diff options
Diffstat (limited to 'elf')
-rw-r--r-- | elf/dl-open.c | 9 | ||||
-rw-r--r-- | elf/genrtldtbl.awk | 2 | ||||
-rw-r--r-- | elf/rtld.c | 8 |
3 files changed, 13 insertions, 6 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c index 84a76cfb4a..b984aa8f89 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -1,5 +1,5 @@ /* Load a shared object at runtime, relocate it, and run its initializer. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -93,6 +93,13 @@ _dl_open (const char *file, int mode) between when _dl_object_relocation_scope returns and when we enter the dynamic linker's code (_dl_relocate_object). */ __typeof (_dl_relocate_object) *reloc = &_dl_relocate_object; + + /* GCC is very clever. If we wouldn't add some magic it would + simply optimize away our nice little variable `reloc' and we + would result in a not working binary. So let's swing the + magic ward. */ + asm ("" : "=r" (reloc) : "0" (reloc)); + (*reloc) (l, _dl_object_relocation_scope (l), (mode & RTLD_BINDING_MASK) == RTLD_LAZY); *_dl_global_scope_end = NULL; diff --git a/elf/genrtldtbl.awk b/elf/genrtldtbl.awk index f5656a2b44..63ada003f6 100644 --- a/elf/genrtldtbl.awk +++ b/elf/genrtldtbl.awk @@ -12,7 +12,7 @@ BEGIN { END { for (i = 0; i < count; ++i) { printf ("static struct r_search_path_elem rtld_search_dir%d =\n", i+1); - printf (" { \"%s/\", %d, unknown, 0, unknown, ", + printf (" { \"%s/\", %d, unknown, 0, nonexisting, ", dir[i], length (dir[i]) + 1); if (i== 0) printf ("NULL };\n"); diff --git a/elf/rtld.c b/elf/rtld.c index e0d35216b6..aa40d42097 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -482,6 +482,10 @@ of this helper program; chances are you did not intend to run this program.\n", preloads = NULL; npreloads = 0; + /* Initialize the data structures for the search paths for shared + objects. */ + _dl_init_paths (); + preloadlist = getenv ("LD_PRELOAD"); if (preloadlist) { @@ -595,10 +599,6 @@ of this helper program; chances are you did not intend to run this program.\n", assert (i == npreloads); } - /* Initialize the data structures for the search paths for shared - objects. */ - _dl_init_paths (); - /* Load all the libraries specified by DT_NEEDED entries. If LD_PRELOAD specified some libraries to load, these are inserted before the actual dependencies in the executable's searchlist for symbol resolution. */ |