Use lla instead doing the pcrel relocs ourselves.

This commit is contained in:
matt 2015-03-31 11:59:41 +00:00
parent ea4911da8a
commit d67e7afb11
2 changed files with 5 additions and 8 deletions

View File

@ -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

View File

@ -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)