PATCH: BZ #14557: __kernel_vsyscall unwind info is incorrect
H.J. Lu
hjl.tools@gmail.com
Fri Sep 28 23:59:00 GMT 2012
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?
Thanks.
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Set-up-the-data-structures-for-vDSO-in-libc.a.patch
Type: application/octet-stream
Size: 15078 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120928/4f84aa4b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Allow-_ns_loaded-dl_sysinfo_map-in-libc.a.patch
Type: application/octet-stream
Size: 1242 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120928/4f84aa4b/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Add-test-cases-for-BZ-14557.patch
Type: application/octet-stream
Size: 3788 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120928/4f84aa4b/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Move-_dl_important_hwcaps-to-dl-hwcaps.c.patch
Type: application/octet-stream
Size: 18755 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120928/4f84aa4b/attachment-0003.obj>
More information about the Libc-alpha
mailing list