diff --git a/src/kdumpfile/notes.c b/src/kdumpfile/notes.c index 6de992ff..61e810f2 100644 --- a/src/kdumpfile/notes.c +++ b/src/kdumpfile/notes.c @@ -348,6 +348,9 @@ do_noarch_note(kdump_ctx_t *ctx, Elf32_Word type, else if (note_equal("VMCOREINFO_XEN", name, namesz)) return set_blob_attr(ctx, GKI_xen_vmcoreinfo_raw, desc, descsz, "VMCOREINFO_XEN"); + else if (note_equal("ERASEINFO", name, namesz)) + return set_blob_attr(ctx, GKI_file_eraseinfo_raw, + desc, descsz, "ERASEINFO"); return KDUMP_OK; } diff --git a/tests/Makefile.am b/tests/Makefile.am index 4535518c..177e6da2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -211,6 +211,7 @@ test_scripts = \ elf-empty-s390 \ elf-empty-s390x \ elf-empty-x86_64 \ + elf-eraseinfo \ elf-prstatus-aarch64 \ elf-prstatus-arm \ elf-prstatus-i386 \ @@ -332,6 +333,7 @@ dist_check_DATA = \ early-version-code.data \ early-version-code.expect \ elf-empty.data \ + elf-eraseinfo.data \ elf-prstatus-aarch64.data \ elf-prstatus-arm.data \ elf-prstatus-i386.data \ diff --git a/tests/elf-eraseinfo b/tests/elf-eraseinfo new file mode 100755 index 00000000..7e2de06c --- /dev/null +++ b/tests/elf-eraseinfo @@ -0,0 +1,35 @@ +#! /bin/sh + +mkdir -p out || exit 99 + +name=$( basename "$0" ) +datafile="$srcdir/${name}.data" +dumpfile="out/${name}.dump" +resultfile="out/${name}.result" +expectfile="$srcdir/${name}.expect" + +./mkelf "$dumpfile" <&2 + exit $rc +fi +echo "Created ELF dump: $dumpfile" + +./checkattr "$dumpfile" <&2 + exit $rc +fi diff --git a/tests/elf-eraseinfo.data b/tests/elf-eraseinfo.data new file mode 100644 index 00000000..bf1118af --- /dev/null +++ b/tests/elf-eraseinfo.data @@ -0,0 +1,6 @@ +@phdr type=NOTE offset=0x1800 +0000000a 00000016 00000000 "ERASEINFO" 00*3 +"erase modules size 16\n" 00*2 + +@phdr type=LOAD offset=0x9000 paddr=0x3000000 vaddr=0xffff880003000000 memsz=0x1000 +41 42 43 44 45 46 47 48