From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32457 invoked by alias); 2 Sep 2012 20:00:34 -0000 Received: (qmail 32443 invoked by uid 22791); 2 Sep 2012 20:00:32 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED 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 20:00:18 +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 20:00: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: WAITING X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: 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/msg00010.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=14370 --- Comment #8 from H.J. Lu 2012-09-02 20:00:15 UTC --- (In reply to comment #0) > Created attachment 6536 [details] > testcase > > $ ldd -r SceMiDpiBridge.so > linux-gate.so.1 (0xf76eb000) > libsds_server.so => not found > libxtor_threads_boost.so => not found > libaldecpli.so => not found > libsvdpi_exp.so => not found > libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xf755e000) > libsce_mi.so => not found > libScemiDpiBridgeApi.so => not found > libm.so.6 => /lib/libm.so.6 (0xf7520000) > libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xf7505000) > librt.so.1 => /lib/librt.so.1 (0xf74fb000) > libc.so.6 => /lib/libc.so.6 (0xf735b000) > /lib/ld-linux.so.2 (0xf76ec000) > libpthread.so.0 => /lib/libpthread.so.0 (0xf7340000) > Floating point exception This DSO is bad in several ways: [hjl@gnu-6 pr14370]$ readelf -d pr14370.so Dynamic section at offset 0x953e0 contains 29 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libsds_server.so] 0x00000001 (NEEDED) Shared library: [libxtor_threads_boost.so] 0x00000001 (NEEDED) Shared library: [libaldecpli.so] 0x00000001 (NEEDED) Shared library: [libsvdpi_exp.so] 0x00000001 (NEEDED) Shared library: [libstdc++.so.6] 0x00000001 (NEEDED) Shared library: [libsce_mi.so] 0x00000001 (NEEDED) Shared library: [libScemiDpiBridgeApi.so] 0x00000001 (NEEDED) Shared library: [libm.so.6] 0x00000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x0000000c (INIT) 0x1de28 0x0000000d (FINI) 0x794d4 0x00000004 (HASH) 0xd4 0x00000005 (STRTAB) 0x6558 0x00000006 (SYMTAB) 0x21d8 0x0000000a (STRSZ) 15815 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000003 (PLTGOT) 0x955c0 0x00000002 (PLTRELSZ) 856 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x1dad0 0x00000011 (REL) 0xabf0 0x00000012 (RELSZ) 77536 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000016 (TEXTREL) 0x0 0x6ffffffe (VERNEED) 0xab90 0x6fffffff (VERNEEDNUM) 2 0x6ffffff0 (VERSYM) 0xa320 0x6ffffffa (RELCOUNT) 3970 0x00000000 (NULL) 0x0 [hjl@gnu-6 pr14370]$ readelf -sWr pr14370.so | grep errno | tail -5 00078dcc 0003a502 R_386_PC32 00033110 __errno_location 00033120 0000ad01 R_386_32 00097254 errno 173: 00097254 4 OBJECT GLOBAL DEFAULT 27 errno 933: 00033110 37 FUNC WEAK DEFAULT 10 __errno_location 959: 00097254 4 OBJECT GLOBAL DEFAULT 27 _errno [hjl@gnu-6 pr14370]$ 1. It wasn't compiled with -fPIC. 2. It wasn't linked against libc.so. 3. It defines errno as int. A testcase: [hjl@gnu-6 pr14370]$ cat x.c int errno = 3; extern void foo (void); int bar (void) { foo (); return errno; } [hjl@gnu-6 pr14370]$ cat foo.c void foo (void) { } [hjl@gnu-6 pr14370]$ gcc -m32 -shared -o libm.so.6 foo.c -fPIC [hjl@gnu-6 pr14370]$ gcc -m32 x.c -c [hjl@gnu-6 pr14370]$ ld -m elf_i386 -shared x.o libm.so.6 [hjl@gnu-6 pr14370]$ ldd -r a.out linux-gate.so.1 => (0xf7ffd000) libm.so.6 => /lib/libm.so.6 (0xf7fad000) /lib/ld-linux.so.2 (0x56555000) libc.so.6 => /lib/libc.so.6 (0xf7dfb000) /usr/local/bin/ldd: line 118: 17528 Floating point exceptionLD_TRACE_LOADED_OBJECTS=1 LD_WARN=yes LD_BIND_NOW=yes LD_LIBRARY_VERSION=$verify_out LD_VERBOSE= "$@" [hjl@gnu-6 pr14370]$ -- 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.