summaryrefslogtreecommitdiffstats
path: root/src/unstrip.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2018-07-21 23:40:11 +0200
committerMark Wielaard <[email protected]>2018-07-27 14:09:21 +0200
commit98ec9737922faef025ab10de15b9a653f46eaf53 (patch)
tree5f5d88241827a49de5b48096089d660f63e9ddd6 /src/unstrip.c
parented62996defc619d0def86a5ed223a48486b97a70 (diff)
unstrip: Handle SHT_GROUP sections in ET_REL files.
SHT_GROUP sections are put in both the stripped and debug file. Handle correcting the symbol table/name entry of the group only once. The testfile was generated with the gcc annobin plugin. Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'src/unstrip.c')
-rw-r--r--src/unstrip.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/unstrip.c b/src/unstrip.c
index 057efef3..cb1f7dc0 100644
--- a/src/unstrip.c
+++ b/src/unstrip.c
@@ -563,7 +563,11 @@ adjust_all_relocs (Elf *elf, Elf_Scn *symtab, const GElf_Shdr *symshdr,
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
- if (shdr->sh_type != SHT_NOBITS && shdr->sh_link == new_sh_link)
+ /* Don't redo SHT_GROUP, groups are in both the stripped and debug,
+ it will already have been done by adjust_relocs for the
+ stripped_symtab. */
+ if (shdr->sh_type != SHT_NOBITS && shdr->sh_type != SHT_GROUP
+ && shdr->sh_link == new_sh_link)
adjust_relocs (scn, scn, shdr, map, symshdr);
}
}