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

(cherry picked from commit 5db5c6c87a)
This commit is contained in:
Konstantin Belousov 2024-02-29 01:40:41 +02:00
parent fd5a82ecd2
commit 8b84d2da9a

View file

@ -75,6 +75,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: