feat: add lab-rv32i-freertos-heap-models card
This commit is contained in:
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
nm=${RISCV_NM:-riscv64-unknown-elf-nm}
|
||||
readelf=${RISCV_READELF:-riscv64-unknown-elf-readelf}
|
||||
elf=build/task01_heap_models/prog.elf
|
||||
heap_object=build/common/cpp_heap.o
|
||||
|
||||
if "$nm" -C -u "$elf" | grep -Eq '__cxa_|_Unwind_|std::|libstdc\+\+'; then
|
||||
echo "unexpected hosted C++ runtime dependency in $elf" >&2
|
||||
"$nm" -C -u "$elf" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if "$nm" -C --defined-only "$elf" | grep -Eq \
|
||||
'vtable for|typeinfo for|typeinfo name for'; then
|
||||
echo "unexpected virtual dispatch or RTTI metadata in $elf" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if "$readelf" -S "$elf" | grep -Eq \
|
||||
'\.init_array|\.eh_frame|\.gcc_except_table'; then
|
||||
echo "unexpected initializer, exception, or unwind section in $elf" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for symbol in \
|
||||
'operator new(unsigned int)' \
|
||||
'operator new[](unsigned int)' \
|
||||
'operator delete(void*)' \
|
||||
'operator delete[](void*)' \
|
||||
'operator delete(void*, unsigned int)' \
|
||||
'operator delete[](void*, unsigned int)'
|
||||
do
|
||||
if ! "$nm" -C --defined-only "$heap_object" | grep -Fq "$symbol"; then
|
||||
echo "missing allocation function: $symbol" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
for symbol in heap_models_debug_checkpoint g_fragmented_stats g_final_stats
|
||||
do
|
||||
if ! "$nm" --defined-only "$elf" | grep -Fq "$symbol"; then
|
||||
echo "missing debugger evidence symbol: $symbol" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "PASS ABI: complete new/delete bridge and zero hosted C++ runtime"
|
||||
|
||||
Reference in New Issue
Block a user