-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault on 32-bit arm when built with -mthumb #1
Comments
It's caused by Problematic line is: According to GCC documentation this is supposed to set register used for this variable in I'd say that it's clang bug that this compiled but clobbered frame pointer (gcc fails compilation in this case) Anyway, only loader does need to be compiled without |
Also revert to thumb mode as termux/proot#1 is fixed
Also revert to thumb mode as termux/proot#1 is fixed
Also revert to thumb mode as termux/proot#1 is fixed
First, r7 register used as syscall number, however in thumb mode it is also used as frame pointer so it needs to be saved and restored Second, use "bx" instead of "mov pc", so thumb mode state will be correct when branching from loader to loaded program Fixes #1
@michalbednarski In termux/termux-packages#761 it was noticed that proot segfaults when built with -mthumb on 32-bit arm (which Termux&Android does by default to save binary size, as Thumb-2 seems to be recommended for most).
I worked around it by avoiding building proot with -mthumb in termux/termux-packages@28c436b, so it's not really that important, and I guess 32-bit arm is slowly being deprecated as more and more new devices are 64-bit.
So not worth spending a lot of time on, but still interesting to see if you have an idea what could cause this :).
The text was updated successfully, but these errors were encountered: