[patch RFA] Do nothing in debug_apply_rela_addends for SH
Kaz Kojima
kkojima@rr.iij4u.or.jp
Fri Mar 23 12:45:00 GMT 2007
Hi,
PR gas/3811 was caught with the cfi-common-6 test and turned
out an SH specific problem of readelf.
readelf loads the .eh_frame section and fixes the contents
according to rela addends with debug_apply_rela_addends when
the target uses RELA. Although SH uses RELA relocations,
it doesn't use their addend fields and uses in place values.
This makes debug_apply_rela_addends confused. The attached
patch is to fix it. Tested on i686-pc-linux-gnu and sh4-
unknown-linux-gnu with no new regressions.
Regards,
kaz
--
2007-03-23 Kaz Kojima <kkojima@rr.iij4u.or.jp>
PR gas/3811
* readelf.c (debug_apply_rela_addends): Do nothing for SH.
diff -uprN ORIG/src/binutils/readelf.c LOCAL/src/binutils/readelf.c
--- ORIG/src/binutils/readelf.c 2007-03-22 11:58:55.000000000 +0900
+++ LOCAL/src/binutils/readelf.c 2007-03-23 08:07:03.000000000 +0900
@@ -7803,6 +7803,10 @@ debug_apply_rela_addends (void *file,
if (!is_relocatable)
return 1;
+ /* SH uses RELA but uses in place value instead of the addend field. */
+ if (elf_header.e_machine == EM_SH)
+ return 0;
+
for (relsec = section_headers;
relsec < section_headers + elf_header.e_shnum;
++relsec)
More information about the Binutils
mailing list