[all-commits] [llvm/llvm-project] c97312: [llvm-objcopy] -O binary: do not align physical ad...

quic-akaryaki via All-commits all-commits at lists.llvm.org
Tue Jun 20 15:46:06 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c973123fdca7c32d2f7cbbf19883677c81e1edb0
      https://github.com/llvm/llvm-project/commit/c973123fdca7c32d2f7cbbf19883677c81e1edb0
  Author: Alexey Karyakin <akaryaki at quicinc.com>
  Date:   2023-06-20 (Tue, 20 Jun 2023)

  Changed paths:
    M llvm/lib/ObjCopy/ELF/ELFObjcopy.cpp
    M llvm/lib/ObjCopy/ELF/ELFObject.cpp
    M llvm/test/tools/llvm-objcopy/ELF/binary-paddr.test

  Log Message:
  -----------
  [llvm-objcopy] -O binary: do not align physical addresses

llvm-objcopy should not insert padding before a section if its
physical addresses is not aligned to section's alignment. This
behavior will match GNU objcopy and is important for embedded images
where the physical address is used to store the initial data image.
The loader typically will copy this image using a start symbol
created by the linker. If llvm-objcopy inserts padding before such a
section, the symbol address will not match the location in the image.

This commit refines the change in https://reviews.llvm.org/D128961
which intended to align sections which type changed from NOBITS and
their offset may not be aligned. However, it affected all sections.

Fix https://github.com/llvm/llvm-project/issues/62636

Reviewed By: jhenderson, MaskRay

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




More information about the All-commits mailing list