Use object file specific section type for initial text section
authorNico Rieck <nico.rieck@gmail.com>
Sun, 14 Apr 2013 21:18:36 +0000 (21:18 +0000)
committerNico Rieck <nico.rieck@gmail.com>
Sun, 14 Apr 2013 21:18:36 +0000 (21:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179494 91177308-0d34-0410-b5e6-96231b3b80d8

20 files changed:
lib/MC/MCAsmStreamer.cpp
lib/MC/MCPureStreamer.cpp
test/MC/Disassembler/Mips/mips32.txt
test/MC/Disassembler/Mips/mips32_le.txt
test/MC/Disassembler/Mips/mips32r2.txt
test/MC/Disassembler/Mips/mips32r2_le.txt
test/MC/Disassembler/Mips/mips64.txt
test/MC/Disassembler/Mips/mips64_le.txt
test/MC/Disassembler/Mips/mips64r2.txt
test/MC/Disassembler/Mips/mips64r2_le.txt
test/MC/Disassembler/XCore/xcore.txt
test/MC/Mips/mips-alu-instructions.s
test/MC/Mips/mips-expansions.s
test/MC/Mips/mips-fpu-instructions.s
test/MC/Mips/mips-jump-instructions.s
test/MC/Mips/mips-memory-instructions.s
test/MC/Mips/mips-relocations.s
test/MC/Mips/mips64-alu-instructions.s
test/MC/Mips/nabi-regs.s
test/MC/Mips/set-at-directive.s

index 35613b411c240e73380c6b37831a56921a44e5ff..b35a9de1fc14a4e21d24b92116062cfeb51a189d 100644 (file)
@@ -131,12 +131,7 @@ public:
   }
 
   virtual void InitToTextSection() {
-    // FIXME, this is MachO specific, but the testsuite
-    // expects this.
-    SwitchSection(getContext().getMachOSection(
-                                      "__TEXT", "__text",
-                                      MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
-                                      0, SectionKind::getText()));
+    SwitchSection(getContext().getObjectFileInfo()->getTextSection());
   }
 
   virtual void EmitLabel(MCSymbol *Symbol);
index 0e04c5537acb8b730764c734940c3016670950dc..c9779e037edc42d9c068171fc933a2464efa1db7 100644 (file)
@@ -12,9 +12,8 @@
 #include "llvm/MC/MCCodeEmitter.h"
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCExpr.h"
+#include "llvm/MC/MCObjectFileInfo.h"
 #include "llvm/MC/MCObjectStreamer.h"
-// FIXME: Remove this.
-#include "llvm/MC/MCSectionMachO.h"
 #include "llvm/MC/MCSymbol.h"
 #include "llvm/Support/ErrorHandling.h"
 
@@ -113,10 +112,7 @@ void MCPureStreamer::InitSections() {
 }
 
 void MCPureStreamer::InitToTextSection() {
-  // FIMXE: To what!?
-  SwitchSection(getContext().getMachOSection("__TEXT", "__text",
-                                    MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
-                                    0, SectionKind::getText()));
+  SwitchSection(getContext().getObjectFileInfo()->getTextSection());
 }
 
 void MCPureStreamer::EmitLabel(MCSymbol *Symbol) {
index 70224860bc7107bebccf493f194c544c57db37d7..ef8bf71bd3a6dd19f2be4400f6edf33a858ff93c 100644 (file)
@@ -1,5 +1,4 @@
 # RUN: llvm-mc --disassemble %s -triple=mips-unknown-linux | FileCheck %s
-# CHECK: .section        __TEXT,__text,regular,pure_instructions
 # CHECK: abs.d $f12, $f14
 0x46 0x20 0x73 0x05
 
index 48fa8e2c7fac10ce4b8aa50b63768990a213b0de..a0885a4bfe853bdefc492559b6a99a6c9522a1aa 100644 (file)
@@ -1,5 +1,4 @@
 # RUN: llvm-mc --disassemble %s -triple=mipsel-unknown-linux | FileCheck %s
-# CHECK: .section        __TEXT,__text,regular,pure_instructions
 # CHECK: abs.d $f12, $f14
 0x05 0x73 0x20 0x46
 
index 3b70db3bc29d1a2ea8161380037bd1f6b19040a4..991eaa6cc97fe3eddf6bfa4f592dd1de2eb85c60 100644 (file)
@@ -1,5 +1,4 @@
 # RUN: llvm-mc --disassemble %s -triple=mips-unknown-linux -mcpu=mips32r2 | FileCheck %s
-# CHECK: .section        __TEXT,__text,regular,pure_instructions
 # CHECK: abs.d $f12, $f14
 0x46 0x20 0x73 0x05
 
index ecfde7a39c4fb961198ce5de197b122ed0ab5aaa..10c293821c9dd22aae2e9f3ba816042ad9c84ed8 100644 (file)
@@ -1,5 +1,4 @@
 # RUN: llvm-mc --disassemble %s -triple=mipsel-unknown-linux -mcpu=mips32r2 | FileCheck %s
-# CHECK: .section        __TEXT,__text,regular,pure_instructions
 # CHECK: abs.d $f12, $f14
 0x05 0x73 0x20 0x46
 
index 38b137766125f00b13c371a16e82a83faa797cce..b88747370b67136a969b184cf429d4c97de17fa9 100644 (file)
@@ -1,5 +1,4 @@
 # RUN: llvm-mc --disassemble %s -triple=mips64-unknown-linux | FileCheck %s
-# CHECK: .section       __TEXT,__text,regular,pure_instructions
 # CHECK: daddiu $11, $26, 31949
 0x67 0x4b 0x7c 0xcd
 
index a7ef0e473bbe66729b3ad069d13ff7498303f649..ddc3c2b60be4269173983e00352909550595c450 100644 (file)
@@ -1,5 +1,4 @@
 # RUN: llvm-mc --disassemble %s -triple=mips64el-unknown-linux | FileCheck %s
-# CHECK: .section       __TEXT,__text,regular,pure_instructions
 # CHECK: daddiu $11, $26, 31949
 0xcd 0x7c 0x4b 0x67
 
index 0b421fc551e2a4ddb2fffa508f3a57c505df8184..cee6f3c21f721bcea2bd5e35b6f5500ab02efbfd 100644 (file)
@@ -1,5 +1,4 @@
 # RUN: llvm-mc --disassemble %s -triple=mips64-unknown-linux -mattr +mips64r2 | FileCheck %s
-# CHECK: .section       __TEXT,__text,regular,pure_instructions
 # CHECK: daddiu $11, $26, 31949
 0x67 0x4b 0x7c 0xcd
 
index c1d326f6d6749c9876695d11f426e03dad9f6737..82e4d6ae1ce0e575be5a98816802797b191aa096 100644 (file)
@@ -1,5 +1,4 @@
 # RUN: llvm-mc --disassemble %s -triple=mips64el-unknown-linux -mattr +mips64r2 | FileCheck %s
-# CHECK: .section       __TEXT,__text,regular,pure_instructions
 # CHECK: daddiu $11, $26, 31949
 0xcd 0x7c 0x4b 0x67
 
index 99e54e9857c56f2b1dd9aafdda312d9c40f1f676..d509aff7d386a34fc540d7a48d39dc6f02fc7293 100644 (file)
@@ -1,5 +1,4 @@
 # RUN: llvm-mc --disassemble %s -triple=xcore-xmos-elf | FileCheck %s
-# CHECK: .section        __TEXT,__text,regular,pure_instructions
 
 # 0r instructions
 
index 7384d19e440f4443341b9b4f866825a176c398c8..586e88bc481416b2715d46262051ce5563826a11 100644 (file)
@@ -1,7 +1,6 @@
 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | FileCheck %s
 # Check that the assembler can handle the documented syntax
 # for arithmetic and logical instructions.
-# CHECK: .section __TEXT,__text,regular,pure_instructions
 #------------------------------------------------------------------------------
 # Logical instructions
 #------------------------------------------------------------------------------
index 3385fe19309f7dde5ca428a17f0f82689b26a4cd..1622965a4139b8fe0ba8656499a8e200333b969b 100644 (file)
@@ -1,7 +1,6 @@
 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | FileCheck %s
 # Check that the assembler can handle the documented syntax
 # for macro instructions
-# CHECK: .section __TEXT,__text,regular,pure_instructions
 #------------------------------------------------------------------------------
 # Load immediate instructions
 #------------------------------------------------------------------------------
index a126c6f7188cd5128f9e65fd2d584111cc6dbab8..29dc471db105c9f5cf07d5fe3462f41ce0ae0a62 100644 (file)
@@ -1,7 +1,6 @@
 # RUN: llvm-mc  %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | FileCheck %s
 # Check that the assembler can handle the documented syntax
 # for FPU instructions.
-# CHECK: .section __TEXT,__text,regular,pure_instructions
 #------------------------------------------------------------------------------
 # FP aritmetic  instructions
 #------------------------------------------------------------------------------
index 1dcb287738ced24d7fad0d53f77ca437964c7330..3643c27bbbd8a7509c44a0e3e0a596d9da4bbeb4 100644 (file)
@@ -2,7 +2,6 @@
 # RUN: FileCheck %s
 # Check that the assembler can handle the documented syntax
 # for jumps and branches.
-# CHECK: .section __TEXT,__text,regular,pure_instructions
 #------------------------------------------------------------------------------
 # Branch instructions
 #------------------------------------------------------------------------------
index b5f1267ef386cb2e83f1d860bcfeac4f0d41b2c8..c8b055906ebbf0847e75921f69ac451164ff3ed1 100644 (file)
@@ -1,7 +1,6 @@
 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | FileCheck %s
 # Check that the assembler can handle the documented syntax
 # for loads and stores.
-# CHECK: .section __TEXT,__text,regular,pure_instructions
 #------------------------------------------------------------------------------
 # Memory store instructions
 #------------------------------------------------------------------------------
index ff71c7559cd019a357f85adae9d39880c0db3717..6f095d1ecdffe04328d19b68fffc84e9efb76375 100644 (file)
@@ -1,7 +1,6 @@
 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | FileCheck %s
 # Check that the assembler can handle the documented syntax
 # for relocations.
-# CHECK: .section __TEXT,__text,regular,pure_instructions
 # CHECK:  lui   $2, %hi(_gp_disp)     # encoding: [A,A,0x02,0x3c]
 # CHECK:                              #   fixup A - offset: 0, value: _gp_disp@ABS_HI, kind: fixup_Mips_HI16
 # CHECK:  addiu $2, $2, %lo(_gp_disp) # encoding: [A,A,0x42,0x24]
index 1b4ebdfbbd490665e14dd1f1b9944c3d234b48dd..04583f9ce6424f19dc07da5d3e7910e0e41fb4ba 100644 (file)
@@ -1,7 +1,6 @@
 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips64r2 | FileCheck %s
 # Check that the assembler can handle the documented syntax
 # for arithmetic and logical instructions.
-# CHECK: .section __TEXT,__text,regular,pure_instructions
 #------------------------------------------------------------------------------
 # Logical instructions
 #------------------------------------------------------------------------------
index 9371208a2a9e81d2c368e1fc4fbaa1d8d4bb236c..050fb8134880d5d1c14b3e0014eb547e9655951c 100644 (file)
@@ -8,7 +8,6 @@
 # RUN: -mcpu=mips64r2 -arch=mips64 | \
 # RUN: FileCheck %s
 
-# CHECK: .section    __TEXT,__text,regular,pure_instructions
     .text
 foo:
 
index 98a3a35b54280a42bcf9ea8bf91a01a4014d325d..828175a223a7fb93bfc0e5884f63394b1d26a217 100644 (file)
@@ -3,7 +3,6 @@
 # Check that the assembler can handle the documented syntax
 # for ".set at" and set the correct value.
 
-# CHECK: .section __TEXT,__text,regular,pure_instructions
     .text
 foo:
 # CHECK:   jr    $1                      # encoding: [0x08,0x00,0x20,0x00]