diff options
author | Marcel Moolenaar <marcel@FreeBSD.org> | 2002-10-19 18:43:37 +0000 |
---|---|---|
committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2002-10-19 18:43:37 +0000 |
commit | 1720979bc5f7c4e7851c2a22e6dacdef85d276f0 (patch) | |
tree | 6af75cc953cf37dce3314fea59a149944433b85a /sys/kern/link_elf.c | |
parent | f4ecdf056e29bda18b069adfb623e95a3d962d3e (diff) | |
download | src-1720979bc5f7c4e7851c2a22e6dacdef85d276f0.tar.gz src-1720979bc5f7c4e7851c2a22e6dacdef85d276f0.zip |
Non-functional change in preparation of the next commit:
Move link_elf_add_gdb(), link_elf_delete_gdb() and link_elf_error()
near the top of the file. The *_gdb() functions are moved inside
the #ifdef DDB already present there.
Notes
Notes:
svn path=/head/; revision=105467
Diffstat (limited to 'sys/kern/link_elf.c')
-rw-r--r-- | sys/kern/link_elf.c | 77 |
1 files changed, 36 insertions, 41 deletions
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 596089a6e874..6bab2810879a 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -160,7 +160,36 @@ r_debug_state(struct r_debug *dummy_one __unused, { } -#endif +static void +link_elf_add_gdb(struct link_map *l) +{ + struct link_map *prev; + + /* + * Scan to the end of the list. + */ + for (prev = r_debug.r_map; prev->l_next != NULL; prev = prev->l_next) + ; + + /* Link in the new entry. */ + l->l_prev = prev; + l->l_next = prev->l_next; + prev->l_next = l; +} + +static void +link_elf_delete_gdb(struct link_map *l) +{ + if (l->l_prev == NULL) { + if ((r_debug.r_map = l->l_next) != NULL) + l->l_next->l_prev = NULL; + return; + } + + if ((l->l_prev->l_next = l->l_next) != NULL) + l->l_next->l_prev = l->l_prev; +} +#endif /* DDB */ #ifdef __ia64__ Elf_Addr link_elf_get_gp(linker_file_t); @@ -172,6 +201,12 @@ Elf_Addr link_elf_get_gp(linker_file_t); extern struct _dynamic _DYNAMIC; static void +link_elf_error(const char *s) +{ + printf("kldload: %s\n", s); +} + +static void link_elf_init(void* arg) { Elf_Dyn *dp; @@ -378,46 +413,6 @@ parse_dynamic(elf_file_t ef) return 0; } -static void -link_elf_error(const char *s) -{ - printf("kldload: %s\n", s); -} - -#ifdef DDB - -static void -link_elf_add_gdb(struct link_map *l) -{ - struct link_map *prev; - - /* - * Scan to the end of the list. - */ - for (prev = r_debug.r_map; prev->l_next != NULL; prev = prev->l_next) - ; - - /* Link in the new entry. */ - l->l_prev = prev; - l->l_next = prev->l_next; - prev->l_next = l; -} - -static void -link_elf_delete_gdb(struct link_map *l) -{ - if (l->l_prev == NULL) { - if ((r_debug.r_map = l->l_next) != NULL) - l->l_next->l_prev = NULL; - return; - } - - if ((l->l_prev->l_next = l->l_next) != NULL) - l->l_next->l_prev = l->l_prev; -} - -#endif /* DDB */ - static int link_elf_link_preload(linker_class_t cls, const char* filename, linker_file_t *result) |