From: Ian Lance Taylor Date: Wed, 13 Jan 2010 16:13:20 +0000 (+0000) Subject: Bring over from mainline: X-Git-Tag: binutils-2_20_1~74 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=30b1dc711c02056fa4725592be2d5d53ec070780;p=thirdparty%2Fbinutils-gdb.git Bring over from mainline: 2010-01-07 Ian Lance Taylor PR 11042 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic object as needed. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index d9c28706e86..e3f226365e3 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,12 @@ +2010-01-13 Ian Lance Taylor + + Bring over from mainline: + 2010-01-07 Ian Lance Taylor + + PR 11042 + * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic + object as needed. + 2010-01-13 Ian Lance Taylor Bring over from mainline: diff --git a/gold/copy-relocs.cc b/gold/copy-relocs.cc index 345c0c64ceb..919b03f56a8 100644 --- a/gold/copy-relocs.cc +++ b/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 . // This file is part of gold. @@ -132,6 +132,9 @@ Copy_relocs::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");