diff --git a/ChangeLog b/ChangeLog index 1b472f9ad7..e54b612eab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-09-17 Roland McGrath + + * malloc/Makefile ($(objpfx)memusagestat.o: sysincludes): Define + file-specific variable override so it compiles properly when using + --with-headers. + + * NEWS: Added item for powerpc64-linux port. + 2002-09-17 Steven Munroe Ported to PowerPC64 running Linux. @@ -35,6 +43,43 @@ * sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: New file. + * include/libc-symbols.h [HAVE_ASM_GLOBAL_DOT_NAME] + (C_SYMBOL_DOT_NAME): Insure that C_SYMBOL_DOT_NAME works for + various gcc versions. Dot names required for powerpc64. + [HAVE_ASM_GLOBAL_DOT_NAME] (_weak_extern): Add .weakext '.'ed symbol. + [HAVE_ASM_GLOBAL_DOT_NAME] (strong_alias): Add .global + C_SYMBOL_DOT_NAME(alias). + [HAVE_ASM_GLOBAL_DOT_NAME] (strong_data_alias): New macro. Same as + original strong_alias macro. + [HAVE_ASM_GLOBAL_DOT_NAME] (weak_alias): Add .weakext/.weak + C_SYMBOL_DOT_NAME(alias). + [HAVE_ASM_GLOBAL_DOT_NAME] (_symbol_version): Add .symver '.'ed name. + [HAVE_ASM_GLOBAL_DOT_NAME] (_default_symbol_version): Add .symver + '.'ed name. + Add comments on libc_hidden_data_def and libc_hidden_data_weak usage. + [HAVE_ASM_GLOBAL_DOT_NAME] (hidden_dot_def1): New macro. Generate + .global C_SYMBOL_DOT_NAME(alias). Otherwise an empty macro. + (hidden_def): Append hidden_dot_def1 macro to definition. + (hidden_ver): Append hidden_dot_def1 macro to definition. + (hidden_data_def): New macro. Same as original hidden_def macro. + (hidden_data_ver): New macro. Same as original hidden_ver macro. + [HAVE_ASM_GLOBAL_DOT_NAME] (hidden_dot_weak1): New macro. Generate + .weakext C_SYMBOL_DOT_NAME(alias). Otherwise an empty macro. + (hidden_weak): Append hidden_dot_weak1 macro to definition. + (hidden_data_weak): New macro. Same as original hidden_weak macro. + [HAVE_ASM_GLOBAL_DOT_NAME] (HIDDEN_JUMPTARGET): Define as .__GI_name. + Otherwise defined as __GI_name. + (libc_hidden_data_def): New macro. Use hidden_data_def. + (libc_hidden_data_weak): New macro. Use hidden_data_weak. + (libc_hidden_data_ver): New macro. Use hidden_data_ver. + (rtld_hidden_data_def): New macro. Use hidden_data_def. + (rtld_hidden_data_weak): New macro. Use hidden_data_weak. + (rtld_hidden_data_ver): New macro. Use hidden_data_ver. + (libm_hidden_data_def): New macro. Use hidden_data_def. + (libm_hidden_data_weak): New macro. Use hidden_data_weak. + (libm_hidden_data_ver): New macro. Use hidden_data_ver. + * inet/in6_addr.c: Replace libc_hidden_def with libc_hidden_data_def. + 2002-09-17 Ulrich Drepper * include/libc-symbols.h: Change *hidden_proto macros to accept diff --git a/NEWS b/NEWS index 618e994ca0..6f3b06f631 100644 --- a/NEWS +++ b/NEWS @@ -52,7 +52,9 @@ Version 2.3 * Startup times are significantly reduced by not using exported functions inside the library itself. Changes by Jakub Jelinek, Roland McGrath, and Ulrich Drepper. -o + +* Steven Munroe contributed a port to PowerPC64/Linux. + Version 2.2.6 * The Hurd now uses the GNU libio implementation of stdio rather than the diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 0c219514b1..d322147f97 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -82,8 +82,15 @@ # define ASM_LINE_SEP ; #endif -#ifndef C_SYMBOL_DOT_NAME -# define C_SYMBOL_DOT_NAME(name) .##name +#ifdef HAVE_ASM_GLOBAL_DOT_NAME +# ifndef C_SYMBOL_DOT_NAME +# if defined __GNUC__ && defined __GNUC_MINOR__ \ + && (__GNUC__ << 16) + __GNUC_MINOR__ >= (3 << 16) + 1 +# define C_SYMBOL_DOT_NAME(name) .name +# else +# define C_SYMBOL_DOT_NAME(name) .##name +# endif +# endif #endif #ifndef __ASSEMBLER__ @@ -111,9 +118,21 @@ /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */ # define weak_extern(symbol) _weak_extern (symbol) # ifdef HAVE_ASM_WEAKEXT_DIRECTIVE -# define _weak_extern(symbol) asm (".weakext " __SYMBOL_PREFIX #symbol); +# ifdef HAVE_ASM_GLOBAL_DOT_NAME +# define _weak_extern(symbol) \ + asm (".weakext " __SYMBOL_PREFIX #symbol "\n\t" \ + ".weakext ." __SYMBOL_PREFIX #symbol); +# else +# define _weak_extern(symbol) asm (".weakext " __SYMBOL_PREFIX #symbol); +# endif # else -# define _weak_extern(symbol) asm (".weak " __SYMBOL_PREFIX #symbol); +# ifdef HAVE_ASM_GLOBAL_DOT_NAME +# define _weak_extern(symbol) \ + asm (".weak " __SYMBOL_PREFIX #symbol "\n\t" \ + ".weak ." __SYMBOL_PREFIX #symbol); +# else +# define _weak_extern(symbol) asm (".weak " __SYMBOL_PREFIX #symbol); +# endif # endif # else @@ -126,45 +145,67 @@ #else /* __ASSEMBLER__ */ # ifdef HAVE_ASM_SET_DIRECTIVE -# define strong_alias(original, alias) \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ +# ifdef HAVE_ASM_GLOBAL_DOT_NAME +# define strong_alias(original, alias) \ + ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ + .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) ASM_LINE_SEP \ + ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \ + .set C_SYMBOL_DOT_NAME (alias),C_SYMBOL_DOT_NAME (original) +# define strong_data_alias(original, alias) \ + ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) +# else +# define strong_alias(original, alias) \ + ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ + .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) +# define strong_data_alias(original, alias) strong_alias(original, alias) +# endif # else # ifdef HAVE_ASM_GLOBAL_DOT_NAME -# define strong_alias(original, alias) \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ - C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \ +# define strong_alias(original, alias) \ + ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ + C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \ + ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \ C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original) -# else -# define strong_alias(original, alias) \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ +# define strong_data_alias(original, alias) \ + ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) +# else +# define strong_alias(original, alias) \ + ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ + C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) +# define strong_data_alias(original, alias) strong_alias(original, alias) # endif # endif # ifdef HAVE_WEAK_SYMBOLS # ifdef HAVE_ASM_WEAKEXT_DIRECTIVE -# define weak_alias(original, alias) \ +# ifdef HAVE_ASM_GLOBAL_DOT_NAME +# define weak_alias(original, alias) \ + .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) ASM_LINE_SEP \ + .weakext C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original) +# else +# define weak_alias(original, alias) \ .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) -# define weak_extern(symbol) \ +# endif +# define weak_extern(symbol) \ .weakext C_SYMBOL_NAME (symbol) # else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */ # ifdef HAVE_ASM_GLOBAL_DOT_NAME -# define weak_alias(original, alias) \ - .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \ - C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \ +# define weak_alias(original, alias) \ + .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \ + C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \ + .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \ C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original) # else -# define weak_alias(original, alias) \ - .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \ +# define weak_alias(original, alias) \ + .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \ C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) # endif -# define weak_extern(symbol) \ +# define weak_extern(symbol) \ .weak C_SYMBOL_NAME (symbol) # endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */ @@ -364,15 +405,33 @@ # define default_symbol_version(real, name, version) \ _default_symbol_version(real, name, version) # ifdef __ASSEMBLER__ -# define _symbol_version(real, name, version) \ +# ifdef HAVE_ASM_GLOBAL_DOT_NAME +# define _symbol_version(real, name, version) \ + .symver real, name##@##version ASM_LINE_SEP \ + .symver .##real, .##name##@##version +# define _default_symbol_version(real, name, version) \ + .symver real, name##@##@##version ASM_LINE_SEP \ + .symver .##real, .##name##@##@##version +# else +# define _symbol_version(real, name, version) \ .symver real, name##@##version -# define _default_symbol_version(real, name, version) \ +# define _default_symbol_version(real, name, version) \ .symver real, name##@##@##version +# endif # else -# define _symbol_version(real, name, version) \ +# ifdef HAVE_ASM_GLOBAL_DOT_NAME +# define _symbol_version(real, name, version) \ + __asm__ (".symver " #real "," #name "@" #version "\n\t" \ + ".symver ." #real ",." #name "@" #version) +# define _default_symbol_version(real, name, version) \ + __asm__ (".symver " #real "," #name "@@" #version "\n\t" \ + ".symver ." #real ",." #name "@@" #version) +# else +# define _symbol_version(real, name, version) \ __asm__ (".symver " #real "," #name "@" #version) -# define _default_symbol_version(real, name, version) \ +# define _default_symbol_version(real, name, version) \ __asm__ (".symver " #real "," #name "@@" #version) +# endif # endif #else # define symbol_version(real, name, version) @@ -439,6 +498,21 @@ } libc_hidden_weak (foo) + Simularly for global data. If references to foo within libc.so should + always go to foo defined in libc.so, then in include/foo.h you add: + + libc_hidden_proto (foo) + + line and after foo's definition: + + int foo = INITIAL_FOO_VALUE; + libc_hidden_data_def (foo) + + or + + int foo = INITIAL_FOO_VALUE; + libc_hidden_data_weak (foo) + If foo is normally just an alias (strong or weak) of some other function, you should use the normal strong_alias first, then add libc_hidden_def or libc_hidden_weak: @@ -494,43 +568,63 @@ # define __hidden_def1(original, alias) \ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) -# else # ifdef HAVE_ASM_GLOBAL_DOT_NAME -# define __hidden_def1(original, alias) \ +# define __hidden_dot_def1(original, alias) ASM_LINE_SEP \ + ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \ + .set C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original) +# else +# define __hidden_dot_def1(original, alias) +# endif +# else +# define __hidden_def1(original, alias) \ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ - C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \ + C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) +# ifdef HAVE_ASM_GLOBAL_DOT_NAME +# define __hidden_dot_def1(original, alias) ASM_LINE_SEP \ ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \ C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original) # else -# define __hidden_def1(original, alias) \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ - C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) +# define __hidden_def1(original, alias) # endif # endif # define __hidden_def2(...) #__VA_ARGS__ # define __hidden_def3(...) __hidden_def2 (__VA_ARGS__) # define hidden_def(name) \ + __asm__ (__hidden_def3 (__hidden_def1 (__GI_##name, name) \ + __hidden_dot_def1 (__GI_##name, name))); +# define hidden_data_def(name) \ __asm__ (__hidden_def3 (__hidden_def1 (__GI_##name, name))); # define hidden_ver(local, name) \ + __asm__ (__hidden_def3 (__hidden_def1 (local, __GI_##name) \ + __hidden_dot_def1 (local, __GI_##name))); +# define hidden_data_ver(local, name) \ __asm__ (__hidden_def3 (__hidden_def1 (local, __GI_##name))); # ifdef HAVE_WEAK_SYMBOLS # ifdef HAVE_ASM_WEAKEXT_DIRECTIVE # define __hidden_weak1(original, alias) \ .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) -# else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */ # ifdef HAVE_ASM_GLOBAL_DOT_NAME -# define __hidden_weak1(original, alias) \ +# define __hidden_dot_weak1(original, alias) ASM_LINE_SEP \ + .weakext C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original) +# else +# define __hidden_dot_weak1(original, alias) +# endif +# else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */ +# define __hidden_weak1(original, alias) \ .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \ - C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \ + C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) +# ifdef HAVE_ASM_GLOBAL_DOT_NAME +# define __hidden_dot_weak1(original, alias) ASM_LINE_SEP \ ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \ C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original) # else -# define __hidden_weak1(original, alias) \ - .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \ - C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) +# define __hidden_dot_weak1(original, alias) # endif # endif # define hidden_weak(name) \ + __asm__ (__hidden_def3 (__hidden_weak1 (__GI_##name, name) \ + __hidden_dot_weak1 (__GI_##name, name))); +# define hidden_data_weak(name) \ __asm__ (__hidden_def3 (__hidden_weak1 (__GI_##name, name))); # else # define hidden_weak(name) hidden_def (name) @@ -548,7 +642,14 @@ # define hidden_def(name) strong_alias (name, __GI_##name) # define hidden_weak(name) hidden_def (name) # define hidden_ver(local, name) strong_alias (local, __GI_##name) -# define HIDDEN_JUMPTARGET(name) __GI_##name +# define hidden_data_def(name) strong_data_alias (name, __GI_##name) +# define hidden_data_weak(name) hidden_data_def (name) +# define hidden_data_ver(local, name) strong_data_alias (local, __GI_##name) +# ifdef HAVE_ASM_GLOBAL_DOT_NAME +# define HIDDEN_JUMPTARGET(name) .__GI_##name +# else +# define HIDDEN_JUMPTARGET(name) __GI_##name +# endif # endif #else # ifndef __ASSEMBLER__ @@ -559,6 +660,9 @@ # define hidden_weak(name) # define hidden_def(name) # define hidden_ver(local, name) +# define hidden_data_weak(name) +# define hidden_data_def(name) +# define hidden_data_ver(local, name) #endif #if !defined NOT_IN_libc @@ -566,11 +670,17 @@ # define libc_hidden_def(name) hidden_def (name) # define libc_hidden_weak(name) hidden_weak (name) # define libc_hidden_ver(local, name) hidden_ver (local, name) +# define libc_hidden_data_def(name) hidden_data_def (name) +# define libc_hidden_data_weak(name) hidden_data_weak (name) +# define libc_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libc_hidden_proto(name, attrs...) # define libc_hidden_def(name) # define libc_hidden_weak(name) # define libc_hidden_ver(local, name) +# define libc_hidden_data_def(name) +# define libc_hidden_data_weak(name) +# define libc_hidden_data_ver(local, name) #endif #if defined NOT_IN_libc && defined IS_IN_rtld @@ -578,11 +688,17 @@ # define rtld_hidden_def(name) hidden_def (name) # define rtld_hidden_weak(name) hidden_weak (name) # define rtld_hidden_ver(local, name) hidden_ver (local, name) +# define rtld_hidden_data_def(name) hidden_data_def (name) +# define rtld_hidden_data_weak(name) hidden_data_weak (name) +# define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define rtld_hidden_proto(name, attrs...) # define rtld_hidden_def(name) # define rtld_hidden_weak(name) # define rtld_hidden_ver(local, name) +# define rtld_hidden_data_def(name) +# define rtld_hidden_data_weak(name) +# define rtld_hidden_data_ver(local, name) #endif #if defined NOT_IN_libc && defined IS_IN_libm @@ -590,11 +706,17 @@ # define libm_hidden_def(name) hidden_def (name) # define libm_hidden_weak(name) hidden_weak (name) # define libm_hidden_ver(local, name) hidden_ver (local, name) +# define libm_hidden_data_def(name) hidden_data_def (name) +# define libm_hidden_data_weak(name) hidden_data_weak (name) +# define libm_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libm_hidden_proto(name, attrs...) # define libm_hidden_def(name) # define libm_hidden_weak(name) # define libm_hidden_ver(local, name) +# define libm_hidden_data_def(name) +# define libm_hidden_data_weak(name) +# define libm_hidden_data_ver(local, name) #endif #endif /* libc-symbols.h */ diff --git a/inet/in6_addr.c b/inet/in6_addr.c index 347d22e950..ab0753f444 100644 --- a/inet/in6_addr.c +++ b/inet/in6_addr.c @@ -21,7 +21,7 @@ const struct in6_addr in6addr_any = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }; -libc_hidden_def (in6addr_any) +libc_hidden_data_def (in6addr_any) const struct in6_addr in6addr_loopback = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }; -libc_hidden_def (in6addr_loopback) +libc_hidden_data_def (in6addr_loopback) diff --git a/malloc/Makefile b/malloc/Makefile index bb7d15db7b..78855c0f0d 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -81,6 +81,12 @@ ifneq ($(LIBGD),no) install-bin = memusagestat memusage generated += memusagestat memusage extra-objs += memusagestat.o + +# The configure.in check for libgd and its headers did not use $SYSINCLUDES. +# The directory specified by --with-headers usually contains only the basic +# kernel interface headers, not something like libgd. So the simplest thing +# is to presume that the standard system headers will be ok for this file. +$(objpfx)memusagestat.o: sysincludes = # nothing endif endif