[PATCH] D80380: [llvm-readobj] - Do not crash when an invalid .eh_frame_hdr is dumped using --unwind.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 02:39:56 PDT 2020


grimar marked an inline comment as done.
grimar added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/unwind.test:327
+
+## Case D: test we report an error when the memory size differs from the file size for the PT_GNU_EH_FRAME header.
+# RUN: yaml2obj --docnum=5 %s -o %t11
----------------
jhenderson wrote:
> Perhaps you should just keep Case D in a separate patch, and improve the error text at the same time. It's not really related to the rest of the changes you are making, I think. Anyway, why is this an error at all? I'm not convinced it's really anything to do with dumping. It might be some sort of validation error if we had something equivalent to llvm-dwarfdump --verify, but I'm not convinced it belongs in llvm-readelf as things stand.
> Anyway, why is this an error at all? 

It was introduced in D43313.
I guess it was just a some kind of sanity check. Having `Phdr.p_memsz` != `Phdr.p_filesz` probably means something is wrong with the header (e.g a bss section was included?). Perhaps we should just convert it to warning and use `p_filesz` when trying to `printEHFrameHdr()`.

I'll remove "case D" and investigate it separatelly.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80380/new/

https://reviews.llvm.org/D80380





More information about the llvm-commits mailing list