[BOLT] Ignore empty funcs in relocation mode

Summary:
Make BOLT ignore empty functions (those containing no instructions,
despite having some space allocated to it filled with zeroes).

(cherry picked from FBD15981683)
This commit is contained in:
Rafael Auler 2019-06-24 20:23:22 -07:00 committed by Maksim Panchenko
parent bda13b7dd8
commit db02a1a142
1 changed files with 6 additions and 0 deletions

View File

@ -1329,6 +1329,12 @@ void BinaryFunction::postProcessEntryPoints() {
continue;
}
// If we are at Offset 0 and there is no instruction associated with it,
// this means this is an empty function. Just ignore.
if (Offset == 0) {
continue;
}
errs() << "BOLT-WARNING: reference in the middle of instruction "
"detected in function " << *this
<< " at offset 0x" << Twine::utohexstr(Offset) << '\n';