[all-commits] [llvm/llvm-project] 26c90e: [TargetLowering][COFF] Only check shouldAssumeDSOL...
Andy Lim via All-commits
all-commits at lists.llvm.org
Mon Sep 21 18:26:44 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 26c90e1588af2d70ac7cf9b51a01ea56acd9f2cc
https://github.com/llvm/llvm-project/commit/26c90e1588af2d70ac7cf9b51a01ea56acd9f2cc
Author: Andy Lim <andysjlim at chromium.org>
Date: 2026-09-21 (Mon, 21 Sep 2026)
Changed paths:
M llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
M llvm/test/MC/COFF/ir-to-imgrel.ll
Log Message:
-----------
[TargetLowering][COFF] Only check shouldAssumeDSOLocal on GlobalVariable in lowerRelativeReference (#225160)
In #220674, a check was added to lowerRelativeReference requiring that
LHS be dso_local to prevent image-relative relocations for dllimport
variables. However, this check was applied unconditionally to all
GlobalObjects, including functions.
On Windows COFF, dllimport functions are valid targets for
image-relative relocations because the linker provides import thunks in
the local image. In particular, MSVC C++ exception handling metadata
(ThrowInfo and CatchableType) references imported copy constructors and
destructors via image-relative offsets when throwing exception types
across DLL boundaries. Rejecting them caused compilation failures in
downstream projects like PyTorch with:
"error: symbol '__ImageBase' can not be undefined in a subtraction
expression"
Restrict the shouldAssumeDSOLocal check to GlobalVariables only.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list