1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Fix default reloc model on ARM.

llvm-svn: 271111
This commit is contained in:
Rafael Espindola 2016-05-28 10:41:15 +00:00
parent d192dcda66
commit e3a90de4ca
2 changed files with 7 additions and 2 deletions

View File

@ -175,8 +175,8 @@ static std::string computeDataLayout(const Triple &TT, StringRef CPU,
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())

View File

@ -0,0 +1,5 @@
; RUN: llc -mtriple=armv7-linux-gnu -O0 < %s
@a = external global i32
define i32* @get() {
ret i32* @a
}