Commit bab9e17
committed
fix(ovsm): CRITICAL - Add 8-byte alignment for .rel.dyn section
ROOT CAUSE IDENTIFIED: The .rel.dyn section was at unaligned file offset 0x285,
causing solana-rbpf's slice_from_bytes() to fail with InvalidAlignment when
trying to cast raw bytes to &[Elf64Rel].
FIX: Add padding after .dynstr section to ensure .rel.dyn starts at an 8-byte
aligned offset. The Rust memory safety checks require proper alignment for
struct casting.
This was the final blocker preventing SBPF V1 ELF deployment to Solana.
Changes:
- Line 353: Align reldyn_offset to 8 bytes: ((dynstr_offset + dynstr_size) + 7) & \!7
- Lines 486-490: Insert padding bytes between .dynstr and .rel.dyn sections
Testing: Confirmed with solana_rbpf v0.8.5 source code analysis and debug logging.1 parent 87070a8 commit bab9e17
1 file changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
| 353 | + | |
353 | 354 | | |
354 | 355 | | |
355 | 356 | | |
| |||
482 | 483 | | |
483 | 484 | | |
484 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
485 | 492 | | |
486 | 493 | | |
487 | 494 | | |
| |||
621 | 628 | | |
622 | 629 | | |
623 | 630 | | |
624 | | - | |
| 631 | + | |
625 | 632 | | |
626 | 633 | | |
627 | 634 | | |
| |||
0 commit comments