From 1650c4ff500bc54eea33d31ae9396434a3e13733 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 12 Mar 2008 04:38:42 +0000 Subject: Combine read-only .eh_frame sections with read-write .eh_frame sections. --- gold/object.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gold/object.cc') diff --git a/gold/object.cc b/gold/object.cc index 98bcb62..109dce4 100644 --- a/gold/object.cc +++ b/gold/object.cc @@ -226,7 +226,7 @@ Sized_relobj::check_eh_frame_flags( { return (shdr->get_sh_size() > 0 && shdr->get_sh_type() == elfcpp::SHT_PROGBITS - && shdr->get_sh_flags() == elfcpp::SHF_ALLOC); + && (shdr->get_sh_flags() & elfcpp::SHF_ALLOC) != 0); } // Return whether there is a GNU .eh_frame section, given the section @@ -275,8 +275,11 @@ Sized_relobj::do_read_symbols(Read_symbols_data* sd) const unsigned char* namesu = sd->section_names->data(); const char* names = reinterpret_cast(namesu); - if (this->find_eh_frame(pshdrs, names, sd->section_names_size)) - this->has_eh_frame_ = true; + if (memmem(names, sd->section_names_size, ".eh_frame", 10) != NULL) + { + if (this->find_eh_frame(pshdrs, names, sd->section_names_size)) + this->has_eh_frame_ = true; + } sd->symbols = NULL; sd->symbols_size = 0; -- cgit v1.1