]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
elfcopy: Clear errors after fetching the shstrtab index.
authormarkj <markj@FreeBSD.org>
Thu, 4 Jul 2019 15:07:19 +0000 (15:07 +0000)
committermarkj <markj@FreeBSD.org>
Thu, 4 Jul 2019 15:07:19 +0000 (15:07 +0000)
commitb6697ced849175f322f3be9d31cf8afb760f99e7
tree6c32c6dc160951b428b6e0f7f12bd7575797ac52
parent3f7167a6b6bb8758e79adc656b2267c5f0e61bbb
elfcopy: Clear errors after fetching the shstrtab index.

Otherwise a future call to elf_errno() will return a non-zero value.
update_shdr(), for example, treats any errors associated with the ELF
descriptor as fatal.  Clear the error per the first example in
elf_errmsg.3.

Convert to elf_getshdrstrndx() while here since elf_getshstrndx() is
apparently deprecated.

Reported by: royger
Reviewed by: emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20852
contrib/elftoolchain/elfcopy/sections.c