llvm-project
aa09dbbb - [RelLookupTableConverter] Drop unnamed_addr to avoid generating GOTPCREL relocations (#142304)

Commit
120 days ago
[RelLookupTableConverter] Drop unnamed_addr to avoid generating GOTPCREL relocations (#142304) Follow https://github.com/llvm/llvm-project/pull/72584#issuecomment-2925759253, the patch will drop the `unnamed_addr` attribute when generating relative lookup tables. I'm not very confident about this patch, but it does resolve https://github.com/rust-lang/rust/issues/140686, https://github.com/rust-lang/rust/issues/141306 and https://github.com/rust-lang/rust/issues/141737. But I don't think this will result in worse problems. > LLVM provides that the calculation of such a constant initializer will not overflow at link time under the medium code model if x is an unnamed_addr function. However, it does not provide this guarantee for a constant initializer folded into a function body. This intrinsic can be used to avoid the possibility of overflows when loading from such a constant. ([‘llvm.load.relative’ Intrinsic](https://llvm.org/docs/LangRef.html#id2592)) This is my concern. I'm not sure how unnamed_addr provides this guarantee, and I haven't found any test cases.
Author
Parents
Loading