diff options
author | Andrew Kaylor <andrew.kaylor@intel.com> | 2012-11-02 19:45:23 +0000 |
---|---|---|
committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2012-11-02 19:45:23 +0000 |
commit | fb05a50f6bf860dd051853e1c822fcbebe75fb47 (patch) | |
tree | ccd333195bd7ebf68b6dc371ef3b60f378826830 /llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp | |
parent | 84dcccd14bc5daf4a1ae356d1acbfc81528ea460 (diff) | |
download | bcm5719-llvm-fb05a50f6bf860dd051853e1c822fcbebe75fb47.tar.gz bcm5719-llvm-fb05a50f6bf860dd051853e1c822fcbebe75fb47.zip |
Change resolveRelocation parameters so the relocations can find placeholder values in the original object buffer.
Some ELF relocations require adding the a value to the original contents of the object buffer at the specified location. In order to properly handle multiple applications of a relocation, the RuntimeDyld code should be grabbing the original value from the object buffer and writing a new value into the loaded section buffer. This patch changes the parameters passed to resolveRelocations to accommodate this need.
llvm-svn: 167304
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp index 141836fc417..950b4208a9f 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp @@ -404,14 +404,14 @@ void RuntimeDyldImpl::resolveRelocationEntry(const RelocationEntry &RE, uint64_t Value) { // Ignore relocations for sections that were not loaded if (Sections[RE.SectionID].Address != 0) { - uint8_t *Target = Sections[RE.SectionID].Address + RE.Offset; DEBUG(dbgs() << "\tSectionID: " << RE.SectionID - << " + " << RE.Offset << " (" << format("%p", Target) << ")" + << " + " << RE.Offset << " (" + << format("%p", Sections[RE.SectionID].Address + RE.Offset) << ")" << " RelType: " << RE.RelType << " Addend: " << RE.Addend << "\n"); - resolveRelocation(Target, Sections[RE.SectionID].LoadAddress + RE.Offset, + resolveRelocation(Sections[RE.SectionID], RE.Offset, Value, RE.RelType, RE.Addend); } } |