link_elf.c (c143d6c24ad906e431d561038544af65d1eb6670) | link_elf.c (1aeb23cdfad85fbb0905ff47a30c712552253c46) |
---|---|
1/*- 2 * Copyright (c) 1998-2000 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 208 unchanged lines hidden (view full) --- 217 */ 218static int 219link_elf_link_common_finish(linker_file_t lf) 220{ 221#ifdef DDB 222 elf_file_t ef = (elf_file_t)lf; 223 char *newfilename; 224#endif | 1/*- 2 * Copyright (c) 1998-2000 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 208 unchanged lines hidden (view full) --- 217 */ 218static int 219link_elf_link_common_finish(linker_file_t lf) 220{ 221#ifdef DDB 222 elf_file_t ef = (elf_file_t)lf; 223 char *newfilename; 224#endif |
225 int error; |
|
225 | 226 |
227 /* Notify MD code that a module is being loaded. */ 228 error = elf_cpu_load_file(lf); 229 if (error) 230 return (error); 231 |
|
226#ifdef DDB 227 GDB_STATE(RT_ADD); 228 ef->gdb.l_addr = lf->address; 229 newfilename = malloc(strlen(lf->filename) + 1, M_LINKER, M_WAITOK); 230 strcpy(newfilename, lf->filename); 231 ef->gdb.l_name = newfilename; 232 ef->gdb.l_ld = ef->dynamic; 233 link_elf_add_gdb(&ef->gdb); --- 599 unchanged lines hidden (view full) --- 833 if (ef->gdb.l_ld) { 834 GDB_STATE(RT_DELETE); 835 free((void *)(uintptr_t)ef->gdb.l_name, M_LINKER); 836 link_elf_delete_gdb(&ef->gdb); 837 GDB_STATE(RT_CONSISTENT); 838 } 839#endif 840 | 232#ifdef DDB 233 GDB_STATE(RT_ADD); 234 ef->gdb.l_addr = lf->address; 235 newfilename = malloc(strlen(lf->filename) + 1, M_LINKER, M_WAITOK); 236 strcpy(newfilename, lf->filename); 237 ef->gdb.l_name = newfilename; 238 ef->gdb.l_ld = ef->dynamic; 239 link_elf_add_gdb(&ef->gdb); --- 599 unchanged lines hidden (view full) --- 839 if (ef->gdb.l_ld) { 840 GDB_STATE(RT_DELETE); 841 free((void *)(uintptr_t)ef->gdb.l_name, M_LINKER); 842 link_elf_delete_gdb(&ef->gdb); 843 GDB_STATE(RT_CONSISTENT); 844 } 845#endif 846 |
847 /* Notify MD code that a module is being unloaded. */ 848 elf_cpu_unload_file(file); 849 |
|
841 if (ef->preloaded) { 842 link_elf_unload_preload(file); 843 return; 844 } 845 846#ifdef SPARSE_MAPPING 847 if (ef->object) { 848 vm_map_remove(kernel_map, (vm_offset_t) ef->address, --- 402 unchanged lines hidden --- | 850 if (ef->preloaded) { 851 link_elf_unload_preload(file); 852 return; 853 } 854 855#ifdef SPARSE_MAPPING 856 if (ef->object) { 857 vm_map_remove(kernel_map, (vm_offset_t) ef->address, --- 402 unchanged lines hidden --- |