Skip to content

Commit 84186fc

Browse files
committed
Merge tag 'urgent/nolibc.2023.10.16a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu
Pull nolibc fixes from Paul McKenney: - tools/nolibc: i386: Fix a stack misalign bug on _start - MAINTAINERS: nolibc: update tree location - tools/nolibc: mark start_c as weak to avoid linker errors * tag 'urgent/nolibc.2023.10.16a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: tools/nolibc: mark start_c as weak MAINTAINERS: nolibc: update tree location tools/nolibc: i386: Fix a stack misalign bug on _start
2 parents e017769 + 9219922 commit 84186fc

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15131,7 +15131,7 @@ NOLIBC HEADER FILE
1513115131
M: Willy Tarreau <w@1wt.eu>
1513215132
M: Thomas Weißschuh <linux@weissschuh.net>
1513315133
S: Maintained
15134-
T: git git://git.kernel.org/pub/scm/linux/kernel/git/wtarreau/nolibc.git
15134+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/nolibc/linux-nolibc.git
1513515135
F: tools/include/nolibc/
1513615136
F: tools/testing/selftests/nolibc/
1513715137

tools/include/nolibc/arch-i386.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ void __attribute__((weak, noreturn, optimize("Os", "omit-frame-pointer"))) __no_
167167
__asm__ volatile (
168168
"xor %ebp, %ebp\n" /* zero the stack frame */
169169
"mov %esp, %eax\n" /* save stack pointer to %eax, as arg1 of _start_c */
170-
"and $-16, %esp\n" /* last pushed argument must be 16-byte aligned */
170+
"add $12, %esp\n" /* avoid over-estimating after the 'and' & 'sub' below */
171+
"and $-16, %esp\n" /* the %esp must be 16-byte aligned on 'call' */
172+
"sub $12, %esp\n" /* sub 12 to keep it aligned after the push %eax */
171173
"push %eax\n" /* push arg1 on stack to support plain stack modes too */
172174
"call _start_c\n" /* transfer to c runtime */
173175
"hlt\n" /* ensure it does not return */

tools/include/nolibc/crt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const unsigned long *_auxv __attribute__((weak));
1313
static void __stack_chk_init(void);
1414
static void exit(int);
1515

16+
__attribute__((weak))
1617
void _start_c(long *sp)
1718
{
1819
long argc;

0 commit comments

Comments
 (0)