Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
Reflects the reality that I haven't done much on hppa32 for years.
|
|
This adds a mingw target for aarch64, including windres and dlltool.
Note that the old value of jmp_aarch64_bytes was wrong, and this does
the same thing as MSVC does.
|
|
|
|
PR 29972
* readelf.c (process_dynamic_section): Correct format string.
|
|
The bfd_coff_backend_data struct should be read-only, the only thing
preventing this is that objcopy writes to one of the fields,
_bfd_coff_long_section_names. This patch creates a copy of the field
in bfd coff_obj_tdata, which makes more sense anyway. When enabling
long section names the intent is to do so for a particular bfd, not
for all bfds that might happen to be using the target xvec.
bfd/
* coffcode.h: Update coff long section name comment.
(bfd_coff_set_long_section_names_allowed): Use macro accessor
to set flag.
(bfd_coff_set_long_section_names_disallowed): Tidy.
(coff_backend_info): Return a const pointer.
(bfd_coff_std_swap_table, ticoff0_swap_table, ticoff1_swap_table),
(bigobj_swap_table): Make const.
(bfd_coff_long_section_names): Use tdata copy.
(coff_mkobject): Set long_section_names from coff_backend_info.
* coff-go32.c (_bfd_go32_mkobject): Likewise.
* peicode.h (pe_mkobject): Likewise.
* coff-sh.c (bfd_coff_small_swap_table): Make const.
* libcoff-in.h (struct coff_tdata): Add long_section_names,
reorder fields.
* libcoff.h: Regenerate.
binutils/
* objcopy.c (set_long_section_mode): Move earlier in file.
(copy_object): Call set_long_section_mode here, after setting
output format.
(copy_file): Don't call set_long_section_mode.
|
|
|
|
binutils/
* MAINTAINERS: Add myself as maintainer of libsframe.
|
|
This occurs when attempting to read back a section from the output
file in _bfd_XX_bfd_copy_private_bfd_data_common. The copy of the
section failed size sanity checking, thus it won't be written.
* objcopy.c (copy_object): Return false if copy_section or
copy_relocations_in_section fails.
|
|
objcopy of archive, element containing an object with a fuzzed section
size far exceeding the element size. copy_section detects this, but
the temp file is laid out for the large section. It can take a long
time to write terabytes of sparse file, a waste of time when it will
be deleted.
* objcopy.c (copy_archive): Don't write element contents after
bad status result from copy_object.
|
|
|
|
|
|
Delete a few files only used for obsolete targets, and tidy config,
xfails and other pieces of support specific to those targets. And
since I was editing target triplets in test files, fix the nm
alpha-linuxecoff fails.
|
|
The newer update-copyright.py fixes file encoding too, removing cr/lf
on binutils/bfdtest2.c and ld/testsuite/ld-cygwin/exe-export.exp, and
embedded cr in binutils/testsuite/binutils-all/ar.exp string match.
|
|
|
|
|
|
|
|
|
|
This fixes a couple of places in display_debug_lines_decoded that were
off by one in checking DWARF5 .debug_line directory indices. It also
displays the DWARF5 entry 0 for the program current directory rather
than "." as is done for pre-DWARF5. I decided against displaying
DW_AT_comp_dir for pre-DWARF5 since I figure it is better for readelf
to minimally interpret debug info.
binutils/
PR 29948
* dwarf.c (display_debug_lines_decoded): Display the given
directory entry 0 for DWARF5. Properly check directory index
against number of entries in the table. Revert to using
unsigned int for n_directories and associated variables.
Correct warning messages.
gas/
* testsuite/gas/elf/dwarf-5-loc0.d: Update.
|
|
parsing a corrupt ELF file.
PR 29924
* objdump.c (load_specific_debug_section): Check for excessively
large sections.
|
|
The Emacs 28 compiler warns about dwarf-mode.el:
Warning (comp): dwarf-mode.el:180:32: Warning: Unused lexical argument `ignore'
This is easily fixed by prepending "_" to the parameter's name.
binutils/ChangeLog
2022-12-19 Tom Tromey <tromey@adacore.com>
* dwarf-mode.el (dwarf-do-refresh): Avoid compiler warning.
|
|
PR 29893
PR 29908
* dwarf.c (display_debug_addr): Combine dwarf5 unit_length checks.
Delete dead code.
|
|
PR 29914
* dwarf.c (fetch_indexed_value): Fail if the section is not big
enough to contain a header size field.
(display_debug_addr): Fail if the computed address size is too big
or too small.
|
|
|
|
PR 29908
* dwarf.c (display_debug_addr): Check for corrupt header lengths.
|
|
* dwarf.c (struct Frame_Chunk): Make col_offset an int64_t.
Adjust all places allocating col_offset and col_type to use
the size of the array element rather than the size of a type.
(frame_display_row): Adjust printing of col_offset.
(display_debug_frames): Factor out multiplication by
code_factor and data_factor. Avoid signed overflow. Use
64-bit variables.
|
|
abfd->filename will be freed if bfd_close gets far enough to delete
the bfd. It's possible to have an error from fclose at this point.
* objcopy.c (copy_archive): Dup filename before closing bfd for
potential use in bfd_nonfatal_message.
|
|
PR 29893
* dwarf.c (display_debug_addr): Sanity check dwarf5 unit_length
field. Don't read past end.
|
|
Plus segvs if the C-library doesn't handle printf %s of NULL.
PR 29872
* dwarf.c (null_name): New function.
(process_debug_info): Use it here..
(display_debug_lines_raw): ..and here..
(display_debug_lines_decoded): ..and here. xcalloc directory_table.
Simplify xcalloc of file_table.
|
|
DWARF5 directory and file table allow more opportunity for fuzzers
to break things. There are likely other places in dwarf.c that should
be fixed too.
PR 29870
* dwarf.c (display_debug_lines_decoded): Handle NULL file_table
name entry.
|
|
ChangeLog:
* binutils/objdump.c (dump_section_sframe): free up contents and
SFrame decoder context on exit.
|
|
Tidies:
- Move stuff from bfd-in.h and libbfd.c to compress.c
- Delete COMPRESS_DEBUG from enum compressed_debug_section_type
- Move compress_debug field out of link_info to ld_config.
Fixes:
- Correct test in bfd_convert_section_setup to use obfd flags,
not ibfd.
- Apply bfd_applicable_file_flags to compression bfd flags added
by gas and ld to the output bfd.
bfd/
* bfd-in.h (enum compressed_debug_section_type),
(struct compressed_type_tuple),
(bfd_get_compression_algorithm),
(bfd_get_compression_algorithm_name),
* libbfd.c (compressed_debug_section_names),
(bfd_get_compression_algorithm),
(bfd_get_compression_algorithm_name): Move..
* compress.c: ..to here, deleting COMPRESS_DEBUG from
enum compressed_debug_section_type.
(bfd_convert_section_setup): Test obfd flags not ibfd for
compression flags.
* elf.c (elf_fake_sections): Replace link_info->compress_debug
test with abfd->flags test.
* bfd-in2.h: Regenerate.
binutils/
* objcopy.c (copy_file): Tidy setting of bfd compress flags.
Expand comment.
gas/
* write.c (compress_debug): Test bfd compress flags rather than
flag_compress_debug.
(write_object_file): Apply bfd_applicable_file_flags to compress
debug flags added to output bfd.
include/
* bfdlink.h (struct bfd_link_info): Delete compress_debug.
ld/
* ld.h (ld_config_type): Add compress_debug.
* emultempl/elf.em: Replace references to link_info.compress_debug
with config.compress_debug.
* lexsup.c (elf_static_list_options): Likewise.
* ldmain.c (main): Likewise. Apply bfd_applicable_file_flags
to compress debug flags added to output bfd.
|
|
SEC_ELF_RENAME is a flag used to effect section name changes when
compressing/decompressing zlib-gnu debug sections. This can be
accomplished more directly in one of the objcopy specific bfd
functions. Renaming for ld input is simplified too. Ld input object
files always have BFD_DECOMPRESS set.
bfd/
* compress.c (bfd_convert_section_size): Rename to..
(bfd_convert_section_setup): ..this. Handle objcopy renaming
of compressed/decompressed debug sections.
* elf.c (_bfd_elf_make_section_from_shdr): Only rename zdebug
input for linker.
(elf_fake_sections): Don't handle renaming of debug sections for
objcopy here.
* section.c (SEC_ELF_RENAME): Delete.
* bfd-in2.h: Regenerate.
binutils/
* objcopy.c (setup_section): Call bfd_convert_section_setup.
Don't call bfd_convert_section_size.
|
|
Define an enum instead of using ELFCOMPRESS_ZLIB and ELFCOMPRESS_ZSTD
in bfd and binutils, and move some functions from bfd.c to compress.c.
When looking at the COFF/PE debug compression support, I wondered
about extending it to support zstd. I likely won't do that, but
the compression header ch_type field isn't just ELF specific if these
headers are to be used in COFF/PE too.
bfd/
* bfd.c (bfd_update_compression_header),
(bfd_check_compression_header, bfd_get_compression_header_size),
(bfd_convert_section_size, bfd_convert_section_contents): Move to..
* compress.c: ..here.
(enum compression_type): New. Use it throughout file.
* elf.c (_bfd_elf_make_section_from_shdr): Replace uses of
ELFCOMPRESS_ZLIB and ELFCOMPRESS_ZSTD with ch_compress_zlib and
ch_compress_zstd.
* bfd-in2.h: Regenerate.
binutils/
* readelf.c (process_section_headers, dump_section_as_strings),
(dump_section_as_bytes, load_specific_debug_section): Replace
uses of ELFCOMPRESS_ZLIB and ELFCOMPRESS_ZSTD with
ch_compress_zlib and ch_compress_zstd.
|
|
Mold linker demotes symbols like main to be local and the patch
adjusts expected output from nm.
Moreover, simplify the regex patterns.
|
|
Respective tests being run means guaranteed failures.
|
|
While working on disassembler styling for MIPS, I noticed that
undefined instructions are printed by the disassembler as raw number
with no assembler directive prefix (e.g. without .word or .short).
I think adding something like .word, or .short, helps to make it
clearer the size of the value that is being displayed, and is inline
with what many of the other libopcode disassemblers do.
In this commit I've added the .word and .short directives, and updated
all the tests that I spotted that failed as a result.
|
|
Fixes a fuzzed object file problem where plt relocs were manipulated
in such a way that two synthetic symbols were generated at the same
plt location. Won't occur in real object files.
PR 29846
PR 20337
* objdump.c (compare_symbols): Test symbol flags to exclude
section and synthetic symbols before attempting to check flavour.
|
|
|
|
The previous warnings about holes in .debug_loclists sections don't
take into account the headers of each CU and could include the locviews
if they precede the loclist.
The following warning can be triggered between two CU.
... <previous CU views> ...
0000001d <End of list>
0000002a v000000000000000 v000000000000000 location view pair
0000002c v000000000000000 v000000000000000 location view pair
readelf: Warning: There is a hole [0x1e - 0x2e] in .debug_loclists section.
0000002e v000000000000000 v000000000000000 views at 0000002a for:
...
But [0x1e - 0x2a] corresponds to the CU header and [0x2a - 0x2e] are
the locviews. Thus there is no hole here.
binutils/ChangeLog:
* dwarf.c (display_debug_loc): Adjust holes detections for
headers and locviews.
|
|
PR 25202
bfd * bfd.c (VerilogDataEndianness): New variable.
(verilog_write_record): Use VerilogDataEndianness, if set, to
choose the endianness of the output.
(verilog_write_section): Adjust the address by the data width.
binutils* objcopy.c (copy_object): Set VerilogDataEndianness to the
endianness of the input file.
(copy_main): Verifiy the value set by the --verilog-data-width
option.
* testsuite/binutils-all/objcopy.exp: Add tests of the new behaviour.
* testsuite/binutils-all/verilog-I4.hex: New file.
|
|
PR 10368
* doc/binutils.texi (strings): Delete example of 7-bit encoding.
|
|
This reverts commit ffbbab0b3a1000f862b6d4ce3d9a76ed14f08801.
|
|
PR 29718
binutils/ChangeLog:
* readelf.c (get_symbol_type): Consider STT_GNU_IFUNC as
reserved name.
|
|
* objdump.c (load_specific_debug_section): Use PRIx64 format.
|
|
* nm.c (formats, format): Make const.
|
|
This extends the commit 4581a1c7d304 fix to more targets, which
hardens BFD a little. I think the real underlying problem was the
bfd_canonicalize_reloc call in load_specific_debug_section which
passed a NULL for "symbols". Fix that too.
PR 22509
bfd/
* aoutx.h (swap_ext_reloc_out): Gracefully handle NULL symbols.
* i386lynx.c (swap_ext_reloc_out): Likewise.
* pdp11.c (pdp11_aout_swap_reloc_out): Likewise.
* coff-tic30.c (reloc_processing): Likewise.
* coff-tic4x.c (tic4x_reloc_processing): Likewise.
* coff-tic54x.c (tic54x_reloc_processing): Likewise.
* coff-z80.c (reloc_processing): Likewise.
* coff-z8k.c (reloc_processing): Likewise.
* ecoff.c (ecoff_slurp_reloc_table): Likewise.
* som.c (som_set_reloc_info): Likewise.
binutils/
* objdump.c (load_specific_debug_section): Pass syms to
bfd_canonicalize_reloc.
|
|
The aim here is to improve readelf handling of large 64-bit object
files on LLP64 hosts (Windows) where long is only 32 bits. The patch
changes more than just file offsets. Addresses and sizes are also
changed to avoid "long". Most places get to use uint64_t even where
size_t may be more appropriate, because that allows some overflow
checks to be implemented easily (*alloc changes).
* dwarf.c (cmalloc, xcmalloc, xcrealloc, xcalloc2): Make nmemb
parameter uint64_t.
* dwarf.h: Update prototypes.
(struct dwarf_section): Make num_relocs uint64_t.
* elfcomm.c (setup_archive): Update error format.
* elfcomm.h (struct archive_info): Make sym_size, longnames_size,
nested_member_origin, next_arhdr_offset uint64_t.
* readelf.c (struct filedata): Make archive_file_offset,
archive_file_size, string_table_length, dynamic_addr,
dynamic_nent, dynamic_strings_length, num_dynamic_syms,
dynamic_syminfo_offset uint64_t.
(many functions): Replace uses of "unsigned long" with
"uint64_t" or "size_t".
|