# HG changeset patch # User Paul Boddie # Date 1540573851 -7200 # Node ID 88fbeb522bba0caaa6e75cc35359e7004b361176 # Parent bb0c949a94e1b4c1783321aea34968e2c95270a1# Parent ae0b0022e6096aa3d9f17df8d0007379153f0abf Merged parallel changes, updating the relocate_data invocation similarly. diff -r bb0c949a94e1 -r 88fbeb522bba lib/start.S --- a/lib/start.S Fri Oct 26 18:22:04 2018 +0200 +++ b/lib/start.S Fri Oct 26 19:10:51 2018 +0200 @@ -75,31 +75,17 @@ lui $gp, %hi(_GLOBAL_OFFSET_TABLE_) ori $gp, $gp, %lo(_GLOBAL_OFFSET_TABLE_) - /* - Relocate mutable data and then jump to the main program. - - Since the boot code is separate from the other code, addresses cannot be - obtained via the GOT: - - "relocation truncated to fit: R_MIPS_PC16 against `main'" - */ + /* Relocate mutable data and then jump to the main program. */ - lui $a0, %hi(_data_original) - ori $a0, $a0, %lo(_data_original) - - lui $a1, %hi(_data) - ori $a1, $a1, %lo(_data) - - lui $a2, %hi(_data_size) - ori $a2, $a2, %lo(_data_size) + la $a0, _data_original + la $a1, _data + la $a2, _data_size lw $a2, 0($a2) - lui $t9, %hi(relocate_data) - ori $t9, $t9, %lo(relocate_data) + la $t9, relocate_data jal $t9 nop - lui $t9, %hi(main) - ori $t9, $t9, %lo(main) + la $t9, main jr $t9 nop