This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: question on glibc interposition
On 02/13/2018 11:39 AM, christopher.aoki@oracle.com wrote:
>
>> On Feb 11, 2018, at 1:05 AM, Alexander Monakov <amonakov@ispras.ru> 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).
>>
>> Alexander
>
> 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.
--
Cheers,
Carlos.