| ... | ... | @@ -3264,20 +3264,24 @@ fn loadObject( |
| 3264 | 3264 | }; |
| 3265 | 3265 | |
| 3266 | 3266 | if (input_sym.shndx == std.elf.SHN_UNDEF) switch (input_sym.info.bind) { |
| 3267 | | _ => |bind| return diags.failParse( |
| 3267 | else => |bind| return diags.failParse( |
| 3268 | 3268 | path, |
| 3269 | 3269 | "symbol '{s}' has unsupported binding (0x{x})", |
| 3270 | 3270 | .{ name, bind }, |
| 3271 | 3271 | ), |
| 3272 | 3272 | .LOCAL => continue, |
| 3273 | | .GLOBAL, .WEAK => |bind| { |
| 3273 | .GLOBAL, .WEAK, .GNU_UNIQUE => |bind| { |
| 3274 | 3274 | si.* = elf.addGlobalSymbolAssumeCapacity(.{ |
| 3275 | 3275 | .node = .none, |
| 3276 | 3276 | .name = try .string(elf, name), |
| 3277 | 3277 | .value = input_sym.value, |
| 3278 | 3278 | .size = input_sym.size, |
| 3279 | 3279 | .type = sym_type, |
| 3280 | | .bind = if (bind == .WEAK) .weak else .strong, |
| 3280 | .bind = switch (bind) { |
| 3281 | .WEAK, .GNU_UNIQUE => .weak, |
| 3282 | .GLOBAL => .strong, |
| 3283 | else => unreachable, |
| 3284 | }, |
| 3281 | 3285 | .visibility = input_sym.other.visibility, |
| 3282 | 3286 | .shndx = .UNDEF, |
| 3283 | 3287 | }) catch |err| switch (err) { |
| ... | ... | @@ -3290,7 +3294,7 @@ fn loadObject( |
| 3290 | 3294 | const input_section_node = (sections[input_sym.shndx].isi orelse continue).node(elf); |
| 3291 | 3295 | |
| 3292 | 3296 | switch (input_sym.info.bind) { |
| 3293 | | _ => |bind| return diags.failParse( |
| 3297 | else => |bind| return diags.failParse( |
| 3294 | 3298 | path, |
| 3295 | 3299 | "symbol '{s}' has unsupported binding (0x{x})", |
| 3296 | 3300 | .{ name, bind }, |
| ... | ... | @@ -3306,14 +3310,18 @@ fn loadObject( |
| 3306 | 3310 | }); |
| 3307 | 3311 | si.* = .local(lsi); |
| 3308 | 3312 | }, |
| 3309 | | .GLOBAL, .WEAK => |bind| { |
| 3313 | .GLOBAL, .WEAK, .GNU_UNIQUE => |bind| { |
| 3310 | 3314 | si.* = elf.addGlobalSymbolAssumeCapacity(.{ |
| 3311 | 3315 | .node = input_section_node, |
| 3312 | 3316 | .name = try .string(elf, name), |
| 3313 | 3317 | .value = input_sym.value, |
| 3314 | 3318 | .size = input_sym.size, |
| 3315 | 3319 | .type = sym_type, |
| 3316 | | .bind = if (bind == .WEAK) .weak else .strong, |
| 3320 | .bind = switch (bind) { |
| 3321 | .WEAK, .GNU_UNIQUE => .weak, |
| 3322 | .GLOBAL => .strong, |
| 3323 | else => unreachable, |
| 3324 | }, |
| 3317 | 3325 | .visibility = input_sym.other.visibility, |
| 3318 | 3326 | .shndx = elf.getNodeShndx(input_section_node), |
| 3319 | 3327 | }) catch |err| switch (err) { |