The pintable loading code is in elf_read_pintable() in sys/kern/exec_elf.c
Here we can see that pretty much anything that doesn't strictly meet the criteria will be rejected with a goto bad and npins set to zero. Overly large .openbsd.syscalls sections are rejected, and a single entry with an index for a syscall beyond the highest present in the kernel, (SYS_MAXSYSCALL), will cause the entire pintable to be rejected.
At this point reading the kernel code, it's interesting to note that a duplicate entry for the same syscall number causes the parser to store the magic value -1 as the address offset which then allows that specific syscall to be called from anywhere, (just like the ‘old days’).
Knowing this not only makes the * 2 multiplier in the size checking code above more useful, but also shows us a way to avoid strict syscall pinning in our assembly coding if we wanted to.
Of course, the dynamic linker has to parse pintables in a similar way, and that code can be found in src/libexec/ld.so/resolve.c.
Back in the kernel, the actual checking of the pintable at runtime when a syscall opcode is encountered is done in pin_check() in sys/sys/syscall_mi.h.