History

Aligb section at end in tcc_load_object_file

Noticed this when the crt1.o file on an updated riscv had a text section where the size is not multiple of align. This file is loaded first and when the c code is then compiled the code is not aligned any more. This results in: alignment of code section not multiple of 4 in riscv64-gen.c

herman ten brugge committed 1 year ago

Commit c6afdff1 parent 90ae3831 file · +5 −0Browse files

Unified · Split

tccelf.c+5−0
@@ -3245,6 +3245,11 @@ invalid: · 3244 unmodified lines
3245 } else {3245 } else {
3246 s->data_offset += size;3246 s->data_offset += size;
3247 }3247 }
3248 /* align end of section */
3249 /* This is needed if we compile a c file after this */
3250 if (s == text_section || s == data_section || s == rodata_section ||
3251 s == bss_section || s == common_section)
3252 s->data_offset += -s->data_offset & (s->sh_addralign - 1);
3248 next: ;3253 next: ;
3249 }3254 }
3250 3255

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t