mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 11:29:27 +02:00
Make relocation type more precise compared to output of gas.
Change and to or in case symbol in other section is not exported. git-svn-id: trunk@32852 -
This commit is contained in:
parent
d4d1fcb634
commit
1b02dd27dc
@ -2974,9 +2974,12 @@ implementation
|
||||
else
|
||||
begin
|
||||
currsym:=objdata.symbolref(oper[0]^.ref^.symbol);
|
||||
if (currsym.bind<>AB_LOCAL) and (currsym.objsection<>objdata.CurrObjSec) then
|
||||
if (currsym.bind<>AB_LOCAL) or (currsym.objsection<>objdata.CurrObjSec) then
|
||||
begin
|
||||
objdata.writereloc(oper[0]^.ref^.offset,0,currsym,RELOC_RELATIVE_24);
|
||||
if (opcode<>A_BL) or (condition<>C_None) then
|
||||
objdata.writereloc(oper[0]^.ref^.offset,0,currsym,RELOC_RELATIVE_24)
|
||||
else
|
||||
objdata.writereloc(oper[0]^.ref^.offset,0,currsym,RELOC_RELATIVE_CALL);
|
||||
bytes:=bytes or $fffffe; // TODO: Not sure this is right, but it matches the output of gas
|
||||
end
|
||||
else
|
||||
|
@ -327,6 +327,8 @@ implementation
|
||||
result:=R_ARM_REL32;
|
||||
RELOC_RELATIVE_24:
|
||||
result:=R_ARM_JUMP24;
|
||||
RELOC_RELATIVE_CALL:
|
||||
result:=R_ARM_CALL;
|
||||
RELOC_RELATIVE_24_THUMB:
|
||||
result:=R_ARM_CALL;
|
||||
RELOC_RELATIVE_CALL_THUMB:
|
||||
|
@ -80,6 +80,7 @@ interface
|
||||
{$endif i8086}
|
||||
{$ifdef arm}
|
||||
RELOC_RELATIVE_24,
|
||||
RELOC_RELATIVE_CALL,
|
||||
RELOC_RELATIVE_24_THUMB,
|
||||
RELOC_RELATIVE_CALL_THUMB,
|
||||
RELOC_GOT32,
|
||||
|
Loading…
Reference in New Issue
Block a user