* the code generator bugs referred to in r21921 weren't completely fixed yet

after all, although for some reason the problems only showed up with the
    external assembler on x86-64 platforms other than Darwin. Now we never use
    GOT entries on x86-64 anymore for local symbols, regardless of their nature,
    and instead use plain RIP-relative addressing for them.

git-svn-id: trunk@21924 -
This commit is contained in:
Jonas Maebe 2012-07-17 14:36:37 +00:00
parent 684bf4fba2
commit 408f459f5a

View File

@ -399,18 +399,12 @@ unit cgx86;
end;
end;
if assigned(ref.symbol) and not((ref.symbol.bind=AB_LOCAL) and (ref.symbol.typ in [AT_LABEL,AT_FUNCTION])) then
if assigned(ref.symbol) then
begin
if cs_create_pic in current_settings.moduleswitches then
begin
{ Local data symbols must not be accessed via the GOT on
darwin/x86_64 under certain circumstances (and do not
have to be in other cases); however, linux/x86_64 does
require it; don't know about others, so do use GOT for
safety reasons
}
if (ref.symbol.bind=AB_LOCAL) and
(ref.symbol.typ=AT_DATA) then
{ Local symbols must not be accessed via the GOT }
if (ref.symbol.bind=AB_LOCAL) then
begin
{ unfortunately, RIP-based addresses don't support an index }
if (ref.base<>NR_NO) or
@ -936,8 +930,7 @@ unit cgx86;
end
else if (cs_create_pic in current_settings.moduleswitches)
{$ifdef x86_64}
and not((ref.symbol.bind=AB_LOCAL) and
(ref.symbol.typ in [AT_DATA,AT_LABEL,AT_ADDR]))
and not(ref.symbol.bind=AB_LOCAL)
{$endif x86_64}
then
begin