authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-09-15 13:13:42+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2020-09-15 18:14:06+03:00
logc1c3212500377a8128f37a873a7845c6bf5993e6
treec6e4d8d4cc5b779f5af9fe444f092e8175ae2506
parent5e39ab460073b0068d30a74488abf83333761c8d

std: Fix typo in ELF section header iterator

The code accidentally used the phdr offset instead of the shdr one while iterating over the section headers. Fixes #6338

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/elf.zig+1-1
......@@ -471,7 +471,7 @@ pub const SectionHeaderIterator = struct {
471471
472472 if (self.elf_header.is_64) {
473473 var shdr: Elf64_Shdr = undefined;
474 const offset = self.elf_header.phoff + @sizeOf(@TypeOf(shdr)) * self.index;
474 const offset = self.elf_header.shoff + @sizeOf(@TypeOf(shdr)) * self.index;
475475 try preadNoEof(self.file, mem.asBytes(&shdr), offset);
476476
477477 // ELF endianness matches native endianness.