public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: PR ld/1301: ELF ld segfault with -uTLS_symbol
@ 2005-09-06 23:06 H. J. Lu
  2005-09-07  8:37 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: H. J. Lu @ 2005-09-06 23:06 UTC (permalink / raw)
  To: binutils

The ELF ld segfaults with -ufoo, where foo is a TLS definition. This
patch skip the TLS check when the undefined symbol is introduced by
"ld -u".


H.J.
----
2005-09-06  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/1301
	* elflink.c (_bfd_elf_merge_symbol): Don't check undefined
	symbol introduced by "ld -u" for TLS.

--- bfd/elflink.c.tls	2005-09-02 06:59:00.000000000 -0700
+++ bfd/elflink.c	2005-09-06 14:20:41.000000000 -0700
@@ -920,9 +920,11 @@ _bfd_elf_merge_symbol (bfd *abfd,
   else
     olddef = TRUE;
 
-  /* Check TLS symbol.  */
+  /* Check TLS symbol.  We don't check undefined symbol introduced by
+     "ld -u".  */
   if ((ELF_ST_TYPE (sym->st_info) == STT_TLS || h->type == STT_TLS)
-      && ELF_ST_TYPE (sym->st_info) != h->type)
+      && ELF_ST_TYPE (sym->st_info) != h->type
+      && oldbfd != NULL)
     {
       bfd *ntbfd, *tbfd;
       bfd_boolean ntdef, tdef;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: PR ld/1301: ELF ld segfault with -uTLS_symbol
  2005-09-06 23:06 PATCH: PR ld/1301: ELF ld segfault with -uTLS_symbol H. J. Lu
@ 2005-09-07  8:37 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2005-09-07  8:37 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Tue, Sep 06, 2005 at 02:26:34PM -0700, H. J. Lu wrote:
> 	PR ld/1301
> 	* elflink.c (_bfd_elf_merge_symbol): Don't check undefined
> 	symbol introduced by "ld -u" for TLS.

Looks good to me.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-09-07  3:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-06 23:06 PATCH: PR ld/1301: ELF ld segfault with -uTLS_symbol H. J. Lu
2005-09-07  8:37 ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).