binutils-gdb/binutils/ChangeLog

1067 lines
34 KiB
Plaintext
Raw Normal View History

2020-06-27 Alan Modra <amodra@gmail.com>
* elfcomm.c (setup_nested_archive): Set nested_arch->file to NULL
after freeing.
(release_archive): Set fields of arch to NULL after freeing.
libctf, binutils: support CTF archives like objdump objdump and readelf have one major CTF-related behavioural difference: objdump can read .ctf sections that contain CTF archives and extract and dump their members, while readelf cannot. Since the linker often emits CTF archives, this means that readelf intermittently and (from the user's perspective) randomly fails to read CTF in files that ld emits, with a confusing error message wrongly claiming that the CTF content is corrupt. This is purely because the archive-opening code in libctf was needlessly tangled up with the BFD code, so readelf couldn't use it. Here, we disentangle it, moving ctf_new_archive_internal from ctf-open-bfd.c into ctf-archive.c and merging it with the helper function in ctf-archive.c it was already using. We add a new public API function ctf_arc_bufopen, that looks very like ctf_bufopen but returns an archive given suitable section data rather than a ctf_file_t: the archive is a ctf_archive_t, so it can be called on raw CTF dictionaries (with no archive present) and will return a single-member synthetic "archive". There is a tiny lifetime tweak here: before now, the archive code could assume that the symbol section in the ctf_archive_internal wrapper structure was always owned by BFD if it was present and should always be freed: now, the caller can pass one in via ctf_arc_bufopen, wihch has the usual lifetime rules for such sections (caller frees): so we add an extra field to track whether this is an internal call from ctf-open-bfd, in which case we still free the symbol section. include/ * ctf-api.h (ctf_arc_bufopen): New. libctf/ * ctf-impl.h (ctf_new_archive_internal): Declare. (ctf_arc_bufopen): Remove. (ctf_archive_internal) <ctfi_free_symsect>: New. * ctf-archive.c (ctf_arc_close): Use it. (ctf_arc_bufopen): Fuse into... (ctf_new_archive_internal): ... this, moved across from... * ctf-open-bfd.c: ... here. (ctf_bfdopen_ctfsect): Use ctf_arc_bufopen. * libctf.ver: Add it. binutils/ * readelf.c (dump_section_as_ctf): Support .ctf archives using ctf_arc_bufopen. Automatically load the .ctf member of such archives as the parent of all other members, unless specifically overridden via --ctf-parent. Split out dumping code into... (dump_ctf_archive_member): ... here, as in objdump, and call it once per archive member. (dump_ctf_indent_lines): Code style fix.
2019-12-13 13:01:12 +01:00
2020-06-26 Nick Alcock <nick.alcock@oracle.com>
* readelf.c (dump_section_as_ctf): Support .ctf archives using
ctf_arc_bufopen. Automatically load the .ctf member of such
archives as the parent of all other members, unless specifically
overridden via --ctf-parent. Split out dumping code into...
(dump_ctf_archive_member): ... here, as in objdump, and call
it once per archive member.
(dump_ctf_indent_lines): Code style fix.
binutils, ld: work with --disable-libctf This unfortunately means conditionalizing out all the libctf code, but the result is not too unbearably ugly, if a bit repetitive. I have stubbed out code in the !ENABLE_LIBCTF path to avoid extra redundant ifdefs where it seems that might be helpful. (The stubs are not too disruptive, but I've tried to keep them on one line where possible to avoid filling up the screen with stubs that nobody would care about. If this is too much of a coding style violation I can change it.) Changes since v2: use GCC_ENABLE rather than repeating all the AC_ARG_ENABLE stuff over and over again. ld/ * configure.ac [--enable-libctf]: New, default yes. Set ENABLE_LIBCTF accordingly. * Makefile.am [!ENABLE_LIBCTF]: Empty LIBCTF. * configure: Regenerate. * config.in: Regenerate. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * ldlang.c (ctf_output): Conditionalize on ENABLE_LIBCTF. (ldlang_open_ctf): Likewise. (lang_merge_ctf): Likewise. (ldlang_ctf_apply_strsym): Likewise. (lang_write_ctf): Likewise. (ldlang_write_ctf_late): Likewise. (ldlang_open_ctf) [!ENABLE_LIBCTF]: Warn about the presence of CTF sections. (lang_merge_ctf) [!ENABLE_LIBCTF]: New stub. (ldlang_ctf_apply_strsym) [!ENABLE_LIBCTF]: Likewise. (lang_write_ctf) [!ENABLE_LIBCTF]: Likewise. (ldlang_write_ctf_late) [!ENABLE_LIBCTF]: Likewise. * ldelfgen.c (ldelf_emit_ctf_early): Conditionalize on ENABLE_LIBCTF. (struct ctf_strsym_iter_cb_arg): Likewise. (ldelf_ctf_strtab_iter_cb): Likewise. (ldelf_ctf_symbols_iter_cb): Likewise. (ldelf_examine_strtab_for_ctf): Likewise. (ldelf_emit_ctf_early) [!ENABLE_LIBCTF]: New stub. (ldelf_examine_strtab_for_ctf) [!ENABLE_LIBCTF]: New stub. binutils/ * configure.ac [--enable-libctf]: New, default yes. Set ENABLE_LIBCTF accordingly. * Makefile.am [!ENABLE_LIBCTF]: Empty LIBCTF and LIBCTF_NOBFD. * configure: Regenerate. * config.in: Regenerate. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * objdump.c (usage): Conditionalize portions on ENABLE_LIBCTF. (option_values): Likewise. (long_options): Likewise. (main): Likewise. (dump_ctf_indent_lines): Conditionalize out when !ENABLE_LIBCTF. (make_ctfsect): Likewise. (dump_ctf_archive_member): Likewise. (dump_ctf) [ENABLE_LIBCTF]: Likewise. (dump_ctf) [!ENABLE_LIBCTF]: New empty stub. * readelf.c (options): Conditionalize portions on ENABLE_LIBCTF. (usage): Likewise. (process_section_contents): Likewise. (shdr_to_ctf_sect): Conditionalize out when !ENABLE_LIBCTF. (dump_ctf_indent_lines): Likewise. (dump_section_as_ctf) [ENABLE_LIBCTF]: Likewise.
2019-09-30 16:04:05 +02:00
2020-06-26 Nick Alcock <nick.alcock@oracle.com>
* configure.ac [--enable-libctf]: New, default yes.
Set ENABLE_LIBCTF accordingly.
* Makefile.am [!ENABLE_LIBCTF]: Empty LIBCTF and LIBCTF_NOBFD.
* configure: Regenerate.
* config.in: Regenerate.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* objdump.c (usage): Conditionalize portions on ENABLE_LIBCTF.
(option_values): Likewise.
(long_options): Likewise.
(main): Likewise.
(dump_ctf_indent_lines): Conditionalize out when !ENABLE_LIBCTF.
(make_ctfsect): Likewise.
(dump_ctf_archive_member): Likewise.
(dump_ctf) [ENABLE_LIBCTF]: Likewise.
(dump_ctf) [!ENABLE_LIBCTF]: New empty stub.
* readelf.c (options): Conditionalize portions on ENABLE_LIBCTF.
(usage): Likewise.
(process_section_contents): Likewise.
(shdr_to_ctf_sect): Conditionalize out when !ENABLE_LIBCTF.
(dump_ctf_indent_lines): Likewise.
(dump_section_as_ctf) [ENABLE_LIBCTF]: Likewise.
2020-06-26 Jan Beulich <jbeulich@suse.com>
* doc/binutils.texi: Adjust description of x86's -Msuffix. Drop
redundant text from x86 specific part of -M section.
2020-06-25 22:05:38 +02:00
2020-06-26 Pat Bernardi <bernardi@adacore.com>
* readelf.c (display_m68k_gnu_attribute): New function.
(process_arch_specific): Call display_m68k_gnu_attribute for EM_68K.
2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/26160
* testsuite/binutils-all/pr26160.dwp.bz2: New file.
* testsuite/binutils-all/pr26160.r: Likewise.
* testsuite/binutils-all/readelf.exp: Run PR binutils/26160 test.
2020-06-23 Nick Clifton <nickc@redhat.com>
PR 26160
* dwarf.c (fetch_indexed_string): Detect and handle old style
.debug_str_offset tables.
(display_debug_str_offsets): Likewise. Also add support for
.debug_str_offsets.dwo sections.
2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/26112
* testsuite/binutils-all/pr26112.o.bz2: New file.
* testsuite/binutils-all/pr26112.r: Likewise.
* testsuite/binutils-all/readelf.exp: Run PR binutils/26112 test.
2020-06-23 Alan Modra <amodra@gmail.com>
* testsuite/binutils-all/objdump.exp (bintest.a): Correct
remote_file delete command.
2020-06-22 Nick Clifton <nickc@redhat.com>
PR 26112
* dwarf.c (display_debug_str_offsets): Add code to display the
contents of the .debug_str_offsets section.
(display_debug_macro): Add support for DW_MACRO_define_strx and
DW_MACRO_undef_strx.
2020-06-22 Saagar Jha <saagar@saagarjha.com>
* od-macho.c: Dump linkedit data for new load commands.
2020-06-19 Alan Modra <amodra@gmail.com>
* testsuite/config/default.exp (ld_elf_shared_opt): Don't set.
* testsuite/lib/binutils-common.exp (check_relro_support): New proc.
(run_dump_test): Use check_relro_support to decide whether to pass
extra ld option "-z norelro".
2020-06-11 Alan Modra <amodra@gmail.com>
* readelf.c (process_mips_specific): Don't alloc memory for
Elf_Internal_Options.
2020-06-11 Alan Modra <amodra@gmail.com>
* readelf.c (process_mips_specific): Assert size of internal
types match size of external types, and simplify allocation of
internal buffer. Catch possible integer overflow when sanity
checking option size. Don't assume options are a regular array.
Sanity check reginfo option against option size. Use PRI macros
when printing.
2020-06-10 Ralf Habacker <ralf.habacker@freenet.de>
PR 26082
* mclex.c (yylex): Reject lines that reach end-of-file without a
terminating newline character.
2020-06-08 Nick Clifton <nickc@redhat.com>
PR 26093
* doc/binutils.texi (strings): Fix typo.
2020-06-08 Nick Clifton <nickc@redhat.com>
PR 26086
* dwarf.c (process_debug_info): Check that there is space in the
debug_information array before filling in an entry.
2020-06-06 Alan Modra <amodra@gmail.com>
* doc/binutils.texi (PowerPC -M option): Mention power10 and pwr10.
2020-06-05 Joel Anderson <joelanderson333@gmail.com>
PR 26082
* mclex.c (yylex): Add test for an empty input stream.
2020-06-04 Stephen Casner <casner@acm.org>
* testsuite/binutils-all/pr25662-pdp11.s: Alternate source file
for test using section pseudo-ops compatible with pdp11.
* testsuite/binutils-all/objcopy.exp: Select alternate source.
opcodes: support insn endianness in cgen_cpu_open This patch adds support for a new CGEN_OPEN_INSN_ENDIAN argument for @arch@_cgen_cpu_open. This is useful for architectures in which the endianness of the instruction words is not the same than the endianness used for data. An accompanying patch has been sent to the CGEN mailing list that adds support for this argument on the CGEN side [1]. Its been already pre-approved [2], and will be applied simultaneously with this binutils series. [1] https://sourceware.org/pipermail/cgen/2020q2/002733.html [2] https://sourceware.org/pipermail/cgen/2020q2/002737.html include/ChangeLog: 2020-06-04 Jose E. Marchesi <jemarch@gnu.org> * opcode/cgen.h (enum cgen_cpu_open_arg): New value CGEN_CPU_OPEN_INSN_ENDIAN. opcodes/ChangeLog: 2020-06-04 Jose E. Marchesi <jemarch@gnu.org> * cgen-dis.in (cpu_desc_list): New field `insn_endian'. (print_insn_): Handle instruction endian. * bpf-dis.c: Regenerate. * bpf-desc.c: Regenerate. * epiphany-dis.c: Likewise. * epiphany-desc.c: Likewise. * fr30-dis.c: Likewise. * fr30-desc.c: Likewise. * frv-dis.c: Likewise. * frv-desc.c: Likewise. * ip2k-dis.c: Likewise. * ip2k-desc.c: Likewise. * iq2000-dis.c: Likewise. * iq2000-desc.c: Likewise. * lm32-dis.c: Likewise. * lm32-desc.c: Likewise. * m32c-dis.c: Likewise. * m32c-desc.c: Likewise. * m32r-dis.c: Likewise. * m32r-desc.c: Likewise. * mep-dis.c: Likewise. * mep-desc.c: Likewise. * mt-dis.c: Likewise. * mt-desc.c: Likewise. * or1k-dis.c: Likewise. * or1k-desc.c: Likewise. * xc16x-dis.c: Likewise. * xc16x-desc.c: Likewise. * xstormy16-dis.c: Likewise. * xstormy16-desc.c: Likewise. binutils/ChangeLog: 2020-06-04 Jose E. Marchesi <jose.marchesi@oracle.com> * objdump.c (disassemble_data): Set disasm_info.endian_code to disasm_info.endian after the latter is initialized to the endianness reported by BFD.
2020-06-04 16:14:41 +02:00
2020-06-04 Jose E. Marchesi <jose.marchesi@oracle.com>
* objdump.c (disassemble_data): Set disasm_info.endian_code to
disasm_info.endian after the latter is initialized to the
endianness reported by BFD.
2020-06-04 Alan Modra <amodra@gmail.com>
* testsuite/binutils-all/i386/i386.exp: Remove global directive
outside proc body.
* testsuite/binutils-all/x86-64/objects.exp: Likewise.
* testsuite/binutils-all/x86-64/x86-64.exp: Likewise.
2020-06-03 Joel Anderson <joelanderson333@gmail.com>
* windmc.h (struct mc_node): Add id_typecast field.
* mcparse.y (message): Initialise the id_typecast field.
* windmc.c (write_dbg): Use the id_typecast field as a parameter
when calling write_dbg_define.
(write_header): Likewise.
2020-06-03 Alan Modra <amodra@gmail.com>
PR 26069
* objcopy.c (copy_relocations_in_section): Free relpp on error.
Don't accidentally free isection->orelocation.
2020-06-02 Alan Modra <amodra@gmail.com>
* testsuite/binutils-all/ar.exp (obj): Set up object file name
extension. Use throughout. Don't completely exclude non-ELF
alpha targets. Run long_filenames test for tic30. Exclude thin
archive tests for aix, ecoff and vms.
* estsuite/binutils-all/objdump.exp (obj): Set up object file name
extension. Use throughout. Don't exclude non-ELF alpha targets
from "bintest.a".
2020-05-28 Max Filippov <jcmvbkbc@gmail.com>
* MAINTAINERS (Xtensa): Add myself as maintainer.
2020-05-23 Alan Modra <amodra@gmail.com>
* testsuite/binutils-all/ar.exp (many_files): New test.
2020-05-21 Alan Modra <amodra@gmail.com>
* addr2line.c: Replace "if (x) free (x)" with "free (x)" throughout.
* dlltool.c: Likewise.
* elfcomm.c: Likewise.
* rddbg.c: Likewise.
* readelf.c: Likewise.
* stabs.c: Likewise.
* windmc.c: Likewise.
* windres.c: Likewise.
* wrstabs.c: Likewise.
2020-05-21 Alan Modra <amodra@gmail.com>
* readelf.c (get_num_dynamic_syms): Bounds check mipsxlat array
access.
[PATCH v2 0/9] RISC-V: Support version controling for ISA standard extensions and CSR 1. Remove the -mriscv-isa-version and --with-riscv-isa-version options. We can still use -march to choose the version for each extensions, so there is no need to add these. 2. Change the arguments of options from [1p9|1p9p1|...] to [1.9|1.9.1|...]. Unlike the architecture string has specified by spec, ther is no need to do the same thing for options. 3. Spilt the patches to reduce the burdens of review. [PATCH 3/7] RISC-V: Support new GAS options and configure options to set ISA versions to [PATCH v2 3/9] RISC-V: Support GAS option -misa-spec to set ISA versions [PATCH v2 4/9] RISC-V: Support configure options to set ISA versions by default. [PATCH 4/7] RISC-V: Support version checking for CSR according to privilege version. to [PATCH v2 5/9] RISC-V: Support version checking for CSR according to privilege spec version. [PATCH v2 6/9] RISC-V: Support configure option to choose the privilege spec version. 4. Use enum class rather than string to compare the choosen ISA spec in opcodes/riscv-opc.c. The behavior is same as comparing the choosen privilege spec. include * opcode/riscv.h: Include "bfd.h" to support bfd_boolean. (enum riscv_isa_spec_class): New enum class. All supported ISA spec belong to one of the class (struct riscv_ext_version): New structure holds version information for the specific ISA. * opcode/riscv-opc.h (DECLARE_CSR): There are two version information, define_version and abort_version. The define_version means which privilege spec is started to define the CSR, and the abort_version means which privilege spec is started to abort the CSR. If the CSR is valid for the newest spec, then the abort_version should be PRIV_SPEC_CLASS_DRAFT. (DECLARE_CSR_ALIAS): Same as DECLARE_CSR, but only for the obselete CSR. * opcode/riscv.h (enum riscv_priv_spec_class): New enum class. Define the current supported privilege spec versions. (struct riscv_csr_extra): Add new fields to store more information about the CSR. We use these information to find the suitable CSR address when user choosing a specific privilege spec. binutils * dwarf.c: Updated since DECLARE_CSR is changed. opcodes * riscv-opc.c (riscv_ext_version_table): The table used to store all information about the supported spec and the corresponding ISA versions. Currently, only Zicsr is supported to verify the correctness of Z sub extension settings. Others will be supported in the future patches. (struct isa_spec_t, isa_specs): List for all supported ISA spec classes and the corresponding strings. (riscv_get_isa_spec_class): New function. Get the corresponding ISA spec class by giving a ISA spec string. * riscv-opc.c (struct priv_spec_t): New structure. (struct priv_spec_t priv_specs): List for all supported privilege spec classes and the corresponding strings. (riscv_get_priv_spec_class): New function. Get the corresponding privilege spec class by giving a spec string. (riscv_get_priv_spec_name): New function. Get the corresponding privilege spec string by giving a CSR version class. * riscv-dis.c: Updated since DECLARE_CSR is changed. * riscv-dis.c: Add new disassembler option -Mpriv-spec to dump the CSR according to the chosen version. Build a hash table riscv_csr_hash to store the valid CSR for the chosen pirv verison. Dump the direct CSR address rather than it's name if it is invalid. (parse_riscv_dis_option_without_args): New function. Parse the options without arguments. (parse_riscv_dis_option): Call parse_riscv_dis_option_without_args to parse the options without arguments first, and then handle the options with arguments. Add the new option -Mpriv-spec, which has argument. * riscv-dis.c (print_riscv_disassembler_options): Add description about the new OBJDUMP option. ld * testsuite/ld-riscv-elf/attr-merge-arch-01.d: Updated priv attributes according to the -mpriv-spec option. * testsuite/ld-riscv-elf/attr-merge-arch-02.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-arch-03.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-a.s: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-b.s: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-stack-align.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-strict-align-01.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-strict-align-02.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-strict-align-03.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-strict-align-04.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-strict-align-05.d: Likewise. bfd * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function get_default_version. It is used to find the default version for the specific extension. * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters default_major_version and default_minor_version. Add new bfd_boolean parameter *use_default_version. Set it to TRUE if we need to call the callback rps->get_default_version to find the default version. (riscv_parse_std_ext): Call rps->get_default_version if we fail to find the default version in riscv_parsing_subset_version, and then call riscv_add_subset to add the subset into subset list. (riscv_parse_prefixed_ext): Likewise. (riscv_std_z_ext_strtab): Support Zicsr extensions. * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the strings rather than characters. riscv_merge_arch_attr_info): The callback function get_default_version is only needed for assembler, so set it to NULL int the linker. * elfxx-riscv.c (riscv_estimate_digit): Remove the static. * elfxx-riscv.h: Updated. gas * testsuite/gas/riscv/priv-reg-fail-read-only-01.s: Updated. * config/tc-riscv.c (default_arch_with_ext, default_isa_spec): Static variables which are used to set the ISA extensions. You can use -march (or ELF build attributes) and -misa-spec to set them, respectively. (ext_version_hash): The hash table used to handle the extensions with versions. (init_ext_version_hash): Initialize the ext_version_hash according to riscv_ext_version_table. (riscv_get_default_ext_version): The callback function of riscv_parse_subset_t. According to the choosed ISA spec, get the default version for the specific extension. (riscv_set_arch): Set the callback function. (enum options, struct option md_longopts): Add new option -misa-spec. (md_parse_option): Do not call riscv_set_arch for -march. We will call it later in riscv_after_parse_args. Call riscv_get_isa_spec_class to set default_isa_spec class. (riscv_after_parse_args): Call init_ext_version_hash to initialize the ext_version_hash, and then call riscv_set_arch to set the architecture with versions according to default_arch_with_ext. * testsuite/gas/riscv/attribute-02.d: Set 0p0 as default version for x extensions. * testsuite/gas/riscv/attribute-03.d: Likewise. * testsuite/gas/riscv/attribute-09.d: New testcase. For i-ext, we already set it's version to 2p1 by march, so no need to use the default 2p2 version. For m-ext, we do not set the version by -march and ELF arch attribute, so set the default 2p0 to it. For zicsr, it is not defined in ISA spec 2p2, so set 0p0 to it. * testsuite/gas/riscv/attribute-10.d: New testcase. The version of zicsr is 2p0 according to ISA spec 20191213. * config/tc-riscv.c (DEFAULT_RISCV_ARCH_WITH_EXT) (DEFAULT_RISCV_ISA_SPEC): Default configure option settings. You can set them by configure options --with-arch and --with-isa-spec, respectively. (riscv_set_default_isa_spec): New function used to set the default ISA spec. (md_parse_option): Call riscv_set_default_isa_spec rather than call riscv_get_isa_spec_class directly. (riscv_after_parse_args): If the -isa-spec is not set, then we set the default ISA spec according to DEFAULT_RISCV_ISA_SPEC by calling riscv_set_default_isa_spec. * testsuite/gas/riscv/attribute-01.d: Add -misa-spec=2.2, since the --with-isa-spec may be set to different ISA spec. * testsuite/gas/riscv/attribute-02.d: Likewise. * testsuite/gas/riscv/attribute-03.d: Likewise. * testsuite/gas/riscv/attribute-04.d: Likewise. * testsuite/gas/riscv/attribute-05.d: Likewise. * testsuite/gas/riscv/attribute-06.d: Likewise. * testsuite/gas/riscv/attribute-07.d: Likewise. * configure.ac: Add configure options, --with-arch and --with-isa-spec. * configure: Regenerated. * config.in: Regenerated. * config/tc-riscv.c (default_priv_spec): Static variable which is used to check if the CSR is valid for the chosen privilege spec. You can use -mpriv-spec to set it. (enum reg_class): We now get the CSR address from csr_extra_hash rather than reg_names_hash. Therefore, move RCLASS_CSR behind RCLASS_MAX. (riscv_init_csr_hashes): Only need to initialize one hash table csr_extra_hash. (riscv_csr_class_check): Change the return type to void. Don't check the ISA dependency if -mcsr-check isn't set. (riscv_csr_version_check): New function. Check and find the CSR address from csr_extra_hash, according to default_priv_spec. Report warning for the invalid CSR if -mcsr-check is set. (reg_csr_lookup_internal): Updated. (reg_lookup_internal): Likewise. (md_begin): Updated since DECLARE_CSR and DECLARE_CSR_ALIAS are changed. (enum options, struct option md_longopts): Add new GAS option -mpriv-spec. (md_parse_option): Call riscv_set_default_priv_version to set default_priv_spec. (riscv_after_parse_args): If -mpriv-spec isn't set, then set the default privilege spec to the newest one. (enum riscv_csr_class, struct riscv_csr_extra): Move them to include/opcode/riscv.h. * testsuite/gas/riscv/priv-reg-fail-fext.d: This test case just want to check the ISA dependency for CSR, so fix the spec version by adding -mpriv-spec=1.11. * testsuite/gas/riscv/priv-reg-fail-fext.l: Likewise. There are some version warnings for the test case. * gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.d: Likewise. * gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.l: Likewise. * gas/testsuite/gas/riscv/priv-reg-fail-read-only-02.d: Likewise. * gas/testsuite/gas/riscv/priv-reg-fail-rv32-only.d: Likewise. * gas/testsuite/gas/riscv/priv-reg-fail-rv32-only.l: Likewise. * gas/testsuite/gas/riscv/priv-reg-fail-version-1p9.d: New test case. Check whether the CSR is valid when privilege version 1.9 is choosed. * gas/testsuite/gas/riscv/priv-reg-fail-version-1p9.l: Likewise. * gas/testsuite/gas/riscv/priv-reg-fail-version-1p9p1.d: New test case. Check whether the CSR is valid when privilege version 1.9.1 is choosed. * gas/testsuite/gas/riscv/priv-reg-fail-version-1p9p1.l: Likewise. * gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.d: New test case. Check whether the CSR is valid when privilege version 1.10 is choosed. * gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.l: Likewise. * gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.d: New test case. Check whether the CSR is valid when privilege version 1.11 is choosed. * gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.l: Likewise. * config/tc-riscv.c (DEFAULT_RISCV_ISA_SPEC): Default configure option setting. You can set it by configure option --with-priv-spec. (riscv_set_default_priv_spec): New function used to set the default privilege spec. (md_parse_option): Call riscv_set_default_priv_spec rather than call riscv_get_priv_spec_class directly. (riscv_after_parse_args): If -mpriv-spec isn't set, then we set the default privilege spec according to DEFAULT_RISCV_PRIV_SPEC by calling riscv_set_default_priv_spec. * testsuite/gas/riscv/csr-dw-regnums.d: Add -mpriv-spec=1.11, since the --with-priv-spec may be set to different privilege spec. * testsuite/gas/riscv/priv-reg.d: Likewise. * configure.ac: Add configure option --with-priv-spec. * configure: Regenerated. * config.in: Regenerated. * config/tc-riscv.c (explicit_attr): Rename explicit_arch_attr to explicit_attr. Set it to TRUE if any ELF attribute is found. (riscv_set_default_priv_spec): Try to set the default_priv_spec if the priv attributes are set. (md_assemble): Set the default_priv_spec according to the priv attributes when we start to assemble instruction. (riscv_write_out_attrs): Rename riscv_write_out_arch_attr to riscv_write_out_attrs. Update the arch and priv attributes. If we don't set the corresponding ELF attributes, then try to output the default ones. (riscv_set_public_attributes): If any ELF attribute or -march-attr options is set (explicit_attr is TRUE), then call riscv_write_out_attrs to update the arch and priv attributes. (s_riscv_attribute): Make sure all arch and priv attributes are set before any instruction. * testsuite/gas/riscv/attribute-01.d: Update the priv attributes if any ELF attribute or -march-attr is set. If the priv attributes are not set, then try to update them by the default setting (-mpriv-spec or --with-priv-spec). * testsuite/gas/riscv/attribute-02.d: Likewise. * testsuite/gas/riscv/attribute-03.d: Likewise. * testsuite/gas/riscv/attribute-04.d: Likewise. * testsuite/gas/riscv/attribute-06.d: Likewise. * testsuite/gas/riscv/attribute-07.d: Likewise. * testsuite/gas/riscv/attribute-08.d: Likewise. * testsuite/gas/riscv/attribute-09.d: Likewise. * testsuite/gas/riscv/attribute-10.d: Likewise. * testsuite/gas/riscv/attribute-unknown.d: Likewise. * testsuite/gas/riscv/attribute-05.d: Likewise. Also, the priv spec set by priv attributes must be supported. * testsuite/gas/riscv/attribute-05.s: Likewise. * testsuite/gas/riscv/priv-reg-fail-version-1p9.d: Likewise. Updated priv attributes according to the -mpriv-spec option. * testsuite/gas/riscv/priv-reg-fail-version-1p9p1.d: Likewise. * testsuite/gas/riscv/priv-reg-fail-version-1p10.d: Likewise. * testsuite/gas/riscv/priv-reg-fail-version-1p11.d: Likewise. * testsuite/gas/riscv/priv-reg.d: Removed. * testsuite/gas/riscv/priv-reg-version-1p9.d: New test case. Dump the CSR according to the priv spec 1.9. * testsuite/gas/riscv/priv-reg-version-1p9p1.d: New test case. Dump the CSR according to the priv spec 1.9.1. * testsuite/gas/riscv/priv-reg-version-1p10.d: New test case. Dump the CSR according to the priv spec 1.10. * testsuite/gas/riscv/priv-reg-version-1p11.d: New test case. Dump the CSR according to the priv spec 1.11. * config/tc-riscv.c (md_show_usage): Add descriptions about the new GAS options. * doc/c-riscv.texi: Likewise.
2020-05-20 18:22:48 +02:00
2020-05-20 Nelson Chu <nelson.chu@sifive.com>
* dwarf.c: Updated since DECLARE_CSR is changed.
2020-05-19 H.J. Lu <hjl.tools@gmail.com>
PR binutils/25809
* readelf.c (process_program_headers): Warn if the PT_DYNAMIC
segment doesn't match the .dynamic section and checks are
enabled.
(struct filedata): Add dynamic_symtab_section and
dynamic_strtab_section fields.
(process_section_headers): Set dynamic_symtab_section to the
.dynsym section. Set dynamic_strtab_section to the .dynstr
section.
(process_dynamic_section): Warn if the .dynsym section doesn't
match DT_SYMTAB and DT_SYMENT or the .dynstr section doesn't
DT_STRTAB and DT_STRSZ. But only if checks are enabled.
2020-05-19 Alan Modra <amodra@gmail.com>
* ar.c (map_over_members, get_pos_bfd, delete_members, move_members),
(replace_members): Use bfd_get_filename rather than accessing
bfd->filename directly.
* arsup.c (map_over_list, ar_delete, ar_replace, ar_extract): Likewise.
* binemul.c (do_ar_emul_append): Likewise.
* coffgrok.c (coff_grok): Likewise.
2020-05-18 Stafford Horne <shorne@gmail.com>
* MAINTAINERS (OR1K): Add myself as maintainer.
2020-05-07 Andrew Burgess <andrew.burgess@embecosm.com>
* doc/binutils.texi: Mention 'entry address' in the set-start and
adjust-start options descriptions.
2020-05-05 Nick Clifton <nickc@redhat.com>
* dwarf.c (do_checks): New global variable.
(display_formatted_table): Warn about an unexpected number of
columns in the table, if checks are enabled. Do not complain
about the lack of data following the number of entries in the
table if the table is empty.
(display_debug_lines_decoded): Only warn about an unexpected
number of columns in a table if checks are enabled.
* dwarf.h (do_checks): Add a prototype.
* elfcomm.c (error): Remove weak attribute.
(warn): Likewise.
* readelf.c (do_checks): Delete.
(warn): Delete.
(process_section_headers): Only warn about empty sections if
checks are enabled.
2020-05-04 Fangrui Song <maskray@google.com>
* objcopy.c (copy_object): Allow empty section.
* testsuite/binutils-all/update-section.exp: Add test.
2020-05-04 Nick Clifton <nickc@redhat.com>
PR 25917
* dwarf.c (display_debug_lines_decoded): Warn if encountering a
supicious number of entries for DWARF-5 format directory and file
name tables. Do not display file name table header if the table
is empty. Do not allocate space for empty tables.
2020-05-04 Alan Modra <amodra@gmail.com>
* readelf.c (process_nds32_specific): Check size of .nds32_e_flags
section. Don't assume endian of host matches nds32 target. Free
buffer.
2020-05-01 Alan Modra <amodra@gmail.com>
Haim Shimonovich <Haim.Shimonovich@ceva-dsp.com>
* objdump.c (disassemble_bytes): Don't scan for zeros when
disassembling zeros. Translate "resuming at file offset" message.
Formatting. Replace some signed variables with unsigned.
2020-04-30 Alex Coplan <alex.coplan@arm.com>
* testsuite/binutils-all/aarch64/in-order-all.d: Update to use new
disassembly.
* testsuite/binutils-all/aarch64/out-of-order-all.d: Likewise.
Add generic tests for linker support of the -shared or -pie options to tests which use them. binutils* testsuite/lib/binutils-common.exp (check_pie_support): New proc. ld * testsuite/ld-elf/compress1c.d: XFAIL if thet target linker does not support the -shared command line option. * /ld-elf/compressed1c.d: Likewise. * /ld-elf/compressed1e.d: Likewise. * /ld-elf/dynamic1.d: Likewise. * /ld-elf/dynsym1.d: Likewise. * /ld-elf/ehdr_start-shared.d: Likewise. * /ld-elf/exclude3b.d: Likewise. * /ld-elf/global1.d: Likewise. * /ld-elf/hash.d: Likewise. * /ld-elf/local1.d: Likewise. * /ld-elf/mbind1b.d: Likewise. * /ld-elf/now-1.d: Likewise. * /ld-elf/now-2.d: Likewise. * /ld-elf/now-3.d: Likewise. * /ld-elf/now-4.d: Likewise. * /ld-elf/pr12975.d: Likewise. * /ld-elf/pr13177.d: Likewise. * /ld-elf/pr13195.d: Likewise. * /ld-elf/pr16322.d: Likewise. * /ld-elf/pr16498a.d: Likewise. * /ld-elf/pr16498b.d: Likewise. * /ld-elf/pr17615.d: Likewise. * /ld-elf/pr19162.d: Likewise. * /ld-elf/pr19698.d: Likewise. * /ld-elf/pr20513c.d: Likewise. * /ld-elf/pr20513d.d: Likewise. * /ld-elf/pr21389a.d: Likewise. * /ld-elf/pr21389b.d: Likewise. * /ld-elf/pr21389c.d: Likewise. * /ld-elf/pr21562a.d: Likewise. * /ld-elf/pr21562b.d: Likewise. * /ld-elf/pr21562c.d: Likewise. * /ld-elf/pr21562d.d: Likewise. * /ld-elf/pr21562e.d: Likewise. * /ld-elf/pr21562f.d: Likewise. * /ld-elf/pr21562g.d: Likewise. * /ld-elf/pr21562h.d: Likewise. * /ld-elf/pr21562i.d: Likewise. * /ld-elf/pr21562j.d: Likewise. * /ld-elf/pr21562k.d: Likewise. * /ld-elf/pr21562l.d: Likewise. * /ld-elf/pr21562m.d: Likewise. * /ld-elf/pr21562n.d: Likewise. * /ld-elf/pr21903a.d: Likewise. * /ld-elf/pr21903b.d: Likewise. * /ld-elf/pr22269b.d: Likewise. * /ld-elf/pr22393-1a.d: Likewise. * /ld-elf/pr22393-1b.d: Likewise. * /ld-elf/pr23658-1c.d: Likewise. * /ld-elf/pr25708.d: Likewise. * /ld-elf/rpath-1.d: Likewise. * /ld-elf/rpath-2.d: Likewise. * /ld-elf/runpath-1.d: Likewise. * /ld-elf/runpath-2.d: Likewise. * /ld-elf/sizeofb.d: Likewise. * /ld-elf/startofb.d: Likewise. * /ld-elf/strtab.d: Likewise. * /ld-elf/textaddr2.d: Likewise. * /ld-elf/textaddr5.d: Likewise. * /ld-elf/textaddr6.d: Likewise. * /ld-elf/unknown2.d: Likewise. * /ld-undefined/entry-3.d: Likewise. * /ld-undefined/entry-4.d: Likewise. * /ld-elf/mbind1c.d: XFAIL if the target linker does not support the -pie option. * /ld-elf/pie.d: Likewise. * /ld-elf/pr19539.d: Likewise. * /ld-elf/pr21903d.d: Likewise. * /ld-elf/pr22269a.d: Likewise. * /ld-elf/pr22393-1c.d: Likewise. * /ld-elf/pr22393-1d.d: Likewise. * /ld-elf/pr22423.d: Likewise. * /ld-elf/loadaddr1.d: Expect to fail on the rx-linux target. * /ld-elf/loadaddr2.d: Likewise. * /ld-elf/pr22393-1e.d: Likewise. * /ld-elf/pr22393-1f.d: Likewise. * /ld-elf/textaddr1.d: Likewise. * /ld-elf/textaddr4.d: Likewise.
2020-04-30 14:49:30 +02:00
2020-04-30 Nick Clifton <nickc@redhat.com>
* testsuite/lib/binutils-common.exp (check_pie_support): New
proc.
2020-04-29 Andrew Burgess <andrew.burgess@embecosm.com>
* dwarf.c (display_debug_ranges): Ignore duplicate entries in
range_entries for the same offset.
2020-04-29 Nick Clifton <nickc@redhat.com>
* readelf.c (warn): New function - like elfcomm.c version but only
produces output if warnings are enabled.
(struct options): Add --lint and --enable-checks.
(usage): Add entry for --lint.
(parse_args): Handle -L. If checks are enabled but no dumps have
been selected then enable all dumps.
(process_section_headers): Replace long if-then-else sequence with
a switch. Add warning messages for empty SHT_REL, SHT_RELA and
SHT_PROGBITS sections.
(process_file): Do not complain if the file is an archive and lint
mode has been enabled.
* elfcomm.c (error): Make the function weak.
(warn): Likewise.
* NEWS: Mention the new feature.
* doc/binutils.texi: Document the new feature.
* dwarf.h (report_leb_status): Add file name and line number
parameters. Include them in the diagnostic output.
(READ_ULEB): Pass file and line number to report_leb_status.
(READ_SLEB): Likewise.
* dwarf.c (read_and_print_leb128): Pass file and line number to
report_leb_status.
* testsuite/binutils-all/readelf.exp: Add test of new feature.
* testsuite/binutils-all/zero-sec.s: New test source file.
* testsuite/binutils-all/zero-sec.r: Expected output from new
test.
2020-04-29 Nick Clifton <nickc@redhat.com>
* po/sr.po: Updated Serbian translation.
2020-04-26 Alan Modra <amodra@gmail.com>
* readelf.c (get_num_dynamic_syms): Check DT_MIPS_XHASH was
read before dereferencing, and gracefully return. Remove
gnu_hash_error variable. Free gnu hash arrays if number of
syms found is zero.
2020-04-24 Alan Modra <amodra@gmail.com>
* readelf.c (get_num_dynamic_syms): Check for nbuckets and nchains
non-zero.
(process_dynamic_section): Call get_num_dynamic_syms once rather
than in segment loop. Break out of segment loop on a successful
load of dynamic symbols. Formatting.
(process_object): Return error status from process_dynamic_section.
2017-05-15 15:17:29 +02:00
2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
* elf-bfd.h (elfcore_write_arc_v2): Add prototype.
* elf.c (elfcore_grok_arc_v2): New function.
(elfcore_grok_note): Call the new function to handle the corresponding
note.
(elfcore_write_arc_v2): New function.
(elfcore_write_register_note): Call the new function to handle the
corresponding pseudo-sections.
xtensa: fix PR ld/25861 Introduce new relaxations XTENSA_PDIFF{8,16,32} for positive differences (subtracted symbol precedes diminished symbol) and XTENSA_NDIFF{8,16,32} for negative differences (subtracted symbol follows diminished symbol). Don't generate XTENSA_DIFF relocations in the assembler, generate XTENSA_PDIFF or XTENSA_NDIFF based on relative symbol position. Handle XTENSA_DIFF in BFD for compatibility with old object files. Handle XTENSA_PDIFF and XTENSA_NDIFF in BFD, treating difference value as unsigned. 2020-04-22 Max Filippov <jcmvbkbc@gmail.com> bfd/ * bfd-in2.h: Regenerated. * elf32-xtensa.c (elf_howto_table): New entries for R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}. (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc) (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}. * libbfd.h (bfd_reloc_code_real_names): Add names for BFD_RELOC_XTENSA_PDIFF{8,16,32} and BFD_RELOC_XTENSA_NDIFF{8,16,32}. * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32} and BFD_RELOC_XTENSA_NDIFF{8,16,32}. binutils/ * readelf.c (is_none_reloc): Recognize BFD_RELOC_XTENSA_PDIFF{8,16,32} and BFD_RELOC_XTENSA_NDIFF{8,16,32}. gas/ * config/tc-xtensa.c (md_apply_fix): Replace BFD_RELOC_XTENSA_DIFF{8,16,32} generation with BFD_RELOC_XTENSA_PDIFF{8,16,32} and BFD_RELOC_XTENSA_NDIFF{8,16,32} generation. * testsuite/gas/xtensa/loc.d: Replace BFD_RELOC_XTENSA_DIFF16 with BFD_RELOC_XTENSA_PDIFF16 in the expected output. include/ * elf/xtensa.h (elf_xtensa_reloc_type): New entries for R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}. ld/ * testsuite/ld-xtensa/relax-loc.d: New test definition. * testsuite/ld-xtensa/relax-loc.s: New test source. * testsuite/ld-xtensa/xtensa.exp (relax-loc): New test.
2020-04-20 04:04:41 +02:00
2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
PR ld/25861
* readelf.c (is_none_reloc): Recognize
BFD_RELOC_XTENSA_PDIFF{8,16,32} and
BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2020-04-22 Nick Clifton <nickc@redhat.com>
* MAINTAINERS: Remove Chris Faylor as the ix86 PE maintainer.
2020-04-22 Alan Modra <amodra@gmail.com>
* readelf.c (archive_file_offset, archive_file_size, dynamic_addr),
(dynamic_size, dynamic_nent, dynamic_strings, dynamic_strings_length),
(num_dynamic_syms, nbuckets, nchains, buckets, chains),
(ngnubuckets, gnubuckets, gnuchains, mipsxlat, ngnuchains),
(gnusymidx, dynamic_symbols, dynamic_syminfo, dynamic_syminfo_offset),
(dynamic_syminfo_nent, program_interpreter, dynamic_info),
(dynamic_info_DT_GNU_HASH, dynamic_info_DT_MIPS_XHASH, version_info),
(dynamic_section, symtab_shndx_list, group_count, section_groups),
(section_headers_groups): Move to struct filedata. Update use
throughout file.
2020-04-22 Alan Modra <amodra@gmail.com>
* readelf.c (struct dump_data): New, used..
(cmdline): ..here, and..
(struct filedata): ..here. Adjust all uses.
(request_dump_bynumber, request_dump, parse_args): Pass in a
struct dump_data* rather than Filedata*. Adjust callers.
(main): Don't set cmdline.file_name.
2020-04-20 Alan Modra <amodra@gmail.com>
* readelf.c (process_symbol_table): Clear ngnuchains, ngnubuckets
and nbuckets.
2020-04-20 Alan Modra <amodra@gmail.com>
* readelf.c (process_section_headers): Free dynamic symbols etc.
earlier.
2020-04-20 Alan Modra <amodra@gmail.com>
* readelf.c (get_num_dynamic_syms): Formatting. Don't return
on error without freeing.
(process_dynamic_section): Don't recreate dynamic symbols from
dynamic tag info when the dynamic symbols have already been
read via section headers.
2020-04-17 Fredrik Strupe <fredrik@strupe.net>
* testsuite/binutils-all/arm/vdup-cond.d: New test for testing that
conditional VDUP instructions are disassembled correctly.
* testsuite/binutils-all/arm/vdup-cond.s: New file used by
vdup-cond.d.
* testsuite/binutils-all/arm/vdup-thumb.d: New test for testing
that VDUP instructions (which are conditional in A32) can be
disassembled in thumb mode.
* testsuite/binutils-all/arm/vdup-cond.s: New file used by
vdup-thumb.d.
2020-04-17 Alan Modra <amodra@gmail.com>
PR 25840
* debug.c (debug_class_type_samep): Don't segfault on NULL type.
2020-04-16 Alan Modra <amodra@gmail.com>
* doc/binutils.texi: Mention --no-show-raw-insn in objdump
--no-addresses description.
2020-04-15 Alan Modra <amodra@gmail.com>
* objdump.c (no_addresses): New static var.
(usage): Print help for --no-addresses.
(long_options): Add --no-addresses entry.
(objdump_print_addr_with_sym, objdump_print_addr): Omit symbol address.
(disassemble_bytes): Don't print current line address, or reloc
address.
* doc/binutils.texi: Document objdump --no-addresses.
2020-04-15 Alan Modra <amodra@gmail.com>
PR 25822
* readelf.c (get_num_dynamic_syms): Don't set num_of_syms when
reading buckets or chains fails.
2020-04-15 Alan Modra <amodra@gmail.com>
* readelf.c (process_symbol_table): Zero gnubuckets, gnuchains
etc. after freeing.
2020-04-15 Alan Modra <amodra@gmail.com>
* readelf.c (get_group_flags): Translate text.
(get_file_type, get_symbol_binding, get_symbol_type),
(get_ppc64_symbol_other, get_symbol_other): Increase size of buffer.
2020-04-15 Alan Modra <amodra@gmail.com>
PR 25821
* readelf.c (get_num_dynamic_syms): Typo fix.
2020-04-14 Alan Modra <amodra@gmail.com>
* readelf.c (process_mips_specific): Free eopt and iopt. Avoid
possibility of overflow when checking number of conflicts.
readelf: Consolidate --syms --use-dynamic with --dyn-syms When reconstructing dynamic symbol table from the PT_DYNAMIC segment, compute dynamic symbol table size from hash table. For DT_HASH, the number of dynamic symbol table entries equals the number of chains. For DT_GNU_HASH/DT_MIPS_XHASH, only defined symbols with non-STB_LOCAL indings are in hash table. Since DT_GNU_HASH/DT_MIPS_XHASH place all symbols with STB_LOCAL binding before symbols with other bindings and all undefined symbols defined ones in dynamic symbol table, the highest symbol index in DT_GNU_HASH/DT_MIPS_XHASH is the highest dynamic symbol table index. Rewrite print_dynamic_symbol to dump dynamic symbol table for --dyn-syms and --syms --use-dynamic. binutils/ PR binutils/25707 * readelf.c (nbuckets): New. (nchains): Likewise. (buckets): Likewise. (chains): Likewise. (ngnubuckets): Likewise. (gnubuckets): Likewise. (gnuchains): Likewise. (mipsxlat): Likewise. (ngnuchains): Likewise. (gnusymidx): Likewise. (VALID_SYMBOL_NAME): Likewise. (VALID_DYNAMIC_NAME): Use it. (get_dynamic_data): Moved before process_dynamic_section. (get_num_dynamic_syms): New function. (process_dynamic_section): Use DT_SYMTAB, DT_SYMENT, DT_HASH, DT_GNU_HASH and DT_MIPS_XHASH to reconstruct dynamic symbol table. Use DT_STRTAB and DT_STRSZ to reconstruct dynamic string table. (get_symbol_index_type): Don't print "bad section index" when there is no section header. (print_dynamic_symbol): Rewrite. (process_symbol_table): Call print_dynamic_symbol to dump dynamic symbol table. ld/ PR binutils/25707 * testsuite/ld-arm/armthumb-lib.sym: Updated. * testsuite/ld-arm/farcall-mixed-app.sym: Likewise. * testsuite/ld-arm/farcall-mixed-app2.sym: Likewise. * testsuite/ld-arm/fdpic-main-m.sym: Likewise. * testsuite/ld-arm/fdpic-main.sym: Likewise. * testsuite/ld-arm/fdpic-shared-m.sym: Likewise. * testsuite/ld-arm/fdpic-shared.sym: Likewise. * testsuite/ld-arm/mixed-app.sym: Likewise. * testsuite/ld-arm/mixed-lib.sym: Likewise. * testsuite/ld-arm/preempt-app.sym: Likewise. * testsuite/ld-elf/hash.d: Likewise. * testsuite/ld-elf/pr13195.d: Likewise. * testsuite/ld-elfvsb/hidden2.d: Likewise. * testsuite/ld-mips-elf/hash2.d: Likewise.
2020-04-14 14:00:22 +02:00
2020-04-14 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/25707
* readelf.c (nbuckets): New.
(nchains): Likewise.
(buckets): Likewise.
(chains): Likewise.
(ngnubuckets): Likewise.
(gnubuckets): Likewise.
(gnuchains): Likewise.
(mipsxlat): Likewise.
(ngnuchains): Likewise.
(gnusymidx): Likewise.
(VALID_SYMBOL_NAME): Likewise.
(VALID_DYNAMIC_NAME): Use it.
(get_dynamic_data): Moved before process_dynamic_section.
(get_num_dynamic_syms): New function.
(process_dynamic_section): Use DT_SYMTAB, DT_SYMENT, DT_HASH,
DT_GNU_HASH and DT_MIPS_XHASH to reconstruct dynamic symbol
table. Use DT_STRTAB and DT_STRSZ to reconstruct dynamic string
table.
(get_symbol_index_type): Don't print "bad section index" when
there is no section header.
(print_dynamic_symbol): Rewrite.
(process_symbol_table): Call print_dynamic_symbol to dump dynamic
symbol table.
ld: Disable ifunc tests on Solaris A couple of ld ifunc tests currently FAIL on 64-bit Solaris/x86: FAIL: ld-ifunc/ifunc-10-x86-64 FAIL: ld-ifunc/ifunc-11-x86-64 FAIL: ld-ifunc/ifunc-12-x86-64 FAIL: ld-ifunc/ifunc-13-x86-64 FAIL: ld-ifunc/ifunc-14a-x86-64 FAIL: ld-ifunc/ifunc-14b-x86-64 FAIL: ld-ifunc/ifunc-14c-x86-64 FAIL: ld-ifunc/ifunc-14d-x86-64 FAIL: ld-ifunc/ifunc-14e-x86-64 FAIL: ld-ifunc/ifunc-14f-x86-64 FAIL: ld-ifunc/ifunc-15-x86-64 FAIL: ld-ifunc/ifunc-17a-x86-64 FAIL: ld-ifunc/ifunc-17b-x86-64 FAIL: ld-ifunc/ifunc-2-local-x86-64-now FAIL: ld-ifunc/ifunc-2-local-x86-64 FAIL: ld-ifunc/ifunc-2-x86-64-now FAIL: ld-ifunc/ifunc-2-x86-64 FAIL: ld-ifunc/ifunc-20-x86-64 FAIL: ld-ifunc/pr17154-x86-64-now FAIL: ld-ifunc/pr17154-x86-64 For one, the actual error is weird: ./ld-new: target elf64-x86-64 not found failed with: <./ld-new: target elf64-x86-64 not found>, no expected output FAIL: ld-ifunc/ifunc-10-x86-64 although ld -V does report the elf_x86_64 emulation as supported: $ ./ld/ld-new -V GNU ld (GNU Binutils) 2.34.50.20200328 Supported emulations: elf_x86_64_sol2 elf_x86_64 [...] When using ld -m elf_x86_64_sol2 instead, one of the testcases links successfully. However, there's no point in pursuing this: Solaris does not support ifunc, as can be seen in <sys/elf.h>: /* * GNU/Linux specific symbol type not used by Solaris */ #define STT_GNU_IFUNC 10 and never will, given that it has symbol capabilities as solution to effectively the same problem: http://www.linker-aliens.org/blogs/rie/entry/symbol_capabilitie/ Therefore this patch disables ifunc testing on Solaris completely by removing Solaris from binutils/testsuite/lib/binutils-common.exp (supports_gnu_osabi). The ifunc part is justified above. SHF_GNU_MBIND is in the OS-specific range and conflicts with #define SHF_SUNW_REALLOC 0x01000000 /* internal: krtld realloc */ While the comment suggests this might be relocatable without too much problems, the description of mbind (no formal spec AFAICS, just the comment in the binutils patch submission) strongly suggests that this isn't relevant to Solaris at all. Indirectly, clearing supports_gnu_osabi on Solaris disables supports_gnu_unique. Again, Solaris <sys/elf.h> has /* * GNU/Linux specific binding not used by Solaris */ #define STB_GNU_UNIQUE 10 so this seems the right thing to do. Afterwards, one can remove the explicit mentions of *-*-solaris2* in quite a number of (but not all) the ld-ifunc dump file notarget lists. There's one fallout, though: two gas tests now XPASS because they are xfail'ed for !supports_gnu_osabi: XPASS: mbind sections 12 XPASS: mbind section contents 16 XPASS: mbind sections 16 XPASS: mbind section contents 16 To fix that, I've changed #xfail: ![supports_gnu_osabi] to notarget. Tested on x86_64-pc-solaris2.11, i386-pc-solaris2.11, x86_64-pc-linux-gnu, and i686-pc-linux-gnu. ld: * testsuite/ld-ifunc/ifunc-10-i386.d: Remove *-*-solaris2* from notarget. * ifunc-11-i386.d: Likewise. * ifunc-12-i386.d: Likewise. * ifunc-13-i386.d: Likewise. * ifunc-14a-i386.d: Likewise. * ifunc-14b-i386.d: Likewise. * ifunc-14c-i386.d: Likewise. * ifunc-14d-i386.d: Likewise. * ifunc-14e-i386.d: Likewise. * ifunc-14f-i386.d: Likewise. * ifunc-15-i386.d: Likewise. * ifunc-16-i386-now.d: Likewise. * ifunc-16-i386.d: Likewise. * ifunc-17a-i386.d: Likewise. * ifunc-17b-i386.d: Likewise. * ifunc-18a-i386.d: Likewise. * ifunc-18b-i386.d: Likewise. * ifunc-19a-i386.d: Likewise. * ifunc-19b-i386.d: Likewise. * ifunc-2-i386-now.d: Likewise. * ifunc-2-i386.d: Likewise. * ifunc-2-local-i386-now.d: Likewise. * ifunc-2-local-i386.d: Likewise. * ifunc-20-i386.d: Likewise. * ifunc-21-i386.d: Likewise. * ifunc-22-i386.d: Likewise. * ifunc-5a-i386.d: Likewise. * ifunc-5a-local-i386.d: Likewise. * ifunc-5b-i386.d: Likewise. * ifunc-5b-local-i386.d: Likewise. * ifunc-5r-local-i386.d: Likewise. * ifunc-6a-i386.d: Likewise. * ifunc-6b-i386.d: Likewise. * ifunc-7a-i386.d: Likewise. * ifunc-7b-i386.d: Likewise. * ifunc-8-i386.d: Likewise. * ifunc-9-i386.d: Likewise. * pr17154-i386-now.d: Likewise. * pr17154-i386.d: Likewise. * ifunc-23a-x86.d: Remove notarget. * ifunc-24a-x86.d: Likewise. * ifunc-25a-x86.d: Likewise. gas: * testsuite/gas/elf/section12a.d: Use notarget instead of xfail. * testsuite/gas/elf/section12b.d: Likewise. * testsuite/gas/elf/section16a.d: Likewise. * testsuite/gas/elf/section16b.d: Likewise. binutils: * testsuite/lib/binutils-common.exp (supports_gnu_osabi): Don't enable on *-*-solaris*.
2020-04-02 10:52:57 +02:00
2020-04-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* testsuite/lib/binutils-common.exp (supports_gnu_osabi): Don't
enable on *-*-solaris*.
2020-03-30 Nick Clifton <nickc@redhat.com>
PR binutils/25662
* objcopy.c (copy_object): When copying PE format files set the
timestamp field in the pe_data structure if the preserve_dates
flag is set.
* testsuite/binutils-all/objcopy.exp (objcopy_test) Use
--preserve-dates in place of the -p option, in order to make its
effect more obvious.
2020-03-28 Alan Modra <amodra@gmail.com>
* testsuite/binutils-all/objcopy.exp (objcopy_test): Only
clear_xfail hppa*-*-*elf*. Revert mips xfails.
2020-03-28 Alan Modra <amodra@gmail.com>
* testsuite/binutils-all/objcopy.exp (objcopy_test): Move xfails
from here to calls. Remove "m8*-*-*" entry. Don't xfail tic54x
but do xfail spu, mipstx39 and mips-sgi-irix for the executable
test. Pass "-p" to objcopy for the executable test.
2020-03-27 Jozef Lawrynowicz <jozef.l@mittosystems.com>
PR binutils/25662
* testsuite/binutils-all/objcopy.exp (objcopy_test): Add argument to
specify whether an object file or executable should be built and tested.
Change test names to report whether an object file or executable is
being tested.
* testsuite/binutils-all/pr25662.ld: New test.
* testsuite/binutils-all/pr25662.s: New test.
2020-03-27 Alan Modra <amodra@gmail.com>
* readelf.c (process_archive): Don't double free qualified_name.
Don't break out of loop with "negative" archive_file_size, just
set file offset to max.
2020-03-25 Alan Modra <amodra@gmail.com>
* readelf.c (process_archive): Prevent endless loop.
2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/25708
* nm.c (print_symname): Replace _bfd_elf_get_symbol_version_name
with bfd_get_symbol_version_string.
(print_symbo): Pass TRUE to bfd_get_symbol_version_string.
* objdump.c (objdump_print_symname): Likewise.
2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/25708
* nm.c (SYM_NAME): Removed.
(print_symname): Add a pointer to struct extended_symbol_info
argument. Call _bfd_elf_get_symbol_version_name to get symbol
version.
(print_symdef_entry): Pass NULL to print_symname.
(print_symbol_info_bsd): Update call to print_symname.
(print_symbol_info_sysv): Likewise.
(print_symbol_info_posix): Likewise.
2020-03-24 Alan Modra <amodra@gmail.com>
* readelf.c (process_mips_specific): Free iconf on error path.
2020-03-23 Nick Clifton <nickc@redhat.com>
PR 25714
* wrstabs.c (stab_pop_type): Replace assertion with error return.
* write_stabs_in_sections_debugging_info: Likewise.
* stab_enum_type: Likewise.
* stab_modify_type: Likewise.
* stab_struct_field: Likewise.
* stab_end_struct_type: Likewise.
* stab_start_class_type: Likewise.
* stab_class_static_member: Likewise.
* stab_class_baseclass: Likewise.
* stab_class_start_method: Likewise.
* stab_class_method_var: Likewise.
* stab_class_end_method: Likewise.
* stab_end_class_type: Likewise.
* stab_typedef_type: Likewise.
* stab_start_function: Likewise.
* stab_end_block: Likewise.
* stab_lineno: Likewise.
2020-03-20 Nick Clifton <nickc@redhat.com>
* readelf.c (get_compression_header): Add ATTRIBUTE_WARN_UNUSED_RESULT.
(process_section_headers): Check the return value from
get_compression_header.
(dump_section_as_strings): Likewise.
(dump_section_as_bytes): Likewise.
(load_specific_debug_section): Likewise.
2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
* ar.c (main): Update bfd_plugin_set_program_name call.
* nm.c (main): Likewise.
2020-03-19 Nick Clifton <nickc@redhat.com>
PR 25676
* testsuite/binutils-all/dw4.s: New test source file.
* testsuite/binutils-all/nm.exp: Run the new test.
2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
* readelf.c (process_symbol_table): Use unsigned long for si.
2020-03-19 Alan Modra <amodra@gmail.com>
* elfcomm.c: Don't include bfd.h or bucomm.h.
(program_name): Declare.
(process_archive_index_and_symbols): Replace bfd_boolean with int,
and substitute FALSE and TRUE.
(setup_archive, setup_nested_archive): Likewise.
* elfcomm.h: Likewise.
2020-03-19 Alan Modra <amodra@gmail.com>
* readelf.c (process_archive): Always return via path freeing
memory. Formatting.
2020-03-19 Alan Modra <amodra@gmail.com>
* readelf.c (process_netbsd_elf_note): Validate descsz before
accessing descdata. Formatting.
2020-03-19 Alan Modra <amodra@gmail.com>
* elfcomm.c (setup_archive): Make file_size an off_t. Comment.
* elfcomm.h (setup_archive): Update prototype.
2020-03-16 Alan Modra <amodra@gmail.com>
* readelf.c (get_symbols): New function.
(process_relocs, ia64_process_unwind, hppa_process_unwind),
(arm_process_unwind, get_symbol_for_build_attribute): Use it.
2020-03-16 Alan Modra <amodra@gmail.com>
* unwind-ia64.c (unw_decode_uleb128): Prevent overlarge shifts.
Detect shift overflows and check that terminating byte is found.
Print an error on a bad uleb128.
2020-03-14 Alan Modra <amodra@gmail.com>
* readelf.c (process_file): Clean ba_cache.
2020-03-14 Alan Modra <amodra@gmail.com>
* elfcomm.h (setup_archive): Update prototype.
* elfcomm.c (setup_archive): Add file_size parameter and sanity
check longnames_size.
(setup_nested_archive): Get file size and pass to setup_archive.
* elfedit.c (process_archive): Likewise.
* readelf.c (process_archive): Pass filedata->file_size to
setup_archive.
2020-03-14 Alan Modra <amodra@gmail.com>
* readelf.c (dump_section_as_strings): Free memory on error exit.
(dump_section_as_bytes, process_notes_at): Likewise.
(get_build_id): Free enote.
2020-03-13 Kamil Rytarowski <n54@gmx.com>
* readelf.c (get_netbsd_elfcore_note_type): Add support for
NT_NETBSDCORE_LWPSTATUS notes.
2020-03-13 Alan Modra <amodra@gmail.com>
* elfcomm.c (get_archive_member_name): Always return malloc'd
string or NULL.
* elfedit.c (process_archive): Tidy memory on all return paths.
* readelf.c (process_archive): Likewise.
(process_symbol_table): Likewise.
(ba_cache): New, replacing ..
(get_symbol_for_build_attribute): ..static vars here. Free
strtab and symtab before loading new ones. Reject symtab without
valid strtab in loop, breaking out of loop on valid symtab.
(process_file): Free ba_cache symtab and strtab here, resetting
ba_cache.
2020-03-12 Alan Modra <amodra@gmail.com>
* readelf.c (process_section_headers): Don't just set
filedata->section_headers NULL, free it first. Similarly for
dynamic_symbols, dynamic_strings, dynamic_syminfo and
symtab_shndx_list. Zero associated counts too.
(process_object): Free symtab_shndx_list.
(process_file): Free various allocated filedata tables.
Add support for generating DWARF-5 format directory and file name tables from the assembler. PR 25611 PR 25614 * dwarf.h (DWARF2_Internal_LineInfo): Add li_address_size and li_segment_size fields. * dwarf.c (read_debug_line_header): Record the address size and segment selector size values (if present) in the lineinfo structure. (display_formatted_table): Warn if the format count is empty but the table itself is not empty. Display the format count and entry count at the start of the table dump. (display_debug_lines_raw): Display the address size and segement selector size fields, if present. * testsuite/binutils-all/dw5.W: Update expected output. gas * dwarf2dbg.c (DWARF2_FILE_TIME_NAME): Default to -1. (DWARF2_FILE_SIZE_NAME): Default to -1. (DWARF2_LINE_VERSION): Default to the current dwarf level or 3, whichever is higher. (DWARF2_LINE_MAX_OPS_PER_INSN): Provide a default value of 1. (NUM_MD5_BYTES): Define. (struct file entry): Add md5 field. (get_filenum): Delete and replace with... (get_basename): New function. (get_directory_table_entry): New function. (allocate_filenum): New function. (allocate_filename_to_slot): New function. (dwarf2_where): Use new functions. (dwarf2_directive_filename): Add support for extended .file pseudo-op. (dwarf2_directive_loc): Allow the use of file number zero with DWARF 5 or higher. (out_file_list): Rename to... (out_dir_and_file_list): Add DWARF 5 support. (out_debug_line): Emit extra values into the section header for DWARF 5. (out_debug_str): Allow for file 0 to be used with DWARF 5. * doc/as.texi (.file): Update the description of this pseudo-op. * testsuite/gas/elf-dwarf-5-file0.s: Add more lines. * testsuite/gas/elf-dwarf-5-file0.d: Update expected dump output. * testsuite/gas/lns/lns-diag-1.l: Update expected error message. * NEWS: Mention the new feature.
2020-03-11 11:17:14 +01:00
2020-03-11 Nick Clifton <nickc@redhat.com>
PR 25611
PR 25614
* dwarf.h (DWARF2_Internal_LineInfo): Add li_address_size and
li_segment_size fields.
* dwarf.c (read_debug_line_header): Record the address size and
segment selector size values (if present) in the lineinfo
structure.
(display_formatted_table): Warn if the format count is empty but
the table itself is not empty.
Display the format count and entry count at the start of the table
dump.
(display_debug_lines_raw): Display the address size and segement
selector size fields, if present.
* testsuite/binutils-all/dw5.W: Update expected output.
2020-03-11 Alan Modra <amodra@gmail.com>
PR 25651
* objcopy.c (copy_object): Test "gaps" not gap_fill_set or
pad_to_set on second block of code dealing with padding.
Replace "c" with "num_sec" and don't recalculate number of
sections on second block. Size arrays using sizeof (element)
rather than sizeof (element type).
2020-03-10 Alan Modra <amodra@gmail.com>
* objdump.c (disassemble_section): Don't call qsort unless
sym count is at least two.
(disassemble_data): Don't call memcpy with NULL src.
2020-03-09 Alan Modra <amodra@gmail.com>
PR 25645
* readelf.c (dump_ia64_vms_dynamic_fixups): Pass size and nmemb
to get_data rather than multiplying.
(dump_ia64_vms_dynamic_relocs): Likewise.
(process_version_sections): Correct order of size and nmemb args
in get_data call.
(process_mips_specific): Likewise.
2020-03-08 H.J. Lu <hongjiu.lu@intel.com>
* readelf.c (get_dynamic_data): Replace "memory chekers" with
"memory checkers" in comments.
2020-03-06 Simon Marchi <simon.marchi@efficios.com>
PR 25491
* doc/Makefile.am: Rename MOSTLYCLEANFILES to MAINTAINERCLEANFILES.
* doc/Makefile.in: Re-generate.
2020-03-06 Nick Clifton <nickc@redhat.com>
* objcopy.c (check_new_section_flags): New function. Reject the
SEC_COFF_SHARED flag if the target is not a COFF binary.
(copy_object): Call check_new_section_flags.
(setup_section): Likewise.
* doc/binutils.texi (objcopy): Add a note that the 'share' section
flag cannot be applied to ELF binaries.
2020-03-06 Alan Modra <amodra@gmail.com>
PR 25637
* objcopy.c (filter_symbols): Correct rem_leading_char logic.
2020-03-05 Alan Modra <amodra@gmail.com>
PR 25629
* objcopy.c (filter_symbols): Don't segfault on NULL
prefix_symbols_string.
2020-03-04 Christian Eggers <ceggers@gmx.de>
* objcopy.c (copy_object): Convert from bytes to octets for
--gap-fill and --pad-to.
2020-03-03 Nick Clifton <nickc@redhat.com>
PR 25625
* prdbg.c (pr_tag_type): Remove call to abort.
2020-03-02 Aaron Merey <amerey@redhat.com>
* binutils/testsuite/binutils-all/debuginfod.exp: Improve port
selection.
2020-03-02 Nick Clifton <nickc@redhat.com>
PR 25543
* readelf.c (dump_section_as_strings): Display new-line characters
as \n and then insert a line break.
* testsuite/binutils-all/pr25543.s: New test.
* testsuite/binutils-all/pr25543.d: Test driver.
* testsuite/binutils-all/readelf.exp: Run the new test.
2020-02-27 Nick Clifton <nickc@redhat.com>
PR 25526
* readelf.c (process_ia64_vms_dynamic_relocs): Check to see if
get_data is unable to load the string table.
Indent labels Labels don't go in the first column according to standard emacs C indent rules, and I got annoyed enough at seeing diff -p show a label rather than the function name to fix this. bfd/ * aoutx.h: Indent labels correctly. Format error strings. * archive.c: Likewise. * archive64.c: Likewise. * coff-arm.c: Likewise. * coff-rs6000.c: Likewise. * coff-stgo32.c: Likewise. * cpu-arm.c: Likewise. * dwarf2.c: Likewise. * elf-ifunc.c: Likewise. * elf-properties.c: Likewise. * elf-s390-common.c: Likewise. * elf-strtab.c: Likewise. * elf.c: Likewise. * elf32-arm.c: Likewise. * elf32-bfin.c: Likewise. * elf32-cr16.c: Likewise. * elf32-csky.c: Likewise. * elf32-i386.c: Likewise. * elf32-m68k.c: Likewise. * elf32-msp430.c: Likewise. * elf32-nds32.c: Likewise. * elf32-nios2.c: Likewise. * elf32-pru.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-x86-64.c: Likewise. * elfcode.h: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfnn-riscv.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-x86.c: Likewise. * i386lynx.c: Likewise. * merge.c: Likewise. * pdp11.c: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. binutils/ * elfedit.c: Indent labels correctly. * readelf.c: Likewise. * resres.c: Likewise. gas/ * config/obj-elf.c: Indent labels correctly. * config/obj-macho.c: Likewise. * config/tc-aarch64.c: Likewise. * config/tc-alpha.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-cr16.c: Likewise. * config/tc-crx.c: Likewise. * config/tc-frv.c: Likewise. * config/tc-i386-intel.c: Likewise. * config/tc-i386.c: Likewise. * config/tc-ia64.c: Likewise. * config/tc-mn10200.c: Likewise. * config/tc-mn10300.c: Likewise. * config/tc-nds32.c: Likewise. * config/tc-riscv.c: Likewise. * config/tc-s12z.c: Likewise. * config/tc-xtensa.c: Likewise. * config/tc-z80.c: Likewise. * read.c: Likewise. * symbols.c: Likewise. * write.c: Likewise. ld/ * emultempl/cskyelf.em: Indent labels correctly. * ldfile.c: Likewise. * ldlang.c: Likewise. * plugin.c: Likewise. opcodes/ * aarch64-asm.c: Indent labels correctly. * aarch64-dis.c: Likewise. * aarch64-gen.c: Likewise. * aarch64-opc.c: Likewise. * alpha-dis.c: Likewise. * i386-dis.c: Likewise. * nds32-asm.c: Likewise. * nfp-dis.c: Likewise. * visium-dis.c: Likewise.
2020-02-25 06:04:46 +01:00
2020-02-26 Alan Modra <amodra@gmail.com>
* elfedit.c: Indent labels correctly.
* readelf.c: Likewise.
* resres.c: Likewise.
2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/25584
* ar.c (main): Pass 0 to bfd_plugin_set_program_name.
* nm.c (main): Pass 1 to bfd_plugin_set_program_name.
2020-02-24 Nick Clifton <nickc@redhat.com>
PR 25499
* doc/binutils.texi (objdump): Fix typo in description of
objdump's -g option.
RISC-V: Support the ISA-dependent CSR checking. According to the riscv privilege spec, some CSR are only valid when rv32 or the specific extension is set. We extend the DECLARE_CSR and DECLARE_CSR_ALIAS to record more informaton we need, and then check whether the CSR is valid according to these information. We report warning message when the CSR is invalid, so we have a choice between error and warning by --fatal-warnings option. Also, a --no-warn/-W option is used to turn the warnings off, if people don't want the warnings. gas/ * config/tc-riscv.c (enum riscv_csr_class): New enum. Used to decide whether or not this CSR is legal in the current ISA string. (struct riscv_csr_extra): New structure to hold all extra information of CSR. (riscv_init_csr_hash): New function. According to the DECLARE_CSR and DECLARE_CSR_ALIAS, insert CSR extra information into csr_extra_hash. Call hash_reg_name to insert CSR address into reg_names_hash. (md_begin): Call riscv_init_csr_hashes for each DECLARE_CSR. (reg_csr_lookup_internal, riscv_csr_class_check): New functions. Decide whether the CSR is valid according to the csr_extra_hash. (init_opcode_hash): Update 'if (hash_error != NULL)' as hash_error is not a boolean. This is same as riscv_init_csr_hash, so keep the consistent usage. * testsuite/gas/riscv/csr-dw-regnums.d: Add -march=rv32if option. * testsuite/gas/riscv/priv-reg.d: Add f-ext by -march option. * testsuite/gas/riscv/priv-reg-fail-fext.d: New testcase. The source file is `priv-reg.s`, and the ISA is rv32i without f-ext, so the f-ext CSR are not allowed. * testsuite/gas/riscv/priv-reg-fail-fext.l: Likewise. * testsuite/gas/riscv/priv-reg-fail-rv32-only.d: New testcase. The source file is `priv-reg.s`, and the ISA is rv64if, so the rv32-only CSR are not allowed. * testsuite/gas/riscv/priv-reg-fail-rv32-only.l: Likewise. include/ * opcode/riscv-opc.h: Extend DECLARE_CSR and DECLARE_CSR_ALIAS to record riscv_csr_class. opcodes/ * riscv-dis.c (print_insn_args): Updated since the DECLARE_CSR is changed. gdb/ * riscv-tdep.c: Updated since the DECLARE_CSR is changed. * riscv-tdep.h: Likewise. * features/riscv/rebuild-csr-xml.sh: Generate the 64bit-csr.xml without rv32-only CSR. * features/riscv/64bit-csr.xml: Regernated. binutils/ * dwarf.c: Updated since the DECLARE_CSR is changed.
2020-02-12 11:18:49 +01:00
2020-02-20 Nelson Chu <nelson.chu@sifive.com>
* dwarf.c (regname_internal_riscv): Updated since the DECLARE_CSR
is changed.
2020-02-19 Jordan Rupprecht <rupprecht@google.com>
* objdump.c (show_line): call bfd_demangle when using do_demangle.
Merge changes from GCC for the config/ directory GCC's config/ChangeLog since the last time this merge was done (in the binutils-gdb commit 0b4d000cc4e8e77c823) is included at the end of this commit message. It is worth noting that the binutils-gdb commit 301a9420d947da1458 added the file config/debuginfod.m4 which is not present in GCC's config/ directory. This file is preserved, unmodified, after this commit. In order to regenerate all of the configure files, I configured with --enable-maintainer-mode, and built the 'all' target. I then did the same thing on a source tree without this patch, and only committed those files that changed when this patch was added. GCC's config/ChangeLog entries: 2020-02-12 Sandra Loosemore <sandra@codesourcery.com> PR libstdc++/79193 PR libstdc++/88999 * no-executables.m4: Use a non-empty program to test for linker support. 2020-02-01 Andrew Burgess <andrew.burgess@embecosm.com> * lib-link.m4 (AC_LIB_LINKFLAGS_BODY): Update shell syntax. 2020-01-27 Andrew Burgess <andrew.burgess@embecosm.com> * lib-link.m4 (AC_LIB_LINKFLAGS_BODY): Add new --with-libXXX-type=... option. Use this to guide the selection of either a shared library or a static library. 2020-01-24 Maciej W. Rozycki <macro@wdc.com> * toolexeclibdir.m4: New file. 2019-09-10 Christophe Lyon <christophe.lyon@st.com> * futex.m4: Handle *-uclinux*. * tls.m4 (GCC_CHECK_TLS): Likewise. 2019-09-06 Florian Weimer <fweimer@redhat.com> * futex.m4 (GCC_LINUX_FUTEX): Include <unistd.h> for the syscall function. 2019-07-08 Richard Sandiford <richard.sandiford@arm.com> * bootstrap-Og.mk: New file. 2019-06-25 Kwok Cheung Yeung <kcy@codesourcery.com> Andrew Stubbs <ams@codesourcery.com> * gthr.m4 (GCC_AC_THREAD_HEADER): Add case for gcn. 2019-05-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * ax_count_cpus.m4: New file. 2019-05-02 Richard Biener <rguenther@suse.de> PR bootstrap/85574 * bootstrap-lto.mk (extra-compare): Set to gcc/lto1$(exeext). 2019-04-16 Martin Liska <mliska@suse.cz> * bootstrap-lto-lean.mk: Filter out -flto in STAGEtrain_CFLAGS. 2019-04-09 Martin Liska <mliska@suse.cz> * bootstrap-lto-lean.mk: New file. 2019-03-02 Johannes Pfau <johannespfau@gmail.com> * mh-mingw: Also set __USE_MINGW_ACCESS flag for C++ code. 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * math.m4, tls.m4: Use AC_LANG_SOURCE. Merge from binutils-gdb: 2018-06-19 Simon Marchi <simon.marchi@ericsson.com> * override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69. config/ChangeLog: * ax_count_cpus.m4: New file, backported from GCC. * bootstrap-Og.mk: New file, backported from GCC. * bootstrap-lto-lean.mk: New file, backported from GCC. * bootstrap-lto.mk: Changes backported from GCC. * futex.m4: Changes backported from GCC. * gthr.m4: Changes backported from GCC. * lib-link.m4: Changes backported from GCC. * mh-mingw: Changes backported from GCC. * no-executables.m4: Changes backported from GCC. * tls.m4: Changes backported from GCC. * toolexeclibdir.m4: New file, backported from GCC. binutils/ChangeLog: * configure: Regenerate. gdb/ChangeLog: * configure: Regenerate. gdbserver/ChangeLog: * configure: Regenerate. gdbsupport/ChangeLog: * configure: Regenerate. intl/ChangeLog: * configure: Regenerate. libiberty/ChangeLog: * configure: Regenerate. zlib/ChangeLog.bin-gdb: * configure: Regenerate.
2020-02-05 12:50:07 +01:00
2020-02-19 Andrew Burgess <andrew.burgess@embecosm.com>
* configure: Regenerate.
2020-02-10 Fangrui Song <maskray@google.com>
* objcopy.c (parse_flags): Handle "exclude".
* doc/binutils.texi: Document the support.
2020-02-10 Aaron Merey <amerey@redhat.com>
* binutils/testsuite/binutils-all/debuginfod.exp:
Replace set ::env with setenv.
Start server before setting environment variable.
Specify tmpdir as the location of the server's
database.
Check additional server metrics at start-up.
2020-02-07 Nick Clifton <nickc@redhat.com>
* README-how-to-make-a-release: Add note about updating the
GAS/NEWS URL in the next release.
Add support for the GBZ80 and Z80N variants of the Z80 architecture, and add DWARF debug info support to the Z80 assembler. PR 25469 bfd * archures.c: Add GBZ80 and Z80N machine values. * reloc.c: Add BFD_RELOC_Z80_16_BE. * coff-z80.c: Add support for new reloc. * coffcode.h: Add support for new machine values. * cpu-z80.c: Add support for new machine names. * elf32-z80.c: Add support for new reloc. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. binutils* readelf.c (get_machine_flags): Add support for Z80N machine number. gas * config/tc-z80.c: Add -gbz80 command line option to generate code for the GameBoy Z80. Add support for generating DWARF. * config/tc-z80.h: Add support for DWARF debug information generation. * doc/c-z80.texi: Document new command line option. * testsuite/gas/z80/gbz80_all.d: New file. * testsuite/gas/z80/gbz80_all.s: New file. * testsuite/gas/z80/z80.exp: Run the new tests. * testsuite/gas/z80/z80n_all.d: New file. * testsuite/gas/z80/z80n_all.s: New file. * testsuite/gas/z80/z80n_reloc.d: New file. include * coff/internal.h (R_IMM16BE): Define. * elf/z80.h (EF_Z80_MACH_Z80N): Define. (R_Z80_16_BE): New reloc. ld * emulparams/elf32z80.sh: Use z80 emulation. * emultempl/z80.em: Make generic to both COFF and ELF Z80 emulations. * emultempl/z80elf.em: Delete. * testsuite/ld-elf/pr22450.d: Expect to fail for the Z80. * testsuite/ld-elf/sec64k.exp: Fix Z80 assembly. * testsuite/ld-unique/pr21529.s: Avoid register name conflict. * testsuite/ld-unique/unique.s: Likewise. * testsuite/ld-unique/unique_empty.s: Likewise. * testsuite/ld-unique/unique_shared.s: Likewise. * testsuite/ld-unique/unique.d: Updated expected output. * testsuite/ld-z80/arch_z80n.d: New file. * testsuite/ld-z80/comb_arch_z80_z80n.d: New file. * testsuite/ld-z80/labels.s: Add more labels. * testsuite/ld-z80/relocs.s: Add more reloc tests. * testsuite/ld-z80/relocs_f_z80n.d: New file opcodes * z80-dis.c: Add support for GBZ80 opcodes.
2020-02-07 15:53:46 +01:00
2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
PR 25469
* readelf.c (get_machine_flags): Add support for Z80N machine
number.
2020-02-07 Nick Clifton <nickc@redhat.com>
* dwarf.c (display_debug_lines_decoded): Force a NUL termination
of the truncated file name.
2020-02-06 14:34:00 +01:00
2020-02-06 Andrew Burgess <andrew.burgess@embecosm.com>
* objdump.c (print_jump_visualisation): New function.
(disassemble_bytes): Call new function.
2020-02-06 Alan Modra <amodra@gmail.com>
* testsuite/lib/binutils-common.exp (match_target): Accept '!' before
TCL procedure.
(supports_gnu_osabi): New procedure.
(is_generic): New, from ld-lib.exp.
(supports_gnu_unique): Use the above.
2020-02-04 Alan Modra <amodra@gmail.com>
* Makefile.am (CFILES): Add od-elf32_avr.c.
* Makefile.in: Regenerate.
* po/POTFILES.in: Regenerate.
2020-02-03 Andreas Schwab <schwab@linux-m68k.org>
* readelf.c (dump_relocations, dump_relocations)
(decode_arm_unwind_bytecode, process_dynamic_section)
(get_symbol_visibility, get_alpha_symbol_other): Add newline to
error message.
2020-02-03 Sergei Trofimovich <siarheit@google.com>
* coffdump.c (program_name): Drop redundant definition.
* srconv.c (program_name): Likewise
* sysdump.c (program_name): Likewise
ELF: Add support for unique section ID to assembler Clang's integrated assembler supports multiple section with the same name: .section .text,"ax",@progbits,unique,1 nop .section .text,"ax",@progbits,unique,2 nop "unique,N" assigns the number, N, as the section ID, to a section. The valid values of the section ID are between 0 and 4294967295. It can be used to distinguish different sections with the same section name. This is useful with -fno-unique-section-names -ffunction-sections. -ffunction-sections by default generates .text.foo, .text.bar, etc. Using the same string can save lots of space in .strtab. This patch adds section_id to bfd_section and reuses the linker internal bit in BFD section flags, SEC_LINKER_CREATED, for assmebler internal use to mark valid section_id. It also updates objdump to compare section pointers if 2 sections comes from the same file since 2 different sections can have the same section name. bfd/ PR gas/25380 * bfd-in2.h: Regenerated. * ecoff.c (bfd_debug_section): Add section_id. * section.c (bfd_section): Add section_id. (SEC_ASSEMBLER_SECTION_ID): New. (BFD_FAKE_SECTION): Add section_id. binutils/ PR gas/25380 * objdump.c (sym_ok): Return FALSE if 2 sections are in the same file with different section pointers. gas/ PR gas/25380 * config/obj-elf.c (section_match): Removed. (get_section): Also match SEC_ASSEMBLER_SECTION_ID and section_id. (obj_elf_change_section): Replace info and group_name arguments with match_p. Also update the section ID and flags from match_p. (obj_elf_section): Handle "unique,N". Update call to obj_elf_change_section. * config/obj-elf.h (elf_section_match): New. (obj_elf_change_section): Updated. * config/tc-arm.c (start_unwind_section): Update call to obj_elf_change_section. * config/tc-ia64.c (obj_elf_vms_common): Likewise. * config/tc-microblaze.c (microblaze_s_data): Likewise. (microblaze_s_sdata): Likewise. (microblaze_s_rdata): Likewise. (microblaze_s_bss): Likewise. * config/tc-mips.c (s_change_section): Likewise. * config/tc-msp430.c (msp430_profiler): Likewise. * config/tc-rx.c (parse_rx_section): Likewise. * config/tc-tic6x.c (tic6x_start_unwind_section): Likewise. * doc/as.texi: Document "unique,N" in .section directive. * testsuite/gas/elf/elf.exp: Run "unique,N" tests. * testsuite/gas/elf/section15.d: New file. * testsuite/gas/elf/section15.s: Likewise. * testsuite/gas/elf/section16.s: Likewise. * testsuite/gas/elf/section16a.d: Likewise. * testsuite/gas/elf/section16b.d: Likewise. * testsuite/gas/elf/section17.d: Likewise. * testsuite/gas/elf/section17.l: Likewise. * testsuite/gas/elf/section17.s: Likewise. * testsuite/gas/i386/unique.d: Likewise. * testsuite/gas/i386/unique.s: Likewise. * testsuite/gas/i386/x86-64-unique.d: Likewise. * testsuite/gas/i386/i386.exp: Run unique and x86-64-unique. ld/ PR gas/25380 * testsuite/ld-i386/pr22001-1c.S: Use "unique,N" in .section directives. * testsuite/ld-i386/tls-gd1.S: Likewise. * testsuite/ld-x86-64/pr21481b.S: Likewise.
2020-02-03 02:07:51 +01:00
2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
PR gas/25380
* objdump.c (sym_ok): Return FALSE if 2 sections are in the
same file with different section pointers.
2020-02-01 14:14:16 +01:00
2020-02-01 Nick Clifton <nickc@redhat.com>
* README-how-to-make-a-release: Update with more details on the
release making process.
2020-01-31 Nick Clifton <nickc@redhat.com>
* po/sv.po: Updated Swedish translation.
2020-01-28 Nick Clifton <nickc@redhat.com>
* readelf.c (get_build_id): Simplify warning message about corrupt
notes encountered whilst scanning for the build-id.
2020-01-27 Roland McGrath <mcgrathr@google.com>
* objcopy.c (compare_gnu_build_notes): Fix comparison results
for overlapping ranges so that (A == B) == (B == A) holds.
2020-01-27 Alan Modra <amodra@gmail.com>
* testsuite/lib/binutils-common.exp (big_or_little_endian): Replace
case statement with switch statement.
2020-01-24 Nick Clifton <nickc@redhat.com>
* readelf.c (get_build_id): Fix warning messages about corrupt
notes.
2020-01-23 Nick Clifton <nickc@redhat.com>
* po/fr.po: Updated French translation.
2020-01-22 Yuri Chornoivan <yurchor@mageia.org>
PR 25417
* readelf.c (get_alpha_symbol_other): Fix error message typo.
2020-01-20 Nick Clifton <nickc@redhat.com>
* po/pt.po: Updated Portuguese translation.
* po/uk.po: Updated Ukranian translation.
2020-01-18 Nick Clifton <nickc@redhat.com>
* README-how-to-make-a-release: Update notes on how to cut a
branch for a release.
2020-01-18 Nick Clifton <nickc@redhat.com>
* configure: Regenerate.
* po/binutils.pot: Regenerate.
2020-01-18 Nick Clifton <nickc@redhat.com>
Binutils 2.34 branch created.
2020-01-17 Thomas Troeger <tstroege@gmx.de>
* objdump.c (jump_info_visualize_address): Discard jumps that are
no longer needed.
(disassemble_bytes): Only compute the maximum level if jumps were
detected.
2020-01-13 Nick Clifton <nickc@redhat.com>
* objdump.c (disassemble_bytes): Remove C99-ism.
* testsuite/binutils-all/debuginfod.exp: New tests.
2020-01-13 Thomas Troeger <tstroege@gmx.de>
* objdump.c (visualize_jumps, color_output, extended_color_output)
(detected_jumps): New variables.
(usage): Add the new jump visualization options.
(option_values): Add new option value.
(long_options): Add the new option.
(jump_info_new, jump_info_free): New functions.
(jump_info_min_address, jump_info_max_address): Likewise.
(jump_info_end_address, jump_info_is_start_address): Likewise.
(jump_info_is_end_address, jump_info_size): Likewise.
(jump_info_unlink, jump_info_insert): Likewise.
(jump_info_add_front, jump_info_move_linked): Likewise.
(jump_info_intersect, jump_info_merge): Likewise.
(jump_info_sort, jump_info_visualize_address): Likewise.
(disassemble_jumps): New function - used to locate jumps.
(disassemble_bytes): Add ascii art generation.
(disassemble_section): Add scan to locate jumps.
(main): Parse the new visualization option.
* doc/binutils.texi: Document the new feature.
* NEWS: Mention the new feature.
2020-01-13 Alan Modra <amodra@gmail.com>
PR 25360
PR 25361
* dwarf.c (display_debug_frames): Move fde_fc earlier. Free
fde_fc col_type and col_offset.
* readelf.c (apply_relocations): Move symsec check earlier.
(free_debug_section): Free reloc_info.
(process_notes_at): Free pnotes on error path.
(process_object): Free dump_sects here..
(process_archive): ..not here.
2020-01-13 Alan Modra <amodra@gmail.com>
PR 25362
* nm.c (display_rel_file): Free dyn_syms.
2020-01-09 Nick Clifton <nickc@redhat.com>
PR 25220
* objcopy.c (empty_name): New variable.
(need_sym_before): Prevent an attempt to free a static variable.
(filter_symbols): Avoid strcmp test by checking for pointer
equality.
2020-01-09 Nick Clifton <nickc@redhat.com>
* po/zh_TW.po: Updated Traditional Chinese translation.
2020-01-09 Aaron Merey <amerey@redhat.com>
* Makefile.am (readelf_LDADD, objdump_LDADD): Add libdebuginfod.
* Makefile.in: Regenerate.
* NEWS: Update.
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac: Call AC_DEBUGINFOD.
* doc/Makefile.in: Regenerate.
* doc/binutils.texi: Add section on using binutils
with debuginfod.
* dwarf.c (debuginfod_fetch_separate_debug_info): New function.
Query debuginfod servers for the target debug file.
(load_separate_debug_info): Call
debuginfod_fetch_separate_debug_info if configured with
debuginfod.
(load_separate_debug_files): Add file argument to
load_separate_debug_info calls.
* dwarf.h (get_build_id): Add declaration.
* objdump.c (get_build_id): New function. Get build-id of file.
* readelf.c (get_build_id): Likewise.
* testsuite/binutils-all/debuginfod.exp: New tests.
* testsuite/binutils-all/linkdebug.s: Add .note.gnu.build-id
section.
Add support for the GBZ80, Z180, and eZ80 variants of the Z80 architecure. Add an ELF based target for these as well. PR 25224 bfd * Makefile.am: Add z80-elf target support. * configure.ac: Likewise. * targets.c: Likewise. * config.bfd: Add z80-elf target support and new arches: ez80 and z180. * elf32-z80.c: New file. * archures.c: Add new z80 architectures: eZ80 and Z180. * coffcode.h: Likewise. * cpu-z80.c: Likewise. * bfd-in2.h: Likewise plus additional Z80 relocations. * coff-z80.c: Add new relocations for Z80 target and local label check. gas * config/tc-z80.c: Add new architectures: Z180 and eZ80. Add support for assembler code generated by SDCC. Add new relocation types. Add z80-elf target support. * config/tc-z80.h: Add z80-elf target support. Enable dollar local labels. Local labels starts from ".L". * testsuite/gas/all/fwdexp.d: Fix failure due to symbol conflict. * testsuite/gas/all/fwdexp.s: Likewise. * testsuite/gas/z80/suffix.d: Fix failure on ELF target. * testsuite/gas/z80/z80.exp: Add new tests * testsuite/gas/z80/dollar.d: New file. * testsuite/gas/z80/dollar.s: New file. * testsuite/gas/z80/ez80_adl_all.d: New file. * testsuite/gas/z80/ez80_adl_all.s: New file. * testsuite/gas/z80/ez80_adl_suf.d: New file. * testsuite/gas/z80/ez80_isuf.s: New file. * testsuite/gas/z80/ez80_z80_all.d: New file. * testsuite/gas/z80/ez80_z80_all.s: New file. * testsuite/gas/z80/ez80_z80_suf.d: New file. * testsuite/gas/z80/r800_extra.d: New file. * testsuite/gas/z80/r800_extra.s: New file. * testsuite/gas/z80/r800_ii8.d: New file. * testsuite/gas/z80/r800_z80_doc.d: New file. * testsuite/gas/z80/z180.d: New file. * testsuite/gas/z80/z180.s: New file. * testsuite/gas/z80/z180_z80_doc.d: New file. * testsuite/gas/z80/z80_doc.d: New file. * testsuite/gas/z80/z80_doc.s: New file. * testsuite/gas/z80/z80_ii8.d: New file. * testsuite/gas/z80/z80_ii8.s: New file. * testsuite/gas/z80/z80_in_f_c.d: New file. * testsuite/gas/z80/z80_in_f_c.s: New file. * testsuite/gas/z80/z80_op_ii_ld.d: New file. * testsuite/gas/z80/z80_op_ii_ld.s: New file. * testsuite/gas/z80/z80_out_c_0.d: New file. * testsuite/gas/z80/z80_out_c_0.s: New file. * testsuite/gas/z80/z80_reloc.d: New file. * testsuite/gas/z80/z80_reloc.s: New file. * testsuite/gas/z80/z80_sli.d: New file. * testsuite/gas/z80/z80_sli.s: New file. ld * Makefile.am: Add new target z80-elf * configure.tgt: Likewise. * emultempl/z80.em: Add support for eZ80 and Z180 architectures. * emulparams/elf32z80.sh: New file. * emultempl/z80elf.em: Likewise. * testsuite/ld-z80/arch_ez80_adl.d: Likewise. * testsuite/ld-z80/arch_ez80_z80.d: Likewise. * testsuite/ld-z80/arch_r800.d: Likewise. * testsuite/ld-z80/arch_z180.d: Likewise. * testsuite/ld-z80/arch_z80.d: Likewise. * testsuite/ld-z80/comb_arch_ez80_z80.d: Likewise. * testsuite/ld-z80/comb_arch_z180.d: Likewise. * testsuite/ld-z80/labels.s: Likewise. * testsuite/ld-z80/relocs.s: Likewise. * testsuite/ld-z80/relocs_b_ez80.d: Likewise. * testsuite/ld-z80/relocs_b_z80.d: Likewise. * testsuite/ld-z80/relocs_f_z80.d: Likewise. * testsuite/ld-z80/z80.exp: Likewise. opcodes * z80-dis.c: Add support for eZ80 and Z80 instructions.
2020-01-02 15:10:40 +01:00
2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
* readelf.c: Add support for new Z*) relocations and machine
types.
2020-01-01 Alan Modra <amodra@gmail.com>
Update year range in copyright notice of all files.
2020-01-01 08:37:11 +01:00
For older changes see ChangeLog-2019
2020-01-01 08:37:11 +01:00
Copyright (C) 2020 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
Local Variables:
mode: change-log
left-margin: 8
fill-column: 74
version-control: never
End: