| ... | ... | @@ -843,15 +843,15 @@ pub const nlist_64 = extern struct { |
| 843 | 843 | n_value: u64, |
| 844 | 844 | |
| 845 | 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 | 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 | 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 | 857 | pub fn sect(sym: nlist_64) bool { |
| ... | ... | @@ -875,15 +875,19 @@ pub const nlist_64 = extern struct { |
| 875 | 875 | } |
| 876 | 876 | |
| 877 | 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 | 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 | 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 | 893 | pub fn tentative(sym: nlist_64) bool { |
| ... | ... | @@ -1002,7 +1006,7 @@ pub const LC = enum(u32) { |
| 1002 | 1006 | |
| 1003 | 1007 | /// load a dynamically linked shared library that is allowed to be missing |
| 1004 | 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 | 1011 | /// 64-bit segment of this file to be mapped |
| 1008 | 1012 | SEGMENT_64 = 0x19, |
| ... | ... | @@ -1014,7 +1018,7 @@ pub const LC = enum(u32) { |
| 1014 | 1018 | UUID = 0x1b, |
| 1015 | 1019 | |
| 1016 | 1020 | /// runpath additions |
| 1017 | | RPATH = (0x1c | LC_REQ_DYLD), |
| 1021 | RPATH = 0x1c | LC_REQ_DYLD, |
| 1018 | 1022 | |
| 1019 | 1023 | /// local of code signature |
| 1020 | 1024 | CODE_SIGNATURE = 0x1d, |
| ... | ... | @@ -1023,7 +1027,7 @@ pub const LC = enum(u32) { |
| 1023 | 1027 | SEGMENT_SPLIT_INFO = 0x1e, |
| 1024 | 1028 | |
| 1025 | 1029 | /// load and re-export dylib |
| 1026 | | REEXPORT_DYLIB = (0x1f | LC_REQ_DYLD), |
| 1030 | REEXPORT_DYLIB = 0x1f | LC_REQ_DYLD, |
| 1027 | 1031 | |
| 1028 | 1032 | /// delay load of dylib until first use |
| 1029 | 1033 | LAZY_LOAD_DYLIB = 0x20, |
| ... | ... | @@ -1035,10 +1039,10 @@ pub const LC = enum(u32) { |
| 1035 | 1039 | DYLD_INFO = 0x22, |
| 1036 | 1040 | |
| 1037 | 1041 | /// compressed dyld information only |
| 1038 | | DYLD_INFO_ONLY = (0x22 | LC_REQ_DYLD), |
| 1042 | DYLD_INFO_ONLY = 0x22 | LC_REQ_DYLD, |
| 1039 | 1043 | |
| 1040 | 1044 | /// load upward dylib |
| 1041 | | LOAD_UPWARD_DYLIB = (0x23 | LC_REQ_DYLD), |
| 1045 | LOAD_UPWARD_DYLIB = 0x23 | LC_REQ_DYLD, |
| 1042 | 1046 | |
| 1043 | 1047 | /// build for MacOSX min OS version |
| 1044 | 1048 | VERSION_MIN_MACOSX = 0x24, |
| ... | ... | @@ -1053,7 +1057,7 @@ pub const LC = enum(u32) { |
| 1053 | 1057 | DYLD_ENVIRONMENT = 0x27, |
| 1054 | 1058 | |
| 1055 | 1059 | /// replacement for LC_UNIXTHREAD |
| 1056 | | MAIN = (0x28 | LC_REQ_DYLD), |
| 1060 | MAIN = 0x28 | LC_REQ_DYLD, |
| 1057 | 1061 | |
| 1058 | 1062 | /// table of non-instructions in __text |
| 1059 | 1063 | DATA_IN_CODE = 0x29, |
| ... | ... | @@ -1085,6 +1089,12 @@ pub const LC = enum(u32) { |
| 1085 | 1089 | /// build for platform min OS version |
| 1086 | 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 | 1639 | /// to avoid removing symbols that must exist: If the symbol has this bit set, strip does not strip it. |
| 1630 | 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 | 1647 | /// Used by the dynamic linker at runtime. Do not set this bit. |
| 1633 | 1648 | pub const N_DESC_DISCARDED: u16 = 0x20; |
| 1634 | 1649 | |