Changeset View
Changeset View
Standalone View
Standalone View
libexec/rtld-elf/rtld.c
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
#include "rtld.h" | #include "rtld.h" | ||||
#include "libmap.h" | #include "libmap.h" | ||||
#include "paths.h" | #include "paths.h" | ||||
#include "rtld_tls.h" | #include "rtld_tls.h" | ||||
#include "rtld_printf.h" | #include "rtld_printf.h" | ||||
#include "rtld_malloc.h" | #include "rtld_malloc.h" | ||||
#include "rtld_utrace.h" | #include "rtld_utrace.h" | ||||
#include "notes.h" | #include "notes.h" | ||||
#include "rtld_libc.h" | |||||
arichardson: I added all these at the end of the include list, should I insert them alphabetically instead? | |||||
/* Types. */ | /* Types. */ | ||||
typedef void (*func_ptr_type)(void); | typedef void (*func_ptr_type)(void); | ||||
typedef void * (*path_enum_proc) (const char *path, size_t len, void *arg); | typedef void * (*path_enum_proc) (const char *path, size_t len, void *arg); | ||||
/* Variables that cannot be static: */ | /* Variables that cannot be static: */ | ||||
extern struct r_debug r_debug; /* For GDB */ | extern struct r_debug r_debug; /* For GDB */ | ||||
▲ Show 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | |||||
int dl_iterate_phdr(__dl_iterate_hdr_callback, void *) __exported; | int dl_iterate_phdr(__dl_iterate_hdr_callback, void *) __exported; | ||||
int _rtld_addr_phdr(const void *, struct dl_phdr_info *) __exported; | int _rtld_addr_phdr(const void *, struct dl_phdr_info *) __exported; | ||||
int _rtld_get_stack_prot(void) __exported; | int _rtld_get_stack_prot(void) __exported; | ||||
int _rtld_is_dlopened(void *) __exported; | int _rtld_is_dlopened(void *) __exported; | ||||
void _rtld_error(const char *, ...) __exported; | void _rtld_error(const char *, ...) __exported; | ||||
/* Only here to fix -Wmissing-prototypes warnings */ | /* Only here to fix -Wmissing-prototypes warnings */ | ||||
int __getosreldate(void); | int __getosreldate(void); | ||||
void __pthread_cxa_finalize(struct dl_phdr_info *a); | |||||
func_ptr_type _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp); | func_ptr_type _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp); | ||||
Elf_Addr _rtld_bind(Obj_Entry *obj, Elf_Size reloff); | Elf_Addr _rtld_bind(Obj_Entry *obj, Elf_Size reloff); | ||||
int npagesizes; | int npagesizes; | ||||
static int osreldate; | static int osreldate; | ||||
size_t *pagesizes; | size_t *pagesizes; | ||||
▲ Show 20 Lines • Show All 5,374 Lines • ▼ Show 20 Lines | __getosreldate(void) | ||||
oid[1] = KERN_OSRELDATE; | oid[1] = KERN_OSRELDATE; | ||||
osrel = 0; | osrel = 0; | ||||
len = sizeof(osrel); | len = sizeof(osrel); | ||||
error = sysctl(oid, 2, &osrel, &len, NULL, 0); | error = sysctl(oid, 2, &osrel, &len, NULL, 0); | ||||
if (error == 0 && osrel > 0 && len == sizeof(osrel)) | if (error == 0 && osrel > 0 && len == sizeof(osrel)) | ||||
osreldate = osrel; | osreldate = osrel; | ||||
return (osreldate); | return (osreldate); | ||||
} | } | ||||
void | |||||
exit(int status) | |||||
{ | |||||
_exit(status); | |||||
} | |||||
void (*__cleanup)(void); | |||||
int __isthreaded = 0; | |||||
int _thread_autoinit_dummy_decl = 1; | |||||
/* | |||||
* No unresolved symbols for rtld. | |||||
*/ | |||||
void | |||||
__pthread_cxa_finalize(struct dl_phdr_info *a __unused) | |||||
{ | |||||
} | |||||
const char * | const char * | ||||
rtld_strerror(int errnum) | rtld_strerror(int errnum) | ||||
{ | { | ||||
if (errnum < 0 || errnum >= sys_nerr) | if (errnum < 0 || errnum >= sys_nerr) | ||||
return ("Unknown error"); | return ("Unknown error"); | ||||
return (sys_errlist[errnum]); | return (sys_errlist[errnum]); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |
I added all these at the end of the include list, should I insert them alphabetically instead?