commit: 34fe5a08b5e12287a71c6391df9357187ab78d24
parent e3612f2e1bda2aca3e85a299b01395024b23172c
Author: Michael Forney <mforney@mforney.org>
Date: Mon, 28 Jun 2021 18:31:40 -0700
elftoolchain: Allow empty Elf_Data
This fixes objtool in linux 5.13.
Diffstat:
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/pkg/elftoolchain/patch/0005-Allow-empty-Elf_Data.patch b/pkg/elftoolchain/patch/0005-Allow-empty-Elf_Data.patch
@@ -0,0 +1,26 @@
+From fe335f0f01aabe08df740092306ecc107ff5d96d Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Mon, 28 Jun 2021 18:23:22 -0700
+Subject: [PATCH] Allow empty Elf_Data
+
+---
+ libelf/elf_update.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/libelf/elf_update.c b/libelf/elf_update.c
+index 3e19b78a..62f64fc1 100644
+--- a/libelf/elf_update.c
++++ b/libelf/elf_update.c
+@@ -815,6 +815,9 @@ _libelf_write_scn(Elf *e, unsigned char *nf, struct _Elf_Extent *ex)
+ LIBELF_PRIVATE(fillchar),
+ (size_t) (sh_off + d->d_off - (uint64_t) rc));
+
++ if (d->d_size == 0)
++ continue;
++
+ rc = (off_t) (sh_off + d->d_off);
+
+ assert(d->d_buf != NULL);
+--
+2.32.0
+
diff --git a/pkg/elftoolchain/ver b/pkg/elftoolchain/ver
@@ -1 +1 @@
-ce6d62aaba r0
+ce6d62aaba r1