Enforce that vdso does not contain runtime relocations

Reviewed by:	emaste
Discussed with:	jrtc27
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D32960
This commit is contained in:
Konstantin Belousov 2021-12-01 02:35:26 +02:00
parent b0e0b4e7b3
commit d49b75d0d6
3 changed files with 16 additions and 2 deletions

View File

@ -14,13 +14,13 @@ include "conf/files.x86"
#
elf-vdso.so.o standard \
dependency "$S/amd64/amd64/sigtramp.S assym.inc $S/tools/amd64_vdso.sh" \
compile-with "env AWK='${AWK}' NM='${NM}' LD='${LD}' CC='${CC}' OBJCOPY='${OBJCOPY}' S='${S}' sh $S/tools/amd64_vdso.sh" \
compile-with "env AWK='${AWK}' NM='${NM}' LD='${LD}' CC='${CC}' OBJCOPY='${OBJCOPY}' ELFDUMP='${ELFDUMP}' S='${S}' sh $S/tools/amd64_vdso.sh" \
no-implicit-rule before-depend \
clean "elf-vdso.so.o elf-vdso.so.1 vdso_offsets.h sigtramp.pico"
#
elf-vdso32.so.o optional compat_freebsd32 \
dependency "$S/amd64/ia32/ia32_sigtramp.S ia32_assym.h $S/tools/amd64_ia32_vdso.sh" \
compile-with "env AWK='${AWK}' NM='${NM}' LD='${LD}' CC='${CC}' OBJCOPY='${OBJCOPY}' S='${S}' sh $S/tools/amd64_ia32_vdso.sh" \
compile-with "env AWK='${AWK}' NM='${NM}' LD='${LD}' CC='${CC}' OBJCOPY='${OBJCOPY}' ELFDUMP='${ELFDUMP}' S='${S}' sh $S/tools/amd64_ia32_vdso.sh" \
no-implicit-rule before-depend \
clean "elf-vdso32.so.o elf-vdso32.so.1 vdso_ia32_offsets.h ia32_sigtramp.pico"
#

View File

@ -46,6 +46,13 @@ then
exit 1
fi
if [ -n "$(${ELFDUMP} -d elf-vdso32.so.1 | \
${AWK} '/DT_REL.*SZ/{print "RELOCS"}')" ]
then
echo "elf-vdso32.so.1 contains runtime relocations" 1>&2
exit 1
fi
${CC} -x assembler-with-cpp -DLOCORE -fPIC -nostdinc -c \
-o elf-vdso32.so.o -I. -I"${S}" -include opt_global.h \
-DVDSO_NAME=elf_vdso32_so_1 -DVDSO_FILE=elf-vdso32.so.1 \

View File

@ -55,6 +55,13 @@ then
exit 1
fi
if [ -n "$(${ELFDUMP} -d elf-vdso.so.1 | \
${AWK} '/DT_REL.*SZ/{print "RELOCS"}')" ]
then
echo "elf-vdso.so.1 contains runtime relocations" 1>&2
exit 1
fi
${CC} -x assembler-with-cpp -DLOCORE -fPIC -nostdinc -c \
-o elf-vdso.so.o -I. -I"${S}" -include opt_global.h \
-DVDSO_NAME=elf_vdso_so_1 -DVDSO_FILE=elf-vdso.so.1 \