Author: mhorne
Date: Fri May 22 18:54:56 2020
New Revision: 361402
URL: https://svnweb.freebsd.org/changeset/base/361402

Log:
  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

Modified:
  head/sys/conf/Makefile.riscv

Modified: head/sys/conf/Makefile.riscv
==============================================================================
--- head/sys/conf/Makefile.riscv        Fri May 22 18:11:17 2020        
(r361401)
+++ head/sys/conf/Makefile.riscv        Fri May 22 18:54:56 2020        
(r361402)
@@ -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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to