From: Sterling Augustine Date: Wed, 18 Jul 2018 00:33:25 +0000 (+0000) Subject: Workaround warning bug in old versions of gcc. X-Git-Tag: llvmorg-7.0.0-rc1~1190 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2526104ee472d4f5c21e4b519d7a04a19d76821b;p=platform%2Fupstream%2Fllvm.git Workaround warning bug in old versions of gcc. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 llvm-svn: 337340 --- diff --git a/lld/ELF/Arch/X86_64.cpp b/lld/ELF/Arch/X86_64.cpp index 63808bb..d4bdb37 100644 --- a/lld/ELF/Arch/X86_64.cpp +++ b/lld/ELF/Arch/X86_64.cpp @@ -471,6 +471,10 @@ void X86_64::relaxGot(uint8_t *Loc, uint64_t Val) const { write32le(Loc - 1, Val + 1); } +// This anonymous namespace works around a warning bug in +// old versions of gcc. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 +namespace { + // A split-stack prologue starts by checking the amount of stack remaining // in one of two ways: // A) Comparing of the stack pointer to a field in the tcb. @@ -505,6 +509,8 @@ bool X86_64::adjustPrologueForCrossSplitStack(uint8_t *Loc, llvm_unreachable("Target doesn't support split stacks."); } +} // namespace + // These nonstandard PLT entries are to migtigate Spectre v2 security // vulnerability. In order to mitigate Spectre v2, we want to avoid indirect // branch instructions such as `jmp *GOTPLT(%rip)`. So, in the following PLT