From: Anton Korobeynikov Date: Sun, 29 Mar 2009 17:14:14 +0000 (+0000) Subject: Alpha always requires global relocations to be r/w regardless of PIC. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=01209bc12a6e94dd6ea69ede06ea8091f5a509a0;p=oota-llvm.git Alpha always requires global relocations to be r/w regardless of PIC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68006 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Alpha/AlphaTargetAsmInfo.cpp b/lib/Target/Alpha/AlphaTargetAsmInfo.cpp index 61fcf83385e..6092ab67b5f 100644 --- a/lib/Target/Alpha/AlphaTargetAsmInfo.cpp +++ b/lib/Target/Alpha/AlphaTargetAsmInfo.cpp @@ -16,7 +16,7 @@ using namespace llvm; -AlphaTargetAsmInfo::AlphaTargetAsmInfo(const AlphaTargetMachine &TM) +AlphaTargetAsmInfo::AlphaTargetAsmInfo(const AlphaTargetMachine &TM) : TargetAsmInfo(TM) { AlignmentIsInBytes = false; PrivateGlobalPrefix = "$"; @@ -24,3 +24,8 @@ AlphaTargetAsmInfo::AlphaTargetAsmInfo(const AlphaTargetMachine &TM) JumpTableDataSection = "\t.section .rodata\n"; WeakRefDirective = "\t.weak\t"; } + +unsigned AlphaTargetAsmInfo::RelocBehaviour() const { + return (TM.getRelocationModel() != Reloc::Static ? + Reloc::LocalOrGlobal : Reloc::Global); +} diff --git a/lib/Target/Alpha/AlphaTargetAsmInfo.h b/lib/Target/Alpha/AlphaTargetAsmInfo.h index 0b50de858fc..7675b26f6e8 100644 --- a/lib/Target/Alpha/AlphaTargetAsmInfo.h +++ b/lib/Target/Alpha/AlphaTargetAsmInfo.h @@ -23,6 +23,8 @@ namespace llvm { struct AlphaTargetAsmInfo : public TargetAsmInfo { explicit AlphaTargetAsmInfo(const AlphaTargetMachine &TM); + + virtual unsigned RelocBehaviour() const; }; } // namespace llvm