Add honeybadger to ape.S

This commit is contained in:
Justine Tunney 2021-03-03 15:00:41 -08:00
parent e55e71ab48
commit 1a08594f95
2 changed files with 35 additions and 10 deletions

View file

@ -1393,15 +1393,45 @@ long: push $GDT_LONG_DATA
call __map_phdrs
push $0x037f
fldcw (%rsp)
movabs $1f,%rax
movabs $kernel,%rax
jmp *%rax
1: movabs $ape_stack_vaddr,%rsp
.endfn long
/*
αcτµαlly pδrταblε εxεcµταblε § cosmopolitan libc runtime runtime
*/
kernel: movabs $ape_stack_vaddr,%rsp
add $ape_stack_memsz,%rsp
movl $0,0x7b000 # unmap null 2mb
#if USE_SYMBOL_HACK
.byte 0x0f,0x1f,0207 # nop rdi binbase
.long (IMAGE_BASE_VIRTUAL-IMAGE_BASE_REAL)/512
#endif
movl $0,0x7b000 # unmap null 2mb
.weak __hostos
ezlea __hostos,ax
test %rax,%rax
@ -1426,7 +1456,7 @@ long: push $GDT_LONG_DATA
push $.Larg0 # argv[0]
push $1 # argc
jmp _start
.endfn long
.endfn kernel
.rodata
.Larg0: .asciz "ape.com"