This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: question on glibc interposition


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


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