From 40d7d93ff412f4c34cde3daa04890d5cd2e0d9c9 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Wed, 21 Dec 2016 17:32:39 -0800 Subject: Fix problem where version script causes predefined hidden symbol to be defined twice. When creating a predefined hidden symbol like _GLOBAL_OFFSET_TABLE_, gold was incorrectly letting a version script add a version to the symbol, resulting in two copies of the symbol, both STB_LOCAL, but one of which was grouped in the globals part of the symbol table. gold/ * symtab.cc (Symbol_table::define_special_symbol): Add is_forced_local parameter; if set, do not check version script. (Symbol_table::do_define_in_output_data): Pass is_forced_local for STB_LOCAL predefined symbols. (Symbol_table::do_define_in_output_segment): Likewise. (Symbol_table::do_define_in_output_segment): Likewise. (Symbol_table::do_define_as_constant): Likewise. * symtab.h (Symbol_table::define_special_symbol): Add is_forced_local parameter. Adjust all callers. * testsuite/Makefile.am (ver_test_8.sh): New test case. * testsuite/Makefile.in: Regenerate. * ver_test_8.sh: New test script. --- gold/symtab.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gold/symtab.h') diff --git a/gold/symtab.h b/gold/symtab.h index b26b4e04a6e..d0be59f7a34 100644 --- a/gold/symtab.h +++ b/gold/symtab.h @@ -1790,7 +1790,7 @@ class Symbol_table Sized_symbol* define_special_symbol(const char** pname, const char** pversion, bool only_if_ref, Sized_symbol** poldsym, - bool* resolve_oldsym); + bool* resolve_oldsym, bool is_forced_local); // Define a symbol in an Output_data, sized version. template -- cgit v1.2.3-65-gdbad