[llvm-commits] [llvm] r76334 - in /llvm/trunk: include/llvm/Target/TargetELFWriterInfo.h lib/CodeGen/ELFCodeEmitter.cpp lib/Target/X86/X86ELFWriterInfo.cpp lib/Target/X86/X86ELFWriterInfo.h
Bruno Cardoso Lopes
bruno.cardoso at gmail.com
Sat Jul 18 13:52:35 PDT 2009
Author: bruno
Date: Sat Jul 18 15:52:11 2009
New Revision: 76334
URL: http://llvm.org/viewvc/llvm-project?rev=76334&view=rev
Log:
Use a better name for the label relocations while emitting them for Jump Tables
Modified:
llvm/trunk/include/llvm/Target/TargetELFWriterInfo.h
llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp
llvm/trunk/lib/Target/X86/X86ELFWriterInfo.cpp
llvm/trunk/lib/Target/X86/X86ELFWriterInfo.h
Modified: llvm/trunk/include/llvm/Target/TargetELFWriterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetELFWriterInfo.h?rev=76334&r1=76333&r2=76334&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetELFWriterInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetELFWriterInfo.h Sat Jul 18 15:52:11 2009
@@ -106,7 +106,7 @@
/// getJumpTableRelocationTy - Returns the machine relocation type used
/// to reference a jumptable.
- virtual unsigned getJumpTableMachineRelocationTy() const = 0;
+ virtual unsigned getAbsoluteLabelMachineRelTy() const = 0;
};
} // end llvm namespace
Modified: llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp?rev=76334&r1=76333&r2=76334&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp (original)
+++ llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp Sat Jul 18 15:52:11 2009
@@ -185,7 +185,7 @@
// 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,
Modified: llvm/trunk/lib/Target/X86/X86ELFWriterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ELFWriterInfo.cpp?rev=76334&r1=76333&r2=76334&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ELFWriterInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ELFWriterInfo.cpp Sat Jul 18 15:52:11 2009
@@ -102,7 +102,8 @@
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;
}
Modified: llvm/trunk/lib/Target/X86/X86ELFWriterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ELFWriterInfo.h?rev=76334&r1=76333&r2=76334&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ELFWriterInfo.h (original)
+++ llvm/trunk/lib/Target/X86/X86ELFWriterInfo.h Sat Jul 18 15:52:11 2009
@@ -58,7 +58,7 @@
/// getJumpTableRelocationTy - Returns the machine relocation type used
/// to reference a jumptable.
- virtual unsigned getJumpTableMachineRelocationTy() const;
+ virtual unsigned getAbsoluteLabelMachineRelTy() const;
};
} // end llvm namespace
More information about the llvm-commits
mailing list