Commit Graph

117737 Commits

Author SHA1 Message Date
Jens Remus
ed489bf157 s390: Add arch15 Concurrent-Functions Facility insns
opcodes/
	* s390-opc.txt: Add arch15 Concurrent-Functions Facility
	instructions.
	* s390-opc.c (INSTR_SSF_RRDRD2, MASK_SSF_RRDRD2): New SSF
	instruction format variant.

gas/testsuite/
	* gas/s390/zarch-arch15.d: Tests for arch15 Concurrent-Functions
	Facility instructions.
	* gas/s390/zarch-arch15.s: Likewise.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
(cherry picked from commit 76445f36a2)
2024-11-18 11:08:46 +01:00
Jens Remus
64e8e16a90 s390: Add arch15 instruction names
opcodes/
	* s390-opc.txt: Add arch15 instruction names.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
(cherry picked from commit b0588b2173)
2024-11-18 11:08:42 +01:00
Lulu Cai
09ba78f051 LoongArch: ld:Report an error when seeing an unrecognized relocation
If we generate an object file using an assembler with the new
relocations added, and then linking those files with an older
linker, the link will still complete and the linked file will
be generated.
In this case we should report an error instead of continuing
the linking process.

(cherry picked from commit 5966e2eb3f)
2024-11-11 11:55:37 +08:00
Andreas Krebbel
00abcf3993 s390: Add arch15 instructions
opcodes/
	* s390-mkopc.c (main) Accept arch15 as CPU string.
	* s390-opc.txt: Add arch15 instructions.

include/
	* opcode/s390.h (enum s390_opcode_cpu_val): Add
	S390_OPCODE_ARCH15.

gas/
	* config/tc-s390.c (s390_parse_cpu): New entry for arch15.
	* doc/c-s390.texi: Document arch15 march option.
	* doc/as.texi: Likewise.
	* testsuite/gas/s390/s390.exp: Run the arch15 related tests.
	* testsuite/gas/s390/zarch-arch15.d: Tests for arch15
	instructions.
	* testsuite/gas/s390/zarch-arch15.s: Likewise.

Signed-off-by: Andreas Krebbel <krebbel@linux.ibm.com>
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
(cherry picked from commit a98a6fa2d8)
2024-10-24 11:17:12 +02:00
Jens Remus
caf72067a7 s390: Relax risbg[n]z, risb{h|l}gz, {rns|ros|rxs}bgt operand constraints
This leverages commit ("s390: Simplify (dis)assembly of insn operands
with const bits") to relax the operand constraints of the immediate
operand that contains the constant Z- or T-bit of the following extended
mnemonics:
risbgz, risbgnz, risbhgz, risblgz, rnsbgt, rosbgt, rxsbgt

Previously those instructions were the only ones where the assembler
on s390 restricted the specification of the subject I3/I4 operand values
exactly according to their specification to an unsigned 6- or 5-bit
unsigned integer. For any other instructions the assembler allows to
specify any operand value allowed by the instruction format, regardless
of whether the instruction specification is more restrictive.

Allow to specify the subject I3/I4 operand as unsigned 8-bit integer
with the constant operand bits being ORed during assembly.
Relax the instructions subject significant operand bit masks to only
consider the Z/T-bit as significant, so that the instructions get
disassembled as their *z or *t flavor regardless of whether any reserved
bits are set in addition to the Z/T-bit.
Adapt the rnsbg, rosbg, and rxsbg test cases not to inadvertently set
the T-bit in operand I3, as they otherwise get disassembled as their
rnsbgt, rosbgt, and rxsbgt counterpart.

This aligns GNU Assembler to LLVM Assembler.

opcodes/
	* s390-opc.c (U6_18, U5_27, U6_26): Remove.
	(INSTR_RIE_RRUUU2, INSTR_RIE_RRUUU3, INSTR_RIE_RRUUU4): Define
	as INSTR_RIE_RRUUU while retaining insn fmt mask.
	(MASK_RIE_RRUUU2, MASK_RIE_RRUUU3, MASK_RIE_RRUUU4): Treat only
	Z/T-bit of I3/I4 operand as significant.

gas/testsuite/
	* gas/s390/zarch-z10.s (rnsbg, rosbg, rxsbg): Do not set T-bit.

Reported-by: Dominik Steenken <dost@de.ibm.com>
Suggested-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
(cherry picked from commit b8b60e2d0c)
2024-10-24 11:17:03 +02:00
Jens Remus
543a22c7ee s390: Simplify (dis)assembly of insn operands with const bits
Simplify assembly and disassembly of extended mnemonics with operands
with constant ORed bits:
Their instruction template already contains the respective constant
operand bits, as they are significant to distinguish the extended from
their base mnemonic. Operands are ORed into the instruction template.
Therefore it is not necessary to OR the constant bits into the operand
value during assembly in s390_insert_operand.
Additionally the constant operand bits from the instruction template
can be used to mask them from the operand value during disassembly in
s390_print_insn_with_opcode. For now do so for non-length unsigned
integer operands only.

The separate instruction formats need to be retained, as their masks
differ, which is relevant during disassembly to distinguish the base
and extended mnemonics from each other.

This affects the following extended mnemonics:
- vfaebs, vfaehs, vfaefs
- vfaezb, vfaezh, vfaezf
- vfaezbs, vfaezhs, vfaezfs
- vstrcbs, vstrchs, vstrcfs
- vstrczb, vstrczh, vstrczf
- vstrczbs, vstrczhs, vstrczfs
- wcefb, wcdgb
- wcelfb, wcdlgb
- wcfeb, wcgdb
- wclfeb, wclgdb
- wfisb, wfidb, wfixb
- wledb, wflrd, wflrx

include/
	* opcode/s390.h (S390_OPERAND_OR1, S390_OPERAND_OR2,
	S390_OPERAND_OR8): Remove.

opcodes/
	* s390-opc.c (U4_OR1_24, U4_OR2_24, U4_OR8_28): Remove.
	(INSTR_VRR_VVV0U1, INSTR_VRR_VVV0U2, INSTR_VRR_VVV0U3): Define
	as INSTR_VRR_VVV0U0 while retaining respective insn fmt mask.
	(INSTR_VRR_VV0UU8): Define as INSTR_VRR_VV0UU while retaining
	respective insn fmt mask.
	(INSTR_VRR_VVVU0VB1, INSTR_VRR_VVVU0VB2, INSTR_VRR_VVVU0VB3):
	Define as INSTR_VRR_VVVU0VB while retaining respective insn fmt
	mask.
	* s390-dis.c (s390_print_insn_with_opcode): Mask constant
	operand bits set in insn template of non-length unsigned
	integer operands.

gas/
	* config/tc-s390.c (s390_insert_operand): Do not OR constant
	operand value bits.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
(cherry picked from commit a3f1e7c56a)
2024-10-24 11:16:53 +02:00
Jens Remus
7c94c87d46 s390: Align opcodes to lower-case
opcodes/
	* s390-opc.txt (rdp): Change opcode to lower-case.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
(cherry picked from commit 1afe02759f)
2024-10-24 11:16:41 +02:00
Jens Remus
fffb4fae82 s390: Flag conditional branch relative insns as condjump
Flag conditional branch relative (extended) mnemonics clij* and clgij*
as "condjump" for jump visualization in disassembly. They were missed
to be flagged as such in commit c5306fed7d ("s390: Support for jump
visualization in disassembly").

opcodes/
	* s390-opc.txt: Flag conditional branch relative instructions
	clij* and clgij* as condjump for jump visualization in
	disassembly.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Acked-by: Nick Clifton <nickc@redhat.com>
(cherry picked from commit 676b98078f)
2024-10-24 11:16:27 +02:00
Jens Remus
2d238ecbe5 s390: Use proper string lengths when parsing opcode table flags
opcodes/
	* s390-mkopc.c: Use proper string lengths when parsing opcode
	table flags.

Fixes: c5306fed7d ("s390: Support for jump visualization in disassembly")
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Reviewed-by: Andreas Krebbel <krebbel@linux.ibm.com>
(cherry picked from commit 996097d5ca)
2024-10-24 11:16:18 +02:00
Jens Remus
10d0dd2ba2 s390: Whitespace fixes in conditional branch flavor descriptions
opcodes/
	* s390-mkopc.c: Whitespace fixes in conditional branch flavor
	descriptions.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Reviewed-by: Andreas Krebbel <krebbel@linux.ibm.com>
(cherry picked from commit d9d4fc898d)
2024-10-24 11:16:08 +02:00
Xin Wang
10a143e273 LoongArch: Add elfNN_loongarch_mkobject to initialize LoongArch tdata
LoongArch: Add elfNN_loongarch_mkobject to initialize LoongArch tdata.

(cherry picked from commit 28489a70d4)
2024-10-24 10:47:05 +08:00
Lulu Cai
9055fbe5ff LoongArch: The symbol got type can only be obtained after initialization
When scanning relocations and determining whether TLS type transition is
possible, it will try to obtain the symbol got type. If the symbol got
type record has not yet been allocated space and initialized, it will
cause ld to crash. So when uninitialized, the symbol is set to GOT_UNKNOWN.

(cherry picked from commit b221bff7c7)
2024-10-24 10:06:20 +08:00
Nick Alcock
8a6764d35e
libctf: fix ref leak of names of newly-inserted non-root-visible types
A bug in ctf_dtd_delete led to refs in the string table to the
names of non-root-visible types not being removed when the DTD
was.  This seems harmless, but actually it would lead to a write
down a pointer into freed memory if such a type was ctf_rollback()ed
over and then the dict was serialized (updating all the refs as the
strtab was serialized in turn).

Bug introduced in commit fe4c2d5563
("libctf: create: non-root-visible types should not appear in name tables")
which is included in binutils 2.35.

libctf/
	* ctf-create.c (ctf_dtd_delete): Remove refs for all types
	with names, not just root-visible ones.
2024-08-01 15:46:03 +01:00
H.J. Lu
d9ddfab9be
ld: Move foo before delete in dl5.cc
* testsuite/ld-elf/dl5.cc (main): Move foo before delete.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 2539602136)
2024-07-25 23:40:06 +01:00
H.J. Lu
3e92ae5088
ld: Avoid folding new and delete pairs
GCC 15 may fold new and delete pairs, like

  A *bb = new A[10];
  delete [] bb;
  bb = new (std::nothrow) A [10];
  delete [] bb;

as shown in

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115712

Avoid folding new and delete pairs by adding a function call between new
and delete.

	* testsuite/ld-elf/dl5.cc: Include "dl5.h".
	(A): Removed.
	Call foo between new and delete.
	* testsuite/ld-elf/dl5.h: New file.
	* testsuite/ld-elf/new.cc: Include "dl5.h".
	(foo): New function.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit adf584eb92)
2024-07-25 23:40:05 +01:00
GDB Administrator
e7cd38b6cd Automatic date update in version.in 2024-07-23 00:01:19 +00:00
GDB Administrator
ee3902864d Automatic date update in version.in 2024-07-22 00:00:43 +00:00
GDB Administrator
595d15a876 Automatic date update in version.in 2024-07-21 00:01:22 +00:00
GDB Administrator
63240fa389 Automatic date update in version.in 2024-07-20 00:00:47 +00:00
GDB Administrator
7ed8c42121 Automatic date update in version.in 2024-07-19 00:01:18 +00:00
GDB Administrator
6a68cd2f30 Automatic date update in version.in 2024-07-18 00:01:32 +00:00
GDB Administrator
e343b51459 Automatic date update in version.in 2024-07-17 00:01:22 +00:00
GDB Administrator
71ef12cbf1 Automatic date update in version.in 2024-07-16 00:01:06 +00:00
GDB Administrator
8678e3decb Automatic date update in version.in 2024-07-15 00:00:50 +00:00
H.J. Lu
29ae8b8ea7
x86-64: Skip -z mark-plt tests on MUSL
Skip -z mark-plt tests, which are specific to glibc, on MUSL.

	PR ld/31970
	* ld/testsuite/ld-x86-64/x86-64.exp: Skip -z mark-plt tests on
	MUSL.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit aa047105e0)
2024-07-14 16:42:29 +01:00
John David Anglin
92cc764e58 hppa: Fix handling of relocations that apply to data
Commit d125f96753 introduced a bug
in handling relocations for data.  The R_PARISC_DIR32 relocation
operates on 32-bit data and not instructions.  The HOWTO table
needs to be used to determine the format of relocations that apply
to data.  The R_PARISC_SEGBASE relocation is another special case
as it only changes segment base.

This was noticed in Debian cmor package build.

2024-07-14  John David Anglin  <danglin@gcc.gnu.org>

bfd/ChangeLog:

	* elf32-hppa.c (final_link_relocate): Use HOWTO table to
	determine reload format for relocations that apply to data.
2024-07-14 07:25:17 -04:00
GDB Administrator
fbfdb7bbec Automatic date update in version.in 2024-07-14 00:01:01 +00:00
GDB Administrator
86c5bfcc72 Automatic date update in version.in 2024-07-13 00:01:22 +00:00
GDB Administrator
b2a84f1ea5 Automatic date update in version.in 2024-07-12 00:01:55 +00:00
GDB Administrator
31f696f33c Automatic date update in version.in 2024-07-11 00:00:42 +00:00
GDB Administrator
1bc11d6238 Automatic date update in version.in 2024-07-10 00:02:23 +00:00
H.J. Lu
c439c1e1f5 elf: Add glibc version dependency only if needed
There is no need to add a needed glibc version if the glibc base version
includes the needed glibc version.

	PR ld/31966
	* elflink.c (elf_link_add_glibc_verneed): Add glibc_minor_base.
	Skip if the glibc base version includes the needed glibc version.
	(_bfd_elf_link_add_glibc_version_dependency): Initialize
	glibc_minor_base to INT_MAX and pass it to
	elf_link_add_glibc_verneed.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 7757f66fdb)
2024-07-09 14:38:15 -07:00
GDB Administrator
67cfd78a01 Automatic date update in version.in 2024-07-09 00:01:30 +00:00
GDB Administrator
5678bf2f89 Automatic date update in version.in 2024-07-08 00:00:45 +00:00
GDB Administrator
31be279bac Automatic date update in version.in 2024-07-07 00:00:36 +00:00
GDB Administrator
f9835bd581 Automatic date update in version.in 2024-07-06 00:00:46 +00:00
GDB Administrator
25f45815bb Automatic date update in version.in 2024-07-05 00:01:28 +00:00
GDB Administrator
a4dc8b3836 Automatic date update in version.in 2024-07-04 00:02:00 +00:00
GDB Administrator
e924470a4e Automatic date update in version.in 2024-07-03 00:01:57 +00:00
GDB Administrator
db0bd35f03 Automatic date update in version.in 2024-07-02 00:01:45 +00:00
GDB Administrator
7973187846 Automatic date update in version.in 2024-07-01 00:02:02 +00:00
GDB Administrator
92da6369e9 Automatic date update in version.in 2024-06-30 00:02:34 +00:00
Sam James
68ae8e2a84
ld: pass -g for ld-elf tests
The "DWARF parse during linker error" and "Build warn libbar.so" tests
require debug information.

configure defaults to "-O2 -g" but if overriding *FLAGS when building
tests, this might be lost. Explicitly pass -g given these tests require
it.

Originally reported downstream in Gentoo at https://bugs.gentoo.org/934149.

ld/
	* testsuite/ld-elf/dwarf.exp: Pass -g for "DWARF parse during linker error".
	* testsuite/ld-elf/shared.exp: Ditto for "Build warn libbar.so".

(cherry picked from commit 17c78a2349)
2024-06-29 17:19:39 +01:00
GDB Administrator
1e285d4f04 Automatic date update in version.in 2024-06-29 00:02:50 +00:00
GDB Administrator
d7721907cf Automatic date update in version.in 2024-06-28 00:01:01 +00:00
GDB Administrator
2462485647 Automatic date update in version.in 2024-06-27 00:02:01 +00:00
GDB Administrator
a491e502e6 Automatic date update in version.in 2024-06-26 00:02:30 +00:00
GDB Administrator
c1efe2d814 Automatic date update in version.in 2024-06-25 00:01:31 +00:00
GDB Administrator
54b3291e97 Automatic date update in version.in 2024-06-24 00:01:17 +00:00
Andrew Carlotti
a1e3cb45c6 aarch64: Enable +cssc for armv8.9-a
FEAT_CSSC is mandatory in the architecture from Armv8.9.
2024-06-23 14:00:34 +01:00