about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-14 10:40:26 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-14 10:43:34 -0700
commitaa6c342af977b4638361b2e68c3f8cc6888cac24 (patch)
treeee7ac032d37796dc5949bd1a9a1a0c747d388428
parent6f812e6ea125aadd2e0891b094902b34924dccd0 (diff)
downloadmu-aa6c342af977b4638361b2e68c3f8cc6888cac24.tar.gz
4343
Let's minimize the alignment requirements of each segment's offset.
It'll make binaries take less room later. Otherwise we may need to pad
lots of 0s for segments after the first.

Generated ELF binaries continue to work natively (except ex4, but that
was already not working).
-rw-r--r--subx/021translate.cc2
-rwxr-xr-xsubx/ex1bin96 -> 96 bytes
-rwxr-xr-xsubx/ex2bin102 -> 102 bytes
-rwxr-xr-xsubx/ex3bin119 -> 119 bytes
-rwxr-xr-xsubx/ex4bin113 -> 113 bytes
5 files changed, 1 insertions, 1 deletions
diff --git a/subx/021translate.cc b/subx/021translate.cc
index c3d780f1..d33755ab 100644
--- a/subx/021translate.cc
+++ b/subx/021translate.cc
@@ -114,7 +114,7 @@ void dump_elf_header(ostream& out) {
   uint32_t p_flags = 0x5;  // r-x
   emit(p_flags);
   // p_align
-  uint32_t p_align = 0x1000;
+  uint32_t p_align = 0x4;  // p_offset must be congruent to p_paddr/p_vaddr modulo p_align
   emit(p_align);
 #undef O
 #undef emit
diff --git a/subx/ex1 b/subx/ex1
index f3c9730d..c4114dfd 100755
--- a/subx/ex1
+++ b/subx/ex1
Binary files differdiff --git a/subx/ex2 b/subx/ex2
index 3bbd979b..38520d38 100755
--- a/subx/ex2
+++ b/subx/ex2
Binary files differdiff --git a/subx/ex3 b/subx/ex3
index aa209b92..9c1f9a92 100755
--- a/subx/ex3
+++ b/subx/ex3
Binary files differdiff --git a/subx/ex4 b/subx/ex4
index b20490ad..21f7118b 100755
--- a/subx/ex4
+++ b/subx/ex4
Binary files differ
s E. Dickey <dickey@invisible-island.net> 1997-04-16 01:40:22 -0400 committer Thomas E. Dickey <dickey@invisible-island.net> 1997-04-16 01:40:22 -0400 snapshot of project "lynx", label v2-7-1ac_0-6' href='/ingrix/lynx-snapshots/commit/config.hin?id=e4409c408eedf320b8845cafdd62b664bec1afd8'>e4409c40 ^
169e8098 ^
97d3287a ^


e4409c40 ^
c4e90d70 ^
2a786b26 ^
79de4059 ^
b223937f ^
f7c3c4ca ^
79de4059 ^
d3f9d547 ^
899516a7 ^
0726d2fa ^
d3f9d547 ^
5be99e2e ^
d3f9d547 ^

f7c3c4ca ^

ab1d1ae5 ^
f7c3c4ca ^
5be99e2e ^
9c512bba ^
f7c3c4ca ^


9c512bba ^
e4409c40 ^
2b52e9e6 ^
2a256611 ^
86b4d41a ^
d3f9d547 ^
e4409c40 ^
d4a8ec3c ^


2b52e9e6 ^
4525eb4b ^
d3f9d547 ^
e4409c40 ^
d3f9d547 ^
e4409c40 ^
d4a8ec3c ^
d3f9d547 ^
2a786b26 ^
e4409c40 ^

5b288495 ^
0726d2fa ^

22088334 ^


549ec595 ^
e4409c40 ^
97d3287a ^
d3f9d547 ^
08fc6e5c ^
c68ecb8b ^
327b7c16 ^
d97a6513 ^
d3f9d547 ^
e4409c40 ^
d3f9d547 ^

e4409c40 ^
d3f9d547 ^
86b4d41a ^
d4a8ec3c ^
c68ecb8b ^

d4a8ec3c ^

29ee16d5 ^
2a786b26 ^
1a6a3318 ^
d4a8ec3c ^
2a786b26 ^
08fc6e5c ^
e4409c40 ^
c4e90d70 ^
9c512bba ^
2b52e9e6 ^
d4a8ec3c ^
d3f9d547 ^
c68ecb8b ^
9c512bba ^
e4409c40 ^
d4a8ec3c ^
86b4d41a ^
d4a8ec3c ^


b6c832d0 ^
e4409c40 ^
c68ecb8b ^
e4409c40 ^


d2e46bbf ^
e4409c40 ^
d4a8ec3c ^
5b288495 ^
97d3287a ^
18024037 ^
d3f9d547 ^
1a6a3318 ^

a2a1ab1e ^
03239fe7 ^
e4409c40 ^
d2e46bbf ^
e4409c40 ^
aa7067e1 ^
b6c832d0 ^
dbcd4fe5 ^




d4a8ec3c ^

0f88481e ^
d2e46bbf ^
b6c832d0 ^
4525eb4b ^
112f25f7 ^
d4a8ec3c ^


e4409c40 ^
d31fb3c4 ^
2a786b26 ^
e4409c40 ^
8f8c57cc ^
e4409c40 ^

c4e90d70 ^
d3f9d547 ^
55ebd12c ^

d2e46bbf ^
e4409c40 ^


c4e90d70 ^
e4409c40 ^

945e8eb6 ^
c4e90d70 ^
d3f9d547 ^
899516a7 ^
f7c3c4ca ^
d3f9d547 ^

e4409c40 ^
55ebd12c ^
c4e90d70 ^
83824f14 ^
c4e90d70 ^




112f25f7 ^
8ce6b560 ^
e4409c40 ^
d3f9d547 ^
b223937f ^
e4409c40 ^


a735f5ad ^
e4409c40 ^
8ce6b560 ^
d3f9d547 ^

8ce6b560 ^
e4409c40 ^


55ebd12c ^
e4409c40 ^

8f8c57cc ^
86b4d41a ^
327b7c16 ^
b223937f ^
899516a7 ^
d31fb3c4 ^
d61bc4e5 ^
ab1d1ae5 ^
97d3287a ^
1a2ac66b ^
d3f9d547 ^

d31fb3c4 ^
dbcd4fe5 ^
1a2ac66b ^
e4409c40 ^

8f8c57cc ^

112f25f7 ^
e4409c40 ^

d3f9d547 ^
d4a8ec3c ^
97d3287a ^
2a786b26 ^

d4a8ec3c ^
d3f9d547 ^

dbcd4fe5 ^


e4409c40 ^
d3f9d547 ^
13278785 ^


0654c702 ^
13278785 ^
0654c702 ^

e4409c40 ^


e4409c40 ^
e4409c40 ^
e4409c40 ^

e4409c40 ^
d3f9d547 ^











e6ba2a01 ^
c68ecb8b ^



86b4d41a ^



97d3287a ^











2f5222ea ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286