Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/arch/arm Make __minbrk, __curbrk, and CERROR hidden...
details: https://anonhg.NetBSD.org/src/rev/1af915d0b009
branches: trunk
changeset: 788971:1af915d0b009
user: matt <matt%NetBSD.org@localhost>
date: Thu Aug 01 05:32:33 2013 +0000
description:
Make __minbrk, __curbrk, and CERROR hidden and avoid using the GOT to access
them.
diffstat:
lib/libc/arch/arm/SYS.h | 3 ++-
lib/libc/arch/arm/sys/brk.S | 13 +++++++------
lib/libc/arch/arm/sys/sbrk.S | 30 ++++++++++++++----------------
3 files changed, 23 insertions(+), 23 deletions(-)
diffs (134 lines):
diff -r e78ab2f90c18 -r 1af915d0b009 lib/libc/arch/arm/SYS.h
--- a/lib/libc/arch/arm/SYS.h Thu Aug 01 01:16:34 2013 +0000
+++ b/lib/libc/arch/arm/SYS.h Thu Aug 01 05:32:33 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: SYS.h,v 1.11 2013/07/18 12:21:52 matt Exp $ */
+/* $NetBSD: SYS.h,v 1.12 2013/08/01 05:32:33 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -86,4 +86,5 @@
PSEUDO(weak,weak)
#endif
+ .hidden CERROR
.globl CERROR
diff -r e78ab2f90c18 -r 1af915d0b009 lib/libc/arch/arm/sys/brk.S
--- a/lib/libc/arch/arm/sys/brk.S Thu Aug 01 01:16:34 2013 +0000
+++ b/lib/libc/arch/arm/sys/brk.S Thu Aug 01 05:32:33 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: brk.S,v 1.9 2011/05/13 23:14:36 nonaka Exp $ */
+/* $NetBSD: brk.S,v 1.10 2013/08/01 05:32:33 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -34,7 +34,7 @@
#include "SYS.h"
.globl _C_LABEL(_end)
- .globl CURBRK
+ .globl _C_LABEL(__curbrk)
#ifdef WEAK_ALIAS
WEAK_ALIAS(brk, _brk)
@@ -43,6 +43,7 @@
.data
.align 0
.globl _C_LABEL(__minbrk)
+ .hidden _C_LABEL(__minbrk)
.type _C_LABEL(__minbrk),#object
_C_LABEL(__minbrk):
.word _C_LABEL(_end)
@@ -57,7 +58,7 @@
add r3, pc, r3
.L1:
ldr r1, .Lminbrk
- ldr r1, [r3, r1]
+ add r1, r3, r1
#else
ldr r1, .Lminbrk
#endif
@@ -76,7 +77,7 @@
#ifdef PIC
ldr r1, .Lcurbrk
- ldr r1, [r3, r1]
+ add r1, r3, r1
#else
ldr r1, .Lcurbrk
#endif
@@ -93,6 +94,6 @@
.word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (.L1+4))
#endif
.Lminbrk:
- .word PIC_SYM(_C_LABEL(__minbrk), GOT)
+ .word PIC_SYM(_C_LABEL(__minbrk), GOTOFF)
.Lcurbrk:
- .word PIC_SYM(CURBRK, GOT)
+ .word PIC_SYM(_C_LABEL(__curbrk), GOTOFF)
diff -r e78ab2f90c18 -r 1af915d0b009 lib/libc/arch/arm/sys/sbrk.S
--- a/lib/libc/arch/arm/sys/sbrk.S Thu Aug 01 01:16:34 2013 +0000
+++ b/lib/libc/arch/arm/sys/sbrk.S Thu Aug 01 05:32:33 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbrk.S,v 1.9 2011/05/13 23:14:36 nonaka Exp $ */
+/* $NetBSD: sbrk.S,v 1.10 2013/08/01 05:32:33 matt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -41,25 +41,23 @@
.data
.align 0
- .globl CURBRK
- .type CURBRK,#object
-CURBRK:
+ .globl _C_LABEL(__curbrk)
+ .hidden _C_LABEL(__curbrk)
+ .type _C_LABEL(__curbrk),#object
+_C_LABEL(__curbrk):
.word _C_LABEL(_end)
/*
* Change the data segment size
*/
ENTRY(_sbrk)
+ /* get address or PC offset to __curbrk */
+ ldr r2, .Lcurbrk
#ifdef PIC
- /* Setup the GOT */
- ldr r3, .Lgot
- add r3, pc, r3
+ add r2, pc, r2
.L1:
- ldr r2, .Lcurbrk
- ldr r2, [r3, r2]
-#else
- ldr r2, .Lcurbrk
#endif
+
/* Get the current brk address */
ldr r1, [r2]
@@ -67,7 +65,7 @@
mov r3, r0
add r0, r0, r1
SYSTRAP(break)
- bcs PIC_SYM(CERROR, PLT)
+ bcs CERROR
/* Store new curbrk value */
ldr r0, [r2]
@@ -78,9 +76,9 @@
RET
.align 0
+.Lcurbrk:
#ifdef PIC
-.Lgot:
- .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (.L1+4))
+ .word _C_LABEL(__curbrk) - (.L1+4)
+#else
+ .word _C_LABEL(__curbrk)
#endif
-.Lcurbrk:
- .word PIC_SYM(CURBRK, GOT)
Home |
Main Index |
Thread Index |
Old Index