mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 19:59:18 +02:00
Fixed issue with COFF linker. The addend wasn't shifted up by four before being added.
git-svn-id: trunk@30405 -
This commit is contained in:
parent
1a3bd5fde1
commit
7f34ab27d2
@ -915,7 +915,7 @@ const pemagic : array[0..3] of byte = (
|
|||||||
{$ifdef arm}
|
{$ifdef arm}
|
||||||
RELOC_RELATIVE_24:
|
RELOC_RELATIVE_24:
|
||||||
begin
|
begin
|
||||||
addend:=sarlongint(((address and $ffffff) shl 8),8);
|
addend:=sarlongint(((address and $ffffff) shl 8),6); // Sign-extend while shifting left twice
|
||||||
relocval:=longint(relocval - objsec.mempos - objreloc.dataoffset + addend) shr 2;
|
relocval:=longint(relocval - objsec.mempos - objreloc.dataoffset + addend) shr 2;
|
||||||
address:=(address and $ff000000) or (relocval and $ffffff);
|
address:=(address and $ff000000) or (relocval and $ffffff);
|
||||||
relocval:=relocval shr 24;
|
relocval:=relocval shr 24;
|
||||||
@ -924,7 +924,7 @@ const pemagic : array[0..3] of byte = (
|
|||||||
end;
|
end;
|
||||||
RELOC_RELATIVE_24_THUMB:
|
RELOC_RELATIVE_24_THUMB:
|
||||||
begin
|
begin
|
||||||
addend:=sarlongint(((address and $ffffff) shl 8),8);
|
addend:=sarlongint(((address and $ffffff) shl 8),6); // Sign-extend while shifting left twice, the assembler never sets the H bit
|
||||||
relocval:=longint(relocval - objsec.mempos - objreloc.dataoffset + addend) shr 1;
|
relocval:=longint(relocval - objsec.mempos - objreloc.dataoffset + addend) shr 1;
|
||||||
address:=(address and $ff000000) or ((relocval shr 1) and $ffffff) or ((relocval and 1) shl 24);
|
address:=(address and $ff000000) or ((relocval shr 1) and $ffffff) or ((relocval and 1) shl 24);
|
||||||
relocval:=relocval shr 25;
|
relocval:=relocval shr 25;
|
||||||
|
Loading…
Reference in New Issue
Block a user