search for: __global_pointer

Displaying 5 results from an estimated 5 matches for "__global_pointer".

2020 Aug 29
0
[klibc:riscv64-enable-relax] riscv64: Make linker relaxation work and enable it
...for static executables but not for those using the shared library, so I disabled relaxation. gp-relative relaxation is *not* meant to be used in shared libraries, but we should enable it in executables. pc-relative relaxation can be enabled in all cases. * When linking the shared library, define __global_pointer$ as 0 to disable gp-relative relaxation * For executables using the shared-library, add a _main routine in _main.S that initialises gp and tail-calls main * Add _main.o to $(KLIBCCRTSHARED) and change the entry point to _main * Install _main.o so klcc can use it * Drop the --no-relax linker opt...
2020 Aug 29
0
[klibc:riscv64-enable-relax] riscv64: Make linker relaxation work and enable it
...000000..284a2222 --- /dev/null +++ b/usr/klibc/arch/riscv64/_main.S @@ -0,0 +1,17 @@ +# +# arch/riscv64/_main.S +# +# Does arch-specific initialization and invokes main with the +# appropriate arguments. +# + +#include <machine/asm.h> + +ENTRY(_main) + .option push + .option norelax + lla gp, __global_pointer$ + .option pop + + j main +END(_main)
2018 Jul 17
1
[PATCH klibc 1/2] rename, renameat: Use renameat2() system call
New architectures only define the renameat2() system call, which was added in Linux 3.15. Define rename() and renameat() as wrappers for it if necessary. Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- --- a/usr/klibc/Kbuild +++ b/usr/klibc/Kbuild @@ -59,7 +59,8 @@ klib-y += vsnprintf.o snprintf.o vsprint inet/inet_ntoa.o inet/inet_aton.o inet/inet_addr.o \
2023 Mar 05
0
[klibc:master] Add LoongArch64 port
...h/loongarch64/crt0.S @@ -1,5 +1,5 @@ # -# arch/riscv64/crt0.S +# arch/loongarch64/crt0.S # # Does arch-specific initialization and invokes __libc_init # with the appropriate arguments. @@ -11,12 +11,8 @@ #include <machine/asm.h> ENTRY(_start) - .option push - .option norelax - lla gp, __global_pointer$ - .option pop - - mv a0, sp # Pointer to ELF entry structure - mv a1, zero # No onexit pointer - jal __libc_init + move $a0, $sp # Pointer to ELF entry structure + move $a1, $zero # No onexit pointer + bstrins.d $sp, $zero, 3, 0 # Align stack to 16 bytes + bl __libc_init END(_start) diff...
2019 Jan 18
0
[klibc:master] Add RISC-V (RV64) port
...@ +# +# arch/riscv64/crt0.S +# +# Does arch-specific initialization and invokes __libc_init +# with the appropriate arguments. +# +# See __static_init.c or __shared_init.c for the expected +# arguments. +# + +#include <machine/asm.h> + +ENTRY(_start) + .option push + .option norelax + lla gp, __global_pointer$ + .option pop + + mv a0, sp # Pointer to ELF entry structure + mv a1, zero # No onexit pointer + jal __libc_init +END(_start) diff --git a/usr/klibc/arch/riscv64/setjmp.S b/usr/klibc/arch/riscv64/setjmp.S new file mode 100644 index 0000000..66e009e --- /dev/null +++ b/usr/klibc/arch/riscv64/set...