diff options
author | Doug Kwan <dougkwan@google.com> | 2009-06-05 18:16:31 +0000 |
---|---|---|
committer | Doug Kwan <dougkwan@google.com> | 2009-06-05 18:16:31 +0000 |
commit | 805bb01c4b93ddb2422af91ea8f76019c8e0c319 (patch) | |
tree | 6596ecdc1a777da42078340ffdeaa191f96cb2f6 /gold/object.cc | |
parent | b3ed98d264e2938d253d0b08b0bb51fbdc65c75b (diff) | |
download | gdb-805bb01c4b93ddb2422af91ea8f76019c8e0c319.zip gdb-805bb01c4b93ddb2422af91ea8f76019c8e0c319.tar.gz gdb-805bb01c4b93ddb2422af91ea8f76019c8e0c319.tar.bz2 |
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.cc | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gold/object.cc b/gold/object.cc index 75fb679..77ddce6 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. |