This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch RFA] Do nothing in debug_apply_rela_addends for SH


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]