public inbox for prelink@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix MIPS debug info prelinking
@ 2010-05-07 15:39 Andrew Stubbs
  2010-05-17  7:53 ` Andrew Stubbs
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Stubbs @ 2010-05-07 15:39 UTC (permalink / raw)
  To: prelink

[-- 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))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix MIPS debug info prelinking
  2010-05-07 15:39 [PATCH] Fix MIPS debug info prelinking Andrew Stubbs
@ 2010-05-17  7:53 ` Andrew Stubbs
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Stubbs @ 2010-05-17  7:53 UTC (permalink / raw)
  To: prelink

Ping?

On 07/05/10 16:38, Andrew Stubbs wrote:
> 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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-17  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-07 15:39 [PATCH] Fix MIPS debug info prelinking Andrew Stubbs
2010-05-17  7:53 ` Andrew Stubbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).