| OLD | NEW |
| 1 /* BFD back-end for i386 a.out binaries under dynix. | 1 /* BFD back-end for i386 a.out binaries under dynix. |
| 2 Copyright 1994, 1995, 2001, 2003, 2005, 2007 Free Software Foundation, Inc. | 2 Copyright 1994, 1995, 2001, 2003, 2005, 2007, 2012 |
| 3 Free Software Foundation, Inc. |
| 3 | 4 |
| 4 This file is part of BFD, the Binary File Descriptor library. | 5 This file is part of BFD, the Binary File Descriptor library. |
| 5 | 6 |
| 6 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 |
| 7 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 |
| 8 the Free Software Foundation; either version 3 of the License, or | 9 the Free Software Foundation; either version 3 of the License, or |
| 9 (at your option) any later version. | 10 (at your option) any later version. |
| 10 | 11 |
| 11 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, |
| 12 but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 49 |
| 49 #include "aoutx.h" | 50 #include "aoutx.h" |
| 50 | 51 |
| 51 /* (Ab)use some fields in the internal exec header to be able to read | 52 /* (Ab)use some fields in the internal exec header to be able to read |
| 52 executables that contain shared data. */ | 53 executables that contain shared data. */ |
| 53 | 54 |
| 54 #define a_shdata a_tload | 55 #define a_shdata a_tload |
| 55 #define a_shdrsize a_dload | 56 #define a_shdrsize a_dload |
| 56 | 57 |
| 57 void | 58 void |
| 58 i386dynix_32_swap_exec_header_in (abfd, raw_bytes, execp) | 59 i386dynix_32_swap_exec_header_in (bfd *abfd, |
| 59 bfd *abfd; | 60 » » » » struct external_exec *raw_bytes, |
| 60 struct external_exec *raw_bytes; | 61 » » » » struct internal_exec *execp) |
| 61 struct internal_exec *execp; | |
| 62 { | 62 { |
| 63 struct external_exec *bytes = (struct external_exec *)raw_bytes; | 63 struct external_exec *bytes = (struct external_exec *)raw_bytes; |
| 64 | 64 |
| 65 /* The internal_exec structure has some fields that are unused in this | 65 /* The internal_exec structure has some fields that are unused in this |
| 66 configuration (IE for i960), so ensure that all such uninitialized | 66 configuration (IE for i960), so ensure that all such uninitialized |
| 67 fields are zero'd out. There are places where two of these structs | 67 fields are zero'd out. There are places where two of these structs |
| 68 are memcmp'd, and thus the contents do matter. */ | 68 are memcmp'd, and thus the contents do matter. */ |
| 69 memset ((PTR) execp, 0, sizeof (struct internal_exec)); | 69 memset (execp, 0, sizeof (struct internal_exec)); |
| 70 /* Now fill in fields in the execp, from the bytes in the raw data. */ | 70 /* Now fill in fields in the execp, from the bytes in the raw data. */ |
| 71 execp->a_info = H_GET_32 (abfd, bytes->e_info); | 71 execp->a_info = H_GET_32 (abfd, bytes->e_info); |
| 72 execp->a_text = GET_WORD (abfd, bytes->e_text); | 72 execp->a_text = GET_WORD (abfd, bytes->e_text); |
| 73 execp->a_data = GET_WORD (abfd, bytes->e_data); | 73 execp->a_data = GET_WORD (abfd, bytes->e_data); |
| 74 execp->a_bss = GET_WORD (abfd, bytes->e_bss); | 74 execp->a_bss = GET_WORD (abfd, bytes->e_bss); |
| 75 execp->a_syms = GET_WORD (abfd, bytes->e_syms); | 75 execp->a_syms = GET_WORD (abfd, bytes->e_syms); |
| 76 execp->a_entry = GET_WORD (abfd, bytes->e_entry); | 76 execp->a_entry = GET_WORD (abfd, bytes->e_entry); |
| 77 execp->a_trsize = GET_WORD (abfd, bytes->e_trsize); | 77 execp->a_trsize = GET_WORD (abfd, bytes->e_trsize); |
| 78 execp->a_drsize = GET_WORD (abfd, bytes->e_drsize); | 78 execp->a_drsize = GET_WORD (abfd, bytes->e_drsize); |
| 79 execp->a_shdata = GET_WORD (abfd, bytes->e_shdata); | 79 execp->a_shdata = GET_WORD (abfd, bytes->e_shdata); |
| 80 execp->a_shdrsize = GET_WORD (abfd, bytes->e_shdrsize); | 80 execp->a_shdrsize = GET_WORD (abfd, bytes->e_shdrsize); |
| 81 } | 81 } |
| 82 | 82 |
| 83 #include "aout-target.h" | 83 #include "aout-target.h" |
| OLD | NEW |