<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">diff --strip-trailing-cr -rupN llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp llvm.patched/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
--- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp	2015-06-30 20:10:31.000000000 +0100
+++ llvm.patched/lib/CodeGen/TargetLoweringObjectFileImpl.cpp	2015-09-02 15:51:06.177611340 +0100
@@ -222,18 +222,20 @@ MCSection *TargetLoweringObjectFileELF::
 /// Return the section prefix name used by options FunctionsSections and
 /// DataSections.
 static StringRef getSectionPrefixForGlobal(SectionKind Kind) {
+  extern const char *bssName, *textName, *dataName, *rodataName;
+
   if (Kind.isText())
-    return ".text";
+    return textName;
   if (Kind.isReadOnly())
-    return ".rodata";
+    return rodataName;
   if (Kind.isBSS())
-    return ".bss";
+    return bssName;
   if (Kind.isThreadData())
     return ".tdata";
   if (Kind.isThreadBSS())
     return ".tbss";
   if (Kind.isDataNoRel())
-    return ".data";
+    return dataName;
   if (Kind.isDataRelLocal())
     return ".data.rel.local";
   if (Kind.isDataRel())
diff --strip-trailing-cr -rupN llvm/lib/MC/MCObjectFileInfo.cpp llvm.patched/lib/MC/MCObjectFileInfo.cpp
--- llvm/lib/MC/MCObjectFileInfo.cpp	2015-06-25 01:28:42.000000000 +0100
+++ llvm.patched/lib/MC/MCObjectFileInfo.cpp	2015-09-02 12:14:52.744510538 +0100
@@ -244,6 +244,11 @@ void MCObjectFileInfo::initMachOMCObject
   TLSExtraDataSection = TLSTLVSection;
 }
 
+const char *bssName = ".bss";
+const char *textName = ".text";
+const char *dataName = ".data";
+const char *rodataName = ".rodata";
+
 void MCObjectFileInfo::initELFMCObjectFileInfo(Triple T) {
   switch (T.getArch()) {
   case Triple::mips:
@@ -404,17 +409,17 @@ void MCObjectFileInfo::initELFMCObjectFi
 
 
   // ELF
-  BSSSection = Ctx-&gt;getELFSection(".bss", ELF::SHT_NOBITS,
+  BSSSection = Ctx-&gt;getELFSection(bssName, ELF::SHT_NOBITS,
                                   ELF::SHF_WRITE | ELF::SHF_ALLOC);
 
-  TextSection = Ctx-&gt;getELFSection(".text", ELF::SHT_PROGBITS,
+  TextSection = Ctx-&gt;getELFSection(textName, ELF::SHT_PROGBITS,
                                    ELF::SHF_EXECINSTR | ELF::SHF_ALLOC);
 
-  DataSection = Ctx-&gt;getELFSection(".data", ELF::SHT_PROGBITS,
+  DataSection = Ctx-&gt;getELFSection(dataName, ELF::SHT_PROGBITS,
                                    ELF::SHF_WRITE | ELF::SHF_ALLOC);
 
   ReadOnlySection =
-      Ctx-&gt;getELFSection(".rodata", ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
+      Ctx-&gt;getELFSection(rodataName, ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
 
   TLSDataSection =
       Ctx-&gt;getELFSection(".tdata", ELF::SHT_PROGBITS,
diff --strip-trailing-cr -rupN llvm/tools/clang/include/clang/Driver/CC1Options.td llvm.patched/tools/clang/include/clang/Driver/CC1Options.td
--- llvm/tools/clang/include/clang/Driver/CC1Options.td	2015-07-17 21:25:46.000000000 +0100
+++ llvm.patched/tools/clang/include/clang/Driver/CC1Options.td	2015-09-03 09:19:22.466531315 +0100
@@ -649,6 +649,19 @@ def fcuda_disable_target_call_checks : F
 def fcuda_include_gpubinary : Separate&lt;["-"], "fcuda-include-gpubinary"&gt;,
   HelpText&lt;"Incorporate CUDA device-side binary into host object file."&gt;;
 
+//===----------------------------------------------------------------------===//
+// Section Naming Options
+//===----------------------------------------------------------------------===//
+
+def mbss_EQ : Joined&lt;["-"], "mbss="&gt;, 
+  HelpText&lt;"name the .bss section"&gt;;
+def mdata_EQ : Joined&lt;["-"], "mdata="&gt;, 
+  HelpText&lt;"name the .data section"&gt;;
+def mrodata_EQ : Joined&lt;["-"], "mrodata="&gt;, 
+  HelpText&lt;"name the .rodata section"&gt;;
+def mtext_EQ : Joined&lt;["-"], "mtext="&gt;, 
+  HelpText&lt;"name the .text section"&gt;;
+
 } // let Flags = [CC1Option]
 
 
diff --strip-trailing-cr -rupN llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp llvm.patched/tools/clang/lib/Frontend/CompilerInvocation.cpp
--- llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp	2015-07-30 23:47:41.000000000 +0100
+++ llvm.patched/tools/clang/lib/Frontend/CompilerInvocation.cpp	2015-09-02 13:35:58.104313101 +0100
@@ -131,6 +131,11 @@ static void addDiagnosticArgs(ArgList &amp;A
   }
 }
 
+extern const char *bssName;
+extern const char *textName;
+extern const char *dataName;
+extern const char *rodataName;
+
 static bool ParseAnalyzerArgs(AnalyzerOptions &amp;Opts, ArgList &amp;Args,
                               DiagnosticsEngine &amp;Diags) {
   using namespace options;
@@ -632,6 +637,19 @@ static bool ParseCodeGenArgs(CodeGenOpti
   Opts.DependentLibraries = Args.getAllArgValues(OPT_dependent_lib);
   bool NeedLocTracking = false;
 
+  if (Arg *A = Args.getLastArg(OPT_mbss_EQ)) {
+    bssName = A-&gt;getValue();
+  }
+  if (Arg *A = Args.getLastArg(OPT_mdata_EQ)) {
+    dataName = A-&gt;getValue();
+  }
+  if (Arg *A = Args.getLastArg(OPT_mrodata_EQ)) {
+    rodataName = A-&gt;getValue();
+  }
+  if (Arg *A = Args.getLastArg(OPT_mtext_EQ)) {
+    textName = A-&gt;getValue();
+  }
+
   if (Arg *A = Args.getLastArg(OPT_Rpass_EQ)) {
     Opts.OptimizationRemarkPattern =
         GenerateOptimizationRemarkRegex(Diags, Args, A);
</pre></body></html>