From d7f9166ab5687e3c657c6e15adcd509982893a37 Mon Sep 17 00:00:00 2001 From: herman ten brugge Date: Sun, 20 Oct 2024 11:05:10 +0200 Subject: [PATCH] Fix last commit. --- tccelf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tccelf.c b/tccelf.c index 609a07ab6..2387ba67c 100644 --- a/tccelf.c +++ b/tccelf.c @@ -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;