[-- Attachment #1: Type: text/plain, Size: 580 bytes --]
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
[-- Attachment #2: prelink-mips-debug.patch --]
[-- Type: text/x-diff, Size: 932 bytes --]
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.
Index: src/prelink.h
===================================================================
--- src/prelink.h (revision 184)
+++ src/prelink.h (working copy)
@@ -79,6 +79,10 @@
#define R_MIPS_GLOB_DAT 51
#endif
+#ifndef SHT_MIPS_DWARF
+#define SHT_MIPS_DWARF 0x7000001e
+#endif
+
#ifndef R_ARM_TLS_DTPMOD32
#define R_ARM_TLS_DTPMOD32 17
#define R_ARM_TLS_DTPOFF32 18
Index: src/dso.c
===================================================================
--- src/dso.c (revision 184)
+++ src/dso.c (working copy)
@@ -1381,6 +1381,7 @@
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))