Alpha always requires global relocations to be r/w regardless of PIC.
authorAnton Korobeynikov <asl@math.spbu.ru>
Sun, 29 Mar 2009 17:14:14 +0000 (17:14 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Sun, 29 Mar 2009 17:14:14 +0000 (17:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68006 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Alpha/AlphaTargetAsmInfo.cpp
lib/Target/Alpha/AlphaTargetAsmInfo.h

index 61fcf83385eede6ed748cab12beecdc165fe3409..6092ab67b5fc959ae5042e3c3e8efb2280f4f388 100644 (file)
@@ -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);
+}
index 0b50de858fc117d245b272dd9393c088a873de7a..7675b26f6e81572c8c0be5456a954de41726f6a8 100644 (file)
@@ -23,6 +23,8 @@ namespace llvm {
 
   struct AlphaTargetAsmInfo : public TargetAsmInfo {
     explicit AlphaTargetAsmInfo(const AlphaTargetMachine &TM);
+
+    virtual unsigned RelocBehaviour() const;
   };
 
 } // namespace llvm