Imagine we have archive file with symbols foo and bar.
And script that do foo = 1.
In that case correct behavior is not to fetch symbols from archive but
create absolute symbol.
If we have script zed = foo then symbol foo will be fetched from archive.
Currently we have Opt.ReferencedSymbols list of symbols referenced
by script and create them undefined early. That allows archives fetching logic
to work. That is what LLD already do and it seems everything is fine here.
But during writing D37059 I had to add left side of assignments to
Opt.ReferencedSymbols list because wanted to stop optimizing out
these symbols when LTO is involved (LTO also uses this list).
And today I realized that testcase from this patch would have fail if we
would have it before.
So I suggest to add this testcase to be able to catch such situations
during writing other patches.
I believe you can just feed an empty file by doing llvm-mc -filetype=obj -triple=x86_64-pc-linux -o %t.o < /dev/null so that you can merge this file with the one under Innputs directory.