This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
gold patch committed to 2.20 branch: Fix PR 11042
- From: Ian Lance Taylor <iant at google dot com>
- To: binutils at sourceware dot org
- Date: Wed, 13 Jan 2010 08:13:53 -0800
- Subject: gold patch committed to 2.20 branch: Fix PR 11042
I have committed this patch to the 2.20 branch. It's a copy of a
mainline patch.
Ian
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.
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 <iant@google.com>.
// This file is part of gold.
@@ -132,6 +132,9 @@ Copy_relocs<sh_type, size, big_endian>::
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");