[all-commits] [llvm/llvm-project] 9db2f3: [Binary] Align the image offset in OffloadBinary

Joseph Huber via All-commits all-commits at lists.llvm.org
Tue Jun 7 12:56:56 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9db2f3233669a6f9796b965714292eca8d5b9cd1
      https://github.com/llvm/llvm-project/commit/9db2f3233669a6f9796b965714292eca8d5b9cd1
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-06-07 (Tue, 07 Jun 2022)

  Changed paths:
    M llvm/lib/Object/OffloadBinary.cpp

  Log Message:
  -----------
  [Binary] Align the image offset in OffloadBinary

Summary:
The OffloadBinary wraps around an embedded device image, commonly an ELF
or LLVM BC file. These file formats have alignment requirements for
parsing, so if the image is stored at an un-aligned offset from the
beginning of the file we will be unable to parse the embeded image
without copying the image buffer. This patch adds alignment padding
before the binary image is appended to ensure we can parse the symbolic
file it contains in-place without copying memory.


  Commit: f06731e3c367c481acc8bc6b1f8244039992fa65
      https://github.com/llvm/llvm-project/commit/f06731e3c367c481acc8bc6b1f8244039992fa65
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-06-07 (Tue, 07 Jun 2022)

  Changed paths:
    M clang/tools/clang-offload-packager/ClangOffloadPackager.cpp
    M llvm/include/llvm/Object/OffloadBinary.h
    M llvm/lib/Object/OffloadBinary.cpp
    M llvm/unittests/Object/OffloadingTest.cpp

  Log Message:
  -----------
  [Binary] Make the OffloadingImage type own the memory

Summary:
The OffloadingBinary uses a convenience struct to help manage the memory
that will be serialized using the binary format. This currently uses a
reference to an existing buffer, but this should own the memory instead
so it is easier to work with seeing as its only current use requires
saving the buffer anyway.


Compare: https://github.com/llvm/llvm-project/compare/d46e7aecb4b1...f06731e3c367


More information about the All-commits mailing list