[PATCH] D100651: [AIX] Support of Big archive (read)

Guesnet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 23 08:18:00 PDT 2021


EGuesnet added a comment.

Hi @jhenderson,
I cannot follow exactly what you propose, because `llvm-ar` (and maybe other tools) uses directly `child_iterator`. As this object does not have access to Archive (=Parent), it seems difficult to transfert Child vector of Archive to child_iterator. Moreover, I want to avoid to un-const Parent in Child.

Using the same idea, but not the same exact way, I propose:

- Move `FixedLengthHeader` on Archive, and use it for Big Archive only.
- Deal with first read (Fixed Length Header) in Archive creation, so any Child after do not care about it (one of the reason of `static` variable in previous version).
- To distinguish Object and Member Table, I cannot use Next Member in Object Header, because it points to Member Table in the last Object; I cannot use Offset to Member Table of Fixed Length Header, because I do not memorize the current position. So, I use a trick: an Object must have a name (adding empty-file to an archive is non valid), and Member Table Header does not have name, so name field is "`\n" (terminator).
- The `child_begin_bigarchive()` function is equivalent to `child_begin()`, but it deals correctly with Fixed Length Header.

`getSize()` and Big Archive Header initialiser are simplified, differences between usual Archive and Big Archive is deal during Child and Archive initialisation (so, correctly separated).

Free List is not yet supported: if you remove object in Archive, it will become unreadable by LLVM. Free List is complex, and not fully documented. I use `report_fatal_error()` if Free List is present in Archive (so, not 0), or if it is impossible to read it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100651



More information about the llvm-commits mailing list