aboutsummaryrefslogtreecommitdiff
path: root/binutils/ChangeLog
AgeCommit message (Collapse)AuthorFilesLines
2022-04-06Add code to display the contents of .debug_loclists sections which contain ↵Nick Clifton1-0/+24
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 Baldwin1-0/+5
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 Clifton1-0/+4
2022-03-16objcopy --weaken-symbol: apply to STB_GNU_UNIQUE symbolsFangrui Song1-0/+8
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?1-0/+6
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 Marchi1-0/+4
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 Marchi1-0/+18
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 Marchi1-0/+5
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 Marchi1-0/+6
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 Marchi1-0/+4
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 Clifton1-0/+4
2022-03-15Fix bug in dwarf-mode.elTom Tromey1-0/+5
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 Mezentsev1-0/+5
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 Clifton1-0/+17
* 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. Rozycki1-0/+19
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 Marchi1-0/+4
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 Clifton1-0/+4
the 2.38 release is out.
2022-01-27Updated Swedish translation for the binutils subdirectoryNick Clifton1-0/+4
2022-01-24Update Bulgarian, French, Romaniam and Ukranian translation for some of the ↵Nick Clifton1-0/+7
sub-directories
2022-01-22Allow inferring tmp_prefix from the dll name from a def file.Martin Storsj?1-0/+5
2022-01-22Change version number to 2.38.50 and regenerate filesNick Clifton1-0/+5
2022-01-22Add markers for 2.38 branchNick Clifton1-0/+4
2022-01-17Update the config.guess and config.sub files from the master repository and ↵Nick Clifton1-0/+4
regenerate files.
2022-01-11ar: Add --thin for creating thin archivesFangrui Song1-0/+9
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 Storsj1-0/+5
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 Mayorov1-1/+9
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 Clifton1-0/+6
PR 28718 * debug.c (debug_write_type): Allow for malicious recursion via indirect debug types.
2022-01-04Remove a spurious debugging message.Nick Clifton1-0/+5
PR 28716 * dwarf.c (load_build_id_debug_file): Remove spurious printf.
2022-01-02Update year range in copyright notice of binutils filesAlan Modra1-1/+1
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 Clifton1-0/+12
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 Xu1-0/+5
2021-12-02Fix illegal memory access whilst parsing corrupt DWARF debug information.Nick Clifton1-0/+6
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 McGrath1-0/+5
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 Clifton1-0/+14
* 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 Clifton1-0/+6
PR 28632 * strings.c (usage): Update desciption of -n option. * doc/binutils.texi: Likewise.
2021-11-24Fix an illegal memory access parsing a corrupt sysroff file.Nick Clifton1-0/+5
PR 28564 * sysdump.c (getCHARS): Check for an out of bounds read.
2021-11-16readelf: Support SHT_RELR/DT_RELR for -rFangrui Song1-0/+11
The -r output for SHT_RELR looks like: Relocation section '.relr.dyn' at offset 0x530 contains 4 entries: 7 offsets 00000000000028c0 00000000000028c8 0000000000003ad0 0000000000003ad8 0000000000003ae0 0000000000003ae8 0000000000003af0 For --use-dynamic, the header looks like 'RELR' relocation section at offset 0x530 contains 32 bytes: include/ * elf/common.h (DT_ENCODING): Bump to 38. * elf/external.h (Elf32_External_Relr): New. (Elf64_External_Relr): New. binutils/ * readelf.c (enum relocation_type): New. (slurp_relr_relocs): New. (dump_relocations): Change is_rela to rel_type. Dump RELR. (dynamic_relocations): Add DT_RELR. (process_relocs): Check SHT_RELR and DT_RELR. (process_dynamic_section): Store into dynamic_info for DT_RELR/DT_RELRENT/DT_RELRSZ.
2021-11-09Add --unicode option to control how unicode characters are handled by ↵Nick Clifton1-0/+15
display tools. * nm.c: Add --unicode option to control how unicode characters are handled. * objdump.c: Likewise. * readelf.c: Likewise. * strings.c: Likewise. * binutils.texi: Document the new feature. * NEWS: Document the new feature. * testsuite/binutils-all/unicode.exp: New file. * testsuite/binutils-all/nm.hex.unicode * testsuite/binutils-all/strings.escape.unicode * testsuite/binutils-all/objdump.highlight.unicode * testsuite/binutils-all/readelf.invalid.unicode
2021-11-03Use section name in warnings in display_debug_locTom Tromey1-0/+4
While looking at an apparently malformed executable with "readelf --debug-dump=loc", I got this warning: readelf: ./main: Warning: There is a hole [0x89 - 0x95] in .debug_loc section. However, the executable only has a .debug_loclists section. This patch fixes the warning messages in display_debug_loc to use the name of the section that is being processed. binutils/ChangeLog 2021-11-03 Tom Tromey <tromey@adacore.com> * dwarf.c (display_debug_loc): Use section name in warnings.
2021-10-25binutils, ld: make objdump --ctf's parameter optionalNick Alcock1-0/+7
ld by default (and always, unless adjusted with a hand-rolled linker script) emits deduplicated CTF into the .ctf section. But viewing it needs you to explicitly tell objdump this: it doesn't default its argument, even though what you always end up typing is --ctf=.ctf. This is annoying, so make the argument optional. binutils/ChangeLog 2021-10-25 Nick Alcock <nick.alcock@oracle.com> * objdump.c (usage): --ctf now has an optional argument. (main): Adjust accordingly. (dump_ctf): Default it. * doc/ctf.options.texi: Adjust. ld/ChangeLog 2021-10-25 Nick Alcock <nick.alcock@oracle.com> * testsuite/ld-ctf/array.d: Change --ctf=.ctf to --ctf. * testsuite/ld-ctf/conflicting-cycle-1.B-1.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-1.B-2.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-1.parent.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-2.A-1.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-2.A-2.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-2.parent.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-3.C-1.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-3.C-2.d: Likewise. * testsuite/ld-ctf/conflicting-cycle-3.parent.d: Likewise. * testsuite/ld-ctf/conflicting-enums.d: Likewise. * testsuite/ld-ctf/conflicting-typedefs.d: Likewise. * testsuite/ld-ctf/cross-tu-cyclic-conflicting.d: Likewise. * testsuite/ld-ctf/cross-tu-cyclic-nonconflicting.d: Likewise. * testsuite/ld-ctf/cross-tu-into-cycle.d: Likewise. * testsuite/ld-ctf/cross-tu-noncyclic.d: Likewise. * testsuite/ld-ctf/cycle-1.d: Likewise. * testsuite/ld-ctf/cycle-2.A.d: Likewise. * testsuite/ld-ctf/cycle-2.B.d: Likewise. * testsuite/ld-ctf/cycle-2.C.d: Likewise. * testsuite/ld-ctf/data-func-conflicted.d: Likewise. * testsuite/ld-ctf/diag-cttname-null.d: Likewise. * testsuite/ld-ctf/diag-cuname.d: Likewise. * testsuite/ld-ctf/diag-parlabel.d: Likewise. * testsuite/ld-ctf/enum-forward.d: Likewise. * testsuite/ld-ctf/enums.d: Likewise. * testsuite/ld-ctf/forward.d: Likewise. * testsuite/ld-ctf/function.d: Likewise. * testsuite/ld-ctf/nonrepresentable.d: Likewise. * testsuite/ld-ctf/slice.d: Likewise. * testsuite/ld-ctf/super-sub-cycles.d: Likewise.
2021-10-25binutils: make objdump/readelf --ctf-parent actually usefulNick Alcock1-0/+16
This option has been present since the very early days of the development of libctf as part of binutils, and it shows. Back in the earliest days, I thought we might handle ambiguous types by introducing new ELF sections on the fly named things like .ctf.foo.c for ambiguous types found only in foo.c, etc. This turned out to be a terrible idea, so we moved to using a CTF archive in the .ctf section which contained all the CTF dictionaries -- but the --ctf-parent option in objdump and readelf was never adjusted, and lingered as a mechanism to specify CTF parent dictionaries in sections other than .ctf, even though the linker has no way to produce parent dictionaries in different sections from their children, libctf's ctf_open can't handle such split-up parent/child dicts, and they are never found in the wild, emitted by GNU ld or by any known third-party linking tool. Meanwhile, the actually-useful ctf_link feature (albeit not used by ld) which lets you remap the names of CTF archive members (so you can end up with a parent archive member named something other than ".ctf", still contained with all its children in a single .ctf section) had no support in objdump or readelf: there was no way to tell them that these members were parents, so all the types in the associated child dicts always appeared corrupted, referencing nonexistent types from a parent objdump couldn't find. So adjust --ctf-parent so that rather than taking a section name it takes a member name instead (if not specified, the name is ".ctf", which is what GNU ld emits). Because the option was always useless before now, this is expected to have no backward-compatibility implications. As part of this, we have to slightly adjust the code which skips the archive member name if redundant: right now it skips it if it's ".ctf", on the assumption that this name will almost always be at the start of the objdump output and thus we'll end up with a shared dump and then smaller, headed dumps for the per-TU child dicts; but if the parent name has been changed, that won't be true any more. So change the rules to "members named .ctf which appear first in the first have their member name skipped". Since we now need to count members, move from ctf_archive_iter (for which passing in extra parameters requires defining a new struct and is clumsy) to ctf_archive_next, allowing us to just *call* dump_ctf_archive_member and maintain a member count in the obvious way. In the process we fix a tiny difference between readelf and objdump: if a ctf_dump ever failed, readelf skipped every later member, while objdump tried to keep going as much as it could. For a dumping tool the former is clearly preferable. binutils/ChangeLog 2021-10-25 Nick Alcock <nick.alcock@oracle.com> * objdump.c (usage): --ctf-parent now takes a name, not a section. (dump_ctf): Don't open a separate section; use the parent_name in ctf_dict_open instead. Use ctf_archive_next, not ctf_archive_iter, so we can pass down a member count. (dump_ctf_archive_member): Add the member count; don't return anything. Import parents into children no matter what the parent's name, while still avoiding displaying the header for the common parent name of ".ctf". * readelf.c (usage): Adjust similarly. (dump_section_as_ctf): Likewise. (dump_ctf_archive_member): Likewise. Never stop iterating over archive members, even if ctf_dump of one member fails. * doc/ctf.options.texi: Adjust.
2021-10-19Fix a potential illegal memory access when testing for a special LTO symbol ↵Nick Clifton1-0/+6
name. bfd * linker.c (_bfd_generic_link_add_one_symbol): Test for a NULL name before checking to see if the symbol is __gnu_lto_slim. * archive.c (_bfd_compute_and_write_armap): Likewise. binutils * nm.c (filter_symbols): Test for a NULL name before checking to see if the symbol is __gnu_lto_slim. * objcopy.c (filter_symbols): Likewise.
2021-09-30make objcopy fail if it is asked to redefine symbols in an object file ↵Nick Clifton1-0/+5
containing LTO information. * objcopy.c (filter_symbols): Fail if attempting to dredefine symbols in an LTO object file.
2021-09-27configure: regenerate in all projects that use libtool.m4Nick Alcock1-0/+4
(including sim/, which has no changelog.) bfd/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate. binutils/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate. gas/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate. gprof/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate. ld/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate. libctf/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate. * Makefile.in: Regenerate. opcodes/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate. zlib/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> * configure: Regenerate.
2021-09-20riscv: print .2byte or .4byte before an unknown instruction encodingAndrew Burgess1-0/+6
When the RISC-V disassembler encounters an unknown instruction, it currently just prints the value of the bytes, like this: Dump of assembler code for function custom_insn: 0x00010132 <+0>: addi sp,sp,-16 0x00010134 <+2>: sw s0,12(sp) 0x00010136 <+4>: addi s0,sp,16 0x00010138 <+6>: 0x52018b 0x0001013c <+10>: 0x9c45 My proposal, in this patch, is to change the behaviour to this: Dump of assembler code for function custom_insn: 0x00010132 <+0>: addi sp,sp,-16 0x00010134 <+2>: sw s0,12(sp) 0x00010136 <+4>: addi s0,sp,16 0x00010138 <+6>: .4byte 0x52018b 0x0001013c <+10>: .2byte 0x9c45 Adding the .4byte and .2byte opcodes. The benefit that I see here is that in the patched version of the tools, the disassembler output can be fed back into the assembler and it should assemble to the same binary format. Before the patch, the disassembler output is invalid assembly. I've started a RISC-V specific test file under binutils so that I can add a test for this change. binutils/ChangeLog: * testsuite/binutils-all/riscv/riscv.exp: New file. * testsuite/binutils-all/riscv/unknown.d: New file. * testsuite/binutils-all/riscv/unknown.s: New file. opcodes/ChangeLog: * riscv-dis.c (riscv_disassemble_insn): Print a .%dbyte opcode before an unknown instruction, '%d' is replaced with the instruction length.
2021-09-07Revert: [AArch64] MTE corefile supportLuis Machado1-0/+8
bfd * elf.c (elfcore_make_memtag_note_section): New function. (elfcore_grok_note): Handle NT_MEMTAG note types. binutils* readelf.c (get_note_type): Handle NT_MEMTAG note types. include * elf/common.h (NT_MEMTAG): New constant. (NT_MEMTAG_TYPE_AARCH_MTE): New constant.
2021-08-11Updated Portuguese translation for the binutils sub-directory.Nick Clifton1-0/+4
2021-08-10Updated Serbian and Russian translations for various sub-directoriesNick Clifton1-0/+4
2021-07-16Updated Swedish translation for the binutils sub-directoryNick Clifton1-0/+4
2021-07-14objdump: add DWARF support for AIXClément Chigot1-0/+7
DWARF sections have special names on AIX which need be handled by objdump in order to correctly print them. This patch also adds the correlation in bfd for future uses. bfd/ * libxcoff.h (struct xcoff_dwsect_name): Add DWARF name. * coff-rs6000.c (xcoff_dwsect_names): Update. * coffcode.h (sec_to_styp_flags): Likewise. (coff_new_section_hook): Likewise. binutils/ * dwarf.h (struct dwarf_section): Add XCOFF name. * dwarf.c (struct dwarf_section_display): Update. * objdump.c (load_debug_section): Add XCOFF name handler. (dump_dwarf_section): Likewise. gas/ * config/tc-ppc.c (ppc_change_debug_section): Update to match new name's field.