diff options
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | extra/Configs/Config.sh | 2 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/initfini.c | 26 |
3 files changed, 24 insertions, 11 deletions
@@ -193,7 +193,6 @@ uClibc_config: Makefile Config else \ echo "#undef __UCLIBC_HAS_RPC__" >> include/bits/uClibc_config.h ; \ fi - @echo "#define C_SYMBOL_PREFIX "\""$(C_SYMBOL_PREFIX)"\" >> include/bits/uClibc_config.h @if [ "$(DOLFS)" = "true" ] ; then \ echo "#define __UCLIBC_HAVE_LFS__ 1" >> include/bits/uClibc_config.h ; \ else \ @@ -219,6 +218,12 @@ uClibc_config: Makefile Config else \ echo "#undef ASSUME_DEVPTS" >> include/bits/uClibc_config.h ; \ fi + @echo "#define C_SYMBOL_PREFIX "\""$(C_SYMBOL_PREFIX)"\" >> include/bits/uClibc_config.h + @if [ "$(HAVE_DOT_HIDDEN)" = "true" ] ; then \ + echo "#define HAVE_DOT_HIDDEN 1" >> include/bits/uClibc_config.h ; \ + else \ + echo "#undef HAVE_DOT_HIDDEN" >> include/bits/uClibc_config.h ; \ + fi subdirs: $(patsubst %, _dir_%, $(DIRS)) diff --git a/extra/Configs/Config.sh b/extra/Configs/Config.sh index 0d4ef5022..8ac29bba5 100644 --- a/extra/Configs/Config.sh +++ b/extra/Configs/Config.sh @@ -217,3 +217,5 @@ DEVEL_TOOL_PREFIX = $(DEVEL_PREFIX)/usr # i.e., 'make PREFIX=/var/tmp/uClibc install'. #PREFIX = $(TOPDIR)/_install +#Enable .hidden asm directives +HAVE_DOT_HIDDEN=true diff --git a/libc/sysdeps/linux/common/initfini.c b/libc/sysdeps/linux/common/initfini.c index f93a9baed..c2e82d591 100644 --- a/libc/sysdeps/linux/common/initfini.c +++ b/libc/sysdeps/linux/common/initfini.c @@ -36,15 +36,21 @@ * crtn.s puts the corresponding function epilogues in the .init and .fini sections. */ +#include <features.h> + #undef GMON_SUPPORT /* We use embedded asm for .section unconditionally, as this makes it easier to insert the necessary directives into crtn.S. */ -#define SECTION(x) asm (".section " x ) +#define SECTION(x) asm (".section " x ); /* Declare symbols as hidden. Hidden symbols are only seen by * the link editor and not by the dynamic loader. */ -#define HIDDEN(func) asm (".hidden " #func ) +#ifdef HAVE_DOT_HIDDEN +# define HIDDEN(func) asm (".hidden " #func ); +#else +# define HIDDEN(func) +#endif /* The initial common code ends here. */ asm ("\n/*@HEADER_ENDS*/"); @@ -75,11 +81,11 @@ call_gmon_start(void) } #endif -SECTION (".init"); -HIDDEN(_init); +SECTION (".init") +HIDDEN(_init) + extern void _init (void); -void -_init (void) +void _init (void) { #ifdef GMON_SUPPORT /* We cannot use the normal constructor mechanism in gcrt1.o because it @@ -112,11 +118,11 @@ _init (void) asm ("\n/*@_init_EPILOG_ENDS*/"); asm ("\n/*@_fini_PROLOG_BEGINS*/"); -SECTION (".fini"); -HIDDEN(_fini); +SECTION (".fini") +HIDDEN(_fini) + extern void _fini (void); -void -_fini (void) +void _fini (void) { /* End of the _fini prolog. */ |