Index: binutils/gold/copy-relocs.cc |
diff --git a/binutils/gold/copy-relocs.cc b/binutils/gold/copy-relocs.cc |
index 6ef72d3ed38677ca903142989e4ba28c5cd6ee4b..919b03f56a8eb21d152b451e10e2dfe5a63ec996 100644 |
--- a/binutils/gold/copy-relocs.cc |
+++ b/binutils/gold/copy-relocs.cc |
@@ -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,13 +132,16 @@ 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"); |
layout->add_output_section_data(".bss", |
elfcpp::SHT_NOBITS, |
elfcpp::SHF_ALLOC | elfcpp::SHF_WRITE, |
- this->dynbss_); |
+ this->dynbss_, false); |
} |
Output_data_space* dynbss = this->dynbss_; |