authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-08-22 09:23:48+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-08-22 04:14:27-04:00
log69de1a51cd4f43e1d7a1fab3208b835b6841579d
tree01fc24957864655d4231fbb028d69b1cc7d6ffd0
parent55d7c399c136537551359eed6f73a70ac77f7091

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>

1 files changed, 18 insertions(+), 0 deletions(-)

lib/std/macho.zig+18
......@@ -40,6 +40,24 @@ pub const uuid_command = extern struct {
4040 uuid: [16]u8,
4141};
4242
43/// The entry_point_command is a replacement for thread_command.
44/// It is used for main executables to specify the location (file offset)
45/// of main(). If -stack_size was used at link time, the stacksize
46/// field will contain the stack size needed for the main thread.
47pub const entry_point_command = struct {
48 /// LC_MAIN only used in MH_EXECUTE filetypes
49 cmd: u32,
50
51 /// sizeof(struct entry_point_command)
52 cmdsize: u32,
53
54 /// file (__TEXT) offset of main()
55 entryoff: u64,
56
57 /// if not zero, initial stack size
58 stacksize: u64,
59};
60
4361/// The symtab_command contains the offsets and sizes of the link-edit 4.3BSD
4462/// "stab" style symbol table information as described in the header files
4563/// <nlist.h> and <stab.h>.