Bladeren bron

* also add the forced indirect symbols of data symbols to the public assembler symbols
* export the forced indirect symbols of data symbols on systems without indirect imports

git-svn-id: trunk@34313 -

svenbarth 9 jaren geleden
bovenliggende
commit
ad2facb10d
2 gewijzigde bestanden met toevoegingen van 15 en 1 verwijderingen
  1. 4 1
      compiler/aasmdef.pas
  2. 11 0
      compiler/pkgutil.pas

+ 4 - 1
compiler/aasmdef.pas

@@ -42,7 +42,8 @@ implementation
 uses
   globals,cutils,systems,
   aasmtai,aasmcnst,
-  symdef;
+  symdef,
+  fmodule;
 
 
 function TAsmDataDef.DefineAsmSymbolByClass(symclass: TAsmSymbolClass; const s: TSymStr; _bind: TAsmSymBind; _typ: Tasmsymtype; def: tdef): TAsmSymbol;
@@ -73,6 +74,8 @@ function TAsmDataDef.DefineAsmSymbolByClass(symclass: TAsmSymbolClass; const s:
           lower(symind.name),
           const_align(ptrdef.alignment)));
         tcb.free;
+        if _typ=AT_DATA_FORCEINDIRECT then
+          current_module.add_public_asmsym(symind.name,AB_INDIRECT,AT_DATA);
       end;
   end;
 

+ 11 - 0
compiler/pkgutil.pas

@@ -218,6 +218,9 @@ implementation
 
 
   procedure export_unit(u: tmodule);
+    var
+      i : longint;
+      sym : tasmsymbol;
     begin
       u.globalsymtable.symlist.ForEachCall(@insert_export,u.globalsymtable);
       { check localsymtable for exports too to get public symbols }
@@ -235,6 +238,14 @@ implementation
           varexport(ctai_typedconstbuilder.get_vectorized_dead_strip_section_symbol_start('RESSTR',u.localsymtable,[]).name);
           varexport(ctai_typedconstbuilder.get_vectorized_dead_strip_section_symbol_end('RESSTR',u.localsymtable,[]).name);
         end;
+
+      if not (target_info.system in systems_indirect_var_imports) then
+        for i:=0 to u.publicasmsyms.count-1 do
+          begin
+            sym:=tasmsymbol(u.publicasmsyms[i]);
+            if sym.bind=AB_INDIRECT then
+              varexport(sym.name);
+          end;
     end;
 
   Function RewritePPU(const PPUFn:String;OutStream:TCStream):Boolean;