analyze.c revision 390b98b5ee57d19c88c936564abbe555f4821091
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * CDDL HEADER START
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * The contents of this file are subject to the terms of the
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Common Development and Distribution License, Version 1.0 only
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * (the "License"). You may not use this file except in compliance
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * with the License.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * See the License for the specific language governing permissions
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * and limitations under the License.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * When distributing Covered Code, include this CDDL HEADER in each
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If applicable, add the following below this CDDL HEADER, with the
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * fields enclosed by brackets "[]" replaced with your own identifying
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * information: Portions Copyright [yyyy] [name of copyright owner]
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * CDDL HEADER END
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Copyright (c) 1988 AT&T
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * All Rights Reserved
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Use is subject to license terms.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter#pragma ident "%Z%%M% %I% %E% SMI"
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If a load filter flag is in effect, and this object is a filter, trigger the
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * loading of all its filtees. The load filter flag is in effect when creating
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * configuration files, or when under the control of ldd(1), or the LD_LOADFLTR
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * environment variable is set, or this object was built with the -zloadfltr
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * flag. Otherwise, filtee loading is deferred until triggered by a relocation.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Analyze one or more link-maps of a link map control list. This routine is
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * called at startup to continue the processing of the main executable. It is
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * also called each time a new set of objects are loaded, ie. from filters,
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * lazy-loaded objects, or dlopen().
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * In each instance we traverse the link-map control list starting with the
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * initial object. As dependencies are analyzed they are added to the link-map
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * control list. Thus the list grows as we traverse it - this results in the
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * breadth first ordering of all needed objects.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalteranalyze_lmc(Lm_list *lml, Aliste nlmco, Rt_map *nlmp)
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If this link-map control list is being analyzed, return. The object
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * that has just been added will be picked up by the existing analysis
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * thread. Note, this is only really meaningful during process init-
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * ialization, as objects are added to the main link-map control list.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Following this initialization, each family of objects that are loaded
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * are added to a new link-map control list.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter /* LINTED */
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter return (1);
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If this object doesn't belong to the present link-map control list
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * then it must already have been analyzed, or it is in the process of
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * being analyzed prior to us recursing into this analysis. In either
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * case, ignore the object as it's already being taken care of.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter return (1);
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter (FLG_RT_ANALZING | FLG_RT_ANALYZED | FLG_RT_DELETE))
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Indicate that analyzing is under way.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If this link map represents a relocatable object, then we
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * need to finish the link-editing of the object at this point.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Establish any dependencies this object requires.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If we're building a configuration file, determine if this
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * object is a filter and if so load its filtees. This
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * traversal is only necessary for crle(1), as typical use of
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * an object will load filters as part of relocation processing.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If an interposer has been added, it will have been inserted
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * in the link-map before the link we're presently analyzing.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Break out of this analysis loop and return to the head of
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * the link-map control list to analyze the interposer. Note
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * that this rescan preserves the breadth first loading of
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * dependencies.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Copy relocation test. If the symbol definition is within .bss, then it's
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * zero filled, and as the destination is within .bss, we can skip copying
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * zero's to zero's. However, if the destination object has a MOVE table, it's
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * .bss might contain non-zero data, in which case copy it regardless.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter for (mmaps = MMAPS(dlmp); mmaps->m_vaddr; mmaps++) {
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter return (1);
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter return (0);
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Relocate an individual object.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalterrelocate_so(Lm_list *lml, Rt_map *lmp, int *relocated, int now)
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If we're running under ldd(1), and haven't been asked to trace any
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * warnings, skip any actual relocation processing.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter return (0);
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter return (1);
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Relocate the objects on a link-map control list.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter_relocate_lmc(Lm_list *lml, Rt_map *nlmp, int *relocated)
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If this object has already been relocated, we're done. If
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * this object is being deleted, skip it, there's probably a
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * relocation error somewhere that's causing this deletion.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter (FLG_RT_RELOCING | FLG_RT_RELOCED | FLG_RT_DELETE))
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Indicate that relocation processing is under way.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Relocate the object.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter return (0);
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Indicate that the objects relocation is complete.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Mark this object's init is available for harvesting. Under
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * ldd(1) this marking is necessary for -i (tsort) gathering.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * None of the following processing is necessary under ldd().
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Process any move data.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Process any DT_SUNW_RTLDINFO information now the
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * object is relocated, and remove the RTLDINFO
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * infrastructure as it won't be needed anymore.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * We wait until lmp == lm_info_lmp, as it's at this
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * stage we know the object contributing RTLDINFO has
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * been properly relocated.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter if ((FCT(lmp) == &elf_fct) && (lml->lm_rtldinfo) &&
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Determine if this object is a filter, and if a load filter
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * flag is in effect, trigger the loading of all its filtees.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Perform special copy relocations. These are only meaningful for
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * dynamic executables (fixed and head of their link-map list). If
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * this ever has to change then the infrastructure of COPY() has to
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * change as presently this element is used to capture both receiver
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * and supplier of copy data.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter if ((FLAGS(nlmp) & FLG_RT_FIXED) && (nlmp == LIST(nlmp)->lm_head) &&
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter/* XX64 don't need this once the compilers are fixed */
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter return (0);
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter return (1);
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Only copy the bits if it's from non-zero
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * filled memory.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter return (1);
51b564aca190d2a430104dded1983d3a1fff66e2mcwalterrelocate_lmc(Lm_list *lml, Aliste nlmco, Rt_map *nlmp)
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If this link-map control list is being relocated, return. The object
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * that has just been added will be picked up by the existing relocation
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * thread. Note, this is only really meaningful during process init-
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * ialization, as objects are added to the main link-map control list.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Following this initialization, each family of objects that are loaded
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * are added to a new link-map control list.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter /* LINTED */
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter return (1);
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Relocate one or more link-maps of a link map control list. If this
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * object doesn't belong to the present link-map control list then it
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * must already have been relocated, or it is in the process of being
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * relocated prior to us recursing into this relocation. In either
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * case, ignore the object as it's already being taken care of, however,
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * fall through and capture any relocation promotions that might have
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * been established from the reference mode of this object.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If we're generating a configuration file using crle(1), two passes
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * may be involved. Under the first pass, RTLD_CONFGEN is set. Under
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * this pass, crle() loads objects into the process address space. No
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * relocation is necessary at this point, we simply need to analyze the
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * objects to insure any directly bound dependencies, filtees, etc.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * get loaded. Although we skip the relocation, fall through to insure
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * any control lists are maintained appropriately.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If objects are to be dldump(3c)'ed, crle(1) makes a second pass,
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * using RTLD_NOW and RTLD_CONFGEN. The RTLD_NOW effectively carries
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * out the relocations of all loaded objects.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter ((MODE(nlmp) & (RTLD_NOW | RTLD_CONFGEN)) != RTLD_CONFGEN)) {
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Determine whether the initial link-map control list has
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * started relocation. From this point, should any interposing
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * objects be added to this link-map control list, the objects
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * are demoted to standard objects. Their interposition can't
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * be guaranteed once relocations have been carried out.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Relocate the link-map control list.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * At this point we've completed the addition of a new group of
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * objects, either the initial objects that start the process
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * (called from setup()), a group added through lazy loading or
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * filters, or from a dlopen() request. Indicate to the
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * debuggers that new objects have been added.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Determine the new, and previous link-map control lists.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter /* LINTED */
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Having completed this control list of objects, they can now be bound
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * to from other objects. Move this control list to the control list
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * that precedes it. Although this control list may have only bound to
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * controls lists much higher up the control list stack, it must only
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * be moved up one control list so as to preserve the link-map order
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * that may have already been traversed in search of symbols.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Determine whether existing objects that have already been relocated,
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * need any additional relocations performed. This can occur when new
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * objects are loaded with RTLD_NOW, and these new objects have
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * dependencies on objects that are already loaded. Note, that we peel
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * any relocation promotions off of one control list at a time. This
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * prevents relocations from being bound to objects that might yet fail
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * to relocate themselves.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Remove the relocation promotion list, as performing more
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * relocations may result in discovering more objects that need
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * promotion.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If the original relocation of the link-map control
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * list failed, or one of the relocation promotions of
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * this loop has failed, demote any pending objects
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * relocation mode.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If a relocation fails, save the error condition.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * It's possible that all new objects on the original
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * link-map control list have been relocated
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * successfully, but if the user request requires
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * promoting objects that have already been loaded, we
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * have to indicate that this operation couldn't be
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * performed. The unrelocated objects are in use on
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * another control list, and may continue to be used.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If the .plt that resulted in the error is called,
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * then the process will receive a fatal error at that
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * time. But, the .plt may never be called.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Having promoted any objects, determine whether additional
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * dependencies were added, and if so move them to the previous
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * link-map control list.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter return (1);
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter return (0);
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Inherit the first rejection message for possible later diagnostics.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Any attempt to process a file that is unsuccessful, should be accompanied
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * with an error diagnostic. However, some operations like searching for a
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * simple filename, involve trying numerous paths, and an error message for each
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * lookup is not required. Although a multiple search can fail, it's possible
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * that a file was found, but was rejected because it was the wrong type.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * To satisfy these possibilities, the first failure is recorded as a rejection
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * message, and this message is used later for a more specific diagnostic.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * File searches are focused at load_one(), and from here a rejection descriptor
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * is passed down to various child routines. If these child routines can
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * process multiple files, then they will maintain their own rejection desc-
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * riptor. This is filled in for any failures, and a diagnostic produced to
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * reflect the failure. The child routines then employ rejection_inherit() to
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * pass the first rejection message back to load_one().
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Note that the name, and rejection string must be duplicated, as the name
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * buffer and error string buffer (see conv_ routines) may be reused for
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * additional processing or rejection messages.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * As this routine is called to clean up after a failed open, remove any
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * resolved pathname that might have been allocated as the file was processed.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalterrejection_inherit(Rej_desc *rej1, Rej_desc *rej2, Fdesc *fdp)
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Determine the object type of a file.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalterare_u_this(Rej_desc *rej, int fd, struct stat *status, const char *name)
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * If this is a directory (which can't be mmap()'ed) generate a precise
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * error message.
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter return (0);
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * Map in the first page of the file. When this buffer is first used,
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * the mapping is a single system page. This is typically enough to
51b564aca190d2a430104dded1983d3a1fff66e2mcwalter * inspect the ehdr and phdrs of the file, and can be reused for each
#if defined(MAP_ALIGN)
fmap_setup();
#if defined(MAP_ALIGN)
for (i = 0; vector[i]; i++) {
return (vector[i]);
return (vector[i]);
const char *_str;
_str++;
static Rt_map *
const char **cpp;
* (DT_NEEDED == libc.so.1), which are expanded to full pathnames to
return (lmp);
return (lmp);
return (lmp);
Rt_map *
const char *_name;
return (lmp);
_name++;
return (lmp);
return ((Rt_map *)0);
if (rej) {
if (alter)
int pmode = 0;
if (pmode) {
#ifdef SIEBEL_DISABLE
return (pmode);
return (pmode);
* is typically used to retain dependency names, such as "libc.so.1", which
AL_CNT_ALIAS) == 0) {
if (added)
static Rt_map *
return (nlmp);
return ((Rt_map *)0);
return (nlmp);
return ((Rt_map *)0);
int secure = 0;
secure++;
if (secure)
if (secure)
added = 0;
&added) == 0)
if (added)
added = 0;
if (added) {
int err = 0;
const char *aname;
0, &aname)) != 0) {
int ret;
return (ret);
if (aname == 0)
dobj = 0;
const char *alt = 0;
if (dobj == 0) {
if (dobj == 0)
if (*strhash == 0)
if (fobj == 0) {
int ret;
RTC_OBJ_OPTINAL) == 0))
return (ret);
static Rt_map *
* libc.so.1 (DT_NEEDED). The original name is maintained on an ALIAS
oname = 0;
if (nlmp == 0)
const char *odir;
char *ndir;
char *ofil;
if (nlmp)
return (nlmp);
static Rt_map *
char *name;
const char *str;
slash++;
if (slash == 0)
* link-map to ld.so.1's link-map.
* when searching for files. By using ld.so.1's we are defaulting to
if (clmp == 0)
#if defined(MAP_ALIGN)
} else if (slash) {
#if !defined(ISSOLOAD_BASENAME_DISABLED)
return (nlmp);
* (i.e., a file might have a dependency on foo.so.1 which has
return (nlmp);
char *_name;
return (name);
int promote;
#ifdef SIEBEL_DISABLE
if (hdl)
int exist;
AL_CNT_DEPCLCT) == 0)
AL_CNT_DEPCLCT) == 0) {
nmode);
Rt_map *
return (nlmp);
Rt_map *
const char *name;
return (tlmp);
return (tlmp);
static Sym *
*binfo |=
return ((Sym *)0);
return (sym);
return ((Sym *)0);
static Sym *
return (sym);
sym = 0;
if (lmp)
if (sym)
return (isym);
return (sym);
static Sym *
return (sym);
static Sym *
return (sym);
Sym *
*binfo = 0;
lmp = 0;
return (sym);
return (sym);
sym = 0;
return ((Sym *)0);
sym)) != 0)
return (isym);
return (sym);
return (found);
if (bound) {
if (ret) {
ret = 0;
if (textrel)
return (ret);