From Cary Coutant: Set DF_STATIC_TLS as appropriate.

This commit is contained in:
Ian Lance Taylor
2007-12-11 23:30:52 +00:00
parent c32d85ca53
commit 535890bb64
4 changed files with 24 additions and 1 deletions

View File

@@ -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);
}