1.1 --- a/stage2/stage2.c Sat Jun 13 00:06:18 2015 +0200
1.2 +++ b/stage2/stage2.c Sun Jun 14 01:44:49 2015 +0200
1.3 @@ -28,36 +28,8 @@
1.4
1.5 void c_main(void)
1.6 {
1.7 - /* Relocate object locations. */
1.8 -
1.9 - volatile unsigned int start_addr, got_start, got_end, addr, offset;
1.10 volatile int started;
1.11
1.12 - /* get absolute start address */
1.13 - __asm__ __volatile__(
1.14 - "move %0, $20\n\t"
1.15 - : "=r"(start_addr)
1.16 - :
1.17 - );
1.18 -
1.19 - /* get related GOT address */
1.20 - __asm__ __volatile__(
1.21 - "la $4, _GLOBAL_OFFSET_TABLE_\n\t"
1.22 - "move %0, $4\n\t"
1.23 - "la $5, _got_end\n\t"
1.24 - "move %1, $5\n\t"
1.25 - : "=r"(got_start),"=r"(got_end)
1.26 - :
1.27 - );
1.28 -
1.29 - /* calculate offset and correct GOT*/
1.30 - offset = start_addr - 0x80000000;
1.31 - got_start += offset;
1.32 - got_end += offset;
1.33 -
1.34 - for ( addr = got_start + 8; addr < got_end; addr += 4 )
1.35 - *((volatile unsigned int *)(addr)) += offset; // add offset to correct all GOT
1.36 -
1.37 /* The actual work. */
1.38
1.39 started = is_started();