Commit Graph

3364 Commits

Author SHA1 Message Date
Nick Clifton
8872d02b0f Sync libiberty sources with gcc master version 2026-01-07 11:33:07 +00:00
Srinath Parvathaneni
43d523e207 aarch64: Add support for POE2 PLBI instruction
This patch adds support for PLB invalidate operation (PLBI) instruction
and the corresponding system registers as operand (<plbi_op>).

Syntax: PLBI <plbi_op>{, <Xt>}

This instruction is an alias to "SYS #<op1>, C10, <Cm>, #<op2>{, <Xt>}"
and PLBI being the preferred disassembly.

The following list of system registers are supported in this patch for the
PLBI instructions enabled by "+poe2" flag and also the "nxs" variants of
these system registers are enabled by "+poe2+xs" flag.

   * alle1
   * alle1is
   * alle1os
   * alle2
   * alle2is
   * alle2os
   * alle3
   * alle3is
   * alle3os
   * aside1
   * aside1is
   * aside1os
   * permae1
   * permae1is
   * permae1os
   * perme1
   * perme1is
   * perme1os
   * perme2
   * perme2is
   * perme2os
   * perme3
   * perme3is
   * perme3os
   * vmalle1
   * vmalle1is
   * vmalle1os
2026-01-05 17:50:55 +00:00
Srinath Parvathaneni
859d7ccd9f aarch64: Add support for TEV instructions
This patch adds support for FEAT_TEV feature enabled by "+tev"
flag along with support for following instructions.

* TENTER
* TEXIT

TENTER instruction uses the existing AARCH64_OPND_NOT_BALANCED_17 operand
to handle the not_balanced (NB) argument , where as a new operand
AARCH64_OPND_NOT_BALANCED_10 is added to support the NB (not_balanced)
argument in TEXIT instruction.
2026-01-05 17:50:43 +00:00
Srinath Parvathaneni
37fd5c9428 aarch64: Add support for POE2 instructions
This patch adds support for FEAT_S1POE2 feature enabled by "+poe2"
flag along with support for following instructions.

* TCHANGEB (immediate)
* TCHANGEB (register)
* TCHANGEF (immediate)
* TCHANGEF (register)

A new operand AARCH64_OPND_NOT_BALANCED_17 is added to the code in this
patch to support the new optional argument "NB" (not_balanced) which
is a 1-bit field in the encoding for all the above mentioned
instructions.

Co-authored-by:  Matthew Malcomson <matthew.malcomson@arm.com>
2026-01-05 17:50:24 +00:00
Alan Modra
c8f306af2f Update year range in copyright notice of binutils files
Avoid warnings about invalid escapes in etc/update-copyright.py by
using raw strings, add BinutilsFilter to skip psql.rc and add
"Kalray SA." as another copyright holder.
2026-01-01 23:22:14 +10:30
Alice Carlotti
1db7006c37 aarch64: Remove sme2_movaz instruction class
The behaviour of sme2_movaz was identical to sme_misc, so use that
instead.
2025-12-29 12:03:03 +00:00
Sivan Shani
d8d024ad42 AArch64 v9.7 extensions: FEAT_SVE_B16MM
This patch includes:
  - Feature flag for FEAT_SVE_B16MM
  - Instruction:
      - BFMMLA (non-widening) BFloat16 matrix multiply-accumulate.
2025-12-27 12:45:53 +00:00
Sivan Shani
3eb520ce6a AArch64 v9.7 extensions: FEAT_F16MM
This patch includes:
  - Feature flag for FEAT_F16MM
  - Instructions:
	- FMMLA (non-widening) Half-precision matrix multiply-accumulate
	- FMMLA (non-widening) Floating-point matrix multiply-accumulate
2025-12-27 12:45:53 +00:00
Sivan Shani
a6956e0c79 AArch64: Add FEAT_F16F32MM
This patch includes:
    - The feature flag for the FEAT_F16F32MM feature.
    - Instruction FMMLA Half-precision matrix multiply-accumulate to single-precision.
2025-12-27 12:45:52 +00:00
Sivan Shani
4373edd2f6 AArch64: Add FEAT_F16F32DOT instructions
This includes the instructions for the F16F32DOT feature:
    - FDOT half-precision to single-precision, by element
    - FDOT half-precision to single-precision, vector
2025-12-27 12:45:52 +00:00
Sivan Shani
a722387a1f AArch64: Add FEAT_SVE2p3 and FEAT_SME2p3 instructions.
This patch includes:

    - Flags for the FEAT_SVE2p3 and FEAT_SME2p3 features.
    - Instructions:
      - ADDQP
      - ADDSUBP
      - FCVTZSN
      - FCVTZUN
      - LUTI6 16-bit
      - LUTI6 8-bit
      - SABAL
      - SCVTF
      - SCVTFLT
      - SDOT vectors
      - SDOT indexed
      - SQRSHRN
      - SQRSHRUN
      - SQSHRN
      - SQSHRUN
      - SUBP
      - UABAL
      - UCVTF
      - UCVTFLT
      - UDOT vectors
      - UDOT indexed
      - UQRSHRN
      - UQSHRN
      - LUTI6 vector
      - LUTI6 table, four registers
      - LUTI6 table, single, 8-bit

    In addition, new operands:
      - OPND_SME_Zmx2_INDEX_22: an operand represents a list of vector registers with an index.
      - OPND_SME_Zn7xN_UNTYPED: an operand represents an untyped list of vector registers.
2025-12-27 12:19:23 +00:00
Yury Khrustalev
242e78b76a aarch64: Add FEAT_MOPS_GO instructions
Also add +mops-go feature flag and make the mops-go feature
depend on the memtag and mops features.
2025-12-27 09:23:51 +00:00
Alan Modra
4dc7130975 PR 33726, symbols in excluded sections
This improves "nearby" section choice when memory regions are active,
preferring a section in the same region as the excluded section over
other sections.

	PR 33726
include/
	* bfdlink.h (struct bfd_link_callbacks): Add nearby_section.
	(_bfd_nearby_section): Delete.
	(bfd_fix_excluded_sec_syms): Rename and remove bfd param from
	_bfd_fix_excluded_sec_syms.
bfd/
	* linker.c (_bfd_nearby_section): Delete.
	(fix_syms): Use linker callback.
	* elflink.c (elf_link_input_bfd): Likewise.
	(_bfd_elf_final_link): Update.
ld/
	* ldemul.c (finish_default): Update.
	* ldlang.c (lang_output_section_get): Delete.
	(ldlang_nearby_section): New function.
	* ldlang.h (ldlang_nearby_section): Declare.
	(lang_output_section_get): New static inline.
	* ldmain.c (link_callbacks): Add ldlang_nearby_section.
2025-12-26 10:54:53 +10:30
Indu Bhagat
7ca80bc6da libsframe: refactor sframe_decoder_add_funcdesc for internal use
sframe_encoder_add_funcdesc () was added for SFRAME_VERSION_1.  This has
since been obsoleted by introduction of SFRAME_VERSION_2 and its
corresponding sframe_decoder_add_funcdesc_v2 API.

Refactor the functionality into an internal-only API:
sframe_encoder_add_funcdesc_internal (). Ensure it returns the error
code for the caller to take necessary action or pass to user.

Keep only two args for sframe_encoder_add_funcdesc: function size and
function start addr.  This simple barebone API will be used in a
subsequent commit to adjust the link-time behaviour of SFrame sections.

Reviewed-by: Jens Remus <jremus@linux.ibm.com>

include/
	* sframe-api.h (sframe_encoder_add_funcdesc): Remove args to
	create the barebone API.
libsframe/
	* sframe.c (sframe_encoder_add_funcdesc): Refactor out into
	sframe_encoder_add_funcdesc_internal.  Change args.
	(sframe_encoder_add_funcdesc_v2): Use the new internal API.
	* libsframe.ver: Move sframe_encoder_add_funcdesc to 2.1 node.
2025-12-24 00:51:43 -08:00
Indu Bhagat
610a98f0f8 include: sframe: add SFRAME_V2_ prefixed macro names for FDE
Such a change for readability only.  SFrame V1 is now obsolete, and with
newer versions like V3 or later, its likely better to have macro names
reflect the applicable version.

Add new macro names for FDE information related macros.

Reviewed-by: Jens Remus <jremus@linux.ibm.com>

include/
	* sframe.h (SFRAME_V2_FUNC_INFO): New definition.
	(SFRAME_V2_FUNC_FRE_TYPE): Likewise.
	(SFRAME_V2_FUNC_PC_TYPE): Likewise.
	(SFRAME_V2_FUNC_PAUTH_KEY): Likewise.
	(SFRAME_V2_FUNC_INFO_UPDATE_PAUTH_KEY): Likewise.
2025-12-24 00:41:18 -08:00
Indu Bhagat
f5d28014be include: gas: bfd: sframe: clean the abstraction
... between specification and implmentation.

Move to definition in the implementation (gas/ld/libsframe) and not the
specification (include/sframe.h).  At this time the implementation in
gas and ld generate the sections in the latest SFrame version only.

Reviewed-by: Jens Remus <jremus@linux.ibm.com>

bfd/
	* elf-sframe.c: Add definition here.
gas/
	* gen-sframe.c: Likewise.
libsframe/
	* sframe.c: Likewise.
include/
	* sframe.h: Remove the definition.
2025-12-23 14:59:59 -08:00
Indu Bhagat
4651bea119 bfd: include: sframe: fix PR ld/32789
Currently, when SFrame sections are emitted after linking the input
SFrame sections, the SFrame FDEs are sorted on start PC.  Doing so for
relocatable links has no effect (SFrame FDEs remain in place), because
the start PC is unrelocated data.  For relocatable links, then, the
emitted SFrame FDEs in the output section remain in the same order as
that in the respective input BFD.

The assembler does not guarantee the emission of SFrame FDEs in the same
order as the placement of the associated .text* sections,
(SFRAME_F_FDE_SORTED is not set in the ET_REL objs generated by GAS).
This means setting SFRAME_F_FDE_SORTED by the linker was wrong when:
  - doing relocatable link, and
  - the input bfds contain multiple .text sections, say .text.hot,
    .text.init, .text.unlikely etc.

For relocatable links, skip sorting the SFrame FDEs.  Do not set
SFRAME_F_FDE_SORTED for relocatable links.

This is achieved by adding an explicit argument (bool sort_fde_p) to the
sframe_encoder_write API.  Move the API from 2.0 to the 2.1 node as this
is an ABI-incompatible change.  Skip bumping the "current" in
libsframe/libtool-version ATM, we will do so closer to release.

When writing of SFrame data for PLT entries, indicate sort_fde_p to
false: these sections are like the other SFrame sections for any other
ET_REL binary.

Add a test in ld/testsuite/ld-sframe/sframe.exp, these tests are run for
all ABIs supported for SFrame.  In this test, for object file generated
for pr32789-1a.c:
  - the emitted SFrame FDEs by GAS are in the order of the .text* in the
    input assembly (i.e., .text.init, .text, .text.exit)
  - the emitted .text* sections by GAS are placed in the following order
    .text, .text.init, .text.exit.
  - GAS does not set SFRAME_F_FDE_SORTED, as expected.

Reviewed-by: Jens Remus <jremus@linux.ibm.com>

bfd/
	PR ld/32789
	* elf-sframe.c (_bfd_elf_write_section_sframe): Skip sorting the
	SFrame FDEs for relocatable links.
	* elf64-s390.c (_bfd_s390_elf_write_sframe_plt): Additional
	argument to sframe_encoder_write.
	* elfxx-x86.c (_bfd_x86_elf_write_sframe_plt): Likewise.
libsframe/
	* libsframe.ver: Move from 2.0 node to 2.1.
	* sframe.c (sframe_encoder_write_sframe): Conditionalize based
	on argument sort_fde_p.
	(sframe_encoder_write): New argument to indicate whether SFrame
	FDEs are to be sorted in output.
include/
	* sframe-api.h (sframe_encoder_write): New argument.
ld/testsuite/
	PR ld/32789
	* ld/testsuite/ld-sframe/sframe.exp: New test.
	* ld/testsuite/ld-sframe/pr32789-1.rd: New test.
	* ld/testsuite/ld-sframe/pr32789-1.sd: New test.
	* ld/testsuite/ld-sframe/pr32789-1a.c: New test.
	* ld/testsuite/ld-sframe/pr32789-1b.c: New test.
	* ld/testsuite/ld-x86-64/sframe-reloc-1.d: Remove
	SFRAME_F_FDE_SORTED.
2025-12-19 23:11:45 -08:00
Lulu Cai
8bea934667 LoongArch: Add disassembly support for ud ui5
ud ui5, also known as amswap.w rd,$r1,rj(rd==rj), is displayed as
"ud ui5" by default during disassembly. Alternatively, the original
instruction can be printed using the objdump -M no-aliases.

To implement this support, a format specifier "ru0:5,ru5:5" for ud is
applied exclusively during disassembly. This specifier indicates that
registers should be printed using their corresponding numeric values,
and when the instruction is identified as ud, only a single parameter
is displayed.

binutils/

        * testsuite/binutils-all/loongarch64/dis-amswap-ud-noaliases.d:
	  New test.
        * testsuite/binutils-all/loongarch64/dis-amswap-ud.d: New test.
        * testsuite/binutils-all/loongarch64/dis-amswap-ud.s: New test.

gas/

        * testsuite/gas/loongarch/macro_ud.d: Update test.

include/

        * opcode/loongarch.h: New macro.

opcodes/

        * loongarch-dis.c (get_loongarch_opcode_by_binfmt): Correct match `ud`.
        (dis_one_arg): Disassemble the `ud` parameter.
        * loongarch-opc.c: Add opcode for "ud" alias.
2025-12-20 10:49:47 +08:00
Srinath Parvathaneni
d0514e7441 aarch64: Add support for new BTI <target> "r"
This patch adds support for new BTI <target> "r" (instruction: bti r),
which is an alias to "bti" (with no target), for both "bti" and "bti r"
the preferred disassembly is "bti r". This "bti r" instruction is by
default available from Armv8-A architecture.

The HINT_OPD_F_NOPRINT macro has become redundant with these changes
and has been removed.
2025-12-15 11:01:49 +00:00
Jan Beulich
9d977686cf bfd/ELF: fold BFD_RELOC_<arch>_RELATIVE
There's no need to have a separate reloc per arch; just like for other
more or less generic ones a single one will (mostly) do. Arm64, C-Sky,
and KVX - sadly - are exceptions.
2025-12-15 11:29:33 +01:00
Jan Beulich
9f47dd41af bfd/ELF: fold BFD_RELOC_<arch>_J{,U}MP_SLOT
There's no need to have a separate reloc per arch; just like for other
more or less generic ones a single one will (mostly) do. Arm64, C-Sky,
and KVX - sadly - are exceptions.
2025-12-15 11:29:19 +01:00
Jan Beulich
846bf17a36 bfd/ELF: fold BFD_RELOC_<arch>_GLOB_DAT
There's no need to have a separate reloc per arch; just like for other
more or less generic ones a single one will (mostly) do. Arm64, C-Sky,
and KVX - sadly - are exceptions.
2025-12-15 11:28:50 +01:00
Jan Beulich
c77b97d2d8 bfd/ELF: fold BFD_RELOC_<arch>_COPY
There's no need to have a separate reloc per arch; just like for other
more or less generic ones a single one will (mostly) do. Arm64, C-Sky,
and KVX - sadly - are exceptions.
2025-12-15 11:28:14 +01:00
Vignesh Balasubramanian
e2b607517e bfd: Add minimal support to handle note that describes xsave layout
This note section is already supported by Linux kernel.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/kernel/fpu/xstate.c?id=ba386777a30b38dabcc7fb8a89ec2869a09915f7

Co-Authored-By: Jini Susan George <jinisusan.george@amd.com>
2025-12-12 14:59:49 +01:00
Richard Ball
4f9b9eaa24 aarch64: Add support for FEAT_LSCP
This patch adds the new instructions from FEAT_LSCP.
These instructions are LDAP, LDAPP and STLP.
2025-12-11 14:10:42 +00:00
mengqinggang
d17b290265 LoongArch: Add linker relaxation for got_pcadd_hi20 and got_pcadd_lo12
.L1:
pcaddu12i $t0, %got_pcadd_hi20(a)     -> pcaddu12i $t0, %pcadd_hi20(a)
ld.w/d $t0, $t0, %got_pcadd_lo12(.L1) -> addi.w/d $t0, $t0, %pcadd_lo12(.L1)
2025-12-10 16:06:48 +08:00
mengqinggang
82f67b063b LoongArch: Add support for tls type transition on LA32
desc -> le
ie -> le
desc -> ie

For desc/ie -> le, need to change the symbol of le_lo12 to the symbol of
[desc|ie]_pcadd_hi20.
2025-12-10 16:06:48 +08:00
mengqinggang
529e366dd9 LoongArch: Add LA32 and LA32R relocations
LA32 and LA32R do not have pcaddu18i.
LA32R does not have pcalau12i.

Add R_LARCH_CALL30 for pcaddu12i + jirl used in LA32 and LA32R.
Add R_LARCH_*_PCADD_HI20 for pcaddu12i used in LA32R.
Add R_LARCH_*_PCADD_LO12 for addi.w/ld.w used in LA32R.
2025-12-10 16:06:47 +08:00
Lulu Cai
9bb91ce42f LoongArch: Add support for the ud macro instruction
In the "ud ui5" macro, the value of ui5 must be in the range 0–31. It
expands to "amswap.w $rd, $r1, $rj", where ui5 specifies the register
number for $rd in the amswap.w instruction, and $rd == $rj.

The test case have been adjusted to no longer report errors for illegal
operands of the amswap.w instruction.

gas/

	* config/tc-loongarch.c (check_this_insn_before_appending): No
	  longer check amswap.w.
	* testsuite/gas/loongarch/illegal-operand.l: Update.
	* testsuite/gas/loongarch/illegal-operand.s: Update.
	* testsuite/gas/loongarch/macro_ud.d: New test.
	* testsuite/gas/loongarch/macro_ud.s: New test.

include/

	* opcode/loongarch.h: Add new macro for amswap.w.

opcodes/

	* loongarch-opc.c: Add macro for ud.
2025-12-09 17:06:26 +08:00
H.J. Lu
c6ba94c86b elf: Add SHT_SUNW_ctf and SHT_SUNW_symnsort
On Solaris 11.4, there is SHT_SUNW_symnsort and no SHT_SUNW_symtabnsort.
SHT_SUNW_symnsort is defined to 0x6fffffec, which is the same as
SHT_SUNW_symtabnsort.  There is also SHT_SUNW_ctf.  Add SHT_SUNW_ctf and
rename SHT_SUNW_symtabnsort to SHT_SUNW_symnsort.  Move SHT_SUNW_phname
after SHT_SUNW_symnsort.

binutils/

	* readelf.c (get_solaris_section_type): Add SHT_SUNW_ctf and
	SHT_SUNW_symnsort.  Move SHT_SUNW_phname after SHT_SUNW_symnsort.
	Remove SHT_SUNW_symtabnsort.

include/

	* elf/common.h (SHT_SUNW_ctf): New.
	(SHT_SUNW_symtabnsort): Renamed to ...
	(SHT_SUNW_symnsort): This.
	(SHT_SUNW_phname): Moved after SHT_SUNW_symnsort.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-12-08 15:19:12 +08:00
Alice Carlotti
7fc6ffb18e aarch64: Improve comment for aarch64_opnd_info.sysreg.flags
This field is used differently during assembly and disassembly.  It
would be nice if we could make this more consistent, but for now just
extend the comment to explain what is going on.
2025-12-04 16:21:55 +00:00
Nick Clifton
40a04cee22 Synchronize the dwarf2.h and dwarf2.def files with their gcc counterparts, bringing the definitions of DW_AT_language_name and DW_AT_language_version. Add code to binutils/dwarf.c to display these attributes. 2025-12-02 11:06:01 +00:00
timurgol007
3241ec3eca RISC-V: Fixed opcodes for some bitmanip instructions
Currently some of the instructions in bitmanip extensions can not be obtained
using DECLARE_INSN macros. I generated them using riscv-opcodes and added to
other opcodes.

Approved-By: Nelson Chu <nelson@rivosinc.com>
2025-11-21 22:33:09 +03:00
Ezra Sitorus
3c3f58814b bfd/ELF: Core file support for AArch64 FPMR
The Floating Point Mode Register is a new register which controls the
behaviour of FP8 instructions. This is handled by the Linux kernel
through a new NT_ARM_FPMR register set.

This patch adds required code to support core file dumps with
NT_ARM_FPMR in them.
2025-11-17 12:47:09 +00:00
Indu Bhagat
b91966e2df libsframe: rename encoder to ectx for readability
Addressing (an old) review comment suggesting this housekeeping item.
Use consistent naming style in libsframe.  sframe_decoder_ctx objects
are named 'dctx', so use 'ectx' for sframe_encoder_ctx objects.

Make necessary changes in all the applicable declarations and definitions.

Reviewed-by: Jens Remus <jremus@linux.ibm.com>
2025-11-09 00:34:27 -08:00
H.J. Lu
2be0f2da21 readelf: Display the base symbol version as empty string
Update readelf to display the base symbol version as

Symbol table for image contains 5 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 0000000000003008     0 OBJECT  GLOBAL DEFAULT   10 bar@@
     2: 0000000000000000     0 OBJECT  GLOBAL DEFAULT  ABS VERS_1
     3: 0000000000003008     0 OBJECT  GLOBAL DEFAULT   10 bar@@VERS_1
     4: 0000000000003000     0 OBJECT  GLOBAL DEFAULT   10 foo@

instead of

Symbol table for image contains 5 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 0000000000003008     0 OBJECT  GLOBAL DEFAULT   10 bar
     2: 0000000000000000     0 OBJECT  GLOBAL DEFAULT  ABS VERS_1
     3: 0000000000003008     0 OBJECT  GLOBAL DEFAULT   10 bar@@VERS_1
     4: 0000000000003000     0 OBJECT  GLOBAL DEFAULT   10 foo

That is bar@@ and foo@ vs bar and foo.

binutils/

	PR binutils/33599
	* readelf.c (process_version_sections): Replace 0x8001 with
	(VERSYM_HIDDEN | VERSYM_BASE).
	(get_symbol_version_string): Likewise.  Return "" for the base
	version.

include/

	PR binutils/33599
	* elf/common.h (VERSYM_BASE): New.

ld/

	PR binutils/33599
	* testsuite/ld-elf/pr33599.d: New file.
	* testsuite/ld-elf/pr33599.map: Likewise.
	* testsuite/ld-elf/pr33599.s: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-11-08 06:39:42 +08:00
Indu Bhagat
dfb31cd02b include: sframe: fix minor typos in sframe_decode
Change argument names (in declaration) to SF_BUF and SF_SIZE (instead of
the current CF_BUF and CF_SIZE respectively).

include/
        * sframe-api.h (sframe_decode): Fix typos.  Use same name as
	used for the definition.
2025-11-04 23:28:43 -08:00
Jan Beulich
caccc182b5 bfd: replace _bfd_merge_sections() hook with simple boolean
There's no need for a hook; what needs doing is uniform, the question is
only whether to perform any merging (i.e. whether other parts of a backend
are capable of dealing with the effects).

Where _bfd_nolink_bfd_merge_sections() was used, false is hardcoded. For
ELF no real target override is permitted; true is hardcoded except for the
cases where bfd_generic_merge_sections() was used as the hook function
before.
2025-10-24 15:11:39 +02:00
Jan Beulich
0bdfbd3710 bfd: move merge_info from ELF to general link hash table
This is in prepration of supporting section merging also when the output
isn't ELF (or not of the same class).
2025-10-24 15:08:33 +02:00
Indu Bhagat
8ac9c2cda9 include: sframe: rename sframe_func_desc_entry to use an explicit v2
As SFrame format evolves, this will be useful to refer to v2 on-disk
layout directly as the format evolves.

Reviewed-by: Jens Remus <jremus@linux.ibm.com>

include/
        * sframe.h (struct sframe_func_desc_entry): Rename to tag v2.
2025-10-19 21:03:27 -07:00
Jens Remus
5079bf8959 gas: sframe: Represent .cfi_undefined RA as FRE without offsets
In DWARF CFI an "undefined" register rule for the return address (RA)
register indicates that there is no return address and the stack trace
is complete.

Represent DW_CFA_undefined as SFrame FRE without any offsets, so that a
stack tracer implementation can use this as indication that an outermost
frame has been reached and the stack trace is complete.

This representation is backward compatible, as existing stack tracers
should already deal with the case, that an SFrame FRE a so far invalid
offset count of zero and stop the trace.

include/
	* sframe.h (SFRAME_V2_FRE_RA_UNDEFINED_P): New macro to test
	FRE info word for RA undefined (FRE without any offsets).

binutils/
	* NEWS: Mention SFrame can represent an undefined RA as FRE
	without	any offsets.

gas/
	* gen-sframe.h (struct sframe_row_entry): Add ra_undefined_p
	flag.
	* gen-sframe.c (sframe_row_entry_new): Initialize ra_undefined_p
	flag to not set.
	(sframe_row_entry_initialize): Treat ra_undefined_p flag as
	sticky.
	(sframe_fre_set_ra_track): Reset ra_undefined_p flag.
	(sframe_xlate_do_restore): Reset ra_undefined_p flag to saved
	state.
	(sframe_xlate_do_same_value): Reset ra_undefined_p flag.
	(sframe_xlate_do_cfi_undefined): For RA set ra_undefined_p flag.
	(output_sframe_row_entry): Represent RA undefined as SFrame FRE
	without any offsets and FRE info word fields zeroed.
	* NEWS: Mention assembler represents .cfi_undefined RA in SFrame
	as FRE without any offsets.

libsframe/
	* doc/sframe-spec.texi (Changes from Version 1 to Version 2):
	Mention that a SFrame FRE without any offsets flag indicates an
	outermost frame with an undefined RA.
	(fre_offset_count): Document that a FRE offset count of zero
	indicates an outermost frame with an undefined RA.
	* sframe.c (sframe_get_fre_ra_undefined_p): Use macro
	SFRAME_V2_FRE_RA_UNDEFINED_P.
	(sframe_fre_get_fp_offset, sframe_fre_get_ra_offset): Do not
	return fixed FP/RA offset if RA undefined.
	* sframe-dump.c (dump_sframe_func_with_fres): Show FRE without
	any offsets as "RA undefined".

gas/testsuite/
	* gas/cfi-sframe/cfi-sframe.exp: Run tests for .cfi_undefined RA
	on AArch64, s390x, and x86-64.
	* gas/cfi-sframe/cfi-sframe-aarch64-ra-undefined-1.d: Add test
	for .cfi_undefined RA on AArch64.
	* gas/cfi-sframe/cfi-sframe-aarch64-ra-undefined-1.s: Likewise.
	* as/cfi-sframe/cfi-sframe-s390x-ra-undefined-1.d: Add test
	for .cfi_undefined RA on s390x.
	* gas/cfi-sframe/cfi-sframe-s390x-ra-undefined-1.s: Likewise.
	* gas/cfi-sframe/cfi-sframe-x86_64-ra-undefined-1.d: Add test
	for .cfi_undefined RA on x86-64.
	* gas/cfi-sframe/cfi-sframe-x86_64-ra-undefined-1.s: Likewise.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
2025-10-15 17:45:48 +02:00
Jens Remus
6ca8915c61 include: libsframe: Add API to get RA undefined
SFrame FREs without any offsets will later be used to represent an
undefined return address (RA) in SFrame.  This API can then be used,
for instance by libsframe when dumping SFrame stack trace information
(e.g. in objdump and readelf), to test for RA undefined.  Other users
of libsframe need the same capability.

include/
	* sframe-api.h (sframe_fre_get_ra_undefined_p): New declaration.

libsframe/
	* libsframe.ver (sframe_fre_get_ra_undefined_p): List new API.
	* sframe.c (sframe_fre_get_ra_undefined_p): New definition.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
2025-10-15 17:45:48 +02:00
Alice Carlotti
552ddbabb5 aarch64: Add support for FEAT_SSVE_BITPERM 2025-10-10 01:33:15 +01:00
Alice Carlotti
8a5fe4ee71 aarch64: Add support for FEAT_SSVE_FEXPA 2025-10-10 01:33:14 +01:00
Alice Carlotti
64aae286f6 aarch64: Add support for FEAT_SME_MOP4 2025-10-10 01:29:19 +01:00
Alice Carlotti
0787e01a25 aarch64: Add support for FEAT_SME_TMOP 2025-10-10 01:29:18 +01:00
Alice Carlotti
3b957f92de aarch64: Remove incorrect disassembly constraint
A check in print_insn_aarch64_word asserted that part of the encoding
space couldn't contain any valid encodings, and then returned ERR_NYI
("Not Yet Implemented", perhaps?) for these values.  However, some of
the new FEAT_MOP4 instructions will trigger the assert.  The check seems
to be outdated, and is clearly no longer valid, so it can just be
deleted.

Additionally, there are no other assignments of ERR_NYI, so delete all
remaining references to this error type.
2025-10-10 01:14:07 +01:00
Andre Vieira
94861aa1c0 aarch64, gas: Relax Armv9.6-A mandatory feature set
Remove FPRCVT and SVE2p2 from the set of mandatory features for Armv9.6-A.
2025-10-08 11:30:56 +01:00
Saurabh Jha
a149def232 gas: aarch64: Add instructions for GICv5
Add new instructions from the Generic Interrupt Controller, GICv5,
extension. These instructions are aliases to system instructions and are
the following:

* gic <operation>, <reg>
* gicr <reg>, <operation>
* gsb <operation>
2025-10-06 17:56:26 +00:00
Saurabh Jha
c3954fc3a1 gas: aarch64: Add flag for GICv5
Generic Interrupt Controller v5, GICv5, adds new system registers
and system instructions. These are enabled with the +gcie flag, where
gcie stands for GICv5 (Generic Interrupt Controller) CPU Interrupt
Extension.
2025-10-06 17:56:26 +00:00