mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 16:09:17 +02:00
* 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:
parent
684bf4fba2
commit
408f459f5a
@ -399,18 +399,12 @@ unit cgx86;
|
|||||||
end;
|
end;
|
||||||
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
|
begin
|
||||||
if cs_create_pic in current_settings.moduleswitches then
|
if cs_create_pic in current_settings.moduleswitches then
|
||||||
begin
|
begin
|
||||||
{ Local data symbols must not be accessed via the GOT on
|
{ Local symbols must not be accessed via the GOT }
|
||||||
darwin/x86_64 under certain circumstances (and do not
|
if (ref.symbol.bind=AB_LOCAL) then
|
||||||
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
|
|
||||||
begin
|
begin
|
||||||
{ unfortunately, RIP-based addresses don't support an index }
|
{ unfortunately, RIP-based addresses don't support an index }
|
||||||
if (ref.base<>NR_NO) or
|
if (ref.base<>NR_NO) or
|
||||||
@ -936,8 +930,7 @@ unit cgx86;
|
|||||||
end
|
end
|
||||||
else if (cs_create_pic in current_settings.moduleswitches)
|
else if (cs_create_pic in current_settings.moduleswitches)
|
||||||
{$ifdef x86_64}
|
{$ifdef x86_64}
|
||||||
and not((ref.symbol.bind=AB_LOCAL) and
|
and not(ref.symbol.bind=AB_LOCAL)
|
||||||
(ref.symbol.typ in [AT_DATA,AT_LABEL,AT_ADDR]))
|
|
||||||
{$endif x86_64}
|
{$endif x86_64}
|
||||||
then
|
then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user