From cd5e62bbe8234233679861f7421b850ff832efd5 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sun, 5 Sep 2010 22:00:41 +0000 Subject: PLUGINS: Added _segmentVMA to the MIPS loader. Also added 2 TODOs for all loaders not respection that offset. svn-id: r52577 --- backends/plugins/elf/arm-loader.cpp | 2 +- backends/plugins/elf/mips-loader.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backends/plugins/elf/arm-loader.cpp b/backends/plugins/elf/arm-loader.cpp index 388723eafb..5dbbe3ff04 100644 --- a/backends/plugins/elf/arm-loader.cpp +++ b/backends/plugins/elf/arm-loader.cpp @@ -59,7 +59,7 @@ bool ARMDLObject::relocate(Elf32_Off offset, Elf32_Word size, byte *relSegment) // Get the symbol this relocation entry is referring to Elf32_Sym *sym = _symtab + (REL_INDEX(rel[i].r_info)); - // Get the target instruction in the code + // Get the target instruction in the code. TODO: repect _segmentVMA uint32 *target = (uint32 *)((byte *)relSegment + rel[i].r_offset); uint32 origTarget = *target; //Save for debugging diff --git a/backends/plugins/elf/mips-loader.cpp b/backends/plugins/elf/mips-loader.cpp index 0fc1ca8728..af8c70fcf6 100644 --- a/backends/plugins/elf/mips-loader.cpp +++ b/backends/plugins/elf/mips-loader.cpp @@ -69,7 +69,7 @@ bool MIPSDLObject::relocate(Elf32_Off offset, Elf32_Word size, byte *relSegment) // Get the symbol this relocation entry is referring to Elf32_Sym *sym = _symtab + (REL_INDEX(rel[i].r_info)); - // Get the target instruction in the code + // Get the target instruction in the code. TODO: repect _segmentVMA uint32 *target = (uint32 *)((byte *)relSegment + rel[i].r_offset); uint32 origTarget = *target; // Save for debugging @@ -288,6 +288,7 @@ bool MIPSDLObject::loadSegment(Elf32_Phdr *phdr) { // Get offset to load segment into baseAddress = _segment + phdr->p_vaddr; _segmentSize = phdr->p_memsz; + _segmentVMA = phdr->p_vaddr; // Set .bss segment to 0 if necessary if (phdr->p_memsz > phdr->p_filesz) { -- cgit v1.2.3