* layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
authorIan Lance Taylor <ian@airs.com>
Sat, 18 Jun 2011 22:53:23 +0000 (22:53 +0000)
committerIan Lance Taylor <ian@airs.com>
Sat, 18 Jun 2011 22:53:23 +0000 (22:53 +0000)
merely because a non-PT_LOAD segment has a dynamic reloc.

gold/ChangeLog
gold/layout.cc

index 3b79d95e05c91a1f15c3ab691f2a25ac3acefb60..ecf65f858aba21b2419c2092c53533822f74e6e1 100644 (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>
 
        * layout.cc (Layout::finish_dynamic_section): Don't create
index f74c626a745464bc19c46b839f009b9a06dda57a..6e69a9299ce803eef6ddda90c096ea6996321e50 100644 (file)
@@ -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;