[PATCH] D49383: [cfi-verify] Add an option to treat calls to a specified function as traps.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 24 17:38:49 PDT 2018


eugenis added a comment.

--emit-relocs will generate a relocation at the call site, the same kind you find in object files.



================
Comment at: tools/llvm-cfi-verify/lib/FileAnalysis.cpp:580
+        StringRef Str;
+        return !Section.getName(Str) && Str == ".rela.plt";
+      });
----------------
jgalenson wrote:
> eugenis wrote:
> > .rela.plt can be found by DT_JMPREL entry in dynamic section.
> > 
> > It's very uncommon, but the section table can be stripped from the binary.
> Okay, I'll look into using the ELF::DT_JMPREL flag instead of this.  There's no way to do something like that to find the PLT sections, is there?
> 
> If the section table is stripped, this code will fail to find the section and fail, so at least we don't get incorrect results.
On a second thought, I would not worry about executables w/o a section table, especially since there is no reliable way to find .plt there.


Repository:
  rL LLVM

https://reviews.llvm.org/D49383





More information about the llvm-commits mailing list