aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorVivek Das Mohapatra <vivek@collabora.com>2020-12-14 17:25:51 +0000
committerAlan Modra <amodra@gmail.com>2020-12-15 18:44:56 +1030
commit6a0a0dd0cc43765d8e5e277aeaaf169a863f2315 (patch)
tree776cc1a93737ca13d34c6f6c0c906134c7ddd46f /ld
parentee0688c2339deba4bca7d57a96001183aa06a765 (diff)
downloadgdb-6a0a0dd0cc43765d8e5e277aeaaf169a863f2315.zip
gdb-6a0a0dd0cc43765d8e5e277aeaaf169a863f2315.tar.gz
gdb-6a0a0dd0cc43765d8e5e277aeaaf169a863f2315.tar.bz2
Handle -z unique/-z nounique in ld
Add (or suppress) a DT_GNU_FLAGS_1 dynamic section with a bit flag value of DF_GNU_1_UNIQUE. bfd/ * elflink.c (bfd_elf_size_dynamic_sections): Call _bfd_elf_add_dynamic_entry to add a DT_GNU_FLAGS_1 section. include/ * bfdlink.h (struct bfd_link_info): New field gnu_flags_1. ld/ * emultempl/elf.em (gld${EMULATION_NAME}_handle_option): Parse -z unique / -z nounique options.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/emultempl/elf.em4
2 files changed, 9 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index b649e68..3db7fc6 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2020-12-15 Vivek Das Mohapatra <vivek@collabora.com>
+
+ * emultempl/elf.em (gld${EMULATION_NAME}_handle_option):
+ Parse -z unique / -z nounique options.
+
2020-12-14 Howard Chu <hyc@symas.com>
* libdep_plugin.c: New file: Processes archives that contain a
diff --git a/ld/emultempl/elf.em b/ld/emultempl/elf.em
index cfdf60e..aa40c78 100644
--- a/ld/emultempl/elf.em
+++ b/ld/emultempl/elf.em
@@ -809,6 +809,10 @@ fragment <<EOF
link_info.flags |= (bfd_vma) DF_ORIGIN;
link_info.flags_1 |= (bfd_vma) DF_1_ORIGIN;
}
+ else if (strcmp (optarg, "unique") == 0)
+ link_info.gnu_flags_1 |= (bfd_vma) DF_GNU_1_UNIQUE;
+ else if (strcmp (optarg, "nounique") == 0)
+ link_info.gnu_flags_1 &= ~(bfd_vma) DF_GNU_1_UNIQUE;
else if (strcmp (optarg, "combreloc") == 0)
link_info.combreloc = TRUE;
else if (strcmp (optarg, "nocombreloc") == 0)