aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorRoland McGrath <mcgrathr@google.com>2020-06-15 11:45:02 -0700
committerRoland McGrath <mcgrathr@google.com>2020-06-15 11:45:02 -0700
commitcae64165f47b64898c4f1982d294862cfae89a47 (patch)
treed51ade829ba19bebf17822647e08d49506d534b8 /ld/emultempl
parent669203174311c5be76744a879563c697cd479853 (diff)
downloadgdb-cae64165f47b64898c4f1982d294862cfae89a47.zip
gdb-cae64165f47b64898c4f1982d294862cfae89a47.tar.gz
gdb-cae64165f47b64898c4f1982d294862cfae89a47.tar.bz2
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.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/elf.em15
1 files changed, 15 insertions, 0 deletions
diff --git a/ld/emultempl/elf.em b/ld/emultempl/elf.em
index c4979eb..c577e8b 100644
--- a/ld/emultempl/elf.em
+++ b/ld/emultempl/elf.em
@@ -749,6 +749,21 @@ fragment <<EOF
{
link_info.flags_1 |= DF_1_GLOBAUDIT;
}
+ else if (CONST_STRNEQ (optarg, "start-stop-visibility="))
+ {
+ if (strcmp (optarg, "start-stop-visibility=default") == 0)
+ link_info.start_stop_visibility = STV_DEFAULT;
+ else if (strcmp (optarg, "start-stop-visibility=internal") == 0)
+ link_info.start_stop_visibility = STV_INTERNAL;
+ else if (strcmp (optarg, "start-stop-visibility=hidden") == 0)
+ link_info.start_stop_visibility = STV_HIDDEN;
+ else if (strcmp (optarg, "start-stop-visibility=protected") == 0)
+ link_info.start_stop_visibility = STV_PROTECTED;
+ else
+ einfo (_("%F%P: invalid visibility in \`-z %s'; "
+ "must be default, internal, hidden, or protected"),
+ optarg);
+ }
EOF
if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then