mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 11:10:33 +02:00
* x86 AT&T writer: never ever drop "@GOTPCREL" relocation, because it results in corrupted code (at least, "mov foo@GOTPCREL(%rip),%reg" must change to "lea foo(%rip),%reg" to remain equivalent, but this must be handled elsewhere anyway. Assembler writer should just write generated code as is).
* Added internal errors on some impossible types of references. git-svn-id: trunk@29506 -
This commit is contained in:
parent
26cd3dc58a
commit
d24382e8f8
@ -163,18 +163,19 @@ interface
|
||||
if assigned(relsymbol) then
|
||||
owner.AsmWrite('-'+relsymbol.name);
|
||||
if ref.refaddr=addr_pic then
|
||||
{$ifdef x86_64}
|
||||
begin
|
||||
{ local symbols don't have to (and in case of Mac OS X: cannot)
|
||||
be accessed via the GOT
|
||||
}
|
||||
if not assigned(ref.symbol) or
|
||||
(ref.symbol.bind<>AB_LOCAL) then
|
||||
owner.AsmWrite('@GOTPCREL');
|
||||
end;
|
||||
{ @GOT and @GOTPCREL references are only allowed for symbol alone,
|
||||
indexing, relsymbol or offset cannot be present. }
|
||||
if assigned(relsymbol) or (offset<>0) or (index<>NR_NO) then
|
||||
InternalError(2015011801);
|
||||
{$ifdef x86_64}
|
||||
if (base<>NR_RIP) then
|
||||
InternalError(2015011802);
|
||||
owner.AsmWrite('@GOTPCREL');
|
||||
{$else x86_64}
|
||||
owner.AsmWrite('@GOT');
|
||||
owner.AsmWrite('@GOT');
|
||||
{$endif x86_64}
|
||||
end;
|
||||
if offset<0 then
|
||||
owner.AsmWrite(tostr(offset))
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user