[PATCH] D150022: [Object] Fix handling of Elf_Nhdr with sh_addralign=8

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 00:11:04 PDT 2023


jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.

Looks good.



================
Comment at: llvm/include/llvm/Object/ELF.h:325
+    return Elf_Note_Iterator(base() + Phdr.p_offset, Phdr.p_filesz,
+                             std::max<size_t>(Phdr.p_align, 4), Err);
   }
----------------
MaskRay wrote:
> jhenderson wrote:
> > Nit: this probably wants to be a `uint64_t` rather than `size_t` max, right (since p_align could be `uint64_t` and therefore a larger type on 32-bit hosts than `size_t`)?
> We have excluded larger `p_align` values, so using `size_t` is fine. `ELFTypes.h Elf_Nhdr_Impl::getSize` returns a `size_t` and the choice is to match its return value.
Okay, fair enough.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150022



More information about the llvm-commits mailing list