]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[PATCH] gold: Set DF_1_PIE for -pie
authorFangrui Song <i@maskray.me>
Thu, 18 Jun 2020 09:46:18 +0000 (10:46 +0100)
committerNick Clifton <nickc@redhat.com>
Thu, 18 Jun 2020 09:46:18 +0000 (10:46 +0100)
PR gold/26039
* layout.cc (Layout::finish_dynamic_section): Set DF_1_PIE.

elfcpp/
* elfcpp.h (enum DF_1): New enum member DF_1_PIE.

elfcpp/ChangeLog
elfcpp/elfcpp.h
gold/ChangeLog
gold/layout.cc

index a0d1e0061ebf8a5b137bbf1351b9784064833c57..dc37f65bab440ffb36c1599c98e4c468ea098376 100644 (file)
@@ -1,3 +1,8 @@
+2020-06-18  Fangrui Song  <i@maskray.me>
+
+       PR gold/26039
+       * elfcpp.h (enum DF_1): New enum member DF_1_PIE.
+
 2020-06-06  Alan Modra  <amodra@gmail.com>
 
        * powerpc.h: Rename
index 339faadaf3f2b34b60996589b8b336a794241913..9c7c6294e424e032e9a449f101ae17b194fa0f4c 100644 (file)
@@ -913,7 +913,8 @@ enum DF_1
   DF_1_INTERPOSE = 0x400,
   DF_1_NODEFLIB = 0x800,
   DF_1_NODUMP = 0x1000,
-  DF_1_CONLFAT = 0x2000
+  DF_1_CONLFAT = 0x2000,
+  DF_1_PIE = 0x08000000
 };
 
 // Version numbers which appear in the vd_version field of a Verdef
index d429e9debb3d7c695802a633c2e4ea29df3c8de1..f4679f9a6468b81e7aff8fa50bf43db780505074 100644 (file)
@@ -1,3 +1,8 @@
+2020-06-18  Fangrui Song  <i@maskray.me>
+
+       PR gold/26039
+       * layout.cc (Layout::finish_dynamic_section): Set DF_1_PIE.
+
 2020-06-16  Alan Modra  <amodra@gmail.com>
 
        * testsuite/discard_locals_test.c: Replace uses of asm with __asm__.
index b3b0c5701d3c92e6debae0d35e504dabffbea804..0c7be85240e4f49389581a4e0b23e98b307bf104 100644 (file)
@@ -5352,6 +5352,8 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
     flags |= elfcpp::DF_1_NOW;
   if (parameters->options().Bgroup())
     flags |= elfcpp::DF_1_GROUP;
+  if (parameters->options().pie())
+    flags |= elfcpp::DF_1_PIE;
   if (flags != 0)
     odyn->add_constant(elfcpp::DT_FLAGS_1, flags);
 }