version 1.9, 2017/09/19 08:28:57 |
version 1.10, 2017/09/26 09:40:28 |
|
|
int elf_getshstab(const char *, size_t, const char **, size_t *); |
int elf_getshstab(const char *, size_t, const char **, size_t *); |
ssize_t elf_getsymtab(const char *, const char *, size_t, |
ssize_t elf_getsymtab(const char *, const char *, size_t, |
const Elf_Sym **, size_t *); |
const Elf_Sym **, size_t *); |
ssize_t elf_getsection(char *, const char *, const char *, |
ssize_t elf_getsection(char *, size_t, const char *, const char *, |
size_t, const char **, size_t *); |
size_t, const char **, size_t *); |
|
|
/* parse.c */ |
/* parse.c */ |
|
|
warnx("symbol table not found"); |
warnx("symbol table not found"); |
|
|
/* Find string table location and size. */ |
/* Find string table location and size. */ |
if (elf_getsection(p, ELF_STRTAB, shstab, shstabsz, &strtab, |
if (elf_getsection(p, filesize, ELF_STRTAB, shstab, shstabsz, &strtab, |
&strtabsz) == -1) |
&strtabsz) == -1) |
warnx("string table not found"); |
warnx("string table not found"); |
|
|
/* Find abbreviation location and size. */ |
/* Find abbreviation location and size. */ |
if (elf_getsection(p, DEBUG_ABBREV, shstab, shstabsz, &abbuf, |
if (elf_getsection(p, filesize, DEBUG_ABBREV, shstab, shstabsz, &abbuf, |
&ablen) == -1) { |
&ablen) == -1) { |
warnx("%s section not found", DEBUG_ABBREV); |
warnx("%s section not found", DEBUG_ABBREV); |
return 1; |
return 1; |
} |
} |
|
|
if (elf_getsection(p, DEBUG_INFO, shstab, shstabsz, &infobuf, |
if (elf_getsection(p, filesize, DEBUG_INFO, shstab, shstabsz, &infobuf, |
&infolen) == -1) { |
&infolen) == -1) { |
warnx("%s section not found", DEBUG_INFO); |
warnx("%s section not found", DEBUG_INFO); |
return 1; |
return 1; |
} |
} |
|
|
/* Find string table location and size. */ |
/* Find string table location and size. */ |
if (elf_getsection(p, DEBUG_STR, shstab, shstabsz, &dstrbuf, |
if (elf_getsection(p, filesize, DEBUG_STR, shstab, shstabsz, &dstrbuf, |
&dstrlen) == -1) |
&dstrlen) == -1) |
warnx("%s section not found", DEBUG_STR); |
warnx("%s section not found", DEBUG_STR); |
|
|