[all-commits] [llvm/llvm-project] eb56ef: [llvm-lib] Add support for ARM64EC libraries.

jacekcw via All-commits all-commits at lists.llvm.org
Fri Apr 21 05:46:36 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: eb56ef3edd9f1d21e625f0158dfc4edc48bd7349
      https://github.com/llvm/llvm-project/commit/eb56ef3edd9f1d21e625f0158dfc4edc48bd7349
  Author: Jacek Caban <jacek at codeweavers.com>
  Date:   2023-04-21 (Fri, 21 Apr 2023)

  Changed paths:
    M llvm/include/llvm/Object/ArchiveWriter.h
    M llvm/lib/Object/ArchiveWriter.cpp
    M llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
    M llvm/test/tools/llvm-lib/ecsymbols.test
    M llvm/test/tools/llvm-lib/machine-mismatch.test

  Log Message:
  -----------
  [llvm-lib] Add support for ARM64EC libraries.

ARM64EC allows having both pure ARM64 objects and ARM64EC in the
same archive. This allows using single static library for linking
pure ARM64, pure ARM64EC or mixed modules (what MS calls ARM64X:
a single module that may be used in both modes). To achieve that,
such static libraries need two separated symbol maps. The usual map
contains only pure ARM64 symbols, while a new /<ECSYMBOLS>/ section
contains EC symbols. EC symbols map has very similar format to the
usual map, except it doesn't contain object offsets and uses offsets
from regular map instead. This is true even for pure ARM64EC static
library: it will simply have 0 symbols in the symbol map.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D143541


  Commit: 85a2c50ec4979b87267e4f2068f2921beb0b98f2
      https://github.com/llvm/llvm-project/commit/85a2c50ec4979b87267e4f2068f2921beb0b98f2
  Author: Jacek Caban <jacek at codeweavers.com>
  Date:   2023-04-21 (Fri, 21 Apr 2023)

  Changed paths:
    M llvm/include/llvm/Object/Archive.h
    M llvm/lib/Object/Archive.cpp
    M llvm/test/tools/llvm-lib/ecsymbols.test
    A llvm/test/tools/llvm-nm/ecsymbols.test
    M llvm/tools/llvm-nm/llvm-nm.cpp

  Log Message:
  -----------
  [llvm-nm] Print EC symbol map.

This is useful for examining ARM64EC static libraries and allows
better llvm-lib testing. Changes to Archive class will also be
useful for LLD to support ARM64EC, where it will need to use one
map or the other, depending on linking target (or both, in case of
ARM64X, but separately as they are in different namespaces).

Reviewed By: jhenderson, efriedma

Differential Revision: https://reviews.llvm.org/D146534


  Commit: cea5d2870f379e7f93ba9da01747a279e4225998
      https://github.com/llvm/llvm-project/commit/cea5d2870f379e7f93ba9da01747a279e4225998
  Author: Jacek Caban <jacek at codeweavers.com>
  Date:   2023-04-21 (Fri, 21 Apr 2023)

  Changed paths:
    M llvm/include/llvm/BinaryFormat/COFF.h
    M llvm/lib/BinaryFormat/Magic.cpp
    M llvm/lib/Object/COFFImportFile.cpp
    M llvm/lib/Object/COFFObjectFile.cpp
    M llvm/lib/Object/WindowsMachineFlag.cpp
    M llvm/lib/Object/WindowsResource.cpp
    M llvm/lib/ObjectYAML/COFFEmitter.cpp
    M llvm/lib/ObjectYAML/COFFYAML.cpp
    M llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp
    M llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
    M llvm/test/tools/llvm-cvtres/machine.test
    A llvm/test/tools/llvm-lib/Inputs/arm64x.yaml
    M llvm/test/tools/llvm-lib/machine-mismatch.test
    A llvm/test/tools/llvm-readobj/COFF/arm64x.yaml
    M llvm/tools/llvm-readobj/COFFDumper.cpp

  Log Message:
  -----------
  [llvm-lib] [llvm-readobj] [llvm-cvtres] Add Support for ARM64X object files.

Similar to D125411, but for ARM64X.

ARM64X PE binaries are hybrids containing both ARM64EC and pure ARM64
variants in one file. They are usually linked by passing separate
ARM64EC and ARM64 object files to linker. Linked binaries use ARM64
machine and contain additional CHPE metadata in their load config.
CHPE metadata support is not part of this patch, I plan to send that later.

Using ARM64X as a machine type of object files themselves is somewhat
ambiguous, but such files are allowed by MSVC. It treats them as ARM64
or ARM64EC object, depending on the context. Such objects can be
produced with cvtres.exe -machine:arm64x.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D148517


Compare: https://github.com/llvm/llvm-project/compare/9d7785b2e995...cea5d2870f37


More information about the All-commits mailing list