[PATCH] D28045: [ELF] - Return file offset as address only for allocatable sections when building .gdb_index
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 23 00:02:37 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL290419: [ELF] - Return file offset as address only for allocatable sections when… (authored by grimar).
Changed prior to commit:
https://reviews.llvm.org/D28045?vs=82310&id=82398#toc
Repository:
rL LLVM
https://reviews.llvm.org/D28045
Files:
lld/trunk/ELF/GdbIndex.cpp
Index: lld/trunk/ELF/GdbIndex.cpp
===================================================================
--- lld/trunk/ELF/GdbIndex.cpp
+++ lld/trunk/ELF/GdbIndex.cpp
@@ -179,10 +179,15 @@
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>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28045.82398.patch
Type: text/x-patch
Size: 787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161223/0cfadeda/attachment.bin>
More information about the llvm-commits
mailing list