Parcourir la source

* declare various assembler symbols (VMT, RTTI, threadvars) as public assembler symbols
* declare public function alias as public assembler symbols

git-svn-id: trunk@34175 -

svenbarth il y a 9 ans
Parent
commit
bb72c1c4df
4 fichiers modifiés avec 38 ajouts et 2 suppressions
  1. 7 0
      compiler/ncgrtti.pas
  2. 5 1
      compiler/ncgvmt.pas
  3. 1 0
      compiler/ngenutil.pas
  4. 25 1
      compiler/pdecsub.pas

+ 7 - 0
compiler/ncgrtti.pas

@@ -1371,6 +1371,8 @@ implementation
               rttilab,tabledef,sec_rodata,
               rttilab.name,const_align(sizeof(pint))));
             tcb.free;
+
+            current_module.add_public_asmsym(rttilab);
         end;
 
 
@@ -1416,6 +1418,8 @@ implementation
             rttilab,tabledef,sec_rodata,
             rttilab.name,const_align(sizeof(pint))));
           tcb.free;
+
+          current_module.add_public_asmsym(rttilab);
         end;
 
         procedure enumdef_rtti_extrasyms(def:Tenumdef);
@@ -1558,6 +1562,9 @@ implementation
         current_asmdata.AsmLists[al_rtti].concatList(
           tcb.get_final_asmlist(rttilab,rttidef,sec_rodata,rttilab.name,const_align(sizeof(pint))));
         tcb.free;
+
+        current_module.add_public_asmsym(rttilab);
+
         { write additional data }
         write_rtti_extrasyms(def,rt,rttilab);
       end;

+ 5 - 1
compiler/ncgvmt.pas

@@ -1045,6 +1045,7 @@ implementation
          pstringmessagetabledef: tdef;
          vmttypesym: ttypesym;
          vmtdef: tdef;
+         sym : TAsmSymbol;
       begin
 {$ifdef WITHDMT}
          dmtlabel:=gendmt;
@@ -1199,10 +1200,13 @@ implementation
 
          tcb.maybe_end_aggregate(vmtdef);
 
+         sym:=current_asmdata.DefineAsmSymbol(_class.vmt_mangledname,AB_GLOBAL,AT_DATA_FORCEINDIRECT,vmtdef);
+         current_module.add_public_asmsym(sym);
+
          { concatenate the VMT to the asmlist }
          current_asmdata.asmlists[al_globals].concatlist(
            tcb.get_final_asmlist(
-             current_asmdata.DefineAsmSymbol(_class.vmt_mangledname,AB_GLOBAL,AT_DATA_FORCEINDIRECT,vmtdef),
+             sym,
              vmtdef,sec_rodata,_class.vmt_mangledname,const_align(sizeof(pint))
            )
          );

+ 1 - 0
compiler/ngenutil.pas

@@ -1113,6 +1113,7 @@ implementation
            current_asmdata.asmlists[al_globals].concatlist(
              tcb.get_final_asmlist(sym,tabledef,sec_data,s,sizeof(pint)));
            current_module.flags:=current_module.flags or uf_threadvars;
+           current_module.add_public_asmsym(sym);
          end
        else
          s:='';

+ 25 - 1
compiler/pdecsub.pas

@@ -104,6 +104,8 @@ implementation
        globtype,globals,verbose,constexp,
        systems,
        cpuinfo,
+       { assembler }
+       aasmbase,
        { symtable }
        symbase,symcpu,symtable,defutil,defcmp,
        { parameter handling }
@@ -3455,6 +3457,7 @@ const
         paracompopt: tcompare_paras_options;
         forwardfound : boolean;
         symentry: TSymEntry;
+        item : tlinkedlistitem;
       begin
         forwardfound:=false;
 
@@ -3715,7 +3718,19 @@ const
                      it immediately, because then the implementation symbol
                      won't be matched) }
                    if po_compilerproc in fwpd.procoptions then
-                     compilerproc_set_symbol_name(fwpd);
+                     begin
+                       compilerproc_set_symbol_name(fwpd);
+                       current_module.add_public_asmsym(fwpd.procsym.realname,AB_GLOBAL,AT_FUNCTION);
+                     end;
+                   if po_public in fwpd.procoptions then
+                     begin
+                       item:=fwpd.aliasnames.first;
+                       while assigned(item) do
+                         begin
+                           current_module.add_public_asmsym(TCmdStrListItem(item).str,AB_GLOBAL,AT_FUNCTION);
+                           item:=item.next;
+                         end;
+                     end;
 
                    { Release current procdef }
                    currpd.owner.deletedef(currpd);
@@ -3781,6 +3796,15 @@ const
                is_void(currpd.returndef) then
               MessagePos1(currpd.fileinfo,parser_e_no_funcret_specified,currpd.procsym.realname);
             tprocsym(currpd.procsym).ProcdefList.Add(currpd);
+            if not currpd.forwarddef and (po_public in currpd.procoptions) then
+              begin
+                item:=currpd.aliasnames.first;
+                while assigned(item) do
+                  begin
+                    current_module.add_public_asmsym(TCmdStrListItem(item).str,AB_GLOBAL,AT_FUNCTION);
+                    item:=item.next;
+                  end;
+              end;
           end;
 
         proc_add_definition:=forwardfound;