diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-11-08 15:56:54 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-11-08 16:02:50 -0800 |
commit | dc8d2d90da3f191ae0461900ab98e3b29cc2b280 (patch) | |
tree | 810c9e619488f444ac0079866dc15714da1a2d9f /gold/layout.cc | |
parent | cb1a122cce8a7eefe1025d8d189c52f96da6138f (diff) | |
download | gdb-dc8d2d90da3f191ae0461900ab98e3b29cc2b280.zip gdb-dc8d2d90da3f191ae0461900ab98e3b29cc2b280.tar.gz gdb-dc8d2d90da3f191ae0461900ab98e3b29cc2b280.tar.bz2 |
gold: Ignore def/ref from a dynamic object for special symbols
Since special symbol must be defined in a regular object, definition
from a dynamic object should be ignored. If special symbol has the
hidden or internal visibility, reference from a dynamic object should
also be ignored. Also __start and __stop symbols in a dynamic object
shouldn't be preempted.
PR gold/22291
* layout.cc (Layout::define_section_symbols): Use STV_PROTECTED
for __start and __stop symbols.
* symtab.cc (Symbol_table::define_special_symbol): Add an
argument, visibility. Ignore definition and reference from
a dynamic object, depending on visibility.
(Symbol_table::do_define_in_output_data): Pass visibility to
define_special_symbol.
(Symbol_table::do_define_in_output_segment): Likewise.
(Symbol_table::do_define_as_constant): Likewise.
(Symbol_table::add_undefined_symbol_from_command_line): Pass
STV_DEFAULT to define_special_symbol.
* symtab.h (Symbol_table::define_special_symbol): Add an
argument, visibility.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r-- | gold/layout.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gold/layout.cc b/gold/layout.cc index 15c5434..351c4b4 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -2252,7 +2252,7 @@ Layout::define_section_symbols(Symbol_table* symtab) 0, // symsize elfcpp::STT_NOTYPE, elfcpp::STB_GLOBAL, - elfcpp::STV_DEFAULT, + elfcpp::STV_PROTECTED, 0, // nonvis false, // offset_is_from_end true); // only_if_ref @@ -2265,7 +2265,7 @@ Layout::define_section_symbols(Symbol_table* symtab) 0, // symsize elfcpp::STT_NOTYPE, elfcpp::STB_GLOBAL, - elfcpp::STV_DEFAULT, + elfcpp::STV_PROTECTED, 0, // nonvis true, // offset_is_from_end true); // only_if_ref |