summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-07-18 20:52:11 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-07-18 20:52:11 +0000
commit617dd7baa6dfd3a7b5ee72ace37f6b6aeaa6006b (patch)
tree8163212cd30fad3f727b18b255eba3ce04d29899 /lib
parentf689fa185f8469f595222bff41b7e8f41bda2bef (diff)
downloadllvm-617dd7baa6dfd3a7b5ee72ace37f6b6aeaa6006b.tar.gz
llvm-617dd7baa6dfd3a7b5ee72ace37f6b6aeaa6006b.tar.bz2
llvm-617dd7baa6dfd3a7b5ee72ace37f6b6aeaa6006b.tar.xz
Use a better name for the label relocations while emitting them for Jump Tables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76334 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/ELFCodeEmitter.cpp2
-rw-r--r--lib/Target/X86/X86ELFWriterInfo.cpp5
-rw-r--r--lib/Target/X86/X86ELFWriterInfo.h2
3 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/ELFCodeEmitter.cpp b/lib/CodeGen/ELFCodeEmitter.cpp
index 6e6ba8ec6a..6e50246594 100644
--- a/lib/CodeGen/ELFCodeEmitter.cpp
+++ b/lib/CodeGen/ELFCodeEmitter.cpp
@@ -185,7 +185,7 @@ void ELFCodeEmitter::emitJumpTables(MachineJumpTableInfo *MJTI) {
// Each MBB entry in the Jump table section has a relocation entry
// against the current text section.
for (unsigned mi = 0, me = MBBs.size(); mi != me; ++mi) {
- unsigned MachineRelTy = TEW->getJumpTableMachineRelocationTy();
+ unsigned MachineRelTy = TEW->getAbsoluteLabelMachineRelTy();
MachineRelocation MR =
MachineRelocation::getBB(JTSection.size(),
MachineRelTy,
diff --git a/lib/Target/X86/X86ELFWriterInfo.cpp b/lib/Target/X86/X86ELFWriterInfo.cpp
index 4002e26530..4e4b6f1d91 100644
--- a/lib/Target/X86/X86ELFWriterInfo.cpp
+++ b/lib/Target/X86/X86ELFWriterInfo.cpp
@@ -102,7 +102,8 @@ unsigned X86ELFWriterInfo::getRelocationTySize(unsigned RelTy) const {
return 0;
}
-unsigned X86ELFWriterInfo::getJumpTableMachineRelocationTy() const {
- return X86::reloc_absolute_dword;
+unsigned X86ELFWriterInfo::getAbsoluteLabelMachineRelTy() const {
+ return is64Bit ?
+ X86::reloc_absolute_dword : X86::reloc_absolute_word;
}
diff --git a/lib/Target/X86/X86ELFWriterInfo.h b/lib/Target/X86/X86ELFWriterInfo.h
index f372658f70..7782a5b12f 100644
--- a/lib/Target/X86/X86ELFWriterInfo.h
+++ b/lib/Target/X86/X86ELFWriterInfo.h
@@ -58,7 +58,7 @@ namespace llvm {
/// getJumpTableRelocationTy - Returns the machine relocation type used
/// to reference a jumptable.
- virtual unsigned getJumpTableMachineRelocationTy() const;
+ virtual unsigned getAbsoluteLabelMachineRelTy() const;
};
} // end llvm namespace