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]

[PATCH] Re: ld: orthogonal functionality?


Here is an integration of -Bsymbolic and --allow-shlib-undefined
with diffs against the latest release binutils-2.11.2.
The i386 version has been tested, but not the others.
=====
2001-09-19  John Reiser  <jreiser@BitWagon.com>

	* elf32-i386.c (elf_i386_relocate_section): coordinate info->symbolic
	  and info->allow_shlib_undefined.
	* elf32-hppa.c: likewise
	* elf32-m68k.c: likewise
	* elf32-mips.c: likewise
	* elf32-ppc.c: likewise
	* elf32-sh.c: likewise
	* elf32-sparc.c: likewise

===== binutils-2.11.2/bfd
--- elf32-hppa.c.orig	Mon Jun 11 03:04:10 2001
+++ elf32-hppa.c	Wed Sep 19 08:40:19 2001
@@ -3662,7 +3662,7 @@
 		   && ELF_ST_VISIBILITY (h->elf.other) == STV_DEFAULT
 		   && h->elf.type != STT_PARISC_MILLI)
 	    {
-	      if (info->symbolic)
+	      if (info->symbolic && !info->allow_shlib_undefined)
 		if (!((*info->callbacks->undefined_symbol)
 		      (info, h->elf.root.root.string, input_bfd,
 		       input_section, rel->r_offset, false)))
--- elf32-i386.c.orig	Mon Jun 11 03:04:10 2001
+++ elf32-i386.c	Wed Sep 19 08:35:26 2001
@@ -1465,7 +1465,8 @@
 	    }
 	  else if (h->root.type == bfd_link_hash_undefweak)
 	    relocation = 0;
-	  else if (info->shared && !info->symbolic
+	  else if (info->shared
+                   && (!info->symbolic || info->allow_shlib_undefined)
 		   && !info->no_undefined
 		   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
 	    relocation = 0;
--- elf32-m68k.c.orig	Wed Jun  6 20:08:24 2001
+++ elf32-m68k.c	Wed Sep 19 08:41:54 2001
@@ -1490,7 +1490,8 @@
 	    }
 	  else if (h->root.type == bfd_link_hash_undefweak)
 	    relocation = 0;
-	  else if (info->shared && !info->symbolic
+	  else if (info->shared
+		   && (!info->symbolic || info->allow_shlib_undefined)
 		   && !info->no_undefined
 		   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
 	    relocation = 0;
--- elf32-mips.c.orig	Mon Jun 11 03:04:11 2001
+++ elf32-mips.c	Wed Sep 19 08:53:09 2001
@@ -6136,7 +6136,9 @@
 	   and check to see if they exist by looking at their
 	   addresses.  */
 	symbol = 0;
-      else if (info->shared && !info->symbolic && !info->no_undefined
+      else if (info->shared
+	       && (!info->symbolic || info->allow_shlib_undefined)
+	       && !info->no_undefined
 	       && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
 	symbol = 0;
       else if (strcmp (h->root.root.root.string, "_DYNAMIC_LINK") == 0 ||
--- elf32-ppc.c.orig	Wed Jun  6 20:08:25 2001
+++ elf32-ppc.c	Wed Sep 19 08:53:34 2001
@@ -3102,7 +3102,9 @@
 	    }
 	  else if (h->root.type == bfd_link_hash_undefweak)
 	    relocation = 0;
-	  else if (info->shared && !info->symbolic && !info->no_undefined
+	  else if (info->shared
+		   && (!info->symbolic || info->allow_shlib_undefined)
+		   && !info->no_undefined
 		   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
 	    relocation = 0;
 	  else
--- elf32-sh.c.orig	Wed Jun  6 20:08:25 2001
+++ elf32-sh.c	Wed Sep 19 08:44:16 2001
@@ -3006,7 +3006,9 @@
 	    }
 	  else if (h->root.type == bfd_link_hash_undefweak)
 	    relocation = 0;
-	  else if (info->shared && !info->symbolic && !info->no_undefined)
+	  else if (info->shared
+	       && (!info->symbolic || info->allow_shlib_undefined)
+	       && !info->no_undefined )
 	    relocation = 0;
 	  else
 	    {
--- elf32-sparc.c.orig	Mon Jun 11 03:04:13 2001
+++ elf32-sparc.c	Wed Sep 19 08:44:52 2001
@@ -1241,7 +1241,8 @@
 	    }
 	  else if (h->root.type == bfd_link_hash_undefweak)
 	    relocation = 0;
-	  else if (info->shared && !info->symbolic
+	  else if (info->shared
+		   && (!info->symbolic || info->allow_shlib_undefined)
 		   && !info->no_undefined
 		   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
 	    relocation = 0;
=====

-- 
John Reiser, jreiser@BitWagon.com


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