diff -ur binutils-2.9/bfd/ChangeLog binutils-2.9.1/bfd/ChangeLog --- binutils-2.9/bfd/ChangeLog Tue Apr 7 15:48:37 1998 +++ binutils-2.9.1/bfd/ChangeLog Fri May 1 11:47:57 1998 @@ -1,3 +1,36 @@ +Mon Apr 27 11:49:55 1998 Ian Lance Taylor + + * configure.in: Set version number to 2.9.1. + * configure: Rebuild. + + Based on patch from H.J. Lu : + * elf.c (bfd_elf_get_bfd_needed_list): New function. + * bfd-in.h (bfd_elf_get_bfd_needed_list): Declare. + * bfd-in2.h: Rebuild. + +Fri Apr 24 12:09:18 1998 Ian Lance Taylor + + * syms.c (struct indexentry): Change directory_name, file_name, + and function_name fields to char *. + (struct stab_find_info): Change cached_file_name field to char *. + +Thu Apr 16 11:43:33 1998 Ian Lance Taylor + + * archive.c (bfd_generic_archive_p): If a slurp subroutine returns + an error other than bfd_error_system_call, set the error to + bfd_error_wrong_format. + + * targets.c (bfd_target_vector) [SELECT_VECS not defined]: Add + bfd_elf32_powerpcle_vec. + + * elf.c (copy_private_bfd_data): If all the p_paddr fields in the + program segments are zero, don't set p_paddr_valid. + +Fri Apr 10 13:44:27 1998 Ian Lance Taylor + + * coffcode.h (coff_write_object_contents): Move a PE COMDAT symbol + before any other symbols in the same section. + Tue Apr 7 12:35:18 1998 Ian Lance Taylor * archures.c (bfd_default_scan): Add m68k cases back to default diff -ur binutils-2.9/bfd/archive.c binutils-2.9.1/bfd/archive.c --- binutils-2.9/bfd/archive.c Tue Apr 7 15:48:39 1998 +++ binutils-2.9.1/bfd/archive.c Fri May 1 11:48:01 1998 @@ -646,6 +646,8 @@ { bfd_release (abfd, bfd_ardata (abfd)); abfd->tdata.aout_ar_data = tdata_hold; + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); return NULL; } @@ -653,6 +655,8 @@ { bfd_release (abfd, bfd_ardata (abfd)); abfd->tdata.aout_ar_data = tdata_hold; + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); return NULL; } diff -ur binutils-2.9/bfd/bfd-in.h binutils-2.9.1/bfd/bfd-in.h --- binutils-2.9/bfd/bfd-in.h Tue Apr 7 15:48:39 1998 +++ binutils-2.9.1/bfd/bfd-in.h Fri May 1 11:48:01 1998 @@ -607,6 +607,8 @@ PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean)); extern struct bfd_link_needed_list *bfd_elf_get_needed_list PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean bfd_elf_get_bfd_needed_list + PARAMS ((bfd *, struct bfd_link_needed_list **)); extern boolean bfd_elf32_size_dynamic_sections PARAMS ((bfd *, const char *, const char *, boolean, const char *, const char * const *, struct bfd_link_info *, struct sec **, diff -ur binutils-2.9/bfd/bfd-in2.h binutils-2.9.1/bfd/bfd-in2.h --- binutils-2.9/bfd/bfd-in2.h Tue Apr 7 15:48:39 1998 +++ binutils-2.9.1/bfd/bfd-in2.h Fri May 1 11:48:01 1998 @@ -607,6 +607,8 @@ PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean)); extern struct bfd_link_needed_list *bfd_elf_get_needed_list PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean bfd_elf_get_bfd_needed_list + PARAMS ((bfd *, struct bfd_link_needed_list **)); extern boolean bfd_elf32_size_dynamic_sections PARAMS ((bfd *, const char *, const char *, boolean, const char *, const char * const *, struct bfd_link_info *, struct sec **, diff -ur binutils-2.9/bfd/coffcode.h binutils-2.9.1/bfd/coffcode.h --- binutils-2.9/bfd/coffcode.h Tue Apr 7 15:48:42 1998 +++ binutils-2.9.1/bfd/coffcode.h Fri May 1 11:48:05 1998 @@ -2724,12 +2724,21 @@ unsigned int i, count; asymbol **psym; coff_symbol_type *csym = NULL; + asymbol **psymsec; + psymsec = NULL; count = bfd_get_symcount (abfd); for (i = 0, psym = abfd->outsymbols; i < count; i++, psym++) { - /* Here *PSYM is the section symbol for CURRENT. */ + if ((*psym)->section != current) + continue; + /* Remember the location of the first symbol in this + section. */ + if (psymsec == NULL) + psymsec = psym; + + /* See if this is the section symbol. */ if (strcmp ((*psym)->name, current->name) == 0) { csym = coff_symbol_from (abfd, *psym); @@ -2739,6 +2748,9 @@ || csym->native->u.syment.n_sclass != C_STAT || csym->native->u.syment.n_type != T_NULL) continue; + + /* Here *PSYM is the section symbol for CURRENT. */ + break; } } @@ -2774,6 +2786,24 @@ aux->u.auxent.x_scn.x_comdat = IMAGE_COMDAT_SELECT_EXACT_MATCH; break; + } + + /* The COMDAT symbol must be the first symbol from this + section in the symbol table. In order to make this + work, we move the COMDAT symbol before the first + symbol we found in the search above. It's OK to + rearrange the symbol table at this point, because + coff_renumber_symbols is going to rearrange it + further and fix up all the aux entries. */ + if (psym != psymsec) + { + asymbol *hold; + asymbol **pcopy; + + hold = *psym; + for (pcopy = psym; pcopy > psymsec; pcopy--) + pcopy[0] = pcopy[-1]; + *psymsec = hold; } } } diff -ur binutils-2.9/bfd/configure binutils-2.9.1/bfd/configure --- binutils-2.9/bfd/configure Tue Apr 7 15:48:42 1998 +++ binutils-2.9.1/bfd/configure Fri May 1 11:48:05 1998 @@ -993,7 +993,7 @@ PACKAGE=bfd -VERSION=2.9 +VERSION=2.9.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } diff -ur binutils-2.9/bfd/configure.in binutils-2.9.1/bfd/configure.in --- binutils-2.9/bfd/configure.in Tue Apr 7 15:48:42 1998 +++ binutils-2.9.1/bfd/configure.in Fri May 1 11:48:05 1998 @@ -7,7 +7,7 @@ AC_CANONICAL_SYSTEM AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.9) +AM_INIT_AUTOMAKE(bfd, 2.9.1) dnl These must be called before AM_PROG_LIBTOOL, because it may want dnl to call AC_CHECK_PROG. diff -ur binutils-2.9/bfd/elf.c binutils-2.9.1/bfd/elf.c --- binutils-2.9/bfd/elf.c Tue Apr 7 15:48:44 1998 +++ binutils-2.9.1/bfd/elf.c Fri May 1 11:48:08 1998 @@ -941,6 +941,91 @@ return elf_dt_name (abfd); return NULL; } + +/* Get the list of DT_NEEDED entries from a BFD. This is a hook for + the ELF linker emulation code. */ + +boolean +bfd_elf_get_bfd_needed_list (abfd, pneeded) + bfd *abfd; + struct bfd_link_needed_list **pneeded; +{ + asection *s; + bfd_byte *dynbuf = NULL; + int elfsec; + unsigned long link; + bfd_byte *extdyn, *extdynend; + size_t extdynsize; + void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); + + *pneeded = NULL; + + if (bfd_get_flavour (abfd) != bfd_target_elf_flavour + || bfd_get_format (abfd) != bfd_object) + return true; + + s = bfd_get_section_by_name (abfd, ".dynamic"); + if (s == NULL || s->_raw_size == 0) + return true; + + dynbuf = (bfd_byte *) bfd_malloc (s->_raw_size); + if (dynbuf == NULL) + goto error_return; + + if (! bfd_get_section_contents (abfd, s, (PTR) dynbuf, (file_ptr) 0, + s->_raw_size)) + goto error_return; + + elfsec = _bfd_elf_section_from_bfd_section (abfd, s); + if (elfsec == -1) + goto error_return; + + link = elf_elfsections (abfd)[elfsec]->sh_link; + + extdynsize = get_elf_backend_data (abfd)->s->sizeof_dyn; + swap_dyn_in = get_elf_backend_data (abfd)->s->swap_dyn_in; + + extdyn = dynbuf; + extdynend = extdyn + s->_raw_size; + for (; extdyn < extdynend; extdyn += extdynsize) + { + Elf_Internal_Dyn dyn; + + (*swap_dyn_in) (abfd, (PTR) extdyn, &dyn); + + if (dyn.d_tag == DT_NULL) + break; + + if (dyn.d_tag == DT_NEEDED) + { + const char *string; + struct bfd_link_needed_list *l; + + string = bfd_elf_string_from_elf_section (abfd, link, + dyn.d_un.d_val); + if (string == NULL) + goto error_return; + + l = (struct bfd_link_needed_list *) bfd_alloc (abfd, sizeof *l); + if (l == NULL) + goto error_return; + + l->by = abfd; + l->name = string; + l->next = *pneeded; + *pneeded = l; + } + } + + free (dynbuf); + + return true; + + error_return: + if (dynbuf != NULL) + free (dynbuf); + return false; +} /* Allocate an ELF string table--force the first byte to be zero. */ @@ -3148,6 +3233,7 @@ Elf_Internal_Ehdr *iehdr; struct elf_segment_map *mfirst; struct elf_segment_map **pm; + struct elf_segment_map *m; Elf_Internal_Phdr *p; unsigned int i, c; @@ -3168,7 +3254,6 @@ { unsigned int csecs; asection *s; - struct elf_segment_map *m; unsigned int isec; csecs = 0; @@ -3236,6 +3321,19 @@ *pm = m; pm = &m->next; + } + + /* The Solaris linker creates program headers in which all the + p_paddr fields are zero. When we try to objcopy or strip such a + file, we get confused. Check for this case, and if we find it + reset the p_paddr_valid fields. */ + for (m = mfirst; m != NULL; m = m->next) + if (m->p_paddr != 0) + break; + if (m == NULL) + { + for (m = mfirst; m != NULL; m = m->next) + m->p_paddr_valid = 0; } elf_tdata (obfd)->segment_map = mfirst; diff -ur binutils-2.9/bfd/syms.c binutils-2.9.1/bfd/syms.c --- binutils-2.9/bfd/syms.c Tue Apr 7 15:48:52 1998 +++ binutils-2.9.1/bfd/syms.c Fri May 1 11:48:15 1998 @@ -728,9 +728,9 @@ bfd_vma val; bfd_byte *stab; bfd_byte *str; - bfd_byte *directory_name; - bfd_byte *file_name; - bfd_byte *function_name; + char *directory_name; + char *file_name; + char *function_name; }; /* Compare two indexentry structures. This is called via qsort. */ @@ -774,7 +774,7 @@ struct indexentry *cached_indexentry; bfd_vma cached_offset; bfd_byte *cached_stab; - bfd_byte *cached_file_name; + char *cached_file_name; #endif /* Saved ptr to malloc'ed filename. */ diff -ur binutils-2.9/bfd/targets.c binutils-2.9.1/bfd/targets.c --- binutils-2.9/bfd/targets.c Tue Apr 7 15:48:52 1998 +++ binutils-2.9.1/bfd/targets.c Fri May 1 11:48:16 1998 @@ -667,6 +667,7 @@ &bfd_elf32_m88k_vec, &bfd_elf32_sparc_vec, &bfd_elf32_powerpc_vec, + &bfd_elf32_powerpcle_vec, &bfd_elf32_v850_vec, #ifdef BFD64 /* No one seems to use this. */ &bfd_elf64_big_generic_vec, diff -ur binutils-2.9/binutils/ChangeLog binutils-2.9.1/binutils/ChangeLog --- binutils-2.9/binutils/ChangeLog Tue Apr 7 15:49:48 1998 +++ binutils-2.9.1/binutils/ChangeLog Fri May 1 11:49:30 1998 @@ -1,3 +1,8 @@ +Mon Apr 27 13:45:26 1998 Ian Lance Taylor + + * configure.in: Set version number to 2.9.1. + * configure: Rebuild. + Tue Apr 7 15:41:15 1998 Ian Lance Taylor * Makefile.am (DISTSTUFF): Add defparse.h, defparse.c, rclex.c, diff -ur binutils-2.9/binutils/binutils.info binutils-2.9.1/binutils/binutils.info --- binutils-2.9/binutils/binutils.info Tue Apr 7 15:57:54 1998 +++ binutils-2.9.1/binutils/binutils.info Fri May 1 11:59:45 1998 @@ -26,32 +26,32 @@  Indirect: binutils.info-1: 979 -binutils.info-2: 50568 +binutils.info-2: 50570  Tag Table: (Indirect) Node: Top979 -Node: ar2059 -Node: ar cmdline4225 -Node: ar scripts11460 -Node: nm17141 -Node: objcopy23689 -Node: objdump34031 -Node: ranlib42318 -Node: size43052 -Node: strings45778 -Node: strip47603 -Node: c++filt50568 -Node: addr2line53129 -Node: nlmconv55526 -Node: windres58131 -Node: Selecting The Target System62603 -Node: Target Selection63620 -Node: Architecture Selection66320 -Node: Linker Emulation Selection67552 -Node: Reporting Bugs68430 -Node: Bug Criteria69181 -Node: Bug Reporting69727 -Node: Index76708 +Node: ar2061 +Node: ar cmdline4227 +Node: ar scripts11462 +Node: nm17143 +Node: objcopy23691 +Node: objdump34033 +Node: ranlib42320 +Node: size43054 +Node: strings45780 +Node: strip47605 +Node: c++filt50570 +Node: addr2line53131 +Node: nlmconv55528 +Node: windres58133 +Node: Selecting The Target System62605 +Node: Target Selection63622 +Node: Architecture Selection66322 +Node: Linker Emulation Selection67554 +Node: Reporting Bugs68432 +Node: Bug Criteria69183 +Node: Bug Reporting69729 +Node: Index76710  End Tag Table diff -ur binutils-2.9/binutils/binutils.info-1 binutils-2.9.1/binutils/binutils.info-1 --- binutils-2.9/binutils/binutils.info-1 Tue Apr 7 15:57:54 1998 +++ binutils-2.9.1/binutils/binutils.info-1 Fri May 1 11:59:45 1998 @@ -30,7 +30,7 @@ ************ This brief manual contains preliminary documentation for the GNU -binary utilities (collectively version 2.9): +binary utilities (collectively version 2.9.1): * Menu: diff -ur binutils-2.9/binutils/config.texi binutils-2.9.1/binutils/config.texi --- binutils-2.9/binutils/config.texi Tue Apr 7 15:57:53 1998 +++ binutils-2.9.1/binutils/config.texi Fri May 1 11:59:43 1998 @@ -1 +1 @@ -@set VERSION 2.9 +@set VERSION 2.9.1 diff -ur binutils-2.9/binutils/configure binutils-2.9.1/binutils/configure --- binutils-2.9/binutils/configure Tue Apr 7 15:49:50 1998 +++ binutils-2.9.1/binutils/configure Fri May 1 11:49:31 1998 @@ -798,7 +798,7 @@ PACKAGE=binutils -VERSION=2.9 +VERSION=2.9.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } diff -ur binutils-2.9/binutils/configure.in binutils-2.9.1/binutils/configure.in --- binutils-2.9/binutils/configure.in Tue Apr 7 15:49:50 1998 +++ binutils-2.9.1/binutils/configure.in Fri May 1 11:49:32 1998 @@ -5,7 +5,7 @@ AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(binutils, 2.9) +AM_INIT_AUTOMAKE(binutils, 2.9.1) AM_PROG_LIBTOOL diff -ur binutils-2.9/configure.in binutils-2.9.1/configure.in --- binutils-2.9/configure.in Tue Apr 7 15:59:15 1998 +++ binutils-2.9.1/configure.in Fri May 1 12:00:42 1998 @@ -246,8 +246,8 @@ # Well, we don't yet, but we will. if false && [ "${host}" = "${target}" ] && [ x${enable_shared} = x ]; then case "${target}" in - alpha-dec-osf*) enable_shared=yes ;; - alpha-*-linux*) enable_shared=yes ;; + alpha*-dec-osf*) enable_shared=yes ;; + alpha*-*-linux*) enable_shared=yes ;; mips-sgi-irix5*) enable_shared=yes ;; *) enable_shared=no ;; esac @@ -274,7 +274,7 @@ powerpc*-*) host_makefile_frag="${host_makefile_frag} config/mh-ppcpic" ;; - alpha-*-linux*) + alpha*-*-linux*) host_makefile_frag="${host_makefile_frag} config/mh-elfalphapic" ;; *) @@ -512,7 +512,7 @@ *-*-vxworks*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; - alpha-dec-osf*) + alpha*-dec-osf*) # ld works, but does not support shared libraries. emacs doesn't # work. newlib is not 64 bit ready. I'm not sure about fileutils. # gas doesn't generate exception information. @@ -521,7 +521,7 @@ alpha*-*-*vms*) noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss" ;; - alpha-*-linux*) + alpha*-*-linux*) # newlib is not 64 bit ready noconfigdirs="$noconfigdirs target-newlib target-libgloss" # linux has rx in libc @@ -900,7 +900,7 @@ powerpc*-*) target_makefile_frag="${target_makefile_frag} config/mt-ppcpic" ;; - alpha-*-linux*) + alpha*-*-linux*) target_makefile_frag="${target_makefile_frag} config/mt-elfalphapic" ;; *) diff -ur binutils-2.9/gas/ChangeLog binutils-2.9.1/gas/ChangeLog --- binutils-2.9/gas/ChangeLog Tue Apr 7 15:47:29 1998 +++ binutils-2.9.1/gas/ChangeLog Fri May 1 11:45:02 1998 @@ -1,3 +1,25 @@ +Mon Apr 27 13:45:04 1998 Ian Lance Taylor + + * configure.in: Set version number to 2.9.1. + * configure: Rebuild. + +Fri Apr 24 12:47:42 1998 Philippe De Muyter + + * read.c (s_set): Cast xmalloc return value to fragS *. + * config/tc-m68k.c (m68k_ip): Function made static to match + previous forward declaration. + (insert_reg, init_regtable, md_convert_frag_1): Likewise. + +Thu Apr 23 19:23:23 1998 Ian Lance Taylor + + * config/tc-ppc.c (ppc_fix_adjustable): Correct test of whether a + reloc is in the TOC csect. + +Tue Apr 21 16:18:12 1998 Ian Lance Taylor + + * doc/Makefile.am (as.dvi): New target. + * doc/Makefile.in: Rebuild. + Thu Apr 2 16:36:47 1998 Ian Lance Taylor * gasp.c (main): Set next field of new include_path structure to diff -ur binutils-2.9/gas/config/tc-m68k.c binutils-2.9.1/gas/config/tc-m68k.c --- binutils-2.9/gas/config/tc-m68k.c Tue Apr 7 15:47:24 1998 +++ binutils-2.9.1/gas/config/tc-m68k.c Fri May 1 11:44:43 1998 @@ -912,7 +912,7 @@ /* Assemble an m68k instruction. */ -void +static void m68k_ip (instring) char *instring; { @@ -3112,7 +3112,7 @@ the frags/bytes it assembles to. */ -void +static void insert_reg (regname, regnum) const char *regname; int regnum; @@ -3308,7 +3308,7 @@ { 0, 0 } }; -void +static void init_regtable () { int i; @@ -4097,7 +4097,7 @@ the bytes inside it modified to conform to the new size There is UGLY MAGIC here. .. */ -void +static void md_convert_frag_1 (fragP) register fragS *fragP; { diff -ur binutils-2.9/gas/config/tc-ppc.c binutils-2.9.1/gas/config/tc-ppc.c --- binutils-2.9/gas/config/tc-ppc.c Tue Apr 7 15:47:25 1998 +++ binutils-2.9.1/gas/config/tc-ppc.c Fri May 1 11:44:45 1998 @@ -4514,9 +4514,9 @@ /* Don't adjust if this is a reloc in the toc section. */ && (S_GET_SEGMENT (fix->fx_addsy) != data_section || ppc_toc_csect == NULL - || fix->fx_frag->fr_address < ppc_toc_frag->fr_address + || val < ppc_toc_frag->fr_address || (ppc_after_toc_frag != NULL - && fix->fx_frag->fr_address >= ppc_after_toc_frag->fr_address))) + && val >= ppc_after_toc_frag->fr_address))) { symbolS *csect; diff -ur binutils-2.9/gas/configure binutils-2.9.1/gas/configure --- binutils-2.9/gas/configure Tue Apr 7 15:47:31 1998 +++ binutils-2.9.1/gas/configure Fri May 1 11:45:07 1998 @@ -800,7 +800,7 @@ PACKAGE=gas -VERSION=2.9 +VERSION=2.9.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } diff -ur binutils-2.9/gas/configure.in binutils-2.9.1/gas/configure.in --- binutils-2.9/gas/configure.in Tue Apr 7 15:47:31 1998 +++ binutils-2.9.1/gas/configure.in Fri May 1 11:45:07 1998 @@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(gas, 2.9) +AM_INIT_AUTOMAKE(gas, 2.9.1) AM_PROG_LIBTOOL diff -ur binutils-2.9/gas/doc/Makefile.am binutils-2.9.1/gas/doc/Makefile.am --- binutils-2.9/gas/doc/Makefile.am Tue Apr 7 15:47:28 1998 +++ binutils-2.9.1/gas/doc/Makefile.am Fri May 1 11:44:55 1998 @@ -34,6 +34,7 @@ c-z8k.texi as.info: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS) +as.dvi: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS) # This one isn't ready for prime time yet. Not even a little bit. diff -ur binutils-2.9/gas/doc/Makefile.in binutils-2.9.1/gas/doc/Makefile.in --- binutils-2.9/gas/doc/Makefile.in Tue Apr 7 15:47:28 1998 +++ binutils-2.9.1/gas/doc/Makefile.in Fri May 1 11:44:56 1998 @@ -343,6 +343,7 @@ || cp $(srcdir)/$(CONFIG).texi ./asconfig.texi as.info: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS) +as.dvi: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -ur binutils-2.9/gas/read.c binutils-2.9.1/gas/read.c --- binutils-2.9/gas/read.c Tue Apr 7 15:47:33 1998 +++ binutils-2.9.1/gas/read.c Fri May 1 11:45:16 1998 @@ -2709,7 +2709,7 @@ if (listing & LISTING_SYMBOLS) { extern struct list_info_struct *listing_tail; - fragS *dummy_frag = xmalloc (sizeof(fragS)); + fragS *dummy_frag = (fragS *) xmalloc (sizeof(fragS)); memset (dummy_frag, 0, sizeof(fragS)); dummy_frag->fr_type = rs_fill; dummy_frag->line = listing_tail; diff -ur binutils-2.9/gprof/ChangeLog binutils-2.9.1/gprof/ChangeLog --- binutils-2.9/gprof/ChangeLog Tue Apr 7 15:50:01 1998 +++ binutils-2.9.1/gprof/ChangeLog Fri May 1 11:49:41 1998 @@ -1,3 +1,8 @@ +Mon Apr 27 13:45:35 1998 Ian Lance Taylor + + * configure.in: Set version number to 2.9.1. + * configure: Rebuild. + Tue Apr 7 12:43:37 1998 Ian Lance Taylor From hjl@lucon.org : diff -ur binutils-2.9/gprof/configure binutils-2.9.1/gprof/configure --- binutils-2.9/gprof/configure Tue Apr 7 15:50:02 1998 +++ binutils-2.9.1/gprof/configure Fri May 1 11:49:42 1998 @@ -794,7 +794,7 @@ PACKAGE=gprof -VERSION=2.9 +VERSION=2.9.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } diff -ur binutils-2.9/gprof/configure.in binutils-2.9.1/gprof/configure.in --- binutils-2.9/gprof/configure.in Tue Apr 7 15:50:02 1998 +++ binutils-2.9.1/gprof/configure.in Fri May 1 11:49:42 1998 @@ -4,7 +4,7 @@ AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(gprof, 2.9) +AM_INIT_AUTOMAKE(gprof, 2.9.1) AM_PROG_LIBTOOL diff -ur binutils-2.9/ld/ChangeLog binutils-2.9.1/ld/ChangeLog --- binutils-2.9/ld/ChangeLog Tue Apr 7 15:49:23 1998 +++ binutils-2.9.1/ld/ChangeLog Fri May 1 11:48:47 1998 @@ -1,3 +1,21 @@ +Mon Apr 27 11:56:21 1998 Ian Lance Taylor + + * configure.in: Set version number to 2.9.1. + * configure: Rebuild. + + Based on patch from H.J. Lu : + * emultempl/elf32.em (global_vercheck_needed): New file static + variable. + (global_vercheck_failed): New file static variable. + (gld${EMULATION_NAME}_after_open): Check for shared libraries + twice, once with force set to 0 and once with it set to 1. + (gld${EMULATION_NAME}_check_ld_so_conf): Add force parameter. + Change all callers. + (gld${EMULATION_NAME}_search_needed): Likewise. + (gld${EMULATION_NAME}_try_needed): Likewise. If not force, check + whether the libraries needs any incompatible versions. + (gld${EMULATION_NAME}_vercheck): New static function. + Tue Apr 7 13:35:29 1998 H.J. Lu * configure.in (TESTBFDLIB): New. Defined and substituted. diff -ur binutils-2.9/ld/configure binutils-2.9.1/ld/configure --- binutils-2.9/ld/configure Tue Apr 7 15:49:24 1998 +++ binutils-2.9.1/ld/configure Fri May 1 11:48:48 1998 @@ -798,7 +798,7 @@ PACKAGE=ld -VERSION=2.9 +VERSION=2.9.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } diff -ur binutils-2.9/ld/configure.in binutils-2.9.1/ld/configure.in --- binutils-2.9/ld/configure.in Tue Apr 7 15:49:24 1998 +++ binutils-2.9.1/ld/configure.in Fri May 1 11:48:48 1998 @@ -5,7 +5,7 @@ AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(ld, 2.9) +AM_INIT_AUTOMAKE(ld, 2.9.1) AM_PROG_LIBTOOL diff -ur binutils-2.9/ld/emultempl/elf32.em binutils-2.9.1/ld/emultempl/elf32.em --- binutils-2.9/ld/emultempl/elf32.em Tue Apr 7 15:49:31 1998 +++ binutils-2.9.1/ld/emultempl/elf32.em Fri May 1 11:48:55 1998 @@ -54,8 +54,10 @@ static void gld${EMULATION_NAME}_stat_needed PARAMS ((lang_input_statement_type *)); static boolean gld${EMULATION_NAME}_search_needed - PARAMS ((const char *, const char *)); -static boolean gld${EMULATION_NAME}_try_needed PARAMS ((const char *)); + PARAMS ((const char *, const char *, int)); +static boolean gld${EMULATION_NAME}_try_needed PARAMS ((const char *, int)); +static void gld${EMULATION_NAME}_vercheck + PARAMS ((lang_input_statement_type *)); static void gld${EMULATION_NAME}_before_allocation PARAMS ((void)); static void gld${EMULATION_NAME}_find_statement_assignment PARAMS ((lang_statement_union_type *)); @@ -143,11 +145,13 @@ in which we may find shared libraries. /etc/ld.so.conf is really only meaningful on Linux, but we check it on other systems anyhow. */ -static boolean gld${EMULATION_NAME}_check_ld_so_conf PARAMS ((const char *)); +static boolean gld${EMULATION_NAME}_check_ld_so_conf + PARAMS ((const char *, int)); static boolean -gld${EMULATION_NAME}_check_ld_so_conf (name) +gld${EMULATION_NAME}_check_ld_so_conf (name, force) const char *name; + int force; { static boolean initialized; static char *ld_so_conf; @@ -215,7 +219,7 @@ if (ld_so_conf == NULL) return false; - return gld${EMULATION_NAME}_search_needed (ld_so_conf, name); + return gld${EMULATION_NAME}_search_needed (ld_so_conf, name, force); } EOF @@ -224,11 +228,13 @@ cat >>e${EMULATION_NAME}.c <next) { struct bfd_link_needed_list *ll; - const char *lib_path; - size_t len; - search_dirs_type *search; + int force; /* If we've already seen this file, skip it. */ for (ll = needed; ll != l; ll = ll->next) @@ -277,55 +281,71 @@ linker will search. That means that we want to use rpath_link, rpath, then the environment variable LD_LIBRARY_PATH (native only), then the linker script - LIB_SEARCH_DIRS. We do not search using the -L arguments. */ - if (gld${EMULATION_NAME}_search_needed (command_line.rpath_link, - l->name)) - continue; - if (gld${EMULATION_NAME}_search_needed (command_line.rpath, l->name)) - continue; - if (command_line.rpath_link == NULL - && command_line.rpath == NULL) + LIB_SEARCH_DIRS. We do not search using the -L arguments. + + We search twice. The first time, we skip objects which may + introduce version mismatches. The second time, we force + their use. See gld${EMULATION_NAME}_vercheck comment. */ + for (force = 0; force < 2; force++) { - lib_path = (const char *) getenv ("LD_RUN_PATH"); - if (gld${EMULATION_NAME}_search_needed (lib_path, l->name)) - continue; - } + const char *lib_path; + size_t len; + search_dirs_type *search; + + if (gld${EMULATION_NAME}_search_needed (command_line.rpath_link, + l->name, force)) + break; + if (gld${EMULATION_NAME}_search_needed (command_line.rpath, + l->name, force)) + break; + if (command_line.rpath_link == NULL + && command_line.rpath == NULL) + { + lib_path = (const char *) getenv ("LD_RUN_PATH"); + if (gld${EMULATION_NAME}_search_needed (lib_path, l->name, + force)) + break; + } EOF if [ "x${host}" = "x${target}" ] ; then if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then cat >>e${EMULATION_NAME}.c <name)) - continue; + lib_path = (const char *) getenv ("LD_LIBRARY_PATH"); + if (gld${EMULATION_NAME}_search_needed (lib_path, l->name, force)) + break; EOF fi fi cat >>e${EMULATION_NAME}.c <name); - for (search = search_head; search != NULL; search = search->next) - { - char *filename; + len = strlen (l->name); + for (search = search_head; search != NULL; search = search->next) + { + char *filename; - if (search->cmdline) - continue; - filename = (char *) xmalloc (strlen (search->name) + len + 2); - sprintf (filename, "%s/%s", search->name, l->name); - if (gld${EMULATION_NAME}_try_needed (filename)) + if (search->cmdline) + continue; + filename = (char *) xmalloc (strlen (search->name) + len + 2); + sprintf (filename, "%s/%s", search->name, l->name); + if (gld${EMULATION_NAME}_try_needed (filename, force)) + break; + free (filename); + } + if (search != NULL) break; - free (filename); - } - if (search != NULL) - continue; EOF if [ "x${host}" = "x${target}" ] ; then if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then cat >>e${EMULATION_NAME}.c <name)) - continue; + if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force)) + break; EOF fi fi cat >>e${EMULATION_NAME}.c <name, l->by); @@ -335,9 +355,10 @@ /* Search for a needed file in a path. */ static boolean -gld${EMULATION_NAME}_search_needed (path, name) +gld${EMULATION_NAME}_search_needed (path, name, force) const char *path; const char *name; + int force; { const char *s; size_t len; @@ -364,7 +385,7 @@ } strcpy (sset, name); - if (gld${EMULATION_NAME}_try_needed (filename)) + if (gld${EMULATION_NAME}_try_needed (filename, force)) return true; free (filename); @@ -378,11 +399,13 @@ } /* This function is called for each possible name for a dynamic object - named by a DT_NEEDED entry. */ + named by a DT_NEEDED entry. The FORCE parameter indicates whether + to skip the check for a conflicting version. */ static boolean -gld${EMULATION_NAME}_try_needed (name) +gld${EMULATION_NAME}_try_needed (name, force) const char *name; + int force; { bfd *abfd; @@ -400,6 +423,62 @@ return false; } + /* Check whether this object would include any conflicting library + versions. If FORCE is set, then we skip this check; we use this + the second time around, if we couldn't find any compatible + instance of the shared library. */ + + if (! force) + { + struct bfd_link_needed_list *needed; + + if (! bfd_elf_get_bfd_needed_list (abfd, &needed)) + einfo ("%F%P:%B: bfd_elf_get_bfd_needed_list failed: %E\n", abfd); + + if (needed != NULL) + { + global_vercheck_needed = needed; + global_vercheck_failed = false; + lang_for_each_input_file (gld${EMULATION_NAME}_vercheck); + if (global_vercheck_failed) + { + (void) bfd_close (abfd); + /* Return false to force the caller to move on to try + another file on the search path. */ + return false; + } + + /* But wait! It gets much worse. On Linux, if a shared + library does not use libc at all, we are supposed to skip + it the first time around in case we encounter a shared + library later on with the same name which does use the + version of libc that we want. This is much too horrible + to use on any system other than Linux. */ + +EOF +case ${target} in + *-*-linux-gnu*) + cat >>e${EMULATION_NAME}.c <next) + if (strncmp (l->name, "libc.so", 7) == 0) + break; + if (l == NULL) + { + (void) bfd_close (abfd); + return false; + } + } + +EOF + ;; +esac +cat >>e${EMULATION_NAME}.c <name, suffix - global_needed->name) == 0) einfo ("%P: warning: %s, needed by %B, may conflict with %s\n", global_needed->name, global_needed->by, f); +} + +/* On Linux, it's possible to have different versions of the same + shared library linked against different versions of libc. The + dynamic linker somehow tags which libc version to use in + /etc/ld.so.cache, and, based on the libc that it sees in the + executable, chooses which version of the shared library to use. + + We try to do a similar check here by checking whether this shared + library needs any other shared libraries which may conflict with + libraries we have already included in the link. If it does, we + skip it, and try to find another shared library farther on down the + link path. + + This is called via lang_for_each_input_file. + GLOBAL_VERCHECK_NEEDED is the list of objects needed by the object + which we ar checking. This sets GLOBAL_VERCHECK_FAILED if we find + a conflicting version. */ + +static void +gld${EMULATION_NAME}_vercheck (s) + lang_input_statement_type *s; +{ + const char *soname, *f; + struct bfd_link_needed_list *l; + + if (global_vercheck_failed) + return; + if (s->the_bfd == NULL + || (bfd_get_file_flags (s->the_bfd) & DYNAMIC) == 0) + return; + + soname = bfd_elf_get_dt_soname (s->the_bfd); + if (soname == NULL) + soname = bfd_get_filename (s->the_bfd); + + f = strrchr (soname, '/'); + if (f != NULL) + ++f; + else + f = soname; + + for (l = global_vercheck_needed; l != NULL; l = l->next) + { + const char *suffix; + + if (strcmp (f, l->name) == 0) + { + /* Probably can't happen, but it's an easy check. */ + continue; + } + + if (strchr (l->name, '/') != NULL) + continue; + + suffix = strstr (l->name, ".so."); + if (suffix == NULL) + continue; + + suffix += sizeof ".so." - 1; + + if (strncmp (f, l->name, suffix - l->name) == 0) + { + /* Here we know that S is a dynamic object FOO.SO.VER1, and + the object we are considering needs a dynamic object + FOO.SO.VER2, and VER1 and VER2 are different. This + appears to be a version mismatch, so we tell the caller + to try a different version of this library. */ + global_vercheck_failed = true; + return; + } + } } /* This is called after the sections have been attached to output diff -ur binutils-2.9/opcodes/ChangeLog binutils-2.9.1/opcodes/ChangeLog --- binutils-2.9/opcodes/ChangeLog Tue Apr 7 15:48:54 1998 +++ binutils-2.9.1/opcodes/ChangeLog Fri May 1 11:48:18 1998 @@ -1,3 +1,11 @@ +Fri Apr 24 16:07:57 1998 Alan Modra + + * i386-dis.c (OP_DSSI): Print segment override. + +Tue Apr 21 16:31:51 1998 Ian Lance Taylor + + * mips-dis.c (print_insn_arg): Restore accidentally lost code. + Sun Apr 5 16:04:39 1998 H.J. Lu * Makefile.am (stamp-lib): Check that .libs/libopcodes.a exists diff -ur binutils-2.9/opcodes/i386-dis.c binutils-2.9.1/opcodes/i386-dis.c --- binutils-2.9/opcodes/i386-dis.c Tue Apr 7 15:48:56 1998 +++ binutils-2.9.1/opcodes/i386-dis.c Fri May 1 11:48:19 1998 @@ -2173,7 +2173,16 @@ int aflag; int dflag; { - oappend ("%ds:("); + if ((prefixes + & (PREFIX_CS + | PREFIX_DS + | PREFIX_SS + | PREFIX_ES + | PREFIX_FS + | PREFIX_GS)) == 0) + prefixes |= PREFIX_DS; + append_prefix (); + oappend ("("); oappend (aflag ? "%esi" : "%si"); oappend (")"); return (0); diff -ur binutils-2.9/opcodes/mips-dis.c binutils-2.9.1/opcodes/mips-dis.c --- binutils-2.9/opcodes/mips-dis.c Tue Apr 7 15:48:56 1998 +++ binutils-2.9.1/opcodes/mips-dis.c Fri May 1 11:48:20 1998 @@ -80,6 +80,101 @@ case ',': case '(': case ')': + (*info->fprintf_func) (info->stream, "%c", *d); + break; + + case 's': + case 'b': + case 'r': + case 'v': + (*info->fprintf_func) (info->stream, "$%s", + reg_names[(l >> OP_SH_RS) & OP_MASK_RS]); + break; + + case 't': + case 'w': + (*info->fprintf_func) (info->stream, "$%s", + reg_names[(l >> OP_SH_RT) & OP_MASK_RT]); + break; + + case 'i': + case 'u': + (*info->fprintf_func) (info->stream, "0x%x", + (l >> OP_SH_IMMEDIATE) & OP_MASK_IMMEDIATE); + break; + + case 'j': /* same as i, but sign-extended */ + case 'o': + delta = (l >> OP_SH_DELTA) & OP_MASK_DELTA; + if (delta & 0x8000) + delta |= ~0xffff; + (*info->fprintf_func) (info->stream, "%d", + delta); + break; + + case 'h': + (*info->fprintf_func) (info->stream, "0x%x", + (unsigned int) ((l >> OP_SH_PREFX) + & OP_MASK_PREFX)); + break; + + case 'k': + (*info->fprintf_func) (info->stream, "0x%x", + (unsigned int) ((l >> OP_SH_CACHE) + & OP_MASK_CACHE)); + break; + + case 'a': + (*info->print_address_func) + (((pc & 0xF0000000) | (((l >> OP_SH_TARGET) & OP_MASK_TARGET) << 2)), + info); + break; + + case 'p': + /* sign extend the displacement */ + delta = (l >> OP_SH_DELTA) & OP_MASK_DELTA; + if (delta & 0x8000) + delta |= ~0xffff; + (*info->print_address_func) + ((delta << 2) + pc + 4, + info); + break; + + case 'd': + (*info->fprintf_func) (info->stream, "$%s", + reg_names[(l >> OP_SH_RD) & OP_MASK_RD]); + break; + + case 'z': + (*info->fprintf_func) (info->stream, "$%s", reg_names[0]); + break; + + case '<': + (*info->fprintf_func) (info->stream, "0x%x", + (l >> OP_SH_SHAMT) & OP_MASK_SHAMT); + break; + + case 'c': + (*info->fprintf_func) (info->stream, "0x%x", + (l >> OP_SH_CODE) & OP_MASK_CODE); + break; + + case 'C': + (*info->fprintf_func) (info->stream, "0x%x", + (l >> OP_SH_COPZ) & OP_MASK_COPZ); + break; + + case 'B': + (*info->fprintf_func) (info->stream, "0x%x", + (l >> OP_SH_SYSCALL) & OP_MASK_SYSCALL); + break; + + case 'S': + case 'V': + (*info->fprintf_func) (info->stream, "$f%d", + (l >> OP_SH_FS) & OP_MASK_FS); + break; + case 'T': case 'W':