summaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-11-14 22:31:02 +0000
committerIan Lance Taylor <iant@google.com>2007-11-14 22:31:02 +0000
commit07f397aba39f619db4fdce42c9e91cb07dd4dc68 (patch)
tree5cc86b1998b729454448c3f3429154dbdebde33d /gold/layout.cc
parentc224138d88196fe7cabce4fe554c10a1520f5a4f (diff)
downloadbinutils-gdb-07f397aba39f619db4fdce42c9e91cb07dd4dc68.tar.gz
From Cary Coutant: Improve i386 shared library TLS support.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index fea056d1a31..e4eda44a2d8 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -70,7 +70,8 @@ Layout::Layout(const General_options& options)
eh_frame_section_(NULL), output_file_size_(-1),
input_requires_executable_stack_(false),
input_with_gnu_stack_note_(false),
- input_without_gnu_stack_note_(false)
+ input_without_gnu_stack_note_(false),
+ have_textrel_(false)
{
// Make space for more than enough segments for a typical file.
// This is just for efficiency--it's OK if we wind up needing more.
@@ -1582,6 +1583,13 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
odyn->add_string(elfcpp::DT_RPATH, rpath_val);
}
+
+ // Add a DT_FLAGS entry. We add it even if no flags are set so that
+ // post-link tools can easily modify these flags if desired.
+ unsigned int flags = 0;
+ if (this->have_textrel_)
+ flags |= elfcpp::DF_TEXTREL;
+ odyn->add_constant(elfcpp::DT_FLAGS, flags);
}
// The mapping of .gnu.linkonce section names to real section names.