From 275eeea6c928509284dd267fdcc9646d65a5352d Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 23 Apr 2003 18:34:20 +0000 Subject: [PATCH] The __wrap_* symbols need to become local symbols. If you have module x which is dependent y but they both have __wrap_foo, if the __wrap_foo is not localized, you will get linker truncation messages. --- share/mk/bsd.kmod.mk | 8 +++++++- sys/lkm/arch/powerpc/lkmhide.awk | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 sys/lkm/arch/powerpc/lkmhide.awk diff --git a/share/mk/bsd.kmod.mk b/share/mk/bsd.kmod.mk index e1b02e2f06ce..ee349e5b04cc 100644 --- a/share/mk/bsd.kmod.mk +++ b/share/mk/bsd.kmod.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.kmod.mk,v 1.59 2003/03/27 17:05:14 christos Exp $ +# $NetBSD: bsd.kmod.mk,v 1.60 2003/04/23 18:34:20 matt Exp $ .include @@ -54,6 +54,12 @@ ${PROG}: ${KMOD}_tmp.o ${KMOD}_tramp.o `${OBJDUMP} --reloc ${KMOD}_tmp.o | \ awk -f $S/lkm/arch/${MACHINE_ARCH}/lkmwrap.awk` \ -o tmp.o ${KMOD}_tmp.o ${KMOD}_tramp.o +.if exists($S/lkm/arch/${MACHINE_ARCH}/lkmhide.awk) + ${OBJCOPY} \ + `${NM} tmp.o | awk -f $S/lkm/arch/${MACHINE_ARCH}/lkmhide.awk` \ + tmp.o tmp1.o + mv tmp1.o tmp.o +.endif mv tmp.o ${.TARGET} .else ${PROG}: ${OBJS} ${DPADD} diff --git a/sys/lkm/arch/powerpc/lkmhide.awk b/sys/lkm/arch/powerpc/lkmhide.awk new file mode 100644 index 000000000000..df7de7e1c682 --- /dev/null +++ b/sys/lkm/arch/powerpc/lkmhide.awk @@ -0,0 +1,5 @@ +# $NetBSD: lkmhide.awk,v 1.1 2003/04/23 18:34:21 matt Exp $ + +substr($NF, 1, 7) == "__wrap_" { + print " --localize-symbol "$NF; +}