diff options
author | Ali Bahrami <Ali.Bahrami@Sun.COM> | 2009-06-18 13:16:39 -0600 |
---|---|---|
committer | Ali Bahrami <Ali.Bahrami@Sun.COM> | 2009-06-18 13:16:39 -0600 |
commit | 62b628a68db596a2d75a316dc7ffef658079231f (patch) | |
tree | 6d2f7ab582d82b5c1ab5f0214cc4e92b9cc2e2b7 /usr/src/lib/libproc/common/Psymtab.c | |
parent | 60c682e1f62d3c131ea9130c21e0ccd86044e039 (diff) | |
download | illumos-joyent-62b628a68db596a2d75a316dc7ffef658079231f.tar.gz |
6851224 elf_getshnum() and elf_getshstrndx() incompatible with 2002 ELF gABI agreement
PSARC/2009/363 replace elf_getphnum, elf_getshnum, and elf_getshstrndx
Diffstat (limited to 'usr/src/lib/libproc/common/Psymtab.c')
-rw-r--r-- | usr/src/lib/libproc/common/Psymtab.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usr/src/lib/libproc/common/Psymtab.c b/usr/src/lib/libproc/common/Psymtab.c index 7c05653eeb..725a765798 100644 --- a/usr/src/lib/libproc/common/Psymtab.c +++ b/usr/src/lib/libproc/common/Psymtab.c @@ -1664,8 +1664,8 @@ Pbuild_file_symtab(struct ps_prochandle *P, file_info_t *fptr) if ((elf = fake_elf(P, fptr)) == NULL || elf_kind(elf) != ELF_K_ELF || gelf_getehdr(elf, &ehdr) == NULL || - elf_getshnum(elf, &nshdrs) == 0 || - elf_getshstrndx(elf, &shstrndx) == 0 || + elf_getshdrnum(elf, &nshdrs) == -1 || + elf_getshdrstrndx(elf, &shstrndx) == -1 || (scn = elf_getscn(elf, shstrndx)) == NULL || (shdata = elf_getdata(scn, NULL)) == NULL) { dprintf("failed to fake up ELF file\n"); @@ -1675,8 +1675,8 @@ Pbuild_file_symtab(struct ps_prochandle *P, file_info_t *fptr) } else if ((elf = elf_begin(fptr->file_fd, ELF_C_READ, NULL)) == NULL || elf_kind(elf) != ELF_K_ELF || gelf_getehdr(elf, &ehdr) == NULL || - elf_getshnum(elf, &nshdrs) == 0 || - elf_getshstrndx(elf, &shstrndx) == 0 || + elf_getshdrnum(elf, &nshdrs) == -1 || + elf_getshdrstrndx(elf, &shstrndx) == -1 || (scn = elf_getscn(elf, shstrndx)) == NULL || (shdata = elf_getdata(scn, NULL)) == NULL) { int err = elf_errno(); @@ -1687,8 +1687,8 @@ Pbuild_file_symtab(struct ps_prochandle *P, file_info_t *fptr) if ((elf = fake_elf(P, fptr)) == NULL || elf_kind(elf) != ELF_K_ELF || gelf_getehdr(elf, &ehdr) == NULL || - elf_getshnum(elf, &nshdrs) == 0 || - elf_getshstrndx(elf, &shstrndx) == 0 || + elf_getshdrnum(elf, &nshdrs) == -1 || + elf_getshdrstrndx(elf, &shstrndx) == -1 || (scn = elf_getscn(elf, shstrndx)) == NULL || (shdata = elf_getdata(scn, NULL)) == NULL) { dprintf("failed to fake up ELF file\n"); @@ -1712,8 +1712,8 @@ Pbuild_file_symtab(struct ps_prochandle *P, file_info_t *fptr) if ((newelf = fake_elf(P, fptr)) == NULL || elf_kind(newelf) != ELF_K_ELF || gelf_getehdr(newelf, &ehdr) == NULL || - elf_getshnum(newelf, &nshdrs) == 0 || - elf_getshstrndx(newelf, &shstrndx) == 0 || + elf_getshdrnum(newelf, &nshdrs) == -1 || + elf_getshdrstrndx(newelf, &shstrndx) == -1 || (scn = elf_getscn(newelf, shstrndx)) == NULL || (shdata = elf_getdata(scn, NULL)) == NULL) { dprintf("failed to fake up ELF file\n"); @@ -2757,7 +2757,7 @@ static int Psymbol_iter_com(struct ps_prochandle *P, Lmid_t lmid, const char *object_name, int which, int mask, pr_order_t order, proc_xsym_f *func, void *cd) { -#if STT_NUM != (STT_IFUNC + 1) +#if STT_NUM != (STT_TLS + 1) #error "STT_NUM has grown. update Psymbol_iter_com()" #endif @@ -2845,7 +2845,7 @@ Psymbol_iter_com(struct ps_prochandle *P, Lmid_t lmid, const char *object_name, * maintain binary compatibility, so I think this is * reasonably fair game. */ - if (s_bind < STB_NUM && s_type < STT_IFUNC) { + if (s_bind < STB_NUM && s_type < STT_NUM) { type = (1 << (s_type + 8)) | (1 << s_bind); if ((type & ~mask) != 0) continue; |