| ... | @@ -2847,6 +2847,14 @@ fn mapInputSection(elf: *Elf, opts: struct { | ... | @@ -2847,6 +2847,14 @@ fn mapInputSection(elf: *Elf, opts: struct { |
| 2847 | assert(!elf.base.comp.config.any_non_single_threaded); | 2847 | assert(!elf.base.comp.config.any_non_single_threaded); |
| 2848 | return error.TlsSectionUnavailable; | 2848 | return error.TlsSectionUnavailable; |
| 2849 | } | 2849 | } |
| | 2850 | |
| | 2851 | if (elf.base.comp.config.debug_format == .strip and |
| | 2852 | std.mem.startsWith(u8, opts.name, ".debug_") and |
| | 2853 | !opts.flags.ALLOC) |
| | 2854 | { |
| | 2855 | return error.StripSection; |
| | 2856 | } |
| | 2857 | |
| 2850 | const name: []const u8 = switch (elf.ehdrField(.type)) { | 2858 | const name: []const u8 = switch (elf.ehdrField(.type)) { |
| 2851 | .NONE, .CORE, _ => unreachable, | 2859 | .NONE, .CORE, _ => unreachable, |
| 2852 | .REL => opts.name, | 2860 | .REL => opts.name, |
| ... | @@ -2971,6 +2979,7 @@ fn navMapIndex(elf: *Elf, zcu: *Zcu, nav_index: InternPool.Nav.Index) !Node.NavM | ... | @@ -2971,6 +2979,7 @@ fn navMapIndex(elf: *Elf, zcu: *Zcu, nav_index: InternPool.Nav.Index) !Node.NavM |
| 2971 | })) |shndx| { | 2979 | })) |shndx| { |
| 2972 | break :section shndx; | 2980 | break :section shndx; |
| 2973 | } else |err| switch (err) { | 2981 | } else |err| switch (err) { |
| | 2982 | error.StripSection, |
| 2974 | error.TlsSectionUnavailable, | 2983 | error.TlsSectionUnavailable, |
| 2975 | error.UnsupportedSectionFlags, | 2984 | error.UnsupportedSectionFlags, |
| 2976 | error.SectionTypeConflict, | 2985 | error.SectionTypeConflict, |
| ... | @@ -3271,6 +3280,7 @@ fn loadObject( | ... | @@ -3271,6 +3280,7 @@ fn loadObject( |
| 3271 | .addralign = section.shdr.addralign, | 3280 | .addralign = section.shdr.addralign, |
| 3272 | .entsize = section.shdr.entsize, | 3281 | .entsize = section.shdr.entsize, |
| 3273 | }) catch |err| switch (err) { | 3282 | }) catch |err| switch (err) { |
| | 3283 | error.StripSection => continue, |
| 3274 | error.TlsSectionUnavailable => return diags.failParse( | 3284 | error.TlsSectionUnavailable => return diags.failParse( |
| 3275 | path, | 3285 | path, |
| 3276 | "thread-local storage section '{s}' is incompatible with '-fsingle-threaded'", | 3286 | "thread-local storage section '{s}' is incompatible with '-fsingle-threaded'", |