mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-13 13:45:16 +00:00
[ELF] - Return file offset as address only for allocatable sections when building .gdb_index
This fixes issue revealed by r289961. Differential revision: https://reviews.llvm.org/D28045 llvm-svn: 290419
This commit is contained in:
parent
0791d5f5aa
commit
58f84a01a3
@ -179,10 +179,15 @@ GdbIndexBuilder<ELFT>::readAddressArea(size_t CurrentCU) {
|
||||
return Ret;
|
||||
}
|
||||
|
||||
// We return file offset as load address for allocatable sections. That is
|
||||
// currently used for collecting address ranges in readAddressArea(). We are
|
||||
// able then to find section index that range belongs to.
|
||||
template <class ELFT>
|
||||
uint64_t GdbIndexBuilder<ELFT>::getSectionLoadAddress(
|
||||
const object::SectionRef &Sec) const {
|
||||
return static_cast<const ELFSectionRef &>(Sec).getOffset();
|
||||
if (static_cast<const ELFSectionRef &>(Sec).getFlags() & ELF::SHF_ALLOC)
|
||||
return static_cast<const ELFSectionRef &>(Sec).getOffset();
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
|
Loading…
x
Reference in New Issue
Block a user