| ... | @@ -843,15 +843,15 @@ pub const nlist_64 = extern struct { | ... | @@ -843,15 +843,15 @@ pub const nlist_64 = extern struct { |
| 843 | n_value: u64, | 843 | n_value: u64, |
| 844 | | 844 | |
| 845 | pub fn stab(sym: nlist_64) bool { | 845 | pub fn stab(sym: nlist_64) bool { |
| 846 | return (N_STAB & sym.n_type) != 0; | 846 | return N_STAB & sym.n_type != 0; |
| 847 | } | 847 | } |
| 848 | | 848 | |
| 849 | pub fn pext(sym: nlist_64) bool { | 849 | pub fn pext(sym: nlist_64) bool { |
| 850 | return (N_PEXT & sym.n_type) != 0; | 850 | return N_PEXT & sym.n_type != 0; |
| 851 | } | 851 | } |
| 852 | | 852 | |
| 853 | pub fn ext(sym: nlist_64) bool { | 853 | pub fn ext(sym: nlist_64) bool { |
| 854 | return (N_EXT & sym.n_type) != 0; | 854 | return N_EXT & sym.n_type != 0; |
| 855 | } | 855 | } |
| 856 | | 856 | |
| 857 | pub fn sect(sym: nlist_64) bool { | 857 | pub fn sect(sym: nlist_64) bool { |
| ... | @@ -875,15 +875,19 @@ pub const nlist_64 = extern struct { | ... | @@ -875,15 +875,19 @@ pub const nlist_64 = extern struct { |
| 875 | } | 875 | } |
| 876 | | 876 | |
| 877 | pub fn weakDef(sym: nlist_64) bool { | 877 | pub fn weakDef(sym: nlist_64) bool { |
| 878 | return (sym.n_desc & N_WEAK_DEF) != 0; | 878 | return sym.n_desc & N_WEAK_DEF != 0; |
| 879 | } | 879 | } |
| 880 | | 880 | |
| 881 | pub fn weakRef(sym: nlist_64) bool { | 881 | pub fn weakRef(sym: nlist_64) bool { |
| 882 | return (sym.n_desc & N_WEAK_REF) != 0; | 882 | return sym.n_desc & N_WEAK_REF != 0; |
| 883 | } | 883 | } |
| 884 | | 884 | |
| 885 | pub fn discarded(sym: nlist_64) bool { | 885 | pub fn discarded(sym: nlist_64) bool { |
| 886 | return (sym.n_desc & N_DESC_DISCARDED) != 0; | 886 | return sym.n_desc & N_DESC_DISCARDED != 0; |
| | 887 | } |
| | 888 | |
| | 889 | pub fn noDeadStrip(sym: nlist_64) bool { |
| | 890 | return sym.n_desc & N_NO_DEAD_STRIP != 0; |
| 887 | } | 891 | } |
| 888 | | 892 | |
| 889 | pub fn tentative(sym: nlist_64) bool { | 893 | pub fn tentative(sym: nlist_64) bool { |
| ... | @@ -1002,7 +1006,7 @@ pub const LC = enum(u32) { | ... | @@ -1002,7 +1006,7 @@ pub const LC = enum(u32) { |
| 1002 | | 1006 | |
| 1003 | /// load a dynamically linked shared library that is allowed to be missing | 1007 | /// load a dynamically linked shared library that is allowed to be missing |
| 1004 | /// (all symbols are weak imported). | 1008 | /// (all symbols are weak imported). |
| 1005 | LOAD_WEAK_DYLIB = (0x18 | LC_REQ_DYLD), | 1009 | LOAD_WEAK_DYLIB = 0x18 | LC_REQ_DYLD, |
| 1006 | | 1010 | |
| 1007 | /// 64-bit segment of this file to be mapped | 1011 | /// 64-bit segment of this file to be mapped |
| 1008 | SEGMENT_64 = 0x19, | 1012 | SEGMENT_64 = 0x19, |
| ... | @@ -1014,7 +1018,7 @@ pub const LC = enum(u32) { | ... | @@ -1014,7 +1018,7 @@ pub const LC = enum(u32) { |
| 1014 | UUID = 0x1b, | 1018 | UUID = 0x1b, |
| 1015 | | 1019 | |
| 1016 | /// runpath additions | 1020 | /// runpath additions |
| 1017 | RPATH = (0x1c | LC_REQ_DYLD), | 1021 | RPATH = 0x1c | LC_REQ_DYLD, |
| 1018 | | 1022 | |
| 1019 | /// local of code signature | 1023 | /// local of code signature |
| 1020 | CODE_SIGNATURE = 0x1d, | 1024 | CODE_SIGNATURE = 0x1d, |
| ... | @@ -1023,7 +1027,7 @@ pub const LC = enum(u32) { | ... | @@ -1023,7 +1027,7 @@ pub const LC = enum(u32) { |
| 1023 | SEGMENT_SPLIT_INFO = 0x1e, | 1027 | SEGMENT_SPLIT_INFO = 0x1e, |
| 1024 | | 1028 | |
| 1025 | /// load and re-export dylib | 1029 | /// load and re-export dylib |
| 1026 | REEXPORT_DYLIB = (0x1f | LC_REQ_DYLD), | 1030 | REEXPORT_DYLIB = 0x1f | LC_REQ_DYLD, |
| 1027 | | 1031 | |
| 1028 | /// delay load of dylib until first use | 1032 | /// delay load of dylib until first use |
| 1029 | LAZY_LOAD_DYLIB = 0x20, | 1033 | LAZY_LOAD_DYLIB = 0x20, |
| ... | @@ -1035,10 +1039,10 @@ pub const LC = enum(u32) { | ... | @@ -1035,10 +1039,10 @@ pub const LC = enum(u32) { |
| 1035 | DYLD_INFO = 0x22, | 1039 | DYLD_INFO = 0x22, |
| 1036 | | 1040 | |
| 1037 | /// compressed dyld information only | 1041 | /// compressed dyld information only |
| 1038 | DYLD_INFO_ONLY = (0x22 | LC_REQ_DYLD), | 1042 | DYLD_INFO_ONLY = 0x22 | LC_REQ_DYLD, |
| 1039 | | 1043 | |
| 1040 | /// load upward dylib | 1044 | /// load upward dylib |
| 1041 | LOAD_UPWARD_DYLIB = (0x23 | LC_REQ_DYLD), | 1045 | LOAD_UPWARD_DYLIB = 0x23 | LC_REQ_DYLD, |
| 1042 | | 1046 | |
| 1043 | /// build for MacOSX min OS version | 1047 | /// build for MacOSX min OS version |
| 1044 | VERSION_MIN_MACOSX = 0x24, | 1048 | VERSION_MIN_MACOSX = 0x24, |
| ... | @@ -1053,7 +1057,7 @@ pub const LC = enum(u32) { | ... | @@ -1053,7 +1057,7 @@ pub const LC = enum(u32) { |
| 1053 | DYLD_ENVIRONMENT = 0x27, | 1057 | DYLD_ENVIRONMENT = 0x27, |
| 1054 | | 1058 | |
| 1055 | /// replacement for LC_UNIXTHREAD | 1059 | /// replacement for LC_UNIXTHREAD |
| 1056 | MAIN = (0x28 | LC_REQ_DYLD), | 1060 | MAIN = 0x28 | LC_REQ_DYLD, |
| 1057 | | 1061 | |
| 1058 | /// table of non-instructions in __text | 1062 | /// table of non-instructions in __text |
| 1059 | DATA_IN_CODE = 0x29, | 1063 | DATA_IN_CODE = 0x29, |
| ... | @@ -1085,6 +1089,12 @@ pub const LC = enum(u32) { | ... | @@ -1085,6 +1089,12 @@ pub const LC = enum(u32) { |
| 1085 | /// build for platform min OS version | 1089 | /// build for platform min OS version |
| 1086 | BUILD_VERSION = 0x32, | 1090 | BUILD_VERSION = 0x32, |
| 1087 | | 1091 | |
| | 1092 | /// used with linkedit_data_command, payload is trie |
| | 1093 | DYLD_EXPORTS_TRIE = 0x33 | LC_REQ_DYLD, |
| | 1094 | |
| | 1095 | /// used with linkedit_data_command |
| | 1096 | DYLD_CHAINED_FIXUPS = 0x34 | LC_REQ_DYLD, |
| | 1097 | |
| 1088 | _, | 1098 | _, |
| 1089 | }; | 1099 | }; |
| 1090 | | 1100 | |
| ... | @@ -1629,6 +1639,11 @@ pub const REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY: u16 = 5; | ... | @@ -1629,6 +1639,11 @@ pub const REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY: u16 = 5; |
| 1629 | /// to avoid removing symbols that must exist: If the symbol has this bit set, strip does not strip it. | 1639 | /// to avoid removing symbols that must exist: If the symbol has this bit set, strip does not strip it. |
| 1630 | pub const REFERENCED_DYNAMICALLY: u16 = 0x10; | 1640 | pub const REFERENCED_DYNAMICALLY: u16 = 0x10; |
| 1631 | | 1641 | |
| | 1642 | /// The N_NO_DEAD_STRIP bit of the n_desc field only ever appears in a |
| | 1643 | /// relocatable .o file (MH_OBJECT filetype). And is used to indicate to the |
| | 1644 | /// static link editor it is never to dead strip the symbol. |
| | 1645 | pub const N_NO_DEAD_STRIP: u16 = 0x20; |
| | 1646 | |
| 1632 | /// Used by the dynamic linker at runtime. Do not set this bit. | 1647 | /// Used by the dynamic linker at runtime. Do not set this bit. |
| 1633 | pub const N_DESC_DISCARDED: u16 = 0x20; | 1648 | pub const N_DESC_DISCARDED: u16 = 0x20; |
| 1634 | | 1649 | |