summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-12-24 14:47:52 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-12-24 14:47:52 +0000
commita56ab0ede7a9bcaebde602c1aa06f46667e6741e (patch)
tree9a72fefd5ed68f2abd3cd6955865268f6961e6c5 /llvm/lib
parenta3d54fe0aefb21fda70fece3b7a61ad0b1fc9fdf (diff)
downloadbcm5719-llvm-a56ab0ede7a9bcaebde602c1aa06f46667e6741e.tar.gz
bcm5719-llvm-a56ab0ede7a9bcaebde602c1aa06f46667e6741e.zip
Section relative fixups are a coff concept, not a x86 one. Replace the
x86 specific reloc_coff_secrel32 with a generic FK_SecRel_4. llvm-svn: 147252
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCAsmBackend.cpp6
-rw-r--r--llvm/lib/MC/WinCOFFStreamer.cpp4
-rw-r--r--llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp8
-rw-r--r--llvm/lib/Target/X86/MCTargetDesc/X86FixupKinds.h2
-rw-r--r--llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp2
5 files changed, 12 insertions, 10 deletions
diff --git a/llvm/lib/MC/MCAsmBackend.cpp b/llvm/lib/MC/MCAsmBackend.cpp
index 936ed55e54d..51c397734bb 100644
--- a/llvm/lib/MC/MCAsmBackend.cpp
+++ b/llvm/lib/MC/MCAsmBackend.cpp
@@ -32,7 +32,11 @@ MCAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
{ "FK_GPRel_1", 0, 8, 0 },
{ "FK_GPRel_2", 0, 16, 0 },
{ "FK_GPRel_4", 0, 32, 0 },
- { "FK_GPRel_8", 0, 64, 0 }
+ { "FK_GPRel_8", 0, 64, 0 },
+ { "FK_SecRel_1", 0, 8, 0 },
+ { "FK_SecRel_2", 0, 16, 0 },
+ { "FK_SecRel_4", 0, 32, 0 },
+ { "FK_SecRel_8", 0, 64, 0 }
};
assert((size_t)Kind <= sizeof(Builtins) / sizeof(Builtins[0]) &&
diff --git a/llvm/lib/MC/WinCOFFStreamer.cpp b/llvm/lib/MC/WinCOFFStreamer.cpp
index 3678a589f4e..f2fecae79c8 100644
--- a/llvm/lib/MC/WinCOFFStreamer.cpp
+++ b/llvm/lib/MC/WinCOFFStreamer.cpp
@@ -33,8 +33,6 @@
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/raw_ostream.h"
-#include "../Target/X86/MCTargetDesc/X86FixupKinds.h"
-
using namespace llvm;
namespace {
@@ -303,7 +301,7 @@ void WinCOFFStreamer::EmitCOFFSecRel32(MCSymbol const *Symbol)
DF->addFixup(MCFixup::Create(DF->getContents().size(),
MCSymbolRefExpr::Create (Symbol, getContext ()),
- (MCFixupKind)X86::reloc_coff_secrel32));
+ FK_SecRel_4));
DF->getContents().resize(DF->getContents().size() + 4, 0);
}
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
index 5278fa01d9b..e241cc0f93e 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
@@ -39,17 +39,20 @@ static unsigned getFixupKindLog2Size(unsigned Kind) {
switch (Kind) {
default: assert(0 && "invalid fixup kind!");
case FK_PCRel_1:
+ case FK_SecRel_1:
case FK_Data_1: return 0;
case FK_PCRel_2:
+ case FK_SecRel_2:
case FK_Data_2: return 1;
case FK_PCRel_4:
case X86::reloc_riprel_4byte:
case X86::reloc_riprel_4byte_movq_load:
case X86::reloc_signed_4byte:
case X86::reloc_global_offset_table:
- case X86::reloc_coff_secrel32:
+ case FK_SecRel_4:
case FK_Data_4: return 2;
case FK_PCRel_8:
+ case FK_SecRel_8:
case FK_Data_8: return 3;
}
}
@@ -77,8 +80,7 @@ public:
{ "reloc_riprel_4byte", 0, 4 * 8, MCFixupKindInfo::FKF_IsPCRel },
{ "reloc_riprel_4byte_movq_load", 0, 4 * 8, MCFixupKindInfo::FKF_IsPCRel},
{ "reloc_signed_4byte", 0, 4 * 8, 0},
- { "reloc_global_offset_table", 0, 4 * 8, 0},
- { "reloc_coff_secrel32", 0, 4 * 8, 0}
+ { "reloc_global_offset_table", 0, 4 * 8, 0}
};
if (Kind < FirstTargetFixupKind)
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86FixupKinds.h b/llvm/lib/Target/X86/MCTargetDesc/X86FixupKinds.h
index d6cb39ae9a7..17d242ab761 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86FixupKinds.h
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86FixupKinds.h
@@ -23,8 +23,6 @@ enum Fixups {
reloc_global_offset_table, // 32-bit, relative to the start
// of the instruction. Used only
// for _GLOBAL_OFFSET_TABLE_.
- reloc_coff_secrel32, // PE-COFF section relative 32
- // (only valid for win32 COFF)
// Marker
LastTargetFixupKind,
NumTargetFixupKinds = LastTargetFixupKind - FirstTargetFixupKind
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp
index 9cdfa52aee0..2123acd8842 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp
@@ -55,7 +55,7 @@ unsigned X86WinCOFFObjectWriter::getRelocType(unsigned FixupKind) const {
else
llvm_unreachable("unsupported relocation type");
break;
- case X86::reloc_coff_secrel32:
+ case FK_SecRel_4:
return Is64Bit ? COFF::IMAGE_REL_AMD64_SREL32 : COFF::IMAGE_REL_I386_SECREL;
break;
default:
OpenPOWER on IntegriCloud