Fix problem where __start_ and __stop_ section symbols do not honor version script.
authorCary Coutant <ccoutant@gmail.com>
Tue, 21 Jul 2015 23:10:05 +0000 (16:10 -0700)
committerCary Coutant <ccoutant@gmail.com>
Tue, 21 Jul 2015 23:10:05 +0000 (16:10 -0700)
When creating the special __start_ and __stop_ section symbols, gold
does not check the version script to see if they should be local
instead of global.

2015-07-21  Cary Coutant  <ccoutant@gmail.com>

gold/
PR gold/18548
* symtab.cc (Symbol_table::do_define_in_output_data): Check for
forced local symbol even when oldsym != NULL.
(Symbol_table::do_define_in_output_segment): Likewise.
(Symbol_table::do_define_as_constant): Likewise.

gold/ChangeLog
gold/symtab.cc

index 7fdc7bf5c88790ef28293b73c1e78f25a8d3234c..a74d96c12771725128439a0555c7af8c72eb819e 100644 (file)
@@ -1,3 +1,11 @@
+2015-07-21  Cary Coutant  <ccoutant@gmail.com>
+
+       PR gold/18548
+       * symtab.cc (Symbol_table::do_define_in_output_data): Check for
+       forced local symbol even when oldsym != NULL.
+       (Symbol_table::do_define_in_output_segment): Likewise.
+       (Symbol_table::do_define_as_constant): Likewise.
+
 2015-07-21  Cary Coutant  <ccoutant@gmail.com>
 
        PR gold/18698
index 925296a8c286ee19eab98fcf9c3465582ab893e8..31ecc5c2638056fed5565b349aace636333de25e 100644 (file)
@@ -1953,6 +1953,9 @@ Symbol_table::do_define_in_output_data(
     return sym;
   else
     {
+      if (binding == elfcpp::STB_LOCAL
+         || this->version_script_.symbol_is_local(name))
+       this->force_local(oldsym);
       delete sym;
       return oldsym;
     }
@@ -2067,6 +2070,9 @@ Symbol_table::do_define_in_output_segment(
     return sym;
   else
     {
+      if (binding == elfcpp::STB_LOCAL
+         || this->version_script_.symbol_is_local(name))
+       this->force_local(oldsym);
       delete sym;
       return oldsym;
     }
@@ -2186,6 +2192,9 @@ Symbol_table::do_define_as_constant(
     return sym;
   else
     {
+      if (binding == elfcpp::STB_LOCAL
+         || this->version_script_.symbol_is_local(name))
+       this->force_local(oldsym);
       delete sym;
       return oldsym;
     }