Skip to content

Commit 4613c36

Browse files
committed
build: prohibit orphan sections
I changed `--orphan-section` from `place` (default) to `error`, and explicitly specified rules in a linker script.
1 parent efb38ce commit 4613c36

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

linker.ld

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@ SECTIONS {
1515
*(.debug*)
1616
*(.eh_frame*)
1717
}
18+
.symtab : { *(.symtab) }
19+
.strtab : { *(.strtab) }
20+
.shstrtab : { *(.shstrtab) }
1821
}
1922
__bss_size = (__bss_end - __bss_start) >> 3;

toolset.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"--gc-sections",
1919
"--print-gc-sections",
2020
"--strip-all",
21+
"--orphan-handling=error",
2122
"-T", "linker.ld",
2223
"-Map", ".build/kernel.map",
2324
]

0 commit comments

Comments
 (0)