diff --git a/compiler/aasmdef.pas b/compiler/aasmdef.pas index 255de8d204..0bc1eed4a1 100644 --- a/compiler/aasmdef.pas +++ b/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; diff --git a/compiler/pkgutil.pas b/compiler/pkgutil.pas index 3354d940d0..7305321b51 100644 --- a/compiler/pkgutil.pas +++ b/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;