musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/crt/rcrt1.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015年10月15日 12:08:51 -0400
committerRich Felker <dalias@aerifal.cx>2015年10月15日 12:08:51 -0400
commit92637bb0d8f13940aebd2a8116cc935c3e7d8266 (patch)
treed3c5f18bda12af14834b0d2eeb484c24e80e3cf0 /crt/rcrt1.c
parent74483c5955a632af5d9a4783cc2b541764450551 (diff)
downloadmusl-92637bb0d8f13940aebd2a8116cc935c3e7d8266.tar.gz
prevent reordering of or1k and powerpc thread pointer loads
other archs use asm for the thread pointer load, so making that asm volatile is sufficient to inform the compiler that it has a "side effect" (crashing or giving the wrong result if the thread pointer was not yet initialized) that prevents reordering. however, powerpc and or1k have dedicated general purpose registers for the thread pointer and did not need to use any asm to access it; instead, "local register variables with a specified register" were used. however, there is no specification for ordering constraints on this type of usage, and presumably use of the thread pointer could be reordered across its initialization. to impose an ordering, I have added empty volatile asm blocks that produce the "local register variable with a specified register" as an output constraint.
Diffstat (limited to 'crt/rcrt1.c')
0 files changed, 0 insertions, 0 deletions
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月26日 14:58:32 +0000

AltStyle によって変換されたページ (->オリジナル) /