From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22039 invoked by alias); 6 Sep 2005 21:28:10 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 21355 invoked by uid 22791); 6 Sep 2005 21:26:37 -0000 Received: from smtp113.sbc.mail.mud.yahoo.com (HELO smtp113.sbc.mail.mud.yahoo.com) (68.142.198.212) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Tue, 06 Sep 2005 21:26:37 +0000 Received: (qmail 14444 invoked from network); 6 Sep 2005 21:26:35 -0000 Received: from unknown (HELO lucon.org) (hjjean@sbcglobal.net@69.232.225.39 with login) by smtp113.sbc.mail.mud.yahoo.com with SMTP; 6 Sep 2005 21:26:35 -0000 Received: by lucon.org (Postfix, from userid 1000) id EDC22640CA; Tue, 6 Sep 2005 14:26:34 -0700 (PDT) Date: Tue, 06 Sep 2005 23:06:00 -0000 From: "H. J. Lu" To: binutils@sources.redhat.com Subject: PATCH: PR ld/1301: ELF ld segfault with -uTLS_symbol Message-ID: <20050906212634.GA25046@lucon.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-SW-Source: 2005-09/txt/msg00075.txt.bz2 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 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;