This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB 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]

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


The following reply was made to PR gdb/454; it has been noted by GNATS.

From: Stephane Carrez <stcarrez@nerim.fr>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-gnats@sources.redhat.com, Reva Cuthbertson <reva@cup.hp.com>,
	binutils@sources.redhat.com
Subject: Re: gdb/454: "DW_FORM_strp pointing outside of .debug_str section"
Date: Wed, 23 Oct 2002 00:32:31 +0200

 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
 
 


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