Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runtime: make static/dynamic startup detection work with musl on ppc64le
The glibc loader explicitly sets the first doubleword on the stack (R1) to $0 to indicate it was dynamically loaded. An ELFv2 ABI compliant loader will set R3/R4 to argc/argv when starting the process, and R13 to TLS. musl is not compliant. Instead it passes argc/argv like the kernel, but R3/R4 are in an undefined state and R13 is valid. With the knowledge above, the startup code can be modified to dynamically handle all three cases when linked internally. Fixes #51787 Change-Id: I5de33862c161900d9161817388bbc13a65fdc69c Reviewed-on: https://go-review.googlesource.com/c/go/+/394654 Reviewed-by: Cherry Mui <[email protected]> Run-TryBot: Paul Murphy <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Trust: Paul Murphy <[email protected]> Trust: Lynn Boger <[email protected]>
- Loading branch information