소스 검색

fix tls access on arm targets before armv6k

commit 610c5a8524c3d6cd3ac5a5f1231422e7648a3791 changed the thread
pointer setup so tp points at the end of the pthread struct on arm,
but failed to update __aeabi_read_tp so it was off by 8.

this broke tls access in code that is compiled with -mtp=soft, which
is the default when target arch is pre armv6k or thumb1.

maintainer's note: no release versions are affected.
Szabolcs Nagy 6 년 전
부모
커밋
c06c1eb661
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/thread/arm/__aeabi_read_tp_c.c

+ 1 - 1
src/thread/arm/__aeabi_read_tp_c.c

@@ -4,5 +4,5 @@
 __attribute__((__visibility__("hidden")))
 void *__aeabi_read_tp_c(void)
 {
-	return (void *)((uintptr_t)__pthread_self()-8+sizeof(struct pthread));
+	return TP_ADJ(__pthread_self());
 }