From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20002 invoked by alias); 2 Sep 2012 22:57:30 -0000 Received: (qmail 19992 invoked by uid 22791); 2 Sep 2012 22:57:29 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KAM_STOCKTIP,KHOP_THREADED,TW_FN X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 02 Sep 2012 22:57:15 +0000 From: "hjl.tools at gmail dot com" To: glibc-bugs@sources.redhat.com Subject: [Bug dynamic-link/14370] SIGFPE in 'ldd -r' Date: Sun, 02 Sep 2012 22:57:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2012-09/txt/msg00012.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=14370 H.J. Lu changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |NEW --- Comment #9 from H.J. Lu 2012-09-02 22:57:15 UTC --- We can add check like: diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index 33847f0..e09b413 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -388,6 +388,11 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, { # ifndef RTLD_BOOTSTRAP # ifndef SHARED + if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) != STT_NOTYPE, + 1) + && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) != STT_TLS, + 1)) + goto non_tls; CHECK_STATIC_TLS (map, sym_map); # else if (!TRY_STATIC_TLS (map, sym_map)) @@ -418,6 +423,11 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, block we subtract the offset from that of the TLS block. */ if (sym != NULL) { + if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) != STT_NOTYPE, + 1) + && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) != STT_TLS, + 1)) + goto non_tls; CHECK_STATIC_TLS (map, sym_map); *reloc_addr += sym_map->l_tls_offset - sym->st_value; } @@ -433,6 +443,11 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, thread pointer. */ if (sym != NULL) { + if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) != STT_NOTYPE, + 1) + && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) != STT_TLS, + 1)) + goto non_tls; CHECK_STATIC_TLS (map, sym_map); *reloc_addr += sym->st_value - sym_map->l_tls_offset; } @@ -476,6 +491,20 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, break; # endif /* !RTLD_BOOTSTRAP */ } + +# ifndef RTLD_BOOTSTRAP + return; + +non_tls: + { + const char *strtab; + strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]); + _dl_error_printf ("\ + reloc type 0x%x against non-TLS symbol `%s' in %s\n", + r_type, strtab + refsym->st_name, + rtld_progname ?: ""); + } +# endif } } -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.