diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-07-18 23:24:01 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-07-18 23:24:01 +0000 |
commit | 50bf9a60e5dee870c574d5c515034803c5a155f7 (patch) | |
tree | b5b3cb4b5e77f1896259e26a28785648e6f14f91 /llvm/lib/Target | |
parent | f03e78f024b7b21b07a4f2b834aa3ecdf1838a1e (diff) | |
download | bcm5719-llvm-50bf9a60e5dee870c574d5c515034803c5a155f7.tar.gz bcm5719-llvm-50bf9a60e5dee870c574d5c515034803c5a155f7.zip |
Use R_X86_64_32S to handle Jump Table Index relocation entries. Hide TAI usage inside getSection* functions
llvm-svn: 76347
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/X86/X86ELFWriterInfo.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86ELFWriterInfo.h | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ELFWriterInfo.cpp b/llvm/lib/Target/X86/X86ELFWriterInfo.cpp index 4e4b6f1d917..9e44f97ca80 100644 --- a/llvm/lib/Target/X86/X86ELFWriterInfo.cpp +++ b/llvm/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/llvm/lib/Target/X86/X86ELFWriterInfo.h b/llvm/lib/Target/X86/X86ELFWriterInfo.h index 7782a5b12fb..e534e17f28a 100644 --- a/llvm/lib/Target/X86/X86ELFWriterInfo.h +++ b/llvm/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; |