aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/module.cc
diff options
context:
space:
mode:
authorYunQiang Su <yunqiang.su@cipunited.com>2024-01-17 15:11:33 +0800
committerYunQiang Su <syq@gcc.gnu.org>2024-01-17 17:03:08 +0800
commit557dbbac8e6a344d44fedff75e16008fa8a5ffb7 (patch)
tree5576b16c6514d14e57fdfbcd67c749b5f5577a88 /gcc/cp/module.cc
parentde4c9a27ba51e409e9d9e2a2827da53b1c979b09 (diff)
downloadgcc-557dbbac8e6a344d44fedff75e16008fa8a5ffb7.zip
gcc-557dbbac8e6a344d44fedff75e16008fa8a5ffb7.tar.gz
gcc-557dbbac8e6a344d44fedff75e16008fa8a5ffb7.tar.bz2
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.
Diffstat (limited to 'gcc/cp/module.cc')
0 files changed, 0 insertions, 0 deletions