aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf/pr13250-3.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2011-10-08 16:51:11 +0000
committerH.J. Lu <hjl.tools@gmail.com>2011-10-08 16:51:11 +0000
commit3e0882af52d7a4b40de87c0be36f1b5bc84ddadb (patch)
tree8356aa5ce3049354ee8dfb631f7f4b98d8591ec2 /ld/testsuite/ld-elf/pr13250-3.c
parentc3df8c14822028ab319894b4c02c519073b62dba (diff)
downloadgdb-3e0882af52d7a4b40de87c0be36f1b5bc84ddadb.zip
gdb-3e0882af52d7a4b40de87c0be36f1b5bc84ddadb.tar.gz
gdb-3e0882af52d7a4b40de87c0be36f1b5bc84ddadb.tar.bz2
Preserve the maximum alignment/size for common symbols.
bfd/ 2011-10-08 H.J. Lu <hongjiu.lu@intel.com> PR ld/13250 * elflink.c (elf_link_add_object_symbols): Preserve the maximum alignment and size for common symbols. ld/testsuite/ 2011-10-08 H.J. Lu <hongjiu.lu@intel.com> PR ld/13250 * ld-elf/shared.exp (build_tests): Add tests for PR ld/13250. (run_tests): Likewise. * ld-elf/pr13250-1.c: New. * ld-elf/pr13250-2.c: Likewise. * ld-elf/pr13250-3.c: Likewise.
Diffstat (limited to 'ld/testsuite/ld-elf/pr13250-3.c')
-rw-r--r--ld/testsuite/ld-elf/pr13250-3.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/pr13250-3.c b/ld/testsuite/ld-elf/pr13250-3.c
new file mode 100644
index 0000000..a227670
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr13250-3.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int common1[1];
+char common2[2];
+
+extern int bar ();
+
+int
+main ()
+{
+ int i;
+ if (bar () != -1)
+ abort ();
+ if (common1[0] != -1)
+ abort ();
+ for (i = 0; i < sizeof (common2)/ sizeof (common2[0]); i++)
+ if (common2[i] != 0)
+ abort ();
+ printf ("PASS\n");
+ return 0;
+}