Fix incorrect byte counts.
[deliverable/binutils-gdb.git] / gold / ChangeLog
index 8534b5195aa138f9a6cc031330e69875bc547d84..991d7b8b8c8780f12041d2603be486f16374d039 100644 (file)
-2016-02-11 Rahul Chaudhry  <rahulchaudhry@google.com>
-
-       * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Remove
-       info message for every erratum 843419 found and fixed.
-
-2016-02-07  Cary Coutant  <ccoutant@gmail.com>
-
-       PR gold/18695
-       * x86_64.cc (Target_x86_64::Relocate::relocate): Add additional
-       information to relocation overflow errors.
-
-2016-02-06  Cary Coutant  <ccoutant@gmail.com>
-
-       PR gold/18695
-       * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
-       overflow checking when symbol value + addend < 0.
-
-2016-02-06  Cary Coutant  <ccoutant@gmail.com>
-
-       PR gold/19577
-       * reloc.h (Limits): New class.
-       (Bits::has_overflow32): Use min/max values from Limits.
-       (Bits::has_unsigned_overflow32): Likewise.
-       (Bits::has_signed_unsigned_overflow32): Likewise.
-       (Bits::has_overflow): Likewise.
-       (Bits::has_unsigned_overflow): Likewise.
-       (Bits::has_signed_unsigned_overflow64): Likewise.
-
-2016-02-06  Cary Coutant  <ccoutant@gmail.com>
-
-       PR gold/19567
-       * reloc.h (Relocate_functions::Overflow_check): Add comments.
-       * x86_64.cc (X86_64_relocate_functions): New class.
-       (Target_x86_64::Relocate::relocate): Use the new class.
-       * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
-       (x32_overflow_pc32): New test case.
-       * testsuite/Makefile.in: Regenerate.
-       * testsuite/x32_overflow_pc32.sh: New script.
-       * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
-
-2016-02-06  Cary Coutant  <ccoutant@gmail.com>
-
-       PR gold/19577
-       * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
-       (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
-
-2016-02-06  Cary Coutant  <ccoutant@gmail.com>
-
-       PR gold/19577
-       * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
-       comparison.
-       (Bits::has_unsigned_overflow): Likewise.
-
-2016-02-06  Marcin Koƛcielnicki  <koriakin@0x04.net>
-
-       * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
-       parameters.
-       * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
-       and view_size to is_call_to_non_split.
-       * target.cc (Target::is_call_to_non_split): Add view and view_size
-       parameters.
-       * target.h (class Target): Likewise.
-
-2016-02-05  Sriraman Tallam  <tmsriram@google.com>
-
-       * icf.cc (get_rel_addend): New function.
-       (get_section_contents):  Move merge section addend computation to a
-       new function.  Ignore negative values for SHT_REL and SHT_RELA addends.
-       Fix bug to not read past the length of the section.
-
-2016-02-05  Cary Coutant  <ccoutant@gmail.com>
-           Andrew Senkevich  <andrew.senkevich@intel.com>
-
-       PR gold/18695
-       * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
-       checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
-       R_X86_64_PLT32.
-       * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
-       * testsuite/x86_64_overflow_pc32.sh: New test script.
-       * testsuite/x86_64_overflow_pc32.s: New source file.
-
-2016-02-05  Cary Coutant  <ccoutant@gmail.com>
-
-       PR gold/18695
-       * reloc.h (Relocate_functions::Address): New typedef.
-       (Relocate_functions::Addendtype): New typedef.
-       (Relocate_functions::Overflow_check): New enum type.
-       (Relocate_functions::Reloc_status): New enum type.
-       (Relocate_functions::check_overflow): New function template.
-       (Relocate_functions::rel): Add check parameter; check for overflow.
-       (Relocate_functions::rel_unaligned): Likewise.
-       (Relocate_functions::rela): Likewise.
-       (Relocate_functions::pcrel): Likewise.
-       (Relocate_functions::pcrel_unaligned): Likewise.
-       (Relocate_functions::pcrela): Likewise.
-       (Relocate_functions::rel8): Adjust parameter types.
-       (Relocate_functions::rela8): Likewise.
-       (Relocate_functions::pcrel8): Likewise.
-       (Relocate_functions::pcrela8): Likewise.
-       (Relocate_functions::rel16): Likewise.
-       (Relocate_functions::rela168): Likewise.
-       (Relocate_functions::pcrel16): Likewise.
-       (Relocate_functions::pcrela16): Likewise.
-       (Relocate_functions::rel32): Likewise.
-       (Relocate_functions::rel32_unaligned): Likewise.
-       (Relocate_functions::rela32): Likewise.
-       (Relocate_functions::pcrel32): Likewise.
-       (Relocate_functions::pcrel32_unaligned): Likewise.
-       (Relocate_functions::pcrela32): Likewise.
-       (Relocate_functions::rel8_check): New function.
-       (Relocate_functions::rela8_check): New function.
-       (Relocate_functions::pcrel8_check): New function.
-       (Relocate_functions::pcrela8_check): New function.
-       (Relocate_functions::rel16_check): New function.
-       (Relocate_functions::rela168_check): New function.
-       (Relocate_functions::pcrel16_check): New function.
-       (Relocate_functions::pcrela16_check): New function.
-       (Relocate_functions::rel32_check): New function.
-       (Relocate_functions::rel32_unaligned_check): New function.
-       (Relocate_functions::rela32_check): New function.
-       (Relocate_functions::pcrel32_check): New function.
-       (Relocate_functions::pcrel32_unaligned_check): New function.
-       (Relocate_functions::pcrela32_check): New function.
-       (Bits::has_unsigned_overflow32): New function.
-       (Bits::has_unsigned_overflow): New function.
-       * testsuite/Makefile.am (overflow_unittest): New test.
-       * testsuite/Makefile.in: Regenerate.
-       * testsuite/overflow_unittest.cc: New source file.
-
-2016-02-04  Alan Modra  <amodra@gmail.com>
-
-       * powerpc.cc (relocate): Adjust last patch for big-endian.
-
-2016-02-02  Alan Modra  <amodra@gmail.com>
-
-       * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
-
-2016-01-15 Han Shen  <shenhan@google.com>
-
-       PR gold/19472 - need pc-relative stubs.
-
-       * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
-       stub type for DSOs and pie executables.
-
-2016-01-12  H.J. Lu  <hongjiu.lu@intel.com>
-
-       * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
-       'typename'.
-
-2016-01-12  Cary Coutant  <ccoutant@gmail.com>
-
-       * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
-       * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
-       * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
-       specializations) New method.
-
-2016-01-11  Cary Coutant  <ccoutant@gmail.com>
-
-       PR gold/19353
-       * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
-       we have a TLS segment for GD-to-IE optimization.
-       * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
-       Adjust all calls.
-       (Target_i386::tls_desc_gd_to_ie): Likewise.
-       (Target_i386::relocate_tls): Don't insist that we have a TLS segment
-       for TLSDESC GD-to-IE optimizations.
-       * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
-       Adjust all calls.
-       (Target_x86_64::tls_desc_gd_to_ie): Likewise.
-       (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
-       for TLSDESC GD-to-IE optimizations.
-
-2016-01-11  Cary Coutant  <ccoutant@gmail.com>
-
-       Refactor gold to enable support for MIPS-64 relocation format.
-
-       * gc.h (get_embedded_addend_size): Remove sh_type parameter.
-       (gc_process_relocs): Remove sh_type template parameter.
-       Use Classify_reloc to access r_sym, r_type, and r_addend fields.
-       * object.h (Sized_relobj_file::split_stack_adjust): Add target
-       parameter.
-       (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
-       * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
-       specializations) Remove.
-       * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
-       (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
-       (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
-       (Sized_relobj_file::split_stack_adjust): Add target parameter.
-       Adjust all callers.
-       (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
-       Target::get_r_sym() to get r_sym field from relocations.
-       (Track_relocs::next_symndx): Call Target::get_r_sym().
-       * target-reloc.h (scan_relocs): Remove sh_type template parameter;
-       add Classify_reloc template parameter.  Use for accessing r_sym and
-       r_type.
-       (relocate_section): Likewise.
-       (Default_classify_reloc): New class (renamed and moved from reloc.cc).
-       (Default_scan_relocatable_relocs): Remove sh_type template parameter.
-       (Default_scan_relocatable_relocs::Reltype): New typedef.
-       (Default_scan_relocatable_relocs::reloc_size): New const.
-       (Default_scan_relocatable_relocs::sh_type): New const.
-       (Default_scan_relocatable_relocs::get_r_sym): New method.
-       (Default_scan_relocatable_relocs::get_r_type): New method.
-       (Default_emit_relocs_strategy): New class.
-       (scan_relocatable_relocs): Replace sh_type template parameter with
-       Scan_relocatable_relocs class.  Use it to access r_sym and r_type
-       fields.
-       (relocate_relocs): Replace sh_type template parameter with
-       Classify_reloc class.  Use it to access r_sym and r_type fields.
-       * target.h (Target::is_call_to_non_split): Replace r_type parameter
-       with pointer to relocation. Adjust all callers.
-       (Target::do_is_call_to_non_split): Likewise.
-       (Target::emit_relocs_scan): New virtual method.
-       (Sized_target::get_r_sym): New virtual method.
-       * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
-       with pointer to relocation.
-
-       * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
-       (Target_aarch64::Relocatable_size_for_reloc): Remove.
-       (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
-       (Target_aarch64::scan_relocs): Likewise.
-       (Target_aarch64::relocate_section): Likewise.
-       (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
-       Remove.
-       (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
-       (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
-       * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
-       template parameter.
-       (Target_arm::emit_relocs_scan): New method.
-       (Target_arm::Relocatable_size_for_reloc): Replace with...
-       (Target_arm::Classify_reloc): ...this.
-       (Target_arm::gc_process_relocs): Use Classify_reloc.
-       (Target_arm::scan_relocs): Likewise.
-       (Target_arm::relocate_section): Likewise.
-       (Target_arm::scan_relocatable_relocs): Likewise.
-       (Target_arm::relocate_relocs): Likewise.
-       * i386.cc (Target_i386::emit_relocs_scan): New method.
-       (Target_i386::Relocatable_size_for_reloc): Replace with...
-       (Target_i386::Classify_reloc): ...this.
-       (Target_i386::gc_process_relocs): Use Classify_reloc.
-       (Target_i386::scan_relocs): Likewise.
-       (Target_i386::relocate_section): Likewise.
-       (Target_i386::scan_relocatable_relocs): Likewise.
-       (Target_i386::relocate_relocs): Likewise.
-       * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
-       parameter.
-       (Mips_reloc_types): New class template.
-       (Mips_classify_reloc): New class template.
-       (Target_mips::Reltype): New typedef.
-       (Target_mips::Relatype): New typedef.
-       (Target_mips::emit_relocs_scan): New method.
-       (Target_mips::get_r_sym): New method.
-       (Target_mips::Relocatable_size_for_reloc): Replace with
-       Mips_classify_reloc.
-       (Target_mips::copy_reloc): Use Mips_classify_reloc.
-       (Target_mips::gc_process_relocs): Likewise.
-       (Target_mips::scan_relocs): Likewise.
-       (Target_mips::relocate_section): Likewise.
-       (Target_mips::scan_relocatable_relocs): Likewise.
-       (Target_mips::relocate_relocs): Likewise.
-       (mips_get_size_for_reloc): New function, factored out from
-       Relocatable_size_for_reloc::get_size_for_reloc.
-       (Target_mips::Scan::local): Use Mips_classify_reloc.
-       (Target_mips::Scan::global): Likewise.
-       (Target_mips::Relocate::relocate): Likewise.
-       * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
-       (Target_powerpc::Relocatable_size_for_reloc): Remove.
-       (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
-       (Target_powerpc::scan_relocs): Likewise.
-       (Target_powerpc::relocate_section): Likewise.
-       (Powerpc_scan_relocatable_reloc): Convert to class template.
-       (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
-       (Powerpc_scan_relocatable_reloc::reloc_size): New const.
-       (Powerpc_scan_relocatable_reloc::sh_type): New const.
-       (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
-       (Powerpc_scan_relocatable_reloc::get_r_type): New method.
-       (Target_powerpc::scan_relocatable_relocs): Use
-       Powerpc_scan_relocatable_reloc.
-       (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
-       * s390.cc (Target_s390::emit_relocs_scan): New method.
-       (Target_s390::Relocatable_size_for_reloc): Remove.
-       (Target_s390::gc_process_relocs): Use Default_classify_reloc.
-       (Target_s390::scan_relocs): Likewise.
-       (Target_s390::relocate_section): Likewise.
-       (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
-       Remove.
-       (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
-       (Target_s390::relocate_relocs): Use Default_classify_reloc.
-       * sparc.cc (Target_sparc::emit_relocs_scan): New method.
-       (Target_sparc::Relocatable_size_for_reloc): Remove.
-       (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
-       (Target_sparc::scan_relocs): Likewise.
-       (Target_sparc::relocate_section): Likewise.
-       (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
-       Remove.
-       (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
-       (Target_sparc::relocate_relocs): Use Default_classify_reloc.
-       * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
-       (Target_tilegx::Relocatable_size_for_reloc): Remove.
-       (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
-       (Target_tilegx::scan_relocs): Likewise.
-       (Target_tilegx::relocate_section): Likewise.
-       (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
-       Remove.
-       (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
-       (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
-       * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
-       (Target_x86_64::Relocatable_size_for_reloc): Remove.
-       (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
-       (Target_x86_64::scan_relocs): Likewise.
-       (Target_x86_64::relocate_section): Likewise.
-       (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
-       Remove.
-       (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
-       (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
-
-       * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
-
-2016-01-01  Alan Modra  <amodra@gmail.com>
+2017-01-12  Cary Coutant  <ccoutant@gmail.com>
+
+       * object.cc (Sized_relobj_file): Fix byte counts for calls to memmem.
+
+2017-01-11  Cary Coutant  <ccoutant@gmail.com>
+
+       PR gold/21040
+       * x86_64.cc (Output_data_plt_x86_64_bnd::do_fill_first_plt_entry):
+       Remove unnecessary 'typename' keyword.
+       (Output_data_plt_x86_64_bnd::do_fill_plt_entry): Likewise.
+       (Output_data_plt_x86_64_bnd::fill_aplt_entry): Likewise.
+       (Output_data_plt_x86_64_bnd::do_fill_tlsdesc_entry): Likewise.
+       (Output_data_plt_x86_64_bnd::do_write): Likewise.
+
+2017-01-11  Cary Coutant  <ccoutant@gmail.com>
+
+       PR gold/21040
+       * x86_64.cc (Output_data_plt_x86_64_bnd::do_fill_first_plt_entry):
+       Remove unnecessary 'typename' keyword.
+       (Output_data_plt_x86_64_bnd::do_fill_plt_entry): Likewise.
+       (Output_data_plt_x86_64_bnd::do_fill_tlsdesc_entry): Likewise.
+       (Output_data_plt_x86_64_bnd::fill_aplt_entry): Likewise.
+       * testsuite/copy_test_relro_1.cc (p, b, c, q): Add separate extern
+       declarations.
+
+2017-01-11  Cary Coutant  <ccoutant@gmail.com>
+
+       PR gold/21039
+       * testsuite/script_test_13.sh: Adjust patterns to work for i386.
+       * testsuite/script_test_15a.sh: Likewise.
+       * testsuite/script_test_15b.sh: Likewise.
+       * testsuite/script_test_15c.sh: Likewise.
+
+2017-01-11  Alan Modra  <amodra@gmail.com>
+
+       * powerpc.cc (class Powerpc_copy_relocs): New.
+       (Powerpc_copy_relocs::emit): New function.
+       (Powerpc_relobj::relatoc_, toc_, no_toc_opt_): New variables.
+       (Powerpc_relobj::toc_shndx, set_no_toc_opt, no_toc_opt): New inlines.
+       (Powerpc_relobj::do_relocate_sections): New function.
+       (Powerpc_relobj::make_toc_relative): Likewise.
+       (Powerpc_relobj::do_find_special_sections): Stash away .rela.toc
+       and .toc too.
+       (ok_lo_toc_insn): Move earlier, and handle more insns.
+       (Target_powerpc::Scan::local): If optimizing toc accesses, set
+       no_toc_opt for entries we can't edit.  Check insn validity.
+       Emit "toc optimization is not supported" warning, downgraded
+       from error.
+       (Target_powerpc::Scan::global): Likewise.
+       (Target_powerpc::Relocate::relocate): Edit TOC indirect code
+       to TOC relative.  Don't emit "toc optimization is not supported"
+       error here.
+
+2017-01-10  Cary Coutant  <ccoutant@gmail.com>
+
+       * aarch64.cc (AArch64_relobj::do_relocate_sections): Call
+       Sized_relobj_file::relocate_section_range().
+       * arm.cc (Arm_relobj::do_relocate_sections): Likewise.
+       * object.h (Sized_relobj_file::relocate_section_range): New method.
+       * reloc.cc (Sized_relobj_file::do_relocate_sections): Move
+       implementation...
+       (Sized_relobj_file::relocate_section_range): ...to new method.
+
+2017-01-10  Alan Modra  <amodra@gmail.com>
+
+       * testsuite/ver_test_8.sh: Accept .TOC. in lieu of
+       _GLOBAL_OFFSET_TABLE_.  Allow zero count.
+       * testsuite/copy_test_relro_1.cc (c, q): New vars.
+       * testsuite/copy_test_relro.cc: Rewrite to test read-only
+       status of variables directly.  Reference new vars in
+       read-only data.
+
+2017-01-10  Alan Modra  <amodra@gmail.com>
+
+       * options.h: Add --secure-plt option.
+       * powerpc.cc (Target_powerpc::Scan::local): Detect and error
+       on -fPIC -mbss-plt code.
+       (Target_powerpc::Scan::global): Likewise.
+
+2017-01-09  Alan Modra  <amodra@gmail.com>
+
+       * powerpc.cc (Target_powerpc::make_plt_section): Point sh_info of
+       ".rela.plt" at ".plt".
+
+2017-01-07  Alan Modra  <amodra@gmail.com>
+
+       * powerpc.cc: Use shorter equivalent elfcpp typedef for
+       Reltype and reloc_size throughout.
+       (Target_powerpc::symval_for_branch): Exclude dynamic symbols.
+       (Target_powerpc::Scan::local): Use local var r_sym.
+       (Target_powerpc::Scan::global: Likewise.
+       (Target_powerpc::Relocate::relocate): Delete shadowing r_sym.
+
+2017-01-02  Alan Modra  <amodra@gmail.com>
 
        Update year range in copyright notice of all files.
 
-For older changes see ChangeLog-0815
+For older changes see ChangeLog-2016
 \f
-Copyright (C) 2016 Free Software Foundation, Inc.
+Copyright (C) 2017 Free Software Foundation, Inc.
 
 Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
This page took 0.02852 seconds and 4 git commands to generate.