xref: /netbsd-src/external/bsd/elftosb/dist/bdfiles/test_cmd.e (revision 993229b6fea628ff8b1fa09146c80b0cfb2768eb)
1
2# ooh! test input command file for elftosb 2!
3
4options {
5	searchPath = "elftosb2:elftosb2/elf_test_files";
6
7	maximumLoadBlock = 4K;
8	sectionAlign = 4K;
9
10	productVersion = "4.4.720";
11	componentVersion = "4.4.999";
12
13	coalesce = yes;
14}
15
16constants {
17	ocram_start = 0;
18	ocram_size = 256K;
19	ocram_end = ocram_start + ocram_size - 1;
20
21	prec_test = 1 + 5 * 10;
22	paren_test = (1 + 5) * 10;
23
24	a = 123;
25	foo = (1 + 0x1cf1.w).w ^ 5 + a;
26
27	bar1 = 0xa << 2;
28	bar2 = bar1 | 0x1000;
29	bar3 = bar2 & 0x5555;
30	bar4 = bar3 >> 1;
31
32	mod = 35 % 16;
33
34	n = -1;
35	x = 1 + -2;
36
37	c1 = 'x';
38	c2 = 'oh';
39	c4 = 'shit';
40
41	# test int size promotion
42	x = 0xff.b;
43	y = 0x1234.h;
44	z = 0x55aa55aa.w;
45	xx = x - (x / 2.b);	# should produce byte
46	xy = x + y;			# should produce half-word
47	xz = x - z;			# should produce word
48	yz = y + z;			# should produce word
49	xh = x.h;
50	xw = x.w;
51}
52
53sources {
54	hostlink = extern(0);
55	redboot = extern(1);
56
57	sd_player_elf="elftosb2/elf_test_files/sd_player_gcc";
58	sd_player_srec="elftosb2/elf_test_files/sd_player_gcc.srec";
59
60	datafile="elftosb2/elf_test_files/hello_NOR_arm";
61}
62
63#section('foo!') {
64#	load 0.w > ocram_start..ocram_end;	# word fill all ocram with 0
65#
66#	load hostlink;					# load all of hostlink source
67#
68#	load 0x1000ffff.w > 0x1000;		# load a word to address 0x1000
69#	load 0x55aa.h > 0x2000;			# load a half-word to address 0x2000
70#	load redboot;					# load all sections of redboot source
71#
72#	from hostlink {
73#	   load $.*.text;				# load some sections to their natural location
74#	   call :_start;				# call function "_start" from hostlink
75#	   call hostlink:foofn;			# call function "foofn" from hostlink
76#
77#	   call :monkey (1 + 1);		# call function "monkey" from hostlink with an argument
78#
79#	   load $* > .;					# load all sections of hostlink to their natural location
80#
81#	   load $.text > 0x1000;		# load .text section to address 0x1000
82#
83#	   load 0x55.b > 0x0..0x4000;	# fill 0 through 0x4000 with byte pattern 0x55
84#	}
85#
86#	load $*.text from hostlink > .;	# load sections match "*.text" from hostlink to default places
87#
88#	jump redboot;					# jump to entry point of redboot source
89#}
90
91## this section...
92#section(2) {
93#	from sd_player_elf {
94#		load $* > .;
95#		call :_start();
96#	}
97#}
98#
99## and this one are both equivalent except for section ids
100#section(3) {
101#	load $* from sd_player_elf;
102#	call sd_player_elf:_start();
103#}
104#
105#section(100) {
106#    # set the value of a symbol
107#    load hostlink;
108#    load 0x5555.h > hostlink:g_USBPID;
109#
110#    # load a string to memory
111#    load "this is a string" > 0x1e0;
112#}
113
114section (32) {
115	load sd_player_srec;
116	call sd_player_srec;
117}
118
119#section('rsrc') <= datafile;
120
121