home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update38.zoo / util / diffs
Encoding:
Text File  |  1994-02-03  |  14.6 KB  |  540 lines

  1. ===================================================================
  2. RCS file: /net/acae127/home/bammi/etc/src/master/atari/cross-util/Changelog,v
  3. retrieving revision 1.40
  4. diff -c -r1.40 Changelog
  5. *** 1.40    1993/07/13 19:57:32
  6. --- Changelog    1994/02/03 21:19:36
  7. ***************
  8. *** 490,492 ****
  9. --- 490,513 ----
  10.       do chmod() on output file.
  11.   
  12.   ----------------------------- Patchlevel 37 --------------------------------
  13. + ld.c:: Jean-Marc Zucconi (jmz@cabri.obs-besancon.fr )
  14. +     on a little endian machine, the output symbol type was'nt being byte
  15. +     byte swapped.
  16. + printstk.c, fixstk.c:: Jean-Marc Zucconi (jmz@cabri.obs-besancon.fr )
  17. +     fix up for little endian machines. ( BYTE_SWAP #defined)
  18. + ld.c:: Thomas  FFH002@VM.HRZ.UNI-ESSEN.DE
  19. +     fixes for BYTE_SWAP (ie little endian machines for N_SETV (for
  20. +     global ctor/dtor table) to ld.c. Thanks!
  21. + nm.c:: Thomas  FFH002@VM.HRZ.UNI-ESSEN.DE
  22. +     fixes for BYTE_SWAP (little endian machines). thanks!
  23. +     486/freeBSD now reported to work great as a cross-compile
  24. +     platform for the atari-gcc/g++. (for 486/freeBSD use
  25. +     -DBYTE_SWAP while compiling utils. Dont know if
  26. +     -DWORD_ALIGNED is needed)
  27. + ----------------------------- Patchlevel 38 --------------------------------
  28. ===================================================================
  29. RCS file: /net/acae127/home/bammi/etc/src/master/atari/cross-util/PatchLev.h,v
  30. retrieving revision 1.34
  31. diff -c -r1.34 PatchLev.h
  32. *** 1.34    1993/07/13 19:57:35
  33. --- PatchLev.h    1994/02/03 21:19:50
  34. ***************
  35. *** 1,4 ****
  36. ! #define PatchLevel "37"
  37.   
  38.   /*
  39.    *    the Patch Level above is to identify the version
  40. --- 1,4 ----
  41. ! #define PatchLevel "38"
  42.   
  43.   /*
  44.    *    the Patch Level above is to identify the version
  45. ===================================================================
  46. RCS file: /net/acae127/home/bammi/etc/src/master/atari/cross-util/demangle.c,v
  47. retrieving revision 1.1
  48. diff -c -r1.1 demangle.c
  49. *** 1.1    1992/06/03 18:40:27
  50. --- demangle.c    1993/11/02 17:01:26
  51. ***************
  52. *** 4,9 ****
  53. --- 4,11 ----
  54.   #include <stdio.h>
  55.   #include <ctype.h>
  56.   
  57. + #include "demangle.h"
  58.   char *cplus_demangle();
  59.   char word[1024];
  60.   
  61. ***************
  62. *** 24,30 ****
  63.           word[i] = '\0';
  64.                   in_word = 0;
  65.                   i = 0;
  66. !         s = cplus_demangle(word);
  67.           printf("%s%c", s?s:word, c);
  68.           if(s) free(s);
  69.           }
  70. --- 26,32 ----
  71.           word[i] = '\0';
  72.                   in_word = 0;
  73.                   i = 0;
  74. !         s = cplus_demangle(word, DMGL_ANSI|DMGL_PARAMS);
  75.           printf("%s%c", s?s:word, c);
  76.           if(s) free(s);
  77.           }
  78. ===================================================================
  79. RCS file: /net/acae127/home/bammi/etc/src/master/atari/cross-util/fixstk.c,v
  80. retrieving revision 1.8
  81. diff -c -r1.8 fixstk.c
  82. *** 1.8    1993/05/21 15:23:06
  83. --- fixstk.c    1993/07/14 21:23:21
  84. ***************
  85. *** 41,46 ****
  86. --- 41,54 ----
  87.   # define SYM_OFFSET   (sizeof(short) + (3*sizeof(long)))
  88.   #endif
  89.   
  90. + #ifdef BYTE_SWAP
  91. + #define SWAP4(y) (((unsigned)(y)>>24) + (((unsigned)(y)>>8)&0xff00) + \
  92. +          (((unsigned)(y)<<8)&0xff0000) + ((unsigned)(y)<<24)) 
  93. + #define SWAP2(y) ((((unsigned)(y)&0xff00)>>8) + (((unsigned)(y)&0x00ff)<<8))
  94. + #endif /* BYTE_SWAP */
  95.   int error = 0;
  96.   long newstksize;
  97.   
  98. ***************
  99. *** 70,75 ****
  100. --- 78,89 ----
  101.       perror(fn);
  102.       return -1;
  103.       }
  104. + #ifdef BYTE_SWAP
  105. +     head.a_magic = SWAP2(head.a_magic);
  106. +     head.a_syms = SWAP4(head.a_syms);
  107. +     head.a_text = SWAP4(head.a_text);
  108. +     head.a_data = SWAP4(head.a_data);
  109. + #endif
  110.       if(head.a_magic != CMAGIC)
  111.       {
  112.       fprintf(stderr,"%s: invalid magic number %x\n", fn, head.a_magic);
  113. ***************
  114. *** 101,106 ****
  115. --- 115,124 ----
  116.           fprintf(stderr, "%s: symbol _stksize not found\n", fn);
  117.           return -1;
  118.       }
  119. + #ifdef BYTE_SWAP
  120. +     sym.a_type = SWAP2(sym.a_type);
  121. +     sym.a_value = SWAP4(sym.a_value);
  122. + #endif
  123.       if (index && (sym.a_type & A_LNAM) == A_LNAM)
  124.         if (read (fd, extension, sizeof (extension)) != sizeof (extension))
  125.           {
  126. ***************
  127. *** 199,209 ****
  128. --- 217,233 ----
  129.       return 1;
  130.       }
  131.       read(fd, &stksize, sizeof(long));
  132. + #ifdef BYTE_SWAP
  133. +     stksize = SWAP4(stksize);
  134. + #endif
  135.       printf("%s: %s was %ld (%dK)\n",
  136.            fn, sym_names[what] + 1, stksize, (int)(stksize/1024));
  137.       
  138.       lseek(fd, -((long)sizeof(long)), 1);
  139.       
  140. + #ifdef BYTE_SWAP
  141. +     newstksize = SWAP4(newstksize);
  142. + #endif
  143.       if(write(fd, &newstksize, sizeof(long)) != sizeof(long))
  144.       {
  145.       perror(fn);
  146. ***************
  147. *** 214,219 ****
  148. --- 238,246 ----
  149.       lseek(fd, -((long)sizeof(long)), 1);
  150.       
  151.       read(fd, &stksize, sizeof(long));
  152. + #ifdef BYTE_SWAP
  153. +     stksize = SWAP4(stksize);
  154. + #endif
  155.       printf("%s: %s now is %ld (%dK)\n",
  156.            fn, sym_names[what] + 1, stksize, (int)(stksize/1024));
  157.       return close(fd) != 0;
  158. ===================================================================
  159. RCS file: /net/acae127/home/bammi/etc/src/master/atari/cross-util/ld.c,v
  160. retrieving revision 1.44
  161. diff -c -r1.44 ld.c
  162. *** 1.44    1993/07/13 19:57:38
  163. --- ld.c    1994/01/29 00:18:26
  164. ***************
  165. *** 4195,4200 ****
  166. --- 4195,4204 ----
  167.   void
  168.   write_text ()
  169.   {
  170. + #ifdef BYTE_SWAP
  171. + int i;
  172. + unsigned long vbuf;
  173. + #endif
  174.     if (trace_files)
  175.       fprintf (stderr, "Copying and relocating text:\n\n");
  176.   
  177. ***************
  178. *** 4204,4213 ****
  179.     /* Write out the set element vectors */
  180.   
  181.     if (set_vector_count)
  182.       mywrite ((char *) set_vectors,
  183.            set_symbol_count + 2 * set_vector_count,
  184.            sizeof (unsigned long), outdesc);
  185.     if (trace_files)
  186.       fprintf (stderr, "\n");
  187.   
  188. --- 4208,4224 ----
  189.     /* Write out the set element vectors */
  190.   
  191.     if (set_vector_count)
  192. + #ifdef BYTE_SWAP /* THN 94-01-27 */
  193. +     for(i=0; i < set_symbol_count + 2 * set_vector_count; ++ i){
  194. +       vbuf = SWAP4(set_vectors[i]);
  195. + /* printf("%lx -> %lx\n", set_vectors[i], vbuf); */
  196. +       mywrite((char *)&vbuf,1,sizeof(unsigned long), outdesc);
  197. +     }
  198. + #else
  199.       mywrite ((char *) set_vectors,
  200.            set_symbol_count + 2 * set_vector_count,
  201.            sizeof (unsigned long), outdesc);
  202. ! #endif
  203.     if (trace_files)
  204.       fprintf (stderr, "\n");
  205.   
  206. ***************
  207. *** 4592,4599 ****
  208.           entry->strings = (char *) xmalloc (entry->string_size);
  209.           read_entry_strings (file_open (entry), entry);
  210.             }
  211. !         error ("fatal error: relocation out of range for %s in %s",
  212. !         retsymname(p, entry, oldreloc+word), entry->filename);
  213.           make_executable = 0;
  214.         }
  215.         word &= ~mask;
  216. --- 4603,4610 ----
  217.           entry->strings = (char *) xmalloc (entry->string_size);
  218.           read_entry_strings (file_open (entry), entry);
  219.             }
  220. !         error ("fatal error: relocation out of range (%d) for %s in %s",
  221. !         relocation, retsymname(p, entry, oldreloc+word), entry->filename);
  222.           make_executable = 0;
  223.         }
  224.         word &= ~mask;
  225. ***************
  226. *** 4763,4769 ****
  227.   {
  228.       unsigned char byte = b & 0xFF;
  229.   
  230. ! /*fprintf(stderr, "  %X\n", byte);*/
  231.     if (rbuf_size >= RBUF_SIZE)
  232.       flush_atari_rbuf();
  233.     rbuf[rbuf_size++] = byte;
  234. --- 4774,4780 ----
  235.   {
  236.       unsigned char byte = b & 0xFF;
  237.   
  238. ! /*fprintf(stderr, "  %X", byte);*/
  239.     if (rbuf_size >= RBUF_SIZE)
  240.       flush_atari_rbuf();
  241.     rbuf[rbuf_size++] = byte;
  242. ***************
  243. *** 5020,5025 ****
  244. --- 5031,5039 ----
  245.     else if (*str && gst_symboltable)    /* if more to write */
  246.       {
  247.         sym.a_type |= A_LNAM;
  248. + #ifdef BYTE_SWAP
  249. +       sym.a_type = SWAP2(sym.a_type);
  250. + #endif
  251.         i = sizeof sym;
  252.         gst_symbols++;
  253.       }
  254. ===================================================================
  255. RCS file: /net/acae127/home/bammi/etc/src/master/atari/cross-util/nm.c,v
  256. retrieving revision 1.12
  257. diff -c -r1.12 nm.c
  258. *** 1.12    1993/05/21 15:23:12
  259. --- nm.c    1994/01/29 00:20:24
  260. ***************
  261. *** 100,106 ****
  262. --- 100,119 ----
  263.    You are forbidden to forbid anyone else to use, share and improve
  264.    what you give them.   Help stamp out software-hoarding!  */
  265.   
  266. + #ifdef BYTE_SWAP
  267.   
  268. + #define SWAP4(y) (((unsigned)(y)>>24) + (((unsigned)(y)>>8)&0xff00) + \
  269. +                  (((unsigned)(y)<<8)&0xff0000) + ((unsigned)(y)<<24))
  270. + #define SWAP2(y) ((((unsigned)(y)&0xff00)>>8) + (((unsigned)(y)&0x00ff)<<8))
  271. + #endif /* BYTE_SWAP */
  272. + #ifdef CROSSATARI
  273. + #  ifdef atarist
  274. + #    undef atarist
  275. + #  endif
  276. + #  ifdef atariminix
  277. + #    undef atariminix
  278. + #  endif
  279. + #endif
  280.   #if (CROSSATARI || atarist || atariminix)
  281.   #include "gnu-out.h"
  282.   #else
  283. ***************
  284. *** 318,323 ****
  285. --- 331,339 ----
  286.     input_member = 0;
  287.   
  288.     len = read (desc, &magicnum, sizeof magicnum);
  289. + #ifdef BYTE_SWAP
  290. +   magicnum = SWAP4(magicnum);
  291. + #endif
  292.     if (len != sizeof magicnum)
  293.       error_with_file ("failure reading header of ");
  294.     else if (!N_BADMAG (*((struct exec *)&magicnum)))
  295. ***************
  296. *** 330,337 ****
  297.         lseek (desc, 0, 0);
  298.         nchars = read (desc, armag, SARMAG);
  299.   
  300. !       if (SARMAG != nchars || strncmp (armag, ARMAG, SARMAG))
  301.       error_with_file ("malformed input file (not rel or archive) ");
  302.         else
  303.           scan_library (desc);
  304.       }
  305. --- 346,355 ----
  306.         lseek (desc, 0, 0);
  307.         nchars = read (desc, armag, SARMAG);
  308.   
  309. !       if (SARMAG != nchars || strncmp (armag, ARMAG, SARMAG)){
  310. !     fprintf(stderr,"Magix is %lx, expected %lx\n",magicnum,OMAGIC);
  311.       error_with_file ("malformed input file (not rel or archive) ");
  312. +       }
  313.         else
  314.           scan_library (desc);
  315.       }
  316. ***************
  317. *** 517,522 ****
  318. --- 535,543 ----
  319.         error_with_file ("bad string table in ");
  320.         return;
  321.       }
  322. + #ifdef BYTE_SWAP
  323. +   string_size = SWAP4(string_size);
  324. + #endif
  325.   
  326.     /* Number of symbol entries in the file.  */
  327.     symcount = header.a_syms / sizeof (struct nlist);
  328. ***************
  329. *** 552,559 ****
  330.       struct nlist *end = symbols_and_strings + symcount;
  331.   
  332.       for (; p < end; p++)
  333. !       if (p->n_un.n_strx)
  334.           p->n_un.n_name = strings + p->n_un.n_strx;
  335.     }
  336.   
  337.     /* Sort the symbols if desired.  */
  338. --- 573,584 ----
  339.       struct nlist *end = symbols_and_strings + symcount;
  340.   
  341.       for (; p < end; p++)
  342. !       if (p->n_un.n_strx){
  343. ! #ifdef BYTE_SWAP
  344. !     p->n_un.n_strx = SWAP4(p->n_un.n_strx);
  345. ! #endif
  346.           p->n_un.n_name = strings + p->n_un.n_strx;
  347. +       }
  348.     }
  349.   
  350.     /* Sort the symbols if desired.  */
  351. ***************
  352. *** 583,588 ****
  353. --- 608,632 ----
  354.     len = read (desc, loc, sizeof (struct exec));
  355.     if (len != sizeof (struct exec))
  356.       error_with_file ("failure reading header of ");
  357. + #ifdef BYTE_SWAP
  358. + loc->a_info = SWAP4(loc->a_info);       /* always four (4) bytes */
  359. + if (sizeof(loc->a_text)==4)                     /* does this need to be ? */
  360. + {  loc->a_text   = SWAP4(loc->a_text);
  361. +    loc->a_data   = SWAP4(loc->a_data);
  362. +    loc->a_bss    = SWAP4(loc->a_bss);
  363. +    loc->a_syms   = SWAP4(loc->a_syms);
  364. +    loc->a_entry  = SWAP4(loc->a_entry);
  365. +    loc->a_trsize = SWAP4(loc->a_trsize);
  366. +    loc->a_drsize = SWAP4(loc->a_drsize); }
  367. + else
  368. + {  loc->a_text   = SWAP4(loc->a_text);
  369. +    loc->a_data   = SWAP4(loc->a_data);
  370. +    loc->a_bss    = SWAP4(loc->a_bss);
  371. +    loc->a_syms   = SWAP4(loc->a_syms);
  372. +    loc->a_entry  = SWAP4(loc->a_entry);
  373. +    loc->a_trsize = SWAP4(loc->a_trsize);
  374. +    loc->a_drsize = SWAP4(loc->a_drsize); }
  375. + #endif /* BYTE_SWAP */
  376.   }
  377.   
  378.   /* Choose which symbol entries to print;
  379. ***************
  380. *** 687,693 ****
  381. --- 731,741 ----
  382.       }
  383.   
  384.     if (sym->n_type & ~N_EXT || sym->n_value)
  385. + #ifdef BYTE_SWAP
  386. +     printf ("%08x ", SWAP4(sym->n_value));
  387. + #else
  388.       printf ("%08x ", sym->n_value);
  389. + #endif
  390.     else printf ("         ");
  391.   
  392.     switch (sym->n_type)
  393. ***************
  394. *** 805,811 ****
  395. --- 853,863 ----
  396.           default:
  397.             s = "";
  398.           }
  399. + #ifdef BYTE_SWAP
  400. +       printf ("- %02x %04x %5s", sym->n_other, SWAP2(sym->n_desc), s);
  401. + #else
  402.         printf ("- %02x %04x %5s", sym->n_other, sym->n_desc, s);
  403. + #endif
  404.       }
  405.       }
  406.   
  407. ***************
  408. *** 851,856 ****
  409. --- 903,911 ----
  410.         error_with_file ("premature eof in ");
  411.         return;
  412.       }
  413. + #ifdef BYTE_SWAP
  414. +   symdef_size = SWAP4(symdef_size);
  415. + #endif
  416.   
  417.     if (symdef_size < 0)
  418.       {
  419. ***************
  420. *** 873,878 ****
  421. --- 928,936 ----
  422.         free (symdefs);
  423.         return;
  424.       }
  425. + #ifdef BYTE_SWAP
  426. +   stringsize = SWAP4(stringsize);
  427. + #endif
  428.   
  429.     if (stringsize < 0)
  430.       {
  431. ***************
  432. *** 904,916 ****
  433.     member_offset = -1;
  434.     for (i = 0; i < nsymdefs; i++)
  435.       {
  436. !       if (symdefs[i].stringoffset < 0 || symdefs[i].stringoffset >= stringsize)
  437.       {
  438.         error_with_file ("invalid entry in ");
  439.         free (symdefs);
  440.         free (strings);
  441.         return;
  442.       }
  443.         if (member_offset != symdefs[i].offset)
  444.       {
  445.         member_offset = symdefs[i].offset;
  446. --- 962,980 ----
  447.     member_offset = -1;
  448.     for (i = 0; i < nsymdefs; i++)
  449.       {
  450. ! #ifdef BYTE_SWAP
  451. !   symdefs[i].stringoffset = SWAP4(symdefs[i].stringoffset);
  452. ! #endif
  453. !   if (symdefs[i].stringoffset < 0 || symdefs[i].stringoffset >= stringsize)
  454.       {
  455.         error_with_file ("invalid entry in ");
  456.         free (symdefs);
  457.         free (strings);
  458.         return;
  459.       }
  460. + #ifdef BYTE_SWAP
  461. +   symdefs[i].offset = SWAP4(symdefs[i].offset);
  462. + #endif
  463.         if (member_offset != symdefs[i].offset)
  464.       {
  465.         member_offset = symdefs[i].offset;
  466. ===================================================================
  467. RCS file: /net/acae127/home/bammi/etc/src/master/atari/cross-util/printstk.c,v
  468. retrieving revision 1.8
  469. diff -c -r1.8 printstk.c
  470. *** 1.8    1993/05/21 15:23:14
  471. --- printstk.c    1993/07/14 21:23:21
  472. ***************
  473. *** 35,41 ****
  474. --- 35,48 ----
  475.   # define SIZEOF_ASYM  ((SYMLEN*sizeof(char)) + sizeof(short) + sizeof(long))
  476.   # define SYM_OFFSET   (sizeof(short) + (3*sizeof(long)))
  477.   #endif
  478. + #ifdef BYTE_SWAP
  479.   
  480. + #define SWAP4(y) (((unsigned)(y)>>24) + (((unsigned)(y)>>8)&0xff00) + \
  481. +          (((unsigned)(y)<<8)&0xff0000) + ((unsigned)(y)<<24)) 
  482. + #define SWAP2(y) ((((unsigned)(y)&0xff00)>>8) + (((unsigned)(y)&0x00ff)<<8))
  483. + #endif /* BYTE_SWAP */
  484.   int error = 0;
  485.   
  486.   static char *sym_names[] = { "__stksize", "__initial_stack" };
  487. ***************
  488. *** 64,69 ****
  489. --- 71,82 ----
  490.       perror(fn);
  491.       return -1;
  492.       }
  493. + #ifdef BYTE_SWAP
  494. +     head.a_magic = SWAP2(head.a_magic);
  495. +     head.a_syms = SWAP4(head.a_syms);
  496. +     head.a_text = SWAP4(head.a_text);
  497. +     head.a_data = SWAP4(head.a_data);
  498. + #endif
  499.       if(head.a_magic != CMAGIC)
  500.       {
  501.       fprintf(stderr,"%s: invalid magic number %x\n", fn, head.a_magic);
  502. ***************
  503. *** 95,100 ****
  504. --- 108,117 ----
  505.           fprintf(stderr, "%s: symbol _stksize not found\n", fn);
  506.           return -1;
  507.       }
  508. + #ifdef BYTE_SWAP
  509. +     sym.a_type = SWAP2(sym.a_type);
  510. +     sym.a_value = SWAP4(sym.a_value);
  511. + #endif
  512.       if (index && (sym.a_type & A_LNAM) == A_LNAM)
  513.         if (read (fd, extension, sizeof (extension)) != sizeof (extension))
  514.           {
  515. ***************
  516. *** 163,168 ****
  517. --- 180,188 ----
  518.       return 1;
  519.       }
  520.       read(fd, &stksize, sizeof(long));
  521. + #ifdef BYTE_SWAP
  522. +     stksize = SWAP4(stksize);
  523. + #endif
  524.       printf("%s: %s is %ld (%dK)\n",
  525.            fn, sym_names[what] + 1, stksize, (int)(stksize/1024));
  526.       
  527.