ld: resolve: search all images for symbols, rather than just direct links

This commit is contained in:
2026-03-22 19:05:47 +00:00
parent 44cd6c551a
commit 3e0fdb616c
5 changed files with 251 additions and 47 deletions

View File

@@ -344,6 +344,11 @@ struct elf_image {
size_t e_nr_links;
};
struct elf_symbol {
struct elf_image *sym_container;
const elf_sym_t *sym_info;
};
extern const char *elf_image_status_to_string(enum elf_image_status status);
extern int elf_image_open(const char *path, struct elf_image **out);
@@ -352,14 +357,25 @@ extern int elf_image_load(struct elf_image *img);
extern int elf_image_collect_dependencies(
struct elf_image *img,
struct image_list *dest);
extern int elf_image_add_dependency(
struct elf_image *img,
struct elf_image *dep);
extern int elf_image_link(struct elf_image *img);
extern void elf_image_close(struct elf_image *img);
extern virt_addr_t elf_image_find_symbol(
extern int elf_image_find_symbol(
struct elf_image *img,
const char *name);
extern virt_addr_t elf_image_find_linked_symbol(
const char *name,
struct elf_symbol *out);
extern int elf_image_find_symbol(
struct elf_image *img,
const char *name);
const char *name,
struct elf_symbol *out);
extern int elf_image_find_linked_symbol(
struct elf_image *img,
const char *name,
struct elf_symbol *out);
extern virt_addr_t find_global_symbol(const char *name);
#endif