]> sourceware.org Git - glibc.git/blame - sysdeps/unix/sysv/linux/i386/brk.S
Wed Nov 22 12:37:39 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
[glibc.git] / sysdeps / unix / sysv / linux / i386 / brk.S
CommitLineData
d2f5be2a 1/* Copyright (C) 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
28f540f4
RM
2This file is part of the GNU C Library.
3
4The GNU C Library is free software; you can redistribute it and/or
5modify it under the terms of the GNU Library General Public License as
6published by the Free Software Foundation; either version 2 of the
7License, or (at your option) any later version.
8
9The GNU C Library is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12Library General Public License for more details.
13
14You should have received a copy of the GNU Library General Public
15License along with the GNU C Library; see the file COPYING.LIB. If
16not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17Cambridge, MA 02139, USA. */
18
19#include <sysdep.h>
20
d2f5be2a
UD
21.data
22.globl C_SYMBOL_NAME(__curbrk)
23C_LABEL(__curbrk)
d2f5be2a 24 .long C_SYMBOL_NAME(_end)
d2f5be2a
UD
25
26.text
d2f5be2a 27
c14e4c32 28 SYSCALL_ERROR_HANDLER
d2f5be2a
UD
29ENTRY (__brk)
30 movl %ebx, %edx
31 movl $SYS_ify(brk), %eax
32 movl 4(%esp), %ebx
33 int $0x80
34 movl %edx, %ebx
35
36 cmpl 4(%esp), %eax
efc755b2 37 jne syscall_error
d2f5be2a
UD
38
39#ifdef PIC
40 /* Standard PIC nonsense to store into `__curbrk' through the GOT. */
41 call here
42here: popl %ecx
43 addl $_GLOBAL_OFFSET_TABLE_+[.-here], %ecx
44 movl C_SYMBOL_NAME(__curbrk@GOT)(%ecx), %ecx
45 movl %eax, (%ecx)
46#else
47 movl %eax, C_SYMBOL_NAME(__curbrk)
48#endif
49 xorl %eax, %eax
28f540f4
RM
50 ret
51
d2f5be2a 52weak_alias (__brk, brk)
This page took 0.048648 seconds and 5 git commands to generate.