aboutsummaryrefslogtreecommitdiff
path: root/gold/testsuite
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-03-16 23:51:19 +0000
committerIan Lance Taylor <iant@google.com>2008-03-16 23:51:19 +0000
commitd1f003c610e39314803fa3fd4f311230729d3616 (patch)
tree221e357d029f9eb1bbd14c02ffbdf37cf5d2d8e0 /gold/testsuite
parentda6b876ee6e7599e1fd07514b77f1c4a6ae7dca6 (diff)
downloadgdb-d1f003c610e39314803fa3fd4f311230729d3616.zip
gdb-d1f003c610e39314803fa3fd4f311230729d3616.tar.gz
gdb-d1f003c610e39314803fa3fd4f311230729d3616.tar.bz2
Fix handling of RELA relative relocs against local symbols in merge
sections.
Diffstat (limited to 'gold/testsuite')
-rw-r--r--gold/testsuite/two_file_test.h4
-rw-r--r--gold/testsuite/two_file_test_1.cc16
-rw-r--r--gold/testsuite/two_file_test_2.cc7
-rw-r--r--gold/testsuite/two_file_test_main.cc1
4 files changed, 28 insertions, 0 deletions
diff --git a/gold/testsuite/two_file_test.h b/gold/testsuite/two_file_test.h
index 88aa234..32a247f 100644
--- a/gold/testsuite/two_file_test.h
+++ b/gold/testsuite/two_file_test.h
@@ -69,3 +69,7 @@ extern const wchar_t* f15();
extern bool t16();
extern bool t16a();
+
+extern bool t17();
+extern const char* t17data[];
+#define T17_COUNT 5
diff --git a/gold/testsuite/two_file_test_1.cc b/gold/testsuite/two_file_test_1.cc
index 2c3b9c9..7646838 100644
--- a/gold/testsuite/two_file_test_1.cc
+++ b/gold/testsuite/two_file_test_1.cc
@@ -47,6 +47,7 @@
// 14 Compare string constants in file 1 and file 2.
// 15 Compare wide string constants in file 1 and file 2.
// 16 Call a function directly after its address has been taken.
+// 17 File 1 checks array of string constants defined in file 2.
#include "two_file_test.h"
@@ -203,3 +204,18 @@ t16()
{
return f10() == 135;
}
+
+// 17 File 1 checks array of string constants defined in file 2.
+
+bool
+t17()
+{
+ char c = 'a';
+ for (int i = 0; i < T17_COUNT; ++i)
+ {
+ if (t17data[i][0] != c || t17data[i][1] != '\0')
+ return false;
+ ++c;
+ }
+ return true;
+}
diff --git a/gold/testsuite/two_file_test_2.cc b/gold/testsuite/two_file_test_2.cc
index b922856..3888bef 100644
--- a/gold/testsuite/two_file_test_2.cc
+++ b/gold/testsuite/two_file_test_2.cc
@@ -114,3 +114,10 @@ f15()
{
return TEST_WIDE_STRING_CONSTANT;
}
+
+// 17 File 1 checks array of string constants defined in file 2.
+
+const char* t17data[T17_COUNT] =
+{
+ "a", "b", "c", "d", "e"
+};
diff --git a/gold/testsuite/two_file_test_main.cc b/gold/testsuite/two_file_test_main.cc
index 5f2ff56..c69d6e0 100644
--- a/gold/testsuite/two_file_test_main.cc
+++ b/gold/testsuite/two_file_test_main.cc
@@ -51,5 +51,6 @@ main()
assert(t13());
assert(t16());
assert(t16a());
+ assert(t17());
return 0;
}