Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "John David Anglin" <dave@hiauly1.hia.nrc.ca>
To: randolph@tausq.org
Cc: gdb@sources.redhat.com
Subject: Re: pc_requires_run_before_use
Date: Sat, 04 Dec 2004 01:01:00 -0000	[thread overview]
Message-ID: <200412040101.iB411Jnl013389@hiauly1.hia.nrc.ca> (raw)
In-Reply-To: <20041204003819.GM6359@tausq.org> from "Randolph Chung" at Dec 3, 2004 07:38:20 pm

> # ??rehrauer: Currently, this doesn't work, but we do catch the case
> # and explicitly disallow it.  The reason it fails appears to be that
> #
> #  [1] gdb consults only the linker symbol table in this scenario, and
> #  [2] For a shlib function that is only indirectly called from the
> #      main a.out, there is in the linker symbol table a stub whose
> #      address is negative.  Possibly this is to be interpreted as
> #      an index into the DLT??
> 
> interestingly, this only triggers when calling a function in a
> user-defined shared object. in my original test program which calls a
> function in libc.sl, the problem doesn't occur. i don't know why yet....
> i wish there were a "readelf" equivalent for SOM... :)

Have you tried odump?  There is a manpage for it on uly3.

> using the same testcase on linux, the reference to the shared object
> function is not picked up by gdb for the main program before the app is
> started, so the problem doesn't exist. i guess this may be a problem
> with the SOM reader where it records a symbol for the unresolved
> reference to a shlib function....

I haven't looked into the mechanics of this as I did for linux.  There is
info on binding in the ld and dld.sl manpages.  There is a millicode
routine $$sh_func_adrs that performs function pointer canonicalization.
Possibly, understanding the deferred binding mechanism may allow you
to detect unresolved references to shlib functions.

This is obviously a pain for the user who wants to place a break
on such a function.  I usely use static linkage or immediate binding
when I encounter problems such as this.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)


      reply	other threads:[~2004-12-04  1:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-23 21:43 pc_requires_run_before_use Randolph Chung
2004-11-24  3:55 ` pc_requires_run_before_use John David Anglin
2004-11-24  6:47   ` pc_requires_run_before_use Randolph Chung
2004-12-04  0:38   ` pc_requires_run_before_use Randolph Chung
2004-12-04  1:01     ` John David Anglin [this message]

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=200412040101.iB411Jnl013389@hiauly1.hia.nrc.ca \
    --to=dave@hiauly1.hia.nrc.ca \
    --cc=gdb@sources.redhat.com \
    --cc=randolph@tausq.org \
    /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