[llvm] r206610 - ARM64: don't emit .subsections_via_symbols on ELF.

Tim Northover tnorthover at apple.com
Fri Apr 18 07:54:41 PDT 2014


Author: tnorthover
Date: Fri Apr 18 09:54:41 2014
New Revision: 206610

URL: http://llvm.org/viewvc/llvm-project?rev=206610&view=rev
Log:
ARM64: don't emit .subsections_via_symbols on ELF.

Part of PR19455.

Added:
    llvm/trunk/test/CodeGen/ARM64/subsections.ll
Modified:
    llvm/trunk/lib/Target/ARM64/ARM64AsmPrinter.cpp

Modified: llvm/trunk/lib/Target/ARM64/ARM64AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM64/ARM64AsmPrinter.cpp?rev=206610&r1=206609&r2=206610&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM64/ARM64AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM64/ARM64AsmPrinter.cpp Fri Apr 18 09:54:41 2014
@@ -120,13 +120,15 @@ private:
 //===----------------------------------------------------------------------===//
 
 void ARM64AsmPrinter::EmitEndOfAsmFile(Module &M) {
-  // Funny Darwin hack: This flag tells the linker that no global symbols
-  // contain code that falls through to other global symbols (e.g. the obvious
-  // implementation of multiple entry points).  If this doesn't occur, the
-  // linker can safely perform dead code stripping.  Since LLVM never
-  // generates code that does this, it is always safe to set.
-  OutStreamer.EmitAssemblerFlag(MCAF_SubsectionsViaSymbols);
-  SM.serializeToStackMapSection();
+  if (Subtarget->isTargetMachO()) {
+    // Funny Darwin hack: This flag tells the linker that no global symbols
+    // contain code that falls through to other global symbols (e.g. the obvious
+    // implementation of multiple entry points).  If this doesn't occur, the
+    // linker can safely perform dead code stripping.  Since LLVM never
+    // generates code that does this, it is always safe to set.
+    OutStreamer.EmitAssemblerFlag(MCAF_SubsectionsViaSymbols);
+    SM.serializeToStackMapSection();
+  }
 
   // Emit a .data.rel section containing any stubs that were created.
   if (Subtarget->isTargetELF()) {

Added: llvm/trunk/test/CodeGen/ARM64/subsections.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM64/subsections.ll?rev=206610&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM64/subsections.ll (added)
+++ llvm/trunk/test/CodeGen/ARM64/subsections.ll Fri Apr 18 09:54:41 2014
@@ -0,0 +1,5 @@
+; RUN: llc -mtriple=arm64-apple-ios7.0 -o - %s | FileCheck %s --check-prefix=CHECK-MACHO
+; RUN: llc -mtriple=arm64-linux-gnu -o - %s | FileCheck %s --check-prefix=CHECK-ELF
+
+; CHECK-MACHO: .subsections_via_symbols
+; CHECK-ELF-NOT: .subsections_via_symbols
\ No newline at end of file





More information about the llvm-commits mailing list