Commit Graph

12468 Commits

Author SHA1 Message Date
Alan Modra
6274233ac8 PR 33302, Symbols truncated on i386pep target
Commit 012d442686 effectively made peXXigen.c _bfd_XXi_swap_aux_out
always use the COFF E_FILNMLEN of 14.  The problem was that the auxent
x_fname field was defined in include/coff/external.h using a length of
14.  Later, E_FILNMLEN is redefined to 18 in coff/pe.h.  This no doubt
falsely tripped memory checking tools.  AUXESZ is 18, so no actual
buffer overrun.

This patch defines x_fname as an 18 char field, the full auxent, and
uses E_FILNMLEN when accessing.

	PR 33302
include/
	* coff/external.h (union external_auxent): Make x_fname
	AUXESZ chars.
bfd/
	* coffswap.h (coff_swap_aux_in): Correct #error message.
	(coff_swap_aux_out): Likewise.  Use E_FILNMLEN when copying
	to ext field.
	* peXXigen.c (_bfd_XXi_swap_aux_in): Add #error.  Style fix.
	(_bfd_XXi_swap_aux_out): Add #error.  Don't use sizeof, use
	E_FILNMLEN when copying to ext field.
gas
	* testsuite/gas/pe/long_file_symbol.d,
	* testsuite/gas/pe/long_file_symbol.s: New test.
	* testsuite/gas/pe/pe.exp: Run it.

Reported-By: Frediano Ziglio <freddy77@gmail.com>
2025-08-25 08:28:38 +09:30
Sam James
b0653e3db9 gas: add --enable-default-sframe configure option
SFrames make the most sense when userland as a whole is built with them,
so add a --enable-default-sframe configure flag to facilitate distributors
and vendors doing that.

The primary motivation for a configure-time flag is that we don't support
SFrame for 32-bit x86 but some packaging uses the same flags (with some
added on top) for multilib builds (to support old binaries like games),
and simply adding `-Wa,--gsframe` to the standard build flags isn't an
option (*).

That aside, I believe it'll be helpful for testing and eventual adoption
in any case.

In summary, combined with the recent --gsframe=[yes|no] support (**):
* Configured with --enable-default-sframe and nothing is passed
  => SFrames (previously no SFrames)
* Configured with --enable-default-sframe and --gsframe=yes is passed
  => SFrames (no change from before)
* Configured with --enable-default-sframe and --gsframe=no is passed
  => No SFrames (no change from before)
* Configured with --enable-default-sframe and --gsframe is passed
  => SFrames (no change from before)

* Configured with --disable-default-sframe and nothing is passed
  => No SFrames (no change from before)
* Configured with --disable-default-sframe and --gsframe=yes is passed
  => SFrames (no change from before)
* Configured with --disable-default-sframe and --gsframe=no is passed
  => No SFrames (no change from before)
* Configured with --disable-default-sframe and --gsframe is passed
  => SFrames (no change from before)

I've introduced a sframe_as_bad macro on Indu's suggestion. A following
patch uses its sibling sframe_as_warn heavily and having symmetry plus
the macro as a form of documentation of intent seems useful.

(*) It gets added to multilib builds too and then we hit the
    `.sframe not supported for target` error in gas/dw2gencfi.c.

(**) I've verbosely listed --gsframe=yes but it's the same as --gsframe.

gas/
	PR gas/33126
	* as.c (enum gen_sframe_option): Initialize if DEFAULT_SFRAME.
	* config.in (DEFAULT_SFRAME): New.
	* configure: Regenerate.
	* configure.ac: Add --enable-default-sframe.
	* doc/as.texi: Document --enable-default-sframe.
	* dw2gencfi.c (cfi_finish): Don't warn if SFrames are enabled
	by default but unavailable for this target.
	* gen-sframe.h (sframe_as_bad): New macro.
2025-08-23 03:04:35 +01:00
Jan Beulich
cb028bfe34 gas: make as_tsktsk() output more as_warn()-like
The lack of a uniform "Warning: " prefix can be irritating. Re-use
as_warn_internal(), by moving the warning count increment into the pre-
existing callers (where the flag_no_warnings checks also are). At the
same time keep the listing_warning() invocation at its place - listings
certainly should have such warnings reproduced as well.

While there also drop the unnecessary forward declarations of static
functions.
2025-08-22 07:56:28 +02:00
Alan Modra
64c7560c6a Don't run cfi-commit-10 test on 32-bit targets 2025-08-22 10:02:52 +09:30
Nelson Chu
cb4ed2bee7 RISC-V: PR33216, Fixed gcc testcases failed for commit 28520d7
I made a stupid mistake in the commit 28520d7, allow to assemble slli/srli/srai
with 0 immediate to hint c.slli/c.srli/c.srai.  These hints will be regared as
illegal instruction for gdb and qemu, so at least I got following gcc testcases
failed,

                === g++: Unexpected fails for rv64gc lp64d medlow ===
FAIL: c-c++-common/torture/builtin-arith-overflow-17.c   -O0  execution test
FAIL: c-c++-common/torture/builtin-arith-overflow-6.c   -O0  execution test
FAIL: c-c++-common/torture/builtin-arith-overflow-p-17.c   -O0  execution test
FAIL: c-c++-common/torture/builtin-arith-overflow-p-6.c   -O0  execution test

                === gfortran: Unexpected fails for rv64gc lp64d medlow ===
FAIL: gfortran.dg/leadz_trailz_2.f90   -O0  execution test

                === gcc: Unexpected fails for rv64gc lp64d medlow ===
FAIL: c-c++-common/torture/builtin-arith-overflow-17.c   -O0  execution test
FAIL: c-c++-common/torture/builtin-arith-overflow-6.c   -O0  execution test
FAIL: c-c++-common/torture/builtin-arith-overflow-p-17.c   -O0  execution test
FAIL: c-c++-common/torture/builtin-arith-overflow-p-6.c   -O0  execution test

So we should just allow c.slli/c.srli/c.srai with zero immediate as hints, but
don't allow slli/srli/srai with zero immediate.

gas/
	PR 33216
	* testsuite/gas/riscv/c-zero-imm.d: Only allow c.slli/c.srli/c.srai
	with zero immediate as hints, but don't allow slli/srli/srai with
	zero immediate.
	* testsuite/gas/riscv/c-zero-imm.s: Likewise.
opcodes/
	PR 33216
	* riscv-opc.c (match_slli_as_c_slli): Added back.
	(match_srxi_as_c_srxi): Likewise.
	(riscv_opcodes): Only allow c.slli/c.srli/c.srai with zero immediate
	as hints, but don't allow slli/srli/srai with zero immediate.
2025-08-20 18:02:49 +08:00
Alan Modra
fed7c3654c Remove cloudabi support
Apparently the cloudabi project is dead.  The cloudabi support branded
object files with ELFOSABI_CLOUDABI but other than that didn't do much.
2025-08-20 13:26:19 +09:30
Alan Modra
8acc451784 Re: gas: testsuite: fix regression in cfi-common-10.d
Just match what the test is actually trying to verify, to fix more
regressions.
2025-08-20 09:06:25 +09:30
Indu Bhagat
dab18bd71c gas: testsuite: fix regression in cfi-common-10.d
A previous commit 09292f4ae2 introduced the new test cfi-common-10.d.
The testcase needs some adjustments for it to be useful on a variety of
targets.
2025-08-19 12:27:42 -07:00
Indu Bhagat
09292f4ae2 binutils: dwarf: fix display of large cfa_offset
eh_frame textual dump was not correct when the cfa_offset is a large
value.  The reason is that the dumping code generally assumes the
cfa_offset is an 'int'.

cfa_offset values can be updated by various DWARF opcodes, like:
  - DW_CFA_def_cfa, DW_CFA_def_cfa_offset which bring unsigned leb128
    cfa_offset
  - DW_CFA_def_cfa_sf, DW_CFA_def_cfa_offset_sf which bring signed
    leb128 cfa_offset

Internally, the routines in dwarf.c keep the value as 'uint64_t
cfa_offset'.  That size of the datatype is expected to work for most of
the real-world cases.  Care, however, needs to be taken when it comes
to the signedness of the value.  Fix the buggy behavior by adding an
additional field to track whether the value of cfa_offset is signed or
unsigned and display accordingly for "frames-interp" output.

The display of cfa_offset had issues in both "frames-interp" output
(objdump -WF or do_debug_frames_interp) and the "frames" output.

Add two new tests: cfi-common-10.s uses a large positive cfa_offset
(with "frames output), and cfi-x86_64-2.s uses a negative cfa_offset
(with "frames-interp" output).

ChangeLog:
	* binutils/dwarf.c (frame_display_row): Update format string
	based on signedness.
	(display_debug_frames): Track signedness.  Also fix display of
	cfa_offset using PRIu64 or PRId64 as applicable.
	* gas/testsuite/gas/cfi/cfi.exp: Add two new tests.
	* gas/testsuite/gas/cfi/cfi-common-10.d: New test.
	* gas/testsuite/gas/cfi/cfi-common-10.s: New test.
	* gas/testsuite/gas/cfi/cfi-x86_64-2.d: New test.
	* gas/testsuite/gas/cfi/cfi-x86_64-2.s: New test.
2025-08-19 01:08:06 -07:00
Alice Carlotti
9e5fdac9ac gas: Record file name in macro locations
This allows the correct file name to be used when emitting messages for
lines within a macro.  The line numbers were already set and displayed
correctly, which resulted in mismatched file names and line numbers.

PR 32738
2025-08-18 14:37:10 +01:00
Alice Carlotti
40acf2f9ae gas: Improve file name in messages header
Message output from gas is prefixed with a line of the form:

path/file.s: Assembler messages:

Don't use the file name from the first message for this header.
Instead, use the source file name specified in the command line.
2025-08-18 14:37:10 +01:00
Indu Bhagat
7dcdd8cae4 gas: sframe: const ptrs for args and local vars where applicable
Use const pointers for function arguments and local vars where
applicable.  'cfi_insn' contains the DWARF CFI instruction data which,
for the purpose of SFrame generation, is read-only.  Similarly, some
getter APIs and output related APIs now document their argument as
read-only.

While at it, also remove the ATTRIBUTE_UNUSED from argument xlate_ctx in
sframe_xlate_do_register () because the argument is indeed conditionally
used.
2025-08-15 10:29:38 -07:00
Jan Beulich
bafcf0823c x86/APX: drop AMX-TRANSPOSE promoted insns
They were dropped from spec version 007.
2025-08-15 12:21:42 +02:00
Jan Beulich
98e6d3f5bd gas/ELF: allow specifying entity size for arbitrary sections
The spec doesn't tie entity size to just SHF_MERGE and SHF_STRINGS
sections. Introduce a new "section letter" 'E' to allow recording (and
checking) of entity size even without 'M' or 'S'.
2025-08-15 12:19:59 +02:00
Jan Beulich
21ff588912 gas/ELF: adjust bad section letter diagnostic
Being told of a problem with .section when .pushsection was used can be
irritating, especially when several of them are on the same line.
2025-08-15 12:18:51 +02:00
Jan Beulich
4984ab44f8 gas/ELF: re-work SHF_GNU_* handling
Indicate to obj_elf_parse_section_letters() whether to recognize GNU-
specific flags by conditionally passing NULL in place of a pointer to
the GNU attributes. This way wrong use of d and R can be diagnosed just
like any other use of unrecognized letters.

Furthermore adjust the md_elf_section_letter() interface: Have targets
merely return the extra letters they support. There's no point having
them customize the entire diagnostic. Even more so that additions in
common code would then reflecting in every target's diagnostic as well,
which - as can be seen - wasn't always properly done.

There's also no reason for wrong letters to be a fatal error; switch to
as_bad() while making other adjustments there.

While making the target specific adjustments, also drop IA-64's dead
handling of 'o' (SHF_LINK_ORDER), which has been covered by common code
for a long time.

Also re-arrange the switch() in obj_elf_parse_section_letters() to be
alphabetically sorted again.
2025-08-15 12:18:34 +02:00
Jan Beulich
a1b33b8cc4 gas/ELF: drop bogus check for ELFOSABI_STANDALONE
obj_elf_parse_section_letters() checking for that ABI, when the checking
at the bottom of obj_elf_section() and the logic in
_bfd_elf_final_write_processing() don't, makes no sense. Either
STANDALONE is meant to be GNU-ish, or it is not, I would think. Drop the
one inconsistent check.

If it was not GNU-ish (as the other two locations suggest), what did the
section23b testcase actually mean to check? The numeric attribute value
0x200000 has an entirely unknown (or more precisely, OS-defined, which
we may or may not know of) meaning then, so ought to be accepted. If it
was GNU-ish, the other testcase, elf/section23a, would want running for
those targets as well, and the testcase in question would still be wrong
to have. Hence that testcase is removed, and section23a is renamed to
just section23.
2025-08-15 12:18:03 +02:00
Nelson Chu
28520d7eed RISC-V: PR33216, Allow c.slli, c.srai, c.srli with 0 immediate as a hint
The original patch,
e6f372ba66

Since recently c.slli64, c.srai64, and c.srli64 have been removed from the
riscv-isa-manual, c.slli, c.srli, and c.srai with 0 immediate are now listed
as hints,
https://github.com/riscv/riscv-isa-manual/pull/1942 and https://github.com/riscv/riscv-isa-manual/pull/2093

So allow c.slli, c.srli, and c.srai with 0 immediate as a hint.  Also allow to
assemble slli, srli and srai with 0 immediate to hint c.slli, c.srli and c.srai
when rvc is enabled.  The c.slli64, c.srai64, and c.srli64 should be kept as
aliases, so dis-assembler should disassemble to c.slli, c.srli, and c.srai with
0 immediate.

Passed rv32/64-elf/linux binutils testcases.

gas/
	PR 33216
	* testsuite/gas/riscv/c-zero-imm.d: Updated since allow c.slli64,
	c.srai64, and c.srli64 with 0 immediate as a hint.
	* testsuite/gas/riscv/c-zero-imm.s: Likewise.
	* testsuite/gas/riscv/zca.d: Likewise.
opcodes/
	PR 33216
	* riscv-opc.c (riscv_opcodes): Updated since allow c.slli64, c.srai64,
	and c.srli64 with 0 immediate as a hint.
2025-08-14 12:10:49 +08:00
Jan Beulich
d582b4eb1b Arm: parse_neon_type() weaknesses
The custom parsing done there and in one of its callers allowed various
bogus constructs to be accepted. Insist on a non-zero leading digit when
parsing numbers, don't lose upper bits, and insist on proper separation
of operands.
2025-08-08 11:43:02 +02:00
Pietro Monteiro
bdee554202 Update obsolete autoconf macros
bfd/
	* bfd.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.
binutils/
	* configure.ac: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.
gas/
	* acinclude.m4: Replace AC_TRY_LINK with AC_LINK_IFELSE.
	Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.
gprof/
	* configure.ac: Replace AC_OUTPUT(file list) with
	AC_CONFIG_FILES([file list])\nAC_OUTPUT.
libctf/
	* configure.ac: Replace AC_TRY_LINK with AC_LINK_IFELSE.
opcodes/
	* configure.ac: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.
2025-08-07 22:14:49 +09:30
Jan Beulich
85cced8e9b gas: check section size against entry size
If a section has a non-zero entry size, its total size would generally
better be a multiple of the entry size. Warn if that's not the case.
2025-08-01 09:16:19 +02:00
Alan Modra
303045d953 PR 33229 nds32 gas segfaults on gcc output
Commit 1ac26e9f7a replaced ISSPACE with is_whitespace, but the
former returns true on EOL while the latter does not.  Sprinkle
is_end_of_stmt tests to fix this bug.

The same segfault can be triggered by a ".relax_hint" with no
following instructions.  Fix that too.

	* config/tc-nds32.c (nds32_lookup_pseudo_opcode): Use
	is_end_of_stmt along with is_whitespace.
	(nds32_relax_relocs, nds32_relax_hint, nds32_flag),
	(ict_model: Likewise.
	(nds32_elf_append_relax_relocs): Return on no opcode.
	* testsuite/gas/nds32/nds32.exp: Find .d files automatically.
	* testsuite/gas/nds32/pr33229.d,
	* testsuite/gas/nds32/pr33229.s: New test.
2025-07-30 09:48:59 +09:30
Matthieu Longo
8fbfec1180 gas: add missing header guard in tc-<arch>.h files
This patch adds missing header guards in some of the tc-<arch>.h,
and merely comments on the corresponding #endif for others. The
patch does not aim at being exhaustive, it only touched the files
relevant for [1].

[1]: https://inbox.sourceware.org/binutils/20250711112913.2453285-1-matthieu.longo@arm.com/
2025-07-28 12:34:08 +01:00
Alice Carlotti
ff67c7a329 gas/NEWS: Add AArch64 updates 2025-07-25 10:43:35 +01:00
Alice Carlotti
2b000fbeae gas/doc: Update AArch64 Architecture Extensions
Add faminmax, move a couple of misplaced entries, and improve a few
other entries.

The documentation now lists every recognised extension name, with the
exception of a couple of aliases that are deliberately undocumented.
2025-07-25 10:43:35 +01:00
Alice Carlotti
493ed05224 aarch64: Fix sve2p2/sme2p2 dependencies
Change dependency on sve2/sme2 to sve2p1/sme2p1.
2025-07-25 10:43:34 +01:00
Indu Bhagat
095319fe53 gas: sframe: command line option takes precedence
over gas directive to emit .sframe section.

Fix PR gas/33175 sframe: --gsframe=no does not disable when
.cfi_sections directive with .sframe

--gsframe=no should also disable generation of SFrame section when
explicit CFI directive:
  .cfi_sections .sframe
is specified in the input.  This means we need to track whether SFrame
generation was explicitly disabled by the user.  Introduce a new enum to
facilitate disambiguation between GEN_SFRAME_DEFAULT_NONE and
GEN_SFRAME_DISABLED.

While fixing the bug by adding the enum, keep the upcoming requirement
in mind: we will also need to disambiguate between
--enable-default-sframe and user-specified --gsframe/--gsframe=yes.  The
intent is to not display SFrame related warnings or errors like:

  as_bad (_(".sframe not supported for target"));

for unsupported targets if --enable-default-sframe is in effect.

This implies we need to have a four state enum (
GEN_SFRAME_DEFAULT_NONE, GEN_SFRAME_CONFIG_ENABLED,
GEN_SFRAME_DISABLED, GEN_SFRAME_ENABLED)

gas/
	PR gas/33175
	* dw2gencfi.c (cfi_finish): Check state of flag_gen_sframe to
	determine whether any SFrame section is generated.
	* as.h (enum gen_sframe_option): New definition.
	* as.c (parse_args): Keep track of whether the flag is
	explicitly enabled or disabled

gas/testsuite/
	PR gas/33175
	* gas/cfi-sframe/cfi-sframe-common-1.d: Remove redundant
	--gsframe.
	* gas/cfi-sframe/cfi-sframe.exp:  Add new test.
	* gas/cfi-sframe/cfi-sframe-common-1c.d: New test.  No SFrame
	section if explicit --gsframe=no.
	* gas/cfi-sframe/cfi-sframe-common-1c.s: New test.
2025-07-25 01:47:20 -07:00
Indu Bhagat
83eeaf9178 gas: sframe: fix PR gas/33170
SFrame generation code assumes that since DW_CFA_restore means
restoration of the state of the register to the one at the beginning of
the function, there must be a state to restore to (hence the gas_assert
(cie_fre)).

This assumption needs adjustment.  DW_CFA_restore may be present in the
very beginning of a (e.g., cold) function, with no initialized state for
SFrame functions to restore to.

gas/
	PR gas/33170
	* gas/gen-sframe.c (sframe_xlate_do_restore): Use current FRE if
	CIE FRE is not yet setup.
gas/testsuite/
	PR gas/33170
	* gas/cfi-sframe/cfi-sframe.exp: New test.
	* gas/cfi-sframe/cfi-sframe-x86_64-pr33170.d: New test.
	* gas/cfi-sframe/cfi-sframe-x86_64-pr33170.s: New test.
2025-07-23 00:11:47 -07:00
Nick Clifton
657f10397e Updated translations for various sub-directories 2025-07-22 15:58:21 +01:00
H.J. Lu
014ae6af49 Remove NaCl/arm target support
NaCl has been deprecated:

https://developer.chrome.com/docs/native-client/migration/

It is now in the process of being removed from llvm:

https://github.com/llvm/llvm-project/pull/133661

Remove NaCl/arm target support from bfd, binutils, gas and ld.

bfd/

	* Makefile.am (BFD32_BACKENDS): Remove elf-nacl.lo.
	(BFD32_BACKENDS_CFILES): Remove elf-nacl.c.
	(SOURCE_HFILES): Remove elf-nacl.h.
	* Makefile.in: Regenerated.
	* config.bfd: Add *-*-nacl* to obsolete targets.
	Remove *-*-nacl* targets.
	* configure.ac: Remove nacl target vectors.
	* elf-bfd.h (elf_target_os): Remove is_nacl.
	* elf-nacl.c: Removed.
	* elf-nacl.h: Likewise.
	* elf32-arm.c: Don't include "elf-nacl.h".
	(elf32_arm_nacl_plt0_entry): Removed.
	(elf32_arm_nacl_plt_entry): Likewise.
	(elf32_arm_stub_long_branch_arm_nacl): Likewise.
	(elf32_arm_stub_long_branch_arm_nacl_pic): Likewise.
	(arm_movw_immediate): Likewise.
	(arm_movt_immediate): Likewise.
	(arm_nacl_put_plt0): Likewise.
	(elf32_arm_nacl_link_hash_table_create): Likewise.
	(elf32_arm_nacl_modify_segment_map): Likewise.
	(elf32_arm_nacl_final_write_processing): Likewise.
	(elf32_arm_nacl_plt_sym_val): Likewise.
	(elf32_arm_stub_cmse_branch_thumb_only): Remove
	long_branch_arm_nacl and long_branch_arm_nacl_pic entries.
	(arm_type_of_stub): Updated.
	(elf32_arm_create_or_find_stub_sec): Likewise.
	(arm_stub_required_alignment): Likewise.
	(elf32_arm_allocate_plt_entry): Likewise.
	(elf32_arm_populate_plt_entry): Likewise.
	(elf32_arm_finish_dynamic_sections): Likewise.
	(elf32_arm_output_plt_map_1): Likewise.
	(elf32_arm_output_arch_local_syms): Likewise.
	Remove elf32_arm_nacl_bed.
	* targets.c: Remove NaCl target vectors.
	* bfd-in2.h: Regenerated.
	* configure: Likewise.
	* po/SRC-POTFILES.in: Likewise.

binutils/

	* NEWS: Mention NaCl target support removal.
	* testsuite/lib/binutils-common.exp: Remove NaCl target support.

gas/

	* NEWS: Mention NaCl target support removal.
	* configure.tgt: Likewise.
	* config/tc-arm.c: Remove NaCl target support.
	* testsuite/gas/arm/any-armv8m.d: Likewise.
	* testsuite/gas/arm/any-cmse-main.d: Likewise.
	* testsuite/gas/arm/any-cmse.d: Likewise.
	* testsuite/gas/arm/any-idiv.d: Likewise.
	* testsuite/gas/arm/arch4t-eabi.d: Likewise.
	* testsuite/gas/arm/arch4t.d: Likewise.
	* testsuite/gas/arm/armv8m.base-idiv.d: Likewise.
	* testsuite/gas/arm/armv9-a_arch.d: Likewise.
	* testsuite/gas/arm/attr-abi-hardfp-use-0.d: Likewise.
	* testsuite/gas/arm/attr-abi-hardfp-use-1.d: Likewise.
	* testsuite/gas/arm/attr-abi-hardfp-use-2.d: Likewise.
	* testsuite/gas/arm/attr-abi-hardfp-use-3.d: Likewise.
	* testsuite/gas/arm/attr-any-armv4t.d: Likewise.
	* testsuite/gas/arm/attr-any-thumbv6.d: Likewise.
	* testsuite/gas/arm/attr-arch-assumption.d: Likewise.
	* testsuite/gas/arm/attr-cpu-directive.d: Likewise.
	* testsuite/gas/arm/attr-default.d: Likewise.
	* testsuite/gas/arm/attr-empty-string.d: Likewise.
	* testsuite/gas/arm/attr-ext-fpv5-d16.d: Likewise.
	* testsuite/gas/arm/attr-ext-fpv5.d: Likewise.
	* testsuite/gas/arm/attr-ext-idiv.d: Likewise.
	* testsuite/gas/arm/attr-ext-mp.d: Likewise.
	* testsuite/gas/arm/attr-ext-neon-fp16.d: Likewise.
	* testsuite/gas/arm/attr-ext-neon-vfpv3.d: Likewise.
	* testsuite/gas/arm/attr-ext-neon-vfpv4.d: Likewise.
	* testsuite/gas/arm/attr-ext-sec.d: Likewise.
	* testsuite/gas/arm/attr-ext-vfpv3-d16-fp16.d: Likewise.
	* testsuite/gas/arm/attr-ext-vfpv3-d16.d: Likewise.
	* testsuite/gas/arm/attr-ext-vfpv3-fp16.d: Likewise.
	* testsuite/gas/arm/attr-ext-vfpv3.d: Likewise.
	* testsuite/gas/arm/attr-ext-vfpv3xd-fp.d: Likewise.
	* testsuite/gas/arm/attr-ext-vfpv3xd.d: Likewise.
	* testsuite/gas/arm/attr-ext-vfpv4-d16.d: Likewise.
	* testsuite/gas/arm/attr-ext-vfpv4-sp-d16.d: Likewise.
	* testsuite/gas/arm/attr-ext-vfpv4.d: Likewise.
	* testsuite/gas/arm/attr-march-all.d: Likewise.
	* testsuite/gas/arm/attr-march-armv1.d: Likewise.
	* testsuite/gas/arm/attr-march-armv2.d: Likewise.
	* testsuite/gas/arm/attr-march-armv2a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv2s.d: Likewise.
	* testsuite/gas/arm/attr-march-armv3.d: Likewise.
	* testsuite/gas/arm/attr-march-armv3m.d: Likewise.
	* testsuite/gas/arm/attr-march-armv4.d: Likewise.
	* testsuite/gas/arm/attr-march-armv4t.d: Likewise.
	* testsuite/gas/arm/attr-march-armv4txm.d: Likewise.
	* testsuite/gas/arm/attr-march-armv4xm.d: Likewise.
	* testsuite/gas/arm/attr-march-armv5.d: Likewise.
	* testsuite/gas/arm/attr-march-armv5t.d: Likewise.
	* testsuite/gas/arm/attr-march-armv5te.d: Likewise.
	* testsuite/gas/arm/attr-march-armv5tej.d: Likewise.
	* testsuite/gas/arm/attr-march-armv5texp.d: Likewise.
	* testsuite/gas/arm/attr-march-armv5txm.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6-m+os.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6-m.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6j.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6k+sec.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6k.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6kt2.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6kz.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6kzt2.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6s-m.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6t2.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6z.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6zk.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6zkt2.d: Likewise.
	* testsuite/gas/arm/attr-march-armv6zt2.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7-a+idiv.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7-a+mp.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7-a+sec+virt.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7-a+sec.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7-a+virt.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7-a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7-m.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7-r+mp.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7-r.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7em.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7m.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7r.d: Likewise.
	* testsuite/gas/arm/attr-march-armv7ve.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8-a+crypto.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8-a+fp.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8-a+rdma.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8-a+simd.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8-a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8-r+crypto.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8-r+fp.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8-r+simd.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8-r.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8_1-a+simd.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8_1-m.main.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8_4-a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8_5-a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8_6-a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8_7-a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8_8-a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8_9-a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv9_1-a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv9_2-a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv9_3-a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv9_4-a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv9_5-a.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8m.base.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8m.main.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8m.main.dsp.d: Likewise.
	* testsuite/gas/arm/attr-march-iwmmxt.d: Likewise.
	* testsuite/gas/arm/attr-march-iwmmxt2.d: Likewise.
	* testsuite/gas/arm/attr-march-xscale.d: Likewise.
	* testsuite/gas/arm/attr-mcpu.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-arm1020e.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-arm1020t.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-arm1136jf-s.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-arm1136jfs.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-neon-fp16.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-neon.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-softvfp+vfp.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-softvfp.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-vfp.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-vfp10-r0.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-vfp10.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-vfp3.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-vfp9.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-vfpv2.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-vfpv3-d16.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-vfpv3.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-vfpv4-d16.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-vfpv4.d: Likewise.
	* testsuite/gas/arm/attr-mfpu-vfpxd.d: Likewise.
	* testsuite/gas/arm/attr-names.d: Likewise.
	* testsuite/gas/arm/attr-non-null-terminated-string.d: Likewise.
	* testsuite/gas/arm/attr-order.d: Likewise.
	* testsuite/gas/arm/attr-override-cpu-directive.d: Likewise.
	* testsuite/gas/arm/attr-override-mcpu.d: Likewise.
	* testsuite/gas/arm/bl-local-2.d: Likewise.
	* testsuite/gas/arm/bl-local-v4t.d: Likewise.
	* testsuite/gas/arm/blx-local.d: Likewise.
	* testsuite/gas/arm/branch-reloc.d: Likewise.
	* testsuite/gas/arm/directives.d: Likewise.
	* testsuite/gas/arm/got_prel.d: Likewise.
	* testsuite/gas/arm/mapdir.d: Likewise.
	* testsuite/gas/arm/mapmisc.d: Likewise.
	* testsuite/gas/arm/mapsecs.d: Likewise.
	* testsuite/gas/arm/mapshort-eabi.d: Likewise.
	* testsuite/gas/arm/mov-highregs-any.d: Likewise.
	* testsuite/gas/arm/mov-lowregs-any.d: Likewise.
	* testsuite/gas/arm/note-march-armv2.d: Likewise.
	* testsuite/gas/arm/note-march-armv2a.d: Likewise.
	* testsuite/gas/arm/note-march-armv3.d: Likewise.
	* testsuite/gas/arm/note-march-armv3m.d: Likewise.
	* testsuite/gas/arm/note-march-armv4.d: Likewise.
	* testsuite/gas/arm/note-march-armv4t.d: Likewise.
	* testsuite/gas/arm/note-march-armv5.d: Likewise.
	* testsuite/gas/arm/note-march-armv5t.d: Likewise.
	* testsuite/gas/arm/note-march-armv5te.d: Likewise.
	* testsuite/gas/arm/note-march-iwmmxt.d: Likewise.
	* testsuite/gas/arm/note-march-iwmmxt2.d: Likewise.
	* testsuite/gas/arm/note-march-xscale.d: Likewise.
	* testsuite/gas/arm/pr12198-1.d: Likewise.
	* testsuite/gas/arm/pr12198-2.d: Likewise.
	* testsuite/gas/arm/thumb-eabi.d: Likewise.
	* testsuite/gas/arm/thumb.d: Likewise.
	* testsuite/gas/arm/thumbrel.d: Likewise.
	* config/te-nacl.h: Removed.

ld/

	* Makefile.am (ALL_EMULATION_SOURCES): Remove earmelf_nacl.c and
	and earmelfb_nacl.c.
	Remove NaCl dep files.
	* NEWS: Mention NaCl target support removal.
	* configure.tgt: Remove NaCl target support.
	* Makefile.in: Regenerated.
	* configure: Likewise.
	* po/BLD-POTFILES.in: Likewise.
	* emulparams/armelf_nacl.sh: Removed.
	* emulparams/armelfb_nacl.sh: Likewise.
	* emulparams/elf_nacl.sh: Likewise.
	* testsuite/ld-arm/farcall-arm-nacl-pic.d: Likewise.
	* testsuite/ld-arm/farcall-arm-nacl.d: Likewise.
	* testsuite/ld-arm/farcall-data-nacl.d: Likewise.
	* testsuite/ld-arm/farcall-thumb2-purecode-consecutive-veneer.d:
	Adjusted.
	* testsuite/ld-arm/arm-elf.exp: Remove NaCl target support.
	* testsuite/ld-arm/cortex-a8-far.d: Likewise.
	* testsuite/ld-arm/non-contiguous-arm3.d: Likewise.
	* testsuite/ld-arm/non-contiguous-arm6.d: Likewise.
	* testsuite/ld-elf/binutils.exp: Likewise.
	* testsuite/ld-elf/build-id.exp: Likewise.
	* testsuite/ld-elf/ehdr_start-missing.d: Likewise.
	* testsuite/ld-elf/ehdr_start-shared.d: Likewise.
	* testsuite/ld-elf/ehdr_start-userdef.d: Likewise.
	* testsuite/ld-elf/ehdr_start-weak.d: Likewise.
	* testsuite/ld-elf/ehdr_start.d: Likewise.
	* testsuite/ld-elf/elf.exp: Likewise.
	* testsuite/ld-elf/export-class.exp: Likewise.
	* testsuite/ld-elf/fatal-warnings-1a.d: Likewise.
	* testsuite/ld-elf/fatal-warnings-1b.d: Likewise.
	* testsuite/ld-elf/orphan-region.d: Likewise.
	* testsuite/ld-elf/package-note.exp: Likewise.
	* testsuite/ld-elf/pr16322.d: Likewise.
	* testsuite/ld-elf/pr16498a.d: Likewise.
	* testsuite/ld-elf/pr16498b.d: Likewise.
	* testsuite/ld-elf/pr19162.d: Likewise.
	* testsuite/ld-elf/pr22269a.d: Likewise.
	* testsuite/ld-elf/pr22269b.d: Likewise.
	* testsuite/ld-elf/pr22393-1a.d: Likewise.
	* testsuite/ld-elf/pr22393-1b.d: Likewise.
	* testsuite/ld-elf/pr22393-1c.d: Likewise.
	* testsuite/ld-elf/pr22393-1d.d: Likewise.
	* testsuite/ld-elf/pr22393-1e.d: Likewise.
	* testsuite/ld-elf/pr22393-1f.d: Likewise.
	* testsuite/ld-elf/pr22393-2a.rd: Likewise.
	* testsuite/ld-elf/pr22393-2b.rd: Likewise.
	* testsuite/ld-elf/pr23900-1-32.rd: Likewise.
	* testsuite/ld-elf/pr23900-1-64.rd: Likewise.
	* testsuite/ld-elf/pr23900-1.d: Likewise.
	* testsuite/ld-elf/pr23900-2a.d: Likewise.
	* testsuite/ld-elf/pr23900-2b.d: Likewise.
	* testsuite/ld-elf/pr30508.d: Likewise.
	* testsuite/ld-elf/pr30907-1.d: Likewise.
	* testsuite/ld-elf/pr30907-2.d: Likewise.
	* testsuite/ld-elf/pr32341.d: Likewise.
	* testsuite/ld-elf/shared.exp: Likewise.
	* testsuite/ld-elf/tls.exp: Likewise.
	* testsuite/ld-elf/tls_common.exp: Likewise.
	* testsuite/ld-elfvers/vers.exp: Likewise.
	* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
	* testsuite/ld-elfweak/elfweak.exp: Likewise.
	* testsuite/ld-gc/gc.exp: Likewise.
	* testsuite/ld-ifunc/binutils.exp: Likewise.
	* testsuite/ld-pie/pie.exp: Likewise.
	* testsuite/ld-plugin/lto-binutils.exp: Likewise.
	* testsuite/ld-plugin/lto.exp: Likewise.
	* testsuite/ld-scripts/rgn-at3.d: Likewise.
	* testsuite/ld-shared/shared.exp: Likewise.
	* testsuite/ld-size/size.exp: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-07-21 06:18:54 -07:00
Alan Modra
9472a0558d Fix more unused variable warnings 2025-07-18 17:24:51 +09:30
Alan Modra
7d9ed03a1b asan: undefined shift
.bundle_align_mode 32
 nop
read.c:776:26: runtime error: shift exponent 32 is too large for
32-bit type 'unsigned int'

Avoid this by using wider types in the expressions.
2025-07-18 15:59:20 +09:30
Sam James
50c1c57426 gas: improve --gsframe documentation
I omitted documentation in 8aad677a12 in
error. Rectify that with:
1) changing ---help to mention bare `--gsframe` too, as we're not
   getting rid of that;

2) adding the new --gsframe=[no|yes] form to as.texi.

	PR gas/33125
	* gas/as.c (parse_args): Tweak --gsframe= help text.
	* gas/doc/as.texi: Document --gsframe=[no|yes].
2025-07-16 09:10:12 +01:00
Nick Clifton
83be472a61 Updated translations for various sub-directories 2025-07-15 13:37:09 +01:00
H.J. Lu
1535d2a0ce gas: Re-indent case OPTION_SFRAME:
PR gas/33125
	* gas/as.c (parse_args): Re-indent case OPTION_SFRAME:

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-07-15 10:16:40 +08:00
Sam James
8aad677a12 gas: support --gsframe=no
Being able to explicitly disable SFrames on the command line is useful,
especially when looking at a gas that enables SFrames by default. The
binutils testsuite will benefit from this as there's testcases that don't
expect their presence.

In summary:
* Nothing is passed       => no SFrames (no change from before)
* --gsframe is passed     => SFrames    (no change from before)
* --gsframe=yes is passed => SFrames    (previously rejected)
* --gsframe-no  is passed => no SFrames (previously rejected)

	PR gas/33125
	* gas/as.c (parse_args): Accept --gsframe=no, --gsframe=yes.
2025-07-15 01:30:01 +01:00
Sam James
62bc378b0b Revert "gas: support --gsframe=no"
This reverts commit e6b2368b95.

I made a last minute style change and oopsed it.
2025-07-15 01:29:22 +01:00
Sam James
e6b2368b95 gas: support --gsframe=no
Being able to explicitly disable SFrames on the command line is useful,
especially when looking at a gas that enables SFrames by default. The
binutils testsuite will benefit from this as there's testcases that don't
expect their presence.

In summary:
* Nothing is passed       => no SFrames (no change from before)
* --gsframe is passed     => SFrames    (no change from before)
* --gsframe=yes is passed => SFrames    (previously rejected)
* --gsframe-no  is passed => no SFrames (previously rejected)

	PR gas/33125
	* gas/as.c (parse_args): Accept --gsframe=no, --gsframe=yes.
2025-07-15 01:17:09 +01:00
Nick Clifton
7a18105dff Updated Spanish translation for the gas sub-directory 2025-07-14 16:39:36 +01:00
Alan Modra
1f252ce4b2 gas deferrred diags leak
asan complains when running the gas all/cond-diag test.

	* read.c (deferred_diag_head, deferred_diag_tail): Renamed
	from deferred_diags and last_deferred_diag, making the tail
	pointer a deferred_diag**.
	(s_errwarn_if): Simplify appending to list.  Free unused diag
	on error.
	(evaluate_deferred_diags): Free list.
2025-07-14 19:31:41 +09:30
Alan Modra
33aa1470c7 Delete AM_PO_SUBDIRS invocation
These aren't needed since commit 862776f26a.
2025-07-14 19:31:41 +09:30
Nelson Chu
8be32d5065 gas/NEWS: Corrected the information about mapping symbol $x for risc-v 2025-07-14 17:50:52 +08:00
Aaron Griffith
804ccd0a64 gas: accept leading zeros on dollar local labels in z80 sdcc compat mode
SDCC assembly output uses 5-digit numeric dollar sign labels, padded
with zeros. Commit 226749d made these invalid, and broke the Z80 SDCC
compatibility mode in GAS.

https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=226749d5a6ff0d5c607d6428d6c81e1e7e7a994b

This restores SDCC compatibility by replacing the leading zeros with
spaces when inside dollar local labels and when SDCC compatibility is
enabled. It also restores the SDCC test case to represent actual
syntax emitted by SDCC, and adds a note explaining the purpose of
the test.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33030
2025-07-14 10:38:52 +02:00
H.J. Lu
ef7a634dc0 gas: Move gas_sframe_check to binutils-common.exp
Move gas_sframe_check to binutils-common.exp so that it can be used in
linker tests to check if a target assembler supports --gsframe.

binutils/

	PR ld/33146
	* testsuite/lib/binutils-common.exp (gas_sframe_check): Moved
	from cfi-sframe.exp.  Replace gas_host_run with remote_exec.

gas/

	PR ld/33146
	* testsuite/gas/cfi-sframe/cfi-sframe.exp (gas_sframe_check):
	Moved to binutils-common.exp.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-07-14 06:10:52 +08:00
Nick Clifton
47fdedbb95 Update version number on mainline 2025-07-13 08:57:08 +01:00
Nick Clifton
5c778308bd Add markers for 2.45 branch 2025-07-13 08:35:45 +01:00
Indu Bhagat
4c043ef6f3 gas: aarch64: suppport CFI directive .cfi_mte_tagged_frame
Process a new aarch64-specific CFI directive: .cfi_mte_tagged_frame
(LLVM uses this CFI directive already).  The CFI directive, when
present for a function, indicates that the stack frame for the
function may modify the MTE tags of the stack space it uses.  The
assembler emits char 'G' in the CIE augmentation string to indicate
the same.

ChangeLog:

        * gas/config/tc-aarch64.c (s_aarch64_mte_tagged_frame): New
	definition.
        * gas/config/tc-aarch64.h (tc_fde_entry_extras): Add
	memtag_frame_p.
        (tc_cie_entry_extras): Likewise.
        (tc_fde_entry_init_extra): Likewise.
        (tc_cie_fde_equivalent_extra): Likewise.
        (tc_cie_entry_init_extra): Likewise.
        * gas/doc/c-aarch64.texi: Add documentation for
	.cfi_mte_tagged_frame directive.
        * gas/testsuite/gas/aarch64/mte_tagged_stack.d: New test.
        * gas/testsuite/gas/aarch64/mte_tagged_stack.s: New test.
2025-07-12 11:33:25 +02:00
Alice Carlotti
3b6b69205c aarch64: Add support for --march=armv9.6-a 2025-07-12 10:04:27 +01:00
Alice Carlotti
7c684dc6a1 aarch64: Disable sysreg guards by default
Add a new flag -menable-sysreg-checking to restore previous behaviour.
This existing behaviour is quite inconsistent, so the gating will
probably be updated in the future.  (In particular, many system
registers are currently gated with the architecture version they were
released with instead of the lower architecture version that they
actually require).

This patch retains the +d128 requirement for msrr/mrrs.

Co-Authored-By: Srinath Parvathaneni <srinath.parvathaneni@arm.com>
2025-07-12 10:04:27 +01:00
Alice Carlotti
5bf6d4cd7e aarch64: Add missing F_STRICT flags
By default, NIL qualifiers are treated as matching any qualifier when
checking operand constraints.  For many SVE instructions, this would
allow operands with missing type suffixes to be assembled as if they had
any explicit type specified.  To prevent this, the F_STRICT flag is used
to specify that NIL qualifiers should match only NIL qualifiers.

Unfortunately, several SVE instructions incorrectly omitted this
F_STRICT flag.  The bug has existed in the *MATMUL_SVE* macros since
they were added in 2019.  The macro LUT_SVE2_INSN was added last year,
and the other incorrect macros are new in this release.

LUTv2_SME2_INSN and LUTv2_SME2p1_INSN were not actually broken, because
we reject untyped vector lists already during parsing.  However, I have
added the F_STRICT flag here anyway, since this is more consistent and
would be more robust if those operands start accepting untyped vector
lists in the future.  The new luti4 tests are the only ones that were
already rejected before this change.

BFLOAT16_SVE_INSN has been unused since it was originally added, so I
just deleted the macro.

The SVE LUT instructions were using the lut instruction class, which
has special handling only for SIMD operands, and isn't recognised by
aarch64_decode_variant_using_iclass (which sets the qualifiers during
decode for most SVE instructions).  To prevent these instructions
failing to disassemble, I changed their instruction class to sve_misc.
2025-07-12 10:04:27 +01:00