| ... | @@ -807,26 +807,26 @@ pub fn buildSharedObjects(comp: *Compilation) !void { | ... | @@ -807,26 +807,26 @@ pub fn buildSharedObjects(comp: *Compilation) !void { |
| 807 | // .globl _Exit_2_2_5 | 807 | // .globl _Exit_2_2_5 |
| 808 | // .type _Exit_2_2_5, %function; | 808 | // .type _Exit_2_2_5, %function; |
| 809 | // .symver _Exit_2_2_5, _Exit@@GLIBC_2.2.5 | 809 | // .symver _Exit_2_2_5, _Exit@@GLIBC_2.2.5 |
| 810 | // .hidden _Exit_2_2_5 | | |
| 811 | // _Exit_2_2_5: | 810 | // _Exit_2_2_5: |
| 812 | const ver_index = ver_list.versions[ver_i]; | 811 | const ver_index = ver_list.versions[ver_i]; |
| 813 | const ver = metadata.all_versions[ver_index]; | 812 | const ver = metadata.all_versions[ver_index]; |
| 814 | const sym_name = libc_fn.name; | 813 | const sym_name = libc_fn.name; |
| 815 | // Default symbol version definition vs normal symbol version definition | 814 | // Default symbol version definition vs normal symbol version definition |
| 816 | const want_two_ats = chosen_def_ver_index != 255 and ver_index == chosen_def_ver_index; | 815 | const want_default = chosen_def_ver_index != 255 and ver_index == chosen_def_ver_index; |
| 817 | const at_sign_str = "@@"[0 .. @boolToInt(want_two_ats) + @as(usize, 1)]; | 816 | const at_sign_str: []const u8 = if (want_default) "@@" else "@"; |
| 818 | | | |
| 819 | if (ver.patch == 0) { | 817 | if (ver.patch == 0) { |
| 820 | const sym_plus_ver = try std.fmt.allocPrint( | 818 | const sym_plus_ver = if (want_default) |
| 821 | arena, | 819 | sym_name |
| 822 | "{s}_{d}_{d}", | 820 | else |
| 823 | .{ sym_name, ver.major, ver.minor }, | 821 | try std.fmt.allocPrint( |
| 824 | ); | 822 | arena, |
| | 823 | "{s}_GLIBC_{d}_{d}", |
| | 824 | .{ sym_name, ver.major, ver.minor }, |
| | 825 | ); |
| 825 | try zig_body.writer().print( | 826 | try zig_body.writer().print( |
| 826 | \\.globl {s} | 827 | \\.globl {s} |
| 827 | \\.type {s}, %function; | 828 | \\.type {s}, %function; |
| 828 | \\.symver {s}, {s}{s}GLIBC_{d}.{d} | 829 | \\.symver {s}, {s}{s}GLIBC_{d}.{d} |
| 829 | \\.hidden {s} | | |
| 830 | \\{s}: | 830 | \\{s}: |
| 831 | \\ | 831 | \\ |
| 832 | , .{ | 832 | , .{ |
| ... | @@ -838,19 +838,20 @@ pub fn buildSharedObjects(comp: *Compilation) !void { | ... | @@ -838,19 +838,20 @@ pub fn buildSharedObjects(comp: *Compilation) !void { |
| 838 | ver.major, | 838 | ver.major, |
| 839 | ver.minor, | 839 | ver.minor, |
| 840 | sym_plus_ver, | 840 | sym_plus_ver, |
| 841 | sym_plus_ver, | | |
| 842 | }); | 841 | }); |
| 843 | } else { | 842 | } else { |
| 844 | const sym_plus_ver = try std.fmt.allocPrint( | 843 | const sym_plus_ver = if (want_default) |
| 845 | arena, | 844 | sym_name |
| 846 | "{s}_{d}_{d}_{d}", | 845 | else |
| 847 | .{ sym_name, ver.major, ver.minor, ver.patch }, | 846 | try std.fmt.allocPrint( |
| 848 | ); | 847 | arena, |
| | 848 | "{s}_GLIBC_{d}_{d}_{d}", |
| | 849 | .{ sym_name, ver.major, ver.minor, ver.patch }, |
| | 850 | ); |
| 849 | try zig_body.writer().print( | 851 | try zig_body.writer().print( |
| 850 | \\.globl {s} | 852 | \\.globl {s} |
| 851 | \\.type {s}, %function; | 853 | \\.type {s}, %function; |
| 852 | \\.symver {s}, {s}{s}GLIBC_{d}.{d}.{d} | 854 | \\.symver {s}, {s}{s}GLIBC_{d}.{d}.{d} |
| 853 | \\.hidden {s} | | |
| 854 | \\{s}: | 855 | \\{s}: |
| 855 | \\ | 856 | \\ |
| 856 | , .{ | 857 | , .{ |
| ... | @@ -863,7 +864,6 @@ pub fn buildSharedObjects(comp: *Compilation) !void { | ... | @@ -863,7 +864,6 @@ pub fn buildSharedObjects(comp: *Compilation) !void { |
| 863 | ver.minor, | 864 | ver.minor, |
| 864 | ver.patch, | 865 | ver.patch, |
| 865 | sym_plus_ver, | 866 | sym_plus_ver, |
| 866 | sym_plus_ver, | | |
| 867 | }); | 867 | }); |
| 868 | } | 868 | } |
| 869 | } | 869 | } |