From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Buettner To: "H . J . Lu" , Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH RFA] partial-stab.h patch amendment Date: Fri, 07 Sep 2001 09:53:00 -0000 Message-id: <1010907165329.ZM10390@ocotillo.lan> References: <1010905224331.ZM6026@ocotillo.lan> <1010906205537.ZM8109@ocotillo.lan> <1010906232048.ZM8395@ocotillo.lan> <20010906230028.A9702@lucon.org> X-SW-Source: 2001-09/msg00089.html On Sep 6, 11:00pm, H . J . Lu wrote: > > If you read H.J.'s message, you'll see that __strtol_internal appears > > in libdl.so.2 as a weak undefined symbol. It got that way presumably > > through a bug somewhere else in the toolchain (linker perhaps?) which > > converted it from a weak defined symbol to a weak undefined symbol. > > Yet, in the process, the stabs entries related to this symbol weren't > > removed. Thus we end up having stabs entries which describe an > > undefined symbol. > > Is there a way to remove a stabs entry in this case? In theory, yes. If the minsym reader kept track of the undefined symbols that it ran across, the stabs reader could check to see if it's attempting to read an entry for an undefined symbol and discard it. However, the minsym reader (e.g. see elf_symtab_read in elfread.c) doesn't keep track of the undefined symbols... In my opinion, it'd be better for some other part of the toolchain (i.e. not GDB) to remove the appropriate stabs entries when a symbol is converted from being weak defined to (weak) undefined. (Is there any difference between ``undefined'' and ``weak undefined''?) > I tried your patch on gdb 5.1. It works for me. Can we have it in > gdb 5.1? Good question. I think it should go in, but I'm not the keeper of the branch. Andrew, what do you say?