From 183fd0e3ed5f9229379cb3e75f64939ba123c9b8 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 16 Sep 2008 04:23:29 +0000 Subject: * 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. --- gold/i386.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gold/i386.cc') diff --git a/gold/i386.cc b/gold/i386.cc index 54f123333b7..8889a6802b7 100644 --- a/gold/i386.cc +++ b/gold/i386.cc @@ -747,12 +747,16 @@ Target_i386::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; } -- cgit v1.2.1