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