| ... | ... | @@ -540,7 +540,7 @@ fn updateMetadata(self: *Zld) !void { |
| 540 | 540 | const data_seg = &self.load_commands.items[self.data_segment_cmd_index.?].Segment; |
| 541 | 541 | const common_section_index = self.common_section_index orelse ind: { |
| 542 | 542 | self.common_section_index = @intCast(u16, data_seg.sections.items.len); |
| 543 | | try data_seg.addSection(self.allocator, "__common", "__DATA", .{ |
| 543 | try data_seg.addSection(self.allocator, "__common", .{ |
| 544 | 544 | .flags = macho.S_ZEROFILL, |
| 545 | 545 | }); |
| 546 | 546 | break :ind self.common_section_index.?; |
| ... | ... | @@ -627,7 +627,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 627 | 627 | macho.S_4BYTE_LITERALS, macho.S_8BYTE_LITERALS, macho.S_16BYTE_LITERALS => { |
| 628 | 628 | if (self.text_const_section_index == null) { |
| 629 | 629 | self.text_const_section_index = @intCast(u16, text_seg.sections.items.len); |
| 630 | | try text_seg.addSection(self.allocator, "__const", "__TEXT", .{}); |
| 630 | try text_seg.addSection(self.allocator, "__const", .{}); |
| 631 | 631 | } |
| 632 | 632 | |
| 633 | 633 | break :blk .{ |
| ... | ... | @@ -641,7 +641,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 641 | 641 | // on merging the sections' contents. |
| 642 | 642 | if (self.objc_methname_section_index == null) { |
| 643 | 643 | self.objc_methname_section_index = @intCast(u16, text_seg.sections.items.len); |
| 644 | | try text_seg.addSection(self.allocator, "__objc_methname", "__TEXT", .{ |
| 644 | try text_seg.addSection(self.allocator, "__objc_methname", .{ |
| 645 | 645 | .flags = macho.S_CSTRING_LITERALS, |
| 646 | 646 | }); |
| 647 | 647 | } |
| ... | ... | @@ -653,7 +653,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 653 | 653 | } else if (mem.eql(u8, sectname, "__objc_methtype")) { |
| 654 | 654 | if (self.objc_methtype_section_index == null) { |
| 655 | 655 | self.objc_methtype_section_index = @intCast(u16, text_seg.sections.items.len); |
| 656 | | try text_seg.addSection(self.allocator, "__objc_methtype", "__TEXT", .{ |
| 656 | try text_seg.addSection(self.allocator, "__objc_methtype", .{ |
| 657 | 657 | .flags = macho.S_CSTRING_LITERALS, |
| 658 | 658 | }); |
| 659 | 659 | } |
| ... | ... | @@ -665,7 +665,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 665 | 665 | } else if (mem.eql(u8, sectname, "__objc_classname")) { |
| 666 | 666 | if (self.objc_classname_section_index == null) { |
| 667 | 667 | self.objc_classname_section_index = @intCast(u16, text_seg.sections.items.len); |
| 668 | | try text_seg.addSection(self.allocator, "__objc_classname", "__TEXT", .{}); |
| 668 | try text_seg.addSection(self.allocator, "__objc_classname", .{}); |
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | break :blk .{ |
| ... | ... | @@ -676,7 +676,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 676 | 676 | |
| 677 | 677 | if (self.cstring_section_index == null) { |
| 678 | 678 | self.cstring_section_index = @intCast(u16, text_seg.sections.items.len); |
| 679 | | try text_seg.addSection(self.allocator, "__cstring", "__TEXT", .{ |
| 679 | try text_seg.addSection(self.allocator, "__cstring", .{ |
| 680 | 680 | .flags = macho.S_CSTRING_LITERALS, |
| 681 | 681 | }); |
| 682 | 682 | } |
| ... | ... | @@ -690,7 +690,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 690 | 690 | if (mem.eql(u8, segname, "__DATA") and mem.eql(u8, sectname, "__objc_selrefs")) { |
| 691 | 691 | if (self.objc_selrefs_section_index == null) { |
| 692 | 692 | self.objc_selrefs_section_index = @intCast(u16, data_seg.sections.items.len); |
| 693 | | try data_seg.addSection(self.allocator, "__objc_selrefs", "__DATA", .{ |
| 693 | try data_seg.addSection(self.allocator, "__objc_selrefs", .{ |
| 694 | 694 | .flags = macho.S_LITERAL_POINTERS, |
| 695 | 695 | }); |
| 696 | 696 | } |
| ... | ... | @@ -707,7 +707,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 707 | 707 | macho.S_MOD_INIT_FUNC_POINTERS => { |
| 708 | 708 | if (self.mod_init_func_section_index == null) { |
| 709 | 709 | self.mod_init_func_section_index = @intCast(u16, data_const_seg.sections.items.len); |
| 710 | | try data_const_seg.addSection(self.allocator, "__mod_init_func", "__DATA_CONST", .{ |
| 710 | try data_const_seg.addSection(self.allocator, "__mod_init_func", .{ |
| 711 | 711 | .flags = macho.S_MOD_INIT_FUNC_POINTERS, |
| 712 | 712 | }); |
| 713 | 713 | } |
| ... | ... | @@ -720,7 +720,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 720 | 720 | macho.S_MOD_TERM_FUNC_POINTERS => { |
| 721 | 721 | if (self.mod_term_func_section_index == null) { |
| 722 | 722 | self.mod_term_func_section_index = @intCast(u16, data_const_seg.sections.items.len); |
| 723 | | try data_const_seg.addSection(self.allocator, "__mod_term_func", "__DATA_CONST", .{ |
| 723 | try data_const_seg.addSection(self.allocator, "__mod_term_func", .{ |
| 724 | 724 | .flags = macho.S_MOD_TERM_FUNC_POINTERS, |
| 725 | 725 | }); |
| 726 | 726 | } |
| ... | ... | @@ -734,7 +734,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 734 | 734 | if (mem.eql(u8, sectname, "__common")) { |
| 735 | 735 | if (self.common_section_index == null) { |
| 736 | 736 | self.common_section_index = @intCast(u16, data_seg.sections.items.len); |
| 737 | | try data_seg.addSection(self.allocator, "__common", "__DATA", .{ |
| 737 | try data_seg.addSection(self.allocator, "__common", .{ |
| 738 | 738 | .flags = macho.S_ZEROFILL, |
| 739 | 739 | }); |
| 740 | 740 | } |
| ... | ... | @@ -746,7 +746,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 746 | 746 | } else { |
| 747 | 747 | if (self.bss_section_index == null) { |
| 748 | 748 | self.bss_section_index = @intCast(u16, data_seg.sections.items.len); |
| 749 | | try data_seg.addSection(self.allocator, "__bss", "__DATA", .{ |
| 749 | try data_seg.addSection(self.allocator, "__bss", .{ |
| 750 | 750 | .flags = macho.S_ZEROFILL, |
| 751 | 751 | }); |
| 752 | 752 | } |
| ... | ... | @@ -760,7 +760,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 760 | 760 | macho.S_THREAD_LOCAL_VARIABLES => { |
| 761 | 761 | if (self.tlv_section_index == null) { |
| 762 | 762 | self.tlv_section_index = @intCast(u16, data_seg.sections.items.len); |
| 763 | | try data_seg.addSection(self.allocator, "__thread_vars", "__DATA", .{ |
| 763 | try data_seg.addSection(self.allocator, "__thread_vars", .{ |
| 764 | 764 | .flags = macho.S_THREAD_LOCAL_VARIABLES, |
| 765 | 765 | }); |
| 766 | 766 | } |
| ... | ... | @@ -773,7 +773,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 773 | 773 | macho.S_THREAD_LOCAL_REGULAR => { |
| 774 | 774 | if (self.tlv_data_section_index == null) { |
| 775 | 775 | self.tlv_data_section_index = @intCast(u16, data_seg.sections.items.len); |
| 776 | | try data_seg.addSection(self.allocator, "__thread_data", "__DATA", .{ |
| 776 | try data_seg.addSection(self.allocator, "__thread_data", .{ |
| 777 | 777 | .flags = macho.S_THREAD_LOCAL_REGULAR, |
| 778 | 778 | }); |
| 779 | 779 | } |
| ... | ... | @@ -786,7 +786,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 786 | 786 | macho.S_THREAD_LOCAL_ZEROFILL => { |
| 787 | 787 | if (self.tlv_bss_section_index == null) { |
| 788 | 788 | self.tlv_bss_section_index = @intCast(u16, data_seg.sections.items.len); |
| 789 | | try data_seg.addSection(self.allocator, "__thread_bss", "__DATA", .{ |
| 789 | try data_seg.addSection(self.allocator, "__thread_bss", .{ |
| 790 | 790 | .flags = macho.S_THREAD_LOCAL_ZEROFILL, |
| 791 | 791 | }); |
| 792 | 792 | } |
| ... | ... | @@ -802,7 +802,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 802 | 802 | // in the latest ld64 output. |
| 803 | 803 | if (self.eh_frame_section_index == null) { |
| 804 | 804 | self.eh_frame_section_index = @intCast(u16, text_seg.sections.items.len); |
| 805 | | try text_seg.addSection(self.allocator, "__eh_frame", "__TEXT", .{}); |
| 805 | try text_seg.addSection(self.allocator, "__eh_frame", .{}); |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | 808 | break :blk .{ |
| ... | ... | @@ -814,7 +814,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 814 | 814 | // TODO audit this: is this the right mapping? |
| 815 | 815 | if (self.data_const_section_index == null) { |
| 816 | 816 | self.data_const_section_index = @intCast(u16, data_const_seg.sections.items.len); |
| 817 | | try data_const_seg.addSection(self.allocator, "__const", "__DATA_CONST", .{}); |
| 817 | try data_const_seg.addSection(self.allocator, "__const", .{}); |
| 818 | 818 | } |
| 819 | 819 | |
| 820 | 820 | break :blk .{ |
| ... | ... | @@ -826,7 +826,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 826 | 826 | if (sect.isCode()) { |
| 827 | 827 | if (self.text_section_index == null) { |
| 828 | 828 | self.text_section_index = @intCast(u16, text_seg.sections.items.len); |
| 829 | | try text_seg.addSection(self.allocator, "__text", "__TEXT", .{ |
| 829 | try text_seg.addSection(self.allocator, "__text", .{ |
| 830 | 830 | .flags = macho.S_REGULAR | macho.S_ATTR_PURE_INSTRUCTIONS | macho.S_ATTR_SOME_INSTRUCTIONS, |
| 831 | 831 | }); |
| 832 | 832 | } |
| ... | ... | @@ -850,7 +850,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 850 | 850 | if (mem.eql(u8, sectname, "__ustring")) { |
| 851 | 851 | if (self.ustring_section_index == null) { |
| 852 | 852 | self.ustring_section_index = @intCast(u16, text_seg.sections.items.len); |
| 853 | | try text_seg.addSection(self.allocator, "__ustring", "__TEXT", .{}); |
| 853 | try text_seg.addSection(self.allocator, "__ustring", .{}); |
| 854 | 854 | } |
| 855 | 855 | |
| 856 | 856 | break :blk .{ |
| ... | ... | @@ -860,7 +860,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 860 | 860 | } else if (mem.eql(u8, sectname, "__gcc_except_tab")) { |
| 861 | 861 | if (self.gcc_except_tab_section_index == null) { |
| 862 | 862 | self.gcc_except_tab_section_index = @intCast(u16, text_seg.sections.items.len); |
| 863 | | try text_seg.addSection(self.allocator, "__gcc_except_tab", "__TEXT", .{}); |
| 863 | try text_seg.addSection(self.allocator, "__gcc_except_tab", .{}); |
| 864 | 864 | } |
| 865 | 865 | |
| 866 | 866 | break :blk .{ |
| ... | ... | @@ -870,7 +870,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 870 | 870 | } else if (mem.eql(u8, sectname, "__objc_methlist")) { |
| 871 | 871 | if (self.objc_methlist_section_index == null) { |
| 872 | 872 | self.objc_methlist_section_index = @intCast(u16, text_seg.sections.items.len); |
| 873 | | try text_seg.addSection(self.allocator, "__objc_methlist", "__TEXT", .{}); |
| 873 | try text_seg.addSection(self.allocator, "__objc_methlist", .{}); |
| 874 | 874 | } |
| 875 | 875 | |
| 876 | 876 | break :blk .{ |
| ... | ... | @@ -880,7 +880,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 880 | 880 | } else { |
| 881 | 881 | if (self.text_const_section_index == null) { |
| 882 | 882 | self.text_const_section_index = @intCast(u16, text_seg.sections.items.len); |
| 883 | | try text_seg.addSection(self.allocator, "__const", "__TEXT", .{}); |
| 883 | try text_seg.addSection(self.allocator, "__const", .{}); |
| 884 | 884 | } |
| 885 | 885 | |
| 886 | 886 | break :blk .{ |
| ... | ... | @@ -893,7 +893,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 893 | 893 | if (mem.eql(u8, segname, "__DATA_CONST")) { |
| 894 | 894 | if (self.data_const_section_index == null) { |
| 895 | 895 | self.data_const_section_index = @intCast(u16, data_const_seg.sections.items.len); |
| 896 | | try data_const_seg.addSection(self.allocator, "__const", "__DATA_CONST", .{}); |
| 896 | try data_const_seg.addSection(self.allocator, "__const", .{}); |
| 897 | 897 | } |
| 898 | 898 | |
| 899 | 899 | break :blk .{ |
| ... | ... | @@ -906,7 +906,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 906 | 906 | if (mem.eql(u8, sectname, "__const")) { |
| 907 | 907 | if (self.data_const_section_index == null) { |
| 908 | 908 | self.data_const_section_index = @intCast(u16, data_const_seg.sections.items.len); |
| 909 | | try data_const_seg.addSection(self.allocator, "__const", "__DATA_CONST", .{}); |
| 909 | try data_const_seg.addSection(self.allocator, "__const", .{}); |
| 910 | 910 | } |
| 911 | 911 | |
| 912 | 912 | break :blk .{ |
| ... | ... | @@ -916,7 +916,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 916 | 916 | } else if (mem.eql(u8, sectname, "__cfstring")) { |
| 917 | 917 | if (self.objc_cfstring_section_index == null) { |
| 918 | 918 | self.objc_cfstring_section_index = @intCast(u16, data_const_seg.sections.items.len); |
| 919 | | try data_const_seg.addSection(self.allocator, "__cfstring", "__DATA_CONST", .{}); |
| 919 | try data_const_seg.addSection(self.allocator, "__cfstring", .{}); |
| 920 | 920 | } |
| 921 | 921 | |
| 922 | 922 | break :blk .{ |
| ... | ... | @@ -926,7 +926,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 926 | 926 | } else if (mem.eql(u8, sectname, "__objc_classlist")) { |
| 927 | 927 | if (self.objc_classlist_section_index == null) { |
| 928 | 928 | self.objc_classlist_section_index = @intCast(u16, data_const_seg.sections.items.len); |
| 929 | | try data_const_seg.addSection(self.allocator, "__objc_classlist", "__DATA_CONST", .{}); |
| 929 | try data_const_seg.addSection(self.allocator, "__objc_classlist", .{}); |
| 930 | 930 | } |
| 931 | 931 | |
| 932 | 932 | break :blk .{ |
| ... | ... | @@ -936,7 +936,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 936 | 936 | } else if (mem.eql(u8, sectname, "__objc_imageinfo")) { |
| 937 | 937 | if (self.objc_imageinfo_section_index == null) { |
| 938 | 938 | self.objc_imageinfo_section_index = @intCast(u16, data_const_seg.sections.items.len); |
| 939 | | try data_const_seg.addSection(self.allocator, "__objc_imageinfo", "__DATA_CONST", .{}); |
| 939 | try data_const_seg.addSection(self.allocator, "__objc_imageinfo", .{}); |
| 940 | 940 | } |
| 941 | 941 | |
| 942 | 942 | break :blk .{ |
| ... | ... | @@ -946,7 +946,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 946 | 946 | } else if (mem.eql(u8, sectname, "__objc_const")) { |
| 947 | 947 | if (self.objc_const_section_index == null) { |
| 948 | 948 | self.objc_const_section_index = @intCast(u16, data_seg.sections.items.len); |
| 949 | | try data_seg.addSection(self.allocator, "__objc_const", "__DATA", .{}); |
| 949 | try data_seg.addSection(self.allocator, "__objc_const", .{}); |
| 950 | 950 | } |
| 951 | 951 | |
| 952 | 952 | break :blk .{ |
| ... | ... | @@ -956,7 +956,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 956 | 956 | } else if (mem.eql(u8, sectname, "__objc_classrefs")) { |
| 957 | 957 | if (self.objc_classrefs_section_index == null) { |
| 958 | 958 | self.objc_classrefs_section_index = @intCast(u16, data_seg.sections.items.len); |
| 959 | | try data_seg.addSection(self.allocator, "__objc_classrefs", "__DATA", .{}); |
| 959 | try data_seg.addSection(self.allocator, "__objc_classrefs", .{}); |
| 960 | 960 | } |
| 961 | 961 | |
| 962 | 962 | break :blk .{ |
| ... | ... | @@ -966,7 +966,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 966 | 966 | } else if (mem.eql(u8, sectname, "__objc_data")) { |
| 967 | 967 | if (self.objc_data_section_index == null) { |
| 968 | 968 | self.objc_data_section_index = @intCast(u16, data_seg.sections.items.len); |
| 969 | | try data_seg.addSection(self.allocator, "__objc_data", "__DATA", .{}); |
| 969 | try data_seg.addSection(self.allocator, "__objc_data", .{}); |
| 970 | 970 | } |
| 971 | 971 | |
| 972 | 972 | break :blk .{ |
| ... | ... | @@ -976,7 +976,7 @@ fn getMatchingSection(self: *Zld, sect: Object.Section) !?MatchingSection { |
| 976 | 976 | } else { |
| 977 | 977 | if (self.data_section_index == null) { |
| 978 | 978 | self.data_section_index = @intCast(u16, data_seg.sections.items.len); |
| 979 | | try data_seg.addSection(self.allocator, "__data", "__DATA", .{}); |
| 979 | try data_seg.addSection(self.allocator, "__data", .{}); |
| 980 | 980 | } |
| 981 | 981 | |
| 982 | 982 | break :blk .{ |
| ... | ... | @@ -2124,7 +2124,7 @@ fn populateMetadata(self: *Zld) !void { |
| 2124 | 2124 | .aarch64 => 2, |
| 2125 | 2125 | else => unreachable, // unhandled architecture type |
| 2126 | 2126 | }; |
| 2127 | | try text_seg.addSection(self.allocator, "__text", "__TEXT", .{ |
| 2127 | try text_seg.addSection(self.allocator, "__text", .{ |
| 2128 | 2128 | .@"align" = alignment, |
| 2129 | 2129 | .flags = macho.S_REGULAR | macho.S_ATTR_PURE_INSTRUCTIONS | macho.S_ATTR_SOME_INSTRUCTIONS, |
| 2130 | 2130 | }); |
| ... | ... | @@ -2143,7 +2143,7 @@ fn populateMetadata(self: *Zld) !void { |
| 2143 | 2143 | .aarch64 => 3 * @sizeOf(u32), |
| 2144 | 2144 | else => unreachable, // unhandled architecture type |
| 2145 | 2145 | }; |
| 2146 | | try text_seg.addSection(self.allocator, "__stubs", "__TEXT", .{ |
| 2146 | try text_seg.addSection(self.allocator, "__stubs", .{ |
| 2147 | 2147 | .@"align" = alignment, |
| 2148 | 2148 | .flags = macho.S_SYMBOL_STUBS | macho.S_ATTR_PURE_INSTRUCTIONS | macho.S_ATTR_SOME_INSTRUCTIONS, |
| 2149 | 2149 | .reserved2 = stub_size, |
| ... | ... | @@ -2163,7 +2163,7 @@ fn populateMetadata(self: *Zld) !void { |
| 2163 | 2163 | .aarch64 => 6 * @sizeOf(u32), |
| 2164 | 2164 | else => unreachable, |
| 2165 | 2165 | }; |
| 2166 | | try text_seg.addSection(self.allocator, "__stub_helper", "__TEXT", .{ |
| 2166 | try text_seg.addSection(self.allocator, "__stub_helper", .{ |
| 2167 | 2167 | .size = stub_helper_size, |
| 2168 | 2168 | .@"align" = alignment, |
| 2169 | 2169 | .flags = macho.S_REGULAR | macho.S_ATTR_PURE_INSTRUCTIONS | macho.S_ATTR_SOME_INSTRUCTIONS, |
| ... | ... | @@ -2183,7 +2183,7 @@ fn populateMetadata(self: *Zld) !void { |
| 2183 | 2183 | if (self.got_section_index == null) { |
| 2184 | 2184 | const data_const_seg = &self.load_commands.items[self.data_const_segment_cmd_index.?].Segment; |
| 2185 | 2185 | self.got_section_index = @intCast(u16, data_const_seg.sections.items.len); |
| 2186 | | try data_const_seg.addSection(self.allocator, "__got", "__DATA_CONST", .{ |
| 2186 | try data_const_seg.addSection(self.allocator, "__got", .{ |
| 2187 | 2187 | .@"align" = 3, // 2^3 = @sizeOf(u64) |
| 2188 | 2188 | .flags = macho.S_NON_LAZY_SYMBOL_POINTERS, |
| 2189 | 2189 | }); |
| ... | ... | @@ -2202,7 +2202,7 @@ fn populateMetadata(self: *Zld) !void { |
| 2202 | 2202 | if (self.la_symbol_ptr_section_index == null) { |
| 2203 | 2203 | const data_seg = &self.load_commands.items[self.data_segment_cmd_index.?].Segment; |
| 2204 | 2204 | self.la_symbol_ptr_section_index = @intCast(u16, data_seg.sections.items.len); |
| 2205 | | try data_seg.addSection(self.allocator, "__la_symbol_ptr", "__DATA", .{ |
| 2205 | try data_seg.addSection(self.allocator, "__la_symbol_ptr", .{ |
| 2206 | 2206 | .@"align" = 3, // 2^3 = @sizeOf(u64) |
| 2207 | 2207 | .flags = macho.S_LAZY_SYMBOL_POINTERS, |
| 2208 | 2208 | }); |
| ... | ... | @@ -2211,7 +2211,7 @@ fn populateMetadata(self: *Zld) !void { |
| 2211 | 2211 | if (self.data_section_index == null) { |
| 2212 | 2212 | const data_seg = &self.load_commands.items[self.data_segment_cmd_index.?].Segment; |
| 2213 | 2213 | self.data_section_index = @intCast(u16, data_seg.sections.items.len); |
| 2214 | | try data_seg.addSection(self.allocator, "__data", "__DATA", .{ |
| 2214 | try data_seg.addSection(self.allocator, "__data", .{ |
| 2215 | 2215 | .@"align" = 3, // 2^3 = @sizeOf(u64) |
| 2216 | 2216 | }); |
| 2217 | 2217 | } |