1 //===-- elf_common.h - Common ELF functionality -----------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // Common ELF functionality for target plugins. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #ifndef LLVM_OPENMP_LIBOMPTARGET_PLUGINS_COMMON_ELF_COMMON_ELF_COMMON_H 14 #define LLVM_OPENMP_LIBOMPTARGET_PLUGINS_COMMON_ELF_COMMON_ELF_COMMON_H 15 16 #include "omptargetplugin.h" 17 #include <cstdint> 18 19 /// Return non-zero, if the given \p image is an ELF object, which 20 /// e_machine matches \p target_id; return zero otherwise. 21 EXTERN int32_t elf_check_machine(__tgt_device_image *Image, uint16_t TargetId); 22 23 /// Return non-zero, if the given \p image is an ET_DYN ELF object; 24 /// return zero otherwise. 25 EXTERN int32_t elf_is_dynamic(__tgt_device_image *Image); 26 27 #endif // LLVM_OPENMP_LIBOMPTARGET_PLUGINS_COMMON_ELF_COMMON_ELF_COMMON_H 28