summaryrefslogtreecommitdiff
path: root/gold/object.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-02-28 00:12:26 +0000
committerIan Lance Taylor <ian@airs.com>2009-02-28 00:12:26 +0000
commit2c3d87aa0312a665638d50559dd7f398062f0bf5 (patch)
treed24783176b244da7a103d2538b71afcc195b90ba /gold/object.cc
parent8e552455e294e526effce219e668dce0e75a8bd4 (diff)
downloadbinutils-redhat-2c3d87aa0312a665638d50559dd7f398062f0bf5.tar.gz
PR 7091
* output.cc (Output_section::find_starting_output_address): Rename from starting_output_address; add PADDR parameter; change return type. * output.h (class Output_section): Declare find_starting_output_address instead of starting_output_address. * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a section symbol for which we can't find a merge section.
Diffstat (limited to 'gold/object.cc')
-rw-r--r--gold/object.cc31
1 files changed, 21 insertions, 10 deletions
diff --git a/gold/object.cc b/gold/object.cc
index 76858021bc..82c5dd6e30 100644
--- a/gold/object.cc
+++ b/gold/object.cc
@@ -1554,20 +1554,31 @@ Sized_relobj<size, big_endian>::do_finalize_local_symbols(unsigned int index,
}
else if (out_offsets[shndx] == invalid_address)
{
+ uint64_t start;
+
// This is a SHF_MERGE section or one which otherwise
- // requires special handling. We get the output address
- // of the start of the merged section. If this is not a
- // section symbol, we can then determine the final
- // value. If it is a section symbol, we can not, as in
- // that case we have to consider the addend to determine
- // the value to use in a relocation.
+ // requires special handling.
if (!lv.is_section_symbol())
- lv.set_output_value(os->output_address(this, shndx,
- lv.input_value()));
+ {
+ // This is not a section symbol. We can determine
+ // the final value now.
+ lv.set_output_value(os->output_address(this, shndx,
+ lv.input_value()));
+ }
+ else if (!os->find_starting_output_address(this, shndx, &start))
+ {
+ // This is a section symbol, but apparently not one
+ // in a merged section. Just use the start of the
+ // output section. This happens with relocatable
+ // links when the input object has section symbols
+ // for arbitrary non-merge sections.
+ lv.set_output_value(os->address());
+ }
else
{
- section_offset_type start =
- os->starting_output_address(this, shndx);
+ // We have to consider the addend to determine the
+ // value to use in a relocation. START is the start
+ // of this input section.
Merged_symbol_value<size>* msv =
new Merged_symbol_value<size>(lv.input_value(), start);
lv.set_merged_symbol_value(msv);