From e1a6e0e33e32d384c1419b311db3a4a3ace1ecc5 Mon Sep 17 00:00:00 2001 From: Mitchell Horne Date: Fri, 22 May 2020 18:54:56 +0000 Subject: [PATCH] Simplify the RISC-V kernel linker invocation Remove our custom SYSTEM_LD definition. This generates program headers that are more consistent with other architectures, and more importantly, are in line with what loader(8) expects when loading a kernel. As noted in https://reviews.freebsd.org/D22920, there is no apparent reason why the kernel would need a writable text segment, so removal of the -N flag isn't likely to cause issue. Reviewed by: kp, br MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24909 --- sys/conf/Makefile.riscv | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/conf/Makefile.riscv b/sys/conf/Makefile.riscv index 183fa6dd448..06ce602f25e 100644 --- a/sys/conf/Makefile.riscv +++ b/sys/conf/Makefile.riscv @@ -35,12 +35,7 @@ INCLUDES+= -I$S/contrib/libfdt # We set this value using --defsym rather than hardcoding it in ldscript.riscv # so that different kernel configs can override the load address. KERNEL_LMA?= 0x80200000 - -SYSTEM_LD= @${LD} -N -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \ - --no-warn-mismatch --warn-common --export-dynamic \ - --defsym='kernel_lma=${KERNEL_LMA}' \ - --dynamic-linker /red/herring \ - -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o +LDFLAGS+= --defsym='kernel_lma=${KERNEL_LMA}' .if !empty(DDB_ENABLED) CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls -- 2.45.2