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
This commit is contained in:
Bruno Cardoso Lopes
2009-07-18 19:30:09 +00:00
parent 76e7ba893f
commit 171375f73a
7 changed files with 103 additions and 18 deletions
+4 -1
View File
@@ -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