What we eventually tracked down was that an overflow had occurred. We
don't have an obvious maximum size for DWARF-2 location lists - so
we record the end of .debug_loc as their size, to prevent running into
uninitialized memory. I stored the size in an unsigned short. If
.debug_loc is >64k, then this will be truncated, and we may decide we
hit the end at an unfortunate moment.
The size is stored between two pointers in the baton already, wasting
space. So there's no point being overly clever here; just make it an
unsigned long and our problems go away.