summaryrefslogtreecommitdiff
path: root/gold/object.cc
diff options
context:
space:
mode:
authorDoug Kwan <dougkwan@google.com>2009-06-05 18:16:31 +0000
committerDoug Kwan <dougkwan@google.com>2009-06-05 18:16:31 +0000
commit58ac6c97d34ca0d272e9d64e62d2f312be6094c0 (patch)
treeb035193a090551c8c5d4c00512c3d629257abbb5 /gold/object.cc
parent415d12d7b7f57ab63215b99e229fff5c1edf35d8 (diff)
downloadbinutils-redhat-58ac6c97d34ca0d272e9d64e62d2f312be6094c0.tar.gz
2009-06-05 Doug Kwan <dougkwan@google.com>
* object.cc (Sized_relobj::Sized_relobj): Initialize discarded_eh_frame_shndx_ to -1U. (Sized_relobj::do_layout): Record index of a discard .eh_frame section. (Sized_relobj::do_count_local_symbols): Skip local symbols in a discarded .eh_frame section. (Sized_relobj::do_finalize_local_symbols): Ditto. * object.h (class Sized_relobj): Declare new member discarded_eh_frame_shndx_. * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test. (local_labels_test.o, local_labels_test): New rules. * testsuite/Makefile.in: Regenerate.
Diffstat (limited to 'gold/object.cc')
-rw-r--r--gold/object.cc24
1 files changed, 20 insertions, 4 deletions
diff --git a/gold/object.cc b/gold/object.cc
index 75fb67970e..77ddce6e38 100644
--- a/gold/object.cc
+++ b/gold/object.cc
@@ -327,7 +327,8 @@ Sized_relobj<size, big_endian>::Sized_relobj(
local_values_(),
local_got_offsets_(),
kept_comdat_sections_(),
- has_eh_frame_(false)
+ has_eh_frame_(false),
+ discarded_eh_frame_shndx_(-1U)
{
}
@@ -1295,7 +1296,13 @@ Sized_relobj<size, big_endian>::do_layout(Symbol_table* symtab,
&offset);
out_sections[i] = os;
if (offset == -1)
- out_section_offsets[i] = invalid_address;
+ {
+ // An object can contain at most one section holding exception
+ // frame information.
+ gold_assert(this->discarded_eh_frame_shndx_ == -1U);
+ this->discarded_eh_frame_shndx_ = i;
+ out_section_offsets[i] = invalid_address;
+ }
else
out_section_offsets[i] = convert_types<Address, off_t>(offset);
@@ -1453,7 +1460,8 @@ Sized_relobj<size, big_endian>::do_count_local_symbols(Stringpool* pool,
// Decide whether this symbol should go into the output file.
- if (shndx < shnum && out_sections[shndx] == NULL)
+ if ((shndx < shnum && out_sections[shndx] == NULL)
+ || (shndx == this->discarded_eh_frame_shndx_))
{
lv.set_no_output_symtab_entry();
gold_assert(!lv.needs_output_dynsym_entry());
@@ -1558,7 +1566,15 @@ Sized_relobj<size, big_endian>::do_finalize_local_symbols(unsigned int index,
// This is a SHF_MERGE section or one which otherwise
// requires special handling.
- if (!lv.is_section_symbol())
+ if (shndx == this->discarded_eh_frame_shndx_)
+ {
+ // This local symbol belongs to a discarded .eh_frame
+ // section. Just treat it like the case in which
+ // os == NULL above.
+ gold_assert(this->has_eh_frame_);
+ continue;
+ }
+ else if (!lv.is_section_symbol())
{
// This is not a section symbol. We can determine
// the final value now.