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

In reference to a message from John David Anglin, dated Nov 23:
> > Does anybody understand what this comment means or what this code is
> > supposed to do?
> > 
> > hppa_pc_requires_run_before_use() in hppa-tdep.a says:

hrm, i found a testcase for this (gdb.base/so-indr-cl). It's
hpux-specific.

if we create one shared object that exports a function, and then use
that function from the main program via an indirect reference, then we
trip the check. there's a bit more explanation in the testcase:

# This program implicitly loads SOM shared libraries.  We wish to test
# whether a user can set breakpoints in a shlib before running the
# program, where the program doesn't directly call the shlib, but
# indirectly does via passing its address to another function.
#
# ??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... :)

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....

randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/


  parent reply	other threads:[~2004-12-04  0:38 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   ` Randolph Chung [this message]
2004-12-04  1:01     ` pc_requires_run_before_use John David Anglin

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