This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gold commit] PR gold/16773: 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.


2014-09-26  Cary Coutant  <>

        PR gold/16773
        * (Sized_relobj_file): Compute value of section symbols
        for TLS sections the same as TLS symbols.

diff --git a/gold/ b/gold/
index 03239d8..6ab84ce 100644
--- a/gold/
+++ b/gold/
@@ -2359,7 +2359,9 @@ Sized_relobj_file<size,
-      else if (lv_in->is_tls_symbol())
+      else if (lv_in->is_tls_symbol()
+               || (lv_in->is_section_symbol()
+                   && (os->flags() & elfcpp::SHF_TLS)))
                                 + secoffset
                                 + lv_in->input_value());

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]