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]

PATCH: PR ld/975: [Regression]: ld -pie generates DT_TEXTREL


On Fri, May 27, 2005 at 04:09:00PM -0700, H. J. Lu wrote:
> This is caused by not defining array bonds in elf.sc. The problem
> is when bfd_elf_size_dynamic_sections is called by
> gld${EMULATION_NAME}_before_allocation. Those symbols are undefined.
> As the result, bfd_elf_size_dynamic_sections will allocate
> dynamic relocations for them, which leads to extra R_X86_64_NONE and
> DT_TEXTREL on x86-64. On ia64, we got some R_IA64_REL64LSB instead of
> R_IA64_NONE.
> 

This fixed PR 975. I will look into ia64 later. BTW, gcc needs the fix
for:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20218


H.J.
----
2005-05-27  H.J. Lu  <hongjiu.lu@intel.com>

	PR 975
	* elflink.c (_bfd_elf_symbol_refs_local_p): Only undefined
	symbol with default visibility is local.

--- bfd/elflink.c.vsb	2005-05-19 10:38:30.000000000 -0700
+++ bfd/elflink.c	2005-05-27 17:03:01.000000000 -0700
@@ -2572,8 +2572,10 @@ _bfd_elf_symbol_refs_local_p (struct elf
   if (ELF_COMMON_DEF_P (h))
     /* Do nothing.  */;
   /* If we don't have a definition in a regular file, then we can't
-     resolve locally.  The sym is either undefined or dynamic.  */
-  else if (!h->def_regular)
+     resolve locally unless it has non-default visibility .  The sym
+     is either undefined or dynamic.  */
+  else if (!h->def_regular
+	   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
     return FALSE;
 
   /* Forced local symbols resolve locally.  */


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