| ... | ... | @@ -4685,11 +4685,13 @@ fn allocateSpecialPhdrs(self: *Elf) void { |
| 4685 | 4685 | } |
| 4686 | 4686 | |
| 4687 | 4687 | // Allocate TLS phdr |
| 4688 | // We assume TLS sections are laid out contiguously and that there is |
| 4689 | // a single TLS segment. |
| 4688 | 4690 | if (self.phdr_tls_index) |index| { |
| 4689 | 4691 | const slice = self.shdrs.items; |
| 4690 | 4692 | const phdr = &self.phdrs.items[index]; |
| 4691 | 4693 | var shndx: u16 = 0; |
| 4692 | | outer: while (shndx < slice.len) { |
| 4694 | while (shndx < slice.len) { |
| 4693 | 4695 | const shdr = slice[shndx]; |
| 4694 | 4696 | if (shdr.sh_flags & elf.SHF_TLS == 0) { |
| 4695 | 4697 | shndx += 1; |
| ... | ... | @@ -4704,7 +4706,8 @@ fn allocateSpecialPhdrs(self: *Elf) void { |
| 4704 | 4706 | |
| 4705 | 4707 | while (shndx < slice.len) : (shndx += 1) { |
| 4706 | 4708 | const next = slice[shndx]; |
| 4707 | | if (next.sh_flags & elf.SHF_TLS == 0) continue :outer; |
| 4709 | // if (next.sh_flags & elf.SHF_TLS == 0) continue :outer; // TODO uncomment if we permit more TLS segments |
| 4710 | if (next.sh_flags & elf.SHF_TLS == 0) break; |
| 4708 | 4711 | self.addShdrToPhdr(shndx, index); |
| 4709 | 4712 | } |
| 4710 | 4713 | } |