mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-25 12:50:00 +00:00
Make sure -use-init-array has intended effect on all AArch64 ELF targets, not just linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198937 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
095f4c451c
commit
ac843ff018
@ -31,12 +31,8 @@ using namespace llvm;
|
||||
|
||||
static TargetLoweringObjectFile *createTLOF(AArch64TargetMachine &TM) {
|
||||
const AArch64Subtarget *Subtarget = &TM.getSubtarget<AArch64Subtarget>();
|
||||
|
||||
if (Subtarget->isTargetLinux())
|
||||
return new AArch64LinuxTargetObjectFile();
|
||||
if (Subtarget->isTargetELF())
|
||||
return new TargetLoweringObjectFileELF();
|
||||
llvm_unreachable("unknown subtarget type");
|
||||
assert (Subtarget->isTargetELF() && "unknown subtarget type");
|
||||
return new AArch64ElfTargetObjectFile();
|
||||
}
|
||||
|
||||
AArch64TargetLowering::AArch64TargetLowering(AArch64TargetMachine &TM)
|
||||
|
@ -17,7 +17,7 @@
|
||||
using namespace llvm;
|
||||
|
||||
void
|
||||
AArch64LinuxTargetObjectFile::Initialize(MCContext &Ctx,
|
||||
AArch64ElfTargetObjectFile::Initialize(MCContext &Ctx,
|
||||
const TargetMachine &TM) {
|
||||
TargetLoweringObjectFileELF::Initialize(Ctx, TM);
|
||||
InitializeELF(TM.Options.UseInitArray);
|
||||
|
@ -20,9 +20,9 @@
|
||||
|
||||
namespace llvm {
|
||||
|
||||
/// AArch64LinuxTargetObjectFile - This implementation is used for linux
|
||||
/// AArch64.
|
||||
class AArch64LinuxTargetObjectFile : public TargetLoweringObjectFileELF {
|
||||
/// AArch64ElfTargetObjectFile - This implementation is used for ELF
|
||||
/// AArch64 targets.
|
||||
class AArch64ElfTargetObjectFile : public TargetLoweringObjectFileELF {
|
||||
virtual void Initialize(MCContext &Ctx, const TargetMachine &TM);
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
; RUN: llc -mtriple=aarch64-none-linux-gnu -verify-machineinstrs -use-init-array < %s | FileCheck %s
|
||||
; RUN: llc -mtriple=aarch64-none-none-eabi -verify-machineinstrs -use-init-array < %s | FileCheck %s
|
||||
|
||||
define internal void @_GLOBAL__I_a() section ".text.startup" {
|
||||
ret void
|
||||
|
Loading…
Reference in New Issue
Block a user