Skip to content

Commit 9fb7659

Browse files
josephlrrbradford
authored andcommitted
layout: merge .bss into .data
This moves the .bss section from "uninitialized" memory that gets allocated by the loader to explictily zeroed memory in the .data section. This makes the loader's job much easier, as it can just map the file in one contiguous section of memory. Before, it would have to "expand" the .bss section. Signed-off-by: Joe Richey <joerichey@google.com>
1 parent be2abc5 commit 9fb7659

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

layout.ld

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ SECTIONS
1515
/* Mapping in the program headers makes it easier to mmap the whole file. */
1616
. += SIZEOF_HEADERS ;
1717

18-
.rodata : { *(.rodata .rodata.*) } :rodata
19-
.data : { *(.data .data.*) } :data
20-
.bss : { *(.bss .bss.*) } :data
21-
.text : { *(.text .text.*) } :text
18+
.rodata : { *(.rodata .rodata.*) } :rodata
19+
.data : { *(.data .data.*) *(.bss .bss.*) } :data
20+
.text : { *(.text .text.*) } :text
2221

2322
_end_of_file = . ;
2423

0 commit comments

Comments
 (0)