aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-12-11 23:30:52 +0000
committerIan Lance Taylor <iant@google.com>2007-12-11 23:30:52 +0000
commit535890bb6466aa82b46ea191a37e75b8936aa913 (patch)
tree9c497b427e90f5be33a560f7048c1b6187759452 /gold/layout.cc
parentc32d85ca537bec630d3da979a3d1d6e14553e42c (diff)
downloadgdb-535890bb6466aa82b46ea191a37e75b8936aa913.zip
gdb-535890bb6466aa82b46ea191a37e75b8936aa913.tar.gz
gdb-535890bb6466aa82b46ea191a37e75b8936aa913.tar.bz2
From Cary Coutant: Set DF_STATIC_TLS as appropriate.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index 0a08f71..26585fa 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -71,7 +71,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),
+ has_static_tls_(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.
@@ -1733,6 +1734,8 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
odyn->add_constant(elfcpp::DT_TEXTREL, 0);
flags |= elfcpp::DF_TEXTREL;
}
+ if (parameters->output_is_shared() && this->has_static_tls())
+ flags |= elfcpp::DF_STATIC_TLS;
odyn->add_constant(elfcpp::DT_FLAGS, flags);
}