summaryrefslogtreecommitdiff
path: root/tools/mips-relocs.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-07-11 10:18:13 -0400
committerTom Rini <trini@konsulko.com>2022-07-11 14:58:57 -0400
commit36b661dc919da318c163a45f4a220d2e3d9db608 (patch)
tree268703050f58280feb3287d48eb0cedc974730e1 /tools/mips-relocs.c
parente092e3250270a1016c877da7bdd9384f14b1321e (diff)
parent05a4859637567b13219efd6f1707fb236648b1b7 (diff)
Merge branch 'next'
Diffstat (limited to 'tools/mips-relocs.c')
-rw-r--r--tools/mips-relocs.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/mips-relocs.c b/tools/mips-relocs.c
index 625258085b6..5db610f5c77 100644
--- a/tools/mips-relocs.c
+++ b/tools/mips-relocs.c
@@ -312,7 +312,7 @@ int main(int argc, char *argv[])
goto out_free_relocs;
}
- rel_pfx = is_64 ? ".rela." : ".rel.";
+ rel_pfx = is_64 ? ".rela" : ".rel";
for (i = 0; i < ehdr_field(e_shnum); i++) {
sh_type = shdr_field(i, sh_type);
@@ -321,10 +321,11 @@ int main(int argc, char *argv[])
sh_name = shstr(shdr_field(i, sh_name));
if (strncmp(sh_name, rel_pfx, strlen(rel_pfx))) {
- if (strcmp(sh_name, ".rel") && strcmp(sh_name, ".rel.dyn"))
- fprintf(stderr, "WARNING: Unexpected reloc section name '%s'\n", sh_name);
+ fprintf(stderr, "WARNING: Unexpected reloc section name '%s'\n", sh_name);
continue;
}
+ if (!strcmp(sh_name, ".rel") || !strcmp(sh_name, ".rel.dyn"))
+ continue;
/*
* Skip reloc sections which either don't correspond to another
@@ -334,7 +335,7 @@ int main(int argc, char *argv[])
*/
skip = true;
for (j = 0; j < ehdr_field(e_shnum); j++) {
- if (strcmp(&sh_name[strlen(rel_pfx) - 1], shstr(shdr_field(j, sh_name))))
+ if (strcmp(&sh_name[strlen(rel_pfx)], shstr(shdr_field(j, sh_name))))
continue;
skip = !(shdr_field(j, sh_flags) & SHF_ALLOC);