[LTO] Handle GlobalIFunc in LTOModule::parseSymbols (#212515)

Avoids the assert immediately below.

Fixes #45694

rdar://182744700
This commit is contained in:
Marina Taylor 2026-07-29 15:04:19 +01:00 committed by GitHub
parent 2faa90a208
commit a463071dc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 1 deletions

View file

@ -611,7 +611,7 @@ void LTOModule::parseSymbols() {
continue;
}
if (getTargetTriple().isOSBinFormatXCOFF() && isa<GlobalIFunc>(GV)) {
if (isa<GlobalIFunc>(GV)) {
addDefinedFunctionSymbol(Sym);
continue;
}

View file

@ -0,0 +1,18 @@
; RUN: llvm-as < %s >%t1
; RUN: llvm-lto -o %t2 %t1
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@f2 = dso_local alias void (), void ()* @f
@f = dso_local ifunc void (), bitcast (i8* ()* @f_ifunc to void ()*)
define internal i8* @f_ifunc() {
entry:
ret i8* bitcast (void ()* @f_impl to i8*)
}
define internal void @f_impl() {
entry:
ret void
}