forked from OSchip/llvm-project
parent
96d06c6972
commit
fe796dca90
|
@ -175,8 +175,8 @@ static std::string computeDataLayout(const Triple &TT, StringRef CPU,
|
||||||
static Reloc::Model getEffectiveRelocModel(const Triple &TT,
|
static Reloc::Model getEffectiveRelocModel(const Triple &TT,
|
||||||
Optional<Reloc::Model> RM) {
|
Optional<Reloc::Model> RM) {
|
||||||
if (!RM.hasValue())
|
if (!RM.hasValue())
|
||||||
// Default relocation model on Darwin is PIC, not DynamicNoPIC.
|
// Default relocation model on Darwin is PIC.
|
||||||
return TT.isOSDarwin() ? Reloc::PIC_ : Reloc::DynamicNoPIC;
|
return TT.isOSBinFormatMachO() ? Reloc::PIC_ : Reloc::Static;
|
||||||
|
|
||||||
// DynamicNoPIC is only used on darwin.
|
// DynamicNoPIC is only used on darwin.
|
||||||
if (*RM == Reloc::DynamicNoPIC && !TT.isOSDarwin())
|
if (*RM == Reloc::DynamicNoPIC && !TT.isOSDarwin())
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
; RUN: llc -mtriple=armv7-linux-gnu -O0 < %s
|
||||||
|
@a = external global i32
|
||||||
|
define i32* @get() {
|
||||||
|
ret i32* @a
|
||||||
|
}
|
Loading…
Reference in New Issue