Update EnableTaggingAbi for RISC-V Linux.
GCC now correctly enables pointer tagging in the userspace ABI for RISC-V Linux, fixing an error during HWASAN initialization.
This commit updates the EnableTaggingAbi function for RISC-V Linux to correctly request the required number of masked pointer bits. Previously, an error occurred when enabling the tagged address syscall ABI, particularly when using HWASAN with the Spike simulator. This fix ensures that the tagged address syscall ABI can be successfully enabled, facilitating HWASAN support on RISC-V.
In Details
This patch addresses an issue in the RISC-V HWASAN initialization within GCC. The EnableTaggingAbi function now correctly requests the necessary masked pointer bits, resolving a failure when enabling the tagged address syscall ABI. This change is crucial for developers working with memory safety on RISC-V using HWASAN and impacts the runtime initialization process.
For Context
Pointer tagging is a security feature used to detect memory errors by adding extra bits to pointers that can be checked at runtime. HWASAN (Hardware-assisted AddressSanitizer) is a tool that uses pointer tagging to detect memory safety violations. This commit ensures that GCC correctly enables pointer tagging when running programs on RISC-V Linux, which is essential for using HWASAN to find and fix memory-related bugs. The update resolves an error during HWASAN initialization, improving the toolchain's memory safety capabilities for RISC-V systems.