Module Name: src Committed By: pooka Date: Sun Sep 13 22:51:42 UTC 2009
Modified Files: src/sys/rump: Makefile.rump src/sys/rump/fs/lib: Makefile.inc src/sys/rump/net/lib/liblocal: Makefile src/sys/rump/net/lib/libnet: Makefile src/sys/rump/net/lib/libsockin: Makefile Added Files: src/sys/rump/librump: rump_domain.c rump_module.c Log Message: binutils 2.19 has changed the old behaviour of defining __start_SECTNAME for orphaned sections to using PROVIDE. What this means is that unless a rump component internally references that symbol, it will not be included in the component shared library, and hence cannot be referenced when the component is loaded. Add a workaround which works both with 2.16 and 2.19: force a reference to the __start symbol internally and hence retain it in the resulting library. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/rump/Makefile.rump cvs rdiff -u -r1.12 -r1.13 src/sys/rump/fs/lib/Makefile.inc cvs rdiff -u -r0 -r1.1 src/sys/rump/librump/rump_domain.c \ src/sys/rump/librump/rump_module.c cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/liblocal/Makefile cvs rdiff -u -r1.5 -r1.6 src/sys/rump/net/lib/libnet/Makefile cvs rdiff -u -r1.3 -r1.4 src/sys/rump/net/lib/libsockin/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/rump/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.40 src/sys/rump/Makefile.rump:1.41 --- src/sys/rump/Makefile.rump:1.40 Tue Sep 8 20:24:08 2009 +++ src/sys/rump/Makefile.rump Sun Sep 13 22:51:41 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rump,v 1.40 2009/09/08 20:24:08 pooka Exp $ +# $NetBSD: Makefile.rump,v 1.41 2009/09/13 22:51:41 pooka Exp $ # WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet @@ -39,6 +39,15 @@ # If this file changes, we need a full rebuild DPSRCS+= ${RUMPTOP}/Makefile.rump +.ifdef RUMP_ISMODULE +.PATH: ${RUMPTOP}/librump +SRCS+= rump_module.c +.endif +.ifdef RUMP_ISDOMAIN +.PATH: ${RUMPTOP}/librump +SRCS+= rump_domain.c +.endif + # # Rename library symbols before use. If a symbol does not already belong # to a rump namespace ("rump" or "RUMP"), prefix it with "rumpns". This Index: src/sys/rump/fs/lib/Makefile.inc diff -u src/sys/rump/fs/lib/Makefile.inc:1.12 src/sys/rump/fs/lib/Makefile.inc:1.13 --- src/sys/rump/fs/lib/Makefile.inc:1.12 Wed Oct 15 13:57:03 2008 +++ src/sys/rump/fs/lib/Makefile.inc Sun Sep 13 22:51:41 2009 @@ -1,6 +1,7 @@ -# $NetBSD: Makefile.inc,v 1.12 2008/10/15 13:57:03 pooka Exp $ +# $NetBSD: Makefile.inc,v 1.13 2009/09/13 22:51:41 pooka Exp $ # RUMPTOP= ${.CURDIR}/../../.. +RUMP_ISMODULE= # defined .include "${RUMPTOP}/Makefile.rump" Index: src/sys/rump/net/lib/liblocal/Makefile diff -u src/sys/rump/net/lib/liblocal/Makefile:1.2 src/sys/rump/net/lib/liblocal/Makefile:1.3 --- src/sys/rump/net/lib/liblocal/Makefile:1.2 Thu May 28 00:02:16 2009 +++ src/sys/rump/net/lib/liblocal/Makefile Sun Sep 13 22:51:42 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2009/05/28 00:02:16 pooka Exp $ +# $NetBSD: Makefile,v 1.3 2009/09/13 22:51:42 pooka Exp $ # .PATH: ${.CURDIR}/../../../../kern @@ -10,5 +10,7 @@ CFLAGS+= -Wno-pointer-sign +RUMP_ISDOMAIN= + .include <bsd.lib.mk> .include <bsd.klinks.mk> Index: src/sys/rump/net/lib/libnet/Makefile diff -u src/sys/rump/net/lib/libnet/Makefile:1.5 src/sys/rump/net/lib/libnet/Makefile:1.6 --- src/sys/rump/net/lib/libnet/Makefile:1.5 Thu May 28 00:02:16 2009 +++ src/sys/rump/net/lib/libnet/Makefile Sun Sep 13 22:51:42 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2009/05/28 00:02:16 pooka Exp $ +# $NetBSD: Makefile,v 1.6 2009/09/13 22:51:42 pooka Exp $ # .PATH: ${.CURDIR}/../../../../net @@ -12,6 +12,8 @@ CPPFLAGS+= -I${.CURDIR}/opt -I${.CURDIR}/../libnetinet/opt +RUMP_ISDOMAIN= + .include "${.CURDIR}/../libnetinet/Makefile.inc" .include <bsd.lib.mk> Index: src/sys/rump/net/lib/libsockin/Makefile diff -u src/sys/rump/net/lib/libsockin/Makefile:1.3 src/sys/rump/net/lib/libsockin/Makefile:1.4 --- src/sys/rump/net/lib/libsockin/Makefile:1.3 Thu May 28 00:02:16 2009 +++ src/sys/rump/net/lib/libsockin/Makefile Sun Sep 13 22:51:42 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2009/05/28 00:02:16 pooka Exp $ +# $NetBSD: Makefile,v 1.4 2009/09/13 22:51:42 pooka Exp $ # LIB= rumpnet_sockin @@ -8,5 +8,7 @@ CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern +RUMP_ISDOMAIN= + .include <bsd.lib.mk> .include <bsd.klinks.mk> Added files: Index: src/sys/rump/librump/rump_domain.c diff -u /dev/null src/sys/rump/librump/rump_domain.c:1.1 --- /dev/null Sun Sep 13 22:51:42 2009 +++ src/sys/rump/librump/rump_domain.c Sun Sep 13 22:51:42 2009 @@ -0,0 +1,14 @@ +/* $NetBSD: rump_domain.c,v 1.1 2009/09/13 22:51:42 pooka Exp $ */ + +/* + * Force reference to __start_link_set_domains, so that the + * binutils 2.19 linker does not lose the symbol due to it being + * PROVIDEd in 2.19 as opposed to earlier versions where it was + * defined. + * + * Note: look into this again when all platforms use 2.19 + */ +extern void *__start_link_set_domains; +void *rump_start_domains = &__start_link_set_domains; +extern void *__stop_link_set_domains; +void *rump_stop_domains = &__stop_link_set_domains; Index: src/sys/rump/librump/rump_module.c diff -u /dev/null src/sys/rump/librump/rump_module.c:1.1 --- /dev/null Sun Sep 13 22:51:42 2009 +++ src/sys/rump/librump/rump_module.c Sun Sep 13 22:51:42 2009 @@ -0,0 +1,14 @@ +/* $NetBSD: rump_module.c,v 1.1 2009/09/13 22:51:42 pooka Exp $ */ + +/* + * Force reference to __start_link_set_modules, so that the + * binutils 2.19 linker does not lose the symbol due to it being + * PROVIDEd in 2.19 as opposed to earlier versions where it was + * defined. + * + * Note: look into this again when all platforms use 2.19 + */ +extern void *__start_link_set_modules; +void *rump_start_modules = &__start_link_set_modules; +extern void *__stop_link_set_modules; +void *rump_stop_modules = &__stop_link_set_modules;