This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
gold patch committed: Only call add_dynamic_reloc for a dynamic reloc
- From: Ian Lance Taylor <iant at google dot com>
- To: binutils at sourceware dot org
- Date: Fri, 16 Dec 2011 15:48:03 -0800
- Subject: gold patch committed: Only call add_dynamic_reloc for a dynamic reloc
This minor cleanup patch to gold only calls add_dynamic_reloc if we are
in fact adding a dynamic reloc. Previously this was called for any
reloc. In practice this only made a difference when using
--emit-relocs. Committed to mainline.
Ian
2011-12-16 Ian Lance Taylor <iant@google.com>
* output.h (Output_data_reloc_generic::add): Only call
add_dynamic_reloc if this is a dynamic reloc section.
Index: output.h
===================================================================
RCS file: /cvs/src/src/gold/output.h,v
retrieving revision 1.130
diff -p -u -r1.130 output.h
--- output.h 10 Oct 2011 17:29:52 -0000 1.130
+++ output.h 16 Dec 2011 23:46:18 -0000
@@ -1458,7 +1458,8 @@ class Output_data_reloc_base : public Ou
{
this->relocs_.push_back(reloc);
this->set_current_data_size(this->relocs_.size() * reloc_size);
- od->add_dynamic_reloc();
+ if (dynamic)
+ od->add_dynamic_reloc();
if (reloc.is_relative())
this->bump_relative_reloc_count();
Sized_relobj<size, big_endian>* relobj = reloc.get_relobj();