README 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. Almost all of the code present in these source files was taken
  2. from GLIBC. In the descriptions below, all files mentioned are
  3. with respect to the top level GLIBC source directory accept for
  4. code taken from the Linux kernel.
  5. boot1_arch.h
  6. ------------
  7. Contains code to fix up the stack pointer so that the dynamic
  8. linker can find argc, argv and Auxillary Vector Table (AVT).
  9. The code is taken from the function 'RTLD_START' in the file
  10. 'sysdeps/mips/dl-machine.h'.
  11. elfinterp.c
  12. -----------
  13. Contains the runtime resolver code taken from the function
  14. '__dl_runtime_resolve' in 'sysdeps/mips/dl-machine.h'. Also
  15. contains the function to perform relocations for objects
  16. other than the linker itself. The code was taken from the
  17. function 'elf_machine_rel' in 'sysdeps/mips/dl-machine.h'.
  18. dl-syscalls.h
  19. -------------
  20. Used to contain all the macro functions for the system calls
  21. as well as the list of system calls supported. We now include
  22. <sys/syscall.h> but with the __set_errno macro defined empty
  23. so we can use the same file for the linker as well as userspace.
  24. Original code was taken from the Linux kernel source 2.4.17 and
  25. can be found in the file 'include/asm-mips/unistd.h'.
  26. dl-sysdep.h
  27. -----------
  28. Contains bootstrap code for the dynamic linker, magic numbers
  29. for detecting MIPS target types and some macros. The macro
  30. function 'PERFORM_BOOTSTRAP_GOT' is used to relocate the dynamic
  31. linker's GOT so that function calls can be made. The code is
  32. taken from the function 'ELF_MACHINE_BEFORE_RTLD_RELOC' in the
  33. file 'sysdeps/mips/dl-machine.h'. The other macro function
  34. 'PERFORM_BOOTSTRAP_RELOC' is used to do the relocations for
  35. the dynamic loader. The code is taken from the function
  36. 'elf_machine_rel' in the file 'sysdeps/mips/dl-machine.h'. The
  37. final macro function is 'INIT_GOT' which initializes the GOT
  38. for the application being dynamically linked and loaded. The
  39. code is taken from the functions 'elf_machine_runtime_setup'
  40. and 'elf_machine_got_rel' in 'sysdeps/mips/dl-machine.h'.
  41. resolve.S
  42. ---------
  43. Contains the low-level assembly code for the dynamic runtime
  44. resolver. The code is taken from the assembly code function
  45. '_dl_runtime_resolve' in the file 'sysdeps/mips/dl-machine.h'.
  46. The code looks a bit different since we only need to pass the
  47. symbol index and the old GP register.