1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
emacs/exec
Po Lu ebf5bcb9f0 Optimize process execution on Android
* exec/configure.ac (REENTRANT): Remove option for reentrancy.
(PROGRAM_COUNTER, HAVE_SECCOMP): Define register providing the
program counter and enable seccomp if its headers are available.

* exec/exec.c (write_load_command): Avoid defining unused
variable.
(exec_0): Remove code specific to REENTRANT configurations.

* exec/exec.h (struct exec_tracee) <exec_data, data_size>: New
fields for loader instructions and their size.

* exec/exec1.c (main): Call exec_init before forking.

* exec/mipsel-user.h (ELF_NGREG): Delete definition.
(struct mipsel_regs): Reduce number of gregs to 32, but
introduce separate fields for special registers.

* exec/trace.c (use_seccomp_p): New variable; defile to false if
!HAVE_SECCOMP.
(remove_tracee): Cease providing for non-reentrant
configurations.  Release executable data if present.
(handle_clone_prepare): Likewise.  Resume process with
PTRACE_CONT if seccomp-based interception is enabled.
(handle_clone, check_signal): Resume processes as above.
(handle_exec): Divide into two functions, with only rewriting
the system call and generating instructions for the loader
remaining in the first, and copying such instructions into the
loader's stack removed into a new function, `finish_exec'.
(finish_exec): New function.
(handle_readlinkat, handle_openat): Abolish non-REENTRANT
configurations.
(process_system_call): Divide exec system calls into two phases,
disambiguated by the value of tracee->waiting_for_syscall.  Typo
fixes.  Accommodate syscall-exit-stops where the signal was
initially intercepted by `seccomp_system_call'.
(interesting_syscalls): New array.
(ARRAYELTS): New macro.
(seccomp_system_call, establish_seccomp_filter): New function.
(tracing_execve) [HAVE_SECCOMP]: Establish a seccomp filter if
this is to be enabled.
(after_fork): Provide PTRACE_O_TRACESECCOMP.  Resume process
with PTRACE_CONT if seccomp-based interception is enabled.
(exec_waitpid): Resume process with PTRACE_CONT if seccomp-based
interception is enabled.  Dispatch stops identifying as
PTRACE_EVENT_SECCOMP to `seccomp_system_call'.
(exec_init): Establish whether it is possible to enable seccomp.
2024-07-01 18:11:58 +08:00
..
config-mips.m4.in ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
configure.ac Optimize process execution on Android 2024-07-01 18:11:58 +08:00
deps.mk ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
exec.c Optimize process execution on Android 2024-07-01 18:11:58 +08:00
exec.h Optimize process execution on Android 2024-07-01 18:11:58 +08:00
exec1.c Optimize process execution on Android 2024-07-01 18:11:58 +08:00
loader-aarch64.s ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
loader-armeabi.s ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
loader-mips64el.s ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
loader-mipsel.s ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
loader-x86.s Disable preprocessing of assembler files with m4 on non-MIPS systems 2024-06-27 10:15:13 +08:00
loader-x86_64.s Disable preprocessing of assembler files with m4 on non-MIPS systems 2024-06-27 10:15:13 +08:00
Makefile.in Disable preprocessing of assembler files with m4 on non-MIPS systems 2024-06-27 10:15:13 +08:00
mipsel-user.h Optimize process execution on Android 2024-07-01 18:11:58 +08:00
mipsfpu.c ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
mipsfpu.h ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
README
test.c ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
trace.c Optimize process execution on Android 2024-07-01 18:11:58 +08:00

This directory holds the source code to a library used to replace the
`execve' and `execveat' system calls, used by the Android port of
Emacs to start executables without intervention from the system.