search for: __libc_init

Displaying 20 results from an estimated 53 matches for "__libc_init".

2003 Nov 28
2
[PATCH] update crt0.S on ppc32
The _start stuff was changed some time ago, but ppc was not updated. This fixes klibc for me. I'm not sure what to do with the second arg to __libc_init, so I set it to 0.. However, looking at other static binaries, there is more stuff todo. diff -p -purNx linux -x '.*.d' -x syscalls -x socketcalls y/klibc-0.87/klibc/arch/ppc/crt0.S klibc-0.87/klibc/arch/ppc/crt0.S --- y/klibc-0.87/klibc/arch/ppc/crt0.S 2002-08-10 13:28:55.000000000 +0200...
2005 Dec 07
0
Fix segfault in new exit code on parisc, klibc-1.1.3
parisc is currently passing argc as the second argument to __libc_init: --- crt0.S.old 2005-12-07 19:06:07.000000000 +0000 +++ crt0.S 2005-12-07 19:06:40.000000000 +0000 @@ -25,6 +25,10 @@ ldil L%$global$, %dp ldo R%$global$(%dp), %dp +/* Indicate that we don't need no stinkin' atexit callback */ + + ldi 0,%r25 + /* br...
2019 Jan 18
0
[klibc:master] mips/mips64: simplify crt0 code
...addiu gp, gp, _gp - - addiu a0, sp, 32 # Pointer to ELF entry structure +NESTED(__start, 0, ra) + move a0, sp # Pointer to ELF entry structure move a1, v0 # Kernel-provided atexit() pointer + and sp, -8 # Align stack to 8 bytes + subu sp, 16 # Allocate 16 bytes for function call jal __libc_init + teq zero, zero # Crash if we return END(__start) diff --git a/usr/klibc/arch/mips64/crt0.S b/usr/klibc/arch/mips64/crt0.S index 775a919..3f1c2a9 100644 --- a/usr/klibc/arch/mips64/crt0.S +++ b/usr/klibc/arch/mips64/crt0.S @@ -10,22 +10,12 @@ #include <machine/asm.h> -NESTED(__star...
2006 Jan 08
0
[PATCH] Fix DT_FINI function pass-in to _start on parisc
...+++ b/klibc/arch/parisc/crt0.S @@ -25,8 +25,8 @@ _start: ldil L%$global$, %dp ldo R%$global$(%dp), %dp -/* Indicate that we don't need no stinkin' atexit callback */ - ldi 0,%r25 +/* parisc abi puts the atexit pointer in %r23, see ELF_PLAT_INIT() */ + copy %r23, %r25 /* branch to __libc_init */ bl __libc_init,%r2
2014 Jan 25
0
[klibc:master] auxv: convert auxiliary vector into an array; define getauxval()
...tatic_init.c or __shared_init.c */ @@ -35,12 +36,14 @@ char **environ; unsigned int __page_size, __page_shift; struct auxentry { - uintptr_t type; - uintptr_t v; + unsigned long type; + unsigned long v; }; extern void __init_stdio(void); +unsigned long __auxval[_AUXVAL_MAX]; + __noreturn __libc_init(uintptr_t * elfdata, void (*onexit) (void)) { int argc; @@ -76,20 +79,16 @@ __noreturn __libc_init(uintptr_t * elfdata, void (*onexit) (void)) auxentry = (struct auxentry *)(envend + 1); while (auxentry->type) { - switch (auxentry->type) { -#if SHARED - case AT_ENTRY: - MAIN = (m...
2015 Mar 06
0
[klibc:master] add-mips64-support-arch-mips64-specific
...EDFLAGS = -T $(src)/arch/mips/klibc.ld diff --git a/usr/klibc/arch/mips64/crt0.S b/usr/klibc/arch/mips64/crt0.S new file mode 100644 index 0000000..775a919 --- /dev/null +++ b/usr/klibc/arch/mips64/crt0.S @@ -0,0 +1,31 @@ +# +# arch/mips64/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> + +NESTED(__start, 64, sp) + daddiu sp,sp,-64 + sd zero, 32(sp) + + # Initialize gp + lui gp,%highest(_gp) # load highest "halfword" +...
2014 Apr 09
0
[klibc:master] Move architecture-specific initialization to arch/
...00:01 -0700 [klibc] Move architecture-specific initialization to arch/ Move out architecture-specific initialization code (currently only for i386) into the arch/ directory and define a configuration variable _KLIBC_HAS_ARCHINIT to indicate its presence. For consistency, change __init_stdio() to __libc_init_stdio(). Signed-off-by: H. Peter Anvin <hpa at linux.intel.com> --- usr/include/arch/i386/klibc/archconfig.h | 3 +++ usr/include/klibc/sysconfig.h | 9 +++++++++ usr/klibc/arch/i386/Kbuild | 2 +- usr/klibc/arch/i386/archinit.c | 18 ++++++++++++++++++...
2006 Jun 26
0
[klibc 30/43] parisc support for klibc
...+KLIBCARCHOOBJS = $(patsubst %o,%.lo,%(KLIBCARCHOBJS)) + +archclean: diff --git a/usr/klibc/arch/parisc/crt0.S b/usr/klibc/arch/parisc/crt0.S new file mode 100644 index 0000000..0922446 --- /dev/null +++ b/usr/klibc/arch/parisc/crt0.S @@ -0,0 +1,37 @@ + .align 4 + + .import $global$, data + .import __libc_init, code + + .global _start + .export _start, ENTRY + .type _start, at function + + .proc + .callinfo + +_start: +/* extend the stack by 64-bytes */ + ldo 64(%sp), %sp + +/* %r25 = argc + * %r24 = argv + * envp = argv + (argc + 1) + * elfdata = (argv - 4) + */ + ldo -4(%r24), %r26 + +/* load global da...
2023 Mar 05
0
[klibc:master] Add LoongArch64 port
...sr/klibc/arch/riscv64/crt0.S copy to usr/klibc/arch/loongarch64/crt0.S index 76fa3c28..cb3da669 100644 --- a/usr/klibc/arch/riscv64/crt0.S +++ b/usr/klibc/arch/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 #...
2013 Dec 03
0
[klibc:master] ppc64: Add ppc64le support
...e _start, 24 .type ._start, at function - .globl _start - .globl ._start ._start: - stdu %r1,-32(%r1) - addi %r3,%r1,32 +#endif + +#if _CALL_ELF == 2 +0: addis 2,12,.TOC.-0b at ha + addi 2,2,.TOC.-0b at l +#endif + + stdu %r1,-32(%r1) + addi %r3,%r1,32 li %r4,0 /* fini (unused) */ - b .__libc_init + b __libc_init nop - .size ._start,.-._start +#if _CALL_ELF == 2 + .size _start,.-_start +#else + .size _start,.-._start +#endif diff --git a/usr/klibc/arch/ppc64/setjmp.S b/usr/klibc/arch/ppc64/setjmp.S index 30db419..ecf9717 100644 --- a/usr/klibc/arch/ppc64/setjmp.S +++ b/usr/klibc/arch/ppc...
2006 Jun 26
0
[klibc 33/43] s390 support for klibc
...ubst %.o,%.lo,$(KLIBCARCHOBJS)) + + +archclean: diff --git a/usr/klibc/arch/s390/crt0.S b/usr/klibc/arch/s390/crt0.S new file mode 100644 index 0000000..fd9237e --- /dev/null +++ b/usr/klibc/arch/s390/crt0.S @@ -0,0 +1,35 @@ +# +# arch/s390/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. +# + .text + .align 4 + .type _start, at function + .globl _start + +#ifndef __s390x__ + +_start: + lr %r2,%r15 + lhi %r3,0 + ahi %r15,-96 + bras %r1,.L0 +.L0: + l %r1,.L1-.L0(%r1) + br %r...
2013 Dec 03
2
[PATCH 1/2] ppc64: Add ppc64le support
...e _start, 24 .type ._start, at function - .globl _start - .globl ._start ._start: - stdu %r1,-32(%r1) - addi %r3,%r1,32 +#endif + +#if _CALL_ELF == 2 +0: addis 2,12,.TOC.-0b at ha + addi 2,2,.TOC.-0b at l +#endif + + stdu %r1,-32(%r1) + addi %r3,%r1,32 li %r4,0 /* fini (unused) */ - b .__libc_init + b __libc_init nop - .size ._start,.-._start +#if _CALL_ELF == 2 + .size _start,.-_start +#else + .size _start,.-._start +#endif diff --git a/usr/klibc/arch/ppc64/setjmp.S b/usr/klibc/arch/ppc64/setjmp.S index 30db419..ecf9717 100644 --- a/usr/klibc/arch/ppc64/setjmp.S +++ b/usr/klibc/arch/pp...
2006 May 11
0
[patch] klibc: merge s390 and s390x
...arch/s390/crt0.S 2006-05-11 08:09:08.000000000 +0200 +++ b/usr/klibc/arch/s390/crt0.S 2006-05-11 08:10:07.000000000 +0200 @@ -11,6 +11,9 @@ .align 4 .type _start,@function .globl _start + +#ifndef __s390x__ + _start: lr %r2,%r15 lhi %r3,0 @@ -21,5 +24,12 @@ _start: br %r1 .L1: .long __libc_init +#else +_start: + lgr %r2,%r15 + lghi %r3,0 + aghi %r15,-160 + jg __libc_init +#endif .size _start,.-_start diff -purN a/usr/klibc/arch/s390/mmap.c b/usr/klibc/arch/s390/mmap.c --- a/usr/klibc/arch/s390/mmap.c 2006-05-11 08:09:08.000000000 +0200 +++ b/usr/klibc/arch/s390/mmap.c 2006-05-11 08:10...
2006 May 24
1
[patch] klibc: merge s390/s390x 2nd try
...arch/s390/crt0.S 2006-05-24 15:19:12.000000000 +0200 +++ b/usr/klibc/arch/s390/crt0.S 2006-05-24 13:02:18.000000000 +0200 @@ -11,6 +11,9 @@ .align 4 .type _start,@function .globl _start + +#ifndef __s390x__ + _start: lr %r2,%r15 lhi %r3,0 @@ -21,5 +24,12 @@ _start: br %r1 .L1: .long __libc_init +#else +_start: + lgr %r2,%r15 + lghi %r3,0 + aghi %r15,-160 + jg __libc_init +#endif .size _start,.-_start diff -purN a/usr/klibc/arch/s390/mmap.c b/usr/klibc/arch/s390/mmap.c --- a/usr/klibc/arch/s390/mmap.c 2006-05-24 15:19:12.000000000 +0200 +++ b/usr/klibc/arch/s390/mmap.c 2006-05-24 13:08...
2019 Jan 18
0
[klibc:master] arch: Remove m32r port
...LAGS = --section-start .init=0x0e000100 diff --git a/usr/klibc/arch/m32r/crt0.S b/usr/klibc/arch/m32r/crt0.S deleted file mode 100644 index 568e5d8..0000000 --- a/usr/klibc/arch/m32r/crt0.S +++ /dev/null @@ -1,24 +0,0 @@ -# -# arch/m32r/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. -# - - .text - .balign 4 - .type _start, at function - .globl _start -_start: - /* Save the address of the ELF argument array */ - mv r0, sp - - /* atexit() function (assume null) */ - xor...
2006 Jun 26
0
[klibc 26/43] m32r support for klibc
...oddi3.o \ + libgcc/__udivmoddi4.o + +archclean: diff --git a/usr/klibc/arch/m32r/crt0.S b/usr/klibc/arch/m32r/crt0.S new file mode 100644 index 0000000..568e5d8 --- /dev/null +++ b/usr/klibc/arch/m32r/crt0.S @@ -0,0 +1,24 @@ +# +# arch/m32r/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. +# + + .text + .balign 4 + .type _start, at function + .globl _start +_start: + /* Save the address of the ELF argument array */ + mv r0, sp + + /* atexit() function (assume null) */ + xor...
2018 Mar 02
5
[PATCH 0/5] Various MIPS fixes
Hi, I noticed that klibc started crashing on 64-bit MIPS and in my quest to fix the bug I got a bit carried away and fixed a few other things as well. Here are various miscellaneous MIPS patches, although the first patch is the important one. Thanks, James *** BLURB HERE *** James Cowgill (5): mips64: compile with -mno-abicalls mips: use -Ttext-segment when linking shared library
2006 Jun 26
0
[klibc 34/43] sh support for klibc
...SOOBJS = $(patsubst %.o,%.lo,$(ARCHOBJS)) + +archclean: diff --git a/usr/klibc/arch/sh/crt0.S b/usr/klibc/arch/sh/crt0.S new file mode 100644 index 0000000..7f0a649 --- /dev/null +++ b/usr/klibc/arch/sh/crt0.S @@ -0,0 +1,27 @@ +# +# arch/sh/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. +# + + .text + .align 2 + .type _start,#function + .globl _start + +_start: + mov r15, r4 + mov #0, r5 + mov.l 1f, r0 + + jsr @r0 + nop + + .align 2 +1: .long __libc_init + + .size _start...
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 Feb 20
1
[PATCH] Add LoongArch64 port
...EXECSTACK := n diff --git a/usr/klibc/arch/loongarch64/crt0.S b/usr/klibc/arch/loongarch64/crt0.S new file mode 100644 index 00000000..cb3da669 --- /dev/null +++ b/usr/klibc/arch/loongarch64/crt0.S @@ -0,0 +1,18 @@ +# +# arch/loongarch64/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) + move $a0, $sp # Pointer to ELF entry structure + move $a1, $zero # No onexit pointer + bstrins.d $sp, $zero, 3, 0 # Align stack...