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]

PING: PATCH: BZ #14557: __kernel_vsyscall unwind info is incorrect


On Sat, Sep 29, 2012 at 8:05 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Sep 28, 2012 at 4:59 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Fri, Sep 28, 2012 at 12:47 PM, Roland McGrath <roland@hack.frob.com> wrote:
>>>> The _ns_loaded list is for ld.so and doesn't support libc.a.  For
>>>> example, ld.so calls its own malloc routines to manage memory before
>>>> entering main.  We can't easily do that in libc.a since we need to set up
>>>> a few things for malloc first.  Unless there is a specific issue we need
>>>> to address, I'd like to use the existing patch.  OK to install?
>>>
>>> If statically-linked programs are going to know about the vDSO at all,
>>> then they should support it fully.  That means a static program can use
>>> -ldl and use dlsym to access the vDSO, for example.
>>>
>>> The rtld.c code that sets up dl_sysinfo_map can move into a new internal
>>> function in a new dl-foo.c file built both for ld.so and for libc.a.  For
>>> static, that function can be called by some __attribute__((constructor))
>>> function that is defined in the same file as the definition of some data
>>> variables that only -ldl code or dl_iterate_phdr will use, so it's not
>>> included in a static link that doesn't need it.  Surely a static program's
>>> __attribute__((constructor)) functions can call malloc (if they can't, then
>>> that's a preexisting bug we should fix first).
>>>
>>
>> Here are 4 patches I checked into hjl/pr14557/map branch:
>>
>> Patch 1:  Set up the data structures for the system-supplied DSO early
>> in _dl_non_dynamic_init,  so they can influence _dl_init_paths.  I
>> extracted elf_get_dynamic_info from dynamic-link.h into
>> get-dynamic-info.h so that it can be used in _dl_non_dynamic_init.
>> Patch 2:  It allows _ns_loaded == dl_sysinfo_map if SHARED isn't defined.
>> Otherwise it will trigger
>>
>> assert (nsid < GL(dl_nns));
>>
>> in _dl_map_object in static executables.
>> Patch 3: Test cases for BZ #14557.
>> Patch 4: Use the same _dl_important_hwcaps in ld.so and
>> libc.a.
>>
>> Tested on x86-64 and ia32.  OK to install?
>>
>
> Here is the updated patch 1, which factors vDSO setup
> code into elf/setup-vdso.h so that it can be shared by
> rtld.c and dl-support.c.
>

PING.

-- 
H.J.


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