fix -section-alignment smaller than ELF header size

This commit is contained in:
tuxcrafting 2024-10-24 13:02:28 +03:00
parent d9f1836124
commit 50cfe1141b

View file

@ -2305,7 +2305,7 @@ static int layout_sections(TCCState *s1, int *sec_order, struct dyn_inf *d)
} }
base = addr; base = addr;
/* compute address after headers */ /* compute address after headers */
addr = addr + (file_offset & (s_align - 1)); addr += file_offset;
n = 0; n = 0;
for(i = 1; i < s1->nb_sections; i++) { for(i = 1; i < s1->nb_sections; i++) {