public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: "christopher.aoki@oracle.com" <christopher.aoki@oracle.com>
Cc: libc-alpha@sourceware.org
Subject: Re: question on glibc interposition
Date: Sun, 11 Feb 2018 16:36:00 -0000	[thread overview]
Message-ID: <alpine.LNX.2.20.13.1802111120340.9728@monopod.intra.ispras.ru> (raw)
In-Reply-To: <85D90A1D-4D34-404C-AE3D-D2864F0CAB01@oracle.com>

On Sat, 10 Feb 2018, christopher.aoki@oracle.com wrote:

> I have a question on glibc interposition.   Should calls to an
> interposed function (e.g., malloc) from within a shared library
> (e.g., libgfortran.so) bind to the interposing library, as opposed
> to the glibc version?

In general yes. There are exceptions related to dlopen or libc listed
earlier in DT_NEEDED tags (check readelf -d ./tonto*), but that seems
unlikely to be your case.

To investigate your situation, have a look at LD_DEBUG functionality
as documented in 'man ld.so'. You can do something like

  LD_DEBUG_OUTPUT=/tmp/lddbg.txt LD_DEBUG=all ./tonto...

and then peruse the output, or alternatively interactively in gdb like

  gdb --args ./tonto...
  (gdb) set env LD_DEBUG=all
  (gdb) set env LD_BIND_NOT=1
  (gdb) break _gfortran_string_trim
  (gdb) run
  [breakpoint hit]
  (gdb) fin

and after that LD_DEBUG stream between the 'run' and 'fin' commands should
show you how the malloc call was bound.

Hope that helps.
Alexander

  reply	other threads:[~2018-02-11  8:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-11  9:06 christopher.aoki
2018-02-11 16:36 ` Alexander Monakov [this message]
2018-02-11 16:36   ` Alexander Monakov
2018-02-13 21:34     ` christopher.aoki
2018-02-14 13:04       ` Carlos O'Donell

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=alpine.LNX.2.20.13.1802111120340.9728@monopod.intra.ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=christopher.aoki@oracle.com \
    --cc=libc-alpha@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).