diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2018-01-31 12:42:28 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2018-01-31 12:42:28 -0800 |
commit | f000c2b940e82736d8a58387d73ac48bc38a4220 (patch) | |
tree | 32ae47cf603c513ae5878f9b062ec00e0447b30e /ld | |
parent | 07e5f5cf883c64f7bd8a2afa4302c0479670b03f (diff) | |
download | gdb-f000c2b940e82736d8a58387d73ac48bc38a4220.zip gdb-f000c2b940e82736d8a58387d73ac48bc38a4220.tar.gz gdb-f000c2b940e82736d8a58387d73ac48bc38a4220.tar.bz2 |
Fix testsuite/ld-elf/pr21964-5.c
Mark my_var as used. Otherwise it fails at -O2.
* testsuite/ld-elf/pr21964-5.c (my_var): Mark as used.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr21964-5.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index ba42294..2db90b5 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,7 @@ +2018-01-31 H.J. Lu <hongjiu.lu@intel.com> + + * testsuite/ld-elf/pr21964-5.c (my_var): Mark as used. + 2018-01-31 Maciej W. Rozycki <macro@mips.com> * testsuite/ld-elf/shared.exp: Fix a typo s/scrip/script/. diff --git a/ld/testsuite/ld-elf/pr21964-5.c b/ld/testsuite/ld-elf/pr21964-5.c index 56ed5a9..bc77422 100644 --- a/ld/testsuite/ld-elf/pr21964-5.c +++ b/ld/testsuite/ld-elf/pr21964-5.c @@ -9,7 +9,7 @@ extern int __start___verbose[]; extern int __stop___verbose[]; int bar (void) { - static int my_var __attribute__((section("__verbose"))) = 6; + static int my_var __attribute__((section("__verbose"), used)) = 6; int *ptr; ptr = (int*) dlsym(RTLD_DEFAULT, "__start___verbose"); if (!ptr || *ptr != 6) |