[PATCH] D58102: Support X86 Control-flow Enforcement Technology (CET) in LLD

Xiang Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 01:36:13 PDT 2019


xiangzhangllvm updated this revision to Diff 191057.
xiangzhangllvm added a comment.

hi dears,
I updated the patch: most of changes refer to peter and ruiu's suggestions, but not of all.
The main change is:

1. Read all input files, then collect the CET features, and discard the .note.gnu.property sections, do these in SyntheticSections.cpp not in Driver.cpp.
2. If CET features checked successful, then create the SyntheticSection's sections (GnuPropertySection, SPltSection) in Writer's createSyntheticSections().

instead of directly creating .note.gnu.property section in Writer.

3. Adjust the test cases to remove redundant code check.

deficiencies:

1. I tend to collect the CET features in GnuPropertySection (SyntheticSection) class or in Writer->run like combineEhFrameSections(), but I found it should first get the CET features,

then decide to create the GnuPropertySection or not (SPltSection too).

2. I didn't remove the Config->X86Feature1AND, because I need it to tell the createSyntheticSections() to create the GnuPropertySection or not (SPltSection too).


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D58102

Files:
  ELF/Arch/X86.cpp
  ELF/Arch/X86_64.cpp
  ELF/Config.h
  ELF/Driver.cpp
  ELF/Driver.h
  ELF/InputSection.cpp
  ELF/Options.td
  ELF/Relocations.cpp
  ELF/Symbols.cpp
  ELF/Symbols.h
  ELF/SyntheticSections.cpp
  ELF/SyntheticSections.h
  ELF/Target.h
  ELF/Writer.cpp
  docs/ld.lld.1
  test/ELF/Inputs/i386-feature-1-and0.s
  test/ELF/Inputs/i386-feature-1-and1.s
  test/ELF/Inputs/i386-feature-1-and1x.s
  test/ELF/Inputs/i386-feature-1-and2.s
  test/ELF/Inputs/i386-feature-1-and2s.s
  test/ELF/Inputs/x86-64-feature-1-and0.s
  test/ELF/Inputs/x86-64-feature-1-and1.s
  test/ELF/Inputs/x86-64-feature-1-and1x.s
  test/ELF/Inputs/x86-64-feature-1-and2.s
  test/ELF/Inputs/x86-64-feature-1-and2s.s
  test/ELF/i386-feature-1-and.s
  test/ELF/x86-64-feature-1-and.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58102.191057.patch
Type: text/x-patch
Size: 45766 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190318/8fd5e446/attachment.bin>


More information about the llvm-commits mailing list