HomePhabricator

MCObjectStreamer: assign MCSymbols in the dummy fragment to offset 0.
Audit Requiredbf142fc43347

Authored by jyknight on Nov 10 2019, 1:12 PM.

Description

MCObjectStreamer: assign MCSymbols in the dummy fragment to offset 0.

In MCObjectStreamer, when there is no current fragment, initially
symbols are created in a "pending" state and assigned to a dummy
empty fragment.

Previously, they were not being assigned an offset, and thus
evaluateAbsolute would fail if trying to evaluate an expression 'a -
b', where both 'a' and 'b' were in this pending state.

Also slightly refactored the EmitLabel overload which takes an
MCFragment for clarity.

Fixes: https://llvm.org/PR41825

Differential Revision: https://reviews.llvm.org/D70062