[PATCH] D55860: [Object] Deduplicate long archive member names

Peter Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 19 02:12:46 PST 2018


Lekensteyn added a comment.

In D55860#1335943 <https://reviews.llvm.org/D55860#1335943>, @mstorsjo wrote:

> I'm not intimately familiar with the structure of ar files, but the change looks like it makes sense to me at least. Does MSVC link.exe produce import libraries with deduplicated member names as well?


Yes it does deduplicate and use `/0` for every archive member File ID.

Additional differences with MSVC which does not appear to have a noticable functional impact:

- LLVM produces string table entries terminated with `/\n` while MSVC uses `\0`. The PE Format documentation <https://docs.microsoft.com/en-us/windows/desktop/Debug/pe-format#longnames-member> says: "The strings are null-terminated. Each string begins immediately after the null byte in the previous string."
- MSVC creates an additional Second Linker Member <https://docs.microsoft.com/en-us/windows/desktop/Debug/pe-format#archive-library-file-format> which is omitted by LLVM.

To view the contents you could look at a hexdump or use Wireshark with https://git.lekensteyn.nl/peter/wireshark-notes/tree/lua/file-ar.lua

  wireshark -Xlua_script:path/to/file-ar.lua -r your.lib

> I think the change is possible to apply as such, but it'd be better if the diff was made with more context included (diff -U9999).

I've used `git diff -W` to include function context, but if that's not sufficient I'll include the full diff next time :)


Repository:
  rL LLVM

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

https://reviews.llvm.org/D55860





More information about the llvm-commits mailing list