This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Fix error reporting with --strip-debug/--strip-all.
ClosedPublic

Authored by grimar on Nov 2 2017, 7:23 AM.

Details

Summary

Currently LLD tries to use information about functions and variables location
taking it from debug sections. When --strip-* is given we discard such sections
and that breaks error reporting.
Patch stops discarding such sections and just removes them from InputSections list.

Diff Detail

Event Timeline

grimar created this revision.Nov 2 2017, 7:23 AM
ruiu edited edge metadata.Nov 2 2017, 12:45 PM

I don't think it is a good idea to remove debug sections using the garbage collector. That is unnecessarily complicated. You should simply remove debug sections from InputSections before markLive().

grimar updated this revision to Diff 121443.Nov 3 2017, 1:55 AM
  • Changed implementation.
ruiu accepted this revision.Nov 3 2017, 1:46 PM

LGTM

It's now much better.

ELF/Driver.cpp
1120–1122 ↗(On Diff #121443)

Just the first half should suffice.

// We do not want to emit debug sections if --strip-all or -strip-debug are given.
This revision is now accepted and ready to land.Nov 3 2017, 1:46 PM
grimar edited the summary of this revision. (Show Details)Nov 4 2017, 1:20 AM
This revision was automatically updated to reflect the committed changes.