dl-startup.h 850 B

12345678910111213141516171819202122232425262728293031323334
  1. __asm__ ("\
  2. .text\n\
  3. .globl _start\n\
  4. .type _start, %function\n\
  5. _start:\n\
  6. mov r4, sp\n\
  7. br _dl_start\n\
  8. mov r16, r4\n\
  9. jmp r16\n\
  10. ");
  11. /*
  12. * Get a pointer to the argv array. On many platforms this can be just
  13. * the address of the first argument, on other platforms we need to
  14. * do something a little more subtle here.
  15. */
  16. #define GET_ARGV(ARGVP, ARGS) ARGVP = (((unsigned long*) ARGS)+1)
  17. /* The ld.so library requires relocations */
  18. #define ARCH_NEEDS_BOOTSTRAP_RELOCS
  19. static __always_inline
  20. void PERFORM_BOOTSTRAP_RELOC(ELF_RELOC *rpnt, unsigned long *reloc_addr,
  21. unsigned long symbol_addr, unsigned long load_addr, attribute_unused Elf32_Sym *symtab)
  22. {
  23. switch (ELF_R_TYPE(rpnt->r_info)) {
  24. case R_NIOS2_RELATIVE:
  25. *reloc_addr = load_addr + rpnt->r_addend;
  26. break;
  27. default:
  28. _dl_exit(1);
  29. break;
  30. }
  31. }