This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] restore NOSTRIP for .debug_frame on mips-irix


Hello,

GCC used to set NOSTRIP bit on .debug_frame and doesn't any more.

This is causing troubles when using the libexc system library e.g.
for frame unwinding purposes, because it expects a single .debug_frame
per executable, the section has NOSTRIP set in system objects and the
native linker doesn't merge those having the bit set together with
those not having it.

Typically, for

   << /* t.c */
      #include <libexc.h>

      int main (void)
      {
	trace_back_stack_and_print ();
	return 0;
      }
   >>

We see

   $ gcc -o t t.c -lexc

   $ elfdump -hv t | grep -A 1 debug_frame
   [37]   SHT_MIPS_DWARF      0          0x9bc0     0x4b0       .debug_frame
	  0          0        0x4        0          0x00000000
   --
   [39]   SHT_MIPS_DWARF      0          0xa5a6     0xa4        .debug_frame
	  0          0        0x1        0          0x08000000 NOSTRIP

   $ ./t
   libexc(158601884): FATAL ERROR update_obj_info: dwarf_elf_init failed
   for ./t -- (107) DW_DLE_DEBUG_FRAME_DUPLICATE  Only one .debug_frame
   section is allowed

The attached patch addresses this by overriding the default elf
asm_named_section implementation on irix for ".debug_frame" only, to
special case it in a similar fashion as before.

Proper behavior with GNU as requires a change there as well to
propagate the flags down into the object, but this is a separate
issue.

Bootstrapped and regression tested for languages=c,c++,ada on
mips-sgi-irix6.5.

Thanks in advance,

Olivier

2007-10-08  Olivier Hainque  <hainque@adacore.com>

	* config/mips/mips.c (irix_asm_named_section): New function.
	Handle .debug_frame specially and fallback to the default elf
	support otherwise.
	* config/mips/iris.h (TARGET_ASM_NAMED_SECTION): Define.



Attachment: mips-debug_frame_flags.dif
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]