mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-03 06:38:22 +02:00
* ELF linker: track relocation style (REL or RELA) of each input section and use it instead of global default on MIPS targets. This fixes internal linking of tests/test/units/system/tres*.pp.
git-svn-id: trunk@29070 -
This commit is contained in:
parent
9fdfe4f474
commit
a4053370fc
@ -207,6 +207,8 @@ implementation
|
|||||||
result:=R_MIPS_NONE;
|
result:=R_MIPS_NONE;
|
||||||
RELOC_ABSOLUTE:
|
RELOC_ABSOLUTE:
|
||||||
result:=R_MIPS_32;
|
result:=R_MIPS_32;
|
||||||
|
RELOC_GOTOFF: {For case jumptables only }
|
||||||
|
result:=R_MIPS_GPREL32;
|
||||||
else
|
else
|
||||||
result:=0;
|
result:=0;
|
||||||
InternalError(2012110602);
|
InternalError(2012110602);
|
||||||
@ -809,7 +811,7 @@ implementation
|
|||||||
else
|
else
|
||||||
reltyp:=objreloc.ftype;
|
reltyp:=objreloc.ftype;
|
||||||
|
|
||||||
if ElfTarget.relocs_use_addend then
|
if (oso_rela_relocs in objsec.SecOptions) then
|
||||||
address:=objreloc.orgsize
|
address:=objreloc.orgsize
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
@ -145,7 +145,9 @@ interface
|
|||||||
{ Contains only strings }
|
{ Contains only strings }
|
||||||
oso_strings,
|
oso_strings,
|
||||||
{ Must be cloned when writing separate debug file }
|
{ Must be cloned when writing separate debug file }
|
||||||
oso_debug_copy
|
oso_debug_copy,
|
||||||
|
{ Has relocations with explicit addends (ELF-specific) }
|
||||||
|
oso_rela_relocs
|
||||||
);
|
);
|
||||||
|
|
||||||
TObjSectionOptions = set of TObjSectionOption;
|
TObjSectionOptions = set of TObjSectionOption;
|
||||||
|
@ -1334,6 +1334,8 @@ implementation
|
|||||||
FReader.Seek(secrec.relocpos);
|
FReader.Seek(secrec.relocpos);
|
||||||
if secrec.sec=nil then
|
if secrec.sec=nil then
|
||||||
InternalError(2012060203);
|
InternalError(2012060203);
|
||||||
|
if (secrec.relentsize=3*sizeof(pint)) then
|
||||||
|
with secrec.sec do SecOptions:=SecOptions+[oso_rela_relocs];
|
||||||
for i:=0 to secrec.relocs-1 do
|
for i:=0 to secrec.relocs-1 do
|
||||||
begin
|
begin
|
||||||
FReader.Read(rel,secrec.relentsize);
|
FReader.Read(rel,secrec.relentsize);
|
||||||
|
Loading…
Reference in New Issue
Block a user