git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271111
91177308-0d34-0410-b5e6-
96231b3b80d8
static Reloc::Model getEffectiveRelocModel(const Triple &TT,
Optional<Reloc::Model> RM) {
if (!RM.hasValue())
- // Default relocation model on Darwin is PIC, not DynamicNoPIC.
- return TT.isOSDarwin() ? Reloc::PIC_ : Reloc::DynamicNoPIC;
+ // Default relocation model on Darwin is PIC.
+ return TT.isOSBinFormatMachO() ? Reloc::PIC_ : Reloc::Static;
// DynamicNoPIC is only used on darwin.
if (*RM == Reloc::DynamicNoPIC && !TT.isOSDarwin())
--- /dev/null
+; RUN: llc -mtriple=armv7-linux-gnu -O0 < %s
+@a = external global i32
+define i32* @get() {
+ ret i32* @a
+}