-Crelocation-model=rwpi
(and possibly others) are unsound due to affecting the ABI
#131300
Labels
C-bug
Category: This is a bug.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
O-AArch64
Armv8-A or later processors in AArch64 mode
O-Arm
Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state
P-medium
Medium priority
This is based on the discussion here; I don't understand much of the underlying technical details unfortunately.
It seems like setting
-Crelocation-model=rwpi
on an ARM target compiles code in a way that it expects a particular register to be reserved for data addressing. However, the standard library is not built with that in mind and can use the register for other purposes. That's clearly unsound, we can now get arbitrary misbehavior because the same register is used in conflicting ways.The text was updated successfully, but these errors were encountered: