[llvm] [M68k] implement -mxgot (PR #119803)

John Paul Adrian Glaubitz via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 17 10:37:38 PDT 2025


glaubitz wrote:

> Reading GCC's `-mxgot` description, it seems like the problem is not about the address of `_GLOBAL_OFFSET_TABLE_` exceeding 16 bits -- it's the _offset_ that gets over 16 bits. That's why they used an example error message "relocation truncated to fit: R_68K_GOT16O foobar", where `GOT16O` is the offset between the beginning of GOT to the target entry.

Isn't the too large offset what the linker in the above `rustc` build is complaining about?

If understand the flag correctly, the backend must emit two instructions instead of one to load offsets larger than 64k. And this is enabled by passing `-mxgot`.

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


More information about the llvm-commits mailing list