]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Bring over from mainline:
authorIan Lance Taylor <ian@airs.com>
Wed, 13 Jan 2010 16:13:20 +0000 (16:13 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 13 Jan 2010 16:13:20 +0000 (16:13 +0000)
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.

gold/ChangeLog
gold/copy-relocs.cc

index d9c28706e867f25a6b977b68c28a8cdf290b8bed..e3f226365e3911cac8fcc7bb146294e94a105ac2 100644 (file)
@@ -1,3 +1,12 @@
+2010-01-13  Ian Lance Taylor  <iant@google.com>
+
+       Bring over from mainline:
+       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-13  Ian Lance Taylor  <iant@google.com>
 
        Bring over from mainline:
index 345c0c64cebec43cc374abfd97d29ed4a7027996..919b03f56a8eb21d152b451e10e2dfe5a63ec996 100644 (file)
@@ -1,6 +1,6 @@
 // copy-relocs.cc -- handle COPY relocations for gold.
 
-// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -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");