kernel
kernel copied to clipboard
Stripping debug symbols from the kernel binary makes it bigger
When the kernel binary is compiled with debug symbols, stripping them out actually makes the resultant binary bigger, rather than smaller:
-rwxr-xr-x 1 eliza staff 4323440 6 Oct 11:19 sos_kernel
-rwxr-xr-x 1 eliza staff 1262672 6 Oct 11:19 sos_kernel.debug
-rwxr-xr-x 1 eliza staff 1328208 6 Oct 11:19 sos_kernel_full
Both @twisted-pear and I have literally no idea why this is happening. I suspect some kind of black magic.
If I use x86_64-elf-objcopy -O binary sos_kernel_full sos_kernel to make a flat binary, the resultant binary file is much smaller, but the boot loader expects it to be an ELF and it breaks the boot process...
Meanwhile, using x86_64-elf-objcopy --strip-debug also makes the kernel about 3 megs bigger...