138 lines · plain
1@ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \2@ RUN: | llvm-readobj -S --sd --sr --symbols - | FileCheck %s3 4@ Check the .group section for the function in comdat section.5 6@ In C++, the instantiation of the template will come with linkonce (or7@ linkonce_odr) linkage, so that the linker can remove the duplicated8@ instantiation. When the exception handling is enabled on those function,9@ we have to group the corresponding .ARM.extab and .ARM.exidx with the10@ text section together.11@12@ This test case will check the content of .group section. The section index13@ of the grouped sections should be recorded in .group section.14 15 .syntax unified16 .section .TEST1,"axG",%progbits,func1,comdat17 .weak func118 .align 219 .type func1,%function20func1:21 .fnstart22 .save {r4, lr}23 push {r4, lr}24 .vsave {d8, d9, d10, d11, d12}25 vpush {d8, d9, d10, d11, d12}26 .pad #2427 sub sp, sp, #2428 29 add sp, sp, #2430 vpop {d8, d9, d10, d11, d12}31 pop {r4, pc}32 33 .globl __gxx_personality_v034 .personality __gxx_personality_v035 .handlerdata36 .fnend37 38 39 40@-------------------------------------------------------------------------------41@ Check the .group section42@-------------------------------------------------------------------------------43@ CHECK: Sections [44@ CHECK: Section {45@ CHECK: Index: 146@ CHECK: Name: .group47@ CHECK: Type: SHT_GROUP (0x11)48@ CHECK: Flags [ (0x0)49@ CHECK: ]50@ CHECK: Size: 2451@ CHECK: SectionData (52@-------------------------------------------------------------------------------53@ These are the section indexes of .TEST1, .ARM.extab.TEST1, .ARM.exidx.TEST1,54@ .rel.ARM.extab.TEST1, and .rel.ARM.exidx.TEST1.55@-------------------------------------------------------------------------------56@ CHECK-NEXT: 0000: 01000000 04000000 05000000 0600000057@ CHECK-NEXT: 0010: 07000000 0800000058@ CHECK-NEXT: )59@ CHECK: }60 61 62@-------------------------------------------------------------------------------63@ Check the .TEST1 section64@-------------------------------------------------------------------------------65@ CHECK: Section {66@ CHECK: Index: 467@ CHECK-NEXT: Name: .TEST168@ CHECK: Type: SHT_PROGBITS (0x1)69@-------------------------------------------------------------------------------70@ The flags should contain SHF_GROUP.71@-------------------------------------------------------------------------------72@ CHECK: Flags [ (0x206)73@ CHECK: SHF_ALLOC (0x2)74@ CHECK: SHF_EXECINSTR (0x4)75@ CHECK: SHF_GROUP (0x200)76@ CHECK: ]77@ CHECK: }78 79 80@-------------------------------------------------------------------------------81@ Check the .ARM.extab.TEST1 section82@-------------------------------------------------------------------------------83@ CHECK: Section {84@ CHECK: Index: 585@ CHECK-NEXT: Name: .ARM.extab.TEST186@ CHECK: Type: SHT_PROGBITS (0x1)87@-------------------------------------------------------------------------------88@ The flags should contain SHF_GROUP.89@-------------------------------------------------------------------------------90@ CHECK: Flags [ (0x202)91@ CHECK: SHF_ALLOC (0x2)92@ CHECK: SHF_GROUP (0x200)93@ CHECK: ]94@ CHECK: }95 96@ CHECK: Section {97@ CHECK: Index: 698@ CHECK-NEXT: Name: .rel.ARM.extab.TEST199@ CHECK: }100 101@-------------------------------------------------------------------------------102@ Check the .ARM.exidx.TEST1 section103@-------------------------------------------------------------------------------104@ CHECK: Section {105@ CHECK: Index: 7106@ CHECK-NEXT: Name: .ARM.exidx.TEST1107@ CHECK: Type: SHT_ARM_EXIDX (0x70000001)108@-------------------------------------------------------------------------------109@ The flags should contain SHF_GROUP.110@-------------------------------------------------------------------------------111@ CHECK: Flags [ (0x282)112@ CHECK: SHF_ALLOC (0x2)113@ CHECK: SHF_GROUP (0x200)114@ CHECK: SHF_LINK_ORDER (0x80)115@ CHECK: ]116@ CHECK: Link: 4117@ CHECK: }118 119 120@ CHECK: Section {121@ CHECK: Index: 8122@ CHECK-NEXT: Name: .rel.ARM.exidx.TEST1123@ CHECK: }124 125@ CHECK: ]126 127@-------------------------------------------------------------------------------128@ Check symbol func1. It should be weak binding, and belong to .TEST1 section.129@-------------------------------------------------------------------------------130@ CHECK: Symbols [131@ CHECK: Symbol {132@ CHECK: Name: func1133@ CHECK: Binding: Weak (0x2)134@ CHECK: Type: Function (0x2)135@ CHECK: Section: .TEST1136@ CHECK: }137@ CHECK: ]138