aboutsummaryrefslogtreecommitdiff
path: root/gold/x86_64.cc
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2008-09-16 04:23:29 +0000
committerAlexandre Oliva <aoliva@redhat.com>2008-09-16 04:23:29 +0000
commit183fd0e3ed5f9229379cb3e75f64939ba123c9b8 (patch)
tree62ee5c331ee593d80a181c86aa293ecd1049a6f5 /gold/x86_64.cc
parentb7f9e084d27da4ebfb4b8d2531738e4bcb57e28a (diff)
downloadgdb-183fd0e3ed5f9229379cb3e75f64939ba123c9b8.zip
gdb-183fd0e3ed5f9229379cb3e75f64939ba123c9b8.tar.gz
gdb-183fd0e3ed5f9229379cb3e75f64939ba123c9b8.tar.bz2
* options.h (General_options::output_is_executable): New.
(General_options::output_is_pie): New. * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START for shared libraries. * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
Diffstat (limited to 'gold/x86_64.cc')
-rw-r--r--gold/x86_64.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index 2daa9bf..dda3297 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -807,12 +807,16 @@ Target_x86_64::define_tls_base_symbol(Symbol_table* symtab, Layout* layout)
Output_segment* tls_segment = layout->tls_segment();
if (tls_segment != NULL)
{
+ bool is_exec = parameters->options().output_is_executable();
symtab->define_in_output_segment("_TLS_MODULE_BASE_", NULL,
tls_segment, 0, 0,
elfcpp::STT_TLS,
elfcpp::STB_LOCAL,
elfcpp::STV_HIDDEN, 0,
- Symbol::SEGMENT_END, true);
+ (is_exec
+ ? Symbol::SEGMENT_END
+ : Symbol::SEGMENT_START),
+ true);
}
this->tls_base_symbol_defined_ = true;
}