From: Maciej W. Rozycki Date: Mon, 4 Apr 2005 15:07:34 +0000 (+0000) Subject: * readelf.c (debug_apply_rela_addends): Reorder r_info as X-Git-Tag: binutils-2_16~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c9cc00b5edcf48a8d28fe338d6137000f27201b;p=thirdparty%2Fbinutils-gdb.git * readelf.c (debug_apply_rela_addends): Reorder r_info as necessary for 64-bit MIPS. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 95c188e1112..8889c426a2d 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2005-04-04 Maciej W. Rozycki + + * readelf.c (debug_apply_rela_addends): Reorder r_info as + necessary for 64-bit MIPS. + 2005-04-04 Maciej W. Rozycki * doc/binutils.texi (readelf): Remove a duplicate paragraph. diff --git a/binutils/readelf.c b/binutils/readelf.c index 31fd3fa0e92..018728b3a21 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -7329,6 +7329,18 @@ debug_apply_rela_addends (FILE *file, } else { + /* In MIPS little-endian objects, r_info isn't really a + 64-bit little-endian value: it has a 32-bit little-endian + symbol index followed by four individual byte fields. + Reorder INFO accordingly. */ + if (elf_header.e_machine == EM_MIPS + && elf_header.e_ident[EI_DATA] != ELFDATA2MSB) + rp->r_info = (((rp->r_info & 0xffffffff) << 32) + | ((rp->r_info >> 56) & 0xff) + | ((rp->r_info >> 40) & 0xff00) + | ((rp->r_info >> 24) & 0xff0000) + | ((rp->r_info >> 8) & 0xff000000)); + sym = symtab + ELF64_R_SYM (rp->r_info); if (ELF64_R_SYM (rp->r_info) != 0