summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf/data2.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-07-02 14:40:18 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-07-02 14:40:18 +0000
commitbf16711e7c2daef9bc114760f1671165b6d1b05d (patch)
treeef21ab27ee202b9ecda73b1705ec22571161e011 /ld/testsuite/ld-elf/data2.c
parent33291a7b312f18e260e8a0946ebdb6bf90c37a36 (diff)
downloadbinutils-redhat-bf16711e7c2daef9bc114760f1671165b6d1b05d.tar.gz
Add a test for weak alias
* ld-elf/data2.c: New file. * ld-elf/weakdef1.c: Likewise. * ld-elf/shared.exp: Add tests for libdata2 and weakdef1.
Diffstat (limited to 'ld/testsuite/ld-elf/data2.c')
-rw-r--r--ld/testsuite/ld-elf/data2.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/data2.c b/ld/testsuite/ld-elf/data2.c
new file mode 100644
index 0000000000..c137b7ce5d
--- /dev/null
+++ b/ld/testsuite/ld-elf/data2.c
@@ -0,0 +1,9 @@
+int foo = 0;
+extern int foo_alias __attribute__ ((weak, alias ("foo")));
+
+void
+bar (void)
+{
+ foo = -1;
+}
+