aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2005-04-04 15:07:18 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2005-04-04 15:07:18 +0000
commita8b683fc5efb2ef11220166b48bf5b64334be44d (patch)
tree54d9cc11798fbd2574a06190f86b7a354f15501c /binutils
parent470e4bd1c2fb2431add30b00ecbf669ffa3e1932 (diff)
downloadgdb-a8b683fc5efb2ef11220166b48bf5b64334be44d.zip
gdb-a8b683fc5efb2ef11220166b48bf5b64334be44d.tar.gz
gdb-a8b683fc5efb2ef11220166b48bf5b64334be44d.tar.bz2
* readelf.c (debug_apply_rela_addends): Reorder r_info as
necessary for 64-bit MIPS.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/readelf.c12
2 files changed, 17 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 54b6a43..7d47fad 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,10 @@
2005-04-04 Maciej W. Rozycki <macro@linux-mips.org>
+ * readelf.c (debug_apply_rela_addends): Reorder r_info as
+ necessary for 64-bit MIPS.
+
+2005-04-04 Maciej W. Rozycki <macro@linux-mips.org>
+
* doc/binutils.texi (readelf): Remove a duplicate paragraph.
2005-04-04 Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
diff --git a/binutils/readelf.c b/binutils/readelf.c
index d7bdf3e..fe4c815 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -7395,6 +7395,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