This makes it easier to debug those errors. See e.g. https://github.com/llvm/llvm-project/issues/52767#issuecomment-1028713943
We take the approach of 'reverse-engineering' the InputSection from the
output buffer offset. This provides for a cleaner Target API, and is
similar to LLD-ELF's implementation of getErrorPlace().
I'm not sure which way is better. Is there a reason why you didn't use pointer arithmetic here and elsewhere? I'm wondering if the current code performs a dereferencing + address of operations unnecessarily (or if that gets optimized out). It's not a big deal and either way is fine with me but I just wanted to ask.