[lld] r263707 - Avoid using braces. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 04:00:28 PDT 2016


Author: grimar
Date: Thu Mar 17 06:00:27 2016
New Revision: 263707

URL: http://llvm.org/viewvc/llvm-project?rev=263707&view=rev
Log:
Avoid using braces. NFC.

Modified:
    lld/trunk/ELF/Driver.cpp

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=263707&r1=263706&r2=263707&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Thu Mar 17 06:00:27 2016
@@ -351,30 +351,27 @@ template <class ELFT> void LinkerDriver:
 
   Config->Rela = ELFT::Is64Bits;
 
+  // Add entry symbol.
+  // There is no entry symbol for AMDGPU binaries, so skip adding one to avoid
+  // having and undefined symbol.
   if (Config->Entry.empty() && !Config->Shared && !Config->Relocatable &&
-      Config->EMachine != EM_AMDGPU) {
-    // Add entry symbol.
-    //
-    // There is no entry symbol for AMDGPU binaries, so skip adding one to avoid
-    // having and undefined symbol.
+      Config->EMachine != EM_AMDGPU)
     Config->Entry = Config->EMachine == EM_MIPS ? "__start" : "_start";
-  }
 
-  if (!Config->Relocatable) {
-    // In the assembly for 32 bit x86 the _GLOBAL_OFFSET_TABLE_ symbol
-    // is magical and is used to produce a R_386_GOTPC relocation.
-    // The R_386_GOTPC relocation value doesn't actually depend on the
-    // symbol value, so it could use an index of STN_UNDEF which, according
-    // to the spec, means the symbol value is 0.
-    // Unfortunately both gas and MC keep the _GLOBAL_OFFSET_TABLE_ symbol in
-    // the object file.
-    // The situation is even stranger on x86_64 where the assembly doesn't
-    // need the magical symbol, but gas still puts _GLOBAL_OFFSET_TABLE_ as
-    // an undefined symbol in the .o files.
-    // Given that the symbol is effectively unused, we just create a dummy
-    // hidden one to avoid the undefined symbol error.
+  // In the assembly for 32 bit x86 the _GLOBAL_OFFSET_TABLE_ symbol
+  // is magical and is used to produce a R_386_GOTPC relocation.
+  // The R_386_GOTPC relocation value doesn't actually depend on the
+  // symbol value, so it could use an index of STN_UNDEF which, according
+  // to the spec, means the symbol value is 0.
+  // Unfortunately both gas and MC keep the _GLOBAL_OFFSET_TABLE_ symbol in
+  // the object file.
+  // The situation is even stranger on x86_64 where the assembly doesn't
+  // need the magical symbol, but gas still puts _GLOBAL_OFFSET_TABLE_ as
+  // an undefined symbol in the .o files.
+  // Given that the symbol is effectively unused, we just create a dummy
+  // hidden one to avoid the undefined symbol error.
+  if (!Config->Relocatable)
     Symtab.addIgnored("_GLOBAL_OFFSET_TABLE_");
-  }
 
   if (!Config->Entry.empty()) {
     // Set either EntryAddr (if S is a number) or EntrySym (otherwise).




More information about the llvm-commits mailing list