home *** CD-ROM | disk | FTP | other *** search
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/cross-util/Changelog,v
- retrieving revision 1.40
- diff -c -r1.40 Changelog
- *** 1.40 1993/07/13 19:57:32
- --- Changelog 1994/02/03 21:19:36
- ***************
- *** 490,492 ****
- --- 490,513 ----
- do chmod() on output file.
-
- ----------------------------- Patchlevel 37 --------------------------------
- +
- + ld.c:: Jean-Marc Zucconi (jmz@cabri.obs-besancon.fr )
- + on a little endian machine, the output symbol type was'nt being byte
- + byte swapped.
- +
- + printstk.c, fixstk.c:: Jean-Marc Zucconi (jmz@cabri.obs-besancon.fr )
- + fix up for little endian machines. ( BYTE_SWAP #defined)
- +
- + ld.c:: Thomas FFH002@VM.HRZ.UNI-ESSEN.DE
- + fixes for BYTE_SWAP (ie little endian machines for N_SETV (for
- + global ctor/dtor table) to ld.c. Thanks!
- +
- + nm.c:: Thomas FFH002@VM.HRZ.UNI-ESSEN.DE
- + fixes for BYTE_SWAP (little endian machines). thanks!
- +
- + 486/freeBSD now reported to work great as a cross-compile
- + platform for the atari-gcc/g++. (for 486/freeBSD use
- + -DBYTE_SWAP while compiling utils. Dont know if
- + -DWORD_ALIGNED is needed)
- +
- + ----------------------------- Patchlevel 38 --------------------------------
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/cross-util/PatchLev.h,v
- retrieving revision 1.34
- diff -c -r1.34 PatchLev.h
- *** 1.34 1993/07/13 19:57:35
- --- PatchLev.h 1994/02/03 21:19:50
- ***************
- *** 1,4 ****
- ! #define PatchLevel "37"
-
- /*
- * the Patch Level above is to identify the version
- --- 1,4 ----
- ! #define PatchLevel "38"
-
- /*
- * the Patch Level above is to identify the version
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/cross-util/demangle.c,v
- retrieving revision 1.1
- diff -c -r1.1 demangle.c
- *** 1.1 1992/06/03 18:40:27
- --- demangle.c 1993/11/02 17:01:26
- ***************
- *** 4,9 ****
- --- 4,11 ----
- #include <stdio.h>
- #include <ctype.h>
-
- + #include "demangle.h"
- +
- char *cplus_demangle();
- char word[1024];
-
- ***************
- *** 24,30 ****
- word[i] = '\0';
- in_word = 0;
- i = 0;
- ! s = cplus_demangle(word);
- printf("%s%c", s?s:word, c);
- if(s) free(s);
- }
- --- 26,32 ----
- word[i] = '\0';
- in_word = 0;
- i = 0;
- ! s = cplus_demangle(word, DMGL_ANSI|DMGL_PARAMS);
- printf("%s%c", s?s:word, c);
- if(s) free(s);
- }
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/cross-util/fixstk.c,v
- retrieving revision 1.8
- diff -c -r1.8 fixstk.c
- *** 1.8 1993/05/21 15:23:06
- --- fixstk.c 1993/07/14 21:23:21
- ***************
- *** 41,46 ****
- --- 41,54 ----
- # define SYM_OFFSET (sizeof(short) + (3*sizeof(long)))
- #endif
-
- + #ifdef BYTE_SWAP
- +
- + #define SWAP4(y) (((unsigned)(y)>>24) + (((unsigned)(y)>>8)&0xff00) + \
- + (((unsigned)(y)<<8)&0xff0000) + ((unsigned)(y)<<24))
- + #define SWAP2(y) ((((unsigned)(y)&0xff00)>>8) + (((unsigned)(y)&0x00ff)<<8))
- +
- + #endif /* BYTE_SWAP */
- +
- int error = 0;
- long newstksize;
-
- ***************
- *** 70,75 ****
- --- 78,89 ----
- perror(fn);
- return -1;
- }
- + #ifdef BYTE_SWAP
- + head.a_magic = SWAP2(head.a_magic);
- + head.a_syms = SWAP4(head.a_syms);
- + head.a_text = SWAP4(head.a_text);
- + head.a_data = SWAP4(head.a_data);
- + #endif
- if(head.a_magic != CMAGIC)
- {
- fprintf(stderr,"%s: invalid magic number %x\n", fn, head.a_magic);
- ***************
- *** 101,106 ****
- --- 115,124 ----
- fprintf(stderr, "%s: symbol _stksize not found\n", fn);
- return -1;
- }
- + #ifdef BYTE_SWAP
- + sym.a_type = SWAP2(sym.a_type);
- + sym.a_value = SWAP4(sym.a_value);
- + #endif
- if (index && (sym.a_type & A_LNAM) == A_LNAM)
- if (read (fd, extension, sizeof (extension)) != sizeof (extension))
- {
- ***************
- *** 199,209 ****
- --- 217,233 ----
- return 1;
- }
- read(fd, &stksize, sizeof(long));
- + #ifdef BYTE_SWAP
- + stksize = SWAP4(stksize);
- + #endif
- printf("%s: %s was %ld (%dK)\n",
- fn, sym_names[what] + 1, stksize, (int)(stksize/1024));
-
- lseek(fd, -((long)sizeof(long)), 1);
-
- + #ifdef BYTE_SWAP
- + newstksize = SWAP4(newstksize);
- + #endif
- if(write(fd, &newstksize, sizeof(long)) != sizeof(long))
- {
- perror(fn);
- ***************
- *** 214,219 ****
- --- 238,246 ----
- lseek(fd, -((long)sizeof(long)), 1);
-
- read(fd, &stksize, sizeof(long));
- + #ifdef BYTE_SWAP
- + stksize = SWAP4(stksize);
- + #endif
- printf("%s: %s now is %ld (%dK)\n",
- fn, sym_names[what] + 1, stksize, (int)(stksize/1024));
- return close(fd) != 0;
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/cross-util/ld.c,v
- retrieving revision 1.44
- diff -c -r1.44 ld.c
- *** 1.44 1993/07/13 19:57:38
- --- ld.c 1994/01/29 00:18:26
- ***************
- *** 4195,4200 ****
- --- 4195,4204 ----
- void
- write_text ()
- {
- + #ifdef BYTE_SWAP
- + int i;
- + unsigned long vbuf;
- + #endif
- if (trace_files)
- fprintf (stderr, "Copying and relocating text:\n\n");
-
- ***************
- *** 4204,4213 ****
- /* Write out the set element vectors */
-
- if (set_vector_count)
- mywrite ((char *) set_vectors,
- set_symbol_count + 2 * set_vector_count,
- sizeof (unsigned long), outdesc);
- !
- if (trace_files)
- fprintf (stderr, "\n");
-
- --- 4208,4224 ----
- /* Write out the set element vectors */
-
- if (set_vector_count)
- + #ifdef BYTE_SWAP /* THN 94-01-27 */
- + for(i=0; i < set_symbol_count + 2 * set_vector_count; ++ i){
- + vbuf = SWAP4(set_vectors[i]);
- + /* printf("%lx -> %lx\n", set_vectors[i], vbuf); */
- + mywrite((char *)&vbuf,1,sizeof(unsigned long), outdesc);
- + }
- + #else
- mywrite ((char *) set_vectors,
- set_symbol_count + 2 * set_vector_count,
- sizeof (unsigned long), outdesc);
- ! #endif
- if (trace_files)
- fprintf (stderr, "\n");
-
- ***************
- *** 4592,4599 ****
- entry->strings = (char *) xmalloc (entry->string_size);
- read_entry_strings (file_open (entry), entry);
- }
- ! error ("fatal error: relocation out of range for %s in %s",
- ! retsymname(p, entry, oldreloc+word), entry->filename);
- make_executable = 0;
- }
- word &= ~mask;
- --- 4603,4610 ----
- entry->strings = (char *) xmalloc (entry->string_size);
- read_entry_strings (file_open (entry), entry);
- }
- ! error ("fatal error: relocation out of range (%d) for %s in %s",
- ! relocation, retsymname(p, entry, oldreloc+word), entry->filename);
- make_executable = 0;
- }
- word &= ~mask;
- ***************
- *** 4763,4769 ****
- {
- unsigned char byte = b & 0xFF;
-
- ! /*fprintf(stderr, " %X\n", byte);*/
- if (rbuf_size >= RBUF_SIZE)
- flush_atari_rbuf();
- rbuf[rbuf_size++] = byte;
- --- 4774,4780 ----
- {
- unsigned char byte = b & 0xFF;
-
- ! /*fprintf(stderr, " %X", byte);*/
- if (rbuf_size >= RBUF_SIZE)
- flush_atari_rbuf();
- rbuf[rbuf_size++] = byte;
- ***************
- *** 5020,5025 ****
- --- 5031,5039 ----
- else if (*str && gst_symboltable) /* if more to write */
- {
- sym.a_type |= A_LNAM;
- + #ifdef BYTE_SWAP
- + sym.a_type = SWAP2(sym.a_type);
- + #endif
- i = sizeof sym;
- gst_symbols++;
- }
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/cross-util/nm.c,v
- retrieving revision 1.12
- diff -c -r1.12 nm.c
- *** 1.12 1993/05/21 15:23:12
- --- nm.c 1994/01/29 00:20:24
- ***************
- *** 100,106 ****
- --- 100,119 ----
- You are forbidden to forbid anyone else to use, share and improve
- what you give them. Help stamp out software-hoarding! */
-
- + #ifdef BYTE_SWAP
-
- + #define SWAP4(y) (((unsigned)(y)>>24) + (((unsigned)(y)>>8)&0xff00) + \
- + (((unsigned)(y)<<8)&0xff0000) + ((unsigned)(y)<<24))
- + #define SWAP2(y) ((((unsigned)(y)&0xff00)>>8) + (((unsigned)(y)&0x00ff)<<8))
- + #endif /* BYTE_SWAP */
- + #ifdef CROSSATARI
- + # ifdef atarist
- + # undef atarist
- + # endif
- + # ifdef atariminix
- + # undef atariminix
- + # endif
- + #endif
- #if (CROSSATARI || atarist || atariminix)
- #include "gnu-out.h"
- #else
- ***************
- *** 318,323 ****
- --- 331,339 ----
- input_member = 0;
-
- len = read (desc, &magicnum, sizeof magicnum);
- + #ifdef BYTE_SWAP
- + magicnum = SWAP4(magicnum);
- + #endif
- if (len != sizeof magicnum)
- error_with_file ("failure reading header of ");
- else if (!N_BADMAG (*((struct exec *)&magicnum)))
- ***************
- *** 330,337 ****
- lseek (desc, 0, 0);
- nchars = read (desc, armag, SARMAG);
-
- ! if (SARMAG != nchars || strncmp (armag, ARMAG, SARMAG))
- error_with_file ("malformed input file (not rel or archive) ");
- else
- scan_library (desc);
- }
- --- 346,355 ----
- lseek (desc, 0, 0);
- nchars = read (desc, armag, SARMAG);
-
- ! if (SARMAG != nchars || strncmp (armag, ARMAG, SARMAG)){
- ! fprintf(stderr,"Magix is %lx, expected %lx\n",magicnum,OMAGIC);
- error_with_file ("malformed input file (not rel or archive) ");
- + }
- else
- scan_library (desc);
- }
- ***************
- *** 517,522 ****
- --- 535,543 ----
- error_with_file ("bad string table in ");
- return;
- }
- + #ifdef BYTE_SWAP
- + string_size = SWAP4(string_size);
- + #endif
-
- /* Number of symbol entries in the file. */
- symcount = header.a_syms / sizeof (struct nlist);
- ***************
- *** 552,559 ****
- struct nlist *end = symbols_and_strings + symcount;
-
- for (; p < end; p++)
- ! if (p->n_un.n_strx)
- p->n_un.n_name = strings + p->n_un.n_strx;
- }
-
- /* Sort the symbols if desired. */
- --- 573,584 ----
- struct nlist *end = symbols_and_strings + symcount;
-
- for (; p < end; p++)
- ! if (p->n_un.n_strx){
- ! #ifdef BYTE_SWAP
- ! p->n_un.n_strx = SWAP4(p->n_un.n_strx);
- ! #endif
- p->n_un.n_name = strings + p->n_un.n_strx;
- + }
- }
-
- /* Sort the symbols if desired. */
- ***************
- *** 583,588 ****
- --- 608,632 ----
- len = read (desc, loc, sizeof (struct exec));
- if (len != sizeof (struct exec))
- error_with_file ("failure reading header of ");
- + #ifdef BYTE_SWAP
- + loc->a_info = SWAP4(loc->a_info); /* always four (4) bytes */
- + if (sizeof(loc->a_text)==4) /* does this need to be ? */
- + { loc->a_text = SWAP4(loc->a_text);
- + loc->a_data = SWAP4(loc->a_data);
- + loc->a_bss = SWAP4(loc->a_bss);
- + loc->a_syms = SWAP4(loc->a_syms);
- + loc->a_entry = SWAP4(loc->a_entry);
- + loc->a_trsize = SWAP4(loc->a_trsize);
- + loc->a_drsize = SWAP4(loc->a_drsize); }
- + else
- + { loc->a_text = SWAP4(loc->a_text);
- + loc->a_data = SWAP4(loc->a_data);
- + loc->a_bss = SWAP4(loc->a_bss);
- + loc->a_syms = SWAP4(loc->a_syms);
- + loc->a_entry = SWAP4(loc->a_entry);
- + loc->a_trsize = SWAP4(loc->a_trsize);
- + loc->a_drsize = SWAP4(loc->a_drsize); }
- + #endif /* BYTE_SWAP */
- }
-
- /* Choose which symbol entries to print;
- ***************
- *** 687,693 ****
- --- 731,741 ----
- }
-
- if (sym->n_type & ~N_EXT || sym->n_value)
- + #ifdef BYTE_SWAP
- + printf ("%08x ", SWAP4(sym->n_value));
- + #else
- printf ("%08x ", sym->n_value);
- + #endif
- else printf (" ");
-
- switch (sym->n_type)
- ***************
- *** 805,811 ****
- --- 853,863 ----
- default:
- s = "";
- }
- + #ifdef BYTE_SWAP
- + printf ("- %02x %04x %5s", sym->n_other, SWAP2(sym->n_desc), s);
- + #else
- printf ("- %02x %04x %5s", sym->n_other, sym->n_desc, s);
- + #endif
- }
- }
-
- ***************
- *** 851,856 ****
- --- 903,911 ----
- error_with_file ("premature eof in ");
- return;
- }
- + #ifdef BYTE_SWAP
- + symdef_size = SWAP4(symdef_size);
- + #endif
-
- if (symdef_size < 0)
- {
- ***************
- *** 873,878 ****
- --- 928,936 ----
- free (symdefs);
- return;
- }
- + #ifdef BYTE_SWAP
- + stringsize = SWAP4(stringsize);
- + #endif
-
- if (stringsize < 0)
- {
- ***************
- *** 904,916 ****
- member_offset = -1;
- for (i = 0; i < nsymdefs; i++)
- {
- ! if (symdefs[i].stringoffset < 0 || symdefs[i].stringoffset >= stringsize)
- {
- error_with_file ("invalid entry in ");
- free (symdefs);
- free (strings);
- return;
- }
- if (member_offset != symdefs[i].offset)
- {
- member_offset = symdefs[i].offset;
- --- 962,980 ----
- member_offset = -1;
- for (i = 0; i < nsymdefs; i++)
- {
- ! #ifdef BYTE_SWAP
- ! symdefs[i].stringoffset = SWAP4(symdefs[i].stringoffset);
- ! #endif
- ! if (symdefs[i].stringoffset < 0 || symdefs[i].stringoffset >= stringsize)
- {
- error_with_file ("invalid entry in ");
- free (symdefs);
- free (strings);
- return;
- }
- + #ifdef BYTE_SWAP
- + symdefs[i].offset = SWAP4(symdefs[i].offset);
- + #endif
- if (member_offset != symdefs[i].offset)
- {
- member_offset = symdefs[i].offset;
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/cross-util/printstk.c,v
- retrieving revision 1.8
- diff -c -r1.8 printstk.c
- *** 1.8 1993/05/21 15:23:14
- --- printstk.c 1993/07/14 21:23:21
- ***************
- *** 35,41 ****
- --- 35,48 ----
- # define SIZEOF_ASYM ((SYMLEN*sizeof(char)) + sizeof(short) + sizeof(long))
- # define SYM_OFFSET (sizeof(short) + (3*sizeof(long)))
- #endif
- + #ifdef BYTE_SWAP
-
- + #define SWAP4(y) (((unsigned)(y)>>24) + (((unsigned)(y)>>8)&0xff00) + \
- + (((unsigned)(y)<<8)&0xff0000) + ((unsigned)(y)<<24))
- + #define SWAP2(y) ((((unsigned)(y)&0xff00)>>8) + (((unsigned)(y)&0x00ff)<<8))
- +
- + #endif /* BYTE_SWAP */
- +
- int error = 0;
-
- static char *sym_names[] = { "__stksize", "__initial_stack" };
- ***************
- *** 64,69 ****
- --- 71,82 ----
- perror(fn);
- return -1;
- }
- + #ifdef BYTE_SWAP
- + head.a_magic = SWAP2(head.a_magic);
- + head.a_syms = SWAP4(head.a_syms);
- + head.a_text = SWAP4(head.a_text);
- + head.a_data = SWAP4(head.a_data);
- + #endif
- if(head.a_magic != CMAGIC)
- {
- fprintf(stderr,"%s: invalid magic number %x\n", fn, head.a_magic);
- ***************
- *** 95,100 ****
- --- 108,117 ----
- fprintf(stderr, "%s: symbol _stksize not found\n", fn);
- return -1;
- }
- + #ifdef BYTE_SWAP
- + sym.a_type = SWAP2(sym.a_type);
- + sym.a_value = SWAP4(sym.a_value);
- + #endif
- if (index && (sym.a_type & A_LNAM) == A_LNAM)
- if (read (fd, extension, sizeof (extension)) != sizeof (extension))
- {
- ***************
- *** 163,168 ****
- --- 180,188 ----
- return 1;
- }
- read(fd, &stksize, sizeof(long));
- + #ifdef BYTE_SWAP
- + stksize = SWAP4(stksize);
- + #endif
- printf("%s: %s is %ld (%dK)\n",
- fn, sym_names[what] + 1, stksize, (int)(stksize/1024));
-
-