Included NewOS change 1674. Moved private elf structures to elf_priv.h.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2320 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2002-12-30 13:34:25 +00:00
parent ed5c11d75a
commit 7fae070584
2 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,19 @@
/*
** Copyright 2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _KERNEL_ARCH_ELF_H
#define _KERNEL_ARCH_ELF_H
struct Elf32_Rel;
struct Elf32_Rela;
struct elf_image_info;
extern int arch_elf_relocate_rel(struct elf_image_info *image, const char *sym_prepend,
struct elf_image_info *resolve_image, struct Elf32_Rel *rel, int rel_len);
extern int arch_elf_relocate_rela(struct elf_image_info *image, const char *sym_prepend,
struct elf_image_info *resolve_image, struct Elf32_Rela *rel, int rel_len);
//#include <arch_elf.h>
#endif /* _KERNEL_ARCH_ELF_H */

View File

@ -0,0 +1,55 @@
/*
** 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>
struct elf_region {
region_id id;
addr start;
addr size;
long delta;
};
struct elf_image_info {
struct elf_image_info *next;
char *name;
image_id id;
int32 ref_count;
void *vnode;
struct elf_region regions[2]; // describes the text and data regions
addr 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;
unsigned int *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;
};
#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 int elf_resolve_symbol(struct elf_image_info *image, struct Elf32_Sym *sym,
struct elf_image_info *shared_image, const char *sym_prepend, addr *sym_addr);
#endif /* _KERNEL_ELF_PRIV_H */