haiku/headers/private/kernel/elf_priv.h
Axel Dörfler ecfed6a718 Added fields to hold debug symbol information.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7696 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-31 21:33:13 +00:00

66 lines
1.6 KiB
C

/*
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _KERNEL_ELF_PRIV_H
#define _KERNEL_ELF_PRIV_H
#include <elf32.h>
#include <image.h>
typedef struct elf_region {
area_id id;
addr_t start;
addr_t size;
long delta;
} elf_region;
struct elf_image_info {
struct elf_image_info *next; // next image in the hash
char *name;
image_id id;
int32 ref_count;
void *vnode;
elf_region regions[2]; // describes the text and data regions
addr_t dynamic_ptr; // pointer to the dynamic section
struct elf_linked_image *linked_images;
struct Elf32_Ehdr *eheader;
// pointer to symbol participation data structures
char *needed;
uint32 *symhash;
struct Elf32_Sym *syms;
char *strtab;
struct Elf32_Rel *rel;
int rel_len;
struct Elf32_Rela *rela;
int rela_len;
struct Elf32_Rel *pltrel;
int pltrel_len;
int pltrel_type;
struct Elf32_Sym *debug_symbols;
uint32 num_debug_symbols;
const char *debug_string_table;
};
#define STRING(image, offset) ((char *)(&(image)->strtab[(offset)]))
#define SYMNAME(image, sym) STRING(image, (sym)->st_name)
#define SYMBOL(image, num) ((struct Elf32_Sym *)&(image)->syms[num])
#define HASHTABSIZE(image) ((image)->symhash[0])
#define HASHBUCKETS(image) ((unsigned int *)&(image)->symhash[2])
#define HASHCHAINS(image) ((unsigned int *)&(image)->symhash[2+HASHTABSIZE(image)])
extern
#ifdef __cplusplus
"C"
#endif
status_t elf_resolve_symbol(struct elf_image_info *image, struct Elf32_Sym *sym,
struct elf_image_info *shared_image, const char *sym_prepend, addr_t *sym_addr);
#endif /* _KERNEL_ELF_PRIV_H */