[lld] r232865 - [ELF][X86_64] Use anonymous namespace only for class declarations

Shankar Easwaran shankare at codeaurora.org
Fri Mar 20 16:47:01 PDT 2015


Author: shankare
Date: Fri Mar 20 18:47:01 2015
New Revision: 232865

URL: http://llvm.org/viewvc/llvm-project?rev=232865&view=rev
Log:
[ELF][X86_64] Use anonymous namespace only for class declarations

Modified:
    lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp

Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp?rev=232865&r1=232864&r2=232865&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp Fri Mar 20 18:47:01 2015
@@ -30,22 +30,21 @@ using namespace lld;
 using namespace lld::elf;
 using namespace llvm::ELF;
 
-namespace {
 // .got values
-const uint8_t x86_64GotAtomContent[8] = { 0 };
+static const uint8_t x86_64GotAtomContent[8] = {0};
 
 // .plt value (entry 0)
-const uint8_t x86_64Plt0AtomContent[16] = {
-  0xff, 0x35, 0x00, 0x00, 0x00, 0x00, // pushq GOT+8(%rip)
-  0xff, 0x25, 0x00, 0x00, 0x00, 0x00, // jmp *GOT+16(%rip)
-  0x90, 0x90, 0x90, 0x90              // nopnopnop
+static const uint8_t x86_64Plt0AtomContent[16] = {
+    0xff, 0x35, 0x00, 0x00, 0x00, 0x00, // pushq GOT+8(%rip)
+    0xff, 0x25, 0x00, 0x00, 0x00, 0x00, // jmp *GOT+16(%rip)
+    0x90, 0x90, 0x90, 0x90              // nopnopnop
 };
 
 // .plt values (other entries)
-const uint8_t x86_64PltAtomContent[16] = {
-  0xff, 0x25, 0x00, 0x00, 0x00, 0x00, // jmpq *gotatom(%rip)
-  0x68, 0x00, 0x00, 0x00, 0x00,       // pushq reloc-index
-  0xe9, 0x00, 0x00, 0x00, 0x00        // jmpq plt[-1]
+static const uint8_t x86_64PltAtomContent[16] = {
+    0xff, 0x25, 0x00, 0x00, 0x00, 0x00, // jmpq *gotatom(%rip)
+    0x68, 0x00, 0x00, 0x00, 0x00,       // pushq reloc-index
+    0xe9, 0x00, 0x00, 0x00, 0x00        // jmpq plt[-1]
 };
 
 // TLS GD Entry
@@ -54,6 +53,7 @@ static const uint8_t x86_64GotTlsGdAtomC
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
+namespace {
 /// \brief Atoms that are used by X86_64 dynamic linking
 class X86_64GOTAtom : public GOTAtom {
 public:





More information about the llvm-commits mailing list