HomePhabricator

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

Description

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

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 (which is usually in
crt0.o), but that doesn't work if the symbol is in an archive file.
This patch is to make it work.

Differential Revision: https://reviews.llvm.org/D43658

Details

Committed
ruiuFeb 22 2018, 5:16 PM
Differential Revision
D43658: Make undefined symbol in DSO to pull out object files from archive files.
Branches
Unknown
Tags
Unknown