[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: ABI support for special memory area



* H. J. Lu:

> On Mon, Mar 20, 2017 at 7:57 AM, Florian Weimer <fweimer@redhat.com> wrote:
>> On 03/16/2017 07:22 PM, H.J. Lu wrote:
>>
>>>> If the latter, why can't you use the existing ELF constructor mechanism
>>>> for
>>>> this?  As far as I understand it, the call to __gnu_mbind_setup would
>>>> just
>>>> happen before the constructor calls.
>>>
>>>
>>> That is correct.  The issue is to access the ELF segment header for each
>>> loaded object only once.  There is no good way to get this info from
>>> constructor.
>>
>>
>> I think you can get the data in a pretty straightforward manner using
>> dlinfo.
>
> dlinfo is used to info from application.  I don't see how it can be used
> here.

You can get an opaque handle from an address and feed it into dlinfo.
However, dlinfo only gives you access to the dynamic section, so
unless you put your section markup there as well, it won't help you.

I see that you are now considering dl_iterate_phdr, which gives you
access to the program headers, from where you can walk the section
headers.  This looks like a good solution.

>> I expect that libraries such as bdwgc might want to use the
>> __gnu_mbind_setup callback as well, just to register freshly loaded shared
>
> Did you mean to mark pieces of memory garbage collectible? I guess it may
> work.

It's more for identifying roots to scan.

>> objects and their data sections.  Can we make this work for multiple users?
>>
>
> What did you mean by "multiple users"?

Different libraries installing different hooks with similar
intentions.