This is PR31128 which complains that we show unclear message when
parsing script like
.= foo
(note: there is no space between `.=')
When LLD see .= foo; it starts reading output section declaration.
It reads section name .=, addess expression foo and expects to see : right after that
all and fails with : expected, but got ; message, which is fully correct in this case,
but not very useful for user who writes simple assignment expression.
FWIW scripts like SECTIONS { .= : { *(.text*) } } are correct, both GNU linkers
would create output section .= in that case, and LLD do the same.
What I suggest is to provide additional error context if available, like this patch do.
It might be better to call this LocationContext if it is specifically going to be used within setLocationContext() and dropLocationContex(). This might help prevent it being used/overwritten in other non LocationContext situations by mistake.