Imagine we have script with following line:
INPUT(no_such_file)
Previously we would report next error: "cannot open no_such_file: No such file
or directory". It provides no information that file was tried to be opened from
linker script. And it is confusing, because some times we have regular inputs that
looks like libraries, for example libm.so, but they are linker scripts inside.
It is hard to find where error is coming from without debugging.
Patch adds reporting of script file name.
Will it be better if I add following check here ?
It still will be excessive check currently I believe (like I pointed in my previous comment),
but if code outside will change so that this function be called with ErrorCount > 0,
such check will protect error reporting logic this patch introduces.