D35352: [ELF] - Implement filter library support (-F / --filter)

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 07:18:57 PDT 2017


>>> I believe `-F` / `--filter` can be used multiple times, as with `-f`.
>>
>> I think that is true for -f/--auxilary only.
>>
>> LD manual says that: "This option may be specified more than once. The DT_AUXILIARY entries will be created in the order in which they >appear on the command line."
>> https://www.freebsd.org/cgi/man.cgi?ld(1)
>>
>> But it does not say anything about multiple use of '-F/--filter'.
>>
>> And both gold/bfd use only last library passed via -F:
>> ld.bfd -F aa -shared -F dd x.o
>> readelf -a a.out
>
>I think this is a bug in GNU ld. The Solaris linker and library guide
>suggests multiple filtees are allowed: "The /usr/lib/libxnet.so.1
>filter uses multiple filtees. This library provides socket and XTI
>interfaces from /usr/lib/libsocket.so.1, /usr/lib/libnsl.so.1, and
>/usr/lib/libc.so.1."

Interesting. I have no objections to allow multiple common filters then,
it would be consistent with how we handle -f/--auxilary.

FWIW I also noticed another difference in description of feature today.
We allow filters only for DSO (and that is consistent with GNU linkers), 
but Oracle spec says it can be used for dynamic executables: 
"If the link-editor references the standard filter filtee.so.1, 
to create a dynamic executable or shared object, it uses information from the symbol table
 of the filter to satisfy any symbol resolution."

Should we allow -F/-f for PIE then ?

George.


More information about the llvm-commits mailing list