From: H.J. Lu Date: Wed, 31 Jan 2018 20:42:28 +0000 (-0800) Subject: Fix testsuite/ld-elf/pr21964-5.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f000c2b940e82736d8a58387d73ac48bc38a4220;p=binutils-gdb.git 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. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index ba42294a9ad..2db90b5157b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,7 @@ +2018-01-31 H.J. Lu + + * testsuite/ld-elf/pr21964-5.c (my_var): Mark as used. + 2018-01-31 Maciej W. Rozycki * 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 56ed5a9eed2..bc77422a566 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)