GNU C Library master sources branch master updated. glibc-2.16-ports-merge-437-g53cea63
Thomas Schwinge
thomas@codesourcery.com
Thu Nov 1 09:02:00 GMT 2012
Hi!
On 5 Oct 2012 17:39:33 -0000, hjl@sourceware.org wrote:
> http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9cee55856438b714fa1efa45d8b7c1857467f4ca
>
> commit 9cee55856438b714fa1efa45d8b7c1857467f4ca
> Author: H.J. Lu <hjl.tools@gmail.com>
> Date: Fri Oct 5 10:20:39 2012 -0700
>
> Set up the data structures for vDSO in libc.a
> + [BZ #14557]
> + * elf/dl-support.c (_dl_sysinfo_map): New.
> + Include "get-dynamic-info.h" and "setup-vdso.h".
> + (_dl_non_dynamic_init): Call setup_vdso.
> + * elf/dynamic-link.h: Don't include <assert.h>.
> + (elf_get_dynamic_info): Moved to ...
> + * elf/get-dynamic-info.h: Here. New file.
> + * elf/dynamic-link.h: Include "get-dynamic-info.h".
> + * elf/rtld.c (dl_main): Break out vDSO setup code into ...
> + * elf/setup-vdso.h: Here. New file.
> + * elf/rtld.c: Include "setup-vdso.h".
> + (dl_main): Call setup_vdso.
> diff --git a/elf/dl-support.c b/elf/dl-support.c
> index 2bb468a..424ca6d 100644
> --- a/elf/dl-support.c
> +++ b/elf/dl-support.c
> @@ -161,6 +161,11 @@ uintptr_t _dl_sysinfo = DL_SYSINFO_DEFAULT;
> #if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
> /* Address of the ELF headers in the vsyscall page. */
> const ElfW(Ehdr) *_dl_sysinfo_dso;
> +
> +struct link_map *_dl_sysinfo_map;
> +
> +# include "get-dynamic-info.h"
> +# include "setup-vdso.h"
> #endif
>
> /* During the program run we must not modify the global data of
> @@ -266,6 +271,10 @@ _dl_non_dynamic_init (void)
>
> _dl_verbose = *(getenv ("LD_WARN") ?: "") == '\0' ? 0 : 1;
>
> + /* Set up the data structures for the system-supplied DSO early,
> + so they can influence _dl_init_paths. */
> + setup_vdso (NULL, NULL);
For »!(defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO)« (as it is
on GNU Hurd), this causes:
dl-support.c: In function '_dl_non_dynamic_init':
dl-support.c:277:3: warning: implicit declaration of function 'setup_vdso' [-Wimplicit-function-declaration]
setup_vdso (NULL, NULL);
^
[...]
[...]/libc.a(dl-support.o): In function `_dl_non_dynamic_init':
[...]/elf/dl-support.c:277: undefined reference to `setup_vdso'
collect2: error: ld returned 1 exit status
make[2]: *** [[...]/elf/sln] Error 1
Is the following a suitable minimal fix, given that setup_vdso itself
only gets active for »defined NEED_DL_SYSINFO || defined
NEED_DL_SYSINFO_DSO«?
diff --git elf/dl-support.c elf/dl-support.c
index 722b1b9..5688ecd 100644
--- elf/dl-support.c
+++ elf/dl-support.c
@@ -166,8 +166,8 @@ const ElfW(Ehdr) *_dl_sysinfo_dso;
struct link_map *_dl_sysinfo_map;
# include "get-dynamic-info.h"
-# include "setup-vdso.h"
#endif
+#include "setup-vdso.h"
/* During the program run we must not modify the global data of
loaded shared object simultanously in two threads. Therefore we
Also, I generally don't understand the "#include discipline" of the new
files elf/get-dynamic-info.h and elf/setup-vdso.h -- there are no
#includes in these. But it seems that other files in elf/ also don't
always #include what they use, so rely on what they implicitly get.
Grüße,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20121101/23a7b74e/attachment.sig>
More information about the Libc-alpha
mailing list