This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: gdb/454: "DW_FORM_strp pointing outside of .debug_str section"
- From: Stephane Carrez <stcarrez at nerim dot fr>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: gdb-gnats at sources dot redhat dot com, Reva Cuthbertson <reva at cup dot hp dot com>,binutils at sources dot redhat dot com
- Date: Wed, 23 Oct 2002 00:32:31 +0200
- Subject: Re: gdb/454: "DW_FORM_strp pointing outside of .debug_str section"
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