PR 11042
	* copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
	object as needed.
diff --git a/gold/copy-relocs.cc b/gold/copy-relocs.cc
index 4a98f83..0501ea0 100644
--- a/gold/copy-relocs.cc
+++ b/gold/copy-relocs.cc
@@ -132,6 +132,9 @@
   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");