[llvm] [X86] Don't convert local function foo in the same section to foo(%rip) when the offset is near INT32_MIN (PR #98438)

James Y Knight via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 14:24:16 PDT 2024


jyknight wrote:

But that's only _one_ of the kinds of errors you can get from such code.

We'll also emit a PC32 relocation -- with the user-specified addend included -- for symbols that are _NOT_ in the same section. It won't be an assembler error, then, but will turn into a linker error. A binary can easily be larger than 256MB, in which case this breaks again.

I really don't think magic numbers are the right answer here. We either need to formalize this sort of code as invalid, or else modify codegen to not use a 32-bit-limited fixup/relocation for code like this.

https://github.com/llvm/llvm-project/pull/98438


More information about the llvm-commits mailing list