Changeset 609 for branches/GNU/src/binutils/bfd/libpei.h
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/bfd/libpei.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Support for the generic parts of PE/PEI; common header information. 2 Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 2 Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 3 3 Free Software Foundation, Inc. 4 4 Written by Cygnus Solutions. 5 5 6 This file is part of BFD, the Binary File Descriptor library. 7 8 This program is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2 of the License, or 11 (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 21 22 /* 23 Most of this hacked by Steve Chamberlain, 6 This file is part of BFD, the Binary File Descriptor library. 7 8 This program is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2 of the License, or 11 (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 21 22 /* Most of this hacked by Steve Chamberlain, 24 23 sac@cygnus.com 25 24 26 PE/PEI rearrangement (and code added): Donn Terry 27 Softway Systems, Inc. 28 */ 25 PE/PEI rearrangement (and code added): Donn Terry 26 Softway Systems, Inc. */ 29 27 30 28 /* Hey look, some documentation [and in a place you expect to find it]! … … 54 52 FIXME: Please add more docs here so the next poor fool that has to hack 55 53 on this code has a chance of getting something accomplished without 56 wasting too much time. 57 */ 54 wasting too much time. */ 58 55 59 56 #ifndef GET_FCN_LNNOPTR 60 57 #define GET_FCN_LNNOPTR(abfd, ext) \ 61 bfd_h_get_32(abfd, (bfd_byte *)ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)58 H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr) 62 59 #endif 63 60 64 61 #ifndef GET_FCN_ENDNDX 65 #define GET_FCN_ENDNDX(abfd, ext) 66 bfd_h_get_32(abfd, (bfd_byte *)ext->x_sym.x_fcnary.x_fcn.x_endndx)62 #define GET_FCN_ENDNDX(abfd, ext) \ 63 H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_endndx) 67 64 #endif 68 65 69 66 #ifndef PUT_FCN_LNNOPTR 70 #define PUT_FCN_LNNOPTR(abfd, in, ext) bfd_h_put_32(abfd, in, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr) 67 #define PUT_FCN_LNNOPTR(abfd, in, ext) \ 68 H_PUT_32(abfd, in, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr) 71 69 #endif 72 70 #ifndef PUT_FCN_ENDNDX 73 #define PUT_FCN_ENDNDX(abfd, in, ext) bfd_h_put_32(abfd, in, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx) 71 #define PUT_FCN_ENDNDX(abfd, in, ext) \ 72 H_PUT_32(abfd, in, ext->x_sym.x_fcnary.x_fcn.x_endndx) 74 73 #endif 75 74 #ifndef GET_LNSZ_LNNO 76 #define GET_LNSZ_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_misc.x_lnsz.x_lnno) 75 #define GET_LNSZ_LNNO(abfd, ext) \ 76 H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_lnno) 77 77 #endif 78 78 #ifndef GET_LNSZ_SIZE 79 #define GET_LNSZ_SIZE(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_misc.x_lnsz.x_size) 79 #define GET_LNSZ_SIZE(abfd, ext) \ 80 H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_size) 80 81 #endif 81 82 #ifndef PUT_LNSZ_LNNO 82 #define PUT_LNSZ_LNNO(abfd, in, ext) bfd_h_put_16(abfd, in, (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_lnno) 83 #define PUT_LNSZ_LNNO(abfd, in, ext) \ 84 H_PUT_16(abfd, in, ext->x_sym.x_misc.x_lnsz.x_lnno) 83 85 #endif 84 86 #ifndef PUT_LNSZ_SIZE 85 #define PUT_LNSZ_SIZE(abfd, in, ext) bfd_h_put_16(abfd, in, (bfd_byte*) ext->x_sym.x_misc.x_lnsz.x_size) 87 #define PUT_LNSZ_SIZE(abfd, in, ext) \ 88 H_PUT_16(abfd, in, ext->x_sym.x_misc.x_lnsz.x_size) 86 89 #endif 87 90 #ifndef GET_SCN_SCNLEN 88 #define GET_SCN_SCNLEN(abfd, ext) bfd_h_get_32(abfd, (bfd_byte *) ext->x_scn.x_scnlen) 91 #define GET_SCN_SCNLEN(abfd, ext) \ 92 H_GET_32 (abfd, ext->x_scn.x_scnlen) 89 93 #endif 90 94 #ifndef GET_SCN_NRELOC 91 #define GET_SCN_NRELOC(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *)ext->x_scn.x_nreloc) 95 #define GET_SCN_NRELOC(abfd, ext) \ 96 H_GET_16 (abfd, ext->x_scn.x_nreloc) 92 97 #endif 93 98 #ifndef GET_SCN_NLINNO 94 #define GET_SCN_NLINNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *)ext->x_scn.x_nlinno) 99 #define GET_SCN_NLINNO(abfd, ext) \ 100 H_GET_16 (abfd, ext->x_scn.x_nlinno) 95 101 #endif 96 102 #ifndef PUT_SCN_SCNLEN 97 #define PUT_SCN_SCNLEN(abfd,in, ext) bfd_h_put_32(abfd, in, (bfd_byte *) ext->x_scn.x_scnlen) 103 #define PUT_SCN_SCNLEN(abfd, in, ext) \ 104 H_PUT_32(abfd, in, ext->x_scn.x_scnlen) 98 105 #endif 99 106 #ifndef PUT_SCN_NRELOC 100 #define PUT_SCN_NRELOC(abfd,in, ext) bfd_h_put_16(abfd, in, (bfd_byte *)ext->x_scn.x_nreloc) 107 #define PUT_SCN_NRELOC(abfd, in, ext) \ 108 H_PUT_16(abfd, in, ext->x_scn.x_nreloc) 101 109 #endif 102 110 #ifndef PUT_SCN_NLINNO 103 #define PUT_SCN_NLINNO(abfd,in, ext) bfd_h_put_16(abfd,in, (bfd_byte *) ext->x_scn.x_nlinno) 111 #define PUT_SCN_NLINNO(abfd, in, ext) \ 112 H_PUT_16(abfd,in, ext->x_scn.x_nlinno) 104 113 #endif 105 114 #ifndef GET_LINENO_LNNO 106 #define GET_LINENO_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) (ext->l_lnno)); 115 #define GET_LINENO_LNNO(abfd, ext) \ 116 H_GET_16 (abfd, ext->l_lnno); 107 117 #endif 108 118 #ifndef PUT_LINENO_LNNO 109 #define PUT_LINENO_LNNO(abfd,val, ext) bfd_h_put_16(abfd,val, (bfd_byte *) (ext->l_lnno)); 119 #define PUT_LINENO_LNNO(abfd, val, ext) \ 120 H_PUT_16(abfd,val, ext->l_lnno); 110 121 #endif 111 122 112 123 /* The f_symptr field in the filehdr is sometimes 64 bits. */ 113 124 #ifndef GET_FILEHDR_SYMPTR 114 #define GET_FILEHDR_SYMPTR bfd_h_get_32125 #define GET_FILEHDR_SYMPTR H_GET_32 115 126 #endif 116 127 #ifndef PUT_FILEHDR_SYMPTR 117 #define PUT_FILEHDR_SYMPTR bfd_h_put_32128 #define PUT_FILEHDR_SYMPTR H_PUT_32 118 129 #endif 119 130 120 131 /* Some fields in the aouthdr are sometimes 64 bits. */ 121 132 #ifndef GET_AOUTHDR_TSIZE 122 #define GET_AOUTHDR_TSIZE bfd_h_get_32133 #define GET_AOUTHDR_TSIZE H_GET_32 123 134 #endif 124 135 #ifndef PUT_AOUTHDR_TSIZE 125 #define PUT_AOUTHDR_TSIZE bfd_h_put_32136 #define PUT_AOUTHDR_TSIZE H_PUT_32 126 137 #endif 127 138 #ifndef GET_AOUTHDR_DSIZE 128 #define GET_AOUTHDR_DSIZE bfd_h_get_32139 #define GET_AOUTHDR_DSIZE H_GET_32 129 140 #endif 130 141 #ifndef PUT_AOUTHDR_DSIZE 131 #define PUT_AOUTHDR_DSIZE bfd_h_put_32142 #define PUT_AOUTHDR_DSIZE H_PUT_32 132 143 #endif 133 144 #ifndef GET_AOUTHDR_BSIZE 134 #define GET_AOUTHDR_BSIZE bfd_h_get_32145 #define GET_AOUTHDR_BSIZE H_GET_32 135 146 #endif 136 147 #ifndef PUT_AOUTHDR_BSIZE 137 #define PUT_AOUTHDR_BSIZE bfd_h_put_32148 #define PUT_AOUTHDR_BSIZE H_PUT_32 138 149 #endif 139 150 #ifndef GET_AOUTHDR_ENTRY 140 #define GET_AOUTHDR_ENTRY bfd_h_get_32151 #define GET_AOUTHDR_ENTRY H_GET_32 141 152 #endif 142 153 #ifndef PUT_AOUTHDR_ENTRY 143 #define PUT_AOUTHDR_ENTRY bfd_h_put_32154 #define PUT_AOUTHDR_ENTRY H_PUT_32 144 155 #endif 145 156 #ifndef GET_AOUTHDR_TEXT_START 146 #define GET_AOUTHDR_TEXT_START bfd_h_get_32157 #define GET_AOUTHDR_TEXT_START H_GET_32 147 158 #endif 148 159 #ifndef PUT_AOUTHDR_TEXT_START 149 #define PUT_AOUTHDR_TEXT_START bfd_h_put_32160 #define PUT_AOUTHDR_TEXT_START H_PUT_32 150 161 #endif 151 162 #ifndef GET_AOUTHDR_DATA_START 152 #define GET_AOUTHDR_DATA_START bfd_h_get_32163 #define GET_AOUTHDR_DATA_START H_GET_32 153 164 #endif 154 165 #ifndef PUT_AOUTHDR_DATA_START 155 #define PUT_AOUTHDR_DATA_START bfd_h_put_32166 #define PUT_AOUTHDR_DATA_START H_PUT_32 156 167 #endif 157 168 158 169 /* Some fields in the scnhdr are sometimes 64 bits. */ 159 170 #ifndef GET_SCNHDR_PADDR 160 #define GET_SCNHDR_PADDR bfd_h_get_32171 #define GET_SCNHDR_PADDR H_GET_32 161 172 #endif 162 173 #ifndef PUT_SCNHDR_PADDR 163 #define PUT_SCNHDR_PADDR bfd_h_put_32174 #define PUT_SCNHDR_PADDR H_PUT_32 164 175 #endif 165 176 #ifndef GET_SCNHDR_VADDR 166 #define GET_SCNHDR_VADDR bfd_h_get_32177 #define GET_SCNHDR_VADDR H_GET_32 167 178 #endif 168 179 #ifndef PUT_SCNHDR_VADDR 169 #define PUT_SCNHDR_VADDR bfd_h_put_32180 #define PUT_SCNHDR_VADDR H_PUT_32 170 181 #endif 171 182 #ifndef GET_SCNHDR_SIZE 172 #define GET_SCNHDR_SIZE bfd_h_get_32183 #define GET_SCNHDR_SIZE H_GET_32 173 184 #endif 174 185 #ifndef PUT_SCNHDR_SIZE 175 #define PUT_SCNHDR_SIZE bfd_h_put_32186 #define PUT_SCNHDR_SIZE H_PUT_32 176 187 #endif 177 188 #ifndef GET_SCNHDR_SCNPTR 178 #define GET_SCNHDR_SCNPTR bfd_h_get_32189 #define GET_SCNHDR_SCNPTR H_GET_32 179 190 #endif 180 191 #ifndef PUT_SCNHDR_SCNPTR 181 #define PUT_SCNHDR_SCNPTR bfd_h_put_32192 #define PUT_SCNHDR_SCNPTR H_PUT_32 182 193 #endif 183 194 #ifndef GET_SCNHDR_RELPTR 184 #define GET_SCNHDR_RELPTR bfd_h_get_32195 #define GET_SCNHDR_RELPTR H_GET_32 185 196 #endif 186 197 #ifndef PUT_SCNHDR_RELPTR 187 #define PUT_SCNHDR_RELPTR bfd_h_put_32198 #define PUT_SCNHDR_RELPTR H_PUT_32 188 199 #endif 189 200 #ifndef GET_SCNHDR_LNNOPTR 190 #define GET_SCNHDR_LNNOPTR bfd_h_get_32201 #define GET_SCNHDR_LNNOPTR H_GET_32 191 202 #endif 192 203 #ifndef PUT_SCNHDR_LNNOPTR 193 #define PUT_SCNHDR_LNNOPTR bfd_h_put_32204 #define PUT_SCNHDR_LNNOPTR H_PUT_32 194 205 #endif 195 206 196 207 #ifdef COFF_WITH_pep 197 208 198 #define GET_OPTHDR_IMAGE_BASE bfd_h_get_64199 #define PUT_OPTHDR_IMAGE_BASE bfd_h_put_64200 #define GET_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_get_64201 #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_put_64202 #define GET_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_get_64203 #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_put_64204 #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_get_64205 #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_put_64206 #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_get_64207 #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_put_64209 #define GET_OPTHDR_IMAGE_BASE H_GET_64 210 #define PUT_OPTHDR_IMAGE_BASE H_PUT_64 211 #define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64 212 #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64 213 #define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64 214 #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64 215 #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64 216 #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64 217 #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64 218 #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64 208 219 #define GET_PDATA_ENTRY bfd_get_64 209 220 … … 228 239 #else /* !COFF_WITH_pep */ 229 240 230 #define GET_OPTHDR_IMAGE_BASE bfd_h_get_32231 #define PUT_OPTHDR_IMAGE_BASE bfd_h_put_32232 #define GET_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_get_32233 #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_put_32234 #define GET_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_get_32235 #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_put_32236 #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_get_32237 #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_put_32238 #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_get_32239 #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_put_32241 #define GET_OPTHDR_IMAGE_BASE H_GET_32 242 #define PUT_OPTHDR_IMAGE_BASE H_PUT_32 243 #define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_32 244 #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_32 245 #define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_32 246 #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_32 247 #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_32 248 #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_32 249 #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_32 250 #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_32 240 251 #define GET_PDATA_ENTRY bfd_get_32 241 252 … … 300 311 #define coff_swap_scnhdr_out _bfd_XXi_swap_scnhdr_out 301 312 302 b oolean _bfd_XX_print_private_bfd_data_common PARAMS ((bfd *, PTR));303 304 b oolean _bfd_XX_bfd_copy_private_bfd_data_common PARAMS ((bfd *, bfd *));313 bfd_boolean _bfd_XX_print_private_bfd_data_common PARAMS ((bfd *, PTR)); 314 315 bfd_boolean _bfd_XX_bfd_copy_private_bfd_data_common PARAMS ((bfd *, bfd *)); 305 316 306 317 void _bfd_XX_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); 307 318 308 b oolean _bfd_XXi_final_link_postscript319 bfd_boolean _bfd_XXi_final_link_postscript 309 320 PARAMS ((bfd *, struct coff_final_link_info *)); 310 321 … … 318 329 unsigned int _bfd_XX_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR)); 319 330 unsigned int _bfd_XXi_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR)); 320 b oolean _bfd_XX_bfd_copy_private_section_data331 bfd_boolean _bfd_XX_bfd_copy_private_section_data 321 332 PARAMS ((bfd *, asection *, bfd *, asection *)); 333 334 /* Macro: Returns true if the bfd is a PE executable as opposed to a PE object file. */ 335 #define bfd_pe_executable_p(abfd) (strncmp ((abfd)->xvec->name, "pei-", 4) == 0) -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.