popcorn-compiler icon indicating copy to clipboard operation
popcorn-compiler copied to clipboard

TLS alignment lead to a not aligned stack on aarch64

Open mohamed-karaoui opened this issue 7 years ago • 2 comments

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

mohamed-karaoui avatar Jan 07 '18 20:01 mohamed-karaoui

@mohamed-karaoui is this issue now closed?

rlyerly avatar Sep 12 '18 21:09 rlyerly

Not sure. I will run the test again on the last master branch, just in case.

mohamed-karaoui avatar Sep 13 '18 00:09 mohamed-karaoui