[PATCH] D49675: [cfi-verify] Detect more protected calls using cross-DSO.

Joel Galenson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 13:15:53 PDT 2018


jgalenson added a comment.

In https://reviews.llvm.org/D49675#1183229, @vlad.tsyrklevich wrote:

> Remind me, was there a reason why you wanted to use binary test inputs instead of assembling them?


The same reason as in https://reviews.llvm.org/D49383:

> Second, I don't know the best way of testing this.  I need correctly-linked files to populate the symbol table and PLT, but I don't think I can assume a linker, and llvm-mc doesn't seem to handle calls to undefined functions well.  So for now I just updated a binary with a valid PLT, but I'd much prefer to use .s and unit tests like the others.  Is there a good way to do that, or does this suffice?

As an aside, when I finish the rewrite suggested in https://reviews.llvm.org/D49383, I'm planning to merge this into that patch so that it adds proper support for cross-DSO mode.



================
Comment at: tools/llvm-cfi-verify/lib/FileAnalysis.cpp:448
 
+    // Avoid checking the PLT since it produces spurious failures on AArch64.
+    StringRef SectionName;
----------------
vlad.tsyrklevich wrote:
> Why?
AArch64 plt entries look like:

adrp
ldr x17
add
br x17

So of course they're unprotected indirect calls.

What I left off this comment is that this is only needed when using the -ignore-dwarf flag.  Without that, these entries are filtered out because they have no line information.  But when using that flag, something like this is very helpful at removing spurious failures.


https://reviews.llvm.org/D49675





More information about the llvm-commits mailing list