annotate agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSectionHeader.java @ 0:a61af66fc99e jdk7-b24

Initial load
author duke
date Sat, 01 Dec 2007 00:00:00 +0000
parents
children c18cbe5936b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
2 * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 package sun.jvm.hotspot.debugger.posix.elf;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 public interface ELFSectionHeader {
a61af66fc99e Initial load
duke
parents:
diff changeset
28 /** Undefined section header index. */
a61af66fc99e Initial load
duke
parents:
diff changeset
29 public static final int NDX_UNDEFINED = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
30 /** Lower bound section header index. */
a61af66fc99e Initial load
duke
parents:
diff changeset
31 public static final int NDX_LORESERVE = 0xff00;
a61af66fc99e Initial load
duke
parents:
diff changeset
32 /** Lower bound section header index reserved for processor specific
a61af66fc99e Initial load
duke
parents:
diff changeset
33 * semantics. */
a61af66fc99e Initial load
duke
parents:
diff changeset
34 public static final int NDX_LOPROC = 0xff00;
a61af66fc99e Initial load
duke
parents:
diff changeset
35 /** Upper bound section header index reserved for processor specific
a61af66fc99e Initial load
duke
parents:
diff changeset
36 * semantics. */
a61af66fc99e Initial load
duke
parents:
diff changeset
37 public static final int NDX_HIPROC = 0xff1f;
a61af66fc99e Initial load
duke
parents:
diff changeset
38 /** Absolute values for the corresponding reference. Symbols defined
a61af66fc99e Initial load
duke
parents:
diff changeset
39 * relative to section number NDX_ABS have absolute values and are not
a61af66fc99e Initial load
duke
parents:
diff changeset
40 * affected by relocation. */
a61af66fc99e Initial load
duke
parents:
diff changeset
41 public static final int NDX_ABS = 0xfff1;
a61af66fc99e Initial load
duke
parents:
diff changeset
42 /** Symbols defined relative to this section are common symbols, such
a61af66fc99e Initial load
duke
parents:
diff changeset
43 * as FORTRAN, COMMON or unallocated C external variables. */
a61af66fc99e Initial load
duke
parents:
diff changeset
44 public static final int NDX_COMMON = 0xfff2;
a61af66fc99e Initial load
duke
parents:
diff changeset
45 /** Upper bound section header index. */
a61af66fc99e Initial load
duke
parents:
diff changeset
46 public static final int NDX_HIRESERVE = 0xffff;
a61af66fc99e Initial load
duke
parents:
diff changeset
47
a61af66fc99e Initial load
duke
parents:
diff changeset
48 /** Section is inactive. */
a61af66fc99e Initial load
duke
parents:
diff changeset
49 public static final int TYPE_NULL = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
50 /** Section holds information defined by the program. */
a61af66fc99e Initial load
duke
parents:
diff changeset
51 public static final int TYPE_PROGBITS = 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
52 /** Section holds symbol table information for link editing. It may also
a61af66fc99e Initial load
duke
parents:
diff changeset
53 * be used to store symbols for dynamic linking. */
a61af66fc99e Initial load
duke
parents:
diff changeset
54 public static final int TYPE_SYMTBL = 2;
a61af66fc99e Initial load
duke
parents:
diff changeset
55 /** Section holds string table information. */
a61af66fc99e Initial load
duke
parents:
diff changeset
56 public static final int TYPE_STRTBL = 3;
a61af66fc99e Initial load
duke
parents:
diff changeset
57 /** Section holds relocation entries with explicit addends. */
a61af66fc99e Initial load
duke
parents:
diff changeset
58 public static final int TYPE_RELO_EXPLICIT = 4;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 /** Section holds symbol hash table. */
a61af66fc99e Initial load
duke
parents:
diff changeset
60 public static final int TYPE_HASH = 5;
a61af66fc99e Initial load
duke
parents:
diff changeset
61 /** Section holds information for dynamic linking. */
a61af66fc99e Initial load
duke
parents:
diff changeset
62 public static final int TYPE_DYNAMIC = 6;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 /** Section holds information that marks the file. */
a61af66fc99e Initial load
duke
parents:
diff changeset
64 public static final int TYPE_NOTE = 7;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 /** Section occupies no space but resembles TYPE_PROGBITS. */
a61af66fc99e Initial load
duke
parents:
diff changeset
66 public static final int TYPE_NOBITS = 8;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 /** Section holds relocation entries without explicit addends. */
a61af66fc99e Initial load
duke
parents:
diff changeset
68 public static final int TYPE_RELO = 9;
a61af66fc99e Initial load
duke
parents:
diff changeset
69 /** Section is reserved but has unspecified semantics. */
a61af66fc99e Initial load
duke
parents:
diff changeset
70 public static final int TYPE_SHLIB = 10;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 /** Section holds a minimum set of dynamic linking symbols. */
a61af66fc99e Initial load
duke
parents:
diff changeset
72 public static final int TYPE_DYNSYM = 11;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 /** Lower bound section type that contains processor specific semantics. */
a61af66fc99e Initial load
duke
parents:
diff changeset
74 public static final int TYPE_LOPROC = 0x70000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 /** Upper bound section type that contains processor specific semantics. */
a61af66fc99e Initial load
duke
parents:
diff changeset
76 public static final int TYPE_HIPROC = 0x7fffffff;
a61af66fc99e Initial load
duke
parents:
diff changeset
77 /** Lower bound of the range of indexes reserved for application
a61af66fc99e Initial load
duke
parents:
diff changeset
78 * programs. */
a61af66fc99e Initial load
duke
parents:
diff changeset
79 public static final int TYPE_LOUSER = 0x80000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
80 /** Upper bound of the range of indexes reserved for application
a61af66fc99e Initial load
duke
parents:
diff changeset
81 * programs. */
a61af66fc99e Initial load
duke
parents:
diff changeset
82 public static final int TYPE_HIUSER = 0xffffffff;
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84 /** Flag informing that this section contains data that should be writable
a61af66fc99e Initial load
duke
parents:
diff changeset
85 * during process execution. */
a61af66fc99e Initial load
duke
parents:
diff changeset
86 public static final int FLAG_WRITE = 0x1;
a61af66fc99e Initial load
duke
parents:
diff changeset
87 /** Flag informing that section occupies memory during process
a61af66fc99e Initial load
duke
parents:
diff changeset
88 * execution. */
a61af66fc99e Initial load
duke
parents:
diff changeset
89 public static final int FLAG_ALLOC = 0x2;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 /** Flag informaing that section contains executable machine
a61af66fc99e Initial load
duke
parents:
diff changeset
91 * instructions. */
a61af66fc99e Initial load
duke
parents:
diff changeset
92 public static final int FLAG_EXEC_INSTR = 0x4;
a61af66fc99e Initial load
duke
parents:
diff changeset
93 /** Flag informing that all the bits in the mask are reserved for processor
a61af66fc99e Initial load
duke
parents:
diff changeset
94 * specific semantics. */
a61af66fc99e Initial load
duke
parents:
diff changeset
95 public static final int FLAG_MASK = 0xf0000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
96
a61af66fc99e Initial load
duke
parents:
diff changeset
97 /** Section header name identifying the section as a string table. */
a61af66fc99e Initial load
duke
parents:
diff changeset
98 public static final String STRING_TABLE_NAME = ".strtab";
a61af66fc99e Initial load
duke
parents:
diff changeset
99 /** Section header name identifying the section as a dynamic string
a61af66fc99e Initial load
duke
parents:
diff changeset
100 * table. */
a61af66fc99e Initial load
duke
parents:
diff changeset
101 public static final String DYNAMIC_STRING_TABLE_NAME = ".dynstr";
a61af66fc99e Initial load
duke
parents:
diff changeset
102 /** Returns the type of section header. */
a61af66fc99e Initial load
duke
parents:
diff changeset
103 public int getType();
a61af66fc99e Initial load
duke
parents:
diff changeset
104 /** Returns the number of symbols in this section or 0 if none. */
a61af66fc99e Initial load
duke
parents:
diff changeset
105 public int getNumberOfSymbols();
a61af66fc99e Initial load
duke
parents:
diff changeset
106 /** Returns the symbol at the specified index. The ELF symbol at index 0
a61af66fc99e Initial load
duke
parents:
diff changeset
107 * is the undefined symbol. */
a61af66fc99e Initial load
duke
parents:
diff changeset
108 public ELFSymbol getELFSymbol(int index);
a61af66fc99e Initial load
duke
parents:
diff changeset
109 /** Returns the string table for this section or null if one does not
a61af66fc99e Initial load
duke
parents:
diff changeset
110 * exist. */
a61af66fc99e Initial load
duke
parents:
diff changeset
111 public ELFStringTable getStringTable();
a61af66fc99e Initial load
duke
parents:
diff changeset
112 /** Returns the hash table for this section or null if one does not
a61af66fc99e Initial load
duke
parents:
diff changeset
113 * exist. NOTE: currently the ELFHashTable does not work and this method
a61af66fc99e Initial load
duke
parents:
diff changeset
114 * will always return null. */
a61af66fc99e Initial load
duke
parents:
diff changeset
115 public ELFHashTable getHashTable();
a61af66fc99e Initial load
duke
parents:
diff changeset
116 public int getLink();
a61af66fc99e Initial load
duke
parents:
diff changeset
117 /** Returns the name of the section or null if the section has no name. */
a61af66fc99e Initial load
duke
parents:
diff changeset
118 public String getName();
a61af66fc99e Initial load
duke
parents:
diff changeset
119 /** Returns the offset in bytes to the beginning of the section. */
a61af66fc99e Initial load
duke
parents:
diff changeset
120 public int getOffset();
a61af66fc99e Initial load
duke
parents:
diff changeset
121 }