Modify InputSectionBase::getLocation to add section and offset to every loc.
authorSean Fertile <sfertile@ca.ibm.com>
Thu, 10 Jan 2019 15:08:06 +0000 (15:08 +0000)
committerSean Fertile <sfertile@ca.ibm.com>
Thu, 10 Jan 2019 15:08:06 +0000 (15:08 +0000)
commit3ca494b2eeeede1502cc000fe7818ca2db1461c6
tree960f1eccb64d26c8a4ee3b531cdaf55c6fac7d7f
parent461725b58500a63585ce4dc5aa97ce2b6b17a33f
Modify InputSectionBase::getLocation to add section and offset to every loc.

The section and offset can be very helpful in diagnosing certian errors.
For example on a relocation overflow or misalignment diagnostic:

test.c:(function  foo): relocation R_PPC64_ADDR16_DS out of range: ...

The function foo can have many R_PPC64_ADDR16_DS relocations. Adding the offset
and section will identify exactly which relocation is causing the failure.

Differential Revision: https://reviews.llvm.org/D56453

llvm-svn: 350828
lld/ELF/InputSection.cpp
lld/test/ELF/ppc64-split-stack-adjust-overflow.s
lld/test/ELF/x86-64-reloc-error2.s
lld/test/ELF/x86-64-reloc-range-debug-loc.s