aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-07-11s390: Explicitly list linker dump testsJens Remus1-9/+6
Generating the linker dump test list using file globbing makes it difficult to exclude specific tests under certain circumstances. List them explicitly instead. This enables to add tests in the future that can be excluded. While at it reorganize how s390 linker tests get run for s390x. ld/testsuite/ * ld-s390/s390.exp: Reorganize and explicitly list linker dump tests. Signed-off-by: Jens Remus <jremus@linux.ibm.com>
2025-07-11sframe: Ignore section padding when converting endiannessJens Remus1-2/+6
The .sframe section may have a trailing padding due to the architecture- specific default section alignment. Do not treat this padding as error when converting between target and host endianness. This can be observed when building Binutils with SFrame s390x support on x86-64 for s390x using configure option "--target=s390x-ibm-linux-gnu" and running the GAS test suite. While at it reuse the determined SFrame section header size. libsframe/ * sframe.c (flip_sframe): Ignore .sframe section padding. Reuse SFrame header size. Reported-by: Indu Bhagat <indu.bhagat@oracle.com> Signed-off-by: Jens Remus <jremus@linux.ibm.com>
2025-07-11Automatic date update in version.inGDB Administrator1-1/+1
2025-07-11AM_PO_SUBDIRSAlan Modra14-2737/+7
Swap AM_PO_SUBDIRS and ZW_GNU_GETTEXT_SISTER_DIR lines in */configure.ac. ZW_GNU_GETTEXT_SISTER_DIR indirectly invokes AC_REQUIRE(AM_PO_SUBDIRS) so results in AM_PO_SUBDIRS being emitted before ZW_GNU_GETTEXT_SISTER_DIR if it hasn't already been invoked.
2025-07-11gas v850 md_convert_fragAlan Modra6-64/+39
The v850 md_convert_frag function oddly calls subseg_change twice (commit 1cd986c58543). Neither call is needed, because that is done in size_seg. Convert the fr_opcode fixup field back (to an opindex, not fx_r_type) using a cast rather than a union, since we used casts when setting up those values. I guess the union was added to silence compiler warnings about wrong-size casts, but unfortunately results in the wrong value being retrieved on big-endian hosts. Change "buffer" to a char* as there is no need to make it an unsigned char*, and that way requires fewer casts. Finally, fix formatting and use uintptr_t when make the rs_machine_dependent frags. Remove subseg_change calls from cr16, crx, mn10200, mn10300, and sh md_convert_frag too.
2025-07-11union alpha_macro_argAlan Modra1-115/+113
Rename the old enum alpha_macro_arg to alpha_macro_argset, and create a union alpha_macro_arg to use in all the alpha_macro.emit functions. This avoids intptr_t casts on retrieving index values and void* casts on storing them in the alpha_macros array.
2025-07-10sim: riscv: Fix build issue due to INSN_CLASS_C was changed to INSN_CLASS_ZCANelson Chu1-1/+1
2025-07-10libiberty: sync with gccMatthieu Longo4-1/+728
Import the following commits from GCC as of r16-2170-g2f2e9bcfb0fd9c: 0fd98b6f9f2 libiberty: add routines to handle type-sensitive doubly linked lists
2025-07-10RISC-V: Fixed wrong imply result for zce when -march=rv32id_zceNelson Chu6-40/+32
The entry of "zce imply zcf" needs check_implicit_for_zcf, so it needs to be placed after the entries of "whatever imply f". Otherwise the implicit zcf may be missed. Also merge the march-implu-zce* testcases into imply testcases.
2025-07-10RISC-V: Clarify the imply rule of cNelson Chu17-228/+231
This also fix the imply result for .option rvc. Imply zcf when c and f and rv32 Imply zcd when c and d Imply zca when c Changed INSN_CLASS_C to INSN_CLASS_ZCA Changed INSN_CLASS_F_AND_C to INSN_CLASS_ZCF Changed INSN_CLASS_D_AND_C to INSN_CLASS_ZCD Changed INSN_CLASS_ZIHINTNTL_AND_C to INSN_CLASS_ZIHINTNTL_AND_ZCA
2025-07-10RISC-V: Deprecate ".option arch, -ext" for users due to its controversial useNelson Chu16-47/+71
Before we figure out the whole remove situations for ".option arch, -ext", and have any RISC-V public spec defines it, we should just deprecate it.
2025-07-10Automatic date update in version.inGDB Administrator1-1/+1
2025-07-09gas: ld: sframe: add new internal headerIndu Bhagat4-12/+38
for SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS. The intention of creating an abstraction like SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS is to address the concern that there should be a central place to enforce harmonious flags between GNU as and ld. At the moment, the only flag that needs to be enforced is SFRAME_F_FDE_FUNC_START_PCREL. sframe.h and sframe-api.h are installed headers by libsframe for the specification and implementation respectively. Adding a definition like SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS does not fit in either. Create a new internal header instead to keep the definition uncoupled from sframe.h and sframe-api.h. Rename the previously added SFRAME_F_LD_MUSTHAVE_FLAGS to define the new SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS. bfd/ * elf-sframe.c (_bfd_elf_merge_section_sframe): Use the new internal header and SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS. gas/ * gen-sframe.c (output_sframe_internal): Likewise. include/ * sframe-api.h (SFRAME_F_LD_MUSTHAVE_FLAGS): Move from.. * sframe-internal.h: ..to here. New file.
2025-07-09Merge init_private_section_data with copy_private_section_dataAlan Modra28-131/+79
init_private_section_data is used by the linker and is a special case of copy_private_section_data that copies a reduced set of section data from input to output. Merge the two functions, adding a link_info param to copy_private_section_data and remove init_private_section_data.
2025-07-09gas remove assorted unnecessary castsAlan Modra44-224/+190
This continues the saga of removing unnecessary casts, and making small code tidies in gas. Hopefully this sees the last of K&R anachronisms.
2025-07-09gas standardise md_section_alignAlan Modra25-25/+25
The point here is that when valueT is 64 bits and int is 32 bits, 1 << align doesn't work for shifts larger than the size of int. (Not that anyone is likely to use such large alignments in real code.)
2025-07-09gas function arg castsAlan Modra32-117/+104
This patch removes more unnecessary arg casts in various function calls.
2025-07-09gas fixupsAlan Modra10-43/+27
Remove unnecessary arg casts in fix_new and similar calls.
2025-07-09gas char/unsigned char castsAlan Modra22-101/+93
This patch removes many unneeded casts to char or unsigned char. It's worth noting that safe-ctype.h macros ISDIGIT and the like cope with either signed or unsigned char. In some cases a cast to unsigned char is replaced by anding with 0xff, which accomplishes the same thing but doesn't rely on char being eight bits. The patch also removes pointer casts, and a few unsigned char pointer variables.
2025-07-09gas alpha sign extension macrosAlan Modra1-25/+5
Use standard sign extend and range checking using unsigned expressions that don't rely on implementation defined right shifts or size of short and int.
2025-07-09gas md_number_to_charsAlan Modra30-187/+159
Calls to md_number_to_chars don't need to cast their value arg (*). Remove those casts. avr_output_property_recode made a call to md_number_to_chars with size of 1. Simplify that. tc-bpf.c md_convert_frag used write_insn_bytes that simply copied input to output. Dispense with that nonsense, and similarly in a couple of other places where md_number_to_chars was called with size 1. *) unless the value arg is an expression that needs a cast, eg. tic54x emit_insn where the shift left could trigger signed overflow UB without a cast.
2025-07-09z8k opcode_entry_typeAlan Modra3-5/+5
z8k opcode_entry_type.func is never used as a function pointer, only as a pointer to a pseudo_typeS. Change it to a void*.
2025-07-09gas various other void* castsAlan Modra20-63/+55
This removes assorted unneeded casts of void* pointers, and casts when passing args to void* parameters or storing to void* pointers. The patch also changes obj-coff.c stack_push to take a void* parameter, and replaces an odd memcpy in tc-metag.c find_insn_templates with a simple assignment.
2025-07-09gas various other const pointer changesAlan Modra16-87/+82
This removes a bunch of casts involving const pointers, in some cases by making variables const pointers so a cast is not needed. In a couple of places the cast hid errors with "&array" written rather than "array", see iq2000_macro_defs and s_pru_align. tc-xgate.c cmp_opcode is changed to be the standard qsort predicate to avoid a function cast.
2025-07-09gas d30v_insn plus other non-const pointersAlan Modra2-14/+14
d30v has a bunch of casts that are only needed due to various types missing a const. Fix that.
2025-07-09gas alloc castsAlan Modra18-39/+31
All of the various memory allocation function return a "void *" pointer, which needs no cast to assign to other pointer types.
2025-07-09gas bfd_put and bfd_get arg castsAlan Modra17-185/+185
bfd_{h_,}put_* and bfd_{h_,}get_* have "void *" pointer params nowadays. We don't need casts on their pointer args. We also don't need to cast values passed to bfd_put.
2025-07-09gas NULL castsAlan Modra69-398/+393
This removes many unnecessary NULL casts. I'm also adding a few arg casts in concat calls, to make the code consistent. Advice from quite a few years ago was that it's better to use the exact type for args corresponding to function ellipses, in case NULL is defined as plain 0. (I think that happened with some early 64-bit systems. Plain NULL ought to be OK nowadays.)
2025-07-09gas s3_FAIL and s7_FAILAlan Modra2-669/+669
s3_FAIL is defined as 0x80000000 which is unsigned, but everywhere it is used it is cast to int. Get rid of that silliness, and likewise for s7_FAIL.
2025-07-09gas more enum castsAlan Modra10-107/+106
Remove more unnecessary enum casts.
2025-07-09gas bfd_reloc_code_real_typeAlan Modra17-91/+78
Enumeration constants are integer types, so there should be no need to cast such constants to int in expressions. (Perhaps some older gccs warned, I checked back to gcc-4.5.) Remove some of those unnecessary casts. Also remove unnecessary casts to bfd_reloc_code_real_type.
2025-07-09gas add_ecoff_symbolAlan Modra1-49/+19
* ecoff.c: Remove unnecessary arg casts in add_ecoff_symbol calls throughout file.
2025-07-09gas frag_varAlan Modra20-93/+52
Many frag_var calls have unnecessary casts on arguments, no doubt from the days when binutils was written for K&R C. (ie. functions were not prototyped so you needed to cast anything that didn't match the expected type after default promotions, as you still do for args matching a function ellipsis.) Remove those casts. * config/tc-alpha.c (s_alpha_comm): Use offset_T for cur_size to avoid need for casts. Remove casts from frag_var args. * config/tc-ia64.c (obj_elf_vms_common): Remove casts from frag_var args. * config/tc-m32r.c (m32r_scomm): Likewise. * config/tc-m68hc11.c (build_jump_insn): Likewise. (build_dbranch_insn): Likewise. * config/tc-m68k.c (md_assemble): Likewise. * config/tc-microblaze.c (microblaze_s_lcomm): Likewise. * config/tc-mmix.c (s_loc): Likewise. * config/tc-ppc.c (ppc_elf_lcomm, ppc_comm): Likewise. * config/tc-score.c (s3_s_score_lcomm): Likewise. * config/tc-score7.c (s7_s_score_lcomm): Likewise. * config/tc-sh.c (sh_cons_align): Likewise. * config/tc-sparc.c (s_reserve, s_common): Likewise. (sparc_cons_align): Likewise. * config/tc-tic4x.c (tic4x_seg_alloc, tic4x_bss): Likewise. * config/tc-tic54x.c (tic54x_bss, tic54x_space): Likewise. (tic54x_usect, tic54x_field): Likewise. * config/tc-tic6x.c (s_tic6x_scomm): Likewise. * config/tc-v850.c (v850_offset, v850_comm): Likewise. * frags.c (frag_align, frag_align_pattern, frag_align_code): Likewise. * gen-sframe.c (output_sframe_row_entry): Likewise. (output_sframe_funcdesc): Likewise. * read.c (s_fill, do_org, s_space, emit_leb128_expr): Likewise. * symbols.c (colon)): Likewise.
2025-07-09gas pointer to int and vice versaAlan Modra4-21/+21
Use "intptr_t" or "uintptr_t" for these conversions, not "long" which is wrong on LLP64 systems, or "size_t" which is better but still not the correct type. * config/tc-alpha.c (emit_ldXu, emit_ldX, emit_uldXu, emit_uldX), (emit_stX, emit_ustX, emit_sextX): Use correct type when converting vlgsize pointer to in. Use "int" rather than "long" for result. * config/tc-ia64.c (generate_unwind_image): Use intptr_t cast when passing personality_routine to frag_var. * config/tc-ppc.c (ppc_frob_symbol <coff>): Use uintptr_t cast when converting symbol pointer to valueT. * config/tc-v850.c (md_assemble): Use intptr_t cast when loading integer opindex.
2025-07-09Automatic date update in version.inGDB Administrator1-1/+1
2025-07-08aarch64: Add support for FEAT_SVE2p2 and FEAT_SME2p2Alice Carlotti15-626/+3318
2025-07-08aarch64: Reorder virtual feature dependenciesAlice Carlotti1-4/+3
This will improve readability when more combinations of "SVE* or SME*" are added.
2025-07-08gdb/reverse: Add 2 AVX instructions VADDSUBPS and VADDSUBPDFirst Last3-0/+113
add support to recording 2 missing AVX instructions: vaddsubps and vaddsubpd, and add associated tests. Approved-By: Guinevere Larsen <guinevere@redhat.com>
2025-07-08gprofng: support external debug infoVladimir Mezentsev15-185/+279
Use bfd_follow_gnu_debuglink() and bfd_follow_gnu_debugaltlink() to find files with debug info. If necessary, gprofng-archive copies these files to EXP/archives. For each executable, gprofng creates the Elf class twice. One of them was a memory leak. Fixed this by adding a new argument to Stabs::Stabs(). gprofng/ChangeLog 2025-07-07 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR 32147 PR 30194 * src/Disasm.cc (get_funcname_in_plt): Use the executable file instead of the debug information file. * src/Dwarf.h: Define debug_alt_strSec. * src/DwarfLib.cc: Add support for DW_FORM_GNU_ref_alt, DW_FORM_GNU_strp_alt. * src/Elf.h (find_gnu_debug_files, get_dwr_section): New functions. * src/Elf.cc: Likewise. * src/Experiment.cc (copy_file): Add the const qualifier. * src/Experiment.h: Likewise. * src/LoadObject.cc (get_elf, openDebugInfo): Find files with debug info. * src/LoadObject.h: Remove unused variables. * src/Module.cc: Remove an argument in openDebugInfo(). * src/Stabs.cc (Stabs::Stabs): Add the Elf* argument. * src/Stabs.h: Likewise. * src/gp-archive.cc: Archive files with debug info. * src/gp-archive.h (archive_file): New function.
2025-07-08Fix wchar.exp test case per reviewTom Tromey1-2/+2
A recent patch of mine modified wchar.exp, but I failed to notice one part of the review. This patch updates the code to conform to the review comments.
2025-07-08New Malay translation for bfd/ and new Spanish translation for gas/Nick Clifton2-32/+24262
2025-07-08RISC-V: Fix libpath_suffix selection for ldscriptMark Goncharov6-6/+6
When building a cross-compiler ld for RISC-V Linux systems, you can specify target=riscv64*-linux* to create a linker that supports both 32-bit (-march=rv32*) and 64-bit (-march=rv64*) architectures. The specified -march value populates the EMULATION_NAME variable, which determines the default linker script selection. For proper riscv64 target support, the build process must prepare both elf32lriscv* and elf64lriscv* linker scripts. These should align with the standard RISC-V Linux sysroot directory structure. Signed-off-by: Mark Goncharov <mark.goncharov@syntacore.com>
2025-07-08RISC-V: Fixed mapping symbol for .option norvc directiveNelson Chu2-2/+7
2025-07-08RISC-V: Fixed dis-assembler to set correct xlen from mapping symbolNelson Chu4-8/+10
2025-07-08RISC-V: Fixed that .option push/pop won't recover the xlenNelson Chu2-4/+7
2025-07-08RISC-V: Added testcase to show the current rvc and xlen problemsNelson Chu2-0/+94
2025-07-08RISC-V: Bind defined symbol locally in PIELinsen Zhou6-1/+37
Reference commit 1dcb9720d62cd053a72c31881b7724ce9f74332c bfd/ * elfnn-riscv.c (RISCV_COPY_INPUT_RELOC): Bind defined symbol locally in PIE. ld/ * testsuite/ld-riscv-elf/pie-bind-locally-a.s: New test source. * testsuite/ld-riscv-elf/pie-bind-locally-b.s: Likewise. * testsuite/ld-riscv-elf/pie-bind-locally-rv32.d: New testcase. * testsuite/ld-riscv-elf/pie-bind-locally-rv64.d: Likewise. Signed-off-by: Linsen Zhou <i@lin.moe>
2025-07-08Automatic date update in version.inGDB Administrator1-1/+1
2025-07-07gprofng: remove ElfReloc class and unused functions and declarationsVladimir Mezentsev9-498/+6
class ElfReloc is not used after we started use libbfd. Removed ElfReloc and other unused declarations. gprofng/ChangeLog 2025-07-03 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * src/Disasm.cc: Remove unused functions and variables. * src/Disasm.h: Likewise. * src/Dwarf.cc: Likewise. * src/DwarfLib.cc: Likewise. * src/DwarfLib.h: Likewise. * src/Elf.cc: Likewise. * src/Elf.h: Likewise. * src/Stabs.cc: Likewise. * src/Stabs.h: Likewise.
2025-07-07Correctly handle L'\\'Tom Tromey2-11/+19
Hannes filed a bug that pointed out that: print L'\\' ... did not work correctly. The bug is in convert_escape, which simply transcribes the backslash character, rather than convert it between encodings. This patch fixes the error. I also turned a macro into a lambda to clean up this code a little. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33124 Reviewed-By: Tom de Vries <tdevries@suse.de> Tested-By: Hannes Domani <ssbssa@yahoo.de>