#!/usr/bin/env sh set -eu nm=${RISCV_NM:-riscv64-unknown-elf-nm} readelf=${RISCV_READELF:-riscv64-unknown-elf-readelf} elf=build/task01_scheduler/prog.elf if "$nm" --defined-only "$elf" | awk '{print $3}' | grep -Eq '^_Z|^__cxa_|^_Unwind_'; then echo "unexpected C++ or unwind symbol in the C teaching ELF" >&2 exit 1 fi if "$readelf" -S "$elf" | grep -Eq '\.init_array|\.eh_frame|\.gcc_except_table'; then echo "unexpected C++ initialization or unwind section in $elf" >&2 "$readelf" -S "$elf" >&2 exit 1 fi for symbol in peer_task_entry high_probe_task_entry verifier_task_entry \ vApplicationTickHook task01_scheduler_checkpoint \ task01_scheduler_checkpoint_committed task01_tick_checkpoint_committed \ xTaskCreate vTaskPrioritySet uxTaskPriorityGet vTaskDelete; do if ! "$nm" --defined-only "$elf" | grep -Eq "[[:space:]]${symbol}$"; then echo "required C/FreeRTOS symbol is missing: $symbol" >&2 exit 1 fi done echo "PASS ABI: freestanding C11 scheduler experiment, no C++ runtime"