| ... | ... | @@ -935,10 +935,11 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) !voi |
| 935 | 935 | var ver_buf_i: u8 = 0; |
| 936 | 936 | while (ver_buf_i < versions_len) : (ver_buf_i += 1) { |
| 937 | 937 | // Example: |
| 938 | // .balign 4 |
| 938 | 939 | // .globl _Exit_2_2_5 |
| 939 | 940 | // .type _Exit_2_2_5, %function; |
| 940 | 941 | // .symver _Exit_2_2_5, _Exit@@GLIBC_2.2.5 |
| 941 | | // _Exit_2_2_5: |
| 942 | // _Exit_2_2_5: .long 0 |
| 942 | 943 | const ver_index = versions_buffer[ver_buf_i]; |
| 943 | 944 | const ver = metadata.all_versions[ver_index]; |
| 944 | 945 | |
| ... | ... | @@ -957,12 +958,14 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) !voi |
| 957 | 958 | .{ sym_name, ver.major, ver.minor }, |
| 958 | 959 | ); |
| 959 | 960 | try stubs_asm.writer().print( |
| 961 | \\.balign {d} |
| 960 | 962 | \\.globl {s} |
| 961 | 963 | \\.type {s}, %function; |
| 962 | 964 | \\.symver {s}, {s}{s}GLIBC_{d}.{d} |
| 963 | | \\{s}: |
| 965 | \\{s}: {s} 0 |
| 964 | 966 | \\ |
| 965 | 967 | , .{ |
| 968 | target.ptrBitWidth() / 8, |
| 966 | 969 | sym_plus_ver, |
| 967 | 970 | sym_plus_ver, |
| 968 | 971 | sym_plus_ver, |
| ... | ... | @@ -971,6 +974,7 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) !voi |
| 971 | 974 | ver.major, |
| 972 | 975 | ver.minor, |
| 973 | 976 | sym_plus_ver, |
| 977 | wordDirective(target), |
| 974 | 978 | }); |
| 975 | 979 | } else { |
| 976 | 980 | const sym_plus_ver = if (want_default) |
| ... | ... | @@ -982,12 +986,14 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) !voi |
| 982 | 986 | .{ sym_name, ver.major, ver.minor, ver.patch }, |
| 983 | 987 | ); |
| 984 | 988 | try stubs_asm.writer().print( |
| 989 | \\.balign {d} |
| 985 | 990 | \\.globl {s} |
| 986 | 991 | \\.type {s}, %function; |
| 987 | 992 | \\.symver {s}, {s}{s}GLIBC_{d}.{d}.{d} |
| 988 | | \\{s}: |
| 993 | \\{s}: {s} 0 |
| 989 | 994 | \\ |
| 990 | 995 | , .{ |
| 996 | target.ptrBitWidth() / 8, |
| 991 | 997 | sym_plus_ver, |
| 992 | 998 | sym_plus_ver, |
| 993 | 999 | sym_plus_ver, |
| ... | ... | @@ -997,6 +1003,7 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) !voi |
| 997 | 1003 | ver.minor, |
| 998 | 1004 | ver.patch, |
| 999 | 1005 | sym_plus_ver, |
| 1006 | wordDirective(target), |
| 1000 | 1007 | }); |
| 1001 | 1008 | } |
| 1002 | 1009 | } |
| ... | ... | @@ -1024,10 +1031,14 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) !voi |
| 1024 | 1031 | // a strong reference. |
| 1025 | 1032 | if (std.mem.eql(u8, lib.name, "c")) { |
| 1026 | 1033 | try stubs_asm.writer().print( |
| 1034 | \\.balign {d} |
| 1027 | 1035 | \\.globl _IO_stdin_used |
| 1028 | 1036 | \\{s} _IO_stdin_used |
| 1029 | 1037 | \\ |
| 1030 | | , .{wordDirective(target)}); |
| 1038 | , .{ |
| 1039 | target.ptrBitWidth() / 8, |
| 1040 | wordDirective(target), |
| 1041 | }); |
| 1031 | 1042 | } |
| 1032 | 1043 | |
| 1033 | 1044 | const obj_inclusions_len = try inc_reader.readInt(u16, .little); |
| ... | ... | @@ -1099,11 +1110,12 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) !voi |
| 1099 | 1110 | var ver_buf_i: u8 = 0; |
| 1100 | 1111 | while (ver_buf_i < versions_len) : (ver_buf_i += 1) { |
| 1101 | 1112 | // Example: |
| 1113 | // .balign 4 |
| 1102 | 1114 | // .globl environ_2_2_5 |
| 1103 | 1115 | // .type environ_2_2_5, %object; |
| 1104 | 1116 | // .size environ_2_2_5, 4; |
| 1105 | 1117 | // .symver environ_2_2_5, environ@@GLIBC_2.2.5 |
| 1106 | | // environ_2_2_5: |
| 1118 | // environ_2_2_5: .fill 4, 1, 0 |
| 1107 | 1119 | const ver_index = versions_buffer[ver_buf_i]; |
| 1108 | 1120 | const ver = metadata.all_versions[ver_index]; |
| 1109 | 1121 | |
| ... | ... | @@ -1122,13 +1134,15 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) !voi |
| 1122 | 1134 | .{ sym_name, ver.major, ver.minor }, |
| 1123 | 1135 | ); |
| 1124 | 1136 | try stubs_asm.writer().print( |
| 1137 | \\.balign {d} |
| 1125 | 1138 | \\.globl {s} |
| 1126 | 1139 | \\.type {s}, %object; |
| 1127 | 1140 | \\.size {s}, {d}; |
| 1128 | 1141 | \\.symver {s}, {s}{s}GLIBC_{d}.{d} |
| 1129 | | \\{s}: |
| 1142 | \\{s}: .fill {d}, 1, 0 |
| 1130 | 1143 | \\ |
| 1131 | 1144 | , .{ |
| 1145 | target.ptrBitWidth() / 8, |
| 1132 | 1146 | sym_plus_ver, |
| 1133 | 1147 | sym_plus_ver, |
| 1134 | 1148 | sym_plus_ver, |
| ... | ... | @@ -1139,6 +1153,7 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) !voi |
| 1139 | 1153 | ver.major, |
| 1140 | 1154 | ver.minor, |
| 1141 | 1155 | sym_plus_ver, |
| 1156 | size, |
| 1142 | 1157 | }); |
| 1143 | 1158 | } else { |
| 1144 | 1159 | const sym_plus_ver = if (want_default) |
| ... | ... | @@ -1150,13 +1165,15 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) !voi |
| 1150 | 1165 | .{ sym_name, ver.major, ver.minor, ver.patch }, |
| 1151 | 1166 | ); |
| 1152 | 1167 | try stubs_asm.writer().print( |
| 1168 | \\.balign {d} |
| 1153 | 1169 | \\.globl {s} |
| 1154 | 1170 | \\.type {s}, %object; |
| 1155 | 1171 | \\.size {s}, {d}; |
| 1156 | 1172 | \\.symver {s}, {s}{s}GLIBC_{d}.{d}.{d} |
| 1157 | | \\{s}: |
| 1173 | \\{s}: .fill {d}, 1, 0 |
| 1158 | 1174 | \\ |
| 1159 | 1175 | , .{ |
| 1176 | target.ptrBitWidth() / 8, |
| 1160 | 1177 | sym_plus_ver, |
| 1161 | 1178 | sym_plus_ver, |
| 1162 | 1179 | sym_plus_ver, |
| ... | ... | @@ -1168,6 +1185,7 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) !voi |
| 1168 | 1185 | ver.minor, |
| 1169 | 1186 | ver.patch, |
| 1170 | 1187 | sym_plus_ver, |
| 1188 | size, |
| 1171 | 1189 | }); |
| 1172 | 1190 | } |
| 1173 | 1191 | } |