[PATCH] D79013: [llvm-readelf] - Do not crash when the PT_INTERP has an invalid offset.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 02:11:05 PDT 2020


jhenderson accepted this revision.
jhenderson added a comment.

LGTM, with one remaining request.



================
Comment at: llvm/test/tools/llvm-readobj/ELF/gnu-phdrs.test:322
+# ERROR-INTERP:      Type           Offset
+# ERROR-INTERP-NEXT: INTERP         0x000[[#%x,OFFSET:0x000230]]
+# ERROR-INTERP-NEXT:     [Requesting program interpreter: C]
----------------
I believe you don't want the leading 0x000 bit, and then you also won't need the %x either. I believe FileCheck will automatically recognise it as hex that way (as things stand, I think it might not, but can't remember the details). If you want ot be sure that it is hex though, you can keep the %x (and might need it in the lines below too to be sure its always hex, but I'm not sure - experimentation needed). FWIW, I don't think it being hex is a necessary check for this specific case, since we check it earlier.


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

https://reviews.llvm.org/D79013





More information about the llvm-commits mailing list