Check section type rather than assuming it's code when emitting sections while processing relocations.

llvm-svn: 165854
This commit is contained in:
Andrew Kaylor 2012-10-12 23:53:16 +00:00
parent 7e48b252e7
commit 4732872bd2
1 changed files with 7 additions and 1 deletions

View File

@ -413,7 +413,13 @@ void RuntimeDyldELF::processRelocationRef(const ObjRelocationInfo &Rel,
if (si == Obj.end_sections())
llvm_unreachable("Symbol section not found, bad object file format!");
DEBUG(dbgs() << "\t\tThis is section symbol\n");
Value.SectionID = findOrEmitSection(Obj, (*si), true, ObjSectionToID);
// Default to 'true' in case isText fails (though it never does).
bool isCode = true;
si->isText(isCode);
Value.SectionID = findOrEmitSection(Obj,
(*si),
isCode,
ObjSectionToID);
Value.Addend = Addend;
break;
}