gelf_update_symshndx updates the symbol table data and (if given) the
extended section index data. But only the symbol table section was
marked as dirty. Also mark the extended section index section dirty if
the index data is updated.
* libelf/gelf_update_symshndx.c (gelf_update_symshndx):
Mark shndx section dirty.
Signed-off-by: Mark Wielaard <[email protected]>
---
libelf/gelf_update_symshndx.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/libelf/gelf_update_symshndx.c b/libelf/gelf_update_symshndx.c
index eb80afacba74..14f424184383 100644
--- a/libelf/gelf_update_symshndx.c
+++ b/libelf/gelf_update_symshndx.c
@@ -131,7 +131,13 @@ gelf_update_symshndx (Elf_Data *symdata, Elf_Data
*shndxdata, int ndx,
/* Now we can store the section index. */
if (shndx != NULL)
- *shndx = srcshndx;
+ {
+ *shndx = srcshndx;
+
+ /* Mark the section as modified. */
+ Elf_Scn *shndx_scn = shndxdata_scn->s;
+ shndx_scn->flags |= ELF_F_DIRTY;
+ }
result = 1;
--
2.56.0