There might be other sections or segments with ELF Notes that are
readable. Also adjust error message depending on whether or not we
actually got any data for the ELF Note segment or section.
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2017-12-18 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error.
+ Adjust error message depending on whether or not we got data.
+
2017-12-07 Mark Wielaard <mark@klomp.org>
* readelf.c (print_ops): Update data pointer and print arguments
return;
bad_note:
- error (EXIT_FAILURE, 0,
- gettext ("cannot get content of note section: %s"),
- elf_errmsg (-1));
+ error (0, 0,
+ gettext ("cannot get content of note: %s"),
+ data != NULL ? "garbage data" : elf_errmsg (-1));
}
static void