mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-30 04:35:00 +00:00
Handle ctor/init_array initialization.
Hexagon was not calling InitializeELF and could not select between ctors and init_array. Phabricator revision: http://reviews.llvm.org/D6061 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221156 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
87dc149162
commit
0fc1662219
@ -31,7 +31,7 @@ static cl::opt<int> SmallDataThreshold("hexagon-small-data-threshold",
|
||||
void HexagonTargetObjectFile::Initialize(MCContext &Ctx,
|
||||
const TargetMachine &TM) {
|
||||
TargetLoweringObjectFileELF::Initialize(Ctx, TM);
|
||||
|
||||
InitializeELF(TM.Options.UseInitArray);
|
||||
|
||||
SmallDataSection =
|
||||
getContext().getELFSection(".sdata", ELF::SHT_PROGBITS,
|
||||
|
14
test/CodeGen/Hexagon/ctor.ll
Normal file
14
test/CodeGen/Hexagon/ctor.ll
Normal file
@ -0,0 +1,14 @@
|
||||
; RUN: llc -march=hexagon < %s | FileCheck -check-prefix=INITARRAY %s
|
||||
; RUN: llc -march=hexagon < %s -use-ctors | FileCheck -check-prefix=CTOR %s
|
||||
|
||||
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_P10066.ii, i8* null }]
|
||||
define internal void @_GLOBAL__sub_I_P10066.ii() {
|
||||
entry:
|
||||
ret void
|
||||
}
|
||||
|
||||
;CTOR: .section .ctors
|
||||
;CTOR-NOT: section .init_array
|
||||
|
||||
;INITARRAY: section .init_array
|
||||
;INITARRAY-NOT: .section .ctors
|
Loading…
x
Reference in New Issue
Block a user