logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0005-Allow-empty-Elf_Data.patch (696B)


  1. From fe335f0f01aabe08df740092306ecc107ff5d96d Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Mon, 28 Jun 2021 18:23:22 -0700
  4. Subject: [PATCH] Allow empty Elf_Data
  5. ---
  6. libelf/elf_update.c | 3 +++
  7. 1 file changed, 3 insertions(+)
  8. diff --git a/libelf/elf_update.c b/libelf/elf_update.c
  9. index 3e19b78a..62f64fc1 100644
  10. --- a/libelf/elf_update.c
  11. +++ b/libelf/elf_update.c
  12. @@ -815,6 +815,9 @@ _libelf_write_scn(Elf *e, unsigned char *nf, struct _Elf_Extent *ex)
  13. LIBELF_PRIVATE(fillchar),
  14. (size_t) (sh_off + d->d_off - (uint64_t) rc));
  15. + if (d->d_size == 0)
  16. + continue;
  17. +
  18. rc = (off_t) (sh_off + d->d_off);
  19. assert(d->d_buf != NULL);
  20. --
  21. 2.32.0