musllvm

A pure LLVM/Clang cross compiler toolchain targeting musl C
git clone git://git.daat.foo/musllvm.git
Log | Files | Refs | README | LICENSE

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 ---
      7  libelf/elf_update.c | 3 +++
      8  1 file changed, 3 insertions(+)
      9 
     10 diff --git a/libelf/elf_update.c b/libelf/elf_update.c
     11 index 3e19b78a..62f64fc1 100644
     12 --- a/libelf/elf_update.c
     13 +++ b/libelf/elf_update.c
     14 @@ -815,6 +815,9 @@ _libelf_write_scn(Elf *e, unsigned char *nf, struct _Elf_Extent *ex)
     15  			    LIBELF_PRIVATE(fillchar),
     16  			    (size_t) (sh_off + d->d_off - (uint64_t) rc));
     17  
     18 +		if (d->d_size == 0)
     19 +			continue;
     20 +
     21  		rc = (off_t) (sh_off + d->d_off);
     22  
     23  		assert(d->d_buf != NULL);
     24 -- 
     25 2.32.0
     26