When using TLS, the size of the section may lead to having a not aligned stack on aarch64: the TLS is allocated at the same time as the stack within pthread_create().
This problem is confirmed by the kernel dmesg message:
"SP Alignment exception: pc=0000000000508d10 sp=00007ffff6b2a9a8"
A test that show the problem is in the "popcorn-test" repos in the "tls-test" test.
Two possible solutions:
1) Align the TLS section in the LDSCRIPT
2) Modify the musl library to make sure that the stack is aligned
When using TLS, the size of the section may lead to having a not aligned stack on aarch64: the TLS is allocated at the same time as the stack within pthread_create().
This problem is confirmed by the kernel dmesg message: "SP Alignment exception: pc=0000000000508d10 sp=00007ffff6b2a9a8"
A test that show the problem is in the "popcorn-test" repos in the "tls-test" test.
Two possible solutions: 1) Align the TLS section in the LDSCRIPT 2) Modify the musl library to make sure that the stack is aligned