summaryrefslogtreecommitdiff
path: root/compiler/hlcgobj.pas
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2019-07-07 21:33:47 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2019-07-07 21:33:47 +0000
commit22cbc62f43323eb36ba5d8b984b2f8d06aa6b4ae (patch)
tree77b48ebb61184352c3dd4fba3c220f751f6df400 /compiler/hlcgobj.pas
parent4269939f2e4ec7250a692fdb7fc912ba4b7935e1 (diff)
downloadfpc-22cbc62f43323eb36ba5d8b984b2f8d06aa6b4ae.tar.gz
* factored out checks whether a procdef's symbol needs to be global, and
the generation of the procdef's asmsymbols o also removed unnecessary definition of procdef alias symbols for Darwin (they are already defined in ncgutil.alloc_proc_symbol) git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@42341 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/hlcgobj.pas')
-rw-r--r--compiler/hlcgobj.pas12
1 files changed, 1 insertions, 11 deletions
diff --git a/compiler/hlcgobj.pas b/compiler/hlcgobj.pas
index ee1e7ae063..f3d834cc2f 100644
--- a/compiler/hlcgobj.pas
+++ b/compiler/hlcgobj.pas
@@ -4590,14 +4590,7 @@ implementation
begin
item:=TCmdStrListItem(current_procinfo.procdef.aliasnames.first);
firstitem:=item;
- global:=
- (cs_profile in current_settings.moduleswitches) or
- { smart linking using a library requires to promote
- all non-nested procedures to AB_GLOBAL
- otherwise you get undefined symbol error at linking
- for msdos target with -CX option for instance }
- (create_smartlink_library and not is_nested_pd(current_procinfo.procdef)) or
- (po_global in current_procinfo.procdef.procoptions);
+ global:=current_procinfo.procdef.needsglobalasmsym;
while assigned(item) do
begin
{$ifdef arm}
@@ -4614,13 +4607,10 @@ implementation
if global then
begin
list.concat(tai_symbolpair.create(spk_set_global,item.str,firstitem.str));
- { needed for generating the tai_symbol_end }
- current_asmdata.DefineAsmSymbol(item.str,AB_GLOBAL,AT_FUNCTION,current_procinfo.procdef);
end
else
begin
list.concat(tai_symbolpair.create(spk_set,item.str,firstitem.str));
- current_asmdata.DefineAsmSymbol(item.str,AB_PRIVATE_EXTERN,AT_FUNCTION,current_procinfo.procdef);
end;
end
else