Home | History | Annotate | Download | only in ARM
      1 @ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \
      2 @ RUN:   | llvm-readobj -s -sd -sr -t | FileCheck %s
      3 
      4 @ Check the combination of .section, .fnstart, and .fnend directives.
      5 
      6 @ For the functions in .text section, the exception handling index (EXIDX)
      7 @ should be generated in .ARM.exidx, and the exception handling table (EXTAB)
      8 @ should be generated in .ARM.extab.
      9 
     10 @ For the functions in custom section specified by .section directives,
     11 @ the EXIDX should be generated in ".ARM.exidx[[SECTION_NAME]]", and the EXTAB
     12 @ should be generated in ".ARM.extab[[SECTION_NAME]]".
     13 
     14 	.syntax	unified
     15 
     16 @-------------------------------------------------------------------------------
     17 @ .TEST1 section
     18 @-------------------------------------------------------------------------------
     19 	.section	.TEST1
     20 	.globl	func1
     21 	.align	2
     22 	.type	func1,%function
     23 	.fnstart
     24 func1:
     25 	bx	lr
     26 	.personality	__gxx_personality_v0
     27 	.handlerdata
     28 	.fnend
     29 
     30 
     31 @-------------------------------------------------------------------------------
     32 @ TEST2 section (without the dot in the beginning)
     33 @-------------------------------------------------------------------------------
     34 	.section	TEST2
     35 	.globl	func2
     36 	.align	2
     37 	.type	func2,%function
     38 	.fnstart
     39 func2:
     40 	bx	lr
     41 	.personality	__gxx_personality_v0
     42 	.handlerdata
     43 	.fnend
     44 
     45 
     46 @-------------------------------------------------------------------------------
     47 @ Check the .TEST1 section.
     48 @-------------------------------------------------------------------------------
     49 @ CHECK: Sections [
     50 @ CHECK:   Section {
     51 @ CHECK:     Index: 4
     52 @ CHECK:     Name: .TEST1
     53 @ CHECK:     SectionData (
     54 @ CHECK:       0000: 1EFF2FE1                             |../.|
     55 @ CHECK:     )
     56 @ CHECK:   }
     57 
     58 @-------------------------------------------------------------------------------
     59 @ Check the .ARM.extab.TEST1 section, the EXTAB of .TEST1 section.
     60 @-------------------------------------------------------------------------------
     61 @ CHECK:   Section {
     62 @ CHECK:     Name: .ARM.extab.TEST1
     63 @ CHECK:     SectionData (
     64 @ CHECK:       0000: 00000000 B0B0B000                    |........|
     65 @ CHECK:     )
     66 @ CHECK:   }
     67 @ CHECK:     Relocations [
     68 @ CHECK:       0x0 R_ARM_PREL31 __gxx_personality_v0 0x0
     69 @ CHECK:     ]
     70 
     71 
     72 @-------------------------------------------------------------------------------
     73 @ Check the.ARM.exidx.TEST1 section, the EXIDX of .TEST1 section.
     74 @-------------------------------------------------------------------------------
     75 @ CHECK:   Section {
     76 @ CHECK:     Name: .ARM.exidx.TEST1
     77 
     78 @-------------------------------------------------------------------------------
     79 @ This section should linked with .TEST1 section.
     80 @-------------------------------------------------------------------------------
     81 @ CHECK:     Link: 4
     82 
     83 @-------------------------------------------------------------------------------
     84 @ The first word should be relocated to the code address in .TEST1 section.
     85 @ The second word should be relocated to the EHTAB entry in .ARM.extab.TEST1
     86 @ section.
     87 @-------------------------------------------------------------------------------
     88 @ CHECK:     SectionData (
     89 @ CHECK:       0000: 00000000 00000000                    |........|
     90 @ CHECK:     )
     91 @ CHECK:   }
     92 @ CHECK:     Relocations [
     93 @ CHECK:       0x0 R_ARM_PREL31 .TEST1 0x0
     94 @ CHECK:       0x4 R_ARM_PREL31 .ARM.extab.TEST1 0x0
     95 @ CHECK:     ]
     96 
     97 
     98 @-------------------------------------------------------------------------------
     99 @ Check the TEST2 section (without the dot in the beginning)
    100 @-------------------------------------------------------------------------------
    101 @ CHECK:   Section {
    102 @ CHECK:     Index: 9
    103 @ CHECK:     Name: TEST2
    104 @ CHECK:     SectionData (
    105 @ CHECK:       0000: 1EFF2FE1                             |../.|
    106 @ CHECK:     )
    107 @ CHECK:   }
    108 
    109 @-------------------------------------------------------------------------------
    110 @ Check the .ARM.extabTEST2 section, the EXTAB of TEST2 section.
    111 @-------------------------------------------------------------------------------
    112 @ CHECK:   Section {
    113 @ CHECK:     Name: .ARM.extabTEST2
    114 @ CHECK:     SectionData (
    115 @ CHECK:       0000: 00000000 B0B0B000                    |........|
    116 @ CHECK:     )
    117 @ CHECK:   }
    118 @ CHECK:     Relocations [
    119 @ CHECK:       0x0 R_ARM_PREL31 __gxx_personality_v0 0x0
    120 @ CHECK:     ]
    121 
    122 
    123 @-------------------------------------------------------------------------------
    124 @ Check the .ARM.exidxTEST2 section, the EXIDX of TEST2 section.
    125 @-------------------------------------------------------------------------------
    126 @ CHECK:   Section {
    127 @ CHECK:     Name: .ARM.exidxTEST2
    128 
    129 @-------------------------------------------------------------------------------
    130 @ This section should linked with TEST2 section.
    131 @-------------------------------------------------------------------------------
    132 @ CHECK:     Link: 9
    133 
    134 @-------------------------------------------------------------------------------
    135 @ The first word should be relocated to the code address in TEST2 section.
    136 @ The second word should be relocated to the EHTAB entry in .ARM.extabTEST2
    137 @ section.
    138 @-------------------------------------------------------------------------------
    139 @ CHECK:     SectionData (
    140 @ CHECK:       0000: 00000000 00000000                    |........|
    141 @ CHECK:     )
    142 @ CHECK:   }
    143 @ CHECK: ]
    144 @ CHECK:     Relocations [
    145 @ CHECK:       0x0 R_ARM_PREL31 TEST2 0x0
    146 @ CHECK:       0x4 R_ARM_PREL31 .ARM.extabTEST2 0x0
    147 @ CHECK:     ]
    148 
    149 
    150 
    151 @-------------------------------------------------------------------------------
    152 @ Check the symbols and the sections they belong to
    153 @-------------------------------------------------------------------------------
    154 @ CHECK: Symbols [
    155 @ CHECK:   Symbol {
    156 @ CHECK:     Name: func1
    157 @ CHECK:     Section: .TEST1 (0x4)
    158 @ CHECK:   }
    159 @ CHECK:   Symbol {
    160 @ CHECK:     Name: func2
    161 @ CHECK:     Section: TEST2 (0x9)
    162 @ CHECK:   }
    163 @ CHECK: ]
    164