mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 01:28:46 +00:00
gold, ld: Implement -z start-stop-visibility=... option.
gold/
Implement -z start-stop-visibility=... option.
* options.h (class General_options): Handle -z start-stop-visibility=.
(General_options::start_stop_visibility_enum): New public method.
(General_options::set_start_stop_visibility_enum): New private method.
(General_options::start_stop_visibility_enum_): New private member.
* options.cc (General_options::General_options): Add initializer.
(General_options::finalize): Set this->start_stop_visibility_enum_
from string value.
* layout.cc (Layout::define_section_symbols): Use option setting.
bfd/
* elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
field of bfd_link_info.
include/
* bfdlink.h (struct bfd_link_info): New field start_stop_visibility.
ld/
* NEWS: Mention -z start-stop-visibility=... option for ELF.
* ld.texi (Options): Document -z start-stop-visibility=... option.
* ldmain.c (main): Initialize link_info.start_stop_visibility.
* emultempl/elf.em (gld${EMULATION_NAME}_handle_option):
Parse -z start-stop-visibility=... option.
This commit is contained in:
@@ -997,7 +997,8 @@ General_options::General_options()
|
||||
fix_v4bx_(FIX_V4BX_NONE),
|
||||
endianness_(ENDIANNESS_NOT_SET),
|
||||
discard_locals_(DISCARD_SEC_MERGE),
|
||||
orphan_handling_enum_(ORPHAN_PLACE)
|
||||
orphan_handling_enum_(ORPHAN_PLACE),
|
||||
start_stop_visibility_enum_(elfcpp::STV_PROTECTED)
|
||||
{
|
||||
// Turn off option registration once construction is complete.
|
||||
gold::options::ready_to_register = false;
|
||||
@@ -1169,6 +1170,19 @@ General_options::finalize()
|
||||
this->set_orphan_handling_enum(ORPHAN_ERROR);
|
||||
}
|
||||
|
||||
// Parse the -z start-stop-visibility argument.
|
||||
if (this->user_set_start_stop_visibility())
|
||||
{
|
||||
if (strcmp(this->start_stop_visibility(), "default") == 0)
|
||||
this->set_start_stop_visibility_enum(elfcpp::STV_DEFAULT);
|
||||
else if (strcmp(this->start_stop_visibility(), "internal") == 0)
|
||||
this->set_start_stop_visibility_enum(elfcpp::STV_INTERNAL);
|
||||
else if (strcmp(this->start_stop_visibility(), "hidden") == 0)
|
||||
this->set_start_stop_visibility_enum(elfcpp::STV_HIDDEN);
|
||||
else if (strcmp(this->start_stop_visibility(), "protected") == 0)
|
||||
this->set_start_stop_visibility_enum(elfcpp::STV_PROTECTED);
|
||||
}
|
||||
|
||||
// -M is equivalent to "-Map -".
|
||||
if (this->print_map() && !this->user_set_Map())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user