Support __attribute__(section(<name>))

llvm-svn: 64380
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 7b939e2..7192e9d 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -259,6 +259,9 @@
     // should not be munged.
     GV->setName("\01" + ALA->getLabel());
   }
+
+  if (const SectionAttr *SA = D->getAttr<SectionAttr>())
+    GV->setSection(SA->getName());
 }
 
 void CodeGenModule::SetFunctionAttributes(const Decl *D,
@@ -653,6 +656,9 @@
     }
   }
 
+  if (const SectionAttr *SA = D->getAttr<SectionAttr>())
+    GV->setSection(SA->getName());
+
   // Emit global variable debug information.
   CGDebugInfo *DI = getDebugInfo();
   if(DI) {