aboutsummaryrefslogtreecommitdiff
path: root/src/nm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nm.c')
-rw-r--r--src/nm.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/nm.c b/src/nm.c
index b7c2aed6..f6ca3b0a 100644
--- a/src/nm.c
+++ b/src/nm.c
@@ -1510,8 +1510,17 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
GElf_Ehdr *ehdr;
Ebl *ebl;
+ /* Create the full name of the file. */
+ if (prefix != NULL)
+ cp = mempcpy (cp, prefix, prefix_len);
+ cp = mempcpy (cp, fname, fname_len);
+ if (suffix != NULL)
+ memcpy (cp - 1, suffix, suffix_len + 1);
+
/* Get the backend for this object file type. */
ebl = ebl_openbackend (elf);
+ if (ebl == NULL)
+ INTERNAL_ERROR (fullname);
/* We need the ELF header in a few places. */
ehdr = gelf_getehdr (elf, &ehdr_mem);
@@ -1530,13 +1539,6 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
goto out;
}
- /* Create the full name of the file. */
- if (prefix != NULL)
- cp = mempcpy (cp, prefix, prefix_len);
- cp = mempcpy (cp, fname, fname_len);
- if (suffix != NULL)
- memcpy (cp - 1, suffix, suffix_len + 1);
-
/* Find the symbol table.
XXX Can there be more than one? Do we print all? Currently we do. */