diff options
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/ld/rtld/Makefile | 7 | ||||
-rw-r--r-- | gnu/usr.bin/ld/rtld/rtld.c | 44 |
2 files changed, 6 insertions, 45 deletions
diff --git a/gnu/usr.bin/ld/rtld/Makefile b/gnu/usr.bin/ld/rtld/Makefile index 7fb70ea..09277ba 100644 --- a/gnu/usr.bin/ld/rtld/Makefile +++ b/gnu/usr.bin/ld/rtld/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/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c index 7da0508..fd48fb7 100644 --- a/gnu/usr.bin/ld/rtld/rtld.c +++ b/gnu/usr.bin/ld/rtld/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); -} - |