Rev 5197 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5197 | Rev 6324 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* BFD back-end for Intel Hex objects. |
1 | /* BFD back-end for Intel Hex objects. |
2 | Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, |
- | |
3 | 2006, 2007, 2009, 2011 Free Software Foundation, Inc. |
2 | Copyright (C) 1995-2015 Free Software Foundation, Inc. |
4 | Written by Ian Lance Taylor of Cygnus Support |
3 | Written by Ian Lance Taylor of Cygnus Support |
Line 5... | Line 4... | ||
5 | 4 | ||
Line 6... | Line 5... | ||
6 | This file is part of BFD, the Binary File Descriptor library. |
5 | This file is part of BFD, the Binary File Descriptor library. |
Line 218... | Line 217... | ||
218 | else |
217 | else |
219 | { |
218 | { |
220 | char buf[10]; |
219 | char buf[10]; |
Line 221... | Line 220... | ||
221 | 220 | ||
222 | if (! ISPRINT (c)) |
221 | if (! ISPRINT (c)) |
223 | sprintf (buf, "\\%03o", (unsigned int) c); |
222 | sprintf (buf, "\\%03o", (unsigned int) c & 0xff); |
224 | else |
223 | else |
225 | { |
224 | { |
226 | buf[0] = c; |
225 | buf[0] = c; |
227 | buf[1] = '\0'; |
226 | buf[1] = '\0'; |
Line 275... | Line 274... | ||
275 | goto error_return; |
274 | goto error_return; |
276 | } |
275 | } |
277 | else |
276 | else |
278 | { |
277 | { |
279 | file_ptr pos; |
278 | file_ptr pos; |
280 | char hdr[8]; |
279 | unsigned char hdr[8]; |
281 | unsigned int i; |
280 | unsigned int i; |
282 | unsigned int len; |
281 | unsigned int len; |
283 | bfd_vma addr; |
282 | bfd_vma addr; |
284 | unsigned int type; |
283 | unsigned int type; |
285 | unsigned int chars; |
284 | unsigned int chars; |
Line 320... | Line 319... | ||
320 | 319 | ||
321 | for (i = 0; i < chars; i++) |
320 | for (i = 0; i < chars; i++) |
322 | { |
321 | { |
323 | if (! ISHEX (buf[i])) |
322 | if (! ISHEX (buf[i])) |
324 | { |
323 | { |
325 | ihex_bad_byte (abfd, lineno, hdr[i], error); |
324 | ihex_bad_byte (abfd, lineno, buf[i], error); |
326 | goto error_return; |
325 | goto error_return; |
327 | } |
326 | } |
Line 328... | Line 327... | ||
328 | } |
327 | } |
Line 552... | Line 551... | ||
552 | p = contents; |
551 | p = contents; |
553 | bufsize = 0; |
552 | bufsize = 0; |
554 | error = FALSE; |
553 | error = FALSE; |
555 | while ((c = ihex_get_byte (abfd, &error)) != EOF) |
554 | while ((c = ihex_get_byte (abfd, &error)) != EOF) |
556 | { |
555 | { |
557 | char hdr[8]; |
556 | unsigned char hdr[8]; |
558 | unsigned int len; |
557 | unsigned int len; |
559 | unsigned int type; |
558 | unsigned int type; |
560 | unsigned int i; |
559 | unsigned int i; |
Line 561... | Line 560... | ||
561 | 560 | ||
Line 917... | Line 916... | ||
917 | #define ihex_get_symtab_upper_bound bfd_0l |
916 | #define ihex_get_symtab_upper_bound bfd_0l |
918 | #define ihex_canonicalize_symtab ((long (*) (bfd *, asymbol **)) bfd_0l) |
917 | #define ihex_canonicalize_symtab ((long (*) (bfd *, asymbol **)) bfd_0l) |
919 | #define ihex_make_empty_symbol _bfd_generic_make_empty_symbol |
918 | #define ihex_make_empty_symbol _bfd_generic_make_empty_symbol |
920 | #define ihex_print_symbol _bfd_nosymbols_print_symbol |
919 | #define ihex_print_symbol _bfd_nosymbols_print_symbol |
921 | #define ihex_get_symbol_info _bfd_nosymbols_get_symbol_info |
920 | #define ihex_get_symbol_info _bfd_nosymbols_get_symbol_info |
- | 921 | #define ihex_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string |
|
922 | #define ihex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) |
922 | #define ihex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) |
923 | #define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name |
923 | #define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name |
924 | #define ihex_get_lineno _bfd_nosymbols_get_lineno |
924 | #define ihex_get_lineno _bfd_nosymbols_get_lineno |
925 | #define ihex_find_nearest_line _bfd_nosymbols_find_nearest_line |
925 | #define ihex_find_nearest_line _bfd_nosymbols_find_nearest_line |
- | 926 | #define ihex_find_line _bfd_nosymbols_find_line |
|
926 | #define ihex_find_inliner_info _bfd_nosymbols_find_inliner_info |
927 | #define ihex_find_inliner_info _bfd_nosymbols_find_inliner_info |
927 | #define ihex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol |
928 | #define ihex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol |
928 | #define ihex_read_minisymbols _bfd_nosymbols_read_minisymbols |
929 | #define ihex_read_minisymbols _bfd_nosymbols_read_minisymbols |
929 | #define ihex_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol |
930 | #define ihex_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol |
930 | #define ihex_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents |
931 | #define ihex_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents |
Line 935... | Line 936... | ||
935 | #define ihex_bfd_is_group_section bfd_generic_is_group_section |
936 | #define ihex_bfd_is_group_section bfd_generic_is_group_section |
936 | #define ihex_bfd_discard_group bfd_generic_discard_group |
937 | #define ihex_bfd_discard_group bfd_generic_discard_group |
937 | #define ihex_section_already_linked _bfd_generic_section_already_linked |
938 | #define ihex_section_already_linked _bfd_generic_section_already_linked |
938 | #define ihex_bfd_define_common_symbol bfd_generic_define_common_symbol |
939 | #define ihex_bfd_define_common_symbol bfd_generic_define_common_symbol |
939 | #define ihex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create |
940 | #define ihex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create |
940 | #define ihex_bfd_link_hash_table_free _bfd_generic_link_hash_table_free |
- | |
941 | #define ihex_bfd_link_add_symbols _bfd_generic_link_add_symbols |
941 | #define ihex_bfd_link_add_symbols _bfd_generic_link_add_symbols |
942 | #define ihex_bfd_link_just_syms _bfd_generic_link_just_syms |
942 | #define ihex_bfd_link_just_syms _bfd_generic_link_just_syms |
943 | #define ihex_bfd_copy_link_hash_symbol_type \ |
943 | #define ihex_bfd_copy_link_hash_symbol_type \ |
944 | _bfd_generic_copy_link_hash_symbol_type |
944 | _bfd_generic_copy_link_hash_symbol_type |
945 | #define ihex_bfd_final_link _bfd_generic_final_link |
945 | #define ihex_bfd_final_link _bfd_generic_final_link |