Fix testcases compilation failures due to unused variables.

* ld-elfcomm/common1b.c (dummy1): Mark the variable for GCC as USED.
	* ld-shared/main.c (main): Move the P variable only to the places where
	it is used.
This commit is contained in:
Jan Kratochvil 2008-09-17 07:43:49 +00:00
parent 1c4a0acdd3
commit 32649b97b9
3 changed files with 34 additions and 17 deletions

View File

@ -1,3 +1,10 @@
2008-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix testcases compilation failures due to unused variables.
* ld-elfcomm/common1b.c (dummy1): Mark the variable for GCC as USED.
* ld-shared/main.c (main): Move the P variable only to the places where
it is used.
2008-09-16 H.J. Lu <hongjiu.lu@intel.com> 2008-09-16 H.J. Lu <hongjiu.lu@intel.com>
PR ld/6877 PR ld/6877

View File

@ -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 foo1 [] = "Aligned at odd byte.";
char foo2 [4]; char foo2 [4];

View File

@ -38,8 +38,6 @@ shlib_overriddencall2 ()
int int
main () main ()
{ {
int (*p) ();
printf ("mainvar == %d\n", mainvar); printf ("mainvar == %d\n", mainvar);
printf ("overriddenvar == %d\n", overriddenvar); printf ("overriddenvar == %d\n", overriddenvar);
printf ("shlibvar1 == %d\n", shlibvar1); printf ("shlibvar1 == %d\n", shlibvar1);
@ -62,21 +60,29 @@ main ()
printf ("shlib_checkfunptr2 (main_called) == %d\n", printf ("shlib_checkfunptr2 (main_called) == %d\n",
shlib_checkfunptr2 (main_called)); shlib_checkfunptr2 (main_called));
#endif #endif
p = shlib_getfunptr1 (); {
printf ("shlib_getfunptr1 () "); int (*p) ();
if (p == shlib_shlibvar1)
printf ("=="); p = shlib_getfunptr1 ();
else printf ("shlib_getfunptr1 () ");
printf ("!="); if (p == shlib_shlibvar1)
printf (" shlib_shlibvar1\n"); printf ("==");
else
printf ("!=");
printf (" shlib_shlibvar1\n");
}
#ifndef XCOFF_TEST #ifndef XCOFF_TEST
p = shlib_getfunptr2 (); {
printf ("shlib_getfunptr2 () "); int (*p) ();
if (p == main_called)
printf ("=="); p = shlib_getfunptr2 ();
else printf ("shlib_getfunptr2 () ");
printf ("!="); if (p == main_called)
printf (" main_called\n"); printf ("==");
else
printf ("!=");
printf (" main_called\n");
}
#endif #endif
#endif #endif
printf ("shlib_check () == %d\n", shlib_check ()); printf ("shlib_check () == %d\n", shlib_check ());