[ARM] [Windows] Use COFF stubs for calls to extern_weak functions
authorMartin Storsjö <martin@martin.st>
Thu, 19 Dec 2019 12:00:44 +0000 (14:00 +0200)
committerMartin Storsjö <martin@martin.st>
Mon, 23 Dec 2019 10:13:49 +0000 (12:13 +0200)
commitb774aa1011a031b225624277178382bb2db7e26a
treee07213dcc36314ffb90b90fd3c7c56159a9654c9
parent86c9831bb40d2c50c36b748b08a75860c4640875
[ARM] [Windows] Use COFF stubs for calls to extern_weak functions

As the extern_weak target might be missing, resolving to the absolute
address zero, we can't use the normal direct PC-relative branch
instructions (as that would result in relocations out of range).

Instead check the shouldAssumeDSOLocal method and load the address
from a COFF stub.

This matches what was done for X86 in 6bf108d77a3c.

Differential Revision: https://reviews.llvm.org/D71720
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/ARM/tail-call-weak.ll