mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-04 19:18:35 +02:00
* factored out code to decide when an asmsym for a staticvarsym has to be
global, and no longer make it global for all symbols when smartlinking is enabled on systems that use section-based smartlinking git-svn-id: trunk@22241 -
This commit is contained in:
parent
35c70a6c96
commit
289486346b
@ -499,12 +499,7 @@ implementation
|
||||
new_section(list,sec_user,sym.section,varalign)
|
||||
else
|
||||
new_section(list,sectype,lower(sym.mangledname),varalign);
|
||||
if (sym.owner.symtabletype=globalsymtable) or
|
||||
create_smartlink or
|
||||
DLLSource or
|
||||
(assigned(current_procinfo) and
|
||||
(po_inline in current_procinfo.procdef.procoptions)) or
|
||||
(vo_is_public in sym.varoptions) then
|
||||
if sym.globalasmsym then
|
||||
begin
|
||||
{ on AIX/stabx, we cannot generate debug information that encodes
|
||||
the address of a global symbol, you need a symbol with the same
|
||||
|
@ -137,11 +137,7 @@ implementation
|
||||
new_section(list,sec_user,sym.section,const_align(sym.vardef.alignment))
|
||||
else
|
||||
new_section(list,cursectype,lower(sym.mangledname),const_align(sym.vardef.alignment));
|
||||
if (sym.owner.symtabletype=globalsymtable) or
|
||||
create_smartlink or
|
||||
(assigned(current_procinfo) and
|
||||
(po_inline in current_procinfo.procdef.procoptions)) or
|
||||
DLLSource then
|
||||
if sym.globalasmsym then
|
||||
begin
|
||||
{ see same code in ncgutil.insertbssdata }
|
||||
if (target_dbg.id=dbg_stabx) and
|
||||
|
@ -191,6 +191,7 @@ interface
|
||||
inparentfpstruct : boolean; { migrated to a parentfpstruct because of nested access (not written to ppu, because not important and would change interface crc) }
|
||||
constructor create(st:tsymtyp;const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);
|
||||
constructor ppuload(st:tsymtyp;ppufile:tcompilerppufile);
|
||||
function globalasmsym: boolean;
|
||||
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||
procedure buildderef;override;
|
||||
procedure deref;override;
|
||||
@ -1551,6 +1552,18 @@ implementation
|
||||
ppufile.getderef(defaultconstsymderef);
|
||||
end;
|
||||
|
||||
function tabstractnormalvarsym.globalasmsym: boolean;
|
||||
begin
|
||||
result:=
|
||||
(owner.symtabletype=globalsymtable) or
|
||||
(create_smartlink and
|
||||
not(tf_smartlink_sections in target_info.flags)) or
|
||||
DLLSource or
|
||||
(assigned(current_procinfo) and
|
||||
(po_inline in current_procinfo.procdef.procoptions)) or
|
||||
(vo_is_public in varoptions);
|
||||
end;
|
||||
|
||||
|
||||
procedure tabstractnormalvarsym.buildderef;
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user