Index: copy-relocs.cc =================================================================== RCS file: /cvs/src/src/gold/copy-relocs.cc,v retrieving revision 1.4.8.2 diff -p -u -r1.4.8.2 copy-relocs.cc --- copy-relocs.cc 4 Nov 2009 15:56:34 -0000 1.4.8.2 +++ copy-relocs.cc 13 Jan 2010 16:01:15 -0000 @@ -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:: 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");