mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 17:59:27 +02:00
* append rather than insert the alias symbols for the program/procedure
initialisation/finalisation routines o this ensures the procdef's mangled name and its first symbol match, which is required for Darwin when generating debug information and using ".set" directives to define alias symbols, because a symbol defined via ".set" cannot be used in a data relocations (and the DWARF debug generator uses the default mangled name, which used to correspond to the alias symbol due to the "insert" instead of "append") git-svn-id: trunk@42094 -
This commit is contained in:
parent
c330f5080c
commit
8ec3cd6390
@ -728,14 +728,14 @@ implementation
|
||||
mf_init :
|
||||
begin
|
||||
result:=create_main_proc(make_mangledname('',current_module.localsymtable,'init_implicit$'),potype_unitinit,st);
|
||||
result.procdef.aliasnames.insert(make_mangledname('INIT$',current_module.localsymtable,''));
|
||||
result.procdef.aliasnames.concat(make_mangledname('INIT$',current_module.localsymtable,''));
|
||||
end;
|
||||
mf_finalize :
|
||||
begin
|
||||
result:=create_main_proc(make_mangledname('',current_module.localsymtable,'finalize_implicit$'),potype_unitfinalize,st);
|
||||
result.procdef.aliasnames.insert(make_mangledname('FINALIZE$',current_module.localsymtable,''));
|
||||
result.procdef.aliasnames.concat(make_mangledname('FINALIZE$',current_module.localsymtable,''));
|
||||
if (not current_module.is_unit) then
|
||||
result.procdef.aliasnames.insert('PASCALFINALIZE');
|
||||
result.procdef.aliasnames.concat('PASCALFINALIZE');
|
||||
end;
|
||||
else
|
||||
internalerror(200304253);
|
||||
@ -1080,7 +1080,7 @@ type
|
||||
|
||||
{ Compile the unit }
|
||||
init_procinfo:=create_main_proc(make_mangledname('',current_module.localsymtable,'init$'),potype_unitinit,current_module.localsymtable);
|
||||
init_procinfo.procdef.aliasnames.insert(make_mangledname('INIT$',current_module.localsymtable,''));
|
||||
init_procinfo.procdef.aliasnames.concat(make_mangledname('INIT$',current_module.localsymtable,''));
|
||||
init_procinfo.parse_body;
|
||||
{ save file pos for debuginfo }
|
||||
current_module.mainfilepos:=init_procinfo.entrypos;
|
||||
@ -1090,7 +1090,7 @@ type
|
||||
begin
|
||||
{ Compile the finalize }
|
||||
finalize_procinfo:=create_main_proc(make_mangledname('',current_module.localsymtable,'finalize$'),potype_unitfinalize,current_module.localsymtable);
|
||||
finalize_procinfo.procdef.aliasnames.insert(make_mangledname('FINALIZE$',current_module.localsymtable,''));
|
||||
finalize_procinfo.procdef.aliasnames.concat(make_mangledname('FINALIZE$',current_module.localsymtable,''));
|
||||
finalize_procinfo.parse_body;
|
||||
end
|
||||
end;
|
||||
@ -2127,9 +2127,9 @@ type
|
||||
main_procinfo:=create_main_proc(make_mangledname('',current_module.localsymtable,mainaliasname),potype_proginit,current_module.localsymtable);
|
||||
{ Win32 startup code needs a single name }
|
||||
if not(target_info.system in (systems_darwin+systems_aix)) then
|
||||
main_procinfo.procdef.aliasnames.insert('PASCALMAIN')
|
||||
main_procinfo.procdef.aliasnames.concat('PASCALMAIN')
|
||||
else
|
||||
main_procinfo.procdef.aliasnames.insert(target_info.Cprefix+'PASCALMAIN');
|
||||
main_procinfo.procdef.aliasnames.concat(target_info.Cprefix+'PASCALMAIN');
|
||||
|
||||
{ ToDo: systems that use indirect entry info, but check back with Windows! }
|
||||
if target_info.system in systems_darwin then
|
||||
@ -2161,7 +2161,7 @@ type
|
||||
else
|
||||
begin
|
||||
main_procinfo:=create_main_proc(mainaliasname,potype_proginit,current_module.localsymtable);
|
||||
main_procinfo.procdef.aliasnames.insert('PASCALMAIN');
|
||||
main_procinfo.procdef.aliasnames.concat('PASCALMAIN');
|
||||
end;
|
||||
main_procinfo.parse_body;
|
||||
{ save file pos for debuginfo }
|
||||
@ -2173,7 +2173,7 @@ type
|
||||
{ Parse the finalize }
|
||||
finalize_procinfo:=create_main_proc(make_mangledname('',current_module.localsymtable,'finalize$'),potype_unitfinalize,current_module.localsymtable);
|
||||
finalize_procinfo.procdef.aliasnames.insert(make_mangledname('FINALIZE$',current_module.localsymtable,''));
|
||||
finalize_procinfo.procdef.aliasnames.insert('PASCALFINALIZE');
|
||||
finalize_procinfo.procdef.aliasnames.concat('PASCALFINALIZE');
|
||||
finalize_procinfo.parse_body;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user