aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2020-04-19 19:04:41 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2020-04-22 18:46:45 -0700
commit30ce8e47fad9b057b6d7af9e1d43061126d34d20 (patch)
treef1c9ab86407f5a80c78bdf436f2178d2aacc96dd /binutils
parente44f65e3c5c9473d0dd98efa8c142d361b1273d7 (diff)
downloadgdb-30ce8e47fad9b057b6d7af9e1d43061126d34d20.zip
gdb-30ce8e47fad9b057b6d7af9e1d43061126d34d20.tar.gz
gdb-30ce8e47fad9b057b6d7af9e1d43061126d34d20.tar.bz2
xtensa: fix PR ld/25861
Introduce new relaxations XTENSA_PDIFF{8,16,32} for positive differences (subtracted symbol precedes diminished symbol) and XTENSA_NDIFF{8,16,32} for negative differences (subtracted symbol follows diminished symbol). Don't generate XTENSA_DIFF relocations in the assembler, generate XTENSA_PDIFF or XTENSA_NDIFF based on relative symbol position. Handle XTENSA_DIFF in BFD for compatibility with old object files. Handle XTENSA_PDIFF and XTENSA_NDIFF in BFD, treating difference value as unsigned. 2020-04-22 Max Filippov <jcmvbkbc@gmail.com> bfd/ * bfd-in2.h: Regenerated. * elf32-xtensa.c (elf_howto_table): New entries for R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}. (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc) (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}. * libbfd.h (bfd_reloc_code_real_names): Add names for BFD_RELOC_XTENSA_PDIFF{8,16,32} and BFD_RELOC_XTENSA_NDIFF{8,16,32}. * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32} and BFD_RELOC_XTENSA_NDIFF{8,16,32}. binutils/ * readelf.c (is_none_reloc): Recognize BFD_RELOC_XTENSA_PDIFF{8,16,32} and BFD_RELOC_XTENSA_NDIFF{8,16,32}. gas/ * config/tc-xtensa.c (md_apply_fix): Replace BFD_RELOC_XTENSA_DIFF{8,16,32} generation with BFD_RELOC_XTENSA_PDIFF{8,16,32} and BFD_RELOC_XTENSA_NDIFF{8,16,32} generation. * testsuite/gas/xtensa/loc.d: Replace BFD_RELOC_XTENSA_DIFF16 with BFD_RELOC_XTENSA_PDIFF16 in the expected output. include/ * elf/xtensa.h (elf_xtensa_reloc_type): New entries for R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}. ld/ * testsuite/ld-xtensa/relax-loc.d: New test definition. * testsuite/ld-xtensa/relax-loc.s: New test source. * testsuite/ld-xtensa/xtensa.exp (relax-loc): New test.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog7
-rw-r--r--binutils/readelf.c8
2 files changed, 14 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 3b9729a..0762611 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,10 @@
+2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
+
+ PR ld/25861
+ * readelf.c (is_none_reloc): Recognize
+ BFD_RELOC_XTENSA_PDIFF{8,16,32} and
+ BFD_RELOC_XTENSA_NDIFF{8,16,32}.
+
2020-04-22 Nick Clifton <nickc@redhat.com>
* MAINTAINERS: Remove Chris Faylor as the ix86 PE maintainer.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 3253863..4f80bd9 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -13348,7 +13348,13 @@ is_none_reloc (Filedata * filedata, unsigned int reloc_type)
return (reloc_type == 0 /* R_XTENSA_NONE. */
|| reloc_type == 17 /* R_XTENSA_DIFF8. */
|| reloc_type == 18 /* R_XTENSA_DIFF16. */
- || reloc_type == 19 /* R_XTENSA_DIFF32. */);
+ || reloc_type == 19 /* R_XTENSA_DIFF32. */
+ || reloc_type == 57 /* R_XTENSA_PDIFF8. */
+ || reloc_type == 58 /* R_XTENSA_PDIFF16. */
+ || reloc_type == 59 /* R_XTENSA_PDIFF32. */
+ || reloc_type == 60 /* R_XTENSA_NDIFF8. */
+ || reloc_type == 61 /* R_XTENSA_NDIFF16. */
+ || reloc_type == 62 /* R_XTENSA_NDIFF32. */);
}
return FALSE;
}