This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: PR ld/1301: ELF ld segfault with -uTLS_symbol
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Tue, 6 Sep 2005 14:26:34 -0700
- Subject: PATCH: PR ld/1301: ELF ld segfault with -uTLS_symbol
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;