|
@@ -1348,10 +1348,18 @@ implementation
|
|
|
item := TCmdStrListItem(pd.aliasnames.first);
|
|
|
while assigned(item) do
|
|
|
begin
|
|
|
- current_asmdata.DefineAsmSymbol(item.str,AB_GLOBAL,AT_FUNCTION);
|
|
|
- item := TCmdStrListItem(item.next);
|
|
|
- end;
|
|
|
- end;
|
|
|
+ { The condition to use global or local symbol must match
|
|
|
+ the code written in hlcg.gen_proc_symbol to
|
|
|
+ avoid change from AB_LOCAL to AB_GLOBAL, which generates
|
|
|
+ erroneous code (at least for targets using GOT) }
|
|
|
+ if (cs_profile in current_settings.moduleswitches) or
|
|
|
+ (po_global in current_procinfo.procdef.procoptions) then
|
|
|
+ current_asmdata.DefineAsmSymbol(item.str,AB_GLOBAL,AT_FUNCTION)
|
|
|
+ else
|
|
|
+ current_asmdata.DefineAsmSymbol(item.str,AB_LOCAL,AT_FUNCTION);
|
|
|
+ item := TCmdStrListItem(item.next);
|
|
|
+ end;
|
|
|
+ end;
|
|
|
|
|
|
|
|
|
procedure gen_proc_entry_code(list:TAsmList);
|