Update userspace

This commit is contained in:
Alex
2023-08-06 04:52:48 +03:00
parent 0f8cb900cb
commit 2fd23205db
49 changed files with 437 additions and 525 deletions

View File

@@ -27,10 +27,11 @@ else ifeq ($(OSARCH), i386)
ASM_ARCH := elf32
endif
CFLAGS := -fvisibility=hidden -fPIC -I../include -I../../libc/include
CFLAGS := -fvisibility=hidden -fPIC -I../include -I../../out/include
ifeq ($(DEBUG), 1)
CFLAGS += -DDEBUG -ggdb3 -O0 -fdiagnostics-color=always -fverbose-asm
LDFLAGS += -ggdb3 -O0
endif
build: $(OBJECT_NAME)

View File

@@ -6,7 +6,6 @@
#endif
#endif
#ifndef PUBLIC
#define PUBLIC __attribute__((visibility("default")))
#endif // !PUBLIC
@@ -26,19 +25,13 @@ static void __attribute__((constructor, no_stack_protector)) __guard_setup(void)
PUBLIC __attribute__((weak, noreturn, no_stack_protector)) void __stack_chk_fail(void)
{
const char *msg = "Stack smashing detected";
__asm__ __volatile__("syscall"
:
: "a"(0), "D"(0x57AC)
: "rcx", "r11", "memory");
exit(0x57AC);
__builtin_unreachable();
}
PUBLIC __attribute__((weak, noreturn, no_stack_protector)) void __chk_fail(void)
{
const char *msg = "Buffer overflow detected";
__asm__ __volatile__("syscall"
:
: "a"(0), "D"(0xF700)
: "rcx", "r11", "memory");
exit(0xF700);
__builtin_unreachable();
}