[PATCH] D75342: [obj2yaml] - Teach tool to dump program headers.
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 12 10:51:20 PDT 2020
MaskRay added inline comments.
================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:194
+ auto SortPred = [](const ELFYAML::Section *A, const ELFYAML::Section *B) {
+ uint64_t AddressA = A->Address ? (uint64_t)*A->Address : 0;
+ uint64_t AddressB = B->Address ? (uint64_t)*B->Address : 0;
----------------
getValueOr
================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:216
+ while (It != WorkList.end()) {
+ ELFYAML::Section *Sec = *It++;
+ if (isInSegment<ELFT>(*Sec, Phdr))
----------------
`for (; It != WorkList.end() && isInSegment<ELFT>(**It, Phdr); ++It)`
The code checks VMA while isInSegment checks file offsets. It seems strange.
I think a pure O(n^2) algorithm is fine. llvm-objcopy/ELF/Object.cpp is O(n^2).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75342/new/
https://reviews.llvm.org/D75342
More information about the llvm-commits
mailing list