$ gcc -g -O0 -nostdlib main.c ident.S $ valgrind ./a.out ==17819== Memcheck, a memory error detector ==17819== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==17819== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info ==17819== Command: ./a.out ==17819== ==17819== ==17819== HEAP SUMMARY: ==17819== in use at exit: 0 bytes in 0 blocks ==17819== total heap usage: 0 allocs, 0 frees, 0 bytes allocated ==17819== ==17819== All heap blocks were freed -- no leaks are possible ==17819== ==17819== For counts of detected and suppressed errors, rerun with: -v ==17819== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) $ cat main.c ident.S int _start(int argc, char **argv) { int a[10]; // a[argc + 20] = 0; // toast // a[argc + 21] = 0; // toast __asm__ __volatile__( "movq $1, %rax\n" // SYS_exit "syscall\n"); } .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