summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatt <matt@NetBSD.org>2015-03-31 11:59:41 +0000
committermatt <matt@NetBSD.org>2015-03-31 11:59:41 +0000
commit04643ddbcd8e1fdd42d9106c38846ffaa974fbef (patch)
treea158d03768d0baf55ec17080cd733e4daa0dcc2a /lib
parent2b4b47058353d471dd3aa9c589e0b66a8323b619 (diff)
Use lla instead doing the pcrel relocs ourselves.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/arch/riscv/sys/brk.S7
-rw-r--r--lib/libc/arch/riscv/sys/sbrk.S6
2 files changed, 5 insertions, 8 deletions
diff --git a/lib/libc/arch/riscv/sys/brk.S b/lib/libc/arch/riscv/sys/brk.S
index 88541d85910..d57dd03270b 100644
--- a/lib/libc/arch/riscv/sys/brk.S
+++ b/lib/libc/arch/riscv/sys/brk.S
@@ -1,4 +1,4 @@
-/* $NetBSD: brk.S,v 1.3 2015/03/27 23:23:14 matt Exp $ */
+/* $NetBSD: brk.S,v 1.4 2015/03/31 11:59:41 matt Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
- RCSID("$NetBSD: brk.S,v 1.3 2015/03/27 23:23:14 matt Exp $")
+ RCSID("$NetBSD: brk.S,v 1.4 2015/03/31 11:59:41 matt Exp $")
#endif /* LIBC_SCCS and not lint */
.hidden _C_LABEL(__minbrk)
@@ -55,8 +55,7 @@ _C_LABEL(__curbrk):
.text
ENTRY(_brk)
-.L0: auipc t1, %pcrel_hi(_C_LABEL(__minbrk))
- addi t1, t1, %pcrel_lo(.L0)
+ lla t1, _C_LABEL(__minbrk)
PTR_L t5, 0(t1)
bgeu a0, t5, 1f
move a0, t5 # dont allow break < minbrk
diff --git a/lib/libc/arch/riscv/sys/sbrk.S b/lib/libc/arch/riscv/sys/sbrk.S
index 164ea09201e..f8b19705c51 100644
--- a/lib/libc/arch/riscv/sys/sbrk.S
+++ b/lib/libc/arch/riscv/sys/sbrk.S
@@ -1,4 +1,4 @@
-/* $NetBSD: sbrk.S,v 1.3 2015/03/27 23:23:14 matt Exp $ */
+/* $NetBSD: sbrk.S,v 1.4 2015/03/31 11:59:41 matt Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,15 +33,13 @@
.hidden _C_LABEL(__curbrk)
.globl _C_LABEL(__curbrk)
- .globl _C_LABEL(_end)
#ifdef WEAK_ALIAS
WEAK_ALIAS(sbrk, _sbrk)
#endif
ENTRY(_sbrk)
-.L0: auipc t1, %pcrel_hi(_C_LABEL(__curbrk))
- addi t1, t1, %pcrel_lo(.L0)
+ lla t1, _C_LABEL(__curbrk)
PTR_L t2, 0(t1)
add a0, a0, t2 // compute current break
SYSTRAP(break)