00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074 #include "bfd.h"
00075 #include "sysdep.h"
00076 #include "libbfd.h"
00077 #include "libiberty.h"
00078
00079 typedef struct
00080 {
00081 bfd_vma low;
00082 bfd_vma high;
00083 } addr_range_type;
00084
00085 typedef struct tekhex_symbol_struct
00086 {
00087
00088 asymbol symbol;
00089 struct tekhex_symbol_struct *prev;
00090
00091 } tekhex_symbol_type;
00092
00093 static const char digs[] = "0123456789ABCDEF";
00094
00095 static char sum_block[256];
00096
00097 #define NOT_HEX 20
00098 #define NIBBLE(x) hex_value(x)
00099 #define HEX(buffer) ((NIBBLE((buffer)[0])<<4) + NIBBLE((buffer)[1]))
00100 #define TOHEX(d,x) \
00101 (d)[1] = digs[(x) & 0xf]; \
00102 (d)[0] = digs[((x)>>4)&0xf];
00103 #define ISHEX(x) hex_p(x)
00104
00105 static void tekhex_init PARAMS ((void));
00106 static bfd_vma getvalue PARAMS ((char **));
00107 static void tekhex_print_symbol
00108 PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type));
00109 static void tekhex_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
00110 static asymbol *tekhex_make_empty_symbol PARAMS ((bfd *));
00111 static int tekhex_sizeof_headers PARAMS ((bfd *, bfd_boolean));
00112 static bfd_boolean tekhex_write_object_contents PARAMS ((bfd *));
00113 static void out PARAMS ((bfd *, int, char *, char *));
00114 static void writesym PARAMS ((char **, const char *));
00115 static void writevalue PARAMS ((char **, bfd_vma));
00116 static bfd_boolean tekhex_set_section_contents
00117 PARAMS ((bfd*, sec_ptr, const PTR, file_ptr, bfd_size_type));
00118 static bfd_boolean tekhex_set_arch_mach
00119 PARAMS ((bfd *, enum bfd_architecture, unsigned long));
00120 static bfd_boolean tekhex_get_section_contents
00121 PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
00122 static void move_section_contents
00123 PARAMS ((bfd *, asection *, const PTR, file_ptr, bfd_size_type, bfd_boolean));
00124 static const bfd_target *tekhex_object_p PARAMS ((bfd *));
00125 static bfd_boolean tekhex_mkobject PARAMS ((bfd *));
00126 static long tekhex_get_symtab_upper_bound PARAMS ((bfd *));
00127 static long tekhex_canonicalize_symtab PARAMS ((bfd *, asymbol **));
00128 static void pass_over PARAMS ((bfd *, void (*) (bfd*, int, char *)));
00129 static void first_phase PARAMS ((bfd *, int, char *));
00130 static void insert_byte PARAMS ((bfd *, int, bfd_vma));
00131 static struct data_struct *find_chunk PARAMS ((bfd *, bfd_vma));
00132 static unsigned int getsym PARAMS ((char *, char **));
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242 static void
00243 tekhex_init ()
00244 {
00245 unsigned int i;
00246 static bfd_boolean inited = FALSE;
00247 int val;
00248
00249 if (! inited)
00250 {
00251 inited = TRUE;
00252 hex_init ();
00253 val = 0;
00254 for (i = 0; i < 10; i++)
00255 {
00256 sum_block[i + '0'] = val++;
00257 }
00258 for (i = 'A'; i <= 'Z'; i++)
00259 {
00260 sum_block[i] = val++;
00261 }
00262 sum_block['$'] = val++;
00263 sum_block['%'] = val++;
00264 sum_block['.'] = val++;
00265 sum_block['_'] = val++;
00266 for (i = 'a'; i <= 'z'; i++)
00267 {
00268 sum_block[i] = val++;
00269 }
00270 }
00271 }
00272
00273
00274 #define MAXCHUNK 0xff
00275
00276 #define CHUNK 21
00277
00278
00279
00280
00281 struct tekhex_data_list_struct
00282 {
00283 unsigned char *data;
00284 bfd_vma where;
00285 bfd_size_type size;
00286 struct tekhex_data_list_struct *next;
00287
00288 };
00289 typedef struct tekhex_data_list_struct tekhex_data_list_type;
00290
00291 #define CHUNK_MASK 0x1fff
00292
00293 struct data_struct
00294 {
00295 char chunk_data[CHUNK_MASK + 1];
00296 char chunk_init[CHUNK_MASK + 1];
00297 bfd_vma vma;
00298 struct data_struct *next;
00299 };
00300
00301 typedef struct tekhex_data_struct
00302 {
00303 tekhex_data_list_type *head;
00304 unsigned int type;
00305 struct tekhex_symbol_struct *symbols;
00306 struct data_struct *data;
00307 } tdata_type;
00308
00309 #define enda(x) (x->vma + x->size)
00310
00311 static bfd_vma
00312 getvalue (srcp)
00313 char **srcp;
00314 {
00315 char *src = *srcp;
00316 bfd_vma value = 0;
00317 unsigned int len = hex_value(*src++);
00318
00319 if (len == 0)
00320 len = 16;
00321 while (len--)
00322 {
00323 value = value << 4 | hex_value(*src++);
00324 }
00325 *srcp = src;
00326 return value;
00327 }
00328
00329 static unsigned int
00330 getsym (dstp, srcp)
00331 char *dstp;
00332 char **srcp;
00333 {
00334 char *src = *srcp;
00335 unsigned int i;
00336 unsigned int len = hex_value(*src++);
00337
00338 if (len == 0)
00339 len = 16;
00340 for (i = 0; i < len; i++)
00341 dstp[i] = src[i];
00342 dstp[i] = 0;
00343 *srcp = src + i;
00344 return len;
00345 }
00346
00347 static struct data_struct *
00348 find_chunk (abfd, vma)
00349 bfd *abfd;
00350 bfd_vma vma;
00351 {
00352 struct data_struct *d = abfd->tdata.tekhex_data->data;
00353
00354 vma &= ~CHUNK_MASK;
00355 while (d && (d->vma) != vma)
00356 {
00357 d = d->next;
00358 }
00359 if (!d)
00360 {
00361
00362 d = ((struct data_struct *)
00363 bfd_zalloc (abfd, (bfd_size_type) sizeof (struct data_struct)));
00364
00365 if (!d)
00366 return NULL;
00367
00368 d->next = abfd->tdata.tekhex_data->data;
00369 d->vma = vma;
00370 abfd->tdata.tekhex_data->data = d;
00371 }
00372 return d;
00373 }
00374
00375 static void
00376 insert_byte (abfd, value, addr)
00377 bfd *abfd;
00378 int value;
00379 bfd_vma addr;
00380 {
00381
00382 struct data_struct *d = find_chunk (abfd, addr);
00383
00384 d->chunk_data[addr & CHUNK_MASK] = value;
00385 d->chunk_init[addr & CHUNK_MASK] = 1;
00386 }
00387
00388
00389
00390 static void
00391 first_phase (abfd, type, src)
00392 bfd *abfd;
00393 int type;
00394 char *src;
00395 {
00396 asection *section = bfd_abs_section_ptr;
00397 unsigned int len;
00398 char sym[17];
00399
00400 switch (type)
00401 {
00402 case '6':
00403
00404 {
00405 bfd_vma addr = getvalue (&src);
00406
00407 while (*src)
00408 {
00409 insert_byte (abfd, HEX (src), addr);
00410 src += 2;
00411 addr++;
00412 }
00413 }
00414
00415 return;
00416 case '3':
00417
00418 len = getsym (sym, &src);
00419 section = bfd_get_section_by_name (abfd, sym);
00420 if (section == (asection *) NULL)
00421 {
00422 char *n = bfd_alloc (abfd, (bfd_size_type) len + 1);
00423
00424 if (!n)
00425 abort ();
00426 memcpy (n, sym, len + 1);
00427 section = bfd_make_section (abfd, n);
00428 }
00429 while (*src)
00430 {
00431 switch (*src)
00432 {
00433 case '1':
00434 src++;
00435 section->vma = getvalue (&src);
00436 section->size = getvalue (&src) - section->vma;
00437 section->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
00438 break;
00439 case '0':
00440 case '2':
00441 case '3':
00442 case '4':
00443 case '6':
00444 case '7':
00445 case '8':
00446
00447 {
00448 bfd_size_type amt = sizeof (tekhex_symbol_type);
00449 tekhex_symbol_type *new =
00450 (tekhex_symbol_type *) bfd_alloc (abfd, amt);
00451 char stype = (*src);
00452
00453 if (!new)
00454 abort ();
00455 new->symbol.the_bfd = abfd;
00456 src++;
00457 abfd->symcount++;
00458 abfd->flags |= HAS_SYMS;
00459 new->prev = abfd->tdata.tekhex_data->symbols;
00460 abfd->tdata.tekhex_data->symbols = new;
00461 len = getsym (sym, &src);
00462 new->symbol.name = bfd_alloc (abfd, (bfd_size_type) len + 1);
00463 if (!new->symbol.name)
00464 abort ();
00465 memcpy ((char *) (new->symbol.name), sym, len + 1);
00466 new->symbol.section = section;
00467 if (stype <= '4')
00468 new->symbol.flags = (BSF_GLOBAL | BSF_EXPORT);
00469 else
00470 new->symbol.flags = BSF_LOCAL;
00471 new->symbol.value = getvalue (&src) - section->vma;
00472 }
00473 }
00474 }
00475 }
00476 }
00477
00478
00479
00480
00481 static void
00482 pass_over (abfd, func)
00483 bfd *abfd;
00484 void (*func) PARAMS ((bfd *, int, char *));
00485 {
00486 unsigned int chars_on_line;
00487 bfd_boolean eof = FALSE;
00488
00489
00490 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
00491 abort ();
00492 while (! eof)
00493 {
00494 char buffer[MAXCHUNK];
00495 char *src = buffer;
00496 char type;
00497
00498
00499 eof = (bfd_boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1);
00500 while (*src != '%' && !eof)
00501 {
00502 eof = (bfd_boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1);
00503 }
00504 if (eof)
00505 break;
00506 src++;
00507
00508
00509 if (bfd_bread (src, (bfd_size_type) 5, abfd) != 5)
00510 abort ();
00511
00512 type = src[2];
00513
00514 if (!ISHEX (src[0]) || !ISHEX (src[1]))
00515 break;
00516
00517 chars_on_line = HEX (src) - 5;
00518
00519 if (bfd_bread (src, (bfd_size_type) chars_on_line, abfd) != chars_on_line)
00520 abort ();
00521 src[chars_on_line] = 0;
00522
00523 func (abfd, type, src);
00524 }
00525
00526 }
00527
00528 static long
00529 tekhex_canonicalize_symtab (abfd, table)
00530 bfd *abfd;
00531 asymbol **table;
00532 {
00533 tekhex_symbol_type *p = abfd->tdata.tekhex_data->symbols;
00534 unsigned int c = bfd_get_symcount (abfd);
00535
00536 table[c] = 0;
00537 while (p)
00538 {
00539 table[--c] = &(p->symbol);
00540 p = p->prev;
00541 }
00542
00543 return bfd_get_symcount (abfd);
00544 }
00545
00546 static long
00547 tekhex_get_symtab_upper_bound (abfd)
00548 bfd *abfd;
00549 {
00550 return (abfd->symcount + 1) * (sizeof (struct tekhex_asymbol_struct *));
00551
00552 }
00553
00554 static bfd_boolean
00555 tekhex_mkobject (abfd)
00556 bfd *abfd;
00557 {
00558 tdata_type *tdata;
00559
00560 tdata = (tdata_type *) bfd_alloc (abfd, (bfd_size_type) sizeof (tdata_type));
00561 if (!tdata)
00562 return FALSE;
00563 abfd->tdata.tekhex_data = tdata;
00564 tdata->type = 1;
00565 tdata->head = (tekhex_data_list_type *) NULL;
00566 tdata->symbols = (struct tekhex_symbol_struct *) NULL;
00567 tdata->data = (struct data_struct *) NULL;
00568 return TRUE;
00569 }
00570
00571
00572
00573
00574
00575 static const bfd_target *
00576 tekhex_object_p (abfd)
00577 bfd *abfd;
00578 {
00579 char b[4];
00580
00581 tekhex_init ();
00582
00583 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
00584 || bfd_bread (b, (bfd_size_type) 4, abfd) != 4)
00585 return NULL;
00586
00587 if (b[0] != '%' || !ISHEX (b[1]) || !ISHEX (b[2]) || !ISHEX (b[3]))
00588 return (const bfd_target *) NULL;
00589
00590 tekhex_mkobject (abfd);
00591
00592 pass_over (abfd, first_phase);
00593 return abfd->xvec;
00594 }
00595
00596 static void
00597 move_section_contents (abfd, section, locationp, offset, count, get)
00598 bfd *abfd;
00599 asection *section;
00600 const PTR locationp;
00601 file_ptr offset;
00602 bfd_size_type count;
00603 bfd_boolean get;
00604 {
00605 bfd_vma addr;
00606 char *location = (char *) locationp;
00607 bfd_vma prev_number = 1;
00608 struct data_struct *d = (struct data_struct *) NULL;
00609
00610 BFD_ASSERT (offset == 0);
00611 for (addr = section->vma; count != 0; count--, addr++)
00612 {
00613
00614 bfd_vma chunk_number = addr & ~(bfd_vma) CHUNK_MASK;
00615 bfd_vma low_bits = addr & CHUNK_MASK;
00616
00617 if (chunk_number != prev_number)
00618 {
00619
00620 d = find_chunk (abfd, chunk_number);
00621 }
00622
00623 if (get)
00624 {
00625 if (d->chunk_init[low_bits])
00626 {
00627 *location = d->chunk_data[low_bits];
00628 }
00629 else
00630 {
00631 *location = 0;
00632 }
00633 }
00634 else
00635 {
00636 d->chunk_data[low_bits] = *location;
00637 d->chunk_init[low_bits] = (*location != 0);
00638 }
00639
00640 location++;
00641
00642 }
00643
00644 }
00645
00646 static bfd_boolean
00647 tekhex_get_section_contents (abfd, section, locationp, offset, count)
00648 bfd *abfd;
00649 asection *section;
00650 PTR locationp;
00651 file_ptr offset;
00652 bfd_size_type count;
00653 {
00654 if (section->flags & (SEC_LOAD | SEC_ALLOC))
00655 {
00656 move_section_contents (abfd, section, locationp, offset, count, TRUE);
00657 return TRUE;
00658 }
00659 else
00660 return FALSE;
00661 }
00662
00663 static bfd_boolean
00664 tekhex_set_arch_mach (abfd, arch, machine)
00665 bfd *abfd;
00666 enum bfd_architecture arch;
00667 unsigned long machine;
00668 {
00669 return bfd_default_set_arch_mach (abfd, arch, machine);
00670 }
00671
00672
00673
00674
00675 static bfd_boolean
00676 tekhex_set_section_contents (abfd, section, locationp, offset, bytes_to_do)
00677 bfd *abfd;
00678 sec_ptr section;
00679 const PTR locationp;
00680 file_ptr offset;
00681 bfd_size_type bytes_to_do;
00682 {
00683
00684 if (! abfd->output_has_begun)
00685 {
00686
00687 asection *s = abfd->sections;
00688 bfd_vma vma;
00689
00690 for (s = abfd->sections; s; s = s->next)
00691 {
00692 if (s->flags & SEC_LOAD)
00693 {
00694 for (vma = s->vma & ~(bfd_vma) CHUNK_MASK;
00695 vma < s->vma + s->size;
00696 vma += CHUNK_MASK)
00697 find_chunk (abfd, vma);
00698 }
00699 }
00700
00701 }
00702 if (section->flags & (SEC_LOAD | SEC_ALLOC))
00703 {
00704 move_section_contents (abfd, section, locationp, offset, bytes_to_do,
00705 FALSE);
00706 return TRUE;
00707 }
00708 else
00709 return FALSE;
00710
00711 }
00712
00713 static void
00714 writevalue (dst, value)
00715 char **dst;
00716 bfd_vma value;
00717 {
00718 char *p = *dst;
00719 int len;
00720 int shift;
00721
00722 for (len = 8, shift = 28; shift; shift -= 4, len--)
00723 {
00724 if ((value >> shift) & 0xf)
00725 {
00726 *p++ = len + '0';
00727 while (len)
00728 {
00729 *p++ = digs[(value >> shift) & 0xf];
00730 shift -= 4;
00731 len--;
00732 }
00733 *dst = p;
00734 return;
00735
00736 }
00737 }
00738 *p++ = '1';
00739 *p++ = '0';
00740 *dst = p;
00741 }
00742
00743 static void
00744 writesym (dst, sym)
00745 char **dst;
00746 const char *sym;
00747 {
00748 char *p = *dst;
00749 int len = (sym ? strlen (sym) : 0);
00750
00751 if (len >= 16)
00752 {
00753 *p++ = '0';
00754 len = 16;
00755 }
00756
00757 else
00758 {
00759 if (len == 0)
00760 {
00761 *p++ = '1';
00762 sym = "$";
00763 len = 1;
00764 }
00765 else
00766 {
00767 *p++ = digs[len];
00768 }
00769 }
00770
00771 while (len--)
00772 {
00773 *p++ = *sym++;
00774 }
00775 *dst = p;
00776 }
00777
00778 static void
00779 out (abfd, type, start, end)
00780 bfd *abfd;
00781 int type;
00782 char *start;
00783 char *end;
00784 {
00785 int sum = 0;
00786 char *s;
00787 char front[6];
00788 bfd_size_type wrlen;
00789
00790 front[0] = '%';
00791 TOHEX (front + 1, end - start + 5);
00792 front[3] = type;
00793
00794 for (s = start; s < end; s++)
00795 {
00796 sum += sum_block[(unsigned char) *s];
00797 }
00798
00799 sum += sum_block[(unsigned char) front[1]];
00800 sum += sum_block[(unsigned char) front[2]];
00801 sum += sum_block[(unsigned char) front[3]];
00802 TOHEX (front + 4, sum);
00803 if (bfd_bwrite (front, (bfd_size_type) 6, abfd) != 6)
00804 abort ();
00805 end[0] = '\n';
00806 wrlen = end - start + 1;
00807 if (bfd_bwrite (start, wrlen, abfd) != wrlen)
00808 abort ();
00809 }
00810
00811 static bfd_boolean
00812 tekhex_write_object_contents (abfd)
00813 bfd *abfd;
00814 {
00815 int bytes_written;
00816 char buffer[100];
00817 asymbol **p;
00818 asection *s;
00819 struct data_struct *d;
00820
00821 tekhex_init ();
00822
00823 bytes_written = 0;
00824
00825
00826 for (d = abfd->tdata.tekhex_data->data;
00827 d != (struct data_struct *) NULL;
00828 d = d->next)
00829 {
00830 int low;
00831
00832 const int span = 32;
00833 int addr;
00834
00835
00836
00837 for (addr = 0; addr < CHUNK_MASK + 1; addr += span)
00838 {
00839 int need = 0;
00840
00841
00842 for (low = 0; !need && low < span; low++)
00843 {
00844 if (d->chunk_init[addr + low])
00845 need = 1;
00846 }
00847 if (need)
00848 {
00849 char *dst = buffer;
00850
00851 writevalue (&dst, addr + d->vma);
00852 for (low = 0; low < span; low++)
00853 {
00854 TOHEX (dst, d->chunk_data[addr + low]);
00855 dst += 2;
00856 }
00857 out (abfd, '6', buffer, dst);
00858 }
00859 }
00860 }
00861
00862 for (s = abfd->sections; s != (asection *) NULL; s = s->next)
00863 {
00864 char *dst = buffer;
00865
00866 writesym (&dst, s->name);
00867 *dst++ = '1';
00868 writevalue (&dst, s->vma);
00869 writevalue (&dst, s->vma + s->size);
00870 out (abfd, '3', buffer, dst);
00871 }
00872
00873
00874 if (abfd->outsymbols)
00875 {
00876 for (p = abfd->outsymbols; *p; p++)
00877 {
00878 int section_code = bfd_decode_symclass (*p);
00879
00880 if (section_code != '?')
00881 {
00882 asymbol *sym = *p;
00883 char *dst = buffer;
00884
00885 writesym (&dst, sym->section->name);
00886
00887 switch (section_code)
00888 {
00889 case 'A':
00890 *dst++ = '2';
00891 break;
00892 case 'a':
00893 *dst++ = '6';
00894 break;
00895 case 'D':
00896 case 'B':
00897 case 'O':
00898 *dst++ = '4';
00899 break;
00900 case 'd':
00901 case 'b':
00902 case 'o':
00903 *dst++ = '8';
00904 break;
00905 case 'T':
00906 *dst++ = '3';
00907 break;
00908 case 't':
00909 *dst++ = '7';
00910 break;
00911 case 'C':
00912 case 'U':
00913 bfd_set_error (bfd_error_wrong_format);
00914 return FALSE;
00915 }
00916
00917 writesym (&dst, sym->name);
00918 writevalue (&dst, sym->value + sym->section->vma);
00919 out (abfd, '3', buffer, dst);
00920 }
00921 }
00922 }
00923
00924
00925 if (bfd_bwrite ("%0781010\n", (bfd_size_type) 9, abfd) != 9)
00926 abort ();
00927 return TRUE;
00928 }
00929
00930 static int
00931 tekhex_sizeof_headers (abfd, exec)
00932 bfd *abfd ATTRIBUTE_UNUSED;
00933 bfd_boolean exec ATTRIBUTE_UNUSED;
00934
00935 {
00936 return 0;
00937 }
00938
00939 static asymbol *
00940 tekhex_make_empty_symbol (abfd)
00941 bfd *abfd;
00942 {
00943 bfd_size_type amt = sizeof (struct tekhex_symbol_struct);
00944 tekhex_symbol_type *new = (tekhex_symbol_type *) bfd_zalloc (abfd, amt);
00945
00946 if (!new)
00947 return NULL;
00948 new->symbol.the_bfd = abfd;
00949 new->prev = (struct tekhex_symbol_struct *) NULL;
00950 return &(new->symbol);
00951 }
00952
00953 static void
00954 tekhex_get_symbol_info (ignore_abfd, symbol, ret)
00955 bfd *ignore_abfd ATTRIBUTE_UNUSED;
00956 asymbol *symbol;
00957 symbol_info *ret;
00958 {
00959 bfd_symbol_info (symbol, ret);
00960 }
00961
00962 static void
00963 tekhex_print_symbol (abfd, filep, symbol, how)
00964 bfd *abfd;
00965 PTR filep;
00966 asymbol *symbol;
00967 bfd_print_symbol_type how;
00968 {
00969 FILE *file = (FILE *) filep;
00970
00971 switch (how)
00972 {
00973 case bfd_print_symbol_name:
00974 fprintf (file, "%s", symbol->name);
00975 break;
00976 case bfd_print_symbol_more:
00977 break;
00978
00979 case bfd_print_symbol_all:
00980 {
00981 const char *section_name = symbol->section->name;
00982
00983 bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
00984
00985 fprintf (file, " %-5s %s",
00986 section_name,
00987 symbol->name);
00988 }
00989 }
00990 }
00991
00992 #define tekhex_close_and_cleanup _bfd_generic_close_and_cleanup
00993 #define tekhex_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
00994 #define tekhex_new_section_hook _bfd_generic_new_section_hook
00995
00996 #define tekhex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
00997 #define tekhex_bfd_is_local_label_name bfd_generic_is_local_label_name
00998 #define tekhex_get_lineno _bfd_nosymbols_get_lineno
00999 #define tekhex_find_nearest_line _bfd_nosymbols_find_nearest_line
01000 #define tekhex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
01001 #define tekhex_read_minisymbols _bfd_generic_read_minisymbols
01002 #define tekhex_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
01003
01004 #define tekhex_bfd_get_relocated_section_contents \
01005 bfd_generic_get_relocated_section_contents
01006 #define tekhex_bfd_relax_section bfd_generic_relax_section
01007 #define tekhex_bfd_gc_sections bfd_generic_gc_sections
01008 #define tekhex_bfd_merge_sections bfd_generic_merge_sections
01009 #define tekhex_bfd_is_group_section bfd_generic_is_group_section
01010 #define tekhex_bfd_discard_group bfd_generic_discard_group
01011 #define tekhex_section_already_linked \
01012 _bfd_generic_section_already_linked
01013 #define tekhex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
01014 #define tekhex_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
01015 #define tekhex_bfd_link_add_symbols _bfd_generic_link_add_symbols
01016 #define tekhex_bfd_link_just_syms _bfd_generic_link_just_syms
01017 #define tekhex_bfd_final_link _bfd_generic_final_link
01018 #define tekhex_bfd_link_split_section _bfd_generic_link_split_section
01019
01020 #define tekhex_get_section_contents_in_window \
01021 _bfd_generic_get_section_contents_in_window
01022
01023 const bfd_target tekhex_vec =
01024 {
01025 "tekhex",
01026 bfd_target_tekhex_flavour,
01027 BFD_ENDIAN_UNKNOWN,
01028 BFD_ENDIAN_UNKNOWN,
01029 (EXEC_P |
01030 HAS_SYMS | HAS_LINENO | HAS_DEBUG | HAS_RELOC | HAS_LOCALS |
01031 WP_TEXT | D_PAGED),
01032 (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
01033 | SEC_ALLOC | SEC_LOAD | SEC_RELOC),
01034 0,
01035 ' ',
01036 16,
01037 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
01038 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
01039 bfd_getb16, bfd_getb_signed_16, bfd_putb16,
01040 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
01041 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
01042 bfd_getb16, bfd_getb_signed_16, bfd_putb16,
01043
01044 {
01045 _bfd_dummy_target,
01046 tekhex_object_p,
01047 _bfd_dummy_target,
01048 _bfd_dummy_target,
01049 },
01050 {
01051 bfd_false,
01052 tekhex_mkobject,
01053 _bfd_generic_mkarchive,
01054 bfd_false,
01055 },
01056 {
01057 bfd_false,
01058 tekhex_write_object_contents,
01059 _bfd_write_archive_contents,
01060 bfd_false,
01061 },
01062
01063 BFD_JUMP_TABLE_GENERIC (tekhex),
01064 BFD_JUMP_TABLE_COPY (_bfd_generic),
01065 BFD_JUMP_TABLE_CORE (_bfd_nocore),
01066 BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
01067 BFD_JUMP_TABLE_SYMBOLS (tekhex),
01068 BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
01069 BFD_JUMP_TABLE_WRITE (tekhex),
01070 BFD_JUMP_TABLE_LINK (tekhex),
01071 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
01072
01073 NULL,
01074
01075 (PTR) 0
01076 };