Age | Commit message (Collapse) | Author | Files | Lines |
|
While working on gdb's .debug_names writer, I found a couple of small
bugs in binutils .debug_names dumping.
First, the DWARF spec (section 6.1.1.4.6 Name Table) says:
These two arrays are indexed starting at 1, [...]
I think it is clearer for binutils to follow this, particularly
because DW_IDX_parent refers to this number.
Second, I think the handling of an empty hash table is slightly wrong.
Currently the dumping code assumes there is always an array of hashes.
However, section 6.1.1.4.5 Hash Lookup Table says:
The optional hash lookup table immediately follows the list of
type signatures.
and then:
The hash lookup table is actually two separate arrays: an array of
buckets, followed immediately by an array of hashes.
My reading of this is that the hash table as a whole is optional, and
so the hashes will not exist in this case. (This also makes sense
because the hashes are not useful without the buckets anyway.)
This patch fixes both of these problems. FWIW I have some gdb patches
in progress that change gdb both to omit the hash table and to use
DW_IDX_parent.
2023-12-04 Tom Tromey <tom@tromey.com>
* dwarf.c (display_debug_names): Handle empty .debug_names hash
table. Name entries start at 1.
|
|
* intl: Remove directory. Replaced with out-of-tree GNU gettext.
* .gitignore: Add '/gettext*'.
* configure.ac (host_libs): Replace intl with gettext. (hbaseargs, bbaseargs, baseargs): Split baseargs into {h,b}baseargs. (skip_barg): New flag. Skips appending current flag to bbaseargs. <library exemptions>: Exempt --with-libintl-{type,prefix} from target and build machine argument passing.
* configure: Regenerate.
* Makefile.def (host_modules): Replace intl module with gettext module. (configure-ld): Depend on configure-gettext.
* Makefile.in: Regenerate.
* src-release.sh: Remove references to the intl/ directory.
|
|
PR 31062
* objdump.c (decompressed_dumps): New local variable. (usage): Mention the -z/--decompress option. (long_options): Add --decompress. (dump_section_header): Add "COMPRESSED" to the Flags field of any compressed section. (dump_section): Warn users when dumping a compressed section. (display_any_bfd): Decompress the section if decompressed_dumps is true. (main): Handle the -z/--decompress option.
* NEWS: Mention the new feature.
* doc/binutils.texi: Document the new feature.
* testsuite/binutils-all/objdump.s: Update expected output.
* testsuite/binutils-all/objdump.exp: Add test of -Z -s.
* testsuite/binutils-all/objdump.Zs: New file.
* readelf.c (maybe_expand_or_relocate_section): New function. Contains common code found in dump functions. Adds a note message if a compressed section is not being decompressed. (dump_section_as_strings): Use new function. (dump_section_as_bytes): Likewise.
|
|
Teach bfd and readelf about some recent gfx11 architectures. This code
is taken from the rocgdb 5.7.x branch [1].
[1] https://github.com/rocm-Developer-Tools/rocgdb/tree/rocm-5.7.x
bfd/ChangeLog:
* archures.c (bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
bfd_mach_amdgcn_gfx1102): New.
* bfd-in2.h (bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
bfd_mach_amdgcn_gfx1102): New.
* cpu-amdgcn.c (arch_info_struct): Add entries for
bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
bfd_mach_amdgcn_gfx1102.
binutils/ChangeLog:
* readelf.c (decode_AMDGPU_machine_flags): Handle gfx1100,
gfx1101, gfx1102.
include/ChangeLog:
* elf/amdgpu.h (EF_AMDGPU_MACH_AMDGCN_GFX1100,
EF_AMDGPU_MACH_AMDGCN_GFX1101,
EF_AMDGPU_MACH_AMDGCN_GFX1102): New.
Change-Id: I95a8a62942e359781a1c9fa2079950fbcf2a78b8
Co-Authored-By: Laurent Morichetti <laurent.morichetti@amd.com>
Cc: Lancelot Six <lancelot.six@amd.com>
|
|
PR 30880
* dwarf.c (read_and_display_attr_value): Fix loclist handling. (display_loclists_list): Likewise.
|
|
When compiling hello world and adding a v9 .gdb-index section:
...
$ gcc -g hello.c
$ gdb-add-index a.out
...
readelf shows it as:
...
Shortcut table:
Language of main: unknown: 0
Name of main: ^A
...
The documentation of gdb says about the "Name of main" that:
...
This value must be ignored if the value for the language of main is zero.
...
Implement this approach in display_gdb_index, such that we have instead:
...
Shortcut table:
Language of main: unknown: 0
Name of main: <unknown>
...
Tested on x86_64-linux.
Approved-By: Jan Beulich <jbeulich@suse.com>
|
|
Add the abilitity to print a v9 .gdb_index section.
The v9 section contains an extra table, which is printed as follows:
...
Shortcut table:
Language of main: Fortran 95
Name of main: contains_keyword
...
[ For the example, I used the exec of gdb test-case
gdb.fortran/nested-funcs-2-exp when running the test-case with target board
cc-with-gdb-index. ]
Tested on x86_64-linux.
Approved-By: Nick Clifton <nickc@redhat.com>
|
|
ELFv2 ABI
PR 30916
* testsuite/binutils-all/addr2line.exp: Do not use PowerPC specific options when working with a MUSL target.
|
|
PR 29267
* dwarf.c (fetch_indexed_value): Delete. (fetch_indexed_offset): Correct base address calculation. (read_and_display_attr_value): Replace uses of fetch_indexed_value with fetch_indexed_offset.
|
|
|
|
of 22.
|
|
PR 30792
* dwarf.h (struct debug_info): Remove range_versions field.
* dwarf.c (fetch_indexed_offset): New function. (read_and_display_attr_value): Use it for DW_FORM_rnglistx. Remove code to initialise range_versions. (skip_attribute): New function. (read_bases): Read and reccord all range and address bases in a CU. (process_debug_info): Call read_bases. (display_debug_rnglists): Rename to display_debug_rnglists_unit_header and only display the range list header information. (display_debug_ranges): Adjust.
|
|
PR 30684
* readelf.c (extra_sym_info): New variable. (section_name_valid): Also check for filedata being NULL. (section_name_print): Delete. (section_index_real): New function. Returns true if the given section index references a real section. (print_symbol): Rename to print_sumbol_name. (printable_section_name): Use a rotating array of static buffers for the return string. (printable_section_name_from_index): Merge code from dump_relocations and get_symbol_index_type into here. (long_option_values): Add OPTION_NO_EXTRA_SYM_INFO. (options): Add "extra-sym-info" and "no-extra-sym-info". (usage): Mention new options. (parse_args): Parse new options. (get_symbol_index_type): Delete. (print_dynamic_symbol_size): Rename to print_symbol_size. (print_dynamic_symbol): Rename to print_symbol. (print_symbol_table_heading): New function. (process_symbol_table): Use new function.
* doc/binutils.texi: Document the new option.
* NEWS: Mention the new feature.
|
|
|
|
PR 30791
* dwarf.h (debug_info): Add range_versions field.
* dwarf.c (read_and_display_attr_value): When recording a range arribute also ecord the dwarf version number.
(is_range_list_for_this_section): New function.
(display_debug_ranges): Only show debug ranges whose version is suitable for the secction being displayed.
|
|
This reverts commit 675b9d612cc59446e84e2c6d89b45500cb603a8d.
See https://sourceware.org/pipermail/binutils/2023-August/128761.html.
|
|
|
|
This patch adds support for EF_BPF_CPUVER bits in the ELF
machine-dependent header flags. These bits encode the BPF CPU
version for which the object file has been compiled for.
The BPF assembler is updated so it annotates the object files it
generates with these bits.
The BPF disassembler is updated so it honors EF_BPF_CPUVER to use the
appropriate ISA version if the user didn't specify an explicit ISA
version in the command line. Note that a value of zero in
EF_BPF_CPUVER is interpreted by the disassembler as "use the later
supported version" (the BPF CPU versions start with v1.)
The readelf utility is updated to pretty print EF_BPF_CPUVER when it
prints out the ELF header:
$ readelf -h a.out
ELF Header:
...
Flags: 0x4, CPU Version: 4
Tested in bpf-unknown-none.
include/ChangeLog:
2023-07-30 Jose E. Marchesi <jose.marchesi@oracle.com>
* elf/bpf.h (EF_BPF_CPUVER): Define.
* opcode/bpf.h (BPF_XBPF): Change from 0xf to 0xff so it fits in
EF_BPF_CPUVER.
binutils/ChangeLog:
2023-07-30 Jose E. Marchesi <jose.marchesi@oracle.com>
* readelf.c (get_machine_flags): Recognize and pretty print BPF
machine flags.
opcodes/ChangeLog:
2023-07-30 Jose E. Marchesi <jose.marchesi@oracle.com>
* bpf-dis.c: Initialize asm_bpf_version to -1.
(print_insn_bpf): Set BPF ISA version from the cpu version ELF
header flags if no explicit version set in the command line.
* disassemble.c (disassemble_init_for_target): Remove unused code.
gas/ChangeLog:
2023-07-30 Jose E. Marchesi <jose.marchesi@oracle.com>
* config/tc-bpf.h (elf_tc_final_processing): Define.
* config/tc-bpf.c (bpf_elf_final_processing): New function.
|
|
output unreproducible.
bfd
* peXXigen.c (_bfd_XXi_only_swap_filehdr_out): If inserting a timestamp, use the value held in the SOURCE_DATE_EPOCH environment variable, if it is defined.
binutils
* doc/binutils.texi (objcopy): Document change in behaviour of objcopy's --preserve-dates command line option.
ld
* pe-dll.c (fill_edata): If inserting a timestamp, use the value held in the SOURCE_DATE_EPOCH environment variable, if it is defined.
* ld.texi (--insert-timestamp): Document change in behaviour.
|
|
For example, objcopy --set-section-flags .data=alloc,large will add
SHF_X86_64_LARGE to the .data section. Omitting "large" will drop the
SHF_X86_64_LARGE flag.
The bfd_section flag is named generically, SEC_ELF_LARGE, in case other
processors want to follow SHF_X86_64_LARGE. SEC_ELF_LARGE has the same
value as SEC_TIC54X_BLOCK used by coff.
bfd/
* section.c: Define SEC_ELF_LARGE.
* bfd-in2.h: Regenerate.
* elf64-x86-64.c (elf_x86_64_section_flags, elf_x86_64_fake_sections,
elf_x86_64_copy_private_section_data): New.
binutils/
* NEWS: Mention the new feature for objcopy.
* doc/binutils.texi: Mention "large".
* objcopy.c (parse_flags): Parse "large".
(check_new_section_flags): Error if "large" is used with a
non-x86-64 ELF target.
* testsuite/binutils-all/x86-64/large-sections.d: New.
* testsuite/binutils-all/x86-64/large-sections.s: New.
* testsuite/binutils-all/x86-64/large-sections-i386.d: New.
* testsuite/binutils-all/x86-64/large-sections-2.d: New.
* testsuite/binutils-all/x86-64/large-sections-2-x32.d: New.
|
|
|
|
|
|
PR 30598
* strings.c (set_string_min): New function. (main): Use it. (print_unicode_stream): Calculate buffer size using a size_t.
|
|
excessively lerge minimum string length.
PR 30595
* strings.c (main): Check for an excessively large minimum string length.
|
|
execstack option.
* testsuite/lib/binutils-common.exp (prune_warnings_extra): Prune warnings about -z execstack creating an executable stack.
|
|
* od-pe.c (targ_info): New array.
(get_target_specific_info): New function.
(decode_machine_number): Retire. Use get_target_specific_info instead.
(is_pe_object_magic): Likewise.
(dump_pe_file_header): Display more information.
Rework layout to be similar to that from 'objdump -p'.
Add code to handle larger than normnal AOUT headers.
|
|
|
|
format files.
* od-pe.c: New file: Dumps fields in PE format headers.
* configure.ac (od_vectors): Add objdump_private_desc_pe for PE format targets. (od_files): Add od-pe for PE format targets.
* configure: Regenerate.
* Makefile.am (CFILES): Add od-pe.c (EXTRA_objdump_SOURCE): Likewise.
* Makefile.in: Generate.
* NEWS: Mention the new feature.
* doc/binutils.texi: Document the new support.
* objdump.c (wide_output): Change from local to global.
* objdump.h (wide_output): Prototype. (objdump_private_desc_pe): Prototype.
* testsuite/binutils-all/objdump.exp: Add a test of the new feature.
|
|
|
|
|
|
security related bugs.
|
|
PR 30355
* dwarf.c (read_and_display_attr_value): Correctly handle DW_loclistx attributes that index a version 5 .debug_loclists section.
|
|
PR 30142
* peXXigen.c (_bfd_XXi_swap_scnhdr_out): Do not force the .rsrc section to be writeable.
* rescoff.c (write_coff_file): Add the SEC_READONLY flag to the .rsrc section.
|
|
PR 30327
* dwarf.c (read_and_display_attr_value): Warn if the number of views is greater than the number of locations.
|
|
corrupt DWARF file.
PR 30313
* dwarf.c (display_debug_lines_decoded): Check for an overlarge number of files or directories.
|
|
PR 30312
* dwarf.c (prealloc_cu_tu_list): Always allocate at least one entry.
|
|
corrupt ELF format file.
PR 30311
* readelf.c (uncompress_section_contents): Check for a suspiciously large uncompressed size.
|
|
PR 30284
* dwarf.c (read_and_display_attr_value): Detect and ignore negative base values.
|
|
binutils * readelf.c (get_segment_type): Handle PT_OPENBSD_MUTABLE segment type.
include * elf/common.h (PT_OPENBSD_MUTABLE): Define.
|
|
DWARF file.
PR 30227
* dwarf.c (process_cu_tu_index): Prevent excessive memory allocation when nused is large and ncols is zero.
|
|
I've found that I often use dwarf-mode with relatively small test
files. In this situation, it's handy to be able to expand all the
DWARF, rather than moving to each "..." separately and using C-u C-m.
This patch implements this feature. It also makes a couple of other
minor changes:
* I removed a stale FIXME from dwarf-mode. In practice I find I often
use "g" to restore the buffer to a pristine state; checking the file
mtime would work against this.
* I tightened the regexp in dwarf-insert-substructure. This prevents
the C-m binding from trying to re-read a DIE which has already been
expanded.
* Finally, I've bumped the dwarf-mode version number so that this
version can easily be installed using package.el.
2023-02-09 Tom Tromey <tromey@adacore.com>
* dwarf-mode.el: Bump version to 1.8.
(dwarf-insert-substructure): Tighten regexp.
(dwarf-refresh-all): New defun.
(dwarf-mode-map): Bind "A" to dwarf-refresh-all.
(dwarf-mode): Remove old FIXME.
|
|
PR 30080 * doc/binutils.texi (nm): Update description of the 'n' symbol type.
|
|
|
|
|
|
PR 29993
* objcopy.c (merge_gnu_build_notes): Remember the last non-deleted note in order to speed up the scan for matching notes.
|
|
|
|
|
|
|
|
|
|
|