Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Apr 2017 22:40:39 +0000 (UTC)
From:      Ruslan Bukin <br@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r317530 - in head/lib/libc/riscv: . sys
Message-ID:  <201704272240.v3RMedne004940@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: br
Date: Thu Apr 27 22:40:39 2017
New Revision: 317530
URL: https://svnweb.freebsd.org/changeset/base/317530

Log:
  Use unconditional jr (jump register) so cerror relocation offset fits.
  
  This fixes libc build on riscv64sf.
  
  Reviewed by:	jhb
  Sponsored by:	DARPA, AFRL

Modified:
  head/lib/libc/riscv/SYS.h
  head/lib/libc/riscv/sys/vfork.S

Modified: head/lib/libc/riscv/SYS.h
==============================================================================
--- head/lib/libc/riscv/SYS.h	Thu Apr 27 22:28:49 2017	(r317529)
+++ head/lib/libc/riscv/SYS.h	Thu Apr 27 22:40:39 2017	(r317530)
@@ -54,8 +54,10 @@ END(__sys_##name)
 ENTRY(__sys_##name);						\
 	WEAK_REFERENCE(__sys_##name, _##name);			\
 	_SYSCALL(name);						\
-	bnez	t0, cerror; 					\
+	bnez	t0, 1f; 					\
 	ret;							\
+1:	la	t1, cerror;					\
+	jr	t1;						\
 END(__sys_##name)
 
 #define	RSYSCALL(name)						\
@@ -63,6 +65,8 @@ ENTRY(__sys_##name);						\
 	WEAK_REFERENCE(__sys_##name, name);			\
 	WEAK_REFERENCE(__sys_##name, _##name);			\
 	_SYSCALL(name);						\
-	bnez	t0, cerror; 					\
+	bnez	t0, 1f; 					\
 	ret;							\
+1:	la	t1, cerror;					\
+	jr	t1;						\
 END(__sys_##name)

Modified: head/lib/libc/riscv/sys/vfork.S
==============================================================================
--- head/lib/libc/riscv/sys/vfork.S	Thu Apr 27 22:28:49 2017	(r317529)
+++ head/lib/libc/riscv/sys/vfork.S	Thu Apr 27 22:40:39 2017	(r317530)
@@ -42,10 +42,12 @@ ENTRY(__sys_vfork)
 	mv	a2, ra
 
 	_SYSCALL(vfork)
-	bnez	t0, cerror
+	bnez	t0, 1f
 	addi	a1, a1, -1
 	and	a0, a0, a1
 	mv	ra, a2
 
 	ret
+1:	la	t1, cerror
+	jr	t1
 END(__sys_vfork)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704272240.v3RMedne004940>