From: "H . J . Lu" <hjl@lucon.org>
To: Kevin Buettner <kevinb@cygnus.com>,
binutils@sourceware.cygnus.com,
GNU C Library <libc-alpha@sourceware.cygnus.com>
Cc: Mike Krogh <krogh@ceintl.com>, gdb@sourceware.cygnus.com
Subject: Re: debugging a dynamically loaded library
Date: Thu, 06 Sep 2001 10:25:00 -0000 [thread overview]
Message-ID: <20010906102547.A31711@lucon.org> (raw)
In-Reply-To: <1010906060403.ZM6589@ocotillo.lan>
On Wed, Sep 05, 2001 at 11:04:03PM -0700, Kevin Buettner wrote:
> On Sep 5, 10:29pm, H . J . Lu wrote:
>
> > I am wondering if
> >
> > 1327 FUN 0 36 00000000 31372 __strtol_internal:F(0,3)
> >
> > is a valid stab entry. It it is valid, why does it trigger the
> > SOFUN_ADDRESS_MAYBE_MISSING code in gdb. Is that possible a linker
> > or assembler bug?
>
> It's always possible that there's a bug elsewhere, but my guess is
> that __strtol_internal() is merely the first function in the section
> in which case the above entry makes sense to me.
No. That is not the case. In glibc 2.2, which is used in RedHat 7.1,
__strtol_internal is a weak definition in the object files used to
build libdl.so.2:
# objdump --sym eval.os | grep __strtol_internal
00000440 w F .text 00000137 __strtol_internal
But when libdl.so.2 is generated against libc.so.6:
# objdump --sym ../libc.so.6 | grep __strtol_internal
00032d04 g F .text 000006ab __strtol_internal
the linker generates
# objdump --sym libdl.so.2 | grep __strtol_internal
00000000 w F *UND* 000006ab __strtol_internal@@GLIBC_2.0
in libdl.so.2. I am 100% sure where the bug is. It can be in as, ld,
gcc and/or gdb. I tend to think it is a linker bug since the intention
of glibc is to make __strtol_internal weak defined, not weak undefined.
My second thought a weak undefined __strtol_internal in this case may
be the right thing to do, given how weak should be treated. Now the
question is how as/ld/gcc/gdb should deal a symbol which is turned from
weak defined to weak undefined. Does stabs/gdb support the notation of
weak defined symbol, which may be changed between compile-time,
link-time and run-time?
As for how useful a weak defined __strtol_internal is in libdl.so, that
is an entirely different question.
H.J.
next prev parent reply other threads:[~2001-09-06 10:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-29 13:45 Mike Krogh
2001-08-29 15:41 ` Kevin Buettner
2001-08-29 16:07 ` H . J . Lu
2001-08-29 16:59 ` Kevin Buettner
2001-09-03 15:58 ` Kevin Buettner
2001-09-05 22:29 ` H . J . Lu
2001-09-05 23:05 ` Kevin Buettner
2001-09-06 10:25 ` H . J . Lu [this message]
2001-09-18 14:11 ` Mike Krogh
2001-09-18 14:54 ` Kevin Buettner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010906102547.A31711@lucon.org \
--to=hjl@lucon.org \
--cc=binutils@sourceware.cygnus.com \
--cc=gdb@sourceware.cygnus.com \
--cc=kevinb@cygnus.com \
--cc=krogh@ceintl.com \
--cc=libc-alpha@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox