binutils testsuite

Guy Dalziel krendoshazin at gmail.com
Sun Jun 14 10:02:41 MDT 2009


Whenever I ran the binutils testsuite it would always end with an error,
the attached patch fixes this and allows the binutils testsuite to 
finish properly. Credit for this goes to Jan Kratochvil at nabble.com.
-------------- next part --------------
--- binutils-2.19.1/ld/testsuite/ld-elfcomm/common1b.c	2003-04-15 09:38:10.000000000 +0000
+++ binutils-2.19.1-patched/ld/testsuite/ld-elfcomm/common1b.c	2009-06-14 13:58:17.861108210 +0000
@@ -1,3 +1,7 @@
-static char dummy1 = 'X';
+static
+#if     __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
+  __attribute__((__used__))
+#endif  /* !__GNUC__ */
+  char dummy1 = 'X';
 char foo1 [] = "Aligned at odd byte.";
 char foo2 [4];
--- binutils-2.19.1/ld/testsuite/ld-shared/main.c	2001-06-06 21:03:59.000000000 +0000
+++ binutils-2.19.1-patched/ld/testsuite/ld-shared/main.c	2009-06-14 13:58:17.861108210 +0000
@@ -38,8 +38,6 @@
 int
 main ()
 {
-  int (*p) ();
-
   printf ("mainvar == %d\n", mainvar);
   printf ("overriddenvar == %d\n", overriddenvar);
   printf ("shlibvar1 == %d\n", shlibvar1);
@@ -62,21 +60,29 @@
   printf ("shlib_checkfunptr2 (main_called) == %d\n",
 	  shlib_checkfunptr2 (main_called));
 #endif
-  p = shlib_getfunptr1 ();
-  printf ("shlib_getfunptr1 () ");
-  if (p == shlib_shlibvar1)
-    printf ("==");
-  else
-    printf ("!=");
-  printf (" shlib_shlibvar1\n");
+  {
+    int (*p) ();
+
+    p = shlib_getfunptr1 ();
+    printf ("shlib_getfunptr1 () ");
+    if (p == shlib_shlibvar1)
+      printf ("==");
+    else
+      printf ("!=");
+    printf (" shlib_shlibvar1\n");
+  }
 #ifndef XCOFF_TEST
-  p = shlib_getfunptr2 ();
-  printf ("shlib_getfunptr2 () ");
-  if (p == main_called)
-    printf ("==");
-  else
-    printf ("!=");
-  printf (" main_called\n");
+  {
+    int (*p) ();
+
+    p = shlib_getfunptr2 ();
+    printf ("shlib_getfunptr2 () ");
+    if (p == main_called)
+      printf ("==");
+    else
+      printf ("!=");
+    printf (" main_called\n");
+  }
 #endif
 #endif
   printf ("shlib_check () == %d\n", shlib_check ());


More information about the lfs-dev mailing list