This is the mail archive of the
mailing list for the glibc project.
Re: question on glibc interposition
On 02/13/2018 11:39 AM, email@example.com wrote:
>> On Feb 11, 2018, at 1:05 AM, Alexander Monakov <firstname.lastname@example.org> wrote:
>> On Sun, 11 Feb 2018, Alexander Monakov wrote:
>>> and after that LD_DEBUG stream between the 'run' and 'fin' commands should
>>> show you how the malloc call was bound.
>> Ugh, no, not that part. The relatively small part produced after 'fin' and
>> the gdb prompt after that (that's why LD_BIND_NOT is needed - to see bindings
>> after invoking _gfortran_string_trim even if some were already computed).
> Yes, that was helpful. It turned out that my interposition library was misusing
> symbol versioning, which apparently interferes with interposition of the intended
> routines (malloc/free/etc.) Thanks!
Glad to hear that.
In glibc we make sure malloc remains interposable for all callers.
The GNU toolchain does not have anything like group binding from Solaris which might
have allowed you to avoid the interposition. The only alternative would have been
a DSO that provided it's own memory allocator, but in that case you'd never see
any undefined references to malloc family symbols after the static linker ran.