usr/src/cmd/sgs/rtld/common/util.c
changeset 12449 a87750d92895
parent 11827 d7ef53deac3f
child 12650 160f1ef36195
equal deleted inserted replaced
12448:f60856ebe541 12449:a87750d92895
    18  *
    18  *
    19  * CDDL HEADER END
    19  * CDDL HEADER END
    20  */
    20  */
    21 
    21 
    22 /*
    22 /*
    23  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
       
    24  * Use is subject to license terms.
       
    25  */
       
    26 
       
    27 /*
       
    28  *	Copyright (c) 1988 AT&T
    23  *	Copyright (c) 1988 AT&T
    29  *	  All Rights Reserved
    24  *	  All Rights Reserved
       
    25  *
       
    26  * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
    30  */
    27  */
    31 
    28 
    32 /*
    29 /*
    33  * Utility routines for run-time linker.  some are duplicated here from libc
    30  * Utility routines for run-time linker.  some are duplicated here from libc
    34  * (with different names) to avoid name space collisions.
    31  * (with different names) to avoid name space collisions.
  1466 #define	ENV_FLG_HWCAP		0x0008000000000ULL
  1463 #define	ENV_FLG_HWCAP		0x0008000000000ULL
  1467 #define	ENV_FLG_SFCAP		0x0010000000000ULL
  1464 #define	ENV_FLG_SFCAP		0x0010000000000ULL
  1468 #define	ENV_FLG_MACHCAP		0x0020000000000ULL
  1465 #define	ENV_FLG_MACHCAP		0x0020000000000ULL
  1469 #define	ENV_FLG_PLATCAP		0x0040000000000ULL
  1466 #define	ENV_FLG_PLATCAP		0x0040000000000ULL
  1470 #define	ENV_FLG_CAP_FILES	0x0080000000000ULL
  1467 #define	ENV_FLG_CAP_FILES	0x0080000000000ULL
       
  1468 #define	ENV_FLG_DEFERRED	0x0100000000000ULL
  1471 
  1469 
  1472 #define	SEL_REPLACE		0x0001
  1470 #define	SEL_REPLACE		0x0001
  1473 #define	SEL_PERMANT		0x0002
  1471 #define	SEL_PERMANT		0x0002
  1474 #define	SEL_ACT_RT		0x0100	/* setting rtld_flags */
  1472 #define	SEL_ACT_RT		0x0100	/* setting rtld_flags */
  1475 #define	SEL_ACT_RT2		0x0200	/* setting rtld_flags2 */
  1473 #define	SEL_ACT_RT2		0x0200	/* setting rtld_flags2 */
  1601 			str = &config->c_name;
  1599 			str = &config->c_name;
  1602 			variable = ENV_FLG_CONFIG;
  1600 			variable = ENV_FLG_CONFIG;
  1603 		}
  1601 		}
  1604 	}
  1602 	}
  1605 	/*
  1603 	/*
  1606 	 * The LD_DEBUG family and LD_DEMANGLE.
  1604 	 * The LD_DEBUG family, LD_DEFERRED (internal, used by ldd(1)), and
       
  1605 	 * LD_DEMANGLE.
  1607 	 */
  1606 	 */
  1608 	else if (*s1 == 'D') {
  1607 	else if (*s1 == 'D') {
  1609 		if ((len == MSG_LD_DEBUG_SIZE) && (strncmp(s1,
  1608 		if ((len == MSG_LD_DEBUG_SIZE) && (strncmp(s1,
  1610 		    MSG_ORIG(MSG_LD_DEBUG), MSG_LD_DEBUG_SIZE) == 0)) {
  1609 		    MSG_ORIG(MSG_LD_DEBUG), MSG_LD_DEBUG_SIZE) == 0)) {
  1611 			select |= SEL_ACT_STR;
  1610 			select |= SEL_ACT_STR;
  1615 		    MSG_ORIG(MSG_LD_DEBUG_OUTPUT),
  1614 		    MSG_ORIG(MSG_LD_DEBUG_OUTPUT),
  1616 		    MSG_LD_DEBUG_OUTPUT_SIZE) == 0)) {
  1615 		    MSG_LD_DEBUG_OUTPUT_SIZE) == 0)) {
  1617 			select |= SEL_ACT_STR;
  1616 			select |= SEL_ACT_STR;
  1618 			str = &dbg_file;
  1617 			str = &dbg_file;
  1619 			variable = ENV_FLG_DEBUG_OUTPUT;
  1618 			variable = ENV_FLG_DEBUG_OUTPUT;
       
  1619 		} else if ((len == MSG_LD_DEFERRED_SIZE) && (strncmp(s1,
       
  1620 		    MSG_ORIG(MSG_LD_DEFERRED), MSG_LD_DEFERRED_SIZE) == 0)) {
       
  1621 			select |= SEL_ACT_RT;
       
  1622 			val = RT_FL_DEFERRED;
       
  1623 			variable = ENV_FLG_DEFERRED;
  1620 		} else if ((len == MSG_LD_DEMANGLE_SIZE) && (strncmp(s1,
  1624 		} else if ((len == MSG_LD_DEMANGLE_SIZE) && (strncmp(s1,
  1621 		    MSG_ORIG(MSG_LD_DEMANGLE), MSG_LD_DEMANGLE_SIZE) == 0)) {
  1625 		    MSG_ORIG(MSG_LD_DEMANGLE), MSG_LD_DEMANGLE_SIZE) == 0)) {
  1622 			select |= SEL_ACT_RT;
  1626 			select |= SEL_ACT_RT;
  1623 			val = RT_FL_DEMANGLE;
  1627 			val = RT_FL_DEMANGLE;
  1624 			variable = ENV_FLG_DEMANGLE;
  1628 			variable = ENV_FLG_DEMANGLE;