[PATCH] D144872: [AIX] Align the content of an xcoff object file which has auxiliary header in big archive.

Stephen Peckham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 06:59:45 PDT 2023


stephenpeckham added a comment.

In D144872#4239935 <https://reviews.llvm.org/D144872#4239935>, @jhenderson wrote:

> the spec https://www.ibm.com/docs/en/aix/7.2?topic=formats-ar-file-format-big makes no comment about all this complicated additional alignment stuff, and refers simply to aligning on even byte boundaries. From a traditional GNU-like archive format, this makes sense: the ar tool is designed for creating static archvies that are linked by the static linker. Loadability is not a thing that needs thinking about.
>
> Are you suggesting that AIX Big Archives can be used to store shared objects in an archive, and then that the runtime loader can directly load shared objects from these archives?

Yes, the AIX loader loads shared objects directly from archives. This simplifies the search for shared objects, because both 32- and 64-bit shared objects can be in the same archive. In addition, an archive can contain multiple shared objects. It is more efficient for the system loader to load archive members if the members are aligned in the archive.  In fact, the system loader will refuse to load 64-bit members that are not aligned properly.

It's true that the documentation for the archive file format does not mention the alignment requirement.  I don't think the writers of the documentation anticipated that a third party would be writing its own archive management tools.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144872



More information about the llvm-commits mailing list