shithub: riscv

Download patch

ref: 29d22d1362241e8688f99c06416300cb3431ba61
parent: 7f79ce9bb847e037039f9b37464c312fb34b898f
author: Jacob Moody <moody@posixcafe.org>
date: Wed Jan 31 16:04:25 EST 2024

libc: remove dead code from main9p.s

This was seemingly here to ensure that
the profile.$O object was surely pulled in.
However referencing _profmain will also
pull in profile.$O as it contains all
of the _prof* functions.

--- a/sys/src/libc/386/main9p.s
+++ b/sys/src/libc/386/main9p.s
@@ -4,7 +4,6 @@
 	PUSHL	AX
 	PUSHL	$0
 	JMPF	_callmain(SB)
-	MOVL	$_profin(SB), AX	/* force loading of profile */
 
 TEXT	_saveret(SB), 1, $0
 TEXT	_savearg(SB), 1, $0
--- a/sys/src/libc/68000/main9p.s
+++ b/sys/src/libc/68000/main9p.s
@@ -4,7 +4,6 @@
 	PEA	_profmain(SB)
 	MOVL	$0, TOS
 	JMP	_callmain(SB)
-	LEA	_profin(SB), A0		/* force loading of profile */
 
 TEXT	_saveret(SB), 1, $0
 TEXT	_savearg(SB), 1, $0
--- a/sys/src/libc/68020/main9p.s
+++ b/sys/src/libc/68020/main9p.s
@@ -4,7 +4,6 @@
 	PEA	_profmain(SB)
 	MOVL	$0, TOS
 	JMP	_callmain(SB)
-	LEA	_profin(SB), A0		/* force loading of profile */
 
 TEXT	_saveret(SB), 1, $0
 TEXT	_savearg(SB), 1, $0
--- a/sys/src/libc/amd64/main9p.s
+++ b/sys/src/libc/amd64/main9p.s
@@ -5,8 +5,6 @@
 	PUSHQ	$0
 	JMPF	_callmain(SB)
 
-	MOVQ	$_profin(SB), AX	/* force loading of profile */
-
 TEXT	_savearg(SB), 1, $0
 	MOVQ	RARG, AX
 	RET
--- a/sys/src/libc/arm/main9p.s
+++ b/sys/src/libc/arm/main9p.s
@@ -13,7 +13,6 @@
 	B	_callmain(SB)
 
 	MOVW	$_div(SB), R(arg)	/* force loading of div */
-	MOVW	$_profin(SB), R(arg)	/* force loading of profile */
 
 TEXT	_saveret(SB), 1, $0
 TEXT	_savearg(SB), 1, $0
--- a/sys/src/libc/arm64/main9p.s
+++ b/sys/src/libc/arm64/main9p.s
@@ -8,8 +8,6 @@
 	MOV	$0, R30
 	B	_callmain(SB)
 
-	MOV	$_profin(SB), R0
-
 TEXT	_callpc(SB), 1, $-4
 	MOV	0(SP), R0
 TEXT	_saveret(SB), 1, $-4
--- a/sys/src/libc/mips/main9p.s
+++ b/sys/src/libc/mips/main9p.s
@@ -6,7 +6,6 @@
 	MOVW	$_profmain(SB), R1
 	MOVW	$0, R31
 	JMP	_callmain(SB)
-	MOVW	$_profin(SB), R0	/* force loading of profile */
 
 TEXT	_saveret(SB), 1, $0
 TEXT	_savearg(SB), 1, $0
--- a/sys/src/libc/sparc/main9p.s
+++ b/sys/src/libc/sparc/main9p.s
@@ -16,7 +16,6 @@
 	MOVW	$0, R15
 	JMP	(R24)
 	MOVW	$_mul(SB), R8		/* force loading of muldiv */
-	MOVW	$_profin(SB), R9	/* force loading of profile */
 
 TEXT	_saveret(SB), 1, $0
 TEXT	_savearg(SB), 1, $0