PR 11042
authorIan Lance Taylor <ian@airs.com>
Thu, 7 Jan 2010 19:32:59 +0000 (19:32 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 7 Jan 2010 19:32:59 +0000 (19:32 +0000)
* copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
object as needed.

gold/ChangeLog
gold/copy-relocs.cc

index 36ed7c9..b974662 100644 (file)
@@ -1,3 +1,9 @@
+2010-01-07  Ian Lance Taylor  <iant@google.com>
+
+       PR 11042
+       * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
+       object as needed.
+
 2010-01-07  Dmitry Gorbachev  <d.g.gorbachev@gmail.com>
            Ian Lance Taylor  <iant@google.com>
 
index 4a98f83..0501ea0 100644 (file)
@@ -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");