[PATCH] D117284: [ELF] Allow non-bitcode archive with an empty index

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 19 07:51:41 PST 2022


bd1976llvm added a comment.

In D117284#3254734 <https://reviews.llvm.org/D117284#3254734>, @peter.smith wrote:

> No objections. Reading your blog post and my copy of Linkers and Loaders it does seem that early linkers would handle archives with indexes, it just seems like indexes were ubiquitous when GNU ld were written. So it does seem like rejecting archives without an index is a property of the implentation of GNU ld rather than something that should be relied upon.

I'm in favour of this change but I think it is quite easy to make the argument both ways. Links which rely on complex GNU archive symbol resolution behaviour could be easily be broken - so insisting that archives have symbol tables makes sense for GNU linkers.

Rant: Archives are now terrible!

- The format is very old and as pointed out in the description here the index is not efficient.
- Low utilisation archives + complex GNU archive symbol resolution rules make implementing any sort of parallel scanning difficult.
- It's also not true to say that thin archives can always be a replacement as thin archives are not suitable for distribution.

LLD's simplified archive semantics are a good improvement though :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117284/new/

https://reviews.llvm.org/D117284



More information about the llvm-commits mailing list