[all-commits] [llvm/llvm-project] cb4809: [Object, ELF] Implement PN_XNUM extension for progr...

aokblast via All-commits all-commits at lists.llvm.org
Thu Oct 30 09:38:33 PDT 2025


  Branch: refs/heads/users/aokblast/elf/fix_65535err
  Home:   https://github.com/llvm/llvm-project
  Commit: cb480961c52117d441ed3a0edbec69c6f821d35c
      https://github.com/llvm/llvm-project/commit/cb480961c52117d441ed3a0edbec69c6f821d35c
  Author: ShengYi Hung <aokblast at FreeBSD.org>
  Date:   2025-10-31 (Fri, 31 Oct 2025)

  Changed paths:
    M llvm/include/llvm/BinaryFormat/ELF.h
    M llvm/include/llvm/Object/ELF.h

  Log Message:
  -----------
  [Object,ELF] Implement PN_XNUM extension for program headers

In ELF file, there is a possible extended header for those phnum, shnum,
and shstrndx larger than the maximum of 16 bits. This extended header
use section 0 to record these fields in 32 bits.

We implment this feature so that programs rely on ELFFile::program_headers() can get the
correct number of segments. Also, the consumers don't have to check the
section 0 themselve, insteead, they can use the getPhNum() as an
alternative.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list