diff options
author | Vivek Das Mohapatra <vivek@collabora.com> | 2020-12-14 17:25:55 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-12-15 18:45:24 +1030 |
commit | 8a87b2791181eb7fc1533ffaeb95df8d87d41493 (patch) | |
tree | 319ae3d0d3eb416a80f1b9b6a6799f6eed54b6c0 /gold/layout.cc | |
parent | af3c233bdb68e23b64a7453c1a08b4437ecd65b3 (diff) | |
download | fsf-binutils-gdb-8a87b2791181eb7fc1533ffaeb95df8d87d41493.zip fsf-binutils-gdb-8a87b2791181eb7fc1533ffaeb95df8d87d41493.tar.gz fsf-binutils-gdb-8a87b2791181eb7fc1533ffaeb95df8d87d41493.tar.bz2 |
Implement and document -z unique / -z nounique handling in gold
* layout.cc (Layout::finish_dynamic_section): Set DF_GNU_1_UNIQUE.
* options.h (class General_options): Handle -z unique, -z nounique.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r-- | gold/layout.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gold/layout.cc b/gold/layout.cc index dc88a9d..44664e2 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -5371,6 +5371,12 @@ Layout::finish_dynamic_section(const Input_objects* input_objects, flags |= elfcpp::DF_1_PIE; if (flags != 0) odyn->add_constant(elfcpp::DT_FLAGS_1, flags); + + flags = 0; + if (parameters->options().unique()) + flags |= elfcpp::DF_GNU_1_UNIQUE; + if (flags != 0) + odyn->add_constant(elfcpp::DT_GNU_FLAGS_1, flags); } // Set the size of the _DYNAMIC symbol table to be the size of the |