Jez Ng | 1e1a3f6 | 2020-05-21 22:26:35 | [diff] [blame] | 1 | //===- MachOStructs.h -------------------------------------------*- 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 | // This file defines structures used in the MachO object file format. Note that |
| 10 | // unlike llvm/BinaryFormat/MachO.h, the structs here are defined in terms of |
| 11 | // endian- and alignment-compatibility wrappers. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef LLD_MACHO_MACHO_STRUCTS_H |
| 16 | #define LLD_MACHO_MACHO_STRUCTS_H |
| 17 | |
| 18 | #include "llvm/Support/Endian.h" |
| 19 | |
Nico Weber | bf20d43 | 2022-08-07 14:37:49 | [diff] [blame] | 20 | namespace lld::structs { |
Jez Ng | 1e1a3f6 | 2020-05-21 22:26:35 | [diff] [blame] | 21 | |
| 22 | struct nlist_64 { |
| 23 | llvm::support::ulittle32_t n_strx; |
| 24 | uint8_t n_type; |
| 25 | uint8_t n_sect; |
| 26 | llvm::support::ulittle16_t n_desc; |
| 27 | llvm::support::ulittle64_t n_value; |
| 28 | }; |
| 29 | |
Jez Ng | 817d98d | 2021-04-02 22:46:18 | [diff] [blame] | 30 | struct nlist { |
| 31 | llvm::support::ulittle32_t n_strx; |
| 32 | uint8_t n_type; |
| 33 | uint8_t n_sect; |
| 34 | llvm::support::ulittle16_t n_desc; |
| 35 | llvm::support::ulittle32_t n_value; |
| 36 | }; |
| 37 | |
Jez Ng | 3bc88eb | 2021-04-16 01:14:32 | [diff] [blame] | 38 | struct entry_point_command { |
| 39 | llvm::support::ulittle32_t cmd; |
| 40 | llvm::support::ulittle32_t cmdsize; |
| 41 | llvm::support::ulittle64_t entryoff; |
| 42 | llvm::support::ulittle64_t stacksize; |
| 43 | }; |
| 44 | |
Nico Weber | bf20d43 | 2022-08-07 14:37:49 | [diff] [blame] | 45 | } // namespace lld::structs |
Jez Ng | 1e1a3f6 | 2020-05-21 22:26:35 | [diff] [blame] | 46 | |
| 47 | #endif |