diff options
author | John Baldwin <jhb@FreeBSD.org> | 2020-06-24 17:54:24 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2020-06-24 17:54:24 +0000 |
commit | 99db5849f7506e765c43f4e69a7105cc888e8d5e (patch) | |
tree | cab82f06492c121da76da5c604825bd53d438db7 | |
parent | 1926765670b25d4d26709a84753a2d9d28e0ff3b (diff) | |
download | src-99db5849f7506e765c43f4e69a7105cc888e8d5e.tar.gz src-99db5849f7506e765c43f4e69a7105cc888e8d5e.zip |
Always compile the brand and ignore init ELF notes standalone.
Reviewed by: kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25374
Notes
Notes:
svn path=/head/; revision=362589
-rw-r--r-- | lib/csu/aarch64/Makefile | 13 | ||||
-rw-r--r-- | lib/csu/aarch64/crt1_s.S | 3 | ||||
-rw-r--r-- | lib/csu/arm/Makefile | 13 | ||||
-rw-r--r-- | lib/csu/arm/crt1_s.S | 5 | ||||
-rw-r--r-- | lib/csu/i386/Makefile | 13 | ||||
-rw-r--r-- | lib/csu/i386/crt1_s.S | 3 | ||||
-rw-r--r-- | lib/csu/riscv/Makefile | 13 | ||||
-rw-r--r-- | lib/csu/riscv/crt1_s.S | 3 |
8 files changed, 31 insertions, 35 deletions
diff --git a/lib/csu/aarch64/Makefile b/lib/csu/aarch64/Makefile index 61212c0479c0..1ba9c190b70a 100644 --- a/lib/csu/aarch64/Makefile +++ b/lib/csu/aarch64/Makefile @@ -18,20 +18,21 @@ FILESDIR= ${LIBDIR} .undef LIBRARIES_ONLY CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o +CLEANFILES+= crtbrand.o ignore_init_note.o gcrt1_c.o: crt1_c.c ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -gcrt1.o: gcrt1_c.o crt1_s.o - ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o +gcrt1.o: gcrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC} -crt1.o: crt1_c.o crt1_s.o - ${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o +crt1.o: crt1_c.o crt1_s.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC} Scrt1_c.o: crt1_c.c ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -Scrt1.o: Scrt1_c.o crt1_s.o - ${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o +Scrt1.o: Scrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC} .include <bsd.lib.mk> diff --git a/lib/csu/aarch64/crt1_s.S b/lib/csu/aarch64/crt1_s.S index 61e11aef6700..65803c8246ae 100644 --- a/lib/csu/aarch64/crt1_s.S +++ b/lib/csu/aarch64/crt1_s.S @@ -32,9 +32,6 @@ #include <machine/asm.h> __FBSDID("$FreeBSD$"); -#include "crtbrand.S" -#include "ignore_init_note.S" - ENTRY(_start) mov x3, x2 /* cleanup */ add x1, x0, #8 /* load argv */ diff --git a/lib/csu/arm/Makefile b/lib/csu/arm/Makefile index ed238c69c887..245a1ef86058 100644 --- a/lib/csu/arm/Makefile +++ b/lib/csu/arm/Makefile @@ -18,23 +18,24 @@ FILESDIR= ${LIBDIR} .undef LIBRARIES_ONLY CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o +CLEANFILES+= crtbrand.o ignore_init_note.o crt1_c.o: crt1_c.c ${CC} ${CFLAGS} ${STATIC_CFLAGS} -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -crt1.o: crt1_c.o crt1_s.o - ${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o +crt1.o: crt1_c.o crt1_s.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC} gcrt1_c.o: crt1_c.c ${CC} ${CFLAGS} ${STATIC_CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -gcrt1.o: gcrt1_c.o crt1_s.o - ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o +gcrt1.o: gcrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC} Scrt1_c.o: crt1_c.c ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -Scrt1.o: Scrt1_c.o crt1_s.o - ${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o +Scrt1.o: Scrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC} .include <bsd.lib.mk> diff --git a/lib/csu/arm/crt1_s.S b/lib/csu/arm/crt1_s.S index 50c59fc21f5a..eeeab3588ce2 100644 --- a/lib/csu/arm/crt1_s.S +++ b/lib/csu/arm/crt1_s.S @@ -44,8 +44,9 @@ #include <machine/asm.h> __FBSDID("$FreeBSD$"); -#include "crtbrand.S" -#include "ignore_init_note.S" +#include <sys/param.h> +#include <sys/elf_common.h> +#include "notes.h" ENTRY(_start) mov r5, r2 /* cleanup */ diff --git a/lib/csu/i386/Makefile b/lib/csu/i386/Makefile index 2483ca35c285..7e834937c6fe 100644 --- a/lib/csu/i386/Makefile +++ b/lib/csu/i386/Makefile @@ -18,22 +18,23 @@ FILESDIR= ${LIBDIR} .undef LIBRARIES_ONLY CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o +CLEANFILES+= crtbrand.o ignore_init_note.o gcrt1_c.o: crt1_c.c ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -gcrt1.o: gcrt1_c.o crt1_s.o - ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o +gcrt1.o: gcrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC} -crt1.o: crt1_c.o crt1_s.o - ${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o +crt1.o: crt1_c.o crt1_s.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC} ${OBJCOPY} --localize-symbol _start1 crt1.o Scrt1_c.o: crt1_c.c ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -Scrt1.o: Scrt1_c.o crt1_s.o - ${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o +Scrt1.o: Scrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC} ${OBJCOPY} --localize-symbol _start1 Scrt1.o .include <bsd.lib.mk> diff --git a/lib/csu/i386/crt1_s.S b/lib/csu/i386/crt1_s.S index e09c2e6b57f1..1bd9a4283987 100644 --- a/lib/csu/i386/crt1_s.S +++ b/lib/csu/i386/crt1_s.S @@ -25,9 +25,6 @@ #include <machine/asm.h> __FBSDID("$FreeBSD$"); -#include "crtbrand.S" -#include "ignore_init_note.S" - .text .align 4 .globl _start diff --git a/lib/csu/riscv/Makefile b/lib/csu/riscv/Makefile index 61212c0479c0..1ba9c190b70a 100644 --- a/lib/csu/riscv/Makefile +++ b/lib/csu/riscv/Makefile @@ -18,20 +18,21 @@ FILESDIR= ${LIBDIR} .undef LIBRARIES_ONLY CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o +CLEANFILES+= crtbrand.o ignore_init_note.o gcrt1_c.o: crt1_c.c ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -gcrt1.o: gcrt1_c.o crt1_s.o - ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o +gcrt1.o: gcrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC} -crt1.o: crt1_c.o crt1_s.o - ${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o +crt1.o: crt1_c.o crt1_s.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC} Scrt1_c.o: crt1_c.c ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c -Scrt1.o: Scrt1_c.o crt1_s.o - ${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o +Scrt1.o: Scrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC} .include <bsd.lib.mk> diff --git a/lib/csu/riscv/crt1_s.S b/lib/csu/riscv/crt1_s.S index 409e796593e7..e6b23008a4d0 100644 --- a/lib/csu/riscv/crt1_s.S +++ b/lib/csu/riscv/crt1_s.S @@ -36,9 +36,6 @@ #include <machine/asm.h> __FBSDID("$FreeBSD$"); -#include "crtbrand.S" -#include "ignore_init_note.S" - ENTRY(_start) mv a3, a2 # cleanup addi a1, a0, 8 # get argv |