From owner-p4-projects@FreeBSD.ORG Tue Feb 3 22:37:11 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AFA421065676; Tue, 3 Feb 2009 22:37:11 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EE45106566C for ; Tue, 3 Feb 2009 22:37:11 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 40E968FC0A for ; Tue, 3 Feb 2009 22:37:11 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n13MbBqx094401 for ; Tue, 3 Feb 2009 22:37:11 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n13MbB2g094399 for perforce@freebsd.org; Tue, 3 Feb 2009 22:37:11 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 3 Feb 2009 22:37:11 GMT Message-Id: <200902032237.n13MbB2g094399@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 157118 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2009 22:37:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=157118 Change 157118 by rwatson@rwatson_freebsd_capabilities on 2009/02/03 22:36:26 When running in capability mode, expose the __progname and environ symbols from rtld to the executing shared object, since we aren't using crt1.o for those objects. Affected files ... .. //depot/projects/trustedbsd/capabilities/src/libexec/rtld-elf-cap/Makefile#10 edit .. //depot/projects/trustedbsd/capabilities/src/libexec/rtld-elf-cap/Symbol.map#1 add .. //depot/projects/trustedbsd/capabilities/src/libexec/rtld-elf/rtld.c#7 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/libexec/rtld-elf-cap/Makefile#10 (text+ko) ==== @@ -1,5 +1,5 @@ # $FreeBSD$ -# $P4: //depot/projects/trustedbsd/capabilities/src/libexec/rtld-elf-cap/Makefile#9 $ +# $P4: //depot/projects/trustedbsd/capabilities/src/libexec/rtld-elf-cap/Makefile#10 $ WITHOUT_SSP= @@ -29,7 +29,7 @@ .if ${MK_SYMVER} == "yes" LIBCDIR= ${.CURDIR}/../../lib/libc VERSION_DEF= ${LIBCDIR}/Versions.def -SYMBOL_MAPS= ${.CURDIR}/../rtld-elf/Symbol.map +SYMBOL_MAPS= ${.CURDIR}/../rtld-elf/Symbol.map ${.CURDIR}/Symbol.map VERSION_MAP= Version.map LDFLAGS+= -Wl,--version-script=${VERSION_MAP} ==== //depot/projects/trustedbsd/capabilities/src/libexec/rtld-elf/rtld.c#7 (text+ko) ==== @@ -184,6 +184,13 @@ #endif /* + * Global declarations normally provided by crt1. The dynamic linker is + * not built with crt1, so we have to provide them ourselves. + */ +char *__progname; +char **environ; + +/* * These are the functions the dynamic linker exports to application * programs. They are the only symbols the dynamic linker is willing * to export from itself. @@ -208,17 +215,14 @@ (func_ptr_type) &dl_iterate_phdr, (func_ptr_type) &_rtld_atfork_pre, (func_ptr_type) &_rtld_atfork_post, +#ifdef IN_RTLD_CAP + (func_ptr_type) &environ, + (func_ptr_type) &__progname, +#endif NULL }; /* - * Global declarations normally provided by crt1. The dynamic linker is - * not built with crt1, so we have to provide them ourselves. - */ -char *__progname; -char **environ; - -/* * Globals to control TLS allocation. */ size_t tls_last_offset; /* Static TLS offset of last module */