linux/arch/riscv
Anup Patel 22e6a2e14c
RISC-V: Make BSS section as the last section in vmlinux.lds.S
The objcopy only emits loadable sections when creating flat kernel
Image. To have minimal possible size of flat kernel Image, we should
have all non-loadable sections after loadable sections.

Currently, execption table section (loadable section) is after BSS
section (non-loadable section) in the RISC-V vmlinux.lds.S. This
is not optimal for having minimal flat kernel Image size hence this
patch makes BSS section as the last section in RISC-V vmlinux.lds.S.

In addition, we make BSS section aligned to 16byte instead of PAGE
aligned which further reduces flat kernel Image size by few KBs.

The flat kernel Image size of Linux-4.20-rc4 using GCC 8.2.0 is
8819980 bytes with current RISC-V vmlinux.lds.S and it reduces to
7991740 bytes with this patch applied. In summary, this patch reduces
Linux-4.20-rc4 flat kernel Image size by 809 KB.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2019-01-07 07:59:25 -08:00
..
boot RISC-V: Build flat and compressed kernel images 2018-11-20 05:19:09 -08:00
configs RISC-V: defconfig: Enable RISC-V SBI earlycon support 2018-12-17 10:23:46 -08:00
include arch: remove redundant UAPI generic-y defines 2019-01-06 10:22:15 +09:00
kernel RISC-V: Make BSS section as the last section in vmlinux.lds.S 2019-01-07 07:59:25 -08:00
lib RISC-V: lib: minor asm cleanup 2018-12-21 08:17:02 -08:00
mm mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
Kconfig Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
Kconfig.debug RISC-V: Remove EARLY_PRINTK support 2018-12-17 10:23:46 -08:00
Makefile RISC-V: Build flat and compressed kernel images 2018-11-20 05:19:09 -08:00