HomeFreeBSD

elfcopy: Use elf_getscn() instead of iterating over all sections.

Description

elfcopy: Use elf_getscn() instead of iterating over all sections.

When removing a section, we would loop over all sections looking for
a corresponding relocation section. With r348652 it is much faster
to just use elf_getscn().

PR: 234949
Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20471

Details