]> gitweb.factorcode.org Git - factor.git/blob - extra/elf/elf-tests.factor
Update actions, because Node.js 16 actions are deprecated, to Node.js 20
[factor.git] / extra / elf / elf-tests.factor
1 ! Copyright (C) 2010 Erik Charlebois.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors byte-arrays elf kernel sequences system tools.test ;
4
5 cpu ppc? [
6 {
7     {
8         ""
9         ".interp"
10         ".note.ABI-tag"
11         ".note.gnu.build-id"
12         ".hash"
13         ".gnu.hash"
14         ".dynsym"
15         ".dynstr"
16         ".gnu.version"
17         ".gnu.version_r"
18         ".rela.dyn"
19         ".rela.plt"
20         ".init"
21         ".plt"
22         ".text"
23         ".fini"
24         ".rodata"
25         ".eh_frame_hdr"
26         ".eh_frame"
27         ".ctors"
28         ".dtors"
29         ".jcr"
30         ".dynamic"
31         ".got"
32         ".got.plt"
33         ".data"
34         ".bss"
35         ".comment"
36         ".debug_aranges"
37         ".debug_pubnames"
38         ".debug_info"
39         ".debug_abbrev"
40         ".debug_line"
41         ".debug_str"
42         ".shstrtab"
43         ".symtab"
44         ".strtab"
45     }
46 }
47 [
48     "resource:extra/elf/a.elf" [
49         sections [ name>> ] map
50     ] with-mapped-elf
51 ]
52 unit-test
53
54 {
55     {
56         ".interp"
57         ".note.ABI-tag"
58         ".note.gnu.build-id"
59         ".hash"
60         ".gnu.hash"
61         ".dynsym"
62         ".dynstr"
63         ".gnu.version"
64         ".gnu.version_r"
65         ".rela.dyn"
66         ".rela.plt"
67         ".init"
68         ".plt"
69         ".text"
70         ".fini"
71         ".rodata"
72         ".eh_frame_hdr"
73         ".eh_frame"
74     }
75 }
76 [
77     "resource:extra/elf/a.elf" [
78         segments [ program-header>> p_type>> PT_LOAD = ] find nip
79         sections [ name>> ] map
80     ] with-mapped-elf
81 ]
82 unit-test
83
84 {
85     {
86         ""
87         ""
88         ""
89         ""
90         ""
91         ""
92         ""
93         ""
94         ""
95         ""
96         ""
97         ""
98         ""
99         ""
100         ""
101         ""
102         ""
103         ""
104         ""
105         ""
106         ""
107         ""
108         ""
109         ""
110         ""
111         ""
112         ""
113         ""
114         ""
115         ""
116         ""
117         ""
118         ""
119         ""
120         "init.c"
121         "call_gmon_start"
122         "crtstuff.c"
123         "__CTOR_LIST__"
124         "__DTOR_LIST__"
125         "__JCR_LIST__"
126         "__do_global_dtors_aux"
127         "completed.7342"
128         "dtor_idx.7344"
129         "frame_dummy"
130         "crtstuff.c"
131         "__CTOR_END__"
132         "__FRAME_END__"
133         "__JCR_END__"
134         "__do_global_ctors_aux"
135         "test.c"
136         "_GLOBAL_OFFSET_TABLE_"
137         "__init_array_end"
138         "__init_array_start"
139         "_DYNAMIC"
140         "data_start"
141         "printf@@GLIBC_2.2.5"
142         "__libc_csu_fini"
143         "_start"
144         "__gmon_start__"
145         "_Jv_RegisterClasses"
146         "_fini"
147         "__libc_start_main@@GLIBC_2.2.5"
148         "_IO_stdin_used"
149         "__data_start"
150         "__dso_handle"
151         "__DTOR_END__"
152         "__libc_csu_init"
153         "__bss_start"
154         "_end"
155         "_edata"
156         "main"
157         "_init"
158     }
159 }
160 [
161     "resource:extra/elf/a.elf" [
162         sections ".symtab" find-section symbols
163         [ name>> ] map
164     ] with-mapped-elf
165 ]
166 unit-test
167
168 {
169     B{
170         85 72 137 229 184 44 6 64 0 72 137 199 184 0 0 0 0 232 222
171         254 255 255 201 195
172     }
173 }
174 [
175     "resource:extra/elf/a.elf" [
176         sections ".symtab" "main" find-section-symbol
177         symbol-data >byte-array
178     ] with-mapped-elf
179 ]
180 unit-test
181 ] unless