d29b2c4438482eb00488be49a1f5d6835f455546ab * CDDL HEADER START
d29b2c4438482eb00488be49a1f5d6835f455546ab * The contents of this file are subject to the terms of the
d29b2c4438482eb00488be49a1f5d6835f455546ab * Common Development and Distribution License (the "License").
d29b2c4438482eb00488be49a1f5d6835f455546ab * You may not use this file except in compliance with the License.
d29b2c4438482eb00488be49a1f5d6835f455546ab * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d29b2c4438482eb00488be49a1f5d6835f455546ab * See the License for the specific language governing permissions
d29b2c4438482eb00488be49a1f5d6835f455546ab * and limitations under the License.
d29b2c4438482eb00488be49a1f5d6835f455546ab * When distributing Covered Code, include this CDDL HEADER in each
d29b2c4438482eb00488be49a1f5d6835f455546ab * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d29b2c4438482eb00488be49a1f5d6835f455546ab * If applicable, add the following below this CDDL HEADER, with the
d29b2c4438482eb00488be49a1f5d6835f455546ab * fields enclosed by brackets "[]" replaced with your own identifying
d29b2c4438482eb00488be49a1f5d6835f455546ab * information: Portions Copyright [yyyy] [name of copyright owner]
d29b2c4438482eb00488be49a1f5d6835f455546ab * CDDL HEADER END
f441771b0ce9f9d6122d318ff8290cb1a2848f9dRod Evans * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
d29b2c4438482eb00488be49a1f5d6835f455546ab * String conversion routines for syminfo attributes.
ba2be53024c0b999e74ba9adcd7d80fec5df8c57ab#include <_machelf.h>
d29b2c4438482eb00488be49a1f5d6835f455546ab#include "_conv.h"
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramistatic const Val_desc *
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramiconv_syminfo_flags_strings(Conv_fmt_flags_t fmt_flags)
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_SYMINFO_FLG_DIRECT_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_SYMINFO_FLG_FILTER_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_SYMINFO_FLG_COPY_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_SYMINFO_FLG_LAZYLOAD_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_SYMINFO_FLG_DIRECTBIND_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_SYMINFO_FLG_NOEXTDIRECT_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_SYMINFO_FLG_AUXILIARY_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_SYMINFO_FLG_INTERPOSE_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
f441771b0ce9f9d6122d318ff8290cb1a2848f9dRod Evans MSG_SYMINFO_FLG_CAP_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
f441771b0ce9f9d6122d318ff8290cb1a2848f9dRod Evans MSG_SYMINFO_FLG_DEFERRED_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Ensure that Conv_syminfo_flags_buf_t is large enough:
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * FLAGSZ is the real minimum size of the buffer required by
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * conv_syminfo_flags(). However, Conv_syminfo_flags_buf_t uses
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * CONV_SYMINFO_FLAGS_BUFSIZE to set the buffer size. We do things
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * this way because the definition of FLAGSZ uses information that
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * is not available in the environment of other programs that include
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * the conv.h header file.
6a074c93c5dee390d8ca2377f42e55418f0a9eb3ab#if (CONV_SYMINFO_FLAGS_BUFSIZE != FLAGSZ) && !defined(__lint)
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_DIRECT, MSG_SYMINFO_FLG_DIRECT_CF },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_FILTER, MSG_SYMINFO_FLG_FILTER_CF },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_LAZYLOAD, MSG_SYMINFO_FLG_LAZYLOAD_CF },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_DIRECTBIND, MSG_SYMINFO_FLG_DIRECTBIND_CF },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_NOEXTDIRECT, MSG_SYMINFO_FLG_NOEXTDIRECT_CF },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_AUXILIARY, MSG_SYMINFO_FLG_AUXILIARY_CF },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_INTERPOSE, MSG_SYMINFO_FLG_INTERPOSE_CF },
f441771b0ce9f9d6122d318ff8290cb1a2848f9dRod Evans { SYMINFO_FLG_DEFERRED, MSG_SYMINFO_FLG_DEFERRED_CF },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_DIRECT, MSG_SYMINFO_FLG_DIRECT_CFNP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_FILTER, MSG_SYMINFO_FLG_FILTER_CFNP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_COPY, MSG_SYMINFO_FLG_COPY_CFNP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_LAZYLOAD, MSG_SYMINFO_FLG_LAZYLOAD_CFNP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_DIRECTBIND, MSG_SYMINFO_FLG_DIRECTBIND_CFNP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_NOEXTDIRECT, MSG_SYMINFO_FLG_NOEXTDIRECT_CFNP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_AUXILIARY, MSG_SYMINFO_FLG_AUXILIARY_CFNP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_INTERPOSE, MSG_SYMINFO_FLG_INTERPOSE_CFNP },
f441771b0ce9f9d6122d318ff8290cb1a2848f9dRod Evans { SYMINFO_FLG_DEFERRED, MSG_SYMINFO_FLG_DEFERRED_CFNP },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_DIRECT, MSG_SYMINFO_FLG_DIRECT_NF },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_FILTER, MSG_SYMINFO_FLG_FILTER_NF },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_LAZYLOAD, MSG_SYMINFO_FLG_LAZYLOAD_NF },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_DIRECTBIND, MSG_SYMINFO_FLG_DIRECTBIND_NF },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_NOEXTDIRECT, MSG_SYMINFO_FLG_NOEXTDIRECT_NF },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_AUXILIARY, MSG_SYMINFO_FLG_AUXILIARY_NF },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { SYMINFO_FLG_INTERPOSE, MSG_SYMINFO_FLG_INTERPOSE_NF },
f441771b0ce9f9d6122d318ff8290cb1a2848f9dRod Evans { SYMINFO_FLG_DEFERRED, MSG_SYMINFO_FLG_DEFERRED_NF },
d29b2c4438482eb00488be49a1f5d6835f455546abconst char *
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramiconv_syminfo_flags(Half flags, Conv_fmt_flags_t fmt_flags,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami conv_syminfo_flags_strings(fmt_flags), fmt_flags);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramiconv_iter_syminfo_flags(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_iter_vd(conv_syminfo_flags_strings(fmt_flags),
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramistatic const conv_ds_t **
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramiconv_syminfo_boundto_strings(Conv_fmt_flags_t fmt_flags)
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_SYMINFO_BT_EXTERN_CF, MSG_SYMINFO_BT_NONE_CF,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_SYMINFO_BT_PARENT_CF, MSG_SYMINFO_BT_SELF_CF
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_SYMINFO_BT_EXTERN_CFNP, MSG_SYMINFO_BT_NONE_CFNP,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_SYMINFO_BT_PARENT_CFNP, MSG_SYMINFO_BT_SELF_CFNP
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_SYMINFO_BT_EXTERN_NF, MSG_SYMINFO_BT_NONE_NF,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_SYMINFO_BT_PARENT_NF, MSG_SYMINFO_BT_SELF_NF
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(SYMINFO_BT_EXTERN, boundto_cf) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(SYMINFO_BT_EXTERN, boundto_cfnp) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami CONV_DS_MSG_INIT(SYMINFO_BT_EXTERN, boundto_nf) };
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami /* Build NULL terminated return arrays for each string style */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami /* Select the strings to use */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramiconv_syminfo_boundto(Half value, Conv_fmt_flags_t fmt_flags,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_map_ds(ELFOSABI_NONE, EM_NONE, value,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami conv_syminfo_boundto_strings(fmt_flags), fmt_flags, inv_buf));
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramiconv_iter_syminfo_boundto(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,