Skip to content

Commit 48263bd

Browse files
committed
Revert "[MC] Remove assert to work around BOLT"
This reverts commit c72cb27. The patch was not reviewed, and this assertion guards against incorrect values for symbols if the linker decides to modify the layout as it happens on some platforms. getSymbolOffset() is used for code size estimation, among others. Reverting for now, until we get proper code review and undersatnding of the implications.
1 parent 70969df commit 48263bd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/lib/MC/MCAssembler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ bool MCAssembler::getSymbolOffset(const MCSymbol &S, uint64_t &Val) const {
538538
}
539539

540540
uint64_t MCAssembler::getSymbolOffset(const MCSymbol &S) const {
541+
assert(HasLayout);
541542
uint64_t Val;
542543
getSymbolOffsetImpl(*this, S, true, Val);
543544
return Val;

0 commit comments

Comments
 (0)