
17 Mar
2014
17 Mar
'14
3:29 a.m.
Hi, Albert:
Relocation will always happen, and there is no provision for avoiding it.
I have ever tried to del these code in crt0.S : ldr sp, [r8, #GD_START_ADDR_SP] /* r8 = gd->start_addr_sp */ bic sp, sp, #7 /* 8-byte alignment for ABI compliance */ ldr r8, [r8, #GD_BD] /* r8 = gd->bd */ sub r8, r8, #GD_SIZE /* new GD is below bd */
/// tricky code : insure to return here after running relocate_code. adr lr, here ldr r0, [r8, #GD_RELOC_OFF] /* lr = gd->start_addr_sp */ add lr, lr, r0 ldr r0, [r8, #GD_RELOCADDR] /* r0 = gd->relocaddr */ /// start.S implement this function. b relocate_code
Then no relocation, it seemed OK.
Best wishes,