Skip to content

Commit

Permalink
elf: use elf.EM_NONE instead of unix.EM_NONE
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
  • Loading branch information
lmb committed Aug 6, 2024
1 parent da7a3b8 commit 5b670ba
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion elf_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 0 additions & 2 deletions internal/unix/types_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions internal/unix/types_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ const (
SIGPROF
SIG_BLOCK
SIG_UNBLOCK
EM_NONE
EM_BPF
BPF_FS_MAGIC
TRACEFS_MAGIC
DEBUGFS_MAGIC
Expand Down

0 comments on commit 5b670ba

Please sign in to comment.