• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump  --dump-section-data | FileCheck  %s
2
3// Test that relocations with local symbols are represented as relocations
4// with the section. They should be equivalent, but gas behaves like this.
5
6	movl	foo, %r14d
7foo:
8
9// Section number 1 is .text
10// CHECK:        # Section 1
11// CHECK-next:  (('sh_name', 0x00000001) # '.text'
12
13// Relocation refers to symbol number 2
14// CHECK:      ('_relocations', [
15// CHECK-NEXT:  # Relocation 0
16// CHECK-NEXT:   (('r_offset',
17// CHECK-NEXT:    ('r_sym', 0x00000002)
18// CHECK-NEXT:    ('r_type',
19// CHECK-NEXT:    ('r_addend',
20// CHECK-NEXT:   ),
21// CHECK-NEXT:  ])
22
23// Symbol number 2 is section number 1
24// CHECK:    # Symbol 2
25// CHECK-NEXT:    (('st_name', 0x00000000) # ''
26// CHECK-NEXT:     ('st_bind', 0x0)
27// CHECK-NEXT:     ('st_type', 0x3)
28// CHECK-NEXT:     ('st_other', 0x00)
29// CHECK-NEXT:     ('st_shndx', 0x0001)
30// CHECK-NEXT:     ('st_value', 0x0000000000000000)
31// CHECK-NEXT:     ('st_size', 0x0000000000000000)
32