Rev 5191 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5191 | serge | 1 | /* Special version of |
6324 | serge | 2 | Copyright (C) 1988-2015 Free Software Foundation, Inc. |
5191 | serge | 3 | |
4 | This program is free software; you can redistribute it and/or modify |
||
5 | it under the terms of the GNU General Public License as published by |
||
6 | the Free Software Foundation; either version 3 of the License, or |
||
7 | (at your option) any later version. |
||
8 | |||
9 | This program is distributed in the hope that it will be useful, |
||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
12 | GNU General Public License for more details. |
||
13 | |||
14 | You should have received a copy of the GNU General Public License |
||
15 | along with this program; if not, write to the Free Software |
||
16 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
||
17 | MA 02110-1301, USA. */ |
||
18 | |||
19 | struct hp300hpux_exec_bytes |
||
20 | { |
||
21 | unsigned char e_info[4]; /* a_machtype/a_magic */ |
||
22 | unsigned char e_spare1[4]; |
||
23 | unsigned char e_spare2[4]; |
||
24 | unsigned char e_text[4]; /* length of text, in bytes */ |
||
25 | unsigned char e_data[4]; /* length of data, in bytes */ |
||
26 | unsigned char e_bss[4]; /* length of uninitialized data area , in bytes */ |
||
27 | unsigned char e_trsize[4]; /* length of relocation info for text, in bytes*/ |
||
28 | unsigned char e_drsize[4]; /* length of relocation info for data, in bytes*/ |
||
29 | unsigned char e_passize[4];/* HP = pascal interface size */ |
||
30 | unsigned char e_syms[4]; /* HP = symbol table size */ |
||
31 | unsigned char e_spare5[4]; /* HP = debug name table size */ |
||
32 | unsigned char e_entry[4]; /* start address */ |
||
33 | unsigned char e_spare6[4]; /* HP = source line table size */ |
||
34 | unsigned char e_supsize[4];/* HP = value table size */ |
||
35 | unsigned char e_drelocs[4]; |
||
36 | unsigned char e_extension[4]; /* file offset of extension */ |
||
37 | }; |
||
38 | #define EXEC_BYTES_SIZE 64 |
||
39 | |||
40 | struct hp300hpux_nlist_bytes |
||
41 | { |
||
42 | unsigned char e_value[4]; |
||
43 | unsigned char e_type[1]; |
||
44 | unsigned char e_length[1]; /* length of ascii symbol name */ |
||
45 | unsigned char e_almod[2]; /* alignment mod */ |
||
46 | unsigned char e_shlib[2]; /* info about dynamic linking */ |
||
47 | }; |
||
48 | #define EXTERNAL_NLIST_SIZE 10 |
||
49 | |||
50 | struct hp300hpux_reloc |
||
51 | { |
||
52 | unsigned char r_address[4];/* offset of of data to relocate */ |
||
53 | unsigned char r_index[2]; /* symbol table index of symbol */ |
||
54 | unsigned char r_type[1]; /* relocation type */ |
||
55 | unsigned char r_length[1]; /* length of item to reloc */ |
||
56 | }; |
||
57 | |||
58 | struct hp300hpux_header_extension |
||
59 | { |
||
60 | unsigned char e_syms[4]; |
||
61 | unsigned char unique_headers[12*4]; |
||
62 | unsigned char e_header[2]; /* type of header */ |
||
63 | unsigned char e_version[2]; /* version */ |
||
64 | unsigned char e_size[4]; /* bytes following*/ |
||
65 | unsigned char e_extension[4];/* file offset of next extension */ |
||
66 | }; |
||
67 | #define EXTERNAL_EXTENSION_HEADER_SIZE (16*4) |
||
68 | |||
69 | /* hpux separates object files (0x106) and impure executables (0x107) */ |
||
70 | /* but the bfd code does not distinguish between them. Since we want to*/ |
||
71 | /* read hpux .o files, we add an special define and use it below in */ |
||
72 | /* offset and address calculations. */ |
||
73 | |||
74 | #define HPUX_DOT_O_MAGIC 0x106 |
||
75 | #define OMAGIC 0x107 /* object file or impure executable. */ |
||
76 | #define NMAGIC 0x108 /* Code indicating pure executable. */ |
||
77 | #define ZMAGIC 0x10B /* demand-paged executable. */ |
||
78 | |||
79 | #define N_HEADER_IN_TEXT(x) 0 |
||
80 | |||
81 | #if 0 /* libaout.h only uses the lower 8 bits */ |
||
82 | #define HP98x6_ID 0x20A |
||
83 | #define HP9000S200_ID 0x20C |
||
84 | #endif |
||
85 | #define HP98x6_ID 0x0A |
||
86 | #define HP9000S200_ID 0x0C |
||
87 | |||
88 | #define N_BADMAG(x) ((_N_BADMAG (x)) || (_N_BADMACH (x))) |
||
89 | |||
90 | #define N_DATADDR(x) \ |
||
91 | ((N_MAGIC (x) == OMAGIC || N_MAGIC (x) == HPUX_DOT_O_MAGIC) \ |
||
92 | ? (N_TXTADDR (x) + N_TXTSIZE (x)) \ |
||
93 | : (N_SEGSIZE (x) + ((N_TXTADDR (x) + N_TXTSIZE (x) - 1) \ |
||
94 | & ~ (bfd_vma) (N_SEGSIZE (x) - 1)))) |
||
95 | |||
96 | #define _N_BADMACH(x) \ |
||
97 | (((N_MACHTYPE (x)) != HP9000S200_ID) && ((N_MACHTYPE (x)) != HP98x6_ID)) |
||
98 | |||
99 | #define _N_BADMAG(x) (N_MAGIC(x) != HPUX_DOT_O_MAGIC \ |
||
100 | && N_MAGIC(x) != OMAGIC \ |
||
101 | && N_MAGIC(x) != NMAGIC \ |
||
102 | && N_MAGIC(x) != ZMAGIC ) |
||
103 | |||
104 | #undef _N_HDROFF |
||
105 | #define _N_HDROFF(x) (SEGMENT_SIZE - (sizeof (struct exec))) |
||
106 | |||
107 | #undef N_DATOFF |
||
108 | #undef N_PASOFF |
||
109 | #undef N_SYMOFF |
||
110 | #undef N_SUPOFF |
||
111 | #undef N_TRELOFF |
||
112 | #undef N_DRELOFF |
||
113 | #undef N_STROFF |
||
114 | |||
115 | #define N_DATOFF(x) ( N_TXTOFF(x) + N_TXTSIZE(x) ) |
||
116 | #define N_PASOFF(x) ( N_DATOFF(x) + (x).a_data) |
||
117 | #define N_SYMOFF(x) ( N_PASOFF(x) /* + (x).a_passize*/ ) |
||
118 | #define N_SUPOFF(x) ( N_SYMOFF(x) + (x).a_syms ) |
||
119 | #define N_TRELOFF(x) ( N_SUPOFF(x) /* + 0 (x).a_supsize*/ ) |
||
120 | #define N_DRELOFF(x) ( N_TRELOFF(x) + (x).a_trsize ) |
||
121 | #define N_EXTHOFF(x) ( N_DRELOFF(x) /* + 0 (x).a_drsize */) |
||
122 | #define N_STROFF(x) ( 0 /* no string table */ ) |
||
123 | |||
124 | /* use these when the file has gnu symbol tables */ |
||
125 | #define N_GNU_TRELOFF(x) (N_DATOFF(x) + (x).a_data) |
||
126 | #define N_GNU_DRELOFF(x) (N_GNU_TRELOFF(x) + (x).a_trsize) |
||
127 | #define N_GNU_SYMOFF(x) (N_GNU_DRELOFF(x) + (x).a_drsize) |
||
128 | |||
129 | #define TARGET_PAGE_SIZE 0x1000 |
||
130 | #define SEGMENT_SIZE 0x1000 |
||
131 | #define TEXT_START_ADDR 0 |