This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Improve diagnostic messages for move location counter errors.
ClosedPublic

Authored by grimar on Feb 21 2017, 12:42 AM.

Details

Summary

Previously LLD would error out just "ld.lld: error: unable to move location counter backward"
What does not really reveal the place of issue,
Patch adds location to the output.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Feb 21 2017, 12:42 AM
grimar added a subscriber: evgeny777.
This revision was automatically updated to reflect the committed changes.
ruiu added inline comments.Feb 21 2017, 10:00 AM
lld/trunk/ELF/LinkerScript.h
92–94

Performance is not important at all here, so just pass a copy of a std::string instead of std::string &&.

109

This needs a comment.

grimar added inline comments.Feb 22 2017, 1:20 AM
lld/trunk/ELF/LinkerScript.h
109

I wonder if it worth to make Location a member of BaseCommand.
Since we also use it in OutputSectionCommand.
At the same time other commands seems do not need it.

ruiu added inline comments.Feb 22 2017, 10:13 AM
lld/trunk/ELF/LinkerScript.h
109

That's a good point. I guess it might make sense to move it to BaseCommand because basically we need debug info for all commands to print out user-friendly error messages.