mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-06 16:36:07 +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)
|
new_section(list,sec_user,sym.section,varalign)
|
||||||
else
|
else
|
||||||
new_section(list,sectype,lower(sym.mangledname),varalign);
|
new_section(list,sectype,lower(sym.mangledname),varalign);
|
||||||
if (sym.owner.symtabletype=globalsymtable) or
|
if sym.globalasmsym then
|
||||||
create_smartlink or
|
|
||||||
DLLSource or
|
|
||||||
(assigned(current_procinfo) and
|
|
||||||
(po_inline in current_procinfo.procdef.procoptions)) or
|
|
||||||
(vo_is_public in sym.varoptions) then
|
|
||||||
begin
|
begin
|
||||||
{ on AIX/stabx, we cannot generate debug information that encodes
|
{ on AIX/stabx, we cannot generate debug information that encodes
|
||||||
the address of a global symbol, you need a symbol with the same
|
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))
|
new_section(list,sec_user,sym.section,const_align(sym.vardef.alignment))
|
||||||
else
|
else
|
||||||
new_section(list,cursectype,lower(sym.mangledname),const_align(sym.vardef.alignment));
|
new_section(list,cursectype,lower(sym.mangledname),const_align(sym.vardef.alignment));
|
||||||
if (sym.owner.symtabletype=globalsymtable) or
|
if sym.globalasmsym then
|
||||||
create_smartlink or
|
|
||||||
(assigned(current_procinfo) and
|
|
||||||
(po_inline in current_procinfo.procdef.procoptions)) or
|
|
||||||
DLLSource then
|
|
||||||
begin
|
begin
|
||||||
{ see same code in ncgutil.insertbssdata }
|
{ see same code in ncgutil.insertbssdata }
|
||||||
if (target_dbg.id=dbg_stabx) and
|
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) }
|
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 create(st:tsymtyp;const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);
|
||||||
constructor ppuload(st:tsymtyp;ppufile:tcompilerppufile);
|
constructor ppuload(st:tsymtyp;ppufile:tcompilerppufile);
|
||||||
|
function globalasmsym: boolean;
|
||||||
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||||
procedure buildderef;override;
|
procedure buildderef;override;
|
||||||
procedure deref;override;
|
procedure deref;override;
|
||||||
@ -1551,6 +1552,18 @@ implementation
|
|||||||
ppufile.getderef(defaultconstsymderef);
|
ppufile.getderef(defaultconstsymderef);
|
||||||
end;
|
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;
|
procedure tabstractnormalvarsym.buildderef;
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user