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:
@@ -34,7 +34,7 @@ extern __msabi typeof(VirtualProtect) *const __imp_VirtualProtect;
|
||||
* @return 0 on success, or -1 w/ errno
|
||||
* @see mmap()
|
||||
*/
|
||||
textsyscall int mprotect(void *addr, uint64_t len, int prot) {
|
||||
privileged int mprotect(void *addr, uint64_t len, int prot) {
|
||||
bool cf;
|
||||
int64_t rc;
|
||||
uint32_t oldprot;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.text.syscall
|
||||
.privileged
|
||||
|
||||
__restore_rt_netbsd:
|
||||
mov %r15,%rdi
|
||||
|
||||
Reference in New Issue
Block a user