aboutsummaryrefslogtreecommitdiff
path: root/gold/testsuite
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-04-07 22:46:17 +0000
committerIan Lance Taylor <ian@airs.com>2008-04-07 22:46:17 +0000
commit624f881062a90cbd4675e7b826225c232c39050e (patch)
treee9a126aef21b68223532b4da5d2ccc6cf51717bf /gold/testsuite
parent6835af537eec580a0f4f2064d0e11e378c86b39e (diff)
downloadgdb-624f881062a90cbd4675e7b826225c232c39050e.zip
gdb-624f881062a90cbd4675e7b826225c232c39050e.tar.gz
gdb-624f881062a90cbd4675e7b826225c232c39050e.tar.bz2
* output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
addend parameter. Change caller. Handle merge sections. (Output_reloc<SHT_REL>::symbol_value): Change parameter type from Address to Addend. Don't add in the result of local_section_offset, pass down the addend and use the returned value. * output.h (class Output_reloc<SHT_REL>): Add Addend typedef. Update declarations of local_section_offset and symbol_value. * testsuite/two_file_test_1.cc (t18): New function. * testsuite/two_file_test_2.cc (f18): New function. * testsuite/two_file_test_main.cc (main): Call t18. * testsuite/two_file_test.h (t18, f18): Declare.
Diffstat (limited to 'gold/testsuite')
-rw-r--r--gold/testsuite/two_file_test.h3
-rw-r--r--gold/testsuite/two_file_test_1.cc17
-rw-r--r--gold/testsuite/two_file_test_2.cc22
-rw-r--r--gold/testsuite/two_file_test_main.cc1
4 files changed, 43 insertions, 0 deletions
diff --git a/gold/testsuite/two_file_test.h b/gold/testsuite/two_file_test.h
index 32a247f..d89f050 100644
--- a/gold/testsuite/two_file_test.h
+++ b/gold/testsuite/two_file_test.h
@@ -73,3 +73,6 @@ extern bool t16a();
extern bool t17();
extern const char* t17data[];
#define T17_COUNT 5
+
+extern bool t18();
+extern const char* f18(int);
diff --git a/gold/testsuite/two_file_test_1.cc b/gold/testsuite/two_file_test_1.cc
index 7646838..8b4c8ad 100644
--- a/gold/testsuite/two_file_test_1.cc
+++ b/gold/testsuite/two_file_test_1.cc
@@ -48,6 +48,7 @@
// 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.
+// 18 File 1 checks string constants referenced in code in file 2.
#include "two_file_test.h"
@@ -219,3 +220,19 @@ t17()
}
return true;
}
+
+// 18 File 1 checks string constants referenced in code in file 2.
+
+bool
+t18()
+{
+ char c = 'a';
+ for (int i = 0; i < T17_COUNT; ++i)
+ {
+ const char* s = f18(i);
+ if (s[0] != c || s[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 3888bef..e1aeaf4 100644
--- a/gold/testsuite/two_file_test_2.cc
+++ b/gold/testsuite/two_file_test_2.cc
@@ -121,3 +121,25 @@ const char* t17data[T17_COUNT] =
{
"a", "b", "c", "d", "e"
};
+
+// 18 File 1 checks string constants referenced directly in file 2.
+
+const char*
+f18(int i)
+{
+ switch (i)
+ {
+ case 0:
+ return "a";
+ case 1:
+ return "b";
+ case 2:
+ return "c";
+ case 3:
+ return "d";
+ case 4:
+ return "e";
+ default:
+ return 0;
+ }
+}
diff --git a/gold/testsuite/two_file_test_main.cc b/gold/testsuite/two_file_test_main.cc
index c69d6e0..b7e3838 100644
--- a/gold/testsuite/two_file_test_main.cc
+++ b/gold/testsuite/two_file_test_main.cc
@@ -52,5 +52,6 @@ main()
assert(t16());
assert(t16a());
assert(t17());
+ assert(t18());
return 0;
}