mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-20 03:23:01 +02:00
Fix default reloc model on ARM.
llvm-svn: 271111
This commit is contained in:
parent
d192dcda66
commit
e3a90de4ca
@ -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())
|
||||||
|
5
test/CodeGen/ARM/default-reloc.ll
Normal file
5
test/CodeGen/ARM/default-reloc.ll
Normal file
@ -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
Block a user