aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2024-02-28 23:40:41 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2024-02-29 01:49:02 +0000
commit5db5c6c87a75f8b1871f021726fc4697253ae5cf (patch)
tree9e1773cdc111b01b8837a9a736361afa1111abdd /libexec
parent799940154c70597a46627deb4d0b98e174b27b98 (diff)
downloadsrc-5db5c6c87a75f8b1871f021726fc4697253ae5cf.tar.gz
src-5db5c6c87a75f8b1871f021726fc4697253ae5cf.zip
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
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/Makefile19
1 files changed, 19 insertions, 0 deletions
diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile
index cc40b839024f..37c3840538d5 100644
--- a/libexec/rtld-elf/Makefile
+++ b/libexec/rtld-elf/Makefile
@@ -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: