rtld: use generated map file to check for some leaks from libc into rtld

Reviewed by:	brooks, emaste (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44136
This commit is contained in:
Konstantin Belousov 2024-02-29 01:40:41 +02:00
parent 799940154c
commit 5db5c6c87a

View file

@ -79,6 +79,25 @@ MAPFILE= ld-elf.so.1.map
LDFLAGS+= -Wl,-Map=${MAPFILE} -Wl,--cref
CLEANFILES+= ${MAPFILE}
afterbuild:
@if grep __libsys_interposing ${MAPFILE} >/dev/null ; then \
echo "libsys_interposing leaked" 1>&2 ; \
exit 1 ; \
fi
@if grep __libc_interposing ${MAPFILE} >/dev/null ; then \
echo "libc_interposing leaked" 1>&2 ; \
exit 1 ; \
fi
@if grep xlocale ${MAPFILE} >/dev/null ; then \
echo "xlocale leaked" 1>&2 ; \
exit 1 ; \
fi
@if grep fprintf ${MAPFILE} >/dev/null ; then \
echo "stdio leaked" 1>&2 ; \
exit 1 ; \
fi
# Since moving rtld-elf to /libexec, we need to create a symlink.
# Fixup the existing binary that's there so we can symlink over it.
beforeinstall: