gcc/libsanitizer
YunQiang Su 557dbbac8e Sanitizer/MIPS: Use $t9 for preemptible function call
Currently, almost all of the shared libraries of MIPS, rely on $t9
to get the address of current function, instead of PCREL instructions,
even on MIPSr6. So we have to set $t9 properly.

To get the address of preemptible function, we need the help of GOT.
MIPS/O32 has .cpload, which can help to generate 3 instructions to get GOT.
For __mips64, we can get GOT by:

lui $t8, %hi(%neg(%gp_rel(SANITIZER_STRINGIFY(TRAMPOLINE(func)))))
daddu $t8, $t8, $t9
daddiu $t8, $t8, %hi(%neg(%gp_rel(SANITIZER_STRINGIFY(TRAMPOLINE(func)))))

And then get the address of __interceptor_func, and jump to it

ld $t9, %got_disp(_interceptor" SANITIZER_STRINGIFY(func) ")($t8)
jr $t9

Upstream-Commit: 0a64367a72f1634321f5051221f05f2f364bd882

libsanitizer

	* interception/interception.h (substitution_##func_name):
	Use macro C_ASM_TAIL_CALL.
	* sanitizer_common/sanitizer_asm.h: Define C_ASM_TAIL_CALL
	for MIPS with help of t9.
2024-01-17 17:03:08 +08:00
..
asan libsanitizer: Check assembler support for symbol assignment [PR112563] 2023-11-28 14:54:34 +01:00
builtins libsanitizer: merge from upstream (3185e47b5a8444e9fd). 2023-04-26 15:51:56 +02:00
hwasan libsanitizer: Check assembler support for symbol assignment [PR112563] 2023-11-28 14:54:34 +01:00
include libsanitizer: merge from upstream (c425db2eb558c263) 2023-11-15 12:45:58 +01:00
interception Sanitizer/MIPS: Use $t9 for preemptible function call 2024-01-17 17:03:08 +08:00
libbacktrace libsanitizer: Check assembler support for symbol assignment [PR112563] 2023-11-28 14:54:34 +01:00
lsan libsanitizer: Check assembler support for symbol assignment [PR112563] 2023-11-28 14:54:34 +01:00
sanitizer_common Sanitizer/MIPS: Use $t9 for preemptible function call 2024-01-17 17:03:08 +08:00
tsan libsanitizer: Check assembler support for symbol assignment [PR112563] 2023-11-28 14:54:34 +01:00
ubsan libsanitizer: Check assembler support for symbol assignment [PR112563] 2023-11-28 14:54:34 +01:00
acinclude.m4
aclocal.m4 make -Werror optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer 2022-02-03 16:10:18 +01:00
ChangeLog Daily bump. 2024-01-03 00:17:41 +00:00
config.h.in Update build system: include new files and run autoheader, autoconf, automake 2018-10-31 11:15:57 +00:00
configure libsanitizer: Check assembler support for symbol assignment [PR112563] 2023-11-28 14:54:34 +01:00
configure.ac libsanitizer: Check assembler support for symbol assignment [PR112563] 2023-11-28 14:54:34 +01:00
configure.tgt libsanitizer: Enable LSan and TSan for riscv64 2024-01-02 18:52:30 +01:00
HOWTO_MERGE Remove references to SVN in libsanitizer. 2020-05-29 11:50:54 +02:00
libsanitizer.spec.in libsanitizer: Tie the hwasan library into our build system 2020-11-25 16:35:33 +00:00
LICENSE.TXT
LOCAL_PATCHES libsanitizer: Update LOCAL_PATCHES 2023-11-28 15:00:31 +01:00
Makefile.am Fix PR 62157: disclean in libsanitizer not working 2021-11-28 22:40:36 +00:00
Makefile.in libsanitizer: Check assembler support for symbol assignment [PR112563] 2023-11-28 14:54:34 +01:00
MERGE libsanitizer: merge from upstream (c425db2eb558c263) 2023-11-15 12:45:58 +01:00
merge.sh libsanitizer: use git clone --depth 1 2022-11-15 14:18:27 +01:00
README.gcc libsanitizer: add hwasan. 2020-11-25 16:35:30 +00:00

AddressSanitizer and ThreadSanitizer (https://github.com/google/sanitizers) are
projects initially developed by Google Inc.

Both tools consist of a compiler module and a run-time library.
The sources of the run-time library for these projects are hosted at
https://github.com/llvm/llvm-project in the following directories:
  compiler-rt/include/sanitizer
  compiler-rt/lib/sanitizer_common
  compiler-rt/lib/interception
  compiler-rt/lib/asan
  compiler-rt/lib/tsan
  compiler-rt/lib/lsan
  compiler-rt/lib/ubsan
  compiler-rt/lib/hwasan

Trivial and urgent fixes (portability, build fixes, etc.) may go directly to the
GCC tree.  All non-trivial changes, functionality improvements, etc. should go
through the upstream tree first and then be merged back to the GCC tree.
The merges from upstream should be done with the aid of the merge.sh script;
it will also update the file MERGE to contain the upstream revision
we merged with.