summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-aout
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1993-12-11 21:06:00 +0000
committerjkh <jkh@FreeBSD.org>1993-12-11 21:06:00 +0000
commit21990edfaba0490ac02d4556848156a82b0d78b5 (patch)
tree6846c74b079a50f8ac739a2238c6f696ae04ecd6 /libexec/rtld-aout
parentb58557899d23ab39e7756e46a5907d7900f45d85 (diff)
downloadFreeBSD-src-21990edfaba0490ac02d4556848156a82b0d78b5.zip
FreeBSD-src-21990edfaba0490ac02d4556848156a82b0d78b5.tar.gz
Broke sbrk() out of rtld as part of general cleanup.
Diffstat (limited to 'libexec/rtld-aout')
-rw-r--r--libexec/rtld-aout/Makefile7
-rw-r--r--libexec/rtld-aout/rtld.c44
2 files changed, 6 insertions, 45 deletions
diff --git a/libexec/rtld-aout/Makefile b/libexec/rtld-aout/Makefile
index 7fb70ea..09277ba 100644
--- a/libexec/rtld-aout/Makefile
+++ b/libexec/rtld-aout/Makefile
@@ -1,7 +1,7 @@
-# $Id: Makefile,v 1.5 1993/11/22 19:05:26 jkh Exp $
+# $Id: Makefile,v 1.6 1993/11/25 01:06:42 jkh Exp $
PROG= ld.so
-SRCS= mdprologue.S rtld.c shlib.c etc.c md.c
+SRCS= mdprologue.S sbrk.c rtld.c shlib.c etc.c md.c
NOMAN= noman
LDDIR?= $(.CURDIR)/..
#PICFLAG=-pic
@@ -10,6 +10,7 @@ CFLAGS += -I$(LDDIR) -I$(.CURDIR) -I$(LDDIR)/$(MACHINE) -O $(PICFLAG) -DRTLD
LDFLAGS = -Bshareable -Bsymbolic -assert nosymbolic
LIBS = -lc_pic -lgcc_pic
BINDIR= /usr/libexec
+ASFLAGS = -k
.PATH: $(LDDIR) $(LDDIR)/$(MACHINE)
@@ -19,6 +20,6 @@ $(PROG):
$(LD) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIBS) $(LDADD)
.S.o:
- $(CPP) $(.IMPSRC) | $(AS) -k -o $(.TARGET) -
+ $(CPP) $(.IMPSRC) | $(AS) $(ASFLAGS) -o $(.TARGET) -
.include <bsd.prog.mk>
diff --git a/libexec/rtld-aout/rtld.c b/libexec/rtld-aout/rtld.c
index 7da0508..fd48fb7 100644
--- a/libexec/rtld-aout/rtld.c
+++ b/libexec/rtld-aout/rtld.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: rtld.c,v 1.9 1993/12/09 17:45:43 jkh Exp $
+ * $Id: rtld.c,v 1.10 1993/12/11 20:08:39 jkh Exp $
*/
#include <machine/vmparam.h>
@@ -129,7 +129,7 @@ static struct ld_entry ld_entry = {
dlopen, dlclose, dlsym
};
-static void xprintf __P((char *, ...));
+void xprintf __P((char *, ...));
static void init_brk __P((void));
static void load_maps __P((struct crt_ldso *));
static void map_object __P((struct link_object *, struct link_map *));
@@ -984,12 +984,6 @@ char *sym;
return 0;
}
-/*
- * Private heap functions.
- */
-
-static caddr_t curbrk;
-
void
#if __STDC__
xprintf(char *fmt, ...)
@@ -1010,37 +1004,3 @@ char *fmt;
(void)write(1, buf, strlen(buf));
va_end(ap);
}
-
-caddr_t
-sbrk(incr)
-int incr;
-{
- int fd = -1;
-
- /* Round-up increment to page size */
- incr = ((incr + PAGSIZ - 1) & ~(PAGSIZ - 1));
-
-#if DEBUG
-xprintf("sbrk: incr = %#x, curbrk = %#x\n", incr, curbrk);
-#endif
-
-#ifdef NEED_DEV_ZERO
- fd = open("/dev/zero", O_RDWR, 0);
- if (fd == -1)
- perror("/dev/zero");
-#endif
-
- if ((curbrk = mmap(0, incr,
- PROT_READ|PROT_WRITE,
- MAP_ANON|MAP_COPY, fd, 0)) == (caddr_t)-1) {
- xprintf("Cannot map anonymous memory");
- _exit(1);
- }
-
-#ifdef NEED_DEV_ZERO
- close(fd);
-#endif
-
- return(curbrk);
-}
-
OpenPOWER on IntegriCloud