Fix last commit.

This commit is contained in:
herman ten brugge 2024-10-20 11:05:10 +02:00
parent 5a467ddc98
commit d7f9166ab5

View file

@ -2527,8 +2527,6 @@ static int tcc_output_elf(TCCState *s1, FILE *f, int phnum, ElfW(Phdr) *phdr)
ElfW(Ehdr) ehdr;
ElfW(Shdr) shdr, *sh;
sort_syms(s1, s1->symtab);
file_type = s1->output_type;
shnum = s1->nb_sections;
@ -2578,6 +2576,8 @@ static int tcc_output_elf(TCCState *s1, FILE *f, int phnum, ElfW(Phdr) *phdr)
return -1;
}
sort_syms(s1, s1->symtab);
ehdr.e_machine = EM_TCC_TARGET;
ehdr.e_version = EV_CURRENT;
ehdr.e_shoff = (sizeof(ElfW(Ehdr)) + phnum * sizeof(ElfW(Phdr)) + 3) & -4;