[clang] [llvm] [PAC][ELF][AArch64] Support signed personality function pointer (PR #119361)
Daniil Kovalev via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 10 03:39:04 PST 2024
kovdan01 wrote:
@MaskRay Regarding your comment https://github.com/llvm/llvm-project/pull/113148#discussion_r1866992275:
> We should add a subclass of MachineModuleInfoELF similar to `AMDGPUMachineModuleInfo`, then move `HasSignedpersonality` there. Here you can use a static_cast.
Maybe I got your intention wrong, but it looks like that following this approach will complicate things. Since `getObjFileInfo<T>` implicitly creates an instance with type `T` if not created yet, we'll need to add a check against AArch64 each time we call `getObjFileInfo<MachineModuleInfoELF>`, and, if AArch64, use `getObjFileInfo<AArch64MachineModuleInfo>`. Otherwise, we might first create an instance of `MachineModuleInfoELF`, and then try to use it as `AArch64MachineModuleInfo`, which is wrong.
`AMDGPUMachineModuleInfo`, which already exists, is only used in `SIMemoryLegalizer` pass, and is explicitly created. But here we want to change things in common personality-related code, and the target-specific machine module info is stored as pointer to `MachineModuleInfoImpl`.
So, I've reverted the changes from https://github.com/llvm/llvm-project/commit/b4ca8b141b3df8737f0f0d6f64f083fefb403735. Also, I added tests ensuring that w/o the module flag set, we do not sign personality.
https://github.com/llvm/llvm-project/pull/119361
More information about the llvm-commits
mailing list