From 2f31efaa954c441978fa87f623c314b6d12a1f80 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sun, 6 Dec 2020 02:59:59 -0600 Subject: [PATCH] everywhere: rename __start_context to better descriptive libucontext_trampoline --- arch/aarch64/makecontext.c | 4 ++-- arch/aarch64/startcontext.S | 4 ++-- arch/arm/makecontext.c | 4 ++-- arch/arm/startcontext.S | 4 ++-- arch/m68k/makecontext.c | 4 ++-- arch/m68k/startcontext.S | 4 ++-- arch/mips/makecontext.S | 2 +- arch/mips/startcontext.S | 4 ++-- arch/mips64/makecontext.S | 2 +- arch/mips64/startcontext.S | 4 ++-- arch/ppc/makecontext.c | 4 ++-- arch/ppc/startcontext.S | 4 ++-- arch/ppc64/makecontext.c | 4 ++-- arch/ppc64/startcontext.S | 6 +++--- arch/riscv64/makecontext.c | 4 ++-- arch/riscv64/startcontext.S | 4 ++-- arch/s390x/makecontext.c | 4 ++-- arch/s390x/startcontext.S | 4 ++-- arch/x86/makecontext.c | 4 ++-- arch/x86/startcontext.S | 4 ++-- arch/x86_64/makecontext.c | 4 ++-- arch/x86_64/startcontext.S | 4 ++-- 22 files changed, 43 insertions(+), 43 deletions(-) diff --git a/arch/aarch64/makecontext.c b/arch/aarch64/makecontext.c index 0fd6a2a..85af1c1 100644 --- a/arch/aarch64/makecontext.c +++ b/arch/aarch64/makecontext.c @@ -20,7 +20,7 @@ #include "defs.h" -extern void __start_context(void); +extern void libucontext_trampoline(void); void @@ -38,7 +38,7 @@ libucontext_makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) ucp->uc_mcontext.sp = (uintptr_t) sp; ucp->uc_mcontext.pc = (uintptr_t) func; ucp->uc_mcontext.regs[19] = (uintptr_t) ucp->uc_link; - ucp->uc_mcontext.regs[30] = (uintptr_t) &__start_context; + ucp->uc_mcontext.regs[30] = (uintptr_t) &libucontext_trampoline; va_start(va, argc); diff --git a/arch/aarch64/startcontext.S b/arch/aarch64/startcontext.S index 81775c5..aa9558e 100644 --- a/arch/aarch64/startcontext.S +++ b/arch/aarch64/startcontext.S @@ -12,11 +12,11 @@ #include "defs.h" -FUNC(__start_context) +FUNC(libucontext_trampoline) /* get the proper context into position and test for NULL */ mov x0, x19 cbnz x0, __setcontext /* something went wrong, exit */ b exit -END(__start_context) +END(libucontext_trampoline) diff --git a/arch/arm/makecontext.c b/arch/arm/makecontext.c index d276db3..681b2fc 100644 --- a/arch/arm/makecontext.c +++ b/arch/arm/makecontext.c @@ -22,7 +22,7 @@ #include "defs.h" -extern void __start_context(void); +extern void libucontext_trampoline(void); void @@ -42,7 +42,7 @@ libucontext_makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) ucp->uc_mcontext.arm_sp = (uintptr_t) sp; ucp->uc_mcontext.arm_pc = (uintptr_t) func; ucp->uc_mcontext.arm_r4 = (uintptr_t) ucp->uc_link; - ucp->uc_mcontext.arm_lr = (uintptr_t) &__start_context; + ucp->uc_mcontext.arm_lr = (uintptr_t) &libucontext_trampoline; va_start(va, argc); diff --git a/arch/arm/startcontext.S b/arch/arm/startcontext.S index b73fb88..51f1c4a 100644 --- a/arch/arm/startcontext.S +++ b/arch/arm/startcontext.S @@ -10,11 +10,11 @@ * from the use of this software. */ -.globl __start_context; +.globl libucontext_trampoline; .fnstart .cantunwind nop -__start_context: +libucontext_trampoline: /* get the proper context into position and test for NULL */ movs r0, r4 bne __setcontext@plt diff --git a/arch/m68k/makecontext.c b/arch/m68k/makecontext.c index d7ef416..9994800 100644 --- a/arch/m68k/makecontext.c +++ b/arch/m68k/makecontext.c @@ -20,7 +20,7 @@ #include "defs.h" -extern void __start_context(void); +extern void libucontext_trampoline(void); void @@ -42,7 +42,7 @@ libucontext_makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) ucp->uc_mcontext.gregs[REG_PC] = (greg_t) func; /* return address */ - *sp++ = (greg_t) __start_context; + *sp++ = (greg_t) libucontext_trampoline; va_start(va, argc); diff --git a/arch/m68k/startcontext.S b/arch/m68k/startcontext.S index 321e467..799c04b 100644 --- a/arch/m68k/startcontext.S +++ b/arch/m68k/startcontext.S @@ -12,7 +12,7 @@ #include "defs.h" -FUNC(__start_context) +FUNC(libucontext_trampoline) lea (%sp, %d7.l * REG_SZ), %sp /* place uc_link in $sp */ tst.l (%sp) /* test next content for NULL */ @@ -23,4 +23,4 @@ FUNC(__start_context) no_linked_context: jbsr exit -END(__start_context) +END(libucontext_trampoline) diff --git a/arch/mips/makecontext.S b/arch/mips/makecontext.S index bfed44c..6ea5b6d 100644 --- a/arch/mips/makecontext.S +++ b/arch/mips/makecontext.S @@ -76,7 +76,7 @@ no_more_arguments: addiu $t0, -(4 * REG_SZ) /* trampoline setup. */ - la $t9, __start_context + la $t9, libucontext_trampoline /* copy link pointer as $s0... */ lw $v1, UCONTEXT_UC_LINK($a0) diff --git a/arch/mips/startcontext.S b/arch/mips/startcontext.S index 1aec638..a25dfda 100644 --- a/arch/mips/startcontext.S +++ b/arch/mips/startcontext.S @@ -14,7 +14,7 @@ LOCALSZ = 1 #include "defs.h" -FUNC(__start_context) +FUNC(libucontext_trampoline) move $gp, $s1 /* we receive our initial ucontext in $s0, so if $s0 is nil, bail */ @@ -31,4 +31,4 @@ no_linked_context: la $t9, exit jalr $t9 nop -END(__start_context) +END(libucontext_trampoline) diff --git a/arch/mips64/makecontext.S b/arch/mips64/makecontext.S index 6b7975b..1f906fb 100644 --- a/arch/mips64/makecontext.S +++ b/arch/mips64/makecontext.S @@ -82,7 +82,7 @@ store_stack_arg: no_more_arguments: /* trampoline setup. */ - dla $t9, __start_context + dla $t9, libucontext_trampoline /* copy link pointer as $s0... */ ld $v1, UCONTEXT_UC_LINK($a0) diff --git a/arch/mips64/startcontext.S b/arch/mips64/startcontext.S index a9c37a8..7b07c6f 100644 --- a/arch/mips64/startcontext.S +++ b/arch/mips64/startcontext.S @@ -14,7 +14,7 @@ LOCALSZ = 1 #include "defs.h" -FUNC(__start_context) +FUNC(libucontext_trampoline) move $gp, $s1 /* we receive our initial ucontext in $s0, so if $s0 is nil, bail */ @@ -31,4 +31,4 @@ no_linked_context: dla $t9, exit jalr $t9 nop -END(__start_context) +END(libucontext_trampoline) diff --git a/arch/ppc/makecontext.c b/arch/ppc/makecontext.c index 2937ce1..d331670 100644 --- a/arch/ppc/makecontext.c +++ b/arch/ppc/makecontext.c @@ -20,7 +20,7 @@ #include "defs.h" -extern void __start_context(void); +extern void libucontext_trampoline(void); void @@ -38,7 +38,7 @@ libucontext_makecontext(ucontext_t *ucp, void (*func)(), int argc, ...) sp = (greg_t *) ((uintptr_t) sp & -16L); ucp->uc_mcontext.gregs[REG_NIP] = (uintptr_t) func; - ucp->uc_mcontext.gregs[REG_LNK] = (uintptr_t) &__start_context; + ucp->uc_mcontext.gregs[REG_LNK] = (uintptr_t) &libucontext_trampoline; ucp->uc_mcontext.gregs[REG_R31] = (uintptr_t) ucp->uc_link; ucp->uc_mcontext.gregs[REG_SP] = (uintptr_t) sp; diff --git a/arch/ppc/startcontext.S b/arch/ppc/startcontext.S index 71175fb..da3cdd6 100644 --- a/arch/ppc/startcontext.S +++ b/arch/ppc/startcontext.S @@ -10,8 +10,8 @@ * from the use of this software. */ -.globl __start_context; -__start_context: +.globl libucontext_trampoline; +libucontext_trampoline: /* get the proper context into position and test for NULL */ mr. 3,31 diff --git a/arch/ppc64/makecontext.c b/arch/ppc64/makecontext.c index 2d4974e..f328efe 100644 --- a/arch/ppc64/makecontext.c +++ b/arch/ppc64/makecontext.c @@ -20,7 +20,7 @@ #include "defs.h" -extern void __start_context(void); +extern void libucontext_trampoline(void); void @@ -38,7 +38,7 @@ libucontext_makecontext(ucontext_t *ucp, void (*func)(), int argc, ...) sp = (greg_t *) ((uintptr_t) sp & -16L); ucp->uc_mcontext.gp_regs[REG_NIP] = (uintptr_t) func; - ucp->uc_mcontext.gp_regs[REG_LNK] = (uintptr_t) &__start_context; + ucp->uc_mcontext.gp_regs[REG_LNK] = (uintptr_t) &libucontext_trampoline; ucp->uc_mcontext.gp_regs[REG_SP] = (uintptr_t) sp; ucp->uc_mcontext.gp_regs[REG_ENTRY] = (uintptr_t) func; ucp->uc_mcontext.gp_regs[REG_R31] = (uintptr_t) ucp->uc_link; diff --git a/arch/ppc64/startcontext.S b/arch/ppc64/startcontext.S index fb2fc02..14b2576 100644 --- a/arch/ppc64/startcontext.S +++ b/arch/ppc64/startcontext.S @@ -10,9 +10,9 @@ * from the use of this software. */ -.globl __start_context; -.hidden __start_context; -__start_context: +.globl libucontext_trampoline; +.hidden libucontext_trampoline; +libucontext_trampoline: cmpdi 31,0 /* test if ucontext link pointer is null */ beq no_linked_context /* if it is, exit */ diff --git a/arch/riscv64/makecontext.c b/arch/riscv64/makecontext.c index 2c3e8e9..e1a2d59 100644 --- a/arch/riscv64/makecontext.c +++ b/arch/riscv64/makecontext.c @@ -20,7 +20,7 @@ #include "defs.h" -extern void __start_context(void); +extern void libucontext_trampoline(void); void @@ -36,7 +36,7 @@ libucontext_makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) sp = (greg_t *) (((uintptr_t) sp & -16L)); /* set up the ucontext structure */ - ucp->uc_mcontext.__gregs[REG_RA] = (greg_t) __start_context; + ucp->uc_mcontext.__gregs[REG_RA] = (greg_t) libucontext_trampoline; ucp->uc_mcontext.__gregs[REG_S0] = 0; ucp->uc_mcontext.__gregs[REG_S1] = (greg_t) func; ucp->uc_mcontext.__gregs[REG_S2] = (greg_t) ucp->uc_link; diff --git a/arch/riscv64/startcontext.S b/arch/riscv64/startcontext.S index b7edc73..3908b4e 100644 --- a/arch/riscv64/startcontext.S +++ b/arch/riscv64/startcontext.S @@ -12,7 +12,7 @@ #include "defs.h" -FUNC(__start_context) +FUNC(libucontext_trampoline) /* call the function passed to makecontext() */ jalr s1 @@ -26,4 +26,4 @@ FUNC(__start_context) /* otherwise, exit. */ no_linked_context: tail exit@plt -END(__start_context) +END(libucontext_trampoline) diff --git a/arch/s390x/makecontext.c b/arch/s390x/makecontext.c index a0b84fc..05940c0 100644 --- a/arch/s390x/makecontext.c +++ b/arch/s390x/makecontext.c @@ -21,7 +21,7 @@ #include "defs.h" -extern void __start_context(void); +extern void libucontext_trampoline(void); extern int __setcontext(const ucontext_t *ucp); @@ -38,7 +38,7 @@ libucontext_makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) ucp->uc_mcontext.gregs[7] = (uintptr_t) func; ucp->uc_mcontext.gregs[8] = (uintptr_t) ucp->uc_link; ucp->uc_mcontext.gregs[9] = (uintptr_t) &__setcontext; - ucp->uc_mcontext.gregs[14] = (uintptr_t) &__start_context; + ucp->uc_mcontext.gregs[14] = (uintptr_t) &libucontext_trampoline; va_start(va, argc); diff --git a/arch/s390x/startcontext.S b/arch/s390x/startcontext.S index 79bd3fe..a1b2ce2 100644 --- a/arch/s390x/startcontext.S +++ b/arch/s390x/startcontext.S @@ -12,7 +12,7 @@ #include "defs.h" -FUNC(__start_context) +FUNC(libucontext_trampoline) basr %r14, %r7 /* run function pointer (%r7) and return here */ ltgr %r8, %r8 /* check to see if uc_link (%r8) is null */ @@ -26,4 +26,4 @@ no_linked_context: brasl %r14, exit@plt /* call exit */ j .+2 /* crash if exit returns */ -END(__start_context) +END(libucontext_trampoline) diff --git a/arch/x86/makecontext.c b/arch/x86/makecontext.c index 20156d5..02c14f6 100644 --- a/arch/x86/makecontext.c +++ b/arch/x86/makecontext.c @@ -19,7 +19,7 @@ #include -extern void __start_context(void); +extern void libucontext_trampoline(void); void @@ -41,7 +41,7 @@ libucontext_makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) ucp->uc_mcontext.gregs[REG_ESP] = (uintptr_t) sp; argp = sp; - *argp++ = (uintptr_t) &__start_context; + *argp++ = (uintptr_t) &libucontext_trampoline; va_start(va, argc); diff --git a/arch/x86/startcontext.S b/arch/x86/startcontext.S index 3f3bc80..4d1168a 100644 --- a/arch/x86/startcontext.S +++ b/arch/x86/startcontext.S @@ -12,7 +12,7 @@ #include "defs.h" -FUNC(__start_context) +FUNC(libucontext_trampoline) /* get the proper context into position and test for NULL */ leal (%esp,%ebx,4), %esp cmpl $0, (%esp) @@ -38,4 +38,4 @@ no_linked_context: __i686.get_pc_thunk.bx: mov (%esp), %ebx ret -END(__start_context) +END(libucontext_trampoline) diff --git a/arch/x86_64/makecontext.c b/arch/x86_64/makecontext.c index bcc07f3..c529650 100644 --- a/arch/x86_64/makecontext.c +++ b/arch/x86_64/makecontext.c @@ -19,7 +19,7 @@ #include "defs.h" -extern void __start_context(void); +extern void libucontext_trampoline(void); void @@ -40,7 +40,7 @@ libucontext_makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) ucp->uc_mcontext.gregs[REG_RBX] = (uintptr_t) &sp[uc_link]; ucp->uc_mcontext.gregs[REG_RSP] = (uintptr_t) sp; - sp[0] = (uintptr_t) &__start_context; + sp[0] = (uintptr_t) &libucontext_trampoline; sp[uc_link] = (uintptr_t) ucp->uc_link; va_start(va, argc); diff --git a/arch/x86_64/startcontext.S b/arch/x86_64/startcontext.S index 4d39b2f..9a3a374 100644 --- a/arch/x86_64/startcontext.S +++ b/arch/x86_64/startcontext.S @@ -12,7 +12,7 @@ #include "defs.h" -FUNC(__start_context) +FUNC(libucontext_trampoline) /* get the proper context into position and test for NULL */ movq %rbx, %rsp movq (%rsp), %rdi @@ -31,4 +31,4 @@ no_linked_context: /* something is really hosed, call hlt to force termination */ hlt -END(__start_context) +END(libucontext_trampoline)