home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1999 March B
/
SCO_CASTOR4RRT.iso
/
uccs
/
root.14
/
udk
/
usr
/
include
/
link.h
< prev
next >
Wrap
C/C++ Source or Header
|
1998-08-19
|
4KB
|
115 lines
/*
* Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE
* SANTA CRUZ OPERATION INC.
*
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
*/
#ifndef _LINK_H
#define _LINK_H
#ident "@(#)sgs-head:i386/head/link.h 1.17"
#include <sys/elftypes.h>
/* declarations for structures contained in the dynamic
* section of executable files and shared objects
*/
/* The following data structure provides a self-identifying
* union consisting of a tag from a known list and a value.
*/
typedef struct {
Elf32_Sword d_tag; /* how to interpret value */
union {
Elf32_Word d_val;
Elf32_Addr d_ptr;
Elf32_Off d_off;
} d_un;
} Elf32_Dyn;
/* valid tag values */
#define DT_NULL 0 /* last entry in list */
#define DT_NEEDED 1 /* list of needed objects */
#define DT_PLTRELSZ 2 /* size of relocations for the PLT */
#define DT_PLTGOT 3 /* addresses used by procedure linkage table */
#define DT_HASH 4 /* hash table */
#define DT_STRTAB 5 /* string table */
#define DT_SYMTAB 6 /* symbol table */
#define DT_RELA 7 /* addr of relocation entries */
#define DT_RELASZ 8 /* size of relocation table */
#define DT_RELAENT 9 /* base size of relocation entry */
#define DT_STRSZ 10 /* size of string table */
#define DT_SYMENT 11 /* size of symbol table entry */
#define DT_INIT 12 /* _init addr */
#define DT_FINI 13 /* _fini addr */
#define DT_SONAME 14 /* name of this shared object */
#define DT_RPATH 15 /* run-time search path */
#define DT_SYMBOLIC 16 /* shared object linked -Bsymbolic */
#define DT_REL 17 /* addr of relocation entries */
#define DT_RELSZ 18 /* size of relocation table */
#define DT_RELENT 19 /* base size of relocation entry */
#define DT_PLTREL 20 /* relocation type for PLT entry */
#define DT_DEBUG 21 /* pointer to r_debug structure */
#define DT_TEXTREL 22 /* text relocations for this object */
#define DT_JMPREL 23 /* pointer to the PLT relocation entries */
#define DT_BIND_NOW 24 /* object linked with -Bbind_now */
#define DT_FPATH (-1) /* pathname of file to be opened */
#define DT_MODE (-2) /* function binding mode */
#define DT_MAP (-3) /* pointer to link_map */
#define DT_MAP_NODELETE (-4) /* pointer to link_map */
#define DT_MAXPOSTAGS 25 /* number of positive tags */
#define DT_MAXNEGTAGS 4 /* number of negative tags */
#define DT_LOPROC 0x70000000 /* processor specific range */
#define DT_HIPROC 0x7fffffff
#define DT_RANGES 0x50000000 /* addr of eh_ranges entries */
#define DT_RANGES_SZ 0x50000001 /* sz of eh_ranges entries */
#define DT_DELAY_REL 0x50000002 /* addr of delayed relocs */
#define DT_DELAY_RELSZ 0x50000003 /* size of delayed reloc table */
#define DT_DELAY_RELENT 0x50000004 /* size of delayed relocs entries*/
/* public structure defined and maintained within the run-time
* linker
*/
struct link_map {
unsigned long l_addr; /* address at which object is mapped */
char *l_name; /* full name of loaded object */
Elf32_Dyn *l_ld; /* dynamic structure of object */
struct link_map *l_next; /* next link object */
struct link_map *l_prev; /* previous link object */
unsigned long l_tstart; /* vaddr of first RO-exec segment */
unsigned long l_tsize; /* size of first RO-exec segment */
void *l_eh_ranges; /* address of eh_ranges section */
unsigned long l_eh_ranges_sz; /* size of eh_ranges section */
};
enum _r_state {
RT_CONSISTENT,
RT_ADD,
RT_DELETE,
RT_ALTERNATE_RTLD,
RT_SYMBOLS_AVAILABLE,
RT_SYSTEM_INIT,
};
struct r_debug {
int r_version; /* debugging info version no. */
struct link_map *r_map; /* address of link_map */
unsigned long r_brk; /* address of update routine */
enum _r_state r_state; /* current state of map */
unsigned long r_ldbase; /* base addr of ld.so */
};
#endif /*_LINK_H*/