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]


   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>

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

I suspect that patch is a bad idea, and I didn't want it put in the
first place.  However, I have never found the time to do the research
necessary to definitely convince myself one way or another.  It's a
hard issue to decide.

Ian

Index: elf32-i386.c
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf32-i386.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- elf32-i386.c	1998/12/01 20:50:17	1.83
+++ elf32-i386.c	1998/12/10 22:47:25	1.84
@@ -1276,7 +1289,12 @@
 			      & ELF_LINK_HASH_DEF_REGULAR) == 0)
 		      && (r_type == R_386_32
 			  || r_type == R_386_PC32)
-		      && (input_section->flags & SEC_ALLOC) != 0))
+		      && ((input_section->flags & SEC_ALLOC) != 0
+			  /* DWARF will emit R_386_32 relocations in its
+			     sections against symbols defined externally
+			     in shared libraries.  We can't do anything
+			     with them here.  */
+			  || (input_section->flags & SEC_DEBUGGING) != 0)))
 		{
 		  /* In these cases, we don't need the relocation
                      value.  We check specially because in some
@@ -1530,10 +1556,7 @@
 	      else if (r_type == R_386_PC32)
 		{
 		  BFD_ASSERT (h != NULL && h->dynindx != -1);
-		  if ((input_section->flags & SEC_ALLOC) != 0)
-		    relocate = false;
-		  else
-		    relocate = true;
+		  relocate = false;
 		  outrel.r_info = ELF32_R_INFO (h->dynindx, R_386_PC32);
 		}
 	      else
@@ -1551,10 +1574,7 @@
 		  else
 		    {
 		      BFD_ASSERT (h->dynindx != -1);
-		      if ((input_section->flags & SEC_ALLOC) != 0)
-			relocate = false;
-		      else
-			relocate = true;
+		      relocate = false;
 		      outrel.r_info = ELF32_R_INFO (h->dynindx, R_386_32);
 		    }
 		}

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