diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2009-12-01 01:39:36 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2009-12-01 01:39:36 +0000 |
commit | fb0265684ef7d202acf7f26152909d2adf94575d (patch) | |
tree | d0f1934bed0bc46908a6e6c20e7a7ed681ed70f9 /libc/csu | |
parent | 13f9386e858d4de839bcf681debed84ea7f02974 (diff) |
Merge changes between r9301 and r9378 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@9379 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/csu')
-rw-r--r-- | libc/csu/elf-init.c | 21 | ||||
-rw-r--r-- | libc/csu/libc-start.c | 6 |
2 files changed, 21 insertions, 6 deletions
diff --git a/libc/csu/elf-init.c b/libc/csu/elf-init.c index 1d2df62ca..1e3d6d6cd 100644 --- a/libc/csu/elf-init.c +++ b/libc/csu/elf-init.c @@ -72,15 +72,14 @@ extern void _fini (void); /* These functions are passed to __libc_start_main by the startup code. These get statically linked into each program. For dynamically linked programs, this module will come from libc_nonshared.a and differs from - the libc.a module in that it doesn't call the preinit array. */ + the libc.a module in that it doesn't call the preinit array and performs + explicit IREL{,A} relocations. */ -void -__libc_csu_init (int argc, char **argv, char **envp) -{ - /* For dynamically linked executables the preinit array is executed by - the dynamic linker (before initializing any shared object. */ #ifndef LIBC_NONSHARED +void +__libc_csu_irel (void) +{ # ifdef USE_MULTIARCH # ifdef ELF_MACHINE_IRELA { @@ -98,7 +97,17 @@ __libc_csu_init (int argc, char **argv, char **envp) } # endif # endif +} +#endif + +void +__libc_csu_init (int argc, char **argv, char **envp) +{ + /* For dynamically linked executables the preinit array is executed by + the dynamic linker (before initializing any shared object. */ + +#ifndef LIBC_NONSHARED /* For static executables, preinit happens right before init. */ { const size_t size = __preinit_array_end - __preinit_array_start; diff --git a/libc/csu/libc-start.c b/libc/csu/libc-start.c index 80b672f88..dc7ca55f0 100644 --- a/libc/csu/libc-start.c +++ b/libc/csu/libc-start.c @@ -24,6 +24,9 @@ #include <bp-sym.h> extern void __libc_init_first (int argc, char **argv, char **envp); +#ifndef SHARED +extern void __libc_csu_irel (void); +#endif extern int __libc_multiple_libcs; @@ -134,6 +137,9 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL), } # endif + /* Performe IREL{,A} relocations. */ + __libc_csu_irel (); + /* Initialize the thread library at least a bit since the libgcc functions are using thread functions if these are available and we need to setup errno. */ |