summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elfcomm
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2008-09-17 07:43:49 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2008-09-17 07:43:49 +0000
commit3258a3b1ec9beaa5d48e985e56cbf9964b2f8be3 (patch)
treecca56e4ec7f1c0cafbf2aa3d44a8dae3a0126aef /ld/testsuite/ld-elfcomm
parent9d38ce86624b4cb3ab9b9f026042bbb8c5934177 (diff)
downloadbinutils-redhat-3258a3b1ec9beaa5d48e985e56cbf9964b2f8be3.tar.gz
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.
Diffstat (limited to 'ld/testsuite/ld-elfcomm')
-rw-r--r--ld/testsuite/ld-elfcomm/common1b.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ld/testsuite/ld-elfcomm/common1b.c b/ld/testsuite/ld-elfcomm/common1b.c
index 4ed9e039c0..a375c90247 100644
--- a/ld/testsuite/ld-elfcomm/common1b.c
+++ b/ld/testsuite/ld-elfcomm/common1b.c
@@ -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];