This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

brk_addr in sysdeps/unix/sysv/linux/hppa/brk.c



Hi HPPA folks,

there's currently in sysdeps/unix/sysv/linux/hppa/brk.c:
/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt
   to work around different old braindamage in the old Linux ELF dynamic
   linker.  */
weak_alias (__curbrk, ___brk_addr)

A grep through gcc shows that __brk_addr is only used for
i386/linux.h on libc5 systems:

#if defined(__PIC__) && defined (USE_GNULIBC_1)
/* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr,
   __environ and atexit (). We have to make sure they are in the .dynsym
   section. We accomplish it by making a dummy call here. This
   code is never reached.  */

Do you really need this symbol?  IMO it can be removed.

Ok to commit the appended patch that fixes also a warning?

Andreas

2001-11-22  Andreas Jaeger  <aj@suse.de>

	* sysdeps/unix/sysv/linux/hppa/brk.c: Remove __brk_addr alias,
	avoid warning.

============================================================
Index: sysdeps/unix/sysv/linux/hppa/brk.c
--- sysdeps/unix/sysv/linux/hppa/brk.c	2001/07/06 04:56:15	1.4
+++ sysdeps/unix/sysv/linux/hppa/brk.c	2001/11/22 11:55:06
@@ -1,5 +1,5 @@
 /* brk system call for Linux/HPPA.
-   Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -24,17 +24,12 @@
 /* This must be initialized data because commons can't have aliases.  */
 void *__curbrk = 0;
 
-/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt
-   to work around different old braindamage in the old Linux ELF dynamic
-   linker.  */
-weak_alias (__curbrk, ___brk_addr)
-
 int
 __brk (void *addr)
 {
   void *newbrk;
 
-  __curbrk = newbrk = INLINE_SYSCALL(brk, 1, addr);
+  __curbrk = newbrk = (void *) INLINE_SYSCALL (brk, 1, addr);
 
   if (newbrk < addr)
     {

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]