diff options
author | Ian Lance Taylor <ian@airs.com> | 2009-02-28 00:12:26 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2009-02-28 00:12:26 +0000 |
commit | e29e076ab80ed58ab0343c9910e02df7220233f8 (patch) | |
tree | 20a8d5b7d3ae61e0551d66d89799f6ff7d209f8d /gold/output.cc | |
parent | a5a437df7713387228e9ba87aa1e20b33ae20fb1 (diff) | |
download | gdb-e29e076ab80ed58ab0343c9910e02df7220233f8.zip gdb-e29e076ab80ed58ab0343c9910e02df7220233f8.tar.gz gdb-e29e076ab80ed58ab0343c9910e02df7220233f8.tar.bz2 |
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/output.cc')
-rw-r--r-- | gold/output.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gold/output.cc b/gold/output.cc index 0f45ca1..f2ec6ee 100644 --- a/gold/output.cc +++ b/gold/output.cc @@ -1,6 +1,6 @@ // output.cc -- manage the output file for gold -// Copyright 2006, 2007, 2008 Free Software Foundation, Inc. +// Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc. // Written by Ian Lance Taylor <iant@google.com>. // This file is part of gold. @@ -2057,12 +2057,13 @@ Output_section::output_address(const Relobj* object, unsigned int shndx, gold_unreachable(); } -// Return the output address of the start of the merged section for +// Find the output address of the start of the merged section for // input section SHNDX in object OBJECT. -uint64_t -Output_section::starting_output_address(const Relobj* object, - unsigned int shndx) const +bool +Output_section::find_starting_output_address(const Relobj* object, + unsigned int shndx, + uint64_t* paddr) const { uint64_t addr = this->address() + this->first_input_offset_; for (Input_section_list::const_iterator p = this->input_sections_.begin(); @@ -2076,11 +2077,16 @@ Output_section::starting_output_address(const Relobj* object, // Unfortunately we don't know for sure that input offset 0 is // mapped at all. if (p->is_merge_section_for(object, shndx)) - return addr; + { + *paddr = addr; + return true; + } addr += p->data_size(); } - gold_unreachable(); + + // We couldn't find a merge output section for this input section. + return false; } // Set the data size of an Output_section. This is where we handle |