[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 11 22:22:45 PDT 2019
xiangzhangllvm updated this revision to Diff 190206.
xiangzhangllvm added a comment.
- a/ELF/Driver.cpp
+++ b/ELF/Driver.cpp
@@ -72,8 +72,6 @@ LinkerDriver *elf::Driver;
static void setConfigs(opt::InputArgList &Args);
-#define ALIGN_UP(size, alignment) ((size) + (alignment) - 1)&(-(alignment))
bool elf::link(ArrayRef<const char *> Args, bool CanExitEarly,
raw_ostream &Error) {
errorHandler().LogName = args::getFilenameWithoutExe(Args[0]);
@@ -323,8 +321,7 @@ static void checkOptions() {
if (Config->ZRetpolineplt
&& (Config->AutoCET || Config->ForceCET))
- error("--auto-cet/--force-cet may not be used with -z retpolineplt, IBT can"
- " instead of retpolineplt");
+ error("--auto-cet/--force-cet may not be used with -z retpolineplt");
}
static const char *getReproduceOption(opt::InputArgList &Args) {
@@ -1600,7 +1597,7 @@ static bool findGNUPropertyX86Feature1AND(InputSectionBase *S,
do {
unsigned Size = Data[CurSecOffset + DescOffset + pr_dataszInDescIndex];
Size += CurSecOffset * 4 + DescOffset*4 + DescFixedSize;
- Size = ALIGN_UP (Size, S->Alignment);
+ Size = alignTo (Size, S->Alignment);
NextDescOffset = Size / 4 - CurSecOffset; //next DescOffset
Next_pr_typeIndex = CurSecOffset + NextDescOffset + pr_typeInDescIndex;
@@ -1624,7 +1621,7 @@ static bool findGNUPropertyX86Feature1AND(InputSectionBase *S,
CurSize += HeadSize + Size;
// Section and pr_data both have the align requestment: 8 in 64bit cpu
// and 4 in 32bit cpu.
- CurSize = ALIGN_UP (CurSize, S->Alignment);
+ CurSize = alignTo (CurSize, S->Alignment);
CurSecOffset = CurSize / 4;
}
return false;
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.190206.patch
Type: text/x-patch
Size: 46764 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190312/dfc7c215/attachment.bin>
More information about the llvm-commits
mailing list