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 add9e1dc70f57d0a2ba9573258e8b037385395da..15593b6ed95fe0e57fed10b5d6d236f68558a490 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 f38cd9a91ba507b28baba8104ad9002987e52bc9..96a4ba7dde9ceb8d89a521a01b353d53d9a1231f 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 e351ad9e78d73c976404582edec83b1f0233db24..ea20c3762605ae13cdf5651af41f9f7a819a6b5c 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 1e95d5b24529ee066130aaf53bbc469b09be0327..67e171cb78bf209d8574fa58e6324b5ebb0354c6 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,