This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH RFA] partial-stab.h patch amendment


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]