Commit Graph

3715 Commits

Author SHA1 Message Date
Enze Li
d9cc4b060d Correct a spelling mistake in the binutils README file. 2023-05-09 11:44:22 +01:00
Nick Clifton
b545d4239b Remove Dimity Diky as MSP430 maintainer. 2023-05-02 13:33:53 +01:00
Nick Clifton
8e7785b4bd Add a SECURITY.txt file describing the GNU Binutils' project's stance on security related bugs. 2023-04-20 16:52:11 +01:00
Nick Clifton
28ab94f51d Fix: readelf: loc_offset XX too big
PR 30355
  * dwarf.c (read_and_display_attr_value): Correctly handle DW_loclistx attributes that index a version 5 .debug_loclists section.
2023-04-19 11:48:24 +01:00
Nick Clifton
c53c6186c8 Make the .rsrc section read only.
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.
2023-04-17 17:19:21 +01:00
Nick Clifton
7bb9e56c6a Replace an assertion in the dwarf code with a warning message.
PR 30327
  * dwarf.c (read_and_display_attr_value): Warn if the number of views is greater than the number of locations.
2023-04-11 17:24:09 +01:00
Nick Clifton
9f1c612b7c Fix an attempt to allocate an excessive amount of memory when parsing a corrupt DWARF file.
PR 30313
  * dwarf.c (display_debug_lines_decoded): Check for an overlarge number of files or directories.
2023-04-11 16:14:23 +01:00
Nick Clifton
688fe114cd Fix a potential illegal memory access when displaying corrupt DWARF information.
PR 30312
  * dwarf.c (prealloc_cu_tu_list): Always allocate at least one entry.
2023-04-11 15:59:07 +01:00
Nick Clifton
45f5fe468b Fix an attempt to allocate an overlarge amount of memory when decoding a corrupt ELF format file.
PR 30311
  * readelf.c (uncompress_section_contents): Check for a suspiciously large uncompressed size.
2023-04-11 15:30:02 +01:00
Nick Clifton
8d17c53b8d Fix an illegal memory access triggered by parsing corrupt DWARF info.
PR 30284
  * dwarf.c (read_and_display_attr_value): Detect and ignore negative base values.
2023-03-30 11:04:53 +01:00
Frederic Cambus
80251d4185 Add support to readelf for the PT_OPENBSD_MUTABLE segment type.
binutils * readelf.c (get_segment_type): Handle PT_OPENBSD_MUTABLE segment type.
include  * elf/common.h (PT_OPENBSD_MUTABLE): Define.
2023-03-23 15:19:38 +00:00
Nick Clifton
97b75c421f Prevent an over large memory allocation in readelf when parsing a corrupt DWARF file.
PR 30227
  * dwarf.c (process_cu_tu_index): Prevent excessive memory allocation when nused is large and ncols is zero.
2023-03-14 13:15:12 +00:00
Tom Tromey
93c8054387 Add full display feature to dwarf-mode.el
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.
2023-02-09 13:50:21 -07:00
Nick Clifton
3a8be578d6 Fix documentation of the 'n' symbol type displayed by nm.
PR 30080 * doc/binutils.texi (nm): Update description of the 'n' symbol type.
2023-02-07 11:41:28 +00:00
Nick Clifton
be527f283a Updated Swedish translation for the binutils sub-directory 2023-01-31 13:02:20 +00:00
Nick Clifton
b960c86c1e Updated Swedish translation for the binutils sub-directory 2023-01-23 10:53:12 +00:00
Nick Clifton
94e76498c3 Speed up objcopy's note merging.
PR 29993
  * objcopy.c (merge_gnu_build_notes): Remember the last non-deleted note in order to speed up the scan for matching notes.
2023-01-18 11:32:21 +00:00
Nick Clifton
69373ba164 Updated translations for the gas and binutils sub-directories 2023-01-16 10:45:38 +00:00
Nick Clifton
4004cf8331 Updated transaltions for the gprof and binutils sub-directories 2023-01-09 10:24:13 +00:00
Nick Clifton
c362d5978e Remove Stephen Casner as the PDP11 maintainer. 2023-01-05 14:40:16 +00:00
Nick Clifton
11982f9f8b Updated translations for various languages and sub-directories 2023-01-03 11:32:42 +00:00
Luis Machado
a8f175d9d0 Add new NT_ARM_ZA and NT_ARM_SSVE register set constants. 2023-01-03 11:15:26 +00:00
Alan Modra
d87bef3a7b Update year range in copyright notice of binutils files
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.
2023-01-01 21:50:11 +10:30
Nick Clifton
a72b07181d Add markers for 2.40 branch 2022-12-31 12:05:28 +00:00
Nick Clifton
826eed8027 Updated Romanian translation for the binutils sub-directory 2022-12-31 08:55:31 +00:00
Nick Clifton
75393a2d54 Fix an attempt to allocate an unreasonably large amount of memory when parsing a corrupt ELF file.
PR  29924
	* objdump.c (load_specific_debug_section): Check for excessively
	large sections.
2022-12-21 11:51:23 +00:00
Tom Tromey
0d120726bd Avoid compiler warning in dwarf-do-refresh
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.
2022-12-19 09:46:54 -07:00
Nick Clifton
42f39fdedc Fix potential illegal memory accesses when parsing corrupt DWARF data.
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.
2022-12-19 11:13:46 +00:00
Nick Clifton
fa501b6930 Fix a potential illegal memory access when parsing corrupt DWARF information.
PR 29908
	* dwarf.c (display_debug_addr): Check for corrupt header lengths.
2022-12-16 12:06:43 +00:00
Nick Clifton
6ef35c04df Fix verilog output when the width is > 1.
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.
2022-12-01 13:09:26 +00:00
Nick Clifton
1a7e622b82 Fix ARM and AArch64 assembler tests to work in a multi-arch environment.
PR 29764
gas	* testsuite/gas/arm/cpu-cortex-a76ae.d: Add arm prefix to the -m
	option passed to objdump.
	* testsuite/gas/arm/cpu-cortex-a77.d: Likewise.
	* testsuite/gas/aarch64/cpu-cortex-a76ae.d: Add aarch64 prefix to
	the -m option passed to objdump.
	* testsuite/gas/aarch64/cpu-cortex-a77.d: Likewise.

bfd	* cpu-arm.c (scan): Accept machine names prefixed with "arm:".
	* cpu-aarch64.c (scan): Accept machine names prefixed with "aarch64:".

bin	* doc/binutils.texi (objdump): Note that the -m option supports
	the <architecture>:<machine> syntax.
2022-11-21 16:44:02 +00:00
Nick Clifton
1da0b075ae Update release documentation with regard to uploading gprofng docs 2022-11-04 12:01:03 +00:00
Nick Clifton
18bf56434d objdump: Add configure time option to enable colored disassembly output by default.
PR 29457
	* configure.ac: Add --enable-colored-disassembly.
	* objdump.c: Add --disassembler-color=terminal.
	* doc/binutils.texi (objdump): Document the new option.
	* NEWS: Mention new feature.
	* config.in: Regenerate in.
	* configure: Regenerate.
2022-10-31 09:35:16 +00:00
Nick Clifton
f2ba47d69e Update MAINTAINERS file with details about accepting DCO signed contributions.
* MAINTAINERS: Add section on patches, copyright and DCO.
2022-10-19 12:39:20 +01:00
Nick Clifton
7fd882d4ad Fix objcopy's error message when it cannot add a .gnu_debuglink section because the section already exists.
PR 29665
	* objcopy.c (copy_object): Use the input filename when
	reporting that a .gnu_debuglink section already exists.
2022-10-12 15:33:47 +01:00
Nick Clifton
907b52f4ce readelf: DO not load section headers from file offset zero
* readelf.c (get_32bit_section_headers): Return false if the
	e_shoff field is zero.
	(get_64bit_section_headers): Likewise.
2022-10-03 13:19:21 +01:00
Nick Clifton
be5f79aa39 The help document of size misses an option.
PR 29628
	* size.c (usage): Add -f.
	* doc/binutils.texi (size): Add -f.
2022-09-28 15:29:18 +01:00
Nick Clifton
1588d98bab Stop strip from complaining about empty note sections when stripping a binary for a second time.
* objcopy.c (copy_object): Do not issue a warning message when
	encountering empty .gnu.build.attribute sections.
2022-09-20 11:46:32 +01:00
Rupesh Potharla
e959744eca Binutils: Readelf testcase failing with clang
* testsuite/binutils-all/readelf.exp (readelf_wi_test): Extend
	regexps to allow for output genreated by the Clang compiler.
2022-09-14 10:27:38 +01:00
Aaron Merey
e9a241e87b objdump: '-S' should trigger search for separate debuginfo.
Add with_source_code to the command line options that trigger
might_need_separate_debug_info and dump_any_debugging.  This helps
'objdump -S' download missing files via debuginfod without the need for
specifying extra command line options like '-L'.
2022-09-13 09:29:09 -04:00
Nick Clifton
efc1521e40 Support debuginfo files with empty group sections.
PR 29532
bfd	* elf.c (setup_group): Do not return false if there is no group
	information available.

bionutils* objcopy.c (setup_section): Leave group sections intact when
	creating separate debuginfo files.
2022-09-09 12:01:55 +01:00
Nick Clifton
2caffd34df i686-w64-mingw32-objdump -WL returns incorrect file paths
PR 29523
	* dwarf.c (display_debug_lines_decoded): Correctly handle DWARF-5
	directory and filename tables.
2022-09-08 09:56:39 +01:00
Aaron Merey
d647c797b7 Add debuginfod support for objdump -S
Currently objdump -S is not able to make use files downloaded from debuginfod.
This is due to bfd_find_nearest_line_discriminator being unable to locate any
separate debuginfo files in the debuginfod cache. Additionally objdump lacked
a call to debuginfod_find_source in order to download missing source files.

Fix this by using bfd_find_nearest_line_with_alt instead of
bfd_find_nearest_line_discriminator. Also add a call to
debuginfod_find_source in order to download missing source files.

Co-authored-by: Nick Clifton <nickc@redhat.com>
2022-09-06 10:43:07 -04:00
Nick Clifton
f4492fb683 dllwrap, windres and dlltools use mktemp, which should be avoided
PR 29534
	* dllwrap.c: Replace uses of choose_temp_base() with
	make_temp_file().
	* dlltool.c: Likewise.
	* resrc.c: Likewise.
2022-09-01 14:51:50 +01:00
Nick Clifton
25ee24d990 Add an option to dlltool to allow the creation of deterministic libraries.
PR 29489
	* dlltool.c (deterministic): New variable.
	(gen_lib_file): If deterministic is true set the
	BFD_DETERMINISTIC_OUTPUT flag.
	(usage): Mention --deterministic-libraries and
	--non-deterministic-libraries.
	(long_options): Add new options.
	(main): Parse new options.
	* doc/binutils.texi: Document the new options.
	* NEWS: Mention the new feature.
2022-08-23 09:54:52 +01:00
Nick Clifton
521f726815 Have readelf warn users if it is asked to decode a LLVM bitcode file or a golang object file.
* readelf.c (check_magic_number): New function.  Checks the magic
	bytes at the start of a file.  If they are not the ELF format
	magic values, then attempts to generate a helpful error message.
	(process_file_header): Call check_magic_number.
2022-08-22 11:15:40 +01:00
Nick Clifton
a88c79b770 Default to enabling colored disassembly if output is to a terminal.
PR 29457
	* objdump.c (disassembler_color): Change type to an enum.
	(disassembler_extended_color): Remove.
	(usage): Update.
	(objdump_color_for_assembler_style): Update.
	(main): Update initialisation of disassembler_color.  If not
	initialised via a command line option, set based upon terminal
	output.
	* doc/binutils.texi: Update description of disassmbler-color
	option.
	* testsuite/binutils-all/arc/objdump.exp: Add
	--disassembler-color=off option when disassembling.
	* testsuite/binutils-all/arm/objdump.exp: Likewise.
2022-08-09 14:57:48 +01:00
Nick Clifton
e838f9c284 Add a link to the NEWS files in the release announcement email. 2022-08-08 11:45:40 +01:00
Nick Clifton
0bd0932314 Add markers for 2.39 branch 2022-07-08 10:41:07 +01:00
Nick Clifton
1dd024239b Add newline to the end of the rnglists displsy. 2022-07-01 15:08:44 +01:00