From: Ian Lance Taylor Date: Sat, 18 Jun 2011 22:53:23 +0000 (+0000) Subject: * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=766f91bb8935561d61b89b67bc90320f24ce8d95;p=binutils-gdb.git * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL merely because a non-PT_LOAD segment has a dynamic reloc. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index 3b79d95e05c..ecf65f858ab 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2011-06-18 Ian Lance Taylor + + * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL + merely because a non-PT_LOAD segment has a dynamic reloc. + 2011-06-18 Ian Lance Taylor * layout.cc (Layout::finish_dynamic_section): Don't create diff --git a/gold/layout.cc b/gold/layout.cc index f74c626a745..6e69a9299ce 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -4107,7 +4107,8 @@ Layout::finish_dynamic_section(const Input_objects* input_objects, p != this->segment_list_.end(); ++p) { - if (((*p)->flags() & elfcpp::PF_W) == 0 + if ((*p)->type() == elfcpp::PT_LOAD + && ((*p)->flags() & elfcpp::PF_W) == 0 && (*p)->has_dynamic_reloc()) { have_textrel = true; @@ -4127,7 +4128,7 @@ Layout::finish_dynamic_section(const Input_objects* input_objects, { if (((*p)->flags() & elfcpp::SHF_ALLOC) != 0 && ((*p)->flags() & elfcpp::SHF_WRITE) == 0 - && ((*p)->has_dynamic_reloc())) + && (*p)->has_dynamic_reloc()) { have_textrel = true; break;