15ffd83dbSDimitry Andric //===- MachOStructs.h -------------------------------------------*- C++ -*-===// 25ffd83dbSDimitry Andric // 35ffd83dbSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 45ffd83dbSDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 55ffd83dbSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 65ffd83dbSDimitry Andric // 75ffd83dbSDimitry Andric //===----------------------------------------------------------------------===// 85ffd83dbSDimitry Andric // 95ffd83dbSDimitry Andric // This file defines structures used in the MachO object file format. Note that 105ffd83dbSDimitry Andric // unlike llvm/BinaryFormat/MachO.h, the structs here are defined in terms of 115ffd83dbSDimitry Andric // endian- and alignment-compatibility wrappers. 125ffd83dbSDimitry Andric // 135ffd83dbSDimitry Andric //===----------------------------------------------------------------------===// 145ffd83dbSDimitry Andric 155ffd83dbSDimitry Andric #ifndef LLD_MACHO_MACHO_STRUCTS_H 165ffd83dbSDimitry Andric #define LLD_MACHO_MACHO_STRUCTS_H 175ffd83dbSDimitry Andric 185ffd83dbSDimitry Andric #include "llvm/Support/Endian.h" 195ffd83dbSDimitry Andric 20*bdd1243dSDimitry Andric namespace lld::structs { 215ffd83dbSDimitry Andric 225ffd83dbSDimitry Andric struct nlist_64 { 235ffd83dbSDimitry Andric llvm::support::ulittle32_t n_strx; 245ffd83dbSDimitry Andric uint8_t n_type; 255ffd83dbSDimitry Andric uint8_t n_sect; 265ffd83dbSDimitry Andric llvm::support::ulittle16_t n_desc; 275ffd83dbSDimitry Andric llvm::support::ulittle64_t n_value; 285ffd83dbSDimitry Andric }; 295ffd83dbSDimitry Andric 30fe6060f1SDimitry Andric struct nlist { 31fe6060f1SDimitry Andric llvm::support::ulittle32_t n_strx; 32fe6060f1SDimitry Andric uint8_t n_type; 33fe6060f1SDimitry Andric uint8_t n_sect; 34fe6060f1SDimitry Andric llvm::support::ulittle16_t n_desc; 35fe6060f1SDimitry Andric llvm::support::ulittle32_t n_value; 36fe6060f1SDimitry Andric }; 37fe6060f1SDimitry Andric 38fe6060f1SDimitry Andric struct entry_point_command { 39fe6060f1SDimitry Andric llvm::support::ulittle32_t cmd; 40fe6060f1SDimitry Andric llvm::support::ulittle32_t cmdsize; 41fe6060f1SDimitry Andric llvm::support::ulittle64_t entryoff; 42fe6060f1SDimitry Andric llvm::support::ulittle64_t stacksize; 43fe6060f1SDimitry Andric }; 44fe6060f1SDimitry Andric 45*bdd1243dSDimitry Andric } // namespace lld::structs 465ffd83dbSDimitry Andric 475ffd83dbSDimitry Andric #endif 48