Submitted By: Jim Gifford (jim at cross-lfs dot org) Date: 01-22-2009 Initial Package Version: 2.19 Origin: Upstream Upstream Status: Applied Description: This is a branch update for binutils-2.19, and should be rechecked periodically. diff -Naur binutils-2.19.orig/bfd/ChangeLog binutils-2.19/bfd/ChangeLog --- binutils-2.19.orig/bfd/ChangeLog 2008-10-16 06:20:48.000000000 -0700 +++ binutils-2.19/bfd/ChangeLog 2009-01-14 01:13:49.000000000 -0800 @@ -1,3 +1,37 @@ +2009-01-14 Joseph Myers + + * elf32-arm.c (elf32_arm_final_link_relocate): Do not turn + branches to undefine weak symbols into branches to the next + instruction if creating PLT entries for those symbols. + +2008-12-23 Nick Clifton + + * Import this patch from the mainline: + 2008-11-10 Andreas Schwab + + PR 7011 + * elf.c (assign_file_positions_for_non_load_sections): Handle + PT_GNU_RELRO specially. + +2008-11-20 Alan Modra + + * elf32-ppc.c (allocate_dynrelocs): Always use tlsld_got for + TLS_LD even when symbol is used with other TLS reloc types. + (ppc_elf_relocate_section): Bypass symbol checks when using tlsld_got. + Leave addend zero on LD DTPMOD dynamic reloc. + +2008-11-17 Eric B. Weddington + + PR 7022 + * elf32-avr.c (bfd_elf_avr_final_write_processing): + Add missing break statements. + +2008-10-28 Tristan Gingold + + * configure.in: Bump version to 2.19.0 + * Makefile.am (RELEASE): Unset. + * configure, Makefile.in: Regenerated. + 2008-10-16 Tristan Gingold * configure.in: Bump version to 2.19 diff -Naur binutils-2.19.orig/bfd/configure binutils-2.19/bfd/configure --- binutils-2.19.orig/bfd/configure 2008-10-16 06:20:42.000000000 -0700 +++ binutils-2.19/bfd/configure 2008-10-28 03:42:15.000000000 -0700 @@ -3032,7 +3032,7 @@ # Define the identity of the package. PACKAGE=bfd - VERSION=2.19 + VERSION=2.19.0 cat >>confdefs.h <<_ACEOF diff -Naur binutils-2.19.orig/bfd/configure.in binutils-2.19/bfd/configure.in --- binutils-2.19.orig/bfd/configure.in 2008-10-16 06:20:34.000000000 -0700 +++ binutils-2.19/bfd/configure.in 2008-10-28 03:42:15.000000000 -0700 @@ -8,7 +8,7 @@ AC_CANONICAL_TARGET AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.19) +AM_INIT_AUTOMAKE(bfd, 2.19.0) dnl These must be called before LT_INIT, because it may want dnl to call AC_CHECK_PROG. diff -Naur binutils-2.19.orig/bfd/doc/bfdver.texi binutils-2.19/bfd/doc/bfdver.texi --- binutils-2.19.orig/bfd/doc/bfdver.texi 2008-10-16 06:45:29.000000000 -0700 +++ binutils-2.19/bfd/doc/bfdver.texi 2009-01-14 01:00:24.000000000 -0800 @@ -1,4 +1,4 @@ -@set VERSION 2.19 +@set VERSION 2.19.0 @set VERSION_PACKAGE (GNU Binutils) -@set UPDATED October 2008 +@set UPDATED December 2008 @set BUGURL @uref{http://www.sourceware.org/bugzilla/} diff -Naur binutils-2.19.orig/bfd/elf32-arm.c binutils-2.19/bfd/elf32-arm.c --- binutils-2.19.orig/bfd/elf32-arm.c 2008-08-26 07:40:18.000000000 -0700 +++ binutils-2.19/bfd/elf32-arm.c 2009-01-14 01:13:49.000000000 -0800 @@ -6381,8 +6381,9 @@ int thumb2 = using_thumb2 (globals); /* A branch to an undefined weak symbol is turned into a jump to - the next instruction. */ - if (h && h->root.type == bfd_link_hash_undefweak) + the next instruction unless a PLT entry will be created. */ + if (h && h->root.type == bfd_link_hash_undefweak + && !(splt != NULL && h->plt.offset != (bfd_vma) -1)) { bfd_put_16 (input_bfd, 0xe000, hit_data); bfd_put_16 (input_bfd, 0xbf00, hit_data + 2); diff -Naur binutils-2.19.orig/bfd/elf32-avr.c binutils-2.19/bfd/elf32-avr.c --- binutils-2.19.orig/bfd/elf32-avr.c 2008-08-08 22:35:12.000000000 -0700 +++ binutils-2.19/bfd/elf32-avr.c 2008-11-17 07:26:01.000000000 -0800 @@ -1298,6 +1298,7 @@ case bfd_mach_avr25: val = E_AVR_MACH_AVR25; + break; case bfd_mach_avr3: val = E_AVR_MACH_AVR3; @@ -1305,9 +1306,11 @@ case bfd_mach_avr31: val = E_AVR_MACH_AVR31; + break; case bfd_mach_avr35: val = E_AVR_MACH_AVR35; + break; case bfd_mach_avr4: val = E_AVR_MACH_AVR4; diff -Naur binutils-2.19.orig/bfd/elf32-ppc.c binutils-2.19/bfd/elf32-ppc.c --- binutils-2.19.orig/bfd/elf32-ppc.c 2008-10-02 01:07:16.000000000 -0700 +++ binutils-2.19/bfd/elf32-ppc.c 2008-11-20 03:50:22.000000000 -0800 @@ -4997,6 +4997,9 @@ eh = (struct ppc_elf_link_hash_entry *) h; if (eh->elf.got.refcount > 0) { + bfd_boolean dyn; + unsigned int need; + /* Make sure this symbol is output as a dynamic symbol. */ if (eh->elf.dynindx == -1 && !eh->elf.forced_local @@ -5006,30 +5009,32 @@ return FALSE; } - if (eh->tls_mask == (TLS_TLS | TLS_LD) - && !eh->elf.def_dynamic) - { - /* If just an LD reloc, we'll just use htab->tlsld_got.offset. */ - htab->tlsld_got.refcount += 1; - eh->elf.got.offset = (bfd_vma) -1; - } - else + need = 0; + if ((eh->tls_mask & TLS_TLS) != 0) { - bfd_boolean dyn; - unsigned int need = 0; - if ((eh->tls_mask & TLS_TLS) != 0) + if ((eh->tls_mask & TLS_LD) != 0) { - if ((eh->tls_mask & TLS_LD) != 0) - need += 8; - if ((eh->tls_mask & TLS_GD) != 0) + if (!eh->elf.def_dynamic) + /* We'll just use htab->tlsld_got.offset. This should + always be the case. It's a little odd if we have + a local dynamic reloc against a non-local symbol. */ + htab->tlsld_got.refcount += 1; + else need += 8; - if ((eh->tls_mask & (TLS_TPREL | TLS_TPRELGD)) != 0) - need += 4; - if ((eh->tls_mask & TLS_DTPREL) != 0) - need += 4; } - else + if ((eh->tls_mask & TLS_GD) != 0) + need += 8; + if ((eh->tls_mask & (TLS_TPREL | TLS_TPRELGD)) != 0) + need += 4; + if ((eh->tls_mask & TLS_DTPREL) != 0) need += 4; + } + else + need += 4; + if (need == 0) + eh->elf.got.offset = (bfd_vma) -1; + else + { eh->elf.got.offset = allocate_got (htab, need); dyn = htab->elf.dynamic_sections_created; if ((info->shared @@ -5039,7 +5044,8 @@ { /* All the entries we allocated need relocs. Except LD only needs one. */ - if ((eh->tls_mask & TLS_LD) != 0) + if ((eh->tls_mask & TLS_LD) != 0 + && eh->elf.def_dynamic) need -= 4; htab->relgot->size += need * (sizeof (Elf32_External_Rela) / 4); } @@ -5275,27 +5281,24 @@ for (; local_got < end_local_got; ++local_got, ++lgot_masks) if (*local_got > 0) { - if (*lgot_masks == (TLS_TLS | TLS_LD)) + unsigned int need = 0; + if ((*lgot_masks & TLS_TLS) != 0) { - /* If just an LD reloc, we'll just use - htab->tlsld_got.offset. */ - htab->tlsld_got.refcount += 1; - *local_got = (bfd_vma) -1; + if ((*lgot_masks & TLS_GD) != 0) + need += 8; + if ((*lgot_masks & TLS_LD) != 0) + htab->tlsld_got.refcount += 1; + if ((*lgot_masks & (TLS_TPREL | TLS_TPRELGD)) != 0) + need += 4; + if ((*lgot_masks & TLS_DTPREL) != 0) + need += 4; } else + need += 4; + if (need == 0) + *local_got = (bfd_vma) -1; + else { - unsigned int need = 0; - if ((*lgot_masks & TLS_TLS) != 0) - { - if ((*lgot_masks & TLS_GD) != 0) - need += 8; - if ((*lgot_masks & (TLS_TPREL | TLS_TPRELGD)) != 0) - need += 4; - if ((*lgot_masks & TLS_DTPREL) != 0) - need += 4; - } - else - need += 4; *local_got = allocate_got (htab, need); if (info->shared) htab->relgot->size += (need @@ -6560,7 +6563,8 @@ /* Generate relocs for the dynamic linker. */ if ((info->shared || indx != 0) - && (h == NULL + && (offp == &htab->tlsld_got.offset + || h == NULL || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT || h->root.type != bfd_link_hash_undefweak)) { @@ -6591,7 +6595,7 @@ outrel.r_info = ELF32_R_INFO (indx, R_PPC_RELATIVE); else outrel.r_info = ELF32_R_INFO (indx, R_PPC_GLOB_DAT); - if (indx == 0) + if (indx == 0 && tls_ty != (TLS_TLS | TLS_LD)) { outrel.r_addend += relocation; if (tls_ty & (TLS_GD | TLS_DTPREL | TLS_TPREL)) diff -Naur binutils-2.19.orig/bfd/elf.c binutils-2.19/bfd/elf.c --- binutils-2.19.orig/bfd/elf.c 2008-10-09 05:18:23.000000000 -0700 +++ binutils-2.19/bfd/elf.c 2008-12-23 02:06:46.000000000 -0800 @@ -4606,7 +4606,61 @@ m != NULL; m = m->next, p++) { - if (m->count != 0) + if (p->p_type == PT_GNU_RELRO) + { + const Elf_Internal_Phdr *lp; + + BFD_ASSERT (!m->includes_filehdr && !m->includes_phdrs); + + if (link_info != NULL) + { + /* During linking the range of the RELRO segment is passed + in link_info. */ + for (lp = phdrs; lp < phdrs + count; ++lp) + { + if (lp->p_type == PT_LOAD + && lp->p_vaddr >= link_info->relro_start + && lp->p_vaddr < link_info->relro_end + && lp->p_vaddr + lp->p_filesz >= link_info->relro_end) + break; + } + } + else + { + /* Otherwise we are copying an executable or shared + library, but we need to use the same linker logic. */ + for (lp = phdrs; lp < phdrs + count; ++lp) + { + if (lp->p_type == PT_LOAD + && lp->p_paddr == p->p_paddr) + break; + } + } + + if (lp < phdrs + count) + { + p->p_vaddr = lp->p_vaddr; + p->p_paddr = lp->p_paddr; + p->p_offset = lp->p_offset; + if (link_info != NULL) + p->p_filesz = link_info->relro_end - lp->p_vaddr; + else if (m->p_size_valid) + p->p_filesz = m->p_size; + else + abort (); + p->p_memsz = p->p_filesz; + p->p_align = 1; + p->p_flags = (lp->p_flags & ~PF_W); + } + else if (link_info != NULL) + { + memset (p, 0, sizeof *p); + p->p_type = PT_NULL; + } + else + abort (); + } + else if (m->count != 0) { if (p->p_type != PT_LOAD && (p->p_type != PT_NOTE @@ -4622,87 +4676,20 @@ p->p_filesz = sect->filepos - m->sections[0]->filepos; if (hdr->sh_type != SHT_NOBITS) p->p_filesz += hdr->sh_size; - - if (p->p_type == PT_GNU_RELRO) - { - /* When we get here, we are copying executable - or shared library. But we need to use the same - linker logic. */ - Elf_Internal_Phdr *lp; - - for (lp = phdrs; lp < phdrs + count; ++lp) - { - if (lp->p_type == PT_LOAD - && lp->p_paddr == p->p_paddr) - break; - } - - if (lp < phdrs + count) - { - /* We should use p_size if it is valid since it - may contain the first few bytes of the next - SEC_ALLOC section. */ - if (m->p_size_valid) - p->p_filesz = m->p_size; - else - abort (); - p->p_vaddr = lp->p_vaddr; - p->p_offset = lp->p_offset; - p->p_memsz = p->p_filesz; - p->p_align = 1; - } - else - abort (); - } - else - p->p_offset = m->sections[0]->filepos; + p->p_offset = m->sections[0]->filepos; } } - else + else if (m->includes_filehdr) { - if (m->includes_filehdr) - { - p->p_vaddr = filehdr_vaddr; - if (! m->p_paddr_valid) - p->p_paddr = filehdr_paddr; - } - else if (m->includes_phdrs) - { - p->p_vaddr = phdrs_vaddr; - if (! m->p_paddr_valid) - p->p_paddr = phdrs_paddr; - } - else if (p->p_type == PT_GNU_RELRO) - { - Elf_Internal_Phdr *lp; - - for (lp = phdrs; lp < phdrs + count; ++lp) - { - if (lp->p_type == PT_LOAD - && lp->p_vaddr <= link_info->relro_end - && lp->p_vaddr >= link_info->relro_start - && (lp->p_vaddr + lp->p_filesz - >= link_info->relro_end)) - break; - } - - if (lp < phdrs + count - && link_info->relro_end > lp->p_vaddr) - { - p->p_vaddr = lp->p_vaddr; - p->p_paddr = lp->p_paddr; - p->p_offset = lp->p_offset; - p->p_filesz = link_info->relro_end - lp->p_vaddr; - p->p_memsz = p->p_filesz; - p->p_align = 1; - p->p_flags = (lp->p_flags & ~PF_W); - } - else - { - memset (p, 0, sizeof *p); - p->p_type = PT_NULL; - } - } + p->p_vaddr = filehdr_vaddr; + if (! m->p_paddr_valid) + p->p_paddr = filehdr_paddr; + } + else if (m->includes_phdrs) + { + p->p_vaddr = phdrs_vaddr; + if (! m->p_paddr_valid) + p->p_paddr = phdrs_paddr; } } diff -Naur binutils-2.19.orig/bfd/Makefile.in binutils-2.19/bfd/Makefile.in --- binutils-2.19.orig/bfd/Makefile.in 2008-10-16 06:20:48.000000000 -0700 +++ binutils-2.19/bfd/Makefile.in 2009-01-22 16:10:32.431360245 -0800 @@ -271,7 +271,7 @@ ACLOCAL_AMFLAGS = -I . -I .. -I ../config # Uncomment the following line when doing a release. -RELEASE = y +RELEASE=y INCDIR = $(srcdir)/../include CSEARCH = -I. -I$(srcdir) -I$(INCDIR) MKDEP = gcc -MM diff -Naur binutils-2.19.orig/bfd/version.h binutils-2.19/bfd/version.h --- binutils-2.19.orig/bfd/version.h 2008-10-16 05:51:57.000000000 -0700 +++ binutils-2.19/bfd/version.h 2009-01-22 16:00:14.000000000 -0800 @@ -1,4 +1,4 @@ -#define BFD_VERSION_DATE 20081016 +#define BFD_VERSION_DATE 20090123 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff -Naur binutils-2.19.orig/binutils/ChangeLog binutils-2.19/binutils/ChangeLog --- binutils-2.19.orig/binutils/ChangeLog 2008-10-02 01:07:16.000000000 -0700 +++ binutils-2.19/binutils/ChangeLog 2008-12-23 03:49:58.000000000 -0800 @@ -1,3 +1,16 @@ +2008-12-23 Nick Clifton + + * windmc.c (main): Use correct type for file length. + * dlltool.c (gen_exp_file): Likewise. + +2008-12-01 Nick Clifton + + PR 7044 + * dlltool.c (run): Use formatting string to avoid compile time + warning. + (gen_exp_file): Check return value from fread. + * windmc.c (main): Check return value from fread. + 2008-09-25 Richard Henderson * dwarf.c (size_of_encoded_value, get_encoded_value): Move up. diff -Naur binutils-2.19.orig/binutils/dlltool.c binutils-2.19/binutils/dlltool.c --- binutils-2.19.orig/binutils/dlltool.c 2008-07-29 21:34:56.000000000 -0700 +++ binutils-2.19/binutils/dlltool.c 2008-12-23 03:49:58.000000000 -0800 @@ -1206,7 +1206,7 @@ if (pid == -1) { - inform (strerror (errno)); + inform ("%s", strerror (errno)); fatal (errmsg_fmt, errmsg_arg); } @@ -1980,7 +1980,7 @@ int addr; long need[PAGE_SIZE]; long page_addr; - int numbytes; + bfd_size_type numbytes; int num_entries; long *copy; int j; @@ -1992,10 +1992,10 @@ numbytes = ftell (base_file); fseek (base_file, 0, SEEK_SET); copy = xmalloc (numbytes); - fread (copy, 1, numbytes, base_file); + if (fread (copy, 1, numbytes, base_file) < numbytes) + fatal (_("failed to read the number of entries from base file")); num_entries = numbytes / sizeof (long); - fprintf (f, "\t.section\t.reloc\n"); if (num_entries) { diff -Naur binutils-2.19.orig/binutils/windmc.c binutils-2.19/binutils/windmc.c --- binutils-2.19.orig/binutils/windmc.c 2008-07-29 21:34:56.000000000 -0700 +++ binutils-2.19/binutils/windmc.c 2008-12-23 03:49:58.000000000 -0800 @@ -1144,7 +1144,7 @@ unichar *u; rc_uint_type ul; char *buff; - long flen; + bfd_size_type flen; FILE *fp = fopen (input_filename, "rb"); if (!fp) @@ -1155,7 +1155,8 @@ fseek (fp, 0, SEEK_SET); buff = malloc (flen + 3); memset (buff, 0, flen + 3); - fread (buff, 1, flen, fp); + if (fread (buff, 1, flen, fp) < flen) + fatal (_("unable to read contents of %s"), input_filename); fclose (fp); if (mcset_text_in_is_unicode != 1) { diff -Naur binutils-2.19.orig/configure.ac binutils-2.19/configure.ac --- binutils-2.19.orig/configure.ac 2008-10-16 06:45:42.000000000 -0700 +++ binutils-2.19/configure.ac 2008-09-03 19:18:16.000000000 -0700 @@ -166,7 +166,7 @@ # binutils, gas and ld appear in that order because it makes sense to run # "make check" in that particular order. # If --enable-gold is used, "gold" will replace "ld". -host_tools="byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools" +host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools" # libgcj represents the runtime libraries only used by gcj. libgcj="target-libffi \ diff -Naur binutils-2.19.orig/gas/ChangeLog binutils-2.19/gas/ChangeLog --- binutils-2.19.orig/gas/ChangeLog 2008-10-16 05:52:03.000000000 -0700 +++ binutils-2.19/gas/ChangeLog 2009-01-14 01:00:24.000000000 -0800 @@ -1,3 +1,29 @@ +2009-01-14 Jakub Jelinek + + * Makefile.am (ehopt.o): Add struc-symbol.h. + * Makefile.in: Regenerated. + * ehopt.c: Include struc-symbol.h. + (check_eh_frame): For very small O_constant DW_CFA_advance_loc4 + create correct DW_CFA_advance_loc. Handle O_subtract only + for code alignment factor 1, otherwise handle O_divide or + O_right_shift of O_subtract and O_constant. + (eh_frame_estimate_size_before_relax): Always divide by ca. + (eh_frame_convert_frag): Likewise. + +2009-01-14 John David Anglin + + * dw2gencfi.c (output_cfi_insn): Scale DW_CFA_advance_loc1, + DW_CFA_advance_loc2 and DW_CFA_advance_loc4 outputs. + +2009-01-08 Adam Nemet + + * config/tc-mips.c (NO_ISA_COP): New macro. + (COP_INSN): New macro. + (is_opcode_valid): Use them. + (macro) : Use them. Don't accept coprocessor load store + insns based on the ISA if CPU is NO_ISA_COP. + : Likewise for coprocessor operations. + 2008-10-09 Eric Botcazou * dw2gencfi.c (cfi_finish): Deal with md_fix_up_eh_frame. diff -Naur binutils-2.19.orig/gas/config/tc-mips.c binutils-2.19/gas/config/tc-mips.c --- binutils-2.19.orig/gas/config/tc-mips.c 2008-08-08 12:24:49.000000000 -0700 +++ binutils-2.19/gas/config/tc-mips.c 2009-01-08 16:16:12.000000000 -0800 @@ -514,12 +514,11 @@ /* Returns true for a (non floating-point) coprocessor instruction. Reading or writing the condition code is only possible on the coprocessors and these insns are not marked with INSN_COP. Thus for these insns use the - condition-code flags unless this is the floating-point coprocessor. */ + condition-code flags. */ #define COP_INSN(PINFO) \ (PINFO != INSN_MACRO \ - && (((PINFO) & INSN_COP) \ - || ((PINFO) & (INSN_READ_COND_CODE | INSN_WRITE_COND_CODE) \ - && ((PINFO) & (FP_S | FP_D)) == 0))) + && ((PINFO) & (FP_S | FP_D)) == 0 \ + && ((PINFO) & (INSN_COP | INSN_READ_COND_CODE | INSN_WRITE_COND_CODE))) /* MIPS PIC level. */ diff -Naur binutils-2.19.orig/gas/dw2gencfi.c binutils-2.19/gas/dw2gencfi.c --- binutils-2.19.orig/gas/dw2gencfi.c 2008-10-16 05:52:09.000000000 -0700 +++ binutils-2.19/gas/dw2gencfi.c 2009-01-14 01:00:24.000000000 -0800 @@ -1,5 +1,5 @@ /* dw2gencfi.c - Support for generating Dwarf2 CFI information. - Copyright 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Michal Ludvig This file is part of GAS, the GNU Assembler. @@ -972,20 +972,20 @@ if (scaled <= 0x3F) out_one (DW_CFA_advance_loc + scaled); - else if (delta <= 0xFF) + else if (scaled <= 0xFF) { out_one (DW_CFA_advance_loc1); - out_one (delta); + out_one (scaled); } - else if (delta <= 0xFFFF) + else if (scaled <= 0xFFFF) { out_one (DW_CFA_advance_loc2); - out_two (delta); + out_two (scaled); } else { out_one (DW_CFA_advance_loc4); - out_four (delta); + out_four (scaled); } } else diff -Naur binutils-2.19.orig/gas/ehopt.c binutils-2.19/gas/ehopt.c --- binutils-2.19.orig/gas/ehopt.c 2007-11-06 09:15:10.000000000 -0800 +++ binutils-2.19/gas/ehopt.c 2009-01-14 01:00:25.000000000 -0800 @@ -1,5 +1,6 @@ /* ehopt.c--optimize gcc exception frame information. - Copyright 1998, 2000, 2001, 2003, 2005, 2007 Free Software Foundation, Inc. + Copyright 1998, 2000, 2001, 2003, 2005, 2007, 2008 + Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GAS, the GNU Assembler. @@ -21,6 +22,7 @@ #include "as.h" #include "subsegs.h" +#include "struc-symbol.h" /* We include this ELF file, even though we may not be assembling for ELF, since the exception frame information is always in a format @@ -398,13 +400,10 @@ subtracted were in the same frag and the expression was reduced to a constant. We can do the optimization entirely in this function. */ - if (d->cie_info.code_alignment > 0 - && exp->X_add_number % d->cie_info.code_alignment == 0 - && exp->X_add_number / d->cie_info.code_alignment < 0x40) + if (exp->X_add_number < 0x40) { d->loc4_frag->fr_literal[d->loc4_fix] - = DW_CFA_advance_loc - | (exp->X_add_number / d->cie_info.code_alignment); + = DW_CFA_advance_loc | exp->X_add_number; /* No more bytes needed. */ return 1; } @@ -419,23 +418,39 @@ *pnbytes = 2; } } - else if (exp->X_op == O_subtract) + else if (exp->X_op == O_subtract && d->cie_info.code_alignment == 1) { /* This is a case we can optimize. The expression was not reduced, so we can not finish the optimization until the end of the assembly. We set up a variant frag which we handle later. */ - int fr_subtype; - - if (d->cie_info.code_alignment > 0) - fr_subtype = d->cie_info.code_alignment << 3; - else - fr_subtype = 0; - - frag_var (rs_cfa, 4, 0, fr_subtype, make_expr_symbol (exp), + frag_var (rs_cfa, 4, 0, 1 << 3, make_expr_symbol (exp), d->loc4_fix, (char *) d->loc4_frag); return 1; } + else if ((exp->X_op == O_divide + || exp->X_op == O_right_shift) + && d->cie_info.code_alignment > 1) + { + if (exp->X_add_symbol->bsym + && exp->X_op_symbol->bsym + && exp->X_add_symbol->sy_value.X_op == O_subtract + && exp->X_op_symbol->sy_value.X_op == O_constant + && ((exp->X_op == O_divide + ? exp->X_op_symbol->sy_value.X_add_number + : (offsetT) 1 << exp->X_op_symbol->sy_value.X_add_number) + == (offsetT) d->cie_info.code_alignment)) + { + /* This is a case we can optimize as well. The expression was + not reduced, so we can not finish the optimization until the + end of the assembly. We set up a variant frag which we + handle later. */ + frag_var (rs_cfa, 4, 0, d->cie_info.code_alignment << 3, + make_expr_symbol (&exp->X_add_symbol->sy_value), + d->loc4_fix, (char *) d->loc4_frag); + return 1; + } + } break; case state_error: @@ -459,7 +474,9 @@ diff = resolve_symbol_value (frag->fr_symbol); - if (ca > 0 && diff % ca == 0 && diff / ca < 0x40) + assert (ca > 0); + diff /= ca; + if (diff < 0x40) ret = 0; else if (diff < 0x100) ret = 1; @@ -496,21 +513,21 @@ { offsetT diff; fragS *loc4_frag; - int loc4_fix; + int loc4_fix, ca; loc4_frag = (fragS *) frag->fr_opcode; loc4_fix = (int) frag->fr_offset; diff = resolve_symbol_value (frag->fr_symbol); + ca = frag->fr_subtype >> 3; + assert (ca > 0); + diff /= ca; switch (frag->fr_subtype & 7) { case 0: - { - int ca = frag->fr_subtype >> 3; - assert (ca > 0 && diff % ca == 0 && diff / ca < 0x40); - loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc | (diff / ca); - } + assert (diff < 0x40); + loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc | diff; break; case 1: diff -Naur binutils-2.19.orig/gas/Makefile.am binutils-2.19/gas/Makefile.am --- binutils-2.19.orig/gas/Makefile.am 2008-10-02 01:07:17.000000000 -0700 +++ binutils-2.19/gas/Makefile.am 2009-01-14 01:00:24.000000000 -0800 @@ -2159,7 +2159,8 @@ dw2gencfi.o: dw2gencfi.c dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ subsegs.h $(INCDIR)/obstack.h ecoff.o: ecoff.c ecoff.h -ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h +ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h \ + struc-symbol.h expr.o: expr.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h flonum-copy.o: flonum-copy.c flonum-konst.o: flonum-konst.c diff -Naur binutils-2.19.orig/gas/Makefile.in binutils-2.19/gas/Makefile.in --- binutils-2.19.orig/gas/Makefile.in 2008-10-02 01:07:17.000000000 -0700 +++ binutils-2.19/gas/Makefile.in 2009-01-14 01:00:24.000000000 -0800 @@ -3002,7 +3002,8 @@ dw2gencfi.o: dw2gencfi.c dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ subsegs.h $(INCDIR)/obstack.h ecoff.o: ecoff.c ecoff.h -ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h +ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h \ + struc-symbol.h expr.o: expr.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h flonum-copy.o: flonum-copy.c flonum-konst.o: flonum-konst.c diff -Naur binutils-2.19.orig/gas/testsuite/ChangeLog binutils-2.19/gas/testsuite/ChangeLog --- binutils-2.19.orig/gas/testsuite/ChangeLog 2008-09-17 02:00:45.000000000 -0700 +++ binutils-2.19/gas/testsuite/ChangeLog 2009-01-08 16:16:12.000000000 -0800 @@ -1,3 +1,9 @@ +2009-01-08 Adam Nemet + + * gas/mips/mips1-fp.s, gas/mips/mips1-fp.d, gas/mips/mips1-fp.l: + New tests. + * gas/mips/mips.exp: Run them. + 2008-09-15 Alan Modra * gas/all/gas.exp: Don't run redef tests on a bunch of targets. diff -Naur binutils-2.19.orig/gas/testsuite/gas/mips/mips1-fp.d binutils-2.19/gas/testsuite/gas/mips/mips1-fp.d --- binutils-2.19.orig/gas/testsuite/gas/mips/mips1-fp.d 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.19/gas/testsuite/gas/mips/mips1-fp.d 2009-01-08 16:16:12.000000000 -0800 @@ -0,0 +1,12 @@ +#as: -32 +#objdump: -M reg-names=numeric -dr +#name: MIPS1 FP instructions + +.*: file format .* + +Disassembly of section .text: + +[0-9a-f]+ : +.*: 46041000 add.s \$f0,\$f2,\$f4 +.*: 44420000 cfc1 \$2,\$0 +#pass diff -Naur binutils-2.19.orig/gas/testsuite/gas/mips/mips1-fp.l binutils-2.19/gas/testsuite/gas/mips/mips1-fp.l --- binutils-2.19.orig/gas/testsuite/gas/mips/mips1-fp.l 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.19/gas/testsuite/gas/mips/mips1-fp.l 2009-01-08 16:16:12.000000000 -0800 @@ -0,0 +1,3 @@ +.*: Assembler messages: +.*:6: Error: opcode not supported on this processor: .* \(.*\) `add.s \$f0,\$f2,\$f4' +.*:7: Error: opcode not supported on this processor: .* \(.*\) `cfc1 \$2,\$0' diff -Naur binutils-2.19.orig/gas/testsuite/gas/mips/mips1-fp.s binutils-2.19/gas/testsuite/gas/mips/mips1-fp.s --- binutils-2.19.orig/gas/testsuite/gas/mips/mips1-fp.s 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.19/gas/testsuite/gas/mips/mips1-fp.s 2009-01-08 16:16:12.000000000 -0800 @@ -0,0 +1,7 @@ +# Source file used to test -mips1 fp instructions. + +# This is not a complete list of mips1 FP instructions. + +foo: + add.s $f0,$f2,$f4 + cfc1 $2,$0 diff -Naur binutils-2.19.orig/gas/testsuite/gas/mips/mips.exp binutils-2.19/gas/testsuite/gas/mips/mips.exp --- binutils-2.19.orig/gas/testsuite/gas/mips/mips.exp 2008-09-06 01:47:00.000000000 -0700 +++ binutils-2.19/gas/testsuite/gas/mips/mips.exp 2009-01-08 16:16:12.000000000 -0800 @@ -398,6 +398,9 @@ run_dump_test_arches "abs" [mips_arch_list_matching mips1] run_dump_test_arches "add" [mips_arch_list_matching mips1] run_dump_test_arches "and" [mips_arch_list_matching mips1] + run_dump_test_arches "mips1-fp" [mips_arch_list_matching mips1] + run_list_test_arches "mips1-fp" "-32 -msoft-float" \ + [mips_arch_list_matching mips1] run_dump_test "break20" run_dump_test "trap20" diff -Naur binutils-2.19.orig/ld/ChangeLog binutils-2.19/ld/ChangeLog --- binutils-2.19.orig/ld/ChangeLog 2008-10-09 05:18:31.000000000 -0700 +++ binutils-2.19/ld/ChangeLog 2009-01-08 06:39:46.000000000 -0800 @@ -1,826 +1,14 @@ -2008-10-05 Alan Modra +2009-01-08 Dave Korn - PR 6943 - * scripttempl/avr.sc (.bss): Set lma when relocating. - (.bss, .noinit): No need to set vma when relocating. - (.text, .bss, ,noinit): Set vma to zero when not relocating. +Backport bugfix from HEAD: -2008-09-30 Joseph Myers + 2009-01-03 Dave Korn - * emulparams/elf64ppc.sh (OTHER_GOT_RELOC_SECTIONS): Add .rela.opd - and .rela.branch_lt. + * pe-dll.c (autofilter_liblist): Add entry for shared libgcc. + (libnamencmp): New function. + (auto_export): Use it in place of strncmp when filtering libraries. -2008-09-29 Nick Clifton - - * po/vi.po: Updated Vietnamese translation. - -2008-09-09 Peter Rosin (tiny change) - - * emultempl/pe.em (pe_find_data_imports): Add trailing newline - to warning message. - * emultempl/pep.em (pep_find_data_imports): Likewise. - -2008-09-09 Alan Modra - - * Makefile.am: Run "make dep-am". - * Makefile.in: Regenerate. - * po/ld.pot: Regenerate. - -2008-09-09 Alan Modra - - * emultempl/beos.em (gld${EMULATION_NAME}_place_orphan): Updated. - * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): Ditto. - -2008-09-08 Tristan Gingold - - * NEWS: Add a marker for the 2.19 features. - -2008-09-07 Alan Modra - - * ldlang.h (lang_output_section_find): Define. - (lang_output_section_statement_lookup): Update prototype. - * ldlang.c (lang_output_section_find, - lang_output_section_statement_lookup_1): Merge into.. - (lang_output_section_statement_lookup): ..here. Update all callers. - (process_insert_statements): Set constraint negative - for output section statements we might be inserting. Make error - fatal on not finding insertion section. - (lang_output_section_find): Rather than comparing - output_section_statement.constraint against -1, test whether - it is postive. - (lang_output_section_statement_lookup_1): Likewise. - (output_prev_sec_find, strip_excluded_output_sections): Likewise. - (lang_record_phdrs): Likewise. - * emultempl/elf32.em (output_rel_find): Likewise. - * NEWS: Mention INSERT. - -2008-08-26 Nick Clifton - - PR 6727 - * emultempl/armelf.em (arm_elf_set_bfd_for_interworking): Scan all - input sections in all input bfds and always select the last - suitable one, so that interworking stubs are always processed - after all other input sections. - (arm_elf_before_allocation): Remove redundant use of - output_has_begun flag. - -2008-08-24 Alan Modra - - * configure.in: Update a number of obsolete autoconf macros. - * configure: Regenerate. - * aclocal.m4: Regenerate. - -2008-08-21 Jan Kratochvil - - PR ld/6833 - * ldexp.c (fold_binary ): Do not align - EXPLD.DATASEG.MIN_BASE. - * ldlang.c (lang_size_sections): New variable OLD_BASE. Rename - OLD_MIN_BASE to MIN_BASE with the former alignment from `ldexp.c'. - Use OLD_BASE now for the minimal base check after the base decrease by - the maximum alignment found. - -2008-08-17 Alan Modra - - PR 6478 - * ldcref.c (check_local_sym_xref): Use bfd_generic_link_read_symbols. - Don't free symbol pointer array. - (check_refs): Likewise. - * ldmain.c (warning_callback): Likewise. - * ldmisc.c (vfinfo): Likewise. - * pe-dll.c (process_def_file): Likewise. - (pe_walk_relocs_of_symbol, generate_reloc): Likewise. - * emultempl/pe.em (pe_find_data_imports): Likewise. - (gld_${EMULATION_NAME}_after_open): Likewise. - * emultempl/pep.em (pep_find_data_imports): Likewise. - (gld_${EMULATION_NAME}_after_open): Likewise. - * ldlang.h (lang_input_statement_type): Delete asymbols, symbol_count, - passive_position, closed. - * ldlang.c (new_afile): Don't set asymbols and symbol_count. - * ldmain.c (add_archive_element): xcalloc lang_input_statement_type. - -2008-08-15 Alan Modra - - PR 6526 - * configure.in: Invoke AC_USE_SYSTEM_EXTENSIONS. - * Makefile.in: Regenerate. - * aclocal.m4: Regenerate. - * config.in: Regenerate. - * configure: Regenerate. - -2008-08-09 Alan Modra - - PR 6753 - * ldmain.c (check_for_scripts_dir, set_scripts_dir): Delete. - (main): Don't set_scripts_dir here. - * ldfile.c (check_for_scripts_dir, find_scripts_dir): New functions, - largely based on ldmain.c versions. - (ldfile_find_command_file): Set up search in script dir here without - affecting library search. - * Makefile.am (ldmain.o): No need to define SCRIPTDIR. - (ldfile.o): New rule. - * Makefile.in: Regenerate. - -2008-08-08 Anatoly Sokolov - - * Makefile.am (ALL_EMULATIONS): Add eavr25.o, eavr31.o, eavr35.o, - and eavr51.o. - Add rules for eavr25.c, eavr31.c, eavr35.c, eavr51.c. - * Makefile.in: Regenerate. - * configure.tgt (avr-*-*, targ_extra_emuls): Add avr25, avr31, avr35 - and avr51. - * emulparams/avr25.sh: New file. - * emulparams/avr31.sh: New file. - * emulparams/avr35.sh: New file. - * emulparams/avr51.sh: New file. - -2008-08-08 Richard Sandiford - Daniel Jacobowitz - - * emulparams/elf32bmip.sh (GOT): Define, moving .got.plt to... - (OTHER_RELRO_SECTIONS, OTHER_READWRITE_SECTIONS): ...one of these - two variables. - * emulparams/elf32bmipn32-defs.sh: Likewise. - * emultempl/mipself.em: Include ldctor.h, elf/mips.h and elfxx-mips.h. - (is_mips_elf): New macro. - (stub_file, stub_bfd): New variables. - (hook_stub_info): New structure. - (hook_in_stub): New function. - (mips_add_stub_section): Likewise. - (mips_create_output_section_statements): Likewise. - (mips_before_allocation): Likewise. - (real_func): New variable. - (mips_for_each_input_file_wrapper): New function. - (mips_lang_for_each_input_file): Likewise. - (lang_for_each_input_file): Define. - (LDEMUL_BEFORE_ALLOCATION): Likewise. - (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Likewise. - -2008-08-08 Alan Modra - - * ldfile.c (ldfile_open_file_search): Use concat. - (try_open): Don't use a fixed size pathname buffer. - (ldfile_find_command_file): Likewise. - * emultempl/elf32.em (gld${EMULATION_NAME}_open_dynamic_archive): If - using EXTRA_SHLIB_EXTENSION, don't open twice. - -2008-08-04 Alan Modra - - * Makefile.am (POTFILES.in): Set LC_ALL=C. - * Makefile.in: Regenerate. - * po/POTFILES.in: Regenerate. - -2008-08-03 Alan Modra - - * Makefile.am (spu_ovl.o): Merge rule into.. - (spu_ovl.o_c): ..this one. Only run cpp for spu target. - * Makefile.in: Regenerate. - -2008-08-02 Jan Kratochvil - - Include the spu_ovl ASCII form in the repository files. - * emultempl/spuelf.em: No longer use `bin2c', use now `spu_ovl.o_c'. - * Makefile.am (eelf32_spu.c): Depend now on `spu_ovl.o_c'. - ($(srcdir)/emultempl/spu_ovl.o_c): New target. - ($(srcdir)/emultempl/spu_ovl.o): Rename to... - (spu_ovl.o): ...this one. - * Makefile.in: Regenerate. - * emultempl/spu_ovl.o_c: New file. - * emultempl/spu_ovl.o: File removed. - -2008-07-31 Takashi Ono - - * pe-dll.c (generate_relocs): Don't generate relocs for - undefined weak symbols. - -2008-07-31 Jan Kratochvil - - * emultempl/spuelf.em: Abort on the missing required `spu_ovl.o'. - -2008-07-30 Alan Modra - - * emultempl/pe.em, emultempl/pep.em: Silence gcc warnings. - -2008-07-18 Joseph Myers - - * ld.texinfo (--no-wchar-size-warning): Document new ARM option. - * emultempl/armelf.em (no_wchar_size_warning): New. - (arm_elf_create_output_section_statements): Pass - no_wchar_size_warning to arm_elf_create_output_section_statements. - (OPTION_NO_WCHAR_SIZE_WARNING): New. - (PARSE_AND_LIST_LONGOPTS): Add no-wchar-size-warning. - (PARSE_AND_LIST_OPTIONS): List --no-wchar-size-warning. - (PARSE_AND_LIST_ARGS_CASES): Handle --no-wchar-size-warning. - -2008-07-15 Jie Zhang - - * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define. - -2008-07-12 Craig Silverstein - - PR ld/6741 - * configure.in: Check for, and include, libz.a if it is present. - * configure: Regenerate. - * config.in: Regenerate. - -2008-07-12 Jie Zhang - - Revert - 2008-07-12 Jie Zhang - * Makefile.am (eelf32bfin.c): Depend on bfin.em. - (eelf32bfinfd.c): Likewise. - * Makefile.in: Regenerate. - * gen-doc.texi: Set Blackfin. - * ld.texinfo: Document --sep-code and Blackfin specific - options. - * ldmain.c (main): Initialize link_info.sep_code. - * lexsup.c (enum option_values): Add OPTION_SEP_CODE. - (ld_options[]): Add --sep-code. - (parse_args): Deal with --sep-code. - * emulparams/bfin.sh (EXTRA_EM_FILE): Define. - * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define. - * emultempl/bfin.em: New file. - -2008-07-12 Jie Zhang - - * Makefile.am (eelf32bfin.c): Depend on bfin.em. - (eelf32bfinfd.c): Likewise. - * Makefile.in: Regenerate. - * gen-doc.texi: Set Blackfin. - * ld.texinfo: Document --sep-code and Blackfin specific - options. - * ldmain.c (main): Initialize link_info.sep_code. - * lexsup.c (enum option_values): Add OPTION_SEP_CODE. - (ld_options[]): Add --sep-code. - (parse_args): Deal with --sep-code. - * emulparams/bfin.sh (EXTRA_EM_FILE): Define. - * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define. - * emultempl/bfin.em: New file. - -2008-07-09 Danny Smith - - *pe-dll.c (autofilter_symbolprefixlist): Excude all symbols - starting with ".". - Exclude "_IMPORT_DESCRIPTOR_". - (autofilter_symbolsuffixlist): Exclude "_NULL_THUNK_DATA". - (autofilter_symbollist_generic): Don't check for ".text". - Exclude "_NULL_IMPORT_DESCRIPTOR". - (autofilter_symbollist_i386): Likewise. - -2008-07-07 Alan Modra - - * emultempl/armelf.em (elf32_arm_add_stub_section): Use - bfd_make_section_with_flags. - * emultempl/avrelf.em (avr_elf_create_output_section_statements): - Likewise. - * emultempl/hppaelf.em (hppaelf_add_stub_section): Likewise. - * emultempl/m68hc1xelf.em (m68hc11elf_add_stub_section): Likewise. - * emultempl/m68kcoff.em (gld${EMULATION_NAME}_after_open): Likewise. - * emultempl/m68kelf.em (m68k_elf_after_open): Likewise. - * emultempl/ppc64elf.em (ppc_add_stub_section): Likewise. - * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation): - Likewise. - -2008-07-06 Nathan Sidwell - - * ld.texinfo (File Commands): Document that INCLUDE can be used in - several different places. - * ldgram.y (statement, memory_spec, section): Allow INCLUDE. - (memory, memory_spec_list): Simplify BNF - (memory_spec_list_opt): New rule. - * ldlex.l (INCLUDE): Recognize in EXPRESSION. - -2008-06-20 Alan Modra - - * emultempl/spuelf.em (gld${EMULATION_NAME}_finish): Make "can not - build overlay stubs" a fatal error. - -2008-06-17 Ralf Wildenhues - - * config.in: Regenerate. - * configure: Regenerate. - -2008-06-17 Alan Modra - - * emultempl/spuelf.em (extra_stack_space): New variable. - (gld${EMULATION_NAME}_finish): Pass it to spu_elf_check_vma. - (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS, - PARSE_AND_LIST_ARGS_CASES): Handle --extra-stack-space. - * emultempl/spu_ovl.S: Mask interrupts during dma and update of - overlay manager structures. - * emultempl/spu_ovl.o: Regenerate. - -2008-06-16 Hans-Peter Nilsson - - * ld.texinfo (@node MMIX): For the __.MMIX.start. prefix, only - mention it as being special for global symbols. - -2008-06-12 Nick Clifton - - * ldlang.c (print_output_section_statement): If the output section - statement has an update_dot_tree expression, apply it to - print_dot. - (print_input_section): Do not update print_dot if it would move - print_dot backwards. - (lang_do_assignments_1): If the output section statement has an - update_dot_tree expression apply it to dot. - -2008-06-07 Alan Modra - - * NEWS: Mention archive:path patterns. - * ld.texinfo: Likewise. - * ldlang.c: Formatting throughout. - (archive_path): Only assume "[A-Za-z]:" is a dos drive. - (input_statement_is_archive_path): New function, extracted from.. - (walk_wild): ..here. - (walk_wild_consider_section): Match archive:path here too. - (init_map_userdata, sort_def_symbol): Convert to ISO C. - * ldmain.c (main): Set link_info.path_separator. - * emultempl/spuelf.em (choose_target): Don't set it here. - -2008-06-06 Alan Modra - - * ldlang.c (name_match): New function. - (unique_section_p, walk_wild_consider_section): Use it here. - (walk_wild_section_general): And here. - (archive_path): New function. - (walk_wild): Match archive:path filespecs. - (open_input_bfds): Don't load archive:path files. - * emultempl/spuelf.em (choose_target): Set path_separator. - * emulparams/elf32_spu.sh: Add ._ea.* sections to ._ea output. - -2008-06-04 Nick Clifton - - * ld.texinfo (Orphan Sections): Fix texi typo. - -2008-06-04 Chris Metcalf - - * lexsup.c (option_values): Add OPTION_NO_WARN_FATAL. - (ld_options): Add entry for --no-fatal-warnings. - (parse_args): Handle OPTION_NO_WARN_FATAL. - * ld.texinfo (Options): Document new command line switch. - -2008-06-04 Alan Modra - - * emultempl/spuelf.em (spu_elf_relink): Correct --no-auto-overlay arg. - -2008-06-02 Nathan Sidwell - - * ldlang.c (closest_target_match): Skip generic big and little - endian ELF targets. - -2008-05-31 Evandro Menezes - - PR ld/6430 - * ld.h (enum sort_order): New. - * ldlang.c (lang_check: Fix comment. - (lang_common): Sort commons in ascending or descending order. - (lang_one_common): Likewise. - * lexsup.c (ld_options): Have --sort-common take an option - argument. - (parse_args): Handle argument to --sort-common. - * ld.texinfo (--sort-common): Document new optional argument. - * NEWS: Mention new feature. - -2008-05-28 Christophe Lyon - - * ld.texinfo: State that farcalls stubs are supported for ARM-EABI - only. - -2008-05-27 Kai Tietz - - * pe-dll.c (fill_edata): Make sure we calculate vma's in - type bfd_vma. - (generate_reloc): Likewise. - (pe_implied_import_dll): Likewise. - -2008-05-21 Nick Clifton - - PR ld/6519 - * ld.texinfo (Orphan Sections): Mention that the linker will - provide start and stop symbols for orphaned sections if their - names are valid C identifiers. - * NEWS: Add an addendum to the description of the linker feature - for providing orphan section start and end symbols. - -2008-05-21 Maxim Kuvyrkov - - * configure.in (--enable-got): New option. Handle it. - * configure: Regenerate. - * config.in: Regenerate. - * emultempl/m68kelf.em: (got_handling_target_default): New shell - variable. - (GOT_HANDLING_TARGET_DEFAULT): New macro. - (GOT_HANDLING_DEFAULT): New macro. Initialize it from configure - option if one was given. - (got_handling): New static variable. - (elf_m68k_create_output_section_statements): New static function - implementing hook. - (PARSE_AND_LIST_PROLOGUE): Define shell variable. - (OPTION_GOT): New macro. - (PARSE_AND_LIST_LONGOPTS): Define shell variable. Specify - --got option. - (got): New linker option. - (PARSE_AND_LIST_OPTIONS): Define shell variable. Print help string - for --got option. - (PARSE_AND_LIST_ARGS_CASES): Define shell variable. Handle --got - option. - * ld.texinfo: Document --got= option. - * gen-doc.texi: Add M68K. - * NEWS: Mention the new feature. - -2008-05-21 Evandro Menezes - - PR ld/6430 - * ld.texinfo (--sort-common): Correct documentation to indicate - that sorting is performed by alignment, not size, biggest - alignment first. - -2008-05-21 Christophe Lyon - Nick Clifton - - * ld.texinfo (ARM): Document --stub-group-size=N option. - Move description of --pic-veneer option into the ARM section. - * NEWS: Mention the support for long function calls. - -2008-05-15 Christophe Lyon - - * emultempl/armelf.em (build_section_lists): New function. - (stub_file): Define. - (need_laying_out): Define. - (group_size): Define. - (hook_stub_info): Define. - (hook_in_stub): New function. - (elf32_arm_add_stub_section): New function. - (gldarm_layout_sections_again): New function. - (gld${EMULATION_NAME}_finish): Replace arm_elf_finish(). Generate - stubs for long calls if needed. - (arm_elf_create_output_section_statements): create stub_file bfd. - (arm_for_each_input_file_wrapper): New function. - (arm_lang_for_each_input_file): New function. - (lang_for_each_input_file): Define. - (PARSE_AND_LIST_PROLOGUE): Add option token OPTION_STUBGROUP_SIZE. - (PARSE_AND_LIST_LONGOPTS): Add option stub-group-size. - (PARSE_AND_LIST_OPTIONS): Add option stub-group-size. - (PARSE_AND_LIST_ARGS_CASES): Add OPTION_STUBGROUP_SIZE case. - (LDEMUL_FINISH): Update to gld${EMULATION_NAME}_finish. - * lang.c (print_input_statement): Skip if bfd has - BFD_LINKER_CREATED. - -2008-05-14 Alan Modra - - * Makefile.in: Regenerate. - -2008-05-09 Kai Tietz - - ld/PR6502 - * emultempl/pep.em (compute_dll_image_base): Use bfd_vma instead - of long and change return type to bfd_vma. - (definfo): Change type of address from long to bfd_vma. - (set_pep_value): Replace strtoul to strtoull. - (gld_${EMULATION_NAME}_set_symbols): use bfd_vma instead of long.. - * pe-dll.c (pe_dll_generate_def_file): Use fprintf_vma to print - ImageBase. - (quick_reloc): Change argument address from int to bfd_size_type. - -2008-05-08 Tom Tromey - - * ld.texinfo (PowerPC64 ELF64): Fix typo. - -2008-05-08 Alan Modra - - * elf32_spu.sh (OTHER_SECTIONS): Add "._ea". - * elf32ppc.sh: If building with spu support, put ".data.spehandle" - sections at the start of ".data" and provide a symbol to locate - the directory of embedded spe programs. - -2008-05-08 Alan Modra - - * ldexp.c (exp_print_token): Add ABSOLUTE, MIN_K, ASSERT_K. Correct - MAX_K. - (fold_binary ): Set expld.result.section to - current section. Expand comment. Formatting. - (fold_name ): Set expld.result.section to current section. - -2008-04-28 Nathan Sidwell - - * ldlang.c (lang_size_sections_1): Don't check LMA overflow on - non-load sections. - -2008-04-25 Michael Frysinger - - * configure.tgt (bfin-*-linux-uclibc*): Set targ_emul to elf32bfinfd - and targ_extra_emuls to elf32bfin. - -2008-04-23 Paolo Bonzini - - * aclocal.m4: Regenerate. - * configure: Regenerate. - -2008-04-03 Kai Tietz - - * scripttempl/pep.sc: Align start of symbol __CTOR_LIST__. - -2008-04-08 Alan Modra - - * po/POTFILES.in: Regenerate. - -2008-04-08 Alan Modra - - * emultempl/spuelf.em (auto_overlay, auto_overlay_file, - auto_overlay_fixed, auto_overlay_reserved, my_argc, my_argv): New vars. - (spu_before_allocation): Warn on --auto-overlay and existing overlays. - (struct tflist, clean_tmp): Move. - (new_tmp_file): New function, extracted from.. - (embedded_spu_file): ..here. - (spu_elf_open_overlay_script, spu_elf_relink): New function. - (gld${EMULATION_NAME}_finish): Pass a bunch of --auto-overlay params. - Warn on --auto-overlay and zero local store. - (gld${EMULATION_NAME}_choose_target): New function to stash argv. - (OPTION_SPU_AUTO_OVERLAY, OPTION_SPU_AUTO_RELINK, - OPTION_SPU_OVERLAY_RODATA, OPTION_SPU_FIXED_SPACE, - OPTION_SPU_RESERVED_SPACE, OPTION_SPU_NO_AUTO_OVERLAY): Define. - (PARSE_AND_LIST_LONGOPTS): Add entries for new options. - (PARSE_AND_LIST_OPTIONS): Likewise. - (PARSE_AND_LIST_ARGS_CASES): Likewise. - (LDEMUL_CHOOSE_TARGET): Define. - -2008-04-03 Kai Tietz - - PR ld/6026 - * pe-dll.c (make_head): Fix iat and thunk addend offset. - -2008-03-31 Nick Clifton - - * po/fr.po: Updated French translation. - -2008-03-24 Ian Lance Taylor - - The sha1 code is now in libiberty. - * sha1.c: Remove. - * sha1.h: Remove. - * Makefile.am (CFILES): Remove sha1.c. - (HFILES): Remove sha1.h. - (OFILES): Remove sha1.o. - (ld_new_SOURCES): Remove sha1.c. - (sha1.o): Remove target. - * Makefile.in: Rebuild. - -2008-03-20 Alan Modra - - * emultempl/spuelf.em: Update calls to elf32-spu.c funcs. - -2008-03-17 Ralf Wildenhues - - * aclocal.m4: Regenerate. - * configure: Likewise. - * Makefile.in: Likewise. - -2008-03-14 Alan Modra - - * emultempl/spuelf.em (gld${EMULATION_NAME}_finish): Protect - spu_elf_build_stubs with is_spu_target. - -2008-03-13 Alan Modra - - * Makefile.am: Run "make dep-am". - * Makefile.in: Regenerate. - * configure: Regenerate. - -2008-03-06 Joseph Myers - Roman Zippel - - * emulparams/m68kelf.sh (GENERATE_PIE_SCRIPT): Define. - (COMMONPAGESIZE): Define. - -2008-02-22 Nick Clifton - - PR ld/5785 - * ldlang.c (lang_size_sections_1): Honour the setting of an - lma_region even if there is no vma region set, or the vma region - is the same as the lma region. - -2008-02-18 Nick Clifton - - * scripttempl/armbpabi.sc (ENTRY): Do not define when performing a - relocatable link. - * scripttempl/elf32cr16.sc: Likewise. - * scripttempl/elf32cr16c.sc: Likewise. - * scripttempl/elf32crx.sc: Likewise. - * scripttempl/elf32sh-symbian.sc: Likewise. - * scripttempl/elf_chaos.sc: Likewise. - * scripttempl/elfd10v.sc: Likewise. - * scripttempl/elfi370.sc: Likewise. - * scripttempl/elfm68hc11.sc: Likewise. - * scripttempl/elfm68hc12.sc: Likewise. - * scripttempl/ip2k.sc: Likewise. - * scripttempl/iq2000.sc: Likewise. - * scripttempl/mep.sc: Likewise. - * scripttempl/v850.sc: Likewise. - * scripttempl/xstormy16.sc: Likewise. - -2008-02-16 Alan Modra - - PR ld/5761 - * ldexp.c (fold_name ): Check result of evaluating - load_base before calling make_abs. - -2008-02-15 Alan Modra - - * emultempl/alphaelf.em (alpha_after_open): Use elf_object_id. - * emultempl/hppaelf.em (hppaelf_create_output_section_statements): - Likewise. - * emultempl/ppc64elf.em (ppc_create_output_section_statements): - Likewise. - * emultempl/ppc32elf.em (is_ppc_elf32_vec): Delete. Replace all - uses with.. - (is_ppc_elf): ..this new macro. - -2008-02-15 Alan Modra - - * ldmain.h (output_bfd): Delete. - * ldmain.c (output_bfd): Delete. - Replace all occurrences of output_bfd with link_info.output_bfd. - * ldcref.c: Likewise. - * ldctor.c: Likewise. - * ldemul.c: Likewise. - * ldexp.c: Likewise. - * ldfile.c: Likewise. - * ldlang.c: Likewise. - * ldmisc.c: Likewise. - * ldwrite.c: Likewise. - * pe-dll.c: Likewise. - * emultempl/aix.em: Likewise. - * emultempl/alphaelf.em: Likewise. - * emultempl/armcoff.em: Likewise. - * emultempl/armelf.em: Likewise. - * emultempl/avrelf.em: Likewise. - * emultempl/beos.em: Likewise. - * emultempl/elf-generic.em: Likewise. - * emultempl/elf32.em: Likewise. - * emultempl/gld960.em: Likewise. - * emultempl/hppaelf.em: Likewise. - * emultempl/irix.em: Likewise. - * emultempl/linux.em: Likewise. - * emultempl/lnk960.em: Likewise. - * emultempl/m68hc1xelf.em: Likewise. - * emultempl/mmix-elfnmmo.em: Likewise. - * emultempl/mmo.em: Likewise. - * emultempl/pe.em: Likewise. - * emultempl/pep.em: Likewise. - * emultempl/ppc32elf.em: Likewise. - * emultempl/ppc64elf.em: Likewise. - * emultempl/scoreelf.em: Likewise. - * emultempl/sh64elf.em: Likewise. - * emultempl/spuelf.em: Likewise. - * emultempl/sunos.em: Likewise. - * emultempl/vanilla.em: Likewise. - * emultempl/vxworks.em: Likewise. - * emultempl/xtensaelf.em: Likewise. - * emultempl/z80.em: Likewise. - * ldlang.c (open_output): Don't return output, instead write - link_info_output_bfd directly. - * emultempl/alphaelf.em: Replace occurrences of link_info.hash->creator - with link_info.output_bfd->xvec. - * emultempl/hppaelf.em: Likewise. - * emultempl/ppc32elf.em: Likewise. - * emultempl/ppc64elf.em: Likewise. - * emultempl/spuelf.em: Likewise. - -2008-02-07 Alan Modra - - * ldlang.c (new_afile): Don't pass unadorned NULL to concat. - * ldfile.c (ldfile_add_library_path): Likewise. - * emultempl/elf32.em (check_ld_elf_hints, check_ld_so_conf): Likewise. - * emultempl/lnk960.em (lnk960_before_parse): Likewise. - * emultempl/spuelf.em (embedded_spu_file): Likewise. - -2008-02-07 Alan Modra - - * emultempl/spu_ovl.S: Use low bit of _ovly_table.size as - a "present" bit rather than low bit of .buf. Correct indexing - into _ovly_buf_table. Use relative loads and stores to access - overlay manager local vars. - * emultempl/spu_ovl.o: Regenerate. - -2008-02-04 H.J. Lu - - PR 5715 - * configure: Regenerated. - -2008-01-31 Marc Gauthier - - * configure.tgt (xtensa*-*-*): Recognize processor variants. - -2008-01-28 Fabian Groffen - - * configure.tgt (x86_64-*-solaris2): Add support for this target. - -2008-01-28 Vincent Riviere - - PR ld/5652 - * genscripts.sh: Check for the existence of BASH_LINENO not just - the BASH shell before generating line numbers in the emulation - file. - -2008-01-28 Alan Modra - - * emultempl/spu_ovl.S: Rewrite. - * emultempl/spu_ovl.o: Regenerate. - * emultempl/spuelf.em (toe): Delete. - (spu_place_special_section): Add param to control section placement. - Adjust callers. - (spu_elf_load_ovl_mgr): Adjust for struct _spu_elf_section_data - changes. - (spu_before_allocation): Adjust spu_elf_size_stubs call. - (gld${EMULATION_NAME}_finish): Adjust spu_elf_build_stubs call. - -2008-01-25 H.J. Lu - - PR ld/5670 - * ldlang.c (process_insert_statements): Silence gcc 4.1 alias - warning. - -2008-01-25 Alan Modra - - * ld.texinfo (INSERT): Describe. - * ldgram.y (ldgram_in_script, ldgram_had_equals): Delete. - (INSERT_K, AFTER, BEFORE): Add as tokens. - (ifile_p1): Handle INSERT statements. - (saved_script_handle, force_make_executable): Move to.. - * ldmain.c: ..here. - (previous_script_handle): New global var. - * ldmain.h (saved_script_handle, force_make_executable): Declare. - (previous_script_handle): Likewise. - * ldlex.l (INSERT_K, AFTER, BEFORE): Add tokens. - * lexsup.c (parge_args <-T>): Set previous_script_handle. - * ldlang.c (lang_for_each_statement_worker): Handle insert statement. - (map_input_to_output_sections, print_statement): Likewise. - (lang_size_sections_1, lang_do_assignments_1): Likewise. - (insert_os_after): New function, extracted from.. - (lang_insert_orphan): ..here. - (process_insert_statements): New function. - (lang_process): Call it. - (lang_add_insert): New function. - * ldlang.h (lang_insert_statement_enum): New. - (lang_insert_statement_type): New. - (lang_statement_union_type): Add insert_statement. - (lang_add_insert): Declare. - -2008-01-18 Bob Wilson - - * scripttempl/elfxtensa.sc: Merge ENTRY and .note.gnu.build-id - changes from elf.sc. - -2008-01-16 Alan Modra - - * ldlang.c (lang_size_sections_1): Simplify SEC_NEVER_LOAD test. - -2008-01-16 Alan Modra - - * ldlang.h (lang_afile_asection_pair_statement_enum): Delete. - (lang_afile_asection_pair_statement_type): Delete. - (lang_statement_union_type): Delete afile_asection_pair_statement. - * ldlang.c (lang_insert_orphan): Delete case handling the above. - (map_input_to_output_sections, print_statement): Likewise. - -2008-01-15 Kaz Kojima - - * emulparams/shlelf_linux.sh (DATA_START_SYMBOLS): Use PROVIDE - with __data_start. - * emulparams/shelf_nbsd.sh (DATA_START_SYMBOLS): Likewise. - -2008-01-15 Alan Modra - - PR 5604 - * ldlang.c (lang_gc_sections): Move code to set SEC_KEEP on entry - syms to _bfd_elf_gc_keep. - * emultempl/ppc64elf.em (ppc_before_allocation): Don't call - ppc64_elf_edit_opd if no_opd_opt. - -2008-01-11 Tristan Gingold - Eric Botcazou - - * ldlang.c (lang_end): Warns if the entry point is not found when - --gc-sections. - Emit an error if no root is specified when --gc-sections -r. - * ld.texinfo (Options): Document that --gc-sections is compatible - with -r and -q. - * ldmain.c (main): Do not error out if -r and --gc-sections. - * scripttempl/elf.sc: Emit ENTRY command only if relocating. - -2008-01-10 Daniel Jacobowitz - - PR ld/5533 - * ldlang.c (lang_end): Issue a warning for a missing start symbol - of a shared library if the symbol was specified on the command - line. - -2008-01-10 Alan Modra - - * ld.texinfo (--gc-sections): Describe linker behaviour. - -For older changes see ChangeLog-2007 +For older changes see ChangeLog-2008 Local Variables: mode: change-log @@ -828,3 +16,4 @@ fill-column: 74 version-control: never End: + diff -Naur binutils-2.19.orig/ld/ChangeLog-2008 binutils-2.19/ld/ChangeLog-2008 --- binutils-2.19.orig/ld/ChangeLog-2008 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.19/ld/ChangeLog-2008 2009-01-08 06:39:46.000000000 -0800 @@ -0,0 +1,840 @@ +2008-12-23 Tristan Gingold + + * Makefile.am (EXTRA_DIST): Add deffilep.c and deffilep.h + * Makefile.in: Regenerate. + +2008-11-14 Alan Modra + + * Makefile.am (spu_ovl.o_c): Add missing line continuations. + * Makefile.in: Regenerate. + +2008-10-05 Alan Modra + + PR 6943 + * scripttempl/avr.sc (.bss): Set lma when relocating. + (.bss, .noinit): No need to set vma when relocating. + (.text, .bss, ,noinit): Set vma to zero when not relocating. + +2008-09-30 Joseph Myers + + * emulparams/elf64ppc.sh (OTHER_GOT_RELOC_SECTIONS): Add .rela.opd + and .rela.branch_lt. + +2008-09-29 Nick Clifton + + * po/vi.po: Updated Vietnamese translation. + +2008-09-09 Peter Rosin (tiny change) + + * emultempl/pe.em (pe_find_data_imports): Add trailing newline + to warning message. + * emultempl/pep.em (pep_find_data_imports): Likewise. + +2008-09-09 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/ld.pot: Regenerate. + +2008-09-09 Alan Modra + + * emultempl/beos.em (gld${EMULATION_NAME}_place_orphan): Updated. + * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): Ditto. + +2008-09-08 Tristan Gingold + + * NEWS: Add a marker for the 2.19 features. + +2008-09-07 Alan Modra + + * ldlang.h (lang_output_section_find): Define. + (lang_output_section_statement_lookup): Update prototype. + * ldlang.c (lang_output_section_find, + lang_output_section_statement_lookup_1): Merge into.. + (lang_output_section_statement_lookup): ..here. Update all callers. + (process_insert_statements): Set constraint negative + for output section statements we might be inserting. Make error + fatal on not finding insertion section. + (lang_output_section_find): Rather than comparing + output_section_statement.constraint against -1, test whether + it is postive. + (lang_output_section_statement_lookup_1): Likewise. + (output_prev_sec_find, strip_excluded_output_sections): Likewise. + (lang_record_phdrs): Likewise. + * emultempl/elf32.em (output_rel_find): Likewise. + * NEWS: Mention INSERT. + +2008-08-26 Nick Clifton + + PR 6727 + * emultempl/armelf.em (arm_elf_set_bfd_for_interworking): Scan all + input sections in all input bfds and always select the last + suitable one, so that interworking stubs are always processed + after all other input sections. + (arm_elf_before_allocation): Remove redundant use of + output_has_begun flag. + +2008-08-24 Alan Modra + + * configure.in: Update a number of obsolete autoconf macros. + * configure: Regenerate. + * aclocal.m4: Regenerate. + +2008-08-21 Jan Kratochvil + + PR ld/6833 + * ldexp.c (fold_binary ): Do not align + EXPLD.DATASEG.MIN_BASE. + * ldlang.c (lang_size_sections): New variable OLD_BASE. Rename + OLD_MIN_BASE to MIN_BASE with the former alignment from `ldexp.c'. + Use OLD_BASE now for the minimal base check after the base decrease by + the maximum alignment found. + +2008-08-17 Alan Modra + + PR 6478 + * ldcref.c (check_local_sym_xref): Use bfd_generic_link_read_symbols. + Don't free symbol pointer array. + (check_refs): Likewise. + * ldmain.c (warning_callback): Likewise. + * ldmisc.c (vfinfo): Likewise. + * pe-dll.c (process_def_file): Likewise. + (pe_walk_relocs_of_symbol, generate_reloc): Likewise. + * emultempl/pe.em (pe_find_data_imports): Likewise. + (gld_${EMULATION_NAME}_after_open): Likewise. + * emultempl/pep.em (pep_find_data_imports): Likewise. + (gld_${EMULATION_NAME}_after_open): Likewise. + * ldlang.h (lang_input_statement_type): Delete asymbols, symbol_count, + passive_position, closed. + * ldlang.c (new_afile): Don't set asymbols and symbol_count. + * ldmain.c (add_archive_element): xcalloc lang_input_statement_type. + +2008-08-15 Alan Modra + + PR 6526 + * configure.in: Invoke AC_USE_SYSTEM_EXTENSIONS. + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * configure: Regenerate. + +2008-08-09 Alan Modra + + PR 6753 + * ldmain.c (check_for_scripts_dir, set_scripts_dir): Delete. + (main): Don't set_scripts_dir here. + * ldfile.c (check_for_scripts_dir, find_scripts_dir): New functions, + largely based on ldmain.c versions. + (ldfile_find_command_file): Set up search in script dir here without + affecting library search. + * Makefile.am (ldmain.o): No need to define SCRIPTDIR. + (ldfile.o): New rule. + * Makefile.in: Regenerate. + +2008-08-08 Anatoly Sokolov + + * Makefile.am (ALL_EMULATIONS): Add eavr25.o, eavr31.o, eavr35.o, + and eavr51.o. + Add rules for eavr25.c, eavr31.c, eavr35.c, eavr51.c. + * Makefile.in: Regenerate. + * configure.tgt (avr-*-*, targ_extra_emuls): Add avr25, avr31, avr35 + and avr51. + * emulparams/avr25.sh: New file. + * emulparams/avr31.sh: New file. + * emulparams/avr35.sh: New file. + * emulparams/avr51.sh: New file. + +2008-08-08 Richard Sandiford + Daniel Jacobowitz + + * emulparams/elf32bmip.sh (GOT): Define, moving .got.plt to... + (OTHER_RELRO_SECTIONS, OTHER_READWRITE_SECTIONS): ...one of these + two variables. + * emulparams/elf32bmipn32-defs.sh: Likewise. + * emultempl/mipself.em: Include ldctor.h, elf/mips.h and elfxx-mips.h. + (is_mips_elf): New macro. + (stub_file, stub_bfd): New variables. + (hook_stub_info): New structure. + (hook_in_stub): New function. + (mips_add_stub_section): Likewise. + (mips_create_output_section_statements): Likewise. + (mips_before_allocation): Likewise. + (real_func): New variable. + (mips_for_each_input_file_wrapper): New function. + (mips_lang_for_each_input_file): Likewise. + (lang_for_each_input_file): Define. + (LDEMUL_BEFORE_ALLOCATION): Likewise. + (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Likewise. + +2008-08-08 Alan Modra + + * ldfile.c (ldfile_open_file_search): Use concat. + (try_open): Don't use a fixed size pathname buffer. + (ldfile_find_command_file): Likewise. + * emultempl/elf32.em (gld${EMULATION_NAME}_open_dynamic_archive): If + using EXTRA_SHLIB_EXTENSION, don't open twice. + +2008-08-04 Alan Modra + + * Makefile.am (POTFILES.in): Set LC_ALL=C. + * Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + +2008-08-03 Alan Modra + + * Makefile.am (spu_ovl.o): Merge rule into.. + (spu_ovl.o_c): ..this one. Only run cpp for spu target. + * Makefile.in: Regenerate. + +2008-08-02 Jan Kratochvil + + Include the spu_ovl ASCII form in the repository files. + * emultempl/spuelf.em: No longer use `bin2c', use now `spu_ovl.o_c'. + * Makefile.am (eelf32_spu.c): Depend now on `spu_ovl.o_c'. + ($(srcdir)/emultempl/spu_ovl.o_c): New target. + ($(srcdir)/emultempl/spu_ovl.o): Rename to... + (spu_ovl.o): ...this one. + * Makefile.in: Regenerate. + * emultempl/spu_ovl.o_c: New file. + * emultempl/spu_ovl.o: File removed. + +2008-07-31 Takashi Ono + + * pe-dll.c (generate_relocs): Don't generate relocs for + undefined weak symbols. + +2008-07-31 Jan Kratochvil + + * emultempl/spuelf.em: Abort on the missing required `spu_ovl.o'. + +2008-07-30 Alan Modra + + * emultempl/pe.em, emultempl/pep.em: Silence gcc warnings. + +2008-07-18 Joseph Myers + + * ld.texinfo (--no-wchar-size-warning): Document new ARM option. + * emultempl/armelf.em (no_wchar_size_warning): New. + (arm_elf_create_output_section_statements): Pass + no_wchar_size_warning to arm_elf_create_output_section_statements. + (OPTION_NO_WCHAR_SIZE_WARNING): New. + (PARSE_AND_LIST_LONGOPTS): Add no-wchar-size-warning. + (PARSE_AND_LIST_OPTIONS): List --no-wchar-size-warning. + (PARSE_AND_LIST_ARGS_CASES): Handle --no-wchar-size-warning. + +2008-07-15 Jie Zhang + + * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define. + +2008-07-12 Craig Silverstein + + PR ld/6741 + * configure.in: Check for, and include, libz.a if it is present. + * configure: Regenerate. + * config.in: Regenerate. + +2008-07-12 Jie Zhang + + Revert + 2008-07-12 Jie Zhang + * Makefile.am (eelf32bfin.c): Depend on bfin.em. + (eelf32bfinfd.c): Likewise. + * Makefile.in: Regenerate. + * gen-doc.texi: Set Blackfin. + * ld.texinfo: Document --sep-code and Blackfin specific + options. + * ldmain.c (main): Initialize link_info.sep_code. + * lexsup.c (enum option_values): Add OPTION_SEP_CODE. + (ld_options[]): Add --sep-code. + (parse_args): Deal with --sep-code. + * emulparams/bfin.sh (EXTRA_EM_FILE): Define. + * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define. + * emultempl/bfin.em: New file. + +2008-07-12 Jie Zhang + + * Makefile.am (eelf32bfin.c): Depend on bfin.em. + (eelf32bfinfd.c): Likewise. + * Makefile.in: Regenerate. + * gen-doc.texi: Set Blackfin. + * ld.texinfo: Document --sep-code and Blackfin specific + options. + * ldmain.c (main): Initialize link_info.sep_code. + * lexsup.c (enum option_values): Add OPTION_SEP_CODE. + (ld_options[]): Add --sep-code. + (parse_args): Deal with --sep-code. + * emulparams/bfin.sh (EXTRA_EM_FILE): Define. + * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define. + * emultempl/bfin.em: New file. + +2008-07-09 Danny Smith + + *pe-dll.c (autofilter_symbolprefixlist): Excude all symbols + starting with ".". + Exclude "_IMPORT_DESCRIPTOR_". + (autofilter_symbolsuffixlist): Exclude "_NULL_THUNK_DATA". + (autofilter_symbollist_generic): Don't check for ".text". + Exclude "_NULL_IMPORT_DESCRIPTOR". + (autofilter_symbollist_i386): Likewise. + +2008-07-07 Alan Modra + + * emultempl/armelf.em (elf32_arm_add_stub_section): Use + bfd_make_section_with_flags. + * emultempl/avrelf.em (avr_elf_create_output_section_statements): + Likewise. + * emultempl/hppaelf.em (hppaelf_add_stub_section): Likewise. + * emultempl/m68hc1xelf.em (m68hc11elf_add_stub_section): Likewise. + * emultempl/m68kcoff.em (gld${EMULATION_NAME}_after_open): Likewise. + * emultempl/m68kelf.em (m68k_elf_after_open): Likewise. + * emultempl/ppc64elf.em (ppc_add_stub_section): Likewise. + * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation): + Likewise. + +2008-07-06 Nathan Sidwell + + * ld.texinfo (File Commands): Document that INCLUDE can be used in + several different places. + * ldgram.y (statement, memory_spec, section): Allow INCLUDE. + (memory, memory_spec_list): Simplify BNF + (memory_spec_list_opt): New rule. + * ldlex.l (INCLUDE): Recognize in EXPRESSION. + +2008-06-20 Alan Modra + + * emultempl/spuelf.em (gld${EMULATION_NAME}_finish): Make "can not + build overlay stubs" a fatal error. + +2008-06-17 Ralf Wildenhues + + * config.in: Regenerate. + * configure: Regenerate. + +2008-06-17 Alan Modra + + * emultempl/spuelf.em (extra_stack_space): New variable. + (gld${EMULATION_NAME}_finish): Pass it to spu_elf_check_vma. + (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS, + PARSE_AND_LIST_ARGS_CASES): Handle --extra-stack-space. + * emultempl/spu_ovl.S: Mask interrupts during dma and update of + overlay manager structures. + * emultempl/spu_ovl.o: Regenerate. + +2008-06-16 Hans-Peter Nilsson + + * ld.texinfo (@node MMIX): For the __.MMIX.start. prefix, only + mention it as being special for global symbols. + +2008-06-12 Nick Clifton + + * ldlang.c (print_output_section_statement): If the output section + statement has an update_dot_tree expression, apply it to + print_dot. + (print_input_section): Do not update print_dot if it would move + print_dot backwards. + (lang_do_assignments_1): If the output section statement has an + update_dot_tree expression apply it to dot. + +2008-06-07 Alan Modra + + * NEWS: Mention archive:path patterns. + * ld.texinfo: Likewise. + * ldlang.c: Formatting throughout. + (archive_path): Only assume "[A-Za-z]:" is a dos drive. + (input_statement_is_archive_path): New function, extracted from.. + (walk_wild): ..here. + (walk_wild_consider_section): Match archive:path here too. + (init_map_userdata, sort_def_symbol): Convert to ISO C. + * ldmain.c (main): Set link_info.path_separator. + * emultempl/spuelf.em (choose_target): Don't set it here. + +2008-06-06 Alan Modra + + * ldlang.c (name_match): New function. + (unique_section_p, walk_wild_consider_section): Use it here. + (walk_wild_section_general): And here. + (archive_path): New function. + (walk_wild): Match archive:path filespecs. + (open_input_bfds): Don't load archive:path files. + * emultempl/spuelf.em (choose_target): Set path_separator. + * emulparams/elf32_spu.sh: Add ._ea.* sections to ._ea output. + +2008-06-04 Nick Clifton + + * ld.texinfo (Orphan Sections): Fix texi typo. + +2008-06-04 Chris Metcalf + + * lexsup.c (option_values): Add OPTION_NO_WARN_FATAL. + (ld_options): Add entry for --no-fatal-warnings. + (parse_args): Handle OPTION_NO_WARN_FATAL. + * ld.texinfo (Options): Document new command line switch. + +2008-06-04 Alan Modra + + * emultempl/spuelf.em (spu_elf_relink): Correct --no-auto-overlay arg. + +2008-06-02 Nathan Sidwell + + * ldlang.c (closest_target_match): Skip generic big and little + endian ELF targets. + +2008-05-31 Evandro Menezes + + PR ld/6430 + * ld.h (enum sort_order): New. + * ldlang.c (lang_check: Fix comment. + (lang_common): Sort commons in ascending or descending order. + (lang_one_common): Likewise. + * lexsup.c (ld_options): Have --sort-common take an option + argument. + (parse_args): Handle argument to --sort-common. + * ld.texinfo (--sort-common): Document new optional argument. + * NEWS: Mention new feature. + +2008-05-28 Christophe Lyon + + * ld.texinfo: State that farcalls stubs are supported for ARM-EABI + only. + +2008-05-27 Kai Tietz + + * pe-dll.c (fill_edata): Make sure we calculate vma's in + type bfd_vma. + (generate_reloc): Likewise. + (pe_implied_import_dll): Likewise. + +2008-05-21 Nick Clifton + + PR ld/6519 + * ld.texinfo (Orphan Sections): Mention that the linker will + provide start and stop symbols for orphaned sections if their + names are valid C identifiers. + * NEWS: Add an addendum to the description of the linker feature + for providing orphan section start and end symbols. + +2008-05-21 Maxim Kuvyrkov + + * configure.in (--enable-got): New option. Handle it. + * configure: Regenerate. + * config.in: Regenerate. + * emultempl/m68kelf.em: (got_handling_target_default): New shell + variable. + (GOT_HANDLING_TARGET_DEFAULT): New macro. + (GOT_HANDLING_DEFAULT): New macro. Initialize it from configure + option if one was given. + (got_handling): New static variable. + (elf_m68k_create_output_section_statements): New static function + implementing hook. + (PARSE_AND_LIST_PROLOGUE): Define shell variable. + (OPTION_GOT): New macro. + (PARSE_AND_LIST_LONGOPTS): Define shell variable. Specify + --got option. + (got): New linker option. + (PARSE_AND_LIST_OPTIONS): Define shell variable. Print help string + for --got option. + (PARSE_AND_LIST_ARGS_CASES): Define shell variable. Handle --got + option. + * ld.texinfo: Document --got= option. + * gen-doc.texi: Add M68K. + * NEWS: Mention the new feature. + +2008-05-21 Evandro Menezes + + PR ld/6430 + * ld.texinfo (--sort-common): Correct documentation to indicate + that sorting is performed by alignment, not size, biggest + alignment first. + +2008-05-21 Christophe Lyon + Nick Clifton + + * ld.texinfo (ARM): Document --stub-group-size=N option. + Move description of --pic-veneer option into the ARM section. + * NEWS: Mention the support for long function calls. + +2008-05-15 Christophe Lyon + + * emultempl/armelf.em (build_section_lists): New function. + (stub_file): Define. + (need_laying_out): Define. + (group_size): Define. + (hook_stub_info): Define. + (hook_in_stub): New function. + (elf32_arm_add_stub_section): New function. + (gldarm_layout_sections_again): New function. + (gld${EMULATION_NAME}_finish): Replace arm_elf_finish(). Generate + stubs for long calls if needed. + (arm_elf_create_output_section_statements): create stub_file bfd. + (arm_for_each_input_file_wrapper): New function. + (arm_lang_for_each_input_file): New function. + (lang_for_each_input_file): Define. + (PARSE_AND_LIST_PROLOGUE): Add option token OPTION_STUBGROUP_SIZE. + (PARSE_AND_LIST_LONGOPTS): Add option stub-group-size. + (PARSE_AND_LIST_OPTIONS): Add option stub-group-size. + (PARSE_AND_LIST_ARGS_CASES): Add OPTION_STUBGROUP_SIZE case. + (LDEMUL_FINISH): Update to gld${EMULATION_NAME}_finish. + * lang.c (print_input_statement): Skip if bfd has + BFD_LINKER_CREATED. + +2008-05-14 Alan Modra + + * Makefile.in: Regenerate. + +2008-05-09 Kai Tietz + + ld/PR6502 + * emultempl/pep.em (compute_dll_image_base): Use bfd_vma instead + of long and change return type to bfd_vma. + (definfo): Change type of address from long to bfd_vma. + (set_pep_value): Replace strtoul to strtoull. + (gld_${EMULATION_NAME}_set_symbols): use bfd_vma instead of long.. + * pe-dll.c (pe_dll_generate_def_file): Use fprintf_vma to print + ImageBase. + (quick_reloc): Change argument address from int to bfd_size_type. + +2008-05-08 Tom Tromey + + * ld.texinfo (PowerPC64 ELF64): Fix typo. + +2008-05-08 Alan Modra + + * elf32_spu.sh (OTHER_SECTIONS): Add "._ea". + * elf32ppc.sh: If building with spu support, put ".data.spehandle" + sections at the start of ".data" and provide a symbol to locate + the directory of embedded spe programs. + +2008-05-08 Alan Modra + + * ldexp.c (exp_print_token): Add ABSOLUTE, MIN_K, ASSERT_K. Correct + MAX_K. + (fold_binary ): Set expld.result.section to + current section. Expand comment. Formatting. + (fold_name ): Set expld.result.section to current section. + +2008-04-28 Nathan Sidwell + + * ldlang.c (lang_size_sections_1): Don't check LMA overflow on + non-load sections. + +2008-04-25 Michael Frysinger + + * configure.tgt (bfin-*-linux-uclibc*): Set targ_emul to elf32bfinfd + and targ_extra_emuls to elf32bfin. + +2008-04-23 Paolo Bonzini + + * aclocal.m4: Regenerate. + * configure: Regenerate. + +2008-04-03 Kai Tietz + + * scripttempl/pep.sc: Align start of symbol __CTOR_LIST__. + +2008-04-08 Alan Modra + + * po/POTFILES.in: Regenerate. + +2008-04-08 Alan Modra + + * emultempl/spuelf.em (auto_overlay, auto_overlay_file, + auto_overlay_fixed, auto_overlay_reserved, my_argc, my_argv): New vars. + (spu_before_allocation): Warn on --auto-overlay and existing overlays. + (struct tflist, clean_tmp): Move. + (new_tmp_file): New function, extracted from.. + (embedded_spu_file): ..here. + (spu_elf_open_overlay_script, spu_elf_relink): New function. + (gld${EMULATION_NAME}_finish): Pass a bunch of --auto-overlay params. + Warn on --auto-overlay and zero local store. + (gld${EMULATION_NAME}_choose_target): New function to stash argv. + (OPTION_SPU_AUTO_OVERLAY, OPTION_SPU_AUTO_RELINK, + OPTION_SPU_OVERLAY_RODATA, OPTION_SPU_FIXED_SPACE, + OPTION_SPU_RESERVED_SPACE, OPTION_SPU_NO_AUTO_OVERLAY): Define. + (PARSE_AND_LIST_LONGOPTS): Add entries for new options. + (PARSE_AND_LIST_OPTIONS): Likewise. + (PARSE_AND_LIST_ARGS_CASES): Likewise. + (LDEMUL_CHOOSE_TARGET): Define. + +2008-04-03 Kai Tietz + + PR ld/6026 + * pe-dll.c (make_head): Fix iat and thunk addend offset. + +2008-03-31 Nick Clifton + + * po/fr.po: Updated French translation. + +2008-03-24 Ian Lance Taylor + + The sha1 code is now in libiberty. + * sha1.c: Remove. + * sha1.h: Remove. + * Makefile.am (CFILES): Remove sha1.c. + (HFILES): Remove sha1.h. + (OFILES): Remove sha1.o. + (ld_new_SOURCES): Remove sha1.c. + (sha1.o): Remove target. + * Makefile.in: Rebuild. + +2008-03-20 Alan Modra + + * emultempl/spuelf.em: Update calls to elf32-spu.c funcs. + +2008-03-17 Ralf Wildenhues + + * aclocal.m4: Regenerate. + * configure: Likewise. + * Makefile.in: Likewise. + +2008-03-14 Alan Modra + + * emultempl/spuelf.em (gld${EMULATION_NAME}_finish): Protect + spu_elf_build_stubs with is_spu_target. + +2008-03-13 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * configure: Regenerate. + +2008-03-06 Joseph Myers + Roman Zippel + + * emulparams/m68kelf.sh (GENERATE_PIE_SCRIPT): Define. + (COMMONPAGESIZE): Define. + +2008-02-22 Nick Clifton + + PR ld/5785 + * ldlang.c (lang_size_sections_1): Honour the setting of an + lma_region even if there is no vma region set, or the vma region + is the same as the lma region. + +2008-02-18 Nick Clifton + + * scripttempl/armbpabi.sc (ENTRY): Do not define when performing a + relocatable link. + * scripttempl/elf32cr16.sc: Likewise. + * scripttempl/elf32cr16c.sc: Likewise. + * scripttempl/elf32crx.sc: Likewise. + * scripttempl/elf32sh-symbian.sc: Likewise. + * scripttempl/elf_chaos.sc: Likewise. + * scripttempl/elfd10v.sc: Likewise. + * scripttempl/elfi370.sc: Likewise. + * scripttempl/elfm68hc11.sc: Likewise. + * scripttempl/elfm68hc12.sc: Likewise. + * scripttempl/ip2k.sc: Likewise. + * scripttempl/iq2000.sc: Likewise. + * scripttempl/mep.sc: Likewise. + * scripttempl/v850.sc: Likewise. + * scripttempl/xstormy16.sc: Likewise. + +2008-02-16 Alan Modra + + PR ld/5761 + * ldexp.c (fold_name ): Check result of evaluating + load_base before calling make_abs. + +2008-02-15 Alan Modra + + * emultempl/alphaelf.em (alpha_after_open): Use elf_object_id. + * emultempl/hppaelf.em (hppaelf_create_output_section_statements): + Likewise. + * emultempl/ppc64elf.em (ppc_create_output_section_statements): + Likewise. + * emultempl/ppc32elf.em (is_ppc_elf32_vec): Delete. Replace all + uses with.. + (is_ppc_elf): ..this new macro. + +2008-02-15 Alan Modra + + * ldmain.h (output_bfd): Delete. + * ldmain.c (output_bfd): Delete. + Replace all occurrences of output_bfd with link_info.output_bfd. + * ldcref.c: Likewise. + * ldctor.c: Likewise. + * ldemul.c: Likewise. + * ldexp.c: Likewise. + * ldfile.c: Likewise. + * ldlang.c: Likewise. + * ldmisc.c: Likewise. + * ldwrite.c: Likewise. + * pe-dll.c: Likewise. + * emultempl/aix.em: Likewise. + * emultempl/alphaelf.em: Likewise. + * emultempl/armcoff.em: Likewise. + * emultempl/armelf.em: Likewise. + * emultempl/avrelf.em: Likewise. + * emultempl/beos.em: Likewise. + * emultempl/elf-generic.em: Likewise. + * emultempl/elf32.em: Likewise. + * emultempl/gld960.em: Likewise. + * emultempl/hppaelf.em: Likewise. + * emultempl/irix.em: Likewise. + * emultempl/linux.em: Likewise. + * emultempl/lnk960.em: Likewise. + * emultempl/m68hc1xelf.em: Likewise. + * emultempl/mmix-elfnmmo.em: Likewise. + * emultempl/mmo.em: Likewise. + * emultempl/pe.em: Likewise. + * emultempl/pep.em: Likewise. + * emultempl/ppc32elf.em: Likewise. + * emultempl/ppc64elf.em: Likewise. + * emultempl/scoreelf.em: Likewise. + * emultempl/sh64elf.em: Likewise. + * emultempl/spuelf.em: Likewise. + * emultempl/sunos.em: Likewise. + * emultempl/vanilla.em: Likewise. + * emultempl/vxworks.em: Likewise. + * emultempl/xtensaelf.em: Likewise. + * emultempl/z80.em: Likewise. + * ldlang.c (open_output): Don't return output, instead write + link_info_output_bfd directly. + * emultempl/alphaelf.em: Replace occurrences of link_info.hash->creator + with link_info.output_bfd->xvec. + * emultempl/hppaelf.em: Likewise. + * emultempl/ppc32elf.em: Likewise. + * emultempl/ppc64elf.em: Likewise. + * emultempl/spuelf.em: Likewise. + +2008-02-07 Alan Modra + + * ldlang.c (new_afile): Don't pass unadorned NULL to concat. + * ldfile.c (ldfile_add_library_path): Likewise. + * emultempl/elf32.em (check_ld_elf_hints, check_ld_so_conf): Likewise. + * emultempl/lnk960.em (lnk960_before_parse): Likewise. + * emultempl/spuelf.em (embedded_spu_file): Likewise. + +2008-02-07 Alan Modra + + * emultempl/spu_ovl.S: Use low bit of _ovly_table.size as + a "present" bit rather than low bit of .buf. Correct indexing + into _ovly_buf_table. Use relative loads and stores to access + overlay manager local vars. + * emultempl/spu_ovl.o: Regenerate. + +2008-02-04 H.J. Lu + + PR 5715 + * configure: Regenerated. + +2008-01-31 Marc Gauthier + + * configure.tgt (xtensa*-*-*): Recognize processor variants. + +2008-01-28 Fabian Groffen + + * configure.tgt (x86_64-*-solaris2): Add support for this target. + +2008-01-28 Vincent Riviere + + PR ld/5652 + * genscripts.sh: Check for the existence of BASH_LINENO not just + the BASH shell before generating line numbers in the emulation + file. + +2008-01-28 Alan Modra + + * emultempl/spu_ovl.S: Rewrite. + * emultempl/spu_ovl.o: Regenerate. + * emultempl/spuelf.em (toe): Delete. + (spu_place_special_section): Add param to control section placement. + Adjust callers. + (spu_elf_load_ovl_mgr): Adjust for struct _spu_elf_section_data + changes. + (spu_before_allocation): Adjust spu_elf_size_stubs call. + (gld${EMULATION_NAME}_finish): Adjust spu_elf_build_stubs call. + +2008-01-25 H.J. Lu + + PR ld/5670 + * ldlang.c (process_insert_statements): Silence gcc 4.1 alias + warning. + +2008-01-25 Alan Modra + + * ld.texinfo (INSERT): Describe. + * ldgram.y (ldgram_in_script, ldgram_had_equals): Delete. + (INSERT_K, AFTER, BEFORE): Add as tokens. + (ifile_p1): Handle INSERT statements. + (saved_script_handle, force_make_executable): Move to.. + * ldmain.c: ..here. + (previous_script_handle): New global var. + * ldmain.h (saved_script_handle, force_make_executable): Declare. + (previous_script_handle): Likewise. + * ldlex.l (INSERT_K, AFTER, BEFORE): Add tokens. + * lexsup.c (parge_args <-T>): Set previous_script_handle. + * ldlang.c (lang_for_each_statement_worker): Handle insert statement. + (map_input_to_output_sections, print_statement): Likewise. + (lang_size_sections_1, lang_do_assignments_1): Likewise. + (insert_os_after): New function, extracted from.. + (lang_insert_orphan): ..here. + (process_insert_statements): New function. + (lang_process): Call it. + (lang_add_insert): New function. + * ldlang.h (lang_insert_statement_enum): New. + (lang_insert_statement_type): New. + (lang_statement_union_type): Add insert_statement. + (lang_add_insert): Declare. + +2008-01-18 Bob Wilson + + * scripttempl/elfxtensa.sc: Merge ENTRY and .note.gnu.build-id + changes from elf.sc. + +2008-01-16 Alan Modra + + * ldlang.c (lang_size_sections_1): Simplify SEC_NEVER_LOAD test. + +2008-01-16 Alan Modra + + * ldlang.h (lang_afile_asection_pair_statement_enum): Delete. + (lang_afile_asection_pair_statement_type): Delete. + (lang_statement_union_type): Delete afile_asection_pair_statement. + * ldlang.c (lang_insert_orphan): Delete case handling the above. + (map_input_to_output_sections, print_statement): Likewise. + +2008-01-15 Kaz Kojima + + * emulparams/shlelf_linux.sh (DATA_START_SYMBOLS): Use PROVIDE + with __data_start. + * emulparams/shelf_nbsd.sh (DATA_START_SYMBOLS): Likewise. + +2008-01-15 Alan Modra + + PR 5604 + * ldlang.c (lang_gc_sections): Move code to set SEC_KEEP on entry + syms to _bfd_elf_gc_keep. + * emultempl/ppc64elf.em (ppc_before_allocation): Don't call + ppc64_elf_edit_opd if no_opd_opt. + +2008-01-11 Tristan Gingold + Eric Botcazou + + * ldlang.c (lang_end): Warns if the entry point is not found when + --gc-sections. + Emit an error if no root is specified when --gc-sections -r. + * ld.texinfo (Options): Document that --gc-sections is compatible + with -r and -q. + * ldmain.c (main): Do not error out if -r and --gc-sections. + * scripttempl/elf.sc: Emit ENTRY command only if relocating. + +2008-01-10 Daniel Jacobowitz + + PR ld/5533 + * ldlang.c (lang_end): Issue a warning for a missing start symbol + of a shared library if the symbol was specified on the command + line. + +2008-01-10 Alan Modra + + * ld.texinfo (--gc-sections): Describe linker behaviour. + +For older changes see ChangeLog-2007 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff -Naur binutils-2.19.orig/ld/Makefile.am binutils-2.19/ld/Makefile.am --- binutils-2.19.orig/ld/Makefile.am 2008-09-09 01:02:19.000000000 -0700 +++ binutils-2.19/ld/Makefile.am 2008-12-23 05:56:10.000000000 -0800 @@ -758,9 +758,9 @@ $(srcdir)/emultempl/spu_ovl.o_c: @MAINT@ $(srcdir)/emultempl/spu_ovl.S if ../gas/as-new --version \ | grep 'target.*spu' >/dev/null 2>/dev/null; then \ - cpp -DOVLY_IRQ_SAVE $(srcdir)/emultempl/spu_ovl.S spu_ovl.s + cpp -DOVLY_IRQ_SAVE $(srcdir)/emultempl/spu_ovl.S spu_ovl.s; \ ../gas/as-new -o spu_ovl.o spu_ovl.s; \ - ../binutils/bin2c $@ + ../binutils/bin2c $@; \ fi eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \ $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} @@ -1914,7 +1914,8 @@ # Stuff that should be included in a distribution. The diststuff # target is run by the taz target in ../Makefile.in. -EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c $(man_MANS) +EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c \ + deffilep.c deffilep.h $(man_MANS) diststuff: info $(EXTRA_DIST) all: info ld.1 diff -Naur binutils-2.19.orig/ld/Makefile.in binutils-2.19/ld/Makefile.in --- binutils-2.19.orig/ld/Makefile.in 2008-09-09 01:02:19.000000000 -0700 +++ binutils-2.19/ld/Makefile.in 2008-12-23 05:56:10.000000000 -0800 @@ -730,7 +730,9 @@ # Stuff that should be included in a distribution. The diststuff # target is run by the taz target in ../Makefile.in. -EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c $(man_MANS) +EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c \ + deffilep.c deffilep.h $(man_MANS) + DISTCLEANFILES = tdirs site.exp site.bak stringify.sed $(am__append_1) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -1588,9 +1590,9 @@ $(srcdir)/emultempl/spu_ovl.o_c: @MAINT@ $(srcdir)/emultempl/spu_ovl.S if ../gas/as-new --version \ | grep 'target.*spu' >/dev/null 2>/dev/null; then \ - cpp -DOVLY_IRQ_SAVE $(srcdir)/emultempl/spu_ovl.S spu_ovl.s + cpp -DOVLY_IRQ_SAVE $(srcdir)/emultempl/spu_ovl.S spu_ovl.s; \ ../gas/as-new -o spu_ovl.o spu_ovl.s; \ - ../binutils/bin2c $@ + ../binutils/bin2c $@; \ fi eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \ $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} diff -Naur binutils-2.19.orig/ld/pe-dll.c binutils-2.19/ld/pe-dll.c --- binutils-2.19.orig/ld/pe-dll.c 2008-08-16 20:12:50.000000000 -0700 +++ binutils-2.19/ld/pe-dll.c 2009-01-08 06:39:45.000000000 -0800 @@ -1,6 +1,6 @@ /* Routines to help build PEI-format DLLs (Win32 etc) Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - 2008 Free Software Foundation, Inc. + 2008, 2009 Free Software Foundation, Inc. Written by DJ Delorie This file is part of the GNU Binutils. @@ -314,6 +314,7 @@ { STRING_COMMA_LEN ("libcegcc") }, { STRING_COMMA_LEN ("libcygwin") }, { STRING_COMMA_LEN ("libgcc") }, + { STRING_COMMA_LEN ("libgcc_s") }, { STRING_COMMA_LEN ("libstdc++") }, { STRING_COMMA_LEN ("libmingw32") }, { STRING_COMMA_LEN ("libmingwex") }, @@ -324,6 +325,37 @@ { NULL, 0 } }; +/* Regardless of the suffix issue mentioned above, we must ensure that + we do not falsely match on a leading substring, such as when libtool + builds libstdc++ as a DLL using libsupc++convenience.a as an intermediate. + This routine ensures that the leading part of the name matches and that + it is followed by only an optional version suffix and a file extension, + returning zero if so or -1 if not. */ +static int libnamencmp (const char *libname, const autofilter_entry_type *afptr) +{ + if (strncmp (libname, afptr->name, afptr->len)) + return -1; + + libname += afptr->len; + + /* Be liberal in interpreting what counts as a version suffix; we + accept anything that has a dash to separate it from the name and + begins with a digit. */ + if (libname[0] == '-') + { + if (!ISDIGIT (*++libname)) + return -1; + /* Ensure the filename has an extension. */ + while (*++libname != '.') + if (!*libname) + return -1; + } + else if (libname[0] != '.') + return -1; + + return 0; +} + static const autofilter_entry_type autofilter_objlist[] = { { STRING_COMMA_LEN ("crt0.o") }, @@ -501,7 +533,7 @@ while (afptr->name) { - if (strncmp (libname, afptr->name, afptr->len) == 0 ) + if (libnamencmp (libname, afptr) == 0 ) return 0; afptr++; } diff -Naur binutils-2.19.orig/ld/testsuite/ChangeLog binutils-2.19/ld/testsuite/ChangeLog --- binutils-2.19.orig/ld/testsuite/ChangeLog 2008-10-02 03:08:04.000000000 -0700 +++ binutils-2.19/ld/testsuite/ChangeLog 2009-01-14 01:13:49.000000000 -0800 @@ -1,3 +1,8 @@ +2009-01-14 Joseph Myers + + * ld-arm/thumb2-bl-undefweak.d, ld-arm/thumb2-bl-undefweak.s: New. + * ld-arm/arm-elf.exp: Run thumb2-bl-undefweak test. + 2008-09-30 Alan Modra * ld-elf/extract-symbol-1sec.d: Correct section lma. diff -Naur binutils-2.19.orig/ld/testsuite/ld-arm/arm-elf.exp binutils-2.19/ld/testsuite/ld-arm/arm-elf.exp --- binutils-2.19.orig/ld/testsuite/ld-arm/arm-elf.exp 2008-08-26 04:46:41.000000000 -0700 +++ binutils-2.19/ld/testsuite/ld-arm/arm-elf.exp 2009-01-14 01:13:49.000000000 -0800 @@ -184,6 +184,7 @@ run_dump_test "group-relocs-ldr-bad" run_dump_test "group-relocs-ldrs-bad" run_dump_test "group-relocs-ldc-bad" +run_dump_test "thumb2-bl-undefweak" run_dump_test "emit-relocs1" # Exclude non-ARM-EABI targets. diff -Naur binutils-2.19.orig/opcodes/ChangeLog binutils-2.19/opcodes/ChangeLog --- binutils-2.19.orig/opcodes/ChangeLog 2008-10-02 01:07:19.000000000 -0700 +++ binutils-2.19/opcodes/ChangeLog 2008-11-27 02:51:53.000000000 -0800 @@ -1,3 +1,20 @@ +2008-11-27 Alan Modra + + * ppc-opc.c (extract_sprg): Correct operand range check. + +2008-11-26 Andreas Schwab + + * m68k-dis.c (NEXTBYTE, NEXTWORD, NEXTLONG, NEXTULONG, NEXTSINGLE) + (NEXTDOUBLE, NEXTEXTEND, NEXTPACKED): Fix error handling. + (save_printer, save_print_address): Remove. + (fetch_data): Don't use them. + (match_insn_m68k): Always restore printing functions. + (print_insn_m68k): Don't save/restore printing functions. + +2008-11-25 Nick Clifton + + * m68k-dis.c: Rewrite to remove use of setjmp/longjmp. + 2008-09-29 Nick Clifton * po/vi.po: Updated Vietnamese translation. diff -Naur binutils-2.19.orig/opcodes/m68k-dis.c binutils-2.19/opcodes/m68k-dis.c --- binutils-2.19.orig/opcodes/m68k-dis.c 2007-09-27 04:14:10.000000000 -0700 +++ binutils-2.19/opcodes/m68k-dis.c 2008-11-26 02:45:27.000000000 -0800 @@ -60,46 +60,103 @@ #endif /* Get a 1 byte signed integer. */ -#define NEXTBYTE(p) (p += 2, FETCH_DATA (info, p), COERCE_SIGNED_CHAR(p[-1])) +#define NEXTBYTE(p, val) \ + do \ + { \ + p += 2; \ + if (!FETCH_DATA (info, p)) \ + return -3; \ + val = COERCE_SIGNED_CHAR (p[-1]); \ + } \ + while (0) /* Get a 2 byte signed integer. */ #define COERCE16(x) ((int) (((x) ^ 0x8000) - 0x8000)) -#define NEXTWORD(p) \ - (p += 2, FETCH_DATA (info, p), \ - COERCE16 ((p[-2] << 8) + p[-1])) + +#define NEXTWORD(p, val, ret_val) \ + do \ + { \ + p += 2; \ + if (!FETCH_DATA (info, p)) \ + return ret_val; \ + val = COERCE16 ((p[-2] << 8) + p[-1]); \ + } \ + while (0) /* Get a 4 byte signed integer. */ #define COERCE32(x) ((bfd_signed_vma) ((x) ^ 0x80000000) - 0x80000000) -#define NEXTLONG(p) \ - (p += 4, FETCH_DATA (info, p), \ - (COERCE32 ((((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1]))) + +#define NEXTLONG(p, val, ret_val) \ + do \ + { \ + p += 4; \ + if (!FETCH_DATA (info, p)) \ + return ret_val; \ + val = COERCE32 ((((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1]); \ + } \ + while (0) /* Get a 4 byte unsigned integer. */ -#define NEXTULONG(p) \ - (p += 4, FETCH_DATA (info, p), \ - (unsigned int) ((((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1])) +#define NEXTULONG(p, val) \ + do \ + { \ + p += 4; \ + if (!FETCH_DATA (info, p)) \ + return -3; \ + val = (unsigned int) ((((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1]); \ + } \ + while (0) /* Get a single precision float. */ -#define NEXTSINGLE(val, p) \ - (p += 4, FETCH_DATA (info, p), \ - floatformat_to_double (&floatformat_ieee_single_big, (char *) p - 4, &val)) +#define NEXTSINGLE(val, p) \ + do \ + { \ + p += 4; \ + if (!FETCH_DATA (info, p)) \ + return -3; \ + floatformat_to_double (& floatformat_ieee_single_big, \ + (char *) p - 4, & val); \ + } \ + while (0) /* Get a double precision float. */ -#define NEXTDOUBLE(val, p) \ - (p += 8, FETCH_DATA (info, p), \ - floatformat_to_double (&floatformat_ieee_double_big, (char *) p - 8, &val)) +#define NEXTDOUBLE(val, p) \ + do \ + { \ + p += 8; \ + if (!FETCH_DATA (info, p)) \ + return -3; \ + floatformat_to_double (& floatformat_ieee_double_big, \ + (char *) p - 8, & val); \ + } \ + while (0) /* Get an extended precision float. */ -#define NEXTEXTEND(val, p) \ - (p += 12, FETCH_DATA (info, p), \ - floatformat_to_double (&floatformat_m68881_ext, (char *) p - 12, &val)) +#define NEXTEXTEND(val, p) \ + do \ + { \ + p += 12; \ + if (!FETCH_DATA (info, p)) \ + return -3; \ + floatformat_to_double (& floatformat_m68881_ext, \ + (char *) p - 12, & val); \ + } \ + while (0) /* Need a function to convert from packed to double precision. Actually, it's easier to print a packed number than a double anyway, so maybe there should be a special case to handle this... */ -#define NEXTPACKED(p) \ - (p += 12, FETCH_DATA (info, p), 0.0) +#define NEXTPACKED(p, val) \ + do \ + { \ + p += 12; \ + if (!FETCH_DATA (info, p)) \ + return -3; \ + val = 0.0; \ + } \ + while (0) + /* Maximum length of an instruction. */ #define MAXLEN 22 @@ -112,12 +169,10 @@ bfd_byte *max_fetched; bfd_byte the_buffer[MAXLEN]; bfd_vma insn_start; - jmp_buf bailout; }; /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive) - to ADDR (exclusive) are valid. Returns 1 for success, longjmps - on error. */ + to ADDR (exclusive) are valid. Returns 1 for success, 0 on error. */ #define FETCH_DATA(info, addr) \ ((addr) <= ((struct private *) (info->private_data))->max_fetched \ ? 1 : fetch_data ((info), (addr))) @@ -136,7 +191,7 @@ if (status != 0) { (*info->memory_error_func) (status, start, info); - longjmp (priv->bailout, 1); + return 0; } else priv->max_fetched = addr; @@ -161,7 +216,8 @@ /* Fetch BITS bits from a position in the instruction specified by CODE. CODE is a "place to put an argument", or 'x' for a destination that is a general address (mode and register). - BUFFER contains the instruction. */ + BUFFER contains the instruction. + Returns -1 on failure. */ static int fetch_arg (unsigned char *buffer, @@ -216,64 +272,75 @@ break; case 'k': - FETCH_DATA (info, buffer + 3); + if (! FETCH_DATA (info, buffer + 3)) + return -1; val = (buffer[3] >> 4); break; case 'C': - FETCH_DATA (info, buffer + 3); + if (! FETCH_DATA (info, buffer + 3)) + return -1; val = buffer[3]; break; case '1': - FETCH_DATA (info, buffer + 3); + if (! FETCH_DATA (info, buffer + 3)) + return -1; val = (buffer[2] << 8) + buffer[3]; val >>= 12; break; case '2': - FETCH_DATA (info, buffer + 3); + if (! FETCH_DATA (info, buffer + 3)) + return -1; val = (buffer[2] << 8) + buffer[3]; val >>= 6; break; case '3': case 'j': - FETCH_DATA (info, buffer + 3); + if (! FETCH_DATA (info, buffer + 3)) + return -1; val = (buffer[2] << 8) + buffer[3]; break; case '4': - FETCH_DATA (info, buffer + 5); + if (! FETCH_DATA (info, buffer + 5)) + return -1; val = (buffer[4] << 8) + buffer[5]; val >>= 12; break; case '5': - FETCH_DATA (info, buffer + 5); + if (! FETCH_DATA (info, buffer + 5)) + return -1; val = (buffer[4] << 8) + buffer[5]; val >>= 6; break; case '6': - FETCH_DATA (info, buffer + 5); + if (! FETCH_DATA (info, buffer + 5)) + return -1; val = (buffer[4] << 8) + buffer[5]; break; case '7': - FETCH_DATA (info, buffer + 3); + if (! FETCH_DATA (info, buffer + 3)) + return -1; val = (buffer[2] << 8) + buffer[3]; val >>= 7; break; case '8': - FETCH_DATA (info, buffer + 3); + if (! FETCH_DATA (info, buffer + 3)) + return -1; val = (buffer[2] << 8) + buffer[3]; val >>= 10; break; case '9': - FETCH_DATA (info, buffer + 3); + if (! FETCH_DATA (info, buffer + 3)) + return -1; val = (buffer[2] << 8) + buffer[3]; val >>= 5; break; @@ -283,7 +350,8 @@ break; case 'E': - FETCH_DATA (info, buffer + 3); + if (! FETCH_DATA (info, buffer + 3)) + return -1; val = (buffer[2] >> 1); break; @@ -450,7 +518,8 @@ /* Print an indexed argument. The base register is BASEREG (-1 for pc). P points to extension word, in buffer. - ADDR is the nominal core address of that extension word. */ + ADDR is the nominal core address of that extension word. + Returns NULL upon error. */ static unsigned char * print_indexed (int basereg, @@ -465,7 +534,7 @@ char buf[40]; char vmabuf[50]; - word = NEXTWORD (p); + NEXTWORD (p, word, NULL); /* Generate the text for the index register. Where this will be output is not yet determined. */ @@ -503,10 +572,10 @@ switch ((word >> 4) & 3) { case 2: - base_disp = NEXTWORD (p); + NEXTWORD (p, base_disp, NULL); break; case 3: - base_disp = NEXTLONG (p); + NEXTLONG (p, base_disp, NULL); } if (basereg == -1) base_disp += addr; @@ -526,10 +595,10 @@ switch (word & 3) { case 2: - outer_disp = NEXTWORD (p); + NEXTWORD (p, outer_disp, NULL); break; case 3: - outer_disp = NEXTLONG (p); + NEXTLONG (p, outer_disp, NULL); } print_base (basereg, base_disp, info); @@ -547,9 +616,18 @@ return p; } +#define FETCH_ARG(size, val) \ + do \ + { \ + val = fetch_arg (buffer, place, size, info); \ + if (val < 0) \ + return -3; \ + } \ + while (0) + /* Returns number of bytes "eaten" by the operand, or return -1 if an invalid operand was found, or -2 if - an opcode tabe error was found. + an opcode tabe error was found or -3 to simply abort. ADDR is the pc for this arg to be relative to. */ static int @@ -575,23 +653,21 @@ case 'c': /* Cache identifier. */ { static char *const cacheFieldName[] = { "nc", "dc", "ic", "bc" }; - val = fetch_arg (buffer, place, 2, info); - (*info->fprintf_func) (info->stream, cacheFieldName[val]); + FETCH_ARG (2, val); + (*info->fprintf_func) (info->stream, cacheFieldName[val]); break; } case 'a': /* Address register indirect only. Cf. case '+'. */ { - (*info->fprintf_func) - (info->stream, - "%s@", - reg_names[fetch_arg (buffer, place, 3, info) + 8]); + FETCH_ARG (3, val); + (*info->fprintf_func) (info->stream, "%s@", reg_names[val + 8]); break; } case '_': /* 32-bit absolute address for move16. */ { - uval = NEXTULONG (p); + NEXTULONG (p, uval); (*info->print_address_func) (uval, info); break; } @@ -643,7 +719,7 @@ /* Fido added these. */ {"%cac", 0xffe}, {"%mbo", 0xfff}}; - val = fetch_arg (buffer, place, 12, info); + FETCH_ARG (12, val); for (regno = sizeof names / sizeof names[0] - 1; regno >= 0; regno--) if (names[regno].value == val) { @@ -656,7 +732,7 @@ break; case 'Q': - val = fetch_arg (buffer, place, 3, info); + FETCH_ARG (3, val); /* 0 means 8, except for the bkpt instruction... */ if (val == 0 && d[1] != 's') val = 8; @@ -664,7 +740,7 @@ break; case 'x': - val = fetch_arg (buffer, place, 3, info); + FETCH_ARG (3, val); /* 0 means -1. */ if (val == 0) val = -1; @@ -672,12 +748,12 @@ break; case 'j': - val = fetch_arg (buffer, place, 3, info); + FETCH_ARG (3, val); (*info->fprintf_func) (info->stream, "#%d", val+1); break; case 'K': - val = fetch_arg (buffer, place, 9, info); + FETCH_ARG (9, val); (*info->fprintf_func) (info->stream, "#%d", val); break; @@ -685,12 +761,13 @@ if (place == 'h') { static char *const scalefactor_name[] = { "<<", ">>" }; - val = fetch_arg (buffer, place, 1, info); + + FETCH_ARG (1, val); (*info->fprintf_func) (info->stream, scalefactor_name[val]); } else { - val = fetch_arg (buffer, place, 8, info); + FETCH_ARG (8, val); if (val & 0x80) val = val - 0x100; (*info->fprintf_func) (info->stream, "#%d", val); @@ -698,29 +775,27 @@ break; case 'T': - val = fetch_arg (buffer, place, 4, info); + FETCH_ARG (4, val); (*info->fprintf_func) (info->stream, "#%d", val); break; case 'D': - (*info->fprintf_func) (info->stream, "%s", - reg_names[fetch_arg (buffer, place, 3, info)]); + FETCH_ARG (3, val); + (*info->fprintf_func) (info->stream, "%s", reg_names[val]); break; case 'A': - (*info->fprintf_func) - (info->stream, "%s", - reg_names[fetch_arg (buffer, place, 3, info) + 010]); + FETCH_ARG (3, val); + (*info->fprintf_func) (info->stream, "%s", reg_names[val + 010]); break; case 'R': - (*info->fprintf_func) - (info->stream, "%s", - reg_names[fetch_arg (buffer, place, 4, info)]); + FETCH_ARG (4, val); + (*info->fprintf_func) (info->stream, "%s", reg_names[val]); break; case 'r': - regno = fetch_arg (buffer, place, 4, info); + FETCH_ARG (4, regno); if (regno > 7) (*info->fprintf_func) (info->stream, "%s@", reg_names[regno]); else @@ -728,13 +803,12 @@ break; case 'F': - (*info->fprintf_func) - (info->stream, "%%fp%d", - fetch_arg (buffer, place, 3, info)); + FETCH_ARG (3, val); + (*info->fprintf_func) (info->stream, "%%fp%d", val); break; case 'O': - val = fetch_arg (buffer, place, 6, info); + FETCH_ARG (6, val); if (val & 0x20) (*info->fprintf_func) (info->stream, "%s", reg_names[val & 7]); else @@ -742,78 +816,78 @@ break; case '+': - (*info->fprintf_func) - (info->stream, "%s@+", - reg_names[fetch_arg (buffer, place, 3, info) + 8]); + FETCH_ARG (3, val); + (*info->fprintf_func) (info->stream, "%s@+", reg_names[val + 8]); break; case '-': - (*info->fprintf_func) - (info->stream, "%s@-", - reg_names[fetch_arg (buffer, place, 3, info) + 8]); + FETCH_ARG (3, val); + (*info->fprintf_func) (info->stream, "%s@-", reg_names[val + 8]); break; case 'k': if (place == 'k') - (*info->fprintf_func) - (info->stream, "{%s}", - reg_names[fetch_arg (buffer, place, 3, info)]); + { + FETCH_ARG (3, val); + (*info->fprintf_func) (info->stream, "{%s}", reg_names[val]); + } else if (place == 'C') { - val = fetch_arg (buffer, place, 7, info); + FETCH_ARG (7, val); if (val > 63) /* This is a signed constant. */ val -= 128; (*info->fprintf_func) (info->stream, "{#%d}", val); } else - return -2; + return -1; break; case '#': case '^': p1 = buffer + (*d == '#' ? 2 : 4); if (place == 's') - val = fetch_arg (buffer, place, 4, info); + FETCH_ARG (4, val); else if (place == 'C') - val = fetch_arg (buffer, place, 7, info); + FETCH_ARG (7, val); else if (place == '8') - val = fetch_arg (buffer, place, 3, info); + FETCH_ARG (3, val); else if (place == '3') - val = fetch_arg (buffer, place, 8, info); + FETCH_ARG (8, val); else if (place == 'b') - val = NEXTBYTE (p1); + NEXTBYTE (p1, val); else if (place == 'w' || place == 'W') - val = NEXTWORD (p1); + NEXTWORD (p1, val, -3); else if (place == 'l') - val = NEXTLONG (p1); + NEXTLONG (p1, val, -3); else return -2; + (*info->fprintf_func) (info->stream, "#%d", val); break; case 'B': if (place == 'b') - disp = NEXTBYTE (p); + NEXTBYTE (p, disp); else if (place == 'B') disp = COERCE_SIGNED_CHAR (buffer[1]); else if (place == 'w' || place == 'W') - disp = NEXTWORD (p); + NEXTWORD (p, disp, -3); else if (place == 'l' || place == 'L' || place == 'C') - disp = NEXTLONG (p); + NEXTLONG (p, disp, -3); else if (place == 'g') { - disp = NEXTBYTE (buffer); + NEXTBYTE (buffer, disp); if (disp == 0) - disp = NEXTWORD (p); + NEXTWORD (p, disp, -3); else if (disp == -1) - disp = NEXTLONG (p); + NEXTLONG (p, disp, -3); } else if (place == 'c') { if (buffer[1] & 0x40) /* If bit six is one, long offset. */ - disp = NEXTLONG (p); + NEXTLONG (p, disp, -3); else - disp = NEXTWORD (p); + NEXTWORD (p, disp, -3); } else return -2; @@ -822,29 +896,32 @@ break; case 'd': - val = NEXTWORD (p); - (*info->fprintf_func) - (info->stream, "%s@(%d)", - reg_names[fetch_arg (buffer, place, 3, info) + 8], val); - break; + { + int val1; + + NEXTWORD (p, val, -3); + FETCH_ARG (3, val1); + (*info->fprintf_func) (info->stream, "%s@(%d)", reg_names[val1 + 8], val); + break; + } case 's': - (*info->fprintf_func) (info->stream, "%s", - fpcr_names[fetch_arg (buffer, place, 3, info)]); + FETCH_ARG (3, val); + (*info->fprintf_func) (info->stream, "%s", fpcr_names[val]); break; case 'e': - val = fetch_arg(buffer, place, 2, info); + FETCH_ARG (2, val); (*info->fprintf_func) (info->stream, "%%acc%d", val); break; case 'g': - val = fetch_arg(buffer, place, 1, info); - (*info->fprintf_func) (info->stream, "%%accext%s", val==0 ? "01" : "23"); + FETCH_ARG (1, val); + (*info->fprintf_func) (info->stream, "%%accext%s", val == 0 ? "01" : "23"); break; case 'i': - val = fetch_arg(buffer, place, 2, info); + FETCH_ARG (2, val); if (val == 1) (*info->fprintf_func) (info->stream, "<<"); else if (val == 3) @@ -856,7 +933,8 @@ case 'I': /* Get coprocessor ID... */ val = fetch_arg (buffer, 'd', 3, info); - + if (val < 0) + return -3; if (val != 1) /* Unusual coprocessor ID? */ (*info->fprintf_func) (info->stream, "(cpid=%d) ", val); break; @@ -888,10 +966,16 @@ if (place == 'd') { val = fetch_arg (buffer, 'x', 6, info); + if (val < 0) + return -3; val = ((val & 7) << 3) + ((val >> 3) & 7); } else - val = fetch_arg (buffer, 's', 6, info); + { + val = fetch_arg (buffer, 's', 6, info); + if (val < 0) + return -3; + } /* If the is invalid for *d, then reject this match. */ if (!m68k_valid_ea (*d, val)) @@ -923,29 +1007,31 @@ break; case 5: - val = NEXTWORD (p); + NEXTWORD (p, val, -3); (*info->fprintf_func) (info->stream, "%s@(%d)", regname, val); break; case 6: p = print_indexed (regno, p, addr, info); + if (p == NULL) + return -3; break; case 7: switch (val & 7) { case 0: - val = NEXTWORD (p); + NEXTWORD (p, val, -3); (*info->print_address_func) (val, info); break; case 1: - uval = NEXTULONG (p); + NEXTULONG (p, uval); (*info->print_address_func) (uval, info); break; case 2: - val = NEXTWORD (p); + NEXTWORD (p, val, -3); (*info->fprintf_func) (info->stream, "%%pc@("); (*info->print_address_func) (addr + val, info); (*info->fprintf_func) (info->stream, ")"); @@ -953,6 +1039,8 @@ case 3: p = print_indexed (-1, p, addr, info); + if (p == NULL) + return -3; break; case 4: @@ -960,17 +1048,17 @@ switch (place) { case 'b': - val = NEXTBYTE (p); + NEXTBYTE (p, val); flt_p = 0; break; case 'w': - val = NEXTWORD (p); + NEXTWORD (p, val, -3); flt_p = 0; break; case 'l': - val = NEXTLONG (p); + NEXTLONG (p, val, -3); flt_p = 0; break; @@ -987,7 +1075,7 @@ break; case 'p': - flval = NEXTPACKED (p); + NEXTPACKED (p, flval); break; default: @@ -1009,7 +1097,7 @@ mask bit and if set, add a '&' to the arg. */ if (place == '/') { - val = fetch_arg (buffer, place, 1, info); + FETCH_ARG (1, val); if (val) info->fprintf_func (info->stream, "&"); } @@ -1021,7 +1109,7 @@ { char doneany; p1 = buffer + 2; - val = NEXTWORD (p1); + NEXTWORD (p1, val, -3); /* Move the pointer ahead if this point is farther ahead than the last. */ p = p1 > p ? p1 : p; @@ -1062,7 +1150,8 @@ { /* `fmovem' insn. */ char doneany; - val = fetch_arg (buffer, place, 8, info); + + FETCH_ARG (8, val); if (val == 0) { (*info->fprintf_func) (info->stream, "#0"); @@ -1096,10 +1185,9 @@ } else if (place == '8') { + FETCH_ARG (3, val); /* fmoveml for FP status registers. */ - (*info->fprintf_func) (info->stream, "%s", - fpcr_names[fetch_arg (buffer, place, 3, - info)]); + (*info->fprintf_func) (info->stream, "%s", fpcr_names[val]); } else return -2; @@ -1115,9 +1203,10 @@ case '2': case '3': { - int val = fetch_arg (buffer, place, 5, info); + int val; char *name = 0; + FETCH_ARG (5, val); switch (val) { case 2: name = "%tt0"; break; @@ -1152,8 +1241,9 @@ case 'f': { - int fc = fetch_arg (buffer, place, 5, info); + int fc; + FETCH_ARG (5, fc); if (fc == 1) (*info->fprintf_func) (info->stream, "%%dfc"); else if (fc == 0) @@ -1170,8 +1260,9 @@ case 't': { - int level = fetch_arg (buffer, place, 3, info); + int level; + FETCH_ARG (3, level); (*info->fprintf_func) (info->stream, "%d", level); } break; @@ -1179,8 +1270,9 @@ case 'u': { short is_upper = 0; - int reg = fetch_arg (buffer, place, 5, info); + int reg; + FETCH_ARG (5, reg); if (reg & 0x10) { is_upper = 1; @@ -1303,7 +1395,7 @@ if (eaten >= 0) p += eaten; - else if (eaten == -1) + else if (eaten == -1 || eaten == -3) { info->fprintf_func = save_printer; info->print_address_func = save_print_address; @@ -1318,7 +1410,7 @@ info->fprintf_func (info->stream, /* xgettext:c-format */ _("\n"), - best->name, best->args); + best->name, best->args); return 2; } } @@ -1439,6 +1531,8 @@ if (d[0] == 's' && d[1] == '8') { val = fetch_arg (buffer, d[1], 3, info); + if (val < 0) + return 0; if ((val & (val - 1)) != 0) break; } @@ -1479,13 +1573,7 @@ bfd_byte *buffer = priv.the_buffer; - /* Save these printing functions in case we need to restore them - later. */ - fprintf_ftype save_printer = info->fprintf_func; - void (* save_print_address) (bfd_vma, struct disassemble_info *) - = info->print_address_func; - - info->private_data = (PTR) &priv; + info->private_data = & priv; /* Tell objdump to use two bytes per chunk and six bytes per line for displaying raw data. */ info->bytes_per_chunk = 2; @@ -1494,49 +1582,23 @@ priv.max_fetched = priv.the_buffer; priv.insn_start = memaddr; - if (setjmp (priv.bailout) != 0) - { - /* longjmp may be called while these printing functions are - temporarily replaced with dummy functions. Restore them - before we leave. - - Admittedly, this save-and-restore operation is somewhat ugly - in that we are exposing the fact that match_insn_m68k - temporarily replaces insn->fprintf_func and - insn->print_address_func. Perhaps, a real fix is to report a - FETCH_DATA failure with a return value of some sort, without - using setjmp/longjmp. A better fix may be to teach the m68k - disassembler do its job without temporarily replacing - insn->fprintf_func and insn->print_address_func, but that's a - task for another day. */ - info->fprintf_func = save_printer; - info->print_address_func = save_print_address; - - /* Error return. */ - return -1; - } - arch_mask = bfd_m68k_mach_to_features (info->mach); if (!arch_mask) { /* First try printing an m680x0 instruction. Try printing a Coldfire one if that fails. */ val = m68k_scan_mask (memaddr, info, m68k_mask); - if (val) - return val; - - val = m68k_scan_mask (memaddr, info, mcf_mask); - if (val) - return val; + if (val == 0) + val = m68k_scan_mask (memaddr, info, mcf_mask); } else { val = m68k_scan_mask (memaddr, info, arch_mask); - if (val) - return val; } - /* Handle undefined instructions. */ - info->fprintf_func (info->stream, "0%o", (buffer[0] << 8) + buffer[1]); - return 2; + if (val == 0) + /* Handle undefined instructions. */ + info->fprintf_func (info->stream, "0%o", (buffer[0] << 8) + buffer[1]); + + return val ? val : 2; } diff -Naur binutils-2.19.orig/opcodes/ppc-opc.c binutils-2.19/opcodes/ppc-opc.c --- binutils-2.19.orig/opcodes/ppc-opc.c 2008-08-14 06:56:00.000000000 -0700 +++ binutils-2.19/opcodes/ppc-opc.c 2008-11-27 02:51:53.000000000 -0800 @@ -1281,10 +1281,10 @@ /* mfsprg can use 260..263 and 272..279. mtsprg only uses spr 272..279 If not BOOKE or 405, then both use only 272..275. */ - if (val <= 3 - || (val < 0x10 && (insn & 0x100) != 0) - || (val - 0x10 > 3 - && (dialect & (PPC_OPCODE_BOOKE | PPC_OPCODE_403)) == 0)) + if ((val - 0x10 > 3 && (dialect & (PPC_OPCODE_BOOKE | PPC_OPCODE_405)) == 0) + || (val - 0x10 > 7 && (insn & 0x100) != 0) + || val <= 3 + || (val & 8) != 0) *invalid = 1; return val & 7; }