Fix libc-start change for IRELless machines.
authorRoland McGrath <roland@hack.frob.com>
Wed, 22 Aug 2012 19:53:38 +0000 (12:53 -0700)
committerRoland McGrath <roland@hack.frob.com>
Wed, 22 Aug 2012 19:53:38 +0000 (12:53 -0700)
ChangeLog
csu/libc-start.c

index 5c2aea1..fbaadca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-22  Roland McGrath  <roland@hack.frob.com>
+
+       * csu/libc-start.c (apply_irel): Move extern declarations inside here.
+       Conditionalize whole body on [IREL].
+
 2012-08-22  Jeff Law <law@redhat.com>
 
        [BZ #14505]
index 7e541d4..e335b64 100644 (file)
@@ -62,18 +62,19 @@ uintptr_t __stack_chk_guard attribute_relro;
 #  define IREL         elf_irel
 # endif
 
-/* We use weak references for these so that we'll still work with a linker
-   that doesn't define them.  Such a linker doesn't support IFUNC at all
-   and so uses won't work, but a statically-linked program that doesn't
-   use any IFUNC symbols won't have a problem.  */
-extern const IREL_T IPLT_START[] __attribute__ ((weak));
-extern const IREL_T IPLT_END[] __attribute__ ((weak));
-
 static void
 apply_irel (void)
 {
+# ifdef IREL
+  /* We use weak references for these so that we'll still work with a linker
+     that doesn't define them.  Such a linker doesn't support IFUNC at all
+     and so uses won't work, but a statically-linked program that doesn't
+     use any IFUNC symbols won't have a problem.  */
+  extern const IREL_T IPLT_START[] __attribute__ ((weak));
+  extern const IREL_T IPLT_END[] __attribute__ ((weak));
   for (const IREL_T *ipltent = IPLT_START; ipltent < IPLT_END; ++ipltent)
     IREL (ipltent);
+# endif
 }
 #endif