[PATCH] D38193: Pre compute the tail of the archive

Rafael Ávila de Espíndola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 05:03:51 PDT 2017


rafael created this revision.
Herald added a subscriber: fedor.sergeev.

An archive looks like

<header>
<symbol table>
<tail>

The symbol table refers to offsets in the tail.  A complication is that we would like to support symbol tables that use 64 bit offsets if it turns out that any of the offsets is too big.

This patch changes the archive writer to first compute the tail. We cannot just compute one bit StringRef since that would require reading every member upfront, but we can represent it as a series of StringRefs.

Having done that it is much easier to compute the symbol table and all offsets are computed before it is written. With this if there is an accounting problem it will show up with a regular symbol table, not just when a 64 bit one is needed.

This should help simplify https://reviews.llvm.org/D36812.


https://reviews.llvm.org/D38193

Files:
  lib/Object/ArchiveWriter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38193.116410.patch
Type: text/x-patch
Size: 16607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170925/2b3a6a9e/attachment.bin>


More information about the llvm-commits mailing list