Workaround warning bug in old versions of gcc.
authorSterling Augustine <saugustine@google.com>
Wed, 18 Jul 2018 00:33:25 +0000 (00:33 +0000)
committerSterling Augustine <saugustine@google.com>
Wed, 18 Jul 2018 00:33:25 +0000 (00:33 +0000)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480

llvm-svn: 337340

lld/ELF/Arch/X86_64.cpp

index 63808bb..d4bdb37 100644 (file)
@@ -471,6 +471,10 @@ void X86_64<ELFT>::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<ELF32LE>::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