boot1_arch.h 761 B

123456789101112131415161718192021222324252627282930
  1. /* Any assmbly language/system dependent hacks needed to setup boot1.c so it
  2. * will work as expected and cope with whatever platform specific wierdness is
  3. * needed for this architecture. */
  4. /* Overrive the default _dl_boot function, and replace it with a bit of asm.
  5. * Then call the real _dl_boot function, which is now named _dl_boot2. */
  6. asm("" \
  7. " .text\n" \
  8. " .globl _dl_boot\n" \
  9. "_dl_boot:\n" \
  10. " mov r7, sp\n" \
  11. " @ldr r0, [sp], #4\n" \
  12. " mov r0, sp\n" \
  13. " bl _dl_boot2\n" \
  14. " mov r6, r0\n" \
  15. " mov r0, r7\n" \
  16. " mov pc, r6\n" \
  17. );
  18. #define _dl_boot _dl_boot2
  19. #define LD_BOOT(X) static void * __attribute__ ((unused)) _dl_boot (X)
  20. /* It seems ARM needs an offset here */
  21. #undef ELFMAGIC
  22. #define ELFMAGIC ELFMAG+load_addr