output: elf -- Use Elf64_Ehdr into section offset

Same as we do in e_shoff.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov 2017-03-18 16:25:49 +03:00
parent b074501887
commit 8f1d6b0ed8

View File

@ -1679,7 +1679,7 @@ static void elf_write(void)
* Now output the section header table.
*/
elf_foffs = 0x40 + (is_elf64() ? sizeof(Elf64_Shdr): sizeof(Elf32_Shdr)) * nsections;
elf_foffs = sizeof(Elf64_Ehdr) + (is_elf64() ? sizeof(Elf64_Shdr): sizeof(Elf32_Shdr)) * nsections;
align = ALIGN(elf_foffs, SEC_FILEALIGN) - elf_foffs;
elf_foffs += align;
elf_nsect = 0;