This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


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

Re: [marco.gidde@gatekeeper.pcc.de: wrong line numbers when debugging shared libraries]


On Thu, Apr 06, 2000 at 05:20:45PM +1000, Alan Modra wrote:
> On 5 Apr 2000, Ian Lance Taylor wrote:
> 
> >    Date: Wed, 5 Apr 2000 07:51:20 -0700
> >    From: "H . J . Lu" <hjl@lucon.org>
> > 
> >    It seems that "nm -l" doesn't work on shared libraries. But gdb is ok. 
> >    Any ideas?
> > 
> > I think it is this old patch again:
> > 
> > 1998-12-10  Richard Henderson  <rth@cygnus.com>
> 
> Good guess.  Reverting the patch fixes the "nm -l" problem.  Now it's just
> a matter of fixing the dwarf problem another way...
> 

This is the patch I sent to Ian and Richard.



H.J.
----
2000-04-05  H.J. Lu  <hjl@gnu.org>

	*elf32-i386.c (elf_i386_relocate_section): Don't fail 
	relocations in debug sections for symbol defined externally
	in shared libraries.

Index: elf32-i386.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-i386.c,v
retrieving revision 1.8
diff -u -p -r1.8 elf32-i386.c
--- elf32-i386.c	2000/03/12 17:40:13	1.8
+++ elf32-i386.c	2000/04/05 23:58:37
@@ -1291,7 +1291,10 @@ elf_i386_relocate_section (output_bfd, i
 			     sections against symbols defined externally
 			     in shared libraries.  We can't do anything
 			     with them here.  */
-			  || (input_section->flags & SEC_DEBUGGING) != 0)))
+			  || ((h->elf_link_hash_flags
+			       & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+			      && (input_section->flags
+				  & SEC_DEBUGGING) != 0))))
 		{
 		  /* In these cases, we don't need the relocation
                      value.  We check specially because in some

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