From: Roland McGrath Date: Wed, 26 Jul 1995 07:10:58 +0000 (+0000) Subject: Wed Jul 26 02:00:29 1995 Roland McGrath X-Git-Tag: upstream/2.30~29950 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=958f803fc021993cc2ee1d4157d0092b830368aa;p=external%2Fglibc.git Wed Jul 26 02:00:29 1995 Roland McGrath * malloc/memalign.c: Allocate (SIZE + ALIGNMENT - 1) and then trim if possible. * mach/shortcut.awk: Emit decls for RPC. * libc-symbols.h [GCC >= 2.7 && !ASSEMBLER] (weak_symbol, weak_alias, strong_alias): Define using GCC __attribute__ syntax. * Makerules ($(installed-libcs)): Depend on `lib' (only). --- diff --git a/ChangeLog b/ChangeLog index 598f70f..5227ff0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Wed Jul 26 02:00:29 1995 Roland McGrath + + * malloc/memalign.c: Allocate (SIZE + ALIGNMENT - 1) and then trim + if possible. + + * mach/shortcut.awk: Emit decls for RPC. + + * libc-symbols.h [GCC >= 2.7 && !ASSEMBLER] (weak_symbol, + weak_alias, strong_alias): Define using GCC __attribute__ syntax. + + * Makerules ($(installed-libcs)): Depend on `lib' (only). + Tue Jul 25 09:14:53 1995 Roland McGrath * sysdeps/mach/hurd/pathconf.c: Declare VALUE as int, not long int. diff --git a/libc-symbols.h b/libc-symbols.h index f4d82a6..951ea61 100644 --- a/libc-symbols.h +++ b/libc-symbols.h @@ -134,6 +134,26 @@ Cambridge, MA 02139, USA. */ #endif +#if (!defined (ASSEMBLER) && \ + (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))) +/* GCC 2.7 and later has special syntax for weak symbols and aliases. + Using that is better when possible, because the compiler and assembler + are better clued in to what we are doing. */ +#undef strong_alias +#define strong_alias(name, aliasname) \ + __typeof (name) aliasname __attribute__ ((alias (#name))); + +#ifdef HAVE_WEAK_SYMBOLS +#undef weak_symbol +#define weak_symbol(name) \ + __typeof (name) name __attribute__ ((weak)); +#undef weak_alias +#define weak_alias(name, aliasname) \ + __typeof (name) aliasname __attribute__ ((weak, alias (#name))); +#endif /* HAVE_WEAK_SYMBOLS. */ +#endif /* Not ASSEMBLER, and GCC 2.7 or later. */ + + /* When the file using this macro is linked in, the linker will emit a warning message MSG. */ diff --git a/mach/shortcut.awk b/mach/shortcut.awk index d6090d7..987cebe 100644 --- a/mach/shortcut.awk +++ b/mach/shortcut.awk @@ -35,11 +35,14 @@ echo == 1 { print $0; } print "{"; print " kern_return_t err;"; print " extern kern_return_t " syscall " (" proto ");"; + print " extern kern_return_t " rpc " (" proto ");"; print " err = " syscall " (" arglist ");"; print " if (err == MACH_SEND_INTERRUPTED)"; print " err = " rpc " (" arglist ");"; print " return err;" print "}"; - print "weak_alias (" call ", " alias ")" + print "weak_alias (" call ", " alias ")"; + # Declare RPC so the weak_alias that follows will work. + print "extern __typeof (" call ") " rpc ";"; echo = 1; }