Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Feb 2009 22:37:11 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 157118 for review
Message-ID:  <200902032237.n13MbB2g094399@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902032237.n13MbB2g094399>