in contrib/elftoolchain/readelf/readelf.c [219:393]
static void add_dumpop(struct readelf *re, size_t si, const char *sn, int op,
int t);
static const char *aeabi_adv_simd_arch(uint64_t simd);
static const char *aeabi_align_needed(uint64_t an);
static const char *aeabi_align_preserved(uint64_t ap);
static const char *aeabi_arm_isa(uint64_t ai);
static const char *aeabi_cpu_arch(uint64_t arch);
static const char *aeabi_cpu_arch_profile(uint64_t pf);
static const char *aeabi_div(uint64_t du);
static const char *aeabi_enum_size(uint64_t es);
static const char *aeabi_fp_16bit_format(uint64_t fp16);
static const char *aeabi_fp_arch(uint64_t fp);
static const char *aeabi_fp_denormal(uint64_t fd);
static const char *aeabi_fp_exceptions(uint64_t fe);
static const char *aeabi_fp_hpext(uint64_t fh);
static const char *aeabi_fp_number_model(uint64_t fn);
static const char *aeabi_fp_optm_goal(uint64_t fog);
static const char *aeabi_fp_rounding(uint64_t fr);
static const char *aeabi_hardfp(uint64_t hfp);
static const char *aeabi_mpext(uint64_t mp);
static const char *aeabi_optm_goal(uint64_t og);
static const char *aeabi_pcs_config(uint64_t pcs);
static const char *aeabi_pcs_got(uint64_t got);
static const char *aeabi_pcs_r9(uint64_t r9);
static const char *aeabi_pcs_ro(uint64_t ro);
static const char *aeabi_pcs_rw(uint64_t rw);
static const char *aeabi_pcs_wchar_t(uint64_t wt);
static const char *aeabi_t2ee(uint64_t t2ee);
static const char *aeabi_thumb_isa(uint64_t ti);
static const char *aeabi_fp_user_exceptions(uint64_t fu);
static const char *aeabi_unaligned_access(uint64_t ua);
static const char *aeabi_vfp_args(uint64_t va);
static const char *aeabi_virtual(uint64_t vt);
static const char *aeabi_wmmx_arch(uint64_t wmmx);
static const char *aeabi_wmmx_args(uint64_t wa);
static const char *elf_class(unsigned int class);
static const char *elf_endian(unsigned int endian);
static const char *elf_machine(unsigned int mach);
static const char *elf_osabi(unsigned int abi);
static const char *elf_type(unsigned int type);
static const char *elf_ver(unsigned int ver);
static const char *dt_type(unsigned int mach, unsigned int dtype);
static void dump_ar(struct readelf *re, int);
static void dump_arm_attributes(struct readelf *re, uint8_t *p, uint8_t *pe);
static void dump_attributes(struct readelf *re);
static uint8_t *dump_compatibility_tag(uint8_t *p, uint8_t *pe);
static void dump_dwarf(struct readelf *re);
static void dump_dwarf_abbrev(struct readelf *re);
static void dump_dwarf_aranges(struct readelf *re);
static void dump_dwarf_block(struct readelf *re, uint8_t *b,
Dwarf_Unsigned len);
static void dump_dwarf_die(struct readelf *re, Dwarf_Die die, int level);
static void dump_dwarf_frame(struct readelf *re, int alt);
static void dump_dwarf_frame_inst(struct readelf *re, Dwarf_Cie cie,
uint8_t *insts, Dwarf_Unsigned len, Dwarf_Unsigned caf, Dwarf_Signed daf,
Dwarf_Addr pc, Dwarf_Debug dbg);
static int dump_dwarf_frame_regtable(struct readelf *re, Dwarf_Fde fde,
Dwarf_Addr pc, Dwarf_Unsigned func_len, Dwarf_Half cie_ra);
static void dump_dwarf_frame_section(struct readelf *re, struct section *s,
int alt);
static void dump_dwarf_info(struct readelf *re, Dwarf_Bool is_info);
static void dump_dwarf_macinfo(struct readelf *re);
static void dump_dwarf_line(struct readelf *re);
static void dump_dwarf_line_decoded(struct readelf *re);
static void dump_dwarf_loc(struct readelf *re, Dwarf_Loc *lr);
static void dump_dwarf_loclist(struct readelf *re);
static void dump_dwarf_pubnames(struct readelf *re);
static void dump_dwarf_ranges(struct readelf *re);
static void dump_dwarf_ranges_foreach(struct readelf *re, Dwarf_Die die,
Dwarf_Addr base);
static void dump_dwarf_str(struct readelf *re);
static void dump_eflags(struct readelf *re, uint64_t e_flags);
static void dump_elf(struct readelf *re);
static void dump_flags(struct flag_desc *fd, uint64_t flags);
static void dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32_t stab);
static void dump_dynamic(struct readelf *re);
static void dump_liblist(struct readelf *re);
static void dump_mips_abiflags(struct readelf *re, struct section *s);
static void dump_mips_attributes(struct readelf *re, uint8_t *p, uint8_t *pe);
static void dump_mips_odk_reginfo(struct readelf *re, uint8_t *p, size_t sz);
static void dump_mips_options(struct readelf *re, struct section *s);
static void dump_mips_option_flags(const char *name, struct mips_option *opt,
uint64_t info);
static void dump_mips_reginfo(struct readelf *re, struct section *s);
static void dump_mips_specific_info(struct readelf *re);
static void dump_notes(struct readelf *re);
static void dump_notes_content(struct readelf *re, const char *buf, size_t sz,
off_t off);
static void dump_notes_data(const char *name, uint32_t type, const char *buf,
size_t sz);
static void dump_svr4_hash(struct section *s);
static void dump_svr4_hash64(struct readelf *re, struct section *s);
static void dump_gnu_hash(struct readelf *re, struct section *s);
static void dump_hash(struct readelf *re);
static void dump_phdr(struct readelf *re);
static void dump_ppc_attributes(uint8_t *p, uint8_t *pe);
static void dump_section_groups(struct readelf *re);
static void dump_symtab(struct readelf *re, int i);
static void dump_symtabs(struct readelf *re);
static uint8_t *dump_unknown_tag(uint64_t tag, uint8_t *p, uint8_t *pe);
static void dump_ver(struct readelf *re);
static void dump_verdef(struct readelf *re, int dump);
static void dump_verneed(struct readelf *re, int dump);
static void dump_versym(struct readelf *re);
static const char *dwarf_reg(unsigned int mach, unsigned int reg);
static const char *dwarf_regname(struct readelf *re, unsigned int num);
static struct dumpop *find_dumpop(struct readelf *re, size_t si,
const char *sn, int op, int t);
static int get_ent_count(struct section *s, int *ent_count);
static int get_mips_register_size(uint8_t flag);
static char *get_regoff_str(struct readelf *re, Dwarf_Half reg,
Dwarf_Addr off);
static const char *get_string(struct readelf *re, int strtab, size_t off);
static const char *get_symbol_name(struct readelf *re, int symtab, int i);
static uint64_t get_symbol_value(struct readelf *re, int symtab, int i);
static void load_sections(struct readelf *re);
static const char *mips_abi_fp(uint64_t fp);
static const char *note_type(const char *note_name, unsigned int et,
unsigned int nt);
static const char *note_type_freebsd(unsigned int nt);
static const char *note_type_freebsd_core(unsigned int nt);
static const char *note_type_linux_core(unsigned int nt);
static const char *note_type_gnu(unsigned int nt);
static const char *note_type_netbsd(unsigned int nt);
static const char *note_type_openbsd(unsigned int nt);
static const char *note_type_unknown(unsigned int nt);
static const char *note_type_xen(unsigned int nt);
static const char *option_kind(uint8_t kind);
static const char *phdr_type(unsigned int mach, unsigned int ptype);
static const char *ppc_abi_fp(uint64_t fp);
static const char *ppc_abi_vector(uint64_t vec);
static void readelf_usage(int status);
static void readelf_version(void);
static void search_loclist_at(struct readelf *re, Dwarf_Die die,
Dwarf_Unsigned lowpc);
static void search_ver(struct readelf *re);
static const char *section_type(unsigned int mach, unsigned int stype);
static void set_cu_context(struct readelf *re, Dwarf_Half psize,
Dwarf_Half osize, Dwarf_Half ver);
static const char *st_bind(unsigned int sbind);
static const char *st_shndx(unsigned int shndx);
static const char *st_type(unsigned int mach, unsigned int os,
unsigned int stype);
static const char *st_vis(unsigned int svis);
static const char *top_tag(unsigned int tag);
static void unload_sections(struct readelf *re);
static uint64_t _read_lsb(Elf_Data *d, uint64_t *offsetp,
int bytes_to_read);
static uint64_t _read_msb(Elf_Data *d, uint64_t *offsetp,
int bytes_to_read);
static uint64_t _decode_lsb(uint8_t **data, int bytes_to_read);
static uint64_t _decode_msb(uint8_t **data, int bytes_to_read);
static int64_t _decode_sleb128(uint8_t **dp, uint8_t *dpe);
static uint64_t _decode_uleb128(uint8_t **dp, uint8_t *dpe);
static struct eflags_desc arm_eflags_desc[] = {
{EF_ARM_RELEXEC, "relocatable executable"},
{EF_ARM_HASENTRY, "has entry point"},
{EF_ARM_SYMSARESORTED, "sorted symbol tables"},
{EF_ARM_DYNSYMSUSESEGIDX, "dynamic symbols use segment index"},
{EF_ARM_MAPSYMSFIRST, "mapping symbols precede others"},
{EF_ARM_BE8, "BE8"},
{EF_ARM_LE8, "LE8"},
{EF_ARM_INTERWORK, "interworking enabled"},
{EF_ARM_APCS_26, "uses APCS/26"},
{EF_ARM_APCS_FLOAT, "uses APCS/float"},
{EF_ARM_PIC, "position independent"},
{EF_ARM_ALIGN8, "8 bit structure alignment"},
{EF_ARM_NEW_ABI, "uses new ABI"},
{EF_ARM_OLD_ABI, "uses old ABI"},
{EF_ARM_SOFT_FLOAT, "software FP"},
{EF_ARM_VFP_FLOAT, "VFP"},
{EF_ARM_MAVERICK_FLOAT, "Maverick FP"},
{0, NULL}
};