OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [conts/] [posix/] [mm0/] [include/] [lib/] [elf/] [elfsect.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * Definitions for ELF Sections
3
 * Based on Portable Formats Specification v1.1
4
 *
5
 * Copyright (C) 2008 Bahadir Balban
6
 */
7
 
8
#ifndef __ELFSECT_H__
9
#define __ELFSECT_H__
10
 
11
#include <l4/types.h>
12
 
13
/* Special section indices */
14
#define SHN_UNDEF                       0
15
#define SHN_LORESERVE                   0xFF00
16
#define SHN_LOPROC                      0xFF00
17
#define SHN_HIPROC                      0xFF1F
18
#define SHN_ABS                         0xFFF1
19
#define SHN_COMMON                      0xFFF2
20
#define SHN_HIRESERVE                   0xFFFF
21
 
22
 
23
struct elf_section_header {
24
        u32     sh_name;        /* Index to section header str table for name */
25
        u32     sh_type;        /* Categorises section's semantics */
26
        u32     sh_flags;       /* Flags that define various attributes */
27
        u32     sh_addr;        /* Virtual address for section */
28
        u32     sh_offset;      /* Offset to contents from file beginning */
29
        u32     sh_size;        /* Size of section (note SHT_NOBITS) */
30
        u32     sh_link;
31
        u32     sh_info;        /* Extra section info */
32
        u32     sh_addralign;   /* Section alignment in power of 2 */
33
        u32     sh_entsize;     /* Size of each entry if fixed */
34
} __attribute__((__packed__));
35
 
36
/* Section type codes */
37
#define SHT_NULL                        0        /* Inactive */
38
#define SHT_PROGBITS                    1       /* Program contents */
39
#define SHT_SYMTAB                      2       /* Symbol table */
40
#define SHT_STRTAB                      3       /* String table */
41
#define SHT_RELA                        4       /* Relocation entries */
42
#define SHT_HASH                        5       /* Symbol hash table */
43
#define SHT_DYNAMIC                     6       /* Dynamic linking info */
44
#define SHT_NOTE                        7       /* Optional, additional info */
45
#define SHT_NOBITS                      8       /* Does not occupy file space */
46
#define SHT_REL                         9       /* Relocation entries */
47
#define SHT_SHLIB                       10      /* Reserved */
48
#define SHT_DYNSYM                      11      /* Symbols for dynamic linking */
49
#define SHT_LOPROC              0x70000000      /* Reserved for processors */
50
#define SHT_HIPROC              0x7FFFFFFF      /* Reserved for processors */
51
#define SHT_LOUSER              0x80000000      /* Reserved for user progs */
52
#define SHT_HIUSER              0xFFFFFFFF      /* Reserved for user progs */
53
 
54
/* Section attribute flags */
55
#define SHF_WRITE               (1 << 0)        /* Writeable */
56
#define SHF_ALLOC               (1 << 1)        /* Occupies actual memory */
57
#define SHF_EXECINSTR           (1 << 2)        /* Executable */
58
#define SHF_MASCPROC            0xF0000000      /* Reserved for processors */
59
 
60
#endif /* __ELFSECT_H__ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.