summaryrefslogtreecommitdiff
path: root/gold/copy-relocs.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/copy-relocs.cc')
-rw-r--r--gold/copy-relocs.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gold/copy-relocs.cc b/gold/copy-relocs.cc
index 4a98f8366a..0501ea034b 100644
--- a/gold/copy-relocs.cc
+++ b/gold/copy-relocs.cc
@@ -132,6 +132,9 @@ Copy_relocs<sh_type, size, big_endian>::emit_copy_reloc(
while ((value & (addralign - 1)) != 0)
addralign >>= 1;
+ // Mark the dynamic object as needed for the --as-needed option.
+ sym->object()->set_is_needed();
+
if (this->dynbss_ == NULL)
{
this->dynbss_ = new Output_data_space(addralign, "** dynbss");