This is an archive of the discontinued LLVM Phabricator instance.

[LLD][ELF] - Check options before processing the -v/-version options.
ClosedPublic

Authored by grimar on Oct 15 2018, 3:10 AM.

Details

Summary

This is https://bugs.llvm.org/show_bug.cgi?id=39289.

Currently both gold and bfd report errors about invalid options values
even with -v/-versions. But LLD does not.

This makes complicated to check the options available when LLD is used
(see Linux kernel issue: https://github.com/ClangBuiltLinux/linux/issues/31#issuecomment-429683000)

Patch makes LLD behavior to be consistent with GNU linkers.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Oct 15 2018, 3:10 AM
ruiu accepted this revision.Oct 15 2018, 7:19 AM

Honestly I don't think this is worth "fixing" because this is not a bug. We shouldn't bother copying this much details of GNU linkers' behavior. Being said that, since this patch does not append any complexity to the linker, I'm fine with that. LGTM

This revision is now accepted and ready to land.Oct 15 2018, 7:19 AM
This revision was automatically updated to reflect the committed changes.