_map.h revision 08278a5e91755ccdb5850c19d21d42fb2e16b50e
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * CDDL HEADER START
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * The contents of this file are subject to the terms of the
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * Common Development and Distribution License (the "License").
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * You may not use this file except in compliance with the License.
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * See the License for the specific language governing permissions
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * and limitations under the License.
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * When distributing Covered Code, include this CDDL HEADER in each
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * If applicable, add the following below this CDDL HEADER, with the
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * fields enclosed by brackets "[]" replaced with your own identifying
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * information: Portions Copyright [yyyy] [name of copyright owner]
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * CDDL HEADER END
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * Use is subject to license terms.
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * Local include file for libld mapfile subsystem.
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * Macro used to size name buffer corresponding to a NULL terminated array
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * of structures each of which contains a name string. Macro is used per-name.
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * 2 extra characters are allowed per item to allow for a ', ' delimiter
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * or NULL termination.
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * Variant of isspace() that excludes newline characters. Requires <ctype.h>.
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore#define isspace_nonl(_s) (isspace(_s) && ((_s) != '\n'))
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * Type used to insert NULL characters in the mapfile text and later
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * back them out and restore the original character. The mapfile text
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * is held in a single string, so when we want to access sub-strings,
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * it is necessary to temporarily insert NULLs to prevent the entire
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * mapfile from that point forward being output.
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Mooretypedef struct {
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore char *np_ptr; /* Address patched with NULL character */
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore char np_ch; /* Character originally found at *np_ptr */
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * ld_map_gettoken() uses a table of 128 bytes to determine how to
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * process a token starting with any 7-bit ASCII value. The table is
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * indexed by the character code, and returns one of the TK_* token values.
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * The definition of an unquoted identifier differs based on the mapfile
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * version. Rather than write a separate function to locate identifiers
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * for each version, we use a single function that relies on a per-character
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * table that encodes which characters can start an identifier, and which
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * can continue one, for each supported mapfile version.
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * Two bits are used for each version, one for the start attribute, and the
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * other for continuation. The first two bits are not used (version 0), the
753a6d457b330b1b29b2d3eefcd0831116ce950dSherry Moore * next 2 are used for version 1, the following 2 for version 2, and so on.
} Mapfile;
} Token;
} tkv_int;
} ld_map_ver_t;
} ld_map_sym_t;
#if defined(_ELF64)
extern void ld_map_lowercase(char *);
char **restrict, Xword *);
Conv_inv_buf_t *);
Word, const char *);
const char *symname);
ld_map_sym_t *);
ld_map_ver_t *);
#ifdef __cplusplus