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]

Re: PATCH for i386: --no-copy-relocs


Some tweaks to H.J.'s fix to stop those R_386_NONE relocs from sneaking
in again.

bfd/ChangeLog
	* elf32-i386.c (allocate_plt_and_got_and_discard_relocs): Discard
	relocs without ELF_LINK_HASH_DEF_DYNAMIC set.
	(elf_i386_relocate_section <R_386_32, R_386_PC32>): Remove
	redundant bfd_link_hash_defined, bfd_link_hash_defweak test.

Index: bfd/elf32-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i386.c,v
retrieving revision 1.33
diff -u -p -r1.33 elf32-i386.c
--- elf32-i386.c	2001/06/24 00:36:47	1.33
+++ elf32-i386.c	2001/06/25 02:20:21
@@ -1193,8 +1193,9 @@ allocate_plt_and_got_and_discard_relocs 
        && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
 	   || info->symbolic))
       || (!info->shared
-	  && ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) != 0
-	      || h->dynindx == -1)))
+	  && (h->dynindx == -1
+	      || (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) != 0
+	      || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0)))
     {
       struct elf_i386_link_hash_entry *eh;
       struct elf_i386_dyn_relocs *c;
@@ -1693,10 +1694,8 @@ elf_i386_relocate_section (output_bfd, i
 		  && h != NULL
 		  && h->dynindx != -1
 		  && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
-		  && ((h->root.type == bfd_link_hash_defined
-		       || h->root.type == bfd_link_hash_defweak)
-		      && (h->elf_link_hash_flags
-			  & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
+		  && (h->elf_link_hash_flags
+		      & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
 	    {
 	      Elf_Internal_Rel outrel;
 	      boolean skip, relocate;


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