This is the more correct location. The targets/cortex-m.s file is really just for qemu, not for Cortex-M in general.
This is very useful for debugging. It differentiates between a stack overflow and other errors (because it's easy to see when a stack overflow occurs) and prints the old stack pointer and program counter if available.