aboutsummaryrefslogtreecommitdiff
path: root/gold/object.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-03-12 04:38:42 +0000
committerIan Lance Taylor <iant@google.com>2008-03-12 04:38:42 +0000
commit1650c4ff500bc54eea33d31ae9396434a3e13733 (patch)
tree36c7a4a10c6005e8ab65e0afb8b9230d49a50c39 /gold/object.cc
parente00eeb0a11ba17abc1166adb7f94097ae37c470c (diff)
downloadgdb-1650c4ff500bc54eea33d31ae9396434a3e13733.zip
gdb-1650c4ff500bc54eea33d31ae9396434a3e13733.tar.gz
gdb-1650c4ff500bc54eea33d31ae9396434a3e13733.tar.bz2
Combine read-only .eh_frame sections with read-write .eh_frame
sections.
Diffstat (limited to 'gold/object.cc')
-rw-r--r--gold/object.cc9
1 files changed, 6 insertions, 3 deletions
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<size, big_endian>::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<size, big_endian>::do_read_symbols(Read_symbols_data* sd)
const unsigned char* namesu = sd->section_names->data();
const char* names = reinterpret_cast<const char*>(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;