2 * Copyright 2002-2007, Haiku Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT license.
5 * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
6 * Distributed under the terms of the NewOS License.
8 #ifndef _KERNEL_ELF_PRIV_H
9 #define _KERNEL_ELF_PRIV_H
12 #include <elf_private.h>
17 struct elf_version_info
;
20 typedef struct elf_region
{
27 struct elf_image_info
{
28 struct elf_image_info
* next
; // next image in the hash
33 elf_region text_region
;
34 elf_region data_region
;
35 addr_t dynamic_section
; // pointer to the dynamic section
36 struct elf_linked_image
* linked_images
;
42 // pointer to symbol participation data structures
55 elf_sym
* debug_symbols
;
56 uint32 num_debug_symbols
;
57 const char* debug_string_table
;
59 // versioning related structures
60 uint32 num_version_definitions
;
61 elf_verdef
* version_definitions
;
62 uint32 num_needed_versions
;
63 elf_verneed
* needed_versions
;
64 elf_versym
* symbol_versions
;
65 struct elf_version_info
* versions
;
70 #define STRING(image, offset) ((char*)(&(image)->strtab[(offset)]))
71 #define SYMNAME(image, sym) STRING(image, (sym)->st_name)
72 #define SYMBOL(image, num) (&(image)->syms[num])
73 #define HASHTABSIZE(image) ((image)->symhash[0])
74 #define HASHBUCKETS(image) ((unsigned int*)&(image)->symhash[2])
75 #define HASHCHAINS(image) ((unsigned int*)&(image)->symhash[2+HASHTABSIZE(image)])
82 extern status_t
elf_resolve_symbol(struct elf_image_info
* image
,
83 elf_sym
* symbol
, struct elf_image_info
* sharedImage
,
84 addr_t
* _symbolAddress
);
91 #endif /* _KERNEL_ELF_PRIV_H */