diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2013-05-23 23:37:23 +0200 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2013-05-23 23:37:23 +0200 |
commit | cbb9d63bde7e060a2ae9cdf17a913a6e3f44446f (patch) | |
tree | c57fe05be1ab39888bdcd09c56f67c10662bee99 /csu | |
parent | f5ac626c4ff62b26b99c3a1eb7bca4fccfbe4006 (diff) | |
parent | b934acf0e93c5a220551ed6e686bb9d45a24a8cc (diff) |
Merge commit 'refs/top-bases/t/tls' into t/tls
Diffstat (limited to 'csu')
-rw-r--r-- | csu/Makefile | 9 | ||||
-rw-r--r-- | csu/elf-init.c | 7 | ||||
-rw-r--r-- | csu/gmon-start.c | 24 | ||||
-rw-r--r-- | csu/libc-start.c | 31 | ||||
-rw-r--r-- | csu/libc-tls.c | 4 |
5 files changed, 45 insertions, 30 deletions
diff --git a/csu/Makefile b/csu/Makefile index bf0b4c4ada..24f0974b54 100644 --- a/csu/Makefile +++ b/csu/Makefile @@ -53,12 +53,6 @@ install-lib += S$(start-installed-name) generated += start.os endif -ifeq (yes,$(build-bounded)) -extra-objs += b$(start-installed-name) -install-lib += b$(start-installed-name) -generated += start.ob -endif - ifneq ($(start-installed-name),$(static-start-installed-name)) extra-objs += $(static-start-installed-name) g$(static-start-installed-name) omit-deps += $(patsubst %.o,%,$(static-start-installed-name) \ @@ -98,9 +92,6 @@ $(objpfx)$(start-installed-name): $(objpfx)start.o $(objpfx)abi-note.o \ $(objpfx)S$(start-installed-name): $(objpfx)start.os $(objpfx)abi-note.o \ $(objpfx)init.o $(link-relocatable) -$(objpfx)b$(start-installed-name): $(objpfx)start.ob $(objpfx)abi-note.ob \ - $(objpfx)init.ob - $(link-relocatable) endif # The profiling startfile is made by linking together the normal diff --git a/csu/elf-init.c b/csu/elf-init.c index 1e231c1a08..84700e6fff 100644 --- a/csu/elf-init.c +++ b/csu/elf-init.c @@ -49,10 +49,13 @@ extern void (*__fini_array_start []) (void) attribute_hidden; extern void (*__fini_array_end []) (void) attribute_hidden; +#ifndef NO_INITFINI /* These function symbols are provided for the .init/.fini section entry points automagically by the linker. */ extern void _init (void); extern void _fini (void); +#endif + /* These functions are passed to __libc_start_main by the startup code. These get statically linked into each program. For dynamically linked @@ -76,7 +79,9 @@ __libc_csu_init (int argc, char **argv, char **envp) } #endif +#ifndef NO_INITFINI _init (); +#endif const size_t size = __init_array_end - __init_array_start; for (size_t i = 0; i < size; i++) @@ -94,6 +99,8 @@ __libc_csu_fini (void) while (i-- > 0) (*__fini_array_start [i]) (); +# ifndef NO_INITFINI _fini (); +# endif #endif } diff --git a/csu/gmon-start.c b/csu/gmon-start.c index 3710379809..0c18321095 100644 --- a/csu/gmon-start.c +++ b/csu/gmon-start.c @@ -7,6 +7,23 @@ License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file with other + programs, and to distribute those programs without any restriction + coming from the use of this file. (The GNU Lesser General Public + License restrictions do apply in other respects; for example, they + cover modification of the file, and distribution when not linked + into another program.) + + Note that people who make modified versions of this file are not + obligated to grant this special exception for their modified + versions; it is their choice whether to do so. The GNU Lesser + General Public License gives permission to release a modified + version without this exception; this exception also makes it + possible to release a modified version which carries forward this + exception. + The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -42,10 +59,17 @@ extern char etext[]; # endif #endif +#ifdef GMON_START_ARRAY_SECTION +static void __gmon_start__ (void); +static void (*const gmon_start_initializer) (void) + __attribute__ ((used, section (GMON_START_ARRAY_SECTION))) = &__gmon_start__; +static +#else /* We cannot use the normal constructor mechanism to call __gmon_start__ because gcrt1.o appears before crtbegin.o in the link. Instead crti.o calls it specially. */ extern void __gmon_start__ (void); +#endif void __gmon_start__ (void) diff --git a/csu/libc-start.c b/csu/libc-start.c index 2f0c1fba76..736f30c9c5 100644 --- a/csu/libc-start.c +++ b/csu/libc-start.c @@ -19,7 +19,6 @@ #include <stdio.h> #include <unistd.h> #include <ldsodefs.h> -#include <bp-sym.h> extern void __libc_init_first (int argc, char **argv, char **envp); #ifndef SHARED @@ -86,7 +85,7 @@ apply_irel (void) # endif #else # define STATIC -# define LIBC_START_MAIN BP_SYM (__libc_start_main) +# define LIBC_START_MAIN __libc_start_main #endif #ifdef MAIN_AUXVEC_ARG @@ -101,14 +100,14 @@ apply_irel (void) STATIC int LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL), int argc, - char *__unbounded *__unbounded ubp_av, + char **argv, #ifdef LIBC_START_MAIN_AUXVEC_ARG - ElfW(auxv_t) *__unbounded auxvec, + ElfW(auxv_t) *auxvec, #endif __typeof (main) init, void (*fini) (void), void (*rtld_fini) (void), - void *__unbounded stack_end) + void *stack_end) __attribute__ ((noreturn)); @@ -117,29 +116,23 @@ STATIC int LIBC_START_MAIN (int (*main) (int, char **, char ** finalizers were called in more than one place. */ STATIC int LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL), - int argc, char *__unbounded *__unbounded ubp_av, + int argc, char **argv, #ifdef LIBC_START_MAIN_AUXVEC_ARG - ElfW(auxv_t) *__unbounded auxvec, + ElfW(auxv_t) *auxvec, #endif __typeof (main) init, void (*fini) (void), - void (*rtld_fini) (void), void *__unbounded stack_end) + void (*rtld_fini) (void), void *stack_end) { -#if __BOUNDED_POINTERS__ - char **argv; -#else -# define argv ubp_av -#endif - /* Result of the 'main' function. */ int result; __libc_multiple_libcs = &_dl_starting_up && !_dl_starting_up; #ifndef SHARED - char *__unbounded *__unbounded ubp_ev = &ubp_av[argc + 1]; + char **ev = &argv[argc + 1]; - __environ = ubp_ev; + __environ = ev; /* Store the lowest stack address. This is done in ld.so if this is the code for the DSO. */ @@ -149,12 +142,12 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL), /* First process the auxiliary vector since we need to find the program header to locate an eventually present PT_TLS entry. */ # ifndef LIBC_START_MAIN_AUXVEC_ARG - ElfW(auxv_t) *__unbounded auxvec; + ElfW(auxv_t) *auxvec; { - char *__unbounded *__unbounded evp = ubp_ev; + char **evp = ev; while (*evp++ != NULL) ; - auxvec = (ElfW(auxv_t) *__unbounded) evp; + auxvec = (ElfW(auxv_t) *) evp; } # endif _dl_aux_init (auxvec); diff --git a/csu/libc-tls.c b/csu/libc-tls.c index 90daaa61c1..5fa39eb8d1 100644 --- a/csu/libc-tls.c +++ b/csu/libc-tls.c @@ -75,7 +75,7 @@ size_t _dl_tls_generation; TLS_INIT_HELPER #endif -static inline void +static void init_slotinfo (void) { /* Create the slotinfo list. */ @@ -90,7 +90,7 @@ init_slotinfo (void) GL(dl_tls_dtv_slotinfo_list) = &static_slotinfo.si; } -static inline void +static void init_static_tls (size_t memsz, size_t align) { /* That is the size of the TLS memory for this object. The initialized |