This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gold patch committed: Don't set DT_TEXTREL because of non load segment


This gold patch corrects it to not set DT_TEXTREL merely because there
is a readonly non-PT_LOAD segment with a dynamic reloc.  This case can
occur with the PT_TLS segment.  Committed to mainline.

Ian


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.


Index: layout.cc
===================================================================
RCS file: /cvs/src/src/gold/layout.cc,v
retrieving revision 1.202
diff -u -p -r1.202 layout.cc
--- layout.cc	18 Jun 2011 22:34:24 -0000	1.202
+++ layout.cc	18 Jun 2011 22:51:14 -0000
@@ -4107,7 +4107,8 @@ Layout::finish_dynamic_section(const Inp
            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 Inp
         {
           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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]