llvm.org GIT mirror llvm / d5a280d
Merging r198937: ------------------------------------------------------------------------ r198937 | kristof.beyls | 2014-01-10 08:41:49 -0500 (Fri, 10 Jan 2014) | 2 lines 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/branches/release_34@206065 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 6 years ago
4 changed file(s) with 16 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
3030
3131 static TargetLoweringObjectFile *createTLOF(AArch64TargetMachine &TM) {
3232 const AArch64Subtarget *Subtarget = &TM.getSubtarget();
33
34 if (Subtarget->isTargetLinux())
35 return new AArch64LinuxTargetObjectFile();
36 if (Subtarget->isTargetELF())
37 return new TargetLoweringObjectFileELF();
38 llvm_unreachable("unknown subtarget type");
33 assert (Subtarget->isTargetELF() && "unknown subtarget type");
34 return new AArch64ElfTargetObjectFile();
3935 }
4036
4137 AArch64TargetLowering::AArch64TargetLowering(AArch64TargetMachine &TM)
2121 TargetLoweringObjectFileELF::Initialize(Ctx, TM);
2222 InitializeELF(TM.Options.UseInitArray);
2323 }
24
25 void
26 AArch64ElfTargetObjectFile::Initialize(MCContext &Ctx,
27 const TargetMachine &TM) {
28 TargetLoweringObjectFileELF::Initialize(Ctx, TM);
29 InitializeELF(TM.Options.UseInitArray);
30 }
1919
2020 namespace llvm {
2121
22 /// AArch64LinuxTargetObjectFile - This implementation is used for linux
23 /// AArch64.
22 /// AArch64ElfTargetObjectFile - This implementation is used for ELF
23 /// AArch64 targets.
24 class AArch64ElfTargetObjectFile : public TargetLoweringObjectFileELF {
25 virtual void Initialize(MCContext &Ctx, const TargetMachine &TM);
26 };
27
2428 class AArch64LinuxTargetObjectFile : public TargetLoweringObjectFileELF {
2529 virtual void Initialize(MCContext &Ctx, const TargetMachine &TM);
2630 };
0 ; RUN: llc -mtriple=aarch64-none-linux-gnu -verify-machineinstrs -use-init-array < %s | FileCheck %s
1 ; RUN: llc -mtriple=aarch64-none-none-eabi -verify-machineinstrs -use-init-array < %s | FileCheck %s
12
23 define internal void @_GLOBAL__I_a() section ".text.startup" {
34 ret void