mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
Make it easier to use DwarfContext with MCJIT
Summary: This supersedes http://reviews.llvm.org/D4010, hopefully properly dealing with the JIT case and also adds an actual test case. DwarfContext was basically already usable for the JIT (and back when we were overwriting ELF files it actually worked out of the box by accident), but in order to resolve relocations correctly it needs to know the load address of the section. Rather than trying to get this out of the ObjectFile or requiring the user to create a new ObjectFile just to get some debug info, this adds the capability to pass in that info directly. As part of this I separated out part of the LoadedObjectInfo struct from RuntimeDyld, since it is now required at a higher layer. Reviewers: lhames, echristo Reviewed By: echristo Subscribers: vtjnash, friss, rafael, llvm-commits Differential Revision: http://reviews.llvm.org/D6961 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237961 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1044,6 +1044,19 @@ symbol_iterator COFFObjectFile::getRelocationSymbol(DataRefImpl Rel) const {
|
||||
return symbol_iterator(SymbolRef(Ref, this));
|
||||
}
|
||||
|
||||
section_iterator COFFObjectFile::getRelocationSection(DataRefImpl Rel) const {
|
||||
symbol_iterator Sym = getRelocationSymbol(Rel);
|
||||
if (Sym == symbol_end())
|
||||
return section_end();
|
||||
COFFSymbolRef Symb = getCOFFSymbol(*Sym);
|
||||
if (!Symb.isSection())
|
||||
return section_end();
|
||||
section_iterator Res(section_end());
|
||||
if (getSymbolSection(Sym->getRawDataRefImpl(),Res))
|
||||
return section_end();
|
||||
return Res;
|
||||
}
|
||||
|
||||
std::error_code COFFObjectFile::getRelocationType(DataRefImpl Rel,
|
||||
uint64_t &Res) const {
|
||||
const coff_relocation* R = toRel(Rel);
|
||||
|
Reference in New Issue
Block a user