Created attachment 182064 [details] Patch to fix the problem The libelf library in base doesn't reload section headers after clearing them when performing an elf_update with ELF_C_WRITE. This is because it fails to clear a flag indicating that the section headers have been loaded. This is fixed with the attached patch.
Review for fix: https://reviews.freebsd.org/D10486
A commit references this bug: Author: emaste Date: Wed Aug 1 15:55:15 UTC 2018 New revision: 337045 URL: https://svnweb.freebsd.org/changeset/base/337045 Log: libelf: reload section headers after update with ELF_C_WRITE These issues (PR 218860 and PR 218861) are still undergoing additional discussion in the upstream context and there may be additional changes to come. PR: 218860 Submitted by: Eric McCorkle MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10486 Changes: head/contrib/elftoolchain/libelf/elf_update.c
A commit references this bug: Author: emaste Date: Fri Aug 31 17:29:25 UTC 2018 New revision: 338411 URL: https://svnweb.freebsd.org/changeset/base/338411 Log: MFC r337045: libelf: reload section headers after update with ELF_C_WRITE These issues (PR 218860 and PR 218861) are still undergoing additional discussion in the upstream context and there may be additional changes to come. PR: 218860 Submitted by: Eric McCorkle Sponsored by: The FreeBSD Foundation (MFC) Changes: _U stable/11/ stable/11/contrib/elftoolchain/libelf/elf_update.c