[all-commits] [llvm/llvm-project] e895c5: [Object] getBuildAttributes: check e_machine. NFC

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Mar 14 21:55:46 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e895c523b53c97c92a69ba0997e8904edd1e40a8
      https://github.com/llvm/llvm-project/commit/e895c523b53c97c92a69ba0997e8904edd1e40a8
  Author: Fangrui Song <i at maskray.me>
  Date:   2024-03-14 (Thu, 14 Mar 2024)

  Changed paths:
    M llvm/include/llvm/Object/ELFObjectFile.h

  Log Message:
  -----------
  [Object] getBuildAttributes: check e_machine. NFC

getBuildAttributes is only called for ARM/RISCV object files and
`SHT_ARM_ATTRIBUTES == SHT_RISCV_ATTRIBUTES`, so the following check
`Sec.sh_type == ELF::SHT_ARM_ATTRIBUTES || Sec.sh_type == ELF::SHT_RISCV_ATTRIBUTES`
is actually fine. But the convention is to guard such processor-specific
section type checks with an e_machine test.



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