99282790b7
The ELF notes compiled in C were placed in a section with the wrong type (SHT_PROGBITS instead of SHT_NOTE). Previously, sed was used on the generated assembly to rewrite the section type. Instead, write the notes in assembly which permits setting the correct section type directly. While here, move inline assembly entry points out of C and into assembly for aarch64, arm, and riscv. Reviewed by: kib Tested on: amd64 (cirrus-ci), riscv64 Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25211
44 lines
1.2 KiB
Makefile
44 lines
1.2 KiB
Makefile
# $FreeBSD$
|
|
|
|
.PATH: ${.CURDIR:H}/common
|
|
|
|
SRCS= crti.S crtn.S
|
|
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
|
|
OBJS+= Scrt1.o crt1.o crtsavres.o gcrt1.o
|
|
CFLAGS+= -I${.CURDIR} -I${.CURDIR:H}/common \
|
|
-I${SRCTOP}/lib/libc/include \
|
|
-mlongcall -DCRT_IRELOC_RELA
|
|
|
|
FILES= ${OBJS}
|
|
FILESMODE= ${LIBMODE}
|
|
FILESOWN= ${LIBOWN}
|
|
FILESGRP= ${LIBGRP}
|
|
FILESDIR= ${LIBDIR}
|
|
# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
|
|
.undef LIBRARIES_ONLY
|
|
|
|
CLEANFILES= ${OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o
|
|
CLEANFILES+= crtbrand.o ignore_init_note.o
|
|
CLEANFILES+= crtsavres.S
|
|
|
|
# On powerpc64 crtsavres is an empty file
|
|
crtsavres.S:
|
|
touch ${.TARGET}
|
|
|
|
gcrt1_c.o: crt1_c.c
|
|
${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
|
|
|
|
gcrt1.o: gcrt1_c.o crtbrand.o ignore_init_note.o
|
|
${LD} ${_LDFLAGS} -o gcrt1.o -r crtbrand.o ignore_init_note.o gcrt1_c.o
|
|
|
|
crt1.o: crt1_c.o crtbrand.o ignore_init_note.o
|
|
${LD} ${_LDFLAGS} -o crt1.o -r crtbrand.o ignore_init_note.o crt1_c.o
|
|
|
|
Scrt1_c.o: crt1_c.c
|
|
${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
|
|
|
|
Scrt1.o: Scrt1_c.o crtbrand.o ignore_init_note.o
|
|
${LD} ${_LDFLAGS} -o Scrt1.o -r crtbrand.o ignore_init_note.o Scrt1_c.o
|
|
|
|
.include <bsd.lib.mk>
|