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:
Jeppe Johansen 2016-01-05 07:23:20 +00:00
parent d4d1fcb634
commit 1b02dd27dc
3 changed files with 8 additions and 2 deletions

View File

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

View File

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

View File

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