Commit Graph

4651 Commits

Author SHA1 Message Date
Alan Modra
479c611636 skip_attr_bytes assertion (data) <= (end) fail
get_type_abbrev_from_form is lax in not limiting data for a uleb to
the current CU, because DW_FORM_ref_addr allows access to other CU's
data.  This can lead to an assertion fail when skipping or reading
attributes in get_type_signedness.

	* dwarf.c (get_type_abbrev_from_form): Limit uleb data to map end
	for ref_addr, cu_end otherwise.
2024-08-01 21:52:34 +09:30
Nick Clifton
8896efce13 Updated translations for the bfd, binutils, gas, ld and opcodes directories 2024-07-29 11:57:25 +01:00
Pali Rohár
fb2a924990 PR 31728 testcases 2024-07-29 20:01:06 +09:30
YunQiang Su
08e6af1bac microMIPS: Add MT ASE instruction set support
Add the MT ASE instruction operand types and encodings to the microMIPS
opcode table and enable the assembly of these instructions in GAS from
MIPSr2 onwards.  Update the binutils and GAS testsuites accordingly.

References:

"MIPS Architecture for Programmers, Volume IV-f: The MIPS MT Module for
the microMIPS32 Architecture", MIPS Technologies, Inc., Document Number:
MD00768, Revision 1.12, July 16, 2013

Co-Authored-By: Maciej W. Rozycki <macro@redhat.com>
2024-07-26 18:01:09 +01:00
Nick Clifton
ad43ae7635 Fix "Untranslated plural in readelf.c"
PR 32002
2024-07-26 16:42:03 +01:00
Pali Roh?r
91b999864f Improve objdump's display of PE header information.
PR 31953
2024-07-23 08:52:21 +01:00
H.J. Lu
e1b9d58e85 Correct version for binutils 2.43 NEWS entries.
Change 2.42 to 2.43 for binutils 2.43 NEWS entries.

binutils/

	* NEWS: Change 2.42 to 2.43 for 2.43 NEWS entries.

ld/

	* NEWS: Change 2.42 to 2.43 for 2.43 NEWS entries.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-07-20 13:52:50 -07:00
Nick Clifton
9f26b04c3e Update after creating 2.43 branch 2024-07-20 13:46:23 +01:00
Nick Clifton
cff16e125a Change version to 2.43.50 2024-07-20 13:16:33 +01:00
Nick Clifton
b33c4f8f82 Add markers for 2.43 branch/release 2024-07-20 12:43:19 +01:00
Alan Modra
237c05a65f Re: binutils: Add a test for strip with build notes
The new test wasn't being run, and failed due to relocations against
.gnu.build.attributes being stripped by default strip behaviour.
We probably should be keeping these relocations, but I haven't made
that change here.
BTW, the new test fails on ia64-hpux but that's just a repeat of the
existing note-5 fail.

	PR 31999
	* testsuite/binutils-all/strip-16.d: strip with --strip-unneeded
	and --merge-notes.
	* testsuite/binutils-all/objcopy.exp: Run the new test.  Sort
	other strip tests.
2024-07-20 13:54:00 +09:30
H.J. Lu
3f55acd0ec binutils: Add a test for strip with build notes
Add a test for strip with build notes.

	PR binutils/31999
	* testsuite/binutils-all/strip-16.d: New.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-07-19 18:59:53 -07:00
Alan Modra
964be70df7 PR31999 strip [.gnu.build.attributes]: failed
PR 31999
	* objcopy.c (merge_gnu_build_notes): Always set *new_size.
2024-07-20 10:11:25 +09:30
Maciej W. Rozycki
0ffc724699 MIPS/opcodes: Mark MT thread context move assembly idioms as aliases
A number of instructions in the regular MIPS opcode table are assembly
idioms for the MT thread context move MFTR and MTTR instructions, so
mark them as aliases accordingly.  Add suitable test cases, which also
cover the PAUSE assembly idiom.
2024-07-19 19:01:53 +01:00
Vladimir Mezentsev
f769dcdb01 gprofng: add release notes for 2.43
ChangeLog
2024-07-10  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>.

	* binutils/NEWS (gprofng): Add release notes for 2.43
2024-07-11 21:27:10 -07:00
Alan Modra
66e545391e Re: LoongArch: Add DT_RELR support
Fix commit d89ecf33ab testsuite breakage.

	* testsuite/lib/binutils-common.exp (supports_dt_relr): Correct.
2024-07-06 18:22:06 +09:30
Alan Modra
428c21e99a objcopy bfd_map_over_sections and global status
This patch started life as a relatively simple change to fix some
unimportant objcopy memory leaks, but expanded into a larger patch
when I was annoyed by the awkwardness of passing data when using
bfd_map_over_sections.  A simple loop over sections is much more
convenient, and we really don't need the abstraction layer.  Sections
in a list isn't going to disappear any time soon.

The patch also removes use of the global "status" variable by all but
the top-level functions called from main.

	* objcopy.c (filter_symbols): Return success as a bool.  Pass
	symcount as a pointer, updated on return.
	(merge_gnu_build_notes): Similarly return a bool and add newsize
	param with updated smaller section size.
	(setup_bfd_headers): Return bool success rather than setting
	"status" on failure.
	(setup_section): Likewise.
	(copy_relocations_in_section, copy_section): Likewise, and adjust
	params.
	(mark_symbols_used_in_relocations): Likewise, and free memory
	on failure path.  Don't call bfd_fatal.
	(get_sections): Delete function.
	(copy_object): Don't use bfd_map_over_sections, instead use a
	loop allowing easy detection of failure status.  Free memory on
	error paths.
	(copy_archive): Return bool success rather than setting "status"
	on failure.
	(copy_file): Set "status" here.
	* testsuite/binutils-all/strip-13.d: Adjust to suit.
2024-07-06 10:41:29 +09:30
Xi Ruoyao
d89ecf33ab LoongArch: Add DT_RELR support
The logic is same as a71d876801 ("aarch64: Add DT_RELR support").

As LoongArch does not have -z dynamic-undefined-weak, we don't need to
consider UNDEFWEAK_NO_DYNAMIC_RELOC.

The linker relaxation adds another layer of complexity.  When we delete
bytes in a section during relaxation, we need to fix up the offset in
the to-be-packed relative relocations against this section.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
2024-07-05 12:11:11 +08:00
Claudiu Zissulescu
7fafb57457 MAINTAINERS: Update my e-mail address
Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
2024-07-01 10:58:17 +03:00
Alan Modra
79674bfc36 PR31941 objcopy --globalize-symbol
I think FILE symbols are special, and I can't see why anyone would
want them to be made global.  The fact that no one has reported this
bug since commit 7b4a0685e8 in 2005 supports that claim.

	PR 31941
	* objcopy.c (filter_symbols): Don't allow BSF_FILE symbols to
	be made global.
2024-07-01 11:04:31 +09:30
Marcus Nilsson
ebe3f6d0f1 objcopy: Allow making symbol global and weak on same invocation
Previously objcopy had to be run twice in order to make a local symbol
weak, first once to globalize it, and once again to mark it as weak.

	* objcopy.c (filter_symbols): Weaken symbols after making
	local/global changes.
	* testsuite/binutils-all/symbols-5.d,
	* testsuite/binutils-all/symbols-5.s: New test.
2024-07-01 07:19:47 +09:30
Alan Modra
4b8c2aaf2d Assertion `(data) <= (end)' failed in read_bases
* dwarf.c (skip_attribute): Don't increment data past end.
	Use SKIP_{S,U}LEB rather than READ_{S,U}LEB.
2024-06-30 14:41:37 +09:30
H.J. Lu
67b1d28b52 Set BFD_DECOMPRESS when reading build-id debuglink
We should set BFD_DECOMPRESS to decompress sections unless dumping the
section contents when reading build-id debuglink.

	PR binutils/31925
	* objdump.c (open_debug_file): Set BFD_DECOMPRESS to decompress
	sections unless dumping the section contents.
	* testsuite/binutils-all/objdump.exp (test_build_id_debuglink):
	Add a compress option.
	Run test_build_id_debuglink with none and zlib.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-06-27 14:22:25 -07:00
Pali Roh?r
973563710c Improve comments describing the Import Directory Table
PR 31728
2024-06-27 12:17:27 +01:00
Nick Clifton
057a2b4c4b Revert: 35fd2ddeb1
PR 20814
2024-06-26 13:17:25 +01:00
Szabolcs Nagy
22a8698b56 aarch64: Add DT_RELR tests for ILP32 ABI 2024-06-25 11:07:51 +01:00
Nick Clifton
e13c4e5890 Updated Spanish translations for the bfd and binutils sub-directories 2024-06-24 15:03:22 +01:00
Alan Modra
56f3903369 Revert "Remove LIBINTL_DEP"
This reverts commit e874cbd387.
The patch was wrong.  LIBINTL_DEP is needed with an in-tree gettext.
2024-06-20 21:15:27 +09:30
Alan Modra
e874cbd387 Remove LIBINTL_DEP
The intl directory in the source no longer exists.  LIBINTL_DEP is
thus always empty.  Remove references to it.

config/
	* gettext-sister.m4: Don't AC_SUBST LIBINTL_DEP.
bfd/
	* Makefile.in: Regenerate.
	* configure: Regenerate.
binutils/
	* Makefile.am (*_DEPENDENCIES): Remove LIBINTL_DEP.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
gas/
	* Makefile.am (as_new_DEPENDENCIES): Remove LIBINTL_DEP.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
gdb/
	* Makefile.in (INTL_DEPS): Don't set or reference.
	* configure: Regenerate.
gdbserver/
	* Makefile.in (INTL_DEPS): Don't set or reference.
gdbsupport/
	* Makefile.in: Regenerate.
	* configure: Regenerate.
gold/
	* Makefile.am (deps_var): Remove LIBINTL_DEP.
	(incremental_dump_DEPENDENCIES, dwp_DEPENDENCIES): Likewise.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.am (DEPENDENCIES): Remove LIBINTL_DEP.
	* testsuite/Makefile.in: Regenerate.
gprof/
	* Makefile.am (gprof_DEPENDENCIES): Remove LIBINTL_DEP.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
ld/
	* Makefile.am (ld_new_DEPENDENCIES): Remove LIBINTL_DEP.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
libctf/
	* Makefile.in: Regenerate.
	* configure: Regenerate.
opcodes/
	* configure.ac (BUILD_LIBS): Remove LIBINTL.
	(BUILD_LIB_DEPS): Remove LIBINTL_DEP.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
2024-06-20 18:33:28 +09:30
Jan Beulich
28c812b349 readelf: rename recently added testsuite files
Files named *.0 are somewhat odd for testsuite expectations. Rename the
one such file to *.r with a suitable base name suffix, and have its
sibling follow suit in this latter regard.
2024-06-18 13:23:36 +02:00
Maciej W. Rozycki
38362a0c63 binutils/testsuite: Add a helper for relative path construction
Implement a helper to construct a relative path between two locations in
the filesystem, for example to make a path from the source to the object
directory for the case where a tool has been set up to look at a given
path and there is a need to point it elsewhere, but an absolute path
will not work.  The helper works on normalized paths internally, so the
result is correct even in the presence of symlinks as intermediate path
components.

So given "/path/to/src/gas/testsuite/gas/all" as the FROM argument and
then "/path/to/obj/gas/testsuite/tmpdir/none.s" as the TO argument the
helper will return "../../../../../obj/gas/testsuite/tmpdir/none.s" in
the absence of symlinks.
2024-06-17 23:28:20 +01:00
Alan Modra
1b19566b18 PR31898 bug in processing DW_RLE_startx_endx
PR 31898
	* dwarf.c (display_debug_rnglists_list): Correct fetch of "end"
	indexed address.  Remove excess parens.
2024-06-17 15:57:50 +09:30
Alan Modra
9dc9a56ebc support_dt_relr aarch64
Tweak commit db335d7e0a so that support_dt_relr returns false for
aarch64*-*-*ilp32.
2024-06-11 20:29:25 +09:30
Clément Chigot
db335d7e0a ld-aarch64: check support before launching dt_relr tests
Not all aarch64 targets supports dt_relr as this requires some
mechanisms on the OS side.

Adjust support_dt_relr helper and use it in aarch64-elf.exp.
2024-06-10 09:02:08 +02:00
Matthieu Longo
e83746f535 autoupdate: regen after replacing obsolete macros 2024-06-10 08:25:56 +09:30
Matthieu Longo
3dee0baea2 autoupdate: add square brackets around arguments of AC_INIT
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fINIT-2
2024-06-10 08:25:56 +09:30
Matthieu Longo
2cac47f5ba autoupdate: replace obsolete macros AC_AIX, AC_MINIX, and AC_GNU_SOURCE
- AC_AIX, AC_MINIX, and AC_GNU_SOURCE by AC_USE_SYSTEM_EXTENSIONS
  https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fAIX
  https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fMINIX-1
  https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fGNU_005fSOURCE-1
2024-06-10 08:25:55 +09:30
Matthieu Longo
c22e3e25de autoupdate: replace obsolete macros AC_HELP_STRING
- AC_HELP_STRING by AS_HELP_STRING
  https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fHELP_005fSTRING-1
Except for the ifdef in lib-prefix.m4, make the defun of AC_LIB_ARG_WITH
unconditional.
2024-06-10 08:25:55 +09:30
Richard Earnshaw
ecc5fed791 NEWS: arm: note that FPA support has been removed 2024-06-05 17:45:45 +01:00
Nick Clifton
cc08f5580e Update binutils release documentation to include using the -z option when invoking src-release.sh 2024-05-30 12:52:37 +01:00
Szabolcs Nagy
d565a95828 readelf: Use section names for displaying RELR relocs
In some cases using section names instead of symbol names for
displaying an address is more useful.

If the symbol falls outside the section where the address is
then likely it is not useful to display the address relative to.

And if symbols are stripped from a binary then printing the
section that contains the address is more useful than printing
<no sym>.
2024-05-29 16:08:04 +01:00
Szabolcs Nagy
d41629d35e readelf: Fix symbol display for RELR relocs
Filter symbols before binary searching for the right symbol to display
for a given address, such that only displayable symbols are present and
at most one per address.

The current logic does not handle multiple symbols for the same address
well if some of them are empty, the selected symbol is not stable with
respect to an unrelated symbol table change and on aarch64 often mapping
symbols are displayed which is not useful.

Filtering solves these problems at the cost of a linear scan of the
sorted symbol table.

The heuristic to select the best symbol likely could be improved, this
patch aims to improve symbol display for RELR without complex logic
such that the output is useful and stable for ld tests.
2024-05-29 16:08:04 +01:00
Nick Clifton
08b0f198b1 Add new ELF section and segment types to readelf. 2024-05-28 10:12:28 +01:00
Luca Boccassi
762910fbd1 readelf: add pretty printing for FDO Dlopen Metadata note 2024-05-20 16:47:00 +01:00
Georg-Johann Lay
e8c83191cc Include .rodata size in avr-objdump -P mem-usage.
PR 31687
2024-05-20 13:33:55 +01:00
Georg-Johann Lay
f65d4a2f81 Let avr-objdump show .note.gnu.avr.deviceinfo
PR 31704
2024-05-20 12:12:10 +01:00
Tom de Vries
e548840a03 [binutils/readelf] Fix handling of DW_MACRO_define_strx in dwo file
When printing a DW_MACRO_define_strx entry in a .debug_macro.dwo section, we
run into:
...
 DW_MACRO_define_strx lineno : 0 macro : <no .debug_str_offsets section>
...

Fix this in display_debug_macro by passing the correct dwo argument to a
fetch_indexed_string call.

That works fine for readelf -w, with with readelf -wm we have:
...
 DW_MACRO_define_strx lineno : 0 macro : <no .debug_str_offsets.dwo section>
...

Fix this in display_debug_macro by doing load_debug_section_with_follow for
str_dwo / str_index_dwo sections instead of str / str_index sections when
handling .debug_macro.dwo.

PR 31735
2024-05-15 09:45:55 +02:00
Tom de Vries
7e4f1f4bc7 [binutils/readelf] Fix printing of dwarf4 .debug_str_offsets.dwo
When compiling a hello world with dwarf4 split dwarf:
...
$ gcc -gdwarf-4 -gsplit-dwarf hello.c -save-temps -dA
...
we have in a-hello.s these three initial entries in .debug_str_offsets:
...
	.section        .debug_str_offsets.dwo,"e",@progbits
	.4byte  0       // indexed string 0x0: short int
	.4byte  0xa     // indexed string 0x1: /home/vries/binutils
	.4byte  0x1f    // indexed string 0x2: main
...
but "readelf -ws a.out" starts at the third entry:
...
Contents of the .debug_str_offsets.dwo section (loaded from a-hello.dwo):

    Length: 0x30
       Index   Offset [String]
           0 00000000  main
...

This is a regression since commit 407115429b ("Modified changes for
split-dwarf and dwarf-5."), which introduced a variable
debug_str_offsets_hdr_len in display_debug_str_offsets.

Fix this by setting display_debug_str_offsets to 0 for the dwarf4 case.

PR 31734
2024-05-15 09:45:55 +02:00
Richard Earnshaw
30d57f2e41 arm: update documentation for removal of the Maverick extension
Finally, update the documentation and add a NEWS item.
2024-05-14 10:56:58 +01:00
Richard Earnshaw
e06a561b73 arm: binutils: drop Maverick support.
Remove the decoding of the Maverick flag from readelf.
2024-05-14 10:56:58 +01:00