Browse Source

fix up ifdef checks so dl_iterate_phdr is defined in all the proper objects

Mike Frysinger 18 years ago
parent
commit
ee6aec88f2
2 changed files with 4 additions and 2 deletions
  1. 1 1
      ldso/ldso/Makefile.in
  2. 3 1
      ldso/ldso/dl-elf.c

+ 1 - 1
ldso/ldso/Makefile.in

@@ -5,7 +5,7 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
-CFLAGS-ldso := -DNOT_IN_libc -DIS_IN_rtld $(SSP_DISABLE_FLAGS)
+CFLAGS-ldso := -DNOT_IN_libc -DIS_IN_rtld $(SSP_DISABLE_FLAGS) -D_GNU_SOURCE
 
 # This stuff will not work with -fomit-frame-pointer
 CFLAGS-ldso += -fno-omit-frame-pointer

+ 3 - 1
ldso/ldso/dl-elf.c

@@ -793,8 +793,10 @@ void _dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info[], void
 {
 	__dl_parse_dynamic_info(dpnt, dynamic_info, debug_addr, load_off);
 }
+
+/* we want this in ldso.so and libdl.a but nowhere else */
 #ifdef __USE_GNU
-#if ! defined LIBDL || (! defined PIC && ! defined __PIC__)
+#if defined IS_IN_rtld || (defined IS_IN_libdl && ! defined SHARED)
 int
 __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, size_t size, void *data), void *data)
 {