+2021-02-17 Timm Bäder <tbaeder@redhat.com>
+
+ * unstrip.c (find_alloc_sections_prelink): Move check_match to...
+ (check_match): Adjusted to return whether there was no match,
+ which indicates a failure. So callers are adjusted to or the
+ result into a local fail boolean.
+
2021-02-17 Timm Bäder <tbaeder@redhat.com>
* unstrip.c (adjust_relocs): Move adjust_reloc function to...
return sig;
}
+static inline bool
+check_match (bool match, Elf_Scn *scn, const char *name)
+{
+ if (!match)
+ {
+ error (0, 0, _("cannot find matching section for [%zu] '%s'"),
+ elf_ndxscn (scn), name);
+ return true;
+ }
+
+ return false;
+}
+
+
/* Fix things up when prelink has moved some allocated sections around
and the debuginfo file's section headers no longer match up.
This fills in SECTIONS[0..NALLOC-1].outscn or exits.
}
bool fail = false;
- inline void check_match (bool match, Elf_Scn *scn, const char *name)
- {
- if (!match)
- {
- fail = true;
- error (0, 0, _("cannot find matching section for [%zu] '%s'"),
- elf_ndxscn (scn), name);
- }
- }
-
Elf_Scn *scn = NULL;
while ((scn = elf_nextscn (debug, scn)) != NULL)
{
for (size_t i = 0; shdr != NULL && i < nalloc; ++i)
if (sections[i].outscn == scn)
shdr = NULL;
- check_match (shdr == NULL, scn, name);
+ fail |= check_match (shdr == NULL, scn, name);
}
if (fail)
}
}
- check_match (undo_sec == NULL, scn, name);
+ fail |= check_match (undo_sec == NULL, scn, name);
}
free (undo_sections);