public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* dl-*brk.c breakage
@ 2002-03-23 14:27 Jakub Jelinek
  2002-03-23 14:40 ` [PATCH] dl-*brk.c breakage (take 2) Jakub Jelinek
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2002-03-23 14:27 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

The dl-*brk.c addition breaks lots of targets, because generic
dl-*brk.c are including <brk.c> resp. <sbrk.c>, while lots of targets
use brk.S and sbrk.S. Furthermore, sysdeps/unix/sysv/linux/i386/dl-brk.c
and dl-sbrk.c don't seem to be i?86-*-linux specific, __curbrk is used
on all linux ports (well, some others too).
Here is one possible solution (I wanted to avoid adding too many other
dl-brk.S files, but if you perferred it that way, dl-sbrk and dl-brk
could stay where they are, sysdeps/generic/dl-brk.c and dl-sbrk.c
could have the attribute hidden stuff, and lots of
dl-brk.S files all around).

2002-03-23  Jakub Jelinek  <jakub@redhat.com>

	* elf/Makefile (rtld-routines): Remove dl-sbrk and dl-brk.
	* sysdeps/generic/brk.c (__curbrk): Declare.
	* sysdeps/generic/dl-brk.c: Removed.
	* sysdeps/generic/dl-sbrk.c: Removed.
	* sysdeps/unix/sysv/linux/Makefile (sysdep-rtld-routines): Add
	dl-sbrk and dl-brk.
	* sysdeps/unix/sysv/linux/alpha/dl-brk.S: New file.
	* sysdeps/unix/sysv/linux/ia64/dl-brk.S: New file.
	* sysdeps/unix/sysv/linux/powerpc/dl-brk.S: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/dl-brk.S: New file.
	* sysdeps/unix/sysv/linux/i386/dl-brk.c: Move...
	* sysdeps/unix/sysv/linux/dl-brk.c: ...here.
	* sysdeps/unix/sysv/linux/i386/dl-sbrk.c: Move...
	* sysdeps/unix/sysv/linux/dl-sbrk.c: ...here.

--- libc/elf/Makefile.jj	Sat Mar 23 11:50:25 2002
+++ libc/elf/Makefile	Sat Mar 23 23:19:45 2002
@@ -38,7 +38,7 @@ elide-routines.os = $(all-dl-routines) d
 # ld.so uses those routines, plus some special stuff for being the program
 # interpreter and operating independent of libc.
 rtld-routines	:= rtld $(dl-routines) dl-sysdep dl-environ dl-minimal \
-		   dl-xstat64 dl-fxstat64 dl-sbrk dl-brk
+		   dl-xstat64 dl-fxstat64
 all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines)
 
 distribute	:= $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \
--- libc/sysdeps/generic/brk.c.jj	Thu Aug 23 18:49:24 2001
+++ libc/sysdeps/generic/brk.c	Sat Mar 23 23:15:50 2002
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996, 1997, 2002 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
@@ -19,6 +19,9 @@
 #include <errno.h>
 #include <unistd.h>
 
+/* sbrk.c expects this.  */
+void *__curbrk;
+
 /* Set the end of the process's data space to ADDR.
    Return 0 if successful, -1 if not.  */
 int
--- libc/sysdeps/generic/dl-brk.c.jj	Fri Mar 15 05:39:53 2002
+++ libc/sysdeps/generic/dl-brk.c	Sat Mar 23 23:27:41 2002
@@ -1,2 +0,0 @@
-/* Just use the normal code.  */
-#include <brk.c>
--- libc/sysdeps/generic/dl-sbrk.c.jj	Fri Mar 15 05:40:28 2002
+++ libc/sysdeps/generic/dl-sbrk.c	Sat Mar 23 23:27:54 2002
@@ -1,2 +0,0 @@
-/* Just use the normal code.  */
-#include <sbrk.c>
--- libc/sysdeps/unix/sysv/linux/alpha/dl-brk.S.jj	Sat Mar 23 23:23:16 2002
+++ libc/sysdeps/unix/sysv/linux/alpha/dl-brk.S	Sat Mar 23 23:23:16 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/sysv/linux/ia64/dl-brk.S.jj	Sat Mar 23 23:23:16 2002
+++ libc/sysdeps/unix/sysv/linux/ia64/dl-brk.S	Sat Mar 23 23:23:16 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/sysv/linux/i386/dl-brk.c.jj	Fri Mar 15 05:41:13 2002
+++ libc/sysdeps/unix/sysv/linux/i386/dl-brk.c	Sat Mar 23 23:21:49 2002
@@ -1,5 +0,0 @@
-/* We can use the normal code but we also know the __curbrk is not exported
-   from ld.so.  */
-extern void *__curbrk attribute_hidden;
-
-#include <brk.c>
--- libc/sysdeps/unix/sysv/linux/i386/dl-sbrk.c.jj	Fri Mar 15 05:41:49 2002
+++ libc/sysdeps/unix/sysv/linux/i386/dl-sbrk.c	Sat Mar 23 23:21:52 2002
@@ -1,5 +0,0 @@
-/* We can use the normal code but we also know the __curbrk is not exported
-   from ld.so.  */
-extern void *__curbrk attribute_hidden;
-
-#include <sbrk.c>
--- libc/sysdeps/unix/sysv/linux/powerpc/dl-brk.S.jj	Sat Mar 23 23:23:16 2002
+++ libc/sysdeps/unix/sysv/linux/powerpc/dl-brk.S	Sat Mar 23 23:23:16 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-brk.S.jj	Sat Mar 23 23:23:16 2002
+++ libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-brk.S	Sat Mar 23 23:23:16 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/sysv/linux/Makefile.jj	Thu Aug 23 18:50:40 2001
+++ libc/sysdeps/unix/sysv/linux/Makefile	Sat Mar 23 23:21:16 2002
@@ -106,3 +106,7 @@ endif
 ifeq ($(subdir),nis)
 CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1
 endif
+
+ifeq ($(subdir),elf)
+sysdep-rtld-routines += dl-brk dl-sbrk
+endif
--- libc/sysdeps/unix/sysv/linux/dl-brk.c.jj	Sat Mar 23 23:21:59 2002
+++ libc/sysdeps/unix/sysv/linux/dl-brk.c	Fri Mar 15 05:41:13 2002
@@ -0,0 +1,5 @@
+/* We can use the normal code but we also know the __curbrk is not exported
+   from ld.so.  */
+extern void *__curbrk attribute_hidden;
+
+#include <brk.c>
--- libc/sysdeps/unix/sysv/linux/dl-sbrk.c.jj	Sat Mar 23 23:22:01 2002
+++ libc/sysdeps/unix/sysv/linux/dl-sbrk.c	Fri Mar 15 05:41:49 2002
@@ -0,0 +1,5 @@
+/* We can use the normal code but we also know the __curbrk is not exported
+   from ld.so.  */
+extern void *__curbrk attribute_hidden;
+
+#include <sbrk.c>


	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] dl-*brk.c breakage (take 2)
  2002-03-23 14:27 dl-*brk.c breakage Jakub Jelinek
@ 2002-03-23 14:40 ` Jakub Jelinek
  2002-04-05 17:35   ` Ulrich Drepper
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2002-03-23 14:40 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

On Sat, Mar 23, 2002 at 11:27:32PM +0100, Jakub Jelinek wrote:
> The dl-*brk.c addition breaks lots of targets, because generic
> dl-*brk.c are including <brk.c> resp. <sbrk.c>, while lots of targets
> use brk.S and sbrk.S. Furthermore, sysdeps/unix/sysv/linux/i386/dl-brk.c
> and dl-sbrk.c don't seem to be i?86-*-linux specific, __curbrk is used
> on all linux ports (well, some others too).
> Here is one possible solution (I wanted to avoid adding too many other
> dl-brk.S files, but if you perferred it that way, dl-sbrk and dl-brk
> could stay where they are, sysdeps/generic/dl-brk.c and dl-sbrk.c
> could have the attribute hidden stuff, and lots of
> dl-brk.S files all around).

Here is the second alternative.
Note that
sysdeps/mach/hurd/brk.c
sysdeps/unix/sysv/aix/brk.c
apparently don't use __curbrk at all, but IMHO extern void * __curbrk attribute_hidden;
doesn't hurt there at all (of course, we can add
sysdeps/mach/hurd/dl-{,s}brk.c
sysdeps/unix/sysv/aix/dl-{,s}brk.c
which will just include the non-"dl-" versions.

2002-03-23  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/generic/brk.c (__curbrk): Declare.
	* sysdeps/generic/dl-brk.c: Add attribute_hidden to __curbrk.
	* sysdeps/generic/dl-sbrk.c: Likewise.
	* sysdeps/unix/arm/dl-brk.S: New file.
	* sysdeps/unix/bsd/hp/m68k/dl-brk.S: New file.
	* sysdeps/unix/bsd/osf/alpha/dl-brk.S: New file.
	* sysdeps/unix/bsd/sun/m68k/dl-brk.S: New file.
	* sysdeps/unix/bsd/vax/dl-brk.S: New file.
	* sysdeps/unix/i386/dl-brk.S: New file.
	* sysdeps/unix/mips/dl-brk.S: New file.
	* sysdeps/unix/sparc/dl-brk.S: New file.
	* sysdeps/unix/sysv/linux/alpha/dl-brk.S: New file.
	* sysdeps/unix/sysv/linux/ia64/dl-brk.S: New file.
	* sysdeps/unix/sysv/linux/powerpc/dl-brk.S: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/dl-brk.S: New file.
	* sysdeps/unix/sysv/linux/i386/dl-brk.c: Remove.
	* sysdeps/unix/sysv/linux/i386/dl-sbrk.c: Remove.

--- libc/sysdeps/generic/brk.c.jj	Thu Aug 23 18:49:24 2001
+++ libc/sysdeps/generic/brk.c	Sat Mar 23 23:15:50 2002
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996, 1997, 2002 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
@@ -19,6 +19,9 @@
 #include <errno.h>
 #include <unistd.h>
 
+/* sbrk.c expects this.  */
+void *__curbrk;
+
 /* Set the end of the process's data space to ADDR.
    Return 0 if successful, -1 if not.  */
 int
--- libc/sysdeps/generic/dl-brk.c.jj	Fri Mar 15 05:39:53 2002
+++ libc/sysdeps/generic/dl-brk.c	Fri Mar 15 05:41:13 2002
@@ -1,2 +1,5 @@
-/* Just use the normal code.  */
+/* We can use the normal code but we also know the __curbrk is not exported
+   from ld.so.  */
+extern void *__curbrk attribute_hidden;
+
 #include <brk.c>
--- libc/sysdeps/generic/dl-sbrk.c.jj	Fri Mar 15 05:40:28 2002
+++ libc/sysdeps/generic/dl-sbrk.c	Fri Mar 15 05:41:49 2002
@@ -1,2 +1,5 @@
-/* Just use the normal code.  */
+/* We can use the normal code but we also know the __curbrk is not exported
+   from ld.so.  */
+extern void *__curbrk attribute_hidden;
+
 #include <sbrk.c>
--- libc/sysdeps/unix/arm/dl-brk.S.jj	Sat Mar 23 23:36:53 2002
+++ libc/sysdeps/unix/arm/dl-brk.S	Sat Mar 23 23:36:53 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/bsd/hp/m68k/dl-brk.S.jj	Sat Mar 23 23:36:53 2002
+++ libc/sysdeps/unix/bsd/hp/m68k/dl-brk.S	Sat Mar 23 23:36:53 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/bsd/osf/alpha/dl-brk.S.jj	Sat Mar 23 23:36:53 2002
+++ libc/sysdeps/unix/bsd/osf/alpha/dl-brk.S	Sat Mar 23 23:36:53 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/bsd/sun/m68k/dl-brk.S.jj	Sat Mar 23 23:36:53 2002
+++ libc/sysdeps/unix/bsd/sun/m68k/dl-brk.S	Sat Mar 23 23:36:53 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/bsd/vax/dl-brk.S.jj	Sat Mar 23 23:36:53 2002
+++ libc/sysdeps/unix/bsd/vax/dl-brk.S	Sat Mar 23 23:36:53 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/i386/dl-brk.S.jj	Sat Mar 23 23:36:53 2002
+++ libc/sysdeps/unix/i386/dl-brk.S	Sat Mar 23 23:36:53 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/mips/dl-brk.S.jj	Sat Mar 23 23:36:53 2002
+++ libc/sysdeps/unix/mips/dl-brk.S	Sat Mar 23 23:36:53 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/sparc/dl-brk.S.jj	Sat Mar 23 23:36:53 2002
+++ libc/sysdeps/unix/sparc/dl-brk.S	Sat Mar 23 23:36:53 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/sysv/linux/alpha/dl-brk.S.jj	Sat Mar 23 23:36:53 2002
+++ libc/sysdeps/unix/sysv/linux/alpha/dl-brk.S	Sat Mar 23 23:36:53 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/sysv/linux/ia64/dl-brk.S.jj	Sat Mar 23 23:36:53 2002
+++ libc/sysdeps/unix/sysv/linux/ia64/dl-brk.S	Sat Mar 23 23:36:53 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/sysv/linux/i386/dl-brk.c.jj	Fri Mar 15 05:41:13 2002
+++ libc/sysdeps/unix/sysv/linux/i386/dl-brk.c	Sat Mar 23 23:35:39 2002
@@ -1,5 +0,0 @@
-/* We can use the normal code but we also know the __curbrk is not exported
-   from ld.so.  */
-extern void *__curbrk attribute_hidden;
-
-#include <brk.c>
--- libc/sysdeps/unix/sysv/linux/i386/dl-sbrk.c.jj	Fri Mar 15 05:41:49 2002
+++ libc/sysdeps/unix/sysv/linux/i386/dl-sbrk.c	Sat Mar 23 23:35:39 2002
@@ -1,5 +0,0 @@
-/* We can use the normal code but we also know the __curbrk is not exported
-   from ld.so.  */
-extern void *__curbrk attribute_hidden;
-
-#include <sbrk.c>
--- libc/sysdeps/unix/sysv/linux/powerpc/dl-brk.S.jj	Sat Mar 23 23:36:53 2002
+++ libc/sysdeps/unix/sysv/linux/powerpc/dl-brk.S	Sat Mar 23 23:36:53 2002
@@ -0,0 +1 @@
+#include <brk.S>
--- libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-brk.S.jj	Sat Mar 23 23:36:53 2002
+++ libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-brk.S	Sat Mar 23 23:36:53 2002
@@ -0,0 +1 @@
+#include <brk.S>

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dl-*brk.c breakage (take 2)
  2002-03-23 14:40 ` [PATCH] dl-*brk.c breakage (take 2) Jakub Jelinek
@ 2002-04-05 17:35   ` Ulrich Drepper
  0 siblings, 0 replies; 3+ messages in thread
From: Ulrich Drepper @ 2002-04-05 17:35 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

[-- Attachment #1: Type: text/plain, Size: 448 bytes --]

On Sat, 2002-03-23 at 14:40, Jakub Jelinek wrote:

> Here is the second alternative.

I've finally decided to go with the second variant.  The problem is not
restricted to Linux so the first patch isn't OK.  Thanks,

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-04-06  1:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-23 14:27 dl-*brk.c breakage Jakub Jelinek
2002-03-23 14:40 ` [PATCH] dl-*brk.c breakage (take 2) Jakub Jelinek
2002-04-05 17:35   ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).