[all-commits] [llvm/llvm-project] 6daa4b: [LLD] [COFF] Warn about pseudo relocations that ar...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Tue Jul 11 13:43:52 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6daa4b90e28ef4789ae0eb3163c6770c110d3a28
  Author: Martin Storsjö <martin at martin.st>
  Date:   2023-07-11 (Tue, 11 Jul 2023)

  Changed paths:
    M lld/COFF/Chunks.cpp
    M lld/test/CMakeLists.txt
    A lld/test/COFF/autoimport-nowarn.s
    A lld/test/COFF/autoimport-warn.s

  Log Message:
  [LLD] [COFF] Warn about pseudo relocations that are too narrow

In 64 bit mode, any references to symbols that might end up autoimported
must be made via full 64 bit pointers (usually in .refptr stubs
generated by the compiler).

If referenced via e.g. a 32 bit rip relative offset, it might work
as long as DLLs are loaded close together in the 64 bit address
space, but will fail surprisingly later if they happen to be loaded
further apart. Any cases of that happening is usually a toolchain
error, and the sooner we can warn about it, the easier it is to diagnose.

Differential Revision: https://reviews.llvm.org/D154777

More information about the All-commits mailing list