diff options
Diffstat (limited to 'csu')
-rw-r--r-- | csu/Makefile | 3 | ||||
-rw-r--r-- | csu/elf-init.c | 17 |
2 files changed, 19 insertions, 1 deletions
diff --git a/csu/Makefile b/csu/Makefile index 0e2ae07cf7..1339b5d117 100644 --- a/csu/Makefile +++ b/csu/Makefile @@ -93,7 +93,8 @@ omit-deps += $(crtstuff) $(crtstuff:%=$(objpfx)%.o): %.o: %.S $(objpfx)defs.h $(compile.S) -g0 $(ASFLAGS-.os) -o $@ -CFLAGS-initfini.s = -g0 -fPIC -fno-inline-functions $(fno-unit-at-a-time) +CFLAGS-initfini.s = -g0 -fPIC -fno-inline-functions $(fno-unit-at-a-time) \ + -fno-asynchronous-unwind-tables vpath initfini.c $(sysdirs) diff --git a/csu/elf-init.c b/csu/elf-init.c index d5ec912cba..0ea23c6193 100644 --- a/csu/elf-init.c +++ b/csu/elf-init.c @@ -63,6 +63,23 @@ extern void (*__init_array_end []) (int, char **, char **) extern void (*__fini_array_start []) (void) attribute_hidden; extern void (*__fini_array_end []) (void) attribute_hidden; +#if defined HAVE_VISIBILITY_ATTRIBUTE \ + && (defined SHARED || defined LIBC_NONSHARED) +# define hidden_undef_2(x) #x +# define hidden_undef_1(x) hidden_undef_2 (x) +# define hidden_undef(x) \ + __asm (hidden_undef_1 (ASM_GLOBAL_DIRECTIVE) " " #x); \ + __asm (".hidden " #x); +#else +# define hidden_undef(x) +#endif + +hidden_undef (__preinit_array_start) +hidden_undef (__preinit_array_end) +hidden_undef (__init_array_start) +hidden_undef (__init_array_end) +hidden_undef (__fini_array_start) +hidden_undef (__fini_array_end) /* These function symbols are provided for the .init/.fini section entry points automagically by the linker. */ |