diff options
| author | Simon J. Gerraty <sjg@FreeBSD.org> | 2014-08-19 06:50:54 +0000 |
|---|---|---|
| committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2014-08-19 06:50:54 +0000 |
| commit | ee7b0571c2c18bdec848ed2044223cc88db29bd8 (patch) | |
| tree | b04f4bd7cd887f50e7d98af35f46b9834ff86c80 /lib/csu | |
| parent | ffda191e301f128a62c152fde92b692548367fca (diff) | |
| parent | 15fc2873832ea5b9b639e701bbbf2e73af8b6a88 (diff) | |
Notes
Diffstat (limited to 'lib/csu')
| -rw-r--r-- | lib/csu/amd64/Makefile | 1 | ||||
| -rw-r--r-- | lib/csu/i386-elf/Makefile | 8 | ||||
| -rw-r--r-- | lib/csu/ia64/Makefile | 62 | ||||
| -rw-r--r-- | lib/csu/ia64/crt1.S | 197 | ||||
| -rw-r--r-- | lib/csu/ia64/crti.S | 60 | ||||
| -rw-r--r-- | lib/csu/ia64/crtn.S | 44 |
6 files changed, 6 insertions, 366 deletions
diff --git a/lib/csu/amd64/Makefile b/lib/csu/amd64/Makefile index 5ddbab661f43..7b888fad52d5 100644 --- a/lib/csu/amd64/Makefile +++ b/lib/csu/amd64/Makefile @@ -14,6 +14,7 @@ FILESOWN= ${LIBOWN} FILESGRP= ${LIBGRP} FILESMODE= ${LIBMODE} FILESDIR= ${LIBDIR} +NO_PIE= yes all: ${OBJS} diff --git a/lib/csu/i386-elf/Makefile b/lib/csu/i386-elf/Makefile index 52e1955c1093..8a685dcf9a09 100644 --- a/lib/csu/i386-elf/Makefile +++ b/lib/csu/i386-elf/Makefile @@ -13,6 +13,8 @@ CFLAGS+= -I${.CURDIR}/../common \ CLEANFILES= ${FILES} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o CLEANFILES+= crt1_c.s gcrt1_c.s Scrt1_c.s +NO_PIE= yes + # See the comment in lib/csu/common/crtbrand.c for the reason crt1_c.c is not # directly compiled to .o files. @@ -24,7 +26,7 @@ gcrt1_c.o: gcrt1_c.s ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1_c.s gcrt1.o: gcrt1_c.o crt1_s.o - ${LD} ${LDFLAGS:N-[BL]/*} -o gcrt1.o -r crt1_s.o gcrt1_c.o + ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o crt1_c.s: crt1_c.c ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1_c.c @@ -34,7 +36,7 @@ crt1_c.o: crt1_c.s ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1_c.s crt1.o: crt1_c.o crt1_s.o - ${LD} ${LDFLAGS:N-[BL]/*} -o crt1.o -r crt1_s.o crt1_c.o + ${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o objcopy --localize-symbol _start1 crt1.o Scrt1_c.s: crt1_c.c @@ -45,7 +47,7 @@ Scrt1_c.o: Scrt1_c.s ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1_c.s Scrt1.o: Scrt1_c.o crt1_s.o - ${LD} ${LDFLAGS:N-[BL]/*} -o Scrt1.o -r crt1_s.o Scrt1_c.o + ${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o objcopy --localize-symbol _start1 Scrt1.o .include <bsd.prog.mk> diff --git a/lib/csu/ia64/Makefile b/lib/csu/ia64/Makefile deleted file mode 100644 index b12e88822d17..000000000000 --- a/lib/csu/ia64/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../common - -SRCS= crti.S crtn.S -OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= crt1.o gcrt1.o Scrt1.o - -all: ${OBJS} - -CLEANFILES= ${OBJS} -CLEANFILES+= crt1_.o gcrt1_.o Scrt1_.o -CLEANFILES+= crtbrand.o gcrtbrand.o Scrtbrand.o -CLEANFILES+= crtbrand.s gcrtbrand.s Scrtbrand.s - -crt1_.o: crt1.S - ${CC} ${CFLAGS} -c -o ${.TARGET} ${.ALLSRC} - -# See the comment in lib/csu/common/crtbrand.c for the reason crtbrand.c is not -# directly compiled to .o files. - -crtbrand.s: crtbrand.c - ${CC} ${CFLAGS} -S -o ${.TARGET} ${.ALLSRC} - sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET} - -crtbrand.o: crtbrand.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} crtbrand.s - -crt1.o: crt1_.o crtbrand.o - ${LD} ${LDFLAGS} -r -o ${.TARGET} crt1_.o crtbrand.o - -gcrt1_.o: crt1.S - ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.ALLSRC} - -gcrtbrand.s: crtbrand.c - ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.ALLSRC} - sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET} - -gcrtbrand.o: gcrtbrand.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrtbrand.s - -gcrt1.o: gcrt1_.o gcrtbrand.o - ${LD} ${LDFLAGS} -r -o ${.TARGET} ${.ALLSRC} - -Scrt1_.o: crt1.S - ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.ALLSRC} - -Scrtbrand.s: crtbrand.c - ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.ALLSRC} - sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET} - -Scrtbrand.o: Scrtbrand.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrtbrand.s - -Scrt1.o: Scrt1_.o Scrtbrand.o - ${LD} ${LDFLAGS} -r -o ${.TARGET} ${.ALLSRC} - -realinstall: - ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${OBJS} ${DESTDIR}${LIBDIR} - -.include <bsd.lib.mk> diff --git a/lib/csu/ia64/crt1.S b/lib/csu/ia64/crt1.S deleted file mode 100644 index 6ff9cd9171ae..000000000000 --- a/lib/csu/ia64/crt1.S +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (c) 2003 Marcel Moolenaar - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <machine/asm.h> -__FBSDID("$FreeBSD$"); - - .text - -/* - * void _start(char **ap, struct ps_strings *, void (*cleanup)(void)); - */ -#define AP in0 -#define CLEANUP in2 - -#define GP loc0 -#define ARGC loc1 -#define ARGV loc2 -#define ENVP loc3 - - .global _start - .type _start, @function - .proc _start -_start: - .prologue - .save rp, r0 - .body -{ .mlx - alloc r14=ar.pfs,3,4,3,0 - movl r15=@gprel(1f) -} -1: -{ .mmi - ld4 ARGC=[AP] - adds ARGV=8,AP - mov r16=ip - ;; -} -{ .mmi - sub gp=r16,r15 - sub GP=r16,r15 - shladd r14=ARGC,3,AP - ;; -} -{ .mii - addl r15=@ltoff(environ),gp - cmp4.ge p6,p7=0,ARGC - adds ENVP=16,r14 - ;; -} -{ .mmi - ld8 r14=[r15] -(p7) ld8 r15=[ARGV] - addl r16=@gprel(__progname),gp - ;; -} -{ .mib - st8 [r14]=ENVP -(p7) cmp.eq p6,p0=0,r15 -(p6) br.dpnt .L1 - ;; -} - /* Normalize __progname. */ -{ .mmi - st8 [r16]=r15 - ld1 r14=[r15],1 - nop 0 - ;; -} -.L0: -{ .mib - cmp4.eq p7,p0=0,r14 - cmp4.eq p6,p0=0x2f,r14 -(p7) br.dptk .L1 - ;; -} -{ .mmb -(p6) st8 [r16]=r15 - ld1 r14=[r15],1 - br.dptk.many .L0 -} -.L1: -{ .mib - cmp.ne p7,p0=0,CLEANUP - mov out0=CLEANUP -(p7) br.call.sptk b0=atexit - ;; -} -{ .mfb - mov gp=GP - nop 0 - br.call.sptk b0=_init_tls -} -#ifdef GCRT -{ .mmi - mov gp=GP - ;; - addl r14=@ltoff(@fptr(_mcleanup)),gp - nop 0 - ;; -} -{ .mfb - ld8 out0=[r14] - nop 0 - br.call.sptk b0=atexit - ;; -} -#endif -{ .mmi - mov gp=GP - ;; - addl r14=@ltoff(@fptr(_fini)),gp - nop 0 - ;; -} -{ .mfb - ld8 out0=[r14] - nop 0 - br.call.sptk b0=atexit - ;; -} -#ifdef GCRT -{ .mmi - mov gp=GP - ;; - addl r14=@ltoff(eprol),gp - addl r15=@ltoff(etext),gp - ;; -} -{ .mmb - ld8 out0=[r14] - ld8 out1=[r15] - br.call.sptk b0=monstartup - ;; -} -#endif -{ .mfb - mov gp=GP - nop 0 - br.call.sptk b0=_init - ;; -} -{ .mmi - mov gp=GP - mov out0=ARGC - mov out1=ARGV -} -{ .mfb - mov out2=ENVP - nop 0 - br.call.sptk b0=main - ;; -} -{ .mib - mov gp=GP - mov out0=r8 - br.call.sptk b0=exit - ;; -} - .endp _start - -#ifdef GCRT -eprol: -#endif - - .rodata -.empty: stringz "" - - .sdata - .global __progname - .size __progname,8 - .type __progname,@object -__progname: data8 .empty - - .common environ,8,8 diff --git a/lib/csu/ia64/crti.S b/lib/csu/ia64/crti.S deleted file mode 100644 index 66ef94849924..000000000000 --- a/lib/csu/ia64/crti.S +++ /dev/null @@ -1,60 +0,0 @@ -/*- - * Copyright (c) 2001 Peter Wemm <peter@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include <machine/asm.h> -__FBSDID("$FreeBSD$"); - -/* - * This file (and its companion crtn.S) form the terminators of the - * .init and .fini sections. - */ - .file "crti.S" - - .section .init,"ax",@progbits - .global _init# - .proc _init# -_init: - .regstk 0,2,0,0 - .prologue 12,loc0 - .save ar.pfs,loc1 - alloc loc1=ar.pfs,0,2,0,0 - mov loc0=b0 /* Save return addr */ - .body - .endp _init# - - .section .fini,"ax",@progbits - .global _fini# - .proc _fini# -_fini: - .regstk 0,2,0,0 - .prologue 12,loc0 - .save ar.pfs,loc1 - alloc loc1=ar.pfs,0,2,0,0 - mov loc0=b0 /* Save return addr */ - .body - .endp _fini# diff --git a/lib/csu/ia64/crtn.S b/lib/csu/ia64/crtn.S deleted file mode 100644 index 681fba38c9b2..000000000000 --- a/lib/csu/ia64/crtn.S +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * Copyright (c) 2001 Peter Wemm <peter@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include <machine/asm.h> -__FBSDID("$FreeBSD$"); - - .file "crtn.S" - - .section .init,"ax",@progbits - .regstk 0,2,0,0 - mov b0=loc0 /* Recover return addr */ - mov ar.pfs=loc1 - br.ret.sptk.many b0 - - .section .fini,"ax",@progbits - .regstk 0,2,0,0 - mov b0=loc0 /* Recover return addr */ - mov ar.pfs=loc1 - br.ret.sptk.many b0 |
