diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2020-08-22 09:23:48 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-08-22 04:14:27 -0400 |
| commit | 69de1a51cd4f43e1d7a1fab3208b835b6841579d (patch) | |
| tree | 01fc24957864655d4231fbb028d69b1cc7d6ffd0 /lib/std/macho.zig | |
| parent | 55d7c399c136537551359eed6f73a70ac77f7091 (diff) | |
| download | zig-69de1a51cd4f43e1d7a1fab3208b835b6841579d.tar.gz zig-69de1a51cd4f43e1d7a1fab3208b835b6841579d.zip | |
Add entry_point_command struct to Mach-O definitions
The `entry_point_command` is a replacement for `thread_command`, and
is used for main executables to specify the location of `main()`
entry point.
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
Diffstat (limited to 'lib/std/macho.zig')
| -rw-r--r-- | lib/std/macho.zig | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/std/macho.zig b/lib/std/macho.zig index 99a8cd776c..7eb22c7179 100644 --- a/lib/std/macho.zig +++ b/lib/std/macho.zig @@ -40,6 +40,24 @@ pub const uuid_command = extern struct { uuid: [16]u8, }; +/// The entry_point_command is a replacement for thread_command. +/// It is used for main executables to specify the location (file offset) +/// of main(). If -stack_size was used at link time, the stacksize +/// field will contain the stack size needed for the main thread. +pub const entry_point_command = struct { + /// LC_MAIN only used in MH_EXECUTE filetypes + cmd: u32, + + /// sizeof(struct entry_point_command) + cmdsize: u32, + + /// file (__TEXT) offset of main() + entryoff: u64, + + /// if not zero, initial stack size + stacksize: u64, +}; + /// The symtab_command contains the offsets and sizes of the link-edit 4.3BSD /// "stab" style symbol table information as described in the header files /// <nlist.h> and <stab.h>. |
