Deleted Added
full compact
tekhex.c (78828) tekhex.c (89857)
1/* BFD backend for Extended Tektronix Hex Format objects.
1/* BFD backend for Extended Tektronix Hex Format objects.
2 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000
2 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
3 Free Software Foundation, Inc.
4 Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
5
6This file is part of BFD, the Binary File Descriptor library.
7
8This program is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2 of the License, or

--- 91 unchanged lines hidden (view full) ---

102static bfd_vma getvalue PARAMS ((char **));
103static void tekhex_print_symbol
104 PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type));
105static void tekhex_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
106static asymbol *tekhex_make_empty_symbol PARAMS ((bfd *));
107static int tekhex_sizeof_headers PARAMS ((bfd *, boolean));
108static boolean tekhex_write_object_contents PARAMS ((bfd *));
109static void out PARAMS ((bfd *, int, char *, char *));
3 Free Software Foundation, Inc.
4 Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
5
6This file is part of BFD, the Binary File Descriptor library.
7
8This program is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2 of the License, or

--- 91 unchanged lines hidden (view full) ---

102static bfd_vma getvalue PARAMS ((char **));
103static void tekhex_print_symbol
104 PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type));
105static void tekhex_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
106static asymbol *tekhex_make_empty_symbol PARAMS ((bfd *));
107static int tekhex_sizeof_headers PARAMS ((bfd *, boolean));
108static boolean tekhex_write_object_contents PARAMS ((bfd *));
109static void out PARAMS ((bfd *, int, char *, char *));
110static void writesym PARAMS ((char **, CONST char *));
110static void writesym PARAMS ((char **, const char *));
111static void writevalue PARAMS ((char **, bfd_vma));
112static boolean tekhex_set_section_contents
113 PARAMS ((bfd*, sec_ptr, PTR, file_ptr, bfd_size_type));
114static boolean tekhex_set_arch_mach
115 PARAMS ((bfd *, enum bfd_architecture, unsigned long));
116static boolean tekhex_get_section_contents
117 PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
118static void move_section_contents

--- 230 unchanged lines hidden (view full) ---

349
350 vma &= ~CHUNK_MASK;
351 while (d && (d->vma) != vma)
352 {
353 d = d->next;
354 }
355 if (!d)
356 {
111static void writevalue PARAMS ((char **, bfd_vma));
112static boolean tekhex_set_section_contents
113 PARAMS ((bfd*, sec_ptr, PTR, file_ptr, bfd_size_type));
114static boolean tekhex_set_arch_mach
115 PARAMS ((bfd *, enum bfd_architecture, unsigned long));
116static boolean tekhex_get_section_contents
117 PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
118static void move_section_contents

--- 230 unchanged lines hidden (view full) ---

349
350 vma &= ~CHUNK_MASK;
351 while (d && (d->vma) != vma)
352 {
353 d = d->next;
354 }
355 if (!d)
356 {
357 char *sname = bfd_alloc (abfd, 12);
357 char *sname = bfd_alloc (abfd, (bfd_size_type) 12);
358
359 /* No chunk for this address, so make one up */
358
359 /* No chunk for this address, so make one up */
360 d = (struct data_struct *)
361 bfd_alloc (abfd, sizeof (struct data_struct));
360 d = ((struct data_struct *)
361 bfd_alloc (abfd, (bfd_size_type) sizeof (struct data_struct)));
362
363 if (!sname || !d)
364 return NULL;
365
366 memset (d->chunk_init, 0, CHUNK_MASK + 1);
367 memset (d->chunk_data, 0, CHUNK_MASK + 1);
368 d->next = abfd->tdata.tekhex_data->data;
369 d->vma = vma;

--- 19 unchanged lines hidden (view full) ---

389 how big the data is */
390static void
391first_phase (abfd, type, src)
392 bfd *abfd;
393 int type;
394 char *src;
395{
396 asection *section = bfd_abs_section_ptr;
362
363 if (!sname || !d)
364 return NULL;
365
366 memset (d->chunk_init, 0, CHUNK_MASK + 1);
367 memset (d->chunk_data, 0, CHUNK_MASK + 1);
368 d->next = abfd->tdata.tekhex_data->data;
369 d->vma = vma;

--- 19 unchanged lines hidden (view full) ---

389 how big the data is */
390static void
391first_phase (abfd, type, src)
392 bfd *abfd;
393 int type;
394 char *src;
395{
396 asection *section = bfd_abs_section_ptr;
397 int len;
397 unsigned int len;
398 char sym[17]; /* A symbol can only be 16chars long */
399
400 switch (type)
401 {
402 case '6':
403 /* Data record - read it and store it */
404 {
405 bfd_vma addr = getvalue (&src);

--- 8 unchanged lines hidden (view full) ---

414
415 return;
416 case '3':
417 /* Symbol record, read the segment */
418 len = getsym (sym, &src);
419 section = bfd_get_section_by_name (abfd, sym);
420 if (section == (asection *) NULL)
421 {
398 char sym[17]; /* A symbol can only be 16chars long */
399
400 switch (type)
401 {
402 case '6':
403 /* Data record - read it and store it */
404 {
405 bfd_vma addr = getvalue (&src);

--- 8 unchanged lines hidden (view full) ---

414
415 return;
416 case '3':
417 /* Symbol record, read the segment */
418 len = getsym (sym, &src);
419 section = bfd_get_section_by_name (abfd, sym);
420 if (section == (asection *) NULL)
421 {
422 char *n = bfd_alloc (abfd, len + 1);
422 char *n = bfd_alloc (abfd, (bfd_size_type) len + 1);
423
424 if (!n)
425 abort (); /* FIXME */
426 memcpy (n, sym, len + 1);
427 section = bfd_make_section (abfd, n);
428 }
429 while (*src)
430 {

--- 9 unchanged lines hidden (view full) ---

440 case '2':
441 case '3':
442 case '4':
443 case '6':
444 case '7':
445 case '8':
446 /* Symbols, add to section */
447 {
423
424 if (!n)
425 abort (); /* FIXME */
426 memcpy (n, sym, len + 1);
427 section = bfd_make_section (abfd, n);
428 }
429 while (*src)
430 {

--- 9 unchanged lines hidden (view full) ---

440 case '2':
441 case '3':
442 case '4':
443 case '6':
444 case '7':
445 case '8':
446 /* Symbols, add to section */
447 {
448 bfd_size_type amt = sizeof (tekhex_symbol_type);
448 tekhex_symbol_type *new =
449 tekhex_symbol_type *new =
449 (tekhex_symbol_type *) bfd_alloc (abfd,
450 sizeof (tekhex_symbol_type));
451 char type = (*src);
450 (tekhex_symbol_type *) bfd_alloc (abfd, amt);
451 char stype = (*src);
452
453 if (!new)
454 abort (); /* FIXME */
455 new->symbol.the_bfd = abfd;
456 src++;
457 abfd->symcount++;
458 abfd->flags |= HAS_SYMS;
459 new->prev = abfd->tdata.tekhex_data->symbols;
460 abfd->tdata.tekhex_data->symbols = new;
461 len = getsym (sym, &src);
452
453 if (!new)
454 abort (); /* FIXME */
455 new->symbol.the_bfd = abfd;
456 src++;
457 abfd->symcount++;
458 abfd->flags |= HAS_SYMS;
459 new->prev = abfd->tdata.tekhex_data->symbols;
460 abfd->tdata.tekhex_data->symbols = new;
461 len = getsym (sym, &src);
462 new->symbol.name = bfd_alloc (abfd, len + 1);
462 new->symbol.name = bfd_alloc (abfd, (bfd_size_type) len + 1);
463 if (!new->symbol.name)
464 abort (); /* FIXME */
465 memcpy ((char *) (new->symbol.name), sym, len + 1);
466 new->symbol.section = section;
463 if (!new->symbol.name)
464 abort (); /* FIXME */
465 memcpy ((char *) (new->symbol.name), sym, len + 1);
466 new->symbol.section = section;
467 if (type <= '4')
467 if (stype <= '4')
468 new->symbol.flags = (BSF_GLOBAL | BSF_EXPORT);
469 else
470 new->symbol.flags = BSF_LOCAL;
471 new->symbol.value = getvalue (&src) - section->vma;
472 }
473 }
474 }
475 }

--- 15 unchanged lines hidden (view full) ---

491 abort ();
492 while (eof == false)
493 {
494 char buffer[MAXCHUNK];
495 char *src = buffer;
496 char type;
497
498 /* Find first '%' */
468 new->symbol.flags = (BSF_GLOBAL | BSF_EXPORT);
469 else
470 new->symbol.flags = BSF_LOCAL;
471 new->symbol.value = getvalue (&src) - section->vma;
472 }
473 }
474 }
475 }

--- 15 unchanged lines hidden (view full) ---

491 abort ();
492 while (eof == false)
493 {
494 char buffer[MAXCHUNK];
495 char *src = buffer;
496 char type;
497
498 /* Find first '%' */
499 eof = (boolean) (bfd_read (src, 1, 1, abfd) != 1);
499 eof = (boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1);
500 while (*src != '%' && !eof)
501 {
500 while (*src != '%' && !eof)
501 {
502 eof = (boolean) (bfd_read (src, 1, 1, abfd) != 1);
502 eof = (boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1);
503 }
504 if (eof)
505 break;
506 src++;
507
508 /* Fetch the type and the length and the checksum */
503 }
504 if (eof)
505 break;
506 src++;
507
508 /* Fetch the type and the length and the checksum */
509 if (bfd_read (src, 1, 5, abfd) != 5)
509 if (bfd_bread (src, (bfd_size_type) 5, abfd) != 5)
510 abort (); /* FIXME */
511
512 type = src[2];
513
514 if (!ISHEX (src[0]) || !ISHEX (src[1]))
515 break;
516
517 chars_on_line = HEX (src) - 5; /* Already read five char */
518
510 abort (); /* FIXME */
511
512 type = src[2];
513
514 if (!ISHEX (src[0]) || !ISHEX (src[1]))
515 break;
516
517 chars_on_line = HEX (src) - 5; /* Already read five char */
518
519 if (bfd_read (src, 1, chars_on_line, abfd) != chars_on_line)
519 if (bfd_bread (src, (bfd_size_type) chars_on_line, abfd) != chars_on_line)
520 abort (); /* FIXME */
521 src[chars_on_line] = 0; /* put a null at the end */
522
523 func (abfd, type, src);
524 }
525
526}
527

--- 22 unchanged lines hidden (view full) ---

550 return (abfd->symcount + 1) * (sizeof (struct tekhex_asymbol_struct *));
551
552}
553
554static boolean
555tekhex_mkobject (abfd)
556 bfd *abfd;
557{
520 abort (); /* FIXME */
521 src[chars_on_line] = 0; /* put a null at the end */
522
523 func (abfd, type, src);
524 }
525
526}
527

--- 22 unchanged lines hidden (view full) ---

550 return (abfd->symcount + 1) * (sizeof (struct tekhex_asymbol_struct *));
551
552}
553
554static boolean
555tekhex_mkobject (abfd)
556 bfd *abfd;
557{
558 tdata_type *tdata = (tdata_type *) bfd_alloc (abfd, sizeof (tdata_type));
558 tdata_type *tdata;
559
559
560 tdata = (tdata_type *) bfd_alloc (abfd, (bfd_size_type) sizeof (tdata_type));
560 if (!tdata)
561 return false;
562 abfd->tdata.tekhex_data = tdata;
563 tdata->type = 1;
564 tdata->head = (tekhex_data_list_type *) NULL;
565 tdata->symbols = (struct tekhex_symbol_struct *) NULL;
566 tdata->data = (struct data_struct *) NULL;
567 return true;

--- 7 unchanged lines hidden (view full) ---

575tekhex_object_p (abfd)
576 bfd *abfd;
577{
578 char b[4];
579
580 tekhex_init ();
581
582 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
561 if (!tdata)
562 return false;
563 abfd->tdata.tekhex_data = tdata;
564 tdata->type = 1;
565 tdata->head = (tekhex_data_list_type *) NULL;
566 tdata->symbols = (struct tekhex_symbol_struct *) NULL;
567 tdata->data = (struct data_struct *) NULL;
568 return true;

--- 7 unchanged lines hidden (view full) ---

576tekhex_object_p (abfd)
577 bfd *abfd;
578{
579 char b[4];
580
581 tekhex_init ();
582
583 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
583 || bfd_read (b, 1, 4, abfd) != 4)
584 || bfd_bread (b, (bfd_size_type) 4, abfd) != 4)
584 return NULL;
585
586 if (b[0] != '%' || !ISHEX (b[1]) || !ISHEX (b[2]) || !ISHEX (b[3]))
587 return (const bfd_target *) NULL;
588
589 tekhex_mkobject (abfd);
590
591 pass_over (abfd, first_phase);
592 return abfd->xvec;
593}
594
595static void
596move_section_contents (abfd, section, locationp, offset, count, get)
597 bfd *abfd;
598 asection *section;
599 PTR locationp;
585 return NULL;
586
587 if (b[0] != '%' || !ISHEX (b[1]) || !ISHEX (b[2]) || !ISHEX (b[3]))
588 return (const bfd_target *) NULL;
589
590 tekhex_mkobject (abfd);
591
592 pass_over (abfd, first_phase);
593 return abfd->xvec;
594}
595
596static void
597move_section_contents (abfd, section, locationp, offset, count, get)
598 bfd *abfd;
599 asection *section;
600 PTR locationp;
600 file_ptr offset ATTRIBUTE_UNUSED;
601 file_ptr offset;
601 bfd_size_type count;
602 boolean get;
603{
604 bfd_vma addr;
605 char *location = (char *) locationp;
606 bfd_vma prev_number = 1; /* Nothing can have this as a high bit*/
607 struct data_struct *d = (struct data_struct *) NULL;
608
602 bfd_size_type count;
603 boolean get;
604{
605 bfd_vma addr;
606 char *location = (char *) locationp;
607 bfd_vma prev_number = 1; /* Nothing can have this as a high bit*/
608 struct data_struct *d = (struct data_struct *) NULL;
609
610 BFD_ASSERT (offset == 0);
609 for (addr = section->vma; count != 0; count--, addr++)
610 {
611 for (addr = section->vma; count != 0; count--, addr++)
612 {
611
612 bfd_vma chunk_number = addr & ~CHUNK_MASK; /* Get high bits of address */
613 /* Get high bits of address. */
614 bfd_vma chunk_number = addr & ~(bfd_vma) CHUNK_MASK;
613 bfd_vma low_bits = addr & CHUNK_MASK;
614
615 if (chunk_number != prev_number)
616 {
617 /* Different chunk, so move pointer */
618 d = find_chunk (abfd, chunk_number);
619 }
620

--- 63 unchanged lines hidden (view full) ---

684 /* The first time around, allocate enough sections to hold all the chunks */
685 asection *s = abfd->sections;
686 bfd_vma vma;
687
688 for (s = abfd->sections; s; s = s->next)
689 {
690 if (s->flags & SEC_LOAD)
691 {
615 bfd_vma low_bits = addr & CHUNK_MASK;
616
617 if (chunk_number != prev_number)
618 {
619 /* Different chunk, so move pointer */
620 d = find_chunk (abfd, chunk_number);
621 }
622

--- 63 unchanged lines hidden (view full) ---

686 /* The first time around, allocate enough sections to hold all the chunks */
687 asection *s = abfd->sections;
688 bfd_vma vma;
689
690 for (s = abfd->sections; s; s = s->next)
691 {
692 if (s->flags & SEC_LOAD)
693 {
692 for (vma = s->vma & ~CHUNK_MASK;
694 for (vma = s->vma & ~(bfd_vma) CHUNK_MASK;
693 vma < s->vma + s->_raw_size;
694 vma += CHUNK_MASK)
695 find_chunk (abfd, vma);
696 }
697 }
698
699 }
700 if (section->flags & (SEC_LOAD | SEC_ALLOC))
701 {
695 vma < s->vma + s->_raw_size;
696 vma += CHUNK_MASK)
697 find_chunk (abfd, vma);
698 }
699 }
700
701 }
702 if (section->flags & (SEC_LOAD | SEC_ALLOC))
703 {
702 move_section_contents (abfd, section, locationp, offset, bytes_to_do, false);
704 move_section_contents (abfd, section, locationp, offset, bytes_to_do,
705 false);
703 return true;
704 }
705 else
706 return false;
707
708}
709
710static void

--- 24 unchanged lines hidden (view full) ---

735 *p++ = '1';
736 *p++ = '0';
737 *dst = p;
738}
739
740static void
741writesym (dst, sym)
742 char **dst;
706 return true;
707 }
708 else
709 return false;
710
711}
712
713static void

--- 24 unchanged lines hidden (view full) ---

738 *p++ = '1';
739 *p++ = '0';
740 *dst = p;
741}
742
743static void
744writesym (dst, sym)
745 char **dst;
743 CONST char *sym;
746 const char *sym;
744{
745 char *p = *dst;
746 int len = (sym ? strlen (sym) : 0);
747
748 if (len >= 16)
749 {
750 *p++ = '0';
751 len = 16;

--- 40 unchanged lines hidden (view full) ---

792 {
793 sum += sum_block[(unsigned char) *s];
794 }
795
796 sum += sum_block[(unsigned char) front[1]]; /* length */
797 sum += sum_block[(unsigned char) front[2]];
798 sum += sum_block[(unsigned char) front[3]]; /* type */
799 TOHEX (front + 4, sum);
747{
748 char *p = *dst;
749 int len = (sym ? strlen (sym) : 0);
750
751 if (len >= 16)
752 {
753 *p++ = '0';
754 len = 16;

--- 40 unchanged lines hidden (view full) ---

795 {
796 sum += sum_block[(unsigned char) *s];
797 }
798
799 sum += sum_block[(unsigned char) front[1]]; /* length */
800 sum += sum_block[(unsigned char) front[2]];
801 sum += sum_block[(unsigned char) front[3]]; /* type */
802 TOHEX (front + 4, sum);
800 if (bfd_write (front, 1, 6, abfd) != 6)
803 if (bfd_bwrite (front, (bfd_size_type) 6, abfd) != 6)
801 abort ();
802 end[0] = '\n';
803 wrlen = end - start + 1;
804 abort ();
805 end[0] = '\n';
806 wrlen = end - start + 1;
804 if (bfd_write (start, 1, wrlen, abfd) != wrlen)
807 if (bfd_bwrite (start, wrlen, abfd) != wrlen)
805 abort ();
806}
807
808static boolean
809tekhex_write_object_contents (abfd)
810 bfd *abfd;
811{
812 int bytes_written;

--- 8 unchanged lines hidden (view full) ---

821
822 /* And the raw data */
823 for (d = abfd->tdata.tekhex_data->data;
824 d != (struct data_struct *) NULL;
825 d = d->next)
826 {
827 int low;
828
808 abort ();
809}
810
811static boolean
812tekhex_write_object_contents (abfd)
813 bfd *abfd;
814{
815 int bytes_written;

--- 8 unchanged lines hidden (view full) ---

824
825 /* And the raw data */
826 for (d = abfd->tdata.tekhex_data->data;
827 d != (struct data_struct *) NULL;
828 d = d->next)
829 {
830 int low;
831
829 CONST int span = 32;
832 const int span = 32;
830 int addr;
831
832 /* Write it in blocks of 32 bytes */
833
834 for (addr = 0; addr < CHUNK_MASK + 1; addr += span)
835 {
836 int need = 0;
837

--- 33 unchanged lines hidden (view full) ---

871 if (abfd->outsymbols)
872 {
873 for (p = abfd->outsymbols; *p; p++)
874 {
875 int section_code = bfd_decode_symclass (*p);
876
877 if (section_code != '?')
878 { /* do not include debug symbols */
833 int addr;
834
835 /* Write it in blocks of 32 bytes */
836
837 for (addr = 0; addr < CHUNK_MASK + 1; addr += span)
838 {
839 int need = 0;
840

--- 33 unchanged lines hidden (view full) ---

874 if (abfd->outsymbols)
875 {
876 for (p = abfd->outsymbols; *p; p++)
877 {
878 int section_code = bfd_decode_symclass (*p);
879
880 if (section_code != '?')
881 { /* do not include debug symbols */
879 asymbol *s = *p;
882 asymbol *sym = *p;
880 char *dst = buffer;
881
883 char *dst = buffer;
884
882 writesym (&dst, s->section->name);
885 writesym (&dst, sym->section->name);
883
884 switch (section_code)
885 {
886 case 'A':
887 *dst++ = '2';
888 break;
889 case 'a':
890 *dst++ = '6';

--- 15 unchanged lines hidden (view full) ---

906 *dst++ = '7';
907 break;
908 case 'C':
909 case 'U':
910 bfd_set_error (bfd_error_wrong_format);
911 return false;
912 }
913
886
887 switch (section_code)
888 {
889 case 'A':
890 *dst++ = '2';
891 break;
892 case 'a':
893 *dst++ = '6';

--- 15 unchanged lines hidden (view full) ---

909 *dst++ = '7';
910 break;
911 case 'C':
912 case 'U':
913 bfd_set_error (bfd_error_wrong_format);
914 return false;
915 }
916
914 writesym (&dst, s->name);
915 writevalue (&dst, s->value + s->section->vma);
917 writesym (&dst, sym->name);
918 writevalue (&dst, sym->value + sym->section->vma);
916 out (abfd, '3', buffer, dst);
917 }
918 }
919 }
920
921 /* And the terminator */
919 out (abfd, '3', buffer, dst);
920 }
921 }
922 }
923
924 /* And the terminator */
922 if (bfd_write ("%0781010\n", 1, 9, abfd) != 9)
925 if (bfd_bwrite ("%0781010\n", (bfd_size_type) 9, abfd) != 9)
923 abort ();
924 return true;
925}
926
927static int
928tekhex_sizeof_headers (abfd, exec)
929 bfd *abfd ATTRIBUTE_UNUSED;
930 boolean exec ATTRIBUTE_UNUSED;
931
932{
933 return 0;
934}
935
936static asymbol *
937tekhex_make_empty_symbol (abfd)
938 bfd *abfd;
939{
926 abort ();
927 return true;
928}
929
930static int
931tekhex_sizeof_headers (abfd, exec)
932 bfd *abfd ATTRIBUTE_UNUSED;
933 boolean exec ATTRIBUTE_UNUSED;
934
935{
936 return 0;
937}
938
939static asymbol *
940tekhex_make_empty_symbol (abfd)
941 bfd *abfd;
942{
940 tekhex_symbol_type *new =
941 (tekhex_symbol_type *) bfd_zalloc (abfd, sizeof (struct tekhex_symbol_struct));
943 bfd_size_type amt = sizeof (struct tekhex_symbol_struct);
944 tekhex_symbol_type *new = (tekhex_symbol_type *) bfd_zalloc (abfd, amt);
942
943 if (!new)
944 return NULL;
945 new->symbol.the_bfd = abfd;
946 new->prev = (struct tekhex_symbol_struct *) NULL;
947 return &(new->symbol);
948}
949
950static void
951tekhex_get_symbol_info (ignore_abfd, symbol, ret)
952 bfd *ignore_abfd ATTRIBUTE_UNUSED;
953 asymbol *symbol;
954 symbol_info *ret;
955{
956 bfd_symbol_info (symbol, ret);
957}
958
959static void
945
946 if (!new)
947 return NULL;
948 new->symbol.the_bfd = abfd;
949 new->prev = (struct tekhex_symbol_struct *) NULL;
950 return &(new->symbol);
951}
952
953static void
954tekhex_get_symbol_info (ignore_abfd, symbol, ret)
955 bfd *ignore_abfd ATTRIBUTE_UNUSED;
956 asymbol *symbol;
957 symbol_info *ret;
958{
959 bfd_symbol_info (symbol, ret);
960}
961
962static void
960tekhex_print_symbol (ignore_abfd, filep, symbol, how)
961 bfd *ignore_abfd ATTRIBUTE_UNUSED;
963tekhex_print_symbol (abfd, filep, symbol, how)
964 bfd *abfd;
962 PTR filep;
963 asymbol *symbol;
964 bfd_print_symbol_type how;
965{
966 FILE *file = (FILE *) filep;
967
968 switch (how)
969 {
970 case bfd_print_symbol_name:
971 fprintf (file, "%s", symbol->name);
972 break;
973 case bfd_print_symbol_more:
974 break;
975
976 case bfd_print_symbol_all:
977 {
965 PTR filep;
966 asymbol *symbol;
967 bfd_print_symbol_type how;
968{
969 FILE *file = (FILE *) filep;
970
971 switch (how)
972 {
973 case bfd_print_symbol_name:
974 fprintf (file, "%s", symbol->name);
975 break;
976 case bfd_print_symbol_more:
977 break;
978
979 case bfd_print_symbol_all:
980 {
978 CONST char *section_name = symbol->section->name;
981 const char *section_name = symbol->section->name;
979
982
980 bfd_print_symbol_vandf ((PTR) file, symbol);
983 bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
981
982 fprintf (file, " %-5s %s",
983 section_name,
984 symbol->name);
985 }
986 }
987}
988

--- 7 unchanged lines hidden (view full) ---

996#define tekhex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
997#define tekhex_read_minisymbols _bfd_generic_read_minisymbols
998#define tekhex_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
999
1000#define tekhex_bfd_get_relocated_section_contents \
1001 bfd_generic_get_relocated_section_contents
1002#define tekhex_bfd_relax_section bfd_generic_relax_section
1003#define tekhex_bfd_gc_sections bfd_generic_gc_sections
984
985 fprintf (file, " %-5s %s",
986 section_name,
987 symbol->name);
988 }
989 }
990}
991

--- 7 unchanged lines hidden (view full) ---

999#define tekhex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
1000#define tekhex_read_minisymbols _bfd_generic_read_minisymbols
1001#define tekhex_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
1002
1003#define tekhex_bfd_get_relocated_section_contents \
1004 bfd_generic_get_relocated_section_contents
1005#define tekhex_bfd_relax_section bfd_generic_relax_section
1006#define tekhex_bfd_gc_sections bfd_generic_gc_sections
1007#define tekhex_bfd_merge_sections bfd_generic_merge_sections
1004#define tekhex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
1005#define tekhex_bfd_link_add_symbols _bfd_generic_link_add_symbols
1006#define tekhex_bfd_final_link _bfd_generic_final_link
1007#define tekhex_bfd_link_split_section _bfd_generic_link_split_section
1008
1009#define tekhex_get_section_contents_in_window \
1010 _bfd_generic_get_section_contents_in_window
1011

--- 54 unchanged lines hidden ---
1008#define tekhex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
1009#define tekhex_bfd_link_add_symbols _bfd_generic_link_add_symbols
1010#define tekhex_bfd_final_link _bfd_generic_final_link
1011#define tekhex_bfd_link_split_section _bfd_generic_link_split_section
1012
1013#define tekhex_get_section_contents_in_window \
1014 _bfd_generic_get_section_contents_in_window
1015

--- 54 unchanged lines hidden ---