forked from OSchip/llvm-project
[BOLT] Fixes for scanExternalRefs()
Summary: In my previous commit, I've accidentally reverted the condition while evaluating a branch target. Also, do not emit instruction for relocation purposes in scanExternalRefs() if there was no TargetSymbol set and we have not produced new relocations. (cherry picked from FBD22169317)
This commit is contained in:
parent
8374e8e3fe
commit
0403adde32
|
@ -1463,8 +1463,8 @@ bool BinaryFunction::scanExternalRefs() {
|
|||
IsPCRel = true;
|
||||
}
|
||||
} else if (BC.MIB->isCall(Instruction) || BC.MIB->isBranch(Instruction)) {
|
||||
if (!BC.MIB->evaluateBranch(Instruction, AbsoluteInstrAddr, Size,
|
||||
TargetAddress)) {
|
||||
if (BC.MIB->evaluateBranch(Instruction, AbsoluteInstrAddr, Size,
|
||||
TargetAddress)) {
|
||||
IsBranch = true;
|
||||
}
|
||||
}
|
||||
|
@ -1525,7 +1525,7 @@ bool BinaryFunction::scanExternalRefs() {
|
|||
HasRel = true;
|
||||
}
|
||||
|
||||
if (!IsBranch && !IsPCRel && !HasRel)
|
||||
if (!TargetSymbol && !HasRel)
|
||||
continue;
|
||||
|
||||
// Emit the instruction using temp emitter and generate relocations.
|
||||
|
|
Loading…
Reference in New Issue