This is the mail archive of the binutils@sources.redhat.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]
Other format: [Raw text]

Re: Linux/ppc failure


See the thread starting with
http://sources.redhat.com/ml/binutils/2002-09/msg00554.html

The more I think about it, the more I'm inclined to agree with
rth that we ought not special case !SEC_ALLOC relocs.  ie. do
something like the following (totally untested!) for x86, and
similarly for other targets.

Index: bfd/elf32-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i386.c,v
retrieving revision 1.86
diff -u -p -r1.86 elf32-i386.c
--- bfd/elf32-i386.c	1 Oct 2002 10:43:36 -0000	1.86
+++ bfd/elf32-i386.c	3 Oct 2002 02:55:23 -0000
@@ -1099,7 +1099,6 @@ elf_i386_check_relocs (abfd, info, sec, 
 	     dynamic library if we manage to avoid copy relocs for the
 	     symbol.  */
 	  if ((info->shared
-	       && (sec->flags & SEC_ALLOC) != 0
 	       && (r_type != R_386_PC32
 		   || (h != NULL
 		       && (! info->symbolic
@@ -1107,7 +1106,6 @@ elf_i386_check_relocs (abfd, info, sec, 
 			   || (h->elf_link_hash_flags
 			       & ELF_LINK_HASH_DEF_REGULAR) == 0))))
 	      || (!info->shared
-		  && (sec->flags & SEC_ALLOC) != 0
 		  && h != NULL
 		  && (h->root.type == bfd_link_hash_defweak
 		      || (h->elf_link_hash_flags
@@ -2414,8 +2412,7 @@ elf_i386_relocate_section (output_bfd, i
 	  /* r_symndx will be zero only for relocs against symbols
 	     from removed linkonce sections, or sections discarded by
 	     a linker script.  */
-	  if (r_symndx == 0
-	      || (input_section->flags & SEC_ALLOC) == 0)
+	  if (r_symndx == 0)
 	    break;
 
 	  if ((info->shared
@@ -2976,12 +2973,7 @@ elf_i386_relocate_section (output_bfd, i
 	  break;
 	}
 
-      /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
-	 because such sections are not SEC_ALLOC and thus ld.so will
-	 not process them.  */
-      if (unresolved_reloc
-	  && !((input_section->flags & SEC_DEBUGGING) != 0
-	       && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
+      if (unresolved_reloc)
 	{
 	  (*_bfd_error_handler)
 	    (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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