Many FEAT_SVE2p1 instructions need to be enabled by either of two
different features (one for streaming mode, and one for non-streaming
mode). This patch adds correct gating conditions for these
instructions.
There were also a few sve2p1 instructions missing altogether, so add
those as well.
The testsuite is modified to check for all alternative enablement
conditions. In many cases this is done by adding an alternative
assembler commands to existing test files. For some SME/SME2 tests,
only some of the instructions are enabled by +sve2p1, so these are
copied into a separate test. For original SVE2p1 tests, the non-SME2p1
instructions have been moved to a separate test file.
There are also new tests for the newly added instructions. These
include a couple of fixme comments relating to bad error reporting,
which should be investigated later.
This has been broken since commit 8f95b6e449 in 2010, and apparently
nobody has noticed. How we write archive headers depends on the
archive, not the contents.
* libbfd-in.h (_bfd_write_ar_hdr): Correct.
* libbfd.h: Regenerate.
(cherry picked from commit c232d080c4)
Change the mmap support added with commit 9ba56acee5 to always mmap
memory with PROT_READ | PROT_WRITE. Prior to that commit most file
contents were read into a buffer allocated with bfd_alloc or
bfd_malloc and thus the memory was read/write. Even after that commit
any section contents with relocations must be read/write to apply the
relocs. Making them all read/write is not a major change, and it
should not introduce any measurable linker slowdown for contents that
are not modified. More importantly, it removes a BFD behaviour
difference that only triggers when large files are involved.
PR 32266
PR 32109
* libbfd.c (bfd_mmap_local): Remove prot param. Always mmap
with PROT_READ | PROT_WRITE. Adjust all calls.
(_bfd_mmap_temporary): Rename from _bfd_mmap_readonly_temporary.
(_bfd_munmap_temporary): Rename from _bfd_munmap_readonly_temporary.
_bfd_mmap_persistent): Rename from _bfd_mmap_readonly_persistent.
(_bfd_generic_get_section_contents): Use PROT_READ | PROT_WRITE
regardless of relocs.
* libbfd-in.h: Update decls to suit. Make non-USE_MMAP variants
static inline functions.
* elflink.c: Update all uses of _bfd_mmap functions.
* elf.c: Likewise.
(bfd_elf_get_str_section): Revert commit 656f8fbaae.
* libbfd.h: Regenerate.
(cherry picked from commit 76eab8f47a)
Part of commit a104f0a3e6 ("LoongArch: Add more relaxation support for
call36") in master. This part is needed for 2.43 branch to fix a link
failure of QtWebEngine-6.8.1, which can be demonstrated with a reduced
test case (with -shared):
.text
.zero 1 << 27 # pretending we have a lot of code in .text
.globl f # preemptible, thus must be called via PLT
f:
move $a0, $r0
ret
g:
pcaddu18i $t0, %call36(f)
jr $t0
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
If code compiled with -fPIC -mtls-dialect=desc is linked into a PDE or
PIE, and the code refers to external DSO symbols, we can produce broken
link unit as check_relocs expects DESC => IE transition to happen and
emits a TLS IE entry in the GOT, but a too early "continue" in
relax_section actually jumps over the DESC => IE transition so the code
sequence is unchanged and still expecting a TLS descriptor (instead of
an IE entry) in the GOT.
The bug is already fixed in master branch by commit 5c3d09c185
("LoongArch: Optimize the relaxation process") so this fix is only
needed for the 2.43 branch.
Reported-by: Icenowy Zheng <uwu@icenowy.me>
Closes: https://gcc.gnu.org/PR118114
Tested-by: Icenowy Zheng <uwu@icenowy.me>
Signed-off-by: Xi Ruoyao <xry111@xry111.site>