• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -h -s -r -t | FileCheck %s
2
3        .text
4	.globl	main
5	.align	16, 0x90
6	.type	main,@function
7main:                                   # @main
8# BB#0:
9	subq	$8, %rsp
10	movl	$.L.str1, %edi
11	callq	puts
12	movl	$.L.str2, %edi
13	callq	puts
14	xorl	%eax, %eax
15	addq	$8, %rsp
16	ret
17.Ltmp0:
18	.size	main, .Ltmp0-main
19
20	.type	.L.str1,@object         # @.str1
21	.section	.rodata.str1.1,"aMS",@progbits,1
22.L.str1:
23	.asciz	 "Hello"
24	.size	.L.str1, 6
25
26	.type	.L.str2,@object         # @.str2
27.L.str2:
28	.asciz	 "World!"
29	.size	.L.str2, 7
30
31	.section	.note.GNU-stack,"",@progbits
32
33// CHECK: ElfHeader {
34// CHECK:   Class: 64-bit
35// CHECK:   DataEncoding: LittleEndian
36// CHECK:   FileVersion: 1
37// CHECK: }
38// CHECK: Sections [
39// CHECK:   Section {
40// CHECK:     Index: 0
41// CHECK:     Name: (0)
42
43// CHECK:     Name: .text
44
45// CHECK:     Name: .rela.text
46
47// CHECK: Relocations [
48// CHECK:   Section {{.*}} .rela.text {
49// CHECK:     0x5  R_X86_64_32   .rodata.str1.1 0x0
50// CHECK:     0xA  R_X86_64_PC32 puts           0xFFFFFFFFFFFFFFFC
51// CHECK:     0xF  R_X86_64_32   .rodata.str1.1 0x6
52// CHECK:     0x14 R_X86_64_PC32 puts           0xFFFFFFFFFFFFFFFC
53// CHECK:   }
54// CHECK: ]
55
56// CHECK:   Symbol {
57// CHECK:     Binding: Local
58// CHECK:     Type: Section
59
60// CHECK:   Symbol {
61// CHECK:     Name: main
62// CHECK:     Binding: Global
63// CHECK:     Type: Function
64// CHECK:  }
65
66// CHECK:   Symbol {
67// CHECK:     Name: puts
68// CHECK:     Binding: Global
69// CHECK:     Type: None
70// CHECK:  }
71