[PATCH] D75342: [obj2yaml] - Teach tool to dump program headers.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 13 05:06:53 PDT 2020
grimar added inline comments.
================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:216
+ while (It != WorkList.end()) {
+ ELFYAML::Section *Sec = *It++;
+ if (isInSegment<ELFT>(*Sec, Phdr))
----------------
MaskRay wrote:
> `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).
>
I think you are right. It is easier to use O(n*m) here, since the number of segments is not that large anyways.
Done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75342/new/
https://reviews.llvm.org/D75342
More information about the llvm-commits
mailing list