home *** CD-ROM | disk | FTP | other *** search
- *** ../gas-1.35.old/i386.c Mon Mar 5 20:11:07 1990
- --- ./i386.c Mon May 7 17:29:27 1990
- ***************
- *** 1042,1046 ****
- /* I caught it failing with obstack_room == 6,
- so I changed to <= pace */
- ! if (obstack_room (&frags) <= 6) frag_new (0);
- p = frag_more (1);
- p[0] = t->base_opcode;
- --- 1042,1046 ----
- /* I caught it failing with obstack_room == 6,
- so I changed to <= pace */
- ! if (obstack_room (&frags) <= 6) { frag_wane(frag_now); frag_new (0); }
- p = frag_more (1);
- p[0] = t->base_opcode;
- *** ../gas-1.35.old/msomf.h Mon May 7 17:26:26 1990
- --- ./msomf.h Tue May 1 10:01:23 1990
- ***************
- *** 6,10 ****
- --- 6,13 ----
- #define SDEF_CONST 3
- #define SDEF_BSS 4
- + #define SDEF_SYMBOLS 5
- + #define SDEF_TYPES 6
- #define SDEF_SIZE 4
- + #define SDEF_G_SIZE 6
-
- #define GDEF_DGROUP 1
- *** ../gas-1.35.old/write.c Mon May 7 17:28:28 1990
- --- ./write.c Tue May 1 16:45:59 1990
- ***************
- *** 48,51 ****
- --- 48,57 ----
- #endif /* M_XENIX */
-
- + #if __STDC__
- + #include <stddef.h>
- + #else
- + #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
- + #endif
- +
- void append();
-
- ***************
- *** 87,90 ****
- --- 93,99 ----
-
- static long int string_byte_count;
- + #ifdef M_XENIX
- + static long int stab_symbol_count;
- + #endif /* M_XENIX */
-
- static char * the_object_file;
- ***************
- *** 154,157 ****
- --- 163,195 ----
- }
-
- + #ifdef M_XENIX
- + threads(type, trgt_thrd, frm_thrd)
- + int type;
- + int *trgt_thrd, *frm_thrd;
- + {
- + switch (type)
- + {
- + case PRIVDATA: *trgt_thrd = DATA_TGT_THREAD;
- + *frm_thrd = DGROUP_FRAME_THREAD;
- + break;
- + case PRIVBSS: *trgt_thrd = BSS_TGT_THREAD;
- + *frm_thrd = DGROUP_FRAME_THREAD;
- + break;
- + case PRIVTEXT: *trgt_thrd = TEXT_TGT_THREAD;
- + *frm_thrd = TEXT_FRAME_THREAD;
- + break;
- + case PUBLICDATA: *trgt_thrd = DATA_TGT_THREAD;
- + *frm_thrd = DGROUP_FRAME_THREAD;
- + break;
- + case PUBLICTEXT: *trgt_thrd = TEXT_TGT_THREAD;
- + *frm_thrd = TEXT_FRAME_THREAD;
- + break;
- + default: *trgt_thrd = CONST_TGT_THREAD;
- + *frm_thrd = DGROUP_FRAME_THREAD;
- + break;
- + }
- + }
- + #endif /* M_XENIX */
- +
- void
- write_object_file()
- ***************
- *** 377,381 ****
- symbol_number = 0;
- #else /* M_XENIX */
- ! symbol_number = 1;
- #endif /* M_XENIX */
-
- --- 415,419 ----
- symbol_number = 0;
- #else /* M_XENIX */
- ! symbol_number = 1; stab_symbol_count = 0;
- #endif /* M_XENIX */
-
- ***************
- *** 409,418 ****
- else
- symbolP -> sy_number = 0;
- #else /* M_XENIX */
- symbolP -> sy_number = symbol_number ++;
- #endif /* M_XENIX */
- - #ifndef M_XENIX
- #ifndef VMS
- if (name)
- { /* Ordinary case. */
- symbolP -> sy_name_offset = string_byte_count;
- --- 447,461 ----
- else
- symbolP -> sy_number = 0;
- + if (symbolP->sy_nlist.n_type&N_STAB)
- + stab_symbol_count++;
- #else /* M_XENIX */
- symbolP -> sy_number = symbol_number ++;
- #endif /* M_XENIX */
- #ifndef VMS
- + #ifndef M_XENIX
- if (name)
- + #else /* M_XENIX */
- + if (name && symbolP->sy_nlist.n_type&N_STAB)
- + #endif /* M_XENIX */
- { /* Ordinary case. */
- symbolP -> sy_name_offset = string_byte_count;
- ***************
- *** 421,425 ****
- else /* .Stabd case. */
- #endif /* not VMS */
- - #endif /* not M_XENIX */
- symbolP -> sy_name_offset = 0;
- symbolPP = & (symbolP -> sy_next);
- --- 464,467 ----
- ***************
- *** 757,761 ****
- output_file_create (out_file_name);
- omf_initialize_a_out(output_file_desc(), module_name, text_siz, data_siz,
- ! (long) local_bss_counter, 0L);
-
- /* Traverse the symbol chain emitting external symbol definitions
- --- 799,805 ----
- output_file_create (out_file_name);
- omf_initialize_a_out(output_file_desc(), module_name, text_siz, data_siz,
- ! (long) local_bss_counter, 0L,
- ! flagseen['g'], stab_symbol_count * sizeof(struct nlist),
- ! string_byte_count);
-
- /* Traverse the symbol chain emitting external symbol definitions
- ***************
- *** 783,787 ****
- for ( symbolP = symbol_rootP; symbolP; symbolP = symbolP -> sy_next )
- {
- ! if (PUBLIC(symbolP->sy_type))
- {
- unsigned int group = 0, segment = 0;
- --- 827,831 ----
- for ( symbolP = symbol_rootP; symbolP; symbolP = symbolP -> sy_next )
- {
- ! if (PUBLIC(symbolP->sy_type))
- {
- unsigned int group = 0, segment = 0;
- ***************
- *** 867,891 ****
- int external = EXTDEF(symbolP->sy_type);
-
- ! switch (symbolP->sy_type)
- ! {
- ! case PRIVDATA: trgt_thrd = DATA_TGT_THREAD;
- ! frm_thrd = DGROUP_FRAME_THREAD;
- ! break;
- ! case PRIVBSS: trgt_thrd = BSS_TGT_THREAD;
- ! frm_thrd = DGROUP_FRAME_THREAD;
- ! break;
- ! case PRIVTEXT: trgt_thrd = TEXT_TGT_THREAD;
- ! frm_thrd = TEXT_FRAME_THREAD;
- ! break;
- ! case PUBLICDATA: trgt_thrd = DATA_TGT_THREAD;
- ! frm_thrd = DGROUP_FRAME_THREAD;
- ! break;
- ! case PUBLICTEXT: trgt_thrd = TEXT_TGT_THREAD;
- ! frm_thrd = TEXT_FRAME_THREAD;
- ! break;
- ! default: trgt_thrd = CONST_TGT_THREAD;
- ! frm_thrd = DGROUP_FRAME_THREAD;
- ! break;
- ! }
- if (fixP->fx_pcrel)
- frm_thrd = TEXT_FRAME_THREAD;
- --- 911,915 ----
- int external = EXTDEF(symbolP->sy_type);
-
- ! threads(symbolP->sy_type, &trgt_thrd, &frm_thrd);
- if (fixP->fx_pcrel)
- frm_thrd = TEXT_FRAME_THREAD;
- ***************
- *** 959,983 ****
- int external = EXTDEF(symbolP->sy_type);
-
- ! switch (symbolP->sy_type)
- ! {
- ! case PRIVDATA: trgt_thrd = DATA_TGT_THREAD;
- ! frm_thrd = DGROUP_FRAME_THREAD;
- ! break;
- ! case PRIVBSS: trgt_thrd = BSS_TGT_THREAD;
- ! frm_thrd = DGROUP_FRAME_THREAD;
- ! break;
- ! case PRIVTEXT: trgt_thrd = TEXT_TGT_THREAD;
- ! frm_thrd = TEXT_FRAME_THREAD;
- ! break;
- ! case PUBLICDATA: trgt_thrd = DATA_TGT_THREAD;
- ! frm_thrd = DGROUP_FRAME_THREAD;
- ! break;
- ! case PUBLICTEXT: trgt_thrd = TEXT_TGT_THREAD;
- ! frm_thrd = TEXT_FRAME_THREAD;
- ! break;
- ! default: trgt_thrd = CONST_TGT_THREAD;
- ! frm_thrd = DGROUP_FRAME_THREAD;
- ! break;
- ! }
- if (fixP->fx_pcrel)
- frm_thrd = TEXT_FRAME_THREAD;
- --- 983,987 ----
- int external = EXTDEF(symbolP->sy_type);
-
- ! threads(symbolP->sy_type, &trgt_thrd, &frm_thrd);
- if (fixP->fx_pcrel)
- frm_thrd = TEXT_FRAME_THREAD;
- ***************
- *** 1004,1007 ****
- --- 1008,1140 ----
- }
- }
- +
- + /* Traverse the symbol chain emitting stabs.
- + */
- +
- + #define VAL_OFF offsetof(struct nlist, n_value)
- +
- + if (flagseen['g'] && stab_symbol_count)
- + {
- + long count = 0, ncount = 0;
- + symbolS *last_startP;
- + char *temp;
- + symbolS *fsymP;
- + int i;
- + int start_fixup = 0;
- +
- + omf_start_ledata(I386, SDEF_SYMBOLS, 0);
- + last_startP = symbol_rootP;
- + for (symbolP = symbol_rootP; symbolP; symbolP = symbolP -> sy_next)
- + {
- + if (symbolP->sy_nlist.n_type & N_STAB)
- + {
- + if ((ncount + 1) * sizeof(struct nlist) >= 1016)
- + {
- + omf_end_ledata();
- +
- + /* emit relocations */
- +
- + start_fixup = 0;
- + for (i = 0, fsymP=last_startP; i < ncount; fsymP=fsymP->sy_next)
- + {
- + if (fsymP->sy_nlist.n_type & N_STAB)
- + {
- + if (fsymP->sy_type & N_TYPE) /* if relocation required */
- + {
- + int trgt_thrd, frm_thrd;
- + int external = EXTDEF(fsymP->sy_type & N_TYPE);
- +
- + threads(fsymP->sy_type & N_TYPE,&trgt_thrd,&frm_thrd);
- + if (!start_fixup)
- + {
- + omf_start_fixup(I386);
- + start_fixup++;
- + }
- + omf_fixup(I386, 1, /* segment relative */
- + LOC_OFFSET32, i * sizeof(struct nlist) + VAL_OFF,
- + external ? 0 : 1,
- + external ? FRM_TRGT : frm_thrd,
- + external ? 0 : 1,
- + external ? TGT_EI : trgt_thrd,
- + 1, /* No offset */
- + 0, /* No frame required */
- + external ? fsymP->sy_number : 0,
- + 0);
- + }
- + i++;
- + }
- + }
- + if (start_fixup)
- + omf_end_fixup();
- +
- + /* start new segment */
- +
- + ncount = 0; last_startP = symbolP;
- + omf_start_ledata(I386, SDEF_SYMBOLS, count*sizeof(struct nlist));
- + }
- + temp = symbolP->sy_nlist.n_un.n_name;
- + symbolP->sy_nlist.n_un.n_strx = symbolP->sy_name_offset;
- + omf_ledata(&(symbolP->sy_nlist), sizeof(struct nlist));
- + symbolP->sy_nlist.n_un.n_name = temp;
- + ncount++; count++;
- + }
- + }
- + omf_end_ledata();
- + start_fixup = 0;
- + for (i = 0, fsymP = last_startP; i < ncount; fsymP = fsymP->sy_next)
- + {
- + if (fsymP->sy_nlist.n_type & N_STAB)
- + {
- + if (fsymP->sy_type & N_TYPE) /* if relocation required */
- + {
- + int trgt_thrd, frm_thrd;
- + int external = EXTDEF(fsymP->sy_type & N_TYPE);
- +
- + threads(fsymP->sy_type & N_TYPE,&trgt_thrd,&frm_thrd);
- + if (!start_fixup)
- + {
- + omf_start_fixup(I386);
- + start_fixup++;
- + }
- + omf_fixup(I386, 1, /* segment relative */
- + LOC_OFFSET32, i * sizeof(struct nlist) + VAL_OFF,
- + external ? 0 : 1,
- + external ? FRM_TRGT : frm_thrd,
- + external ? 0 : 1,
- + external ? TGT_EI : trgt_thrd,
- + 1, /* No offset */
- + 0, /* No frame required */
- + external ? fsymP->sy_number : 0,
- + 0);
- + }
- + i++;
- + }
- + }
- + if (start_fixup)
- + omf_end_fixup();
- +
- + count = sizeof(string_byte_count); ncount = count;
- + omf_start_ledata(I386, SDEF_TYPES, 0);
- + omf_ledata(&string_byte_count, sizeof(string_byte_count));
- + for (symbolP = symbol_rootP; symbolP; symbolP = symbolP -> sy_next)
- + {
- + if (symbolP->sy_nlist.n_type & N_STAB && symbolP -> sy_name)
- + {
- + int len = strlen(symbolP -> sy_name) + 1;
- +
- + if (ncount + len > 1016)
- + {
- + omf_end_ledata();
- + omf_start_ledata(I386, SDEF_TYPES, count);
- + ncount = 0;
- + }
- + omf_ledata(symbolP->sy_name, len);
- + count += len; ncount += len;
- + }
- + }
- + omf_end_ledata();
- + }
- +
- +
- omf_modend(I386);
- output_file_close (out_file_name);
- *** ../gas-1.35.old/xenixomf.c Mon May 7 17:26:26 1990
- --- ./xenixomf.c Wed May 2 11:03:47 1990
- ***************
- *** 544,548 ****
- --- 544,553 ----
- #define L_UBSS 8
- #define L_BSS 9
- + #define L_TYPES 10
- + #define L_DEBTYP 11
- + #define L_SYMBOLS 12
- + #define L_DEBSYM 13
- #define L_TSIZE 9
- + #define L_G_TSIZE 13
-
- char *lnames_tab[] = {
- ***************
- *** 556,560 ****
- "CONST",
- "_BSS",
- ! "BSS"
- };
-
- --- 561,569 ----
- "CONST",
- "_BSS",
- ! "BSS",
- ! "$$TYPES",
- ! "DEBTYP",
- ! "$$SYMBOLS",
- ! "DEBSYM"
- };
-
- ***************
- *** 573,577 ****
- {SD_DWORD|SD_PUBLIC|SD_PGRES, 0, L_UDATA, L_DATA},
- {SD_DWORD|SD_PUBLIC|SD_PGRES, 0, L_CONST, L_CONST},
- ! {SD_DWORD|SD_PUBLIC|SD_PGRES, 0, L_UBSS, L_BSS}
- };
-
- --- 582,588 ----
- {SD_DWORD|SD_PUBLIC|SD_PGRES, 0, L_UDATA, L_DATA},
- {SD_DWORD|SD_PUBLIC|SD_PGRES, 0, L_CONST, L_CONST},
- ! {SD_DWORD|SD_PUBLIC|SD_PGRES, 0, L_UBSS, L_BSS},
- ! {SD_BYTE|SD_PGRES, 0, L_SYMBOLS, L_DEBSYM},
- ! {SD_BYTE|SD_PGRES, 0, L_TYPES, L_DEBTYP}
- };
-
- ***************
- *** 592,596 ****
- #define NUMFIXEDCOMMENTS 4
-
- ! static unsigned char gas_comment[] = "gas-1.34";
- static unsigned char lib_comment[] = "SLIBCE";
- static unsigned char model_comment[] = "3s";
- --- 603,607 ----
- #define NUMFIXEDCOMMENTS 4
-
- ! static unsigned char gas_comment[] = "gas-1.35c";
- static unsigned char lib_comment[] = "SLIBCE";
- static unsigned char model_comment[] = "3s";
- ***************
- *** 604,611 ****
- };
-
- ! void omf_initialize_a_out(fd, name, text_size, data_size, bss_size, const_size)
- int fd;
- unsigned char *name;
- long text_size, data_size, bss_size, const_size;
- {
- int i;
- --- 615,625 ----
- };
-
- ! void omf_initialize_a_out(fd, name, text_size, data_size, bss_size, const_size,
- ! gdb, syms_size, str_size)
- int fd;
- unsigned char *name;
- long text_size, data_size, bss_size, const_size;
- + int gdb;
- + long syms_size, str_size;
- {
- int i;
- ***************
- *** 622,626 ****
-
- omf_start_lnames();
- ! for (i = 1; i <= L_TSIZE; i++)
- omf_lnames(lnames_tab[i]);
- omf_end_lnames();
- --- 636,640 ----
-
- omf_start_lnames();
- ! for (i = 1; i <= (gdb ? L_G_TSIZE : L_TSIZE); i++)
- omf_lnames(lnames_tab[i]);
- omf_end_lnames();
- ***************
- *** 632,636 ****
- segt[SDEF_BSS].length = bss_size;
- segt[SDEF_CONST].length = const_size;
- ! for (i = 1; i <= SDEF_SIZE; i++)
- omf_segdef(I386, segt[i].attrib, 0, 0L, segt[i].length,
- segt[i].nameindex, segt[i].classindex);
- --- 646,655 ----
- segt[SDEF_BSS].length = bss_size;
- segt[SDEF_CONST].length = const_size;
- ! if (gdb)
- ! {
- ! segt[SDEF_SYMBOLS].length = syms_size;
- ! segt[SDEF_TYPES].length = str_size;
- ! }
- ! for (i = 1; i <= (gdb ? SDEF_G_SIZE : SDEF_SIZE); i++)
- omf_segdef(I386, segt[i].attrib, 0, 0L, segt[i].length,
- segt[i].nameindex, segt[i].classindex);
-