When error, this adds the text line of script to the output
and a marks exact incorrect token under it:
line 1: <error text here>
UNKNOWN_TAG {
      ^|  Differential  D18699  
[ELF] - Teach linkerscript error handler to show full script line + column marker on error. Authored by grimar on Apr 1 2016, 9:58 AM. 
Details 
 When error, this adds the text line of script to the output line 1: <error text here>
UNKNOWN_TAG {
      ^
Diff Detail Event Timeline
 Comment Actions Let's define StringRef getLine(StringRef S, size_t Pos) which returns a line where the character S[Pos] belongs to. You can define that function using StringRef::rfind and StringRef::find (so you don't need a hand-written for loop.) That helper function should make things simpler. 
 
 
 
 
 Comment Actions 
 Comment Actions Looks much better. 
 Comment Actions 
 
 
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The string manipulation in this function seem a bit too complicated. StringRef provides a good set of utility functions to make this kind of stuff easy. Can you rewrite it with them?