diff options
36 files changed, 877 insertions, 360 deletions
diff --git a/bfd/.Sanitize b/bfd/.Sanitize index 7702062..9c81237 100644 --- a/bfd/.Sanitize +++ b/bfd/.Sanitize @@ -71,6 +71,7 @@ cisco-core.c coff-a29k.c coff-alpha.c coff-apollo.c +coff-go32.c coff-h8300.c coff-h8500.c coff-i386.c diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 8cfc521..61f28db 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,33 @@ +Thu May 26 13:56:03 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * nlmcode.h (nlm_swap_auxiliary_headers_in): Cast bfd_byte pointer + to char pointer to avoid compiler warnings. + + * dep-in.sed: Remove spaces before colons. + + Merged changes back in from FSF gas release 2.3: + + * Makefile.in (stmp-bfd.h): Wrap `if' block around grep + invocation, to avoid a bug in BSD 4.4 make. + + From Ralph Campbell: + * mipsbsd.c (mips_fix_jmp_addr): If symbol is undefined, return an + error. + (mips_fix_hi16_s): Ditto. + + Fri May 13 21:21:00 1994 DJ Delorie (dj@ctron.com) + + * makefile.dos: define a default target, or archives won't work + due to multiple matches. + + Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com) + + * configure.bat: update for latest files + * makefile.dos: update for correct targets and sources + * coff-go32.c: [new] go32's COFF format (i386coff with underscores) + * targets.c: add go32coff target + * makefile.in: add coff-go32.c support + Thu May 26 10:10:21 1994 Jeff Law (law@snake.cs.utah.edu) * som.c (som_prep_headers): Do not set the system_id here, private diff --git a/bfd/Makefile.in b/bfd/Makefile.in index a275712..ccdda11 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -124,6 +124,7 @@ BFD32_BACKENDS = \ coff-h8300.o \ coff-h8500.o \ coff-i386.o \ + coff-go32.o \ coff-i960.o \ coff-m68k.o \ coff-m88k.o \ @@ -220,7 +221,7 @@ ALL_CFLAGS=$(CFLAGS) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) # C source files that correspond to .o's. CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c \ - archures.c coff-i386.c aout64.c aout32.c sunos.c demo64.c \ + archures.c coff-i386.c coff-go32.c aout64.c aout32.c sunos.c demo64.c \ coff-i960.c srec.c tekhex.c oasys.c ieee.c aout0.c \ ecoff.c ecofflink.c coff-m68k.c coff-u68k.c coff-apollo.c \ coff-a29k.c coff-rs6000.c coff-sparc.c coffgen.c format.c \ @@ -474,9 +475,17 @@ $(BFD_H): stmp-bfd.h ; @true # The file ../include/bfd.h is from earlier attempts to get this right. # If the file is still there, kill it. +# The weird sh*t with grep is to avoid printing "exit 1 (ignored)" type +# messages from make, and avoid various ways in which different versions +# of make will screw up exit status checks. +# -grep... -> make prints "exit 1" message +# grep ... ; exit 0 -> sun(?) make notices grep failure +# grep ... || exit 0 -> bsd4.4 make still notices +# if grep ... -> seems okay so far stmp-bfd.h : $(srcdir)/bfd-in2.h Makefile rm -f bfd.h-new 64 ../include/bfd.h - grep BFD_HOST_64_BIT sysdep.h > 64 2>/dev/null || exit 0 + if grep BFD_HOST_64_BIT sysdep.h > 64 2>/dev/null; then true; \ + else true; fi sed -e 's/@WORDSIZE@/$(WORDSIZE)/' \ -e "s/@VERSION@/`cat $(srcdir)/VERSION`/" \ -e '/64-bit.*sysdep.h/ r 64' \ @@ -522,6 +531,8 @@ cache.o: cache.c archures.o: archures.c coff-i386.o: coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ libcoff.h coffcode.h coffswap.h +coff-go32.o: coff-go32.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h aout64.o: aout64.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ $(INCDIR)/aout/ar.h diff --git a/bfd/configure.bat b/bfd/configure.bat index 6cb35f0..78fe79e 100644 --- a/bfd/configure.bat +++ b/bfd/configure.bat @@ -1,18 +1,18 @@ -@echo off -if "%1" == "go32" goto h8300 -if "%1" == "h8/300" goto h8300 -echo Specify one of [ go32 h8/300 ] on command line -goto exit - -:go32 -echo Configuring bfd for go32 -copy hosts/h-go32.h sysdep.h -copy Makefile.dos Makefile -goto exit - -:h8300 -echo Configuring bfd for H8/300 -copy hosts\h-go32.h sysdep.h -copy Makefile.dos Makefile - -:exit +@echo off
+if "%1" == "h8/300" goto h8300
+
+echo Configuring bfd for go32
+update hosts\go32.h sysdep.h
+update Makefile.dos Makefile
+echo s/@WORDSIZE@/32/g>config.sed
+sed -e s/^/s\/@VERSION@\// -e s/$/\/g/g version >>config.sed
+sed -f config.sed < bfd-in2.h > bfd.h2
+update bfd.h2 bfd.h
+goto exit
+
+:h8300
+echo Configuring bfd for H8/300
+update hosts\h-go32.h sysdep.h
+update Makefile.dos Makefile
+
+:exit
diff --git a/bfd/makefile.dos b/bfd/makefile.dos new file mode 100644 index 0000000..c062b5f --- /dev/null +++ b/bfd/makefile.dos @@ -0,0 +1,46 @@ +CFLAGS=-O2 + +.c.o : + gcc $(CFLAGS) -I. -I../include -c $< + +all : libbfd.a + +targets.o : targets.c + gcc $(CFLAGS) -I. -I../include -DSELECT_VECS=&go32coff_vec,&i386aout_vec -DDEFAULT_VECTOR=go32coff_vec -c $*.c + +archures.o : archures.c + gcc $(CFLAGS) -I. -I../include -DSELECT_ARCHITECTURES=bfd_i386_arch -c $*.c + +OBJS = \ + libbfd.o \ + opncls.o \ + bfd.o \ + archive.o \ + targets.o \ + cache.o \ + archures.o \ + core.o \ + section.o \ + format.o \ + syms.o \ + reloc.o \ + init.o \ + ctor.o \ + coffgen.o \ + srec.o \ + hash.o \ + linker.o \ + ecoff.o \ + ecofflink.o \ + elf.o \ + aout32.o \ + stab-sym.o \ + i386aout.o \ + cpu-i386.o \ + coff-go32.o \ + $E + +libbfd.a : $(OBJS) + -rm libbfd.a + ar rvs libbfd.a $(OBJS) + ranlib libbfd.a diff --git a/bfd/mipsbsd.c b/bfd/mipsbsd.c index 020e5a2..29a41fb 100644 --- a/bfd/mipsbsd.c +++ b/bfd/mipsbsd.c @@ -178,6 +178,56 @@ MY(write_object_contents) (abfd) #define MIPS_RELOC_LO16 5 /* + * This is only called when performing a BFD_RELOC_MIPS_JMP relocation. + * The jump destination address is formed from the upper 4 bits of the + * "current" program counter concatenated with the jump instruction's + * 26 bit field and two trailing zeros. + * If the destination address is not in the same segment as the "current" + * program counter, then we need to signal an error. + */ +static bfd_reloc_status_type +mips_fix_jmp_addr (abfd,reloc_entry,symbol,data,input_section,output_bfd) + bfd *abfd; + arelent *reloc_entry; + struct symbol_cache_entry *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; +{ + bfd_vma relocation, pc; + + /* If this is a partial relocation, just continue. */ + if (output_bfd != (bfd *)NULL) + return bfd_reloc_continue; + + /* If this is an undefined symbol, return error */ + if (symbol->section == &bfd_und_section + && (symbol->flags & BSF_WEAK) == 0) + return bfd_reloc_undefined; + + /* + * Work out which section the relocation is targetted at and the + * initial relocation command value. + */ + if (bfd_is_com_section (symbol->section)) + relocation = 0; + else + relocation = symbol->value; + + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + relocation += reloc_entry->addend; + + pc = input_section->output_section->vma + input_section->output_offset + + reloc_entry->address + 4; + + if ((relocation & 0xF0000000) != (pc & 0xF0000000)) + return bfd_reloc_overflow; + + return bfd_reloc_continue; +} + +/* * This is only called when performing a BFD_RELOC_HI16_S relocation. * We need to see if bit 15 is set in the result. If it is, we add * 0x10000 and continue normally. This will compensate for the sign extension @@ -204,11 +254,16 @@ mips_fix_hi16_s (abfd, reloc_entry, symbol, data, input_section, if (output_bfd != (bfd *)NULL) return bfd_reloc_continue; + /* If this is an undefined symbol, return error */ + if (symbol->section == &bfd_und_section + && (symbol->flags & BSF_WEAK) == 0) + return bfd_reloc_undefined; + /* * Work out which section the relocation is targetted at and the * initial relocation command value. */ - if (symbol->section == &bfd_com_section) + if (bfd_is_com_section (symbol->section)) relocation = 0; else relocation = symbol->value; @@ -226,7 +281,8 @@ mips_fix_hi16_s (abfd, reloc_entry, symbol, data, input_section, static reloc_howto_type mips_howto_table_ext[] = { {MIPS_RELOC_32, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", false, 0, 0xffffffff, false}, - {MIPS_RELOC_JMP, 2, 2, 26, false, 0, complain_overflow_bitfield, 0, + {MIPS_RELOC_JMP, 2, 2, 26, false, 0, complain_overflow_dont, + mips_fix_jmp_addr, "MIPS_JMP", false, 0, 0x03ffffff, false}, {MIPS_RELOC_WDISP16, 2, 1, 16, true, 0, complain_overflow_signed, 0, "WDISP16", false, 0, 0x0000ffff, false}, diff --git a/bfd/nlmcode.h b/bfd/nlmcode.h index 63b2b5c..4658a13 100644 --- a/bfd/nlmcode.h +++ b/bfd/nlmcode.h @@ -38,8 +38,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define Nlm_External_Copyright_Header NlmNAME(External_Copyright_Header) #define Nlm_External_Extended_Header NlmNAME(External_Extended_Header) #define Nlm_External_Custom_Header NlmNAME(External_Custom_Header) -#define Nlm_External_Cygnus_Section_Header \ - NlmNAME(External_Cygnus_Section_Header) +#define Nlm_External_Cygnus_Ext_Header NlmNAME(External_Cygnus_Ext_Header) #define nlm_symbol_type nlmNAME(symbol_type) #define nlm_get_symtab_upper_bound nlmNAME(get_symtab_upper_bound) @@ -180,7 +179,7 @@ nlm_object_p (abfd) /* Add the sections supplied by all NLM's, and then read in the auxiliary headers. Reading the auxiliary headers may create - additional sections described in the cygnus_sections header. + additional sections described in the cygnus_ext header. From this point on we assume that we have an NLM, and do not treat errors as indicating the wrong format. */ @@ -505,24 +504,6 @@ nlm_swap_auxiliary_headers_in (abfd) nlm_extended_header (abfd)->reserved5 = get_word (abfd, (bfd_byte *) thdr.reserved5); } - else if (strncmp (tempstr, "CuStHeAd", 8) == 0) - { - Nlm_External_Custom_Header thdr; - if (bfd_read ((PTR) &thdr, sizeof (thdr), 1, abfd) != sizeof (thdr)) - return false; - memcpy (nlm_custom_header (abfd)->stamp, thdr.stamp, - sizeof (thdr.stamp)); - nlm_custom_header (abfd)->dataLength = - get_word (abfd, (bfd_byte *) thdr.dataLength); - nlm_custom_header (abfd)->data = - bfd_alloc (abfd, nlm_custom_header (abfd)->dataLength); - if (nlm_custom_header (abfd)->data == NULL) - return false; - if (bfd_read (nlm_custom_header (abfd)->data, 1, - nlm_custom_header (abfd)->dataLength, abfd) - != nlm_custom_header (abfd)->dataLength) - return false; - } else if (strncmp (tempstr, "CoPyRiGhT=", 10) == 0) { if (bfd_read ((PTR) nlm_copyright_header (abfd)->stamp, @@ -541,83 +522,160 @@ nlm_swap_auxiliary_headers_in (abfd) nlm_copyright_header (abfd)->copyrightMessageLength + 1) return (false); } - else if (strncmp (tempstr, "CyGnUsSeCs", 10) == 0) + else if (strncmp (tempstr, "CuStHeAd", 8) == 0) { - Nlm_External_Cygnus_Section_Header thdr; - bfd_size_type len; - file_ptr pos; - bfd_byte *contents; - bfd_byte *p, *pend; - - if (bfd_read ((PTR) &thdr, sizeof (thdr), 1, abfd) != sizeof (thdr)) + Nlm_External_Custom_Header thdr; + bfd_size_type hdrLength; + file_ptr dataOffset; + bfd_size_type dataLength; + char dataStamp[8]; + PTR hdr; + + /* Read the stamp ("CuStHeAd"). */ + if (bfd_read ((PTR) thdr.stamp, 1, sizeof (thdr.stamp), abfd) + != sizeof (thdr.stamp)) return false; - memcpy (nlm_cygnus_section_header (abfd)->stamp, thdr.stamp, - sizeof (thdr.stamp)); - nlm_cygnus_section_header (abfd)->offset = - get_word (abfd, (bfd_byte *) thdr.offset); - len = get_word (abfd, (bfd_byte *) thdr.length); - nlm_cygnus_section_header (abfd)->length = len; - - /* This data this header points to provides a list of the - sections which were in the original object file which was - converted to become an NLM. We locate those sections and - add them to the BFD. Note that this is likely to create - a second .text, .data and .bss section; retrieving the - sections by name will get the actual NLM sections, which - is what we want to happen. The sections from the - original file, which may be subsets of the NLM section, - can only be found using bfd_map_over_sections. */ - - contents = (bfd_byte *) bfd_alloc (abfd, len); - if (contents == (bfd_byte *) NULL) + /* Read the length of this custom header. */ + if (bfd_read ((PTR) thdr.length, 1, sizeof (thdr.length), abfd) + != sizeof (thdr.length)) + return false; + hdrLength = get_word (abfd, (bfd_byte *) thdr.length); + /* Read further fields if we have them. */ + if (hdrLength < NLM_TARGET_LONG_SIZE) + dataOffset = 0; + else { - bfd_set_error (bfd_error_no_memory); - return false; + if (bfd_read ((PTR) thdr.dataOffset, 1, + sizeof (thdr.dataOffset), abfd) + != sizeof (thdr.dataOffset)) + return false; + dataOffset = get_word (abfd, (bfd_byte *) thdr.dataOffset); } - pos = bfd_tell (abfd); - if (bfd_seek (abfd, nlm_cygnus_section_header (abfd)->offset, - SEEK_SET) != 0 - || bfd_read (contents, len, 1, abfd) != len) - return false; - p = contents; - pend = p + len; - while (p < pend) + if (hdrLength < 2 * NLM_TARGET_LONG_SIZE) + dataLength = 0; + else + { + if (bfd_read ((PTR) thdr.dataLength, 1, + sizeof (thdr.dataLength), abfd) + != sizeof (thdr.dataLength)) + return false; + dataLength = get_word (abfd, (bfd_byte *) thdr.dataLength); + } + if (hdrLength < 2 * NLM_TARGET_LONG_SIZE + 8) + memset (dataStamp, 0, sizeof (dataStamp)); + else { - char *name; - size_t l; - file_ptr filepos; - bfd_size_type size; - asection *newsec; + if (bfd_read ((PTR) dataStamp, 1, sizeof (dataStamp), abfd) + != sizeof (dataStamp)) + return false; + } + + /* Read the rest of the header, if any. */ + if (hdrLength <= 2 * NLM_TARGET_LONG_SIZE + 8) + { + hdr = NULL; + hdrLength = 0; + } + else + { + hdrLength -= 2 * NLM_TARGET_LONG_SIZE + 8; + hdr = bfd_alloc (abfd, hdrLength); + if (hdr == NULL) + { + bfd_set_error (bfd_error_no_memory); + return false; + } + if (bfd_read (hdr, 1, hdrLength, abfd) != hdrLength) + return false; + } + + /* If we have found a Cygnus header, process it. Otherwise, + just save the associated data without trying to interpret + it. */ + if (strncmp (dataStamp, "CyGnUsEx", 8) == 0) + { + file_ptr pos; + bfd_byte *contents; + bfd_byte *p, *pend; - /* The format of this information is + BFD_ASSERT (hdrLength == 0 && hdr == NULL); + + pos = bfd_tell (abfd); + if (bfd_seek (abfd, dataOffset, SEEK_SET) != 0) + return false; + contents = (bfd_byte *) bfd_alloc (abfd, dataLength); + if (contents == NULL) + { + bfd_set_error (bfd_error_no_memory); + return false; + } + if (bfd_read (contents, 1, dataLength, abfd) != dataLength) + return false; + if (bfd_seek (abfd, pos, SEEK_SET) != 0) + return false; + + memcpy (nlm_cygnus_ext_header (abfd), "CyGnUsEx", 8); + nlm_cygnus_ext_header (abfd)->offset = dataOffset; + nlm_cygnus_ext_header (abfd)->length = dataLength; + + /* This data this header points to provides a list of + the sections which were in the original object file + which was converted to become an NLM. We locate + those sections and add them to the BFD. Note that + this is likely to create a second .text, .data and + .bss section; retrieving the sections by name will + get the actual NLM sections, which is what we want to + happen. The sections from the original file, which + may be subsets of the NLM section, can only be found + using bfd_map_over_sections. */ + p = contents; + pend = p + dataLength; + while (p < pend) + { + char *name; + size_t l; + file_ptr filepos; + bfd_size_type size; + asection *newsec; + + /* The format of this information is null terminated section name zeroes to adjust to 4 byte boundary 4 byte section data file pointer 4 byte section size - */ - - name = p; - l = strlen (name) + 1; - l = (l + 3) &~ 3; - p += l; - filepos = bfd_h_get_32 (abfd, p); - p += 4; - size = bfd_h_get_32 (abfd, p); - p += 4; - - newsec = bfd_make_section_anyway (abfd, name); - if (newsec == (asection *) NULL) - return false; - newsec->_raw_size = size; - if (filepos != 0) - { - newsec->filepos = filepos; - newsec->flags |= SEC_HAS_CONTENTS; + */ + + name = (char *) p; + l = strlen (name) + 1; + l = (l + 3) &~ 3; + p += l; + filepos = bfd_h_get_32 (abfd, p); + p += 4; + size = bfd_h_get_32 (abfd, p); + p += 4; + + newsec = bfd_make_section_anyway (abfd, name); + if (newsec == (asection *) NULL) + return false; + newsec->_raw_size = size; + if (filepos != 0) + { + newsec->filepos = filepos; + newsec->flags |= SEC_HAS_CONTENTS; + } } } - - if (bfd_seek (abfd, pos, SEEK_SET) != 0) - return false; + else + { + memcpy (nlm_custom_header (abfd)->stamp, thdr.stamp, + sizeof (thdr.stamp)); + nlm_custom_header (abfd)->hdrLength = hdrLength; + nlm_custom_header (abfd)->dataOffset = dataOffset; + nlm_custom_header (abfd)->dataLength = dataLength; + memcpy (nlm_custom_header (abfd)->dataStamp, dataStamp, + sizeof (dataStamp)); + nlm_custom_header (abfd)->hdr = hdr; + } } else { @@ -771,26 +829,6 @@ nlm_swap_auxiliary_headers_out (abfd) return false; } - /* Write out the custom header if there is one. */ - if (find_nonzero ((PTR) nlm_custom_header (abfd), - sizeof (Nlm_Internal_Custom_Header))) - { - Nlm_External_Custom_Header thdr; - - /* Right now we assume the custom header is always the suggested - format for alternate debugging records. */ - BFD_ASSERT (nlm_custom_header (abfd)->dataLength == 8); - - memcpy (thdr.stamp, "CuStHeAd", 8); - put_word (abfd, (bfd_vma) nlm_custom_header (abfd)->dataLength, - (bfd_byte *) thdr.dataLength); - if (bfd_write ((PTR) &thdr, sizeof (thdr), 1, abfd) != sizeof (thdr)) - return false; - if (bfd_write (nlm_custom_header (abfd)->data, 1, - nlm_custom_header (abfd)->dataLength, abfd) - != nlm_custom_header (abfd)->dataLength) - return false; - } /* Write out the copyright header if there is one. */ if (find_nonzero ((PTR) nlm_copyright_header (abfd), @@ -814,17 +852,59 @@ nlm_swap_auxiliary_headers_out (abfd) return false; } + /* Write out the custom header if there is one. */ + if (find_nonzero ((PTR) nlm_custom_header (abfd), + sizeof (Nlm_Internal_Custom_Header))) + { + Nlm_External_Custom_Header thdr; + boolean ds; + bfd_size_type hdrLength; + + ds = find_nonzero ((PTR) nlm_custom_header (abfd)->dataStamp, + sizeof (nlm_custom_header (abfd)->dataStamp)); + memcpy (thdr.stamp, "CuStHeAd", 8); + hdrLength = (2 * NLM_TARGET_LONG_SIZE + (ds ? 8 : 0) + + nlm_custom_header (abfd)->hdrLength); + put_word (abfd, hdrLength, thdr.length); + put_word (abfd, (bfd_vma) nlm_custom_header (abfd)->dataOffset, + thdr.dataOffset); + put_word (abfd, (bfd_vma) nlm_custom_header (abfd)->dataLength, + thdr.dataLength); + if (! ds) + { + BFD_ASSERT (nlm_custom_header (abfd)->hdrLength == 0); + if (bfd_write ((PTR) &thdr, 1, + sizeof (thdr) - sizeof (thdr.dataStamp), abfd) + != sizeof (thdr) - sizeof (thdr.dataStamp)) + return false; + } + else + { + memcpy (thdr.dataStamp, nlm_custom_header (abfd)->dataStamp, + sizeof (thdr.dataStamp)); + if (bfd_write ((PTR) &thdr, sizeof (thdr), 1, abfd) != sizeof (thdr)) + return false; + if (bfd_write (nlm_custom_header (abfd)->hdr, 1, + nlm_custom_header (abfd)->hdrLength, abfd) + != nlm_custom_header (abfd)->hdrLength) + return false; + } + } + /* Write out the Cygnus debugging header if there is one. */ - if (find_nonzero ((PTR) nlm_cygnus_section_header (abfd), - sizeof (Nlm_Internal_Cygnus_Section_Header))) + if (find_nonzero ((PTR) nlm_cygnus_ext_header (abfd), + sizeof (Nlm_Internal_Cygnus_Ext_Header))) { - Nlm_External_Cygnus_Section_Header thdr; + Nlm_External_Custom_Header thdr; - memcpy (thdr.stamp, "CyGnUsSeCs", 10); - put_word (abfd, (bfd_vma) nlm_cygnus_section_header (abfd)->offset, - (bfd_byte *) thdr.offset); - put_word (abfd, (bfd_vma) nlm_cygnus_section_header (abfd)->length, + memcpy (thdr.stamp, "CuStHeAd", 8); + put_word (abfd, (bfd_vma) 2 * NLM_TARGET_LONG_SIZE + 8, (bfd_byte *) thdr.length); + put_word (abfd, (bfd_vma) nlm_cygnus_ext_header (abfd)->offset, + (bfd_byte *) thdr.dataOffset); + put_word (abfd, (bfd_vma) nlm_cygnus_ext_header (abfd)->length, + (bfd_byte *) thdr.dataLength); + memcpy (thdr.dataStamp, "CyGnUsEx", 8); if (bfd_write ((PTR) &thdr, sizeof (thdr), 1, abfd) != sizeof (thdr)) return false; } @@ -1361,17 +1441,17 @@ nlm_compute_section_file_positions (abfd) if (find_nonzero ((PTR) nlm_extended_header (abfd), sizeof (Nlm_Internal_Extended_Header))) sofar += sizeof (Nlm_External_Extended_Header); - if (find_nonzero ((PTR) nlm_custom_header (abfd), - sizeof (Nlm_Internal_Custom_Header))) - sofar += (sizeof (Nlm_External_Custom_Header) - + nlm_custom_header (abfd)->dataLength); if (find_nonzero ((PTR) nlm_copyright_header (abfd), sizeof (Nlm_Internal_Copyright_Header))) sofar += (sizeof (Nlm_External_Copyright_Header) + nlm_copyright_header (abfd)->copyrightMessageLength + 1); - if (find_nonzero ((PTR) nlm_cygnus_section_header (abfd), - sizeof (Nlm_Internal_Cygnus_Section_Header))) - sofar += sizeof (Nlm_External_Cygnus_Section_Header); + if (find_nonzero ((PTR) nlm_custom_header (abfd), + sizeof (Nlm_Internal_Custom_Header))) + sofar += (sizeof (Nlm_External_Custom_Header) + + nlm_custom_header (abfd)->hdrLength); + if (find_nonzero ((PTR) nlm_cygnus_ext_header (abfd), + sizeof (Nlm_Internal_Cygnus_Ext_Header))) + sofar += sizeof (Nlm_External_Custom_Header); /* Compute the section file positions in two passes. First get the sizes of the text and data sections, and then set the file diff --git a/binutils/ChangeLog b/binutils/ChangeLog index c49b820..a17dcc8 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,21 @@ +Thu May 26 18:05:52 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * config/mh-alphaosf (CFLAGS): Don't specify both -g and -O; + they're not compatible under native cc. Use -O1 instead. + + * Makefile.in (VERSION): Updated to cygnus-2.4.1. + + Changes from binutils-2.4 net release: + + * Makefile.in (MANPAGES): Use $(DEMANGLER_PROG). + ($(DEMANGLER_PROG).1): Build from cxxfilt.man, using sed. + * cxxfilt.man: Renamed from c++filt.1, replaced "c++filt" with + magic token to be replaced by sed. + + Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com) + + * configure.bat: update for latest makefile.in + Fri May 13 23:25:13 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * bucomm.c: Check ANSI_PROTOTYPES rather than __STDC__. diff --git a/binutils/Makefile.in b/binutils/Makefile.in index 377c180..56e844d 100644 --- a/binutils/Makefile.in +++ b/binutils/Makefile.in @@ -46,7 +46,7 @@ SHELL = /bin/sh INSTALL = `cd $(srcdir)/..;pwd`/install.sh -c INSTALL_PROGRAM = $(INSTALL) -INSTALL_DATA = $(INSTALL) +INSTALL_DATA = $(INSTALL) INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)' INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1 @@ -70,7 +70,7 @@ LEX_OPTIONS = -I -Cem LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi` # Distribution version -VERSION=cygnus-2.3.1 +VERSION=cygnus-2.4.1 # Distribution name DIST_NAME=binutils-${VERSION} @@ -79,9 +79,8 @@ version=`./../gcc/gcc -dumpversion` # Where to find texinfo.tex to format docn with TeX TEXIDIR = $(srcdir)/../texinfo -MANPAGES= ar nm objdump ranlib size strings strip c++filt objcopy nlmconv - #CC=gcc -Wall +CC=cc # these two are almost the same program AR_PROG=ar RANLIB_PROG=ranlib @@ -98,16 +97,19 @@ NM_PROG=nm.new OBJDUMP_PROG=objdump # This is the demangler, as a standalone program. +# Note: This one is used as the installed name too, unlike the above. DEMANGLER_PROG=c++filt NLMCONV_PROG=nlmconv -SRCONV_PROG=srconv sysdump coffdump +SRCONV_PROG=srconv sysdump coffdump + +MANPAGES= ar nm objdump ranlib size strings strip $(DEMANGLER_PROG) objcopy nlmconv -PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) $(BUILD_NLMCONV) $(BUILD_SRCONV) +PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) $(BUILD_NLMCONV) $(BUILD_SRCONV) $(SYSINFO_PROG) STAGESTUFF = $(PROGS) *.o # Files that can be generated, but should be in the distribution. -DISTSTUFF=arparse.c arlex.c nlmheader.c info +DISTSTUFF=arparse.c arlex.c nlmheader.c sysinfo.c syslex.c info BASEDIR = $(srcdir)/.. BFDDIR = $(BASEDIR)/bfd @@ -265,10 +267,11 @@ sysroff.c: sysinfo sysroff.info ./sysinfo -g <$(srcdir)/sysroff.info >>sysroff.c ./sysinfo -d <$(srcdir)/sysroff.info >sysroff.h -sysinfo.c: sysinfo.y +sysinfo.h sysinfo.c: sysinfo.y $(BISON) -tvd $(srcdir)/sysinfo.y rm -f sysinfo.c -mv y.tab.c sysinfo.c + -mv y.tab.h sysinfo.h syslex.c : syslex.l $(LEX) $(LEX_OPTIONS) $(srcdir)/syslex.l @@ -277,7 +280,7 @@ syslex.c : syslex.l sysinfo: sysinfo.o syslex.o $(ADDL_LIBS) $(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o -syslex.o: syslex.c +syslex.o: syslex.c sysinfo.h $(CC_FOR_BUILD) -c -I. $(CFLAGS) syslex.c sysinfo.o: sysinfo.c @@ -395,6 +398,10 @@ binutils.dvi: $(srcdir)/binutils.texi binutils.info: $(srcdir)/binutils.texi $(MAKEINFO) -o binutils.info $(srcdir)/binutils.texi +$(DEMANGLER_PROG).1: cxxfilt.man Makefile + sed -e 's/@PROGRAM@/$(DEMANGLER_PROG)/' < $(srcdir)/cxxfilt.man \ + > $(DEMANGLER_PROG).1 + # different targets for -ms, -mm, -me # Try to use a recent texi2roff. v2 was put on prep in jan91. # If you want an index, see texi2roff doc for postprocessing @@ -468,7 +475,7 @@ distclean: @if [ -d testsuite ] ; then \ cd testsuite ; $(MAKE) $(FLAGS_TO_PASS) distclean ; \ else true; fi - -rm -f Makefile config.status sysdep.h *.o *~ \#* core \ + -rm -f Makefile config.status sysdep.h *.o *~ \#* core y.* \ binutils.?? binutils.??s binutils.aux binutils.log binutils.toc -rm -f $(PROGS) underscore.c realclean: clean distclean @@ -479,7 +486,7 @@ etags tags: TAGS TAGS: force etags $(INCDIR)/*.h $(srcdir)/*.[hc] -install: all +install: all $(DEMANGLER_PROG).1 for i in $(PROGS) ; do \ $(INSTALL_XFORM) $$i $(bindir)/`echo $$i | sed -e 's/.new//'` ; \ done @@ -506,7 +513,7 @@ install-info: binutils.info else \ dir=$(srcdir) ; \ fi ; \ - for i in $$dir/binutils.info* ; do \ + for i in `cd $$dir; echo binutils.info*` ; do \ $(INSTALL_DATA) $$i $(infodir)/$$i ; \ done diff --git a/gas/ChangeLog b/gas/ChangeLog index 3e26788..ec3abcf 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,67 @@ +Thu May 19 13:45:59 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + Merged in changes from gas-2.3 net release: + + * Makefile.in (VERSION): Updated to cygnus-2.3.1. + + * config/obj-vms.c: Replaced unchecked uses of malloc with + xmalloc. + + * listing.c (list_symbol_table): Only test BFD64, not + BFD_ASSEMBLER too. + + * config/obj-coff.c (fixup_segment) [DIFF_EXPR_OK]: Don't check + pcrel, just convert it. + + * config/obj-vms.c: Removed lots of extra semicolons after + compound statements. + (strchr): Don't declare here. + + * config/ho-vax.h (realloc): Declare. + + * config/ho-vms.h (strchr, strdup): Declare. + + * config/tc-sparc.c (md_parse_option) [OBJ_ELF]: Accept and ignore + option `-q'. + + Wed May 18 20:50:35 1994 Pat Rankin (rankin@eql.caltech.edu) + + * config/obj-vms.h (DBG_S_C_SQUAD, DBG_S_C_UQUAD): define these + new VMS symbol-type macros; signed and unsigned quadword integers, + for `long long' support. Their values come from the existing + DSC$K_DTYPE_QU and DSC$K_DTYPE_Q macros in <descrip.h>. The + VMS debugger now recognizes `long long' variables correctly. + config/obj-vms.c (VMS_typedef_parse) [case 'r']: add entries + for gcc2's predefined types "long double" (same as double, as + per gcc's current state), "long long int", "long long unsigned + int", and final `otherwise' case (to avoid uninitialized type + and size fields). [caveat: predefined types "complex int", + "complex float", "complex double", and "complex long double" are + still missing.] + + * config/ho-vms.h (EXIT_FAILURE): define as 0x10000002 instead + of 0, because the latter indicates success rather than failure + when passed to `exit' or return from `main' compiled by gcc2. + + * config/obj-vms.c (array_suffix, generate_suffix): replace two + hardcoded `0xa3's with macro DBG_S_C_ADVANCED_TYPE from obj-vms.h. + (VMS_typedef_parse): eliminate redundant if-then-else when + allocating new symbol entry and linking it to VMS_Symbol_type_list. + + Tue May 17 20:47:31 1994 Pat Rankin (rankin@eql.caltech.edu) + + * config/obj-vms.c (Write_VMS_MHD_Records): don't try to interpret + the contents of the GAS_VERSION string when falling back to it for + language processor identification. + + * make-gas.com, vmsconf.sh (ENVIRON): fix misspelling of + `psect_attr' in linker options. + + Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com) + + * configure.bat: update to latest makefile.in + * config/te-go32.h: [new] go32's environment + Fri May 20 17:59:34 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * as.h: Don't declare parameters for strstr. diff --git a/gas/Makefile.in b/gas/Makefile.in index ae98eb5..84b0c0b 100644 --- a/gas/Makefile.in +++ b/gas/Makefile.in @@ -50,7 +50,7 @@ infodir = $(prefix)/info includedir = $(prefix)/include docdir = $(datadir)/doc -VERSION=cygnus-2.2.90 +VERSION=cygnus-2.3.1 SHELL = /bin/sh diff --git a/gas/config/ho-vax.h b/gas/config/ho-vax.h index 6da6691..ed8ccc7 100644 --- a/gas/config/ho-vax.h +++ b/gas/config/ho-vax.h @@ -22,6 +22,7 @@ #endif /* not ansi */ extern char *malloc (); +extern char *realloc (); extern int free (); /* end of ho-vax.h */ diff --git a/gas/config/ho-vms.h b/gas/config/ho-vms.h index a546019..04a71dd 100644 --- a/gas/config/ho-vms.h +++ b/gas/config/ho-vms.h @@ -28,10 +28,13 @@ #include <perror.h> #ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 1 -#define EXIT_FAILURE 0 +#define EXIT_SUCCESS 1 /* SS$_NORMAL, STS$K_SUCCESS */ +#define EXIT_FAILURE 0x10000002 /* (STS$K_ERROR | STS$M_INHIB_MSG) */ #endif #define unlink delete +extern char *strchr (); +extern char *strdup (); + /* end of ho-vms.h */ diff --git a/gas/config/obj-vms.c b/gas/config/obj-vms.c index 10b7fd2..2216ac0 100644 --- a/gas/config/obj-vms.c +++ b/gas/config/obj-vms.c @@ -53,8 +53,6 @@ char *compiler_version_string; char vms_name_mapping = 0; - -extern char *strchr (); extern char *myname; static symbolS *Entry_Point_Symbol = 0; /* Pointer to "_main" */ @@ -661,8 +659,8 @@ VMS_Set_Data (Psect_Index, Offset, Record_Type, Force) PUT_CHAR (TIR_S_C_STA_WPB); PUT_SHORT (Psect_Index); PUT_CHAR (Offset); - }; - }; + } + } /* * Set relocation base */ @@ -947,8 +945,8 @@ VMS_TBT_Routine_End (Max_Size, sp) !strcmp (S_GET_NAME (sp), "gcc2_compiled."))) Size = S_GET_VALUE (symbolP); - }; - }; + } + } if (Size == 0x7fffffff) Size = Max_Size; Size -= S_GET_VALUE (sp); /* and get the size of the routine */ @@ -1417,7 +1415,7 @@ find_file (sp) break; if (fpnt->spnt == sp) return fpnt; - }; + } for (fpnt = file_root; fpnt; fpnt = fpnt->next) { if (fpnt == (struct input_file *) NULL) @@ -1428,9 +1426,9 @@ find_file (sp) return fpnt; same_file = fpnt; break; - }; - }; - fpnt = (struct input_file *) malloc (sizeof (struct input_file)); + } + } + fpnt = (struct input_file *) xmalloc (sizeof (struct input_file)); if (file_root == (struct input_file *) NULL) file_root = fpnt; else @@ -1438,7 +1436,7 @@ find_file (sp) struct input_file *fpnt1; for (fpnt1 = file_root; fpnt1->next; fpnt1 = fpnt1->next) ; fpnt1->next = fpnt; - }; + } fpnt->next = (struct input_file *) NULL; fpnt->name = S_GET_NAME (sp); fpnt->min_line = 0x7fffffff; @@ -1522,7 +1520,7 @@ fix_name (pnt) { if (*pnt1 == '.') *pnt1 = '$'; - }; + } return pnt; } @@ -1566,7 +1564,7 @@ find_symbol (dbx_type) if (spnt->dbx_type == dbx_type) break; spnt = spnt->next; - }; + } if (spnt == (struct VMS_DBG_Symbol *) NULL) return 0; /*Dunno what this is*/ if(spnt->advanced == ALIAS) @@ -1595,7 +1593,7 @@ push (value, size) overflow = 1; Lpnt = 1; return; - }; + } Lpnt -= size1; md_number_to_chars (&Local[Lpnt + 1], value, size1); } @@ -1606,10 +1604,10 @@ push (value, size) overflow = 1; Apoint = MAX_DEBUG_RECORD - 1; return; - }; + } md_number_to_chars (&Asuffix[Apoint], value, size1); Apoint += size1; - }; + } } /* this routine generates the array descriptor for a given array */ @@ -1629,7 +1627,7 @@ array_suffix (spnt2) spnt = find_symbol (spnt->type2); if (spnt == (struct VMS_DBG_Symbol *) NULL) return; - }; + } spnt1 = spnt; spnt1 = spnt; total_size = 1; @@ -1638,10 +1636,10 @@ array_suffix (spnt2) rank++; total_size *= (spnt1->index_max - spnt1->index_min + 1); spnt1 = find_symbol (spnt1->type2); - }; + } total_size = total_size * spnt1->data_size; push (spnt1->data_size, 2); - if (spnt1->VMS_type == 0xa3) + if (spnt1->VMS_type == DBG_S_C_ADVANCED_TYPE) push (0, 1); else push (spnt1->VMS_type, 1); @@ -1657,14 +1655,14 @@ array_suffix (spnt2) { push (spnt1->index_max - spnt1->index_min + 1, 4); spnt1 = find_symbol (spnt1->type2); - }; + } spnt1 = spnt; while (spnt1->advanced == ARRAY) { push (spnt1->index_min, 4); push (spnt1->index_max, 4); spnt1 = find_symbol (spnt1->type2); - }; + } } /* this routine generates the start of a variable descriptor based upon @@ -1677,7 +1675,7 @@ new_forward_ref (dbx_type) int dbx_type; { struct forward_ref *fpnt; - fpnt = (struct forward_ref *) malloc (sizeof (struct forward_ref)); + fpnt = (struct forward_ref *) xmalloc (sizeof (struct forward_ref)); fpnt->next = f_ref_root; f_ref_root = fpnt; fpnt->dbx_type = dbx_type; @@ -1718,7 +1716,7 @@ gen1 (spnt, array_suffix_len) total_len = 2; push (total_len, -2); return 1; - }; + } push (0, -4); push (0xfa02, -2); total_len = -2; @@ -1748,7 +1746,7 @@ gen1 (spnt, array_suffix_len) push (DBG_S_C_POINTER, -1); total_len += 3; push (total_len, -2); - }; + } return 1; case ARRAY: spnt1 = spnt; @@ -1762,7 +1760,7 @@ gen1 (spnt, array_suffix_len) spnt->type2); return; } - }; + } /* It is too late to generate forward references, so the user gets a message. * This should only happen on a compiler error */ i = gen1 (spnt1, 1); @@ -1781,10 +1779,10 @@ gen1 (spnt, array_suffix_len) push (0xfa, -1); push (0x0101, -2); push (DBG_S_C_COMPLEX_ARRAY, -1); - }; + } total_len += array_suffix_len + 8; push (total_len, -2); - }; + } } /* This generates a suffix for a variable. If it is not a defined type yet, @@ -1811,10 +1809,10 @@ generate_suffix (spnt, dbx_type) new_forward_ref (dbx_type); else { - if (spnt->VMS_type != 0xa3) + if (spnt->VMS_type != DBG_S_C_ADVANCED_TYPE) return 0; /* no suffix needed */ gen1 (spnt, 0); - }; + } push (0x00af, -2); total_len += 4; push (total_len, -1); @@ -1826,7 +1824,7 @@ generate_suffix (spnt, dbx_type) printf (" Variable descriptor %d too complicated. Defined as *void ", spnt->dbx_type); VMS_Store_Immediate_Data (pvoid, 6, OBJ_S_C_DBG); return; - }; + } i = 0; while (Lpnt < MAX_DEBUG_RECORD - 1) Local[i++] = Local[++Lpnt]; @@ -1837,7 +1835,7 @@ generate_suffix (spnt, dbx_type) VMS_Store_Immediate_Data (Local, Lpnt, OBJ_S_C_DBG); Lpnt = 0; VMS_Store_Struct (struct_number); - }; + } /* we use this for a forward reference to a structure that has yet to be *defined. We store four bytes of zero to make room for the actual address once * it is known @@ -1852,7 +1850,7 @@ generate_suffix (spnt, dbx_type) Local[Lpnt++] = 0; VMS_Store_Immediate_Data (Local, Lpnt, OBJ_S_C_DBG); Lpnt = 0; - }; + } i = 0; while (i < Apoint) Local[Lpnt++] = Asuffix[i++]; @@ -1952,7 +1950,7 @@ VMS_local_stab_Parse (sp) { char * pnt3=(char*) strchr (S_GET_NAME (sp1), ':') + 1; if (*pnt3 == 'F' || *pnt3 == 'f') break; - }; + } if (S_GET_RAW_TYPE (sp1) != N_RSYM) continue; str1 = S_GET_NAME (sp1); /* and get the name */ @@ -1963,15 +1961,15 @@ VMS_local_stab_Parse (sp) break; pnt2++; str1++; - }; + } if ((*str1 != ':') || (*pnt2 != ':')) continue; return; /* they are the same! lets skip this one */ - }; /* for */ + } /* for */ /* first find the dbx symbol type from list, and then find VMS type */ pnt++; /* skip p in case no register */ - }; /* if */ - }; /* p block */ + } /* if */ + } /* p block */ pnt = cvt_integer (pnt, &dbx_type); spnt = find_symbol (dbx_type); if (spnt == (struct VMS_DBG_Symbol *) NULL) @@ -2037,13 +2035,13 @@ VMS_stab_parse (sp, expected_type, type1, type2, Text_Psect) (S_GET_RAW_TYPE (vsp->Symbol) == type2))) break; vsp = vsp->Next; - }; + } if (vsp != (struct VMS_Symbol *) NULL) { VMS_DBG_record (spnt, vsp->Psect_Index, vsp->Psect_Offset, str); *pnt1 = ':'; /* and restore the string */ return 1; - }; + } /* the symbol was not in the symbol list, but it may be an "entry point" if it was a constant */ for (sp1 = symbol_rootP; sp1; sp1 = symbol_next (sp1)) @@ -2068,7 +2066,7 @@ VMS_stab_parse (sp, expected_type, type1, type2, Text_Psect) printf ("definitions of global variables in your source module(s). Don't say\n"); printf ("I didn't warn you!"); gave_compiler_message = 1; - }; + } VMS_DBG_record (spnt, Text_Psect, S_GET_VALUE (sp1), @@ -2078,9 +2076,9 @@ VMS_stab_parse (sp, expected_type, type1, type2, Text_Psect) /* fool assembler to not output this * as a routine in the TBT */ return 1; - }; - }; - }; + } + } + } *pnt1 = ':'; /* and restore the string */ return 0; } @@ -2158,7 +2156,7 @@ VMS_RSYM_Parse (sp, Current_Routine, Text_Psect) { pnt=(char*) strchr (S_GET_NAME (symbolP), ':') + 1; if (*pnt == 'F' || *pnt == 'f') break; - }; + } } /* check to see that the addresses were defined. If not, then there were no * brackets in the function, and we must try to search for the next function @@ -2190,7 +2188,7 @@ VMS_RSYM_Parse (sp, Current_Routine, Text_Psect) * as a marker of the max PC for which this reg is valid */ if (Max_Offset == 0x7fffffff) Max_Offset = Max_Source_Offset; - }; + } dbx_type = 0; str = S_GET_NAME (sp); pnt = (char *) strchr (str, ':'); @@ -2268,8 +2266,8 @@ forward_reference (pnt) if (spnt1 == (struct VMS_DBG_Symbol *) NULL) break; spnt = spnt1; - }; - }; + } + } pnt = cvt_integer (pnt + 1, &i); pnt = cvt_integer (pnt + 1, &i); } while (*++pnt != ';'); @@ -2290,8 +2288,8 @@ final_forward_reference (spnt) (spnt1 == (struct VMS_DBG_Symbol*) NULL))return 1; if(spnt1 == (struct VMS_DBG_Symbol*) NULL) break; spnt=spnt1; - }; - }; + } + } return 0; /* no forward refences found */ } @@ -2337,7 +2335,7 @@ VMS_typedef_parse (str) { /* check for static constants */ *str = '\0'; /* for now we ignore them */ return 0; - }; + } while ((*pnt <= '9') && (*pnt >= '0')) pnt--; pnt++; /* and get back to the number */ @@ -2346,20 +2344,11 @@ VMS_typedef_parse (str) /* first we see if this has been defined already, due to a forward reference*/ if (spnt == (struct VMS_DBG_Symbol *) NULL) { - if (VMS_Symbol_type_list == (struct VMS_DBG_Symbol *) NULL) - { - spnt = (struct VMS_DBG_Symbol *) malloc (sizeof (struct VMS_DBG_Symbol)); - spnt->next = (struct VMS_DBG_Symbol *) NULL; - VMS_Symbol_type_list = spnt; - } - else - { - spnt = (struct VMS_DBG_Symbol *) malloc (sizeof (struct VMS_DBG_Symbol)); - spnt->next = VMS_Symbol_type_list; - VMS_Symbol_type_list = spnt; - }; + spnt = (struct VMS_DBG_Symbol *) xmalloc (sizeof (struct VMS_DBG_Symbol)); + spnt->next = VMS_Symbol_type_list; + VMS_Symbol_type_list = spnt; spnt->dbx_type = i1; /* and save the type */ - }; + } /* for structs and unions, do a partial parse, otherwise we sometimes get * circular definitions that are impossible to resolve. We read enough info * so that any reference to this type has enough info to be resolved @@ -2367,7 +2356,7 @@ VMS_typedef_parse (str) pnt = str + 1; /* point to character past equal sign */ if ((*pnt == 'u') || (*pnt == 's')) { - }; + } if ((*pnt <= '9') && (*pnt >= '0')) { if (type_check ("void")) @@ -2375,13 +2364,13 @@ VMS_typedef_parse (str) *str = '\0'; spnt->advanced = VOID; return 0; - }; + } if (type_check ("unknown type")) { /* this is the void symbol */ *str = '\0'; spnt->advanced = UNKNOWN; return 0; - }; + } pnt1 = cvt_integer(pnt,&i1); if(i1 != spnt->dbx_type) { @@ -2393,7 +2382,7 @@ VMS_typedef_parse (str) printf ("gcc-as warning(debugger output):"); printf (" %d is an unknown untyped variable.\n", spnt->dbx_type); return 1; /* do not know what this is */ - }; + } /* now define this module*/ pnt = str + 1; /* point to character past equal sign */ switch (*pnt) @@ -2452,9 +2441,32 @@ VMS_typedef_parse (str) } else if (type_check ("double")) { + /* caveat: this assumes D_float, and is not correct for G_float */ spnt->VMS_type = DBG_S_C_REAL8; spnt->data_size = 8; } + else if (type_check ("long double")) + { + /* same as double, at least for now */ + spnt->VMS_type = DBG_S_C_REAL8; + spnt->data_size = 8; + } + else if (type_check ("long long int")) + { + spnt->VMS_type = DBG_S_C_SQUAD; /* signed quadword */ + spnt->data_size = 8; + } + else if (type_check ("long long unsigned int")) + { + spnt->VMS_type = DBG_S_C_UQUAD; /* unsigned quadword */ + spnt->data_size = 8; + } + else + { + /* something more substantial ought to be done here */ + spnt->VMS_type = 0; + spnt->data_size = 0; + } pnt1 = (char *) strchr (str, ';') + 1; break; case 's': @@ -2482,9 +2494,9 @@ VMS_typedef_parse (str) fpnt->resolved = 'Y'; VMS_Set_Struct (fpnt->struc_numb); VMS_Store_Struct (spnt->struc_numb); - }; + } fpnt = fpnt->next; - }; + } VMS_Set_Struct (spnt->struc_numb); i = 0; Local[i++] = 11 + strlen (pnt); @@ -2505,7 +2517,7 @@ VMS_typedef_parse (str) { pnt += strlen (pnt); *pnt = ':'; - }; /* replace colon for later */ + } /* replace colon for later */ while (*++pnt1 != ';') { pnt = (char *) strchr (pnt1, ':'); @@ -2558,8 +2570,8 @@ VMS_typedef_parse (str) generate_suffix (spnt1, dtype); else if (spnt1->VMS_type == DBG_S_C_ADVANCED_TYPE) generate_suffix (spnt1, 0); - }; - }; + } + } pnt1++; Local[i++] = 0x01; /* length byte */ Local[i++] = DBG_S_C_STRUCT_END; @@ -2580,9 +2592,9 @@ VMS_typedef_parse (str) fpnt->resolved = 'Y'; VMS_Set_Struct (fpnt->struc_numb); VMS_Store_Struct (spnt->struc_numb); - }; + } fpnt = fpnt->next; - }; + } VMS_Set_Struct (spnt->struc_numb); i = 0; Local[i++] = 3 + strlen (symbol_name); @@ -2611,7 +2623,7 @@ VMS_typedef_parse (str) VMS_Store_Immediate_Data (Local, i, OBJ_S_C_DBG); i = 0; pnt = pnt1; /* Skip final semicolon */ - }; + } Local[i++] = 0x01; /* len byte */ Local[i++] = DBG_S_C_ENUM_END; VMS_Store_Immediate_Data (Local, i, OBJ_S_C_DBG); @@ -2654,7 +2666,7 @@ VMS_typedef_parse (str) printf ("gcc-as warning(debugger output):"); printf (" %d is an unknown type of variable.\n", spnt->dbx_type); return 1; /* unable to decipher */ - }; + } /* this removes the evidence of the definition so that the outer levels of parsing do not have to worry about it */ pnt = str; @@ -2731,7 +2743,7 @@ VMS_LSYM_Parse () pnt = str + strlen(str) - 1; } while (*pnt == '?'); tlen += strlen(str); - parse_buffer = (char *) malloc (tlen + 1); + parse_buffer = (char *) xmalloc (tlen + 1); strcpy(parse_buffer, S_GET_NAME (sp)); pnt2 = parse_buffer + strlen(S_GET_NAME (sp)) - 1; *pnt2 = '\0'; @@ -2747,7 +2759,7 @@ VMS_LSYM_Parse () } while (1 == 1); str = parse_buffer; symbol_name = str; - }; + } pnt = (char *) strchr (str, ':'); if (pnt != (char *) NULL) { @@ -2763,9 +2775,9 @@ VMS_LSYM_Parse () strcpy(S_GET_NAME (sp), parse_buffer); free (parse_buffer); parse_buffer = 0; - }; + } *pnt = ':'; /* put back colon so variable def code finds dbx_type*/ - }; + } break; } /*switch*/ } /* if */ @@ -2776,7 +2788,7 @@ VMS_LSYM_Parse () { final_pass = 1; incom1 ++; /* Force one last pass through */ - }; + } } while ((incomplete != 0) && (incomplete != incom1)); /* repeat until all refs resolved if possible */ /* if (pass > 1) printf(" Required %d passes\n",pass);*/ @@ -2784,7 +2796,7 @@ VMS_LSYM_Parse () { printf ("gcc-as warning(debugger output):"); printf ("Unable to resolve %d circular references.\n", incomplete); - }; + } fpnt = f_ref_root; symbol_name = "\0"; while (fpnt != (struct forward_ref *) NULL) @@ -2798,14 +2810,14 @@ VMS_LSYM_Parse () printf ("Forward reference error, dbx type %d\n", fpnt->dbx_type); break; - }; + } fixit[0] = 0; sprintf (&fixit[1], "%d=s4;", fpnt->dbx_type); pnt2 = (char *) strchr (&fixit[1], '='); VMS_typedef_parse (pnt2); - }; + } fpnt = fpnt->next; - }; + } } static @@ -2821,7 +2833,7 @@ Define_Local_Symbols (s1, s2) { char * pnt=(char*) strchr (S_GET_NAME (symbolP1), ':') + 1; if (*pnt == 'F' || *pnt == 'f') break; - }; + } /* * Deal with STAB symbols */ @@ -2868,7 +2880,7 @@ Define_Routine (symbolP, Level) { char * pnt=(char*) strchr (S_GET_NAME (symbolP1), ':') + 1; if (*pnt == 'F' || *pnt == 'f') break; - }; + } /* * Deal with STAB symbols */ @@ -2884,7 +2896,7 @@ Define_Routine (symbolP, Level) { sprintf (str, "$%d", rcount++); VMS_TBT_Block_Begin (symbolP1, Text_Psect, str); - }; + } Offset = S_GET_VALUE (symbolP1); Define_Local_Symbols (sstart, symbolP1); symbolP1 = @@ -3045,6 +3057,9 @@ Write_VMS_MHD_Records () /* * Store language processor name and version * (not a counted string!) + * + * This is normally supplied by the gcc driver for the command line + * which invokes gas. If absent, we fall back to gas's version. */ cp = compiler_version_string; if (cp == 0) @@ -3052,12 +3067,9 @@ Write_VMS_MHD_Records () cp = "GNU AS V"; while (*cp) PUT_CHAR (*cp++); - cp = strchr (GAS_VERSION, '.'); - while (*cp != ' ') - cp--; - cp++; - }; - while (*cp >= 32) + cp = GAS_VERSION; + } + while (*cp >= ' ') PUT_CHAR (*cp++); /* * Flush the record @@ -3216,7 +3228,7 @@ VMS_Case_Hack_Symbol (In, Out) *Out++ = isupper(*In) ? tolower(*In++) : *In++; } break; - }; + } } /* * If we saw a dollar sign, we don't do case hacking @@ -3269,7 +3281,7 @@ VMS_Case_Hack_Symbol (In, Out) tolower(*In++) : *In++; break; - }; + } } } } @@ -3480,7 +3492,7 @@ VMS_Global_Symbol_Spec (Name, Psect_Number, Psect_Offset, Defined) else { PUT_SHORT (GSY_S_M_DEF); - }; + } /* * Psect Number */ @@ -3511,7 +3523,7 @@ VMS_Global_Symbol_Spec (Name, Psect_Number, Psect_Offset, Defined) else { PUT_SHORT (0); - }; + } } /* * Finally, the global symbol name @@ -3601,7 +3613,7 @@ VMS_Psect_Spec (Name, Size, Type, vsp) vsp->Psect_Index = -1; /* to catch errors */ S_GET_RAW_TYPE (vsp->Symbol) = N_UNDF; /* make refs work */ return 1; /* decrement psect counter */ - }; + } if ((Psect_Attributes & GLOBALSYMBOL_BIT) != 0) { @@ -3626,9 +3638,9 @@ VMS_Psect_Spec (Name, Size, Type, vsp) Name); error (Error_Line); break; - }; - }; /* switch */ - }; + } + } /* switch */ + } Psect_Attributes &= 0xffff; /* clear out the globalref/def stuff */ /* @@ -3772,7 +3784,7 @@ VMS_Emit_Globalvalues (text_siz, data_siz, Data_Segment) if (!HAS_PSECT_ATTRIBUTES (Name)) continue; - stripped_name = (char *) malloc (strlen (Name) + 1); + stripped_name = (char *) xmalloc (strlen (Name) + 1); strcpy (stripped_name, Name); Psect_Attributes = 0; VMS_Modify_Psect_Attributes (stripped_name, &Psect_Attributes); @@ -3799,10 +3811,10 @@ VMS_Emit_Globalvalues (text_siz, data_siz, Data_Segment) default: printf (" Invalid globalvalue of %s\n", stripped_name); break; - }; /* switch */ - }; /* if */ + } /* switch */ + } /* if */ free (stripped_name); /* clean up */ - }; /* for */ + } /* for */ } @@ -4546,7 +4558,7 @@ VMS_write_object_file (text_siz, data_siz, bss_siz, text_frag_root, as_warn("g++ wrote an extern reference to %s as a routine.", S_GET_NAME (sp)); as_warn("I will fix it, but I hope that it was not really a routine"); - }; + } break; default: break; @@ -5233,13 +5245,13 @@ VMS_write_object_file (text_siz, data_siz, bss_siz, text_frag_root, Current_File->file_number = 0; File_Number--; continue; - }; - }; + } + } VMS_TBT_Source_Lines (Current_File->file_number, Current_File->min_line, Current_File->max_line - Current_File->min_line + 1); - }; /* for */ - }; /* scope */ + } /* for */ + } /* scope */ Current_File = (struct input_file *) NULL; for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP)) @@ -5294,11 +5306,11 @@ VMS_write_object_file (text_siz, data_siz, bss_siz, text_frag_root, continue; while (*pnt++ == *pnt1++) { - }; + } if (*pnt1 != 'F' && *pnt1 != 'f') continue; if ((*(--pnt) == '\0') && (*(--pnt1) == ':')) break; - }; + } if (symbolP1 != (symbolS *) NULL) VMS_DBG_Define_Routine (symbolP1, Current_Routine, Text_Psect); } /* local symbol block */ diff --git a/gas/config/obj-vms.h b/gas/config/obj-vms.h index 6cad61f..c645059 100644 --- a/gas/config/obj-vms.h +++ b/gas/config/obj-vms.h @@ -421,11 +421,13 @@ extern int vms_resolve_symbol_redef (); #define DBG_S_C_UCHAR 0x02 #define DBG_S_C_USINT 0x03 #define DBG_S_C_ULINT 0x04 +#define DBG_S_C_UQUAD 0x05 #define DBG_S_C_SCHAR 0x06 #define DBG_S_C_SSINT 0x07 #define DBG_S_C_SLINT 0x08 +#define DBG_S_C_SQUAD 0x09 #define DBG_S_C_REAL4 0x0a -#define DBG_S_C_REAL8 0x0b +#define DBG_S_C_REAL8 0x0b /* D_float (G_float is 0x1b) */ #define DBG_S_C_FUNCTION_ADDR 0x17 #define DBG_S_C_ADVANCED_TYPE 0xa3 /* These are the codes that are used to generate the definitions of struct diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index 26e6643..733e3d2 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -2240,7 +2240,6 @@ md_parse_option (argP, cntP, vecP) if (!strcmp (*argP, "bump")) { warn_on_bump = 1; - } else if (**argP == 'A') { @@ -2278,6 +2277,10 @@ md_parse_option (argP, cntP, vecP) { /* use .stab instead of .stab.excl */ } + else if (**argP == 'q') + { + /* quick -- native assembler does fewer checks */ + } #endif else if (strcmp (*argP, "sparc") == 0) { diff --git a/gas/configure.bat b/gas/configure.bat index 5bccdba..784bae7 100644 --- a/gas/configure.bat +++ b/gas/configure.bat @@ -1,28 +1,65 @@ -@echo off -if "%1" == "go32" goto h8300 -if "%1" == "h8/300" goto h8300 -echo Specify one of [ go32 h8/300 ] on command line -goto exit - -:go32 -echo Configuring gas for go32 -copy config\i386.md md -copy config\out-i386.c aux-output.c -copy config\tm-i386gas.h tm.h -copy config\float.h-ieee float.h -copy config\xm-i386.h config.h -copy Makefile.dos Makefile -goto exit - -:h8300 -echo Configuring gas for H8/300 -copy config\ho-go32.h host.h -copy config\tc-h8300.c targ-cpu.c -copy config\tc-h8300.h targ-cpu.h -copy config\te-generic.h targ-env.h -copy config\objcoffbfd.h obj-format.h -copy config\objcoffbfd.c obj-format.c -copy config\atof-ieee.c atof-targ.c -copy Makefile.dos Makefile - -:exit +@echo off
+if "%1" == "h8/300" goto h8300
+
+echo Configuring gas for go32
+update config/ho-go32.h host.h
+update config/tc-i386.c targ-cpu.c
+update config/tc-i386.h targ-cpu.h
+update config/te-go32.h targ-env.h
+update config/obj-coff.h obj-format.h
+update config/obj-coff.c obj-format.c
+update config/atof-ieee.c atof-targ.c
+goto common
+
+:h8300
+echo Configuring gas for H8/300
+copy config\ho-go32.h host.h
+copy config\tc-h8300.c targ-cpu.c
+copy config\tc-h8300.h targ-cpu.h
+copy config\te-generic.h targ-env.h
+copy config\objcoffbfd.h obj-format.h
+copy config\objcoffbfd.c obj-format.c
+copy config\atof-ieee.c atof-targ.c
+
+:common
+
+echo # Makefile generated by "configure.bat"> Makefile
+echo all.dos : as.new>>Makefile
+
+if exist config.sed del config.sed
+
+echo "s/^ \$(srcdir)\/move-if-change/ update/ ">> config.sed
+echo "/\.o[ ]*:/ s/config.status// ">> config.sed
+echo "/^target=/ c\ ">> config.sed
+echo "target=go32 ">> config.sed
+echo "s/CC = cc/CC = gcc/ ">> config.sed
+echo "s/:\$/: \$/g ">> config.sed
+echo "s/^ \ *\.\// go32 / ">> config.sed
+echo "s/`echo \$(srcdir)\///g ">> config.sed
+echo "s/ | sed 's,\^\\\.\/,,'`//g ">> config.sed
+echo "s/^ cd \$(srcdir)[ ]*;// ">> config.sed
+
+echo "/^####/ i\ ">> config.sed
+echo "TDEFINES=-DMANY_SEGMENTS -DI386COFF \ ">> config.sed
+echo "LOCAL_LOADLIBES=../bfd/libbfd.a ">> config.sed
+
+echo "/^all[ ]*:/ a\ ">> config.sed
+echo "dummy: ">> config.sed
+
+echo "s/\/usr[^ ]*errno.h//g ">> config.sed
+
+echo "/^config.h[ ]*:/ d ">> config.sed
+
+sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
+sed -f config2.sed Makefile.in >> Makefile.2
+update Makefile.2 Makefile
+del Makefile.2
+del config.sed
+del config2.sed
+
+echo > config-stamp
+echo #define TARGET_CPU "i386">config.h1
+echo #define TARGET_ALIAS "i386">>config.h1
+echo #define TARGET_CANONICAL "i386">>config.h1
+sed -n "/^VERSION=/p" Makefile.in | sed -e "s/VERSION=/#define GAS_VERSION \"/" -e "s/$/\"/">> config.h1
+update config.h1 config.h
diff --git a/gas/make-gas.com b/gas/make-gas.com index 95b573e..221e479 100644 --- a/gas/make-gas.com +++ b/gas/make-gas.com @@ -116,4 +116,4 @@ strncasecmp.obj,- getruntime.obj,- gnu_cc:[000000]gcclib/lib,sys$share:vaxcrtl/lib ! Tell linker exactly what psect attributes we want -- match VAXCRTL. -psect_addr=ENVIRON,long,pic,ovr,rel,gbl,noshr,noexe,rd,wrt +psect_attr=ENVIRON,long,pic,ovr,rel,gbl,noshr,noexe,rd,wrt diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 3eb2d43..a70113d 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +Fri May 27 12:24:18 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * gas/m68k/disperr.s: Use % for registers. + + * gas/m68k-coff/gas.exp: Expect failure for p2389a.s. + Tue May 17 14:53:08 1994 Bill Cox (bill@rtl.cygnus.com) * lib/gas-defs.exp: Replace error proc calls with perror calls. diff --git a/gas/vmsconf.sh b/gas/vmsconf.sh index e1111eb..eac8d84 100644 --- a/gas/vmsconf.sh +++ b/gas/vmsconf.sh @@ -80,5 +80,5 @@ done cat << 'EOF' gnu_cc:[000000]gcclib/lib,sys$share:vaxcrtl/lib ! Tell linker exactly what psect attributes we want -- match VAXCRTL. -psect_addr=ENVIRON,long,pic,ovr,rel,gbl,noshr,noexe,rd,wrt +psect_attr=ENVIRON,long,pic,ovr,rel,gbl,noshr,noexe,rd,wrt EOF diff --git a/gprof/ChangeLog b/gprof/ChangeLog index 52afc9b..854726e 100644 --- a/gprof/ChangeLog +++ b/gprof/ChangeLog @@ -1,3 +1,15 @@ +Fri May 27 12:24:57 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + From binutils-2.4 release: + + Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com) + + * configure.bat: [new] build makefile from makefile.in (dos) + * hertz.c: allow static HERTZ (msdos needs it) + * gprof.c: allow target to select "r" or "rb" for fopen + * gprof.c: ignore __gnu_compiled symbols + * i386.h: dfine FOPEN_RB to "rb" for dos. + Tue May 17 15:30:22 1994 E. Michael Smith (ems@cygnus.com) * Makefile.in (.m.c:): Added .SUFFIXES : .m diff --git a/gprof/configure.bat b/gprof/configure.bat new file mode 100644 index 0000000..22ef37e --- /dev/null +++ b/gprof/configure.bat @@ -0,0 +1,18 @@ +@echo off
+echo Configuring gprof for go32
+rem This batch file assumes a unix-type "sed" program
+
+echo # Makefile generated by "configure.bat"> Makefile
+
+if exist config.sed del config.sed
+
+echo "/^###$/ i\ ">>config.sed
+echo "MY_MACHINE=i386\ ">>config.sed
+echo "CC=gcc ">>config.sed
+
+echo # >> config.sed
+
+sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
+sed -f config2.sed Makefile.in >> Makefile
+del config.sed
+del config2.sed
diff --git a/gprof/gprof.c b/gprof/gprof.c index 683b758..c8e0995 100644 --- a/gprof/gprof.c +++ b/gprof/gprof.c @@ -31,6 +31,10 @@ static char sccsid[] = "@(#)gprof.c 5.6 (Berkeley) 6/1/90"; #include "gprof.h" +#ifndef FOPEN_RB +#define FOPEN_RB "r" +#endif + bfd *abfd; char *whoami; @@ -391,7 +395,7 @@ openpfile(filename) struct rawhdr raw; FILE *pfile; - if((pfile = fopen(filename, "r")) == NULL) { + if((pfile = fopen(filename, FOPEN_RB)) == NULL) { perror(filename); done(); } @@ -769,7 +773,11 @@ funcsymbol( symp ) * Perhaps it should be made configurable. */ - if (symprefix && symprefix != *symp->name) + if (symprefix && symprefix != *symp->name + /* Gcc may add special symbols to help gdb figure out the file + language. We want to ignore these, since sometimes they + mask the real function. (dj@ctron) */ + || !strncmp (symp->name, "__gnu_compiled", 14)) return FALSE; return TRUE; diff --git a/gprof/hertz.c b/gprof/hertz.c index 1c2927f..0d8d9d3 100644 --- a/gprof/hertz.c +++ b/gprof/hertz.c @@ -29,8 +29,15 @@ static char sccsid[] = "@(#)hertz.c 5.4 (Berkeley) 6/1/90"; */ #define HZ_WRONG 0 +#ifdef __MSDOS__ +#define HERTZ 18 +#endif + hertz() { +#ifdef HERTZ + return HERTZ; +#else struct itimerval tim; tim.it_interval.tv_sec = 0; @@ -42,4 +49,5 @@ hertz() if (tim.it_interval.tv_usec < 2) return(HZ_WRONG); return (1000000 / tim.it_interval.tv_usec); +#endif } diff --git a/gprof/i386.h b/gprof/i386.h index f248f6b..79d7b9e 100644 --- a/gprof/i386.h +++ b/gprof/i386.h @@ -33,3 +33,6 @@ #define OFFSET_OF_CODE 0 #define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT)) +#ifdef __MSDOS__ +#define FOPEN_RB "rb" +#endif diff --git a/ld/ChangeLog b/ld/ChangeLog index 70a81a4..f0ebae5 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,36 @@ +Fri May 27 12:25:33 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * ldver.c (ldversion): Changed version to "cygnus-2.4.1". + + Changes from binutils-2.4 release: + + * genscripts.sh (RELOCATING, CONSTRUCTING): When setting + variables, use whitespace, so scripts don't break. + + * config/alphaosf.mh (HDEFINES, CFLAGS): Deleted. + + * emultempl/generic.em: Find emultempl/stringify.sed in ${srcdir}. + + * cdtest-bar.cc: Renamed from cdtest-func.cc. + * Makefile.in: Noted change. + + * scripttempl/a29k.sc: Don't include /lab3/u3/..../segments.o; I + don't know where that's supposed to come from, or why it's + necessary. + + Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com) + + * configure.bat: update to latest makefile.in + * emulpara/go32.sh: set to coff-go32 not aout + * emultemp/generic.em: strength-reduce the structure of + this shell script, since the only available shell for + DOS can't handle complex syntax. + * emultemp/stringify.sed: for "sed -f" instead of inline. + * makefile.in: depend on stringify.sed as well as genscripts.sh + * scripttemp/go32coff.sc: correct for djgpp 1.11's COFF format + * genscripts.sh: empty variables aren't always considered "set", + so set them to "y" instead. + Fri May 27 01:08:14 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * ldlang.c (entry_symbol): Make static. diff --git a/ld/Makefile.in b/ld/Makefile.in index c3f42c0..e1c8701 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -249,7 +249,7 @@ ldlex.c: ldlex.l # These all start with e so 'make clean' can find them. GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${host_alias} ${target_alias} ${EMUL} "$(NATIVE_LIB_DIRS)" -GEN_DEPENDS = $(srcdir)/genscripts.sh +GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed esun4.c: $(srcdir)/emulparams/sun4.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} diff --git a/ld/config/alphaosf.mh b/ld/config/alphaosf.mh index 96e9e0a..0ab53c5 100644 --- a/ld/config/alphaosf.mh +++ b/ld/config/alphaosf.mh @@ -1,4 +1,2 @@ -HDEFINES=-DHOST_64_BIT="long " -CFLAGS=-non_shared NATIVE_LIB_DIRS=/usr/ccs/lib HOSTING_CRT0=/usr/ccs/lib/crt0.o diff --git a/ld/configure.bat b/ld/configure.bat index 73089fa..4643bdb 100644 --- a/ld/configure.bat +++ b/ld/configure.bat @@ -1,18 +1,72 @@ -@echo off -if "%1" == "go32" goto h8300 -if "%1" == "h8/300" goto h8300 -echo Specify one of [ go32 h8/300 ] on command line -goto exit - -:go32 -echo Configuring ld for go32 -copy ..\bfd\hosts\h-go32.h sysdep.h -copy Makefile.dos Makefile -goto exit - -:h8300 -echo Configuring ld for H8/300 -copy ..\bfd\hosts\h-go32.h sysdep.h -copy Makefile.dos Makefile - -:exit +@echo off
+echo Configuring ld for go32
+echo This makefile will be built for GNUISH make
+rem This batch file assumes a unix-type "sed" program
+
+update ..\bfd\hosts\go32.h sysdep.h
+
+echo # Makefile generated by "configure.bat"> Makefile
+echo LONGARGS = gcc:ar >> Makefile
+echo CC=gcc >> Makefile
+echo host_alias=go32 >> Makefile
+echo target_alias=go32 >> Makefile
+
+update ../bfd/hosts/go32.h sysdep.h
+
+if exist config.sed del config.sed
+
+echo "s/^ \$(srcdir)\/move-if-change/ update/ ">> config.sed
+echo "s/:\([^ ]\)/: \1/g ">> config.sed
+echo "s/^ \ *\.\// go32 / ">> config.sed
+echo "s/`echo \$(srcdir)\///g ">> config.sed
+echo "s/ | sed 's,\^\\\.\/,,'`//g ">> config.sed
+echo "s/^ cd \$(srcdir)[ ]*;// ">> config.sed
+
+echo "/^####$/ i\ ">> config.sed
+echo "CC = gcc\ ">> config.sed
+echo "EMUL=go32\ ">> config.sed
+echo "EMULATION_OFILES=ego32.o ei386aout.o ">> config.sed
+
+echo "/^SHELL *=/ d ">> config.sed
+echo "s/$(SHELL)/sh.exe/g ">> config.sed
+
+echo "s/'"/\\"/g ">> config.sed
+echo "s/"'/\\"/g ">> config.sed
+
+echo "/^ldmain.o: ldmain.c/,/fi/ { ">> config.sed
+echo " s/; *\\$// ">> config.sed
+echo " s/-DSCRIPTDIR[^ ]*/-DSCRIPTDIR=\\".\\"/ ">> config.sed
+echo " s/config.status// ">> config.sed
+echo " /ldmain.o:/ p ">> config.sed
+echo " /(CC)/ p ">> config.sed
+echo " d ">> config.sed
+echo "} ">> config.sed
+
+echo "s/^SHELL.*$/SHELL=sh.exe/ ">> config.sed
+echo "s/genscripts.sh/genscripts.dos/g ">> config.sed
+
+echo "s/^ldemul-list.h/not-ldemul-list.h/ ">> config.sed
+
+sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
+sed -f config2.sed Makefile.in >> Makefile
+del config.sed
+del config2.sed
+
+echo set -a > genscripts.dj
+sed -e "/^[a-zA-Z0-9_]*=/ s/^/export /" -e "s/(. \(.*\))/sh \1/" -e "/\.em/ d" genscripts.sh >> genscripts.dj
+type emultempl\generic.em >> genscripts.dj
+update genscripts.dj genscripts.dos
+
+echo extern ld_emulation_xfer_type ld_go32_emulation; > ldemul-list.h2
+echo extern ld_emulation_xfer_type ld_i386aout_emulation; >> ldemul-list.h2
+echo #define EMULATION_LIST \>>ldemul-list.h2
+echo &ld_go32_emulation,\>>ldemul-list.h2
+echo &ld_i386aout_emulation,\>>ldemul-list.h2
+echo 0>>ldemul-list.h2
+
+update ldemul-list.h2 ldemul-list.h
+
+if exist ldscripts\dostest goto ldscripts
+mkdir ldscripts
+dir > ldscripts\dostest
+:ldscripts
diff --git a/ld/emulparams/go32.sh b/ld/emulparams/go32.sh index abeb84e..97271a0 100644 --- a/ld/emulparams/go32.sh +++ b/ld/emulparams/go32.sh @@ -1,17 +1,7 @@ -SCRIPT_NAME=aout -OUTPUT_FORMAT="a.out-i386" -TEXT_START_ADDR=0x1020 -PAGE_SIZE=0x1000 -SEGMENT_SIZE=0x400000 -NONPAGED_TEXT_START_ADDR=0x0 -ARCH=i386 - - -SCRIPT_NAME=coff -OUTPUT_FORMAT="i386-coff" +SCRIPT_NAME=go32coff +OUTPUT_FORMAT="coff-go32" TEXT_START_ADDR=0x10a8 PAGE_SIZE=0x1000 SEGMENT_SIZE=0x1000 NONPAGED_TEXT_START_ADDR=0x0 ARCH=i386 - diff --git a/ld/emultempl/.Sanitize b/ld/emultempl/.Sanitize index c0f5649..8cf22c1 100644 --- a/ld/emultempl/.Sanitize +++ b/ld/emultempl/.Sanitize @@ -25,6 +25,7 @@ Do-first: Things-to-keep: README +stringify.sed elf32.em generic.em gld960.em diff --git a/ld/emultempl/stringify.sed b/ld/emultempl/stringify.sed new file mode 100644 index 0000000..a526d3f --- /dev/null +++ b/ld/emultempl/stringify.sed @@ -0,0 +1,4 @@ +s/["\\]/\\&/g +s/$/\\n\\/ +1 s/^/"/ +$ s/$/n"/ @@ -29,7 +29,7 @@ void ldversion (noisy) int noisy; { - fprintf(stdout,"ld version 2.4.1 (with BFD %s)\n", BFD_VERSION); + fprintf(stdout,"ld version cygnus-2.4.1 (with BFD %s)\n", BFD_VERSION); if (noisy) { diff --git a/ld/scripttempl/go32coff.sc b/ld/scripttempl/go32coff.sc index 2e2a52c..2b2556a 100644 --- a/ld/scripttempl/go32coff.sc +++ b/ld/scripttempl/go32coff.sc @@ -1,11 +1,7 @@ -# Linker script for 386 COFF. This works on SVR3.2 and SCO Unix 3.2.2. -# .data2 handles SCO, which uses two data sections. -# Ian Taylor <ian@cygnus.com>. +# Linker script for 386 go32 +# DJ Delorie (dj@ctron.com) + test -z "$ENTRY" && ENTRY=_start -# These are substituted in as variables in order to get '}' in a shell -# conditional expansion. -INIT='.init : { *(.init) }' -FINI='.fini : { *(.fini) }' cat <<EOF OUTPUT_FORMAT("${OUTPUT_FORMAT}") ${LIB_SEARCH_DIRS} @@ -15,14 +11,15 @@ ENTRY(${ENTRY}) SECTIONS { .text ${RELOCATING+ SIZEOF_HEADERS} : { - ${RELOCATING+ *(.init)} *(.text) - ${RELOCATING+ *(.fini)} ${RELOCATING+ etext = .}; } - .data ${RELOCATING+ 0x400000 + (. & 0xffc00fff)} : { - *(.data .data2) + .data ${RELOCATING+ ALIGN(${DATA_ALIGNMENT})} : { + ${RELOCATING+ *(.ctor)} + ${RELOCATING+ *(.dtor)} + *(.data) ${RELOCATING+ edata = .}; + ${RELOCATING+. = ALIGN(${PAGE_SIZE});} } .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : { @@ -30,15 +27,5 @@ SECTIONS *(COMMON) ${RELOCATING+ end = .}; } - ${RELOCATING- ${INIT}} - ${RELOCATING- ${FINI}} - .stab . (NOLOAD) : - { - [ .stab ] - } - .stabstr . (NOLOAD) : - { - [ .stabstr ] - } } EOF diff --git a/ld/testsuite/ld.cdtest/cdtest.exp b/ld/testsuite/ld.cdtest/cdtest.exp index 321cf0f..43acad4 100644 --- a/ld/testsuite/ld.cdtest/cdtest.exp +++ b/ld/testsuite/ld.cdtest/cdtest.exp @@ -63,7 +63,7 @@ foreach test [glob -nocomplain $srcdir/$subdir/*.dat] { # load (execute) the target if ![file exists $tmptarget] then { - unresolved "$tmptarget doesn't exist. $result" + unresolved "$tmptarget doesn't exist." } else { catch "exec $tmptarget > $tmptarget.out" exec_output diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 34eebe1..43d67c1 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,29 @@ +Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com) + + * configure.bat: update to latest makefile.in + +Sat May 7 17:13:21 1994 Steve Chamberlain (sac@cygnus.com) + + * a29k-dis.c (print_insn): Print 'x' type operand in hex. + * h8300-dis.c (bfd_h8_disassemble): Print 16bit rels correctly. + * sh-dis.c (print_insn_sh): Don't recur endlessly if delay + slot insn is in a delay slot. + * z8k-opc.h: (resflg): Fix patterns. + * h8500-opc.h Fix CR insn patterns. + +Fri May 6 14:34:46 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ppc-opc.c (powerpc_opcodes): Put PowerPC versions of "cmp" and + "cmpl" before POWER versions, so that gas -many uses them. + Thu Apr 28 18:32:36 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + * disassemble.c: New file. + * Makefile.in (OFILES): Add disassemble.o. + (disassemble.o): Provide dependencies; compile with $(ARCHDEFS). + * configure.in: Define ARCHDEFS in Makefile. Code taken from + binutils/configure.in. + * m68k-dis.c (print_insn_m68k): If F_ALIAS flag is set, skip the opcode being examined. |