Fix line table resolution near the end of a section
authorPavel Labath <pavel@labath.sk>
Tue, 6 Aug 2019 06:52:05 +0000 (06:52 +0000)
committerPavel Labath <pavel@labath.sk>
Tue, 6 Aug 2019 06:52:05 +0000 (06:52 +0000)
commita3bdcdf714bfc914ba61792d38b2383424b9b6e3
tree8e2d92348eaf4eb268e33486bd945efa1295ee3f
parentb50e8c592789bfecb85dca9067c0853ad4d30199
Fix line table resolution near the end of a section

Summary:
lld r367537 changed the way the linker organizes sections and segments.
This exposed an lldb bug and caused some tests to fail.

In all of the failing tests the root cause was the same -- when we were
trying to resolve the last address in the line_table section, we failed
because it pointed past the end of the section.

This patch changes the line table address resolution code to back up the
address by one for end-of-sequence entries. This ensures the address
still points inside a section/module even if the line table sequence
ends at the very end of a section.

It also reverts the linker flags which were added to the failing tests
to restore previous behavior.

Reviewers: clayborg, jingham

Subscribers: mgorny, MaskRay, lldb-commits

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

llvm-svn: 367983
lldb/lit/SymbolFile/DWARF/debug-line-basic.s
lldb/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s
lldb/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s
lldb/lit/SymbolFile/DWARF/dir-separator-posix.s
lldb/lit/SymbolFile/DWARF/dir-separator-windows.s
lldb/source/Symbol/LineTable.cpp