This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix testsuite/ld-elf/pr21964-5.c


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f000c2b940e82736d8a58387d73ac48bc38a4220

commit f000c2b940e82736d8a58387d73ac48bc38a4220
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jan 31 12:42:28 2018 -0800

    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:
---
 ld/ChangeLog                    | 4 ++++
 ld/testsuite/ld-elf/pr21964-5.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]