OLD | NEW |
1 /* PEF support for BFD. | 1 /* PEF support for BFD. |
2 Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, | 2 Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
3 2009, 2011 Free Software Foundation, Inc. | 3 2009, 2011 Free Software Foundation, Inc. |
4 | 4 |
5 This file is part of BFD, the Binary File Descriptor library. | 5 This file is part of BFD, the Binary File Descriptor library. |
6 | 6 |
7 This program is free software; you can redistribute it and/or modify | 7 This program is free software; you can redistribute it and/or modify |
8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
9 the Free Software Foundation; either version 3 of the License, or | 9 the Free Software Foundation; either version 3 of the License, or |
10 (at your option) any later version. | 10 (at your option) any later version. |
11 | 11 |
12 This program is distributed in the hope that it will be useful, | 12 This program is distributed in the hope that it will be useful, |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 GNU General Public License for more details. | 15 GNU General Public License for more details. |
16 | 16 |
17 You should have received a copy of the GNU General Public License | 17 You should have received a copy of the GNU General Public License |
18 along with this program; if not, write to the Free Software | 18 along with this program; if not, write to the Free Software |
19 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, | 19 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
20 MA 02110-1301, USA. */ | 20 MA 02110-1301, USA. */ |
21 | 21 |
| 22 /* PEF (Preferred Executable Format) is the binary file format for late |
| 23 classic Mac OS versions (before Darwin). It is supported by both m68k |
| 24 and PowerPc. It is also called CFM (Code Fragment Manager). */ |
| 25 |
22 #include "sysdep.h" | 26 #include "sysdep.h" |
23 #include "safe-ctype.h" | 27 #include "safe-ctype.h" |
24 #include "pef.h" | 28 #include "pef.h" |
25 #include "pef-traceback.h" | 29 #include "pef-traceback.h" |
26 #include "bfd.h" | 30 #include "bfd.h" |
27 #include "libbfd.h" | 31 #include "libbfd.h" |
28 #include "libiberty.h" | 32 #include "libiberty.h" |
29 | 33 |
30 #ifndef BFD_IO_FUNCS | 34 #ifndef BFD_IO_FUNCS |
31 #define BFD_IO_FUNCS 0 | 35 #define BFD_IO_FUNCS 0 |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 free (loaderbuf); | 500 free (loaderbuf); |
497 return 0; | 501 return 0; |
498 | 502 |
499 error: | 503 error: |
500 if (loaderbuf != NULL) | 504 if (loaderbuf != NULL) |
501 free (loaderbuf); | 505 free (loaderbuf); |
502 return -1; | 506 return -1; |
503 } | 507 } |
504 | 508 |
505 int | 509 int |
506 bfd_pef_scan (abfd, header, mdata) | 510 bfd_pef_scan (bfd *abfd, |
507 bfd *abfd; | 511 » bfd_pef_header *header, |
508 bfd_pef_header *header; | 512 » bfd_pef_data_struct *mdata) |
509 bfd_pef_data_struct *mdata; | |
510 { | 513 { |
511 unsigned int i; | 514 unsigned int i; |
512 enum bfd_architecture cputype; | 515 enum bfd_architecture cputype; |
513 unsigned long cpusubtype; | 516 unsigned long cpusubtype; |
514 | 517 |
515 mdata->header = *header; | 518 mdata->header = *header; |
516 | 519 |
517 bfd_pef_convert_architecture (header->architecture, &cputype, &cpusubtype); | 520 bfd_pef_convert_architecture (header->architecture, &cputype, &cpusubtype); |
518 if (cputype == bfd_arch_unknown) | 521 if (cputype == bfd_arch_unknown) |
519 { | 522 { |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), | 1205 BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), |
1203 BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), | 1206 BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), |
1204 BFD_JUMP_TABLE_WRITE (_bfd_nowrite), | 1207 BFD_JUMP_TABLE_WRITE (_bfd_nowrite), |
1205 BFD_JUMP_TABLE_LINK (_bfd_nolink), | 1208 BFD_JUMP_TABLE_LINK (_bfd_nolink), |
1206 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), | 1209 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), |
1207 | 1210 |
1208 NULL, | 1211 NULL, |
1209 | 1212 |
1210 NULL | 1213 NULL |
1211 }; | 1214 }; |
OLD | NEW |