mirror of
https://github.com/ziglang/zig.git
synced 2026-01-05 13:03:25 +00:00
elf: assume only one TLS segment for now
This commit is contained in:
parent
8be71906d9
commit
2aa6099ad9
@ -4685,11 +4685,13 @@ fn allocateSpecialPhdrs(self: *Elf) void {
|
||||
}
|
||||
|
||||
// Allocate TLS phdr
|
||||
// We assume TLS sections are laid out contiguously and that there is
|
||||
// a single TLS segment.
|
||||
if (self.phdr_tls_index) |index| {
|
||||
const slice = self.shdrs.items;
|
||||
const phdr = &self.phdrs.items[index];
|
||||
var shndx: u16 = 0;
|
||||
outer: while (shndx < slice.len) {
|
||||
while (shndx < slice.len) {
|
||||
const shdr = slice[shndx];
|
||||
if (shdr.sh_flags & elf.SHF_TLS == 0) {
|
||||
shndx += 1;
|
||||
@ -4704,7 +4706,8 @@ fn allocateSpecialPhdrs(self: *Elf) void {
|
||||
|
||||
while (shndx < slice.len) : (shndx += 1) {
|
||||
const next = slice[shndx];
|
||||
if (next.sh_flags & elf.SHF_TLS == 0) continue :outer;
|
||||
// if (next.sh_flags & elf.SHF_TLS == 0) continue :outer; // TODO uncomment if we permit more TLS segments
|
||||
if (next.sh_flags & elf.SHF_TLS == 0) break;
|
||||
self.addShdrToPhdr(shndx, index);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user