* 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:
Jonas Maebe 2012-08-25 15:12:39 +00:00
parent 35c70a6c96
commit 289486346b
3 changed files with 15 additions and 11 deletions

View File

@ -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

View File

@ -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

View File

@ -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