about summary refs log tree commit diff
path: root/elf/dl-minimal.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-07-08 06:18:25 +0000
committerRoland McGrath <roland@gnu.org>1996-07-08 06:18:25 +0000
commitaf5b3bc33bbaf9151c34a351bdb257b90d407d5b (patch)
tree7a9d35a2cea2549dad8c3c9276208962732e4954 /elf/dl-minimal.c
parent0676b5fdca8d4f2a8dd442db4d50dc2c1ee8729f (diff)
downloadglibc-af5b3bc33bbaf9151c34a351bdb257b90d407d5b.tar.gz
glibc-af5b3bc33bbaf9151c34a351bdb257b90d407d5b.tar.xz
glibc-af5b3bc33bbaf9151c34a351bdb257b90d407d5b.zip
Mon Jul 8 02:14:25 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> cvs/libc-960708
	* libc-symbols.h [GCC >= 2.7] (strong_alias, weak_alias): Use extern
	storage class.  GCC gives an error for non-extern data defns with the
	alias attribute.

Mon Jul  8 00:11:15 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* libc-symbols.h (weak_function): New macro.
	For GCC 2.7+ define as __attribute__ ((weak)).
	* elf/dl-minimal.c: Use weak_function as keyword in function defns
 	instead of weak_symbol (NAME) after the defn.
	* stdlib/strtol.c: Likewise.
	* sysdeps/mach/hurd/dl-sysdep.c: Likewise.

	* sysdeps/alpha/dl-machine.h (elf_machine_rela) [RTLD_BOOTSTRAP]:
	If this is defined, don't declare _dl_rtld_map as weak, and
	don't check for MAP pointing to it.  RESOLVE is always null in this
	case, so test with #ifdef instead of if.

	* libc-symbols.h (symbol_set_declare): Use weak_extern instead of
	weak_symbol.
	* csu/initfini.c (_init): Likewise.
	* locale/setlocale.c (DEFINE_CATEGORY): Likewise.
	* misc/efgcvt_r.c: Likewise.
	* sysdeps/alpha/dl-machine.h (elf_machine_rela): Likewise.
	* sysdeps/i386/dl-machine.h (elf_machine_rel): Likewise.

	* libc-symbols.h [ASSEMBLER] (weak_symbol): Macro removed.
	It was not used in any assembler code.
	(weak_symbol_asm): Renamed to weak_extern_asm.
	(weak_extern): New macro replaces weak_symbol for weak extern refs;
	define to weak_extern_asm for [!ASSEMBLER].

	* libc-symbols.h [! ASSEMBLER] [HAVE_WEAK_SYMBOLS] (weak_symbol_asm,
	weak_alias_asm): New macros, renamed from weak_symbol/weak_alias;
	define those now as aliases.
	Change conditional to use __attribute__ syntax for GCC 2.7+, not 2.8+
	[GCC >= 2.7] [HAVE_WEAK_SYMBOLS] (weak_symbol): Do weak_symbol_asm
	after GCC weak attribute decl.
Diffstat (limited to 'elf/dl-minimal.c')
-rw-r--r--elf/dl-minimal.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index bf19fee6c4..fd7bf05497 100644
--- a/elf/dl-minimal.c
+++ b/elf/dl-minimal.c
@@ -30,7 +30,7 @@ Cambridge, MA 02139, USA.  */
 
 static void *alloc_ptr, *alloc_end, *alloc_last_block;
 
-void *
+void * weak_function
 malloc (size_t n)
 {
   extern int _dl_zerofd;
@@ -71,20 +71,18 @@ malloc (size_t n)
   alloc_ptr += n;
   return alloc_last_block;
 }
-weak_symbol (malloc)
 
 /* This will rarely be called.  */
-void
+void weak_function
 free (void *ptr)
 {
   /* We can free only the last block allocated.  */
   if (ptr == alloc_last_block)
     alloc_ptr = alloc_last_block;
 }
-weak_symbol (free)
 
 /* This is only called with the most recent block returned by malloc.  */
-void *
+void * weak_function
 realloc (void *ptr, size_t n)
 {
   void *new;
@@ -94,31 +92,27 @@ realloc (void *ptr, size_t n)
   assert (new == ptr);
   return new;
 }
-weak_symbol (realloc)
 
 /* Avoid signal frobnication in setjmp/longjmp.  Keeps things smaller.  */
 
 #include <setjmp.h>
 
-int __sigjmp_save (sigjmp_buf env, int savemask)
+int weak_function
+__sigjmp_save (sigjmp_buf env, int savemask)
 { env[0].__mask_was_saved = savemask; return 0; }
-weak_symbol (__sigjmp_save)
 
-void
+void weak_function
 longjmp (jmp_buf env, int val) { __longjmp (env[0].__jmpbuf, val); }
-weak_symbol (longjmp)
-
 
 /* Define our own stub for the localization function used by strerror.
    English-only in the dynamic linker keeps it smaller.  */
 
-char *
+char * weak_function
 __dgettext (const char *domainname, const char *msgid)
 {
   assert (domainname == _libc_intl_domainname);
   return (char *) msgid;
 }
-weak_symbol (__dgettext)
 weak_alias (__dgettext, dgettext)
 
 #ifndef NDEBUG
@@ -127,7 +121,7 @@ weak_alias (__dgettext, dgettext)
    If we are linked into the user program (-ldl), the normal __assert_fail
    defn can override this one.  */
 
-void
+void weak_function
 __assert_fail (const char *assertion,
 	       const char *file, unsigned int line, const char *function)
 {
@@ -140,9 +134,8 @@ __assert_fail (const char *assertion,
 		    NULL);
 
 }
-weak_symbol (__assert_fail)
 
-void
+void weak_function
 __assert_perror_fail (int errnum,
 		      const char *file, unsigned int line,
 		      const char *function)
@@ -155,6 +148,5 @@ __assert_perror_fail (int errnum,
 		    "Unexpected error: ", strerror (errnum), "\n", NULL);
 
 }
-weak_symbol (__assert_perror_fail)
 
 #endif