This is an archive of the discontinued LLVM Phabricator instance.

A more robust way of testing debug_line parser near the end of module
ClosedPublic

Authored by labath on Aug 6 2019, 1:13 AM.

Details

Summary

While removing -z separate-code makes lld produce place the code at the
end of a segment right now, it's possible that future changes to the
linker will change that, thereby removing the coverage for the changes
in r367983. This patch adds a linker script to one of the line table
tests, which ensures that the code (and its line table) will be placed
at the very end of a module.

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Aug 6 2019, 1:13 AM
MaskRay accepted this revision.Aug 6 2019, 2:29 AM
MaskRay added inline comments.
lit/SymbolFile/DWARF/Inputs/debug-line-basic.script
6 ↗(On Diff #213531)

0 (output section address, addrExpr in lld) can be deleted. For non-SHF_ALLOC sections (.shstrtab .debug_info etc), the address expression is just ignored.

// lld/ELF/LinkerScript.cpp#L772

if ((sec->flags & SHF_ALLOC) && sec->addrExpr)
  setDot(sec->addrExpr, sec->location, false);

(I guess it was retrieved from ld --verbose)

This revision is now accepted and ready to land.Aug 6 2019, 2:29 AM
labath updated this revision to Diff 213845.Aug 7 2019, 4:31 AM
  • remove output section addresses
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2019, 4:34 AM