aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/ELFCodeEmitter.cpp
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-07-18 19:30:09 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-07-18 19:30:09 +0000
commit171375f73a733edcd7a5f839491cc8da4fdeddfe (patch)
tree4443b1ad020ebce746c558e8da7477ea90337b27 /lib/CodeGen/ELFCodeEmitter.cpp
parent76e7ba893fecd35422719acad5ab19af09bf4139 (diff)
Add support to properly reference private symbols on relocation entries.
Use proper relocation type to build relocations for JumpTables (rodata sections). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76326 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ELFCodeEmitter.cpp')
-rw-r--r--lib/CodeGen/ELFCodeEmitter.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/ELFCodeEmitter.cpp b/lib/CodeGen/ELFCodeEmitter.cpp
index 1d150032c3..6e6ba8ec6a 100644
--- a/lib/CodeGen/ELFCodeEmitter.cpp
+++ b/lib/CodeGen/ELFCodeEmitter.cpp
@@ -20,6 +20,7 @@
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineRelocation.h"
#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetELFWriterInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Support/Debug.h"
@@ -160,6 +161,7 @@ void ELFCodeEmitter::emitJumpTables(MachineJumpTableInfo *MJTI) {
"PIC codegen not yet handled for elf jump tables!");
const TargetAsmInfo *TAI = TM.getTargetAsmInfo();
+ const TargetELFWriterInfo *TEW = TM.getELFWriterInfo();
// Get the ELF Section to emit the jump table
unsigned Align = TM.getTargetData()->getPointerABIAlignment();
@@ -183,9 +185,10 @@ 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();
MachineRelocation MR =
MachineRelocation::getBB(JTSection.size(),
- MachineRelocation::VANILLA,
+ MachineRelTy,
MBBs[mi]);
// Offset of JT 'i' in JT section