1 ; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -filetype=obj -relocation-model=static %s -o - | \ 2 ; RUN: elf-dump --dump-section-data | FileCheck %s -check-prefix=STATIC 3 ; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -filetype=obj -relocation-model=pic %s -o - | \ 4 ; RUN: elf-dump --dump-section-data | FileCheck %s -check-prefix=PIC 5 6 ; FIXME: this file should be in .s form, change when asm parser is available. 7 8 define void @f() { 9 entry: 10 ret void 11 } 12 13 ; STATIC: ('sh_name', 0x{{.*}}) # '.eh_frame' 14 ; STATIC-NEXT: ('sh_type', 0x00000001) 15 ; STATIC-NEXT: ('sh_flags', 0x0000000000000002) 16 ; STATIC-NEXT: ('sh_addr', 0x{{.*}}) 17 ; STATIC-NEXT: ('sh_offset', 0x{{.*}}) 18 ; STATIC-NEXT: ('sh_size', 0x0000000000000028) 19 ; STATIC-NEXT: ('sh_link', 0x00000000) 20 ; STATIC-NEXT: ('sh_info', 0x00000000) 21 ; STATIC-NEXT: ('sh_addralign', 0x0000000000000008) 22 ; STATIC-NEXT: ('sh_entsize', 0x0000000000000000) 23 ; STATIC-NEXT: ('_section_data', '00000010 00000000 017a5200 01784101 1b0c0100 00000010 00000018 00000000 00000010 00000000') 24 25 ; STATIC: ('sh_name', 0x{{.*}}) # '.rela.eh_frame' 26 ; STATIC-NEXT: ('sh_type', 0x00000004) 27 ; STATIC-NEXT: ('sh_flags', 0x0000000000000000) 28 ; STATIC-NEXT: ('sh_addr', 0x{{.*}}) 29 ; STATIC-NEXT: ('sh_offset', 0x{{.*}}) 30 ; STATIC-NEXT: ('sh_size', 0x0000000000000018) 31 ; STATIC-NEXT: ('sh_link', 0x{{.*}}) 32 ; STATIC-NEXT: ('sh_info', 0x{{.*}}) 33 ; STATIC-NEXT: ('sh_addralign', 0x0000000000000008) 34 ; STATIC-NEXT: ('sh_entsize', 0x0000000000000018) 35 ; STATIC-NEXT: ('_relocations', [ 36 37 ; Static build should create R_PPC64_REL32 relocations 38 ; STATIC-NEXT: # Relocation 0 39 ; STATIC-NEXT: (('r_offset', 0x000000000000001c) 40 ; STATIC-NEXT: ('r_sym', 0x{{.*}}) 41 ; STATIC-NEXT: ('r_type', 0x0000001a) 42 ; STATIC-NEXT: ('r_addend', 0x0000000000000000) 43 ; STATIC-NEXT: ), 44 ; STATIC-NEXT: ]) 45 46 47 ; PIC: ('sh_name', 0x{{.*}}) # '.eh_frame' 48 ; PIC-NEXT: ('sh_type', 0x00000001) 49 ; PIC-NEXT: ('sh_flags', 0x0000000000000002) 50 ; PIC-NEXT: ('sh_addr', 0x{{.*}}) 51 ; PIC-NEXT: ('sh_offset', 0x{{.*}}) 52 ; PIC-NEXT: ('sh_size', 0x0000000000000028) 53 ; PIC-NEXT: ('sh_link', 0x00000000) 54 ; PIC-NEXT: ('sh_info', 0x00000000) 55 ; PIC-NEXT: ('sh_addralign', 0x0000000000000008) 56 ; PIC-NEXT: ('sh_entsize', 0x0000000000000000) 57 ; PIC-NEXT: ('_section_data', '00000010 00000000 017a5200 01784101 1b0c0100 00000010 00000018 00000000 00000010 00000000') 58 59 ; PIC: ('sh_name', 0x{{.*}}) # '.rela.eh_frame' 60 ; PIC-NEXT: ('sh_type', 0x00000004) 61 ; PIC-NEXT: ('sh_flags', 0x0000000000000000) 62 ; PIC-NEXT: ('sh_addr', 0x{{.*}}) 63 ; PIC-NEXT: ('sh_offset', 0x{{.*}}) 64 ; PIC-NEXT: ('sh_size', 0x0000000000000018) 65 ; PIC-NEXT: ('sh_link', 0x{{.*}}) 66 ; PIC-NEXT: ('sh_info', 0x{{.*}}) 67 ; PIC-NEXT: ('sh_addralign', 0x0000000000000008) 68 ; PIC-NEXT: ('sh_entsize', 0x0000000000000018) 69 ; PIC-NEXT: ('_relocations', [ 70 71 ; PIC build should create R_PPC64_REL32 relocations 72 ; PIC-NEXT: # Relocation 0 73 ; PIC-NEXT: (('r_offset', 0x000000000000001c) 74 ; PIC-NEXT: ('r_sym', 0x{{.*}}) 75 ; PIC-NEXT: ('r_type', 0x0000001a) 76 ; PIC-NEXT: ('r_addend', 0x0000000000000000) 77 ; PIC-NEXT: ), 78 ; PIC-NEXT: ]) 79