Commit a9eaf48
authored
More precise determination of small data accesses (#220)
We can get linker errors for addresses of the form "symbol + offset"
where "symbol" is in the small data area and "offset" is large enough
to overflow the relative displacement from the SDA base register.
To avoid this, this commit enriches `C2C.atom_is_small_data`,
which is the implementation of `Asm.symbol_is_small_data` in the PPC port,
with a check that the offset is within the bounds of the symbol.
If it is not, `Asm.symbol_is_small_data` returns `false` and Asmgen produces
an absolute addressing instead of a SDA-relative addressing.
To implement the check, we record the sizes of symbols in the atom table,
just like we already record their alignments.1 parent 7978290 commit a9eaf48
1 file changed
+15
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
| 76 | + | |
76 | 77 | | |
77 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
| |||
352 | 358 | | |
353 | 359 | | |
354 | 360 | | |
| 361 | + | |
355 | 362 | | |
356 | 363 | | |
357 | 364 | | |
| |||
379 | 386 | | |
380 | 387 | | |
381 | 388 | | |
| 389 | + | |
382 | 390 | | |
383 | 391 | | |
384 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
385 | 395 | | |
386 | 396 | | |
387 | 397 | | |
| |||
1223 | 1233 | | |
1224 | 1234 | | |
1225 | 1235 | | |
| 1236 | + | |
1226 | 1237 | | |
1227 | 1238 | | |
1228 | 1239 | | |
| |||
1309 | 1320 | | |
1310 | 1321 | | |
1311 | 1322 | | |
| 1323 | + | |
1312 | 1324 | | |
1313 | 1325 | | |
1314 | 1326 | | |
| |||
0 commit comments