aboutsummaryrefslogtreecommitdiff
path: root/binutils
AgeCommit message (Collapse)AuthorFilesLines
12 daysnm: Avoid potential segmentation fault when displaying symbols without ↵Nick Clifton1-8/+16
version info. PR 32467
2024-12-14display_lang: Add descriptions for post DWARF5 constantsAlexandra Hájková1-0/+25
Describe all the new post DWARF5 language codes from the latest sync of include/dwarf.h with gcc.
2024-12-14Delete asection.symbol_ptr_ptrAlan Modra2-3/+3
This field is always set to point to asection.symbol, and no code ever changes it from its initial value. With one exception. elfxx-mips.c creates two sections with separate pointers to their symbols, and uses those as asection.symbol_ptr_ptr. Those pointers aren't modified, so they disappear in this patch too.
2024-12-13objdump: Delete close optimisationAlan Modra1-15/+4
In commit cd6581da62c3, Nick made an optimisation that was reasonable at the time, but then pr22032 came along and commit 7c0ed39626e3 made bfd_close_all_done free memory. So Nick's optimisation is now ineffective, and the comment wrong. * objdump.c (display_file): Delete last_file param. Update caller. Call bfd_close always.
2024-12-12close last arfile before processing current arfileAlan Modra4-66/+38
This also reduces peak memory a little. * dlltool.c (identify_search_archive): Close last_arfile earlier. Report an error if bfd_openr_next_archived_file returns the same bfd. Localise variables. * nm.c (display_archive): Likewise. * objdump.c (display_any_bfd): Likewise. * size.c (display_archive): Likewise.
2024-12-12nm.c free_lineno_cacheAlan Modra1-8/+3
free_lineno_cache frees symbol and relocation data used when displaying line number info for symbols (nm -l). Currently that is done when closing the bfd, but that's not ideal for archives since that results in two bfds worth of memory in use. * nm.c (display_rel_file): Call free_lineno_cache here.. (display_archive, display_file): ..not here.
2024-12-09LoongArch: Assign DWARF register numbers to register aliasesLulu Cai1-0/+29
.cfi directives only support the use of register numbers and not register names or aliases. This commit adds support for 4 formats, for example: .cfi_offset r1, 8 .cfi_offset ra, 8 .cfi_offset $r1,8 .cfi_offset $ra,8 The above .cfi directives are equivalent and all represent dwarf register number 1. Display register aliases as specified in the psABI during disassembly.
2024-12-02aarch64: GCS feature check in GNU note properties for input objectsSrinath Parvathaneni1-0/+4
This patch adds support for Guarded Control Stack in AArch64 linker. This patch implements the following: 1) Defines GNU_PROPERTY_AARCH64_FEATURE_1_GCS bit for GCS in GNU_PROPERTY_AARCH64_FEATURE_1_AND macro. 2) Adds readelf support to read and print the GCS feature in GNU properties in AArch64. Displaying notes found in: .note.gnu.property [ ]+Owner[ ]+Data size[ ]+Description GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 Properties: AArch64 feature: GCS 3) Adds support for the "-z gcs" linker option and document all the values allowed with this option (-z gcs[=always|never|implicit]) where "-z gcs" is equivalent to "-z gcs=always". When '-z gcs' option is omitted from the command line, it defaults to "implicit" and relies on the GCS feature marking in GNU properties. 4) Adds support for the "-z gcs-report" linker option and document all the values allowed with this option (-z gcs-report[=none|warning|error]) where "-z gcs-report" is equivalent to "-z gcs-report=warning". When this option is omitted from the command line, it defaults to "warning". The ABI changes adding GNU_PROPERTY_AARCH64_FEATURE_1_GCS to the GNU property GNU_PROPERTY_AARCH64_FEATURE_1_AND is merged into main and can be found in [1]. [1] https://github.com/ARM-software/abi-aa/blob/main/sysvabi64/sysvabi64.rst Co-authored-by: Matthieu Longo <matthieu.longo@arm.com> Co-authored-by: Yury Khrustalev <yury.khrustalev@arm.com>
2024-12-01Remove more remnants of old Mach-O workaroundoltolm1-1/+0
Remove another adjustment for section address, this time for the offset into .debug_str{,.dwo} read from .debug_str_offsets{,.dwo} by fetch_indexed_string. Signed-off-by: oltolm <oleg.tolmatcev@gmail.com>
2024-11-29MAINTAINERS: Update Peter Bergner's e-mail addressSurya Kumari Jangala1-1/+1
2024-11-26nios2: Remove binutils support for Nios II target.Sandra Loosemore2-2/+3
The Nios II architecture has been EOL'ed by the vendor. This patch removes all binutils, bfd, gas, binutils, and opcodes support for this target with the exception of the readelf utility. (The ELF EM_* number remains valid and the relocation definitions from the Nios II ABI will never change in future, so retaining the readelf support seems consistent with its purpose as a utility that tries to parse the headers in any ELF file provided as an argument regardless of target.)
2024-11-20Remove Debian from SECURITY.txtNick Clifton1-1/+0
2024-11-18gas/ELF: also reject merge entity size being zeroJan Beulich1-1/+1
This won't have any useful effect, so is at best marginally less bogus than a negative value. The change actually points out a flawed (for Arm) testcase: @ is a comment character there.
2024-11-18binutils: fix -std=gnu23 compatibility wrt _BoolSam James1-1/+1
GCC trunk now defaults to -std=gnu23. We return false in a few places which can't work when true/false are a proper type (_Bool). Return NULL where appropriate instead of false. All callers handle this appropriately. ChangeLog: PR ld/32372 * prdbg.c (visibility_name): Return NULL.
2024-10-31RISC-V: Dump instruction without checking architecture support as usual.Nelson Chu1-0/+3
Since QEMU have supported -Max option to to enable all normal extensions, the dis-assembler should also add an option, -M,max to do the same thing. For the instruction, which have overlapped encodings like zfinx, will not be considered by the -M,max option. opcodes/ * riscv-dis.c (all_ext): New static boolean. If set, disassemble without checking architectire string. (riscv_disassemble_insn): Likewise. (parse_riscv_dis_option_without_args): Recognized -M,max option. binutils/ * NEWS: Updated.
2024-10-24Replace uses of asprintf with xasprintfAlan Modra8-71/+17
xasprintf has a nicer interface and behaves like xmalloc as far as memory is concerned, ie. no need to check a return status and the program exits with an error on OOM. binutils/ * dwarf.c (load_debug_sup_file): Replace asprintf with xasprintf. * nm.c (get_elf_symbol_type, get_coff_symbol_type): Likewise. * objdump.c (dump_ctf_indent_lines): Likewise. * readelf.c (display_lto_symtab, dump_ctf_indent_lines): Likewise. * windres.c (main): Likewise. * configure.ac: Remove asprintf from AC_CHECK_DECLS. * config.in: Regenerate. * configure: Regenerate. gas/ * config/tc-kvx.c (kvx_emit_single_noop): Simplify. * config/tc-riscv.c (md_assemblef): Replace asprintf with xasprintf. * read.c (s_nop, do_s_func): Likewise. * stabs.c (stabs_generate_asm_func): Likewise. (stabs_generate_asm_endfunc): Likewise. * configure.ac: Remove asprintf from AC_CHECK_DECLS. * config.in: Regenerate. * configure: Regenerate. ld/ * ldlang.c (lang_leave_overlay_section): Replace xmalloc+sprintf with xasprintf. Localise vars. * lexsup.c (parse_args): Replace asprintf with xasprintf. * pe-dll.c (make_head, make_tail, make_one): Likewise. (make_singleton_name_thunk, make_import_fixup_entry): Likewise. (make_runtime_pseudo_reloc): Likewise. (pe_create_runtime_relocator_reference): Likewise. * configure.ac: Remove asprintf from AC_CHECK_DECLS. * config.in: Regenerate. * configure: Regenerate.
2024-10-16Add noxfail option to run_dump_testAlan Modra1-0/+11
The noxfail option is useful in situations like pr23658-1e which fails on all microblaze ELF targets except microblaze-linux. This was possible to handle by writing a small proc and use that as an xfail predicate, or painstakingly listing all microblaze ELF targets, but this is simpler. The patch also fixes some other FAILs and XPASSes of the pr23658 tests. binutils/ * testsuite/lib/binutils-common.exp (run_dump_test): Support noxfail. ld/ * testsuite/ld-elf/pr23658-1a.d: Don't xfail m68hc12. * testsuite/ld-elf/pr23658-1e.d: Likewise. xfail xstormy16 and correct microblaze xfails.
2024-10-11bfd/ELF: restrict file alignment for object filesJan Beulich3-9/+9
While for executables properly aligning sections within the file can be quite relevant, the same is of pretty little importance for relocatable object files. Avoid passing "true" into _bfd_elf_assign_file_position_for_section() when dealing with object files, but compensate minimally by applying log_file_align in such cases as a cap to the alignment put in place.
2024-10-09PR32243, NAME_MAX does not exist on mingw-w64 without _POSIX_Alan Modra1-15/+17
PR 32243 * dlltool.c: Move forward decls. Delete unnecessary ones. (bfd_errmsg): Delete macro, define as inline function. (PATHMAX): Delete. (NAME_MAX): Define.
2024-10-08Revised "Don't return (null) from bfd_elf_sym_name"Alan Modra1-5/+5
Commit 68bbe1183379 results in a lot of follow up work, much of which likely is still to be done. (And yes, since this is all for corrupted or fuzzed object files, a whole lot of work doesn't much benefit anyone. It was a bad idea to put NULL in asymbol->name.) So I'm changing the approach to instead put a unique empty string for symbols with a corrupted st_name. An empty string won't require much work to ensure nm, objcopy, objdump etc. won't crash, since these tools already must work with unnamed local symbols. The unique empty string is called bfd_symbol_error_name. This patch uses that name string for corrupted symbols in the ELF and COFF backends. Such symbols are displayed by nm and objdump as the translated string "<corrupt>", which is what the COFF backend used to put directly into corrupted symbols. ie. it's the way I should have written the original patch, plus a few tides and cleanups I retained from the reverted patches.
2024-10-08Revert "dlltool fixes for commit 68bbe1183379"Alan Modra1-5/+4
This reverts commit 06116013f80e474800cfb122924bc2a6f060606a.
2024-10-08Revert "objcopy fixes for commit 68bbe1183379"Alan Modra1-11/+5
This reverts commit ef166f451fbc2c7b251a251ab23cd35b36c5ee23.
2024-10-05objcopy fixes for commit 68bbe1183379Alan Modra1-5/+11
* objcopy.c (is_specified_symbol): Handle NULL name. (filter_symbols): Drop syms with a NULL name.
2024-10-04dlltool fixes for commit 68bbe1183379Alan Modra1-4/+5
For some reason, dlltool supports mcore-elf input files. * dlltool.c (filter_symbols): Drop symbols with NULL names. (identify_member_contains_symname): Don't consider symbols with NULL names.
2024-10-04MAINTAINERS: move M R Swami Reddy to Past MaintainersJan Beulich1-2/+1
He/she cannot be reached at the given address anymore, and the name is apparently too common to identify the person to attempt to establish another contact. Sadly this orphans the CR16 and CRx ports.
2024-10-04MAINTAINERS: move Matt Thomas to Past MaintainersJan Beulich1-2/+1
Matt cannot be reached at the @netbsd.org address anymore, and I was unable to find another one, even with the help of the NetBSD community (where his resigning was announced over 4 years ago [1]). [1] http://mail-index.netbsd.org/netbsd-announce/2020/05/07/msg000314.html
2024-10-03Enable dlltool --leading-underscore for targets other than x86Alan Modra2-57/+7
This also makes the dlltool tests run more PE targets, finding that sh-pe dlltool reports "Machine 'sh' not supported". I guess no one cares about that. PR19459 * dlltool.c (asm_prefix): Remove "mach" parameter. Return leading_underscore independent of machine. (ASM_PREFIX): Adjust. * testsuite/binutils-all/dlltool.exp: Run on any target satisfying is_pecoff_format for which dlltool is built. Revert commit 0398b8d6c86a. Remove target_xfail.
2024-10-03dlltool leading_underscoreAlan Modra1-42/+25
This patch tidies dlltool code dealing with adding a leading underscore to generated symbol names. There should be no functional change here, but there could be if we ever have a bfd target with symbol_leading_char something other than '_' or 0. * dlltool.c (leading_underscore): Change from an int to a char*. Update all uses. If neither --leading-underscore or --no=leading-underscore is given, set leading_underscore to a string with first char returned by bfd_get_target_info as the target's symbol underscoring.
2024-10-03nm: don't try to print line numbers for symbols without namesAlan Modra1-3/+3
It doesn't make much sense trying to print line numbers for what are usually broken symbols, and there is a possibility of a segfault if we pass strcmp a NULL.
2024-10-01Re: dlltool: file name too longAlan Modra1-36/+22
Allow for "snnnnn.o" suffix when testing against NAME_MAX, and tidy TMP_STUB handling by overwriting a prior nnnnn.o string rather than copying the entire name. * dlltool.c (TMP_STUB): Add "nnnnn.o" to format. (make_one_lib_file): Localise variables. Don't copy TMP_STUB, overwrite suffix instead. (gen_lib_file): Similarly. (main): Allow for max suffix when testing against NAME_MAX.
2024-09-28Move uses_elf_em to ld-lib.expAlan Modra1-21/+0
and add a missing entry from uses_genelf. binutils/ * testsuite/lib/binutils-common.exp (uses_elf_em): Delete. ld/ * testsuite/lib/ld-lib.exp (uses_genelf): Add moxie-*-moxiebox. (uses_elf_em): New.
2024-09-24binutils testsuite: canonicalize subtest names in debuginfod.expFrank Ch. Eigler1-6/+6
Previous code included the full $srcdir pathnames in the individual subtest PASS/FAIL names, which makes it difficult to compute comparisons or regressions between test runs on different machines. This version switches to the basename only, which are common. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2024-08-29get_type_abbrev_from_form tidyAlan Modra1-25/+19
* dwarf.c (get_type_abbrev_from_form): Make uvalue param a uint64_t. Localise variables. Don't bother clearing *data_return and *addrev_num_return for a NULL return value.
2024-08-28dlltool: file name too longJiaying Song1-5/+3
During the execution of the command: i686-w64-mingw32-dlltool --input-def $def_filepath --output-delaylib $filepath --dllname qemu.exe An error occurred: i686-w64-mingw32-dlltool: failed to open temporary head file: ..._w64_mingw32_nativesdk_qemu_8_2_2_build_plugins_libqemu_plugin_api_a_h.s Due to the path length exceeding the Linux system's file name length limit (NAME_MAX=255), the temporary file name generated by the i686-w64-mingw32-dlltool command becomes too long to open. To address this, a new temporary file name prefix is generated using tmp_prefix = prefix_encode ("d", getpid()), ensuring that the file name does not exceed the system's length limit. Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com> Reviewed-by: Alan Modra <amodra@gmail.com>
2024-08-28dlltool.c formattingAlan Modra1-223/+226
Mostly whitespace fixes, some removal of excess parens.
2024-08-19Remove Walter Lee as maintainer for Tile Gx and Tile ProNick Clifton1-2/+1
2024-08-17Update release readme after making 2.43.1 releaseNick Clifton1-20/+40
2024-08-13PR32072 dlltool.c initializer-string is too longAlan Modra1-58/+9
PR 32072 * dlltool.c: Delete unneeded forward function declaraions. Make buffers used by dlltmp static. (prefix_encode): Avoid warning. Use stpcpy.
2024-08-04Update release-README after completing the 2.43 release.Nick Clifton1-20/+18
2024-08-02Updated Bulgarian translation for the binutils/ directoryNick Clifton1-2596/+3328
2024-08-02Fix typo in --help output of the strings program.Aapo Rantalainen1-2/+2
PR 31940
2024-08-01skip_attr_bytes assertion (data) <= (end) failAlan Modra1-1/+4
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-07-29Updated translations for the bfd, binutils, gas, ld and opcodes directoriesNick Clifton4-7653/+8656
2024-07-29PR 31728 testcasesPali Rohár1-2/+21
2024-07-26microMIPS: Add MT ASE instruction set supportYunQiang Su4-0/+1273
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-26Fix "Untranslated plural in readelf.c"Nick Clifton1-9/+10
PR 32002
2024-07-23Improve objdump's display of PE header information.Pali Roh?r1-24/+69
PR 31953
2024-07-20Correct version for binutils 2.43 NEWS entries.H.J. Lu1-1/+1
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-20Update after creating 2.43 branchNick Clifton1-18/+12
2024-07-20Change version to 2.43.50Nick Clifton3-1887/+2121