/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* LINTLIBRARY */ /* PROTOLIB1 */ /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" #include #include #include #include "debug.h" uint_t Dbg_setup(const char *); void Dbg_set(uint_t); void Dbg_args_files(int, char *); void Dbg_args_flags(int, int); void Dbg_audit_interface(const char *, const char *); void Dbg_audit_interface64(const char *, const char *); void Dbg_audit_lib(const char *); void Dbg_audit_lib64(const char *); void Dbg_audit_object(const char *, const char *); void Dbg_audit_object64(const char *, const char *); void Dbg_audit_symval(const char *, const char *, const char *, Addr, Addr); void Dbg_audit_symval64(const char *, const char *, const char *, Addr, Addr); void Dbg_audit_version(const char *, ulong_t); void Dbg_audit_version64(const char *, ulong_t); void Dbg_bind_global(const char *, caddr_t, caddr_t, Xword, Pltbindtype, const char *, caddr_t, caddr_t, const char *, uint_t); void Dbg_bind_profile(uint_t, uint_t); void Dbg_bind_weak(const char *, caddr_t, caddr_t, const char *); void Dbg_cap_hw_candidate(const char *); void Dbg_cap_hw_filter(const char *, const char *); void Dbg_cap_hw_1(Xword, Half); void Dbg_cap_sec_entry(uint_t, Xword, Xword, Half); void Dbg_cap_sec_title(const char *); void Dbg_ent_print(Half, List *, Boolean); void Dbg_file_analyze(Rt_map *); void Dbg_file_analyze64(Rt_map *); void Dbg_file_aout(const char *, ulong_t, ulong_t, ulong_t); void Dbg_file_aout64(const char *, ulong_t, ulong_t, ulong_t); void Dbg_file_archive(const char *, int); void Dbg_file_archive64(const char *, int); void Dbg_file_bind_entry(Bnd_desc *); void Dbg_file_bind_entry64(Bnd_desc *); void Dbg_file_bindings(Rt_map *, int, Word); void Dbg_file_bindings64(Rt_map *, int, Word); void Dbg_file_bind_title(int); void Dbg_file_bind_title64(int); void Dbg_file_cntl(Lm_list *, Aliste, Aliste); void Dbg_file_config_dis(const char *, int); void Dbg_file_config_dis64(const char *, int); void Dbg_file_config_obj(const char *, const char *, const char *); void Dbg_file_config_obj64(const char *, const char *, const char *); void Dbg_file_delete(const char *); void Dbg_file_delete64(const char *); void Dbg_file_dlclose(const char *, int); void Dbg_file_dlclose64(const char *, int); void Dbg_file_dldump(const char *, const char *, int); void Dbg_file_dldump64(const char *, const char *, int); void Dbg_file_dlopen(const char *, const char *, int); void Dbg_file_dlopen64(const char *, const char *, int); void Dbg_file_elf(const char *, ulong_t, ulong_t, ulong_t, ulong_t, Lmid_t, Aliste); void Dbg_file_elf64(const char *, ulong_t, ulong_t, ulong_t, ulong_t, Lmid_t, Aliste); void Dbg_file_filtee(const char *, const char *, int); void Dbg_file_filtee64(const char *, const char *, int); void Dbg_file_filter(const char *, const char *, int); void Dbg_file_filter64(const char *, const char *, int); void Dbg_file_fixname(const char *, const char *); void Dbg_file_fixname64(const char *, const char *); void Dbg_file_generic(Ifl_desc *); void Dbg_file_generic64(Ifl_desc *); void Dbg_file_handle_collect(Grp_hdl *, const char *); void Dbg_file_handle_collect64(Grp_hdl *, const char *); void Dbg_file_handle(Grp_hdl *, Rt_map *, int); void Dbg_file_handle64(Grp_hdl *, Rt_map *, int); void Dbg_file_lazyload(const char *, const char *, const char *); void Dbg_file_lazyload64(const char *, const char *, const char *); void Dbg_file_ldso(const char *, ulong_t, ulong_t, char **, auxv_t *); void Dbg_file_ldso64(const char *, ulong_t, ulong_t, char **, auxv_t *); void Dbg_file_mode_promote(const char *, int); void Dbg_file_needed(const char *, const char *); void Dbg_file_needed64(const char *, const char *); void Dbg_file_nl(void); void Dbg_file_nl64(void); void Dbg_file_output(Ofl_desc *); void Dbg_file_output64(Ofl_desc *); void Dbg_file_preload(const char *); void Dbg_file_preload64(const char *); void Dbg_file_prot(const char *, int); void Dbg_file_prot64(const char *, int); void Dbg_file_rejected(Rej_desc *); void Dbg_file_reuse(const char *, const char *); void Dbg_file_reuse64(const char *, const char *); void Dbg_file_ar_rescan(void); void Dbg_file_del_rescan(void); void Dbg_file_skip(const char *, const char *); void Dbg_file_skip64(const char *, const char *); void Dbg_got_display(Gottable *, Ofl_desc *); void Dbg_got_display64(Gottable *, Ofl_desc *); void Dbg_libs_audit(const char *, const char *); void Dbg_libs_ignore(const char *); void Dbg_libs_init(List *, List *); void Dbg_libs_l(const char *, const char *); void Dbg_libs_path(const char *, Half, const char *); void Dbg_libs_req(const char *, const char *, const char *); void Dbg_libs_update(List *, List *); void Dbg_libs_yp(const char *); void Dbg_libs_ylu(const char *, const char *, int); void Dbg_libs_find(const char *); void Dbg_libs_found(const char *, int); void Dbg_map_atsign(Boolean); void Dbg_map_atsign64(Boolean); void Dbg_map_dash(const char *, Sdf_desc *); void Dbg_map_dash64(const char *, Sdf_desc *); void Dbg_map_ent(Boolean, Ent_desc *, Ofl_desc *); void Dbg_map_ent64(Boolean, Ent_desc *, Ofl_desc *); void Dbg_map_equal(Boolean); void Dbg_map_equal64(Boolean); void Dbg_map_parse(const char *); void Dbg_map_parse64(const char *); void Dbg_map_pipe(Sg_desc *, const char *, const Word); void Dbg_map_pipe64(Sg_desc *, const char *, const Word); void Dbg_map_seg(Half, int, Sg_desc *); void Dbg_map_seg64(Half, int, Sg_desc *); void Dbg_map_size_new(const char *); void Dbg_map_size_new64(const char *); void Dbg_map_size_old(Ehdr *, Sym_desc *); void Dbg_map_size_old64(Ehdr *, Sym_desc *); void Dbg_map_sort_fini(Sg_desc *); void Dbg_map_sort_fini64(Sg_desc *); void Dbg_map_sort_orig(Sg_desc *); void Dbg_map_sort_orig64(Sg_desc *); void Dbg_map_symbol(Ehdr *, Sym_desc *); void Dbg_map_symbol64(Ehdr *, Sym_desc *); void Dbg_map_version(const char *, const char *, int); void Dbg_map_version64(const char *, const char *, int); void Dbg_move_adjexpandreloc(ulong_t, const char *); void Dbg_move_adjmovereloc(ulong_t, ulong_t, const char *); void Dbg_move_data(const char *); void Dbg_move_expanding(Move *, Addr); void Dbg_move_input1(const char *); void Dbg_move_mventry(int, Move *, Sym_desc *); void Dbg_move_mventry64(int, Move *, Sym_desc *); void Dbg_move_mventry2(Move *, Word, char *); void Dbg_move_mventry264(Move *, Word, char *); void Dbg_move_outmove(const uchar_t *); void Dbg_move_outsctadj(Sym_desc *); void Dbg_move_outsctadj64(Sym_desc *); void Dbg_move_parexpn(const char *, const char *); void Dbg_pltpad_bindto64(const char *, const char *, Addr); void Dbg_pltpad_boundto64(const char *, Addr, const char *, const char *); void Dbg_reloc_apply(unsigned long long, unsigned long long); void Dbg_reloc_ars_entry(Half, Rel_desc *); void Dbg_reloc_ars_entry64(Half, Rel_desc *); void Dbg_reloc_copy(const char *, const char *, const char *, int); void Dbg_reloc_discard(Half, Rel_desc *); void Dbg_reloc_discard64(Half, Rel_desc *); void Dbg_reloc_doact(Half, Word, Xword, Xword, const char *, Os_desc *); void Dbg_reloc_doact64(Half, Word, Xword, Xword, const char *, Os_desc *); void Dbg_reloc_doactiverel(void); void Dbg_reloc_dooutrel(GElf_Word); void Dbg_reloc_dooutrel64(GElf_Word); void Dbg_reloc_in(Half, Word, void *, const char *, const char *); void Dbg_reloc_in64(Half, Word, void *, const char *, const char *); void Dbg_reloc_ors_entry(Half, Rel_desc *); void Dbg_reloc_ors_entry64(Half, Rel_desc *); void Dbg_reloc_out(Half, Word, void *, const char *, const char *); void Dbg_reloc_out64(Half, Word, void *, const char *, const char *); void Dbg_reloc_proc(Os_desc *, Is_desc *, Is_desc *); void Dbg_reloc_proc64(Os_desc *, Is_desc *, Is_desc *); void Dbg_reloc_run(const char *, uint_t, int, int); void Dbg_reloc_reg_apply(unsigned long long, unsigned long long); void Dbg_reloc_reg_apply64(unsigned long long, unsigned long long); void Dbg_sec_added(Os_desc *, Sg_desc *); void Dbg_sec_added64(Os_desc *, Sg_desc *); void Dbg_sec_created(Os_desc *, Sg_desc *); void Dbg_sec_created64(Os_desc *, Sg_desc *); void Dbg_sec_group(Is_desc *, Group_desc *); void Dbg_sec_group64(Is_desc *, Group_desc *); void Dbg_sec_in(Is_desc *); void Dbg_sec_in64(Is_desc *); void Dbg_sec_order_list(Ofl_desc *, int); void Dbg_sec_order_list64(Ofl_desc *, int); void Dbg_sec_order_error(Ifl_desc *, Word, int); void Dbg_sec_order_error64(Ifl_desc *, Word, int); void Dbg_seg_entry(Half, int, Sg_desc *); void Dbg_seg_entry64(Half, int, Sg_desc *); void Dbg_seg_list(Half, List *); void Dbg_seg_list64(Half, List *); void Dbg_seg_os(Ofl_desc *, Os_desc *, int); void Dbg_seg_os64(Ofl_desc *, Os_desc *, int); void Dbg_seg_title(void); void Dbg_seg_title64(void); void Dbg_statistics_ld(Ofl_desc *); void Dbg_statistics_ld64(Ofl_desc *); void Dbg_statistics_ar(Ofl_desc *); void Dbg_statistics_ar64(Ofl_desc *); void Dbg_syms_ar_checking(Xword, Elf_Arsym *, const char *); void Dbg_syms_ar_checking64(Xword, Elf_Arsym *, const char *); void Dbg_syms_ar_entry(Xword, Elf_Arsym *); void Dbg_syms_ar_entry64(Xword, Elf_Arsym *); void Dbg_syms_ar_resolve(Xword, Elf_Arsym *, const char *, int); void Dbg_syms_ar_resolve64(Xword, Elf_Arsym *, const char *, int); void Dbg_syms_ar_title(const char *, int); void Dbg_syms_ar_title64(const char *, int); void Dbg_syms_created(const char *); void Dbg_syms_created64(const char *); void Dbg_syms_entered(Ehdr *, Sym *, Sym_desc *); void Dbg_syms_entered64(Ehdr *, Sym *, Sym_desc *); void Dbg_syms_entry(Xword, Sym_desc *); void Dbg_syms_entry64(Xword, Sym_desc *); void Dbg_syms_global(Xword, const char *); void Dbg_syms_global64(Xword, const char *); void Dbg_syms_new(Ehdr *, Sym *, Sym_desc *); void Dbg_syms_new64(Ehdr *, Sym *, Sym_desc *); void Dbg_syms_nl(void); void Dbg_syms_nl64(void); void Dbg_syms_old(Ehdr *, Sym_desc *); void Dbg_syms_old64(Ehdr *, Sym_desc *); void Dbg_syms_process(Ifl_desc *); void Dbg_syms_process64(Ifl_desc *); void Dbg_syms_reduce(int, Ehdr *, Sym_desc *, int, const char *); void Dbg_syms_reduce64(int, Ehdr *, Sym_desc *, int, const char *); void Dbg_syms_reloc(Ehdr *, Sym_desc *); void Dbg_syms_reloc64(Ehdr *, Sym_desc *); void Dbg_syms_resolved(Ehdr *, Sym_desc *); void Dbg_syms_resolved64(Ehdr *, Sym_desc *); void Dbg_syms_resolving1(Xword, const char *, int, int); void Dbg_syms_resolving164(Xword, const char *, int, int); void Dbg_syms_resolving2(Ehdr *, Sym *, Sym *, Sym_desc *, Ifl_desc *); void Dbg_syms_resolving264(Ehdr *, Sym *, Sym *, Sym_desc *, Ifl_desc *); void Dbg_syms_sec_entry(int, Sg_desc *, Os_desc *); void Dbg_syms_sec_entry64(int, Sg_desc *, Os_desc *); void Dbg_syms_sec_title(void); void Dbg_syms_sec_title64(void); void Dbg_syms_sec_unused(Is_desc *, uint_t); void Dbg_syms_sec_unused64(Is_desc *, uint_t); void Dbg_syms_spec_title(void); void Dbg_syms_spec_title64(void); void Dbg_syms_up_title(Ehdr *); void Dbg_syms_up_title64(Ehdr *); void Dbg_syms_updated(Ehdr *, Sym_desc *, const char *); void Dbg_syms_updated64(Ehdr *, Sym_desc *, const char *); void Dbg_syms_dlsym(const char *, const char *, const char *, int); void Dbg_syms_dlsym64(const char *, const char *, const char *, int); void Dbg_syms_lookup_aout(const char *); void Dbg_syms_lookup_aout64(const char *); void Dbg_syms_lookup(const char *, const char *, const char *); void Dbg_syms_lookup64(const char *, const char *, const char *); void Dbg_syminfo_entry(int, Syminfo *, Sym *, const char *, Dyn *); void Dbg_syminfo_entry64(int, Syminfo *, Sym *, const char *, Dyn *); void Dbg_syminfo_title(void); void Dbg_syminfo_title64(void); void Dbg_support_action(const char *, const char *, Support_ndx, const char *); void Dbg_support_load(const char *, const char *); void Dbg_support_req(const char *, int); void Dbg_unused_file(const char *, int, int); void Dbg_unused_rtldinfo(const char *, const char *); void Dbg_unused_sec(Is_desc *); void Dbg_unused_sec64(Is_desc *); void Dbg_unused_unref(const char *, const char *); void Dbg_util_broadcast(const char *name); void Dbg_util_call_array(const char *libname, void *addr, uint_t ndx, uint_t shtype); void Dbg_util_call_fini(const char *name); void Dbg_util_call_init(const char *name, int flag); void Dbg_util_call_main(const char *name); void Dbg_util_collect(const char *name, int flag, int ndx); void Dbg_util_dbnotify(rd_event_e event, r_state_e state); void Dbg_util_edge_in(Rt_map *clmp, uint_t flags, Rt_map *dlmp, int ndx, int flag); void Dbg_util_edge_out(const char *cname, int ndx, const char *dname); void Dbg_util_intoolate(const char *name); void Dbg_util_nl(); void Dbg_util_no_init(const char *name); void Dbg_util_scc_entry(uint_t idx, const char *name); void Dbg_util_scc_title(int sec); void Dbg_util_str(const char *name); void Dbg_util_wait(int what, const char *cname, const char *dname); void Dbg_ver_avail_entry(Ver_index *, const char *); void Dbg_ver_avail_entry64(Ver_index *, const char *); void Dbg_ver_avail_title(const char *); void Dbg_ver_def_title(const char *); void Dbg_ver_desc_entry(Ver_desc *); void Dbg_ver_desc_entry64(Ver_desc *); void Dbg_ver_need_title(const char *); void Dbg_ver_need_entry(Half, const char *, const char *); void Dbg_ver_symbol(const char *); /* * Gelf related functions, used by elfdump */ const char * Gelf_sym_dem(const char *); void Gelf_cap_print(GElf_Cap *, int, Half); void Gelf_cap_title(void); void Gelf_dyn_print(GElf_Dyn *, int ndx, const char *, Half); void Gelf_dyn_title(void); void Gelf_elf_data_title(void); void Gelf_elf_header(GElf_Ehdr *, GElf_Shdr *); void Gelf_got_title(uchar_t); void Gelf_got_entry(GElf_Ehdr *, Sword, GElf_Addr, GElf_Xword, GElf_Word, void *, const char *); void Gelf_note_entry(GElf_Word *, GElf_Word); void Gelf_phdr_entry(Half, GElf_Phdr *); void Gelf_reloc_entry(const char *, GElf_Half, GElf_Word, GElf_Rela *, const char *, const char *); void Gelf_shdr_entry(Half, GElf_Shdr *); void Gelf_sym_table_entry(const char *, GElf_Ehdr *, GElf_Sym *, GElf_Word, const char *, const char *); void Gelf_sym_table_title(GElf_Ehdr *, const char *, const char *); void Gelf_syminfo_entry(int, GElf_Syminfo *, const char *, const char *); void Gelf_syminfo_title(void); void Gelf_ver_def_title(void); void Gelf_ver_need_title(void); void Gelf_ver_line_1(const char *, const char *, const char *, const char *); void Gelf_ver_line_2(const char *, const char *); void Gelf_ver_line_3(const char *, const char *, const char *);