mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-21 03:32:21 +00:00
Query section for whether it should be executable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170350 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1c2b2f9c56
commit
788221398a
@ -107,20 +107,18 @@ ObjectImage *RuntimeDyldImpl::loadObject(ObjectBuffer *InputBuffer) {
|
|||||||
SymType == object::SymbolRef::ST_Unknown) {
|
SymType == object::SymbolRef::ST_Unknown) {
|
||||||
uint64_t FileOffset;
|
uint64_t FileOffset;
|
||||||
StringRef SectionData;
|
StringRef SectionData;
|
||||||
|
bool IsCode;
|
||||||
section_iterator si = obj->end_sections();
|
section_iterator si = obj->end_sections();
|
||||||
Check(i->getFileOffset(FileOffset));
|
Check(i->getFileOffset(FileOffset));
|
||||||
Check(i->getSection(si));
|
Check(i->getSection(si));
|
||||||
if (si == obj->end_sections()) continue;
|
if (si == obj->end_sections()) continue;
|
||||||
Check(si->getContents(SectionData));
|
Check(si->getContents(SectionData));
|
||||||
|
Check(si->isText(IsCode));
|
||||||
const uint8_t* SymPtr = (const uint8_t*)InputBuffer->getBufferStart() +
|
const uint8_t* SymPtr = (const uint8_t*)InputBuffer->getBufferStart() +
|
||||||
(uintptr_t)FileOffset;
|
(uintptr_t)FileOffset;
|
||||||
uintptr_t SectOffset = (uintptr_t)(SymPtr -
|
uintptr_t SectOffset = (uintptr_t)(SymPtr -
|
||||||
(const uint8_t*)SectionData.begin());
|
(const uint8_t*)SectionData.begin());
|
||||||
unsigned SectionID =
|
unsigned SectionID = findOrEmitSection(*obj, *si, IsCode, LocalSections);
|
||||||
findOrEmitSection(*obj,
|
|
||||||
*si,
|
|
||||||
SymType == object::SymbolRef::ST_Function,
|
|
||||||
LocalSections);
|
|
||||||
LocalSymbols[Name.data()] = SymbolLoc(SectionID, SectOffset);
|
LocalSymbols[Name.data()] = SymbolLoc(SectionID, SectOffset);
|
||||||
DEBUG(dbgs() << "\tFileOffset: " << format("%p", (uintptr_t)FileOffset)
|
DEBUG(dbgs() << "\tFileOffset: " << format("%p", (uintptr_t)FileOffset)
|
||||||
<< " flags: " << flags
|
<< " flags: " << flags
|
||||||
|
Loading…
x
Reference in New Issue
Block a user