Use noclone attribute only for GCC 4.5 or newer
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 29 Jul 2015 18:20:04 +0000 (11:20 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 29 Jul 2015 18:20:04 +0000 (11:20 -0700)
noclone attribute was added to GCC 4.5.  We should check GCC version
before using it.

* ld-elf/pr18718.c (bar): Use noclone attribute only for GCC
4.5 or newer.

ld/testsuite/ChangeLog
ld/testsuite/ld-elf/pr18718.c

index a9e5a7b..267361f 100644 (file)
@@ -1,5 +1,10 @@
 2015-07-29  H.J. Lu  <hongjiu.lu@intel.com>
 
+       * ld-elf/pr18718.c (bar): Use noclone attribute only for GCC
+       4.5 or newer.
+
+2015-07-29  H.J. Lu  <hongjiu.lu@intel.com>
+
        * ld-size/size.exp: Move run-time support check.
 
 2015-07-28  Alan Modra  <amodra@gmail.com>
index 2f4c2a3..5ec1b9e 100644 (file)
@@ -11,7 +11,11 @@ new_foo (void)
 
 __asm__(".symver new_foo, foo@@VERS_2.0");
 
+#if defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 4005
 __attribute__ ((noinline, noclone))
+#else
+__attribute__ ((noinline))
+#endif
 int
 bar (void)
 {