Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MC] Don't treat altentry symbols as atoms #97479

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/MC/MCMachOStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ void MCMachOStreamer::finishImpl() {
DenseMap<const MCFragment *, const MCSymbol *> DefiningSymbolMap;
for (const MCSymbol &Symbol : getAssembler().symbols()) {
if (getAssembler().isSymbolLinkerVisible(Symbol) && Symbol.isInSection() &&
!Symbol.isVariable()) {
!Symbol.isVariable() && !cast<MCSymbolMachO>(Symbol).isAltEntry()) {
// An atom defining symbol should never be internal to a fragment.
assert(Symbol.getOffset() == 0 &&
"Invalid offset in atom defining symbol!");
Expand Down
5 changes: 5 additions & 0 deletions llvm/test/MC/MachO/cfi-advance-loc-err.s
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ _foo:
subq $8, %rsp
.cfi_adjust_cfa_offset 8

.alt_entry _bar
_bar: # alt_entry label can appear here as it is not an atom
addq $8, %rsp
.cfi_adjust_cfa_offset -8

tmp0: # non-private label cannot appear here
addq $8, %rsp
# CHECK: :[[#@LINE+1]]:3: error: invalid CFI advance_loc expression
Expand Down
Loading