This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gold patch obvious] Fix problem where TEXTREL is set incorrectly
- From: Cary Coutant <ccoutant at google dot com>
- To: Binutils <binutils at sourceware dot org>, Ian Lance Taylor <iant at google dot com>
- Date: Thu, 23 Dec 2010 11:54:55 -0800
- Subject: [gold patch obvious] Fix problem where TEXTREL is set incorrectly
When a TLS_GD relocation is seen (and not optimized), gold creates a
pair of GOT entries with dynamic relocations, but sets the
has_dynamic_reloc flag on the section which is the target of the
relocation rather than the GOT section where the relocation applies.
This causes gold to set the TEXTREL flag in the dynamic table even
though the text segment has no dynamic relocations.
I will commit the following patch as obvious and trivial. (The missing
Output_data* parameter from the second form of the function was
undetected previously because that form is never called.)
-cary
* output.h (Output_data_reloc::add_output_section): Pass OD instead
of OS to this->add. Add OD parameter to second form of the function.
Index: output.h
===================================================================
RCS file: /cvs/src/src/gold/output.h,v
retrieving revision 1.117
diff -u -p -r1.117 output.h
--- output.h 16 Nov 2010 19:18:31 -0000 1.117
+++ output.h 23 Dec 2010 19:42:15 -0000
@@ -1789,13 +1789,13 @@ class Output_data_reloc<elfcpp::SHT_RELA
void
add_output_section(Output_section* os, unsigned int type, Output_data* od,
Address address, Addend addend)
- { this->add(os, Output_reloc_type(os, type, od, address, addend)); }
+ { this->add(od, Output_reloc_type(os, type, od, address, addend)); }
void
- add_output_section(Output_section* os, unsigned int type,
+ add_output_section(Output_section* os, unsigned int type, Output_data* od,
Sized_relobj<size, big_endian>* relobj,
unsigned int shndx, Address address, Addend addend)
- { this->add(os, Output_reloc_type(os, type, relobj, shndx, address,
+ { this->add(od, Output_reloc_type(os, type, relobj, shndx, address,
addend)); }
// Add an absolute relocation.