From 2df267406252b6e2e46a9c71e0e3d17bc2026eb2 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Thu, 2 Jun 2022 09:20:02 +0800 Subject: [PATCH 1/2] redefine ucontext - define sigmask of ucontext_t same as that for other ARCHs - use a0 to store the return value - revert -Wall for bionic build --- libc/include/sys/ucontext.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libc/include/sys/ucontext.h b/libc/include/sys/ucontext.h index 94dd8a305..28ceea1e2 100644 --- a/libc/include/sys/ucontext.h +++ b/libc/include/sys/ucontext.h @@ -367,8 +367,10 @@ typedef struct ucontext_t { unsigned long int __uc_flags; struct ucontext_t *uc_link; stack_t uc_stack; - sigset_t uc_sigmask; - sigset64_t uc_sigmask64; + union { + sigset_t uc_sigmask; + sigset64_t uc_sigmask64; + }; unsigned char __reserved[1024 / 8 - sizeof (sigset_t)]; mcontext_t uc_mcontext; } ucontext_t; -- Gitee From 0e8e058e8afbf52fa096c4af1348c9d3b8f253c8 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Tue, 7 Jun 2022 17:55:39 +0800 Subject: [PATCH 2/2] fixed benchmark for link reloc --- .../linker_relocation/include/linker_reloc_bench_asm.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/benchmarks/linker_relocation/include/linker_reloc_bench_asm.h b/benchmarks/linker_relocation/include/linker_reloc_bench_asm.h index acd235c41..7d9931af2 100644 --- a/benchmarks/linker_relocation/include/linker_reloc_bench_asm.h +++ b/benchmarks/linker_relocation/include/linker_reloc_bench_asm.h @@ -44,8 +44,10 @@ #elif (defined(__riscv) && (__riscv_xlen == 64)) -// FIXME: have not tested it out, is it ok? -#define GOT_RELOC(sym) auipc a0, %got_pcrel_hi(sym) +// clang driver for android default enables "-mrelocation-model pic", so 'la' should +// be able to access GOT. A better choise is to use 'lga' but clang has not supported +// this pseudo-inst yet. +#define GOT_RELOC(sym) la a0, sym #define CALL(sym) call sym@plt #define DATA_WORD(val) .quad val #define MAIN .globl main; main: nop; ret -- Gitee