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: [RFC] unify dynamic_symbol_p implementations


On Fri, Jul 18, 2003 at 07:46:42PM -0700, H. J. Lu wrote:
> On Fri, Jul 18, 2003 at 03:21:50PM -0700, Richard Henderson wrote:
> > On Fri, Jul 18, 2003 at 03:16:12PM -0700, Bob Wilson wrote:
> > > Right.  We always set -fpic for Xtensa/Linux.
> > 
> > Ah, ok.  In which case you shouldn't have any problems.
> > I've already committed the patch (with ia64 fixed), so
> > you should just do the s/0/1/ and update the commentary.
> > 
> 
> I got so many "make check" failures like
> 
> /export/build/linux/binutils-debug/build-i686-linux/ld/ld-new:
> /usr/lib/crt1.o(.text+0x1d): unresolvable relocation against symbol
> `__libc_start_main@@GLIBC_2.0'
> FAIL: bootstrap
> 
> on RedHat 9. Did "make check" work for you on RedHat 9?
> 
> 

I checked in the following patch to fix it.


H.J.
--
2003-07-18  H.J. Lu <hongjiu.lu@intel.com>

	* elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Fix a typo.
	(SYMBOL_CALLS_LOCAL): Likewise.

	* elflink.c (_bfd_elf_dynamic_symbol_p): Return TRUE
	immediately if symbol isn't defined locally.

--- bfd/elf-bfd.h.local	2003-07-18 18:55:11.000000000 -0700
+++ bfd/elf-bfd.h	2003-07-18 21:06:30.000000000 -0700
@@ -212,11 +212,11 @@ struct elf_link_hash_entry
    it's necessary for shared libs to also reference the .plt even
    though the symbol is really local to the shared lib.  */
 #define SYMBOL_REFERENCES_LOCAL(INFO, H) \
-  _bfd_elf_dynamic_symbol_p (H, INFO, 1)
+  !_bfd_elf_dynamic_symbol_p (H, INFO, 1)
 
 /* Will _calls_ to this symbol always call the version in this object?  */
 #define SYMBOL_CALLS_LOCAL(INFO, H) \
-  _bfd_elf_dynamic_symbol_p (H, INFO, 0)
+  !_bfd_elf_dynamic_symbol_p (H, INFO, 0)
 
 /* Records local symbols to be emitted in the dynamic symbol table.  */
 
--- bfd/elflink.c.local	2003-07-18 18:52:24.000000000 -0700
+++ bfd/elflink.c	2003-07-18 21:05:40.000000000 -0700
@@ -2494,6 +2494,10 @@ _bfd_elf_dynamic_symbol_p (h, info, igno
 	 || h->root.type == bfd_link_hash_warning)
     h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
+  /* If it isn't defined locally, then clearly it's dynamic.  */
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+    return TRUE;
+
   /* If it was forced local, then clearly it's not dynamic.  */
   if (h->dynindx == -1)
     return FALSE;
@@ -2526,10 +2530,6 @@ _bfd_elf_dynamic_symbol_p (h, info, igno
       break;
     }
 
-  /* If it isn't defined locally, then clearly it's dynamic.  */
-  if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
-    return TRUE;
-
   /* Otherwise, the symbol is dynamic if binding rules don't tell
      us that it remains local.  */
   return !binding_stays_local_p;


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