From bea241a5f5dd3a6f17bf0c968c4a71c5776fbd2a Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Sun, 29 Mar 2009 17:14:35 +0000 Subject: [PATCH] IA64 is as weird as Alpha wrt r/o relocs :) llvm-svn: 68007 --- llvm/lib/Target/IA64/IA64TargetAsmInfo.cpp | 7 +++++++ llvm/lib/Target/IA64/IA64TargetAsmInfo.h | 1 + 2 files changed, 8 insertions(+) diff --git a/llvm/lib/Target/IA64/IA64TargetAsmInfo.cpp b/llvm/lib/Target/IA64/IA64TargetAsmInfo.cpp index 5766e138a3c7..2ae8beb9148e 100644 --- a/llvm/lib/Target/IA64/IA64TargetAsmInfo.cpp +++ b/llvm/lib/Target/IA64/IA64TargetAsmInfo.cpp @@ -12,6 +12,8 @@ //===----------------------------------------------------------------------===// #include "IA64TargetAsmInfo.h" +#include "llvm/Constants.h" +#include "llvm/Target/TargetMachine.h" using namespace llvm; @@ -34,4 +36,9 @@ IA64TargetAsmInfo::IA64TargetAsmInfo(const TargetMachine &TM): ConstantPoolSection = "\n\t.section .data, \"aw\", \"progbits\"\n"; } +unsigned IA64TargetAsmInfo::RelocBehaviour() const { + return (TM.getRelocationModel() != Reloc::Static ? + Reloc::LocalOrGlobal : Reloc::Global); +} + // FIXME: Support small data/bss/rodata sections someday. diff --git a/llvm/lib/Target/IA64/IA64TargetAsmInfo.h b/llvm/lib/Target/IA64/IA64TargetAsmInfo.h index 6c87777f63f8..130822e887f4 100644 --- a/llvm/lib/Target/IA64/IA64TargetAsmInfo.h +++ b/llvm/lib/Target/IA64/IA64TargetAsmInfo.h @@ -24,6 +24,7 @@ namespace llvm { struct IA64TargetAsmInfo : public ELFTargetAsmInfo { explicit IA64TargetAsmInfo(const TargetMachine &TM); + virtual unsigned RelocBehaviour() const; };