summaryrefslogtreecommitdiff
path: root/binutils/ChangeLog
AgeCommit message (Collapse)Author
2022-07-08Add markers for 2.39 branchNick Clifton
2022-07-01Add newline to the end of the rnglists displsy.Nick Clifton
2022-06-30Fix implementation of readelf's -wE and -wN options,Nick Clifton
* dwarf.c (dwarf_select_sections_by_name): If the entry's value is zero then clear the corresponding variable. (dwarf_select_sections_by_letters): Likewise. * testsuite/binutils-all/debuginfo.exp: Expect -WE and -wE debuginfod tests to fail.
2022-06-28Fix the display of the idnex values for DW_FORM_loclistx and ↵Nick Clifton
DW_FORM_rnglistx. Correct the display of .debug.loclists sections. PR 29267 * dwarf.c (display_debug_rnglists): New function, broken out of.. (display_debug_ranges): ... here. (read_and_display_attr_value): Correct calculation of index displayed for DW_FORM_loclistx and DW_FORM_rnglistx. * testsuite/binutils-all/x86-64/pr26808.dump: Update expected output.
2022-06-27Replace a run-time assertion failure with a warning message when parsing ↵Nick Clifton
corrupt DWARF data. PR 29289 * dwarf.c (display_debug_names): Replace assert with a warning message.
2022-06-27Fix NULL pointer indirection when parsing corrupt DWARF data.Nick Clifton
PR 29290 * dwarf.c (read_and_display_attr_value): Check that debug_info_p is set before dereferencing it.
2022-06-27Stop bogus warnings about DWARF indexed string offsets being too big.Nick Clifton
* dwarf.c (fetch_indexed_string): Do not use length of first table in string section as the length of every table in the section. * testsuite/binutils-all/pr26112.r: Update expected output.
2022-06-22Binutils support for split-dwarf and dwarf-5Kumar N, Bhuvanendra
* dwarf.c (fetch_indexed_string): Added new parameter str_offsets_base to calculate the string offset. (read_and_display_attr_value): Read DW_AT_str_offsets_base attribute. (process_debug_info): While allocating memory and initializing debug_information, do it for do_debug_info also, if its true. (load_separate_debug_files): Load .debug_str_offsets if exists. * dwarf.h (struct debug_info): Add str_offsets_base field.
2022-06-22readelf: replace xmalloc with malloc in slurp_relr_relocsMarcus Nilsson
Using xmalloc makes the null check redundant since failing allocation will exit the program. Instead use malloc and let the error be conveyed up the call chain.
2022-06-21Binutils support for dwarf-5 (location and range lists related)Nick Clifton
* dwarf.h (struct debug_info): Add rnglists_base field. * dwarf.c (read_and_display_attr_value): Read attribute DW_AT_rnglists_base. (display_debug_rnglists_list): While handling DW_RLE_base_addressx, DW_RLE_startx_endx, DW_RLE_startx_length items, pass the proper parameter value to fetch_indexed_addr(), i.e. fetch the proper entry in .debug_addr section. (display_debug_ranges): Add rnglists_base to the .debug_rnglists base address. (load_separate_debug_files): Load .debug_addr section, if exists.
2022-05-20Stop readekf and objdump from aggressively following links.Nick Clifton
* dwarf.c (dwarf_select_sections_by_names): Return zero if no sections were selected. (dwarf_select_sections_by_letters): Likewise. * dwarf.h: (dwarf_select_sections_by_names): Update prototype. (dwarf_select_sections_by_letters): Update prototype. * objdump.c (might_need_separate_debug_info): New function. (dump_bfd): Call new function before attempting to load separate debug info files. (main): Do not enable dwarf section dumping for -WK or -WN. * readelf.c (parse_args): Do not enable dwarf section dumping for -wK or -wN. (might_need_separate_debug_info): New function. (process_object): Call new function before attempting to load separate debug info files. * testsuite/binutils-all/debuginfo.exp: Expect -WE and -wE debuginfod tests to pass. * testsuite/binutils-all/objdump.Wk: Add extra regexps. * testsuite/binutils-all/readelf.k: Add extra regexps.
2022-05-19Fix potentially uninitialised variables in the Windows toolsNick Clifton
2022-05-18Add a --no-weak option to nm.Nick Clifton
PR 29135 * nm.c (non_weak): New variable. (filter_symbols): When non-weak is true, ignore weak symbols. (long_options): Add --no-weak. (usage): Mention --no-weak. (main): Handle -W/--no-weak. * doc/binutils.texi: Document new feature. * NEWS: Mention the new feature. * testsuite/binutils-all/nm.exp: Add test of new feature. * testsuite/binutils-all/no-weak.s: New test source file.
2022-04-25Emit a note warning the user that creating an executable stack because of a ↵Nick Clifton
missing .note.GNU-stack section is deprecated. PR 29072 bfd * elflink.c (bfd_elf_size_dynamic_sections): Display a note to the user that the current ehaviour of creating an executable stack because of a missing .note.GNU-stack section is deprecated and will be changed in a future release. binutils* testsuite/lib/binutils-common.exp (prune_warnings_extra): Filter out notes about the executable stacjk behaviour beign deprecated. ld * testsuite/ld-elf/pr29072.b.warn: Update to include the note about the linker's behaviour being depreccated.
2022-04-12Stop strip from removing debuglink sections.Nick Clifton
PR 28992 * objcopy.c (is_strip_section_1): Do not delete debuglink sections when stripping debug information.
2022-04-06Add code to display the contents of .debug_loclists sections which contain ↵Nick Clifton
offset entry tables. PR 28981 * dwarf.c (fetch_indexed_value): Rename to fecth_indexed_addr and return the address, rather than a string. (fetch_indexed_value): New function - returns a value indexed by a DW_FORM_loclistx or DW_FORM_rnglistx form. (read_and_display_attr_value): Add support for DW_FORM_loclistx and DW_FORM_rnglistx. (process_debug_info): Load the loclists and rnglists sections. (display_loclists_list): Add support for DW_LLE_base_addressx, DW_LLE_startx_endx, DW_LLE_startx_length and DW_LLE_default_location. (display_offset_entry_loclists): New function. Displays a .debug_loclists section that contains offset entry tables. (display_debug_loc): Call the new function. (display_debug_rnglists_list): Add support for DW_RLE_base_addressx, DW_RLE_startx_endx and DW_RLE_startx_length. (display_debug_ranges): Display the contents of the section's header. * dwarf.h (struct debug_info): Add loclists_base field. * testsuite/binutils-all/dw5.W: Update expected output. * testsuite/binutils-all/x86-64/pr26808.dump: Likewise.
2022-04-01Recognize FreeBSD core dump note for x86 segment base registers.John Baldwin
This core dump note contains the value of the base address of the %fs and %gs segments for both i386 and amd64 core dumps. It is primarily useful in resolving the address of TLS variables in core dumps. binutils/ChangeLog: * readelf.c (get_freebsd_elfcore_note_type): Handle NT_FREEBSD_X86_SEGBASES. include/ChangeLog: * elf/common.h (NT_FREEBSD_X86_SEGBASES): Define.
2022-03-31Accept the + character as part of filenames for MRI scripts.Nick Clifton
2022-03-16objcopy --weaken-symbol: apply to STB_GNU_UNIQUE symbolsFangrui Song
PR binutils/28926 * objcopy.c (filter_symbols): Apply weaken to STB_GNU_UNIQUE symbols * NEWS: Mention feature. * testsuite/binutils-all/objcopy.exp (objcopy_test_symbol_manipulation): New test. * testsuite/binutils-all/weaken-gnu-unique.s: New.
2022-03-16dlltool: Use the output name as basis for deterministic temp prefixesMartin Storsj?
PR 28885 * dlltool.c (main): use imp_name rather than dll_name when generating a temporary file name.
2022-03-16binutils/readelf: handle AMDGPU relocation typesSimon Marchi
Make readelf recognize AMDGPU relocation types, as documented here: https://llvm.org/docs/AMDGPUUsage.html#amdgpu-relocation-records The user-visible change looks like: -000000000004 000400000001 unrecognized: 1 0000000000000000 SCRATCH_RSRC_DWORD0 -00000000000c 000500000001 unrecognized: 1 0000000000000000 SCRATCH_RSRC_DWORD1 -000000000014 000600000007 unrecognized: 7 0000000000000000 global_var0 -00000000001c 000700000008 unrecognized: 8 0000000000000000 global_var1 -000000000024 000800000009 unrecognized: 9 0000000000000000 global_var2 -00000000002c 00090000000a unrecognized: a 0000000000000000 global_var3 -000000000034 000a0000000b unrecognized: b 0000000000000000 global_var4 +000000000004 000400000001 R_AMDGPU_ABS32_LO 0000000000000000 SCRATCH_RSRC_DWORD0 +00000000000c 000500000001 R_AMDGPU_ABS32_LO 0000000000000000 SCRATCH_RSRC_DWORD1 +000000000014 000600000007 R_AMDGPU_GOTPCREL 0000000000000000 global_var0 +00000000001c 000700000008 R_AMDGPU_GOTPCREL 0000000000000000 global_var1 +000000000024 000800000009 R_AMDGPU_GOTPCREL 0000000000000000 global_var2 +00000000002c 00090000000a R_AMDGPU_REL32_LO 0000000000000000 global_var3 +000000000034 000a0000000b R_AMDGPU_REL32_HI 0000000000000000 global_var4 binutils/ChangeLog: * readelf.c (dump_relocations): Handle EM_AMDGPU. include/ChangeLog: * elf/amdgpu.h: Add relocation values. Change-Id: I2ed4589f4cd37ea11ad2e0cb38d4b682271e1334
2022-03-16binutils/readelf: build against msgpack, dump NT_AMDGPU_METADATA note contentsSimon Marchi
The AMDGPU HSA OS ABI (code object v3 and above) defines the NT_AMDGPU_METADATA ELF note [1]. The content is a msgpack object describing, among other things, the kernels present in the code object and how to call them. I think it would be useful for readelf to be able to display the content of those notes. msgpack is a structured format, a bit like JSON, except not text-based. It is therefore possible to dump the contents in human-readable form without knowledge of the specific layout of the note. Add configury to binutils to optionally check for the msgpack C library [2]. Add There is a new --with{,out}-msgpack configure flag, and the actual library lookup is done using pkg-config. If msgpack support is enabled, dumping a NT_AMDGPU_METADATA note looks like: $ readelf --notes amdgpu-code-object Displaying notes found in: .note Owner Data size Description AMDGPU 0x0000040d NT_AMDGPU_METADATA (code object metadata) { "amdhsa.kernels": [ { ".args": [ { ".address_space": "global", ".name": "out.coerce", ".offset": 0, ".size": 8, ".value_kind": "global_buffer", }, <snip> If msgpack support is disabled, dump the contents as hex, as is done with notes that are not handled in a special way. This allows one to decode the contents manually (maybe using a command-line msgpack decoder) if really needed. [1] https://llvm.org/docs/AMDGPUUsage.html#code-object-metadata [2] https://github.com/msgpack/msgpack-c/tree/c_master binutils/ChangeLog: * Makefile.am (readelf_CFLAGS): New. (readelf_LDADD): Add MSGPACK_LIBS. * Makefile.in: Re-generate. * config.in: Re-generate. * configure: Re-generate. * configure.ac: Add --with-msgpack flag and check for msgpack using pkg-config. * readelf.c: Include msgpack.h if HAVE_MSGPACK. (print_note_contents_hex): New. (print_indents): New. (dump_msgpack_obj): New. (dump_msgpack): New. (print_amdgpu_note): New. (process_note): Handle NT_AMDGPU_METADATA note contents. Use print_note_contents_hex. Change-Id: Ia60a654e620bc32dfdb1bccd845594e2af328b84
2022-03-16binutils/readelf: handle NT_AMDGPU_METADATA note nameSimon Marchi
Handle the NT_AMDGPU_METADATA note, which is described here: https://llvm.org/docs/AMDGPUUsage.html#code-object-v3-note-records As of this patch, just print out the name, not the contents, which is in the msgpack format. binutils/ChangeLog: * readelf.c (get_amdgpu_elf_note_type): New. (process_note): Handle "AMDGPU" notes. include/ChangeLog: * elf/amdgcn.h (NT_AMDGPU_METADATA): New. Change-Id: Id2dba2e2aeaa55ef7464fb35aee9c7d5f96ddb23
2022-03-16binutils/readelf: decode AMDGPU-specific e_flagsSimon Marchi
Decode and print the AMDGPU-specific fields of e_flags, as documented here: https://llvm.org/docs/AMDGPUUsage.html#header That is: - The specific GPU model - Whether the xnack and sramecc features are enabled The result looks like: - Flags: 0x52f + Flags: 0x52f, gfx906, xnack any, sramecc any The flags for the "HSA" OS ABI are properly versioned and documented on that page. But the NONE, PAL and MESA3D OS ABIs are not well documented nor versioned. Taking a peek at the LLVM source code, we see that they encode their flags the same way as HSA v3. For example, for PAL: https://github.com/llvm/llvm-project/blob/c8b614cd74a92d85936aed5ac7c642af75ffdc29/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp#L601 So for those other OS ABIs, we read them the same as HSA v3. binutils/ChangeLog: * readelf.c: Include elf/amdgcn.h. (decode_AMDGPU_machine_flags): New. (get_machine_flags): Handle flags for EM_AMDGPU machine type. include/ChangeLog: * elf/amdgcn.h: Add EF_AMDGPU_MACH_AMDGCN_* and EF_AMDGPU_FEATURE_* defines. Change-Id: Ib5b94df7cae0719a22cf4e4fd0629330e9485c12
2022-03-16binutils/readelf: handle AMDGPU OS ABIsSimon Marchi
When the machine is EM_AMDGPU, handle the various OS ABIs described here: https://llvm.org/docs/AMDGPUUsage.html#header For a binary with the HSA OS ABI, the change looks like: - OS/ABI: <unknown: 40> + OS/ABI: AMD HSA binutils/ChangeLog: * readelf.c (get_osabi_name): Handle EM_AMDGPU OS ABIs. include/ChangeLog: * elf/common.h (ELFOSABI_AMDGPU_PAL, ELFOSABI_AMDGPU_MESA3D): New. Change-Id: I383590c390f7dc2fe0f902f50038735626d71863
2022-03-16Updated Serbian (for binutils/) and Russian (for gprof/) translationsNick Clifton
2022-03-15Fix bug in dwarf-mode.elTom Tromey
I noticed that, occasionally, dwarf-mode would think that the objdump subprocess was still running after it had clearly exited. I managed to reliably reproduce this today and learned that a process sentinel is not guaranteed to be run with the current buffer set to the process buffer. This patch fixes the problem. I've bumped the version number of dwarf-mode.el to make it easier to install for users who already have an earlier one installed. I'm checking this in. 2022-03-15 Tom Tromey <tromey@adacore.com> * dwarf-mode.el: Now 1.7. (dwarf--sentinel): Switch to the process buffer.
2022-03-11gprofng: a new GNU profilerVladimir Mezentsev
top-level * Makefile.def: Add gprofng module. * configure.ac: Add --enable-gprofng option. * src-release.sh: Add gprofng. * Makefile.in: Regenerate. * configure: Regenerate. * gprofng: New directory. binutils * MAINTAINERS: Add gprofng maintainer. * README-how-to-make-a-release: Add gprofng. include. * collectorAPI.h: New file. * libcollector.h: New file. * libfcollector.h: New file.
2022-03-10Add option to objdump/readelf to disable access to debuginfod servers.Nick Clifton
* dwarf.c (use_debuginfod): New variable. Set to 1. (load_separate_debug_info): Only call debuginfod_fetch_separate_debug_info is use_debuginfod is true. (dwarf_select_sections_by_names): Add do-not-use-debuginfod and use-debuginfod options. (dwarf_select_sections_by_letters): Add D and E options. * dwarf.h (use_debuginfod): New extern. * objdump.c (usage): Mention the new options. * readelf.c (usage): Likewise. * doc/binutils.texi: Document the new options. * doc/debug-options.texi: Describe the new options. * NEWS: Mention the new feature. * testsuite/binutils-all/debuginfod.exp: Add tests of the new options.
2022-03-06MIPS/opcodes: Fix alias annotation for branch instructionsMaciej W. Rozycki
Correct issues with INSN2_ALIAS annotation for branch instructions: - regular MIPS BEQZ/L and BNEZ/L assembly instructions are idioms for BEQ/L and BNE/L respectively with the `rs' operand equal to $0, - microMIPS 32-bit BEQZ and BNEZ assembly instructions are idioms for BEQ and BNE respectively with the `rt' operand equal to $0, - regular MIPS BAL assembly instruction is an idiom for architecture levels of up to the MIPSr5 ISA and a machine instruction on its own from the MIPSr6 ISA up. Add missing annotation to BEQZ/L and BNEZ/L accordingly then and add a new entry for BAL for the MIPSr6 ISA, correcting a disassembly bug: $ mips-linux-gnu-objdump -m mips:isa64r6 -M no-aliases -d bal.o bal.o: file format elf32-tradlittlemips Disassembly of section .text: 00000000 <foo>: 0: 04110000 0x4110000 ... $ Add test cases accordingly. Parts for regular MIPS BEQZ/L and BNEZ/L instructions from Sagar Patel. 2022-03-06 Maciej W. Rozycki <macro@orcam.me.uk> binutils/ * testsuite/binutils-all/mips/mips1-branch-alias.d: New test. * testsuite/binutils-all/mips/mips1-branch-noalias.d: New test. * testsuite/binutils-all/mips/mips2-branch-alias.d: New test. * testsuite/binutils-all/mips/mips2-branch-noalias.d: New test. * testsuite/binutils-all/mips/mips32r6-branch-alias.d: New test. * testsuite/binutils-all/mips/mips32r6-branch-noalias.d: New test. * testsuite/binutils-all/mips/micromips-branch-alias.d: New test. * testsuite/binutils-all/mips/micromips-branch-noalias.d: New test. * testsuite/binutils-all/mips/mips-branch-alias.s: New test source. * testsuite/binutils-all/mips/micromips-branch-alias.s: New test source. * testsuite/binutils-all/mips/mips.exp: Run the new tests. 2022-03-06 Sagar Patel <sagarmp@cs.unc.edu> Maciej W. Rozycki <macro@orcam.me.uk> opcodes/ * mips-opc.c (mips_builtin_opcodes): Fix INSN2_ALIAS annotation for "bal", "beqz", "beqzl", "bnez" and "bnezl" instructions. * micromips-opc.c (micromips_opcodes): Likewise for "beqz" and "bnez" instructions.
2022-03-04binutils/readelf: fix indentation in process_dynamic_sectionSimon Marchi
Clangd shows a warning about misleading indentation in this file, fix it. binutils/ChangeLog: * readelf.c (process_dynamic_section): Fix indentation. Change-Id: I43a7f4f4c75dd080af614222b980526f5debf297
2022-02-09Update the obsolete list and how-to-make-a-release documentation now that ↵Nick Clifton
the 2.38 release is out.
2022-01-27Updated Swedish translation for the binutils subdirectoryNick Clifton
2022-01-24Update Bulgarian, French, Romaniam and Ukranian translation for some of the ↵Nick Clifton
sub-directories
2022-01-22Allow inferring tmp_prefix from the dll name from a def file.Martin Storsj?
2022-01-22Change version number to 2.38.50 and regenerate filesNick Clifton
2022-01-22Add markers for 2.38 branchNick Clifton
2022-01-17Update the config.guess and config.sub files from the master repository and ↵Nick Clifton
regenerate files.
2022-01-11ar: Add --thin for creating thin archivesFangrui Song
In many ar implementations (FreeBSD, elfutils, etc), -T has the X/Open System Interface specified semantics. Therefore -T for thin archives is not recommended for portability. -T is deprecated without diagnostics. PR binutils/28759 * ar.c (long_options): Add --thin. (usage) Add --thin. Deprecate -T without diagnostics. * doc/binutils.texi: Add doc. * NEWS: Mention --thin. * binutils/testsuite/binutils-all/ar.exp: Add tests.
2022-01-11Fix multiple problems with DLL generation.Martin Storsj
ld * pe-dll.c (make_head): Prefix the symbol name with the dll name. (make_tail, make_one, make_singleton_name_thunk): Likewise. (make_import_fixup_entry, make_runtime_pseudo_reloc): Likewise. (pe_create_runtime_relocator_reference): Likewise. (pe_dll_generate_implib): Set dll_symname_len. (pe_process_import_defs): Likewise. binutils * dlltool.c (main): If a prefix has not been provided, attempt to use a deterministic one based upon the dll name.
2022-01-07Revert previous delta to debug.c. Replace with patch to reject indirect ↵Pavel Mayorov
types that point to indirect types. PR 28718 * dwarf.c: Revert previous delta. (debug_get_real_type): Reject indirect types that point to indirect types. (debug_get_type_name, debug_get_type_size, debug_write_type): Likewise.
2022-01-06Fix a stack exhaustion bug parsing malicious STABS format debug information.Nick Clifton
PR 28718 * debug.c (debug_write_type): Allow for malicious recursion via indirect debug types.
2022-01-04Remove a spurious debugging message.Nick Clifton
PR 28716 * dwarf.c (load_build_id_debug_file): Remove spurious printf.
2022-01-02Update year range in copyright notice of binutils filesAlan Modra
The result of running etc/update-copyright.py --this-year, fixing all the files whose mode is changed by the script, plus a build with --enable-maintainer-mode --enable-cgen-maint=yes, then checking out */po/*.pot which we don't update frequently. The copy of cgen was with commit d1dd5fcc38ead reverted as that commit breaks building of bfp opcodes files.
2021-12-16When loading separate debug info files, also attempt to locate a file based ↵Nick Clifton
upon the build-id. PR 28697 * dwarf.c (load_build_id_debug_file): New function. (try_build_id_prefix): New function. (check_for_and_load_links): Call load_build_id_debug_file. (debug_displays): Add entry for .note.gnu.build-id. * dwarf.h (enum dwarf_section_display_enum): Add note_gnu_build_id. * testsuite/binutils-all/debuginfod.exp (test_fetch_debuglink): Fix regexp for loads via debuglink section.
2021-12-03Add myself and Zhensong Liu as the LoongArch port maintainer.Chenghua Xu
2021-12-02Fix illegal memory access whilst parsing corrupt DWARF debug information.Nick Clifton
PR 28645 * dwarf.c (process_cu_tu_index): Add test for overruning section whilst processing slots.
2021-11-30Fix missing build dependency for binutils man pagesRoland McGrath
binutils/ * doc/local.mk: Give each man page target its missing dependency on doc/$(am__dirstamp).
2021-11-30Use dwarf_vma type for offsets, ranges and section sizes in DWARF decoder.Nick Clifton
* dwarf.c (find_debug_info_for_offset): Use dwarf_vma type for offsets, sizes and ranges. (display_loc_list): Likewise. Also use print_dwarf_vma to print the offset. (display_loclists_list): Likewise. (display_loc_list_dwo): Likewise. (display_debug_str): Likewise. (display_debug_aranges): Likewise. (display_debug_ranges_list): Likewise. (display_debug_rnglists_list): Likewise. (display_debug_ranges): Likewise.
2021-11-29Update description of string's -n option.Nick Clifton
PR 28632 * strings.c (usage): Update desciption of -n option. * doc/binutils.texi: Likewise.