Two tests were failing on QNX because they hard-code the syscall
function name for raising a signal and the hard-coded function name is
wrong for QNX OS.
Ran the relevant test code through clang-format and fixed additional
issues with Aarch64 scalable vector extension (SVE) on QNX.
Include <cet.h> when Intel Control-flow Enforcement Technology (CET)
is enabled. Both GCC and Clang provide <cet.h> which should be included
in assembly codes with .S suffix when -fcf-protection is used. It will
define _CET_ENDBR (endbr64) and the .note.gnu.property note section.
Fixes#644.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
endian.h on musl/mips can't be included in __ASSEMBLER__ mode,
so use the __BYTE_ORDER__ symbol instead.
Signed-off-by: Ross Burton <ross.burton@arm.com>
All segemnets in an ELF file are not guaranteed to have the same base
virtual address.
Adjusted the GNU hash table address based on the actual file offset of
the segment containing ir rather than the offset of the program table
header itself.
C89: 4.10.3.2 The free function.
The free function causes the space pointed to by ptr to be deallocated, that is, made available for further allocation. If ptr is a null pointer, no action occurs.
This test randomly fails on arm because depending on the place where the
signal is received, the backtrace can involve glibc functions such as
"__read", which do not have .EXIDX instructions.
This reverts commit a4014f3377. The
implementation of the pre-linking support is wrong. It assumes that only
pre-linked libraries will have the virtual address of the LOAD ELF section set
to non-zero.
On arm-linux-gnueabi, without pre-linking, we have:
LOAD 0x000000 0x00010000 0x00010000 0x267fc 0x267fc R E 0x10000
Which means that load_offset is set to 0x10000 and incorrectly substracted
from ip - ip_base. It also seems that pre-linking support is vastly
deprecated.
Reverting that one fixes .debug_frame based unwinding of arm-linux-gnueabi.
On an aarch64 system tdep_trace was returning `-UNW_ESTOPUNWIND`
a lot while profiling a Qt 6 / QML application with heaptrack.
I have not understood why exactly, but note that QML injects
JIT frames and more, which potentially lead to such failures?
Without the patch here, unwinding became excessively slow because
the `slow_backtrace` fallback continuously called `tdep_get_elf_image`
which is extremely slow for applications with many entries in their
`/proc/<pid>/maps` file.
With the patch here applied, I could use heaptrack again with
the expected bearable overhead. The backtraces still look fine,
so for me this patch here looks like a good workaround.
The function in this source file was never used anywhere
(`unw_tdep_getcontext()` is a macro generating inline asm for arm). It
also fails to build from source for any OS other than Linux and FreeBSD.
Removed the file and checks for the symbol.
When using .EXIDX based unwinding, some functions are flagged with the
.cantunwind directive. That causes unw_step to stop unwinding and to return
-UNW_ESTOPUNWIND.
Do not consider that as an error in the tests.
Change the autoconf rules so that
- docs are always built and installed unless
`--enable-documentation=no` is passed
- the documentation-build tools latex2man and pdflatex are
autodetected and, if not found, just issue a warning at configure
time and doc builds do nothing. Since built man pages are under
source control this should not have a dire effect.
Fixes#822
Fix the following warning by making sure that r1 is the first register in the
register list. It means that r0 has to be saved beforehand outside of the
stmia instruction.
{standard input}:333: Warning: if writeback register is in list, it must be
the lowest reg in the list
A (new) unit test was failing at -O0 because it referenced functions
private to the implementation and not exposed through the shared library
ABI. To fix this, the shared library(ies) are now built using a
convenience library, which can also be directly linked to unit tests so
the private functions can be exposed.
This is the first step to greatly expanded unit testing (ie. testing at
unit seams instead of integration testing only at the public API level).
Only one single unit test for the AARCH64 architecture is fully enabled
at this point.
Fixes#841
- Support for pac-ret on aarch64 existed partially before inside the
DWARF parser but this needed applying elsewhere in the code
- Move PAC mask stripping functions to be accessible from more places
and rename to `tdep_ptrauth_insn_mask` for consistency with the
corresponding accessor function
- Apply PAC stripping in appropriate places
- Add ptrace accessor function implementation for `ptrauth_insn_mask`
- make check is now passing on aarch64 when compiled with
`CFLAGS="-mbranch-protection=standard"`
- There is an extra function in the ptrace library ABI now
(`_UPT_ptrauth_insn_mask`) but there are also some other ABI changes
reported by libabigail / `make abi-check` that are unrelated to this
change, so I am not sure whether to proceed with updating the .abi
files or not
Closes#647
Signed-off-by: Lexi Kane <lexi.kane@arm.com>