From owner-freebsd-alpha Mon Feb 18 11:53:45 2002 Delivered-To: freebsd-alpha@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id C3BE537B400; Mon, 18 Feb 2002 11:53:41 -0800 (PST) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id OAA11132; Mon, 18 Feb 2002 14:53:41 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id g1IJrBN36192; Mon, 18 Feb 2002 14:53:11 -0500 (EST) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15473.23463.76106.50785@grasshopper.cs.duke.edu> Date: Mon, 18 Feb 2002 14:53:11 -0500 (EST) To: jdp@freebsd.org, obrien@freebsd.org Cc: freebsd-alpha@freebsd.org Subject: gdb, binutils & rtld on alpha -current X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org After finally being able to install a new world on alpha, I realized that gdb seems to be broken. It goes into an infinate loop when starting up. If I run it under an older, working gdb from -stable and ^C it on startup, its stuck here: (gdb) where #0 0x1601ade14 in _rtld_bind () from /usr/libexec/ld-elf.so.1 #1 0x1601ad53c in _rtld_bind_start () from /usr/libexec/ld-elf.so.1 #2 0x1200c4c60 in set_width () at /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb.291/gdb/utils.c:1427 #3 0x1200c4cb4 in set_width_command (args=0x1201e8200 "", from_tty=82, c=0x1201ec400) at /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb.291/gdb/utils.c:1438 #4 0x1200c6850 in initialize_utils () at /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb.291/gdb/utils.c:2372 #5 0x1200b69f0 in gdb_init ( argv0=0x11fff968 "/usr/src/gnu/usr.bin/binutils/gdb/gdb") at /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb.291/gdb/top.c:663 #6 0x120075f50 in main (argc=301989179, argv=0x11fffd6f) at /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb.291/gdb/main.c:403 It seems to be looping somewhere in rtld. Interestingly enough, the line number that its stuck on is: 1427 wrap_buffer = (char *) xrealloc (wrap_buffer, chars_per_line + 2); xrealloc is multiply defined -- once in the system libc, and once in libiberty, which is statically linked into the binary. % nm gdb | grep xreall 00000001200c4060 T USE_FROM_LIBIBERTY_NOW_xrealloc 00000001201aad50 ? xrealloc And static linking fails: ../libiberty/libiberty.a(xmalloc.o): In function `xmalloc': /usr/src/gnu/usr.bin/binutils/libiberty/../../../../contrib/binutils/libiberty/xmalloc.c:133: multiple definition of `xmalloc' /usr/lib/libreadline.a(xmalloc.o)(.text+0x60): first defined here /usr/libexec/elf/ld: Warning: size of symbol `xmalloc' changed from 72 to 80 in ../libiberty/libiberty.a(xmalloc.o) ../libiberty/libiberty.a(xmalloc.o): In function `xrealloc': /usr/src/gnu/usr.bin/binutils/libiberty/../../../../contrib/binutils/libiberty/xmalloc.c:164: multiple definition of `xrealloc' /usr/lib/libreadline.a(xmalloc.o)(.text+0xc0): first defined here /usr/libexec/elf/ld: Warning: size of symbol `xrealloc' changed from 104 to 112 in ../libiberty/libiberty.a(xmalloc.o) If I remove the offending xmalloc and xrealloc functions from libiberty, then static linking succeeds and a normal, shared binary also works fine. I suspect there are 2 problems here.. The multiple definition, and the infinate loop of rtld in the face of a multiply defined symbol. Thanks for the help, Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message