Fix PR 425

Alan Modra amodra@bigpond.net.au
Tue Oct 5 11:11:00 GMT 2004


It's not clear to me why _bfd_link_section_stabs ignores nested B_BINCL
stabs in the code that optimizes header file stabs and thus decides that
the stabs for t1.o and t2.o are the same.  However, we run into the same
problem with R_*_NONE relocs if linking t1.o twice, ie. with
ld -r -o r1.o t1.o t1.o

bfd/
	PR 425
	* syms.c (_bfd_stab_section_find_nearest_line): Ignore R_*_NONE relocs.

Index: bfd/syms.c
===================================================================
RCS file: /cvs/src/src/bfd/syms.c,v
retrieving revision 1.36
diff -u -p -r1.36 syms.c
--- bfd/syms.c	24 Jun 2004 04:46:26 -0000	1.36
+++ bfd/syms.c	5 Oct 2004 10:57:37 -0000
@@ -1016,6 +1016,10 @@ _bfd_stab_section_find_nearest_line (bfd
 	      asymbol *sym;
 
 	      r = *pr;
+	      /* Ignore R_*_NONE relocs.  */
+	      if (r->howto->dst_mask == 0)
+		continue;
+
 	      if (r->howto->rightshift != 0
 		  || r->howto->size != 2
 		  || r->howto->bitsize != 32

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list