This patch adds AsNeeded and IsUsed bool fields to SharedFile. AsNeeded bit
is set if the DSO is enclosed with --as-needed and --no-as-needed. IsUsed
bit is off by default. When we adds a symbol to the symbol table for dynamic
linking, we set its SharedFile's IsUsed bit.
If AsNeeded is set but IsUsed is not set, we don't want to write that
file's SO name to DT_NEEDED field.
I don't think this correctly handles weak symbols.
It should not set the bit if the symbol is only used to satisfy a weak undefined. For that it looks like you need to fetch the original SymbolBody, not the replacement.