OLD | NEW |
1 /* BFD back-end for oasys objects. | 1 /* BFD back-end for oasys objects. |
2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, | 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, |
3 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 | 3 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 |
4 Free Software Foundation, Inc. | 4 Free Software Foundation, Inc. |
5 Written by Steve Chamberlain of Cygnus Support, <sac@cygnus.com>. | 5 Written by Steve Chamberlain of Cygnus Support, <sac@cygnus.com>. |
6 | 6 |
7 This file is part of BFD, the Binary File Descriptor library. | 7 This file is part of BFD, the Binary File Descriptor library. |
8 | 8 |
9 This program is free software; you can redistribute it and/or modify | 9 This program is free software; you can redistribute it and/or modify |
10 it under the terms of the GNU General Public License as published by | 10 it under the terms of the GNU General Public License as published by |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 | 899 |
900 static bfd_boolean | 900 static bfd_boolean |
901 oasys_write_header (bfd *abfd) | 901 oasys_write_header (bfd *abfd) |
902 { | 902 { |
903 /* Create and write the header. */ | 903 /* Create and write the header. */ |
904 oasys_header_record_type r; | 904 oasys_header_record_type r; |
905 size_t length = strlen (abfd->filename); | 905 size_t length = strlen (abfd->filename); |
906 | 906 |
907 if (length > (size_t) sizeof (r.module_name)) | 907 if (length > (size_t) sizeof (r.module_name)) |
908 length = sizeof (r.module_name); | 908 length = sizeof (r.module_name); |
| 909 else if (length < (size_t) sizeof (r.module_name)) |
| 910 (void) memset (r.module_name + length, ' ', |
| 911 sizeof (r.module_name) - length); |
909 | 912 |
910 (void) memcpy (r.module_name, abfd->filename, length); | 913 (void) memcpy (r.module_name, abfd->filename, length); |
911 (void) memset (r.module_name + length, ' ', sizeof (r.module_name) - length); | |
912 | 914 |
913 r.version_number = OASYS_VERSION_NUMBER; | 915 r.version_number = OASYS_VERSION_NUMBER; |
914 r.rev_number = OASYS_REV_NUMBER; | 916 r.rev_number = OASYS_REV_NUMBER; |
915 | 917 |
916 return oasys_write_record (abfd, oasys_record_is_header_enum, | 918 return oasys_write_record (abfd, oasys_record_is_header_enum, |
917 (oasys_record_union_type *) & r, | 919 (oasys_record_union_type *) & r, |
918 offsetof (oasys_header_record_type, | 920 offsetof (oasys_header_record_type, |
919 description[0])); | 921 description[0])); |
920 } | 922 } |
921 | 923 |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 BFD_JUMP_TABLE_SYMBOLS (oasys), | 1260 BFD_JUMP_TABLE_SYMBOLS (oasys), |
1259 BFD_JUMP_TABLE_RELOCS (oasys), | 1261 BFD_JUMP_TABLE_RELOCS (oasys), |
1260 BFD_JUMP_TABLE_WRITE (oasys), | 1262 BFD_JUMP_TABLE_WRITE (oasys), |
1261 BFD_JUMP_TABLE_LINK (oasys), | 1263 BFD_JUMP_TABLE_LINK (oasys), |
1262 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), | 1264 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), |
1263 | 1265 |
1264 NULL, | 1266 NULL, |
1265 | 1267 |
1266 NULL | 1268 NULL |
1267 }; | 1269 }; |
OLD | NEW |