Fix internal error when relaxing branches to STT_SECTION symbols.
authorCary Coutant <ccoutant@gmail.com>
Thu, 1 Dec 2016 20:50:21 +0000 (12:50 -0800)
committerCary Coutant <ccoutant@gmail.com>
Thu, 1 Dec 2016 20:53:54 +0000 (12:53 -0800)
gold/
PR gold/20807
* aarch64.cc (Target_aarch64::scan_reloc_section_for_stubs): Handle
section symbols correctly.
* arm.cc (Target_arm): Likewise.
* powerpc.cc (Target_powerpc): Likewise.

gold/ChangeLog
gold/aarch64.cc
gold/arm.cc
gold/powerpc.cc

index add9e1d..15593b6 100644 (file)
@@ -1,3 +1,11 @@
+2016-12-01  Cary Coutant  <ccoutant@gmail.com>
+
+       PR gold/20807
+       * aarch64.cc (Target_aarch64::scan_reloc_section_for_stubs): Handle
+       section symbols correctly.
+       * arm.cc (Target_arm): Likewise.
+       * powerpc.cc (Target_powerpc): Likewise.
+
 2016-11-27  Ambrogino Modigliani  <ambrogino.modigliani@gmail.com>
 
        * aarch64-reloc.def: Fix spelling in comments.
index f38cd9a..96a4ba7 100644 (file)
@@ -3865,6 +3865,8 @@ Target_aarch64<size, big_endian>::scan_reloc_section_for_stubs(
          if (!is_defined_in_discarded_section)
            {
              typedef Sized_relobj_file<size, big_endian> ObjType;
+             if (psymval->is_section_symbol())
+               symval.set_is_section_symbol();
              typename ObjType::Compute_final_local_value_status status =
                object->compute_final_local_value(r_sym, psymval, &symval,
                                                  relinfo->symtab);
index e351ad9..ea20c37 100644 (file)
@@ -12144,6 +12144,8 @@ Target_arm<big_endian>::scan_reloc_section_for_stubs(
          if (!is_defined_in_discarded_section)
            {
              typedef Sized_relobj_file<32, big_endian> ObjType;
+             if (psymval->is_section_symbol())
+               symval.set_is_section_symbol();
              typename ObjType::Compute_final_local_value_status status =
                arm_object->compute_final_local_value(r_sym, psymval, &symval,
                                                      relinfo->symtab);
index 1e95d5b..67e171c 100644 (file)
@@ -2799,6 +2799,8 @@ Target_powerpc<size, big_endian>::Branch_info::make_stub(
          const Symbol_value<size>* psymval
            = this->object_->local_symbol(this->r_sym_);
          Symbol_value<size> symval;
+         if (psymval->is_section_symbol())
+           symval.set_is_section_symbol();
          typedef Sized_relobj_file<size, big_endian> ObjType;
          typename ObjType::Compute_final_local_value_status status
            = this->object_->compute_final_local_value(this->r_sym_, psymval,