aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Stubbs <ams at codesourcery dot com>2010-05-07 16:38:50 +0100
committerMark Hatle <mark.hatle@windriver.com>2010-07-22 19:16:29 -0500
commita624324d76d565493ab1966ef386e2aca174ff0b (patch)
tree7e8e4298c6b3962ee5dadc842df75c4d525b4534
parentd15d629f73725f310b7e386057cbddb8b40bd294 (diff)
downloadprelink-cross-a624324d76d565493ab1966ef386e2aca174ff0b.tar.gz
prelink-cross-a624324d76d565493ab1966ef386e2aca174ff0b.tar.bz2
prelink-cross-a624324d76d565493ab1966ef386e2aca174ff0b.zip
Fix MIPS debug info prelinking
Hi all, Prelink currently fails to relocate the debug info in MIPS libraries because they use a custom section type. Here is an example section from PPC: [29] .debug_frame PROGBITS 00000000 0021b0 00002c 00 0 0 4 The type is "PROGBITS", which is what prelink likes, so it works correctly. Now, here is an example from an equivalent MIPS binary: [28] .debug_frame MIPS_DWARF 00000000 000ee8 00002c 00 0 0 4 Here the type is "MIPS_DWARF", a type not handled by prelink. Please accept the attached patch to fix this. Thanks Andrew 2010-05-06 Andrew Stubbs <ams@codesourcery.com> * src/dso.c (adjust_dso): Support MIPS debug sections. * src/prelink.h (SHT_MIPS_DWARF): New define.
-rw-r--r--trunk/src/dso.c1
-rw-r--r--trunk/src/prelink.h4
2 files changed, 5 insertions, 0 deletions
diff --git a/trunk/src/dso.c b/trunk/src/dso.c
index 8ad93d3..309aeca 100644
--- a/trunk/src/dso.c
+++ b/trunk/src/dso.c
@@ -1389,6 +1389,7 @@ adjust_dso (DSO *dso, GElf_Addr start, GElf_Addr adjust)
switch (dso->shdr[i].sh_type)
{
case SHT_PROGBITS:
+ case SHT_MIPS_DWARF:
name = strptr (dso, dso->ehdr.e_shstrndx, dso->shdr[i].sh_name);
if (strcmp (name, ".stab") == 0
&& adjust_stabs (dso, i, start, adjust))
diff --git a/trunk/src/prelink.h b/trunk/src/prelink.h
index 741f0a4..bdf6879 100644
--- a/trunk/src/prelink.h
+++ b/trunk/src/prelink.h
@@ -101,6 +101,10 @@ typedef uint8_t Elf64_Byte;
#define DT_MIPS_RWPLT 0x70000034
#endif
+#ifndef SHT_MIPS_DWARF
+#define SHT_MIPS_DWARF 0x7000001e
+#endif
+
#ifndef RSS_UNDEF
#define RSS_UNDEF 0
#endif