Skip to content

Commit ade010a

Browse files
josephlrrbradford
authored andcommitted
linker.ld: Reorder sections
To allow for future flat BIOS builds, we reorder the sections to put the .text at the end (as that will contain the reset vector). We also remove the alignment requirements for the sections, as they are not necessary. This makes the binary about 10% smaller. Signed-off-by: Joe Richey <[email protected]>
1 parent 3307922 commit ade010a

File tree

1 file changed

+9
-24
lines changed

1 file changed

+9
-24
lines changed

layout.ld

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,15 @@
11
ENTRY(_start)
2-
2+
33
SECTIONS
44
{
5-
. = 1M;
6-
start_of_text = . ;
7-
.text : ALIGN(4K)
8-
{
9-
*(.text .text.*)
10-
}
11-
end_of_text = . ;
12-
5+
. = 1M ;
136
start_of_data = . ;
14-
.rodata : ALIGN(4K)
15-
{
16-
*(.rodata .rodata.*)
17-
}
18-
19-
.data : ALIGN(4K)
20-
{
21-
*(.data .data.*)
22-
}
7+
.rodata : { *(.rodata .rodata.*) }
8+
.data : { *(.data .data.*) }
9+
.bss : { *(COMMON) *(.bss .bss.*) }
2310
end_of_data = . ;
24-
25-
.bss : ALIGN(4K)
26-
{
27-
*(COMMON)
28-
*(.bss .bss.*)
29-
}
11+
12+
start_of_text = . ;
13+
.text : { *(.text .text.*) }
14+
end_of_text = . ;
3015
}

0 commit comments

Comments
 (0)