mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 19:09:31 +08:00
bfd: fix negative GOT offsets for non-local references on sparc64
bfd/ChangeLog: 2016-11-18 James Clarke <jrtc27@jrtc27.com> * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Don't convert R_SPARC_GOTDATA_OP_HIX22 and R_SPARC_GOTDATA_OP_LOX10 to R_SPARC_GOT* for non-local references. Instead, treat them like R_SPARC_GOTDATA_HIX22/R_SPARC_GOTDATA_LOX10 when filling in the immediate with the calculated relocation.
This commit is contained in:

committed by
Jose E. Marchesi

parent
a85db0a618
commit
cc133f9f11
@ -1,3 +1,11 @@
|
|||||||
|
2016-11-18 James Clarke <jrtc27@jrtc27.com>
|
||||||
|
|
||||||
|
* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Don't convert
|
||||||
|
R_SPARC_GOTDATA_OP_HIX22 and R_SPARC_GOTDATA_OP_LOX10 to
|
||||||
|
R_SPARC_GOT* for non-local references. Instead, treat them like
|
||||||
|
R_SPARC_GOTDATA_HIX22/R_SPARC_GOTDATA_LOX10 when filling in the
|
||||||
|
immediate with the calculated relocation.
|
||||||
|
|
||||||
2016-11-18 Nick Clifton <nickc@redhat.com>
|
2016-11-18 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
PR ld/20675
|
PR ld/20675
|
||||||
|
@ -3164,14 +3164,12 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
|
|||||||
case R_SPARC_GOTDATA_OP_HIX22:
|
case R_SPARC_GOTDATA_OP_HIX22:
|
||||||
case R_SPARC_GOTDATA_OP_LOX10:
|
case R_SPARC_GOTDATA_OP_LOX10:
|
||||||
if (SYMBOL_REFERENCES_LOCAL (info, h))
|
if (SYMBOL_REFERENCES_LOCAL (info, h))
|
||||||
r_type = (r_type == R_SPARC_GOTDATA_OP_HIX22
|
{
|
||||||
? R_SPARC_GOTDATA_HIX22
|
r_type = (r_type == R_SPARC_GOTDATA_OP_HIX22
|
||||||
: R_SPARC_GOTDATA_LOX10);
|
? R_SPARC_GOTDATA_HIX22
|
||||||
else
|
: R_SPARC_GOTDATA_LOX10);
|
||||||
r_type = (r_type == R_SPARC_GOTDATA_OP_HIX22
|
howto = _bfd_sparc_elf_howto_table + r_type;
|
||||||
? R_SPARC_GOT22
|
}
|
||||||
: R_SPARC_GOT10);
|
|
||||||
howto = _bfd_sparc_elf_howto_table + r_type;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R_SPARC_GOTDATA_OP:
|
case R_SPARC_GOTDATA_OP:
|
||||||
@ -3193,6 +3191,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
|
|||||||
relocation = gdopoff (info, relocation);
|
relocation = gdopoff (info, relocation);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case R_SPARC_GOTDATA_OP_HIX22:
|
||||||
|
case R_SPARC_GOTDATA_OP_LOX10:
|
||||||
case R_SPARC_GOT10:
|
case R_SPARC_GOT10:
|
||||||
case R_SPARC_GOT13:
|
case R_SPARC_GOT13:
|
||||||
case R_SPARC_GOT22:
|
case R_SPARC_GOT22:
|
||||||
@ -4017,7 +4017,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
|
|||||||
r = bfd_reloc_ok;
|
r = bfd_reloc_ok;
|
||||||
}
|
}
|
||||||
else if (r_type == R_SPARC_HIX22
|
else if (r_type == R_SPARC_HIX22
|
||||||
|| r_type == R_SPARC_GOTDATA_HIX22)
|
|| r_type == R_SPARC_GOTDATA_HIX22
|
||||||
|
|| r_type == R_SPARC_GOTDATA_OP_HIX22)
|
||||||
{
|
{
|
||||||
bfd_vma x;
|
bfd_vma x;
|
||||||
|
|
||||||
@ -4036,7 +4037,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
|
|||||||
relocation);
|
relocation);
|
||||||
}
|
}
|
||||||
else if (r_type == R_SPARC_LOX10
|
else if (r_type == R_SPARC_LOX10
|
||||||
|| r_type == R_SPARC_GOTDATA_LOX10)
|
|| r_type == R_SPARC_GOTDATA_LOX10
|
||||||
|
|| r_type == R_SPARC_GOTDATA_OP_LOX10)
|
||||||
{
|
{
|
||||||
bfd_vma x;
|
bfd_vma x;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user