summaryrefslogtreecommitdiffstats
path: root/src/readelf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/readelf.c')
-rw-r--r--src/readelf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/readelf.c b/src/readelf.c
index f243f626..e0352443 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -601,7 +601,6 @@ process_elf_file (Dwfl_Module *dwflmod, int fd)
if (ehdr->e_type == ET_REL && print_unrelocated)
{
/* Read the file afresh. */
- pure_elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
off64_t aroff = elf_getaroff (elf);
if (aroff > 0)
{
@@ -611,6 +610,8 @@ process_elf_file (Dwfl_Module *dwflmod, int fd)
elf_end (pure_elf);
pure_elf = armem;
}
+ else
+ pure_elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
if (pure_elf == NULL)
goto elf_error;
pure_ebl = ebl_openbackend (pure_elf);