]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
elfcopy: Clear errors after fetching the shstrtab index.
authorMark Johnston <markj@FreeBSD.org>
Thu, 4 Jul 2019 15:07:19 +0000 (15:07 +0000)
committerMark Johnston <markj@FreeBSD.org>
Thu, 4 Jul 2019 15:07:19 +0000 (15:07 +0000)
commit0070b575f47d9fa116f7c4367faed3e1b5f88555
tree6c32c6dc160951b428b6e0f7f12bd7575797ac52
parent3b53f994ea89486d859e6bb4144b19e07ea77cea
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