-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
Description
SUBALIGN may be used to adjust the alignment of each input section
cat > script.t << '!'
SECTIONS {
text (0x14) : SUBALIGN(64) {
*(.text*)
}
}
!
cat > test.c << '!'
int foo() { return 1; }
int bar() { return 0; }
!
clang -falign-functions=4 --target=riscv32-unknown-elf -c test.c -ffunction-sections
ld.eld test.o -T script.t -Map map.txt -o eld.out
Bug
$ llvm-readelf -s eld.out | grep -E 'foo|bar'
9: 00000014 18 FUNC GLOBAL DEFAULT 1 foo
10: 00000028 18 FUNC GLOBAL DEFAULT 1 bar
Correct Behavior
$ llvm-readelf -s bfd.out | grep -E 'foo|bar'
9: 00000040 18 FUNC GLOBAL DEFAULT 1 foo
10: 00000080 18 FUNC GLOBAL DEFAULT 1 bar
Reactions are currently unavailable