$ gcc -g -O0 -nostdlib main.c ident.S $ valgrind ./a.out ==1147== Memcheck, a memory error detector ==1147== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==1147== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info ==1147== Command: ./a.out ==1147== ==1147== Invalid write of size 4 ==1147== at 0x400113: ??? ==1147== Address 0x7fb0039e0 is not stack'd, malloc'd or (recently) free'd ==1147== Illegal instruction (core dumped) $ cat main.c int _start(int argc, char **argv) { int a[10]; a[argc + 20] = 0; // toast } $ cat ident.S .section ".note.netbsd.ident", "a", @note .long 2f-1f .long 4f-3f .long 1 1: .asciz "NetBSD" 2: .p2align 2 3: .long 700000001 4: .p2align 2