This is an archive of the discontinued LLVM Phabricator instance.

Make undefined symbol in DSO to pull out object files from archive files.
ClosedPublic

Authored by ruiu on Feb 22 2018, 4:41 PM.

Details

Summary

We have an internal program that does't link without this patch. I don't
know of any open-source program that needs this, but there might be.
Since this patch improves compatibility with GNU linkers with a few lines
of code, I think it's worth to be committed.

The problem is about undefined symbols in DSOs. Some programs depend on
the GNU linkers' behavior that they pull out object files from archive
files to resolve undefined symbols in DSOs. We already allow that kind of
"reverse" dependency (from DSOs to the main executable) for regular
symbols, in particular, for "__progname" symbol, but that didn't work
if the symbol is in an archive file. This patch is to make it work.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu created this revision.Feb 22 2018, 4:41 PM
ruiu updated this revision to Diff 135569.Feb 22 2018, 5:09 PM
  • updated the test case.
This revision was not accepted when it landed; it landed in state Needs Review.Feb 22 2018, 5:19 PM
This revision was automatically updated to reflect the committed changes.