From 5b670ba5db05a6df69e47f1eb5abc80d1e938b6e Mon Sep 17 00:00:00 2001 From: Lorenz Bauer Date: Tue, 6 Aug 2024 15:45:04 +0200 Subject: [PATCH] elf: use elf.EM_NONE instead of unix.EM_NONE Signed-off-by: Lorenz Bauer --- elf_reader.go | 2 +- internal/unix/types_linux.go | 2 -- internal/unix/types_other.go | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/elf_reader.go b/elf_reader.go index 620037d80..2e31a1931 100644 --- a/elf_reader.go +++ b/elf_reader.go @@ -71,7 +71,7 @@ func LoadCollectionSpecFromReader(rd io.ReaderAt) (*CollectionSpec, error) { // Checks if the ELF file is for BPF data. // Old LLVM versions set e_machine to EM_NONE. - if f.File.Machine != unix.EM_NONE && f.File.Machine != elf.EM_BPF { + if f.File.Machine != elf.EM_NONE && f.File.Machine != elf.EM_BPF { return nil, fmt.Errorf("unexpected machine type for BPF ELF: %s", f.File.Machine) } diff --git a/internal/unix/types_linux.go b/internal/unix/types_linux.go index d725cfaa3..c09b8d5fa 100644 --- a/internal/unix/types_linux.go +++ b/internal/unix/types_linux.go @@ -83,8 +83,6 @@ const ( SIGPROF = linux.SIGPROF SIG_BLOCK = linux.SIG_BLOCK SIG_UNBLOCK = linux.SIG_UNBLOCK - EM_NONE = linux.EM_NONE - EM_BPF = linux.EM_BPF BPF_FS_MAGIC = linux.BPF_FS_MAGIC TRACEFS_MAGIC = linux.TRACEFS_MAGIC DEBUGFS_MAGIC = linux.DEBUGFS_MAGIC diff --git a/internal/unix/types_other.go b/internal/unix/types_other.go index 3ff896271..022881894 100644 --- a/internal/unix/types_other.go +++ b/internal/unix/types_other.go @@ -86,8 +86,6 @@ const ( SIGPROF SIG_BLOCK SIG_UNBLOCK - EM_NONE - EM_BPF BPF_FS_MAGIC TRACEFS_MAGIC DEBUGFS_MAGIC