Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 32bbb27

Browse files
committed
[ELF] Print the .type assembly directive correctly for STT_NOTYPE
The llvm assembly parser and gas both accept "@noType" in the .type assembly directive, but we were printing it as "@no_type", which isn't accepted by either assembler. Differential revision: https://reviews.llvm.org/D43116 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324731 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 2e6bdcc commit 32bbb27

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

lib/MC/MCAsmStreamer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ bool MCAsmStreamer::EmitSymbolAttribute(MCSymbol *Symbol,
565565
case MCSA_ELF_TypeObject: OS << "object"; break;
566566
case MCSA_ELF_TypeTLS: OS << "tls_object"; break;
567567
case MCSA_ELF_TypeCommon: OS << "common"; break;
568-
case MCSA_ELF_TypeNoType: OS << "no_type"; break;
568+
case MCSA_ELF_TypeNoType: OS << "notype"; break;
569569
case MCSA_ELF_TypeGnuUniqueObject: OS << "gnu_unique_object"; break;
570570
}
571571
EmitEOL();

test/MC/ARM/type-directive-print.ll

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; RUN: llc < %s -mtriple=armv7a | FileCheck %s
2+
3+
module asm ".type test_notype, %notype"
4+
module asm ".type test_function, %function"
5+
module asm ".type test_object, %object"
6+
module asm ".type test_common, %common"
7+
module asm ".type test_tls_object, %tls_object"
8+
module asm ".type test_gnu_indirect_function, %gnu_indirect_function"
9+
module asm ".type test_gnu_unique_object, %gnu_unique_object"
10+
11+
; CHECK: .type test_notype,%notype
12+
; CHECK: .type test_function,%function
13+
; CHECK: .type test_object,%object
14+
; CHECK: .type test_common,%common
15+
; CHECK: .type test_tls_object,%tls_object
16+
; CHECK: .type test_gnu_indirect_function,%gnu_indirect_function
17+
; CHECK: .type test_gnu_unique_object,%gnu_unique_object

0 commit comments

Comments
 (0)