Changeset View
Changeset View
Standalone View
Standalone View
contrib/elftoolchain/readelf/readelf.c
Show First 20 Lines • Show All 290 Lines • ▼ Show 20 Lines | |||||
static void dump_dwarf_ranges_foreach(struct readelf *re, Dwarf_Die die, | static void dump_dwarf_ranges_foreach(struct readelf *re, Dwarf_Die die, | ||||
Dwarf_Addr base); | Dwarf_Addr base); | ||||
static void dump_dwarf_str(struct readelf *re); | static void dump_dwarf_str(struct readelf *re); | ||||
static void dump_eflags(struct readelf *re, uint64_t e_flags); | static void dump_eflags(struct readelf *re, uint64_t e_flags); | ||||
static void dump_elf(struct readelf *re); | static void dump_elf(struct readelf *re); | ||||
static void dump_dt_flags_1_val(uint64_t d_val); | static void dump_dt_flags_1_val(uint64_t d_val); | ||||
static void dump_dt_flags_val(uint64_t d_val); | static void dump_dt_flags_val(uint64_t d_val); | ||||
static void dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32_t stab); | static void dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32_t stab); | ||||
static void dump_dynamic(struct readelf *re); | static void dump_dynamic(struct readelf *re); | ||||
static void dump_liblist(struct readelf *re); | static void dump_liblist(struct readelf *re); | ||||
emaste: should be in alpha order - i.e., before `dump_dyn_val` | |||||
static void dump_mips_abiflags(struct readelf *re, struct section *s); | 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_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_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_options(struct readelf *re, struct section *s); | ||||
static void dump_mips_option_flags(const char *name, struct mips_option *opt, | static void dump_mips_option_flags(const char *name, struct mips_option *opt, | ||||
uint64_t info); | uint64_t info); | ||||
static void dump_mips_reginfo(struct readelf *re, struct section *s); | static void dump_mips_reginfo(struct readelf *re, struct section *s); | ||||
static void dump_mips_specific_info(struct readelf *re); | static void dump_mips_specific_info(struct readelf *re); | ||||
▲ Show 20 Lines • Show All 2,535 Lines • ▼ Show 20 Lines | if(d_val) { | ||||
printf(" %lx", d_val); | printf(" %lx", d_val); | ||||
} | } | ||||
printf("\n"); | printf("\n"); | ||||
} | } | ||||
static void | static void | ||||
dump_dt_flags_1_val(uint64_t d_val) | dump_dt_flags_1_val(uint64_t d_val) | ||||
{ | { | ||||
printf(" Flags:"); | |||||
if(d_val & 0x1) { | if(d_val & 0x1) { | ||||
emasteUnsubmitted Not Done Inline ActionsFreeBSD style(9) has a space between if and (. Will update prior to commit. emaste: FreeBSD style(9) has a space between `if` and `(`. Will update prior to commit. | |||||
d_val ^= 0x1; | d_val ^= 0x1; | ||||
printf(" NOW"); | printf(" NOW"); | ||||
} | } | ||||
if(d_val & 0x2) { | if(d_val & 0x2) { | ||||
d_val ^= 0x2; | d_val ^= 0x2; | ||||
printf(" GLOBAL"); | printf(" GLOBAL"); | ||||
} | } | ||||
if(d_val & 0x4) { | if(d_val & 0x4) { | ||||
▲ Show 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | #define REL_CT64 (uintmax_t)r.r_offset, (uintmax_t)r.r_info, \ | ||||
else { | else { | ||||
if (re->options & RE_WW) | if (re->options & RE_WW) | ||||
printf("%-16s %-16s %-24s %-16s %s\n", REL_HDR); | printf("%-16s %-16s %-24s %-16s %s\n", REL_HDR); | ||||
else | else | ||||
printf("%-12s %-12s %-19s %-16s %s\n", REL_HDR); | printf("%-12s %-12s %-19s %-16s %s\n", REL_HDR); | ||||
} | } | ||||
assert(d->d_size == s->sz); | assert(d->d_size == s->sz); | ||||
if (!get_ent_count(s, &len)) | if (!get_ent_count(s, &len)) | ||||
return; | return; | ||||
Done Inline ActionsWhy print "Flags:" for flags_1 and no prefix for flags above? emaste: Why print "Flags:" for flags_1 and no prefix for flags above? | |||||
Done Inline ActionsThat's the behavior in GNU readelf as seen in the bug report borako.ozarslan_gmail.com: That's the behavior in GNU readelf as seen in the bug report | |||||
for (i = 0; i < len; i++) { | for (i = 0; i < len; i++) { | ||||
if (gelf_getrel(d, i, &r) != &r) { | if (gelf_getrel(d, i, &r) != &r) { | ||||
warnx("gelf_getrel failed: %s", elf_errmsg(-1)); | warnx("gelf_getrel failed: %s", elf_errmsg(-1)); | ||||
continue; | continue; | ||||
} | } | ||||
symname = get_symbol_name(re, s->link, GELF_R_SYM(r.r_info)); | symname = get_symbol_name(re, s->link, GELF_R_SYM(r.r_info)); | ||||
symval = get_symbol_value(re, s->link, GELF_R_SYM(r.r_info)); | symval = get_symbol_value(re, s->link, GELF_R_SYM(r.r_info)); | ||||
if (re->ec == ELFCLASS32) { | if (re->ec == ELFCLASS32) { | ||||
▲ Show 20 Lines • Show All 4,560 Lines • Show Last 20 Lines |
should be in alpha order - i.e., before dump_dyn_val