Browse Source

Hide .hidden stuff unless explicitly enabled
-Erik

Eric Andersen 22 years ago
parent
commit
2c7e5c09a2
3 changed files with 24 additions and 11 deletions
  1. 6 1
      Makefile
  2. 2 0
      extra/Configs/Config.sh
  3. 16 10
      libc/sysdeps/linux/common/initfini.c

+ 6 - 1
Makefile

@@ -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))
 

+ 2 - 0
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

+ 16 - 10
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. */