dl-*brk.c breakage
Jakub Jelinek
jakub@redhat.com
Sat Mar 23 14:27:00 GMT 2002
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
More information about the Libc-hacker
mailing list