Skip to content

Commit a9cc2af

Browse files
committed
fixup! [BOLT] Offset LPStart to avoid unnecessary instructions
1 parent fbd363e commit a9cc2af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bolt/lib/Core/BinaryEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@ void BinaryEmitter::emitLSDA(BinaryFunction &BF, const FunctionFragment &FF) {
923923
// As a solution, for fixed-address binaries we set LPStart to 0, and for
924924
// position-independent binaries we set LP start to FDE start minus one byte
925925
// for FDEs that start with a landing pad.
926+
const bool NeedsLPAdjustment = !FF.empty() && FF.front()->isLandingPad();
926927
std::function<void(const MCSymbol *)> emitLandingPad;
927928
if (BC.HasFixedLoadAddress) {
928929
Streamer.emitIntValue(dwarf::DW_EH_PE_udata4, 1); // LPStart format
@@ -934,7 +935,6 @@ void BinaryEmitter::emitLSDA(BinaryFunction &BF, const FunctionFragment &FF) {
934935
Streamer.emitIntValue(0, 4);
935936
};
936937
} else {
937-
const bool NeedsLPAdjustment = !FF.empty() && FF.front()->isLandingPad();
938938
if (NeedsLPAdjustment) {
939939
// Use relative LPStart format and emit LPStart as [SymbolStart - 1].
940940
Streamer.emitIntValue(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4, 1);

0 commit comments

Comments
 (0)