aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2020-06-18 10:46:18 +0100
committerNick Clifton <nickc@redhat.com>2020-06-18 10:46:18 +0100
commit9a17a136439c200b13a69d453f38824b7edc522c (patch)
tree47061f8acc088f9f273365bd54641f6eb6608e5d /gold
parent581bea2c99751391fc49d104d5eacb85bfb63c96 (diff)
downloadgdb-9a17a136439c200b13a69d453f38824b7edc522c.zip
gdb-9a17a136439c200b13a69d453f38824b7edc522c.tar.gz
gdb-9a17a136439c200b13a69d453f38824b7edc522c.tar.bz2
[PATCH] gold: Set DF_1_PIE for -pie
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.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog5
-rw-r--r--gold/layout.cc2
2 files changed, 7 insertions, 0 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index d429e9d..f4679f9 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -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__.
diff --git a/gold/layout.cc b/gold/layout.cc
index b3b0c57..0c7be85 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -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);
}