The previous line number code flushed immediately when the filename changed. This meant that some instructions after the current row's address could be not marked because they hadn't been passed when the flush happened but were before the address in the row for the new file. This patch changes addLineInfo to flush when adding a row that indicates a file change. Since at that point we know the address of the first instruction from the new file we can mark any previous instructions as being part of the previous file.
The previous line number code flushed immediately when the filename changed. This meant that some instructions after the current row's address could be not marked because they hadn't been passed when the flush happened but were before the address in the row for the new file. This patch changes
addLineInfo
to flush when adding a row that indicates a file change. Since at that point we know the address of the first instruction from the new file we can mark any previous instructions as being part of the previous file.This also removes the special-casing of address 0; it's not mentioned in the DWARF spec and causes issues due to a linker bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24192