kern_linker.c (f41325db5f16640212574a03b9a34e5ed4a884ca) | kern_linker.c (09dbb40410f39cdc5bd25bd2bdc445e423eb7063) |
---|---|
1/*- 2 * Copyright (c) 1997-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 --- 317 unchanged lines hidden (view full) --- 326 error = ENOEXEC; /* Format not recognised (or unloadable) */ 327 else 328 error = ENOENT; /* Nothing found */ 329 330out: 331 return error; 332} 333 | 1/*- 2 * Copyright (c) 1997-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 --- 317 unchanged lines hidden (view full) --- 326 error = ENOEXEC; /* Format not recognised (or unloadable) */ 327 else 328 error = ENOENT; /* Nothing found */ 329 330out: 331 return error; 332} 333 |
334int 335linker_reference_module(const char *modname, linker_file_t *result) 336{ 337 char *pathname; 338 int res; 339 340 /* 341 * There will be a system to look up or guess a file name from 342 * a module name. 343 * For now we just try to load a file with the same name. 344 */ 345 if ((pathname = linker_search_path(modname)) == NULL) 346 return (ENOENT); 347 348 /* 349 * If the module is already loaded or built into the kernel, 350 * linker_load_file() simply bumps it's refcount. 351 */ 352 res = linker_load_file(pathname, result); 353 354 free(pathname, M_LINKER); 355 356 return (res); 357} 358 |
|
334linker_file_t 335linker_find_file_by_name(const char* filename) 336{ 337 linker_file_t lf = 0; 338 char *koname; 339 340 koname = malloc(strlen(filename) + 4, M_LINKER, M_WAITOK); 341 if (koname == NULL) --- 1082 unchanged lines hidden --- | 359linker_file_t 360linker_find_file_by_name(const char* filename) 361{ 362 linker_file_t lf = 0; 363 char *koname; 364 365 koname = malloc(strlen(filename) + 4, M_LINKER, M_WAITOK); 366 if (koname == NULL) --- 1082 unchanged lines hidden --- |