[PATCH] Support -z initfirst for multiple shared libraries

Yury Gribov y.gribov@samsung.com
Fri Apr 29 06:47:00 GMT 2016


On 04/29/2016 04:11 AM, Kostya Serebryany wrote:
>>
>>
>>>> I'm myself pretty sure that people would generally prefer to avoid
>>>> reimplementing parts of Glibc (symbol resolver in particular). Let's see
>>>> if
>>>> Kostya has something to say.
>>>>
>>>
>>>
>>> Hm? To say about what? :)
>>> We almost never use asan as a DSO on Linux, so we don't get any problems
>>> like this.
>>>
>>
>> Just to clarify: you mean you don't ASan DSO dependencies (libc,
>> libpthread, librt, etc.) to be initialized before ASan initialization (i.e.
>> __asan_init) runs? In that case the OP's patch would work for ASan DSO.
>>
>> No, I mean that we don't use asan.so, only asan.a, which calls __asan_init
> from the pre-init array.

Right but preinit gets called prior to library ctors which means that 
__asan_init indeed does not depend on libc initializers to be completed.

-Y



More information about the Libc-alpha mailing list