diff options
author | Cary Coutant <ccoutant@google.com> | 2014-09-26 13:34:27 -0700 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2014-09-26 13:34:27 -0700 |
commit | 5efeedf61e4fe720fd3e9a08e6c91c10abb66d42 (patch) | |
tree | 82b78794a6890ec232644b62b96ca9dd86932052 /gold | |
parent | a73c2b56cd87f709fb9118232b19cdf516edfb10 (diff) | |
download | fsf-binutils-gdb-5efeedf61e4fe720fd3e9a08e6c91c10abb66d42.zip fsf-binutils-gdb-5efeedf61e4fe720fd3e9a08e6c91c10abb66d42.tar.gz fsf-binutils-gdb-5efeedf61e4fe720fd3e9a08e6c91c10abb66d42.tar.bz2 |
Fix handling of relocations against TLS section symbols.
Gold doesn't handle relocations against the section symbol for a TLS
section correctly. Instead of using the offset of the section relative
to the TLS segment, it uses the address of the actual section. This
patch checks for section symbols for TLS sections, and treats them
the same as TLS symbols.
gold/
PR gold/16773
* object.cc (Sized_relobj_file): Compute value of section symbols
for TLS sections the same as TLS symbols.
Diffstat (limited to 'gold')
-rw-r--r-- | gold/ChangeLog | 6 | ||||
-rw-r--r-- | gold/object.cc | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index 4b39c3f..f71db09 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,9 @@ +2014-09-26 Cary Coutant <ccoutant@google.com> + + PR gold/16773 + * object.cc (Sized_relobj_file): Compute value of section symbols + for TLS sections the same as TLS symbols. + 2014-09-25 Cary Coutant <ccoutant@google.com> PR gold/17432 diff --git a/gold/object.cc b/gold/object.cc index 03239d8..6ab84ce 100644 --- a/gold/object.cc +++ b/gold/object.cc @@ -2359,7 +2359,9 @@ Sized_relobj_file<size, big_endian>::compute_final_local_value_internal( lv_out->set_merged_symbol_value(msv); } } - else if (lv_in->is_tls_symbol()) + else if (lv_in->is_tls_symbol() + || (lv_in->is_section_symbol() + && (os->flags() & elfcpp::SHF_TLS))) lv_out->set_output_value(os->tls_offset() + secoffset + lv_in->input_value()); |