gdb/454: "DW_FORM_strp pointing outside of .debug_str section"

Stephane Carrez stcarrez@nerim.fr
Tue Oct 22 13:32:00 GMT 2002


Hi Daniel,

I just saw this PR in gdb's database.  I had a similar problem for 68HC11 and I found
the reason.  I suspect this may be the same problem for ia64.

My problem was in the assembler where the BFD_RELOC_32 to the .debug_str labels
are turned into relocs against the section.  This is very bad because the .debug_str
section is marked with M/SEC_MERGE and strings can be removed.

In the HC11 assembler, I fixed tc_fix_adjustable() to avoid that and it fixed completely
the problem (indeed, the objdump shows the relocs against the local labels in .debug_str).

I had a closer look at adjust_reloc_syms() and it seems that the
SEC_MERGE sections are handled as follows:

	/* Never adjust a reloc against local symbol in a merge section
	   with non-zero addend.  */
	if ((symsec->flags & SEC_MERGE) != 0 && fixp->fx_offset != 0)
	  continue;

But in my case, the fx_offset was 0, and thus was not taken into account.

As far as I'm concerned, I can leave with tc_fix_adjustable() to handle this.
But I'm wondering if we should remove the fx_offset test to solve the problem
in a generic way.

	Stephane

Ps:  Before fix:

RELOCATION RECORDS FOR [.debug_info]:
...
00000014 R_M68HC11_32      .debug_str
00000018 R_M68HC11_32      .debug_str
0000001c R_M68HC11_32      .debug_str

      After fix:

RELOCATION RECORDS FOR [.debug_info]:
...
00000014 R_M68HC11_32      .LC6
00000018 R_M68HC11_32      .LC7
0000001c R_M68HC11_32      .LC8


-----------------------------------------------------------------------
         Home                               Office
E-mail: stcarrez@nerim.fr                  Stephane.Carrez@solsoft.fr
WWW:    http://stcarrez.nerim.net          http://www.solsoft.com
         Free the Software!                 Visual Security Policy Management




More information about the Binutils mailing list