Index: boot/arch/arm32/_link.ld.in
===================================================================
--- boot/arch/arm32/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ boot/arch/arm32/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -7,6 +7,6 @@
 	.text : {
 		loader_start = .;
-		*(BOOTSTRAP);
-		*(.text);
+		KEEP(*(BOOTSTRAP));
+		*(.text .text.*);
 	}
 	. = BOOT_BASE + 0x8000;
@@ -14,16 +14,14 @@
 		*(BOOTPT);      /* bootstrap page table */
 		*(BOOTSTACK);   /* bootstrap stack */
-		*(.data);       /* initialized data */
-		*(.rodata);
-		*(.rodata.*);
-		*(.sdata);
-		*(.reginfo);
-		*(.sbss);
-		*(.scommon);
-		*(.bss);        /* uninitialized static variables */
+		*(.data .data.*);       /* initialized data */
+		*(.rodata .rodata.*);
+		*(.sdata .sdata.*);
+		*(.sbss .sbss.*);
+		*(.scommon .scommon.*);
+		*(.bss .bss.*);        /* uninitialized static variables */
 		*(COMMON);      /* global variables */
 		loader_end = .;
 		payload_start = .;
-		*(.payload);
+		KEEP(*(.payload));
 		payload_end = .;
 	}
Index: boot/arch/arm64/_link.ld.in
===================================================================
--- boot/arch/arm64/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ boot/arch/arm64/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -7,6 +7,6 @@
 	.text : {
 		HIDDEN(loader_start = .);
-		*(BOOTSTRAP);
-		*(.text);
+		KEEP(*(BOOTSTRAP));
+		*(.text .text.*);
 	}
 	.dynamic : { *(.dynamic); }
@@ -17,12 +17,12 @@
 	. = 0x8000;
 	.data : {
-		*(.data*);      /* initialized data */
-		*(.rodata*);
-		*(.bss);        /* uninitialized static variables */
+		*(.data .data.*);      /* initialized data */
+		*(.rodata .rodata.*);
+		*(.bss .bss.*);        /* uninitialized static variables */
 		*(COMMON);      /* global variables */
-		*(.got .got.plt);
+		*(.got .got.*);
 		HIDDEN(loader_end = .);
 		HIDDEN(payload_start = .);
-		*(.payload);
+		KEEP(*(.payload));
 		HIDDEN(payload_end = .);
 	}
Index: boot/arch/ia64/_link.ld.in
===================================================================
--- boot/arch/ia64/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ boot/arch/ia64/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -5,20 +5,18 @@
 	.boot 0x4400000: AT (0x4400000) {
 		loader_start = .;
-		*(BOOTSTRAP);
-		*(.text);
-		*(.text.*);
-		*(.sdata);
-		*(.sdata2);
-		*(.sbss);
-		*(.rodata);
-		*(.rodata.*);
+		KEEP(*(BOOTSTRAP));
+		*(.text .text.*);
+		*(.sdata .sdata.*);
+		*(.sdata2 .sdata2.*);
+		*(.sbss .sbss.*);
+		*(.rodata .rodata.*);
 		*(.data .data.*);       /* initialized data */
 		__gp = . ;
 		*(.got .got.*);
-		*(.bss);                /* uninitialized static variables */
+		*(.bss .bss.*);                /* uninitialized static variables */
 		*(COMMON);
 		loader_end = .;
 		payload_start = .;
-		*(.payload);
+		KEEP(*(.payload));
 		payload_end = .;
 	}
Index: boot/arch/mips32/_link.ld.in
===================================================================
--- boot/arch/mips32/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ boot/arch/mips32/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -9,20 +9,19 @@
 	.text : {
 		loader_start = .;
-		*(BOOTSTRAP);
-		*(.text);
+		KEEP(*(BOOTSTRAP));
+		*(.text .text.*);
 	}
 	.data : {
-		*(.data);       /* initialized data */
-		*(.rodata);
-		*(.rodata.*);
-		*(.sdata);
+		*(.data .data.*);       /* initialized data */
+		*(.rodata .rodata.*);
+		*(.sdata .sdata.*);
 		*(.reginfo);
-		*(.sbss);
-		*(.scommon);
-		*(.bss);        /* uninitialized static variables */
+		*(.sbss .sbss.*);
+		*(.scommon .scommon.*);
+		*(.bss .bss.*);        /* uninitialized static variables */
 		*(COMMON);      /* global variables */
 		loader_end = .;
 		payload_start = .;
-		*(.payload);
+		KEEP(*(.payload));
 		payload_end = .;
 	}
Index: boot/arch/ppc32/_link.ld.in
===================================================================
--- boot/arch/ppc32/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ boot/arch/ppc32/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -5,21 +5,18 @@
 	.text : {
 		loader_start = .;
-		*(BOOTSTRAP);
-		*(.text);
-		*(.text.*);
+		KEEP(*(BOOTSTRAP));
+		*(.text .text.*);
 	}
 	.data : {
-		*(.data);       /* initialized data */
-		*(.rodata);
-		*(.rodata.*);
-		*(.sdata);
-		*(.reginfo);
-		*(.sbss);
-		*(.scommon);
-		*(.bss);        /* uninitialized static variables */
+		*(.data .data.*);       /* initialized data */
+		*(.rodata .rodata.*);
+		*(.sdata .sdata.*);
+		*(.sbss .sbss.*);
+		*(.scommon .scommon.*);
+		*(.bss .bss.*);        /* uninitialized static variables */
 		*(COMMON);      /* global variables */
 		loader_end = .;
 		payload_start = .;
-		*(.payload);
+		KEEP(*(.payload));
 		payload_end = .;
 	}
Index: boot/arch/riscv64/_link.ld.in
===================================================================
--- boot/arch/riscv64/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ boot/arch/riscv64/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -8,6 +8,6 @@
 	.text : {
 		loader_start = .;
-		*(BOOTSTRAP);
-		*(.text);
+		KEEP(*(BOOTSTRAP));
+		*(.text .text.*);
 	}
 
@@ -27,16 +27,14 @@
 
 	.data : {
-		*(.data);       /* initialized data */
-		*(.rodata);
-		*(.rodata.*);
-		*(.sdata);
-		*(.reginfo);
-		*(.sbss);
-		*(.scommon);
-		*(.bss);        /* uninitialized static variables */
+		*(.data .data.*);       /* initialized data */
+		*(.rodata .rodata.*);
+		*(.sdata .sdata.*);
+		*(.sbss .sbss.*);
+		*(.scommon .scommon.*);
+		*(.bss .bss.*);        /* uninitialized static variables */
 		*(COMMON);      /* global variables */
 		loader_end = .;
 		payload_start = .;
-		*(.payload);
+		KEEP(*(.payload));
 		payload_end = .;
 	}
Index: boot/arch/sparc64/_link.ld.in
===================================================================
--- boot/arch/sparc64/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ boot/arch/sparc64/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -5,18 +5,16 @@
 	.boot : {
 		loader_start = .;
-		*(BOOTSTRAP);
-		*(.text.*);
+		KEEP(*(BOOTSTRAP));
+		*(.text .text.*);
 
-		*(.data);       /* initialized data */
-		*(.rodata);
-		*(.rodata.*);
-		*(.sdata);
-		*(.reginfo);
-		*(.sbss);
-		*(.bss);        /* uninitialized static variables */
+		*(.data .data.*);       /* initialized data */
+		*(.rodata .rodata.*);
+		*(.sdata .sdata.*);
+		*(.sbss .sbss.*);
+		*(.bss .bss.*);        /* uninitialized static variables */
 		*(COMMON);      /* global variables */
 		loader_end = .;
 		payload_start = .;
-		*(.payload);
+		KEEP(*(.payload));
 		payload_end = .;
 	}
Index: boot/meson.build
===================================================================
--- boot/meson.build	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ boot/meson.build	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -98,5 +98,4 @@
 		'-Wl,--nmagic',
 		'-T', meson.current_build_dir()/'_link.ld',
-		'-Wl,--no-gc-sections',
 	]
 
Index: kernel/arch/abs32le/_link.ld.in
===================================================================
--- kernel/arch/abs32le/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ kernel/arch/abs32le/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -3,11 +3,11 @@
 		kernel_load_address = .;
 		ktext_start = .;
-		*(.text);
+		*(.text .text.*);
 		ktext_end = .;
 	}
 	.data : {
 		kdata_start = .;
-		*(.data);                       /* initialized data */
-		*(.bss);                        /* uninitialized static variables */
+		*(.data .data.*);                       /* initialized data */
+		*(.bss .bss.*);                        /* uninitialized static variables */
 		*(COMMON);                      /* global variables */
 
@@ -15,10 +15,9 @@
 		*(.eh_frame .eh_frame.*);       /* stack unwinding data */
 		*(.eh_frame_hdr .eh_frame_hdr.*);
-		*(.sdata);
-		*(.reginfo);
+		*(.sdata .sdata.*);
 	}
 	.sbss : {
-		*(.sbss);
-		*(.scommon);
+		*(.sbss .sbss.*);
+		*(.scommon .scommon.*);
 	}
 
Index: kernel/arch/amd64/_link.ld.in
===================================================================
--- kernel/arch/amd64/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ kernel/arch/amd64/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -17,7 +17,7 @@
 	.unmapped (BOOT_OFFSET + SIZEOF_HEADERS): AT (BOOT_OFFSET + SIZEOF_HEADERS) {
 		unmapped_start = .;
-		*(K_TEXT_START);
-		*(K_DATA_START);
-		*(K_INI_PTLS);
+		KEEP(*(K_TEXT_START));
+		KEEP(*(K_DATA_START));
+		KEEP(*(K_INI_PTLS));
 		unmapped_end = .;
 	}
@@ -29,12 +29,12 @@
 
 		kdata_start = .;
-		*(.data);              /* initialized data */
+		*(.data .data.*);              /* initialized data */
 		*(.rodata .rodata.*);
-		*(.eh_frame .eh_frame.*);       /* stack unwinding data */
+		*(.eh_frame .eh_frame.*);      /* stack unwinding data */
 		*(.eh_frame_hdr .eh_frame_hdr.*);
 		*(COMMON);      /* global variables */
 
 		/* bss can't be omitted from the ELF image. */
-		*(.bss);        /* uninitialized static variables */
+		*(.bss .bss.*);        /* uninitialized static variables */
 		kdata_end = .;
 	}
Index: kernel/arch/arm32/_link.ld.in
===================================================================
--- kernel/arch/arm32/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ kernel/arch/arm32/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -28,11 +28,11 @@
 	.text : {
 		ktext_start = .;
-		*(.text);
+		*(.text .text.*);
 		ktext_end = .;
 	}
 	.data : {
 		kdata_start = .;
-		*(.data);                       /* initialized data */
-		*(.bss);                        /* uninitialized static variables */
+		*(.data .data.*);                       /* initialized data */
+		*(.bss .bss.*);                        /* uninitialized static variables */
 		*(COMMON);                      /* global variables */
 
@@ -40,10 +40,9 @@
 		*(.eh_frame .eh_frame.*);       /* stack unwinding data */
 		*(.eh_frame_hdr .eh_frame_hdr.*);
-		*(.sdata);
-		*(.reginfo);
+		*(.sdata .sdata.*);
 	}
 	.sbss : {
-		*(.sbss);
-		*(.scommon);
+		*(.sbss .sbss.*);
+		*(.scommon .scommon.*);
 	}
 
Index: kernel/arch/arm64/_link.ld.in
===================================================================
--- kernel/arch/arm64/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ kernel/arch/arm64/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -22,12 +22,12 @@
 		. = ALIGN(16);
 		ktext_start = .;
-		*(K_TEXT_START)
+		KEEP(*(K_TEXT_START))
 		*(.text .text.*);
 		ktext_end = .;
 
 		kdata_start = .;
-		*(K_DATA_START)
-		*(.data);                       /* initialized data */
-		*(.bss);                        /* uninitialized static variables */
+		KEEP(*(K_DATA_START))
+		*(.data .data.*);                       /* initialized data */
+		*(.bss .bss.*);                        /* uninitialized static variables */
 		*(COMMON);                      /* global variables */
 
Index: kernel/arch/ia32/_link.ld.in
===================================================================
--- kernel/arch/ia32/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ kernel/arch/ia32/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -17,6 +17,6 @@
 	.unmapped (BOOT_OFFSET + SIZEOF_HEADERS): AT (BOOT_OFFSET + SIZEOF_HEADERS) {
 		unmapped_start = .;
-		*(K_TEXT_START);
-		*(K_DATA_START);
+		KEEP(*(K_TEXT_START));
+		KEEP(*(K_DATA_START));
 		unmapped_end = .;
 	}
@@ -28,5 +28,5 @@
 
 		kdata_start = .;
-		*(.data);               /* initialized data */
+		*(.data .data.*);               /* initialized data */
 		*(.rodata .rodata.*);
 		*(.eh_frame .eh_frame.*);       /* stack unwinding data */
@@ -35,5 +35,5 @@
 
 		/* bss can't be omitted from the ELF image. */
-		*(.bss);                /* uninitialized static variables */
+		*(.bss .bss.*);                /* uninitialized static variables */
 		kdata_end = .;
 	}
Index: kernel/arch/ia64/_link.ld.in
===================================================================
--- kernel/arch/ia64/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ kernel/arch/ia64/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -18,10 +18,10 @@
 		. = ALIGN(16);
 		ktext_start = .;
-		*(K_TEXT_START);
+		KEEP(*(K_TEXT_START));
 		*(.text .text.*)
 		ktext_end = .;
 
 		kdata_start = .;
-		*(K_DATA_START)
+		KEEP(*(K_DATA_START));
 		*(.rodata .rodata.*);
 		*(.eh_frame .eh_frame.*);       /* stack unwinding data */
@@ -31,8 +31,8 @@
 		__gp = .;
 		*(.got .got.*)
-		*(.sdata)
-		*(.sbss)
-		*(.scommon)
-		*(.bss)
+		*(.sdata .sdata.*)
+		*(.sbss .sbss.*)
+		*(.scommon .scommon.*)
+		*(.bss .bss.*)
 		*(COMMON);
 		kdata_end = .;
Index: kernel/arch/mips32/_link.ld.in
===================================================================
--- kernel/arch/mips32/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ kernel/arch/mips32/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -28,18 +28,20 @@
 	.text : {
 		ktext_start = .;
+		/* FIXME: for some reason, mixing .text with .text.* produces a crash on malta-be */
 		*(.text);
+		*(.text.*);
 		ktext_end = .;
 	}
 	.data : {
 		kdata_start = .;
-		*(.data);                       /* initialized data */
+		*(.data .data.*);                       /* initialized data */
 		*(.rodata .rodata.*);
 		*(.eh_frame .eh_frame.*);       /* stack unwinding data */
 		*(.eh_frame_hdr .eh_frame_hdr.*);
-		*(.sdata);
+		*(.sdata .sdata.*);
 		*(.reginfo);
-		*(.sbss);
-		*(.scommon);
-		*(.bss);                        /* uninitialized static variables */
+		*(.sbss .sbss.*);
+		*(.scommon .scommon.*);
+		*(.bss .bss.*);                        /* uninitialized static variables */
 		*(COMMON);                      /* global variables */
 	}
Index: kernel/arch/ppc32/_link.ld.in
===================================================================
--- kernel/arch/ppc32/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ kernel/arch/ppc32/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -22,23 +22,23 @@
 	.unmapped (SIZEOF_HEADERS): AT (SIZEOF_HEADERS) {
 		. = ALIGN(0x100);
-		*(K_UNMAPPED_TEXT_START);
+		KEEP(*(K_UNMAPPED_TEXT_START));
 	}
 
 	.mapped PA2KA(BOOT_OFFSET): AT (BOOT_OFFSET) {
 		ktext_start = .;
-		*(K_TEXT_START);
-		*(.text);
+		KEEP(*(K_TEXT_START));
+		*(.text .text.*);
 		ktext_end = .;
 
 		kdata_start = .;
-		*(K_DATA_START);
+		KEEP(*(K_DATA_START));
 		*(.rodata .rodata.*);
 		*(.eh_frame .eh_frame.*);       /* stack unwinding data */
 		*(.eh_frame_hdr .eh_frame_hdr.*);
-		*(.data);       /* initialized data */
-		*(.sdata);
-		*(.sdata2);
-		*(.sbss);
-		*(.bss);        /* uninitialized static variables */
+		*(.data .data.*);       /* initialized data */
+		*(.sdata .sdata.*);
+		*(.sdata2 .sdata2.*);
+		*(.sbss .sbss.*);
+		*(.bss .bss.*);        /* uninitialized static variables */
 		*(COMMON);      /* global variables */
 		kdata_end = .;
Index: kernel/arch/riscv64/_link.ld.in
===================================================================
--- kernel/arch/riscv64/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ kernel/arch/riscv64/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -18,18 +18,17 @@
 	.image (PA2KA(BOOT_OFFSET) + SIZEOF_HEADERS) : AT (BOOT_OFFSET + SIZEOF_HEADERS) {
 		ktext_start = .;
-		*(K_TEXT_START);
-		*(.text);
+		KEEP(*(K_TEXT_START));
+		*(.text .text.*);
 		ktext_end = .;
 
 		kdata_start = .;
-		*(.data);                       /* initialized data */
+		*(.data .data.*);                       /* initialized data */
 		*(.rodata .rodata.*);
 		*(.eh_frame .eh_frame.*);       /* stack unwinding data */
 		*(.eh_frame_hdr .eh_frame_hdr.*);
-		*(.sdata);
-		*(.reginfo);
-		*(.sbss);
-		*(.scommon);
-		*(.bss);                        /* uninitialized static variables */
+		*(.sdata .sdata.*);
+		*(.sbss .sbss.*);
+		*(.scommon .scommon.*);
+		*(.bss .bss.*);                        /* uninitialized static variables */
 		*(COMMON);                      /* global variables */
 		kdata_end = .;
Index: kernel/arch/sparc64/_link.ld.in
===================================================================
--- kernel/arch/sparc64/_link.ld.in	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ kernel/arch/sparc64/_link.ld.in	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -16,19 +16,19 @@
 	.image (VMA + SIZEOF_HEADERS): AT (LMA + SIZEOF_HEADERS) {
 		ktext_start = .;
-		*(K_TEXT_START)
+		KEEP(*(K_TEXT_START));
 		*(.text .text.*);
 		ktext_end = .;
 
 		kdata_start = .;
-		*(K_DATA_START)
+		KEEP(*(K_DATA_START));
 		*(.rodata .rodata.*);
 		*(.eh_frame .eh_frame.*);       /* stack unwinding data */
 		*(.eh_frame_hdr .eh_frame_hdr.*);
-		*(.data);                   /* initialized data */
-		*(.sdata);
-		*(.sdata2);
-		*(.sbss);
+		*(.data .data.*);                   /* initialized data */
+		*(.sdata .sdata.*);
+		*(.sdata2 .sdata2.*);
+		*(.sbss .sbss.*);
 		. = ALIGN(8);
-		*(.bss);                    /* uninitialized static variables */
+		*(.bss .bss.*);                    /* uninitialized static variables */
 		*(COMMON);                  /* global variables */
 		kdata_end = .;
Index: meson/arch/amd64/meson.build
===================================================================
--- meson/arch/amd64/meson.build	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ meson/arch/amd64/meson.build	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -45,7 +45,5 @@
 endif
 
-
-# TODO: Enable --gc-sections
-arch_kernel_link_args = [ '-Wl,-z,max-page-size=0x1000', '-nostdlib', '-Wl,--no-gc-sections' ]
+arch_kernel_link_args = [ '-Wl,-z,max-page-size=0x1000', '-nostdlib' ]
 arch_uspace_link_args = [ '-Wl,-z,max-page-size=0x1000', '-nostdlib', '-lgcc' ]
 
Index: meson/arch/arm64/meson.build
===================================================================
--- meson/arch/arm64/meson.build	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ meson/arch/arm64/meson.build	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -47,6 +47,6 @@
 # processor is in the execution mode that has unaligned access enabled. The
 # -mstrict-align option is therefore not needed.
-arch_boot_c_args = arch_uspace_c_args + [ '-fpic', '-fvisibility=hidden', '-fno-function-sections' ]
-arch_boot_link_args = [ '-Wl,-shared', '-Wl,--no-gc-sections' ] + ldflags_ignore_rwx_segments
+arch_boot_c_args = arch_uspace_c_args + [ '-fpic', '-fvisibility=hidden' ]
+arch_boot_link_args = [ '-Wl,-shared' ] + ldflags_ignore_rwx_segments
 
 if MACHINE == 'virt'
Index: meson/arch/ia32/meson.build
===================================================================
--- meson/arch/ia32/meson.build	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ meson/arch/ia32/meson.build	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -51,7 +51,5 @@
 ]
 
-
-# TODO: Enable --gc-sections.
-arch_kernel_link_args = [ '-nostdlib', '-Wl,--no-gc-sections' ]
+arch_kernel_link_args = [ '-nostdlib' ]
 arch_uspace_link_args = [ '-nostdlib', '-lgcc' ]
 
Index: meson/arch/ppc32/meson.build
===================================================================
--- meson/arch/ppc32/meson.build	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ meson/arch/ppc32/meson.build	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -28,12 +28,10 @@
 #
 
-# FIXME: enable --gc-sections
-
 _common_c_args = [ '-D__BE__', '-fno-omit-frame-pointer', '-m32', '-Wa,-a32', '-mcpu=powerpc' ]
 
-arch_kernel_c_args = _common_c_args + [ '-msoft-float', '-fno-function-sections' ]
+arch_kernel_c_args = _common_c_args + [ '-msoft-float' ]
 arch_uspace_c_args = _common_c_args + [ CONFIG_FPU ? '-mhard-float' : '-msoft-float' ]
 arch_boot_c_args = arch_kernel_c_args
-arch_kernel_link_args = [ '-nostdlib', '-Wl,-z,max-page-size=0x1000', '-Wl,--no-check-sections', '-Wl,--no-gc-sections' ]
+arch_kernel_link_args = [ '-nostdlib', '-Wl,-z,max-page-size=0x1000' ]
 arch_uspace_link_args = [ '-nostdlib', '-lgcc', '-Wl,-z,max-page-size=0x1000' ]
 arch_uspace_link_args += ldflags_ignore_rwx_segments
Index: meson/part/compiler_args/meson.build
===================================================================
--- meson/part/compiler_args/meson.build	(revision 0373af921e46809be1f9f16e080f93fb2c354b2b)
+++ meson/part/compiler_args/meson.build	(revision c89ae2562f477e91a8041f1bdff7ef9c6bec68b8)
@@ -68,4 +68,5 @@
 
 	'-ffunction-sections',
+	'-fdata-sections',
 	'-fno-common',
 	'-fdebug-prefix-map=' + meson.source_root() + '/=',
