Lines 316-321
static const char *p_flags[] = {
Link Here
|
316 |
"PF_X|PF_W|PF_R" |
316 |
"PF_X|PF_W|PF_R" |
317 |
}; |
317 |
}; |
318 |
|
318 |
|
|
|
319 |
static const char *nt_types[] = { |
320 |
"", "NT_FREEBSD_ABI_TAG", "NT_FREEBSD_NOINIT_TAG", "NT_FREEBSD_ARCH_TAG" |
321 |
}; |
322 |
|
319 |
/* http://www.sco.com/developers/gabi/latest/ch4.sheader.html#sh_type */ |
323 |
/* http://www.sco.com/developers/gabi/latest/ch4.sheader.html#sh_type */ |
320 |
static const char * |
324 |
static const char * |
321 |
sh_types(uint64_t machine, uint64_t sht) { |
325 |
sh_types(uint64_t machine, uint64_t sht) { |
Lines 659-665
main(int ac, char **av)
Link Here
|
659 |
case SHT_NOTE: |
663 |
case SHT_NOTE: |
660 |
name = elf_get_word(e, v, SH_NAME); |
664 |
name = elf_get_word(e, v, SH_NAME); |
661 |
if (flags & ED_NOTE && |
665 |
if (flags & ED_NOTE && |
662 |
strcmp(shstrtab + name, ".note.tag") == 0) |
666 |
(strcmp(shstrtab + name, ".note.tag") == 0 || |
|
|
667 |
strcmp(shstrtab + name, ".note.ABI-tag") == 0)) |
663 |
elf_print_note(e, v); |
668 |
elf_print_note(e, v); |
664 |
break; |
669 |
break; |
665 |
case SHT_DYNSYM: |
670 |
case SHT_DYNSYM: |
Lines 1052-1070
elf_print_note(Elf32_Ehdr *e, void *sh)
Link Here
|
1052 |
u_int32_t namesz; |
1057 |
u_int32_t namesz; |
1053 |
u_int32_t descsz; |
1058 |
u_int32_t descsz; |
1054 |
u_int32_t desc; |
1059 |
u_int32_t desc; |
|
|
1060 |
u_int32_t type; |
1055 |
char *n, *s; |
1061 |
char *n, *s; |
|
|
1062 |
const char *nt_type; |
1056 |
|
1063 |
|
1057 |
offset = elf_get_off(e, sh, SH_OFFSET); |
1064 |
offset = elf_get_off(e, sh, SH_OFFSET); |
1058 |
size = elf_get_size(e, sh, SH_SIZE); |
1065 |
size = elf_get_size(e, sh, SH_SIZE); |
1059 |
name = elf_get_word(e, sh, SH_NAME); |
1066 |
name = elf_get_word(e, sh, SH_NAME); |
1060 |
n = (char *)e + offset; |
1067 |
n = (char *)e + offset; |
1061 |
fprintf(out, "\nnote (%s):\n", shstrtab + name); |
1068 |
fprintf(out, "\nnote (%s):\n", shstrtab + name); |
1062 |
while (n < ((char *)e + offset + size)) { |
1069 |
while (n < ((char *)e + offset + size)) { |
1063 |
namesz = elf_get_word(e, n, N_NAMESZ); |
1070 |
namesz = elf_get_word(e, n, N_NAMESZ); |
1064 |
descsz = elf_get_word(e, n, N_DESCSZ); |
1071 |
descsz = elf_get_word(e, n, N_DESCSZ); |
1065 |
s = n + sizeof(Elf_Note); |
1072 |
type = elf_get_word(e, n, N_TYPE); |
1066 |
desc = elf_get_word(e, n + sizeof(Elf_Note) + namesz, 0); |
1073 |
nt_type = nt_types[type]; |
1067 |
fprintf(out, "\t%s %d\n", s, desc); |
1074 |
if (type < NT_FREEBSD_ABI_TAG || type > NT_FREEBSD_ARCH_TAG) |
|
|
1075 |
nt_type = "Unknown type"; |
1076 |
s = n + sizeof(Elf_Note); |
1077 |
desc = elf_get_word(e, n + sizeof(Elf_Note) + namesz, 0); |
1078 |
fprintf(out, "\t%s %d (%s)\n", s, desc, nt_type); |
1068 |
n += sizeof(Elf_Note) + namesz + descsz; |
1079 |
n += sizeof(Elf_Note) + namesz + descsz; |
1069 |
} |
1080 |
} |
1070 |
} |
1081 |
} |
1071 |
- |
|
|