1 #----------------------------------------------------------------------------
3 #----------------------------------------------------------------------------
5 mask
= (1 << alignment
) - 1
7 # Output VALUE as an unaligned pointer-sized quantity.
17 # Start a new CIE, and emit everything up to the augmentation data.
18 # Use LABEL to mark the start of the entry and AUG as the augmentation
20 .macro start_cie label,aug
21 .section .eh_frame,"aw",@progbits
27 .string "\aug" # Augmentation
28 .byte 1 # Code alignment
29 .byte 4 # Data alignment
30 .byte 31 # Return address column
34 # Create a dummy function of SIZE bytes in SECTION and emit the
35 # first four entries of an FDE for it.
36 .macro start_fde cie,section,size
37 .section \section,"ax",@progbits
43 .section .eh_frame,"aw",@progbits
46 .word .-\cie # CIE offset
48 pbyte
4b-
3b # Size of code
52 # Finish a CIE or FDE entry.
54 .p2align alignment,fill
59 # Start the augmentation data for a CIE that has a 'P' entry
60 # followed by EXTRA bytes. AUGLEN is the length of augmentation
61 # string (including zero terminator), ENCODING is the encoding to
62 # use for the personality routine and VALUE is the value it
64 .macro persaug auglen,extra,encoding,value
65 .if (\encoding & 0xf0) == 0x50
66 .byte (-(9 + \auglen + 3 + 2) & mask) + 2 + mask + \extra
68 .fill -(9 + \auglen + 3 + 2) & mask,1,0
70 .byte 2 + mask + \extra
77 .macro cie_basic label
82 .macro fde_basic cie,section,size
83 start_fde \cie
,\section
,\size
88 .macro cie_zP label,encoding,value
90 persaug
3,0,\encoding
,\value
94 .macro fde_zP cie,section,size
95 start_fde \cie
,\section
,\size
96 .byte 0 # Augmentation length
101 .macro cie_zPR label,encoding,value
102 start_cie \label
,"zPR"
103 persaug
4,1,\encoding
,\value
104 .byte 0 # FDE enconding
108 .macro fde_zPR cie,section,size
109 start_fde \cie
,\section
,\size
110 .byte 0 # Augmentation length
114 #----------------------------------------------------------------------------
116 #----------------------------------------------------------------------------
119 fde_basic basic1
,.text,0x10
120 fde_basic basic1
,.text,0x20
123 fde_basic basic2
,.text,0x30
126 fde_basic basic3
,.text,0x40
129 fde_basic basic4
,.text,0x50
131 cie_zP zP_unalign1
,0x00,foo
132 fde_zP zP_unalign1
,.text,0x10
133 fde_zP zP_unalign1
,.text,0x20
135 cie_zP zP_align1
,0x50,foo
136 fde_zP zP_align1
,.text,0x10
137 fde_zP zP_align1
,.text,0x20
139 cie_zPR zPR1
,0x00,foo
140 fde_zPR zPR1
,.text,0x10
141 fde_zPR zPR1
,.discard,0x20
143 cie_zPR zPR2
,0x00,foo
144 fde_zPR zPR2
,.text,0x30
145 fde_zPR zPR2
,.text,0x40
148 fde_basic basic5
,.text,0x10
151 .section .gcc_compiled_long32