Elevate .text.syscall to .privileged
It turns out adding OpenBSD msyscall() origin verification broke the --ftrace flag. The executable needs to issue raw syscalls while it's rewriting itself. So they need to be in the same section, and that's just plain simpler too.
This commit is contained in:
10
ape/ape.lds
10
ape/ape.lds
@ -283,9 +283,6 @@ SECTIONS {
|
||||
KEEP(*(.textwindowsepilogue))
|
||||
*(SORT_BY_ALIGNMENT(.text.modernity))
|
||||
*(SORT_BY_ALIGNMENT(.text.modernity.*))
|
||||
HIDDEN(__text_syscall_start = .);
|
||||
*(.text.syscall .text.syscall.*)
|
||||
HIDDEN(__text_syscall_end = .);
|
||||
*(SORT_BY_ALIGNMENT(.text.hot))
|
||||
*(SORT_BY_ALIGNMENT(.text.hot.*))
|
||||
KEEP(*(.keep.text))
|
||||
@ -309,6 +306,7 @@ SECTIONS {
|
||||
HIDDEN(__test_end = .);
|
||||
. += 1;
|
||||
*(.privileged)
|
||||
HIDDEN(__privileged_end = .);
|
||||
|
||||
/*BEGIN: Read Only Data */
|
||||
|
||||
@ -487,9 +485,9 @@ SHSTUB2(.Lape.macho.dd.skip, RVA(ape.macho) / 8);
|
||||
SHSTUB2(.Lape.macho.dd.count, (.Lape.macho.end - ape.macho) / 8);
|
||||
PFSTUB4(.Lape.pe.offset, ape.pe - ape.mz);
|
||||
|
||||
HIDDEN(__text_syscall_addr = ROUNDDOWN(__text_syscall_start, PAGESIZE));
|
||||
HIDDEN(__text_syscall_size = (ROUNDUP(__text_syscall_end, PAGESIZE) -
|
||||
ROUNDDOWN(__text_syscall_start, PAGESIZE)));
|
||||
HIDDEN(__privileged_addr = ROUNDDOWN(__privileged_start, PAGESIZE));
|
||||
HIDDEN(__privileged_size = (ROUNDUP(__privileged_end, PAGESIZE) -
|
||||
ROUNDDOWN(__privileged_start, PAGESIZE)));
|
||||
|
||||
HIDDEN(.Lape.pe.optsz = .Lape.pe.sections - (ape.pe + 24));
|
||||
HIDDEN(.Lape.pe.shnum = (.Lape.pe.sections_end - .Lape.pe.sections) / 40);
|
||||
|
||||
Reference in New Issue
Block a user