shithub: riscv

Download patch

ref: dfea95b3c29ef4a6de2713a946453d3a022ae0b4
parent: 5a0c2e2d17617ece4819e2f66514a498849ee088
author: cinap_lenrek <[email protected]>
date: Thu Jul 25 04:52:46 EDT 2019

bcm64: strip debug symbols to make sure .img file is multiple of 4 bytes

the raspberry pi4 firmware refuses to enable the GIC interrup controller
for arm64 when the .img file is not a multiple of 4 bytes. yes, this
is insane and nowhere documented.

--- a/sys/src/9/bcm64/mkfile
+++ b/sys/src/9/bcm64/mkfile
@@ -72,7 +72,7 @@
 $p$CONF:DQ:	$CONF.c $OBJ $LIB mkfile
 	$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
 	echo '# linking raw kernel'	# H6: no headers, data segment aligned
-	$LD -l -o $target -H6 -R0x10000 -T$loadaddr $OBJ $CONF.$O $LIB
+	$LD -s -l -o $target -H6 -R0x10000 -T$loadaddr $OBJ $CONF.$O $LIB
 
 s$p$CONF:DQ:	$CONF.$O $OBJ $LIB
 	echo '# linking kernel with symbols'