aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-07-18 23:24:01 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-07-18 23:24:01 +0000
commit2c1fe1aac6032f17855607c46acacb18cf821fde (patch)
tree87ba3192f419d41c3666b79b1ce53db24775976f /lib/Target
parent335149ee052098f92b9b2f8241d9d36baa9e4efd (diff)
downloadexternal_llvm-2c1fe1aac6032f17855607c46acacb18cf821fde.zip
external_llvm-2c1fe1aac6032f17855607c46acacb18cf821fde.tar.gz
external_llvm-2c1fe1aac6032f17855607c46acacb18cf821fde.tar.bz2
Use R_X86_64_32S to handle Jump Table Index relocation entries. Hide TAI usage inside getSection* functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76347 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/X86/X86ELFWriterInfo.cpp1
-rw-r--r--lib/Target/X86/X86ELFWriterInfo.h10
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/Target/X86/X86ELFWriterInfo.cpp b/lib/Target/X86/X86ELFWriterInfo.cpp
index 4e4b6f1..9e44f97 100644
--- a/lib/Target/X86/X86ELFWriterInfo.cpp
+++ b/lib/Target/X86/X86ELFWriterInfo.cpp
@@ -84,6 +84,7 @@ unsigned X86ELFWriterInfo::getRelocationTySize(unsigned RelTy) const {
switch(RelTy) {
case R_X86_64_PC32:
case R_X86_64_32:
+ case R_X86_64_32S:
return 32;
case R_X86_64_64:
return 64;
diff --git a/lib/Target/X86/X86ELFWriterInfo.h b/lib/Target/X86/X86ELFWriterInfo.h
index 7782a5b..e534e17 100644
--- a/lib/Target/X86/X86ELFWriterInfo.h
+++ b/lib/Target/X86/X86ELFWriterInfo.h
@@ -49,6 +49,16 @@ namespace llvm {
/// ELF relocation entry.
virtual bool hasRelocationAddend() const { return is64Bit ? true : false; }
+ /// hasCustomJumpTableIndexRelTy - Returns true if the target has a
+ /// specific relocation type for a jump table index.
+ virtual bool hasCustomJumpTableIndexRelTy() const {
+ return is64Bit ? true : false;
+ }
+
+ /// getJumpTableIndexRelTy - Returns the target specific relocation type
+ /// for a jump table index.
+ virtual unsigned getJumpTableIndexRelTy() const { return R_X86_64_32S; }
+
/// getAddendForRelTy - Gets the addend value for an ELF relocation entry
/// based on the target relocation type
virtual long int getDefaultAddendForRelTy(unsigned RelTy) const;