-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ELF dumps store ERASEINFO in an ELF note. Interestingly, this note is not part of the other notes saved in compressed makedumpfile format v4+, so this new code does not supersede file-format-specific eraseinfo parsing. Signed-off-by: Petr Tesarik <[email protected]>
- Loading branch information
Showing
4 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" <<EOF | ||
ei_class = 2 | ||
ei_data = 1 | ||
e_machine = 62 | ||
e_phoff = 0x1000 | ||
DATA = $datafile | ||
EOF | ||
rc=$? | ||
if [ $rc -ne 0 ]; then | ||
echo "Cannot create ELF file" >&2 | ||
exit $rc | ||
fi | ||
echo "Created ELF dump: $dumpfile" | ||
|
||
./checkattr "$dumpfile" <<EOF | ||
file.set.number = number: 1 | ||
file.format = string: elf | ||
file.eraseinfo.raw = blob:6572617365206d6f64756c65732073697a652031360a | ||
EOF | ||
rc=$? | ||
if [ $rc -ne 0 ]; then | ||
echo "Attribute check failed" >&2 | ||
exit $rc | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |