[PATCH] D59780: Support Intel Control-flow Enforcement Technology
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 31 22:12:41 PDT 2019
MaskRay added inline comments.
================
Comment at: lld/ELF/InputFiles.cpp:594
+// If a source file is compiled with x86 hardware-assisted call flow control
+// enabled, the generated object file contains feature flags indicating that
----------------
ruiu wrote:
> xiangzhangllvm wrote:
> > ruiu wrote:
> > > MaskRay wrote:
> > > > ruiu wrote:
> > > > > MaskRay wrote:
> > > > > > call flow control -> Control-Flow Enforcement ?
> > > > > This is a general name and not specific to the Intel's implementation.
> > > > My concern here is that llvm-objdump/GNU objdump and other tools/profilers would have to recognize two section names `.plt.sec` and `.splt`. Many tools use the section name to do special things, e.g.
> > > > @hjl.tools If the ABI can be changed to not deliberately differ from the implementation (or the other way round), it'd be great.
> > > >
> > > > binutils/objdump.c:739
> > > >
> > > > ```
> > > > static bfd_boolean
> > > > is_significant_symbol_name (const char * name)
> > > > {
> > > > return strncmp (name, ".plt", 4) == 0 || strcmp (name, ".got") == 0;
> > > > }
> > > > ```
> > > I'm not sure if I follow. Currently, in my patch, I use ".splt" and ".plt" as PLT section names, which I think as defined by the ABI. Are you saying that ".plt.sec" might be a correct name?
> > The SPEC not fix the plt's name, It full name is Second IBT-enabled PLT,
> > GCC name it as plt.sec. I name it splt for short at first.
> > It may be better to have the same name with GCC.
> >
> Ok, the I'll just follow the others. Is there anything other than this you invented a nonstandard stuff for this patch?
> I'm not sure if I follow. Currently, in my patch, I use ".splt" and ".plt" as PLT section names, which I think as defined by the ABI. Are you saying that ".plt.sec" might be a correct name?
Sorry for not being clear. PLT sections do not have a dedicated section type and in practice they are usually recognized by the name `.plt`. My example above gave one case. If ld.bfd uses `.plt.sec` while we use `.splt`, the tools (objdump/llvm-mc/profiler/...) would have to understand the two names. The complexity could have been avoided if the linkers and the ABI agreed on the same name, say, `.plt.sec`.
I prefer `.plt.sec` to `.splt` because the same-prefix convention is already used in several other places to have fine-grained section types.
Thus, I suggest, if there is no strong reason to keep using `.splt` in the ABI, change it to what the implementations do: `.plt.sec`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59780/new/
https://reviews.llvm.org/D59780
More information about the llvm-commits
mailing list