* layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL

merely because a non-PT_LOAD segment has a dynamic reloc.
This commit is contained in:
Ian Lance Taylor
2011-06-18 22:53:23 +00:00
parent 0d212c3a03
commit 766f91bb89
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2011-06-18 Ian Lance Taylor <iant@google.com>
* 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 <iant@google.com> 2011-06-18 Ian Lance Taylor <iant@google.com>
* layout.cc (Layout::finish_dynamic_section): Don't create * layout.cc (Layout::finish_dynamic_section): Don't create

View File

@ -4107,7 +4107,8 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
p != this->segment_list_.end(); p != this->segment_list_.end();
++p) ++p)
{ {
if (((*p)->flags() & elfcpp::PF_W) == 0 if ((*p)->type() == elfcpp::PT_LOAD
&& ((*p)->flags() & elfcpp::PF_W) == 0
&& (*p)->has_dynamic_reloc()) && (*p)->has_dynamic_reloc())
{ {
have_textrel = true; have_textrel = true;
@ -4127,7 +4128,7 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
{ {
if (((*p)->flags() & elfcpp::SHF_ALLOC) != 0 if (((*p)->flags() & elfcpp::SHF_ALLOC) != 0
&& ((*p)->flags() & elfcpp::SHF_WRITE) == 0 && ((*p)->flags() & elfcpp::SHF_WRITE) == 0
&& ((*p)->has_dynamic_reloc())) && (*p)->has_dynamic_reloc())
{ {
have_textrel = true; have_textrel = true;
break; break;