From c29cc2b55bcf0f0d344d14e15aec26dedb38121e Mon Sep 17 00:00:00 2001
From: nobody <>
Date: Sun, 16 Apr 2006 11:53:01 +0000
Subject: [PATCH] This commit was manufactured by cvs2svn to create branch
 'binutils- 2_17-branch'.

Sprout from binutils-csl-2_17-branch 2006-03-20 15:38:03 UTC nobody 'This commit was manufactured by cvs2svn to create branch 'binutils-csl-'
Cherrypick from master 2006-04-16 11:53:00 UTC Nick Clifton <nickc@redhat.com> 'Skip ELF specific tests on non-ELF ARM targets':
    ChangeLog
    Makefile.def
    Makefile.in
    Makefile.tpl
    bfd/ChangeLog
    bfd/Makefile.am
    bfd/Makefile.in
    bfd/bfd-in2.h
    bfd/config.bfd
    bfd/configure
    bfd/configure.in
    bfd/cpu-m68k.c
    bfd/doc/ChangeLog
    bfd/doc/Makefile.am
    bfd/doc/Makefile.in
    bfd/elf32-bfin.c
    bfd/elf32-i386.c
    bfd/elf32-m32c.c
    bfd/elf32-m68k.c
    bfd/elf32-mips.c
    bfd/elf32-sparc.c
    bfd/elf32-xtensa.c
    bfd/elf64-hppa.c
    bfd/elf64-x86-64.c
    bfd/elflink.c
    bfd/elfxx-ia64.c
    bfd/elfxx-mips.c
    bfd/elfxx-mips.h
    bfd/elfxx-sparc.c
    bfd/elfxx-sparc.h
    bfd/libbfd.h
    bfd/libcoff.h
    bfd/po/Make-in
    bfd/reloc.c
    bfd/targets.c
    bfd/version.h
    binutils/BRANCHES
    binutils/ChangeLog
    binutils/MAINTAINERS
    binutils/Makefile.am
    binutils/Makefile.in
    binutils/addr2line.c
    binutils/configure
    binutils/configure.in
    binutils/doc/Makefile.am
    binutils/doc/Makefile.in
    binutils/doc/binutils.texi
    binutils/objdump.c
    binutils/po/Make-in
    binutils/resbin.c
    binutils/testsuite/ChangeLog
    binutils/testsuite/lib/utils-lib.exp
    configure
    configure.in
    cpu/ChangeLog
    cpu/m32c.opc
    etc/ChangeLog
    etc/Makefile.in
    etc/configure
    etc/configure.in
    etc/configure.texi
    gas/ChangeLog
    gas/Makefile.am
    gas/Makefile.in
    gas/config/bfin-defs.h
    gas/config/bfin-lex.l
    gas/config/bfin-parse.y
    gas/config/tc-arm.c
    gas/config/tc-avr.c
    gas/config/tc-bfin.c
    gas/config/tc-i386.c
    gas/config/tc-m68k.c
    gas/config/tc-mips.c
    gas/config/tc-mips.h
    gas/config/tc-sparc.c
    gas/config/tc-xtensa.c
    gas/config/tc-z80.c
    gas/config/tc-z80.h
    gas/configure
    gas/configure.in
    gas/configure.tgt
    gas/doc/Makefile.am
    gas/doc/Makefile.in
    gas/expr.c
    gas/frags.c
    gas/frags.h
    gas/po/Make-in
    gas/testsuite/ChangeLog
    gas/testsuite/gas/arm/arch7.d
    gas/testsuite/gas/arm/blx-local.d
    gas/testsuite/gas/arm/blx-local.s
    gas/testsuite/gas/arm/svc.d
    gas/testsuite/gas/arm/thumb2_bcond.d
    gas/testsuite/gas/arm/thumb2_it_bad.d
    gas/testsuite/gas/arm/thumb2_pool.d
    gas/testsuite/gas/arm/thumb2_pool.s
    gas/testsuite/gas/arm/thumb32.d
    gas/testsuite/gas/i386/reloc64.d
    gas/testsuite/gas/i386/reloc64.l
    gas/testsuite/gas/i386/reloc64.s
    gas/testsuite/gas/i386/rep.d
    gas/testsuite/gas/i386/rep.s
    gas/testsuite/gas/mips/mips.exp
    gas/testsuite/gas/mips/vxworks1-xgot.d
    gas/testsuite/gas/mips/vxworks1.d
    gas/testsuite/gas/mips/vxworks1.s
    gas/testsuite/gas/sparc/sparc.exp
    gas/testsuite/gas/sparc/vxworks-pic.d
    gas/testsuite/gas/sparc/vxworks-pic.s
    gprof/ChangeLog
    gprof/Makefile.am
    gprof/Makefile.in
    gprof/configure
    gprof/configure.in
    gprof/corefile.c
    gprof/po/Make-in
    include/ChangeLog
    include/bfdlink.h
    include/elf/ChangeLog
    include/elf/bfin.h
    include/elf/mips.h
    include/elf/x86-64.h
    include/libiberty.h
    include/opcode/ChangeLog
    include/opcode/avr.h
    include/opcode/m68k.h
    intl/ChangeLog
    intl/Makefile.in
    ld/ChangeLog
    ld/Makefile.am
    ld/Makefile.in
    ld/NEWS
    ld/configure
    ld/configure.in
    ld/configure.tgt
    ld/deffilep.y
    ld/elf-hints-local.h
    ld/emulparams/bfin.sh
    ld/emulparams/elf32_sparc_vxworks.sh
    ld/emulparams/elf32bfinfd.sh
    ld/emulparams/elf32ebmipvxworks.sh
    ld/emulparams/elf32elmipvxworks.sh
    ld/emultempl/elf32.em
    ld/emultempl/ia64elf.em
    ld/emultempl/xtensaelf.em
    ld/genscripts.sh
    ld/ld.texinfo
    ld/ldlang.c
    ld/ldmain.c
    ld/ldmisc.c
    ld/po/Make-in
    ld/po/ld.pot
    ld/testsuite/ChangeLog
    ld/testsuite/ld-m68k/m68k.exp
    ld/testsuite/ld-m68k/merge-error-1a.d
    ld/testsuite/ld-m68k/merge-error-1a.s
    ld/testsuite/ld-m68k/merge-error-1b.d
    ld/testsuite/ld-m68k/merge-error-1b.s
    ld/testsuite/ld-m68k/merge-error-1c.d
    ld/testsuite/ld-m68k/merge-error-1d.d
    ld/testsuite/ld-m68k/merge-error-1e.d
    ld/testsuite/ld-m68k/merge-ok-1a.d
    ld/testsuite/ld-m68k/merge-ok-1b.d
    ld/testsuite/ld-mips-elf/mips-elf.exp
    ld/testsuite/ld-mips-elf/tls-hidden3.d
    ld/testsuite/ld-mips-elf/tls-hidden3.got
    ld/testsuite/ld-mips-elf/tls-hidden3.ld
    ld/testsuite/ld-mips-elf/tls-hidden3.r
    ld/testsuite/ld-mips-elf/tls-hidden3a.s
    ld/testsuite/ld-mips-elf/tls-hidden3b.s
    ld/testsuite/ld-mips-elf/tls-hidden4.got
    ld/testsuite/ld-mips-elf/tls-hidden4.r
    ld/testsuite/ld-mips-elf/tls-hidden4a.s
    ld/testsuite/ld-mips-elf/tls-hidden4b.s
    ld/testsuite/ld-mips-elf/vxworks1-lib.dd
    ld/testsuite/ld-mips-elf/vxworks1-lib.nd
    ld/testsuite/ld-mips-elf/vxworks1-lib.rd
    ld/testsuite/ld-mips-elf/vxworks1-lib.s
    ld/testsuite/ld-mips-elf/vxworks1-static.d
    ld/testsuite/ld-mips-elf/vxworks1.dd
    ld/testsuite/ld-mips-elf/vxworks1.ld
    ld/testsuite/ld-mips-elf/vxworks1.rd
    ld/testsuite/ld-mips-elf/vxworks1.s
    ld/testsuite/ld-mips-elf/vxworks2-static.sd
    ld/testsuite/ld-mips-elf/vxworks2.s
    ld/testsuite/ld-mips-elf/vxworks2.sd
    ld/testsuite/ld-sparc/sparc.exp
    ld/testsuite/ld-sparc/vxworks1-lib.dd
    ld/testsuite/ld-sparc/vxworks1-lib.nd
    ld/testsuite/ld-sparc/vxworks1-lib.rd
    ld/testsuite/ld-sparc/vxworks1-lib.s
    ld/testsuite/ld-sparc/vxworks1-static.d
    ld/testsuite/ld-sparc/vxworks1.dd
    ld/testsuite/ld-sparc/vxworks1.ld
    ld/testsuite/ld-sparc/vxworks1.rd
    ld/testsuite/ld-sparc/vxworks1.s
    ld/testsuite/ld-sparc/vxworks2-static.sd
    ld/testsuite/ld-sparc/vxworks2.s
    ld/testsuite/ld-sparc/vxworks2.sd
    ld/testsuite/lib/ld-lib.exp
    libiberty/ChangeLog
    libiberty/Makefile.in
    libiberty/configure
    libiberty/configure.ac
    libiberty/functions.texi
    libiberty/pex-common.c
    libiberty/pex-common.h
    libiberty/pex-djgpp.c
    libiberty/pex-msdos.c
    libiberty/pex-unix.c
    libiberty/pex-win32.c
    libiberty/pexecute.txh
    libiberty/testsuite/Makefile.in
    opcodes/ChangeLog
    opcodes/Makefile.am
    opcodes/Makefile.in
    opcodes/avr-dis.c
    opcodes/m32c-asm.c
    opcodes/pdp11-opc.c
    opcodes/po/Make-in
    opcodes/po/vi.po
Delete:
    compile
    contrib/ChangeLog
    contrib/texi2pod.pl
    djunpack.bat
    ld/emultempl/bfin.em
---
 ChangeLog                                   |   19 +
 Makefile.def                                |    6 +
 Makefile.in                                 | 2506 ++++++++-
 Makefile.tpl                                |    7 +-
 bfd/ChangeLog                               |  423 ++
 bfd/Makefile.am                             |   63 +-
 bfd/Makefile.in                             |   64 +-
 bfd/bfd-in2.h                               |   26 +
 bfd/config.bfd                              |   17 +-
 bfd/configure                               |   44 +-
 bfd/configure.in                            |   40 +-
 bfd/cpu-m68k.c                              |   11 +-
 bfd/doc/ChangeLog                           |    8 +-
 bfd/doc/Makefile.am                         |   25 +
 bfd/doc/Makefile.in                         |   23 +
 bfd/elf32-bfin.c                            | 5126 ++++++++++++++-----
 bfd/elf32-i386.c                            |   39 +-
 bfd/elf32-m32c.c                            |   16 +
 bfd/elf32-m68k.c                            |   94 +-
 bfd/elf32-mips.c                            |  149 +-
 bfd/elf32-sparc.c                           |   66 +
 bfd/elf32-xtensa.c                          |   43 +-
 bfd/elf64-hppa.c                            |   66 +-
 bfd/elf64-x86-64.c                          |  119 +-
 bfd/elflink.c                               |   52 +-
 bfd/elfxx-ia64.c                            |  649 ++-
 bfd/elfxx-mips.c                            | 1482 +++++-
 bfd/elfxx-mips.h                            |    7 +
 bfd/elfxx-sparc.c                           |  440 +-
 bfd/elfxx-sparc.h                           |   11 +
 bfd/libbfd.h                                |   24 +-
 bfd/libcoff.h                               |    2 +-
 bfd/po/Make-in                              |    3 +-
 bfd/reloc.c                                 |   48 +
 bfd/targets.c                               |    8 +
 bfd/version.h                               |    2 +-
 binutils/BRANCHES                           |    4 +-
 binutils/ChangeLog                          |   41 +
 binutils/MAINTAINERS                        |    2 +-
 binutils/Makefile.am                        |   29 +
 binutils/Makefile.in                        |   32 +
 binutils/addr2line.c                        |   67 +-
 binutils/configure                          |   10 +-
 binutils/configure.in                       |    5 +
 binutils/doc/Makefile.am                    |   21 +
 binutils/doc/Makefile.in                    |   23 +
 binutils/doc/binutils.texi                  |   18 +-
 binutils/objdump.c                          |    2 +-
 binutils/po/Make-in                         |    3 +-
 binutils/resbin.c                           |   42 +-
 binutils/testsuite/ChangeLog                |    4 +
 binutils/testsuite/lib/utils-lib.exp        |    6 +
 compile                                     |  142 -
 configure                                   |  358 +-
 configure.in                                |   24 +-
 contrib/ChangeLog                           |    7 -
 contrib/texi2pod.pl                         |  431 --
 cpu/ChangeLog                               |   14 +
 cpu/m32c.opc                                |   51 +-
 djunpack.bat                                |   52 -
 etc/ChangeLog                               |    8 +
 etc/Makefile.in                             |   17 +
 etc/configure                               | 2278 ++++++--
 etc/configure.in                            |    5 +
 etc/configure.texi                          |    4 +-
 gas/ChangeLog                               |  200 +
 gas/Makefile.am                             |   41 +-
 gas/Makefile.in                             |   44 +-
 gas/config/bfin-defs.h                      |    1 +
 gas/config/bfin-lex.l                       |    2 +
 gas/config/bfin-parse.y                     |   26 +-
 gas/config/tc-arm.c                         |   59 +-
 gas/config/tc-avr.c                         |   32 +-
 gas/config/tc-bfin.c                        |  192 +-
 gas/config/tc-i386.c                        |  102 +-
 gas/config/tc-m68k.c                        |  598 +--
 gas/config/tc-mips.c                        |   92 +-
 gas/config/tc-mips.h                        |    3 +
 gas/config/tc-sparc.c                       |   40 +-
 gas/config/tc-xtensa.c                      |  164 +-
 gas/config/tc-z80.c                         |   64 -
 gas/config/tc-z80.h                         |    2 -
 gas/configure                               |   11 +-
 gas/configure.in                            |    7 +-
 gas/configure.tgt                           |    2 +-
 gas/doc/Makefile.am                         |   21 +
 gas/doc/Makefile.in                         |   23 +
 gas/expr.c                                  |   18 +-
 gas/frags.c                                 |   55 +-
 gas/frags.h                                 |    4 +-
 gas/po/Make-in                              |    3 +-
 gas/testsuite/ChangeLog                     |   38 +
 gas/testsuite/gas/arm/arch7.d               |    1 +
 gas/testsuite/gas/arm/blx-local.d           |   15 +
 gas/testsuite/gas/arm/blx-local.s           |   16 +
 gas/testsuite/gas/arm/svc.d                 |    1 +
 gas/testsuite/gas/arm/thumb2_bcond.d        |    1 +
 gas/testsuite/gas/arm/thumb2_it_bad.d       |    1 +
 gas/testsuite/gas/arm/thumb2_pool.d         |   15 +
 gas/testsuite/gas/arm/thumb2_pool.s         |   13 +
 gas/testsuite/gas/arm/thumb32.d             |    4 +-
 gas/testsuite/gas/i386/reloc64.d            |    5 +-
 gas/testsuite/gas/i386/reloc64.l            |    3 -
 gas/testsuite/gas/i386/reloc64.s            |    6 +-
 gas/testsuite/gas/i386/rep.d                |    1 +
 gas/testsuite/gas/i386/rep.s                |    2 +
 gas/testsuite/gas/mips/mips.exp             |   12 +-
 gas/testsuite/gas/mips/vxworks1-xgot.d      |  102 +
 gas/testsuite/gas/mips/vxworks1.d           |   71 +
 gas/testsuite/gas/mips/vxworks1.s           |   16 +
 gas/testsuite/gas/sparc/sparc.exp           |    6 +-
 gas/testsuite/gas/sparc/vxworks-pic.d       |   27 +
 gas/testsuite/gas/sparc/vxworks-pic.s       |   11 +
 gprof/ChangeLog                             |   14 +
 gprof/Makefile.am                           |   48 +
 gprof/Makefile.in                           |   50 +
 gprof/configure                             |  129 +-
 gprof/configure.in                          |    5 +
 gprof/corefile.c                            |    2 +-
 gprof/po/Make-in                            |    3 +-
 include/ChangeLog                           |   19 +
 include/bfdlink.h                           |    9 +-
 include/elf/ChangeLog                       |    9 +
 include/elf/bfin.h                          |   20 +
 include/elf/mips.h                          |    3 +
 include/elf/x86-64.h                        |   11 +-
 include/libiberty.h                         |   41 +
 include/opcode/ChangeLog                    |   12 +
 include/opcode/avr.h                        |   27 +-
 include/opcode/m68k.h                       |   38 -
 intl/ChangeLog                              |    5 +
 intl/Makefile.in                            |    6 +-
 ld/ChangeLog                                |  114 +
 ld/Makefile.am                              |   77 +-
 ld/Makefile.in                              |   81 +-
 ld/NEWS                                     |    6 +-
 ld/configure                                |   12 +-
 ld/configure.in                             |    7 +-
 ld/configure.tgt                            |   12 +-
 ld/deffilep.y                               |   40 +-
 ld/elf-hints-local.h                        |   44 +
 ld/emulparams/bfin.sh                       |    1 -
 ld/emulparams/elf32_sparc_vxworks.sh        |    4 +
 ld/emulparams/elf32bfinfd.sh                |   16 +
 ld/emulparams/elf32ebmipvxworks.sh          |   11 +
 ld/emulparams/elf32elmipvxworks.sh          |   11 +
 ld/emultempl/bfin.em                        |  174 -
 ld/emultempl/elf32.em                       |   89 +-
 ld/emultempl/ia64elf.em                     |    2 +-
 ld/emultempl/xtensaelf.em                   |  145 +-
 ld/genscripts.sh                            |   23 +-
 ld/ld.texinfo                               |    5 +-
 ld/ldlang.c                                 |  110 +-
 ld/ldmain.c                                 |    2 +-
 ld/ldmisc.c                                 |   21 +-
 ld/po/Make-in                               |    3 +-
 ld/po/ld.pot                                |  321 +-
 ld/testsuite/ChangeLog                      |   40 +
 ld/testsuite/ld-m68k/m68k.exp               |    8 +
 ld/testsuite/ld-m68k/merge-error-1a.d       |    4 +
 ld/testsuite/ld-m68k/merge-error-1a.s       |    1 +
 ld/testsuite/ld-m68k/merge-error-1b.d       |    4 +
 ld/testsuite/ld-m68k/merge-error-1b.s       |    1 +
 ld/testsuite/ld-m68k/merge-error-1c.d       |    4 +
 ld/testsuite/ld-m68k/merge-error-1d.d       |    4 +
 ld/testsuite/ld-m68k/merge-error-1e.d       |    4 +
 ld/testsuite/ld-m68k/merge-ok-1a.d          |    6 +
 ld/testsuite/ld-m68k/merge-ok-1b.d          |    6 +
 ld/testsuite/ld-mips-elf/mips-elf.exp       |   39 +
 ld/testsuite/ld-mips-elf/tls-hidden3.d      |   24 +
 ld/testsuite/ld-mips-elf/tls-hidden3.got    |   24 +
 ld/testsuite/ld-mips-elf/tls-hidden3.ld     |   31 +
 ld/testsuite/ld-mips-elf/tls-hidden3.r      |   13 +
 ld/testsuite/ld-mips-elf/tls-hidden3a.s     |   10 +
 ld/testsuite/ld-mips-elf/tls-hidden3b.s     |   18 +
 ld/testsuite/ld-mips-elf/tls-hidden4.got    |   28 +
 ld/testsuite/ld-mips-elf/tls-hidden4.r      |   19 +
 ld/testsuite/ld-mips-elf/tls-hidden4a.s     |   18 +
 ld/testsuite/ld-mips-elf/tls-hidden4b.s     |   27 +
 ld/testsuite/ld-mips-elf/vxworks1-lib.dd    |   50 +
 ld/testsuite/ld-mips-elf/vxworks1-lib.nd    |    9 +
 ld/testsuite/ld-mips-elf/vxworks1-lib.rd    |   18 +
 ld/testsuite/ld-mips-elf/vxworks1-lib.s     |   52 +
 ld/testsuite/ld-mips-elf/vxworks1-static.d  |    4 +
 ld/testsuite/ld-mips-elf/vxworks1.dd        |   51 +
 ld/testsuite/ld-mips-elf/vxworks1.ld        |   32 +
 ld/testsuite/ld-mips-elf/vxworks1.rd        |   32 +
 ld/testsuite/ld-mips-elf/vxworks1.s         |   27 +
 ld/testsuite/ld-mips-elf/vxworks2-static.sd |    9 +
 ld/testsuite/ld-mips-elf/vxworks2.s         |    5 +
 ld/testsuite/ld-mips-elf/vxworks2.sd        |   13 +
 ld/testsuite/ld-sparc/sparc.exp             |   27 +
 ld/testsuite/ld-sparc/vxworks1-lib.dd       |   45 +
 ld/testsuite/ld-sparc/vxworks1-lib.nd       |    9 +
 ld/testsuite/ld-sparc/vxworks1-lib.rd       |   12 +
 ld/testsuite/ld-sparc/vxworks1-lib.s        |   44 +
 ld/testsuite/ld-sparc/vxworks1-static.d     |    4 +
 ld/testsuite/ld-sparc/vxworks1.dd           |   52 +
 ld/testsuite/ld-sparc/vxworks1.ld           |   30 +
 ld/testsuite/ld-sparc/vxworks1.rd           |   22 +
 ld/testsuite/ld-sparc/vxworks1.s            |   25 +
 ld/testsuite/ld-sparc/vxworks2-static.sd    |    9 +
 ld/testsuite/ld-sparc/vxworks2.s            |    6 +
 ld/testsuite/ld-sparc/vxworks2.sd           |   13 +
 ld/testsuite/lib/ld-lib.exp                 |   66 +-
 libiberty/ChangeLog                         |   48 +
 libiberty/Makefile.in                       |   59 +-
 libiberty/configure                         |    9 +-
 libiberty/configure.ac                      |    5 +
 libiberty/functions.texi                    |   81 +-
 libiberty/pex-common.c                      |  211 +-
 libiberty/pex-common.h                      |    7 +
 libiberty/pex-djgpp.c                       |    1 +
 libiberty/pex-msdos.c                       |    1 +
 libiberty/pex-unix.c                        |   11 +
 libiberty/pex-win32.c                       |  594 ++-
 libiberty/pexecute.txh                      |   62 +
 libiberty/testsuite/Makefile.in             |    4 +-
 opcodes/ChangeLog                           |   24 +
 opcodes/Makefile.am                         |    3 +
 opcodes/Makefile.in                         |    3 +
 opcodes/avr-dis.c                           |    7 +-
 opcodes/m32c-asm.c                          |   51 +-
 opcodes/pdp11-opc.c                         |    4 +-
 opcodes/po/Make-in                          |    3 +-
 opcodes/po/vi.po                            |  120 +-
 226 files changed, 17069 insertions(+), 4621 deletions(-)
 delete mode 100755 compile
 delete mode 100644 contrib/ChangeLog
 delete mode 100755 contrib/texi2pod.pl
 delete mode 100755 djunpack.bat
 create mode 100644 gas/testsuite/gas/arm/blx-local.d
 create mode 100644 gas/testsuite/gas/arm/blx-local.s
 create mode 100644 gas/testsuite/gas/arm/thumb2_pool.d
 create mode 100644 gas/testsuite/gas/arm/thumb2_pool.s
 create mode 100644 gas/testsuite/gas/mips/vxworks1-xgot.d
 create mode 100644 gas/testsuite/gas/mips/vxworks1.d
 create mode 100644 gas/testsuite/gas/mips/vxworks1.s
 create mode 100644 gas/testsuite/gas/sparc/vxworks-pic.d
 create mode 100644 gas/testsuite/gas/sparc/vxworks-pic.s
 create mode 100644 ld/elf-hints-local.h
 create mode 100644 ld/emulparams/elf32_sparc_vxworks.sh
 create mode 100644 ld/emulparams/elf32bfinfd.sh
 create mode 100644 ld/emulparams/elf32ebmipvxworks.sh
 create mode 100644 ld/emulparams/elf32elmipvxworks.sh
 delete mode 100644 ld/emultempl/bfin.em
 create mode 100644 ld/testsuite/ld-m68k/merge-error-1a.d
 create mode 100644 ld/testsuite/ld-m68k/merge-error-1a.s
 create mode 100644 ld/testsuite/ld-m68k/merge-error-1b.d
 create mode 100644 ld/testsuite/ld-m68k/merge-error-1b.s
 create mode 100644 ld/testsuite/ld-m68k/merge-error-1c.d
 create mode 100644 ld/testsuite/ld-m68k/merge-error-1d.d
 create mode 100644 ld/testsuite/ld-m68k/merge-error-1e.d
 create mode 100644 ld/testsuite/ld-m68k/merge-ok-1a.d
 create mode 100644 ld/testsuite/ld-m68k/merge-ok-1b.d
 create mode 100644 ld/testsuite/ld-mips-elf/tls-hidden3.d
 create mode 100644 ld/testsuite/ld-mips-elf/tls-hidden3.got
 create mode 100644 ld/testsuite/ld-mips-elf/tls-hidden3.ld
 create mode 100644 ld/testsuite/ld-mips-elf/tls-hidden3.r
 create mode 100644 ld/testsuite/ld-mips-elf/tls-hidden3a.s
 create mode 100644 ld/testsuite/ld-mips-elf/tls-hidden3b.s
 create mode 100644 ld/testsuite/ld-mips-elf/tls-hidden4.got
 create mode 100644 ld/testsuite/ld-mips-elf/tls-hidden4.r
 create mode 100644 ld/testsuite/ld-mips-elf/tls-hidden4a.s
 create mode 100644 ld/testsuite/ld-mips-elf/tls-hidden4b.s
 create mode 100644 ld/testsuite/ld-mips-elf/vxworks1-lib.dd
 create mode 100644 ld/testsuite/ld-mips-elf/vxworks1-lib.nd
 create mode 100644 ld/testsuite/ld-mips-elf/vxworks1-lib.rd
 create mode 100644 ld/testsuite/ld-mips-elf/vxworks1-lib.s
 create mode 100644 ld/testsuite/ld-mips-elf/vxworks1-static.d
 create mode 100644 ld/testsuite/ld-mips-elf/vxworks1.dd
 create mode 100644 ld/testsuite/ld-mips-elf/vxworks1.ld
 create mode 100644 ld/testsuite/ld-mips-elf/vxworks1.rd
 create mode 100644 ld/testsuite/ld-mips-elf/vxworks1.s
 create mode 100644 ld/testsuite/ld-mips-elf/vxworks2-static.sd
 create mode 100644 ld/testsuite/ld-mips-elf/vxworks2.s
 create mode 100644 ld/testsuite/ld-mips-elf/vxworks2.sd
 create mode 100644 ld/testsuite/ld-sparc/vxworks1-lib.dd
 create mode 100644 ld/testsuite/ld-sparc/vxworks1-lib.nd
 create mode 100644 ld/testsuite/ld-sparc/vxworks1-lib.rd
 create mode 100644 ld/testsuite/ld-sparc/vxworks1-lib.s
 create mode 100644 ld/testsuite/ld-sparc/vxworks1-static.d
 create mode 100644 ld/testsuite/ld-sparc/vxworks1.dd
 create mode 100644 ld/testsuite/ld-sparc/vxworks1.ld
 create mode 100644 ld/testsuite/ld-sparc/vxworks1.rd
 create mode 100644 ld/testsuite/ld-sparc/vxworks1.s
 create mode 100644 ld/testsuite/ld-sparc/vxworks2-static.sd
 create mode 100644 ld/testsuite/ld-sparc/vxworks2.s
 create mode 100644 ld/testsuite/ld-sparc/vxworks2.sd

diff --git a/ChangeLog b/ChangeLog
index c0126cd14da..6288a6e4f2e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2006-04-10  Ben Elliston  <bje@au.ibm.com>
+
+	* contrib: Remove directory.
+
+2006-04-06  Carlos O'Donell <carlos@codesourcery.com>
+
+	* Makefile.tpl: Add install-html target.
+	* Makefile.def: Add install-html target.
+	* Makefile.in: Regenerate.
+	* configure.in: Add --with-datarootdir, --with-docdir,
+	and --with-htmldir options.
+	* configure: Regenerate.
+
+2006-03-31  Ben Elliston  <bje@au.ibm.com>
+
+	PR binutils/1860
+	* configure.in: Require makeinfo 4.4 or higher.
+	* configure: Regenerate.
+
 2006-03-14  Paolo Bonzini  <bonzini@gnu.org>
 
 	* Makefile.in: Regenerate.
diff --git a/Makefile.def b/Makefile.def
index 3227a445602..4c58ab5a71f 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -155,6 +155,9 @@ recursive_targets = { make_target= TAGS;
 recursive_targets = { make_target= install-info; 
                       depend=configure;
                       depend=info; };
+recursive_targets = { make_target= install-html; 
+                      depend=configure;
+                      depend=html; };
 recursive_targets = { make_target= installcheck; 
                       depend=configure; };
 recursive_targets = { make_target= mostlyclean; };
@@ -172,7 +175,10 @@ flags_to_pass = { flag= bindir ; };
 flags_to_pass = { flag= datadir ; };
 flags_to_pass = { flag= exec_prefix ; };
 flags_to_pass = { flag= includedir ; };
+flags_to_pass = { flag= datarootdir ; };
+flags_to_pass = { flag= docdir ; };
 flags_to_pass = { flag= infodir ; };
+flags_to_pass = { flag= htmldir ; };
 flags_to_pass = { flag= libdir ; };
 flags_to_pass = { flag= libexecdir ; };
 flags_to_pass = { flag= lispdir ; };
diff --git a/Makefile.in b/Makefile.in
index eae74a72ec2..2d0da2e7c3c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -50,6 +50,9 @@ libdir = @libdir@
 includedir = @includedir@
 oldincludedir = @oldincludedir@
 infodir = @infodir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+htmldir = @htmldir@
 mandir = @mandir@
 man1dir = $(mandir)/man1
 man2dir = $(mandir)/man2
@@ -405,7 +408,10 @@ BASE_FLAGS_TO_PASS = \
 	"datadir=$(datadir)" \
 	"exec_prefix=$(exec_prefix)" \
 	"includedir=$(includedir)" \
+	"datarootdir=$(datarootdir)" \
+	"docdir=$(docdir)" \
 	"infodir=$(infodir)" \
+	"htmldir=$(htmldir)" \
 	"libdir=$(libdir)" \
 	"libexecdir=$(libexecdir)" \
 	"lispdir=$(lispdir)" \
@@ -1309,6 +1315,110 @@ install-info-target: maybe-install-info-target-rda
 install-info-target: maybe-install-info-target-libada
 install-info-target: maybe-install-info-target-libgomp
 
+.PHONY: do-install-html
+do-install-html:
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) install-html-host \
+	  install-html-target
+
+
+.PHONY: install-html-host
+
+install-html-host: maybe-install-html-ash
+install-html-host: maybe-install-html-autoconf
+install-html-host: maybe-install-html-automake
+install-html-host: maybe-install-html-bash
+install-html-host: maybe-install-html-bfd
+install-html-host: maybe-install-html-opcodes
+install-html-host: maybe-install-html-binutils
+install-html-host: maybe-install-html-bison
+install-html-host: maybe-install-html-byacc
+install-html-host: maybe-install-html-bzip2
+install-html-host: maybe-install-html-dejagnu
+install-html-host: maybe-install-html-diff
+install-html-host: maybe-install-html-dosutils
+install-html-host: maybe-install-html-etc
+install-html-host: maybe-install-html-fastjar
+install-html-host: maybe-install-html-fileutils
+install-html-host: maybe-install-html-findutils
+install-html-host: maybe-install-html-find
+install-html-host: maybe-install-html-fixincludes
+install-html-host: maybe-install-html-flex
+install-html-host: maybe-install-html-gas
+install-html-host: maybe-install-html-gcc
+install-html-host: maybe-install-html-gawk
+install-html-host: maybe-install-html-gettext
+install-html-host: maybe-install-html-gnuserv
+install-html-host: maybe-install-html-gprof
+install-html-host: maybe-install-html-gzip
+install-html-host: maybe-install-html-hello
+install-html-host: maybe-install-html-indent
+install-html-host: maybe-install-html-intl
+install-html-host: maybe-install-html-tcl
+install-html-host: maybe-install-html-itcl
+install-html-host: maybe-install-html-ld
+install-html-host: maybe-install-html-libcpp
+install-html-host: maybe-install-html-libdecnumber
+install-html-host: maybe-install-html-libgui
+install-html-host: maybe-install-html-libiberty
+install-html-host: maybe-install-html-libtool
+install-html-host: maybe-install-html-m4
+install-html-host: maybe-install-html-make
+install-html-host: maybe-install-html-mmalloc
+install-html-host: maybe-install-html-patch
+install-html-host: maybe-install-html-perl
+install-html-host: maybe-install-html-prms
+install-html-host: maybe-install-html-rcs
+install-html-host: maybe-install-html-readline
+install-html-host: maybe-install-html-release
+install-html-host: maybe-install-html-recode
+install-html-host: maybe-install-html-sed
+install-html-host: maybe-install-html-send-pr
+install-html-host: maybe-install-html-shellutils
+install-html-host: maybe-install-html-sid
+install-html-host: maybe-install-html-sim
+install-html-host: maybe-install-html-tar
+install-html-host: maybe-install-html-texinfo
+install-html-host: maybe-install-html-textutils
+install-html-host: maybe-install-html-time
+install-html-host: maybe-install-html-uudecode
+install-html-host: maybe-install-html-wdiff
+install-html-host: maybe-install-html-zip
+install-html-host: maybe-install-html-zlib
+install-html-host: maybe-install-html-gdb
+install-html-host: maybe-install-html-expect
+install-html-host: maybe-install-html-guile
+install-html-host: maybe-install-html-tk
+install-html-host: maybe-install-html-libtermcap
+install-html-host: maybe-install-html-utils
+install-html-host: maybe-install-html-gnattools
+
+.PHONY: install-html-target
+
+install-html-target: maybe-install-html-target-libstdc++-v3
+install-html-target: maybe-install-html-target-libmudflap
+install-html-target: maybe-install-html-target-libssp
+install-html-target: maybe-install-html-target-libgcc-math
+install-html-target: maybe-install-html-target-newlib
+install-html-target: maybe-install-html-target-libgfortran
+install-html-target: maybe-install-html-target-libobjc
+install-html-target: maybe-install-html-target-libtermcap
+install-html-target: maybe-install-html-target-winsup
+install-html-target: maybe-install-html-target-libgloss
+install-html-target: maybe-install-html-target-libiberty
+install-html-target: maybe-install-html-target-gperf
+install-html-target: maybe-install-html-target-examples
+install-html-target: maybe-install-html-target-libffi
+install-html-target: maybe-install-html-target-libjava
+install-html-target: maybe-install-html-target-zlib
+install-html-target: maybe-install-html-target-boehm-gc
+install-html-target: maybe-install-html-target-qthreads
+install-html-target: maybe-install-html-target-rda
+install-html-target: maybe-install-html-target-libada
+install-html-target: maybe-install-html-target-libgomp
+
 .PHONY: do-installcheck
 do-installcheck:
 	@: $(MAKE); $(unstage)
@@ -1832,7 +1942,7 @@ maintainer-clean-target: maybe-maintainer-clean-target-libgomp
 
 # Here are the targets which correspond to the do-X targets.
 
-.PHONY: info installcheck dvi html install-info
+.PHONY: info installcheck dvi html install-info install-html
 .PHONY: clean distclean mostlyclean maintainer-clean realclean
 .PHONY: local-clean local-distclean local-maintainer-clean
 info: do-info
@@ -1850,6 +1960,8 @@ install-info: do-install-info dir.info
 	  $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \
 	else true ; fi
 
+install-html: do-install-html
+
 local-clean:
 	-rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
 
@@ -2801,6 +2913,33 @@ install-info-ash: \
 
 @endif ash
 
+.PHONY: maybe-install-html-ash install-html-ash
+maybe-install-html-ash:
+@if ash
+maybe-install-html-ash: install-html-ash
+
+install-html-ash: \
+    configure-ash \
+    html-ash 
+	@: $(MAKE); $(unstage)
+	@[ -f ./ash/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in ash" ; \
+	(cd $(HOST_SUBDIR)/ash && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif ash
+
 .PHONY: maybe-installcheck-ash installcheck-ash
 maybe-installcheck-ash:
 @if ash
@@ -3138,6 +3277,33 @@ install-info-autoconf: \
 
 @endif autoconf
 
+.PHONY: maybe-install-html-autoconf install-html-autoconf
+maybe-install-html-autoconf:
+@if autoconf
+maybe-install-html-autoconf: install-html-autoconf
+
+install-html-autoconf: \
+    configure-autoconf \
+    html-autoconf 
+	@: $(MAKE); $(unstage)
+	@[ -f ./autoconf/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in autoconf" ; \
+	(cd $(HOST_SUBDIR)/autoconf && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif autoconf
+
 .PHONY: maybe-installcheck-autoconf installcheck-autoconf
 maybe-installcheck-autoconf:
 @if autoconf
@@ -3475,6 +3641,33 @@ install-info-automake: \
 
 @endif automake
 
+.PHONY: maybe-install-html-automake install-html-automake
+maybe-install-html-automake:
+@if automake
+maybe-install-html-automake: install-html-automake
+
+install-html-automake: \
+    configure-automake \
+    html-automake 
+	@: $(MAKE); $(unstage)
+	@[ -f ./automake/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in automake" ; \
+	(cd $(HOST_SUBDIR)/automake && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif automake
+
 .PHONY: maybe-installcheck-automake installcheck-automake
 maybe-installcheck-automake:
 @if automake
@@ -3812,6 +4005,33 @@ install-info-bash: \
 
 @endif bash
 
+.PHONY: maybe-install-html-bash install-html-bash
+maybe-install-html-bash:
+@if bash
+maybe-install-html-bash: install-html-bash
+
+install-html-bash: \
+    configure-bash \
+    html-bash 
+	@: $(MAKE); $(unstage)
+	@[ -f ./bash/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in bash" ; \
+	(cd $(HOST_SUBDIR)/bash && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif bash
+
 .PHONY: maybe-installcheck-bash installcheck-bash
 maybe-installcheck-bash:
 @if bash
@@ -4501,6 +4721,32 @@ install-info-bfd: \
 
 @endif bfd
 
+.PHONY: maybe-install-html-bfd install-html-bfd
+maybe-install-html-bfd:
+@if bfd
+maybe-install-html-bfd: install-html-bfd
+
+install-html-bfd: \
+    configure-bfd \
+    html-bfd 
+	@[ -f ./bfd/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in bfd" ; \
+	(cd $(HOST_SUBDIR)/bfd && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif bfd
+
 .PHONY: maybe-installcheck-bfd installcheck-bfd
 maybe-installcheck-bfd:
 @if bfd
@@ -5185,6 +5431,32 @@ install-info-opcodes: \
 
 @endif opcodes
 
+.PHONY: maybe-install-html-opcodes install-html-opcodes
+maybe-install-html-opcodes:
+@if opcodes
+maybe-install-html-opcodes: install-html-opcodes
+
+install-html-opcodes: \
+    configure-opcodes \
+    html-opcodes 
+	@[ -f ./opcodes/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in opcodes" ; \
+	(cd $(HOST_SUBDIR)/opcodes && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif opcodes
+
 .PHONY: maybe-installcheck-opcodes installcheck-opcodes
 maybe-installcheck-opcodes:
 @if opcodes
@@ -5869,6 +6141,32 @@ install-info-binutils: \
 
 @endif binutils
 
+.PHONY: maybe-install-html-binutils install-html-binutils
+maybe-install-html-binutils:
+@if binutils
+maybe-install-html-binutils: install-html-binutils
+
+install-html-binutils: \
+    configure-binutils \
+    html-binutils 
+	@[ -f ./binutils/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in binutils" ; \
+	(cd $(HOST_SUBDIR)/binutils && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif binutils
+
 .PHONY: maybe-installcheck-binutils installcheck-binutils
 maybe-installcheck-binutils:
 @if binutils
@@ -6204,6 +6502,33 @@ install-info-bison: \
 
 @endif bison
 
+.PHONY: maybe-install-html-bison install-html-bison
+maybe-install-html-bison:
+@if bison
+maybe-install-html-bison: install-html-bison
+
+install-html-bison: \
+    configure-bison \
+    html-bison 
+	@: $(MAKE); $(unstage)
+	@[ -f ./bison/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in bison" ; \
+	(cd $(HOST_SUBDIR)/bison && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif bison
+
 .PHONY: maybe-installcheck-bison installcheck-bison
 maybe-installcheck-bison:
 @if bison
@@ -6544,6 +6869,33 @@ install-info-byacc: \
 
 @endif byacc
 
+.PHONY: maybe-install-html-byacc install-html-byacc
+maybe-install-html-byacc:
+@if byacc
+maybe-install-html-byacc: install-html-byacc
+
+install-html-byacc: \
+    configure-byacc \
+    html-byacc 
+	@: $(MAKE); $(unstage)
+	@[ -f ./byacc/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in byacc" ; \
+	(cd $(HOST_SUBDIR)/byacc && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif byacc
+
 .PHONY: maybe-installcheck-byacc installcheck-byacc
 maybe-installcheck-byacc:
 @if byacc
@@ -6881,6 +7233,33 @@ install-info-bzip2: \
 
 @endif bzip2
 
+.PHONY: maybe-install-html-bzip2 install-html-bzip2
+maybe-install-html-bzip2:
+@if bzip2
+maybe-install-html-bzip2: install-html-bzip2
+
+install-html-bzip2: \
+    configure-bzip2 \
+    html-bzip2 
+	@: $(MAKE); $(unstage)
+	@[ -f ./bzip2/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in bzip2" ; \
+	(cd $(HOST_SUBDIR)/bzip2 && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif bzip2
+
 .PHONY: maybe-installcheck-bzip2 installcheck-bzip2
 maybe-installcheck-bzip2:
 @if bzip2
@@ -7218,6 +7597,33 @@ install-info-dejagnu: \
 
 @endif dejagnu
 
+.PHONY: maybe-install-html-dejagnu install-html-dejagnu
+maybe-install-html-dejagnu:
+@if dejagnu
+maybe-install-html-dejagnu: install-html-dejagnu
+
+install-html-dejagnu: \
+    configure-dejagnu \
+    html-dejagnu 
+	@: $(MAKE); $(unstage)
+	@[ -f ./dejagnu/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in dejagnu" ; \
+	(cd $(HOST_SUBDIR)/dejagnu && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif dejagnu
+
 .PHONY: maybe-installcheck-dejagnu installcheck-dejagnu
 maybe-installcheck-dejagnu:
 @if dejagnu
@@ -7555,6 +7961,33 @@ install-info-diff: \
 
 @endif diff
 
+.PHONY: maybe-install-html-diff install-html-diff
+maybe-install-html-diff:
+@if diff
+maybe-install-html-diff: install-html-diff
+
+install-html-diff: \
+    configure-diff \
+    html-diff 
+	@: $(MAKE); $(unstage)
+	@[ -f ./diff/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in diff" ; \
+	(cd $(HOST_SUBDIR)/diff && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif diff
+
 .PHONY: maybe-installcheck-diff installcheck-diff
 maybe-installcheck-diff:
 @if diff
@@ -7886,6 +8319,33 @@ install-info-dosutils: \
 
 @endif dosutils
 
+.PHONY: maybe-install-html-dosutils install-html-dosutils
+maybe-install-html-dosutils:
+@if dosutils
+maybe-install-html-dosutils: install-html-dosutils
+
+install-html-dosutils: \
+    configure-dosutils \
+    html-dosutils 
+	@: $(MAKE); $(unstage)
+	@[ -f ./dosutils/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in dosutils" ; \
+	(cd $(HOST_SUBDIR)/dosutils && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif dosutils
+
 .PHONY: maybe-installcheck-dosutils installcheck-dosutils
 maybe-installcheck-dosutils:
 @if dosutils
@@ -8223,6 +8683,33 @@ install-info-etc: \
 
 @endif etc
 
+.PHONY: maybe-install-html-etc install-html-etc
+maybe-install-html-etc:
+@if etc
+maybe-install-html-etc: install-html-etc
+
+install-html-etc: \
+    configure-etc \
+    html-etc 
+	@: $(MAKE); $(unstage)
+	@[ -f ./etc/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in etc" ; \
+	(cd $(HOST_SUBDIR)/etc && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif etc
+
 .PHONY: maybe-installcheck-etc installcheck-etc
 maybe-installcheck-etc:
 @if etc
@@ -8563,6 +9050,33 @@ install-info-fastjar: \
 
 @endif fastjar
 
+.PHONY: maybe-install-html-fastjar install-html-fastjar
+maybe-install-html-fastjar:
+@if fastjar
+maybe-install-html-fastjar: install-html-fastjar
+
+install-html-fastjar: \
+    configure-fastjar \
+    html-fastjar 
+	@: $(MAKE); $(unstage)
+	@[ -f ./fastjar/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in fastjar" ; \
+	(cd $(HOST_SUBDIR)/fastjar && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif fastjar
+
 .PHONY: maybe-installcheck-fastjar installcheck-fastjar
 maybe-installcheck-fastjar:
 @if fastjar
@@ -8900,6 +9414,33 @@ install-info-fileutils: \
 
 @endif fileutils
 
+.PHONY: maybe-install-html-fileutils install-html-fileutils
+maybe-install-html-fileutils:
+@if fileutils
+maybe-install-html-fileutils: install-html-fileutils
+
+install-html-fileutils: \
+    configure-fileutils \
+    html-fileutils 
+	@: $(MAKE); $(unstage)
+	@[ -f ./fileutils/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in fileutils" ; \
+	(cd $(HOST_SUBDIR)/fileutils && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif fileutils
+
 .PHONY: maybe-installcheck-fileutils installcheck-fileutils
 maybe-installcheck-fileutils:
 @if fileutils
@@ -9237,6 +9778,33 @@ install-info-findutils: \
 
 @endif findutils
 
+.PHONY: maybe-install-html-findutils install-html-findutils
+maybe-install-html-findutils:
+@if findutils
+maybe-install-html-findutils: install-html-findutils
+
+install-html-findutils: \
+    configure-findutils \
+    html-findutils 
+	@: $(MAKE); $(unstage)
+	@[ -f ./findutils/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in findutils" ; \
+	(cd $(HOST_SUBDIR)/findutils && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif findutils
+
 .PHONY: maybe-installcheck-findutils installcheck-findutils
 maybe-installcheck-findutils:
 @if findutils
@@ -9574,6 +10142,33 @@ install-info-find: \
 
 @endif find
 
+.PHONY: maybe-install-html-find install-html-find
+maybe-install-html-find:
+@if find
+maybe-install-html-find: install-html-find
+
+install-html-find: \
+    configure-find \
+    html-find 
+	@: $(MAKE); $(unstage)
+	@[ -f ./find/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in find" ; \
+	(cd $(HOST_SUBDIR)/find && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif find
+
 .PHONY: maybe-installcheck-find installcheck-find
 maybe-installcheck-find:
 @if find
@@ -9846,6 +10441,33 @@ install-info-fixincludes:
 
 @endif fixincludes
 
+.PHONY: maybe-install-html-fixincludes install-html-fixincludes
+maybe-install-html-fixincludes:
+@if fixincludes
+maybe-install-html-fixincludes: install-html-fixincludes
+
+install-html-fixincludes: \
+    configure-fixincludes \
+    html-fixincludes 
+	@: $(MAKE); $(unstage)
+	@[ -f ./fixincludes/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in fixincludes" ; \
+	(cd $(HOST_SUBDIR)/fixincludes && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif fixincludes
+
 .PHONY: maybe-installcheck-fixincludes installcheck-fixincludes
 maybe-installcheck-fixincludes:
 @if fixincludes
@@ -10170,6 +10792,33 @@ install-info-flex: \
 
 @endif flex
 
+.PHONY: maybe-install-html-flex install-html-flex
+maybe-install-html-flex:
+@if flex
+maybe-install-html-flex: install-html-flex
+
+install-html-flex: \
+    configure-flex \
+    html-flex 
+	@: $(MAKE); $(unstage)
+	@[ -f ./flex/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in flex" ; \
+	(cd $(HOST_SUBDIR)/flex && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif flex
+
 .PHONY: maybe-installcheck-flex installcheck-flex
 maybe-installcheck-flex:
 @if flex
@@ -10859,6 +11508,32 @@ install-info-gas: \
 
 @endif gas
 
+.PHONY: maybe-install-html-gas install-html-gas
+maybe-install-html-gas:
+@if gas
+maybe-install-html-gas: install-html-gas
+
+install-html-gas: \
+    configure-gas \
+    html-gas 
+	@[ -f ./gas/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in gas" ; \
+	(cd $(HOST_SUBDIR)/gas && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif gas
+
 .PHONY: maybe-installcheck-gas installcheck-gas
 maybe-installcheck-gas:
 @if gas
@@ -11543,6 +12218,32 @@ install-info-gcc: \
 
 @endif gcc
 
+.PHONY: maybe-install-html-gcc install-html-gcc
+maybe-install-html-gcc:
+@if gcc
+maybe-install-html-gcc: install-html-gcc
+
+install-html-gcc: \
+    configure-gcc \
+    html-gcc 
+	@[ -f ./gcc/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in gcc" ; \
+	(cd $(HOST_SUBDIR)/gcc && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif gcc
+
 .PHONY: maybe-installcheck-gcc installcheck-gcc
 maybe-installcheck-gcc:
 @if gcc
@@ -11875,6 +12576,33 @@ install-info-gawk: \
 
 @endif gawk
 
+.PHONY: maybe-install-html-gawk install-html-gawk
+maybe-install-html-gawk:
+@if gawk
+maybe-install-html-gawk: install-html-gawk
+
+install-html-gawk: \
+    configure-gawk \
+    html-gawk 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gawk/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in gawk" ; \
+	(cd $(HOST_SUBDIR)/gawk && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif gawk
+
 .PHONY: maybe-installcheck-gawk installcheck-gawk
 maybe-installcheck-gawk:
 @if gawk
@@ -12212,6 +12940,33 @@ install-info-gettext: \
 
 @endif gettext
 
+.PHONY: maybe-install-html-gettext install-html-gettext
+maybe-install-html-gettext:
+@if gettext
+maybe-install-html-gettext: install-html-gettext
+
+install-html-gettext: \
+    configure-gettext \
+    html-gettext 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gettext/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in gettext" ; \
+	(cd $(HOST_SUBDIR)/gettext && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif gettext
+
 .PHONY: maybe-installcheck-gettext installcheck-gettext
 maybe-installcheck-gettext:
 @if gettext
@@ -12549,6 +13304,33 @@ install-info-gnuserv: \
 
 @endif gnuserv
 
+.PHONY: maybe-install-html-gnuserv install-html-gnuserv
+maybe-install-html-gnuserv:
+@if gnuserv
+maybe-install-html-gnuserv: install-html-gnuserv
+
+install-html-gnuserv: \
+    configure-gnuserv \
+    html-gnuserv 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gnuserv/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in gnuserv" ; \
+	(cd $(HOST_SUBDIR)/gnuserv && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif gnuserv
+
 .PHONY: maybe-installcheck-gnuserv installcheck-gnuserv
 maybe-installcheck-gnuserv:
 @if gnuserv
@@ -12886,6 +13668,33 @@ install-info-gprof: \
 
 @endif gprof
 
+.PHONY: maybe-install-html-gprof install-html-gprof
+maybe-install-html-gprof:
+@if gprof
+maybe-install-html-gprof: install-html-gprof
+
+install-html-gprof: \
+    configure-gprof \
+    html-gprof 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprof/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in gprof" ; \
+	(cd $(HOST_SUBDIR)/gprof && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif gprof
+
 .PHONY: maybe-installcheck-gprof installcheck-gprof
 maybe-installcheck-gprof:
 @if gprof
@@ -13223,6 +14032,33 @@ install-info-gzip: \
 
 @endif gzip
 
+.PHONY: maybe-install-html-gzip install-html-gzip
+maybe-install-html-gzip:
+@if gzip
+maybe-install-html-gzip: install-html-gzip
+
+install-html-gzip: \
+    configure-gzip \
+    html-gzip 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gzip/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in gzip" ; \
+	(cd $(HOST_SUBDIR)/gzip && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif gzip
+
 .PHONY: maybe-installcheck-gzip installcheck-gzip
 maybe-installcheck-gzip:
 @if gzip
@@ -13560,6 +14396,33 @@ install-info-hello: \
 
 @endif hello
 
+.PHONY: maybe-install-html-hello install-html-hello
+maybe-install-html-hello:
+@if hello
+maybe-install-html-hello: install-html-hello
+
+install-html-hello: \
+    configure-hello \
+    html-hello 
+	@: $(MAKE); $(unstage)
+	@[ -f ./hello/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in hello" ; \
+	(cd $(HOST_SUBDIR)/hello && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif hello
+
 .PHONY: maybe-installcheck-hello installcheck-hello
 maybe-installcheck-hello:
 @if hello
@@ -13897,6 +14760,33 @@ install-info-indent: \
 
 @endif indent
 
+.PHONY: maybe-install-html-indent install-html-indent
+maybe-install-html-indent:
+@if indent
+maybe-install-html-indent: install-html-indent
+
+install-html-indent: \
+    configure-indent \
+    html-indent 
+	@: $(MAKE); $(unstage)
+	@[ -f ./indent/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in indent" ; \
+	(cd $(HOST_SUBDIR)/indent && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif indent
+
 .PHONY: maybe-installcheck-indent installcheck-indent
 maybe-installcheck-indent:
 @if indent
@@ -14586,6 +15476,32 @@ install-info-intl: \
 
 @endif intl
 
+.PHONY: maybe-install-html-intl install-html-intl
+maybe-install-html-intl:
+@if intl
+maybe-install-html-intl: install-html-intl
+
+install-html-intl: \
+    configure-intl \
+    html-intl 
+	@[ -f ./intl/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in intl" ; \
+	(cd $(HOST_SUBDIR)/intl && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif intl
+
 .PHONY: maybe-installcheck-intl installcheck-intl
 maybe-installcheck-intl:
 @if intl
@@ -14918,6 +15834,33 @@ install-info-tcl: \
 
 @endif tcl
 
+.PHONY: maybe-install-html-tcl install-html-tcl
+maybe-install-html-tcl:
+@if tcl
+maybe-install-html-tcl: install-html-tcl
+
+install-html-tcl: \
+    configure-tcl \
+    html-tcl 
+	@: $(MAKE); $(unstage)
+	@[ -f ./tcl/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in tcl" ; \
+	(cd $(HOST_SUBDIR)/tcl && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif tcl
+
 .PHONY: maybe-installcheck-tcl installcheck-tcl
 maybe-installcheck-tcl:
 @if tcl
@@ -15240,6 +16183,33 @@ install-info-itcl: \
 
 @endif itcl
 
+.PHONY: maybe-install-html-itcl install-html-itcl
+maybe-install-html-itcl:
+@if itcl
+maybe-install-html-itcl: install-html-itcl
+
+install-html-itcl: \
+    configure-itcl \
+    html-itcl 
+	@: $(MAKE); $(unstage)
+	@[ -f ./itcl/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in itcl" ; \
+	(cd $(HOST_SUBDIR)/itcl && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif itcl
+
 .PHONY: maybe-installcheck-itcl installcheck-itcl
 maybe-installcheck-itcl:
 @if itcl
@@ -15929,6 +16899,32 @@ install-info-ld: \
 
 @endif ld
 
+.PHONY: maybe-install-html-ld install-html-ld
+maybe-install-html-ld:
+@if ld
+maybe-install-html-ld: install-html-ld
+
+install-html-ld: \
+    configure-ld \
+    html-ld 
+	@[ -f ./ld/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in ld" ; \
+	(cd $(HOST_SUBDIR)/ld && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif ld
+
 .PHONY: maybe-installcheck-ld installcheck-ld
 maybe-installcheck-ld:
 @if ld
@@ -16613,6 +17609,32 @@ install-info-libcpp: \
 
 @endif libcpp
 
+.PHONY: maybe-install-html-libcpp install-html-libcpp
+maybe-install-html-libcpp:
+@if libcpp
+maybe-install-html-libcpp: install-html-libcpp
+
+install-html-libcpp: \
+    configure-libcpp \
+    html-libcpp 
+	@[ -f ./libcpp/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in libcpp" ; \
+	(cd $(HOST_SUBDIR)/libcpp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif libcpp
+
 .PHONY: maybe-installcheck-libcpp installcheck-libcpp
 maybe-installcheck-libcpp:
 @if libcpp
@@ -17297,6 +18319,32 @@ install-info-libdecnumber: \
 
 @endif libdecnumber
 
+.PHONY: maybe-install-html-libdecnumber install-html-libdecnumber
+maybe-install-html-libdecnumber:
+@if libdecnumber
+maybe-install-html-libdecnumber: install-html-libdecnumber
+
+install-html-libdecnumber: \
+    configure-libdecnumber \
+    html-libdecnumber 
+	@[ -f ./libdecnumber/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in libdecnumber" ; \
+	(cd $(HOST_SUBDIR)/libdecnumber && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif libdecnumber
+
 .PHONY: maybe-installcheck-libdecnumber installcheck-libdecnumber
 maybe-installcheck-libdecnumber:
 @if libdecnumber
@@ -17629,6 +18677,33 @@ install-info-libgui: \
 
 @endif libgui
 
+.PHONY: maybe-install-html-libgui install-html-libgui
+maybe-install-html-libgui:
+@if libgui
+maybe-install-html-libgui: install-html-libgui
+
+install-html-libgui: \
+    configure-libgui \
+    html-libgui 
+	@: $(MAKE); $(unstage)
+	@[ -f ./libgui/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in libgui" ; \
+	(cd $(HOST_SUBDIR)/libgui && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif libgui
+
 .PHONY: maybe-installcheck-libgui installcheck-libgui
 maybe-installcheck-libgui:
 @if libgui
@@ -18318,6 +19393,32 @@ install-info-libiberty: \
 
 @endif libiberty
 
+.PHONY: maybe-install-html-libiberty install-html-libiberty
+maybe-install-html-libiberty:
+@if libiberty
+maybe-install-html-libiberty: install-html-libiberty
+
+install-html-libiberty: \
+    configure-libiberty \
+    html-libiberty 
+	@[ -f ./libiberty/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in libiberty" ; \
+	(cd $(HOST_SUBDIR)/libiberty && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif libiberty
+
 .PHONY: maybe-installcheck-libiberty installcheck-libiberty
 maybe-installcheck-libiberty:
 @if libiberty
@@ -18650,6 +19751,33 @@ install-info-libtool: \
 
 @endif libtool
 
+.PHONY: maybe-install-html-libtool install-html-libtool
+maybe-install-html-libtool:
+@if libtool
+maybe-install-html-libtool: install-html-libtool
+
+install-html-libtool: \
+    configure-libtool \
+    html-libtool 
+	@: $(MAKE); $(unstage)
+	@[ -f ./libtool/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in libtool" ; \
+	(cd $(HOST_SUBDIR)/libtool && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif libtool
+
 .PHONY: maybe-installcheck-libtool installcheck-libtool
 maybe-installcheck-libtool:
 @if libtool
@@ -18987,6 +20115,33 @@ install-info-m4: \
 
 @endif m4
 
+.PHONY: maybe-install-html-m4 install-html-m4
+maybe-install-html-m4:
+@if m4
+maybe-install-html-m4: install-html-m4
+
+install-html-m4: \
+    configure-m4 \
+    html-m4 
+	@: $(MAKE); $(unstage)
+	@[ -f ./m4/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in m4" ; \
+	(cd $(HOST_SUBDIR)/m4 && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif m4
+
 .PHONY: maybe-installcheck-m4 installcheck-m4
 maybe-installcheck-m4:
 @if m4
@@ -19324,6 +20479,33 @@ install-info-make: \
 
 @endif make
 
+.PHONY: maybe-install-html-make install-html-make
+maybe-install-html-make:
+@if make
+maybe-install-html-make: install-html-make
+
+install-html-make: \
+    configure-make \
+    html-make 
+	@: $(MAKE); $(unstage)
+	@[ -f ./make/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in make" ; \
+	(cd $(HOST_SUBDIR)/make && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif make
+
 .PHONY: maybe-installcheck-make installcheck-make
 maybe-installcheck-make:
 @if make
@@ -19655,6 +20837,33 @@ install-info-mmalloc: \
 
 @endif mmalloc
 
+.PHONY: maybe-install-html-mmalloc install-html-mmalloc
+maybe-install-html-mmalloc:
+@if mmalloc
+maybe-install-html-mmalloc: install-html-mmalloc
+
+install-html-mmalloc: \
+    configure-mmalloc \
+    html-mmalloc 
+	@: $(MAKE); $(unstage)
+	@[ -f ./mmalloc/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in mmalloc" ; \
+	(cd $(HOST_SUBDIR)/mmalloc && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif mmalloc
+
 .PHONY: maybe-installcheck-mmalloc installcheck-mmalloc
 maybe-installcheck-mmalloc:
 @if mmalloc
@@ -19992,6 +21201,33 @@ install-info-patch: \
 
 @endif patch
 
+.PHONY: maybe-install-html-patch install-html-patch
+maybe-install-html-patch:
+@if patch
+maybe-install-html-patch: install-html-patch
+
+install-html-patch: \
+    configure-patch \
+    html-patch 
+	@: $(MAKE); $(unstage)
+	@[ -f ./patch/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in patch" ; \
+	(cd $(HOST_SUBDIR)/patch && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif patch
+
 .PHONY: maybe-installcheck-patch installcheck-patch
 maybe-installcheck-patch:
 @if patch
@@ -20329,6 +21565,33 @@ install-info-perl: \
 
 @endif perl
 
+.PHONY: maybe-install-html-perl install-html-perl
+maybe-install-html-perl:
+@if perl
+maybe-install-html-perl: install-html-perl
+
+install-html-perl: \
+    configure-perl \
+    html-perl 
+	@: $(MAKE); $(unstage)
+	@[ -f ./perl/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in perl" ; \
+	(cd $(HOST_SUBDIR)/perl && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif perl
+
 .PHONY: maybe-installcheck-perl installcheck-perl
 maybe-installcheck-perl:
 @if perl
@@ -20666,6 +21929,33 @@ install-info-prms: \
 
 @endif prms
 
+.PHONY: maybe-install-html-prms install-html-prms
+maybe-install-html-prms:
+@if prms
+maybe-install-html-prms: install-html-prms
+
+install-html-prms: \
+    configure-prms \
+    html-prms 
+	@: $(MAKE); $(unstage)
+	@[ -f ./prms/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in prms" ; \
+	(cd $(HOST_SUBDIR)/prms && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif prms
+
 .PHONY: maybe-installcheck-prms installcheck-prms
 maybe-installcheck-prms:
 @if prms
@@ -21003,6 +22293,33 @@ install-info-rcs: \
 
 @endif rcs
 
+.PHONY: maybe-install-html-rcs install-html-rcs
+maybe-install-html-rcs:
+@if rcs
+maybe-install-html-rcs: install-html-rcs
+
+install-html-rcs: \
+    configure-rcs \
+    html-rcs 
+	@: $(MAKE); $(unstage)
+	@[ -f ./rcs/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in rcs" ; \
+	(cd $(HOST_SUBDIR)/rcs && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif rcs
+
 .PHONY: maybe-installcheck-rcs installcheck-rcs
 maybe-installcheck-rcs:
 @if rcs
@@ -21340,6 +22657,33 @@ install-info-readline: \
 
 @endif readline
 
+.PHONY: maybe-install-html-readline install-html-readline
+maybe-install-html-readline:
+@if readline
+maybe-install-html-readline: install-html-readline
+
+install-html-readline: \
+    configure-readline \
+    html-readline 
+	@: $(MAKE); $(unstage)
+	@[ -f ./readline/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in readline" ; \
+	(cd $(HOST_SUBDIR)/readline && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif readline
+
 .PHONY: maybe-installcheck-readline installcheck-readline
 maybe-installcheck-readline:
 @if readline
@@ -21665,6 +23009,33 @@ install-info-release: \
 
 @endif release
 
+.PHONY: maybe-install-html-release install-html-release
+maybe-install-html-release:
+@if release
+maybe-install-html-release: install-html-release
+
+install-html-release: \
+    configure-release \
+    html-release 
+	@: $(MAKE); $(unstage)
+	@[ -f ./release/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in release" ; \
+	(cd $(HOST_SUBDIR)/release && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif release
+
 .PHONY: maybe-installcheck-release installcheck-release
 maybe-installcheck-release:
 @if release
@@ -22002,6 +23373,33 @@ install-info-recode: \
 
 @endif recode
 
+.PHONY: maybe-install-html-recode install-html-recode
+maybe-install-html-recode:
+@if recode
+maybe-install-html-recode: install-html-recode
+
+install-html-recode: \
+    configure-recode \
+    html-recode 
+	@: $(MAKE); $(unstage)
+	@[ -f ./recode/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in recode" ; \
+	(cd $(HOST_SUBDIR)/recode && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif recode
+
 .PHONY: maybe-installcheck-recode installcheck-recode
 maybe-installcheck-recode:
 @if recode
@@ -22339,6 +23737,33 @@ install-info-sed: \
 
 @endif sed
 
+.PHONY: maybe-install-html-sed install-html-sed
+maybe-install-html-sed:
+@if sed
+maybe-install-html-sed: install-html-sed
+
+install-html-sed: \
+    configure-sed \
+    html-sed 
+	@: $(MAKE); $(unstage)
+	@[ -f ./sed/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in sed" ; \
+	(cd $(HOST_SUBDIR)/sed && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif sed
+
 .PHONY: maybe-installcheck-sed installcheck-sed
 maybe-installcheck-sed:
 @if sed
@@ -22676,6 +24101,33 @@ install-info-send-pr: \
 
 @endif send-pr
 
+.PHONY: maybe-install-html-send-pr install-html-send-pr
+maybe-install-html-send-pr:
+@if send-pr
+maybe-install-html-send-pr: install-html-send-pr
+
+install-html-send-pr: \
+    configure-send-pr \
+    html-send-pr 
+	@: $(MAKE); $(unstage)
+	@[ -f ./send-pr/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in send-pr" ; \
+	(cd $(HOST_SUBDIR)/send-pr && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif send-pr
+
 .PHONY: maybe-installcheck-send-pr installcheck-send-pr
 maybe-installcheck-send-pr:
 @if send-pr
@@ -23013,6 +24465,33 @@ install-info-shellutils: \
 
 @endif shellutils
 
+.PHONY: maybe-install-html-shellutils install-html-shellutils
+maybe-install-html-shellutils:
+@if shellutils
+maybe-install-html-shellutils: install-html-shellutils
+
+install-html-shellutils: \
+    configure-shellutils \
+    html-shellutils 
+	@: $(MAKE); $(unstage)
+	@[ -f ./shellutils/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in shellutils" ; \
+	(cd $(HOST_SUBDIR)/shellutils && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif shellutils
+
 .PHONY: maybe-installcheck-shellutils installcheck-shellutils
 maybe-installcheck-shellutils:
 @if shellutils
@@ -23350,6 +24829,33 @@ install-info-sid: \
 
 @endif sid
 
+.PHONY: maybe-install-html-sid install-html-sid
+maybe-install-html-sid:
+@if sid
+maybe-install-html-sid: install-html-sid
+
+install-html-sid: \
+    configure-sid \
+    html-sid 
+	@: $(MAKE); $(unstage)
+	@[ -f ./sid/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in sid" ; \
+	(cd $(HOST_SUBDIR)/sid && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif sid
+
 .PHONY: maybe-installcheck-sid installcheck-sid
 maybe-installcheck-sid:
 @if sid
@@ -23687,6 +25193,33 @@ install-info-sim: \
 
 @endif sim
 
+.PHONY: maybe-install-html-sim install-html-sim
+maybe-install-html-sim:
+@if sim
+maybe-install-html-sim: install-html-sim
+
+install-html-sim: \
+    configure-sim \
+    html-sim 
+	@: $(MAKE); $(unstage)
+	@[ -f ./sim/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in sim" ; \
+	(cd $(HOST_SUBDIR)/sim && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif sim
+
 .PHONY: maybe-installcheck-sim installcheck-sim
 maybe-installcheck-sim:
 @if sim
@@ -24024,6 +25557,33 @@ install-info-tar: \
 
 @endif tar
 
+.PHONY: maybe-install-html-tar install-html-tar
+maybe-install-html-tar:
+@if tar
+maybe-install-html-tar: install-html-tar
+
+install-html-tar: \
+    configure-tar \
+    html-tar 
+	@: $(MAKE); $(unstage)
+	@[ -f ./tar/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in tar" ; \
+	(cd $(HOST_SUBDIR)/tar && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif tar
+
 .PHONY: maybe-installcheck-tar installcheck-tar
 maybe-installcheck-tar:
 @if tar
@@ -24355,6 +25915,33 @@ install-info-texinfo: \
 
 @endif texinfo
 
+.PHONY: maybe-install-html-texinfo install-html-texinfo
+maybe-install-html-texinfo:
+@if texinfo
+maybe-install-html-texinfo: install-html-texinfo
+
+install-html-texinfo: \
+    configure-texinfo \
+    html-texinfo 
+	@: $(MAKE); $(unstage)
+	@[ -f ./texinfo/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in texinfo" ; \
+	(cd $(HOST_SUBDIR)/texinfo && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif texinfo
+
 .PHONY: maybe-installcheck-texinfo installcheck-texinfo
 maybe-installcheck-texinfo:
 @if texinfo
@@ -24692,6 +26279,33 @@ install-info-textutils: \
 
 @endif textutils
 
+.PHONY: maybe-install-html-textutils install-html-textutils
+maybe-install-html-textutils:
+@if textutils
+maybe-install-html-textutils: install-html-textutils
+
+install-html-textutils: \
+    configure-textutils \
+    html-textutils 
+	@: $(MAKE); $(unstage)
+	@[ -f ./textutils/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in textutils" ; \
+	(cd $(HOST_SUBDIR)/textutils && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif textutils
+
 .PHONY: maybe-installcheck-textutils installcheck-textutils
 maybe-installcheck-textutils:
 @if textutils
@@ -25029,6 +26643,33 @@ install-info-time: \
 
 @endif time
 
+.PHONY: maybe-install-html-time install-html-time
+maybe-install-html-time:
+@if time
+maybe-install-html-time: install-html-time
+
+install-html-time: \
+    configure-time \
+    html-time 
+	@: $(MAKE); $(unstage)
+	@[ -f ./time/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in time" ; \
+	(cd $(HOST_SUBDIR)/time && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif time
+
 .PHONY: maybe-installcheck-time installcheck-time
 maybe-installcheck-time:
 @if time
@@ -25366,6 +27007,33 @@ install-info-uudecode: \
 
 @endif uudecode
 
+.PHONY: maybe-install-html-uudecode install-html-uudecode
+maybe-install-html-uudecode:
+@if uudecode
+maybe-install-html-uudecode: install-html-uudecode
+
+install-html-uudecode: \
+    configure-uudecode \
+    html-uudecode 
+	@: $(MAKE); $(unstage)
+	@[ -f ./uudecode/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in uudecode" ; \
+	(cd $(HOST_SUBDIR)/uudecode && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif uudecode
+
 .PHONY: maybe-installcheck-uudecode installcheck-uudecode
 maybe-installcheck-uudecode:
 @if uudecode
@@ -25703,6 +27371,33 @@ install-info-wdiff: \
 
 @endif wdiff
 
+.PHONY: maybe-install-html-wdiff install-html-wdiff
+maybe-install-html-wdiff:
+@if wdiff
+maybe-install-html-wdiff: install-html-wdiff
+
+install-html-wdiff: \
+    configure-wdiff \
+    html-wdiff 
+	@: $(MAKE); $(unstage)
+	@[ -f ./wdiff/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in wdiff" ; \
+	(cd $(HOST_SUBDIR)/wdiff && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif wdiff
+
 .PHONY: maybe-installcheck-wdiff installcheck-wdiff
 maybe-installcheck-wdiff:
 @if wdiff
@@ -26043,6 +27738,33 @@ install-info-zip: \
 
 @endif zip
 
+.PHONY: maybe-install-html-zip install-html-zip
+maybe-install-html-zip:
+@if zip
+maybe-install-html-zip: install-html-zip
+
+install-html-zip: \
+    configure-zip \
+    html-zip 
+	@: $(MAKE); $(unstage)
+	@[ -f ./zip/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in zip" ; \
+	(cd $(HOST_SUBDIR)/zip && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif zip
+
 .PHONY: maybe-installcheck-zip installcheck-zip
 maybe-installcheck-zip:
 @if zip
@@ -26720,6 +28442,32 @@ install-info-zlib: \
 
 @endif zlib
 
+.PHONY: maybe-install-html-zlib install-html-zlib
+maybe-install-html-zlib:
+@if zlib
+maybe-install-html-zlib: install-html-zlib
+
+install-html-zlib: \
+    configure-zlib \
+    html-zlib 
+	@[ -f ./zlib/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in zlib" ; \
+	(cd $(HOST_SUBDIR)/zlib && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif zlib
+
 .PHONY: maybe-installcheck-zlib installcheck-zlib
 maybe-installcheck-zlib:
 @if zlib
@@ -27052,6 +28800,33 @@ install-info-gdb: \
 
 @endif gdb
 
+.PHONY: maybe-install-html-gdb install-html-gdb
+maybe-install-html-gdb:
+@if gdb
+maybe-install-html-gdb: install-html-gdb
+
+install-html-gdb: \
+    configure-gdb \
+    html-gdb 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gdb/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in gdb" ; \
+	(cd $(HOST_SUBDIR)/gdb && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif gdb
+
 .PHONY: maybe-installcheck-gdb installcheck-gdb
 maybe-installcheck-gdb:
 @if gdb
@@ -27389,6 +29164,33 @@ install-info-expect: \
 
 @endif expect
 
+.PHONY: maybe-install-html-expect install-html-expect
+maybe-install-html-expect:
+@if expect
+maybe-install-html-expect: install-html-expect
+
+install-html-expect: \
+    configure-expect \
+    html-expect 
+	@: $(MAKE); $(unstage)
+	@[ -f ./expect/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in expect" ; \
+	(cd $(HOST_SUBDIR)/expect && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif expect
+
 .PHONY: maybe-installcheck-expect installcheck-expect
 maybe-installcheck-expect:
 @if expect
@@ -27726,6 +29528,33 @@ install-info-guile: \
 
 @endif guile
 
+.PHONY: maybe-install-html-guile install-html-guile
+maybe-install-html-guile:
+@if guile
+maybe-install-html-guile: install-html-guile
+
+install-html-guile: \
+    configure-guile \
+    html-guile 
+	@: $(MAKE); $(unstage)
+	@[ -f ./guile/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in guile" ; \
+	(cd $(HOST_SUBDIR)/guile && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif guile
+
 .PHONY: maybe-installcheck-guile installcheck-guile
 maybe-installcheck-guile:
 @if guile
@@ -28063,6 +29892,33 @@ install-info-tk: \
 
 @endif tk
 
+.PHONY: maybe-install-html-tk install-html-tk
+maybe-install-html-tk:
+@if tk
+maybe-install-html-tk: install-html-tk
+
+install-html-tk: \
+    configure-tk \
+    html-tk 
+	@: $(MAKE); $(unstage)
+	@[ -f ./tk/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in tk" ; \
+	(cd $(HOST_SUBDIR)/tk && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif tk
+
 .PHONY: maybe-installcheck-tk installcheck-tk
 maybe-installcheck-tk:
 @if tk
@@ -28394,6 +30250,33 @@ install-info-libtermcap: \
 
 @endif libtermcap
 
+.PHONY: maybe-install-html-libtermcap install-html-libtermcap
+maybe-install-html-libtermcap:
+@if libtermcap
+maybe-install-html-libtermcap: install-html-libtermcap
+
+install-html-libtermcap: \
+    configure-libtermcap \
+    html-libtermcap 
+	@: $(MAKE); $(unstage)
+	@[ -f ./libtermcap/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in libtermcap" ; \
+	(cd $(HOST_SUBDIR)/libtermcap && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif libtermcap
+
 .PHONY: maybe-installcheck-libtermcap installcheck-libtermcap
 maybe-installcheck-libtermcap:
 @if libtermcap
@@ -28665,6 +30548,33 @@ install-info-utils: \
 
 @endif utils
 
+.PHONY: maybe-install-html-utils install-html-utils
+maybe-install-html-utils:
+@if utils
+maybe-install-html-utils: install-html-utils
+
+install-html-utils: \
+    configure-utils \
+    html-utils 
+	@: $(MAKE); $(unstage)
+	@[ -f ./utils/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in utils" ; \
+	(cd $(HOST_SUBDIR)/utils && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif utils
+
 .PHONY: maybe-installcheck-utils installcheck-utils
 maybe-installcheck-utils:
 @if utils
@@ -29002,6 +30912,33 @@ install-info-gnattools: \
 
 @endif gnattools
 
+.PHONY: maybe-install-html-gnattools install-html-gnattools
+maybe-install-html-gnattools:
+@if gnattools
+maybe-install-html-gnattools: install-html-gnattools
+
+install-html-gnattools: \
+    configure-gnattools \
+    html-gnattools 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gnattools/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in gnattools" ; \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	          install-html) \
+	  || exit 1
+
+@endif gnattools
+
 .PHONY: maybe-installcheck-gnattools installcheck-gnattools
 maybe-installcheck-gnattools:
 @if gnattools
@@ -29361,6 +31298,33 @@ install-info-target-libstdc++-v3: \
 
 @endif target-libstdc++-v3
 
+.PHONY: maybe-install-html-target-libstdc++-v3 install-html-target-libstdc++-v3
+maybe-install-html-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-install-html-target-libstdc++-v3: install-html-target-libstdc++-v3
+
+install-html-target-libstdc++-v3: \
+    configure-target-libstdc++-v3 \
+    html-target-libstdc++-v3 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(RAW_CXX_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/libstdc++-v3" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libstdc++-v3 && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-libstdc++-v3
+
 .PHONY: maybe-installcheck-target-libstdc++-v3 installcheck-target-libstdc++-v3
 maybe-installcheck-target-libstdc++-v3:
 @if target-libstdc++-v3
@@ -29715,6 +31679,33 @@ install-info-target-libmudflap: \
 
 @endif target-libmudflap
 
+.PHONY: maybe-install-html-target-libmudflap install-html-target-libmudflap
+maybe-install-html-target-libmudflap:
+@if target-libmudflap
+maybe-install-html-target-libmudflap: install-html-target-libmudflap
+
+install-html-target-libmudflap: \
+    configure-target-libmudflap \
+    html-target-libmudflap 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/libmudflap" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libmudflap && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-libmudflap
+
 .PHONY: maybe-installcheck-target-libmudflap installcheck-target-libmudflap
 maybe-installcheck-target-libmudflap:
 @if target-libmudflap
@@ -30069,6 +32060,33 @@ install-info-target-libssp: \
 
 @endif target-libssp
 
+.PHONY: maybe-install-html-target-libssp install-html-target-libssp
+maybe-install-html-target-libssp:
+@if target-libssp
+maybe-install-html-target-libssp: install-html-target-libssp
+
+install-html-target-libssp: \
+    configure-target-libssp \
+    html-target-libssp 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/libssp" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libssp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-libssp
+
 .PHONY: maybe-installcheck-target-libssp installcheck-target-libssp
 maybe-installcheck-target-libssp:
 @if target-libssp
@@ -30423,6 +32441,33 @@ install-info-target-libgcc-math: \
 
 @endif target-libgcc-math
 
+.PHONY: maybe-install-html-target-libgcc-math install-html-target-libgcc-math
+maybe-install-html-target-libgcc-math:
+@if target-libgcc-math
+maybe-install-html-target-libgcc-math: install-html-target-libgcc-math
+
+install-html-target-libgcc-math: \
+    configure-target-libgcc-math \
+    html-target-libgcc-math 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/libgcc-math" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libgcc-math && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-libgcc-math
+
 .PHONY: maybe-installcheck-target-libgcc-math installcheck-target-libgcc-math
 maybe-installcheck-target-libgcc-math:
 @if target-libgcc-math
@@ -30777,6 +32822,33 @@ install-info-target-newlib: \
 
 @endif target-newlib
 
+.PHONY: maybe-install-html-target-newlib install-html-target-newlib
+maybe-install-html-target-newlib:
+@if target-newlib
+maybe-install-html-target-newlib: install-html-target-newlib
+
+install-html-target-newlib: \
+    configure-target-newlib \
+    html-target-newlib 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/newlib" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/newlib && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-newlib
+
 .PHONY: maybe-installcheck-target-newlib installcheck-target-newlib
 maybe-installcheck-target-newlib:
 @if target-newlib
@@ -31131,6 +33203,33 @@ install-info-target-libgfortran: \
 
 @endif target-libgfortran
 
+.PHONY: maybe-install-html-target-libgfortran install-html-target-libgfortran
+maybe-install-html-target-libgfortran:
+@if target-libgfortran
+maybe-install-html-target-libgfortran: install-html-target-libgfortran
+
+install-html-target-libgfortran: \
+    configure-target-libgfortran \
+    html-target-libgfortran 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/libgfortran" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libgfortran && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-libgfortran
+
 .PHONY: maybe-installcheck-target-libgfortran installcheck-target-libgfortran
 maybe-installcheck-target-libgfortran:
 @if target-libgfortran
@@ -31485,6 +33584,33 @@ install-info-target-libobjc: \
 
 @endif target-libobjc
 
+.PHONY: maybe-install-html-target-libobjc install-html-target-libobjc
+maybe-install-html-target-libobjc:
+@if target-libobjc
+maybe-install-html-target-libobjc: install-html-target-libobjc
+
+install-html-target-libobjc: \
+    configure-target-libobjc \
+    html-target-libobjc 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/libobjc" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libobjc && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-libobjc
+
 .PHONY: maybe-installcheck-target-libobjc installcheck-target-libobjc
 maybe-installcheck-target-libobjc:
 @if target-libobjc
@@ -31834,6 +33960,33 @@ install-info-target-libtermcap: \
 
 @endif target-libtermcap
 
+.PHONY: maybe-install-html-target-libtermcap install-html-target-libtermcap
+maybe-install-html-target-libtermcap:
+@if target-libtermcap
+maybe-install-html-target-libtermcap: install-html-target-libtermcap
+
+install-html-target-libtermcap: \
+    configure-target-libtermcap \
+    html-target-libtermcap 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/libtermcap" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libtermcap && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-libtermcap
+
 .PHONY: maybe-installcheck-target-libtermcap installcheck-target-libtermcap
 maybe-installcheck-target-libtermcap:
 @if target-libtermcap
@@ -32128,6 +34281,33 @@ install-info-target-winsup: \
 
 @endif target-winsup
 
+.PHONY: maybe-install-html-target-winsup install-html-target-winsup
+maybe-install-html-target-winsup:
+@if target-winsup
+maybe-install-html-target-winsup: install-html-target-winsup
+
+install-html-target-winsup: \
+    configure-target-winsup \
+    html-target-winsup 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/winsup" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/winsup && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-winsup
+
 .PHONY: maybe-installcheck-target-winsup installcheck-target-winsup
 maybe-installcheck-target-winsup:
 @if target-winsup
@@ -32477,6 +34657,33 @@ install-info-target-libgloss: \
 
 @endif target-libgloss
 
+.PHONY: maybe-install-html-target-libgloss install-html-target-libgloss
+maybe-install-html-target-libgloss:
+@if target-libgloss
+maybe-install-html-target-libgloss: install-html-target-libgloss
+
+install-html-target-libgloss: \
+    configure-target-libgloss \
+    html-target-libgloss 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/libgloss" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libgloss && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-libgloss
+
 .PHONY: maybe-installcheck-target-libgloss installcheck-target-libgloss
 maybe-installcheck-target-libgloss:
 @if target-libgloss
@@ -32831,6 +35038,33 @@ install-info-target-libiberty: \
 
 @endif target-libiberty
 
+.PHONY: maybe-install-html-target-libiberty install-html-target-libiberty
+maybe-install-html-target-libiberty:
+@if target-libiberty
+maybe-install-html-target-libiberty: install-html-target-libiberty
+
+install-html-target-libiberty: \
+    configure-target-libiberty \
+    html-target-libiberty 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/libiberty" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libiberty && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-libiberty
+
 .PHONY: maybe-installcheck-target-libiberty installcheck-target-libiberty
 maybe-installcheck-target-libiberty:
 @if target-libiberty
@@ -33185,6 +35419,33 @@ install-info-target-gperf: \
 
 @endif target-gperf
 
+.PHONY: maybe-install-html-target-gperf install-html-target-gperf
+maybe-install-html-target-gperf:
+@if target-gperf
+maybe-install-html-target-gperf: install-html-target-gperf
+
+install-html-target-gperf: \
+    configure-target-gperf \
+    html-target-gperf 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/gperf" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/gperf && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-gperf
+
 .PHONY: maybe-installcheck-target-gperf installcheck-target-gperf
 maybe-installcheck-target-gperf:
 @if target-gperf
@@ -33529,6 +35790,33 @@ install-info-target-examples: \
 
 @endif target-examples
 
+.PHONY: maybe-install-html-target-examples install-html-target-examples
+maybe-install-html-target-examples:
+@if target-examples
+maybe-install-html-target-examples: install-html-target-examples
+
+install-html-target-examples: \
+    configure-target-examples \
+    html-target-examples 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/examples" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/examples && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-examples
+
 .PHONY: maybe-installcheck-target-examples installcheck-target-examples
 maybe-installcheck-target-examples:
 @if target-examples
@@ -33883,6 +36171,33 @@ install-info-target-libffi: \
 
 @endif target-libffi
 
+.PHONY: maybe-install-html-target-libffi install-html-target-libffi
+maybe-install-html-target-libffi:
+@if target-libffi
+maybe-install-html-target-libffi: install-html-target-libffi
+
+install-html-target-libffi: \
+    configure-target-libffi \
+    html-target-libffi 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/libffi" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libffi && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-libffi
+
 .PHONY: maybe-installcheck-target-libffi installcheck-target-libffi
 maybe-installcheck-target-libffi:
 @if target-libffi
@@ -34237,6 +36552,33 @@ install-info-target-libjava: \
 
 @endif target-libjava
 
+.PHONY: maybe-install-html-target-libjava install-html-target-libjava
+maybe-install-html-target-libjava:
+@if target-libjava
+maybe-install-html-target-libjava: install-html-target-libjava
+
+install-html-target-libjava: \
+    configure-target-libjava \
+    html-target-libjava 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(RAW_CXX_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/libjava" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libjava && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-libjava
+
 .PHONY: maybe-installcheck-target-libjava installcheck-target-libjava
 maybe-installcheck-target-libjava:
 @if target-libjava
@@ -34591,6 +36933,33 @@ install-info-target-zlib: \
 
 @endif target-zlib
 
+.PHONY: maybe-install-html-target-zlib install-html-target-zlib
+maybe-install-html-target-zlib:
+@if target-zlib
+maybe-install-html-target-zlib: install-html-target-zlib
+
+install-html-target-zlib: \
+    configure-target-zlib \
+    html-target-zlib 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/zlib" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/zlib && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-zlib
+
 .PHONY: maybe-installcheck-target-zlib installcheck-target-zlib
 maybe-installcheck-target-zlib:
 @if target-zlib
@@ -34945,6 +37314,33 @@ install-info-target-boehm-gc: \
 
 @endif target-boehm-gc
 
+.PHONY: maybe-install-html-target-boehm-gc install-html-target-boehm-gc
+maybe-install-html-target-boehm-gc:
+@if target-boehm-gc
+maybe-install-html-target-boehm-gc: install-html-target-boehm-gc
+
+install-html-target-boehm-gc: \
+    configure-target-boehm-gc \
+    html-target-boehm-gc 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/boehm-gc" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/boehm-gc && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-boehm-gc
+
 .PHONY: maybe-installcheck-target-boehm-gc installcheck-target-boehm-gc
 maybe-installcheck-target-boehm-gc:
 @if target-boehm-gc
@@ -35299,6 +37695,33 @@ install-info-target-qthreads: \
 
 @endif target-qthreads
 
+.PHONY: maybe-install-html-target-qthreads install-html-target-qthreads
+maybe-install-html-target-qthreads:
+@if target-qthreads
+maybe-install-html-target-qthreads: install-html-target-qthreads
+
+install-html-target-qthreads: \
+    configure-target-qthreads \
+    html-target-qthreads 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/qthreads" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/qthreads && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-qthreads
+
 .PHONY: maybe-installcheck-target-qthreads installcheck-target-qthreads
 maybe-installcheck-target-qthreads:
 @if target-qthreads
@@ -35653,6 +38076,33 @@ install-info-target-rda: \
 
 @endif target-rda
 
+.PHONY: maybe-install-html-target-rda install-html-target-rda
+maybe-install-html-target-rda:
+@if target-rda
+maybe-install-html-target-rda: install-html-target-rda
+
+install-html-target-rda: \
+    configure-target-rda \
+    html-target-rda 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/rda" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/rda && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-rda
+
 .PHONY: maybe-installcheck-target-rda installcheck-target-rda
 maybe-installcheck-target-rda:
 @if target-rda
@@ -36007,6 +38457,33 @@ install-info-target-libada: \
 
 @endif target-libada
 
+.PHONY: maybe-install-html-target-libada install-html-target-libada
+maybe-install-html-target-libada:
+@if target-libada
+maybe-install-html-target-libada: install-html-target-libada
+
+install-html-target-libada: \
+    configure-target-libada \
+    html-target-libada 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/libada" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libada && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-libada
+
 .PHONY: maybe-installcheck-target-libada installcheck-target-libada
 maybe-installcheck-target-libada:
 @if target-libada
@@ -36361,6 +38838,33 @@ install-info-target-libgomp: \
 
 @endif target-libgomp
 
+.PHONY: maybe-install-html-target-libgomp install-html-target-libgomp
+maybe-install-html-target-libgomp:
+@if target-libgomp
+maybe-install-html-target-libgomp: install-html-target-libgomp
+
+install-html-target-libgomp: \
+    configure-target-libgomp \
+    html-target-libgomp 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/libgomp" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libgomp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-libgomp
+
 .PHONY: maybe-installcheck-target-libgomp installcheck-target-libgomp
 maybe-installcheck-target-libgomp:
 @if target-libgomp
diff --git a/Makefile.tpl b/Makefile.tpl
index 274474a5c00..b83d8d5abd9 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -53,6 +53,9 @@ libdir = @libdir@
 includedir = @includedir@
 oldincludedir = @oldincludedir@
 infodir = @infodir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+htmldir = @htmldir@
 mandir = @mandir@
 man1dir = $(mandir)/man1
 man2dir = $(mandir)/man2
@@ -532,7 +535,7 @@ do-[+make_target+]:
 
 # Here are the targets which correspond to the do-X targets.
 
-.PHONY: info installcheck dvi html install-info
+.PHONY: info installcheck dvi html install-info install-html
 .PHONY: clean distclean mostlyclean maintainer-clean realclean
 .PHONY: local-clean local-distclean local-maintainer-clean
 info: do-info
@@ -550,6 +553,8 @@ install-info: do-install-info dir.info
 	  $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \
 	else true ; fi
 
+install-html: do-install-html
+
 local-clean:
 	-rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
 
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 521fcb9c05b..be3b068eef1 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,426 @@
+2006-04-14  David Heine  <dlheine@tensilica.com>
+
+	* elf32-xtensa.c (build_reloc_opcodes): New.
+	(compute_text_actions): Use it to decode opcodes outside inner loop.
+	(check_section_ebb_pcrels_fit): Add "reloc_opcodes" argument, and if
+	it is set, use it to get the opcodes for relocations.
+	(move_shared_literal): Adjust call to check_section_ebb_pcrels_fit.
+
+2006-04-08  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR ld/2513
+	* elf32-i386.c (GOT_TLS_MASK): New macro for tls_type.
+	(GOT_TLS_IE_IE): Likewise.
+	(GOT_TLS_IE_GD): Likewise.
+	(GOT_TLS_IE_MASK): Likewise.
+	(elf_i386_check_relocs): For global symbols, set GOT_TLS_IE_GD
+	and GOT_TLS_IE_IE for R_386_TLS_GD and R_386_TLS_IE
+	respectively.
+	(allocate_dynrelocs): If both GOT_TLS_IE_IE and GOT_TLS_IE_GD
+	are set, treat tls_type as GOT_TLS_IE_BOTH.
+	(elf_i386_relocate_section): Likewise.
+
+2006-04-07  Randolph Chung  <tausq@debian.org>
+
+	* elf64-hppa.c (elf64_hppa_grok_prstatus): New function.
+	(elf64_hppa_grok_psinfo): Likewise.
+	(elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define.
+
+2006-04-06  DJ Delorie  <dj@redhat.com>
+
+	* elf32-m32c.c (m32c_elf_relocate_section): Generate a symbol for
+	each plt entry we create.
+
+2006-04-06  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* po/Make-in: Add install-html target.
+	* Makefile.am: Rename docdir to bfddocdir. Add datarootdir, docdir
+	htmldir. Add install-html and install-html-recursive targets.
+	* Makefile.in: Regenerate.
+	* configure.in: AC_SUBST for datarootdir, docdir and htmldir.
+	* configure: Regenerate.
+
+2006-04-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elfxx-ia64.c (elfNN_ia64_relax_section): Skip unneeded passes
+	with the skip_relax_pass_0 and skip_relax_pass_1 bits in the
+	section structure.
+
+2006-04-05  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* elf32-bfin.c (bfinfdpic_relocs_info_hash): Sprinkle casts to
+	eliminate warnings.
+
+2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
+	    James E Wilson  <wilson@specifixinc.com>
+
+	PR ld/2442
+	* elfxx-ia64.c (elfNN_ia64_dyn_sym_info): Remove next.
+	(elfNN_ia64_local_hash_entry): Add count, sorted_count and
+	size.
+	(elfNN_ia64_link_hash_entry): Likewise.
+	(elfNN_ia64_new_elf_hash_entry): Initialize count, sorted_count
+	and size.
+	(elfNN_ia64_hash_copy_indirect): Updated elfNN_ia64_dyn_sym_info
+	processing.
+	(elfNN_ia64_hash_hide_symbol): Likewise.
+	(elfNN_ia64_global_dyn_sym_thunk): Likewise.
+	(elfNN_ia64_local_dyn_sym_thunk): Likewise.
+	(elfNN_ia64_global_dyn_info_free): New function.
+	(elfNN_ia64_local_dyn_info_free): Likewise.
+	(elfNN_ia64_hash_table_free): Free local and global
+	elfNN_ia64_dyn_sym_info.
+	(addend_compare): New function.
+	(sort_dyn_sym_info): Likewise.
+	(get_dyn_sym_info): Updated to use binary search for addend.
+	(elfNN_ia64_check_relocs): Scan relocations to create dynamic
+	relocation arrays first.
+
+2006-04-05  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* elf32-bfin.c (_bfin_create_got_section): Don't generate a _gp
+	symbol.
+
+2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR ld/2411
+	* elflink.c (check_dynsym): New.
+	(elf_link_output_extsym): Use it.
+	(bfd_elf_final_link): Likewise.
+
+2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR ld/2404
+	* elflink.c (_bfd_elf_merge_symbol): Skip the default indirect
+	symbol from the dynamic definition with the default version if
+	its type and the type of existing regular definition mismatch.
+
+2006-04-05  Richard Sandiford  <richard@codesourcery.com>
+	    Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* config.bfd (sparc-*-vxworks*): New stanza.
+	* configure.in (bfd_elf32_sparc_vxworks_vec): New stanza.
+	(bfd_elf32_sparc_vec, bfd_elf64_sparc_vec): Add elf-vxworks.lo.
+	* configure: Regenerate.
+	* elf32-sparc.c: Include elf-vxworks.h.
+	(elf32_sparc_vxworks_link_hash_table_create: New.
+	(elf32_sparc_vxworks_final_write_processing): New.
+	(TARGET_BIG_SYM): Override for VxWorks.
+	(TARGET_BIG_NAME, ELF_MINPAGESIZE): Likewise.
+	(bfd_elf32_bfd_link_hash_table_create): Likewise.
+	(elf_backend_want_got_plt, elf_backend_plt_readonly): Likewise.
+	(elf_backend_got_header_size, elf_backend_add_symbol_hook): Likewise.
+	(elf_backend_link_output_symbol_hook): Likewise.
+	(elf_backend_emit_relocs): Likewise.
+	(elf_backend_final_write_processing, elf32_bed): Likewise.
+	* elfxx-sparc.c: Include libiberty.h and elf-vxworks.h.
+	(sparc_vxworks_exec_plt0_entry, sparc_vxworks_exec_plt_entry): New.
+	(sparc_vxworks_shared_plt0_entry, sparc_vxworks_shared_plt_entry): New.
+	(_bfd_sparc_elf_link_hash_table_create): Don't initialize
+	build_plt_entry here.
+	(create_got_section): Initialize sgotplt for VxWorks.
+	(_bfd_sparc_elf_create_dynamic_sections): Initialize build_plt_entry,
+	plt_header_size and plt_entry_size, with new VxWorks-specific settings.
+	Call elf_vxworks_create_dynamic_sections for VxWorks.
+	(allocate_dynrelocs): Use plt_header_size and plt_entry_size.
+	Allocate room for .got.plt and .rela.plt.unloaded entries on VxWorks.
+	(_bfd_sparc_elf_size_dynamic_sections): Don't allocate a nop in .plt
+	for VxWorks.  Check for the .got.plt section.
+	(sparc_vxworks_build_plt_entry): New function.
+	(_bfd_sparc_elf_finish_dynamic_symbol): Add handling of VxWorks PLTs.
+	Don't make _GLOBAL_OFFSET_TABLE_ and _PROCEDURE_LINKAGE_TABLE_
+	absolute on VxWorks.
+	(sparc32_finish_dyn): Add special handling for DT_RELASZ
+	and DT_PLTGOT on VxWorks.
+	(sparc_vxworks_finish_exec_plt): New.
+	(sparc_vxworks_finish_shared_plt): New.
+	(_bfd_sparc_elf_finish_dynamic_sections): Call them.
+	Use plt_header_size and plt_entry_size.
+	* elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add is_vxworks,
+	srelplt2, sgotplt, plt_header_size and plt_entry_size fields.
+	* Makefile.am (elfxx-sparc.lo): Depend on elf-vxworks.h.
+	(elf32-sparc.lo): Likewise.
+	* Makefile.in: Regenerate.
+	* targets.c (bfd_elf32_sparc_vxworks_vec): Declare.
+	(_bfd_target_vector): Add a pointer to it.
+
+2006-03-30  Ben Elliston  <bje@au.ibm.com>
+
+	PR ld/2267
+	* elflink.c (elf_fixup_link_order): Ensure `elfsec' is not a
+	special section number that exceeds the number of ELF sections
+	(eg. SHN_MIPS_SCOMMON).
+
+2006-03-27  Richard Sandiford  <richard@codesourcery.com>
+
+	* elfxx-mips.c (mips_got_entry): Add more commentary.
+	(mips_elf_local_got_index): Use the hash table entry to record
+	the GOT index of forced-local symbols.
+	(mips_elf_initialize_tls_index): Rearrange code.  Store the index
+	in either the hash table entry or the mips_got_entry, not both.
+	Add more commentary.
+	(mips_elf_multi_got): Make sure the g->next is nonnull when calling
+	mips_elf_initialize_tls_index.
+
+2006-03-25  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* elf32-bfin.c (bfd_const_reloc, bfd_oper_reloc, bfin_push_reloc,
+	RELOC_STACK_SIZE, reloc_stack, reloc_stack_tos, is_reloc_stack_empty,
+	reloc_stack_push, reloc_stack_pop, reloc_stack_operate,
+	bfin_areloc_howto_table): Delete.  All
+	uses deleted as well.
+	(bfin_reloc_map): Delete all stack relocs.
+	(bfin_info_to_howto, bfin_bfd_reloc_type_lookup,
+	bfin_reloc_type_lookup): Don't support them.
+	(bfin_relocate_section): Don't try to handle them.
+
+	* config.bfd (bfin-*-*): Add bfd_elf32_bfinfdpic_vec.
+	* configure.in: Likewise.
+	* configure: Regenerate.
+	* elf32-bfin.c: Include "elf/dwarf2.h" and "hashtab.h".
+	(BFIN_RELOC_MAX): Now 0x21.
+	(bfin_howto_table, bfin_reloc_map): Add FD-PIC relocs.
+	(bfd_elf32_bfinfdpic_vec): Declare.
+	(IS_FDPIC): New macro.
+	(struct bfinfdpic_elf_link_hash_table): New struct.
+	(bfinfdpic_hash_table, bfinfdpic_got_section,
+	bfinfdpic_gotrel_section, bfinfdpic_gotfixup_section,
+	bfinfdpic_plt_setion, bfinfdpic_pltrel_section,
+	bfinfdpic_relocs_info, bfinfdpic_got_initial_offset,
+	bfinfdpic_plt_initial_offset): Accessor macros for it.
+	(BFINFDPIC_SYM_LOCAL, BFINFDPIC_FUNCDESC_LOCAL): New macros.
+	(struct bfinfdpic_relocs_info): New struct.
+	(LZPLT_RESOLVER_EXTRA, LZPLT_NORMAL_SIZE, LZPLT_ENTRIES,
+	BFINFDPIC_LZPLT_BLOCK_SIZE, BFINFDPIC_LZPLT_RESOLV_LOC,
+	DEFAULT_STACK_SIZE): New macros.
+	(bfinfdpic_elf_link_hash_table_create, bfinfdpic_relocs_info_hash,
+	bfinfdpic_relocs_info_eq, bfinfdpics_relocs_info_find,
+	bfinfdpic_relocs_info_for_global, bfinfdpic_relocs_info_for_local,
+	bfinfdpic_pic_merge_early_relocs_info, _bfinfdpic_add_dyn_reloc,
+	_bfinfdpic_add_rofixup, _bfinfdpic_osec_to_segment,
+	_bfinfdpic_osec_readonly_p, bfinfdpic_relocate_section,
+	bfinfdpic_check_relocs, bfinfdpic_gc_sweep_hook,
+	_bfinfdpic_link_omit_section_dynsym, _bfin_create_got_section,
+	elf32_bfinfdpic_create_dynamic_sections, _bfinfdpic_get_fd_entry,
+	_bfinfdpic_compute_got_alloc_data, _bfinfdpic_get_got_entry,
+	_bfinfdpic_assign_got_entries, _bfinfdpic_assign_plt_entries,
+	_bfinfdpic_resolve_final_relocs_info,
+	elf32_bfinfdpic_size_dynamic_sections,
+	elf32_bfinfdpic_always_size_sections,
+	elf32_bfinfdpic_modify_segment_map,
+	_bfinfdpic_count_got_plt_entries,
+	elf32_bfinfdpic_finish_dynamic_sections,
+	elf32_bfinfdpic_adjust_dynamic_symbol,
+	elf32_bfinfdpic_finish_dynamic_symbol,
+	elf32_bfinfdpic_elf_use_relative_eh_frame,
+	elf32_bfinfdpic_elf_encode_eh_address,
+	elf32_bfin_object_p, bfin_elf_copy_private_bfd_data,
+	elf32_bfinfdpic_copy_private_bfd_data,
+	(struct _bfinfdpic_dynamic_got_info,
+	struct _bfinfdpic_dynamic_got_plt_info): New structs.
+	(elf32_bfin_print_private_bfd_data): Print PIC flags.
+	(elf32_bfin_merge_private_bfd_data): Extend to support FD-PIC.
+	(TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, elf32_bed,
+	elf_backend_got_header_size, bfd_elf32_bfd_link_hash_table_create,
+	elf_backend_always_size_sectinos, elf_backend_modify_segment_map,
+	bfd_elf32_bfd_copy_private_bfd_data,
+	elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol,
+	elf_backend_size_dynamic_sections, elf_backend_finish_dynamic_symbol,
+	elf_backend_finish_dynamic_sections, elf_backend_relocate_section,
+	elf_backend_can_make_relative_eh_frame, elf_backend_check_relocs,
+	elf_backend_can_make_ldsa_relative_eh_frame, elf_backend_may_use_rel_p,
+	elf_backend_may_use_rela_p, elf_backend_default_use_rela_p,
+	elf_backend_omit_section_dynsym): Redefine these macros and include
+	"elf32-target.h" again to create the elf32-bfinfdpic target.
+	* reloc.c (BFD_RELOC_BFIN_GOT17M4, BFD_RELOC_BFIN_GOTHI,
+	BFD_RELOC_BFIN_GOTLO, BFD_RELOC_BFIN_FUNCDESC,
+	BFD_RELOC_BFIN_FUNCDESC_GOT17M4, BFD_RELOC_BFIN_FUNCDESC_GOTHI,
+	BFD_RELOC_BFIN_FUNCDESC_GOTLO, BFD_RELOC_BFIN_FUNCDESC_VALUE,
+	BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
+	BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, BFD_RELOC_BFIN_GOTOFFHI,
+	BFD_RELOC_BFIN_GOTOFFLO): New.
+	* targets.c (bfd_elf32_bfinfdpic_vec): New bfd_target.
+	(_bfd_target_vector): Add it.
+	* bfd-in2.h: Regenerate.
+	* libbfd.h: Regenerate.
+
+2006-03-25  Richard Sandiford  <richard@codesourcery.com>
+
+	* cpu-m68k.c (bfd_m68k_compatible): Treat ISA A+ and ISA B code as
+	incompatible.  Likewise MAC and EMAC code.
+	* elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Use
+	bfd_get_compatible to set the new bfd architecture.  Rely on it
+	to detect incompatibilities.
+
+2006-03-22  Bob Wilson  <bob.wilson@acm.org>
+
+	* elf32-xtensa.c (xtensa_read_table_entries): Remove assertion that
+	rel->r_addend is zero.
+
+2006-03-22  Richard Sandiford  <richard@codesourcery.com>
+
+	* elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Fix type
+	of "loc".
+
+2006-03-22  Richard Sandiford  <richard@codesourcery.com>
+	    Daniel Jacobowitz  <dan@codesourcery.com>
+	    Phil Edwards  <phil@codesourcery.com>
+	    Zack Weinberg  <zack@codesourcery.com>
+	    Mark Mitchell  <mark@codesourcery.com>
+	    Nathan Sidwell  <nathan@codesourcery.com>
+
+	* bfd-in2.h: Regenerate.
+	* config.bfd (mips*-*-vxworks*, mips*el-*-vxworks*): New stanzas.
+	* configure.in (bfd_elf32_bigmips_vxworks_vec): New stanza.
+	(bfd_elf32_littlemips_vxworks_vec): Likewise.
+	(bfd_elf32_bigmips_vec): Add elf-vxworks.lo.
+	(bfd_elf32_littlemips_vec): Likewise.
+	(bfd_elf32_nbigmips_vec): Likewise.
+	(bfd_elf32_nlittlemips_vec): Likewise.
+	(bfd_elf32_ntradbigmips_vec): Likewise.
+	(bfd_elf32_ntradlittlemips_vec): Likewise.
+	(bfd_elf32_tradbigmips_vec): Likewise.
+	(bfd_elf32_tradlittlemips_vec): Likewise.
+	(bfd_elf64_bigmips_vec): Likewise.
+	(bfd_elf64_littlemips_vec): Likewise.
+	(bfd_elf64_tradbigmips_vec): Likewise.
+	(bfd_elf64_tradlittlemips_vec): Likewise.
+	* elf32-mips.c: Include elf-vxworks.h.
+	(mips_info_to_howto_rel): Use elf_backend_mips_rtype_to_howto
+	instead of calling mips_elf32_rtype_to_howto directly.
+	(mips_vxworks_copy_howto_rela): New reloc howto.
+	(mips_vxworks_jump_slot_howto_rela): Likewise.
+	(mips_vxworks_bfd_reloc_type_lookup): New function.
+	(mips_vxworks_rtype_to_howto): Likewise.
+	(mips_vxworks_final_write_processing): Likewise.
+	(TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Override for VxWorks.
+	(TARGET_BIG_SYM, TARGET_BIG_NAME, elf_bed, ELF_MAXPAGESIZE): Likewise.
+	(elf_backend_want_got_plt): Likewise.
+	(elf_backend_want_plt_sym): Likewise.
+	(elf_backend_got_symbol_offset): Likewise.
+	(elf_backend_want_dynbss): Likewise.
+	(elf_backend_may_use_rel_p): Likewise.
+	(elf_backend_may_use_rela_p): Likewise.
+	(elf_backend_default_use_rela_p): Likewise.
+	(elf_backend_got_header_size: Likewise.
+	(elf_backend_plt_readonly): Likewise.
+	(bfd_elf32_bfd_reloc_type_lookup): Likewise.
+	(elf_backend_mips_rtype_to_howto): Likewise.
+	(elf_backend_adjust_dynamic_symbol): Likewise.
+	(elf_backend_finish_dynamic_symbol): Likewise.
+	(bfd_elf32_bfd_link_hash_table_create): Likewise.
+	(elf_backend_add_symbol_hook): Likewise.
+	(elf_backend_link_output_symbol_hook): Likewise.
+	(elf_backend_emit_relocs): Likewise.
+	(elf_backend_final_write_processing: Likewise.
+	(elf_backend_additional_program_headers): Likewise.
+	(elf_backend_modify_segment_map): Likewise.
+	(elf_backend_symbol_processing): Likewise.
+	* elfxx-mips.c: Include elf-vxworks.h.
+	(mips_elf_link_hash_entry): Add is_relocation_target and
+	is_branch_target fields.
+	(mips_elf_link_hash_table): Add is_vxworks, srelbss, sdynbss, srelplt,
+	srelplt2, sgotplt, splt, plt_header_size and plt_entry_size fields.
+	(MIPS_ELF_RELA_SIZE, MIPS_ELF_REL_DYN_NAME): New macros.
+	(MIPS_RESERVED_GOTNO): Take a mips_elf_link_hash_table argument.
+	Return 3 for VxWorks.
+	(ELF_MIPS_GP_OFFSET): Change the argument from a bfd to a
+	mips_elf_link_hash_table.  Return 0 for VxWorks.
+	(MIPS_ELF_GOT_MAX_SIZE): Change the argument from a bfd to a
+	mips_elf_link_hash_table.  Update the call to ELF_MIPS_GP_OFFSET.
+	(mips_vxworks_exec_plt0_entry): New variable.
+	(mips_vxworks_exec_plt_entry): Likewise.
+	(mips_vxworks_shared_plt0_entry): Likewise.
+	(mips_vxworks_shared_plt_entry): Likewise.
+	(mips_elf_link_hash_newfunc): Initialize the new hash_entry fields.
+	(mips_elf_rel_dyn_section): Change the bfd argument to a
+	mips_elf_link_hash_table.  Use MIPS_ELF_REL_DYN_NAME to get
+	the name of the section.
+	(mips_elf_initialize_tls_slots): Update the call to
+	mips_elf_rel_dyn_section.
+	(mips_elf_gotplt_index): New function.
+	(mips_elf_local_got_index): Add an input_section argument.
+	Update the call to mips_elf_create_local_got_entry.
+	(mips_elf_got_page): Likewise.
+	(mips_elf_got16_entry): Likewise.
+	(mips_elf_create_local_got_entry): Add bfd_link_info and input_section
+	arguments.  Create dynamic relocations for each entry on VxWorks.
+	(mips_elf_merge_gots): Update the use of MIPS_ELF_GOT_MAX_SIZE.
+	(mips_elf_multi_got): Update the uses of MIPS_ELF_GOT_MAX_SIZE
+	and MIPS_RESERVED_GOTNO.
+	(mips_elf_create_got_section): Update the uses of
+	MIPS_ELF_GOT_MAX_SIZE.  Create .got.plt on VxWorks.
+	(is_gott_symbol): New function.
+	(mips_elf_calculate_relocation): Use a dynobj local variable.
+	Update the calls to mips_elf_local_got_index, mips_elf_got16_entry and
+	mips_elf_got_page_entry.  Set G to the .got.plt entry when calculating
+	VxWorks R_MIPS_CALL* relocations.  Calculate and use G for all GOT
+	relocations on VxWorks.  Add dynamic relocations for references
+	to the VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols.  Don't
+	create dynamic relocations for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64
+	in VxWorks executables.
+	(mips_elf_allocate_dynamic_relocations): Add a bfd_link_info argument.
+	Use MIPS_ELF_RELA_SIZE to calculate the size of a VxWorks entry.
+	Don't allocate a null entry on VxWorks.
+	(mips_elf_create_dynamic_relocation): Update the call to
+	mips_elf_rel_dyn_section.  Use absolute rather than relative
+	relocations for VxWorks, and make them RELA rather than REL.
+	(_bfd_mips_elf_create_dynamic_sections): Don't make .dynamic
+	read-only on VxWorks.  Update the call to mips_elf_rel_dyn_section.
+	Create the .plt, .rela.plt, .dynbss and .rela.bss sections on
+	VxWorks.  Likewise create the _PROCEDURE_LINKAGE_TABLE symbol.
+	Call elf_vxworks_create_dynamic_sections for VxWorks and
+	initialize the plt_header_size and plt_entry_size fields.
+	(_bfd_mips_elf_check_relocs): Don't allow GOT relocations to be
+	used in VxWorks executables.  Don't allocate dynamic relocations
+	for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 in VxWorks executables.
+	Set is_relocation_target for each symbol referenced by a relocation.
+	Allocate .rela.dyn entries for relocations against the special
+	VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols.  Create GOT
+	entries for all VxWorks R_MIPS_GOT16 relocations.  Don't allocate
+	a global GOT entry for symbols mentioned in VxWorks R_MIPS_CALL*,
+	R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 relocations.  Update the calls
+	to mips_elf_rel_dyn_section and mips_elf_allocate_dynamic_relocations.
+	Set is_branch_target for symbols mentioned in R_MIPS_PC16 or R_MIPS_26
+	relocations.  Don't set no_fn_stub on VxWorks.
+	(_bfd_mips_elf_adjust_dynamic_symbol): Update the call to
+	mips_elf_allocate_dynamic_relocations.
+	(_bfd_mips_vxworks_adjust_dynamic_symbol): New function.
+	(_bfd_mips_elf_always_size_sections): Do not allocate GOT page
+	entries for VxWorks, and do not create multiple GOTs.
+	(_bfd_mips_elf_size_dynamic_sections): Use MIPS_ELF_REL_DYN_NAME.
+	Handle .got specially for VxWorks.  Update the uses of
+	MIPS_RESERVED_GOTNO and mips_elf_allocate_dynamic_relocations.
+	Check for sgotplt and splt.  Allocate the .rel(a).dyn contents last,
+	once its final size is known.  Set DF_TEXTREL for VxWorks.  Add
+	DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, DT_PLTRELSZ and DT_JMPREL
+	tags on VxWorks.  Do not add the MIPS-specific tags for VxWorks.
+	(_bfd_mips_vxworks_finish_dynamic_symbol): New function.
+	(mips_vxworks_finish_exec_plt): Likewise.
+	(mips_vxworks_finish_shared_plt): Likewise.
+	(_bfd_mips_elf_finish_dynamic_sections): Remove an unncessary call
+	to mips_elf_rel_dyn_section.  Use a VxWorks-specific value of
+	DT_PLTGOT.  Handle DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL,
+	DT_PLTRELSZ and DT_JMPREL.  Update the uses of MIPS_RESERVED_GOTNO
+	and mips_elf_rel_dyn_section.  Use a different GOT header for
+	VxWorks.  Don't sort .rela.dyn on VxWorks.  Finish the PLT on VxWorks.
+	(_bfd_mips_elf_link_hash_table_create): Initialize the new
+	mips_elf_link_hash_table fields.
+	(_bfd_mips_vxworks_link_hash_table_create): New function.
+	(_bfd_mips_elf_final_link): Set the GP value to _GLOBAL_OFFSET_TABLE_
+	on VxWorks.  Update the call to ELF_MIPS_GP_OFFSET.
+	* elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Declare.
+	(_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
+	(_bfd_mips_vxworks_link_hash_table_create): Likewise.
+	* libbfd.h: Regenerate.
+	* Makefile.am (elfxx-mips.lo): Depend on elf-vxworks.h.
+	(elf32-mips.lo): Likewise.
+	* Makefile.in: Regenerate.
+	* reloc.c (BFD_RELOC_MIPS_COPY, BFD_RELOC_MIPS_JUMP_SLOT): Declare.
+	* targets.c (bfd_elf32_bigmips_vxworks_vec): Declare.
+	(bfd_elf32_littlemips_vxworks_vec): Likewise.
+	(_bfd_target_vector): Add entries for them.
+
 2006-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
 	* elf64-hppa.c (elf64_hppa_special_sections): Change flags for .tbss
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 4300ca9ed36..77278a832a1 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -11,10 +11,14 @@ MKDEP = gcc -MM
 
 SUBDIRS = doc po
 
-docdir = doc
+bfddocdir = doc
 bfdlibdir = @bfdlibdir@
 bfdincludedir = @bfdincludedir@
 
+datarootdir = @datarootdir@
+docdir = @docdir@
+htmldir = @htmldir@
+
 bfdlib_LTLIBRARIES = libbfd.la
 
 WARN_CFLAGS = @WARN_CFLAGS@
@@ -661,6 +665,35 @@ po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES)
 
 all diststuff: info
 
+.PHONY: install-html install-html-am install-html-recursive
+
+install-html:	install-html-recursive
+
+install-html-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
 # Various kinds of .o files to put in libbfd.a:
 # BFD_BACKENDS	Routines the configured targets need.
 # BFD_MACHINES	Architecture-specific routines the configured targets need.
@@ -859,12 +892,12 @@ LIBCOFF_H_FILES = libcoff-in.h coffcode.h
 
 # Could really use a "copy-if-change"...
 headers:
-	(cd $(docdir); $(MAKE) protos $(FLAGS_TO_PASS))
-	cp $(docdir)/bfd.h bfd-in2.h-new
+	(cd $(bfddocdir); $(MAKE) protos $(FLAGS_TO_PASS))
+	cp $(bfddocdir)/bfd.h bfd-in2.h-new
 	$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
-	cp $(docdir)/libbfd.h libbfd.h-new
+	cp $(bfddocdir)/libbfd.h libbfd.h-new
 	$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
-	cp $(docdir)/libcoff.h libcoff.h-new
+	cp $(bfddocdir)/libcoff.h libcoff.h-new
 	$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
 
 # We only rebuild the header files automatically if we have been
@@ -872,22 +905,22 @@ headers:
 
 $(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
 stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES)
-	(cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
-	cp $(docdir)/bfd.h bfd-in2.h-new
+	(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
+	cp $(bfddocdir)/bfd.h bfd-in2.h-new
 	$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
 	touch stmp-bin2-h
 
 $(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
 stmp-lbfd-h: $(LIBBFD_H_FILES)
-	(cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
-	cp $(docdir)/libbfd.h libbfd.h-new
+	(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
+	cp $(bfddocdir)/libbfd.h libbfd.h-new
 	$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
 	touch stmp-lbfd-h
 
 $(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
 stmp-lcoff-h: $(LIBCOFF_H_FILES)
-	(cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
-	cp $(docdir)/libcoff.h libcoff.h-new
+	(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
+	cp $(bfddocdir)/libcoff.h libcoff.h-new
 	$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
 	touch stmp-lcoff-h
 
@@ -1350,14 +1383,14 @@ elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
   elfxx-mips.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
   $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
-  $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h
+  $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h elf-vxworks.h
 elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
   $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \
   $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \
   $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \
-  ecoffswap.h elf32-target.h
+  ecoffswap.h elf32-target.h elf-vxworks.h
 elf32-mt.lo: elf32-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mt.h \
@@ -1416,12 +1449,12 @@ elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
   $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
-  elfxx-sparc.h
+  elfxx-sparc.h elf-vxworks.h
 elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
   $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
-  elfxx-sparc.h elf32-target.h
+  elfxx-sparc.h elf32-target.h elf-vxworks.h
 elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h \
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index ef96cc7a0ea..8ed90563561 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -2,7 +2,7 @@
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# 2003, 2004, 2005  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -217,6 +217,8 @@ build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
@@ -224,6 +226,7 @@ host_cpu = @host_cpu@
 host_noncanonical = @host_noncanonical@
 host_os = @host_os@
 host_vendor = @host_vendor@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
@@ -255,7 +258,7 @@ INCDIR = $(srcdir)/../include
 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
 MKDEP = gcc -MM
 SUBDIRS = doc po
-docdir = doc
+bfddocdir = doc
 bfdlib_LTLIBRARIES = libbfd.la
 AM_CFLAGS = $(WARN_CFLAGS)
 
@@ -1265,6 +1268,35 @@ po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES)
 
 all diststuff: info
 
+.PHONY: install-html install-html-am install-html-recursive
+
+install-html:	install-html-recursive
+
+install-html-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
 stamp-ofiles: Makefile
 	rm -f tofiles
 	f=""; \
@@ -1433,12 +1465,12 @@ stmp-bfd-h: bfd-in3.h
 
 # Could really use a "copy-if-change"...
 headers:
-	(cd $(docdir); $(MAKE) protos $(FLAGS_TO_PASS))
-	cp $(docdir)/bfd.h bfd-in2.h-new
+	(cd $(bfddocdir); $(MAKE) protos $(FLAGS_TO_PASS))
+	cp $(bfddocdir)/bfd.h bfd-in2.h-new
 	$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
-	cp $(docdir)/libbfd.h libbfd.h-new
+	cp $(bfddocdir)/libbfd.h libbfd.h-new
 	$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
-	cp $(docdir)/libcoff.h libcoff.h-new
+	cp $(bfddocdir)/libcoff.h libcoff.h-new
 	$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
 
 # We only rebuild the header files automatically if we have been
@@ -1446,22 +1478,22 @@ headers:
 
 $(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
 stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES)
-	(cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
-	cp $(docdir)/bfd.h bfd-in2.h-new
+	(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
+	cp $(bfddocdir)/bfd.h bfd-in2.h-new
 	$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
 	touch stmp-bin2-h
 
 $(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
 stmp-lbfd-h: $(LIBBFD_H_FILES)
-	(cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
-	cp $(docdir)/libbfd.h libbfd.h-new
+	(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
+	cp $(bfddocdir)/libbfd.h libbfd.h-new
 	$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
 	touch stmp-lbfd-h
 
 $(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
 stmp-lcoff-h: $(LIBCOFF_H_FILES)
-	(cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
-	cp $(docdir)/libcoff.h libcoff.h-new
+	(cd $(bfddocdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
+	cp $(bfddocdir)/libcoff.h libcoff.h-new
 	$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
 	touch stmp-lcoff-h
 
@@ -1917,14 +1949,14 @@ elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
   elfxx-mips.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
   $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
-  $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h
+  $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h elf-vxworks.h
 elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
   $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \
   $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \
   $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \
-  ecoffswap.h elf32-target.h
+  ecoffswap.h elf32-target.h elf-vxworks.h
 elf32-mt.lo: elf32-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mt.h \
@@ -1983,12 +2015,12 @@ elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
   $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
-  elfxx-sparc.h
+  elfxx-sparc.h elf-vxworks.h
 elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
   $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
-  elfxx-sparc.h elf32-target.h
+  elfxx-sparc.h elf32-target.h elf-vxworks.h
 elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h \
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 4a777ed825c..63fb521b0ab 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -2588,6 +2588,11 @@ to compensate for the borrow when the low bits are added.  */
   BFD_RELOC_MIPS_TLS_TPREL_LO16,
 
 
+/* MIPS ELF relocations (VxWorks extensions).  */
+  BFD_RELOC_MIPS_COPY,
+  BFD_RELOC_MIPS_JUMP_SLOT,
+
+
 /* Fujitsu Frv Relocations.  */
   BFD_RELOC_FRV_LABEL16,
   BFD_RELOC_FRV_LABEL24,
@@ -2702,6 +2707,11 @@ in the instruction.  */
   BFD_RELOC_X86_64_TPOFF32,
   BFD_RELOC_X86_64_GOTOFF64,
   BFD_RELOC_X86_64_GOTPC32,
+  BFD_RELOC_X86_64_GOT64,
+  BFD_RELOC_X86_64_GOTPCREL64,
+  BFD_RELOC_X86_64_GOTPC64,
+  BFD_RELOC_X86_64_GOTPLT64,
+  BFD_RELOC_X86_64_PLTOFF64,
   BFD_RELOC_X86_64_GOTPC32_TLSDESC,
   BFD_RELOC_X86_64_TLSDESC_CALL,
   BFD_RELOC_X86_64_TLSDESC,
@@ -3075,6 +3085,22 @@ through 0.  */
 /* ADI Blackfin Long Jump pcrel.  */
   BFD_RELOC_BFIN_24_PCREL_JUMP_L,
 
+/* ADI Blackfin FD-PIC relocations.  */
+  BFD_RELOC_BFIN_GOT17M4,
+  BFD_RELOC_BFIN_GOTHI,
+  BFD_RELOC_BFIN_GOTLO,
+  BFD_RELOC_BFIN_FUNCDESC,
+  BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
+  BFD_RELOC_BFIN_FUNCDESC_GOTHI,
+  BFD_RELOC_BFIN_FUNCDESC_GOTLO,
+  BFD_RELOC_BFIN_FUNCDESC_VALUE,
+  BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
+  BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
+  BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
+  BFD_RELOC_BFIN_GOTOFF17M4,
+  BFD_RELOC_BFIN_GOTOFFHI,
+  BFD_RELOC_BFIN_GOTOFFLO,
+
 /* ADI Blackfin GOT relocation.  */
   BFD_RELOC_BFIN_GOT,
 
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 37dd03cee69..4fd72c1c152 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -313,7 +313,8 @@ case "${targ}" in
 
   bfin-*-*)
     targ_defvec=bfd_elf32_bfin_vec
-    tar_underscore=yes
+    targ_selvecs=bfd_elf32_bfinfdpic_vec
+    targ_underscore=yes
     ;;
 
   c30-*-*aout* | tic30-*-*aout*)
@@ -868,6 +869,16 @@ case "${targ}" in
     targ_defvec=ecoff_big_vec
     targ_selvecs=ecoff_little_vec
     ;;
+#ifdef BFD64
+  mips*el-*-vxworks*)
+    targ_defvec=bfd_elf32_littlemips_vxworks_vec
+    targ_selvecs="bfd_elf32_littlemips_vec bfd_elf32_bigmips_vxworks_vec bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+    ;;
+  mips*-*-vxworks*)
+    targ_defvec=bfd_elf32_bigmips_vxworks_vec
+    targ_selvecs="bfd_elf32_bigmips_vec bfd_elf32_littlemips_vxworks_vec bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+    ;;
+#endif
   mips*el-*-elf* | mips*el-*-vxworks* | mips*-*-chorus*)
     targ_defvec=bfd_elf32_littlemips_vec
     targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
@@ -1273,6 +1284,10 @@ case "${targ}" in
   sparc-*-sysv4*)
     targ_defvec=bfd_elf32_sparc_vec
     ;;
+  sparc-*-vxworks*)
+    targ_defvec=bfd_elf32_sparc_vxworks_vec
+    targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+    ;;
   sparc-*-netware*)
     targ_defvec=bfd_elf32_sparc_vec
     targ_selvecs="nlm32_sparc_vec sunos_big_vec"
diff --git a/bfd/configure b/bfd/configure
index ef1d5b50a26..1e0be1d02b9 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB LN_S LIBTOOL WARN_CFLAGS NO_WERROR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB LN_S LIBTOOL WARN_CFLAGS NO_WERROR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults datarootdir docdir htmldir LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -13071,6 +13071,7 @@ do
     bfd_elf32_am33lin_vec)	tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
     bfd_elf32_avr_vec)		tb="$tb elf32-avr.lo elf32.lo $elf" ;;
     bfd_elf32_bfin_vec)		tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
+    bfd_elf32_bfinfdpic_vec)	tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
     bfd_elf32_big_generic_vec) 	tb="$tb elf32-gen.lo elf32.lo $elf" ;;
     bfd_elf32_bigarc_vec)	tb="$tb elf32-arc.lo elf32.lo $elf" ;;
     bfd_elf32_bigarm_vec)	tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
@@ -13078,7 +13079,9 @@ do
                                 tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
     bfd_elf32_bigarm_vxworks_vec)
                                 tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
-    bfd_elf32_bigmips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
+    bfd_elf32_bigmips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+    bfd_elf32_bigmips_vxworks_vec)
+			 	tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_cr16c_vec)	tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
     bfd_elf32_cris_vec)		tb="$tb elf32-cris.lo elf32.lo $elf" ;;
     bfd_elf32_crx_vec)          tb="$tb elf32-crx.lo elf32.lo $elf" ;;
@@ -13110,7 +13113,9 @@ do
     bfd_elf32_littlearm_vxworks_vec)
                                 tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
     bfd_elf32_littlearm_vec)	tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
-    bfd_elf32_littlemips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
+    bfd_elf32_littlemips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+    bfd_elf32_littlemips_vxworks_vec)
+			 	tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_m32c_vec)         tb="$tb elf32-m32c.lo elf32.lo $elf" ;;
     bfd_elf32_m32r_vec)		tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
     bfd_elf32_m32rle_vec)       tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
@@ -13126,10 +13131,10 @@ do
     bfd_elf32_mn10300_vec)	tb="$tb elf-m10300.lo elf32.lo $elf" ;;
     bfd_elf32_mt_vec)           tb="$tb elf32-mt.lo elf32.lo $elf" ;;
     bfd_elf32_msp430_vec)	tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
-    bfd_elf32_nbigmips_vec)	tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
-    bfd_elf32_nlittlemips_vec)	tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
-    bfd_elf32_ntradbigmips_vec)	tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
-    bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf32_nbigmips_vec)	tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf32_nlittlemips_vec)	tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf32_ntradbigmips_vec)	tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     bfd_elf32_openrisc_vec)	tb="$tb elf32-openrisc.lo elf32.lo $elf" ;;
     bfd_elf32_or32_big_vec)	tb="$tb elf32-or32.lo elf32.lo $elf" ;;
     bfd_elf32_pj_vec)           tb="$tb elf32-pj.lo elf32.lo $elf";;
@@ -13154,9 +13159,10 @@ do
     bfd_elf32_shlin_vec)	tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     bfd_elf32_shlnbsd_vec)	tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     bfd_elf32_shnbsd_vec)	tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
-    bfd_elf32_sparc_vec)	tb="$tb elf32-sparc.lo elfxx-sparc.lo elf32.lo $elf" ;;
-    bfd_elf32_tradbigmips_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
-    bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
+    bfd_elf32_sparc_vec)	tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+    bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+    bfd_elf32_tradbigmips_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+    bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_us_cris_vec)	tb="$tb elf32-cris.lo elf32.lo $elf" ;;
     bfd_elf32_v850_vec)		tb="$tb elf32-v850.lo elf32.lo $elf" ;;
     bfd_elf32_vax_vec)		tb="$tb elf32-vax.lo elf32.lo $elf" ;;
@@ -13167,14 +13173,14 @@ do
     bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_alpha_vec)	tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_big_generic_vec) 	tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
-    bfd_elf64_bigmips_vec) 	tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf64_bigmips_vec) 	tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     bfd_elf64_hppa_linux_vec)	tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_hppa_vec)		tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_ia64_big_vec)	tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_ia64_little_vec)	tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
-    bfd_elf64_littlemips_vec) 	tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf64_littlemips_vec) 	tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     bfd_elf64_mmix_vec) 	tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_powerpc_vec)	tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_powerpcle_vec)	tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
@@ -13185,9 +13191,9 @@ do
     bfd_elf64_sh64blin_vec)	tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sh64lnbsd_vec)	tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sh64nbsd_vec)	tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
-    bfd_elf64_sparc_vec)	tb="$tb elf64-sparc.lo elfxx-sparc.lo elf64.lo $elf"; target_size=64 ;;
-    bfd_elf64_tradbigmips_vec)	tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
-    bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf64_sparc_vec)	tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
+    bfd_elf64_tradbigmips_vec)	tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     bfd_elf64_x86_64_vec)	tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
     bfd_mmo_vec)		tb="$tb mmo.lo" target_size=64 ;;
     bfd_powerpc_pe_vec)         tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
@@ -14520,6 +14526,11 @@ rm -f doc/config.status
 
           ac_config_commands="$ac_config_commands default"
 
+
+
+
+
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -15288,6 +15299,9 @@ s,@bfd_default_target_size@,$bfd_default_target_size,;t t
 s,@bfd_file_ptr@,$bfd_file_ptr,;t t
 s,@bfd_ufile_ptr@,$bfd_ufile_ptr,;t t
 s,@tdefaults@,$tdefaults,;t t
+s,@datarootdir@,$datarootdir,;t t
+s,@docdir@,$docdir,;t t
+s,@htmldir@,$htmldir,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
diff --git a/bfd/configure.in b/bfd/configure.in
index 5aaf17db8fe..963e56238b2 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -584,6 +584,7 @@ do
     bfd_elf32_am33lin_vec)	tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
     bfd_elf32_avr_vec)		tb="$tb elf32-avr.lo elf32.lo $elf" ;;
     bfd_elf32_bfin_vec)		tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
+    bfd_elf32_bfinfdpic_vec)	tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
     bfd_elf32_big_generic_vec) 	tb="$tb elf32-gen.lo elf32.lo $elf" ;;
     bfd_elf32_bigarc_vec)	tb="$tb elf32-arc.lo elf32.lo $elf" ;;
     bfd_elf32_bigarm_vec)	tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
@@ -591,7 +592,9 @@ do
                                 tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
     bfd_elf32_bigarm_vxworks_vec)	
                                 tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
-    bfd_elf32_bigmips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
+    bfd_elf32_bigmips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+    bfd_elf32_bigmips_vxworks_vec)
+			 	tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_cr16c_vec)	tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
     bfd_elf32_cris_vec)		tb="$tb elf32-cris.lo elf32.lo $elf" ;;
     bfd_elf32_crx_vec)          tb="$tb elf32-crx.lo elf32.lo $elf" ;;    
@@ -623,7 +626,9 @@ do
     bfd_elf32_littlearm_vxworks_vec)
                                 tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
     bfd_elf32_littlearm_vec)	tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
-    bfd_elf32_littlemips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
+    bfd_elf32_littlemips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+    bfd_elf32_littlemips_vxworks_vec)
+			 	tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_m32c_vec)         tb="$tb elf32-m32c.lo elf32.lo $elf" ;;
     bfd_elf32_m32r_vec)		tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
     bfd_elf32_m32rle_vec)       tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
@@ -639,10 +644,10 @@ do
     bfd_elf32_mn10300_vec)	tb="$tb elf-m10300.lo elf32.lo $elf" ;;
     bfd_elf32_mt_vec)           tb="$tb elf32-mt.lo elf32.lo $elf" ;;
     bfd_elf32_msp430_vec)	tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
-    bfd_elf32_nbigmips_vec)	tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
-    bfd_elf32_nlittlemips_vec)	tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
-    bfd_elf32_ntradbigmips_vec)	tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
-    bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf32_nbigmips_vec)	tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf32_nlittlemips_vec)	tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf32_ntradbigmips_vec)	tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     bfd_elf32_openrisc_vec)	tb="$tb elf32-openrisc.lo elf32.lo $elf" ;;
     bfd_elf32_or32_big_vec)	tb="$tb elf32-or32.lo elf32.lo $elf" ;;
     bfd_elf32_pj_vec)           tb="$tb elf32-pj.lo elf32.lo $elf";;
@@ -667,9 +672,10 @@ do
     bfd_elf32_shlin_vec)	tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     bfd_elf32_shlnbsd_vec)	tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     bfd_elf32_shnbsd_vec)	tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
-    bfd_elf32_sparc_vec)	tb="$tb elf32-sparc.lo elfxx-sparc.lo elf32.lo $elf" ;;
-    bfd_elf32_tradbigmips_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
-    bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
+    bfd_elf32_sparc_vec)	tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+    bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+    bfd_elf32_tradbigmips_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+    bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_us_cris_vec)	tb="$tb elf32-cris.lo elf32.lo $elf" ;;
     bfd_elf32_v850_vec)		tb="$tb elf32-v850.lo elf32.lo $elf" ;;
     bfd_elf32_vax_vec)		tb="$tb elf32-vax.lo elf32.lo $elf" ;;
@@ -680,14 +686,14 @@ do
     bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_alpha_vec)	tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_big_generic_vec) 	tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
-    bfd_elf64_bigmips_vec) 	tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf64_bigmips_vec) 	tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     bfd_elf64_hppa_linux_vec)	tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_hppa_vec)		tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_ia64_big_vec)	tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_ia64_little_vec)	tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
-    bfd_elf64_littlemips_vec) 	tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf64_littlemips_vec) 	tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     bfd_elf64_mmix_vec) 	tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_powerpc_vec)	tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_powerpcle_vec)	tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
@@ -698,9 +704,9 @@ do
     bfd_elf64_sh64blin_vec)	tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sh64lnbsd_vec)	tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sh64nbsd_vec)	tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
-    bfd_elf64_sparc_vec)	tb="$tb elf64-sparc.lo elfxx-sparc.lo elf64.lo $elf"; target_size=64 ;;
-    bfd_elf64_tradbigmips_vec)	tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
-    bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf64_sparc_vec)	tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
+    bfd_elf64_tradbigmips_vec)	tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+    bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     bfd_elf64_x86_64_vec)	tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
     bfd_mmo_vec)		tb="$tb mmo.lo" target_size=64 ;;
     bfd_powerpc_pe_vec)         tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
@@ -957,5 +963,11 @@ esac
 rm -f doc/config.status
 AC_CONFIG_FILES([Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in])
 AC_CONFIG_COMMANDS([default],[[sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile]],[[]])
+
+dnl Required by html and install-html
+AC_SUBST(datarootdir)
+AC_SUBST(docdir)
+AC_SUBST(htmldir)
+
 AC_OUTPUT
 
diff --git a/bfd/cpu-m68k.c b/bfd/cpu-m68k.c
index 83aaa254c1f..366278960a6 100644
--- a/bfd/cpu-m68k.c
+++ b/bfd/cpu-m68k.c
@@ -208,9 +208,16 @@ bfd_m68k_compatible (const bfd_arch_info_type *a,
       /* Merge cf machine.  */
       unsigned features = (bfd_m68k_mach_to_features (a->mach)
 			   | bfd_m68k_mach_to_features (b->mach));
-      unsigned machine = bfd_m68k_features_to_mach (features);
 
-      return bfd_lookup_arch (a->arch, machine);
+      /* ISA A+ and ISA B are incompatible.  */
+      if ((~features & (mcfisa_aa | mcfisa_b)) == 0)
+	return NULL;
+
+      /* MAC and EMAC code cannot be merged.  */
+      if ((~features & (mcfmac | mcfemac)) == 0)
+	return NULL;
+
+      return bfd_lookup_arch (a->arch, bfd_m68k_features_to_mach (features));
     }
   else
     /* They are incompatible.  */
diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog
index dd9b8b0cdd9..d00fd99332f 100644
--- a/bfd/doc/ChangeLog
+++ b/bfd/doc/ChangeLog
@@ -1,4 +1,10 @@
-2006-02-27  Carlos O'Donell  <carlos@codesourcery.com
+2006-04-06  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* Makefile.am: Add install-html and install-html-am targets. 
+	Define datarootdir, docdir and htmldir.
+	* Makefile.in: Regenerate.
+
+2006-02-27  Carlos O'Donell  <carlos@codesourcery.com>
 
 	* Makefile.am: Add html target.
 	* Makefile.in: Regenerate.
diff --git a/bfd/doc/Makefile.am b/bfd/doc/Makefile.am
index 7bee26d6c2c..6d221faad4a 100644
--- a/bfd/doc/Makefile.am
+++ b/bfd/doc/Makefile.am
@@ -287,3 +287,28 @@ MAINTAINERCLEANFILES = $(DOCFILES)
 # We want install to imply install-info as per GNU standards, despite the
 # cygnus option.
 install: install-info
+
+html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+
+install-html: install-html-am
+
+install-html-am: $(HTMLS)
+	@$(NORMAL_INSTALL)
+	test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
+	@list='$(HTMLS)'; for p in $$list; do \
+	  if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
+	  f=$(html__strip_dir) \
+	  if test -d "$$d$$p"; then \
+	    echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+	    echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+	  else \
+	    echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+	  fi; \
+	done
+
+
+
+
diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in
index fa92e707521..ad81061ec7b 100644
--- a/bfd/doc/Makefile.in
+++ b/bfd/doc/Makefile.in
@@ -181,6 +181,8 @@ build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
@@ -188,6 +190,7 @@ host_cpu = @host_cpu@
 host_noncanonical = @host_noncanonical@
 host_os = @host_os@
 host_vendor = @host_vendor@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
@@ -313,6 +316,7 @@ MOSTLYCLEANFILES = $(MKDOC) *.o
 CLEANFILES = *.p *.ip
 DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log
 MAINTAINERCLEANFILES = $(DOCFILES)
+html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 all: all-am
 
 .SUFFIXES:
@@ -761,6 +765,25 @@ bfd.h: $(BFD_H_DEP)
 # We want install to imply install-info as per GNU standards, despite the
 # cygnus option.
 install: install-info
+
+install-html: install-html-am
+
+install-html-am: $(HTMLS)
+	@$(NORMAL_INSTALL)
+	test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
+	@list='$(HTMLS)'; for p in $$list; do \
+	  if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
+	  f=$(html__strip_dir) \
+	  if test -d "$$d$$p"; then \
+	    echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+	    echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+	  else \
+	    echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+	  fi; \
+	done
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index 13c32015202..d5a81dbc605 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -1,4 +1,4 @@
-/* ADI Blackfin BFD support for 32-bit ELF. 
+/* ADI Blackfin BFD support for 32-bit ELF.
    Copyright 2005, 2006 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -23,167 +23,8 @@
 #include "libbfd.h"
 #include "elf-bfd.h"
 #include "elf/bfin.h"
-
-/* Handling expression relocations for blackfin.  Blackfin
-   will generate relocations in an expression form with a stack.
-   A relocation such as P1.H  = _typenames-4000000;
-   will generate the following relocs at offset 4:
-00000004 R_expst_push      _typenames
-00000004 R_expst_const     .__constant
-00000004 R_expst_sub       .__operator
-00000006 R_huimm16         .__operator
-
-   The .__constant and .__operator symbol names are fake.
-   Special case is a single relocation
-     P1.L  = _typenames; generates
-00000002 R_luimm16         _typenames
-
-   Thus, if you get a R_luimm16, R_huimm16, R_imm16,
-   if the stack is not empty, pop the stack and
-   put the value, else do the normal thing
-   We will currently assume that the max the stack
-   would grow to is 100. .  */
-
-#define RELOC_STACK_SIZE 100
-static bfd_vma reloc_stack[RELOC_STACK_SIZE];
-static unsigned int reloc_stack_tos = 0;
-
-#define is_reloc_stack_empty() ((reloc_stack_tos > 0) ? 0 : 1)
-
-static void
-reloc_stack_push (bfd_vma value)
-{
-  reloc_stack[reloc_stack_tos++] = value;
-}
-
-static bfd_vma
-reloc_stack_pop (void)
-{
-  return reloc_stack[--reloc_stack_tos];
-}
-
-static bfd_vma
-reloc_stack_operate (unsigned int oper)
-{
-  bfd_vma value;
-  switch (oper)
-    {
-    case R_add:
-      {
-	value =
-	  reloc_stack[reloc_stack_tos - 2] + reloc_stack[reloc_stack_tos - 1];
-	reloc_stack_tos -= 2;
-	break;
-      }
-    case R_sub:
-      {
-	value =
-	  reloc_stack[reloc_stack_tos - 2] - reloc_stack[reloc_stack_tos - 1];
-	reloc_stack_tos -= 2;
-	break;
-      }
-    case R_mult:
-      {
-	value =
-	  reloc_stack[reloc_stack_tos - 2] * reloc_stack[reloc_stack_tos - 1];
-	reloc_stack_tos -= 2;
-	break;
-      }
-    case R_div:
-      {
-	if (reloc_stack[reloc_stack_tos - 1] == 0)
-	  {
-	    _bfd_abort (__FILE__, __LINE__, _("Division by zero. "));
-	  }
-	else
-	  {
-	    value =
-	      reloc_stack[reloc_stack_tos - 2] / reloc_stack[reloc_stack_tos - 1];
-	    reloc_stack_tos -= 2;
-	  }
-	break;
-      }
-    case R_mod:
-      {
-	value =
-	  reloc_stack[reloc_stack_tos - 2] % reloc_stack[reloc_stack_tos - 1];
-	reloc_stack_tos -= 2;
-	break;
-      }
-    case R_lshift:
-      {
-	value =
-	  reloc_stack[reloc_stack_tos - 2] << reloc_stack[reloc_stack_tos -
-							  1];
-	reloc_stack_tos -= 2;
-	break;
-      }
-    case R_rshift:
-      {
-	value =
-	  reloc_stack[reloc_stack_tos - 2] >> reloc_stack[reloc_stack_tos -
-							  1];
-	reloc_stack_tos -= 2;
-	break;
-      }
-    case R_and:
-      {
-	value =
-	  reloc_stack[reloc_stack_tos - 2] & reloc_stack[reloc_stack_tos - 1];
-	reloc_stack_tos -= 2;
-	break;
-      }
-    case R_or:
-      {
-	value =
-	  reloc_stack[reloc_stack_tos - 2] | reloc_stack[reloc_stack_tos - 1];
-	reloc_stack_tos -= 2;
-	break;
-      }
-    case R_xor:
-      {
-	value =
-	  reloc_stack[reloc_stack_tos - 2] ^ reloc_stack[reloc_stack_tos - 1];
-	reloc_stack_tos -= 2;
-	break;
-      }
-    case R_land:
-      {
-	value = reloc_stack[reloc_stack_tos - 2]
-	  && reloc_stack[reloc_stack_tos - 1];
-	reloc_stack_tos -= 2;
-	break;
-      }
-    case R_lor:
-      {
-	value = reloc_stack[reloc_stack_tos - 2]
-	  || reloc_stack[reloc_stack_tos - 1];
-	reloc_stack_tos -= 2;
-	break;
-      }
-    case R_neg:
-      {
-	value = -reloc_stack[reloc_stack_tos - 1];
-	reloc_stack_tos--;
-	break;
-      }
-    case R_comp:
-      {
-	value = ~reloc_stack[reloc_stack_tos - 1];
-	reloc_stack_tos -= 1;
-	break;
-      }
-    default:
-      {
-	fprintf (stderr, "bfin relocation : Internal bug\n");
-	return 0;
-      }
-    }
-
-  reloc_stack_push (value);
-
-  return value;
-}
+#include "elf/dwarf2.h"
+#include "hashtab.h"
 
 /* FUNCTION : bfin_pltpc_reloc
    ABSTRACT : TODO : figure out how to handle pltpc relocs.  */
@@ -195,10 +36,10 @@ bfin_pltpc_reloc (
      PTR data ATTRIBUTE_UNUSED,
      asection *input_section ATTRIBUTE_UNUSED,
      bfd *output_bfd ATTRIBUTE_UNUSED,
-     char **error_message ATTRIBUTE_UNUSED) 
+     char **error_message ATTRIBUTE_UNUSED)
 {
   bfd_reloc_status_type flag = bfd_reloc_ok;
-  return flag; 
+  return flag;
 }
 
 
@@ -221,49 +62,44 @@ bfin_pcrel24_reloc (bfd *abfd,
   if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
-  if (!is_reloc_stack_empty ())
-    relocation = reloc_stack_pop();
+  if (bfd_is_und_section (symbol->section)
+      && (symbol->flags & BSF_WEAK) == 0
+      && !relocatable)
+    return bfd_reloc_undefined;
+
+  if (bfd_is_com_section (symbol->section))
+    relocation = 0;
   else
-    {
-      if (bfd_is_und_section (symbol->section)
-          && (symbol->flags & BSF_WEAK) == 0
-          && !relocatable)
-        return bfd_reloc_undefined;
+    relocation = symbol->value;
 
-      if (bfd_is_com_section (symbol->section))
-	relocation = 0;
-      else
-	relocation = symbol->value;       
+  output_section = symbol->section->output_section;
+
+  if (relocatable)
+    output_base = 0;
+  else
+    output_base = output_section->vma;
+
+  if (!relocatable || !strcmp (symbol->name, symbol->section->name))
+    relocation += output_base + symbol->section->output_offset;
 
-      output_section = symbol->section->output_section;
+  if (!relocatable && !strcmp (symbol->name, symbol->section->name))
+    relocation += reloc_entry->addend;
 
-      if (relocatable)
-	output_base = 0;
-      else
-	output_base = output_section->vma;
-      
-      if (!relocatable || !strcmp (symbol->name, symbol->section->name))
-	relocation += output_base + symbol->section->output_offset;
-        
-      if (!relocatable && !strcmp (symbol->name, symbol->section->name))
-        relocation += reloc_entry->addend;
-    }
-      
   relocation -= input_section->output_section->vma + input_section->output_offset;
   relocation -= reloc_entry->address;
 
   if (howto->complain_on_overflow != complain_overflow_dont)
     {
       bfd_reloc_status_type status;
-      status= bfd_check_overflow (howto->complain_on_overflow, 
-                                  howto->bitsize,
-                                  howto->rightshift, 
-                                  bfd_arch_bits_per_address(abfd),
-                                  relocation);      
+      status = bfd_check_overflow (howto->complain_on_overflow,
+				   howto->bitsize,
+				   howto->rightshift,
+				   bfd_arch_bits_per_address(abfd),
+				   relocation);
       if (status != bfd_reloc_ok)
 	return status;
     }
-      
+
   /* if rightshift is 1 and the number odd, return error.  */
   if (howto->rightshift && (relocation & 0x01))
     {
@@ -286,11 +122,11 @@ bfin_pcrel24_reloc (bfd *abfd,
     short x;
 
     /* We are getting reloc_entry->address 2 byte off from
-    the start of instruction. Assuming absolute postion
-    of the reloc data. But, following code had been written assuming 
-    reloc address is starting at begining of instruction.
-    To compensate that I have increased the value of 
-    relocation by 1 (effectively 2) and used the addr -2 instead of addr.  */ 
+       the start of instruction. Assuming absolute postion
+       of the reloc data. But, following code had been written assuming
+       reloc address is starting at begining of instruction.
+       To compensate that I have increased the value of
+       relocation by 1 (effectively 2) and used the addr -2 instead of addr.  */
 
     relocation += 1;
     x = bfd_get_16 (abfd, (bfd_byte *) data + addr - 2);
@@ -305,30 +141,32 @@ bfin_pcrel24_reloc (bfd *abfd,
 }
 
 static bfd_reloc_status_type
-bfin_push_reloc (bfd *abfd ATTRIBUTE_UNUSED,
-     		 arelent *reloc_entry,
-     		 asymbol *symbol,
-     		 PTR data ATTRIBUTE_UNUSED,
-     		 asection *input_section,
-     		 bfd *output_bfd,
-     		 char **error_message ATTRIBUTE_UNUSED) 
+bfin_imm16_reloc (bfd *abfd,
+     		  arelent *reloc_entry,
+     		  asymbol *symbol,
+     		  PTR data,
+     		  asection *input_section,
+     		  bfd *output_bfd,
+     		  char **error_message ATTRIBUTE_UNUSED)
 {
-  bfd_vma relocation;
+  bfd_vma relocation, x;
+  bfd_size_type reloc_addr = reloc_entry->address;
   bfd_vma output_base = 0;
+  reloc_howto_type *howto = reloc_entry->howto;
   asection *output_section;
   bfd_boolean relocatable = (output_bfd != NULL);
 
+  /* Is the address of the relocation really within the section?  */
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
+    return bfd_reloc_outofrange;
+
   if (bfd_is_und_section (symbol->section)
       && (symbol->flags & BSF_WEAK) == 0
       && !relocatable)
     return bfd_reloc_undefined;
 
-  /* Is the address of the relocation really within the section?  */
-  if (reloc_entry->address > bfd_get_section_limit(abfd, input_section))
-     return bfd_reloc_outofrange;
-      
   output_section = symbol->section->output_section;
-  relocation = symbol->value;      
+  relocation = symbol->value;
 
   /* Convert input-section-relative symbol value to absolute.  */
   if (relocatable)
@@ -336,7 +174,7 @@ bfin_push_reloc (bfd *abfd ATTRIBUTE_UNUSED,
   else
     output_base = output_section->vma;
 
-  if (!relocatable || !strcmp(symbol->name, symbol->section->name))
+  if (!relocatable || !strcmp (symbol->name, symbol->section->name))
     relocation += output_base + symbol->section->output_offset;
 
   /* Add in supplied addend.  */
@@ -347,105 +185,6 @@ bfin_push_reloc (bfd *abfd ATTRIBUTE_UNUSED,
       reloc_entry->address += input_section->output_offset;
       reloc_entry->addend += symbol->section->output_offset;
     }
-
-  /* Now that we have the value, push it. */
-  reloc_stack_push (relocation);
-  
-  return bfd_reloc_ok;
-}
-
-static bfd_reloc_status_type
-bfin_oper_reloc (bfd *abfd ATTRIBUTE_UNUSED,
-     		 arelent *reloc_entry,
-     		 asymbol *symbol ATTRIBUTE_UNUSED,
-     		 PTR data ATTRIBUTE_UNUSED,
-     		 asection *input_section,
-     		 bfd *output_bfd,
-     		 char **error_message ATTRIBUTE_UNUSED) 
-{
-  bfd_boolean relocatable = (output_bfd != NULL);
-
-  /* Just call the operation based on the reloc_type.  */
-  reloc_stack_operate (reloc_entry->howto->type);
-  
-  if (relocatable)
-    reloc_entry->address += input_section->output_offset;
-
-  return bfd_reloc_ok;
-}
-
-static bfd_reloc_status_type
-bfin_const_reloc (bfd *abfd ATTRIBUTE_UNUSED,
-     		  arelent *reloc_entry,
-     		  asymbol *symbol ATTRIBUTE_UNUSED,
-     		  PTR data ATTRIBUTE_UNUSED,
-     		  asection *input_section,
-     		  bfd *output_bfd,
-     		  char **error_message ATTRIBUTE_UNUSED) 
-{
-  bfd_boolean relocatable = (output_bfd != NULL);
-
-  /* Push the addend portion of the relocation.  */
-  reloc_stack_push (reloc_entry->addend);
-
-  if (relocatable)
-    reloc_entry->address += input_section->output_offset;
-  
-  return bfd_reloc_ok;
-}
-
-static bfd_reloc_status_type
-bfin_imm16_reloc (bfd *abfd,
-     		  arelent *reloc_entry,
-     		  asymbol *symbol,
-     		  PTR data,
-     		  asection *input_section,
-     		  bfd *output_bfd,
-     		  char **error_message ATTRIBUTE_UNUSED) 
-{
-  bfd_vma relocation, x;
-  bfd_size_type reloc_addr = reloc_entry->address;
-  bfd_vma output_base = 0;
-  reloc_howto_type *howto = reloc_entry->howto;
-  asection *output_section;
-  bfd_boolean relocatable = (output_bfd != NULL);
-
-  /* Is the address of the relocation really within the section?  */
-  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
-    return bfd_reloc_outofrange;
-
-  if (is_reloc_stack_empty ())
-    {
-      if (bfd_is_und_section (symbol->section)
-          && (symbol->flags & BSF_WEAK) == 0
-          && !relocatable)
-        return bfd_reloc_undefined;
-
-      output_section = symbol->section->output_section;
-      relocation = symbol->value;      
-
-      /* Convert input-section-relative symbol value to absolute.  */
-      if (relocatable)
-        output_base = 0;
-      else
-	output_base = output_section->vma;
-  
-      if (!relocatable || !strcmp (symbol->name, symbol->section->name))
-	relocation += output_base + symbol->section->output_offset;
-
-      /* Add in supplied addend.  */
-      relocation += reloc_entry->addend;
-    }
-  else
-    {
-      relocation = reloc_stack_pop ();
-    }
-
-  if (relocatable)
-    {	              
-      reloc_entry->address += input_section->output_offset;
-      reloc_entry->addend += symbol->section->output_offset;
-    }
   else
     {
       reloc_entry->addend = 0;
@@ -455,15 +194,14 @@ bfin_imm16_reloc (bfd *abfd,
     {
       bfd_reloc_status_type flag;
       flag = bfd_check_overflow (howto->complain_on_overflow,
-                                 howto->bitsize,
-                                 howto->rightshift,
-                                 bfd_arch_bits_per_address(abfd),
-                                 relocation);
+				 howto->bitsize,
+				 howto->rightshift,
+				 bfd_arch_bits_per_address(abfd),
+				 relocation);
       if (flag != bfd_reloc_ok)
-        return flag;
+	return flag;
     }
 
-
   /* Here the variable relocation holds the final address of the
      symbol we are relocating against, plus any addend.  */
 
@@ -481,7 +219,7 @@ bfin_byte4_reloc (bfd *abfd,
                   PTR data,
                   asection *input_section,
                   bfd *output_bfd,
-                  char **error_message ATTRIBUTE_UNUSED) 
+                  char **error_message ATTRIBUTE_UNUSED)
 {
   bfd_vma relocation, x;
   bfd_size_type addr = reloc_entry->address;
@@ -493,39 +231,31 @@ bfin_byte4_reloc (bfd *abfd,
   if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
-  if (is_reloc_stack_empty ())
-    {
-      if (bfd_is_und_section (symbol->section)
-          && (symbol->flags & BSF_WEAK) == 0
-          && !relocatable)
-        return bfd_reloc_undefined;
-
-      output_section = symbol->section->output_section;
-      relocation = symbol->value;      
-      /* Convert input-section-relative symbol value to absolute.  */
-      if (relocatable)
-	output_base = 0;
-      else
-	output_base = output_section->vma;
-  
-      if ((symbol->name 
-	  && symbol->section->name
-          && !strcmp (symbol->name, symbol->section->name))
-          || !relocatable)
-        {
-	  relocation += output_base + symbol->section->output_offset;
-	}
+  if (bfd_is_und_section (symbol->section)
+      && (symbol->flags & BSF_WEAK) == 0
+      && !relocatable)
+    return bfd_reloc_undefined;
 
-      relocation += reloc_entry->addend;
-    }
+  output_section = symbol->section->output_section;
+  relocation = symbol->value;
+  /* Convert input-section-relative symbol value to absolute.  */
+  if (relocatable)
+    output_base = 0;
   else
+    output_base = output_section->vma;
+
+  if ((symbol->name
+       && symbol->section->name
+       && !strcmp (symbol->name, symbol->section->name))
+      || !relocatable)
     {
-      relocation = reloc_stack_pop();
-      relocation += reloc_entry->addend;
+      relocation += output_base + symbol->section->output_offset;
     }
 
+  relocation += reloc_entry->addend;
+
   if (relocatable)
-    { 
+    {
       /* This output will be relocatable ... like ld -r. */
       reloc_entry->address += input_section->output_offset;
       reloc_entry->addend += symbol->section->output_offset;
@@ -540,7 +270,7 @@ bfin_byte4_reloc (bfd *abfd,
   x = relocation & 0xFFFF0000;
   x >>=16;
   bfd_put_16 (abfd, x, (unsigned char *) data + addr + 2);
-            
+
   x = relocation & 0x0000FFFF;
   bfd_put_16 (abfd, x, (unsigned char *) data + addr);
   return bfd_reloc_ok;
@@ -568,42 +298,34 @@ bfin_bfd_reloc (bfd *abfd,
   if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
-  if (is_reloc_stack_empty())
-    {
-      if (bfd_is_und_section (symbol->section)
-          && (symbol->flags & BSF_WEAK) == 0
-          && !relocatable)
-        return bfd_reloc_undefined;
+  if (bfd_is_und_section (symbol->section)
+      && (symbol->flags & BSF_WEAK) == 0
+      && !relocatable)
+    return bfd_reloc_undefined;
 
-      /* Get symbol value.  (Common symbols are special.)  */
-      if (bfd_is_com_section (symbol->section))
-        relocation = 0;
-      else
-        relocation = symbol->value;       
-  
-      output_section = symbol->section->output_section;
-        
-      /* Convert input-section-relative symbol value to absolute.  */
-      if (relocatable)
-	output_base = 0;
-      else
-	output_base = output_section->vma;
-        
-      if (!relocatable || !strcmp (symbol->name, symbol->section->name))
-        relocation += output_base + symbol->section->output_offset;
-
-     if (!relocatable && !strcmp (symbol->name, symbol->section->name))
-       {
-         /* Add in supplied addend.  */
-         relocation += reloc_entry->addend;
-       }
-        
-    }
+  /* Get symbol value.  (Common symbols are special.)  */
+  if (bfd_is_com_section (symbol->section))
+    relocation = 0;
+  else
+    relocation = symbol->value;
+
+  output_section = symbol->section->output_section;
+
+  /* Convert input-section-relative symbol value to absolute.  */
+  if (relocatable)
+    output_base = 0;
   else
+    output_base = output_section->vma;
+
+  if (!relocatable || !strcmp (symbol->name, symbol->section->name))
+    relocation += output_base + symbol->section->output_offset;
+
+  if (!relocatable && !strcmp (symbol->name, symbol->section->name))
     {
-      relocation = reloc_stack_pop();
+      /* Add in supplied addend.  */
+      relocation += reloc_entry->addend;
     }
-      
+
   /* Here the variable relocation holds the final address of the
      symbol we are relocating against, plus any addend.  */
 
@@ -625,15 +347,15 @@ bfin_bfd_reloc (bfd *abfd,
     {
       bfd_reloc_status_type status;
 
-      status = bfd_check_overflow (howto->complain_on_overflow, 
+      status = bfd_check_overflow (howto->complain_on_overflow,
                                   howto->bitsize,
-                                  howto->rightshift, 
+                                  howto->rightshift,
                                   bfd_arch_bits_per_address(abfd),
                                   relocation);
       if (status != bfd_reloc_ok)
 	return status;
     }
-      
+
   /* If rightshift is 1 and the number odd, return error.  */
   if (howto->rightshift && (relocation & 0x01))
     {
@@ -647,7 +369,7 @@ bfin_bfd_reloc (bfd *abfd,
 
   relocation <<= (bfd_vma) howto->bitpos;
 
-#define DOIT(x) \
+#define DOIT(x)								\
   x = ( (x & ~howto->dst_mask) | (relocation & howto->dst_mask))
 
   /* handle 8 and 16 bit relocations here. */
@@ -673,41 +395,9 @@ bfin_bfd_reloc (bfd *abfd,
       return bfd_reloc_other;
     }
 
-   return bfd_reloc_ok;
+  return bfd_reloc_ok;
 }
 
-#if 0
-static bfd_reloc_status_type bfin_bfd_reloc
-  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_reloc_status_type bfin_imm16_reloc
-  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_reloc_status_type bfin_pcrel24_reloc
-  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_reloc_status_type bfin_pltpc_reloc
-  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_reloc_status_type bfin_const_reloc
-  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_reloc_status_type bfin_oper_reloc
-  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_reloc_status_type bfin_byte4_reloc
-  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_reloc_status_type bfin_push_reloc
-  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_boolean bfin_is_local_label_name
-  PARAMS ((bfd *, const char *));
-#endif
-bfd_boolean bfd_bfin_elf32_create_embedded_relocs
-  PARAMS ((bfd *, struct bfd_link_info *, asection *, asection *, char **));
-
-
 /* HOWTO Table for blackfin.
    Blackfin relocations are fairly complicated.
    Some of the salient features are
@@ -722,7 +412,7 @@ bfd_boolean bfd_bfin_elf32_create_embedded_relocs
    the relocation stack. .  */
 
 #define BFIN_RELOC_MIN 0
-#define BFIN_RELOC_MAX 0x13
+#define BFIN_RELOC_MAX 0x21
 #define BFIN_GNUEXT_RELOC_MIN 0x40
 #define BFIN_GNUEXT_RELOC_MAX 0x43
 #define BFIN_ARELOC_MIN 0xE0
@@ -786,7 +476,7 @@ static reloc_howto_type bfin_howto_table [] =
 	 0,			/* src_mask.  */
 	 0x000003FF,		/* dst_mask.  */
 	 TRUE),			/* pcrel_offset.  */
- 
+
   HOWTO (R_pcrel12_jump,	/* type.  */
 	 1,			/* rightshift.  */
 				/* the offset is actually 13 bit
@@ -832,7 +522,7 @@ static reloc_howto_type bfin_howto_table [] =
 	 0,			/* src_mask.  */
 	 0x0000FFFF,		/* dst_mask.  */
 	 TRUE),			/* pcrel_offset.  */
- 
+
   HOWTO (R_huimm16,		/* type.  */
 	 16,			/* rightshift.  */
 	 1,			/* size (0 = byte, 1 = short, 2 = long).  */
@@ -1014,319 +704,259 @@ static reloc_howto_type bfin_howto_table [] =
 	 0,			/* src_mask.  */
 	 0x000003FF,		/* dst_mask.  */
 	 FALSE),		/* pcrel_offset.  */
+
+
+  /* A 18-bit signed operand with the GOT offset for the address of
+     the symbol.  */
+  HOWTO (R_BFIN_GOT17M4,        /* type */
+	 2,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_BFIN_GOT12",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,	        /* src_mask */
+	 0xffff,	        /* dst_mask */
+	 FALSE),	        /* pcrel_offset */
+
+  /* The upper 16 bits of the GOT offset for the address of the
+     symbol.  */
+  HOWTO (R_BFIN_GOTHI,	        /* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_BFIN_GOTHI",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,		        /* src_mask */
+	 0xffff,		/* dst_mask */
+	 FALSE),	        /* pcrel_offset */
+
+  /* The lower 16 bits of the GOT offset for the address of the
+     symbol.  */
+  HOWTO (R_BFIN_GOTLO,	        /* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_BFIN_GOTLO",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,		/* src_mask */
+	 0xffff,		/* dst_mask */
+	 FALSE),	        /* pcrel_offset */
+
+  /* The 32-bit address of the canonical descriptor of a function.  */
+  HOWTO (R_BFIN_FUNCDESC,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_BFIN_FUNCDESC",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffffffff,		/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* A 12-bit signed operand with the GOT offset for the address of
+     canonical descriptor of a function.  */
+  HOWTO (R_BFIN_FUNCDESC_GOT17M4,	/* type */
+	 2,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_BFIN_FUNCDESC_GOT17M4", /* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,	        /* src_mask */
+	 0xffff,	        /* dst_mask */
+	 FALSE),	        /* pcrel_offset */
+
+  /* The upper 16 bits of the GOT offset for the address of the
+     canonical descriptor of a function.  */
+  HOWTO (R_BFIN_FUNCDESC_GOTHI,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_BFIN_FUNCDESC_GOTHI", /* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,		/* src_mask */
+	 0xffff,		/* dst_mask */
+	 FALSE),	        /* pcrel_offset */
+
+  /* The lower 16 bits of the GOT offset for the address of the
+     canonical descriptor of a function.  */
+  HOWTO (R_BFIN_FUNCDESC_GOTLO,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_BFIN_FUNCDESC_GOTLO", /* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,		/* src_mask */
+	 0xffff,		/* dst_mask */
+	 FALSE),	        /* pcrel_offset */
+
+  /* The 32-bit address of the canonical descriptor of a function.  */
+  HOWTO (R_BFIN_FUNCDESC_VALUE,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 64,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_BFIN_FUNCDESC_VALUE", /* name */
+	 FALSE,			/* partial_inplace */
+	 0xffffffff,		/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* A 12-bit signed operand with the GOT offset for the address of
+     canonical descriptor of a function.  */
+  HOWTO (R_BFIN_FUNCDESC_GOTOFF17M4, /* type */
+	 2,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_BFIN_FUNCDESC_GOTOFF17M4", /* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,	        /* src_mask */
+	 0xffff,	        /* dst_mask */
+	 FALSE),	        /* pcrel_offset */
+
+  /* The upper 16 bits of the GOT offset for the address of the
+     canonical descriptor of a function.  */
+  HOWTO (R_BFIN_FUNCDESC_GOTOFFHI, /* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_BFIN_FUNCDESC_GOTOFFHI", /* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,		/* src_mask */
+	 0xffff,		/* dst_mask */
+	 FALSE),	        /* pcrel_offset */
+
+  /* The lower 16 bits of the GOT offset for the address of the
+     canonical descriptor of a function.  */
+  HOWTO (R_BFIN_FUNCDESC_GOTOFFLO, /* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_BFIN_FUNCDESC_GOTOFFLO", /* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,		/* src_mask */
+	 0xffff,		/* dst_mask */
+	 FALSE),	        /* pcrel_offset */
+
+  /* A 12-bit signed operand with the GOT offset for the address of
+     the symbol.  */
+  HOWTO (R_BFIN_GOTOFF17M4,     /* type */
+	 2,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_BFIN_GOTOFF17M4",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,	        /* src_mask */
+	 0xffff,	        /* dst_mask */
+	 FALSE),	        /* pcrel_offset */
+
+  /* The upper 16 bits of the GOT offset for the address of the
+     symbol.  */
+  HOWTO (R_BFIN_GOTOFFHI,        /* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_BFIN_GOTOFFHI",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,		/* src_mask */
+	 0xffff,		/* dst_mask */
+	 FALSE),	        /* pcrel_offset */
+
+  /* The lower 16 bits of the GOT offset for the address of the
+     symbol.  */
+  HOWTO (R_BFIN_GOTOFFLO,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_BFIN_GOTOFFLO",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,		/* src_mask */
+	 0xffff,		/* dst_mask */
+	 FALSE),	        /* pcrel_offset */
 };
 
-static reloc_howto_type bfin_areloc_howto_table [] =
-{
-  HOWTO (R_push,
-	 0,
-	 2,
-	 0,
-	 FALSE,
-	 0,
-	 complain_overflow_dont,
-	 bfin_push_reloc,
-	 "R_expst_push",
-	 FALSE,
-	 0,
-	 0,
-	 FALSE),
-
-  HOWTO (R_const,
-	 0,
-	 2,
-	 0,
-	 FALSE,
-	 0,
-	 complain_overflow_dont,
-	 bfin_const_reloc,
-	 "R_expst_const",
-	 FALSE,
-	 0,
-	 0,
-	 FALSE),
-
-  HOWTO (R_add,
-	 0,
-	 0,
-	 0,
-	 FALSE,
-	 0,
-	 complain_overflow_dont,
-	 bfin_oper_reloc,
-	 "R_expst_add",
-	 FALSE,
-	 0,
-	 0,
-	 FALSE),
-
-  HOWTO (R_sub,
-	 0,
-	 0,
-	 0,
-	 FALSE,
-	 0,
-	 complain_overflow_dont,
-	 bfin_oper_reloc,
-	 "R_expst_sub",
-	 FALSE,
-	 0,
-	 0,
-	 FALSE),
-
-  HOWTO (R_mult,
-	 0,
-	 0,
-	 0,
-	 FALSE,
-	 0,
-	 complain_overflow_dont,
-	 bfin_oper_reloc,
-	 "R_expst_mult",
-	 FALSE,
-	 0,
-	 0,
-	 FALSE),
-
-  HOWTO (R_div,			/* type.  */
+static reloc_howto_type bfin_gnuext_howto_table [] =
+{
+  HOWTO (R_pltpc,		/* type.  */
 	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
+	 1,			/* size (0 = byte, 1 = short, 2 = long).  */
+	 16,			/* bitsize.  */
 	 FALSE,			/* pc_relative.  */
 	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_div",		/* name.  */
+	 complain_overflow_bitfield, /* complain_on_overflow.  */
+	 bfin_pltpc_reloc,	/* special_function.  */
+	 "R_pltpc",		/* name.  */
 	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
+	 0xffff,		/* src_mask.  */
+	 0xffff,		/* dst_mask.  */
 	 FALSE),		/* pcrel_offset.  */
 
-  HOWTO (R_mod,			/* type.  */
+  HOWTO (R_got,			/* type.  */
 	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
+	 1,			/* size (0 = byte, 1 = short, 2 = long).  */
+	 16,			/* bitsize.  */
 	 FALSE,			/* pc_relative.  */
 	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_mod",		/* name.  */
+	 complain_overflow_bitfield, /* complain_on_overflow.  */
+	 bfd_elf_generic_reloc,	/* special_function.  */
+	 "R_got",		/* name.  */
 	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-
-  HOWTO (R_lshift,		/* type.  */
-	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_lshift",	/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-
-  HOWTO (R_rshift,		/* type.  */
-	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_rshift",	/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-
-  HOWTO (R_and,			/* type.  */
-	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_and",		/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-
-  HOWTO (R_or,			/* type.  */
-	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_or",		/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-
-  HOWTO (R_xor,			/* type.  */
-	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_xor",		/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-
-  HOWTO (R_land,		/* type.  */
-	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_land",	/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-
-  HOWTO (R_lor,			/* type.  */
-	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_lor",		/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-
-  HOWTO (R_len,			/* type.  */
-	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_len",		/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-
-  HOWTO (R_neg,			/* type.  */
-	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_neg",		/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-
-  HOWTO (R_comp,		/* type.  */
-	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_comp",	/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-  
-  HOWTO (R_page,		/* type.  */
-	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_page",	/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-  
-  HOWTO (R_hwpage,		/* type.  */
-	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_hwpage",	/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-  
-  HOWTO (R_addr,		/* type.  */
-	 0,			/* rightshift.  */
-	 0,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 0,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_dont, /* complain_on_overflow.  */
-	 bfin_oper_reloc,	/* special_function.  */
-	 "R_expst_addr",	/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0,			/* src_mask.  */
-	 0,			/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-};
-
-static reloc_howto_type bfin_gnuext_howto_table [] =
-{
-  HOWTO (R_pltpc,		/* type.  */
-	 0,			/* rightshift.  */
-	 1,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 16,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_bitfield, /* complain_on_overflow.  */
-	 bfin_pltpc_reloc,	/* special_function.  */
-	 "R_pltpc",		/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0xffff,		/* src_mask.  */
-	 0xffff,		/* dst_mask.  */
-	 FALSE),		/* pcrel_offset.  */
-
-  HOWTO (R_got,			/* type.  */
-	 0,			/* rightshift.  */
-	 1,			/* size (0 = byte, 1 = short, 2 = long).  */
-	 16,			/* bitsize.  */
-	 FALSE,			/* pc_relative.  */
-	 0,			/* bitpos.  */
-	 complain_overflow_bitfield, /* complain_on_overflow.  */
-	 bfd_elf_generic_reloc,	/* special_function.  */
-	 "R_got",		/* name.  */
-	 FALSE,			/* partial_inplace.  */
-	 0x7fff,		/* src_mask.  */
-	 0x7fff,		/* dst_mask.  */
+	 0x7fff,		/* src_mask.  */
+	 0x7fff,		/* dst_mask.  */
 	 FALSE),		/* pcrel_offset.  */
 
 /* GNU extension to record C++ vtable hierarchy.  */
@@ -1389,29 +1019,24 @@ static const struct bfin_reloc_map bfin_reloc_map [] =
   { BFD_RELOC_BFIN_11_PCREL,		R_pcrel11 },
   { BFD_RELOC_BFIN_GOT,			R_got },
   { BFD_RELOC_BFIN_PLTPC,		R_pltpc },
+
+  { BFD_RELOC_BFIN_GOT17M4,      R_BFIN_GOT17M4 },
+  { BFD_RELOC_BFIN_GOTHI,      R_BFIN_GOTHI },
+  { BFD_RELOC_BFIN_GOTLO,      R_BFIN_GOTLO },
+  { BFD_RELOC_BFIN_FUNCDESC,   R_BFIN_FUNCDESC },
+  { BFD_RELOC_BFIN_FUNCDESC_GOT17M4, R_BFIN_FUNCDESC_GOT17M4 },
+  { BFD_RELOC_BFIN_FUNCDESC_GOTHI, R_BFIN_FUNCDESC_GOTHI },
+  { BFD_RELOC_BFIN_FUNCDESC_GOTLO, R_BFIN_FUNCDESC_GOTLO },
+  { BFD_RELOC_BFIN_FUNCDESC_VALUE, R_BFIN_FUNCDESC_VALUE },
+  { BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, R_BFIN_FUNCDESC_GOTOFF17M4 },
+  { BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI, R_BFIN_FUNCDESC_GOTOFFHI },
+  { BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, R_BFIN_FUNCDESC_GOTOFFLO },
+  { BFD_RELOC_BFIN_GOTOFF17M4,   R_BFIN_GOTOFF17M4 },
+  { BFD_RELOC_BFIN_GOTOFFHI,   R_BFIN_GOTOFFHI },
+  { BFD_RELOC_BFIN_GOTOFFLO,   R_BFIN_GOTOFFLO },
+
   { BFD_RELOC_VTABLE_INHERIT,		R_BFIN_GNU_VTINHERIT },
   { BFD_RELOC_VTABLE_ENTRY,		R_BFIN_GNU_VTENTRY },
-  { BFD_ARELOC_BFIN_PUSH,		R_push },
-  { BFD_ARELOC_BFIN_CONST,		R_const },
-  { BFD_ARELOC_BFIN_ADD,		R_add },
-  { BFD_ARELOC_BFIN_SUB,		R_sub },
-  { BFD_ARELOC_BFIN_MULT,		R_mult },
-  { BFD_ARELOC_BFIN_DIV,		R_div },
-  { BFD_ARELOC_BFIN_MOD,		R_mod },
-  { BFD_ARELOC_BFIN_LSHIFT,		R_lshift },
-  { BFD_ARELOC_BFIN_RSHIFT,		R_rshift },
-  { BFD_ARELOC_BFIN_AND,		R_and },
-  { BFD_ARELOC_BFIN_OR,			R_or },
-  { BFD_ARELOC_BFIN_XOR,		R_xor },
-  { BFD_ARELOC_BFIN_LAND,		R_land },
-  { BFD_ARELOC_BFIN_LOR,		R_lor },
-  { BFD_ARELOC_BFIN_LEN,		R_len },
-  { BFD_ARELOC_BFIN_NEG,		R_neg },
-  { BFD_ARELOC_BFIN_COMP,		R_comp },
-  { BFD_ARELOC_BFIN_PAGE,		R_page },
-  { BFD_ARELOC_BFIN_HWPAGE,		R_hwpage },
-  { BFD_ARELOC_BFIN_ADDR,		R_addr }
-
 };
 
 
@@ -1427,9 +1052,6 @@ bfin_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
   if (r_type <= BFIN_RELOC_MAX)
     cache_ptr->howto = &bfin_howto_table [r_type];
 
-  else if (r_type >= BFIN_ARELOC_MIN && r_type <= BFIN_ARELOC_MAX)
-    cache_ptr->howto = &bfin_areloc_howto_table [r_type - BFIN_ARELOC_MIN];
-
   else if (r_type >= BFIN_GNUEXT_RELOC_MIN && r_type <= BFIN_GNUEXT_RELOC_MAX)
     cache_ptr->howto = &bfin_gnuext_howto_table [r_type - BFIN_GNUEXT_RELOC_MIN];
 
@@ -1452,9 +1074,6 @@ bfin_bfd_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
   if (r_type <= BFIN_RELOC_MAX && r_type > BFIN_RELOC_MIN)
     return &bfin_howto_table [r_type];
 
-  else if (r_type >= BFIN_ARELOC_MIN && r_type <= BFIN_ARELOC_MAX)
-   return &bfin_areloc_howto_table [r_type - BFIN_ARELOC_MIN];
-
   else if (r_type >= BFIN_GNUEXT_RELOC_MIN && r_type <= BFIN_GNUEXT_RELOC_MAX)
    return &bfin_gnuext_howto_table [r_type - BFIN_GNUEXT_RELOC_MIN];
 
@@ -1469,9 +1088,6 @@ bfin_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
   if (r_type <= BFIN_RELOC_MAX)
     return &bfin_howto_table [r_type];
 
-  else if (r_type >= BFIN_ARELOC_MIN && r_type <= BFIN_ARELOC_MAX)
-   return &bfin_areloc_howto_table [r_type - BFIN_ARELOC_MIN];
-
   else if (r_type >= BFIN_GNUEXT_RELOC_MIN && r_type <= BFIN_GNUEXT_RELOC_MAX)
    return &bfin_gnuext_howto_table [r_type - BFIN_GNUEXT_RELOC_MIN];
 
@@ -1492,96 +1108,887 @@ bfin_is_local_label_name (
   return _bfd_elf_is_local_label_name (abfd, label);
 }
 
+extern const bfd_target bfd_elf32_bfinfdpic_vec;
+#define IS_FDPIC(bfd) ((bfd)->xvec == &bfd_elf32_bfinfdpic_vec)
 
-/* Look through the relocs for a section during the first phase, and
-   allocate space in the global offset table or procedure linkage
-   table.  */
-
-static bfd_boolean
-bfin_check_relocs (bfd * abfd,
-		   struct bfd_link_info *info,
-		   asection *sec,
-                   const Elf_Internal_Rela *relocs)
+/* An extension of the elf hash table data structure, containing some
+   additional Blackfin-specific data.  */
+struct bfinfdpic_elf_link_hash_table
 {
-  bfd *dynobj;
-  Elf_Internal_Shdr *symtab_hdr;
-  struct elf_link_hash_entry **sym_hashes;
-  bfd_signed_vma *local_got_refcounts;
-  const Elf_Internal_Rela *rel;
-  const Elf_Internal_Rela *rel_end;
+  struct elf_link_hash_table elf;
+
+  /* A pointer to the .got section.  */
   asection *sgot;
-  asection *srelgot;
-  asection *sreloc;
-  if (info->relocatable)
-    return TRUE;
+  /* A pointer to the .rel.got section.  */
+  asection *sgotrel;
+  /* A pointer to the .rofixup section.  */
+  asection *sgotfixup;
+  /* A pointer to the .plt section.  */
+  asection *splt;
+  /* A pointer to the .rel.plt section.  */
+  asection *spltrel;
+  /* GOT base offset.  */
+  bfd_vma got0;
+  /* Location of the first non-lazy PLT entry, i.e., the number of
+     bytes taken by lazy PLT entries.  */
+  bfd_vma plt0;
+  /* A hash table holding information about which symbols were
+     referenced with which PIC-related relocations.  */
+  struct htab *relocs_info;
+};
 
-  dynobj = elf_hash_table (info)->dynobj;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
-  sym_hashes = elf_sym_hashes (abfd);
-  local_got_refcounts = elf_local_got_refcounts (abfd);
+/* Get the Blackfin ELF linker hash table from a link_info structure.  */
+
+#define bfinfdpic_hash_table(info) \
+  ((struct bfinfdpic_elf_link_hash_table *) ((info)->hash))
+
+#define bfinfdpic_got_section(info) \
+  (bfinfdpic_hash_table (info)->sgot)
+#define bfinfdpic_gotrel_section(info) \
+  (bfinfdpic_hash_table (info)->sgotrel)
+#define bfinfdpic_gotfixup_section(info) \
+  (bfinfdpic_hash_table (info)->sgotfixup)
+#define bfinfdpic_plt_section(info) \
+  (bfinfdpic_hash_table (info)->splt)
+#define bfinfdpic_pltrel_section(info) \
+  (bfinfdpic_hash_table (info)->spltrel)
+#define bfinfdpic_relocs_info(info) \
+  (bfinfdpic_hash_table (info)->relocs_info)
+#define bfinfdpic_got_initial_offset(info) \
+  (bfinfdpic_hash_table (info)->got0)
+#define bfinfdpic_plt_initial_offset(info) \
+  (bfinfdpic_hash_table (info)->plt0)
+
+/* Create a Blackfin ELF linker hash table.  */
 
-  sgot = NULL;
-  srelgot = NULL;
-  sreloc = NULL;
+static struct bfd_link_hash_table *
+bfinfdpic_elf_link_hash_table_create (bfd *abfd)
+{
+  struct bfinfdpic_elf_link_hash_table *ret;
+  bfd_size_type amt = sizeof (struct bfinfdpic_elf_link_hash_table);
 
-  rel_end = relocs + sec->reloc_count;
-  for (rel = relocs; rel < rel_end; rel++)
+  ret = bfd_zalloc (abfd, amt);
+  if (ret == NULL)
+    return NULL;
+
+  if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd,
+				      _bfd_elf_link_hash_newfunc,
+				      sizeof (struct elf_link_hash_entry)))
     {
-      unsigned long r_symndx;
-      struct elf_link_hash_entry *h;
+      free (ret);
+      return NULL;
+    }
 
-      r_symndx = ELF32_R_SYM (rel->r_info);
-      if (r_symndx < symtab_hdr->sh_info)
-	h = NULL;
-      else
-	h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+  return &ret->elf.root;
+}
 
-      switch (ELF32_R_TYPE (rel->r_info))
-	{
-       /* This relocation describes the C++ object vtable hierarchy.
-           Reconstruct it for later use during GC.  */
-        case R_BFIN_GNU_VTINHERIT:
-          if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
-            return FALSE;
-          break;
+/* Decide whether a reference to a symbol can be resolved locally or
+   not.  If the symbol is protected, we want the local address, but
+   its function descriptor must be assigned by the dynamic linker.  */
+#define BFINFDPIC_SYM_LOCAL(INFO, H) \
+  (_bfd_elf_symbol_refs_local_p ((H), (INFO), 1) \
+   || ! elf_hash_table (INFO)->dynamic_sections_created)
+#define BFINFDPIC_FUNCDESC_LOCAL(INFO, H) \
+  ((H)->dynindx == -1 || ! elf_hash_table (INFO)->dynamic_sections_created)
+
+/* This structure collects information on what kind of GOT, PLT or
+   function descriptors are required by relocations that reference a
+   certain symbol.  */
+struct bfinfdpic_relocs_info
+{
+  /* The index of the symbol, as stored in the relocation r_info, if
+     we have a local symbol; -1 otherwise.  */
+  long symndx;
+  union
+  {
+    /* The input bfd in which the symbol is defined, if it's a local
+       symbol.  */
+    bfd *abfd;
+    /* If symndx == -1, the hash table entry corresponding to a global
+       symbol (even if it turns out to bind locally, in which case it
+       should ideally be replaced with section's symndx + addend).  */
+    struct elf_link_hash_entry *h;
+  } d;
+  /* The addend of the relocation that references the symbol.  */
+  bfd_vma addend;
+
+  /* The fields above are used to identify an entry.  The fields below
+     contain information on how an entry is used and, later on, which
+     locations it was assigned.  */
+  /* The following 2 fields record whether the symbol+addend above was
+     ever referenced with a GOT relocation.  The 17M4 suffix indicates a
+     GOT17M4 relocation; hilo is used for GOTLO/GOTHI pairs.  */
+  unsigned got17m4:1;
+  unsigned gothilo:1;
+  /* Whether a FUNCDESC relocation references symbol+addend.  */
+  unsigned fd:1;
+  /* Whether a FUNCDESC_GOT relocation references symbol+addend.  */
+  unsigned fdgot17m4:1;
+  unsigned fdgothilo:1;
+  /* Whether a FUNCDESC_GOTOFF relocation references symbol+addend.  */
+  unsigned fdgoff17m4:1;
+  unsigned fdgoffhilo:1;
+  /* Whether symbol+addend is referenced with GOTOFF17M4, GOTOFFLO or
+     GOTOFFHI relocations.  The addend doesn't really matter, since we
+     envision that this will only be used to check whether the symbol
+     is mapped to the same segment as the got.  */
+  unsigned gotoff:1;
+  /* Whether symbol+addend is referenced by a LABEL24 relocation.  */
+  unsigned call:1;
+  /* Whether symbol+addend is referenced by a 32 or FUNCDESC_VALUE
+     relocation.  */
+  unsigned sym:1;
+  /* Whether we need a PLT entry for a symbol.  Should be implied by
+     something like:
+     (call && symndx == -1 && ! BFINFDPIC_SYM_LOCAL (info, d.h))  */
+  unsigned plt:1;
+  /* Whether a function descriptor should be created in this link unit
+     for symbol+addend.  Should be implied by something like:
+     (plt || fdgotoff17m4 || fdgotofflohi
+      || ((fd || fdgot17m4 || fdgothilo)
+          && (symndx != -1 || BFINFDPIC_FUNCDESC_LOCAL (info, d.h))))  */
+  unsigned privfd:1;
+  /* Whether a lazy PLT entry is needed for this symbol+addend.
+     Should be implied by something like:
+     (privfd && symndx == -1 && ! BFINFDPIC_SYM_LOCAL (info, d.h)
+      && ! (info->flags & DF_BIND_NOW))  */
+  unsigned lazyplt:1;
+  /* Whether we've already emitted GOT relocations and PLT entries as
+     needed for this symbol.  */
+  unsigned done:1;
+
+  /* The number of R_byte4_data, R_BFIN_FUNCDESC and R_BFIN_FUNCDESC_VALUE
+     relocations referencing the symbol.  */
+  unsigned relocs32, relocsfd, relocsfdv;
+
+  /* The number of .rofixups entries and dynamic relocations allocated
+     for this symbol, minus any that might have already been used.  */
+  unsigned fixups, dynrelocs;
+
+  /* The offsets of the GOT entries assigned to symbol+addend, to the
+     function descriptor's address, and to a function descriptor,
+     respectively.  Should be zero if unassigned.  The offsets are
+     counted from the value that will be assigned to the PIC register,
+     not from the beginning of the .got section.  */
+  bfd_signed_vma got_entry, fdgot_entry, fd_entry;
+  /* The offsets of the PLT entries assigned to symbol+addend,
+     non-lazy and lazy, respectively.  If unassigned, should be
+     (bfd_vma)-1.  */
+  bfd_vma plt_entry, lzplt_entry;
+};
 
-        /* This relocation describes which C++ vtable entries
-           are actually used.  Record for later use during GC.  */
-        case R_BFIN_GNU_VTENTRY:
-          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
-            return FALSE;
-          break;
+/* Compute a hash with the key fields of an bfinfdpic_relocs_info entry.  */
+static hashval_t
+bfinfdpic_relocs_info_hash (const void *entry_)
+{
+  const struct bfinfdpic_relocs_info *entry = entry_;
 
-	case R_got:
-	  if (h != NULL
-	      && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
-	    break;
-	  /* Fall through.  */
+  return (entry->symndx == -1
+	  ? (long) entry->d.h->root.root.hash
+	  : entry->symndx + (long) entry->d.abfd->id * 257) + entry->addend;
+}
 
-	  if (dynobj == NULL)
-	    {
-	      /* Create the .got section.  */
-	      elf_hash_table (info)->dynobj = dynobj = abfd;
-	      if (!_bfd_elf_create_got_section (dynobj, info))
-		return FALSE;
-	    }
+/* Test whether the key fields of two bfinfdpic_relocs_info entries are
+   identical.  */
+static int
+bfinfdpic_relocs_info_eq (const void *entry1, const void *entry2)
+{
+  const struct bfinfdpic_relocs_info *e1 = entry1;
+  const struct bfinfdpic_relocs_info *e2 = entry2;
 
-	  if (sgot == NULL)
-	    {
-	      sgot = bfd_get_section_by_name (dynobj, ".got");
-	      BFD_ASSERT (sgot != NULL);
-	    }
+  return e1->symndx == e2->symndx && e1->addend == e2->addend
+    && (e1->symndx == -1 ? e1->d.h == e2->d.h : e1->d.abfd == e2->d.abfd);
+}
 
-	  if (srelgot == NULL && (h != NULL || info->shared))
-	    {
-	      srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
-	      if (srelgot == NULL)
-		{
-		  srelgot = bfd_make_section (dynobj, ".rela.got");
-		  if (srelgot == NULL
-		      || !bfd_set_section_flags (dynobj, srelgot,
-						 (SEC_ALLOC
-						  | SEC_LOAD
+/* Find or create an entry in a hash table HT that matches the key
+   fields of the given ENTRY.  If it's not found, memory for a new
+   entry is allocated in ABFD's obstack.  */
+static struct bfinfdpic_relocs_info *
+bfinfdpic_relocs_info_find (struct htab *ht,
+			   bfd *abfd,
+			   const struct bfinfdpic_relocs_info *entry,
+			   enum insert_option insert)
+{
+  struct bfinfdpic_relocs_info **loc =
+    (struct bfinfdpic_relocs_info **) htab_find_slot (ht, entry, insert);
+
+  if (! loc)
+    return NULL;
+
+  if (*loc)
+    return *loc;
+
+  *loc = bfd_zalloc (abfd, sizeof (**loc));
+
+  if (! *loc)
+    return *loc;
+
+  (*loc)->symndx = entry->symndx;
+  (*loc)->d = entry->d;
+  (*loc)->addend = entry->addend;
+  (*loc)->plt_entry = (bfd_vma)-1;
+  (*loc)->lzplt_entry = (bfd_vma)-1;
+
+  return *loc;
+}
+
+/* Obtain the address of the entry in HT associated with H's symbol +
+   addend, creating a new entry if none existed.  ABFD is only used
+   for memory allocation purposes.  */
+inline static struct bfinfdpic_relocs_info *
+bfinfdpic_relocs_info_for_global (struct htab *ht,
+				 bfd *abfd,
+				 struct elf_link_hash_entry *h,
+				 bfd_vma addend,
+				 enum insert_option insert)
+{
+  struct bfinfdpic_relocs_info entry;
+
+  entry.symndx = -1;
+  entry.d.h = h;
+  entry.addend = addend;
+
+  return bfinfdpic_relocs_info_find (ht, abfd, &entry, insert);
+}
+
+/* Obtain the address of the entry in HT associated with the SYMNDXth
+   local symbol of the input bfd ABFD, plus the addend, creating a new
+   entry if none existed.  */
+inline static struct bfinfdpic_relocs_info *
+bfinfdpic_relocs_info_for_local (struct htab *ht,
+				bfd *abfd,
+				long symndx,
+				bfd_vma addend,
+				enum insert_option insert)
+{
+  struct bfinfdpic_relocs_info entry;
+
+  entry.symndx = symndx;
+  entry.d.abfd = abfd;
+  entry.addend = addend;
+
+  return bfinfdpic_relocs_info_find (ht, abfd, &entry, insert);
+}
+
+/* Merge fields set by check_relocs() of two entries that end up being
+   mapped to the same (presumably global) symbol.  */
+
+inline static void
+bfinfdpic_pic_merge_early_relocs_info (struct bfinfdpic_relocs_info *e2,
+				      struct bfinfdpic_relocs_info const *e1)
+{
+  e2->got17m4 |= e1->got17m4;
+  e2->gothilo |= e1->gothilo;
+  e2->fd |= e1->fd;
+  e2->fdgot17m4 |= e1->fdgot17m4;
+  e2->fdgothilo |= e1->fdgothilo;
+  e2->fdgoff17m4 |= e1->fdgoff17m4;
+  e2->fdgoffhilo |= e1->fdgoffhilo;
+  e2->gotoff |= e1->gotoff;
+  e2->call |= e1->call;
+  e2->sym |= e1->sym;
+}
+
+/* Every block of 65535 lazy PLT entries shares a single call to the
+   resolver, inserted in the 32768th lazy PLT entry (i.e., entry #
+   32767, counting from 0).  All other lazy PLT entries branch to it
+   in a single instruction.  */
+
+#define LZPLT_RESOLVER_EXTRA 10
+#define LZPLT_NORMAL_SIZE 6
+#define LZPLT_ENTRIES 1362
+
+#define BFINFDPIC_LZPLT_BLOCK_SIZE ((bfd_vma) LZPLT_NORMAL_SIZE * LZPLT_ENTRIES + LZPLT_RESOLVER_EXTRA)
+#define BFINFDPIC_LZPLT_RESOLV_LOC (LZPLT_NORMAL_SIZE * LZPLT_ENTRIES / 2)
+
+/* Add a dynamic relocation to the SRELOC section.  */
+
+inline static bfd_vma
+_bfinfdpic_add_dyn_reloc (bfd *output_bfd, asection *sreloc, bfd_vma offset,
+			 int reloc_type, long dynindx, bfd_vma addend,
+			 struct bfinfdpic_relocs_info *entry)
+{
+  Elf_Internal_Rela outrel;
+  bfd_vma reloc_offset;
+
+  outrel.r_offset = offset;
+  outrel.r_info = ELF32_R_INFO (dynindx, reloc_type);
+  outrel.r_addend = addend;
+
+  reloc_offset = sreloc->reloc_count * sizeof (Elf32_External_Rel);
+  BFD_ASSERT (reloc_offset < sreloc->size);
+  bfd_elf32_swap_reloc_out (output_bfd, &outrel,
+			    sreloc->contents + reloc_offset);
+  sreloc->reloc_count++;
+
+  /* If the entry's index is zero, this relocation was probably to a
+     linkonce section that got discarded.  We reserved a dynamic
+     relocation, but it was for another entry than the one we got at
+     the time of emitting the relocation.  Unfortunately there's no
+     simple way for us to catch this situation, since the relocation
+     is cleared right before calling relocate_section, at which point
+     we no longer know what the relocation used to point to.  */
+  if (entry->symndx)
+    {
+      BFD_ASSERT (entry->dynrelocs > 0);
+      entry->dynrelocs--;
+    }
+
+  return reloc_offset;
+}
+
+/* Add a fixup to the ROFIXUP section.  */
+
+static bfd_vma
+_bfinfdpic_add_rofixup (bfd *output_bfd, asection *rofixup, bfd_vma offset,
+		       struct bfinfdpic_relocs_info *entry)
+{
+  bfd_vma fixup_offset;
+
+  if (rofixup->flags & SEC_EXCLUDE)
+    return -1;
+
+  fixup_offset = rofixup->reloc_count * 4;
+  if (rofixup->contents)
+    {
+      BFD_ASSERT (fixup_offset < rofixup->size);
+      bfd_put_32 (output_bfd, offset, rofixup->contents + fixup_offset);
+    }
+  rofixup->reloc_count++;
+
+  if (entry && entry->symndx)
+    {
+      /* See discussion about symndx == 0 in _bfinfdpic_add_dyn_reloc
+	 above.  */
+      BFD_ASSERT (entry->fixups > 0);
+      entry->fixups--;
+    }
+
+  return fixup_offset;
+}
+
+/* Find the segment number in which OSEC, and output section, is
+   located.  */
+
+static unsigned
+_bfinfdpic_osec_to_segment (bfd *output_bfd, asection *osec)
+{
+  struct elf_segment_map *m;
+  Elf_Internal_Phdr *p;
+
+  /* Find the segment that contains the output_section.  */
+  for (m = elf_tdata (output_bfd)->segment_map,
+	 p = elf_tdata (output_bfd)->phdr;
+       m != NULL;
+       m = m->next, p++)
+    {
+      int i;
+
+      for (i = m->count - 1; i >= 0; i--)
+	if (m->sections[i] == osec)
+	  break;
+
+      if (i >= 0)
+	break;
+    }
+
+  return p - elf_tdata (output_bfd)->phdr;
+}
+
+inline static bfd_boolean
+_bfinfdpic_osec_readonly_p (bfd *output_bfd, asection *osec)
+{
+  unsigned seg = _bfinfdpic_osec_to_segment (output_bfd, osec);
+
+  return ! (elf_tdata (output_bfd)->phdr[seg].p_flags & PF_W);
+}
+
+/* Generate relocations for GOT entries, function descriptors, and
+   code for PLT and lazy PLT entries.  */
+
+inline static bfd_boolean
+_bfinfdpic_emit_got_relocs_plt_entries (struct bfinfdpic_relocs_info *entry,
+					bfd *output_bfd,
+					struct bfd_link_info *info,
+					asection *sec,
+					Elf_Internal_Sym *sym,
+					bfd_vma addend)
+
+{
+  bfd_vma fd_lazy_rel_offset = (bfd_vma)-1;
+  int dynindx = -1;
+
+  if (entry->done)
+    return TRUE;
+  entry->done = 1;
+
+  if (entry->got_entry || entry->fdgot_entry || entry->fd_entry)
+    {
+      /* If the symbol is dynamic, consider it for dynamic
+	 relocations, otherwise decay to section + offset.  */
+      if (entry->symndx == -1 && entry->d.h->dynindx != -1)
+	dynindx = entry->d.h->dynindx;
+      else
+	{
+	  if (sec->output_section
+	      && ! bfd_is_abs_section (sec->output_section)
+	      && ! bfd_is_und_section (sec->output_section))
+	    dynindx = elf_section_data (sec->output_section)->dynindx;
+	  else
+	    dynindx = 0;
+	}
+    }
+
+  /* Generate relocation for GOT entry pointing to the symbol.  */
+  if (entry->got_entry)
+    {
+      int idx = dynindx;
+      bfd_vma ad = addend;
+
+      /* If the symbol is dynamic but binds locally, use
+	 section+offset.  */
+      if (sec && (entry->symndx != -1
+		  || BFINFDPIC_SYM_LOCAL (info, entry->d.h)))
+	{
+	  if (entry->symndx == -1)
+	    ad += entry->d.h->root.u.def.value;
+	  else
+	    ad += sym->st_value;
+	  ad += sec->output_offset;
+	  if (sec->output_section && elf_section_data (sec->output_section))
+	    idx = elf_section_data (sec->output_section)->dynindx;
+	  else
+	    idx = 0;
+	}
+
+      /* If we're linking an executable at a fixed address, we can
+	 omit the dynamic relocation as long as the symbol is local to
+	 this module.  */
+      if (info->executable && !info->pie
+	  && (entry->symndx != -1
+	      || BFINFDPIC_SYM_LOCAL (info, entry->d.h)))
+	{
+	  if (sec)
+	    ad += sec->output_section->vma;
+	  if (entry->symndx != -1
+	      || entry->d.h->root.type != bfd_link_hash_undefweak)
+	    _bfinfdpic_add_rofixup (output_bfd,
+				   bfinfdpic_gotfixup_section (info),
+				   bfinfdpic_got_section (info)->output_section
+				   ->vma
+				   + bfinfdpic_got_section (info)->output_offset
+				   + bfinfdpic_got_initial_offset (info)
+				   + entry->got_entry, entry);
+	}
+      else
+	_bfinfdpic_add_dyn_reloc (output_bfd, bfinfdpic_gotrel_section (info),
+				 _bfd_elf_section_offset
+				 (output_bfd, info,
+				  bfinfdpic_got_section (info),
+				  bfinfdpic_got_initial_offset (info)
+				  + entry->got_entry)
+				 + bfinfdpic_got_section (info)
+				 ->output_section->vma
+				 + bfinfdpic_got_section (info)->output_offset,
+				 R_byte4_data, idx, ad, entry);
+
+      bfd_put_32 (output_bfd, ad,
+		  bfinfdpic_got_section (info)->contents
+		  + bfinfdpic_got_initial_offset (info)
+		  + entry->got_entry);
+    }
+
+  /* Generate relocation for GOT entry pointing to a canonical
+     function descriptor.  */
+  if (entry->fdgot_entry)
+    {
+      int reloc, idx;
+      bfd_vma ad = 0;
+
+      if (! (entry->symndx == -1
+	     && entry->d.h->root.type == bfd_link_hash_undefweak
+	     && BFINFDPIC_SYM_LOCAL (info, entry->d.h)))
+	{
+	  /* If the symbol is dynamic and there may be dynamic symbol
+	     resolution because we are, or are linked with, a shared
+	     library, emit a FUNCDESC relocation such that the dynamic
+	     linker will allocate the function descriptor.  If the
+	     symbol needs a non-local function descriptor but binds
+	     locally (e.g., its visibility is protected, emit a
+	     dynamic relocation decayed to section+offset.  */
+	  if (entry->symndx == -1
+	      && ! BFINFDPIC_FUNCDESC_LOCAL (info, entry->d.h)
+	      && BFINFDPIC_SYM_LOCAL (info, entry->d.h)
+	      && !(info->executable && !info->pie))
+	    {
+	      reloc = R_BFIN_FUNCDESC;
+	      idx = elf_section_data (entry->d.h->root.u.def.section
+				      ->output_section)->dynindx;
+	      ad = entry->d.h->root.u.def.section->output_offset
+		+ entry->d.h->root.u.def.value;
+	    }
+	  else if (entry->symndx == -1
+		   && ! BFINFDPIC_FUNCDESC_LOCAL (info, entry->d.h))
+	    {
+	      reloc = R_BFIN_FUNCDESC;
+	      idx = dynindx;
+	      ad = addend;
+	      if (ad)
+		return FALSE;
+	    }
+	  else
+	    {
+	      /* Otherwise, we know we have a private function descriptor,
+		 so reference it directly.  */
+	      if (elf_hash_table (info)->dynamic_sections_created)
+		BFD_ASSERT (entry->privfd);
+	      reloc = R_byte4_data;
+	      idx = elf_section_data (bfinfdpic_got_section (info)
+				      ->output_section)->dynindx;
+	      ad = bfinfdpic_got_section (info)->output_offset
+		+ bfinfdpic_got_initial_offset (info) + entry->fd_entry;
+	    }
+
+	  /* If there is room for dynamic symbol resolution, emit the
+	     dynamic relocation.  However, if we're linking an
+	     executable at a fixed location, we won't have emitted a
+	     dynamic symbol entry for the got section, so idx will be
+	     zero, which means we can and should compute the address
+	     of the private descriptor ourselves.  */
+	  if (info->executable && !info->pie
+	      && (entry->symndx != -1
+		  || BFINFDPIC_FUNCDESC_LOCAL (info, entry->d.h)))
+	    {
+	      ad += bfinfdpic_got_section (info)->output_section->vma;
+	      _bfinfdpic_add_rofixup (output_bfd,
+				     bfinfdpic_gotfixup_section (info),
+				     bfinfdpic_got_section (info)
+				     ->output_section->vma
+				     + bfinfdpic_got_section (info)
+				     ->output_offset
+				     + bfinfdpic_got_initial_offset (info)
+				     + entry->fdgot_entry, entry);
+	    }
+	  else
+	    _bfinfdpic_add_dyn_reloc (output_bfd,
+				     bfinfdpic_gotrel_section (info),
+				     _bfd_elf_section_offset
+				     (output_bfd, info,
+				      bfinfdpic_got_section (info),
+				      bfinfdpic_got_initial_offset (info)
+				      + entry->fdgot_entry)
+				     + bfinfdpic_got_section (info)
+				     ->output_section->vma
+				     + bfinfdpic_got_section (info)
+				     ->output_offset,
+				     reloc, idx, ad, entry);
+	}
+
+      bfd_put_32 (output_bfd, ad,
+		  bfinfdpic_got_section (info)->contents
+		  + bfinfdpic_got_initial_offset (info)
+		  + entry->fdgot_entry);
+    }
+
+  /* Generate relocation to fill in a private function descriptor in
+     the GOT.  */
+  if (entry->fd_entry)
+    {
+      int idx = dynindx;
+      bfd_vma ad = addend;
+      bfd_vma ofst;
+      long lowword, highword;
+
+      /* If the symbol is dynamic but binds locally, use
+	 section+offset.  */
+      if (sec && (entry->symndx != -1
+		  || BFINFDPIC_SYM_LOCAL (info, entry->d.h)))
+	{
+	  if (entry->symndx == -1)
+	    ad += entry->d.h->root.u.def.value;
+	  else
+	    ad += sym->st_value;
+	  ad += sec->output_offset;
+	  if (sec->output_section && elf_section_data (sec->output_section))
+	    idx = elf_section_data (sec->output_section)->dynindx;
+	  else
+	    idx = 0;
+	}
+
+      /* If we're linking an executable at a fixed address, we can
+	 omit the dynamic relocation as long as the symbol is local to
+	 this module.  */
+      if (info->executable && !info->pie
+	  && (entry->symndx != -1 || BFINFDPIC_SYM_LOCAL (info, entry->d.h)))
+	{
+	  if (sec)
+	    ad += sec->output_section->vma;
+	  ofst = 0;
+	  if (entry->symndx != -1
+	      || entry->d.h->root.type != bfd_link_hash_undefweak)
+	    {
+	      _bfinfdpic_add_rofixup (output_bfd,
+				     bfinfdpic_gotfixup_section (info),
+				     bfinfdpic_got_section (info)
+				     ->output_section->vma
+				     + bfinfdpic_got_section (info)
+				     ->output_offset
+				     + bfinfdpic_got_initial_offset (info)
+				     + entry->fd_entry, entry);
+	      _bfinfdpic_add_rofixup (output_bfd,
+				     bfinfdpic_gotfixup_section (info),
+				     bfinfdpic_got_section (info)
+				     ->output_section->vma
+				     + bfinfdpic_got_section (info)
+				     ->output_offset
+				     + bfinfdpic_got_initial_offset (info)
+				     + entry->fd_entry + 4, entry);
+	    }
+	}
+      else
+	{
+	  ofst
+	    = _bfinfdpic_add_dyn_reloc (output_bfd,
+					entry->lazyplt
+					? bfinfdpic_pltrel_section (info)
+					: bfinfdpic_gotrel_section (info),
+					_bfd_elf_section_offset
+					(output_bfd, info,
+					 bfinfdpic_got_section (info),
+					 bfinfdpic_got_initial_offset (info)
+					 + entry->fd_entry)
+					+ bfinfdpic_got_section (info)
+					->output_section->vma
+					+ bfinfdpic_got_section (info)
+					->output_offset,
+					R_BFIN_FUNCDESC_VALUE, idx, ad, entry);
+	}
+
+      /* If we've omitted the dynamic relocation, just emit the fixed
+	 addresses of the symbol and of the local GOT base offset.  */
+      if (info->executable && !info->pie && sec && sec->output_section)
+	{
+	  lowword = ad;
+	  highword = bfinfdpic_got_section (info)->output_section->vma
+	    + bfinfdpic_got_section (info)->output_offset
+	    + bfinfdpic_got_initial_offset (info);
+	}
+      else if (entry->lazyplt)
+	{
+	  if (ad)
+	    return FALSE;
+
+	  fd_lazy_rel_offset = ofst;
+
+	  /* A function descriptor used for lazy or local resolving is
+	     initialized such that its high word contains the output
+	     section index in which the PLT entries are located, and
+	     the low word contains the address of the lazy PLT entry
+	     entry point, that must be within the memory region
+	     assigned to that section.  */
+	  lowword = entry->lzplt_entry + 4
+	    + bfinfdpic_plt_section (info)->output_offset
+	    + bfinfdpic_plt_section (info)->output_section->vma;
+	  highword = _bfinfdpic_osec_to_segment
+	    (output_bfd, bfinfdpic_plt_section (info)->output_section);
+	}
+      else
+	{
+	  /* A function descriptor for a local function gets the index
+	     of the section.  For a non-local function, it's
+	     disregarded.  */
+	  lowword = ad;
+	  if (entry->symndx == -1 && entry->d.h->dynindx != -1
+	      && entry->d.h->dynindx == idx)
+	    highword = 0;
+	  else
+	    highword = _bfinfdpic_osec_to_segment
+	      (output_bfd, sec->output_section);
+	}
+
+      bfd_put_32 (output_bfd, lowword,
+		  bfinfdpic_got_section (info)->contents
+		  + bfinfdpic_got_initial_offset (info)
+		  + entry->fd_entry);
+      bfd_put_32 (output_bfd, highword,
+		  bfinfdpic_got_section (info)->contents
+		  + bfinfdpic_got_initial_offset (info)
+		  + entry->fd_entry + 4);
+    }
+
+  /* Generate code for the PLT entry.  */
+  if (entry->plt_entry != (bfd_vma) -1)
+    {
+      bfd_byte *plt_code = bfinfdpic_plt_section (info)->contents
+	+ entry->plt_entry;
+
+      BFD_ASSERT (entry->fd_entry);
+
+      /* Figure out what kind of PLT entry we need, depending on the
+	 location of the function descriptor within the GOT.  */
+      if (entry->fd_entry >= -(1 << (18 - 1))
+	  && entry->fd_entry + 4 < (1 << (18 - 1)))
+	{
+	  /* P1 = [P3 + fd_entry]; P3 = [P3 + fd_entry + 4] */
+	  bfd_put_32 (output_bfd,
+		      0xe519 | ((entry->fd_entry << 14) & 0xFFFF0000),
+		      plt_code);
+	  bfd_put_32 (output_bfd,
+		      0xe51b | (((entry->fd_entry + 4) << 14) & 0xFFFF0000),
+		      plt_code + 4);
+	  plt_code += 8;
+	}
+      else
+	{
+	  /* P1.L = fd_entry; P1.H = fd_entry;
+	     P3 = P3 + P1;
+	     P1 = [P3];
+	     P3 = [P3 + 4];  */
+	  bfd_put_32 (output_bfd,
+		      0xe109 | (entry->fd_entry << 16),
+		      plt_code);
+	  bfd_put_32 (output_bfd,
+		      0xe149 | (entry->fd_entry & 0xFFFF0000),
+		      plt_code + 4);
+	  bfd_put_16 (output_bfd, 0x5ad9, plt_code + 8);
+	  bfd_put_16 (output_bfd, 0x9159, plt_code + 10);
+	  bfd_put_16 (output_bfd, 0xac5b, plt_code + 12);
+	  plt_code += 14;
+	}
+      /* JUMP (P1) */
+      bfd_put_16 (output_bfd, 0x0051, plt_code);
+    }
+
+  /* Generate code for the lazy PLT entry.  */
+  if (entry->lzplt_entry != (bfd_vma) -1)
+    {
+      bfd_byte *lzplt_code = bfinfdpic_plt_section (info)->contents
+	+ entry->lzplt_entry;
+      bfd_vma resolverStub_addr;
+
+      bfd_put_32 (output_bfd, fd_lazy_rel_offset, lzplt_code);
+      lzplt_code += 4;
+
+      resolverStub_addr = entry->lzplt_entry / BFINFDPIC_LZPLT_BLOCK_SIZE
+	* BFINFDPIC_LZPLT_BLOCK_SIZE + BFINFDPIC_LZPLT_RESOLV_LOC;
+      if (resolverStub_addr >= bfinfdpic_plt_initial_offset (info))
+	resolverStub_addr = bfinfdpic_plt_initial_offset (info) - LZPLT_NORMAL_SIZE - LZPLT_RESOLVER_EXTRA;
+
+      if (entry->lzplt_entry == resolverStub_addr)
+	{
+	  /* This is a lazy PLT entry that includes a resolver call.
+	     P2 = [P3];
+	     R3 = [P3 + 4];
+	     JUMP (P2);  */
+	  bfd_put_32 (output_bfd,
+		      0xa05b915a,
+		      lzplt_code);
+	  bfd_put_16 (output_bfd, 0x0052, lzplt_code + 4);
+	}
+      else
+	{
+	  /* JUMP.S  resolverStub */
+	  bfd_put_16 (output_bfd,
+		      0x2000
+		      | (((resolverStub_addr - entry->lzplt_entry)
+			  / 2) & (((bfd_vma)1 << 12) - 1)),
+		      lzplt_code);
+	}
+    }
+
+  return TRUE;
+}
+
+
+/* Look through the relocs for a section during the first phase, and
+   allocate space in the global offset table or procedure linkage
+   table.  */
+
+static bfd_boolean
+bfin_check_relocs (bfd * abfd,
+		   struct bfd_link_info *info,
+		   asection *sec,
+                   const Elf_Internal_Rela *relocs)
+{
+  bfd *dynobj;
+  Elf_Internal_Shdr *symtab_hdr;
+  struct elf_link_hash_entry **sym_hashes;
+  bfd_signed_vma *local_got_refcounts;
+  const Elf_Internal_Rela *rel;
+  const Elf_Internal_Rela *rel_end;
+  asection *sgot;
+  asection *srelgot;
+  asection *sreloc;
+  if (info->relocatable)
+    return TRUE;
+
+  dynobj = elf_hash_table (info)->dynobj;
+  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  sym_hashes = elf_sym_hashes (abfd);
+  local_got_refcounts = elf_local_got_refcounts (abfd);
+
+  sgot = NULL;
+  srelgot = NULL;
+  sreloc = NULL;
+
+  rel_end = relocs + sec->reloc_count;
+  for (rel = relocs; rel < rel_end; rel++)
+    {
+      unsigned long r_symndx;
+      struct elf_link_hash_entry *h;
+
+      r_symndx = ELF32_R_SYM (rel->r_info);
+      if (r_symndx < symtab_hdr->sh_info)
+	h = NULL;
+      else
+	h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+
+      switch (ELF32_R_TYPE (rel->r_info))
+	{
+       /* This relocation describes the C++ object vtable hierarchy.
+           Reconstruct it for later use during GC.  */
+        case R_BFIN_GNU_VTINHERIT:
+          if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+            return FALSE;
+          break;
+
+        /* This relocation describes which C++ vtable entries
+           are actually used.  Record for later use during GC.  */
+        case R_BFIN_GNU_VTENTRY:
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+            return FALSE;
+          break;
+
+	case R_got:
+	  if (h != NULL
+	      && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+	    break;
+	  /* Fall through.  */
+
+	  if (dynobj == NULL)
+	    {
+	      /* Create the .got section.  */
+	      elf_hash_table (info)->dynobj = dynobj = abfd;
+	      if (!_bfd_elf_create_got_section (dynobj, info))
+		return FALSE;
+	    }
+
+	  if (sgot == NULL)
+	    {
+	      sgot = bfd_get_section_by_name (dynobj, ".got");
+	      BFD_ASSERT (sgot != NULL);
+	    }
+
+	  if (srelgot == NULL && (h != NULL || info->shared))
+	    {
+	      srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+	      if (srelgot == NULL)
+		{
+		  srelgot = bfd_make_section (dynobj, ".rela.got");
+		  if (srelgot == NULL
+		      || !bfd_set_section_flags (dynobj, srelgot,
+						 (SEC_ALLOC
+						  | SEC_LOAD
 						  | SEC_HAS_CONTENTS
 						  | SEC_IN_MEMORY
 						  | SEC_LINKER_CREATED
@@ -1656,492 +2063,2729 @@ elf32_bfin_reloc_type_class (const Elf_Internal_Rela * rela)
       return reloc_class_normal;
     }
 }
+
+/* Relocate an Blackfin ELF section.
+
+   The RELOCATE_SECTION function is called by the new ELF backend linker
+   to handle the relocations for a section.
+
+   The relocs are always passed as Rela structures; if the section
+   actually uses Rel structures, the r_addend field will always be
+   zero.
+
+   This function is responsible for adjusting the section contents as
+   necessary, and (if using Rela relocs and generating a relocatable
+   output file) adjusting the reloc addend as necessary.
+
+   This function does not have to worry about setting the reloc
+   address or the reloc symbol index.
+
+   LOCAL_SYMS is a pointer to the swapped in local symbols.
+
+   LOCAL_SECTIONS is an array giving the section in the input file
+   corresponding to the st_shndx field of each local symbol.
+
+   The global hash table entry for the global symbols can be found
+   via elf_sym_hashes (input_bfd).
+
+   When generating relocatable output, this function must handle
+   STB_LOCAL/STT_SECTION symbols specially.  The output symbol is
+   going to be the section symbol corresponding to the output
+   section, which means that the addend must be adjusted
+   accordingly.  */
 
 static bfd_boolean
-bfin_relocate_section (bfd * output_bfd,
-		       struct bfd_link_info *info,
-		       bfd * input_bfd,
-		       asection * input_section,
-		       bfd_byte * contents,
-		       Elf_Internal_Rela * relocs,
-		       Elf_Internal_Sym * local_syms,
-		       asection ** local_sections)
+bfinfdpic_relocate_section (bfd * output_bfd,
+			    struct bfd_link_info *info,
+			    bfd * input_bfd,
+			    asection * input_section,
+			    bfd_byte * contents,
+			    Elf_Internal_Rela * relocs,
+			    Elf_Internal_Sym * local_syms,
+			    asection ** local_sections)
 {
-  bfd *dynobj;
   Elf_Internal_Shdr *symtab_hdr;
   struct elf_link_hash_entry **sym_hashes;
-  bfd_vma *local_got_offsets;
-  asection *sgot;
-  asection *sreloc;
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
-  int i = 0;
+  unsigned isec_segment, got_segment, plt_segment,
+    check_segment[2];
+  int silence_segment_error = !(info->shared || info->pie);
 
   if (info->relocatable)
     return TRUE;
 
-  dynobj = elf_hash_table (info)->dynobj;
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (input_bfd);
-  local_got_offsets = elf_local_got_offsets (input_bfd);
-
-  sgot = NULL;
-  sreloc = NULL;
+  relend     = relocs + input_section->reloc_count;
+
+  isec_segment = _bfinfdpic_osec_to_segment (output_bfd,
+					     input_section->output_section);
+  if (IS_FDPIC (output_bfd) && bfinfdpic_got_section (info))
+    got_segment = _bfinfdpic_osec_to_segment (output_bfd,
+					      bfinfdpic_got_section (info)
+					      ->output_section);
+  else
+    got_segment = -1;
+  if (IS_FDPIC (output_bfd) && elf_hash_table (info)->dynamic_sections_created)
+    plt_segment = _bfinfdpic_osec_to_segment (output_bfd,
+					      bfinfdpic_plt_section (info)
+					      ->output_section);
+  else
+    plt_segment = -1;
 
-  rel = relocs;
-  relend = relocs + input_section->reloc_count;
-  for (; rel < relend; rel++, i++)
+  for (rel = relocs; rel < relend; rel ++)
     {
-      int r_type;
       reloc_howto_type *howto;
       unsigned long r_symndx;
-      struct elf_link_hash_entry *h;
       Elf_Internal_Sym *sym;
       asection *sec;
-      bfd_vma relocation = 0;
-      bfd_boolean unresolved_reloc;
+      struct elf_link_hash_entry *h;
+      bfd_vma relocation;
       bfd_reloc_status_type r;
-      bfd_vma address;
+      const char * name = NULL;
+      int r_type;
+      asection *osec;
+      struct bfinfdpic_relocs_info *picrel;
+      bfd_vma orig_addend = rel->r_addend;
 
       r_type = ELF32_R_TYPE (rel->r_info);
-      if (r_type < 0 || r_type >= 243)
-	{
-	  bfd_set_error (bfd_error_bad_value);
-	  return FALSE;
-	}
 
-      if (r_type == R_BFIN_GNU_VTENTRY
-          || r_type == R_BFIN_GNU_VTINHERIT)
+      if (r_type == R_BFIN_GNU_VTINHERIT
+	  || r_type == R_BFIN_GNU_VTENTRY)
 	continue;
 
+      /* This is a final link.  */
+      r_symndx = ELF32_R_SYM (rel->r_info);
       howto = bfin_reloc_type_lookup (input_bfd, r_type);
       if (howto == NULL)
 	{
 	  bfd_set_error (bfd_error_bad_value);
 	  return FALSE;
 	}
-      r_symndx = ELF32_R_SYM (rel->r_info);
 
-      h = NULL;
-      sym = NULL;
-      sec = NULL;
-      unresolved_reloc = FALSE;
+      h      = NULL;
+      sym    = NULL;
+      sec    = NULL;
 
       if (r_symndx < symtab_hdr->sh_info)
 	{
 	  sym = local_syms + r_symndx;
-	  sec = local_sections[r_symndx];
+	  osec = sec = local_sections [r_symndx];
 	  relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+
+	  name = bfd_elf_string_from_elf_section
+	    (input_bfd, symtab_hdr->sh_link, sym->st_name);
+	  name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
 	}
       else
 	{
-	  h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+	  h = sym_hashes [r_symndx - symtab_hdr->sh_info];
 
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
-	  if (!
-	      (!strcmp (h->root.root.string, ".__constant")
-	       || !strcmp (h->root.root.string, ".__operator")))
-	    {
-	      bfd_boolean warned;
-	      h = NULL;
-	      RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
-				       r_symndx, symtab_hdr, sym_hashes,
-				       h, sec, relocation,
-				       unresolved_reloc, warned);
+	  name = h->root.root.string;
 
+	  if ((h->root.type == bfd_link_hash_defined
+	       || h->root.type == bfd_link_hash_defweak)
+	      && ! BFINFDPIC_SYM_LOCAL (info, h))
+	    {
+	      sec = NULL;
+	      relocation = 0;
 	    }
+	  else
+	    if (h->root.type == bfd_link_hash_defined
+		|| h->root.type == bfd_link_hash_defweak)
+	      {
+		sec = h->root.u.def.section;
+		relocation = (h->root.u.def.value
+			      + sec->output_section->vma
+			      + sec->output_offset);
+	      }
+	    else if (h->root.type == bfd_link_hash_undefweak)
+	      {
+		relocation = 0;
+	      }
+	    else if (info->unresolved_syms_in_objects == RM_IGNORE
+		     && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
+	      relocation = 0;
+	    else
+	      {
+		if (! ((*info->callbacks->undefined_symbol)
+		       (info, h->root.root.string, input_bfd,
+			input_section, rel->r_offset,
+			(info->unresolved_syms_in_objects == RM_GENERATE_ERROR
+			 || ELF_ST_VISIBILITY (h->other)))))
+		  return FALSE;
+		relocation = 0;
+	      }
+	  osec = sec;
 	}
 
-      address = rel->r_offset;
-      /* First, get stack relocs out of the way.  */
       switch (r_type)
 	{
-	case R_push:
-	  reloc_stack_push (relocation + rel->r_addend);
-	  r = bfd_reloc_ok;
-	  goto done_reloc;
-	case R_const:
-	  reloc_stack_push (rel->r_addend);
-	  r = bfd_reloc_ok;
-	  goto done_reloc;
-	case R_add:
-	case R_sub:
-	case R_mult:
-	case R_div:
-	case R_mod:
-	case R_lshift:
-	case R_rshift:
-	case R_neg:
-	case R_and:
-	case R_or:
-	case R_xor:
-	case R_land:
-	case R_lor:
-	case R_comp:
-	case R_page:
-	case R_hwpage:
-	  reloc_stack_operate (r_type);
-	  r = bfd_reloc_ok;
-	  goto done_reloc;
+	case R_pcrel24:
+	case R_pcrel24_jump_l:
+	case R_byte4_data:
+	  if (! IS_FDPIC (output_bfd))
+	    goto non_fdpic;
+
+	case R_BFIN_GOT17M4:
+	case R_BFIN_GOTHI:
+	case R_BFIN_GOTLO:
+	case R_BFIN_FUNCDESC_GOT17M4:
+	case R_BFIN_FUNCDESC_GOTHI:
+	case R_BFIN_FUNCDESC_GOTLO:
+	case R_BFIN_GOTOFF17M4:
+	case R_BFIN_GOTOFFHI:
+	case R_BFIN_GOTOFFLO:
+	case R_BFIN_FUNCDESC_GOTOFF17M4:
+	case R_BFIN_FUNCDESC_GOTOFFHI:
+	case R_BFIN_FUNCDESC_GOTOFFLO:
+	case R_BFIN_FUNCDESC:
+	case R_BFIN_FUNCDESC_VALUE:
+	  if (h != NULL)
+	    picrel = bfinfdpic_relocs_info_for_global (bfinfdpic_relocs_info
+						       (info), input_bfd, h,
+						       orig_addend, INSERT);
+	  else
+	    /* In order to find the entry we created before, we must
+	       use the original addend, not the one that may have been
+	       modified by _bfd_elf_rela_local_sym().  */
+	    picrel = bfinfdpic_relocs_info_for_local (bfinfdpic_relocs_info
+						      (info), input_bfd, r_symndx,
+						      orig_addend, INSERT);
+	  if (! picrel)
+	    return FALSE;
+
+	  if (!_bfinfdpic_emit_got_relocs_plt_entries (picrel, output_bfd, info,
+						       osec, sym,
+						       rel->r_addend))
+	    {
+	      (*_bfd_error_handler)
+		(_("%B: relocation at `%A+0x%x' references symbol `%s' with nonzero addend"),
+		 input_bfd, input_section, rel->r_offset, name);
+	      return FALSE;
+
+	    }
+
+	  break;
 
 	default:
-	  if (!is_reloc_stack_empty())
-	    relocation = reloc_stack_pop ();
+	non_fdpic:
+	  picrel = NULL;
+	  if (h && ! BFINFDPIC_SYM_LOCAL (info, h))
+	    {
+	      info->callbacks->warning
+		(info, _("relocation references symbol not defined in the module"),
+		 name, input_bfd, input_section, rel->r_offset);
+	      return FALSE;
+	    }
 	  break;
 	}
 
-      /* Then, process normally.  */
       switch (r_type)
 	{
-	case R_BFIN_GNU_VTINHERIT:
-	case R_BFIN_GNU_VTENTRY:
-	  return bfd_reloc_ok;
+	case R_pcrel24:
+	case R_pcrel24_jump_l:
+	  check_segment[0] = isec_segment;
+	  if (! IS_FDPIC (output_bfd))
+	    check_segment[1] = isec_segment;
+	  else if (picrel->plt)
+	    {
+	      relocation = bfinfdpic_plt_section (info)->output_section->vma
+		+ bfinfdpic_plt_section (info)->output_offset
+		+ picrel->plt_entry;
+	      check_segment[1] = plt_segment;
+	    }
+	  /* We don't want to warn on calls to undefined weak symbols,
+	     as calls to them must be protected by non-NULL tests
+	     anyway, and unprotected calls would invoke undefined
+	     behavior.  */
+	  else if (picrel->symndx == -1
+		   && picrel->d.h->root.type == bfd_link_hash_undefweak)
+	    check_segment[1] = check_segment[0];
+	  else
+	    check_segment[1] = sec
+	      ? _bfinfdpic_osec_to_segment (output_bfd, sec->output_section)
+	      : (unsigned)-1;
+	  break;
 
-	case R_got:
-	  /* Relocation is to the address of the entry for this symbol
-	     in the global offset table.  */
-	  if (h != NULL
-	      && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
-	    goto do_default;
-	  /* Fall through.  */
-	  /* Relocation is the offset of the entry for this symbol in
-	     the global offset table.  */
+	case R_BFIN_GOT17M4:
+	case R_BFIN_GOTHI:
+	case R_BFIN_GOTLO:
+	  relocation = picrel->got_entry;
+	  check_segment[0] = check_segment[1] = got_segment;
+	  break;
 
-	  {
-	    bfd_vma off;
+	case R_BFIN_FUNCDESC_GOT17M4:
+	case R_BFIN_FUNCDESC_GOTHI:
+	case R_BFIN_FUNCDESC_GOTLO:
+	  relocation = picrel->fdgot_entry;
+	  check_segment[0] = check_segment[1] = got_segment;
+	  break;
 
-	    if (sgot == NULL)
-	      {
-		sgot = bfd_get_section_by_name (dynobj, ".got");
-		BFD_ASSERT (sgot != NULL);
-	      }
+	case R_BFIN_GOTOFFHI:
+	case R_BFIN_GOTOFF17M4:
+	case R_BFIN_GOTOFFLO:
+	  relocation -= bfinfdpic_got_section (info)->output_section->vma
+	    + bfinfdpic_got_section (info)->output_offset
+	    + bfinfdpic_got_initial_offset (info);
+	  check_segment[0] = got_segment;
+	  check_segment[1] = sec
+	    ? _bfinfdpic_osec_to_segment (output_bfd, sec->output_section)
+	    : (unsigned)-1;
+	  break;
 
-	    if (h != NULL)
-	      {
-		bfd_boolean dyn;
+	case R_BFIN_FUNCDESC_GOTOFF17M4:
+	case R_BFIN_FUNCDESC_GOTOFFHI:
+	case R_BFIN_FUNCDESC_GOTOFFLO:
+	  relocation = picrel->fd_entry;
+	  check_segment[0] = check_segment[1] = got_segment;
+	  break;
 
-		off = h->got.offset;
-		BFD_ASSERT (off != (bfd_vma) - 1);
-		dyn = elf_hash_table (info)->dynamic_sections_created;
+	case R_BFIN_FUNCDESC:
+	  {
+	    int dynindx;
+	    bfd_vma addend = rel->r_addend;
 
-		if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
-		    || (info->shared
-			&& (info->symbolic
-			    || h->dynindx == -1
-			    || h->forced_local)
-			&& h->def_regular))
+	    if (! (h && h->root.type == bfd_link_hash_undefweak
+		   && BFINFDPIC_SYM_LOCAL (info, h)))
+	      {
+		/* If the symbol is dynamic and there may be dynamic
+		   symbol resolution because we are or are linked with a
+		   shared library, emit a FUNCDESC relocation such that
+		   the dynamic linker will allocate the function
+		   descriptor.  If the symbol needs a non-local function
+		   descriptor but binds locally (e.g., its visibility is
+		   protected, emit a dynamic relocation decayed to
+		   section+offset.  */
+		if (h && ! BFINFDPIC_FUNCDESC_LOCAL (info, h)
+		    && BFINFDPIC_SYM_LOCAL (info, h)
+		    && !(info->executable && !info->pie))
 		  {
-		    /* This is actually a static link, or it is a
-		       -Bsymbolic link and the symbol is defined
-		       locally, or the symbol was forced to be local
-		       because of a version file..  We must initialize
-		       this entry in the global offset table.  Since
-		       the offset must always be a multiple of 4, we
-		       use the least significant bit to record whether
-		       we have initialized it already.
-
-		       When doing a dynamic link, we create a .rela.got
-		       relocation entry to initialize the value.  This
-		       is done in the finish_dynamic_symbol routine.  */
-		    if ((off & 1) != 0)
-		      off &= ~1;
-		    else
+		    dynindx = elf_section_data (h->root.u.def.section
+						->output_section)->dynindx;
+		    addend += h->root.u.def.section->output_offset
+		      + h->root.u.def.value;
+		  }
+		else if (h && ! BFINFDPIC_FUNCDESC_LOCAL (info, h))
+		  {
+		    if (addend)
 		      {
-			bfd_put_32 (output_bfd, relocation,
-				    sgot->contents + off);
-			h->got.offset |= 1;
+			info->callbacks->warning
+			  (info, _("R_BFIN_FUNCDESC references dynamic symbol with nonzero addend"),
+			   name, input_bfd, input_section, rel->r_offset);
+			return FALSE;
 		      }
+		    dynindx = h->dynindx;
 		  }
-		else
-		  unresolved_reloc = FALSE;
-	      }
-	    else
-	      {
-		BFD_ASSERT (local_got_offsets != NULL);
-		off = local_got_offsets[r_symndx];
-		BFD_ASSERT (off != (bfd_vma) - 1);
-
-		/* The offset must always be a multiple of 4.  We use
-		   the least significant bit to record whether we have
-		   already generated the necessary reloc.  */
-		if ((off & 1) != 0)
-		  off &= ~1;
 		else
 		  {
-		    bfd_put_32 (output_bfd, relocation, sgot->contents + off);
+		    /* Otherwise, we know we have a private function
+		       descriptor, so reference it directly.  */
+		    BFD_ASSERT (picrel->privfd);
+		    r_type = R_byte4_data;
+		    dynindx = elf_section_data (bfinfdpic_got_section (info)
+						->output_section)->dynindx;
+		    addend = bfinfdpic_got_section (info)->output_offset
+		      + bfinfdpic_got_initial_offset (info)
+		      + picrel->fd_entry;
+		  }
 
-		    if (info->shared)
+		/* If there is room for dynamic symbol resolution, emit
+		   the dynamic relocation.  However, if we're linking an
+		   executable at a fixed location, we won't have emitted a
+		   dynamic symbol entry for the got section, so idx will
+		   be zero, which means we can and should compute the
+		   address of the private descriptor ourselves.  */
+		if (info->executable && !info->pie
+		    && (!h || BFINFDPIC_FUNCDESC_LOCAL (info, h)))
+		  {
+		    addend += bfinfdpic_got_section (info)->output_section->vma;
+		    if ((bfd_get_section_flags (output_bfd,
+						input_section->output_section)
+			 & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
 		      {
-			asection *s;
-			Elf_Internal_Rela outrel;
-			bfd_byte *loc;
-
-			s = bfd_get_section_by_name (dynobj, ".rela.got");
-			BFD_ASSERT (s != NULL);
-
-			outrel.r_offset = (sgot->output_section->vma
-					   + sgot->output_offset + off);
-			outrel.r_info =
-			  ELF32_R_INFO (0, R_pcrel24);
-			outrel.r_addend = relocation;
-			loc = s->contents;
-			loc +=
-			  s->reloc_count++ * sizeof (Elf32_External_Rela);
-			bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+			if (_bfinfdpic_osec_readonly_p (output_bfd,
+						       input_section
+						       ->output_section))
+			  {
+			    info->callbacks->warning
+			      (info,
+			       _("cannot emit fixups in read-only section"),
+			       name, input_bfd, input_section, rel->r_offset);
+			    return FALSE;
+			  }
+			_bfinfdpic_add_rofixup (output_bfd,
+					       bfinfdpic_gotfixup_section
+					       (info),
+					       _bfd_elf_section_offset
+					       (output_bfd, info,
+						input_section, rel->r_offset)
+					       + input_section
+					       ->output_section->vma
+					       + input_section->output_offset,
+					       picrel);
 		      }
-
-		    local_got_offsets[r_symndx] |= 1;
 		  }
+		else if ((bfd_get_section_flags (output_bfd,
+						 input_section->output_section)
+			  & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
+		  {
+		    if (_bfinfdpic_osec_readonly_p (output_bfd,
+						   input_section
+						   ->output_section))
+		      {
+			info->callbacks->warning
+			  (info,
+			   _("cannot emit dynamic relocations in read-only section"),
+			   name, input_bfd, input_section, rel->r_offset);
+			return FALSE;
+		      }
+		    _bfinfdpic_add_dyn_reloc (output_bfd,
+					      bfinfdpic_gotrel_section (info),
+					      _bfd_elf_section_offset
+					      (output_bfd, info,
+					       input_section, rel->r_offset)
+					      + input_section
+					      ->output_section->vma
+					      + input_section->output_offset,
+					      r_type, dynindx, addend, picrel);
+		  }
+		else
+		  addend += bfinfdpic_got_section (info)->output_section->vma;
 	      }
 
-	    relocation = sgot->output_offset + off;
-	    rel->r_addend = 0;
-            /* bfin : preg = [preg + 17bitdiv4offset] relocation is div by 4.  */
-            relocation /= 4;
+	    /* We want the addend in-place because dynamic
+	       relocations are REL.  Setting relocation to it should
+	       arrange for it to be installed.  */
+	    relocation = addend - rel->r_addend;
 	  }
-	  goto do_default;
+	  check_segment[0] = check_segment[1] = got_segment;
+	  break;
 
-	case R_pcrel24:
-	case R_pcrel24_jump_l:
+	case R_byte4_data:
+	  if (! IS_FDPIC (output_bfd))
+	    {
+	      check_segment[0] = check_segment[1] = -1;
+	      break;
+	    }
+	  /* Fall through.  */
+	case R_BFIN_FUNCDESC_VALUE:
 	  {
-	    bfd_vma x;
-
-	    relocation += rel->r_addend;
-
-	    /* Perform usual pc-relative correction.  */
-	    relocation -= input_section->output_section->vma + input_section->output_offset;
-	    relocation -= address;
-
-	    /* We are getting reloc_entry->address 2 byte off from
-	       the start of instruction. Assuming absolute postion
-	       of the reloc data. But, following code had been written assuming 
-	       reloc address is starting at begining of instruction.
-	       To compensate that I have increased the value of 
-	       relocation by 1 (effectively 2) and used the addr -2 instead of addr.  */ 
-
-	    relocation += 2;
-	    address -= 2;
+	    int dynindx;
+	    bfd_vma addend = rel->r_addend;
 
-	    relocation >>= 1;
+	    /* If the symbol is dynamic but binds locally, use
+	       section+offset.  */
+	    if (h && ! BFINFDPIC_SYM_LOCAL (info, h))
+	      {
+		if (addend && r_type == R_BFIN_FUNCDESC_VALUE)
+		  {
+		    info->callbacks->warning
+		      (info, _("R_BFIN_FUNCDESC_VALUE references dynamic symbol with nonzero addend"),
+		       name, input_bfd, input_section, rel->r_offset);
+		    return FALSE;
+		  }
+		dynindx = h->dynindx;
+	      }
+	    else
+	      {
+		if (h)
+		  addend += h->root.u.def.value;
+		else
+		  addend += sym->st_value;
+		if (osec)
+		  addend += osec->output_offset;
+		if (osec && osec->output_section
+		    && ! bfd_is_abs_section (osec->output_section)
+		    && ! bfd_is_und_section (osec->output_section))
+		  dynindx = elf_section_data (osec->output_section)->dynindx;
+		else
+		  dynindx = 0;
+	      }
 
-	    x = bfd_get_16 (input_bfd, contents + address);
-	    x = (x & 0xff00) | ((relocation >> 16) & 0xff);
-	    bfd_put_16 (input_bfd, x, contents + address);
+	    /* If we're linking an executable at a fixed address, we
+	       can omit the dynamic relocation as long as the symbol
+	       is defined in the current link unit (which is implied
+	       by its output section not being NULL).  */
+	    if (info->executable && !info->pie
+		&& (!h || BFINFDPIC_SYM_LOCAL (info, h)))
+	      {
+		if (osec)
+		  addend += osec->output_section->vma;
+		if (IS_FDPIC (input_bfd)
+		    && (bfd_get_section_flags (output_bfd,
+					       input_section->output_section)
+			& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
+		  {
+		    if (_bfinfdpic_osec_readonly_p (output_bfd,
+						   input_section
+						   ->output_section))
+		      {
+			info->callbacks->warning
+			  (info,
+			   _("cannot emit fixups in read-only section"),
+			   name, input_bfd, input_section, rel->r_offset);
+			return FALSE;
+		      }
+		    if (!h || h->root.type != bfd_link_hash_undefweak)
+		      {
+			_bfinfdpic_add_rofixup (output_bfd,
+					       bfinfdpic_gotfixup_section
+					       (info),
+					       _bfd_elf_section_offset
+					       (output_bfd, info,
+						input_section, rel->r_offset)
+					       + input_section
+					       ->output_section->vma
+					       + input_section->output_offset,
+					       picrel);
+			if (r_type == R_BFIN_FUNCDESC_VALUE)
+			  _bfinfdpic_add_rofixup
+			    (output_bfd,
+			     bfinfdpic_gotfixup_section (info),
+			     _bfd_elf_section_offset
+			     (output_bfd, info,
+			      input_section, rel->r_offset)
+			     + input_section->output_section->vma
+			     + input_section->output_offset + 4, picrel);
+		      }
+		  }
+	      }
+	    else
+	      {
+		if ((bfd_get_section_flags (output_bfd,
+					    input_section->output_section)
+		     & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
+		  {
+		    if (_bfinfdpic_osec_readonly_p (output_bfd,
+						   input_section
+						   ->output_section))
+		      {
+			info->callbacks->warning
+			  (info,
+			   _("cannot emit dynamic relocations in read-only section"),
+			   name, input_bfd, input_section, rel->r_offset);
+			return FALSE;
+		      }
+		    _bfinfdpic_add_dyn_reloc (output_bfd,
+					      bfinfdpic_gotrel_section (info),
+					      _bfd_elf_section_offset
+					      (output_bfd, info,
+					       input_section, rel->r_offset)
+					      + input_section
+					      ->output_section->vma
+					      + input_section->output_offset,
+					      r_type, dynindx, addend, picrel);
+		  }
+		else if (osec)
+		  addend += osec->output_section->vma;
+		/* We want the addend in-place because dynamic
+		   relocations are REL.  Setting relocation to it
+		   should arrange for it to be installed.  */
+		relocation = addend - rel->r_addend;
+	      }
 
-	    x = bfd_get_16 (input_bfd, contents + address + 2);
-	    x = relocation & 0xFFFF;
-	    bfd_put_16 (input_bfd, x, contents + address + 2);
-	    r = bfd_reloc_ok;
+	    if (r_type == R_BFIN_FUNCDESC_VALUE)
+	      {
+		/* If we've omitted the dynamic relocation, just emit
+		   the fixed addresses of the symbol and of the local
+		   GOT base offset.  */
+		if (info->executable && !info->pie
+		    && (!h || BFINFDPIC_SYM_LOCAL (info, h)))
+		  bfd_put_32 (output_bfd,
+			      bfinfdpic_got_section (info)->output_section->vma
+			      + bfinfdpic_got_section (info)->output_offset
+			      + bfinfdpic_got_initial_offset (info),
+			      contents + rel->r_offset + 4);
+		else
+		  /* A function descriptor used for lazy or local
+		     resolving is initialized such that its high word
+		     contains the output section index in which the
+		     PLT entries are located, and the low word
+		     contains the offset of the lazy PLT entry entry
+		     point into that section.  */
+		  bfd_put_32 (output_bfd,
+			      h && ! BFINFDPIC_SYM_LOCAL (info, h)
+			      ? 0
+			      : _bfinfdpic_osec_to_segment (output_bfd,
+							    sec
+							    ->output_section),
+			      contents + rel->r_offset + 4);
+	      }
 	  }
+	  check_segment[0] = check_segment[1] = got_segment;
 	  break;
 
 	default:
-	do_default:
-	  r = _bfd_final_link_relocate (howto, input_bfd, input_section,
-					contents, address,
-					relocation, rel->r_addend);
-
+	  check_segment[0] = isec_segment;
+	  check_segment[1] = sec
+	    ? _bfinfdpic_osec_to_segment (output_bfd, sec->output_section)
+	    : (unsigned)-1;
 	  break;
 	}
 
-    done_reloc:
-      /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
-         because such sections are not SEC_ALLOC and thus ld.so will
-         not process them.  */
-      if (unresolved_reloc
+      if (check_segment[0] != check_segment[1] && IS_FDPIC (output_bfd))
+	{
+#if 1 /* If you take this out, remove the #error from fdpic-static-6.d
+	 in the ld testsuite.  */
+	  /* This helps catch problems in GCC while we can't do more
+	     than static linking.  The idea is to test whether the
+	     input file basename is crt0.o only once.  */
+	  if (silence_segment_error == 1)
+	    silence_segment_error =
+	      (strlen (input_bfd->filename) == 6
+	       && strcmp (input_bfd->filename, "crt0.o") == 0)
+	      || (strlen (input_bfd->filename) > 6
+		  && strcmp (input_bfd->filename
+			     + strlen (input_bfd->filename) - 7,
+			     "/crt0.o") == 0)
+	      ? -1 : 0;
+#endif
+	  if (!silence_segment_error
+	      /* We don't want duplicate errors for undefined
+		 symbols.  */
+	      && !(picrel && picrel->symndx == -1
+		   && picrel->d.h->root.type == bfd_link_hash_undefined))
+	    info->callbacks->warning
+	      (info,
+	       (info->shared || info->pie)
+	       ? _("relocations between different segments are not supported")
+	       : _("warning: relocation references a different segment"),
+	       name, input_bfd, input_section, rel->r_offset);
+	  if (!silence_segment_error && (info->shared || info->pie))
+	    return FALSE;
+	  elf_elfheader (output_bfd)->e_flags |= EF_BFIN_PIC;
+	}
+
+      switch (r_type)
+	{
+	case R_BFIN_GOTOFFHI:
+	  /* We need the addend to be applied before we shift the
+	     value right.  */
+	  relocation += rel->r_addend;
+	  /* Fall through.  */
+	case R_BFIN_GOTHI:
+	case R_BFIN_FUNCDESC_GOTHI:
+	case R_BFIN_FUNCDESC_GOTOFFHI:
+	  relocation >>= 16;
+	  /* Fall through.  */
+
+	case R_BFIN_GOTLO:
+	case R_BFIN_FUNCDESC_GOTLO:
+	case R_BFIN_GOTOFFLO:
+	case R_BFIN_FUNCDESC_GOTOFFLO:
+	  relocation &= 0xffff;
+	  break;
+
+	default:
+	  break;
+	}
+
+      switch (r_type)
+	{
+	case R_pcrel24:
+	case R_pcrel24_jump_l:
+	  if (! IS_FDPIC (output_bfd) || ! picrel->plt)
+	    break;
+	  /* Fall through.  */
+
+	  /* When referencing a GOT entry, a function descriptor or a
+	     PLT, we don't want the addend to apply to the reference,
+	     but rather to the referenced symbol.  The actual entry
+	     will have already been created taking the addend into
+	     account, so cancel it out here.  */
+	case R_BFIN_GOT17M4:
+	case R_BFIN_GOTHI:
+	case R_BFIN_GOTLO:
+	case R_BFIN_FUNCDESC_GOT17M4:
+	case R_BFIN_FUNCDESC_GOTHI:
+	case R_BFIN_FUNCDESC_GOTLO:
+	case R_BFIN_FUNCDESC_GOTOFF17M4:
+	case R_BFIN_FUNCDESC_GOTOFFHI:
+	case R_BFIN_FUNCDESC_GOTOFFLO:
+	  /* Note that we only want GOTOFFHI, not GOTOFFLO or GOTOFF17M4
+	     here, since we do want to apply the addend to the others.
+	     Note that we've applied the addend to GOTOFFHI before we
+	     shifted it right.  */
+	case R_BFIN_GOTOFFHI:
+	  relocation -= rel->r_addend;
+	  break;
+
+	default:
+	  break;
+	}
+
+      if (r_type == R_pcrel24
+	  || r_type == R_pcrel24_jump_l)
+	{
+	  bfd_vma x;
+	  bfd_vma address = rel->r_offset;
+
+	  relocation += rel->r_addend;
+
+	  /* Perform usual pc-relative correction.  */
+	  relocation -= input_section->output_section->vma + input_section->output_offset;
+	  relocation -= address;
+
+	  /* We are getting reloc_entry->address 2 byte off from
+	     the start of instruction. Assuming absolute postion
+	     of the reloc data. But, following code had been written assuming
+	     reloc address is starting at begining of instruction.
+	     To compensate that I have increased the value of
+	     relocation by 1 (effectively 2) and used the addr -2 instead of addr.  */
+
+	  relocation += 2;
+	  address -= 2;
+
+	  relocation >>= 1;
+
+	  x = bfd_get_16 (input_bfd, contents + address);
+	  x = (x & 0xff00) | ((relocation >> 16) & 0xff);
+	  bfd_put_16 (input_bfd, x, contents + address);
+
+	  x = bfd_get_16 (input_bfd, contents + address + 2);
+	  x = relocation & 0xFFFF;
+	  bfd_put_16 (input_bfd, x, contents + address + 2);
+	  r = bfd_reloc_ok;
+	}
+      else
+	r = _bfd_final_link_relocate (howto, input_bfd, input_section,
+				      contents, rel->r_offset,
+				      relocation, rel->r_addend);
+
+      if (r != bfd_reloc_ok)
+	{
+	  const char * msg = (const char *) NULL;
+
+	  switch (r)
+	    {
+	    case bfd_reloc_overflow:
+	      r = info->callbacks->reloc_overflow
+		(info, (h ? &h->root : NULL), name, howto->name,
+		 (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
+	      break;
+
+	    case bfd_reloc_undefined:
+	      r = info->callbacks->undefined_symbol
+		(info, name, input_bfd, input_section, rel->r_offset, TRUE);
+	      break;
+
+	    case bfd_reloc_outofrange:
+	      msg = _("internal error: out of range error");
+	      break;
+
+	    case bfd_reloc_notsupported:
+	      msg = _("internal error: unsupported relocation error");
+	      break;
+
+	    case bfd_reloc_dangerous:
+	      msg = _("internal error: dangerous relocation");
+	      break;
+
+	    default:
+	      msg = _("internal error: unknown error");
+	      break;
+	    }
+
+	  if (msg)
+	    r = info->callbacks->warning
+	      (info, msg, name, input_bfd, input_section, rel->r_offset);
+
+	  if (! r)
+	    return FALSE;
+	}
+    }
+
+  return TRUE;
+}
+
+static bfd_boolean
+bfin_relocate_section (bfd * output_bfd,
+		       struct bfd_link_info *info,
+		       bfd * input_bfd,
+		       asection * input_section,
+		       bfd_byte * contents,
+		       Elf_Internal_Rela * relocs,
+		       Elf_Internal_Sym * local_syms,
+		       asection ** local_sections)
+{
+  bfd *dynobj;
+  Elf_Internal_Shdr *symtab_hdr;
+  struct elf_link_hash_entry **sym_hashes;
+  bfd_vma *local_got_offsets;
+  asection *sgot;
+  asection *sreloc;
+  Elf_Internal_Rela *rel;
+  Elf_Internal_Rela *relend;
+  int i = 0;
+
+  if (info->relocatable)
+    return TRUE;
+
+  dynobj = elf_hash_table (info)->dynobj;
+  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  sym_hashes = elf_sym_hashes (input_bfd);
+  local_got_offsets = elf_local_got_offsets (input_bfd);
+
+  sgot = NULL;
+  sreloc = NULL;
+
+  rel = relocs;
+  relend = relocs + input_section->reloc_count;
+  for (; rel < relend; rel++, i++)
+    {
+      int r_type;
+      reloc_howto_type *howto;
+      unsigned long r_symndx;
+      struct elf_link_hash_entry *h;
+      Elf_Internal_Sym *sym;
+      asection *sec;
+      bfd_vma relocation = 0;
+      bfd_boolean unresolved_reloc;
+      bfd_reloc_status_type r;
+      bfd_vma address;
+
+      r_type = ELF32_R_TYPE (rel->r_info);
+      if (r_type < 0 || r_type >= 243)
+	{
+	  bfd_set_error (bfd_error_bad_value);
+	  return FALSE;
+	}
+
+      if (r_type == R_BFIN_GNU_VTENTRY
+          || r_type == R_BFIN_GNU_VTINHERIT)
+	continue;
+
+      howto = bfin_reloc_type_lookup (input_bfd, r_type);
+      if (howto == NULL)
+	{
+	  bfd_set_error (bfd_error_bad_value);
+	  return FALSE;
+	}
+      r_symndx = ELF32_R_SYM (rel->r_info);
+
+      h = NULL;
+      sym = NULL;
+      sec = NULL;
+      unresolved_reloc = FALSE;
+
+      if (r_symndx < symtab_hdr->sh_info)
+	{
+	  sym = local_syms + r_symndx;
+	  sec = local_sections[r_symndx];
+	  relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+	}
+      else
+	{
+	  bfd_boolean warned;
+	  h = NULL;
+	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+				   r_symndx, symtab_hdr, sym_hashes,
+				   h, sec, relocation,
+				   unresolved_reloc, warned);
+	}
+
+      address = rel->r_offset;
+
+      /* Then, process normally.  */
+      switch (r_type)
+	{
+	case R_BFIN_GNU_VTINHERIT:
+	case R_BFIN_GNU_VTENTRY:
+	  return bfd_reloc_ok;
+
+	case R_got:
+	  /* Relocation is to the address of the entry for this symbol
+	     in the global offset table.  */
+	  if (h != NULL
+	      && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+	    goto do_default;
+	  /* Fall through.  */
+	  /* Relocation is the offset of the entry for this symbol in
+	     the global offset table.  */
+
+	  {
+	    bfd_vma off;
+
+	    if (sgot == NULL)
+	      {
+		sgot = bfd_get_section_by_name (dynobj, ".got");
+		BFD_ASSERT (sgot != NULL);
+	      }
+
+	    if (h != NULL)
+	      {
+		bfd_boolean dyn;
+
+		off = h->got.offset;
+		BFD_ASSERT (off != (bfd_vma) - 1);
+		dyn = elf_hash_table (info)->dynamic_sections_created;
+
+		if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
+		    || (info->shared
+			&& (info->symbolic
+			    || h->dynindx == -1
+			    || h->forced_local)
+			&& h->def_regular))
+		  {
+		    /* This is actually a static link, or it is a
+		       -Bsymbolic link and the symbol is defined
+		       locally, or the symbol was forced to be local
+		       because of a version file..  We must initialize
+		       this entry in the global offset table.  Since
+		       the offset must always be a multiple of 4, we
+		       use the least significant bit to record whether
+		       we have initialized it already.
+
+		       When doing a dynamic link, we create a .rela.got
+		       relocation entry to initialize the value.  This
+		       is done in the finish_dynamic_symbol routine.  */
+		    if ((off & 1) != 0)
+		      off &= ~1;
+		    else
+		      {
+			bfd_put_32 (output_bfd, relocation,
+				    sgot->contents + off);
+			h->got.offset |= 1;
+		      }
+		  }
+		else
+		  unresolved_reloc = FALSE;
+	      }
+	    else
+	      {
+		BFD_ASSERT (local_got_offsets != NULL);
+		off = local_got_offsets[r_symndx];
+		BFD_ASSERT (off != (bfd_vma) - 1);
+
+		/* The offset must always be a multiple of 4.  We use
+		   the least significant bit to record whether we have
+		   already generated the necessary reloc.  */
+		if ((off & 1) != 0)
+		  off &= ~1;
+		else
+		  {
+		    bfd_put_32 (output_bfd, relocation, sgot->contents + off);
+
+		    if (info->shared)
+		      {
+			asection *s;
+			Elf_Internal_Rela outrel;
+			bfd_byte *loc;
+
+			s = bfd_get_section_by_name (dynobj, ".rela.got");
+			BFD_ASSERT (s != NULL);
+
+			outrel.r_offset = (sgot->output_section->vma
+					   + sgot->output_offset + off);
+			outrel.r_info =
+			  ELF32_R_INFO (0, R_pcrel24);
+			outrel.r_addend = relocation;
+			loc = s->contents;
+			loc +=
+			  s->reloc_count++ * sizeof (Elf32_External_Rela);
+			bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+		      }
+
+		    local_got_offsets[r_symndx] |= 1;
+		  }
+	      }
+
+	    relocation = sgot->output_offset + off;
+	    rel->r_addend = 0;
+            /* bfin : preg = [preg + 17bitdiv4offset] relocation is div by 4.  */
+            relocation /= 4;
+	  }
+	  goto do_default;
+
+	case R_pcrel24:
+	case R_pcrel24_jump_l:
+	  {
+	    bfd_vma x;
+
+	    relocation += rel->r_addend;
+
+	    /* Perform usual pc-relative correction.  */
+	    relocation -= input_section->output_section->vma + input_section->output_offset;
+	    relocation -= address;
+
+	    /* We are getting reloc_entry->address 2 byte off from
+	       the start of instruction. Assuming absolute postion
+	       of the reloc data. But, following code had been written assuming
+	       reloc address is starting at begining of instruction.
+	       To compensate that I have increased the value of
+	       relocation by 1 (effectively 2) and used the addr -2 instead of addr.  */
+
+	    relocation += 2;
+	    address -= 2;
+
+	    relocation >>= 1;
+
+	    x = bfd_get_16 (input_bfd, contents + address);
+	    x = (x & 0xff00) | ((relocation >> 16) & 0xff);
+	    bfd_put_16 (input_bfd, x, contents + address);
+
+	    x = bfd_get_16 (input_bfd, contents + address + 2);
+	    x = relocation & 0xFFFF;
+	    bfd_put_16 (input_bfd, x, contents + address + 2);
+	    r = bfd_reloc_ok;
+	  }
+	  break;
+
+	default:
+	do_default:
+	  r = _bfd_final_link_relocate (howto, input_bfd, input_section,
+					contents, address,
+					relocation, rel->r_addend);
+
+	  break;
+	}
+
+      /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
+         because such sections are not SEC_ALLOC and thus ld.so will
+         not process them.  */
+      if (unresolved_reloc
 	  && !((input_section->flags & SEC_DEBUGGING) != 0 && h->def_dynamic))
 	{
-	  (*_bfd_error_handler)
-	    (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
-	     input_bfd,
-	     input_section, (long) rel->r_offset, h->root.root.string);
+	  (*_bfd_error_handler)
+	    (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+	     input_bfd,
+	     input_section, (long) rel->r_offset, h->root.root.string);
+	  return FALSE;
+	}
+
+      if (r != bfd_reloc_ok)
+	{
+	  const char *name;
+
+	  if (h != NULL)
+	    name = h->root.root.string;
+	  else
+	    {
+	      name = bfd_elf_string_from_elf_section (input_bfd,
+						      symtab_hdr->sh_link,
+						      sym->st_name);
+	      if (name == NULL)
+		return FALSE;
+	      if (*name == '\0')
+		name = bfd_section_name (input_bfd, sec);
+	    }
+
+	  if (r == bfd_reloc_overflow)
+	    {
+	      if (!(info->callbacks->reloc_overflow
+		    (info, (h ? &h->root : NULL), name, howto->name,
+		     (bfd_vma) 0, input_bfd, input_section, rel->r_offset)))
+		return FALSE;
+	    }
+	  else
+	    {
+	      (*_bfd_error_handler)
+		(_("%B(%A+0x%lx): reloc against `%s': error %d"),
+		 input_bfd, input_section,
+		 (long) rel->r_offset, name, (int) r);
+	      return FALSE;
+	    }
+	}
+    }
+
+  return TRUE;
+}
+
+static asection *
+bfin_gc_mark_hook (asection * sec,
+		   struct bfd_link_info *info ATTRIBUTE_UNUSED,
+		   Elf_Internal_Rela * rel,
+		   struct elf_link_hash_entry *h,
+                   Elf_Internal_Sym * sym)
+{
+  if (h != NULL)
+    {
+      switch (ELF32_R_TYPE (rel->r_info))
+	{
+
+	case R_BFIN_GNU_VTINHERIT:
+	case R_BFIN_GNU_VTENTRY:
+	  break;
+
+	default:
+	  switch (h->root.type)
+	    {
+	    default:
+	      break;
+
+	    case bfd_link_hash_defined:
+	    case bfd_link_hash_defweak:
+	      return h->root.u.def.section;
+
+	    case bfd_link_hash_common:
+	      return h->root.u.c.p->section;
+	    }
+	}
+    }
+  else
+    return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
+
+  return NULL;
+}
+
+
+/* Update the got entry reference counts for the section being removed.  */
+
+static bfd_boolean
+bfinfdpic_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED,
+			 struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			 asection *sec ATTRIBUTE_UNUSED,
+			 const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED)
+{
+  return TRUE;
+}
+
+/* Update the got entry reference counts for the section being removed.  */
+
+static bfd_boolean
+bfin_gc_sweep_hook (bfd * abfd,
+		    struct bfd_link_info *info,
+		    asection * sec,
+                    const Elf_Internal_Rela * relocs)
+{
+  Elf_Internal_Shdr *symtab_hdr;
+  struct elf_link_hash_entry **sym_hashes;
+  bfd_signed_vma *local_got_refcounts;
+  const Elf_Internal_Rela *rel, *relend;
+  bfd *dynobj;
+  asection *sgot;
+  asection *srelgot;
+
+  dynobj = elf_hash_table (info)->dynobj;
+  if (dynobj == NULL)
+    return TRUE;
+
+  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  sym_hashes = elf_sym_hashes (abfd);
+  local_got_refcounts = elf_local_got_refcounts (abfd);
+
+  sgot = bfd_get_section_by_name (dynobj, ".got");
+  srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+
+  relend = relocs + sec->reloc_count;
+  for (rel = relocs; rel < relend; rel++)
+    {
+      unsigned long r_symndx;
+      struct elf_link_hash_entry *h;
+
+      switch (ELF32_R_TYPE (rel->r_info))
+	{
+	case R_got:
+	  r_symndx = ELF32_R_SYM (rel->r_info);
+	  if (r_symndx >= symtab_hdr->sh_info)
+	    {
+	      h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+	      if (h->got.refcount > 0)
+		{
+		  --h->got.refcount;
+		  if (h->got.refcount == 0)
+		    {
+		      /* We don't need the .got entry any more.  */
+		      sgot->size -= 4;
+		      srelgot->size -= sizeof (Elf32_External_Rela);
+		    }
+		}
+	    }
+	  else if (local_got_refcounts != NULL)
+	    {
+	      if (local_got_refcounts[r_symndx] > 0)
+		{
+		  --local_got_refcounts[r_symndx];
+		  if (local_got_refcounts[r_symndx] == 0)
+		    {
+		      /* We don't need the .got entry any more.  */
+		      sgot->size -= 4;
+		      if (info->shared)
+			srelgot->size -= sizeof (Elf32_External_Rela);
+		    }
+		}
+	    }
+	  break;
+	default:
+	  break;
+	}
+    }
+  return TRUE;
+}
+
+/* We need dynamic symbols for every section, since segments can
+   relocate independently.  */
+static bfd_boolean
+_bfinfdpic_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED,
+				    struct bfd_link_info *info
+				    ATTRIBUTE_UNUSED,
+				    asection *p ATTRIBUTE_UNUSED)
+{
+  switch (elf_section_data (p)->this_hdr.sh_type)
+    {
+    case SHT_PROGBITS:
+    case SHT_NOBITS:
+      /* If sh_type is yet undecided, assume it could be
+	 SHT_PROGBITS/SHT_NOBITS.  */
+    case SHT_NULL:
+      return FALSE;
+
+      /* There shouldn't be section relative relocations
+	 against any other section.  */
+    default:
+      return TRUE;
+    }
+}
+
+/* Create  a .got section, as well as its additional info field.  This
+   is almost entirely copied from
+   elflink.c:_bfd_elf_create_got_section().  */
+
+static bfd_boolean
+_bfin_create_got_section (bfd *abfd, struct bfd_link_info *info)
+{
+  flagword flags, pltflags;
+  asection *s;
+  struct elf_link_hash_entry *h;
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  int ptralign;
+  int offset;
+
+  /* This function may be called more than once.  */
+  s = bfd_get_section_by_name (abfd, ".got");
+  if (s != NULL && (s->flags & SEC_LINKER_CREATED) != 0)
+    return TRUE;
+
+  /* Machine specific: although pointers are 32-bits wide, we want the
+     GOT to be aligned to a 64-bit boundary, such that function
+     descriptors in it can be accessed with 64-bit loads and
+     stores.  */
+  ptralign = 3;
+
+  flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+	   | SEC_LINKER_CREATED);
+  pltflags = flags;
+
+  s = bfd_make_section_with_flags (abfd, ".got", flags);
+  if (s == NULL
+      || !bfd_set_section_alignment (abfd, s, ptralign))
+    return FALSE;
+
+  if (bed->want_got_plt)
+    {
+      s = bfd_make_section_with_flags (abfd, ".got.plt", flags);
+      if (s == NULL
+	  || !bfd_set_section_alignment (abfd, s, ptralign))
+	return FALSE;
+    }
+
+  if (bed->want_got_sym)
+    {
+      /* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the .got
+	 (or .got.plt) section.  We don't do this in the linker script
+	 because we don't want to define the symbol if we are not creating
+	 a global offset table.  */
+      h = _bfd_elf_define_linkage_sym (abfd, info, s, "_GLOBAL_OFFSET_TABLE_");
+      elf_hash_table (info)->hgot = h;
+      if (h == NULL)
+	return FALSE;
+
+      /* Machine-specific: we want the symbol for executables as
+	 well.  */
+      if (! bfd_elf_link_record_dynamic_symbol (info, h))
+	return FALSE;
+    }
+
+  /* The first bit of the global offset table is the header.  */
+  s->size += bed->got_header_size;
+
+  /* This is the machine-specific part.  Create and initialize section
+     data for the got.  */
+  if (IS_FDPIC (abfd))
+    {
+      bfinfdpic_got_section (info) = s;
+      bfinfdpic_relocs_info (info) = htab_try_create (1,
+						      bfinfdpic_relocs_info_hash,
+						      bfinfdpic_relocs_info_eq,
+						      (htab_del) NULL);
+      if (! bfinfdpic_relocs_info (info))
+	return FALSE;
+
+      s = bfd_make_section_with_flags (abfd, ".rel.got",
+				       (flags | SEC_READONLY));
+      if (s == NULL
+	  || ! bfd_set_section_alignment (abfd, s, 2))
+	return FALSE;
+
+      bfinfdpic_gotrel_section (info) = s;
+
+      /* Machine-specific.  */
+      s = bfd_make_section_with_flags (abfd, ".rofixup",
+				       (flags | SEC_READONLY));
+      if (s == NULL
+	  || ! bfd_set_section_alignment (abfd, s, 2))
+	return FALSE;
+
+      bfinfdpic_gotfixup_section (info) = s;
+      offset = -2048;
+      flags = BSF_GLOBAL;
+    }
+  else
+    {
+      offset = 2048;
+      flags = BSF_GLOBAL | BSF_WEAK;
+    }
+
+  return TRUE;
+}
+
+/* Make sure the got and plt sections exist, and that our pointers in
+   the link hash table point to them.  */
+
+static bfd_boolean
+elf32_bfinfdpic_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
+{
+  /* This is mostly copied from
+     elflink.c:_bfd_elf_create_dynamic_sections().  */
+  flagword flags, pltflags;
+  asection *s;
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+
+  /* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and
+     .rel[a].bss sections.  */
+
+  flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+	   | SEC_LINKER_CREATED);
+
+  pltflags = flags;
+  pltflags |= SEC_CODE;
+  if (bed->plt_not_loaded)
+    pltflags &= ~ (SEC_CODE | SEC_LOAD | SEC_HAS_CONTENTS);
+  if (bed->plt_readonly)
+    pltflags |= SEC_READONLY;
+
+  s = bfd_make_section (abfd, ".plt");
+  if (s == NULL
+      || ! bfd_set_section_flags (abfd, s, pltflags)
+      || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+    return FALSE;
+  /* Blackfin-specific: remember it.  */
+  bfinfdpic_plt_section (info) = s;
+
+  if (bed->want_plt_sym)
+    {
+      /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
+	 .plt section.  */
+      struct elf_link_hash_entry *h;
+      struct bfd_link_hash_entry *bh = NULL;
+
+      if (! (_bfd_generic_link_add_one_symbol
+	     (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s, 0, NULL,
+	      FALSE, get_elf_backend_data (abfd)->collect, &bh)))
+	return FALSE;
+      h = (struct elf_link_hash_entry *) bh;
+      h->def_regular = 1;
+      h->type = STT_OBJECT;
+
+      if (! info->executable
+	  && ! bfd_elf_link_record_dynamic_symbol (info, h))
+	return FALSE;
+    }
+
+  /* Blackfin-specific: we want rel relocations for the plt.  */
+  s = bfd_make_section (abfd, ".rel.plt");
+  if (s == NULL
+      || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+      || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+    return FALSE;
+  /* Blackfin-specific: remember it.  */
+  bfinfdpic_pltrel_section (info) = s;
+
+  /* Blackfin-specific: we want to create the GOT in the Blackfin way.  */
+  if (! _bfin_create_got_section (abfd, info))
+    return FALSE;
+
+  /* Blackfin-specific: make sure we created everything we wanted.  */
+  BFD_ASSERT (bfinfdpic_got_section (info) && bfinfdpic_gotrel_section (info)
+	      /* && bfinfdpic_gotfixup_section (info) */
+	      && bfinfdpic_plt_section (info)
+	      && bfinfdpic_pltrel_section (info));
+
+  if (bed->want_dynbss)
+    {
+      /* The .dynbss section is a place to put symbols which are defined
+	 by dynamic objects, are referenced by regular objects, and are
+	 not functions.  We must allocate space for them in the process
+	 image and use a R_*_COPY reloc to tell the dynamic linker to
+	 initialize them at run time.  The linker script puts the .dynbss
+	 section into the .bss section of the final image.  */
+      s = bfd_make_section (abfd, ".dynbss");
+      if (s == NULL
+	  || ! bfd_set_section_flags (abfd, s, SEC_ALLOC | SEC_LINKER_CREATED))
+	return FALSE;
+
+      /* The .rel[a].bss section holds copy relocs.  This section is not
+     normally needed.  We need to create it here, though, so that the
+     linker will map it to an output section.  We can't just create it
+     only if we need it, because we will not know whether we need it
+     until we have seen all the input files, and the first time the
+     main linker code calls BFD after examining all the input files
+     (size_dynamic_sections) the input sections have already been
+     mapped to the output sections.  If the section turns out not to
+     be needed, we can discard it later.  We will never need this
+     section when generating a shared object, since they do not use
+     copy relocs.  */
+      if (! info->shared)
+	{
+	  s = bfd_make_section (abfd,
+				(bed->default_use_rela_p
+				 ? ".rela.bss" : ".rel.bss"));
+	  if (s == NULL
+	      || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+	      || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+	    return FALSE;
+	}
+    }
+
+  return TRUE;
+}
+
+/* The name of the dynamic interpreter.  This is put in the .interp
+   section.  */
+
+#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
+
+#define DEFAULT_STACK_SIZE 0x20000
+
+/* This structure is used to collect the number of entries present in
+   each addressable range of the got.  */
+struct _bfinfdpic_dynamic_got_info
+{
+  /* Several bits of information about the current link.  */
+  struct bfd_link_info *info;
+  /* Total size needed for GOT entries within the 18- or 32-bit
+     ranges.  */
+  bfd_vma got17m4, gothilo;
+  /* Total size needed for function descriptor entries within the 18-
+     or 32-bit ranges.  */
+  bfd_vma fd17m4, fdhilo;
+  /* Total size needed function descriptor entries referenced in PLT
+     entries, that would be profitable to place in offsets close to
+     the PIC register.  */
+  bfd_vma fdplt;
+  /* Total size needed by lazy PLT entries.  */
+  bfd_vma lzplt;
+  /* Number of relocations carried over from input object files.  */
+  unsigned long relocs;
+  /* Number of fixups introduced by relocations in input object files.  */
+  unsigned long fixups;
+};
+
+/* Compute the total GOT size required by each symbol in each range.
+   Symbols may require up to 4 words in the GOT: an entry pointing to
+   the symbol, an entry pointing to its function descriptor, and a
+   private function descriptors taking two words.  */
+
+static int
+_bfinfdpic_count_got_plt_entries (void **entryp, void *dinfo_)
+{
+  struct bfinfdpic_relocs_info *entry = *entryp;
+  struct _bfinfdpic_dynamic_got_info *dinfo = dinfo_;
+  unsigned relocs = 0, fixups = 0;
+
+  /* Allocate space for a GOT entry pointing to the symbol.  */
+  if (entry->got17m4)
+    dinfo->got17m4 += 4;
+  else if (entry->gothilo)
+    dinfo->gothilo += 4;
+  else
+    entry->relocs32--;
+  entry->relocs32++;
+
+  /* Allocate space for a GOT entry pointing to the function
+     descriptor.  */
+  if (entry->fdgot17m4)
+    dinfo->got17m4 += 4;
+  else if (entry->fdgothilo)
+    dinfo->gothilo += 4;
+  else
+    entry->relocsfd--;
+  entry->relocsfd++;
+
+  /* Decide whether we need a PLT entry, a function descriptor in the
+     GOT, and a lazy PLT entry for this symbol.  */
+  entry->plt = entry->call
+    && entry->symndx == -1 && ! BFINFDPIC_SYM_LOCAL (dinfo->info, entry->d.h)
+    && elf_hash_table (dinfo->info)->dynamic_sections_created;
+  entry->privfd = entry->plt
+    || entry->fdgoff17m4 || entry->fdgoffhilo
+    || ((entry->fd || entry->fdgot17m4 || entry->fdgothilo)
+	&& (entry->symndx != -1
+	    || BFINFDPIC_FUNCDESC_LOCAL (dinfo->info, entry->d.h)));
+  entry->lazyplt = entry->privfd
+    && entry->symndx == -1 && ! BFINFDPIC_SYM_LOCAL (dinfo->info, entry->d.h)
+    && ! (dinfo->info->flags & DF_BIND_NOW)
+    && elf_hash_table (dinfo->info)->dynamic_sections_created;
+
+  /* Allocate space for a function descriptor.  */
+  if (entry->fdgoff17m4)
+    dinfo->fd17m4 += 8;
+  else if (entry->privfd && entry->plt)
+    dinfo->fdplt += 8;
+  else if (entry->privfd)
+    dinfo->fdhilo += 8;
+  else
+    entry->relocsfdv--;
+  entry->relocsfdv++;
+
+  if (entry->lazyplt)
+    dinfo->lzplt += LZPLT_NORMAL_SIZE;
+
+  if (!dinfo->info->executable || dinfo->info->pie)
+    relocs = entry->relocs32 + entry->relocsfd + entry->relocsfdv;
+  else
+    {
+      if (entry->symndx != -1 || BFINFDPIC_SYM_LOCAL (dinfo->info, entry->d.h))
+	{
+	  if (entry->symndx != -1
+	      || entry->d.h->root.type != bfd_link_hash_undefweak)
+	    fixups += entry->relocs32 + 2 * entry->relocsfdv;
+	}
+      else
+	relocs += entry->relocs32 + entry->relocsfdv;
+
+      if (entry->symndx != -1
+	  || BFINFDPIC_FUNCDESC_LOCAL (dinfo->info, entry->d.h))
+	{
+	  if (entry->symndx != -1
+	      || entry->d.h->root.type != bfd_link_hash_undefweak)
+	    fixups += entry->relocsfd;
+	}
+      else
+	relocs += entry->relocsfd;
+    }
+
+  entry->dynrelocs += relocs;
+  entry->fixups += fixups;
+  dinfo->relocs += relocs;
+  dinfo->fixups += fixups;
+
+  return 1;
+}
+
+/* This structure is used to assign offsets to got entries, function
+   descriptors, plt entries and lazy plt entries.  */
+
+struct _bfinfdpic_dynamic_got_plt_info
+{
+  /* Summary information collected with _bfinfdpic_count_got_plt_entries.  */
+  struct _bfinfdpic_dynamic_got_info g;
+
+  /* For each addressable range, we record a MAX (positive) and MIN
+     (negative) value.  CUR is used to assign got entries, and it's
+     incremented from an initial positive value to MAX, then from MIN
+     to FDCUR (unless FDCUR wraps around first).  FDCUR is used to
+     assign function descriptors, and it's decreased from an initial
+     non-positive value to MIN, then from MAX down to CUR (unless CUR
+     wraps around first).  All of MIN, MAX, CUR and FDCUR always point
+     to even words.  ODD, if non-zero, indicates an odd word to be
+     used for the next got entry, otherwise CUR is used and
+     incremented by a pair of words, wrapping around when it reaches
+     MAX.  FDCUR is decremented (and wrapped) before the next function
+     descriptor is chosen.  FDPLT indicates the number of remaining
+     slots that can be used for function descriptors used only by PLT
+     entries.  */
+  struct _bfinfdpic_dynamic_got_alloc_data
+  {
+    bfd_signed_vma max, cur, odd, fdcur, min;
+    bfd_vma fdplt;
+  } got17m4, gothilo;
+};
+
+/* Determine the positive and negative ranges to be used by each
+   offset range in the GOT.  FDCUR and CUR, that must be aligned to a
+   double-word boundary, are the minimum (negative) and maximum
+   (positive) GOT offsets already used by previous ranges, except for
+   an ODD entry that may have been left behind.  GOT and FD indicate
+   the size of GOT entries and function descriptors that must be
+   placed within the range from -WRAP to WRAP.  If there's room left,
+   up to FDPLT bytes should be reserved for additional function
+   descriptors.  */
+
+inline static bfd_signed_vma
+_bfinfdpic_compute_got_alloc_data (struct _bfinfdpic_dynamic_got_alloc_data *gad,
+				   bfd_signed_vma fdcur,
+				   bfd_signed_vma odd,
+				   bfd_signed_vma cur,
+				   bfd_vma got,
+				   bfd_vma fd,
+				   bfd_vma fdplt,
+				   bfd_vma wrap)
+{
+  bfd_signed_vma wrapmin = -wrap;
+
+  /* Start at the given initial points.  */
+  gad->fdcur = fdcur;
+  gad->cur = cur;
+
+  /* If we had an incoming odd word and we have any got entries that
+     are going to use it, consume it, otherwise leave gad->odd at
+     zero.  We might force gad->odd to zero and return the incoming
+     odd such that it is used by the next range, but then GOT entries
+     might appear to be out of order and we wouldn't be able to
+     shorten the GOT by one word if it turns out to end with an
+     unpaired GOT entry.  */
+  if (odd && got)
+    {
+      gad->odd = odd;
+      got -= 4;
+      odd = 0;
+    }
+  else
+    gad->odd = 0;
+
+  /* If we're left with an unpaired GOT entry, compute its location
+     such that we can return it.  Otherwise, if got doesn't require an
+     odd number of words here, either odd was already zero in the
+     block above, or it was set to zero because got was non-zero, or
+     got was already zero.  In the latter case, we want the value of
+     odd to carry over to the return statement, so we don't want to
+     reset odd unless the condition below is true.  */
+  if (got & 4)
+    {
+      odd = cur + got;
+      got += 4;
+    }
+
+  /* Compute the tentative boundaries of this range.  */
+  gad->max = cur + got;
+  gad->min = fdcur - fd;
+  gad->fdplt = 0;
+
+  /* If function descriptors took too much space, wrap some of them
+     around.  */
+  if (gad->min < wrapmin)
+    {
+      gad->max += wrapmin - gad->min;
+      gad->min = wrapmin;
+    }
+  /* If there is space left and we have function descriptors
+     referenced in PLT entries that could take advantage of shorter
+     offsets, place them here.  */
+  else if (fdplt && gad->min > wrapmin)
+    {
+      bfd_vma fds;
+      if ((bfd_vma) (gad->min - wrapmin) < fdplt)
+	fds = gad->min - wrapmin;
+      else
+	fds = fdplt;
+
+      fdplt -= fds;
+      gad->min -= fds;
+      gad->fdplt += fds;
+    }
+
+  /* If GOT entries took too much space, wrap some of them around.
+     This may well cause gad->min to become lower than wrapmin.  This
+     will cause a relocation overflow later on, so we don't have to
+     report it here . */
+  if ((bfd_vma) gad->max > wrap)
+    {
+      gad->min -= gad->max - wrap;
+      gad->max = wrap;
+    }
+  /* If there is more space left, try to place some more function
+     descriptors for PLT entries.  */
+  else if (fdplt && (bfd_vma) gad->max < wrap)
+    {
+      bfd_vma fds;
+      if ((bfd_vma) (wrap - gad->max) < fdplt)
+	fds = wrap - gad->max;
+      else
+	fds = fdplt;
+
+      fdplt -= fds;
+      gad->max += fds;
+      gad->fdplt += fds;
+    }
+
+  /* If odd was initially computed as an offset past the wrap point,
+     wrap it around.  */
+  if (odd > gad->max)
+    odd = gad->min + odd - gad->max;
+
+  /* _bfinfdpic_get_got_entry() below will always wrap gad->cur if needed
+     before returning, so do it here too.  This guarantees that,
+     should cur and fdcur meet at the wrap point, they'll both be
+     equal to min.  */
+  if (gad->cur == gad->max)
+    gad->cur = gad->min;
+
+  return odd;
+}
+
+/* Compute the location of the next GOT entry, given the allocation
+   data for a range.  */
+
+inline static bfd_signed_vma
+_bfinfdpic_get_got_entry (struct _bfinfdpic_dynamic_got_alloc_data *gad)
+{
+  bfd_signed_vma ret;
+
+  if (gad->odd)
+    {
+      /* If there was an odd word left behind, use it.  */
+      ret = gad->odd;
+      gad->odd = 0;
+    }
+  else
+    {
+      /* Otherwise, use the word pointed to by cur, reserve the next
+	 as an odd word, and skip to the next pair of words, possibly
+	 wrapping around.  */
+      ret = gad->cur;
+      gad->odd = gad->cur + 4;
+      gad->cur += 8;
+      if (gad->cur == gad->max)
+	gad->cur = gad->min;
+    }
+
+  return ret;
+}
+
+/* Compute the location of the next function descriptor entry in the
+   GOT, given the allocation data for a range.  */
+
+inline static bfd_signed_vma
+_bfinfdpic_get_fd_entry (struct _bfinfdpic_dynamic_got_alloc_data *gad)
+{
+  /* If we're at the bottom, wrap around, and only then allocate the
+     next pair of words.  */
+  if (gad->fdcur == gad->min)
+    gad->fdcur = gad->max;
+  return gad->fdcur -= 8;
+}
+
+/* Assign GOT offsets for every GOT entry and function descriptor.
+   Doing everything in a single pass is tricky.  */
+
+static int
+_bfinfdpic_assign_got_entries (void **entryp, void *info_)
+{
+  struct bfinfdpic_relocs_info *entry = *entryp;
+  struct _bfinfdpic_dynamic_got_plt_info *dinfo = info_;
+
+  if (entry->got17m4)
+    entry->got_entry = _bfinfdpic_get_got_entry (&dinfo->got17m4);
+  else if (entry->gothilo)
+    entry->got_entry = _bfinfdpic_get_got_entry (&dinfo->gothilo);
+
+  if (entry->fdgot17m4)
+    entry->fdgot_entry = _bfinfdpic_get_got_entry (&dinfo->got17m4);
+  else if (entry->fdgothilo)
+    entry->fdgot_entry = _bfinfdpic_get_got_entry (&dinfo->gothilo);
+
+  if (entry->fdgoff17m4)
+    entry->fd_entry = _bfinfdpic_get_fd_entry (&dinfo->got17m4);
+  else if (entry->plt && dinfo->got17m4.fdplt)
+    {
+      dinfo->got17m4.fdplt -= 8;
+      entry->fd_entry = _bfinfdpic_get_fd_entry (&dinfo->got17m4);
+    }
+  else if (entry->plt)
+    {
+      dinfo->gothilo.fdplt -= 8;
+      entry->fd_entry = _bfinfdpic_get_fd_entry (&dinfo->gothilo);
+    }
+  else if (entry->privfd)
+    entry->fd_entry = _bfinfdpic_get_fd_entry (&dinfo->gothilo);
+
+  return 1;
+}
+
+/* Assign GOT offsets to private function descriptors used by PLT
+   entries (or referenced by 32-bit offsets), as well as PLT entries
+   and lazy PLT entries.  */
+
+static int
+_bfinfdpic_assign_plt_entries (void **entryp, void *info_)
+{
+  struct bfinfdpic_relocs_info *entry = *entryp;
+  struct _bfinfdpic_dynamic_got_plt_info *dinfo = info_;
+
+  /* If this symbol requires a local function descriptor, allocate
+     one.  */
+  if (entry->privfd && entry->fd_entry == 0)
+    {
+      if (dinfo->got17m4.fdplt)
+	{
+	  entry->fd_entry = _bfinfdpic_get_fd_entry (&dinfo->got17m4);
+	  dinfo->got17m4.fdplt -= 8;
+	}
+      else
+	{
+	  BFD_ASSERT (dinfo->gothilo.fdplt);
+	  entry->fd_entry = _bfinfdpic_get_fd_entry (&dinfo->gothilo);
+	  dinfo->gothilo.fdplt -= 8;
+	}
+    }
+
+  if (entry->plt)
+    {
+      int size;
+
+      /* We use the section's raw size to mark the location of the
+	 next PLT entry.  */
+      entry->plt_entry = bfinfdpic_plt_section (dinfo->g.info)->size;
+
+      /* Figure out the length of this PLT entry based on the
+	 addressing mode we need to reach the function descriptor.  */
+      BFD_ASSERT (entry->fd_entry);
+      if (entry->fd_entry >= -(1 << (18 - 1))
+	  && entry->fd_entry + 4 < (1 << (18 - 1)))
+	size = 10;
+      else
+	size = 16;
+
+      bfinfdpic_plt_section (dinfo->g.info)->size += size;
+    }
+
+  if (entry->lazyplt)
+    {
+      entry->lzplt_entry = dinfo->g.lzplt;
+      dinfo->g.lzplt += LZPLT_NORMAL_SIZE;
+      /* If this entry is the one that gets the resolver stub, account
+	 for the additional instruction.  */
+      if (entry->lzplt_entry % BFINFDPIC_LZPLT_BLOCK_SIZE
+	  == BFINFDPIC_LZPLT_RESOLV_LOC)
+	dinfo->g.lzplt += LZPLT_RESOLVER_EXTRA;
+    }
+
+  return 1;
+}
+
+/* Follow indirect and warning hash entries so that each got entry
+   points to the final symbol definition.  P must point to a pointer
+   to the hash table we're traversing.  Since this traversal may
+   modify the hash table, we set this pointer to NULL to indicate
+   we've made a potentially-destructive change to the hash table, so
+   the traversal must be restarted.  */
+static int
+_bfinfdpic_resolve_final_relocs_info (void **entryp, void *p)
+{
+  struct bfinfdpic_relocs_info *entry = *entryp;
+  htab_t *htab = p;
+
+  if (entry->symndx == -1)
+    {
+      struct elf_link_hash_entry *h = entry->d.h;
+      struct bfinfdpic_relocs_info *oentry;
+
+      while (h->root.type == bfd_link_hash_indirect
+	     || h->root.type == bfd_link_hash_warning)
+	h = (struct elf_link_hash_entry *)h->root.u.i.link;
+
+      if (entry->d.h == h)
+	return 1;
+
+      oentry = bfinfdpic_relocs_info_for_global (*htab, 0, h, entry->addend,
+						NO_INSERT);
+
+      if (oentry)
+	{
+	  /* Merge the two entries.  */
+	  bfinfdpic_pic_merge_early_relocs_info (oentry, entry);
+	  htab_clear_slot (*htab, entryp);
+	  return 1;
+	}
+
+      entry->d.h = h;
+
+      /* If we can't find this entry with the new bfd hash, re-insert
+	 it, and get the traversal restarted.  */
+      if (! htab_find (*htab, entry))
+	{
+	  htab_clear_slot (*htab, entryp);
+	  entryp = htab_find_slot (*htab, entry, INSERT);
+	  if (! *entryp)
+	    *entryp = entry;
+	  /* Abort the traversal, since the whole table may have
+	     moved, and leave it up to the parent to restart the
+	     process.  */
+	  *(htab_t *)p = NULL;
+	  return 0;
+	}
+    }
+
+  return 1;
+}
+
+/* Set the sizes of the dynamic sections.  */
+
+static bfd_boolean
+elf32_bfinfdpic_size_dynamic_sections (bfd *output_bfd,
+				      struct bfd_link_info *info)
+{
+  bfd *dynobj;
+  asection *s;
+  struct _bfinfdpic_dynamic_got_plt_info gpinfo;
+  bfd_signed_vma odd;
+  bfd_vma limit;
+
+  dynobj = elf_hash_table (info)->dynobj;
+  BFD_ASSERT (dynobj != NULL);
+
+  if (elf_hash_table (info)->dynamic_sections_created)
+    {
+      /* Set the contents of the .interp section to the interpreter.  */
+      if (info->executable)
+	{
+	  s = bfd_get_section_by_name (dynobj, ".interp");
+	  BFD_ASSERT (s != NULL);
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER;
+	}
+    }
+
+  memset (&gpinfo, 0, sizeof (gpinfo));
+  gpinfo.g.info = info;
+
+  for (;;)
+    {
+      htab_t relocs = bfinfdpic_relocs_info (info);
+
+      htab_traverse (relocs, _bfinfdpic_resolve_final_relocs_info, &relocs);
+
+      if (relocs == bfinfdpic_relocs_info (info))
+	break;
+    }
+
+  htab_traverse (bfinfdpic_relocs_info (info), _bfinfdpic_count_got_plt_entries,
+		 &gpinfo.g);
+
+  odd = 12;
+  /* Compute the total size taken by entries in the 18-bit range,
+     to tell how many PLT function descriptors we can bring into it
+     without causing it to overflow.  */
+  limit = odd + gpinfo.g.got17m4 + gpinfo.g.fd17m4;
+  if (limit < (bfd_vma)1 << 18)
+    limit = ((bfd_vma)1 << 18) - limit;
+  else
+    limit = 0;
+  if (gpinfo.g.fdplt < limit)
+    limit = gpinfo.g.fdplt;
+
+  /* Determine the ranges of GOT offsets that we can use for each
+     range of addressing modes.  */
+  odd = _bfinfdpic_compute_got_alloc_data (&gpinfo.got17m4,
+					  0,
+					  odd,
+					  16,
+					  gpinfo.g.got17m4,
+					  gpinfo.g.fd17m4,
+					  limit,
+					  (bfd_vma)1 << (18-1));
+  odd = _bfinfdpic_compute_got_alloc_data (&gpinfo.gothilo,
+					  gpinfo.got17m4.min,
+					  odd,
+					  gpinfo.got17m4.max,
+					  gpinfo.g.gothilo,
+					  gpinfo.g.fdhilo,
+					  gpinfo.g.fdplt - gpinfo.got17m4.fdplt,
+					  (bfd_vma)1 << (32-1));
+
+  /* Now assign (most) GOT offsets.  */
+  htab_traverse (bfinfdpic_relocs_info (info), _bfinfdpic_assign_got_entries,
+		 &gpinfo);
+
+  bfinfdpic_got_section (info)->size = gpinfo.gothilo.max
+    - gpinfo.gothilo.min
+    /* If an odd word is the last word of the GOT, we don't need this
+       word to be part of the GOT.  */
+    - (odd + 4 == gpinfo.gothilo.max ? 4 : 0);
+  if (bfinfdpic_got_section (info)->size == 0)
+    bfinfdpic_got_section (info)->flags |= SEC_EXCLUDE;
+  else if (bfinfdpic_got_section (info)->size == 12
+	   && ! elf_hash_table (info)->dynamic_sections_created)
+    {
+      bfinfdpic_got_section (info)->flags |= SEC_EXCLUDE;
+      bfinfdpic_got_section (info)->size = 0;
+    }
+  else
+    {
+      bfinfdpic_got_section (info)->contents =
+	(bfd_byte *) bfd_zalloc (dynobj,
+				 bfinfdpic_got_section (info)->size);
+      if (bfinfdpic_got_section (info)->contents == NULL)
+	return FALSE;
+    }
+
+  if (elf_hash_table (info)->dynamic_sections_created)
+    /* Subtract the number of lzplt entries, since those will generate
+       relocations in the pltrel section.  */
+    bfinfdpic_gotrel_section (info)->size =
+      (gpinfo.g.relocs - gpinfo.g.lzplt / LZPLT_NORMAL_SIZE)
+      * get_elf_backend_data (output_bfd)->s->sizeof_rel;
+  else
+    BFD_ASSERT (gpinfo.g.relocs == 0);
+  if (bfinfdpic_gotrel_section (info)->size == 0)
+    bfinfdpic_gotrel_section (info)->flags |= SEC_EXCLUDE;
+  else
+    {
+      bfinfdpic_gotrel_section (info)->contents =
+	(bfd_byte *) bfd_zalloc (dynobj,
+				 bfinfdpic_gotrel_section (info)->size);
+      if (bfinfdpic_gotrel_section (info)->contents == NULL)
+	return FALSE;
+    }
+
+  bfinfdpic_gotfixup_section (info)->size = (gpinfo.g.fixups + 1) * 4;
+  if (bfinfdpic_gotfixup_section (info)->size == 0)
+    bfinfdpic_gotfixup_section (info)->flags |= SEC_EXCLUDE;
+  else
+    {
+      bfinfdpic_gotfixup_section (info)->contents =
+	(bfd_byte *) bfd_zalloc (dynobj,
+				 bfinfdpic_gotfixup_section (info)->size);
+      if (bfinfdpic_gotfixup_section (info)->contents == NULL)
+	return FALSE;
+    }
+
+  if (elf_hash_table (info)->dynamic_sections_created)
+    {
+      bfinfdpic_pltrel_section (info)->size =
+	gpinfo.g.lzplt / LZPLT_NORMAL_SIZE * get_elf_backend_data (output_bfd)->s->sizeof_rel;
+      if (bfinfdpic_pltrel_section (info)->size == 0)
+	bfinfdpic_pltrel_section (info)->flags |= SEC_EXCLUDE;
+      else
+	{
+	  bfinfdpic_pltrel_section (info)->contents =
+	    (bfd_byte *) bfd_zalloc (dynobj,
+				     bfinfdpic_pltrel_section (info)->size);
+	  if (bfinfdpic_pltrel_section (info)->contents == NULL)
+	    return FALSE;
+	}
+    }
+
+  /* Add 4 bytes for every block of at most 65535 lazy PLT entries,
+     such that there's room for the additional instruction needed to
+     call the resolver.  Since _bfinfdpic_assign_got_entries didn't
+     account for them, our block size is 4 bytes smaller than the real
+     block size.  */
+  if (elf_hash_table (info)->dynamic_sections_created)
+    {
+      bfinfdpic_plt_section (info)->size = gpinfo.g.lzplt
+	+ ((gpinfo.g.lzplt + (BFINFDPIC_LZPLT_BLOCK_SIZE - 4) - LZPLT_NORMAL_SIZE)
+	   / (BFINFDPIC_LZPLT_BLOCK_SIZE - 4) * LZPLT_RESOLVER_EXTRA);
+    }
+
+  /* Reset it, such that _bfinfdpic_assign_plt_entries() can use it to
+     actually assign lazy PLT entries addresses.  */
+  gpinfo.g.lzplt = 0;
+
+  /* Save information that we're going to need to generate GOT and PLT
+     entries.  */
+  bfinfdpic_got_initial_offset (info) = -gpinfo.gothilo.min;
+
+  if (get_elf_backend_data (output_bfd)->want_got_sym)
+    elf_hash_table (info)->hgot->root.u.def.value
+      += bfinfdpic_got_initial_offset (info);
+
+  if (elf_hash_table (info)->dynamic_sections_created)
+    bfinfdpic_plt_initial_offset (info) =
+      bfinfdpic_plt_section (info)->size;
+
+  htab_traverse (bfinfdpic_relocs_info (info), _bfinfdpic_assign_plt_entries,
+		 &gpinfo);
+
+  /* Allocate the PLT section contents only after
+     _bfinfdpic_assign_plt_entries has a chance to add the size of the
+     non-lazy PLT entries.  */
+  if (elf_hash_table (info)->dynamic_sections_created)
+    {
+      if (bfinfdpic_plt_section (info)->size == 0)
+	bfinfdpic_plt_section (info)->flags |= SEC_EXCLUDE;
+      else
+	{
+	  bfinfdpic_plt_section (info)->contents =
+	    (bfd_byte *) bfd_zalloc (dynobj,
+				     bfinfdpic_plt_section (info)->size);
+	  if (bfinfdpic_plt_section (info)->contents == NULL)
+	    return FALSE;
+	}
+    }
+
+  if (elf_hash_table (info)->dynamic_sections_created)
+    {
+      if (bfinfdpic_got_section (info)->size)
+	if (!_bfd_elf_add_dynamic_entry (info, DT_PLTGOT, 0))
+	  return FALSE;
+
+      if (bfinfdpic_pltrel_section (info)->size)
+	if (!_bfd_elf_add_dynamic_entry (info, DT_PLTRELSZ, 0)
+	    || !_bfd_elf_add_dynamic_entry (info, DT_PLTREL, DT_REL)
+	    || !_bfd_elf_add_dynamic_entry (info, DT_JMPREL, 0))
+	  return FALSE;
+
+      if (bfinfdpic_gotrel_section (info)->size)
+	if (!_bfd_elf_add_dynamic_entry (info, DT_REL, 0)
+	    || !_bfd_elf_add_dynamic_entry (info, DT_RELSZ, 0)
+	    || !_bfd_elf_add_dynamic_entry (info, DT_RELENT,
+					    sizeof (Elf32_External_Rel)))
 	  return FALSE;
+    }
+
+  return TRUE;
+}
+
+static bfd_boolean
+elf32_bfinfdpic_always_size_sections (bfd *output_bfd,
+				     struct bfd_link_info *info)
+{
+  if (!info->relocatable)
+    {
+      struct elf_link_hash_entry *h;
+      asection *sec;
+
+      /* Force a PT_GNU_STACK segment to be created.  */
+      if (! elf_tdata (output_bfd)->stack_flags)
+	elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
+
+      /* Define __stacksize if it's not defined yet.  */
+      h = elf_link_hash_lookup (elf_hash_table (info), "__stacksize",
+				FALSE, FALSE, FALSE);
+      if (! h || h->root.type != bfd_link_hash_defined
+	  || h->type != STT_OBJECT
+	  || !h->def_regular)
+	{
+	  struct bfd_link_hash_entry *bh = NULL;
+
+	  if (!(_bfd_generic_link_add_one_symbol
+		(info, output_bfd, "__stacksize",
+		 BSF_GLOBAL, bfd_abs_section_ptr, DEFAULT_STACK_SIZE,
+		 (const char *) NULL, FALSE,
+		 get_elf_backend_data (output_bfd)->collect, &bh)))
+	    return FALSE;
+
+	  h = (struct elf_link_hash_entry *) bh;
+	  h->def_regular = 1;
+	  h->type = STT_OBJECT;
 	}
 
-      if (r != bfd_reloc_ok)
+      /* Create a stack section, and set its alignment.  */
+      sec = bfd_make_section (output_bfd, ".stack");
+
+      if (sec == NULL
+	  || ! bfd_set_section_alignment (output_bfd, sec, 3))
+	return FALSE;
+    }
+
+  return TRUE;
+}
+
+static bfd_boolean
+elf32_bfinfdpic_modify_segment_map (bfd *output_bfd,
+				   struct bfd_link_info *info)
+{
+  struct elf_segment_map *m;
+
+  /* objcopy and strip preserve what's already there using
+     elf32_bfinfdpic_copy_private_bfd_data ().  */
+  if (! info)
+    return TRUE;
+
+  for (m = elf_tdata (output_bfd)->segment_map; m != NULL; m = m->next)
+    if (m->p_type == PT_GNU_STACK)
+      break;
+
+  if (m)
+    {
+      asection *sec = bfd_get_section_by_name (output_bfd, ".stack");
+      struct elf_link_hash_entry *h;
+
+      if (sec)
 	{
-	  const char *name;
+	  /* Obtain the pointer to the __stacksize symbol.  */
+	  h = elf_link_hash_lookup (elf_hash_table (info), "__stacksize",
+				    FALSE, FALSE, FALSE);
+	  while (h->root.type == bfd_link_hash_indirect
+		 || h->root.type == bfd_link_hash_warning)
+	    h = (struct elf_link_hash_entry *)h->root.u.i.link;
+	  BFD_ASSERT (h->root.type == bfd_link_hash_defined);
 
-	  if (h != NULL)
-	    name = h->root.root.string;
+	  /* Set the section size from the symbol value.  We
+	     intentionally ignore the symbol section.  */
+	  if (h->root.type == bfd_link_hash_defined)
+	    sec->size = h->root.u.def.value;
 	  else
-	    {
-	      name = bfd_elf_string_from_elf_section (input_bfd,
-						      symtab_hdr->sh_link,
-						      sym->st_name);
-	      if (name == NULL)
-		return FALSE;
-	      if (*name == '\0')
-		name = bfd_section_name (input_bfd, sec);
-	    }
+	    sec->size = DEFAULT_STACK_SIZE;
 
-	  if (r == bfd_reloc_overflow)
-	    {
-	      if (!(info->callbacks->reloc_overflow
-		    (info, (h ? &h->root : NULL), name, howto->name,
-		     (bfd_vma) 0, input_bfd, input_section, rel->r_offset)))
-		return FALSE;
-	    }
-	  else
+	  /* Add the stack section to the PT_GNU_STACK segment,
+	     such that its size and alignment requirements make it
+	     to the segment.  */
+	  m->sections[m->count] = sec;
+	  m->count++;
+	}
+    }
+
+  return TRUE;
+}
+
+static bfd_boolean
+elf32_bfinfdpic_finish_dynamic_sections (bfd *output_bfd,
+					struct bfd_link_info *info)
+{
+  bfd *dynobj;
+  asection *sdyn;
+
+  dynobj = elf_hash_table (info)->dynobj;
+
+  if (bfinfdpic_got_section (info))
+    {
+      BFD_ASSERT (bfinfdpic_gotrel_section (info)->size
+		  == (bfinfdpic_gotrel_section (info)->reloc_count
+		      * sizeof (Elf32_External_Rel)));
+
+      if (bfinfdpic_gotfixup_section (info))
+	{
+	  struct elf_link_hash_entry *hgot = elf_hash_table (info)->hgot;
+	  bfd_vma got_value = hgot->root.u.def.value
+	    + hgot->root.u.def.section->output_section->vma
+	    + hgot->root.u.def.section->output_offset;
+
+	  _bfinfdpic_add_rofixup (output_bfd, bfinfdpic_gotfixup_section (info),
+				 got_value, 0);
+
+	  if (bfinfdpic_gotfixup_section (info)->size
+	      != (bfinfdpic_gotfixup_section (info)->reloc_count * 4))
 	    {
 	      (*_bfd_error_handler)
-		(_("%B(%A+0x%lx): reloc against `%s': error %d"),
-		 input_bfd, input_section,
-		 (long) rel->r_offset, name, (int) r);
+		("LINKER BUG: .rofixup section size mismatch");
 	      return FALSE;
 	    }
 	}
     }
+  if (elf_hash_table (info)->dynamic_sections_created)
+    {
+      BFD_ASSERT (bfinfdpic_pltrel_section (info)->size
+		  == (bfinfdpic_pltrel_section (info)->reloc_count
+		      * sizeof (Elf32_External_Rel)));
+    }
+
+  sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+
+  if (elf_hash_table (info)->dynamic_sections_created)
+    {
+      Elf32_External_Dyn * dyncon;
+      Elf32_External_Dyn * dynconend;
+
+      BFD_ASSERT (sdyn != NULL);
+
+      dyncon = (Elf32_External_Dyn *) sdyn->contents;
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
+
+      for (; dyncon < dynconend; dyncon++)
+	{
+	  Elf_Internal_Dyn dyn;
+
+	  bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+
+	  switch (dyn.d_tag)
+	    {
+	    default:
+	      break;
+
+	    case DT_PLTGOT:
+	      dyn.d_un.d_ptr = bfinfdpic_got_section (info)->output_section->vma
+		+ bfinfdpic_got_section (info)->output_offset
+		+ bfinfdpic_got_initial_offset (info);
+	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+	      break;
+
+	    case DT_JMPREL:
+	      dyn.d_un.d_ptr = bfinfdpic_pltrel_section (info)
+		->output_section->vma
+		+ bfinfdpic_pltrel_section (info)->output_offset;
+	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+	      break;
+
+	    case DT_PLTRELSZ:
+	      dyn.d_un.d_val = bfinfdpic_pltrel_section (info)->size;
+	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+	      break;
+	    }
+	}
+    }
+
+  return TRUE;
+}
+
+/* Adjust a symbol defined by a dynamic object and referenced by a
+   regular object.  */
+
+static bfd_boolean
+elf32_bfinfdpic_adjust_dynamic_symbol
+(struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ struct elf_link_hash_entry *h ATTRIBUTE_UNUSED)
+{
+  bfd * dynobj;
+
+  dynobj = elf_hash_table (info)->dynobj;
+
+  /* Make sure we know what is going on here.  */
+  BFD_ASSERT (dynobj != NULL
+	      && (h->u.weakdef != NULL
+		  || (h->def_dynamic
+		      && h->ref_regular
+		      && !h->def_regular)));
+
+  /* If this is a weak symbol, and there is a real definition, the
+     processor independent code will have arranged for us to see the
+     real definition first, and we can just use the same value.  */
+  if (h->u.weakdef != NULL)
+    {
+      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
+		  || h->u.weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->u.weakdef->root.u.def.section;
+      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+    }
 
   return TRUE;
 }
 
-static asection *
-bfin_gc_mark_hook (asection * sec,
-		   struct bfd_link_info *info ATTRIBUTE_UNUSED,
-		   Elf_Internal_Rela * rel,
-		   struct elf_link_hash_entry *h,
-                   Elf_Internal_Sym * sym)
+/* Perform any actions needed for dynamic symbols.  */
+
+static bfd_boolean
+elf32_bfinfdpic_finish_dynamic_symbol
+(bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ struct elf_link_hash_entry *h ATTRIBUTE_UNUSED,
+ Elf_Internal_Sym *sym ATTRIBUTE_UNUSED)
 {
-  if (h != NULL)
-    {
-      switch (ELF32_R_TYPE (rel->r_info))
-	{
+  return TRUE;
+}
 
-	case R_BFIN_GNU_VTINHERIT:
-	case R_BFIN_GNU_VTENTRY:
-	  break;
+/* Decide whether to attempt to turn absptr or lsda encodings in
+   shared libraries into pcrel within the given input section.  */
 
-	default:
-	  switch (h->root.type)
-	    {
-	    default:
-	      break;
+static bfd_boolean
+bfinfdpic_elf_use_relative_eh_frame
+(bfd *input_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ asection *eh_frame_section ATTRIBUTE_UNUSED)
+{
+  /* We can't use PC-relative encodings in FDPIC binaries, in general.  */
+  return FALSE;
+}
 
-	    case bfd_link_hash_defined:
-	    case bfd_link_hash_defweak:
-	      return h->root.u.def.section;
+/* Adjust the contents of an eh_frame_hdr section before they're output.  */
 
-	    case bfd_link_hash_common:
-	      return h->root.u.c.p->section;
-	    }
-	}
-    }
-  else
-    return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
+static bfd_byte
+bfinfdpic_elf_encode_eh_address (bfd *abfd,
+				struct bfd_link_info *info,
+				asection *osec, bfd_vma offset,
+				asection *loc_sec, bfd_vma loc_offset,
+				bfd_vma *encoded)
+{
+  struct elf_link_hash_entry *h;
 
-  return NULL;
+  h = elf_hash_table (info)->hgot;
+  BFD_ASSERT (h && h->root.type == bfd_link_hash_defined);
+
+  if (! h || (_bfinfdpic_osec_to_segment (abfd, osec)
+	      == _bfinfdpic_osec_to_segment (abfd, loc_sec->output_section)))
+    return _bfd_elf_encode_eh_address (abfd, info, osec, offset,
+				       loc_sec, loc_offset, encoded);
+
+  BFD_ASSERT (_bfinfdpic_osec_to_segment (abfd, osec)
+	      == (_bfinfdpic_osec_to_segment
+		  (abfd, h->root.u.def.section->output_section)));
+
+  *encoded = osec->vma + offset
+    - (h->root.u.def.value
+       + h->root.u.def.section->output_section->vma
+       + h->root.u.def.section->output_offset);
+
+  return DW_EH_PE_datarel | DW_EH_PE_sdata4;
 }
 
 
-/* Update the got entry reference counts for the section being removed.  */
+
+/* Look through the relocs for a section during the first phase.
+
+   Besides handling virtual table relocs for gc, we have to deal with
+   all sorts of PIC-related relocations.  We describe below the
+   general plan on how to handle such relocations, even though we only
+   collect information at this point, storing them in hash tables for
+   perusal of later passes.
+
+   32 relocations are propagated to the linker output when creating
+   position-independent output.  LO16 and HI16 relocations are not
+   supposed to be encountered in this case.
+
+   LABEL16 should always be resolvable by the linker, since it's only
+   used by branches.
+
+   LABEL24, on the other hand, is used by calls.  If it turns out that
+   the target of a call is a dynamic symbol, a PLT entry must be
+   created for it, which triggers the creation of a private function
+   descriptor and, unless lazy binding is disabled, a lazy PLT entry.
+
+   GPREL relocations require the referenced symbol to be in the same
+   segment as _gp, but this can only be checked later.
+
+   All GOT, GOTOFF and FUNCDESC relocations require a .got section to
+   exist.  LABEL24 might as well, since it may require a PLT entry,
+   that will require a got.
+
+   Non-FUNCDESC GOT relocations require a GOT entry to be created
+   regardless of whether the symbol is dynamic.  However, since a
+   global symbol that turns out to not be exported may have the same
+   address of a non-dynamic symbol, we don't assign GOT entries at
+   this point, such that we can share them in this case.  A relocation
+   for the GOT entry always has to be created, be it to offset a
+   private symbol by the section load address, be it to get the symbol
+   resolved dynamically.
+
+   FUNCDESC GOT relocations require a GOT entry to be created, and
+   handled as if a FUNCDESC relocation was applied to the GOT entry in
+   an object file.
+
+   FUNCDESC relocations referencing a symbol that turns out to NOT be
+   dynamic cause a private function descriptor to be created.  The
+   FUNCDESC relocation then decays to a 32 relocation that points at
+   the private descriptor.  If the symbol is dynamic, the FUNCDESC
+   relocation is propagated to the linker output, such that the
+   dynamic linker creates the canonical descriptor, pointing to the
+   dynamically-resolved definition of the function.
+
+   Non-FUNCDESC GOTOFF relocations must always refer to non-dynamic
+   symbols that are assigned to the same segment as the GOT, but we
+   can only check this later, after we know the complete set of
+   symbols defined and/or exported.
+
+   FUNCDESC GOTOFF relocations require a function descriptor to be
+   created and, unless lazy binding is disabled or the symbol is not
+   dynamic, a lazy PLT entry.  Since we can't tell at this point
+   whether a symbol is going to be dynamic, we have to decide later
+   whether to create a lazy PLT entry or bind the descriptor directly
+   to the private function.
+
+   FUNCDESC_VALUE relocations are not supposed to be present in object
+   files, but they may very well be simply propagated to the linker
+   output, since they have no side effect.
+
+
+   A function descriptor always requires a FUNCDESC_VALUE relocation.
+   Whether it's in .plt.rel or not depends on whether lazy binding is
+   enabled and on whether the referenced symbol is dynamic.
+
+   The existence of a lazy PLT requires the resolverStub lazy PLT
+   entry to be present.
+
+
+   As for assignment of GOT, PLT and lazy PLT entries, and private
+   descriptors, we might do them all sequentially, but we can do
+   better than that.  For example, we can place GOT entries and
+   private function descriptors referenced using 12-bit operands
+   closer to the PIC register value, such that these relocations don't
+   overflow.  Those that are only referenced with LO16 relocations
+   could come next, but we may as well place PLT-required function
+   descriptors in the 12-bit range to make them shorter.  Symbols
+   referenced with LO16/HI16 may come next, but we may place
+   additional function descriptors in the 16-bit range if we can
+   reliably tell that we've already placed entries that are ever
+   referenced with only LO16.  PLT entries are therefore generated as
+   small as possible, while not introducing relocation overflows in
+   GOT or FUNCDESC_GOTOFF relocations.  Lazy PLT entries could be
+   generated before or after PLT entries, but not intermingled with
+   them, such that we can have more lazy PLT entries in range for a
+   branch to the resolverStub.  The resolverStub should be emitted at
+   the most distant location from the first lazy PLT entry such that
+   it's still in range for a branch, or closer, if there isn't a need
+   for so many lazy PLT entries.  Additional lazy PLT entries may be
+   emitted after the resolverStub, as long as branches are still in
+   range.  If the branch goes out of range, longer lazy PLT entries
+   are emitted.
+
+   We could further optimize PLT and lazy PLT entries by giving them
+   priority in assignment to closer-to-gr17 locations depending on the
+   number of occurrences of references to them (assuming a function
+   that's called more often is more important for performance, so its
+   PLT entry should be faster), or taking hints from the compiler.
+   Given infinite time and money... :-)  */
 
 static bfd_boolean
-bfin_gc_sweep_hook (bfd * abfd,
-		    struct bfd_link_info *info,
-		    asection * sec,
-                    const Elf_Internal_Rela * relocs)
+bfinfdpic_check_relocs (bfd *abfd, struct bfd_link_info *info,
+			asection *sec, const Elf_Internal_Rela *relocs)
 {
   Elf_Internal_Shdr *symtab_hdr;
-  struct elf_link_hash_entry **sym_hashes;
-  bfd_signed_vma *local_got_refcounts;
-  const Elf_Internal_Rela *rel, *relend;
+  struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
+  const Elf_Internal_Rela *rel;
+  const Elf_Internal_Rela *rel_end;
   bfd *dynobj;
-  asection *sgot;
-  asection *srelgot;
+  struct bfinfdpic_relocs_info *picrel;
 
-  dynobj = elf_hash_table (info)->dynobj;
-  if (dynobj == NULL)
+  if (info->relocatable)
     return TRUE;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
-  local_got_refcounts = elf_local_got_refcounts (abfd);
-
-  sgot = bfd_get_section_by_name (dynobj, ".got");
-  srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+  sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym);
+  if (!elf_bad_symtab (abfd))
+    sym_hashes_end -= symtab_hdr->sh_info;
 
-  relend = relocs + sec->reloc_count;
-  for (rel = relocs; rel < relend; rel++)
+  dynobj = elf_hash_table (info)->dynobj;
+  rel_end = relocs + sec->reloc_count;
+  for (rel = relocs; rel < rel_end; rel++)
     {
-      unsigned long r_symndx;
       struct elf_link_hash_entry *h;
+      unsigned long r_symndx;
+
+      r_symndx = ELF32_R_SYM (rel->r_info);
+      if (r_symndx < symtab_hdr->sh_info)
+        h = NULL;
+      else
+        h = sym_hashes[r_symndx - symtab_hdr->sh_info];
 
       switch (ELF32_R_TYPE (rel->r_info))
 	{
-	case R_got:
-	  r_symndx = ELF32_R_SYM (rel->r_info);
-	  if (r_symndx >= symtab_hdr->sh_info)
+	case R_BFIN_GOT17M4:
+	case R_BFIN_GOTHI:
+	case R_BFIN_GOTLO:
+	case R_BFIN_FUNCDESC_GOT17M4:
+	case R_BFIN_FUNCDESC_GOTHI:
+	case R_BFIN_FUNCDESC_GOTLO:
+	case R_BFIN_GOTOFF17M4:
+	case R_BFIN_GOTOFFHI:
+	case R_BFIN_GOTOFFLO:
+	case R_BFIN_FUNCDESC_GOTOFF17M4:
+	case R_BFIN_FUNCDESC_GOTOFFHI:
+	case R_BFIN_FUNCDESC_GOTOFFLO:
+	case R_BFIN_FUNCDESC:
+	case R_BFIN_FUNCDESC_VALUE:
+	  if (! IS_FDPIC (abfd))
+	    goto bad_reloc;
+	  /* Fall through.  */
+	case R_pcrel24:
+	case R_pcrel24_jump_l:
+	case R_byte4_data:
+	  if (IS_FDPIC (abfd) && ! dynobj)
 	    {
-	      h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-	      if (h->got.refcount > 0)
-		{
-		  --h->got.refcount;
-		  if (h->got.refcount == 0)
-		    {
-		      /* We don't need the .got entry any more.  */
-		      sgot->size -= 4;
-		      srelgot->size -= sizeof (Elf32_External_Rela);
-		    }
-		}
+	      elf_hash_table (info)->dynobj = dynobj = abfd;
+	      if (! _bfin_create_got_section (abfd, info))
+		return FALSE;
 	    }
-	  else if (local_got_refcounts != NULL)
+	  if (! IS_FDPIC (abfd))
 	    {
-	      if (local_got_refcounts[r_symndx] > 0)
-		{
-		  --local_got_refcounts[r_symndx];
-		  if (local_got_refcounts[r_symndx] == 0)
-		    {
-		      /* We don't need the .got entry any more.  */
-		      sgot->size -= 4;
-		      if (info->shared)
-			srelgot->size -= sizeof (Elf32_External_Rela);
-		    }
-		}
+	      picrel = NULL;
+	      break;
+	    }
+	  if (h != NULL)
+	    {
+	      if (h->dynindx == -1)
+		switch (ELF_ST_VISIBILITY (h->other))
+		  {
+		  case STV_INTERNAL:
+		  case STV_HIDDEN:
+		    break;
+		  default:
+		    bfd_elf_link_record_dynamic_symbol (info, h);
+		    break;
+		  }
+	      picrel
+		= bfinfdpic_relocs_info_for_global (bfinfdpic_relocs_info (info),
+						   abfd, h,
+						   rel->r_addend, INSERT);
 	    }
+	  else
+	    picrel = bfinfdpic_relocs_info_for_local (bfinfdpic_relocs_info
+						     (info), abfd, r_symndx,
+						     rel->r_addend, INSERT);
+	  if (! picrel)
+	    return FALSE;
 	  break;
+
 	default:
+	  picrel = NULL;
 	  break;
 	}
+
+      switch (ELF32_R_TYPE (rel->r_info))
+        {
+	case R_pcrel24:
+	case R_pcrel24_jump_l:
+	  if (IS_FDPIC (abfd))
+	    picrel->call = 1;
+	  break;
+
+	case R_BFIN_FUNCDESC_VALUE:
+	  picrel->relocsfdv++;
+	  if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+	    picrel->relocs32--;
+	  /* Fall through.  */
+
+	case R_byte4_data:
+	  if (! IS_FDPIC (abfd))
+	    break;
+
+	  picrel->sym = 1;
+	  if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+	    picrel->relocs32++;
+	  break;
+
+	case R_BFIN_GOT17M4:
+	  picrel->got17m4 = 1;
+	  break;
+
+	case R_BFIN_GOTHI:
+	case R_BFIN_GOTLO:
+	  picrel->gothilo = 1;
+	  break;
+
+	case R_BFIN_FUNCDESC_GOT17M4:
+	  picrel->fdgot17m4 = 1;
+	  break;
+
+	case R_BFIN_FUNCDESC_GOTHI:
+	case R_BFIN_FUNCDESC_GOTLO:
+	  picrel->fdgothilo = 1;
+	  break;
+
+	case R_BFIN_GOTOFF17M4:
+	case R_BFIN_GOTOFFHI:
+	case R_BFIN_GOTOFFLO:
+	  picrel->gotoff = 1;
+	  break;
+
+	case R_BFIN_FUNCDESC_GOTOFF17M4:
+	  picrel->fdgoff17m4 = 1;
+	  break;
+
+	case R_BFIN_FUNCDESC_GOTOFFHI:
+	case R_BFIN_FUNCDESC_GOTOFFLO:
+	  picrel->fdgoffhilo = 1;
+	  break;
+
+	case R_BFIN_FUNCDESC:
+	  picrel->fd = 1;
+	  picrel->relocsfd++;
+	  break;
+
+        /* This relocation describes the C++ object vtable hierarchy.
+           Reconstruct it for later use during GC.  */
+        case R_BFIN_GNU_VTINHERIT:
+          if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+            return FALSE;
+          break;
+
+        /* This relocation describes which C++ vtable entries are actually
+           used.  Record for later use during GC.  */
+        case R_BFIN_GNU_VTENTRY:
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+            return FALSE;
+          break;
+
+	case R_huimm16:
+	case R_luimm16:
+	case R_pcrel12_jump_s:
+	case R_pcrel10:
+	  break;
+
+	default:
+	bad_reloc:
+	  (*_bfd_error_handler)
+	    (_("%B: unsupported relocation type %i"),
+	     abfd, ELF32_R_TYPE (rel->r_info));
+	  return FALSE;
+        }
     }
 
   return TRUE;
 }
 
+/* Set the right machine number for a Blackfin ELF file.  */
+
+static bfd_boolean
+elf32_bfin_object_p (bfd *abfd)
+{
+  bfd_default_set_arch_mach (abfd, bfd_arch_bfin, 0);
+  return (((elf_elfheader (abfd)->e_flags & EF_BFIN_FDPIC) != 0)
+	  == (IS_FDPIC (abfd)));
+}
 
-/* Merge backend specific data from an object file to the output
-   object file when linking.  */
 static bfd_boolean
-elf32_bfin_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
+elf32_bfin_set_private_flags (bfd * abfd, flagword flags)
 {
-  flagword out_flags;
-  flagword in_flags;
+  elf_elfheader (abfd)->e_flags = flags;
+  elf_flags_init (abfd) = TRUE;
+  return TRUE;
+}
+
+/* Copy backend specific data from one object module to another.  */
 
+static bfd_boolean
+bfin_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
+{
   if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
       || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
     return TRUE;
 
-  in_flags = elf_elfheader (ibfd)->e_flags;
-  out_flags = elf_elfheader (obfd)->e_flags;
-
-  if (!elf_flags_init (obfd))
-    {
-      elf_flags_init (obfd) = TRUE;
-      elf_elfheader (obfd)->e_flags = in_flags;
-    }
+  BFD_ASSERT (!elf_flags_init (obfd)
+	      || elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags);
 
+  elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
+  elf_flags_init (obfd) = TRUE;
   return TRUE;
 }
 
-
 static bfd_boolean
-elf32_bfin_set_private_flags (bfd * abfd, flagword flags)
+elf32_bfinfdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
 {
-  elf_elfheader (abfd)->e_flags = flags;
-  elf_flags_init (abfd) = TRUE;
+  unsigned i;
+
+  if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+    return TRUE;
+
+  if (! bfin_elf_copy_private_bfd_data (ibfd, obfd))
+    return FALSE;
+
+  if (! elf_tdata (ibfd) || ! elf_tdata (ibfd)->phdr
+      || ! elf_tdata (obfd) || ! elf_tdata (obfd)->phdr)
+    return TRUE;
+
+  /* Copy the stack size.  */
+  for (i = 0; i < elf_elfheader (ibfd)->e_phnum; i++)
+    if (elf_tdata (ibfd)->phdr[i].p_type == PT_GNU_STACK)
+      {
+	Elf_Internal_Phdr *iphdr = &elf_tdata (ibfd)->phdr[i];
+
+	for (i = 0; i < elf_elfheader (obfd)->e_phnum; i++)
+	  if (elf_tdata (obfd)->phdr[i].p_type == PT_GNU_STACK)
+	    {
+	      memcpy (&elf_tdata (obfd)->phdr[i], iphdr, sizeof (*iphdr));
+
+	      /* Rewrite the phdrs, since we're only called after they
+		 were first written.  */
+	      if (bfd_seek (obfd, (bfd_signed_vma) get_elf_backend_data (obfd)
+			    ->s->sizeof_ehdr, SEEK_SET) != 0
+		  || get_elf_backend_data (obfd)->s
+		  ->write_out_phdrs (obfd, elf_tdata (obfd)->phdr,
+				     elf_elfheader (obfd)->e_phnum) != 0)
+		return FALSE;
+	      break;
+	    }
+
+	break;
+      }
+
   return TRUE;
 }
 
@@ -2151,23 +4795,103 @@ static bfd_boolean
 elf32_bfin_print_private_bfd_data (bfd * abfd, PTR ptr)
 {
   FILE *file = (FILE *) ptr;
+  flagword flags;
 
   BFD_ASSERT (abfd != NULL && ptr != NULL);
 
   /* Print normal ELF private data.  */
   _bfd_elf_print_private_bfd_data (abfd, ptr);
 
-  /* Ignore init flag - it may not be set, despite the flags field
-     containing valid data.  */
+  flags = elf_elfheader (abfd)->e_flags;
 
   /* xgettext:c-format */
   fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
 
+  if (flags & EF_BFIN_PIC)
+    fprintf (file, " -fpic");
+
+  if (flags & EF_BFIN_FDPIC)
+    fprintf (file, " -mfdpic");
+
   fputc ('\n', file);
 
   return TRUE;
 }
 
+/* Merge backend specific data from an object file to the output
+   object file when linking.  */
+
+static bfd_boolean
+elf32_bfin_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
+{
+  flagword old_flags, old_partial;
+  flagword new_flags, new_partial;
+  bfd_boolean error = FALSE;
+
+  new_flags = elf_elfheader (ibfd)->e_flags;
+  old_flags = elf_elfheader (obfd)->e_flags;
+
+  if (new_flags & EF_BFIN_FDPIC)
+    new_flags &= ~EF_BFIN_PIC;
+
+#ifdef DEBUG
+  (*_bfd_error_handler) ("old_flags = 0x%.8lx, new_flags = 0x%.8lx, init = %s, filename = %s",
+			 old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no",
+			 bfd_get_filename (ibfd));
+#endif
+
+  if (!elf_flags_init (obfd))			/* First call, no flags set.  */
+    {
+      elf_flags_init (obfd) = TRUE;
+      old_flags = new_flags;
+    }
+
+  else if (new_flags == old_flags)		/* Compatible flags are ok.  */
+    ;
+
+  else						/* Possibly incompatible flags.  */
+    {
+      /* We don't have to do anything if the pic flags are the same, or the new
+         module(s) were compiled with -mlibrary-pic.  */
+      new_partial = (new_flags & EF_BFIN_PIC_FLAGS);
+      old_partial = (old_flags & EF_BFIN_PIC_FLAGS);
+      if (new_partial == old_partial)
+	;
+
+      /* If we have mixtures of -fpic and -fPIC, or in both bits.  */
+      else if (new_partial != 0 && old_partial != 0)
+	old_flags |= new_partial;
+
+      /* One module was compiled for pic and the other was not, see if we have
+         had any relocations that are not pic-safe.  */
+      else
+	old_flags |= new_partial;
+
+    }
+
+  /* Update the old flags now with changes made above.  */
+  elf_elfheader (obfd)->e_flags = old_flags;
+
+  if (((new_flags & EF_BFIN_FDPIC) == 0)
+      != (! IS_FDPIC (ibfd)))
+    {
+      error = TRUE;
+      if (IS_FDPIC (obfd))
+	(*_bfd_error_handler)
+	  (_("%s: cannot link non-fdpic object file into fdpic executable"),
+	   bfd_get_filename (ibfd));
+      else
+	(*_bfd_error_handler)
+	  (_("%s: cannot link fdpic object file into non-fdpic executable"),
+	   bfd_get_filename (ibfd));
+    }
+
+  if (error)
+    bfd_set_error (bfd_error_bad_value);
+
+  return !error;
+}
+
 /* bfin ELF linker hash entry.  */
 
 struct bfin_link_hash_entry
@@ -2192,7 +4916,7 @@ struct bfin_link_hash_table
 
 static struct bfd_hash_entry *
 bfin_link_hash_newfunc (struct bfd_hash_entry *entry,
-			    struct bfd_hash_table *table, const char *string)
+			struct bfd_hash_table *table, const char *string)
 {
   struct bfd_hash_entry *ret = entry;
 
@@ -2219,13 +4943,13 @@ bfin_link_hash_table_create (bfd * abfd)
   struct bfin_link_hash_table *ret;
   bfd_size_type amt = sizeof (struct bfin_link_hash_table);
 
-  ret = (struct bfin_link_hash_table *) bfd_malloc (amt);
-  if (ret == (struct bfin_link_hash_table *) NULL)
+  ret = bfd_zalloc (abfd, amt);
+  if (ret == NULL)
     return NULL;
 
   if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
 				      bfin_link_hash_newfunc,
-				      sizeof (struct bfin_link_hash_entry)))
+				      sizeof (struct elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
@@ -2512,9 +5236,6 @@ bfin_discard_copies (struct elf_link_hash_entry *h, PTR inf)
   return TRUE;
 }
 
-/* Set the sizes of the dynamic sections.  */
-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1"
-
 static bfd_boolean
 bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
 				struct bfd_link_info *info)
@@ -2660,7 +5381,7 @@ bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
 
   return TRUE;
 }
-
+
 /* Given a .data section and a .emreloc in-memory section, store
    relocation information into the .emreloc section which can be
    used at runtime to relocate the section.  This is called by the
@@ -2668,6 +5389,9 @@ bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
    after the add_symbols entry point has been called for all the
    objects, and before the final_link entry point is called.  */
 
+bfd_boolean bfd_bfin_elf32_create_embedded_relocs
+  PARAMS ((bfd *, struct bfd_link_info *, asection *, asection *, char **));
+
 bfd_boolean
 bfd_bfin_elf32_create_embedded_relocs (
      bfd *abfd,
@@ -2783,17 +5507,18 @@ error_return:
     free (internal_relocs);
   return FALSE;
 }
-
+
 #define TARGET_LITTLE_SYM		bfd_elf32_bfin_vec
 #define TARGET_LITTLE_NAME		"elf32-bfin"
 #define ELF_ARCH			bfd_arch_bfin
-#define ELF_MACHINE_CODE		EM_BLACKFIN	
+#define ELF_MACHINE_CODE		EM_BLACKFIN
 #define ELF_MAXPAGESIZE			0x1000
 #define elf_symbol_leading_char		'_'
 
 #define bfd_elf32_bfd_reloc_type_lookup	bfin_bfd_reloc_type_lookup
 #define elf_info_to_howto		bfin_info_to_howto
 #define elf_info_to_howto_rel		0
+#define elf_backend_object_p		elf32_bfin_object_p
 
 #define bfd_elf32_bfd_is_local_label_name \
                                         bfin_is_local_label_name
@@ -2808,7 +5533,7 @@ error_return:
                                         bfin_link_hash_table_create
 #define bfd_elf32_bfd_final_link        bfd_elf_gc_common_final_link
 
-#define elf_backend_check_relocs   bfin_check_relocs
+#define elf_backend_check_relocs        bfin_check_relocs
 #define elf_backend_adjust_dynamic_symbol \
                                         bfin_adjust_dynamic_symbol
 #define elf_backend_size_dynamic_sections \
@@ -2835,5 +5560,74 @@ error_return:
 #define elf_backend_got_header_size     12
 #define elf_backend_rela_normal         1
 
+#include "elf32-target.h"
+
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM          bfd_elf32_bfinfdpic_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME		"elf32-bfinfdpic"
+#undef	elf32_bed
+#define	elf32_bed		elf32_bfinfdpic_bed
+
+#undef elf_backend_gc_sweep_hook
+#define elf_backend_gc_sweep_hook       bfinfdpic_gc_sweep_hook
+
+#undef elf_backend_got_header_size
+#define elf_backend_got_header_size     0
+
+#undef elf_backend_relocate_section
+#define elf_backend_relocate_section    bfinfdpic_relocate_section
+#undef elf_backend_check_relocs
+#define elf_backend_check_relocs        bfinfdpic_check_relocs
+
+#undef bfd_elf32_bfd_link_hash_table_create
+#define bfd_elf32_bfd_link_hash_table_create \
+		bfinfdpic_elf_link_hash_table_create
+#undef elf_backend_always_size_sections
+#define elf_backend_always_size_sections \
+		elf32_bfinfdpic_always_size_sections
+#undef elf_backend_modify_segment_map
+#define elf_backend_modify_segment_map \
+		elf32_bfinfdpic_modify_segment_map
+#undef bfd_elf32_bfd_copy_private_bfd_data
+#define bfd_elf32_bfd_copy_private_bfd_data \
+		elf32_bfinfdpic_copy_private_bfd_data
+
+#undef elf_backend_create_dynamic_sections
+#define elf_backend_create_dynamic_sections \
+		elf32_bfinfdpic_create_dynamic_sections
+#undef elf_backend_adjust_dynamic_symbol
+#define elf_backend_adjust_dynamic_symbol \
+		elf32_bfinfdpic_adjust_dynamic_symbol
+#undef elf_backend_size_dynamic_sections
+#define elf_backend_size_dynamic_sections \
+		elf32_bfinfdpic_size_dynamic_sections
+#undef elf_backend_finish_dynamic_symbol
+#define elf_backend_finish_dynamic_symbol \
+		elf32_bfinfdpic_finish_dynamic_symbol
+#undef elf_backend_finish_dynamic_sections
+#define elf_backend_finish_dynamic_sections \
+		elf32_bfinfdpic_finish_dynamic_sections
+
+#undef elf_backend_can_make_relative_eh_frame
+#define elf_backend_can_make_relative_eh_frame \
+		bfinfdpic_elf_use_relative_eh_frame
+#undef elf_backend_can_make_lsda_relative_eh_frame
+#define elf_backend_can_make_lsda_relative_eh_frame \
+		bfinfdpic_elf_use_relative_eh_frame
+#undef elf_backend_encode_eh_address
+#define elf_backend_encode_eh_address \
+		bfinfdpic_elf_encode_eh_address
+
+#undef elf_backend_may_use_rel_p
+#define elf_backend_may_use_rel_p       1
+#undef elf_backend_may_use_rela_p
+#define elf_backend_may_use_rela_p      1
+/* We use REL for dynamic relocations only.  */
+#undef elf_backend_default_use_rela_p
+#define elf_backend_default_use_rela_p  1
+
+#undef elf_backend_omit_section_dynsym
+#define elf_backend_omit_section_dynsym _bfinfdpic_link_omit_section_dynsym
 
 #include "elf32-target.h"
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index bc44cba972c..754aa52254d 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -582,6 +582,10 @@ struct elf_i386_link_hash_entry
 #define GOT_TLS_IE_NEG	6
 #define GOT_TLS_IE_BOTH 7
 #define GOT_TLS_GDESC	8
+#define GOT_TLS_MASK	0x0f
+#define GOT_TLS_IE_IE	0x10
+#define GOT_TLS_IE_GD	0x20
+#define GOT_TLS_IE_MASK	0x30
 #define GOT_TLS_GD_BOTH_P(type)						\
   ((type) == (GOT_TLS_GD | GOT_TLS_GDESC))
 #define GOT_TLS_GD_P(type)						\
@@ -1007,12 +1011,25 @@ elf_i386_check_relocs (bfd *abfd,
 	      case R_386_TLS_IE_32:
 		if (ELF32_R_TYPE (rel->r_info) == r_type)
 		  tls_type = GOT_TLS_IE_NEG;
+		else if (h
+			 && ELF32_R_TYPE (rel->r_info) == R_386_TLS_GD)
+		  /* If this is a GD->IE transition, we may use either
+		     of R_386_TLS_TPOFF and R_386_TLS_TPOFF32.  But if
+		     we may have both R_386_TLS_IE and R_386_TLS_GD,
+		     we can't share the same R_386_TLS_TPOFF since
+		     they require different offsets. So we remember
+		     it comes from R_386_TLS_GD.  */
+		  tls_type = GOT_TLS_IE | GOT_TLS_IE_GD;
 		else
-		  /* If this is a GD->IE transition, we may use either of
-		     R_386_TLS_TPOFF and R_386_TLS_TPOFF32.  */
 		  tls_type = GOT_TLS_IE;
 		break;
 	      case R_386_TLS_IE:
+		if (h)
+		  {
+		    /* We remember it comes from R_386_TLS_IE.  */
+		    tls_type = GOT_TLS_IE_POS | GOT_TLS_IE_IE;
+		    break;
+		  }
 	      case R_386_TLS_GOTIE:
 		tls_type = GOT_TLS_IE_POS; break;
 	      }
@@ -1052,7 +1069,8 @@ elf_i386_check_relocs (bfd *abfd,
 	      tls_type |= old_tls_type;
 	    /* If a TLS symbol is accessed using IE at least once,
 	       there is no point to use dynamic model for it.  */
-	    else if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN
+	    else if (old_tls_type != tls_type
+		     && old_tls_type != GOT_UNKNOWN
 		     && (! GOT_TLS_GD_ANY_P (old_tls_type)
 			 || (tls_type & GOT_TLS_IE) == 0))
 	      {
@@ -1682,6 +1700,14 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
       asection *s;
       bfd_boolean dyn;
       int tls_type = elf_i386_hash_entry(h)->tls_type;
+      
+      /* If we have both R_386_TLS_IE and R_386_TLS_GD, GOT_TLS_IE_BOTH
+	 should be used.  */
+      if ((tls_type & GOT_TLS_IE_MASK)
+	  == (GOT_TLS_IE_IE | GOT_TLS_IE_GD))
+	tls_type = GOT_TLS_IE_BOTH;
+      else
+	tls_type &= GOT_TLS_MASK;
 
       /* Make sure this symbol is output as a dynamic symbol.
 	 Undefined weak syms won't yet be marked as dynamic.  */
@@ -2685,6 +2711,13 @@ elf_i386_relocate_section (bfd *output_bfd,
 	  else if (h != NULL)
 	    {
 	      tls_type = elf_i386_hash_entry(h)->tls_type;
+	      /* If we have both R_386_TLS_IE and R_386_TLS_GD,
+		 GOT_TLS_IE_BOTH should be used.  */
+	      if ((tls_type & GOT_TLS_IE_MASK)
+		  == (GOT_TLS_IE_IE | GOT_TLS_IE_GD))
+		tls_type = GOT_TLS_IE_BOTH;
+	      else
+		tls_type &= GOT_TLS_MASK;
 	      if (!info->shared && h->dynindx == -1 && (tls_type & GOT_TLS_IE))
 		r_type = R_386_TLS_LE_32;
 	    }
diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c
index f56efd2e4da..5e9f3ab28a2 100644
--- a/bfd/elf32-m32c.c
+++ b/bfd/elf32-m32c.c
@@ -482,6 +482,22 @@ m32c_elf_relocate_section
 		relocation = (splt->output_section->vma
 			      + splt->output_offset
 			      + (*plt_offset & -2));
+		if (name)
+		{
+		  char *newname = bfd_malloc (strlen(name)+5);
+		  strcpy (newname, name);
+		  strcat(newname, ".plt");
+		  _bfd_generic_link_add_one_symbol (info,
+						    input_bfd,
+						    newname,
+						    BSF_FUNCTION | BSF_WEAK,
+						    splt,
+						    (*plt_offset & -2),
+						    0,
+						    1,
+						    0,
+						    0);
+		}
 	      }
 	  }
 	  break;
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 5e69df5c9b0..df988a84966 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -446,40 +446,24 @@ elf32_m68k_merge_private_bfd_data (ibfd, obfd)
 {
   flagword out_flags;
   flagword in_flags;
-  unsigned in_mach, out_mach;
+  flagword out_isa;
+  flagword in_isa;
+  const bfd_arch_info_type *arch_info;
   
   if (   bfd_get_flavour (ibfd) != bfd_target_elf_flavour
       || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
     return FALSE;
 
-  in_mach = bfd_get_mach (ibfd);
-  out_mach = bfd_get_mach (obfd);
-  if (!out_mach || !in_mach)
-    /* One is unknown, copy the input machine.  */
-    out_mach = in_mach;
-  else if (in_mach != out_mach)
-    {
-      if (in_mach <= bfd_mach_m68060 && out_mach <= bfd_mach_m68060)
-	{
-	  /* Merge m68k machine. */
-	  if (in_mach > out_mach)
-	    out_mach = in_mach;
-	}
-      else if (in_mach >= bfd_mach_mcf_isa_a_nodiv
-	       && out_mach >= bfd_mach_mcf_isa_a_nodiv)
-	/* Merge cf machine.  */
-	out_mach = bfd_m68k_features_to_mach
-	  (bfd_m68k_mach_to_features (in_mach)
-	   | bfd_m68k_mach_to_features (out_mach));
-      else
-	/* They are incompatible.  */
-	return FALSE;
-    }
-  bfd_set_arch_mach (obfd, bfd_arch_m68k, out_mach);
-  
-  in_flags  = elf_elfheader (ibfd)->e_flags;
-  out_flags = elf_elfheader (obfd)->e_flags;
+  /* Get the merged machine.  This checks for incompatibility between
+     Coldfire & non-Coldfire flags, incompability between different
+     Coldfire ISAs, and incompability between different MAC types.  */
+  arch_info = bfd_arch_get_compatible (ibfd, obfd, FALSE);
+  if (!arch_info)
+    return FALSE;
 
+  bfd_set_arch_mach (obfd, bfd_arch_m68k, arch_info->mach);
+  
+  in_flags = elf_elfheader (ibfd)->e_flags;
   if (!elf_flags_init (obfd))
     {
       elf_flags_init (obfd) = TRUE;
@@ -487,54 +471,12 @@ elf32_m68k_merge_private_bfd_data (ibfd, obfd)
     }
   else
     {
-      flagword isa_in = in_flags & EF_M68K_ISA_MASK;
-      flagword isa_out = out_flags & EF_M68K_ISA_MASK;
-      
-      
-      /* Copy legacy flags.  */
-      out_flags |= in_flags & (EF_M68K_CPU32 | EF_M68K_M68000 | EF_M68K_CFV4E);
-
-      if ((isa_in | isa_out)
-	  && ((in_flags | out_flags) & (EF_M68K_CPU32 | EF_M68K_M68000)))
-	/* Mixing m68k and cf is not allowed */
-	return FALSE;
-      
-      if (isa_in)
-	{
-	  if (isa_out)
-	    {
-	      if (isa_out == EF_M68K_ISA_A_PLUS
-		  && (isa_in == EF_M68K_ISA_B_NOUSP
-		      || isa_in == EF_M68K_ISA_B))
-		/* Cannot mix A+ and B */
-		return FALSE;
-	      if (isa_in == EF_M68K_ISA_A_PLUS
-		  && (isa_out == EF_M68K_ISA_B_NOUSP
-		      || isa_out == EF_M68K_ISA_B))
-		/* Cannot mix B and A+ */
-		return FALSE;
-	      
-	      if (isa_in > isa_out)
-		out_flags ^= isa_in ^ isa_out;
-
-	      out_flags |= in_flags & EF_M68K_FLOAT;
-	      if (in_flags & EF_M68K_MAC_MASK)
-		{
-		  if (!(out_flags & EF_M68K_MAC_MASK))
-		    out_flags |= in_flags & EF_M68K_MAC_MASK;
-		  else if ((out_flags & EF_M68K_MAC_MASK)
-			   != (in_flags & EF_M68K_MAC_MASK))
-		    /* Cannot mix MACs */
-		    return FALSE;
-		}
-	    }
-	  else
-	    {
-	      /* Copy the coldfire bits.  */
-	      out_flags &= ~EF_M68K_CF_MASK;
-	      out_flags |= in_flags & EF_M68K_CF_MASK;
-	    }
-	}
+      out_flags = elf_elfheader (obfd)->e_flags;
+      in_isa = (in_flags & EF_M68K_ISA_MASK);
+      out_isa = (out_flags & EF_M68K_ISA_MASK);
+      if (in_isa > out_isa)
+	out_flags ^= in_isa ^ out_isa;
+      out_flags |= in_flags ^ in_isa;
     }
   elf_elfheader (obfd)->e_flags = out_flags;
 
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 3cdaeeec6d6..6ed4ad35f62 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
 #include "elf-bfd.h"
 #include "elfxx-mips.h"
 #include "elf/mips.h"
+#include "elf-vxworks.h"
 
 /* Get the ECOFF swapping routines.  */
 #include "coff/sym.h"
@@ -1319,10 +1320,12 @@ mips_elf32_rtype_to_howto (unsigned int r_type,
 static void
 mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
 {
+  const struct elf_backend_data *bed;
   unsigned int r_type;
 
   r_type = ELF32_R_TYPE (dst->r_info);
-  cache_ptr->howto = mips_elf32_rtype_to_howto (r_type, FALSE);
+  bed = get_elf_backend_data (abfd);
+  cache_ptr->howto = bed->elf_backend_mips_rtype_to_howto (r_type, FALSE);
 
   /* The addend for a GPREL16 or LITERAL relocation comes from the GP
      value for the object file.  We get the addend now, rather than
@@ -1619,3 +1622,147 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
 
 /* Include the target file again for this target.  */
 #include "elf32-target.h"
+
+
+/* Specific to VxWorks.  */
+static reloc_howto_type mips_vxworks_copy_howto_rela =
+  HOWTO (R_MIPS_COPY,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_MIPS_COPY",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0x0,         		/* src_mask */
+	 0x0,		        /* dst_mask */
+	 FALSE);		/* pcrel_offset */
+
+/* Specific to VxWorks.  */
+static reloc_howto_type mips_vxworks_jump_slot_howto_rela =
+  HOWTO (R_MIPS_JUMP_SLOT,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_MIPS_JUMP_SLOT",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0x0,         		/* src_mask */
+	 0x0,		        /* dst_mask */
+	 FALSE);		/* pcrel_offset */
+
+/* Implement elf_backend_bfd_reloc_type_lookup for VxWorks.  */
+
+static reloc_howto_type *
+mips_vxworks_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code)
+{
+  switch (code)
+    {
+    case BFD_RELOC_MIPS_COPY:
+      return &mips_vxworks_copy_howto_rela;
+    case BFD_RELOC_MIPS_JUMP_SLOT:
+      return &mips_vxworks_jump_slot_howto_rela;
+    default:
+      return bfd_elf32_bfd_reloc_type_lookup (abfd, code);
+    }
+}
+
+/* Implement elf_backend_mips_rtype_to_lookup for VxWorks.  */
+
+static reloc_howto_type *
+mips_vxworks_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p)
+{
+  switch (r_type)
+    {
+    case R_MIPS_COPY:
+      return &mips_vxworks_copy_howto_rela;
+    case R_MIPS_JUMP_SLOT:
+      return &mips_vxworks_jump_slot_howto_rela;
+    default:
+      return mips_elf32_rtype_to_howto (r_type, rela_p);
+    }
+}
+
+/* Implement elf_backend_final_write_processing for VxWorks.  */
+
+static void
+mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
+{
+  _bfd_mips_elf_final_write_processing (abfd, linker);
+  elf_vxworks_final_write_processing (abfd, linker);
+}
+
+#undef TARGET_LITTLE_SYM
+#undef TARGET_LITTLE_NAME
+#undef TARGET_BIG_SYM
+#undef TARGET_BIG_NAME
+
+#define TARGET_LITTLE_SYM               bfd_elf32_littlemips_vxworks_vec
+#define TARGET_LITTLE_NAME              "elf32-littlemips-vxworks"
+#define TARGET_BIG_SYM                  bfd_elf32_bigmips_vxworks_vec
+#define TARGET_BIG_NAME                 "elf32-bigmips-vxworks"
+
+#undef elf32_bed
+#define elf32_bed			elf32_mips_vxworks_bed
+
+#undef ELF_MAXPAGESIZE
+#define ELF_MAXPAGESIZE			0x1000
+
+#undef elf_backend_want_got_plt
+#define elf_backend_want_got_plt		1
+#undef elf_backend_want_plt_sym
+#define elf_backend_want_plt_sym		1
+#undef elf_backend_got_symbol_offset
+#define elf_backend_got_symbol_offset		0
+#undef elf_backend_want_dynbss
+#define elf_backend_want_dynbss			1
+#undef elf_backend_may_use_rel_p
+#define elf_backend_may_use_rel_p		0
+#undef elf_backend_may_use_rela_p
+#define elf_backend_may_use_rela_p		1
+#undef elf_backend_default_use_rela_p
+#define elf_backend_default_use_rela_p		1
+#undef elf_backend_got_header_size
+#define elf_backend_got_header_size		(4 * 3)
+#undef elf_backend_plt_readonly
+#define elf_backend_plt_readonly		1
+
+#undef bfd_elf32_bfd_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_type_lookup \
+  mips_vxworks_bfd_reloc_type_lookup
+#undef elf_backend_mips_rtype_to_howto
+#define elf_backend_mips_rtype_to_howto	\
+  mips_vxworks_rtype_to_howto
+#undef elf_backend_adjust_dynamic_symbol
+#define elf_backend_adjust_dynamic_symbol \
+  _bfd_mips_vxworks_adjust_dynamic_symbol
+#undef elf_backend_finish_dynamic_symbol
+#define elf_backend_finish_dynamic_symbol \
+  _bfd_mips_vxworks_finish_dynamic_symbol
+#undef bfd_elf32_bfd_link_hash_table_create
+#define bfd_elf32_bfd_link_hash_table_create \
+  _bfd_mips_vxworks_link_hash_table_create
+#undef elf_backend_add_symbol_hook
+#define elf_backend_add_symbol_hook \
+  elf_vxworks_add_symbol_hook
+#undef elf_backend_link_output_symbol_hook
+#define elf_backend_link_output_symbol_hook \
+  elf_vxworks_link_output_symbol_hook
+#undef elf_backend_emit_relocs
+#define elf_backend_emit_relocs \
+  elf_vxworks_emit_relocs
+#undef elf_backend_final_write_processing
+#define elf_backend_final_write_processing \
+  mips_vxworks_final_write_processing
+
+#undef elf_backend_additional_program_headers
+#undef elf_backend_modify_segment_map
+#undef elf_backend_symbol_processing
+/* NOTE: elf_backend_rela_normal is not defined for MIPS.  */
+
+#include "elf32-target.h"
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index 031b3034a8b..3bfb38a3d44 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -26,6 +26,7 @@
 #include "elf/sparc.h"
 #include "opcode/sparc.h"
 #include "elfxx-sparc.h"
+#include "elf-vxworks.h"
 
 /* Support for core dump NOTE sections.  */
 
@@ -215,3 +216,68 @@ elf32_sparc_reloc_type_class (const Elf_Internal_Rela *rela)
 #define elf_backend_rela_normal 1
 
 #include "elf32-target.h"
+
+/* A wrapper around _bfd_sparc_elf_link_hash_table_create that identifies
+   the target system as VxWorks.  */
+
+static struct bfd_link_hash_table *
+elf32_sparc_vxworks_link_hash_table_create (bfd *abfd)
+{
+  struct bfd_link_hash_table *ret;
+
+  ret = _bfd_sparc_elf_link_hash_table_create (abfd);
+  if (ret)
+    {
+      struct _bfd_sparc_elf_link_hash_table *htab;
+
+      htab = (struct _bfd_sparc_elf_link_hash_table *) ret;
+      htab->is_vxworks = 1;
+    }
+  return ret;
+}
+
+/* A final_write_processing hook that does both the SPARC- and VxWorks-
+   specific handling.  */
+
+static void
+elf32_sparc_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
+{
+  elf32_sparc_final_write_processing (abfd, linker);
+  elf_vxworks_final_write_processing (abfd, linker);
+}
+
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM	bfd_elf32_sparc_vxworks_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME	"elf32-sparc-vxworks"
+
+#undef ELF_MINPAGESIZE
+#define ELF_MINPAGESIZE	0x1000
+
+#undef bfd_elf32_bfd_link_hash_table_create
+#define bfd_elf32_bfd_link_hash_table_create \
+  elf32_sparc_vxworks_link_hash_table_create
+
+#undef elf_backend_want_got_plt
+#define elf_backend_want_got_plt		1
+#undef elf_backend_plt_readonly
+#define elf_backend_plt_readonly		1
+#undef elf_backend_got_header_size
+#define elf_backend_got_header_size		12
+#undef elf_backend_add_symbol_hook
+#define elf_backend_add_symbol_hook \
+  elf_vxworks_add_symbol_hook
+#undef elf_backend_link_output_symbol_hook
+#define elf_backend_link_output_symbol_hook \
+  elf_vxworks_link_output_symbol_hook
+#undef elf_backend_emit_relocs
+#define elf_backend_emit_relocs \
+  elf_vxworks_emit_relocs
+#undef elf_backend_final_write_processing
+#define elf_backend_final_write_processing \
+  elf32_sparc_vxworks_final_write_processing
+
+#undef elf32_bed
+#define elf32_bed				sparc_elf_vxworks_bed
+
+#include "elf32-target.h"
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index 18610c720f5..7a41d628577 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -640,7 +640,6 @@ xtensa_read_table_entries (bfd *abfd,
 	    {
 	      bfd_vma sym_off = get_elf_r_symndx_offset (abfd, r_symndx);
 	      BFD_ASSERT (sym_off == 0);
-	      BFD_ASSERT (rel->r_addend == 0);
 	      blocks[block_count].address =
 		(section_addr + sym_off + rel->r_addend
 		 + bfd_get_32 (abfd, table_data + rel->r_offset));
@@ -5767,7 +5766,8 @@ static bfd_boolean compute_text_actions
 static bfd_boolean compute_ebb_proposed_actions (ebb_constraint *);
 static bfd_boolean compute_ebb_actions (ebb_constraint *);
 static bfd_boolean check_section_ebb_pcrels_fit
-  (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, const ebb_constraint *);
+  (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, const ebb_constraint *,
+   const xtensa_opcode *);
 static bfd_boolean check_section_ebb_reduces (const ebb_constraint *);
 static void text_action_add_proposed
   (text_action_list *, const ebb_constraint *, asection *);
@@ -6303,6 +6303,24 @@ find_associated_l32r_irel (bfd *abfd,
 }
 
 
+static xtensa_opcode *
+build_reloc_opcodes (bfd *abfd,
+		     asection *sec,
+		     bfd_byte *contents,
+		     Elf_Internal_Rela *internal_relocs)
+{
+  unsigned i;
+  xtensa_opcode *reloc_opcodes =
+    (xtensa_opcode *) bfd_malloc (sizeof (xtensa_opcode) * sec->reloc_count);
+  for (i = 0; i < sec->reloc_count; i++)
+    {
+      Elf_Internal_Rela *irel = &internal_relocs[i];
+      reloc_opcodes[i] = get_relocation_opcode (abfd, sec, contents, irel);
+    }
+  return reloc_opcodes;
+}
+
+
 /* The compute_text_actions function will build a list of potential
    transformation actions for code in the extended basic block of each
    longcall that is optimized to a direct call.  From this list we
@@ -6319,6 +6337,7 @@ compute_text_actions (bfd *abfd,
 		      asection *sec,
 		      struct bfd_link_info *link_info)
 {
+  xtensa_opcode *reloc_opcodes = NULL;
   xtensa_relax_info *relax_info;
   bfd_byte *contents;
   Elf_Internal_Rela *internal_relocs;
@@ -6424,11 +6443,17 @@ compute_text_actions (bfd *abfd,
       ebb->start_reloc_idx = i;
       ebb->end_reloc_idx = i;
 
+      /* Precompute the opcode for each relocation.  */
+      if (reloc_opcodes == NULL)
+	reloc_opcodes = build_reloc_opcodes (abfd, sec, contents,
+					     internal_relocs);
+
       if (!extend_ebb_bounds (ebb)
 	  || !compute_ebb_proposed_actions (&ebb_table)
 	  || !compute_ebb_actions (&ebb_table)
 	  || !check_section_ebb_pcrels_fit (abfd, sec, contents,
-					    internal_relocs, &ebb_table)
+					    internal_relocs, &ebb_table,
+					    reloc_opcodes)
 	  || !check_section_ebb_reduces (&ebb_table))
 	{
 	  /* If anything goes wrong or we get unlucky and something does
@@ -6460,6 +6485,8 @@ error_return:
   release_internal_relocs (sec, internal_relocs);
   if (prop_table)
     free (prop_table);
+  if (reloc_opcodes)
+    free (reloc_opcodes);
 
   return ok;
 }
@@ -7027,7 +7054,8 @@ check_section_ebb_pcrels_fit (bfd *abfd,
 			      asection *sec,
 			      bfd_byte *contents,
 			      Elf_Internal_Rela *internal_relocs,
-			      const ebb_constraint *constraint)
+			      const ebb_constraint *constraint,
+			      const xtensa_opcode *reloc_opcodes)
 {
   unsigned i, j;
   Elf_Internal_Rela *irel;
@@ -7118,7 +7146,10 @@ check_section_ebb_pcrels_fit (bfd *abfd,
 	  xtensa_opcode opcode;
 	  int opnum;
 
-	  opcode = get_relocation_opcode (abfd, sec, contents, irel);
+	  if (reloc_opcodes)
+	    opcode = reloc_opcodes[i];
+	  else
+	    opcode = get_relocation_opcode (abfd, sec, contents, irel);
 	  if (opcode == XTENSA_UNDEFINED)
 	    {
 	      ok = FALSE;
@@ -7815,7 +7846,7 @@ move_shared_literal (asection *sec,
   relocs_fit = check_section_ebb_pcrels_fit (target_sec->owner, target_sec, 
 					     target_sec_cache->contents,
 					     target_sec_cache->relocs,
-					     &ebb_table);
+					     &ebb_table, NULL);
 
   if (!relocs_fit) 
     return FALSE;
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 4e0b83c96be..58798ae3794 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -2542,6 +2542,68 @@ elf64_hppa_finish_dynamic_sections (output_bfd, info)
   return TRUE;
 }
 
+/* Support for core dump NOTE sections.  */
+
+static bfd_boolean
+elf64_hppa_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
+{
+  int offset;
+  size_t size;
+
+  switch (note->descsz)
+    {
+      default:
+	return FALSE;
+
+      case 760:		/* Linux/hppa */
+	/* pr_cursig */
+	elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+
+	/* pr_pid */
+	elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 32);
+
+	/* pr_reg */
+	offset = 112;
+	size = 640;
+
+	break;
+    }
+
+  /* Make a ".reg/999" section.  */
+  return _bfd_elfcore_make_pseudosection (abfd, ".reg",
+					  size, note->descpos + offset);
+}
+
+static bfd_boolean
+elf64_hppa_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
+{
+  char * command;
+  int n;
+
+  switch (note->descsz)
+    {
+    default:
+      return FALSE;
+
+    case 136:		/* Linux/hppa elf_prpsinfo.  */
+      elf_tdata (abfd)->core_program
+	= _bfd_elfcore_strndup (abfd, note->descdata + 40, 16);
+      elf_tdata (abfd)->core_command
+	= _bfd_elfcore_strndup (abfd, note->descdata + 56, 80);
+    }
+
+  /* Note that for some reason, a spurious space is tacked
+     onto the end of the args in some (at least one anyway)
+     implementations, so strip it off if it exists.  */
+  command = elf_tdata (abfd)->core_command;
+  n = strlen (command);
+
+  if (0 < n && command[n - 1] == ' ')
+    command[n - 1] = '\0';
+
+  return TRUE;
+}
+
 /* Return the number of additional phdrs we will need.
 
    The generic ELF code only creates PT_PHDRs for executables.  The HP
@@ -2775,7 +2837,9 @@ const struct elf_size_info hppa64_elf_size_info =
 					elf64_hppa_finish_dynamic_symbol
 #define elf_backend_finish_dynamic_sections \
 					elf64_hppa_finish_dynamic_sections
-
+#define elf_backend_grok_prstatus	elf64_hppa_grok_prstatus
+#define elf_backend_grok_psinfo		elf64_hppa_grok_psinfo
+ 
 /* Stuff for the BFD linker: */
 #define bfd_elf64_bfd_link_hash_table_create \
 	elf64_hppa_hash_table_create
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 504a19b7b98..9befd69c5df 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -31,8 +31,8 @@
 #define MINUS_ONE (~ (bfd_vma) 0)
 
 /* The relocation "howto" table.  Order of fields:
-   type, size, bitsize, pc_relative, complain_on_overflow,
-   special_function, name, partial_inplace, src_mask, dst_pack, pcrel_offset.  */
+   type, rightshift, size, bitsize, pc_relative, bitpos, complain_on_overflow,
+   special_function, name, partial_inplace, src_mask, dst_mask, pcrel_offset.  */
 static reloc_howto_type x86_64_elf_howto_table[] =
 {
   HOWTO(R_X86_64_NONE, 0, 0, 0, FALSE, 0, complain_overflow_dont,
@@ -112,11 +112,21 @@ static reloc_howto_type x86_64_elf_howto_table[] =
   HOWTO(R_X86_64_GOTPC32, 0, 2, 32, TRUE, 0, complain_overflow_signed,
 	bfd_elf_generic_reloc, "R_X86_64_GOTPC32",
 	FALSE, 0xffffffff, 0xffffffff, TRUE),
-  EMPTY_HOWTO (27),
-  EMPTY_HOWTO (28),
-  EMPTY_HOWTO (29),
-  EMPTY_HOWTO (30),
-  EMPTY_HOWTO (31),
+  HOWTO(R_X86_64_GOT64, 0, 4, 64, FALSE, 0, complain_overflow_signed,
+	bfd_elf_generic_reloc, "R_X86_64_GOT64", FALSE, MINUS_ONE, MINUS_ONE,
+	FALSE),
+  HOWTO(R_X86_64_GOTPCREL64, 0, 4, 64, TRUE, 0, complain_overflow_signed,
+	bfd_elf_generic_reloc, "R_X86_64_GOTPCREL64", FALSE, MINUS_ONE,
+	MINUS_ONE, TRUE),
+  HOWTO(R_X86_64_GOTPC64, 0, 4, 64, TRUE, 0, complain_overflow_signed,
+	bfd_elf_generic_reloc, "R_X86_64_GOTPC64",
+	FALSE, MINUS_ONE, MINUS_ONE, TRUE),
+  HOWTO(R_X86_64_GOTPLT64, 0, 4, 64, FALSE, 0, complain_overflow_signed,
+	bfd_elf_generic_reloc, "R_X86_64_GOTPLT64", FALSE, MINUS_ONE,
+	MINUS_ONE, FALSE),
+  HOWTO(R_X86_64_PLTOFF64, 0, 4, 64, FALSE, 0, complain_overflow_signed,
+	bfd_elf_generic_reloc, "R_X86_64_PLTOFF64", FALSE, MINUS_ONE,
+	MINUS_ONE, FALSE),
   EMPTY_HOWTO (32),
   EMPTY_HOWTO (33),
   HOWTO(R_X86_64_GOTPC32_TLSDESC, 0, 2, 32, TRUE, 0,
@@ -185,6 +195,11 @@ static const struct elf_reloc_map x86_64_reloc_map[] =
   { BFD_RELOC_64_PCREL,		R_X86_64_PC64, },
   { BFD_RELOC_X86_64_GOTOFF64,	R_X86_64_GOTOFF64, },
   { BFD_RELOC_X86_64_GOTPC32,	R_X86_64_GOTPC32, },
+  { BFD_RELOC_X86_64_GOT64,	R_X86_64_GOT64, },
+  { BFD_RELOC_X86_64_GOTPCREL64,R_X86_64_GOTPCREL64, },
+  { BFD_RELOC_X86_64_GOTPC64,	R_X86_64_GOTPC64, },
+  { BFD_RELOC_X86_64_GOTPLT64,	R_X86_64_GOTPLT64, },
+  { BFD_RELOC_X86_64_PLTOFF64,	R_X86_64_PLTOFF64, },
   { BFD_RELOC_X86_64_GOTPC32_TLSDESC, R_X86_64_GOTPC32_TLSDESC, },
   { BFD_RELOC_X86_64_TLSDESC_CALL, R_X86_64_TLSDESC_CALL, },
   { BFD_RELOC_X86_64_TLSDESC,	R_X86_64_TLSDESC, },
@@ -777,6 +792,9 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
 	case R_X86_64_GOT32:
 	case R_X86_64_GOTPCREL:
 	case R_X86_64_TLSGD:
+	case R_X86_64_GOT64:
+	case R_X86_64_GOTPCREL64:
+	case R_X86_64_GOTPLT64:
 	case R_X86_64_GOTPC32_TLSDESC:
 	case R_X86_64_TLSDESC_CALL:
 	  /* This symbol requires a global offset table entry.	*/
@@ -795,6 +813,14 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
 
 	    if (h != NULL)
 	      {
+		if (r_type == R_X86_64_GOTPLT64)
+		  {
+		    /* This relocation indicates that we also need
+		       a PLT entry, as this is a function.  We don't need
+		       a PLT entry for local symbols.  */
+		    h->needs_plt = 1;
+		    h->plt.refcount += 1;
+		  }
 		h->got.refcount += 1;
 		old_tls_type = elf64_x86_64_hash_entry (h)->tls_type;
 	      }
@@ -858,6 +884,7 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
 
 	case R_X86_64_GOTOFF64:
 	case R_X86_64_GOTPC32:
+	case R_X86_64_GOTPC64:
 	create_got:
 	  if (htab->sgot == NULL)
 	    {
@@ -885,6 +912,16 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
 	  h->plt.refcount += 1;
 	  break;
 
+	case R_X86_64_PLTOFF64:
+	  /* This tries to form the 'address' of a function relative
+	     to GOT.  For global symbols we need a PLT entry.  */
+	  if (h != NULL)
+	    {
+	      h->needs_plt = 1;
+	      h->plt.refcount += 1;
+	    }
+	  goto create_got;
+
 	case R_X86_64_8:
 	case R_X86_64_16:
 	case R_X86_64_32:
@@ -1189,8 +1226,13 @@ elf64_x86_64_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
 	case R_X86_64_GOTTPOFF:
 	case R_X86_64_GOT32:
 	case R_X86_64_GOTPCREL:
+	case R_X86_64_GOT64:
+	case R_X86_64_GOTPCREL64:
+	case R_X86_64_GOTPLT64:
 	  if (h != NULL)
 	    {
+	      if (r_type == R_X86_64_GOTPLT64 && h->plt.refcount > 0)
+	        h->plt.refcount -= 1;
 	      if (h->got.refcount > 0)
 		h->got.refcount -= 1;
 	    }
@@ -1215,6 +1257,7 @@ elf64_x86_64_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
 	  /* Fall thru */
 
 	case R_X86_64_PLT32:
+	case R_X86_64_PLTOFF64:
 	  if (h != NULL)
 	    {
 	      if (h->plt.refcount > 0)
@@ -2096,11 +2139,23 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	 copied into the output file to be resolved at run time.  */
       switch (r_type)
 	{
+	asection *base_got;
 	case R_X86_64_GOT32:
+	case R_X86_64_GOT64:
 	  /* Relocation is to the entry for this symbol in the global
 	     offset table.  */
 	case R_X86_64_GOTPCREL:
-	  /* Use global offset table as symbol value.  */
+	case R_X86_64_GOTPCREL64:
+	  /* Use global offset table entry as symbol value.  */
+	case R_X86_64_GOTPLT64:
+	  /* This is the same as GOT64 for relocation purposes, but
+	     indicates the existence of a PLT entry.  The difficulty is,
+	     that we must calculate the GOT slot offset from the PLT
+	     offset, if this symbol got a PLT entry (it was global).
+	     Additionally if it's computed from the PLT entry, then that
+	     GOT offset is relative to .got.plt, not to .got.  */
+	  base_got = htab->sgot;
+
 	  if (htab->sgot == NULL)
 	    abort ();
 
@@ -2109,6 +2164,19 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	      bfd_boolean dyn;
 
 	      off = h->got.offset;
+	      if (h->needs_plt
+	          && h->plt.offset != (bfd_vma)-1
+		  && off == (bfd_vma)-1)
+		{
+		  /* We can't use h->got.offset here to save
+		     state, or even just remember the offset, as
+		     finish_dynamic_symbol would use that as offset into
+		     .got.  */
+		  bfd_vma plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
+		  off = (plt_index + 3) * GOT_ENTRY_SIZE;
+		  base_got = htab->sgotplt;
+		}
+
 	      dyn = htab->elf.dynamic_sections_created;
 
 	      if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
@@ -2133,7 +2201,9 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 		  else
 		    {
 		      bfd_put_64 (output_bfd, relocation,
-				  htab->sgot->contents + off);
+				  base_got->contents + off);
+		      /* Note that this is harmless for the GOTPLT64 case,
+		         as -1 | 1 still is -1.  */
 		      h->got.offset |= 1;
 		    }
 		}
@@ -2155,7 +2225,7 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	      else
 		{
 		  bfd_put_64 (output_bfd, relocation,
-			      htab->sgot->contents + off);
+			      base_got->contents + off);
 
 		  if (info->shared)
 		    {
@@ -2169,8 +2239,8 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 		      if (s == NULL)
 			abort ();
 
-		      outrel.r_offset = (htab->sgot->output_section->vma
-					 + htab->sgot->output_offset
+		      outrel.r_offset = (base_got->output_section->vma
+					 + base_got->output_offset
 					 + off);
 		      outrel.r_info = ELF64_R_INFO (0, R_X86_64_RELATIVE);
 		      outrel.r_addend = relocation;
@@ -2186,9 +2256,9 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	  if (off >= (bfd_vma) -2)
 	    abort ();
 
-	  relocation = htab->sgot->output_section->vma
-		       + htab->sgot->output_offset + off;
-	  if (r_type != R_X86_64_GOTPCREL)
+	  relocation = base_got->output_section->vma
+		       + base_got->output_offset + off;
+	  if (r_type != R_X86_64_GOTPCREL && r_type != R_X86_64_GOTPCREL64)
 	    relocation -= htab->sgotplt->output_section->vma
 			  - htab->sgotplt->output_offset;
 
@@ -2224,12 +2294,31 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	  break;
 
 	case R_X86_64_GOTPC32:
+	case R_X86_64_GOTPC64:
 	  /* Use global offset table as symbol value.  */
 	  relocation = htab->sgotplt->output_section->vma
 		       + htab->sgotplt->output_offset;
 	  unresolved_reloc = FALSE;
 	  break;
 
+	case R_X86_64_PLTOFF64:
+	  /* Relocation is PLT entry relative to GOT.  For local
+	     symbols it's the symbol itself relative to GOT.  */
+          if (h != NULL
+	      /* See PLT32 handling.  */
+	      && h->plt.offset != (bfd_vma) -1
+	      && htab->splt != NULL)
+	    {
+	      relocation = (htab->splt->output_section->vma
+			    + htab->splt->output_offset
+			    + h->plt.offset);
+	      unresolved_reloc = FALSE;
+	    }
+
+	  relocation -= htab->sgotplt->output_section->vma
+			+ htab->sgotplt->output_offset;
+	  break;
+
 	case R_X86_64_PLT32:
 	  /* Relocation is to the entry for this symbol in the
 	     procedure linkage table.  */
diff --git a/bfd/elflink.c b/bfd/elflink.c
index f0a0e83cada..0900220dbca 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -889,6 +889,26 @@ _bfd_elf_merge_symbol (bfd *abfd,
 	    && h->root.type != bfd_link_hash_undefweak
 	    && h->root.type != bfd_link_hash_common);
 
+  /* When we try to create a default indirect symbol from the dynamic
+     definition with the default version, we skip it if its type and
+     the type of existing regular definition mismatch.  We only do it
+     if the existing regular definition won't be dynamic.  */
+  if (pold_alignment == NULL
+      && !info->shared
+      && !info->export_dynamic
+      && !h->ref_dynamic
+      && newdyn
+      && newdef
+      && !olddyn
+      && (olddef || h->root.type == bfd_link_hash_common)
+      && ELF_ST_TYPE (sym->st_info) != h->type
+      && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE
+      && h->type != STT_NOTYPE)
+    {
+      *skip = TRUE;
+      return TRUE;
+    }
+
   /* Check TLS symbol.  We don't check undefined symbol introduced by
      "ld -u".  */
   if ((ELF_ST_TYPE (sym->st_info) == STT_TLS || h->type == STT_TLS)
@@ -6184,6 +6204,24 @@ elf_link_output_sym (struct elf_final_link_info *finfo,
   return TRUE;
 }
 
+/* Return TRUE if the dynamic symbol SYM in ABFD is supported.  */
+
+static bfd_boolean
+check_dynsym (bfd *abfd, Elf_Internal_Sym *sym)
+{
+  if (sym->st_shndx > SHN_HIRESERVE)
+    {
+      /* The gABI doesn't support dynamic symbols in output sections
+         beyond 64k.  */
+      (*_bfd_error_handler)
+	(_("%B: Too many sections: %d (>= %d)"),
+	 abfd, bfd_count_sections (abfd), SHN_LORESERVE);
+      bfd_set_error (bfd_error_nonrepresentable_section);
+      return FALSE;
+    }
+  return TRUE;
+}
+
 /* For DSOs loaded in via a DT_NEEDED entry, emulate ld.so in
    allowing an unsatisfied unversioned symbol in the DSO to match a
    versioned symbol that would normally require an explicit version.
@@ -6616,6 +6654,11 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
 
       sym.st_name = h->dynstr_index;
       esym = finfo->dynsym_sec->contents + h->dynindx * bed->s->sizeof_sym;
+      if (! check_dynsym (finfo->output_bfd, &sym))
+	{
+	  eoinfo->failed = TRUE;
+	  return FALSE;
+	}
       bed->s->swap_symbol_out (finfo->output_bfd, &sym, esym, 0);
 
       bucketcount = elf_hash_table (finfo->info)->bucketcount;
@@ -7665,7 +7708,7 @@ elf_fixup_link_order (bfd *abfd, asection *o)
   struct bfd_link_order *p;
   bfd *sub;
   const struct elf_backend_data *bed = get_elf_backend_data (abfd);
-  int elfsec;
+  unsigned elfsec;
   struct bfd_link_order **sections;
   asection *s, *other_sec, *linkorder_sec;
   bfd_vma offset;
@@ -7682,7 +7725,8 @@ elf_fixup_link_order (bfd *abfd, asection *o)
 	  sub = s->owner;
 	  if (bfd_get_flavour (sub) == bfd_target_elf_flavour
 	      && elf_elfheader (sub)->e_ident[EI_CLASS] == bed->s->elfclass
-	      && (elfsec = _bfd_elf_section_from_bfd_section (sub, s)) != -1
+	      && (elfsec = _bfd_elf_section_from_bfd_section (sub, s))
+	      && elfsec < elf_numsections (sub)
 	      && elf_elfsections (sub)[elfsec]->sh_flags & SHF_LINK_ORDER)
 	    {
 	      seen_linkorder++;
@@ -8292,6 +8336,8 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
 	      indx = elf_section_data (s)->this_idx;
 	      BFD_ASSERT (indx > 0);
 	      sym.st_shndx = indx;
+	      if (! check_dynsym (abfd, &sym))
+		return FALSE;
 	      sym.st_value = s->vma;
 	      dest = dynsym + dynindx * bed->s->sizeof_sym;
 	      if (last_local < dynindx)
@@ -8326,6 +8372,8 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
 
 		  sym.st_shndx =
 		    elf_section_data (s->output_section)->this_idx;
+		  if (! check_dynsym (abfd, &sym))
+		    return FALSE;
 		  sym.st_value = (s->output_section->vma
 				  + s->output_offset
 				  + e->isym.st_value);
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index f0bb0fa60ad..6b3257afdf1 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -80,9 +80,6 @@ struct elfNN_ia64_dyn_sym_info
   /* The addend for which this entry is relevant.  */
   bfd_vma addend;
 
-  /* Next addend in the list.  */
-  struct elfNN_ia64_dyn_sym_info *next;
-
   bfd_vma got_offset;
   bfd_vma fptr_offset;
   bfd_vma pltoff_offset;
@@ -133,6 +130,13 @@ struct elfNN_ia64_local_hash_entry
 {
   int id;
   unsigned int r_sym;
+  /* The number of elements in elfNN_ia64_dyn_sym_info array.  */
+  unsigned int count;
+  /* The number of sorted elements in elfNN_ia64_dyn_sym_info array.  */
+  unsigned int sorted_count;
+  /* The size of elfNN_ia64_dyn_sym_info array.  */
+  unsigned int size;
+  /* The array of elfNN_ia64_dyn_sym_info.  */
   struct elfNN_ia64_dyn_sym_info *info;
 
   /* TRUE if this hash entry's addends was translated for
@@ -143,6 +147,13 @@ struct elfNN_ia64_local_hash_entry
 struct elfNN_ia64_link_hash_entry
 {
   struct elf_link_hash_entry root;
+  /* The number of elements in elfNN_ia64_dyn_sym_info array.  */
+  unsigned int count;
+  /* The number of sorted elements in elfNN_ia64_dyn_sym_info array.  */
+  unsigned int sorted_count;
+  /* The size of elfNN_ia64_dyn_sym_info array.  */
+  unsigned int size;
+  /* The array of elfNN_ia64_dyn_sym_info.  */
   struct elfNN_ia64_dyn_sym_info *info;
 };
 
@@ -852,6 +863,12 @@ elfNN_ia64_relax_brl (bfd_byte *contents, bfd_vma off)
   bfd_putl64 (t0, hit_addr);
   bfd_putl64 (t1, hit_addr + 8);
 }
+
+/* Rename some of the generic section flags to better document how they
+   are used here.  */
+#define skip_relax_pass_0 need_finalize_relax
+#define skip_relax_pass_1 has_gp_reloc
+
 
 /* These functions do relaxation for IA-64 ELF.  */
 
@@ -880,6 +897,8 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
   bfd_boolean changed_contents = FALSE;
   bfd_boolean changed_relocs = FALSE;
   bfd_boolean changed_got = FALSE;
+  bfd_boolean skip_relax_pass_0 = TRUE;
+  bfd_boolean skip_relax_pass_1 = TRUE;
   bfd_vma gp = 0;
 
   /* Assume we're not going to change any sizes, and we'll only need
@@ -891,11 +910,11 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
     return FALSE;
 
   /* Nothing to do if there are no relocations or there is no need for
-     the relax finalize pass.  */
+     the current pass.  */
   if ((sec->flags & SEC_RELOC) == 0
       || sec->reloc_count == 0
-      || (!link_info->need_relax_finalize
-	  && sec->need_finalize_relax == 0))
+      || (link_info->relax_pass == 0 && sec->skip_relax_pass_0)
+      || (link_info->relax_pass == 1 && sec->skip_relax_pass_1))
     return TRUE;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
@@ -936,20 +955,19 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
 	case R_IA64_PCREL21BI:
 	case R_IA64_PCREL21M:
 	case R_IA64_PCREL21F:
-	  /* In the finalize pass, all br relaxations are done. We can
-	     skip it. */
-	  if (!link_info->need_relax_finalize)
+	  /* In pass 1, all br relaxations are done. We can skip it. */
+	  if (link_info->relax_pass == 1)
 	    continue;
+	  skip_relax_pass_0 = FALSE;
 	  is_branch = TRUE;
 	  break;
 
 	case R_IA64_PCREL60B:
-	  /* We can't optimize brl to br before the finalize pass since
-	     br relaxations will increase the code size. Defer it to
-	     the finalize pass.  */
-	  if (link_info->need_relax_finalize)
+	  /* We can't optimize brl to br in pass 0 since br relaxations
+	     will increase the code size. Defer it to pass 1.  */
+	  if (link_info->relax_pass == 0)
 	    {
-	      sec->need_finalize_relax = 1;
+	      skip_relax_pass_1 = FALSE;
 	      continue;
 	    }
 	  is_branch = TRUE;
@@ -957,12 +975,11 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
 
 	case R_IA64_LTOFF22X:
 	case R_IA64_LDXMOV:
-	  /* We can't relax ldx/mov before the finalize pass since
-	     br relaxations will increase the code size. Defer it to
-	     the finalize pass.  */
-	  if (link_info->need_relax_finalize)
+	  /* We can't relax ldx/mov in pass 0 since br relaxations will
+	     increase the code size. Defer it to pass 1.  */
+	  if (link_info->relax_pass == 0)
 	    {
-	      sec->need_finalize_relax = 1;
+	      skip_relax_pass_1 = FALSE;
 	      continue;
 	    }
 	  is_branch = FALSE;
@@ -1352,8 +1369,12 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
 	}
     }
 
-  if (!link_info->need_relax_finalize)
-    sec->need_finalize_relax = 0;
+  if (link_info->relax_pass == 0)
+    {
+      /* Pass 0 is only needed to relax br.  */
+      sec->skip_relax_pass_0 = skip_relax_pass_0;
+      sec->skip_relax_pass_1 = skip_relax_pass_1;
+    }
 
   *again = changed_contents || changed_relocs;
   return TRUE;
@@ -1369,6 +1390,8 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
     free (internal_relocs);
   return FALSE;
 }
+#undef skip_relax_pass_0
+#undef skip_relax_pass_1
 
 static void
 elfNN_ia64_relax_ldxmov (contents, off)
@@ -1799,6 +1822,9 @@ elfNN_ia64_new_elf_hash_entry (entry, table, string)
 				     table, string));
 
   ret->info = NULL;
+  ret->count = 0;
+  ret->sorted_count = 0;
+  ret->size = 0;
   return (struct bfd_hash_entry *) ret;
 }
 
@@ -1829,16 +1855,25 @@ elfNN_ia64_hash_copy_indirect (info, xdir, xind)
   if (ind->info != NULL)
     {
       struct elfNN_ia64_dyn_sym_info *dyn_i;
-      struct elfNN_ia64_dyn_sym_info **pdyn;
+      unsigned int count;
+
+      if (dir->info)
+	free (dir->info);
+
+      dir->info = ind->info;
+      dir->count = ind->count;
+      dir->sorted_count = ind->sorted_count;
+      dir->size = ind->size;
 
-      pdyn = &dir->info;
-      while ((dyn_i = *pdyn) != NULL)
-	pdyn = &dyn_i->next;
-      *pdyn = dyn_i = ind->info;
       ind->info = NULL;
+      ind->count = 0;
+      ind->sorted_count = 0;
+      ind->size = 0;
 
       /* Fix up the dyn_sym_info pointers to the global symbol.  */
-      for (; dyn_i; dyn_i = dyn_i->next)
+      for (count = dir->count, dyn_i = dir->info;
+	   count != 0;
+	   count--, dyn_i++)
 	dyn_i->h = &dir->root;
     }
 
@@ -1864,12 +1899,15 @@ elfNN_ia64_hash_hide_symbol (info, xh, force_local)
 {
   struct elfNN_ia64_link_hash_entry *h;
   struct elfNN_ia64_dyn_sym_info *dyn_i;
+  unsigned int count;
 
   h = (struct elfNN_ia64_link_hash_entry *)xh;
 
   _bfd_elf_link_hash_hide_symbol (info, &h->root, force_local);
 
-  for (dyn_i = h->info; dyn_i; dyn_i = dyn_i->next)
+  for (count = h->count, dyn_i = h->info;
+       count != 0;
+       count--, dyn_i++)
     {
       dyn_i->want_plt2 = 0;
       dyn_i->want_plt = 0;
@@ -1937,6 +1975,51 @@ elfNN_ia64_hash_table_create (abfd)
   return &ret->root.root;
 }
 
+/* Free the global elfNN_ia64_dyn_sym_info array.  */
+
+static bfd_boolean
+elfNN_ia64_global_dyn_info_free (void **xentry,
+				PTR unused ATTRIBUTE_UNUSED)
+{
+  struct elfNN_ia64_link_hash_entry *entry
+    = (struct elfNN_ia64_link_hash_entry *) xentry;
+
+  if (entry->root.root.type == bfd_link_hash_warning)
+    entry = (struct elfNN_ia64_link_hash_entry *) entry->root.root.u.i.link;
+
+  if (entry->info)
+    {
+      free (entry->info);
+      entry->info = NULL;
+      entry->count = 0;
+      entry->sorted_count = 0;
+      entry->size = 0;
+    }
+
+  return TRUE;
+}
+
+/* Free the local elfNN_ia64_dyn_sym_info array.  */
+
+static bfd_boolean
+elfNN_ia64_local_dyn_info_free (void **slot,
+				PTR unused ATTRIBUTE_UNUSED)
+{
+  struct elfNN_ia64_local_hash_entry *entry
+    = (struct elfNN_ia64_local_hash_entry *) *slot;
+
+  if (entry->info)
+    {
+      free (entry->info);
+      entry->info = NULL;
+      entry->count = 0;
+      entry->sorted_count = 0;
+      entry->size = 0;
+    }
+
+  return TRUE;
+}
+
 /* Destroy IA-64 linker hash table.  */
 
 static void
@@ -1946,9 +2029,15 @@ elfNN_ia64_hash_table_free (hash)
   struct elfNN_ia64_link_hash_table *ia64_info
     = (struct elfNN_ia64_link_hash_table *) hash;
   if (ia64_info->loc_hash_table)
-    htab_delete (ia64_info->loc_hash_table);
+    {
+      htab_traverse (ia64_info->loc_hash_table,
+		     elfNN_ia64_local_dyn_info_free, NULL);
+      htab_delete (ia64_info->loc_hash_table);
+    }
   if (ia64_info->loc_hash_memory)
     objalloc_free ((struct objalloc *) ia64_info->loc_hash_memory);
+  elf_link_hash_traverse (&ia64_info->root,
+			  elfNN_ia64_global_dyn_info_free, NULL);
   _bfd_generic_link_hash_table_free (hash);
 }
 
@@ -1970,11 +2059,14 @@ elfNN_ia64_global_dyn_sym_thunk (xentry, xdata)
   struct elfNN_ia64_dyn_sym_traverse_data *data
     = (struct elfNN_ia64_dyn_sym_traverse_data *) xdata;
   struct elfNN_ia64_dyn_sym_info *dyn_i;
+  unsigned int count;
 
   if (entry->root.root.type == bfd_link_hash_warning)
     entry = (struct elfNN_ia64_link_hash_entry *) entry->root.root.u.i.link;
 
-  for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next)
+  for (count = entry->count, dyn_i = entry->info;
+       count != 0;
+       count--, dyn_i++)
     if (! (*data->func) (dyn_i, data->data))
       return FALSE;
   return TRUE;
@@ -1990,11 +2082,14 @@ elfNN_ia64_local_dyn_sym_thunk (slot, xdata)
   struct elfNN_ia64_dyn_sym_traverse_data *data
     = (struct elfNN_ia64_dyn_sym_traverse_data *) xdata;
   struct elfNN_ia64_dyn_sym_info *dyn_i;
+  unsigned int count;
 
-  for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next)
+  for (count = entry->count, dyn_i = entry->info;
+       count != 0;
+       count--, dyn_i++)
     if (! (*data->func) (dyn_i, data->data))
-      return 0;
-  return 1;
+      return FALSE;
+  return TRUE;
 }
 
 static void
@@ -2103,8 +2198,129 @@ get_local_sym_hash (ia64_info, abfd, rel, create)
   return ret;
 }
 
+/* Used to sort elfNN_ia64_dyn_sym_info array.  */
+
+static int
+addend_compare (const void *xp, const void *yp)
+{
+  const struct elfNN_ia64_dyn_sym_info *x
+    = (const struct elfNN_ia64_dyn_sym_info *) xp;
+  const struct elfNN_ia64_dyn_sym_info *y
+    = (const struct elfNN_ia64_dyn_sym_info *) yp;
+
+  return x->addend - y->addend;
+}
+
+/* Sort elfNN_ia64_dyn_sym_info array and remove duplicates.  */
+
+static unsigned int
+sort_dyn_sym_info (struct elfNN_ia64_dyn_sym_info *info,
+		   unsigned int count)
+{
+  bfd_vma curr, prev;
+  unsigned int i, dup, diff, dest, src, len;
+
+  qsort (info, count, sizeof (*info), addend_compare);
+
+  /* Find the first duplicate.  */
+  prev = info [0].addend;
+  for (i = 1; i < count; i++)
+    {
+      curr = info [i].addend;
+      if (curr == prev)
+	break;
+      prev = curr;
+    }
+
+  /* Remove duplicates.  */
+  if (i < count)
+    {
+      /* We need to move a block of elements to here.  */
+      dest = i++;
+      while (i < count)
+	{
+	  curr = info [i].addend;
+
+	  /* Move a block of elements whose first one is different from
+	     the previous.  */
+	  if (curr == prev)
+	    {
+	      for (src = i + 1; src < count; src++)
+		if (info [src].addend != curr)
+		  break;
+	    }
+	  else
+	    src = i;
+
+	  if (src >= count)
+	    break;
+
+	  /* Find the next duplicate.  */
+	  prev = info [src].addend;
+	  for (dup = src + 1; dup < count; dup++)
+	    {
+	      curr = info [dup].addend;
+	      if (curr == prev)
+		break;
+	      prev = curr;
+	    }
+
+	  /* How much to move.  */
+	  len = dup - src;
+	  i = dup + 1;
+
+	  if (len == 1 && dup < count)
+	    {
+	      /* If we only move 1 element, we combine it with the next
+		 one.  Find the next different one.  */
+	      for (diff = dup + 1, src++; diff < count; diff++, src++)
+		if (info [diff].addend != curr)
+		  break;
+
+	      if (diff < count)
+		{
+		  /* Find the next duplicate.  */
+		  prev = info [diff].addend;
+		  for (dup = diff + 1; dup < count; dup++)
+		    {
+		      curr = info [dup].addend;
+		      if (curr == prev)
+			break;
+		      prev = curr;
+		      diff++;
+		    }
+
+		  len = diff - src + 1;
+		  i = diff + 1;
+		}
+	    }
+
+	  memmove (&info [dest], &info [src], len * sizeof (*info));
+
+	  dest += len;
+	}
+
+      count = dest;
+    }
+
+  return count;
+}
+
 /* Find and/or create a descriptor for dynamic symbol info.  This will
-   vary based on global or local symbol, and the addend to the reloc.  */
+   vary based on global or local symbol, and the addend to the reloc.
+
+   We don't sort when inserting.  Also, we sort and eliminate
+   duplicates if there is an unsorted section.  Typically, this will
+   only happen once, because we do all insertions before lookups.  We
+   then use bsearch to do a lookup.  This also allows lookups to be
+   fast.  So we have fast insertion (O(log N) due to duplicate check),
+   fast lookup (O(log N)) and one sort (O(N log N) expected time).
+   Previously, all lookups were O(N) because of the use of the linked
+   list and also all insertions were O(N) because of the check for
+   duplicates.  There are some complications here because the array
+   size grows occasionally, which may add an O(N) factor, but this
+   should be rare.  Also,  we free the excess array allocation, which
+   requires a copy which is O(N), but this only happens once.  */
 
 static struct elfNN_ia64_dyn_sym_info *
 get_dyn_sym_info (ia64_info, h, abfd, rel, create)
@@ -2114,12 +2330,22 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create)
      const Elf_Internal_Rela *rel;
      bfd_boolean create;
 {
-  struct elfNN_ia64_dyn_sym_info **pp;
-  struct elfNN_ia64_dyn_sym_info *dyn_i;
+  struct elfNN_ia64_dyn_sym_info **info_p, *info, *dyn_i, key;
+  unsigned int *count_p, *sorted_count_p, *size_p;
+  unsigned int count, sorted_count, size;
   bfd_vma addend = rel ? rel->r_addend : 0;
+  bfd_size_type amt;
 
   if (h)
-    pp = &((struct elfNN_ia64_link_hash_entry *)h)->info;
+    {
+      struct elfNN_ia64_link_hash_entry *global_h;
+
+      global_h = (struct elfNN_ia64_link_hash_entry *) h;
+      info_p = &global_h->info;
+      count_p = &global_h->count;
+      sorted_count_p = &global_h->sorted_count;
+      size_p = &global_h->size;
+    }
   else
     {
       struct elfNN_ia64_local_hash_entry *loc_h;
@@ -2131,18 +2357,107 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create)
 	  return NULL;
 	}
 
-      pp = &loc_h->info;
+      info_p = &loc_h->info;
+      count_p = &loc_h->count;
+      sorted_count_p = &loc_h->sorted_count;
+      size_p = &loc_h->size;
     }
 
-  for (dyn_i = *pp; dyn_i && dyn_i->addend != addend; dyn_i = *pp)
-    pp = &dyn_i->next;
-
-  if (dyn_i == NULL && create)
+  count = *count_p;
+  sorted_count = *sorted_count_p;
+  size = *size_p;
+  info = *info_p;
+  if (create)
     {
-      dyn_i = ((struct elfNN_ia64_dyn_sym_info *)
-	       bfd_zalloc (abfd, (bfd_size_type) sizeof *dyn_i));
-      *pp = dyn_i;
+      /* When we create the array, we don't check for duplicates,
+         except in the previously sorted section if one exists, and
+	 against the last inserted entry.  This allows insertions to
+	 be fast.  */
+      if (info)
+	{
+	  if (sorted_count)
+	    {
+	      /* Try bsearch first on the sorted section.  */
+	      key.addend = addend;
+	      dyn_i = bsearch (&key, info, sorted_count,
+			       sizeof (*info), addend_compare);
+
+	      if (dyn_i)
+		{
+		  return dyn_i;
+		}
+	    }
+
+	  /* Do a quick check for the last inserted entry.  */
+	  dyn_i = info + count - 1;
+	  if (dyn_i->addend == addend)
+	    {
+	      return dyn_i;
+	    }
+	}
+
+      if (size == 0)
+	{
+	  /* It is the very first element. We create the array of size
+	     1.  */
+	  size = 1;
+	  amt = size * sizeof (*info);
+	  info = bfd_malloc (amt);
+	}
+      else if (size <= count)
+	{
+	  /* We double the array size every time when we reach the
+	     size limit.  */
+	  size += size;
+	  amt = size * sizeof (*info);
+	  info = bfd_realloc (info, amt);
+	}
+      else
+	goto has_space;
+
+      if (info == NULL)
+	return NULL;
+      *size_p = size;
+      *info_p = info;
+
+has_space:
+      /* Append the new one to the array.  */
+      dyn_i = info + count;
+      memset (dyn_i, 0, sizeof (*dyn_i));
       dyn_i->addend = addend;
+      
+      /* We increment count only since the new ones are unsorted and
+	 may have duplicate.  */
+      (*count_p)++;
+    }
+  else
+    {
+      /* It is a lookup without insertion.  Sort array if part of the
+	 array isn't sorted.  */
+      if (count != sorted_count)
+	{
+	  count = sort_dyn_sym_info (info, count);
+	  *count_p = count;
+	  *sorted_count_p = count;
+	}
+
+      /* Free unused memory.  */
+      if (size != count)
+	{
+	  amt = count * sizeof (*info);
+	  info = bfd_malloc (amt);
+	  if (info != NULL)
+	    {
+	      memcpy (info, *info_p, amt);
+	      free (*info_p);
+	      *size_p = count;
+	      *info_p = info;
+	    }
+	}
+
+      key.addend = addend;
+      dyn_i = bsearch (&key, info, count,
+		       sizeof (*info), addend_compare);
     }
 
   return dyn_i;
@@ -2368,6 +2683,23 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
   Elf_Internal_Shdr *symtab_hdr;
   const Elf_Internal_Rela *rel;
   asection *got, *fptr, *srel, *pltoff;
+  enum {
+    NEED_GOT = 1,
+    NEED_GOTX = 2,
+    NEED_FPTR = 4,
+    NEED_PLTOFF = 8,
+    NEED_MIN_PLT = 16,
+    NEED_FULL_PLT = 32,
+    NEED_DYNREL = 64,
+    NEED_LTOFF_FPTR = 128,
+    NEED_TPREL = 256,
+    NEED_DTPMOD = 512,
+    NEED_DTPREL = 1024
+  };
+  int need_entry;
+  struct elf_link_hash_entry *h;
+  unsigned long r_symndx;
+  bfd_boolean maybe_dynamic;
 
   if (info->relocatable)
     return TRUE;
@@ -2378,29 +2710,181 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
   got = fptr = srel = pltoff = NULL;
 
   relend = relocs + sec->reloc_count;
+
+  /* We scan relocations first to create dynamic relocation arrays.  We
+     modified get_dyn_sym_info to allow fast insertion and support fast
+     lookup in the next loop.  */
+  for (rel = relocs; rel < relend; ++rel)
+    {
+      r_symndx = ELFNN_R_SYM (rel->r_info);
+      if (r_symndx >= symtab_hdr->sh_info)
+	{
+	  long indx = r_symndx - symtab_hdr->sh_info;
+	  h = elf_sym_hashes (abfd)[indx];
+	  while (h->root.type == bfd_link_hash_indirect
+		 || h->root.type == bfd_link_hash_warning)
+	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+	}
+      else
+	h = NULL;
+
+      /* We can only get preliminary data on whether a symbol is
+	 locally or externally defined, as not all of the input files
+	 have yet been processed.  Do something with what we know, as
+	 this may help reduce memory usage and processing time later.  */
+      maybe_dynamic = (h && ((!info->executable
+			      && (!info->symbolic
+				  || info->unresolved_syms_in_shared_libs == RM_IGNORE))
+			     || !h->def_regular
+			     || h->root.type == bfd_link_hash_defweak));
+
+      need_entry = 0;
+      switch (ELFNN_R_TYPE (rel->r_info))
+	{
+	case R_IA64_TPREL64MSB:
+	case R_IA64_TPREL64LSB:
+	  if (info->shared || maybe_dynamic)
+	    need_entry = NEED_DYNREL;
+	  break;
+
+	case R_IA64_LTOFF_TPREL22:
+	  need_entry = NEED_TPREL;
+	  if (info->shared)
+	    info->flags |= DF_STATIC_TLS;
+	  break;
+
+	case R_IA64_DTPREL32MSB:
+	case R_IA64_DTPREL32LSB:
+	case R_IA64_DTPREL64MSB:
+	case R_IA64_DTPREL64LSB:
+	  if (info->shared || maybe_dynamic)
+	    need_entry = NEED_DYNREL;
+	  break;
+
+	case R_IA64_LTOFF_DTPREL22:
+	  need_entry = NEED_DTPREL;
+	  break;
+
+	case R_IA64_DTPMOD64MSB:
+	case R_IA64_DTPMOD64LSB:
+	  if (info->shared || maybe_dynamic)
+	    need_entry = NEED_DYNREL;
+	  break;
+
+	case R_IA64_LTOFF_DTPMOD22:
+	  need_entry = NEED_DTPMOD;
+	  break;
+
+	case R_IA64_LTOFF_FPTR22:
+	case R_IA64_LTOFF_FPTR64I:
+	case R_IA64_LTOFF_FPTR32MSB:
+	case R_IA64_LTOFF_FPTR32LSB:
+	case R_IA64_LTOFF_FPTR64MSB:
+	case R_IA64_LTOFF_FPTR64LSB:
+	  need_entry = NEED_FPTR | NEED_GOT | NEED_LTOFF_FPTR;
+	  break;
+
+	case R_IA64_FPTR64I:
+	case R_IA64_FPTR32MSB:
+	case R_IA64_FPTR32LSB:
+	case R_IA64_FPTR64MSB:
+	case R_IA64_FPTR64LSB:
+	  if (info->shared || h)
+	    need_entry = NEED_FPTR | NEED_DYNREL;
+	  else
+	    need_entry = NEED_FPTR;
+	  break;
+
+	case R_IA64_LTOFF22:
+	case R_IA64_LTOFF64I:
+	  need_entry = NEED_GOT;
+	  break;
+
+	case R_IA64_LTOFF22X:
+	  need_entry = NEED_GOTX;
+	  break;
+
+	case R_IA64_PLTOFF22:
+	case R_IA64_PLTOFF64I:
+	case R_IA64_PLTOFF64MSB:
+	case R_IA64_PLTOFF64LSB:
+	  need_entry = NEED_PLTOFF;
+	  if (h)
+	    {
+	      if (maybe_dynamic)
+		need_entry |= NEED_MIN_PLT;
+	    }
+	  else
+	    {
+	      (*info->callbacks->warning)
+		(info, _("@pltoff reloc against local symbol"), 0,
+		 abfd, 0, (bfd_vma) 0);
+	    }
+	  break;
+
+	case R_IA64_PCREL21B:
+        case R_IA64_PCREL60B:
+	  /* Depending on where this symbol is defined, we may or may not
+	     need a full plt entry.  Only skip if we know we'll not need
+	     the entry -- static or symbolic, and the symbol definition
+	     has already been seen.  */
+	  if (maybe_dynamic && rel->r_addend == 0)
+	    need_entry = NEED_FULL_PLT;
+	  break;
+
+	case R_IA64_IMM14:
+	case R_IA64_IMM22:
+	case R_IA64_IMM64:
+	case R_IA64_DIR32MSB:
+	case R_IA64_DIR32LSB:
+	case R_IA64_DIR64MSB:
+	case R_IA64_DIR64LSB:
+	  /* Shared objects will always need at least a REL relocation.  */
+	  if (info->shared || maybe_dynamic)
+	    need_entry = NEED_DYNREL;
+	  break;
+
+	case R_IA64_IPLTMSB:
+	case R_IA64_IPLTLSB:
+	  /* Shared objects will always need at least a REL relocation.  */
+	  if (info->shared || maybe_dynamic)
+	    need_entry = NEED_DYNREL;
+	  break;
+
+	case R_IA64_PCREL22:
+	case R_IA64_PCREL64I:
+	case R_IA64_PCREL32MSB:
+	case R_IA64_PCREL32LSB:
+	case R_IA64_PCREL64MSB:
+	case R_IA64_PCREL64LSB:
+	  if (maybe_dynamic)
+	    need_entry = NEED_DYNREL;
+	  break;
+	}
+
+      if (!need_entry)
+	continue;
+
+      if ((need_entry & NEED_FPTR) != 0
+	  && rel->r_addend)
+	{
+	  (*info->callbacks->warning)
+	    (info, _("non-zero addend in @fptr reloc"), 0,
+	     abfd, 0, (bfd_vma) 0);
+	}
+
+      if (get_dyn_sym_info (ia64_info, h, abfd, rel, TRUE) == NULL)
+	return FALSE;
+    }
+
+  /* Now, we only do lookup without insertion, which is very fast
+     with the modified get_dyn_sym_info.  */ 
   for (rel = relocs; rel < relend; ++rel)
     {
-      enum {
-	NEED_GOT = 1,
-	NEED_GOTX = 2,
-	NEED_FPTR = 4,
-	NEED_PLTOFF = 8,
-	NEED_MIN_PLT = 16,
-	NEED_FULL_PLT = 32,
-	NEED_DYNREL = 64,
-	NEED_LTOFF_FPTR = 128,
-	NEED_TPREL = 256,
-	NEED_DTPMOD = 512,
-	NEED_DTPREL = 1024
-      };
-
-      struct elf_link_hash_entry *h = NULL;
-      unsigned long r_symndx = ELFNN_R_SYM (rel->r_info);
       struct elfNN_ia64_dyn_sym_info *dyn_i;
-      int need_entry;
-      bfd_boolean maybe_dynamic;
       int dynrel_type = R_IA64_NONE;
 
+      r_symndx = ELFNN_R_SYM (rel->r_info);
       if (r_symndx >= symtab_hdr->sh_info)
 	{
 	  /* We're dealing with a global symbol -- find its hash entry
@@ -2413,18 +2897,18 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
 
 	  h->ref_regular = 1;
 	}
+      else
+	h = NULL;
 
       /* We can only get preliminary data on whether a symbol is
 	 locally or externally defined, as not all of the input files
 	 have yet been processed.  Do something with what we know, as
 	 this may help reduce memory usage and processing time later.  */
-      maybe_dynamic = FALSE;
-      if (h && ((!info->executable
-		 && (!info->symbolic
-		     || info->unresolved_syms_in_shared_libs == RM_IGNORE))
-		|| !h->def_regular
-		|| h->root.type == bfd_link_hash_defweak))
-	maybe_dynamic = TRUE;
+      maybe_dynamic = (h && ((!info->executable
+			      && (!info->symbolic
+				  || info->unresolved_syms_in_shared_libs == RM_IGNORE))
+			     || !h->def_regular
+			     || h->root.type == bfd_link_hash_defweak));
 
       need_entry = 0;
       switch (ELFNN_R_TYPE (rel->r_info))
@@ -2508,12 +2992,6 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
 	      if (maybe_dynamic)
 		need_entry |= NEED_MIN_PLT;
 	    }
-	  else
-	    {
-	      (*info->callbacks->warning)
-		(info, _("@pltoff reloc against local symbol"), 0,
-		 abfd, 0, (bfd_vma) 0);
-	    }
 	  break;
 
 	case R_IA64_PCREL21B:
@@ -2562,15 +3040,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
       if (!need_entry)
 	continue;
 
-      if ((need_entry & NEED_FPTR) != 0
-	  && rel->r_addend)
-	{
-	  (*info->callbacks->warning)
-	    (info, _("non-zero addend in @fptr reloc"), 0,
-	     abfd, 0, (bfd_vma) 0);
-	}
-
-      dyn_i = get_dyn_sym_info (ia64_info, h, abfd, rel, TRUE);
+      dyn_i = get_dyn_sym_info (ia64_info, h, abfd, rel, FALSE);
 
       /* Record whether or not this is a local symbol.  */
       dyn_i->h = h;
@@ -4145,8 +4615,11 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
 	      if (loc_h && ! loc_h->sec_merge_done)
 		{
 		  struct elfNN_ia64_dyn_sym_info *dynent;
+		  unsigned int count;
 
-		  for (dynent = loc_h->info; dynent; dynent = dynent->next)
+		  for (count = loc_h->count, dynent = loc_h->info;
+		       count != 0;
+		       count--, dynent++)
 		    {
 		      msec = sym_sec;
 		      dynent->addend =
@@ -4161,6 +4634,10 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
 					- sym_sec->output_section->vma
 					- sym_sec->output_offset;
 		    }
+		  
+		  qsort (loc_h->info, loc_h->count,
+			 sizeof (*loc_h->info), addend_compare);
+
 		  loc_h->sec_merge_done = 1;
 		}
 	    }
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 6f6b4a2e6c7..4e27a53fda8 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -34,6 +34,7 @@
 #include "elf-bfd.h"
 #include "elfxx-mips.h"
 #include "elf/mips.h"
+#include "elf-vxworks.h"
 
 /* Get the ECOFF swapping routines.  */
 #include "coff/sym.h"
@@ -43,8 +44,39 @@
 
 #include "hashtab.h"
 
-/* This structure is used to hold .got entries while estimating got
-   sizes.  */
+/* This structure is used to hold information about one GOT entry.
+   There are three types of entry:
+
+      (1) absolute addresses
+	    (abfd == NULL)
+      (2) SYMBOL + OFFSET addresses, where SYMBOL is local to an input bfd
+	    (abfd != NULL, symndx >= 0)
+      (3) global and forced-local symbols
+	    (abfd != NULL, symndx == -1)
+
+   Type (3) entries are treated differently for different types of GOT.
+   In the "master" GOT -- i.e.  the one that describes every GOT
+   reference needed in the link -- the mips_got_entry is keyed on both
+   the symbol and the input bfd that references it.  If it turns out
+   that we need multiple GOTs, we can then use this information to
+   create separate GOTs for each input bfd.
+
+   However, we want each of these separate GOTs to have at most one
+   entry for a given symbol, so their type (3) entries are keyed only
+   on the symbol.  The input bfd given by the "abfd" field is somewhat
+   arbitrary in this case.
+
+   This means that when there are multiple GOTs, each GOT has a unique
+   mips_got_entry for every symbol within it.  We can therefore use the
+   mips_got_entry fields (tls_type and gotidx) to track the symbol's
+   GOT index.
+
+   However, if it turns out that we need only a single GOT, we continue
+   to use the master GOT to describe it.  There may therefore be several
+   mips_got_entries for the same symbol, each with a different input bfd.
+   We want to make sure that each symbol gets a unique GOT entry, so when
+   there's a single GOT, we use the symbol's hash entry, not the
+   mips_got_entry fields, to track a symbol's GOT index.  */
 struct mips_got_entry
 {
   /* The input bfd in which the symbol is defined.  */
@@ -246,6 +278,12 @@ struct mips_elf_link_hash_entry
      the initial global GOT entry to a local GOT entry.  */
   bfd_boolean forced_local;
 
+  /* Are we referenced by some kind of relocation?  */
+  bfd_boolean is_relocation_target;
+
+  /* Are we referenced by branch relocations?  */
+  bfd_boolean is_branch_target;
+
 #define GOT_NORMAL	0
 #define GOT_TLS_GD	1
 #define GOT_TLS_LDM	2
@@ -283,6 +321,20 @@ struct mips_elf_link_hash_table
   bfd_vma rld_value;
   /* This is set if we see any mips16 stub sections.  */
   bfd_boolean mips16_stubs_seen;
+  /* True if we're generating code for VxWorks.  */
+  bfd_boolean is_vxworks;
+  /* Shortcuts to some dynamic sections, or NULL if they are not
+     being used.  */
+  asection *srelbss;
+  asection *sdynbss;
+  asection *srelplt;
+  asection *srelplt2;
+  asection *sgotplt;
+  asection *splt;
+  /* The size of the PLT header in bytes (VxWorks only).  */
+  bfd_vma plt_header_size;
+  /* The size of a PLT entry in bytes (VxWorks only).  */
+  bfd_vma plt_entry_size;
 };
 
 #define TLS_RELOC_P(r_type) \
@@ -433,8 +485,8 @@ typedef struct runtime_pdr {
 #define rpdNil ((pRPDR) 0)
 
 static struct mips_got_entry *mips_elf_create_local_got_entry
-  (bfd *, bfd *, struct mips_got_info *, asection *, bfd_vma, unsigned long,
-   struct mips_elf_link_hash_entry *, int);
+  (bfd *, struct bfd_link_info *, bfd *, struct mips_got_info *, asection *,
+   asection *, bfd_vma, unsigned long, struct mips_elf_link_hash_entry *, int);
 static bfd_boolean mips_elf_sort_hash_table_f
   (struct mips_elf_link_hash_entry *, void *);
 static bfd_vma mips_elf_high
@@ -490,6 +542,10 @@ static bfd *reldyn_sorting_bfd;
 #define MIPS_ELF_REL_SIZE(abfd) \
   (get_elf_backend_data (abfd)->s->sizeof_rel)
 
+/* The size of an external RELA relocation.  */
+#define MIPS_ELF_RELA_SIZE(abfd) \
+  (get_elf_backend_data (abfd)->s->sizeof_rela)
+
 /* The size of an external dynamic table entry.  */
 #define MIPS_ELF_DYN_SIZE(abfd) \
   (get_elf_backend_data (abfd)->s->sizeof_dyn)
@@ -540,20 +596,26 @@ static bfd *reldyn_sorting_bfd;
        == (ABI_64_P (abfd) ? sizeof (Elf64_External_Rela)		\
 	   : sizeof (Elf32_External_Rela))))
 
+/* The name of the dynamic relocation section.  */
+#define MIPS_ELF_REL_DYN_NAME(INFO) \
+  (mips_elf_hash_table (INFO)->is_vxworks ? ".rela.dyn" : ".rel.dyn")
+
 /* In case we're on a 32-bit machine, construct a 64-bit "-1" value
    from smaller values.  Start with zero, widen, *then* decrement.  */
 #define MINUS_ONE	(((bfd_vma)0) - 1)
 #define MINUS_TWO	(((bfd_vma)0) - 2)
 
 /* The number of local .got entries we reserve.  */
-#define MIPS_RESERVED_GOTNO (2)
+#define MIPS_RESERVED_GOTNO(INFO) \
+  (mips_elf_hash_table (INFO)->is_vxworks ? 3 : 2)
 
 /* The offset of $gp from the beginning of the .got section.  */
-#define ELF_MIPS_GP_OFFSET(abfd) (0x7ff0)
+#define ELF_MIPS_GP_OFFSET(INFO) \
+  (mips_elf_hash_table (INFO)->is_vxworks ? 0x0 : 0x7ff0)
 
 /* The maximum size of the GOT for it to be addressable using 16-bit
    offsets from $gp.  */
-#define MIPS_ELF_GOT_MAX_SIZE(abfd) (ELF_MIPS_GP_OFFSET(abfd) + 0x7fff)
+#define MIPS_ELF_GOT_MAX_SIZE(INFO) (ELF_MIPS_GP_OFFSET (INFO) + 0x7fff)
 
 /* Instructions which appear in a stub.  */
 #define STUB_LW(abfd)						\
@@ -636,6 +698,44 @@ static bfd *reldyn_sorting_bfd;
 #define CALL_STUB ".mips16.call."
 #define CALL_FP_STUB ".mips16.call.fp."
 
+/* The format of the first PLT entry in a VxWorks executable.  */
+static const bfd_vma mips_vxworks_exec_plt0_entry[] = {
+  0x3c190000,	/* lui t9, %hi(_GLOBAL_OFFSET_TABLE_)		*/
+  0x27390000,	/* addiu t9, t9, %lo(_GLOBAL_OFFSET_TABLE_)	*/
+  0x8f390008,	/* lw t9, 8(t9)					*/
+  0x00000000,	/* nop						*/
+  0x03200008,	/* jr t9					*/
+  0x00000000	/* nop						*/
+};
+
+/* The format of subsequent PLT entries.  */
+static const bfd_vma mips_vxworks_exec_plt_entry[] = {
+  0x10000000,	/* b .PLT_resolver			*/
+  0x24180000,	/* li t8, <pltindex>			*/
+  0x3c190000,	/* lui t9, %hi(<.got.plt slot>)		*/
+  0x27390000,	/* addiu t9, t9, %lo(<.got.plt slot>)	*/
+  0x8f390000,	/* lw t9, 0(t9)				*/
+  0x00000000,	/* nop					*/
+  0x03200008,	/* jr t9				*/
+  0x00000000	/* nop					*/
+};
+
+/* The format of the first PLT entry in a VxWorks shared object.  */
+static const bfd_vma mips_vxworks_shared_plt0_entry[] = {
+  0x8f990008,	/* lw t9, 8(gp)		*/
+  0x00000000,	/* nop			*/
+  0x03200008,	/* jr t9		*/
+  0x00000000,	/* nop			*/
+  0x00000000,	/* nop			*/
+  0x00000000	/* nop			*/
+};
+
+/* The format of subsequent PLT entries.  */
+static const bfd_vma mips_vxworks_shared_plt_entry[] = {
+  0x10000000,	/* b .PLT_resolver	*/
+  0x24180000	/* li t8, <pltindex>	*/
+};
+
 /* Look up an entry in a MIPS ELF linker hash table.  */
 
 #define mips_elf_link_hash_lookup(table, string, create, copy, follow)	\
@@ -715,6 +815,8 @@ mips_elf_link_hash_newfunc (struct bfd_hash_entry *entry,
       ret->call_stub = NULL;
       ret->call_fp_stub = NULL;
       ret->forced_local = FALSE;
+      ret->is_branch_target = FALSE;
+      ret->is_relocation_target = FALSE;
       ret->tls_type = GOT_NORMAL;
     }
 
@@ -1896,14 +1998,19 @@ mips_elf_multi_got_entry_eq (const void *entry1, const void *entry2)
 	: e1->d.h == e2->d.h);
 }
 
-/* Returns the dynamic relocation section for DYNOBJ.  */
+/* Return the dynamic relocation section.  If it doesn't exist, try to
+   create a new it if CREATE_P, otherwise return NULL.  Also return NULL
+   if creation fails.  */
 
 static asection *
-mips_elf_rel_dyn_section (bfd *dynobj, bfd_boolean create_p)
+mips_elf_rel_dyn_section (struct bfd_link_info *info, bfd_boolean create_p)
 {
-  static const char dname[] = ".rel.dyn";
+  const char *dname;
   asection *sreloc;
+  bfd *dynobj;
 
+  dname = MIPS_ELF_REL_DYN_NAME (info);
+  dynobj = elf_hash_table (info)->dynobj;
   sreloc = bfd_get_section_by_name (dynobj, dname);
   if (sreloc == NULL && create_p)
     {
@@ -2121,7 +2228,7 @@ mips_elf_initialize_tls_slots (bfd *abfd, bfd_vma got_offset,
 	      || h->root.root.type == bfd_link_hash_undefweak);
 
   /* Emit necessary relocations.  */
-  sreloc = mips_elf_rel_dyn_section (dynobj, FALSE);
+  sreloc = mips_elf_rel_dyn_section (info, FALSE);
 
   /* General Dynamic.  */
   if (*tls_type_p & GOT_TLS_GD)
@@ -2240,14 +2347,46 @@ mips_tls_got_index (bfd *abfd, bfd_vma got_index, unsigned char *tls_type,
   return got_index;
 }
 
-/* Returns the GOT offset at which the indicated address can be found.
-   If there is not yet a GOT entry for this value, create one.  If
-   R_SYMNDX refers to a TLS symbol, create a TLS GOT entry instead.
-   Returns -1 if no satisfactory GOT offset can be found.  */
+/* Return the offset from _GLOBAL_OFFSET_TABLE_ of the .got.plt entry
+   for global symbol H.  .got.plt comes before the GOT, so the offset
+   will be negative.  */
+
+static bfd_vma
+mips_elf_gotplt_index (struct bfd_link_info *info,
+		       struct elf_link_hash_entry *h)
+{
+  bfd_vma plt_index, got_address, got_value;
+  struct mips_elf_link_hash_table *htab;
+
+  htab = mips_elf_hash_table (info);
+  BFD_ASSERT (h->plt.offset != (bfd_vma) -1);
+
+  /* Calculate the index of the symbol's PLT entry.  */
+  plt_index = (h->plt.offset - htab->plt_header_size) / htab->plt_entry_size;
+
+  /* Calculate the address of the associated .got.plt entry.  */
+  got_address = (htab->sgotplt->output_section->vma
+		 + htab->sgotplt->output_offset
+		 + plt_index * 4);
+
+  /* Calculate the value of _GLOBAL_OFFSET_TABLE_.  */
+  got_value = (htab->root.hgot->root.u.def.section->output_section->vma
+	       + htab->root.hgot->root.u.def.section->output_offset
+	       + htab->root.hgot->root.u.def.value);
+
+  return got_address - got_value;
+}
+
+/* Return the GOT offset for address VALUE, which was derived from
+   a symbol belonging to INPUT_SECTION.   If there is not yet a GOT
+   entry for this value, create one.  If R_SYMNDX refers to a TLS symbol,
+   create a TLS GOT entry instead.  Return -1 if no satisfactory GOT
+   offset can be found.  */
 
 static bfd_vma
 mips_elf_local_got_index (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
-			  bfd_vma value, unsigned long r_symndx,
+			  asection *input_section, bfd_vma value,
+			  unsigned long r_symndx,
 			  struct mips_elf_link_hash_entry *h, int r_type)
 {
   asection *sgot;
@@ -2256,14 +2395,23 @@ mips_elf_local_got_index (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
 
   g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
 
-  entry = mips_elf_create_local_got_entry (abfd, ibfd, g, sgot, value,
+  entry = mips_elf_create_local_got_entry (abfd, info, ibfd, g, sgot,
+					   input_section, value,
 					   r_symndx, h, r_type);
   if (!entry)
     return MINUS_ONE;
 
   if (TLS_RELOC_P (r_type))
-    return mips_tls_got_index (abfd, entry->gotidx, &entry->tls_type, r_type,
-			       info, h, value);
+    {
+      if (entry->symndx == -1 && g->next == NULL)
+	/* A type (3) entry in the single-GOT case.  We use the symbol's
+	   hash table entry to track the index.  */
+	return mips_tls_got_index (abfd, h->tls_got_offset, &h->tls_type,
+				   r_type, info, h, value);
+      else
+	return mips_tls_got_index (abfd, entry->gotidx, &entry->tls_type,
+				   r_type, info, h, value);
+    }
   else
     return entry->gotidx;
 }
@@ -2350,26 +2498,27 @@ mips_elf_global_got_index (bfd *abfd, bfd *ibfd, struct elf_link_hash_entry *h,
   return index;
 }
 
-/* Find a GOT entry that is within 32KB of the VALUE.  These entries
-   are supposed to be placed at small offsets in the GOT, i.e.,
-   within 32KB of GP.  Return the index into the GOT for this page,
-   and store the offset from this entry to the desired address in
-   OFFSETP, if it is non-NULL.  */
+/* Find a GOT page entry that points to within 32KB of VALUE, which was
+   calculated from a symbol belonging to INPUT_SECTION.  These entries
+   are supposed to be placed at small offsets in the GOT, i.e., within
+   32KB of GP.  Return the index of the GOT entry, or -1 if no entry
+   could be created.  If OFFSETP is nonnull, use it to return the
+   offset of the GOT entry from VALUE.  */
 
 static bfd_vma
 mips_elf_got_page (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
-		   bfd_vma value, bfd_vma *offsetp)
+		   asection *input_section, bfd_vma value, bfd_vma *offsetp)
 {
   asection *sgot;
   struct mips_got_info *g;
-  bfd_vma index;
+  bfd_vma page, index;
   struct mips_got_entry *entry;
 
   g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
 
-  entry = mips_elf_create_local_got_entry (abfd, ibfd, g, sgot,
-					   (value + 0x8000)
-					   & (~(bfd_vma)0xffff), 0,
+  page = (value + 0x8000) & ~(bfd_vma) 0xffff;
+  entry = mips_elf_create_local_got_entry (abfd, info, ibfd, g, sgot,
+					   input_section, page, 0,
 					   NULL, R_MIPS_GOT_PAGE);
 
   if (!entry)
@@ -2383,30 +2532,32 @@ mips_elf_got_page (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
   return index;
 }
 
-/* Find a GOT entry whose higher-order 16 bits are the same as those
-   for value.  Return the index into the GOT for this entry.  */
+/* Find a local GOT entry for an R_MIPS_GOT16 relocation against VALUE,
+   which was calculated from a symbol belonging to INPUT_SECTION.
+   EXTERNAL is true if the relocation was against a global symbol
+   that has been forced local.  */
 
 static bfd_vma
 mips_elf_got16_entry (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
-		      bfd_vma value, bfd_boolean external)
+		      asection *input_section, bfd_vma value,
+		      bfd_boolean external)
 {
   asection *sgot;
   struct mips_got_info *g;
   struct mips_got_entry *entry;
 
+  /* GOT16 relocations against local symbols are followed by a LO16
+     relocation; those against global symbols are not.  Thus if the
+     symbol was originally local, the GOT16 relocation should load the
+     equivalent of %hi(VALUE), otherwise it should load VALUE itself.  */
   if (! external)
-    {
-      /* Although the ABI says that it is "the high-order 16 bits" that we
-	 want, it is really the %high value.  The complete value is
-	 calculated with a `addiu' of a LO16 relocation, just as with a
-	 HI16/LO16 pair.  */
-      value = mips_elf_high (value) << 16;
-    }
+    value = mips_elf_high (value) << 16;
 
   g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
 
-  entry = mips_elf_create_local_got_entry (abfd, ibfd, g, sgot, value, 0, NULL,
-					   R_MIPS_GOT16);
+  entry = mips_elf_create_local_got_entry (abfd, info, ibfd, g, sgot,
+					   input_section, value, 0,
+					   NULL, R_MIPS_GOT16);
   if (entry)
     return entry->gotidx;
   else
@@ -2431,20 +2582,24 @@ mips_elf_got_offset_from_index (bfd *dynobj, bfd *output_bfd,
   return sgot->output_section->vma + sgot->output_offset + index - gp;
 }
 
-/* Create a local GOT entry for VALUE.  Return the index of the entry,
-   or -1 if it could not be created.  If R_SYMNDX refers to a TLS symbol,
-   create a TLS entry instead.  */
+/* Create and return a local GOT entry for VALUE, which was calculated
+   from a symbol belonging to INPUT_SECTON.  Return NULL if it could not
+   be created.  If R_SYMNDX refers to a TLS symbol, create a TLS entry
+   instead.  */
 
 static struct mips_got_entry *
-mips_elf_create_local_got_entry (bfd *abfd, bfd *ibfd,
-				 struct mips_got_info *gg,
-				 asection *sgot, bfd_vma value,
-				 unsigned long r_symndx,
+mips_elf_create_local_got_entry (bfd *abfd, struct bfd_link_info *info,
+				 bfd *ibfd, struct mips_got_info *gg,
+				 asection *sgot, asection *input_section,
+				 bfd_vma value, unsigned long r_symndx,
 				 struct mips_elf_link_hash_entry *h,
 				 int r_type)
 {
   struct mips_got_entry entry, **loc;
   struct mips_got_info *g;
+  struct mips_elf_link_hash_table *htab;
+
+  htab = mips_elf_hash_table (info);
 
   entry.abfd = NULL;
   entry.symndx = -1;
@@ -2517,6 +2672,33 @@ mips_elf_create_local_got_entry (bfd *abfd, bfd *ibfd,
   MIPS_ELF_PUT_WORD (abfd, value,
 		     (sgot->contents + entry.gotidx));
 
+  /* These GOT entries need a dynamic relocation on VxWorks.  Because
+     the offset between segments is not fixed, the relocation must be
+     against a symbol in the same segment as the original symbol.
+     The easiest way to do this is to take INPUT_SECTION's output
+     section and emit a relocation against its section symbol.  */
+  if (htab->is_vxworks)
+    {
+      Elf_Internal_Rela outrel;
+      asection *s, *output_section;
+      bfd_byte *loc;
+      bfd_vma got_address;
+      int dynindx;
+
+      s = mips_elf_rel_dyn_section (info, FALSE);
+      output_section = input_section->output_section;
+      dynindx = elf_section_data (output_section)->dynindx;
+      got_address = (sgot->output_section->vma
+		     + sgot->output_offset
+		     + entry.gotidx);
+
+      loc = s->contents + (s->reloc_count++ * sizeof (Elf32_External_Rela));
+      outrel.r_offset = got_address;
+      outrel.r_info = ELF32_R_INFO (dynindx, R_MIPS_32);
+      outrel.r_addend = value - output_section->vma;
+      bfd_elf32_swap_reloca_out (abfd, &outrel, loc);
+    }
+
   return *loc;
 }
 
@@ -2892,7 +3074,7 @@ mips_elf_merge_gots (void **bfd2got_, void *p)
     {
       unsigned int primary_total = lcount + tcount + arg->global_count;
       if (primary_total * MIPS_ELF_GOT_SIZE (bfd2got->bfd)
-	   >= MIPS_ELF_GOT_MAX_SIZE (bfd2got->bfd))
+	  >= MIPS_ELF_GOT_MAX_SIZE (arg->info))
 	too_many_for_tls = TRUE;
     }
 
@@ -2975,55 +3157,54 @@ mips_elf_merge_gots (void **bfd2got_, void *p)
   return 1;
 }
 
-/* Set the TLS GOT index for the GOT entry in ENTRYP.  */
+/* Set the TLS GOT index for the GOT entry in ENTRYP.  ENTRYP's NEXT field
+   is null iff there is just a single GOT.  */
 
 static int
 mips_elf_initialize_tls_index (void **entryp, void *p)
 {
   struct mips_got_entry *entry = (struct mips_got_entry *)*entryp;
   struct mips_got_info *g = p;
+  bfd_vma next_index;
 
   /* We're only interested in TLS symbols.  */
   if (entry->tls_type == 0)
     return 1;
 
-  if (entry->symndx == -1)
+  next_index = MIPS_ELF_GOT_SIZE (entry->abfd) * (long) g->tls_assigned_gotno;
+
+  if (entry->symndx == -1 && g->next == NULL)
     {
-      /* There may be multiple mips_got_entry structs for a global variable
-	 if there is just one GOT.  Just do this once.  */
-      if (g->next == NULL)
+      /* A type (3) got entry in the single-GOT case.  We use the symbol's
+	 hash table entry to track its index.  */
+      if (entry->d.h->tls_type & GOT_TLS_OFFSET_DONE)
+	return 1;
+      entry->d.h->tls_type |= GOT_TLS_OFFSET_DONE;
+      entry->d.h->tls_got_offset = next_index;
+    }
+  else
+    {
+      if (entry->tls_type & GOT_TLS_LDM)
 	{
-	  if (entry->d.h->tls_type & GOT_TLS_OFFSET_DONE)
+	  /* There are separate mips_got_entry objects for each input bfd
+	     that requires an LDM entry.  Make sure that all LDM entries in
+	     a GOT resolve to the same index.  */
+	  if (g->tls_ldm_offset != MINUS_TWO && g->tls_ldm_offset != MINUS_ONE)
 	    {
-	      entry->gotidx = entry->d.h->tls_got_offset;
+	      entry->gotidx = g->tls_ldm_offset;
 	      return 1;
 	    }
-	  entry->d.h->tls_type |= GOT_TLS_OFFSET_DONE;
-	}
-    }
-  else if (entry->tls_type & GOT_TLS_LDM)
-    {
-      /* Similarly, there may be multiple structs for the LDM entry.  */
-      if (g->tls_ldm_offset != MINUS_TWO && g->tls_ldm_offset != MINUS_ONE)
-	{
-	  entry->gotidx = g->tls_ldm_offset;
-	  return 1;
+	  g->tls_ldm_offset = next_index;
 	}
+      entry->gotidx = next_index;
     }
 
-  /* Initialize the GOT offset.  */
-  entry->gotidx = MIPS_ELF_GOT_SIZE (entry->abfd) * (long) g->tls_assigned_gotno;
-  if (g->next == NULL && entry->symndx == -1)
-    entry->d.h->tls_got_offset = entry->gotidx;
-
+  /* Account for the entries we've just allocated.  */
   if (entry->tls_type & (GOT_TLS_GD | GOT_TLS_LDM))
     g->tls_assigned_gotno += 2;
   if (entry->tls_type & GOT_TLS_IE)
     g->tls_assigned_gotno += 1;
 
-  if (entry->tls_type & GOT_TLS_LDM)
-    g->tls_ldm_offset = entry->gotidx;
-
   return 1;
 }
 
@@ -3207,9 +3388,9 @@ mips_elf_multi_got (bfd *abfd, struct bfd_link_info *info,
   /* Taking out PAGES entries is a worst-case estimate.  We could
      compute the maximum number of pages that each separate input bfd
      uses, but it's probably not worth it.  */
-  got_per_bfd_arg.max_count = ((MIPS_ELF_GOT_MAX_SIZE (abfd)
+  got_per_bfd_arg.max_count = ((MIPS_ELF_GOT_MAX_SIZE (info)
 				/ MIPS_ELF_GOT_SIZE (abfd))
-			       - MIPS_RESERVED_GOTNO - pages);
+			       - MIPS_RESERVED_GOTNO (info) - pages);
   /* The number of globals that will be included in the primary GOT.
      See the calls to mips_elf_set_global_got_offset below for more
      information.  */
@@ -3344,21 +3525,24 @@ mips_elf_multi_got (bfd *abfd, struct bfd_link_info *info,
     {
       struct mips_got_info *gn;
 
-      assign += MIPS_RESERVED_GOTNO;
+      assign += MIPS_RESERVED_GOTNO (info);
       g->assigned_gotno = assign;
       g->local_gotno += assign + pages;
       assign = g->local_gotno + g->global_gotno + g->tls_gotno;
 
+      /* Take g out of the direct list, and push it onto the reversed
+	 list that gg points to.  g->next is guaranteed to be nonnull after
+	 this operation, as required by mips_elf_initialize_tls_index. */
+      gn = g->next;
+      g->next = gg->next;
+      gg->next = g;
+
       /* Set up any TLS entries.  We always place the TLS entries after
 	 all non-TLS entries.  */
       g->tls_assigned_gotno = g->local_gotno + g->global_gotno;
       htab_traverse (g->got_entries, mips_elf_initialize_tls_index, g);
 
-      /* Take g out of the direct list, and push it onto the reversed
-	 list that gg points to.  */
-      gn = g->next;
-      g->next = gg->next;
-      gg->next = g;
+      /* Move onto the next GOT.  It will be a secondary GOT if nonull.  */
       g = gn;
 
       /* Mark global symbols in every non-primary GOT as ineligible for
@@ -3540,6 +3724,9 @@ mips_elf_create_got_section (bfd *abfd, struct bfd_link_info *info,
   struct bfd_link_hash_entry *bh;
   struct mips_got_info *g;
   bfd_size_type amt;
+  struct mips_elf_link_hash_table *htab;
+
+  htab = mips_elf_hash_table (info);
 
   /* This function may be called more than once.  */
   s = mips_elf_got_section (abfd, TRUE);
@@ -3589,8 +3776,8 @@ mips_elf_create_got_section (bfd *abfd, struct bfd_link_info *info,
   g->global_gotsym = NULL;
   g->global_gotno = 0;
   g->tls_gotno = 0;
-  g->local_gotno = MIPS_RESERVED_GOTNO;
-  g->assigned_gotno = MIPS_RESERVED_GOTNO;
+  g->local_gotno = MIPS_RESERVED_GOTNO (info);
+  g->assigned_gotno = MIPS_RESERVED_GOTNO (info);
   g->bfd2got = NULL;
   g->next = NULL;
   g->tls_ldm_offset = MINUS_ONE;
@@ -3602,9 +3789,33 @@ mips_elf_create_got_section (bfd *abfd, struct bfd_link_info *info,
   mips_elf_section_data (s)->elf.this_hdr.sh_flags
     |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
 
+  /* VxWorks also needs a .got.plt section.  */
+  if (htab->is_vxworks)
+    {
+      s = bfd_make_section_with_flags (abfd, ".got.plt",
+				       SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
+				       | SEC_IN_MEMORY | SEC_LINKER_CREATED);
+      if (s == NULL || !bfd_set_section_alignment (abfd, s, 4))
+	return FALSE;
+
+      htab->sgotplt = s;
+    }
   return TRUE;
 }
 
+/* Return true if H refers to the special VxWorks __GOTT_BASE__ or
+   __GOTT_INDEX__ symbols.  These symbols are only special for
+   shared objects; they are not used in executables.  */
+
+static bfd_boolean
+is_gott_symbol (struct bfd_link_info *info, struct elf_link_hash_entry *h)
+{
+  return (mips_elf_hash_table (info)->is_vxworks
+	  && info->shared
+	  && (strcmp (h->root.root.string, "__GOTT_BASE__") == 0
+	      || strcmp (h->root.root.string, "__GOTT_INDEX__") == 0));
+}
+
 /* Calculate the value produced by the RELOCATION (which comes from
    the INPUT_BFD).  The ADDEND is the addend to use for this
    RELOCATION; RELOCATION->R_ADDEND is ignored.
@@ -3667,6 +3878,11 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
   bfd_boolean overflowed_p;
   /* TRUE if this relocation refers to a MIPS16 function.  */
   bfd_boolean target_is_16_bit_code_p = FALSE;
+  struct mips_elf_link_hash_table *htab;
+  bfd *dynobj;
+
+  dynobj = elf_hash_table (info)->dynobj;
+  htab = mips_elf_hash_table (info);
 
   /* Parse the relocation.  */
   r_symndx = ELF_R_SYM (input_bfd, relocation->r_info);
@@ -3916,52 +4132,61 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
       /* Find the index into the GOT where this value is located.  */
       if (r_type == R_MIPS_TLS_LDM)
 	{
-	  g = mips_elf_local_got_index (abfd, input_bfd, info, 0, 0, NULL,
-					r_type);
+	  g = mips_elf_local_got_index (abfd, input_bfd, info,
+					sec, 0, 0, NULL, r_type);
 	  if (g == MINUS_ONE)
 	    return bfd_reloc_outofrange;
 	}
       else if (!local_p)
 	{
-	  /* GOT_PAGE may take a non-zero addend, that is ignored in a
-	     GOT_PAGE relocation that decays to GOT_DISP because the
-	     symbol turns out to be global.  The addend is then added
-	     as GOT_OFST.  */
-	  BFD_ASSERT (addend == 0 || r_type == R_MIPS_GOT_PAGE);
-	  g = mips_elf_global_got_index (elf_hash_table (info)->dynobj,
-					 input_bfd,
-					 (struct elf_link_hash_entry *) h,
-					 r_type, info);
-	  if (h->tls_type == GOT_NORMAL
-	      && (! elf_hash_table(info)->dynamic_sections_created
-		  || (info->shared
-		      && (info->symbolic || h->root.forced_local)
-		      && h->root.def_regular)))
+	  /* On VxWorks, CALL relocations should refer to the .got.plt
+	     entry, which is initialized to point at the PLT stub.  */
+	  if (htab->is_vxworks
+	      && (r_type == R_MIPS_CALL_HI16
+		  || r_type == R_MIPS_CALL_LO16
+		  || r_type == R_MIPS_CALL16))
+	    {
+	      BFD_ASSERT (addend == 0);
+	      BFD_ASSERT (h->root.needs_plt);
+	      g = mips_elf_gotplt_index (info, &h->root);
+	    }
+	  else
 	    {
-	      /* This is a static link or a -Bsymbolic link.  The
-		 symbol is defined locally, or was forced to be local.
-		 We must initialize this entry in the GOT.  */
-	      bfd *tmpbfd = elf_hash_table (info)->dynobj;
-	      asection *sgot = mips_elf_got_section (tmpbfd, FALSE);
-	      MIPS_ELF_PUT_WORD (tmpbfd, symbol, sgot->contents + g);
+	      /* GOT_PAGE may take a non-zero addend, that is ignored in a
+		 GOT_PAGE relocation that decays to GOT_DISP because the
+		 symbol turns out to be global.  The addend is then added
+		 as GOT_OFST.  */
+	      BFD_ASSERT (addend == 0 || r_type == R_MIPS_GOT_PAGE);
+	      g = mips_elf_global_got_index (dynobj, input_bfd,
+					     &h->root, r_type, info);
+	      if (h->tls_type == GOT_NORMAL
+		  && (! elf_hash_table(info)->dynamic_sections_created
+		      || (info->shared
+			  && (info->symbolic || h->root.forced_local)
+			  && h->root.def_regular)))
+		{
+		  /* This is a static link or a -Bsymbolic link.  The
+		     symbol is defined locally, or was forced to be local.
+		     We must initialize this entry in the GOT.  */
+		  asection *sgot = mips_elf_got_section (dynobj, FALSE);
+		  MIPS_ELF_PUT_WORD (dynobj, symbol, sgot->contents + g);
+		}
 	    }
 	}
-      else if (r_type == R_MIPS_GOT16 || r_type == R_MIPS_CALL16)
-	/* There's no need to create a local GOT entry here; the
-	   calculation for a local GOT16 entry does not involve G.  */
+      else if (!htab->is_vxworks
+	       && (r_type == R_MIPS_CALL16 || (r_type == R_MIPS_GOT16)))
+	/* The calculation below does not involve "g".  */
 	break;
       else
 	{
-	  g = mips_elf_local_got_index (abfd, input_bfd,
-					info, symbol + addend, r_symndx, h,
-					r_type);
+	  g = mips_elf_local_got_index (abfd, input_bfd, info, sec,
+					symbol + addend, r_symndx, h, r_type);
 	  if (g == MINUS_ONE)
 	    return bfd_reloc_outofrange;
 	}
 
       /* Convert GOT indices to actual offsets.  */
-      g = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
-					  abfd, input_bfd, g);
+      g = mips_elf_got_offset_from_index (dynobj, abfd, input_bfd, g);
       break;
 
     case R_MIPS_HI16:
@@ -3974,10 +4199,8 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
     case R_MIPS16_GPREL:
       gp0 = _bfd_get_gp_value (input_bfd);
       gp = _bfd_get_gp_value (abfd);
-      if (elf_hash_table (info)->dynobj)
-	gp += mips_elf_adjust_gp (abfd,
-				  mips_elf_got_info
-				  (elf_hash_table (info)->dynobj, NULL),
+      if (dynobj)
+	gp += mips_elf_adjust_gp (abfd, mips_elf_got_info (dynobj, NULL),
 				  input_bfd);
       break;
 
@@ -3988,6 +4211,27 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
   if (gnu_local_gp_p)
     symbol = gp;
 
+  /* Relocations against the VxWorks __GOTT_BASE__ and __GOTT_INDEX__
+     symbols are resolved by the loader.  Add them to .rela.dyn.  */
+  if (h != NULL && is_gott_symbol (info, &h->root))
+    {
+      Elf_Internal_Rela outrel;
+      bfd_byte *loc;
+      asection *s;
+
+      s = mips_elf_rel_dyn_section (info, FALSE);
+      loc = s->contents + s->reloc_count++ * sizeof (Elf32_External_Rela);
+
+      outrel.r_offset = (input_section->output_section->vma
+			 + input_section->output_offset
+			 + relocation->r_offset);
+      outrel.r_info = ELF32_R_INFO (h->root.dynindx, r_type);
+      outrel.r_addend = addend;
+      bfd_elf32_swap_reloca_out (abfd, &outrel, loc);
+      *valuep = 0;
+      return bfd_reloc_ok;
+    }
+
   /* Figure out what kind of relocation is being performed.  */
   switch (r_type)
     {
@@ -4003,7 +4247,8 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
     case R_MIPS_REL32:
     case R_MIPS_64:
       if ((info->shared
-	   || (elf_hash_table (info)->dynamic_sections_created
+	   || (!htab->is_vxworks
+	       && htab->root.dynamic_sections_created
 	       && h != NULL
 	       && h->root.def_dynamic
 	       && !h->root.def_regular))
@@ -4014,7 +4259,11 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
 	     against a symbol in a shared library, then we can't know
 	     where the symbol will end up.  So, we create a relocation
 	     record in the output, and leave the job up to the dynamic
-	     linker.  */
+	     linker.
+
+	     In VxWorks executables, references to external symbols
+	     are handled using copy relocs or PLT stubs, so there's
+	     no need to add a dynamic relocation here.  */
 	  value = addend;
 	  if (!mips_elf_create_dynamic_relocation (abfd,
 						   info,
@@ -4166,22 +4415,20 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
 
     case R_MIPS_GOT16:
     case R_MIPS_CALL16:
-      if (local_p)
+      /* VxWorks does not have separate local and global semantics for
+	 R_MIPS_GOT16; every relocation evaluates to "G".  */
+      if (!htab->is_vxworks && local_p)
 	{
 	  bfd_boolean forced;
 
-	  /* The special case is when the symbol is forced to be local.  We
-	     need the full address in the GOT since no R_MIPS_LO16 relocation
-	     follows.  */
 	  forced = ! mips_elf_local_relocation_p (input_bfd, relocation,
 						  local_sections, FALSE);
-	  value = mips_elf_got16_entry (abfd, input_bfd, info,
+	  value = mips_elf_got16_entry (abfd, input_bfd, info, sec,
 					symbol + addend, forced);
 	  if (value == MINUS_ONE)
 	    return bfd_reloc_outofrange;
 	  value
-	    = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
-					      abfd, input_bfd, value);
+	    = mips_elf_got_offset_from_index (dynobj, abfd, input_bfd, value);
 	  overflowed_p = mips_elf_overflow_p (value, 16);
 	  break;
 	}
@@ -4231,17 +4478,18 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
 	 0.  */
       if (! local_p)
 	goto got_disp;
-      value = mips_elf_got_page (abfd, input_bfd, info, symbol + addend, NULL);
+      value = mips_elf_got_page (abfd, input_bfd, info, sec,
+				 symbol + addend, NULL);
       if (value == MINUS_ONE)
 	return bfd_reloc_outofrange;
-      value = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
-					      abfd, input_bfd, value);
+      value = mips_elf_got_offset_from_index (dynobj, abfd, input_bfd, value);
       overflowed_p = mips_elf_overflow_p (value, 16);
       break;
 
     case R_MIPS_GOT_OFST:
       if (local_p)
-	mips_elf_got_page (abfd, input_bfd, info, symbol + addend, &value);
+	mips_elf_got_page (abfd, input_bfd, info, sec,
+			   symbol + addend, &value);
       else
 	value = addend;
       overflowed_p = mips_elf_overflow_p (value, 16);
@@ -4426,23 +4674,31 @@ mips_elf_stub_section_p (bfd *abfd ATTRIBUTE_UNUSED, asection *section)
 	  || strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0);
 }
 
-/* Add room for N relocations to the .rel.dyn section in ABFD.  */
+/* Add room for N relocations to the .rel(a).dyn section in ABFD.  */
 
 static void
-mips_elf_allocate_dynamic_relocations (bfd *abfd, unsigned int n)
+mips_elf_allocate_dynamic_relocations (bfd *abfd, struct bfd_link_info *info,
+				       unsigned int n)
 {
   asection *s;
+  struct mips_elf_link_hash_table *htab;
 
-  s = mips_elf_rel_dyn_section (abfd, FALSE);
+  htab = mips_elf_hash_table (info);
+  s = mips_elf_rel_dyn_section (info, FALSE);
   BFD_ASSERT (s != NULL);
 
-  if (s->size == 0)
+  if (htab->is_vxworks)
+    s->size += n * MIPS_ELF_RELA_SIZE (abfd);
+  else
     {
-      /* Make room for a null element.  */
-      s->size += MIPS_ELF_REL_SIZE (abfd);
-      ++s->reloc_count;
+      if (s->size == 0)
+	{
+	  /* Make room for a null element.  */
+	  s->size += MIPS_ELF_REL_SIZE (abfd);
+	  ++s->reloc_count;
+	}
+      s->size += n * MIPS_ELF_REL_SIZE (abfd);
     }
-  s->size += n * MIPS_ELF_REL_SIZE (abfd);
 }
 
 /* Create a rel.dyn relocation for the dynamic linker to resolve.  REL
@@ -4464,10 +4720,12 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd,
   int r_type;
   long indx;
   bfd_boolean defined_p;
+  struct mips_elf_link_hash_table *htab;
 
+  htab = mips_elf_hash_table (info);
   r_type = ELF_R_TYPE (output_bfd, rel->r_info);
   dynobj = elf_hash_table (info)->dynobj;
-  sreloc = mips_elf_rel_dyn_section (dynobj, FALSE);
+  sreloc = mips_elf_rel_dyn_section (info, FALSE);
   BFD_ASSERT (sreloc != NULL);
   BFD_ASSERT (sreloc->contents != NULL);
   BFD_ASSERT (sreloc->reloc_count * MIPS_ELF_REL_SIZE (output_bfd)
@@ -4552,10 +4810,15 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd,
   if (defined_p && r_type != R_MIPS_REL32)
     *addendp += symbol;
 
-  /* The relocation is always an REL32 relocation because we don't
-     know where the shared library will wind up at load-time.  */
-  outrel[0].r_info = ELF_R_INFO (output_bfd, (unsigned long) indx,
-				 R_MIPS_REL32);
+  if (htab->is_vxworks)
+    /* VxWorks uses non-relative relocations for this.  */
+    outrel[0].r_info = ELF32_R_INFO (indx, R_MIPS_32);
+  else
+    /* The relocation is always an REL32 relocation because we don't
+       know where the shared library will wind up at load-time.  */
+    outrel[0].r_info = ELF_R_INFO (output_bfd, (unsigned long) indx,
+				   R_MIPS_REL32);
+
   /* For strict adherence to the ABI specification, we should
      generate a R_MIPS_64 relocation record by itself before the
      _REL32/_64 record as well, such that the addend is read in as
@@ -4593,6 +4856,15 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd,
 	 (sreloc->contents
 	  + sreloc->reloc_count * sizeof (Elf64_Mips_External_Rel)));
     }
+  else if (htab->is_vxworks)
+    {
+      /* VxWorks uses RELA rather than REL dynamic relocations.  */
+      outrel[0].r_addend = *addendp;
+      bfd_elf32_swap_reloca_out
+	(output_bfd, &outrel[0],
+	 (sreloc->contents
+	  + sreloc->reloc_count * sizeof (Elf32_External_Rela)));
+    }
   else
     bfd_elf32_swap_reloc_out
       (output_bfd, &outrel[0],
@@ -5609,23 +5881,29 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
   flagword flags;
   register asection *s;
   const char * const *namep;
+  struct mips_elf_link_hash_table *htab;
 
+  htab = mips_elf_hash_table (info);
   flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
 	   | SEC_LINKER_CREATED | SEC_READONLY);
 
-  /* Mips ABI requests the .dynamic section to be read only.  */
-  s = bfd_get_section_by_name (abfd, ".dynamic");
-  if (s != NULL)
+  /* The psABI requires a read-only .dynamic section, but the VxWorks
+     EABI doesn't.  */
+  if (!htab->is_vxworks)
     {
-      if (! bfd_set_section_flags (abfd, s, flags))
-	return FALSE;
+      s = bfd_get_section_by_name (abfd, ".dynamic");
+      if (s != NULL)
+	{
+	  if (! bfd_set_section_flags (abfd, s, flags))
+	    return FALSE;
+	}
     }
 
   /* We need to create .got section.  */
   if (! mips_elf_create_got_section (abfd, info, FALSE))
     return FALSE;
 
-  if (! mips_elf_rel_dyn_section (elf_hash_table (info)->dynobj, TRUE))
+  if (! mips_elf_rel_dyn_section (info, TRUE))
     return FALSE;
 
   /* Create .stub section.  */
@@ -5746,6 +6024,45 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
 	}
     }
 
+  if (htab->is_vxworks)
+    {
+      /* Create the .plt, .rela.plt, .dynbss and .rela.bss sections.
+	 Also create the _PROCEDURE_LINKAGE_TABLE symbol.  */
+      if (!_bfd_elf_create_dynamic_sections (abfd, info))
+	return FALSE;
+
+      /* Cache the sections created above.  */
+      htab->sdynbss = bfd_get_section_by_name (abfd, ".dynbss");
+      htab->srelbss = bfd_get_section_by_name (abfd, ".rela.bss");
+      htab->srelplt = bfd_get_section_by_name (abfd, ".rela.plt");
+      htab->splt = bfd_get_section_by_name (abfd, ".plt");
+      if (!htab->sdynbss
+	  || (!htab->srelbss && !info->shared)
+	  || !htab->srelplt
+	  || !htab->splt)
+	abort ();
+
+      /* Do the usual VxWorks handling.  */
+      if (!elf_vxworks_create_dynamic_sections (abfd, info, &htab->srelplt2))
+	return FALSE;
+
+      /* Work out the PLT sizes.  */
+      if (info->shared)
+	{
+	  htab->plt_header_size
+	    = 4 * ARRAY_SIZE (mips_vxworks_shared_plt0_entry);
+	  htab->plt_entry_size
+	    = 4 * ARRAY_SIZE (mips_vxworks_shared_plt_entry);
+	}
+      else
+	{
+	  htab->plt_header_size
+	    = 4 * ARRAY_SIZE (mips_vxworks_exec_plt0_entry);
+	  htab->plt_entry_size
+	    = 4 * ARRAY_SIZE (mips_vxworks_exec_plt_entry);
+	}
+    }
+
   return TRUE;
 }
 
@@ -5767,10 +6084,12 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
   asection *sgot;
   asection *sreloc;
   const struct elf_backend_data *bed;
+  struct mips_elf_link_hash_table *htab;
 
   if (info->relocatable)
     return TRUE;
 
+  htab = mips_elf_hash_table (info);
   dynobj = elf_hash_table (info)->dynobj;
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
@@ -6012,13 +6331,24 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
 	      if (! mips_elf_create_got_section (dynobj, info, FALSE))
 		return FALSE;
 	      g = mips_elf_got_info (dynobj, &sgot);
+	      if (htab->is_vxworks && !info->shared)
+		{
+		  (*_bfd_error_handler)
+		    (_("%B: GOT reloc at 0x%lx not expected in executables"),
+		     abfd, (unsigned long) rel->r_offset);
+		  bfd_set_error (bfd_error_bad_value);
+		  return FALSE;
+		}
 	      break;
 
 	    case R_MIPS_32:
 	    case R_MIPS_REL32:
 	    case R_MIPS_64:
+	      /* In VxWorks executables, references to external symbols
+		 are handled using copy relocs or PLT stubs, so there's
+		 no need to add a dynamic relocation here.  */
 	      if (dynobj == NULL
-		  && (info->shared || h != NULL)
+		  && (info->shared || (h != NULL && !htab->is_vxworks))
 		  && (sec->flags & SEC_ALLOC) != 0)
 		elf_hash_table (info)->dynobj = dynobj = abfd;
 	      break;
@@ -6028,15 +6358,35 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
 	    }
 	}
 
-      if (!h && (r_type == R_MIPS_CALL_LO16
-		 || r_type == R_MIPS_GOT_LO16
-		 || r_type == R_MIPS_GOT_DISP))
+      if (h)
+	{
+	  ((struct mips_elf_link_hash_entry *) h)->is_relocation_target = TRUE;
+
+	  /* Relocations against the special VxWorks __GOTT_BASE__ and
+	     __GOTT_INDEX__ symbols must be left to the loader.  Allocate
+	     room for them in .rela.dyn.  */
+	  if (is_gott_symbol (info, h))
+	    {
+	      if (sreloc == NULL)
+		{
+		  sreloc = mips_elf_rel_dyn_section (info, TRUE);
+		  if (sreloc == NULL)
+		    return FALSE;
+		}
+	      mips_elf_allocate_dynamic_relocations (dynobj, info, 1);
+	    }
+	}
+      else if (r_type == R_MIPS_CALL_LO16
+	       || r_type == R_MIPS_GOT_LO16
+	       || r_type == R_MIPS_GOT_DISP
+	       || (r_type == R_MIPS_GOT16 && htab->is_vxworks))
 	{
 	  /* We may need a local GOT entry for this relocation.  We
 	     don't count R_MIPS_GOT_PAGE because we can estimate the
 	     maximum number of pages needed by looking at the size of
 	     the segment.  Similar comments apply to R_MIPS_GOT16 and
-	     R_MIPS_CALL16.  We don't count R_MIPS_GOT_HI16, or
+	     R_MIPS_CALL16, except on VxWorks, where GOT relocations
+	     always evaluate to "G".  We don't count R_MIPS_GOT_HI16, or
 	     R_MIPS_CALL_HI16 because these are always followed by an
 	     R_MIPS_GOT_LO16 or R_MIPS_CALL_LO16.  */
 	  if (! mips_elf_record_local_got_symbol (abfd, r_symndx,
@@ -6061,8 +6411,11 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
 	case R_MIPS_CALL_LO16:
 	  if (h != NULL)
 	    {
-	      /* This symbol requires a global offset table entry.  */
-	      if (! mips_elf_record_global_got_symbol (h, abfd, info, g, 0))
+	      /* VxWorks call relocations point the function's .got.plt
+		 entry, which will be allocated by adjust_dynamic_symbol.
+		 Otherwise, this symbol requires a global GOT entry.  */
+	      if (!htab->is_vxworks
+		  && !mips_elf_record_global_got_symbol (h, abfd, info, g, 0))
 		return FALSE;
 
 	      /* We need a stub, not a plt entry for the undefined
@@ -6148,12 +6501,15 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
 	case R_MIPS_32:
 	case R_MIPS_REL32:
 	case R_MIPS_64:
-	  if ((info->shared || h != NULL)
+	  /* In VxWorks executables, references to external symbols
+	     are handled using copy relocs or PLT stubs, so there's
+	     no need to add a .rela.dyn entry for this relocation.  */
+	  if ((info->shared || (h != NULL && !htab->is_vxworks))
 	      && (sec->flags & SEC_ALLOC) != 0)
 	    {
 	      if (sreloc == NULL)
 		{
-		  sreloc = mips_elf_rel_dyn_section (dynobj, TRUE);
+		  sreloc = mips_elf_rel_dyn_section (info, TRUE);
 		  if (sreloc == NULL)
 		    return FALSE;
 		}
@@ -6162,9 +6518,8 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
 		{
 		  /* When creating a shared object, we must copy these
 		     reloc types into the output file as R_MIPS_REL32
-		     relocs.  We make room for this reloc in the
-		     .rel.dyn reloc section.  */
-		  mips_elf_allocate_dynamic_relocations (dynobj, 1);
+		     relocs.  Make room for this reloc in .rel(a).dyn.  */
+		  mips_elf_allocate_dynamic_relocations (dynobj, info, 1);
 		  if ((sec->flags & MIPS_READONLY_SECTION)
 		      == MIPS_READONLY_SECTION)
 		    /* We tell the dynamic linker that there are
@@ -6189,8 +6544,10 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
 	      /* Even though we don't directly need a GOT entry for
 		 this symbol, a symbol must have a dynamic symbol
 		 table index greater that DT_MIPS_GOTSYM if there are
-		 dynamic relocations against it.  */
-	      if (h != NULL)
+		 dynamic relocations against it.  This does not apply
+		 to VxWorks, which does not have the usual coupling
+		 between global GOT entries and .dynsym entries.  */
+	      if (h != NULL && !htab->is_vxworks)
 		{
 		  if (dynobj == NULL)
 		    elf_hash_table (info)->dynobj = dynobj = abfd;
@@ -6207,7 +6564,16 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
 	      sizeof (Elf32_External_crinfo);
 	  break;
 
+	case R_MIPS_PC16:
+	  if (h)
+	    ((struct mips_elf_link_hash_entry *) h)->is_branch_target = TRUE;
+	  break;
+
 	case R_MIPS_26:
+	  if (h)
+	    ((struct mips_elf_link_hash_entry *) h)->is_branch_target = TRUE;
+	  /* Fall through.  */
+
 	case R_MIPS_GPREL16:
 	case R_MIPS_LITERAL:
 	case R_MIPS_GPREL32:
@@ -6235,24 +6601,21 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
 	}
 
       /* We must not create a stub for a symbol that has relocations
-         related to taking the function's address.  */
-      switch (r_type)
-	{
-	default:
-	  if (h != NULL)
-	    {
-	      struct mips_elf_link_hash_entry *mh;
-
-	      mh = (struct mips_elf_link_hash_entry *) h;
-	      mh->no_fn_stub = TRUE;
-	    }
-	  break;
-	case R_MIPS_CALL16:
-	case R_MIPS_CALL_HI16:
-	case R_MIPS_CALL_LO16:
-	case R_MIPS_JALR:
-	  break;
-	}
+	 related to taking the function's address.  This doesn't apply to
+	 VxWorks, where CALL relocs refer to a .got.plt entry instead of
+	 a normal .got entry.  */
+      if (!htab->is_vxworks && h != NULL)
+	switch (r_type)
+	  {
+	  default:
+	    ((struct mips_elf_link_hash_entry *) h)->no_fn_stub = TRUE;
+	    break;
+	  case R_MIPS_CALL16:
+	  case R_MIPS_CALL_HI16:
+	  case R_MIPS_CALL_LO16:
+	  case R_MIPS_JALR:
+	    break;
+	  }
 
       /* If this reloc is not a 16 bit call, and it has a global
          symbol, then we will need the fn_stub if there is one.
@@ -6479,8 +6842,8 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
       && (h->root.type == bfd_link_hash_defweak
 	  || !h->def_regular))
     {
-      mips_elf_allocate_dynamic_relocations (dynobj,
-					     hmips->possibly_dynamic_relocs);
+      mips_elf_allocate_dynamic_relocations
+	(dynobj, info, hmips->possibly_dynamic_relocs);
       if (hmips->readonly_reloc)
 	/* We tell the dynamic linker that there are relocations
 	   against the text segment.  */
@@ -6545,6 +6908,160 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   return TRUE;
 }
+
+/* Likewise, for VxWorks.  */
+
+bfd_boolean
+_bfd_mips_vxworks_adjust_dynamic_symbol (struct bfd_link_info *info,
+					 struct elf_link_hash_entry *h)
+{
+  bfd *dynobj;
+  struct mips_elf_link_hash_entry *hmips;
+  struct mips_elf_link_hash_table *htab;
+  unsigned int power_of_two;
+
+  htab = mips_elf_hash_table (info);
+  dynobj = elf_hash_table (info)->dynobj;
+  hmips = (struct mips_elf_link_hash_entry *) h;
+
+  /* Make sure we know what is going on here.  */
+  BFD_ASSERT (dynobj != NULL
+	      && (h->needs_plt
+		  || h->needs_copy
+		  || h->u.weakdef != NULL
+		  || (h->def_dynamic
+		      && h->ref_regular
+		      && !h->def_regular)));
+
+  /* If the symbol is defined by a dynamic object, we need a PLT stub if
+     either (a) we want to branch to the symbol or (b) we're linking an
+     executable that needs a canonical function address.  In the latter
+     case, the canonical address will be the address of the executable's
+     load stub.  */
+  if ((hmips->is_branch_target
+       || (!info->shared
+	   && h->type == STT_FUNC
+	   && hmips->is_relocation_target))
+      && h->def_dynamic
+      && h->ref_regular
+      && !h->def_regular
+      && !h->forced_local)
+    h->needs_plt = 1;
+
+  /* Locally-binding symbols do not need a PLT stub; we can refer to
+     the functions directly.  */
+  else if (h->needs_plt
+	   && (SYMBOL_CALLS_LOCAL (info, h)
+	       || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+		   && h->root.type == bfd_link_hash_undefweak)))
+    {
+      h->needs_plt = 0;
+      return TRUE;
+    }
+
+  if (h->needs_plt)
+    {
+      /* If this is the first symbol to need a PLT entry, allocate room
+	 for the header, and for the header's .rela.plt.unloaded entries.  */
+      if (htab->splt->size == 0)
+	{
+	  htab->splt->size += htab->plt_header_size;
+	  if (!info->shared)
+	    htab->srelplt2->size += 2 * sizeof (Elf32_External_Rela);
+	}
+
+      /* Assign the next .plt entry to this symbol.  */
+      h->plt.offset = htab->splt->size;
+      htab->splt->size += htab->plt_entry_size;
+
+      /* If the output file has no definition of the symbol, set the
+	 symbol's value to the address of the stub.  For executables,
+	 point at the PLT load stub rather than the lazy resolution stub;
+	 this stub will become the canonical function address.  */
+      if (!h->def_regular)
+	{
+	  h->root.u.def.section = htab->splt;
+	  h->root.u.def.value = h->plt.offset;
+	  if (!info->shared)
+	    h->root.u.def.value += 8;
+	}
+
+      /* Make room for the .got.plt entry and the R_JUMP_SLOT relocation.  */
+      htab->sgotplt->size += 4;
+      htab->srelplt->size += sizeof (Elf32_External_Rela);
+
+      /* Make room for the .rela.plt.unloaded relocations.  */
+      if (!info->shared)
+	htab->srelplt2->size += 3 * sizeof (Elf32_External_Rela);
+
+      return TRUE;
+    }
+
+  /* If a function symbol is defined by a dynamic object, and we do not
+     need a PLT stub for it, the symbol's value should be zero.  */
+  if (h->type == STT_FUNC
+      && h->def_dynamic
+      && h->ref_regular
+      && !h->def_regular)
+    {
+      h->root.u.def.value = 0;
+      return TRUE;
+    }
+
+  /* If this is a weak symbol, and there is a real definition, the
+     processor independent code will have arranged for us to see the
+     real definition first, and we can just use the same value.  */
+  if (h->u.weakdef != NULL)
+    {
+      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
+		  || h->u.weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->u.weakdef->root.u.def.section;
+      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      return TRUE;
+    }
+
+  /* This is a reference to a symbol defined by a dynamic object which
+     is not a function.  */
+  if (info->shared)
+    return TRUE;
+
+  /* We must allocate the symbol in our .dynbss section, which will
+     become part of the .bss section of the executable.  There will be
+     an entry for this symbol in the .dynsym section.  The dynamic
+     object will contain position independent code, so all references
+     from the dynamic object to this symbol will go through the global
+     offset table.  The dynamic linker will use the .dynsym entry to
+     determine the address it must put in the global offset table, so
+     both the dynamic object and the regular object will refer to the
+     same memory location for the variable.  */
+
+  if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
+    {
+      htab->srelbss->size += sizeof (Elf32_External_Rela);
+      h->needs_copy = 1;
+    }
+
+  /* We need to figure out the alignment required for this symbol.  */
+  power_of_two = bfd_log2 (h->size);
+  if (power_of_two > 4)
+    power_of_two = 4;
+
+  /* Apply the required alignment.  */
+  htab->sdynbss->size = BFD_ALIGN (htab->sdynbss->size,
+				   (bfd_size_type) 1 << power_of_two);
+  if (power_of_two > bfd_get_section_alignment (dynobj, htab->sdynbss)
+      && !bfd_set_section_alignment (dynobj, htab->sdynbss, power_of_two))
+    return FALSE;
+
+  /* Define the symbol as being at this point in the section.  */
+  h->root.u.def.section = htab->sdynbss;
+  h->root.u.def.value = htab->sdynbss->size;
+
+  /* Increment the section size to make room for the symbol.  */
+  htab->sdynbss->size += h->size;
+
+  return TRUE;
+}
 
 /* This function is called after all the input files have been read,
    and the input sections have been assigned to output sections.  We
@@ -6564,6 +7081,9 @@ _bfd_mips_elf_always_size_sections (bfd *output_bfd,
   bfd_size_type local_gotno;
   bfd *sub;
   struct mips_elf_count_tls_arg count_tls_arg;
+  struct mips_elf_link_hash_table *htab;
+
+  htab = mips_elf_hash_table (info);
 
   /* The .reginfo section has a fixed size.  */
   ri = bfd_get_section_by_name (output_bfd, ".reginfo");
@@ -6622,9 +7142,15 @@ _bfd_mips_elf_always_size_sections (bfd *output_bfd,
      rld.  */
   loadable_size += MIPS_FUNCTION_STUB_SIZE * (i + 1);
 
-  /* Assume there are two loadable segments consisting of
-     contiguous sections.  Is 5 enough?  */
-  local_gotno = (loadable_size >> 16) + 5;
+  if (htab->is_vxworks)
+    /* There's no need to allocate page entries for VxWorks; R_MIPS_GOT16
+       relocations against local symbols evaluate to "G", and the EABI does
+       not include R_MIPS_GOT_PAGE.  */
+    local_gotno = 0;
+  else
+    /* Assume there are two loadable segments consisting of contiguous
+       sections.  Is 5 enough?  */
+    local_gotno = (loadable_size >> 16) + 5;
 
   g->local_gotno += local_gotno;
   s->size += g->local_gotno * MIPS_ELF_GOT_SIZE (output_bfd);
@@ -6645,7 +7171,10 @@ _bfd_mips_elf_always_size_sections (bfd *output_bfd,
 
   mips_elf_resolve_final_got_entries (g);
 
-  if (s->size > MIPS_ELF_GOT_MAX_SIZE (output_bfd))
+  /* VxWorks does not support multiple GOTs.  It initializes $gp to
+     __GOTT_BASE__[__GOTT_INDEX__], the value of which is set by the
+     dynamic loader.  */
+  if (!htab->is_vxworks && s->size > MIPS_ELF_GOT_MAX_SIZE (info))
     {
       if (! mips_elf_multi_got (output_bfd, info, g, s, local_gotno))
 	return FALSE;
@@ -6667,9 +7196,11 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
 				     struct bfd_link_info *info)
 {
   bfd *dynobj;
-  asection *s;
+  asection *s, *sreldyn;
   bfd_boolean reltext;
+  struct mips_elf_link_hash_table *htab;
 
+  htab = mips_elf_hash_table (info);
   dynobj = elf_hash_table (info)->dynobj;
   BFD_ASSERT (dynobj != NULL);
 
@@ -6691,6 +7222,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
      determined the sizes of the various dynamic sections.  Allocate
      memory for them.  */
   reltext = FALSE;
+  sreldyn = NULL;
   for (s = dynobj->sections; s != NULL; s = s->next)
     {
       const char *name;
@@ -6711,7 +7243,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
 
 	      /* If this relocation section applies to a read only
                  section, then we probably need a DT_TEXTREL entry.
-                 If the relocation section is .rel.dyn, we always
+                 If the relocation section is .rel(a).dyn, we always
                  assert a DT_TEXTREL entry rather than testing whether
                  there exists a relocation to a read only section or
                  not.  */
@@ -6721,12 +7253,12 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
 	      if ((target != NULL
 		   && (target->flags & SEC_READONLY) != 0
 		   && (target->flags & SEC_ALLOC) != 0)
-		  || strcmp (outname, ".rel.dyn") == 0)
+		  || strcmp (outname, MIPS_ELF_REL_DYN_NAME (info)) == 0)
 		reltext = TRUE;
 
 	      /* We use the reloc_count field as a counter if we need
 		 to copy relocs into the output file.  */
-	      if (strcmp (name, ".rel.dyn") != 0)
+	      if (strcmp (name, MIPS_ELF_REL_DYN_NAME (info)) != 0)
 		s->reloc_count = 0;
 
 	      /* If combreloc is enabled, elf_link_sort_relocs() will
@@ -6738,7 +7270,23 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
 	      info->combreloc = 0;
 	    }
 	}
-      else if (strncmp (name, ".got", 4) == 0)
+      else if (htab->is_vxworks && strcmp (name, ".got") == 0)
+	{
+	  /* Executables do not need a GOT.  */
+	  if (info->shared)
+	    {
+	      /* Allocate relocations for all but the reserved entries.  */
+	      struct mips_got_info *g;
+	      unsigned int count;
+
+	      g = mips_elf_got_info (dynobj, NULL);
+	      count = (g->global_gotno
+		       + g->local_gotno
+		       - MIPS_RESERVED_GOTNO (info));
+	      mips_elf_allocate_dynamic_relocations (dynobj, info, count);
+	    }
+	}
+      else if (!htab->is_vxworks && strncmp (name, ".got", 4) == 0)
 	{
 	  /* _bfd_mips_elf_always_size_sections() has already done
 	     most of the work, but some symbols may have been mapped
@@ -6783,7 +7331,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
 		      BFD_ASSERT (g->assigned_gotno == g->next->local_gotno
 				  + g->next->global_gotno
 				  + g->next->tls_gotno
-				  + MIPS_RESERVED_GOTNO);
+				  + MIPS_RESERVED_GOTNO (info));
 		    }
 		}
 	    }
@@ -6803,7 +7351,8 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
 	    }
 
 	  if (needed_relocs)
-	    mips_elf_allocate_dynamic_relocations (dynobj, needed_relocs);
+	    mips_elf_allocate_dynamic_relocations (dynobj, info,
+						   needed_relocs);
 	}
       else if (strcmp (name, MIPS_ELF_STUB_SECTION_NAME (output_bfd)) == 0)
 	{
@@ -6822,7 +7371,9 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
       else if (SGI_COMPAT (output_bfd)
 	       && strncmp (name, ".compact_rel", 12) == 0)
 	s->size += mips_elf_hash_table (info)->compact_rel_size;
-      else if (strncmp (name, ".init", 5) != 0)
+      else if (strncmp (name, ".init", 5) != 0
+	       && s != htab->sgotplt
+	       && s != htab->splt)
 	{
 	  /* It's not one of our sections, so don't allocate space.  */
 	  continue;
@@ -6837,6 +7388,14 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
       if ((s->flags & SEC_HAS_CONTENTS) == 0)
 	continue;
 
+      /* Allocate memory for this section last, since we may increase its
+	 size above.  */
+      if (strcmp (name, MIPS_ELF_REL_DYN_NAME (info)) == 0)
+	{
+	  sreldyn = s;
+	  continue;
+	}
+
       /* Allocate memory for the section contents.  */
       s->contents = bfd_zalloc (dynobj, s->size);
       if (s->contents == NULL)
@@ -6846,6 +7405,17 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
 	}
     }
 
+  /* Allocate memory for the .rel(a).dyn section.  */
+  if (sreldyn != NULL)
+    {
+      sreldyn->contents = bfd_zalloc (dynobj, sreldyn->size);
+      if (sreldyn->contents == NULL)
+	{
+	  bfd_set_error (bfd_error_no_memory);
+	  return FALSE;
+	}
+    }
+
   if (elf_hash_table (info)->dynamic_sections_created)
     {
       /* Add some entries to the .dynamic section.  We fill in the
@@ -6875,7 +7445,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
 	    }
 	}
 
-      if (reltext && SGI_COMPAT (output_bfd))
+      if (reltext && (SGI_COMPAT (output_bfd) || htab->is_vxworks))
 	info->flags |= DF_TEXTREL;
 
       if ((info->flags & DF_TEXTREL) != 0)
@@ -6887,48 +7457,78 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
       if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTGOT, 0))
 	return FALSE;
 
-      if (mips_elf_rel_dyn_section (dynobj, FALSE))
+      if (htab->is_vxworks)
 	{
-	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_REL, 0))
-	    return FALSE;
+	  /* VxWorks uses .rela.dyn instead of .rel.dyn.  It does not
+	     use any of the DT_MIPS_* tags.  */
+	  if (mips_elf_rel_dyn_section (info, FALSE))
+	    {
+	      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELA, 0))
+		return FALSE;
 
-	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELSZ, 0))
-	    return FALSE;
+	      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELASZ, 0))
+		return FALSE;
 
-	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELENT, 0))
-	    return FALSE;
+	      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELAENT, 0))
+		return FALSE;
+	    }
+	  if (htab->splt->size > 0)
+	    {
+	      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTREL, 0))
+		return FALSE;
+
+	      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_JMPREL, 0))
+		return FALSE;
+
+	      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTRELSZ, 0))
+		return FALSE;
+	    }
 	}
+      else
+	{
+	  if (mips_elf_rel_dyn_section (info, FALSE))
+	    {
+	      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_REL, 0))
+		return FALSE;
 
-      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_VERSION, 0))
-	return FALSE;
+	      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELSZ, 0))
+		return FALSE;
 
-      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_FLAGS, 0))
-	return FALSE;
+	      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELENT, 0))
+		return FALSE;
+	    }
 
-      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_BASE_ADDRESS, 0))
-	return FALSE;
+	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_VERSION, 0))
+	    return FALSE;
 
-      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_LOCAL_GOTNO, 0))
-	return FALSE;
+	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_FLAGS, 0))
+	    return FALSE;
 
-      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_SYMTABNO, 0))
-	return FALSE;
+	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_BASE_ADDRESS, 0))
+	    return FALSE;
 
-      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_UNREFEXTNO, 0))
-	return FALSE;
+	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_LOCAL_GOTNO, 0))
+	    return FALSE;
 
-      if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_GOTSYM, 0))
-	return FALSE;
+	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_SYMTABNO, 0))
+	    return FALSE;
 
-      if (IRIX_COMPAT (dynobj) == ict_irix5
-	  && ! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_HIPAGENO, 0))
-	return FALSE;
+	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_UNREFEXTNO, 0))
+	    return FALSE;
 
-      if (IRIX_COMPAT (dynobj) == ict_irix6
-	  && (bfd_get_section_by_name
-	      (dynobj, MIPS_ELF_OPTIONS_SECTION_NAME (dynobj)))
-	  && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_OPTIONS, 0))
-	return FALSE;
+	  if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_GOTSYM, 0))
+	    return FALSE;
+
+	  if (IRIX_COMPAT (dynobj) == ict_irix5
+	      && ! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_HIPAGENO, 0))
+	    return FALSE;
+
+	  if (IRIX_COMPAT (dynobj) == ict_irix6
+	      && (bfd_get_section_by_name
+		  (dynobj, MIPS_ELF_OPTIONS_SECTION_NAME (dynobj)))
+	      && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_OPTIONS, 0))
+	    return FALSE;
+	}
     }
 
   return TRUE;
@@ -7584,6 +8184,268 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
   return TRUE;
 }
 
+/* Likewise, for VxWorks.  */
+
+bfd_boolean
+_bfd_mips_vxworks_finish_dynamic_symbol (bfd *output_bfd,
+					 struct bfd_link_info *info,
+					 struct elf_link_hash_entry *h,
+					 Elf_Internal_Sym *sym)
+{
+  bfd *dynobj;
+  asection *sgot;
+  struct mips_got_info *g;
+  struct mips_elf_link_hash_table *htab;
+
+  htab = mips_elf_hash_table (info);
+  dynobj = elf_hash_table (info)->dynobj;
+
+  if (h->plt.offset != (bfd_vma) -1)
+    {
+      bfd_byte *loc;
+      bfd_vma plt_address, plt_index, got_address, got_offset, branch_offset;
+      Elf_Internal_Rela rel;
+      static const bfd_vma *plt_entry;
+
+      BFD_ASSERT (h->dynindx != -1);
+      BFD_ASSERT (htab->splt != NULL);
+      BFD_ASSERT (h->plt.offset <= htab->splt->size);
+
+      /* Calculate the address of the .plt entry.  */
+      plt_address = (htab->splt->output_section->vma
+		     + htab->splt->output_offset
+		     + h->plt.offset);
+
+      /* Calculate the index of the entry.  */
+      plt_index = ((h->plt.offset - htab->plt_header_size)
+		   / htab->plt_entry_size);
+
+      /* Calculate the address of the .got.plt entry.  */
+      got_address = (htab->sgotplt->output_section->vma
+		     + htab->sgotplt->output_offset
+		     + plt_index * 4);
+
+      /* Calculate the offset of the .got.plt entry from
+	 _GLOBAL_OFFSET_TABLE_.  */
+      got_offset = mips_elf_gotplt_index (info, h);
+
+      /* Calculate the offset for the branch at the start of the PLT
+	 entry.  The branch jumps to the beginning of .plt.  */
+      branch_offset = -(h->plt.offset / 4 + 1) & 0xffff;
+
+      /* Fill in the initial value of the .got.plt entry.  */
+      bfd_put_32 (output_bfd, plt_address,
+		  htab->sgotplt->contents + plt_index * 4);
+
+      /* Find out where the .plt entry should go.  */
+      loc = htab->splt->contents + h->plt.offset;
+
+      if (info->shared)
+	{
+	  plt_entry = mips_vxworks_shared_plt_entry;
+	  bfd_put_32 (output_bfd, plt_entry[0] | branch_offset, loc);
+	  bfd_put_32 (output_bfd, plt_entry[1] | plt_index, loc + 4);
+	}
+      else
+	{
+	  bfd_vma got_address_high, got_address_low;
+
+	  plt_entry = mips_vxworks_exec_plt_entry;
+	  got_address_high = ((got_address + 0x8000) >> 16) & 0xffff;
+	  got_address_low = got_address & 0xffff;
+
+	  bfd_put_32 (output_bfd, plt_entry[0] | branch_offset, loc);
+	  bfd_put_32 (output_bfd, plt_entry[1] | plt_index, loc + 4);
+	  bfd_put_32 (output_bfd, plt_entry[2] | got_address_high, loc + 8);
+	  bfd_put_32 (output_bfd, plt_entry[3] | got_address_low, loc + 12);
+	  bfd_put_32 (output_bfd, plt_entry[4], loc + 16);
+	  bfd_put_32 (output_bfd, plt_entry[5], loc + 20);
+	  bfd_put_32 (output_bfd, plt_entry[6], loc + 24);
+	  bfd_put_32 (output_bfd, plt_entry[7], loc + 28);
+
+	  loc = (htab->srelplt2->contents
+		 + (plt_index * 3 + 2) * sizeof (Elf32_External_Rela));
+
+	  /* Emit a relocation for the .got.plt entry.  */
+	  rel.r_offset = got_address;
+	  rel.r_info = ELF32_R_INFO (htab->root.hplt->indx, R_MIPS_32);
+	  rel.r_addend = h->plt.offset;
+	  bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+
+	  /* Emit a relocation for the lui of %hi(<.got.plt slot>).  */
+	  loc += sizeof (Elf32_External_Rela);
+	  rel.r_offset = plt_address + 8;
+	  rel.r_info = ELF32_R_INFO (htab->root.hgot->indx, R_MIPS_HI16);
+	  rel.r_addend = got_offset;
+	  bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+
+	  /* Emit a relocation for the addiu of %lo(<.got.plt slot>).  */
+	  loc += sizeof (Elf32_External_Rela);
+	  rel.r_offset += 4;
+	  rel.r_info = ELF32_R_INFO (htab->root.hgot->indx, R_MIPS_LO16);
+	  bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+	}
+
+      /* Emit an R_MIPS_JUMP_SLOT relocation against the .got.plt entry.  */
+      loc = htab->srelplt->contents + plt_index * sizeof (Elf32_External_Rela);
+      rel.r_offset = got_address;
+      rel.r_info = ELF32_R_INFO (h->dynindx, R_MIPS_JUMP_SLOT);
+      rel.r_addend = 0;
+      bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+
+      if (!h->def_regular)
+	sym->st_shndx = SHN_UNDEF;
+    }
+
+  BFD_ASSERT (h->dynindx != -1 || h->forced_local);
+
+  sgot = mips_elf_got_section (dynobj, FALSE);
+  BFD_ASSERT (sgot != NULL);
+  BFD_ASSERT (mips_elf_section_data (sgot) != NULL);
+  g = mips_elf_section_data (sgot)->u.got_info;
+  BFD_ASSERT (g != NULL);
+
+  /* See if this symbol has an entry in the GOT.  */
+  if (g->global_gotsym != NULL
+      && h->dynindx >= g->global_gotsym->dynindx)
+    {
+      bfd_vma offset;
+      Elf_Internal_Rela outrel;
+      bfd_byte *loc;
+      asection *s;
+
+      /* Install the symbol value in the GOT.   */
+      offset = mips_elf_global_got_index (dynobj, output_bfd, h,
+					  R_MIPS_GOT16, info);
+      MIPS_ELF_PUT_WORD (output_bfd, sym->st_value, sgot->contents + offset);
+
+      /* Add a dynamic relocation for it.  */
+      s = mips_elf_rel_dyn_section (info, FALSE);
+      loc = s->contents + (s->reloc_count++ * sizeof (Elf32_External_Rela));
+      outrel.r_offset = (sgot->output_section->vma
+			 + sgot->output_offset
+			 + offset);
+      outrel.r_info = ELF32_R_INFO (h->dynindx, R_MIPS_32);
+      outrel.r_addend = 0;
+      bfd_elf32_swap_reloca_out (dynobj, &outrel, loc);
+    }
+
+  /* Emit a copy reloc, if needed.  */
+  if (h->needs_copy)
+    {
+      Elf_Internal_Rela rel;
+
+      BFD_ASSERT (h->dynindx != -1);
+
+      rel.r_offset = (h->root.u.def.section->output_section->vma
+		      + h->root.u.def.section->output_offset
+		      + h->root.u.def.value);
+      rel.r_info = ELF32_R_INFO (h->dynindx, R_MIPS_COPY);
+      rel.r_addend = 0;
+      bfd_elf32_swap_reloca_out (output_bfd, &rel,
+				 htab->srelbss->contents
+				 + (htab->srelbss->reloc_count
+				    * sizeof (Elf32_External_Rela)));
+      ++htab->srelbss->reloc_count;
+    }
+
+  /* If this is a mips16 symbol, force the value to be even.  */
+  if (sym->st_other == STO_MIPS16)
+    sym->st_value &= ~1;
+
+  return TRUE;
+}
+
+/* Install the PLT header for a VxWorks executable and finalize the
+   contents of .rela.plt.unloaded.  */
+
+static void
+mips_vxworks_finish_exec_plt (bfd *output_bfd, struct bfd_link_info *info)
+{
+  Elf_Internal_Rela rela;
+  bfd_byte *loc;
+  bfd_vma got_value, got_value_high, got_value_low, plt_address;
+  static const bfd_vma *plt_entry;
+  struct mips_elf_link_hash_table *htab;
+
+  htab = mips_elf_hash_table (info);
+  plt_entry = mips_vxworks_exec_plt0_entry;
+
+  /* Calculate the value of _GLOBAL_OFFSET_TABLE_.  */
+  got_value = (htab->root.hgot->root.u.def.section->output_section->vma
+	       + htab->root.hgot->root.u.def.section->output_offset
+	       + htab->root.hgot->root.u.def.value);
+
+  got_value_high = ((got_value + 0x8000) >> 16) & 0xffff;
+  got_value_low = got_value & 0xffff;
+
+  /* Calculate the address of the PLT header.  */
+  plt_address = htab->splt->output_section->vma + htab->splt->output_offset;
+
+  /* Install the PLT header.  */
+  loc = htab->splt->contents;
+  bfd_put_32 (output_bfd, plt_entry[0] | got_value_high, loc);
+  bfd_put_32 (output_bfd, plt_entry[1] | got_value_low, loc + 4);
+  bfd_put_32 (output_bfd, plt_entry[2], loc + 8);
+  bfd_put_32 (output_bfd, plt_entry[3], loc + 12);
+  bfd_put_32 (output_bfd, plt_entry[4], loc + 16);
+  bfd_put_32 (output_bfd, plt_entry[5], loc + 20);
+
+  /* Output the relocation for the lui of %hi(_GLOBAL_OFFSET_TABLE_).  */
+  loc = htab->srelplt2->contents;
+  rela.r_offset = plt_address;
+  rela.r_info = ELF32_R_INFO (htab->root.hgot->indx, R_MIPS_HI16);
+  rela.r_addend = 0;
+  bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+  loc += sizeof (Elf32_External_Rela);
+
+  /* Output the relocation for the following addiu of
+     %lo(_GLOBAL_OFFSET_TABLE_).  */
+  rela.r_offset += 4;
+  rela.r_info = ELF32_R_INFO (htab->root.hgot->indx, R_MIPS_LO16);
+  bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+  loc += sizeof (Elf32_External_Rela);
+
+  /* Fix up the remaining relocations.  They may have the wrong
+     symbol index for _G_O_T_ or _P_L_T_ depending on the order
+     in which symbols were output.  */
+  while (loc < htab->srelplt2->contents + htab->srelplt2->size)
+    {
+      Elf_Internal_Rela rel;
+
+      bfd_elf32_swap_reloca_in (output_bfd, loc, &rel);
+      rel.r_info = ELF32_R_INFO (htab->root.hplt->indx, R_MIPS_32);
+      bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+      loc += sizeof (Elf32_External_Rela);
+
+      bfd_elf32_swap_reloca_in (output_bfd, loc, &rel);
+      rel.r_info = ELF32_R_INFO (htab->root.hgot->indx, R_MIPS_HI16);
+      bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+      loc += sizeof (Elf32_External_Rela);
+
+      bfd_elf32_swap_reloca_in (output_bfd, loc, &rel);
+      rel.r_info = ELF32_R_INFO (htab->root.hgot->indx, R_MIPS_LO16);
+      bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+      loc += sizeof (Elf32_External_Rela);
+    }
+}
+
+/* Install the PLT header for a VxWorks shared library.  */
+
+static void
+mips_vxworks_finish_shared_plt (bfd *output_bfd, struct bfd_link_info *info)
+{
+  unsigned int i;
+  struct mips_elf_link_hash_table *htab;
+
+  htab = mips_elf_hash_table (info);
+
+  /* We just need to copy the entry byte-by-byte.  */
+  for (i = 0; i < ARRAY_SIZE (mips_vxworks_shared_plt0_entry); i++)
+    bfd_put_32 (output_bfd, mips_vxworks_shared_plt0_entry[i],
+		htab->splt->contents + i * 4);
+}
+
 /* Finish up the dynamic sections.  */
 
 bfd_boolean
@@ -7594,7 +8456,9 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
   asection *sdyn;
   asection *sgot;
   struct mips_got_info *gg, *g;
+  struct mips_elf_link_hash_table *htab;
 
+  htab = mips_elf_hash_table (info);
   dynobj = elf_hash_table (info)->dynobj;
 
   sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
@@ -7637,11 +8501,14 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
 	  switch (dyn.d_tag)
 	    {
 	    case DT_RELENT:
-	      s = mips_elf_rel_dyn_section (dynobj, FALSE);
-	      BFD_ASSERT (s != NULL);
 	      dyn.d_un.d_val = MIPS_ELF_REL_SIZE (dynobj);
 	      break;
 
+	    case DT_RELAENT:
+	      BFD_ASSERT (htab->is_vxworks);
+	      dyn.d_un.d_val = MIPS_ELF_RELA_SIZE (dynobj);
+	      break;
+
 	    case DT_STRSZ:
 	      /* Rewrite DT_STRSZ.  */
 	      dyn.d_un.d_val =
@@ -7650,9 +8517,20 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
 
 	    case DT_PLTGOT:
 	      name = ".got";
-	      s = bfd_get_section_by_name (output_bfd, name);
-	      BFD_ASSERT (s != NULL);
-	      dyn.d_un.d_ptr = s->vma;
+	      if (htab->is_vxworks)
+		{
+		  /* _GLOBAL_OFFSET_TABLE_ is defined to be the beginning
+		     of the ".got" section in DYNOBJ.  */
+		  s = bfd_get_section_by_name (dynobj, name);
+		  BFD_ASSERT (s != NULL);
+		  dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+		}
+	      else
+		{
+		  s = bfd_get_section_by_name (output_bfd, name);
+		  BFD_ASSERT (s != NULL);
+		  dyn.d_un.d_ptr = s->vma;
+		}
 	      break;
 
 	    case DT_MIPS_RLD_VERSION:
@@ -7718,7 +8596,7 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
 	      break;
 
 	    case DT_MIPS_HIPAGENO:
-	      dyn.d_un.d_val = g->local_gotno - MIPS_RESERVED_GOTNO;
+	      dyn.d_un.d_val = g->local_gotno - MIPS_RESERVED_GOTNO (info);
 	      break;
 
 	    case DT_MIPS_RLD_MAP:
@@ -7731,6 +8609,29 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
 	      dyn.d_un.d_ptr = s->vma;
 	      break;
 
+	    case DT_RELASZ:
+	      BFD_ASSERT (htab->is_vxworks);
+	      /* The count does not include the JUMP_SLOT relocations.  */
+	      if (htab->srelplt)
+		dyn.d_un.d_val -= htab->srelplt->size;
+	      break;
+
+	    case DT_PLTREL:
+	      BFD_ASSERT (htab->is_vxworks);
+	      dyn.d_un.d_val = DT_RELA;
+	      break;
+
+	    case DT_PLTRELSZ:
+	      BFD_ASSERT (htab->is_vxworks);
+	      dyn.d_un.d_val = htab->srelplt->size;
+	      break;
+
+	    case DT_JMPREL:
+	      BFD_ASSERT (htab->is_vxworks);
+	      dyn.d_un.d_val = (htab->srelplt->output_section->vma
+				+ htab->srelplt->output_offset);
+	      break;
+
 	    default:
 	      swap_out_p = FALSE;
 	      break;
@@ -7742,14 +8643,33 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
 	}
     }
 
-  /* The first entry of the global offset table will be filled at
-     runtime. The second entry will be used by some runtime loaders.
-     This isn't the case of IRIX rld.  */
   if (sgot != NULL && sgot->size > 0)
     {
-      MIPS_ELF_PUT_WORD (output_bfd, 0, sgot->contents);
-      MIPS_ELF_PUT_WORD (output_bfd, 0x80000000,
-			 sgot->contents + MIPS_ELF_GOT_SIZE (output_bfd));
+      if (htab->is_vxworks)
+	{
+	  /* The first entry of the global offset table points to the
+	     ".dynamic" section.  The second is initialized by the
+	     loader and contains the shared library identifier.
+	     The third is also initialized by the loader and points
+	     to the lazy resolution stub.  */
+	  MIPS_ELF_PUT_WORD (output_bfd,
+			     sdyn->output_offset + sdyn->output_section->vma,
+			     sgot->contents);
+	  MIPS_ELF_PUT_WORD (output_bfd, 0,
+			     sgot->contents + MIPS_ELF_GOT_SIZE (output_bfd));
+	  MIPS_ELF_PUT_WORD (output_bfd, 0,
+			     sgot->contents
+			     + 2 * MIPS_ELF_GOT_SIZE (output_bfd));
+	}
+      else
+	{
+	  /* The first entry of the global offset table will be filled at
+	     runtime. The second entry will be used by some runtime loaders.
+	     This isn't the case of IRIX rld.  */
+	  MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0, sgot->contents);
+	  MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0x80000000,
+			     sgot->contents + MIPS_ELF_GOT_SIZE (output_bfd));
+	}
     }
 
   if (sgot != NULL)
@@ -7823,7 +8743,7 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
 		 decided not to make.  This is for the n64 irix rld,
 		 which doesn't seem to apply any relocations if there
 		 are trailing null entries.  */
-	      s = mips_elf_rel_dyn_section (dynobj, FALSE);
+	      s = mips_elf_rel_dyn_section (info, FALSE);
 	      dyn.d_un.d_val = (s->reloc_count
 				* (ABI_64_P (output_bfd)
 				   ? sizeof (Elf64_Mips_External_Rel)
@@ -7877,24 +8797,37 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
 	  }
       }
 
-    /* We need to sort the entries of the dynamic relocation section.  */
-
-    s = mips_elf_rel_dyn_section (dynobj, FALSE);
-
-    if (s != NULL
-	&& s->size > (bfd_vma)2 * MIPS_ELF_REL_SIZE (output_bfd))
+    /* The psABI says that the dynamic relocations must be sorted in
+       increasing order of r_symndx.  The VxWorks EABI doesn't require
+       this, and because the code below handles REL rather than RELA
+       relocations, using it for VxWorks would be outright harmful.  */
+    if (!htab->is_vxworks)
       {
-	reldyn_sorting_bfd = output_bfd;
+	s = mips_elf_rel_dyn_section (info, FALSE);
+	if (s != NULL
+	    && s->size > (bfd_vma)2 * MIPS_ELF_REL_SIZE (output_bfd))
+	  {
+	    reldyn_sorting_bfd = output_bfd;
 
-	if (ABI_64_P (output_bfd))
-	  qsort ((Elf64_External_Rel *) s->contents + 1, s->reloc_count - 1,
-		 sizeof (Elf64_Mips_External_Rel), sort_dynamic_relocs_64);
-	else
-	  qsort ((Elf32_External_Rel *) s->contents + 1, s->reloc_count - 1,
-		 sizeof (Elf32_External_Rel), sort_dynamic_relocs);
+	    if (ABI_64_P (output_bfd))
+	      qsort ((Elf64_External_Rel *) s->contents + 1,
+		     s->reloc_count - 1, sizeof (Elf64_Mips_External_Rel),
+		     sort_dynamic_relocs_64);
+	    else
+	      qsort ((Elf32_External_Rel *) s->contents + 1,
+		     s->reloc_count - 1, sizeof (Elf32_External_Rel),
+		     sort_dynamic_relocs);
+	  }
       }
   }
 
+  if (htab->is_vxworks && htab->splt->size > 0)
+    {
+      if (info->shared)
+	mips_vxworks_finish_shared_plt (output_bfd, info);
+      else
+	mips_vxworks_finish_exec_plt (output_bfd, info);
+    }
   return TRUE;
 }
 
@@ -8962,9 +9895,36 @@ _bfd_mips_elf_link_hash_table_create (bfd *abfd)
   ret->use_rld_obj_head = FALSE;
   ret->rld_value = 0;
   ret->mips16_stubs_seen = FALSE;
+  ret->is_vxworks = FALSE;
+  ret->srelbss = NULL;
+  ret->sdynbss = NULL;
+  ret->srelplt = NULL;
+  ret->srelplt2 = NULL;
+  ret->sgotplt = NULL;
+  ret->splt = NULL;
+  ret->plt_header_size = 0;
+  ret->plt_entry_size = 0;
 
   return &ret->root.root;
 }
+
+/* Likewise, but indicate that the target is VxWorks.  */
+
+struct bfd_link_hash_table *
+_bfd_mips_vxworks_link_hash_table_create (bfd *abfd)
+{
+  struct bfd_link_hash_table *ret;
+
+  ret = _bfd_mips_elf_link_hash_table_create (abfd);
+  if (ret)
+    {
+      struct mips_elf_link_hash_table *htab;
+
+      htab = (struct mips_elf_link_hash_table *) ret;
+      htab->is_vxworks = 1;
+    }
+  return ret;
+}
 
 /* We need to use a special link routine to handle the .reginfo and
    the .mdebug sections.  We need to merge all instances of these
@@ -8987,6 +9947,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
   EXTR esym;
   unsigned int i;
   bfd_size_type amt;
+  struct mips_elf_link_hash_table *htab;
 
   static const char * const secname[] =
   {
@@ -9003,6 +9964,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
      generic size_dynamic_sections renumbered them out from under us.
      Rather than trying somehow to prevent the renumbering, just do
      the sort again.  */
+  htab = mips_elf_hash_table (info);
   if (elf_hash_table (info)->dynamic_sections_created)
     {
       bfd *dynobj;
@@ -9053,6 +10015,14 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
 	elf_gp (abfd) = (h->u.def.value
 			 + h->u.def.section->output_section->vma
 			 + h->u.def.section->output_offset);
+      else if (htab->is_vxworks
+	       && (h = bfd_link_hash_lookup (info->hash,
+					     "_GLOBAL_OFFSET_TABLE_",
+					     FALSE, FALSE, TRUE))
+	       && h->type == bfd_link_hash_defined)
+	elf_gp (abfd) = (h->u.def.section->output_section->vma
+			 + h->u.def.section->output_offset
+			 + h->u.def.value);
       else if (info->relocatable)
 	{
 	  bfd_vma lo = MINUS_ONE;
@@ -9064,7 +10034,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
 	      lo = o->vma;
 
 	  /* And calculate GP relative to that.  */
-	  elf_gp (abfd) = lo + ELF_MIPS_GP_OFFSET (abfd);
+	  elf_gp (abfd) = lo + ELF_MIPS_GP_OFFSET (info);
 	}
       else
 	{
@@ -9796,6 +10766,12 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
   new_flags &= ~EF_MIPS_UCODE;
   old_flags &= ~EF_MIPS_UCODE;
 
+  /* Don't care about the PIC flags from dynamic objects; they are
+     PIC by design.  */
+  if ((new_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0
+      && (ibfd->flags & DYNAMIC) != 0)
+    new_flags &= ~ (EF_MIPS_PIC | EF_MIPS_CPIC);
+
   if (new_flags == old_flags)
     return TRUE;
 
diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h
index 07e661d81c0..6c3c9a30f6e 100644
--- a/bfd/elfxx-mips.h
+++ b/bfd/elfxx-mips.h
@@ -48,6 +48,8 @@ extern bfd_boolean _bfd_mips_elf_check_relocs
   (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
 extern bfd_boolean _bfd_mips_elf_adjust_dynamic_symbol
   (struct bfd_link_info *, struct elf_link_hash_entry *);
+extern bfd_boolean _bfd_mips_vxworks_adjust_dynamic_symbol
+  (struct bfd_link_info *, struct elf_link_hash_entry *);
 extern bfd_boolean _bfd_mips_elf_always_size_sections
   (bfd *, struct bfd_link_info *);
 extern bfd_boolean _bfd_mips_elf_size_dynamic_sections
@@ -58,6 +60,9 @@ extern bfd_boolean _bfd_mips_elf_relocate_section
 extern bfd_boolean _bfd_mips_elf_finish_dynamic_symbol
   (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
    Elf_Internal_Sym *);
+extern bfd_boolean _bfd_mips_vxworks_finish_dynamic_symbol
+  (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
+   Elf_Internal_Sym *);
 extern bfd_boolean _bfd_mips_elf_finish_dynamic_sections
   (bfd *, struct bfd_link_info *);
 extern void _bfd_mips_elf_final_write_processing
@@ -90,6 +95,8 @@ extern bfd_byte *_bfd_elf_mips_get_relocated_section_contents
    bfd_byte *, bfd_boolean, asymbol **);
 extern struct bfd_link_hash_table *_bfd_mips_elf_link_hash_table_create
   (bfd *);
+extern struct bfd_link_hash_table *_bfd_mips_vxworks_link_hash_table_create
+  (bfd *);
 extern bfd_boolean _bfd_mips_elf_final_link
   (bfd *, struct bfd_link_info *);
 extern bfd_boolean _bfd_mips_elf_merge_private_bfd_data
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index cb5f7cbba9b..ef7ff482d2e 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -23,10 +23,12 @@
 #include "sysdep.h"
 #include "bfdlink.h"
 #include "libbfd.h"
+#include "libiberty.h"
 #include "elf-bfd.h"
 #include "elf/sparc.h"
 #include "opcode/sparc.h"
 #include "elfxx-sparc.h"
+#include "elf-vxworks.h"
 
 /* In case we're on a 32-bit machine, construct a 64-bit "-1" value.  */
 #define MINUS_ONE (~ (bfd_vma) 0)
@@ -697,6 +699,50 @@ sparc64_plt_entry_build (bfd *output_bfd, asection *splt, bfd_vma offset,
   return index - 4;
 }
 
+/* The format of the first PLT entry in a VxWorks executable.  */
+static const bfd_vma sparc_vxworks_exec_plt0_entry[] =
+  {
+    0x05000000,	/* sethi  %hi(_GLOBAL_OFFSET_TABLE_+8), %g2 */
+    0x8410a000,	/* or     %g2, %lo(_GLOBAL_OFFSET_TABLE_+8), %g2 */
+    0xc4008000,	/* ld     [ %g2 ], %g2 */
+    0x81c08000,	/* jmp    %g2 */
+    0x01000000	/* nop */
+  };
+
+/* The format of subsequent PLT entries.  */
+static const bfd_vma sparc_vxworks_exec_plt_entry[] =
+  {
+    0x03000000,	/* sethi  %hi(_GLOBAL_OFFSET_TABLE_+f@got), %g1 */
+    0x82106000,	/* or     %g1, %lo(_GLOBAL_OFFSET_TABLE_+f@got), %g1 */
+    0xc2004000,	/* ld     [ %g1 ], %g1 */
+    0x81c04000,	/* jmp    %g1 */
+    0x01000000,	/* nop */
+    0x03000000,	/* sethi  %hi(f@pltindex), %g1 */
+    0x10800000,	/* b      _PLT_resolve */
+    0x82106000	/* or     %g1, %lo(f@pltindex), %g1 */
+  };
+
+/* The format of the first PLT entry in a VxWorks shared object.  */
+static const bfd_vma sparc_vxworks_shared_plt0_entry[] =
+  {
+    0xc405e008,	/* ld     [ %l7 + 8 ], %g2 */
+    0x81c08000,	/* jmp    %g2 */
+    0x01000000	/* nop */
+  };
+
+/* The format of subsequent PLT entries.  */
+static const bfd_vma sparc_vxworks_shared_plt_entry[] =
+  {
+    0x03000000,	/* sethi  %hi(f@got), %g1 */
+    0x82106000,	/* or     %g1, %lo(f@got), %g1 */
+    0xc205c001,	/* ld     [ %l7 + %g1 ], %g1 */
+    0x81c04000,	/* jmp    %g1 */
+    0x01000000,	/* nop */
+    0x03000000,	/* sethi  %hi(f@pltindex), %g1 */
+    0x10800000,	/* b      _PLT_resolve */
+    0x82106000	/* or     %g1, %lo(f@pltindex), %g1 */
+  };
+
 #define SPARC_ELF_PUT_WORD(htab, bfd, val, ptr)	\
 	htab->put_word(bfd, val, ptr)
 
@@ -781,7 +827,6 @@ _bfd_sparc_elf_link_hash_table_create (bfd *abfd)
       ret->append_rela = sparc_elf_append_rela_64;
       ret->r_info = sparc_elf_r_info_64;
       ret->r_symndx = sparc_elf_r_symndx_64;
-      ret->build_plt_entry = sparc64_plt_entry_build;
       ret->dtpoff_reloc = R_SPARC_TLS_DTPOFF64;
       ret->dtpmod_reloc = R_SPARC_TLS_DTPMOD64;
       ret->tpoff_reloc = R_SPARC_TLS_TPOFF64;
@@ -798,7 +843,6 @@ _bfd_sparc_elf_link_hash_table_create (bfd *abfd)
       ret->append_rela = sparc_elf_append_rela_32;
       ret->r_info = sparc_elf_r_info_32;
       ret->r_symndx = sparc_elf_r_symndx_32;
-      ret->build_plt_entry = sparc32_plt_entry_build;
       ret->dtpoff_reloc = R_SPARC_TLS_DTPOFF32;
       ret->dtpmod_reloc = R_SPARC_TLS_DTPMOD32;
       ret->tpoff_reloc = R_SPARC_TLS_TPOFF32;
@@ -846,6 +890,14 @@ create_got_section (bfd *dynobj, struct bfd_link_info *info)
       || ! bfd_set_section_alignment (dynobj, htab->srelgot,
 				      htab->word_align_power))
     return FALSE;
+
+  if (htab->is_vxworks)
+    {
+      htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
+      if (!htab->sgotplt)
+	return FALSE;
+    }
+
   return TRUE;
 }
 
@@ -872,6 +924,41 @@ _bfd_sparc_elf_create_dynamic_sections (bfd *dynobj,
   if (!info->shared)
     htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss");
 
+  if (htab->is_vxworks)
+    {
+      if (!elf_vxworks_create_dynamic_sections (dynobj, info, &htab->srelplt2))
+	return FALSE;
+      if (info->shared)
+	{
+	  htab->plt_header_size
+	    = 4 * ARRAY_SIZE (sparc_vxworks_shared_plt0_entry);
+	  htab->plt_entry_size
+	    = 4 * ARRAY_SIZE (sparc_vxworks_shared_plt_entry);
+	}
+      else
+	{
+	  htab->plt_header_size
+	    = 4 * ARRAY_SIZE (sparc_vxworks_exec_plt0_entry);
+	  htab->plt_entry_size
+	    = 4 * ARRAY_SIZE (sparc_vxworks_exec_plt_entry);
+	}
+    }
+  else
+    {
+      if (ABI_64_P (dynobj))
+	{
+	  htab->build_plt_entry = sparc64_plt_entry_build;
+	  htab->plt_header_size = PLT64_HEADER_SIZE;
+	  htab->plt_entry_size = PLT64_ENTRY_SIZE;
+	}
+      else
+	{
+	  htab->build_plt_entry = sparc32_plt_entry_build;
+	  htab->plt_header_size = PLT32_HEADER_SIZE;
+	  htab->plt_entry_size = PLT32_ENTRY_SIZE;
+	}
+    }
+
   if (!htab->splt || !htab->srelplt || !htab->sdynbss
       || (!info->shared && !htab->srelbss))
     abort ();
@@ -1807,10 +1894,15 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, PTR inf)
 	{
 	  asection *s = htab->splt;
 
-	  /* The first four entries in .plt is reserved.  */
+	  /* Allocate room for the header.  */
 	  if (s->size == 0)
-	    s->size = (SPARC_ELF_WORD_BYTES(htab) == 8 ?
-		       PLT64_HEADER_SIZE : PLT32_HEADER_SIZE);
+	    {
+	      s->size = htab->plt_header_size;
+
+	      /* Allocate space for the .rela.plt.unloaded relocations.  */
+	      if (htab->is_vxworks && !info->shared)
+		htab->srelplt2->size = sizeof (Elf32_External_Rela) * 2;
+	    }
 
 	  /* The procedure linkage table size is bounded by the magnitude
 	     of the offset we can describe in the entry.  */
@@ -1847,11 +1939,20 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, PTR inf)
 	    }
 
 	  /* Make room for this entry.  */
-	  s->size += (SPARC_ELF_WORD_BYTES(htab) == 8 ?
-		      PLT64_ENTRY_SIZE : PLT32_ENTRY_SIZE);
+	  s->size += htab->plt_entry_size;
 
 	  /* We also need to make an entry in the .rela.plt section.  */
 	  htab->srelplt->size += SPARC_ELF_RELA_BYTES (htab);
+
+	  if (htab->is_vxworks)
+	    {
+	      /* Allocate space for the .got.plt entry.  */
+	      htab->sgotplt->size += 4;
+
+	      /* ...and for the .rela.plt.unloaded relocations.  */
+	      if (!info->shared)
+		htab->srelplt2->size += sizeof (Elf32_External_Rela) * 3;
+	    }
 	}
       else
 	{
@@ -2153,6 +2254,7 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd,
   elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info);
 
   if (! ABI_64_P (output_bfd)
+      && !htab->is_vxworks
       && elf_hash_table (info)->dynamic_sections_created)
     {
       /* Make space for the trailing nop in .plt.  */
@@ -2179,7 +2281,8 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd,
 
       if (s == htab->splt
 	  || s == htab->sgot
-	  || s == htab->sdynbss)
+	  || s == htab->sdynbss
+	  || s == htab->sgotplt)
 	{
 	  /* Strip this section if we don't need it; see the
 	     comment below.  */
@@ -3428,6 +3531,97 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
   return TRUE;
 }
 
+/* Build a VxWorks PLT entry.  PLT_INDEX is the index of the PLT entry
+   and PLT_OFFSET is the byte offset from the start of .plt.  GOT_OFFSET
+   is the offset of the associated .got.plt entry from
+   _GLOBAL_OFFSET_TABLE_.  */
+
+static void
+sparc_vxworks_build_plt_entry (bfd *output_bfd, struct bfd_link_info *info,
+			       bfd_vma plt_offset, bfd_vma plt_index,
+			       bfd_vma got_offset)
+{
+  bfd_vma got_base;
+  const bfd_vma *plt_entry;
+  struct _bfd_sparc_elf_link_hash_table *htab;
+  bfd_byte *loc;
+  Elf_Internal_Rela rela;
+
+  htab = _bfd_sparc_elf_hash_table (info);
+  if (info->shared)
+    {
+      plt_entry = sparc_vxworks_shared_plt_entry;
+      got_base = 0;
+    }
+  else
+    {
+      plt_entry = sparc_vxworks_exec_plt_entry;
+      got_base = (htab->elf.hgot->root.u.def.value
+		  + htab->elf.hgot->root.u.def.section->output_offset
+		  + htab->elf.hgot->root.u.def.section->output_section->vma);
+    }
+
+  /* Fill in the entry in the procedure linkage table.  */
+  bfd_put_32 (output_bfd, plt_entry[0] + ((got_base + got_offset) >> 10),
+	      htab->splt->contents + plt_offset);
+  bfd_put_32 (output_bfd, plt_entry[1] + ((got_base + got_offset) & 0x3ff),
+	      htab->splt->contents + plt_offset + 4);
+  bfd_put_32 (output_bfd, plt_entry[2],
+	      htab->splt->contents + plt_offset + 8);
+  bfd_put_32 (output_bfd, plt_entry[3],
+	      htab->splt->contents + plt_offset + 12);
+  bfd_put_32 (output_bfd, plt_entry[4],
+	      htab->splt->contents + plt_offset + 16);
+  bfd_put_32 (output_bfd, plt_entry[5] + (plt_index >> 10),
+	      htab->splt->contents + plt_offset + 20);
+  /* PC-relative displacement for a branch to the start of
+     the PLT section.  */
+  bfd_put_32 (output_bfd, plt_entry[6] + (((-plt_offset - 24) >> 2)
+					  & 0x003fffff),
+	      htab->splt->contents + plt_offset + 24);
+  bfd_put_32 (output_bfd, plt_entry[7] + (plt_index & 0x3ff),
+	      htab->splt->contents + plt_offset + 28);
+
+  /* Fill in the .got.plt entry, pointing initially at the
+     second half of the PLT entry.  */
+  BFD_ASSERT (htab->sgotplt != NULL);
+  bfd_put_32 (output_bfd,
+	      htab->splt->output_section->vma
+	      + htab->splt->output_offset
+	      + plt_offset + 20,
+	      htab->sgotplt->contents + got_offset);
+
+  /* Add relocations to .rela.plt.unloaded.  */
+  if (!info->shared)
+    {
+      loc = (htab->srelplt2->contents
+	     + (2 + 3 * plt_index) * sizeof (Elf32_External_Rela));
+
+      /* Relocate the initial sethi.  */
+      rela.r_offset = (htab->splt->output_section->vma
+		       + htab->splt->output_offset
+		       + plt_offset);
+      rela.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_HI22);
+      rela.r_addend = got_offset;
+      bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+      loc += sizeof (Elf32_External_Rela);
+
+      /* Likewise the following or.  */
+      rela.r_offset += 4;
+      rela.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_LO10);
+      bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+      loc += sizeof (Elf32_External_Rela);
+
+      /* Relocate the .got.plt entry.  */
+      rela.r_offset = (htab->sgotplt->output_section->vma
+		       + htab->sgotplt->output_offset
+		       + got_offset);
+      rela.r_info = ELF32_R_INFO (htab->elf.hplt->indx, R_SPARC_32);
+      rela.r_addend = plt_offset + 20;
+      bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+    }
+}
+
 /* Finish up dynamic symbol handling.  We set the contents of various
    dynamic sections here.  */
 
@@ -3449,7 +3643,7 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd,
       asection *srela;
       Elf_Internal_Rela rela;
       bfd_byte *loc;
-      bfd_vma r_offset;
+      bfd_vma r_offset, got_offset;
       int rela_index;
 
       /* This symbol has an entry in the PLT.  Set it up.  */
@@ -3460,23 +3654,48 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd,
       srela = htab->srelplt;
       BFD_ASSERT (splt != NULL && srela != NULL);
 
-      /* Fill in the entry in the procedure linkage table.  */
-      rela_index = SPARC_ELF_BUILD_PLT_ENTRY (htab, output_bfd, splt,
-					      h->plt.offset, splt->size,
-					      &r_offset);
-
       /* Fill in the entry in the .rela.plt section.  */
-      rela.r_offset = r_offset
-	+ (splt->output_section->vma + splt->output_offset);
-      if (! ABI_64_P (output_bfd)
-	  || h->plt.offset < (PLT64_LARGE_THRESHOLD * PLT64_ENTRY_SIZE))
+      if (htab->is_vxworks)
 	{
+	  /* Work out the index of this PLT entry.  */
+	  rela_index = ((h->plt.offset - htab->plt_header_size)
+			/ htab->plt_entry_size);
+
+	  /* Calculate the offset of the associated .got.plt entry.
+	     The first three entries are reserved.  */
+	  got_offset = (rela_index + 3) * 4;
+
+	  sparc_vxworks_build_plt_entry (output_bfd, info, h->plt.offset,
+					 rela_index, got_offset);
+
+
+	  /* On VxWorks, the relocation points to the .got.plt entry,
+	     not the .plt entry.  */
+	  rela.r_offset = (htab->sgotplt->output_section->vma
+			   + htab->sgotplt->output_offset
+			   + got_offset);
 	  rela.r_addend = 0;
 	}
       else
 	{
-	  rela.r_addend = -(h->plt.offset + 4)
-			  -(splt->output_section->vma + splt->output_offset);
+	  /* Fill in the entry in the procedure linkage table.  */
+	  rela_index = SPARC_ELF_BUILD_PLT_ENTRY (htab, output_bfd, splt,
+						  h->plt.offset, splt->size,
+						  &r_offset);
+
+	  rela.r_offset = r_offset
+	    + (splt->output_section->vma + splt->output_offset);
+	  if (! ABI_64_P (output_bfd)
+	      || h->plt.offset < (PLT64_LARGE_THRESHOLD * PLT64_ENTRY_SIZE))
+	    {
+	      rela.r_addend = 0;
+	    }
+	  else
+	    {
+	      rela.r_addend = (-(h->plt.offset + 4)
+			       - splt->output_section->vma
+			       - splt->output_offset);
+	    }
 	}
       rela.r_info = SPARC_ELF_R_INFO (htab, NULL, h->dynindx, R_SPARC_JMP_SLOT);
 
@@ -3577,10 +3796,12 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd,
       SPARC_ELF_APPEND_RELA (htab, output_bfd, s, &rela);
     }
 
-  /* Mark some specially defined symbols as absolute.  */
+  /* Mark some specially defined symbols as absolute.  On VxWorks,
+     _GLOBAL_OFFSET_TABLE_ is not absolute: it is relative to the
+     ".got" section.  Likewise _PROCEDURE_LINKAGE_TABLE_ and ".plt".  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || h == htab->elf.hgot
-      || h == htab->elf.hplt)
+      || (!htab->is_vxworks
+	  && (h == htab->elf.hgot || h == htab->elf.hplt)))
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
@@ -3648,13 +3869,14 @@ sparc64_finish_dyn (bfd *output_bfd, struct bfd_link_info *info,
 #endif
 
 static bfd_boolean
-sparc32_finish_dyn (bfd *output_bfd,
-		    struct bfd_link_info *info ATTRIBUTE_UNUSED,
+sparc32_finish_dyn (bfd *output_bfd, struct bfd_link_info *info,
 		    bfd *dynobj, asection *sdyn,
 		    asection *splt ATTRIBUTE_UNUSED)
 {
   Elf32_External_Dyn *dyncon, *dynconend;
+  struct _bfd_sparc_elf_link_hash_table *htab;
 
+  htab = _bfd_sparc_elf_hash_table (info);
   dyncon = (Elf32_External_Dyn *) sdyn->contents;
   dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
   for (; dyncon < dynconend; dyncon++)
@@ -3665,34 +3887,150 @@ sparc32_finish_dyn (bfd *output_bfd,
 
       bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
 
-      switch (dyn.d_tag)
+      if (htab->is_vxworks && dyn.d_tag == DT_RELASZ)
 	{
-	case DT_PLTGOT:   name = ".plt"; size = FALSE; break;
-	case DT_PLTRELSZ: name = ".rela.plt"; size = TRUE; break;
-	case DT_JMPREL:   name = ".rela.plt"; size = FALSE; break;
-	default:	  name = NULL; size = FALSE; break;
+	  /* On VxWorks, DT_RELASZ should not include the relocations
+	     in .rela.plt.  */
+	  if (htab->srelplt)
+	    {
+	      dyn.d_un.d_val -= htab->srelplt->size;
+	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+	    }
 	}
-
-      if (name != NULL)
+      else if (htab->is_vxworks && dyn.d_tag == DT_PLTGOT)
 	{
-	  asection *s;
+	  /* On VxWorks, DT_PLTGOT should point to the start of the GOT,
+	     not to the start of the PLT.  */
+	  if (htab->sgotplt)
+	    {
+	      dyn.d_un.d_val = (htab->sgotplt->output_section->vma
+				+ htab->sgotplt->output_offset);
+	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+	    }
+	}
+      else
+	{
+	  switch (dyn.d_tag)
+	    {
+	    case DT_PLTGOT:   name = ".plt"; size = FALSE; break;
+	    case DT_PLTRELSZ: name = ".rela.plt"; size = TRUE; break;
+	    case DT_JMPREL:   name = ".rela.plt"; size = FALSE; break;
+	    default:	  name = NULL; size = FALSE; break;
+	    }
 
-	  s = bfd_get_section_by_name (output_bfd, name);
-	  if (s == NULL)
-	    dyn.d_un.d_val = 0;
-	  else
+	  if (name != NULL)
 	    {
-	      if (! size)
-		dyn.d_un.d_ptr = s->vma;
+	      asection *s;
+
+	      s = bfd_get_section_by_name (output_bfd, name);
+	      if (s == NULL)
+		dyn.d_un.d_val = 0;
 	      else
-		dyn.d_un.d_val = s->size;
+		{
+		  if (! size)
+		    dyn.d_un.d_ptr = s->vma;
+		  else
+		    dyn.d_un.d_val = s->size;
+		}
+	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	    }
-	  bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	}
     }
   return TRUE;
 }
 
+/* Install the first PLT entry in a VxWorks executable and make sure that
+   .rela.plt.unloaded relocations have the correct symbol indexes.  */
+
+static void
+sparc_vxworks_finish_exec_plt (bfd *output_bfd, struct bfd_link_info *info)
+{
+  struct _bfd_sparc_elf_link_hash_table *htab;
+  Elf_Internal_Rela rela;
+  bfd_vma got_base;
+  bfd_byte *loc;
+
+  htab = _bfd_sparc_elf_hash_table (info);
+
+  /* Calculate the absolute value of _GLOBAL_OFFSET_TABLE_.  */
+  got_base = (htab->elf.hgot->root.u.def.section->output_section->vma
+	      + htab->elf.hgot->root.u.def.section->output_offset
+	      + htab->elf.hgot->root.u.def.value);
+
+  /* Install the initial PLT entry.  */
+  bfd_put_32 (output_bfd,
+	      sparc_vxworks_exec_plt0_entry[0] + ((got_base + 8) >> 10),
+	      htab->splt->contents);
+  bfd_put_32 (output_bfd,
+	      sparc_vxworks_exec_plt0_entry[1] + ((got_base + 8) & 0x3ff),
+	      htab->splt->contents + 4);
+  bfd_put_32 (output_bfd,
+	      sparc_vxworks_exec_plt0_entry[2],
+	      htab->splt->contents + 8);
+  bfd_put_32 (output_bfd,
+	      sparc_vxworks_exec_plt0_entry[3],
+	      htab->splt->contents + 12);
+  bfd_put_32 (output_bfd,
+	      sparc_vxworks_exec_plt0_entry[4],
+	      htab->splt->contents + 16);
+
+  loc = htab->srelplt2->contents;
+
+  /* Add an unloaded relocation for the initial entry's "sethi".  */
+  rela.r_offset = (htab->splt->output_section->vma
+		   + htab->splt->output_offset);
+  rela.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_HI22);
+  rela.r_addend = 8;
+  bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+  loc += sizeof (Elf32_External_Rela);
+
+  /* Likewise the following "or".  */
+  rela.r_offset += 4;
+  rela.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_LO10);
+  bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+  loc += sizeof (Elf32_External_Rela);
+
+  /* Fix up the remaining .rela.plt.unloaded relocations.  They may have
+     the wrong symbol index for _G_O_T_ or _P_L_T_ depending on the order
+     in which symbols were output.  */
+  while (loc < htab->srelplt2->contents + htab->srelplt2->size)
+    {
+      Elf_Internal_Rela rel;
+
+      /* The entry's initial "sethi" (against _G_O_T_).  */
+      bfd_elf32_swap_reloc_in (output_bfd, loc, &rel);
+      rel.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_HI22);
+      bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
+      loc += sizeof (Elf32_External_Rela);
+
+      /* The following "or" (also against _G_O_T_).  */
+      bfd_elf32_swap_reloc_in (output_bfd, loc, &rel);
+      rel.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_LO10);
+      bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
+      loc += sizeof (Elf32_External_Rela);
+
+      /* The .got.plt entry (against _P_L_T_).  */
+      bfd_elf32_swap_reloc_in (output_bfd, loc, &rel);
+      rel.r_info = ELF32_R_INFO (htab->elf.hplt->indx, R_SPARC_32);
+      bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
+      loc += sizeof (Elf32_External_Rela);
+    }
+}
+
+/* Install the first PLT entry in a VxWorks shared object.  */
+
+static void
+sparc_vxworks_finish_shared_plt (bfd *output_bfd, struct bfd_link_info *info)
+{
+  struct _bfd_sparc_elf_link_hash_table *htab;
+  unsigned int i;
+
+  htab = _bfd_sparc_elf_hash_table (info);
+  for (i = 0; i < ARRAY_SIZE (sparc_vxworks_shared_plt0_entry); i++)
+    bfd_put_32 (output_bfd, sparc_vxworks_shared_plt0_entry[i],
+		htab->splt->contents + i * 4);
+}
+
 bfd_boolean
 _bfd_sparc_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
 {
@@ -3726,18 +4064,24 @@ _bfd_sparc_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i
       /* Initialize the contents of the .plt section.  */
       if (splt->size > 0)
 	{
-	  if (ABI_64_P (output_bfd))
-	    memset (splt->contents, 0, 4 * PLT64_ENTRY_SIZE);
+	  if (htab->is_vxworks)
+	    {
+	      if (info->shared)
+		sparc_vxworks_finish_shared_plt (output_bfd, info);
+	      else
+		sparc_vxworks_finish_exec_plt (output_bfd, info);
+	    }
 	  else
 	    {
-	      memset (splt->contents, 0, 4 * PLT32_ENTRY_SIZE);
-	      bfd_put_32 (output_bfd, (bfd_vma) SPARC_NOP,
-			  splt->contents + splt->size - 4);
+	      memset (splt->contents, 0, htab->plt_header_size);
+	      if (!ABI_64_P (output_bfd))
+		bfd_put_32 (output_bfd, (bfd_vma) SPARC_NOP,
+			    splt->contents + splt->size - 4);
 	    }
 	}
 
-      elf_section_data (splt->output_section)->this_hdr.sh_entsize =
-	(ABI_64_P (output_bfd) ? PLT64_ENTRY_SIZE : PLT32_ENTRY_SIZE);
+      elf_section_data (splt->output_section)->this_hdr.sh_entsize
+	= htab->plt_entry_size;
     }
 
   /* Set the first entry in the global offset table to the address of
diff --git a/bfd/elfxx-sparc.h b/bfd/elfxx-sparc.h
index 624aea52787..0a5a88b6fe3 100644
--- a/bfd/elfxx-sparc.h
+++ b/bfd/elfxx-sparc.h
@@ -61,6 +61,15 @@ struct _bfd_sparc_elf_link_hash_table
   /* Small local sym to section mapping cache.  */
   struct sym_sec_cache sym_sec;
 
+  /* True if the target system is VxWorks.  */
+  int is_vxworks;
+
+  /* The (unloaded but important) .rela.plt.unloaded section, for VxWorks.  */
+  asection *srelplt2;
+
+  /* .got.plt is only used on VxWorks.  */
+  asection *sgotplt;
+
   void (*put_word) (bfd *, bfd_vma, void *);
   void (*append_rela) (bfd *, asection *, Elf_Internal_Rela *);
   bfd_vma (*r_info) (Elf_Internal_Rela *, bfd_vma, bfd_vma);
@@ -70,6 +79,8 @@ struct _bfd_sparc_elf_link_hash_table
   int dynamic_interpreter_size;
   unsigned int word_align_power;
   unsigned int align_power_max;
+  unsigned int plt_header_size;
+  unsigned int plt_entry_size;
   int bytes_per_word;
   int bytes_per_rela;
   int dtpoff_reloc;
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 6d48036f823..2a590a395a5 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -7,7 +7,7 @@
    (This include file is not for users of the library.)
 
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
    Written by Cygnus Support.
@@ -972,6 +972,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_MIPS_TLS_TPREL_HI16",
   "BFD_RELOC_MIPS_TLS_TPREL_LO16",
 
+  "BFD_RELOC_MIPS_COPY",
+  "BFD_RELOC_MIPS_JUMP_SLOT",
+
   "BFD_RELOC_FRV_LABEL16",
   "BFD_RELOC_FRV_LABEL24",
   "BFD_RELOC_FRV_LO16",
@@ -1062,6 +1065,11 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_X86_64_TPOFF32",
   "BFD_RELOC_X86_64_GOTOFF64",
   "BFD_RELOC_X86_64_GOTPC32",
+  "BFD_RELOC_X86_64_GOT64",
+  "BFD_RELOC_X86_64_GOTPCREL64",
+  "BFD_RELOC_X86_64_GOTPC64",
+  "BFD_RELOC_X86_64_GOTPLT64",
+  "BFD_RELOC_X86_64_PLTOFF64",
   "BFD_RELOC_X86_64_GOTPC32_TLSDESC",
   "BFD_RELOC_X86_64_TLSDESC_CALL",
   "BFD_RELOC_X86_64_TLSDESC",
@@ -1340,6 +1348,20 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_BFIN_12_PCREL_JUMP_S",
   "BFD_RELOC_BFIN_24_PCREL_CALL_X",
   "BFD_RELOC_BFIN_24_PCREL_JUMP_L",
+  "BFD_RELOC_BFIN_GOT17M4",
+  "BFD_RELOC_BFIN_GOTHI",
+  "BFD_RELOC_BFIN_GOTLO",
+  "BFD_RELOC_BFIN_FUNCDESC",
+  "BFD_RELOC_BFIN_FUNCDESC_GOT17M4",
+  "BFD_RELOC_BFIN_FUNCDESC_GOTHI",
+  "BFD_RELOC_BFIN_FUNCDESC_GOTLO",
+  "BFD_RELOC_BFIN_FUNCDESC_VALUE",
+  "BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4",
+  "BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI",
+  "BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO",
+  "BFD_RELOC_BFIN_GOTOFF17M4",
+  "BFD_RELOC_BFIN_GOTOFFHI",
+  "BFD_RELOC_BFIN_GOTOFFLO",
   "BFD_RELOC_BFIN_GOT",
   "BFD_RELOC_BFIN_PLTPC",
   "BFD_ARELOC_BFIN_PUSH",
diff --git a/bfd/libcoff.h b/bfd/libcoff.h
index b0b271c09a3..f756f30b1bf 100644
--- a/bfd/libcoff.h
+++ b/bfd/libcoff.h
@@ -4,7 +4,7 @@
 
 /* BFD COFF object file private structure.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005
+   2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
diff --git a/bfd/po/Make-in b/bfd/po/Make-in
index 0885b6f4643..1f33c2fe65c 100644
--- a/bfd/po/Make-in
+++ b/bfd/po/Make-in
@@ -1,6 +1,6 @@
 # Makefile for program source directory in GNU NLS utilities package.
 # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-# Copyright 2001, 2003 Free Software Foundation, Inc.
+# Copyright 2001, 2003, 2006 Free Software Foundation, Inc.
 #
 # This file may be copied and used freely without restrictions.  It can
 # be used in projects which are not available under the GNU Public License
@@ -123,6 +123,7 @@ $(srcdir)/stamp-cat-id: $(PACKAGE).pot
 install: install-exec install-data
 install-exec:
 install-info:
+install-html:
 install-data: install-data-@USE_NLS@
 install-data-no: all
 install-data-yes: all
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 31314e7246f..f1d09a5ab07 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -2139,6 +2139,14 @@ ENUMDOC
   MIPS ELF relocations.
 COMMENT
 
+ENUM
+  BFD_RELOC_MIPS_COPY
+ENUMX
+  BFD_RELOC_MIPS_JUMP_SLOT
+ENUMDOC
+  MIPS ELF relocations (VxWorks extensions).
+COMMENT
+
 ENUM
   BFD_RELOC_FRV_LABEL16
 ENUMX
@@ -2343,6 +2351,16 @@ ENUMX
   BFD_RELOC_X86_64_GOTOFF64
 ENUMX
   BFD_RELOC_X86_64_GOTPC32
+ENUMX
+  BFD_RELOC_X86_64_GOT64
+ENUMX
+  BFD_RELOC_X86_64_GOTPCREL64
+ENUMX
+  BFD_RELOC_X86_64_GOTPC64
+ENUMX
+  BFD_RELOC_X86_64_GOTPLT64
+ENUMX
+  BFD_RELOC_X86_64_PLTOFF64
 ENUMX
   BFD_RELOC_X86_64_GOTPC32_TLSDESC
 ENUMX
@@ -3013,6 +3031,36 @@ ENUM
   BFD_RELOC_BFIN_24_PCREL_JUMP_L
 ENUMDOC
   ADI Blackfin Long Jump pcrel.
+ENUM
+  BFD_RELOC_BFIN_GOT17M4
+ENUMX
+  BFD_RELOC_BFIN_GOTHI
+ENUMX
+  BFD_RELOC_BFIN_GOTLO
+ENUMX
+  BFD_RELOC_BFIN_FUNCDESC
+ENUMX
+  BFD_RELOC_BFIN_FUNCDESC_GOT17M4
+ENUMX
+  BFD_RELOC_BFIN_FUNCDESC_GOTHI
+ENUMX
+  BFD_RELOC_BFIN_FUNCDESC_GOTLO
+ENUMX
+  BFD_RELOC_BFIN_FUNCDESC_VALUE
+ENUMX
+  BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4
+ENUMX
+  BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI
+ENUMX
+  BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO
+ENUMX
+  BFD_RELOC_BFIN_GOTOFF17M4
+ENUMX
+  BFD_RELOC_BFIN_GOTOFFHI
+ENUMX
+  BFD_RELOC_BFIN_GOTOFFLO
+ENUMDOC
+  ADI Blackfin FD-PIC relocations.
 ENUM
   BFD_RELOC_BFIN_GOT
 ENUMDOC
diff --git a/bfd/targets.c b/bfd/targets.c
index 99f300644d1..849eb944fbe 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -554,12 +554,14 @@ extern const bfd_target bfd_efi_app_ia32_vec;
 extern const bfd_target bfd_efi_app_ia64_vec;
 extern const bfd_target bfd_elf32_avr_vec;
 extern const bfd_target bfd_elf32_bfin_vec;
+extern const bfd_target bfd_elf32_bfinfdpic_vec;
 extern const bfd_target bfd_elf32_big_generic_vec;
 extern const bfd_target bfd_elf32_bigarc_vec;
 extern const bfd_target bfd_elf32_bigarm_vec;
 extern const bfd_target bfd_elf32_bigarm_symbian_vec;
 extern const bfd_target bfd_elf32_bigarm_vxworks_vec;
 extern const bfd_target bfd_elf32_bigmips_vec;
+extern const bfd_target bfd_elf32_bigmips_vxworks_vec;
 extern const bfd_target bfd_elf32_cr16c_vec;
 extern const bfd_target bfd_elf32_cris_vec;
 extern const bfd_target bfd_elf32_crx_vec;
@@ -590,6 +592,7 @@ extern const bfd_target bfd_elf32_littlearm_vec;
 extern const bfd_target bfd_elf32_littlearm_symbian_vec;
 extern const bfd_target bfd_elf32_littlearm_vxworks_vec;
 extern const bfd_target bfd_elf32_littlemips_vec;
+extern const bfd_target bfd_elf32_littlemips_vxworks_vec;
 extern const bfd_target bfd_elf32_m32c_vec;
 extern const bfd_target bfd_elf32_m32r_vec;
 extern const bfd_target bfd_elf32_m32rle_vec;
@@ -631,6 +634,7 @@ extern const bfd_target bfd_elf32_shlin_vec;
 extern const bfd_target bfd_elf32_shlnbsd_vec;
 extern const bfd_target bfd_elf32_shnbsd_vec;
 extern const bfd_target bfd_elf32_sparc_vec;
+extern const bfd_target bfd_elf32_sparc_vxworks_vec;
 extern const bfd_target bfd_elf32_tradbigmips_vec;
 extern const bfd_target bfd_elf32_tradlittlemips_vec;
 extern const bfd_target bfd_elf32_us_cris_vec;
@@ -852,6 +856,7 @@ static const bfd_target * const _bfd_target_vector[] = {
 #endif
 	&bfd_elf32_avr_vec,
 	&bfd_elf32_bfin_vec,
+	&bfd_elf32_bfinfdpic_vec,
 
 	/* This, and other vectors, may not be used in any *.mt configuration.
 	   But that does not mean they are unnecessary.  If configured with
@@ -863,6 +868,7 @@ static const bfd_target * const _bfd_target_vector[] = {
 	&bfd_elf32_bigarm_symbian_vec,
 	&bfd_elf32_bigarm_vxworks_vec,
 	&bfd_elf32_bigmips_vec,
+	&bfd_elf32_bigmips_vxworks_vec,
 	&bfd_elf32_cr16c_vec,
 	&bfd_elf32_cris_vec,
 	&bfd_elf32_crx_vec,
@@ -897,6 +903,7 @@ static const bfd_target * const _bfd_target_vector[] = {
 	&bfd_elf32_littlearm_symbian_vec,
 	&bfd_elf32_littlearm_vxworks_vec,
 	&bfd_elf32_littlemips_vec,
+	&bfd_elf32_littlemips_vxworks_vec,
 	&bfd_elf32_m32c_vec,
 	&bfd_elf32_m32r_vec,
         &bfd_elf32_m32rle_vec,
@@ -942,6 +949,7 @@ static const bfd_target * const _bfd_target_vector[] = {
 	&bfd_elf32_sh64blin_vec,
 #endif
 	&bfd_elf32_sparc_vec,
+	&bfd_elf32_sparc_vxworks_vec,
 	&bfd_elf32_tradbigmips_vec,
 	&bfd_elf32_tradlittlemips_vec,
 	&bfd_elf32_us_cris_vec,
diff --git a/bfd/version.h b/bfd/version.h
index 520bd33ca6b..b0bc2463177 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,3 +1,3 @@
-#define BFD_VERSION_DATE 20060320
+#define BFD_VERSION_DATE 20060416
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING @bfd_version_string@
diff --git a/binutils/BRANCHES b/binutils/BRANCHES
index 19eabe7cd12..b770ef4ebfb 100644
--- a/binutils/BRANCHES
+++ b/binutils/BRANCHES
@@ -13,13 +13,13 @@ for the branch (e.g., "no commits without permission of X or Y").
 Organization Branches	Description
 ---------------------	-----------
 binutils-csl-arm-2005q1-branch
-binutils-csl-arm-2006q1-branch
 			CodeSourcery toolchain release branches.
 			Please do not commit to these branches without
 			permission from a CodeSourcery developer.
 
 binutils-csl-gxxpro-3_4-branch
-			CodeSourcery branded GNU Toolchain release branch.
+binutils-csl-2_17-branch
+			CodeSourcery branded GNU Toolchain release branches.
 			Please do not commit to this branch without
 			permission from a CodeSourcery developer.
 
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index cb247a10668..fdb3934a3d9 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,44 @@
+2006-04-12  Nick Clifton  <nickc@redhat.com>
+
+	* objdump.c (objdump_symbol_at_address): Fix typo in comment.
+
+2006-04-10  Ben Elliston  <bje@gnu.org>
+
+	* MAINTAINERS (CGEN Maintainers): Remove myself.
+
+2006-04-06  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* po/Make-in: Add install-html target.
+	* Makefile.am: Add install-html and install-html-recursive targets.
+	* Makefile.in: Regenerate.
+	* configure.in: AC_SUBST datarootdir, docdir and htmldir.
+	* configure: Regenerate.
+	* doc/Makefile.am: Add install-html and install-html-am targets.
+	* doc/Makefile.in: Regenerate.
+
+2006-04-05  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* addr2line.c (long_options): Add new option 'section'.
+	(usage): Document new -j/--section option.
+	(find_offset_in_section): New function.
+	(translate_addresses): Add 'section' parameter.
+	If it is non-null, call find_offset_in_section on it.
+	(process_file): Add 'section_name' parameter.
+	If it is non-null, look for the section in the BFD object.
+	Pass the section to translate_addresses.
+	(main): Handle new -j option.
+	Pass the section name to process_file.
+	* doc/binutils.texi (addr2line): Document new -j/--section option.
+
+2006-03-29  Ben Elliston  <bje@au.ibm.com>
+
+	* resbin.c: Avoid duplicating constants in calls to reswr_alloc.
+
+2006-03-20  Nathan Sidwell  <nathan@codesourcery.com>
+
+	* BRANCHES: Remove binutils-csl-arm-2006q1-branch.  Document
+	binutils-csl-2_17-branch instead.
+
 2006-03-20  Paul Brook  <paul@codesourcery.com>
 
 	* BRANCHES: Mention binutils-csl-arm-2006q1-branch.
diff --git a/binutils/MAINTAINERS b/binutils/MAINTAINERS
index e98b5df6f52..f5beb0343b4 100644
--- a/binutils/MAINTAINERS
+++ b/binutils/MAINTAINERS
@@ -129,7 +129,7 @@ If you have CGEN related problems you can send email to;
 
 The current CGEN maintainers are:
 
-  Doug Evans, Ben Elliston, Frank Eigler
+  Doug Evans, Frank Eigler
 
      --------- Write After Approval ---------
 
diff --git a/binutils/Makefile.am b/binutils/Makefile.am
index 45b04e36014..1b4e85adb8a 100644
--- a/binutils/Makefile.am
+++ b/binutils/Makefile.am
@@ -115,6 +115,35 @@ OPCODES = ../opcodes/libopcodes.la
 
 LIBIBERTY = ../libiberty/libiberty.a
 
+.PHONY: install-html install-html-am install-html-recursive
+
+install-html:	install-html-recursive	
+	
+install-html-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
 POTFILES = $(CFILES) $(DEBUG_SRCS) $(HFILES)
 po/POTFILES.in: @MAINT@ Makefile
 	for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
diff --git a/binutils/Makefile.in b/binutils/Makefile.in
index 64efd089f76..859beaa9dbd 100644
--- a/binutils/Makefile.in
+++ b/binutils/Makefile.in
@@ -335,12 +335,15 @@ build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
@@ -947,6 +950,35 @@ uninstall-info: uninstall-info-recursive
 	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
 	uninstall uninstall-am uninstall-binPROGRAMS uninstall-info-am
 
+
+.PHONY: install-html install-html-am install-html-recursive
+
+install-html:	install-html-recursive	
+
+install-html-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
 po/POTFILES.in: @MAINT@ Makefile
 	for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
 	  && mv tmp $(srcdir)/po/POTFILES.in
diff --git a/binutils/addr2line.c b/binutils/addr2line.c
index aae69ca3be5..7cd67bc0a1b 100644
--- a/binutils/addr2line.c
+++ b/binutils/addr2line.c
@@ -1,5 +1,5 @@
 /* addr2line.c -- convert addresses to line number and function name
-   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006
    Free Software Foundation, Inc.
    Contributed by Ulrich Lauther <Ulrich.Lauther@mchp.siemens.de>
 
@@ -56,6 +56,7 @@ static struct option long_options[] =
   {"exe", required_argument, NULL, 'e'},
   {"functions", no_argument, NULL, 'f'},
   {"inlines", no_argument, NULL, 'i'},
+  {"section", required_argument, NULL, 'j'},
   {"target", required_argument, NULL, 'b'},
   {"help", no_argument, NULL, 'H'},
   {"version", no_argument, NULL, 'V'},
@@ -65,8 +66,9 @@ static struct option long_options[] =
 static void usage (FILE *, int);
 static void slurp_symtab (bfd *);
 static void find_address_in_section (bfd *, asection *, void *);
-static void translate_addresses (bfd *);
-static void process_file (const char *, const char *);
+static void find_offset_in_section (bfd *, asection *);
+static void translate_addresses (bfd *, asection *);
+static void process_file (const char *, const char *, const char *);
 
 /* Print a usage message to STREAM and exit with STATUS.  */
 
@@ -80,7 +82,8 @@ usage (FILE *stream, int status)
   @<file>                Read options from <file>\n\
   -b --target=<bfdname>  Set the binary file format\n\
   -e --exe=<executable>  Set the input file name (default is a.out)\n\
-  -i --inlines		 Unwind inlined functions\n\
+  -i --inlines           Unwind inlined functions\n\
+  -j --section=<name>    Read section-relative offsets instead of addresses\n\
   -s --basenames         Strip directory names\n\
   -f --functions         Show function names\n\
   -C --demangle[=style]  Demangle function names\n\
@@ -150,11 +153,32 @@ find_address_in_section (bfd *abfd, asection *section,
 				 &filename, &functionname, &line);
 }
 
+/* Look for an offset in a section.  This is directly called.  */
+
+static void
+find_offset_in_section (bfd *abfd, asection *section)
+{
+  bfd_size_type size;
+
+  if (found)
+    return;
+
+  if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0)
+    return;
+
+  size = bfd_get_section_size (section);
+  if (pc >= size)
+    return;
+
+  found = bfd_find_nearest_line (abfd, section, syms, pc,
+				 &filename, &functionname, &line);
+}
+
 /* Read hexadecimal addresses from stdin, translate into
    file_name:line_number and optionally function name.  */
 
 static void
-translate_addresses (bfd *abfd)
+translate_addresses (bfd *abfd, asection *section)
 {
   int read_stdin = (naddr == 0);
 
@@ -177,7 +201,10 @@ translate_addresses (bfd *abfd)
 	}
 
       found = FALSE;
-      bfd_map_over_sections (abfd, find_address_in_section, NULL);
+      if (section)
+	find_offset_in_section (abfd, section);
+      else
+	bfd_map_over_sections (abfd, find_address_in_section, NULL);
 
       if (! found)
 	{
@@ -237,9 +264,11 @@ translate_addresses (bfd *abfd)
 /* Process a file.  */
 
 static void
-process_file (const char *file_name, const char *target)
+process_file (const char *file_name, const char *section_name,
+	      const char *target)
 {
   bfd *abfd;
+  asection *section;
   char **matching;
 
   if (get_file_size (file_name) < 1)
@@ -250,7 +279,7 @@ process_file (const char *file_name, const char *target)
     bfd_fatal (file_name);
 
   if (bfd_check_format (abfd, bfd_archive))
-    fatal (_("%s: can not get addresses from archive"), file_name);
+    fatal (_("%s: cannot get addresses from archive"), file_name);
 
   if (! bfd_check_format_matches (abfd, bfd_object, &matching))
     {
@@ -263,9 +292,18 @@ process_file (const char *file_name, const char *target)
       xexit (1);
     }
 
+  if (section_name != NULL)
+    {
+      section = bfd_get_section_by_name (abfd, section_name);
+      if (section == NULL)
+	fatal (_("%s: cannot find section %s"), file_name, section_name);
+    }
+  else
+    section = NULL;
+
   slurp_symtab (abfd);
 
-  translate_addresses (abfd);
+  translate_addresses (abfd, section);
 
   if (syms != NULL)
     {
@@ -276,12 +314,11 @@ process_file (const char *file_name, const char *target)
   bfd_close (abfd);
 }
 
-int main (int, char **);
-
 int
 main (int argc, char **argv)
 {
   const char *file_name;
+  const char *section_name;
   char *target;
   int c;
 
@@ -303,8 +340,9 @@ main (int argc, char **argv)
   set_default_bfd_target ();
 
   file_name = NULL;
+  section_name = NULL;
   target = NULL;
-  while ((c = getopt_long (argc, argv, "b:Ce:sfHhiVv", long_options, (int *) 0))
+  while ((c = getopt_long (argc, argv, "b:Ce:sfHhij:Vv", long_options, (int *) 0))
 	 != EOF)
     {
       switch (c)
@@ -348,6 +386,9 @@ main (int argc, char **argv)
 	case 'i':
 	  unwind_inlines = TRUE;
 	  break;
+	case 'j':
+	  section_name = optarg;
+	  break;
 	default:
 	  usage (stderr, 1);
 	  break;
@@ -360,7 +401,7 @@ main (int argc, char **argv)
   addr = argv + optind;
   naddr = argc - optind;
 
-  process_file (file_name, target);
+  process_file (file_name, section_name, target);
 
   return 0;
 }
diff --git a/binutils/configure b/binutils/configure
index 6ce8f23d76d..2d8e0cb970c 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL WARN_CFLAGS NO_WERROR YACC LEX LEXLIB LEX_OUTPUT_ROOT CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT HDEFINES AR CC_FOR_BUILD EXEEXT_FOR_BUILD DEMANGLER_NAME NLMCONV_DEFS BUILD_NLMCONV BUILD_SRCONV BUILD_DLLTOOL DLLTOOL_DEFS BUILD_WINDRES BUILD_DLLWRAP BUILD_MISC OBJDUMP_DEFS EMULATION EMULATION_VECTOR LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL WARN_CFLAGS NO_WERROR YACC LEX LEXLIB LEX_OUTPUT_ROOT CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT HDEFINES AR CC_FOR_BUILD EXEEXT_FOR_BUILD DEMANGLER_NAME NLMCONV_DEFS BUILD_NLMCONV BUILD_SRCONV BUILD_DLLTOOL DLLTOOL_DEFS BUILD_WINDRES BUILD_DLLWRAP BUILD_MISC OBJDUMP_DEFS EMULATION EMULATION_VECTOR datarootdir docdir htmldir LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -10812,6 +10812,11 @@ done
 
 
 
+# Required for html and install-html
+
+
+
+
                               ac_config_files="$ac_config_files Makefile doc/Makefile po/Makefile.in:po/Make-in"
           ac_config_commands="$ac_config_commands default"
 cat >confcache <<\_ACEOF
@@ -11563,6 +11568,9 @@ s,@BUILD_MISC@,$BUILD_MISC,;t t
 s,@OBJDUMP_DEFS@,$OBJDUMP_DEFS,;t t
 s,@EMULATION@,$EMULATION,;t t
 s,@EMULATION_VECTOR@,$EMULATION_VECTOR,;t t
+s,@datarootdir@,$datarootdir,;t t
+s,@docdir@,$docdir,;t t
+s,@htmldir@,$htmldir,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
diff --git a/binutils/configure.in b/binutils/configure.in
index 1d426afb87f..10afc537441 100644
--- a/binutils/configure.in
+++ b/binutils/configure.in
@@ -346,6 +346,11 @@ done
 AC_SUBST(EMULATION)
 AC_SUBST(EMULATION_VECTOR)
 
+# Required for html and install-html
+AC_SUBST(datarootdir)
+AC_SUBST(docdir)
+AC_SUBST(htmldir)
+
 AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in,
 [
 case "x$CONFIG_FILES" in
diff --git a/binutils/doc/Makefile.am b/binutils/doc/Makefile.am
index 64c35fd0355..3f79ad4066f 100644
--- a/binutils/doc/Makefile.am
+++ b/binutils/doc/Makefile.am
@@ -157,6 +157,27 @@ $(DEMANGLER_NAME).1: cxxfilt.man Makefile
 # cygnus option.
 install-data-local: install-info
 
+html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+
+install-html: install-html-am
+
+install-html-am: $(HTMLS)
+	@$(NORMAL_INSTALL)
+	test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
+	@list='$(HTMLS)'; for p in $$list; do \
+	  if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
+	  f=$(html__strip_dir) \
+	  if test -d "$$d$$p"; then \
+	    echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+	    echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+	  else \
+	    echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+	  fi; \
+	done
+
 # Maintenance
 
 # We need it for the taz target in ../../Makefile.in.
diff --git a/binutils/doc/Makefile.in b/binutils/doc/Makefile.in
index 4df27fe22e3..3558fc70e77 100644
--- a/binutils/doc/Makefile.in
+++ b/binutils/doc/Makefile.in
@@ -181,12 +181,15 @@ build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
@@ -241,6 +244,7 @@ binutils_TEXINFOS = config.texi
 binutils_TEXI = $(srcdir)/binutils.texi
 MAINTAINERCLEANFILES = config.texi
 MOSTLYCLEANFILES = $(DEMANGLER_NAME).1
+html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 all: all-am
 
 .SUFFIXES:
@@ -685,6 +689,25 @@ $(DEMANGLER_NAME).1: cxxfilt.man Makefile
 # cygnus option.
 install-data-local: install-info
 
+install-html: install-html-am
+
+install-html-am: $(HTMLS)
+	@$(NORMAL_INSTALL)
+	test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
+	@list='$(HTMLS)'; for p in $$list; do \
+	  if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
+	  f=$(html__strip_dir) \
+	  if test -d "$$d$$p"; then \
+	    echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+	    echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+	  else \
+	    echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+	  fi; \
+	done
+
 # Maintenance
 
 # We need it for the taz target in ../../Makefile.in.
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
index 3249106db51..c7d30d5f226 100644
--- a/binutils/doc/binutils.texi
+++ b/binutils/doc/binutils.texi
@@ -2601,6 +2601,7 @@ addr2line [@option{-b} @var{bfdname}|@option{--target=}@var{bfdname}]
           [@option{-e} @var{filename}|@option{--exe=}@var{filename}]
           [@option{-f}|@option{--functions}] [@option{-s}|@option{--basename}]
           [@option{-i}|@option{--inlines}]
+          [@option{-j}|@option{--section=}@var{name}]
           [@option{-H}|@option{--help}] [@option{-V}|@option{--version}]
           [addr addr @dots{}]
 @c man end
@@ -2608,13 +2609,14 @@ addr2line [@option{-b} @var{bfdname}|@option{--target=}@var{bfdname}]
 
 @c man begin DESCRIPTION addr2line
 
-@command{addr2line} translates program addresses into file names and line
-numbers.  Given an address and an executable, it uses the debugging
-information in the executable to figure out which file name and line
-number are associated with a given address.
+@command{addr2line} translates addresses into file names and line numbers.
+Given an address in an executable or an offset in a section of a relocatable
+object, it uses the debugging information to figure out which file name and
+line number are associated with it.
 
-The executable to use is specified with the @option{-e} option.  The
-default is the file @file{a.out}.
+The executable or relocatable object to use is specified with the @option{-e}
+option.  The default is the file @file{a.out}.  The section in the relocatable
+object to use is specified with the @option{-j} option.
 
 @command{addr2line} has two modes of operation.
 
@@ -2682,6 +2684,10 @@ function will also be printed.  For example, if @code{main} inlines
 @code{callee1} which inlines @code{callee2}, and address is from
 @code{callee2}, the source information for @code{callee1} and @code{main}
 will also be printed.
+
+@item -j
+@itemx --section
+Read offsets relative to the specified section instead of absolute addresses.
 @end table
 
 @c man end
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 838f083f7ae..6e5eab56da2 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -899,7 +899,7 @@ objdump_print_address (bfd_vma vma, struct disassemble_info *info)
   objdump_print_addr (vma, info, ! prefix_addresses);
 }
 
-/* Determine of the given address has a symbol associated with it.  */
+/* Determine if the given address has a symbol associated with it.  */
 
 static int
 objdump_symbol_at_address (bfd_vma vma, struct disassemble_info * info)
diff --git a/binutils/po/Make-in b/binutils/po/Make-in
index 77f21f1460f..8a72671a5b7 100644
--- a/binutils/po/Make-in
+++ b/binutils/po/Make-in
@@ -1,6 +1,6 @@
 # Makefile for program source directory in GNU NLS utilities package.
 # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003, 2006 Free Software Foundation, Inc.
 #
 # This file may be copied and used freely without restrictions.  It can
 # be used in projects which are not available under the GNU Public License
@@ -110,6 +110,7 @@ $(srcdir)/stamp-cat-id: $(PACKAGE).pot
 install: install-exec install-data
 install-exec:
 install-info:
+install-html:
 install-data: install-data-@USE_NLS@
 install-data-no: all
 install-data-yes: all
diff --git a/binutils/resbin.c b/binutils/resbin.c
index 2c20a273a1a..80c2596a70b 100644
--- a/binutils/resbin.c
+++ b/binutils/resbin.c
@@ -1331,7 +1331,7 @@ resid_to_bin (struct res_id id, int big_endian)
   if (! id.named)
     {
       d->length = 4;
-      d->data = (unsigned char *) reswr_alloc (4);
+      d->data = (unsigned char *) reswr_alloc (d->length);
       put_16 (big_endian, 0xffff, d->data);
       put_16 (big_endian, id.u.id, d->data + 2);
     }
@@ -1408,7 +1408,7 @@ res_to_bin_accelerator (const struct accelerator *accelerators,
 
       d = (struct bindata *) reswr_alloc (sizeof *d);
       d->length = 8;
-      d->data = (unsigned char *) reswr_alloc (8);
+      d->data = (unsigned char *) reswr_alloc (d->length);
 
       put_16 (big_endian,
 	      a->flags | (a->next != NULL ? 0 : ACC_LAST),
@@ -1434,7 +1434,7 @@ res_to_bin_cursor (const struct cursor *c, int big_endian)
 
   d = (struct bindata *) reswr_alloc (sizeof *d);
   d->length = 4;
-  d->data = (unsigned char *) reswr_alloc (4);
+  d->data = (unsigned char *) reswr_alloc (d->length);
 
   put_16 (big_endian, c->xhotspot, d->data);
   put_16 (big_endian, c->yhotspot, d->data + 2);
@@ -1459,7 +1459,7 @@ res_to_bin_group_cursor (const struct group_cursor *group_cursors,
 
   first = (struct bindata *) reswr_alloc (sizeof *first);
   first->length = 6;
-  first->data = (unsigned char *) reswr_alloc (6);
+  first->data = (unsigned char *) reswr_alloc (first->length);
 
   put_16 (big_endian, 0, first->data);
   put_16 (big_endian, 2, first->data + 2);
@@ -1476,7 +1476,7 @@ res_to_bin_group_cursor (const struct group_cursor *group_cursors,
 
       d = (struct bindata *) reswr_alloc (sizeof *d);
       d->length = 14;
-      d->data = (unsigned char *) reswr_alloc (14);
+      d->data = (unsigned char *) reswr_alloc (d->length);
 
       put_16 (big_endian, gc->width, d->data);
       put_16 (big_endian, gc->height, d->data + 2);
@@ -1642,7 +1642,7 @@ res_to_bin_dialog (const struct dialog *dialog, int big_endian)
 
       d = (struct bindata *) reswr_alloc (sizeof *d);
       d->length = 2;
-      d->data = (unsigned char *) reswr_alloc (2);
+      d->data = (unsigned char *) reswr_alloc (d->length);
 
       length += 2;
 
@@ -1687,7 +1687,7 @@ res_to_bin_fontdir (const struct fontdir *fontdirs, int big_endian)
 
   first = (struct bindata *) reswr_alloc (sizeof *first);
   first->length = 2;
-  first->data = (unsigned char *) reswr_alloc (2);
+  first->data = (unsigned char *) reswr_alloc (first->length);
 
   first->next = NULL;
   pp = &first->next;
@@ -1701,7 +1701,7 @@ res_to_bin_fontdir (const struct fontdir *fontdirs, int big_endian)
 
       d = (struct bindata *) reswr_alloc (sizeof *d);
       d->length = 2;
-      d->data = (unsigned char *) reswr_alloc (2);
+      d->data = (unsigned char *) reswr_alloc (d->length);
 
       put_16 (big_endian, fd->index, d->data);
 
@@ -1733,7 +1733,7 @@ res_to_bin_group_icon (const struct group_icon *group_icons, int big_endian)
 
   first = (struct bindata *) reswr_alloc (sizeof *first);
   first->length = 6;
-  first->data = (unsigned char *) reswr_alloc (6);
+  first->data = (unsigned char *) reswr_alloc (first->length);
 
   put_16 (big_endian, 0, first->data);
   put_16 (big_endian, 1, first->data + 2);
@@ -1750,7 +1750,7 @@ res_to_bin_group_icon (const struct group_icon *group_icons, int big_endian)
 
       d = (struct bindata *) reswr_alloc (sizeof *d);
       d->length = 14;
-      d->data = (unsigned char *) reswr_alloc (14);
+      d->data = (unsigned char *) reswr_alloc (d->length);
 
       d->data[0] = gi->width;
       d->data[1] = gi->height;
@@ -1875,7 +1875,7 @@ res_to_bin_menuexitems (const struct menuitem *items, int big_endian)
 
       d = (struct bindata *) reswr_alloc (sizeof *d);
       d->length = 12;
-      d->data = (unsigned char *) reswr_alloc (12);
+      d->data = (unsigned char *) reswr_alloc (d->length);
 
       length += 12;
 
@@ -1903,7 +1903,7 @@ res_to_bin_menuexitems (const struct menuitem *items, int big_endian)
 
 	  d = (struct bindata *) reswr_alloc (sizeof *d);
 	  d->length = 4;
-	  d->data = (unsigned char *) reswr_alloc (4);
+	  d->data = (unsigned char *) reswr_alloc (d->length);
 
 	  put_32 (big_endian, mi->help, d->data);
 
@@ -1948,13 +1948,13 @@ res_to_bin_rcdata (const struct rcdata_item *items, int big_endian)
 
 	case RCDATA_WORD:
 	  d->length = 2;
-	  d->data = (unsigned char *) reswr_alloc (2);
+	  d->data = (unsigned char *) reswr_alloc (d->length);
 	  put_16 (big_endian, ri->u.word, d->data);
 	  break;
 
 	case RCDATA_DWORD:
 	  d->length = 4;
-	  d->data = (unsigned char *) reswr_alloc (4);
+	  d->data = (unsigned char *) reswr_alloc (d->length);
 	  put_32 (big_endian, ri->u.dword, d->data);
 	  break;
 
@@ -2060,7 +2060,7 @@ res_to_bin_versioninfo (const struct versioninfo *versioninfo, int big_endian)
 
   first = (struct bindata *) reswr_alloc (sizeof *first);
   first->length = 6;
-  first->data = (unsigned char *) reswr_alloc (6);
+  first->data = (unsigned char *) reswr_alloc (first->length);
 
   length = 6;
 
@@ -2086,7 +2086,7 @@ res_to_bin_versioninfo (const struct versioninfo *versioninfo, int big_endian)
 
       d = (struct bindata *) reswr_alloc (sizeof *d);
       d->length = 52;
-      d->data = (unsigned char *) reswr_alloc (52);
+      d->data = (unsigned char *) reswr_alloc (d->length);
 
       length += 52;
 
@@ -2120,7 +2120,7 @@ res_to_bin_versioninfo (const struct versioninfo *versioninfo, int big_endian)
 
       vid = (struct bindata *) reswr_alloc (sizeof *vid);
       vid->length = 6;
-      vid->data = (unsigned char *) reswr_alloc (6);
+      vid->data = (unsigned char *) reswr_alloc (vid->length);
 
       length += 6;
       vilen = 6;
@@ -2153,7 +2153,7 @@ res_to_bin_versioninfo (const struct versioninfo *versioninfo, int big_endian)
 
 	    vsd = (struct bindata *) reswr_alloc (sizeof *vsd);
 	    vsd->length = 6;
-	    vsd->data = (unsigned char *) reswr_alloc (6);
+	    vsd->data = (unsigned char *) reswr_alloc (vsd->length);
 
 	    length += 6;
 	    vilen += 6;
@@ -2183,7 +2183,7 @@ res_to_bin_versioninfo (const struct versioninfo *versioninfo, int big_endian)
 
 		vssd = (struct bindata *) reswr_alloc (sizeof *vssd);
 		vssd->length = 6;
-		vssd->data = (unsigned char *) reswr_alloc (6);
+		vssd->data = (unsigned char *) reswr_alloc (vssd->length);
 
 		length += 6;
 		vilen += 6;
@@ -2241,7 +2241,7 @@ res_to_bin_versioninfo (const struct versioninfo *versioninfo, int big_endian)
 
 	    vvd = (struct bindata *) reswr_alloc (sizeof *vvd);
 	    vvd->length = 6;
-	    vvd->data = (unsigned char *) reswr_alloc (6);
+	    vvd->data = (unsigned char *) reswr_alloc (vvd->length);
 
 	    length += 6;
 	    vilen += 6;
@@ -2271,7 +2271,7 @@ res_to_bin_versioninfo (const struct versioninfo *versioninfo, int big_endian)
 
 		vvsd = (struct bindata *) reswr_alloc (sizeof *vvsd);
 		vvsd->length = 4;
-		vvsd->data = (unsigned char *) reswr_alloc (4);
+		vvsd->data = (unsigned char *) reswr_alloc (vvsd->length);
 
 		length += 4;
 		vilen += 4;
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index 3a74c9f8e6d..a7e6ad6d975 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2006-04-10  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* lib/utils-lib.exp (default_binutils_run): Check exit status.
+
 2005-12-24  Ben Elliston  <bje@gnu.org>
 
 	* config/default.exp: Do not load the unneeded util-defs.exp.
diff --git a/binutils/testsuite/lib/utils-lib.exp b/binutils/testsuite/lib/utils-lib.exp
index bb819a3766f..f7970b29269 100644
--- a/binutils/testsuite/lib/utils-lib.exp
+++ b/binutils/testsuite/lib/utils-lib.exp
@@ -73,6 +73,12 @@ proc default_binutils_run { prog progargs } {
     if {![string match "" $exec_output]} then {
 	send_log "$exec_output\n"
 	verbose "$exec_output"
+    } else {
+	if { [lindex $state 0] != 0 } {
+	    set exec_output "$prog exited with status [lindex $state 0]"
+	    send_log "$exec_output\n"
+	    verbose "$exec_output"
+	}
     }
     return $exec_output
 }
diff --git a/compile b/compile
deleted file mode 100755
index 1b1d2321695..00000000000
--- a/compile
+++ /dev/null
@@ -1,142 +0,0 @@
-#! /bin/sh
-# Wrapper for compilers which do not understand `-c -o'.
-
-scriptversion=2005-05-14.22
-
-# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
-# Written by Tom Tromey <tromey@cygnus.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-case $1 in
-  '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
-     exit 1;
-     ;;
-  -h | --h*)
-    cat <<\EOF
-Usage: compile [--help] [--version] PROGRAM [ARGS]
-
-Wrapper for compilers which do not understand `-c -o'.
-Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
-arguments, and rename the output as expected.
-
-If you are trying to build a whole package this is not the
-right script to run: please start by reading the file `INSTALL'.
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
-    exit $?
-    ;;
-  -v | --v*)
-    echo "compile $scriptversion"
-    exit $?
-    ;;
-esac
-
-ofile=
-cfile=
-eat=
-
-for arg
-do
-  if test -n "$eat"; then
-    eat=
-  else
-    case $1 in
-      -o)
-	# configure might choose to run compile as `compile cc -o foo foo.c'.
-	# So we strip `-o arg' only if arg is an object.
-	eat=1
-	case $2 in
-	  *.o | *.obj)
-	    ofile=$2
-	    ;;
-	  *)
-	    set x "$@" -o "$2"
-	    shift
-	    ;;
-	esac
-	;;
-      *.c)
-	cfile=$1
-	set x "$@" "$1"
-	shift
-	;;
-      *)
-	set x "$@" "$1"
-	shift
-	;;
-    esac
-  fi
-  shift
-done
-
-if test -z "$ofile" || test -z "$cfile"; then
-  # If no `-o' option was seen then we might have been invoked from a
-  # pattern rule where we don't need one.  That is ok -- this is a
-  # normal compilation that the losing compiler can handle.  If no
-  # `.c' file was seen then we are probably linking.  That is also
-  # ok.
-  exec "$@"
-fi
-
-# Name of file we expect compiler to create.
-cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
-
-# Create the lock directory.
-# Note: use `[/.-]' here to ensure that we don't use the same name
-# that we are using for the .o file.  Also, base the name on the expected
-# object file name, since that is what matters with a parallel build.
-lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
-while true; do
-  if mkdir "$lockdir" >/dev/null 2>&1; then
-    break
-  fi
-  sleep 1
-done
-# FIXME: race condition here if user kills between mkdir and trap.
-trap "rmdir '$lockdir'; exit 1" 1 2 15
-
-# Run the compile.
-"$@"
-ret=$?
-
-if test -f "$cofile"; then
-  mv "$cofile" "$ofile"
-elif test -f "${cofile}bj"; then
-  mv "${cofile}bj" "$ofile"
-fi
-
-rmdir "$lockdir"
-exit $ret
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/configure b/configure
index 2dae3f1c722..dbcbdfef7d3 100755
--- a/configure
+++ b/configure
@@ -43,6 +43,12 @@ ac_help="$ac_help
                           (and sometimes confusing) to the casual installer"
 ac_help="$ac_help
   --enable-werror         enable -Werror in bootstrap stage2 and later"
+ac_help="$ac_help
+  --with-datarootdir	Use datarootdir as the data root directory."
+ac_help="$ac_help
+  --with-docdir	Install documentation in this directory."
+ac_help="$ac_help
+  --with-htmldir	Install html in this directory."
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -601,7 +607,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:605: checking host system type" >&5
+echo "configure:611: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -622,7 +628,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:626: checking target system type" >&5
+echo "configure:632: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -640,7 +646,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:644: checking build system type" >&5
+echo "configure:650: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -695,7 +701,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:699: checking for a BSD compatible install" >&5
+echo "configure:705: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -748,7 +754,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:752: checking whether ln works" >&5
+echo "configure:758: checking whether ln works" >&5
 if eval "test \"`echo '$''{'acx_cv_prog_LN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -772,7 +778,7 @@ else
 fi
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:776: checking whether ln -s works" >&5
+echo "configure:782: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1857,7 +1863,7 @@ else
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1861: checking for $ac_word" >&5
+echo "configure:1867: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1887,7 +1893,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1891: checking for $ac_word" >&5
+echo "configure:1897: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1938,7 +1944,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1942: checking for $ac_word" >&5
+echo "configure:1948: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1970,7 +1976,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1974: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1980: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1981,12 +1987,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 1985 "configure"
+#line 1991 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2012,12 +2018,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2016: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2022: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2021: checking whether we are using GNU C" >&5
+echo "configure:2027: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2026,7 +2032,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2045,7 +2051,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2049: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2055: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2112,7 +2118,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gnatbind; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2116: checking for $ac_word" >&5
+echo "configure:2122: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2144,7 +2150,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "gnatbind", so it can be a program name with args.
 set dummy gnatbind; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2148: checking for $ac_word" >&5
+echo "configure:2154: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2177,7 +2183,7 @@ fi
 fi
 
 echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6
-echo "configure:2181: checking whether compiler driver understands Ada" >&5
+echo "configure:2187: checking whether compiler driver understands Ada" >&5
 if eval "test \"`echo '$''{'acx_cv_cc_gcc_supports_ada'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2209,7 +2215,7 @@ else
 fi
 
 echo $ac_n "checking how to compare bootstrapped objects""... $ac_c" 1>&6
-echo "configure:2213: checking how to compare bootstrapped objects" >&5
+echo "configure:2219: checking how to compare bootstrapped objects" >&5
 if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2307,9 +2313,9 @@ saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $gmpinc"
 # Check GMP actually works
 echo $ac_n "checking for correct version of gmp.h""... $ac_c" 1>&6
-echo "configure:2311: checking for correct version of gmp.h" >&5
+echo "configure:2317: checking for correct version of gmp.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2313 "configure"
+#line 2319 "configure"
 #include "confdefs.h"
 #include "gmp.h"
 int main() {
@@ -2320,7 +2326,7 @@ choke me
 
 ; return 0; }
 EOF
-if { (eval echo configure:2324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -2333,12 +2339,12 @@ rm -f conftest*
 
 if test x"$have_gmp" = xyes; then
   echo $ac_n "checking for MPFR""... $ac_c" 1>&6
-echo "configure:2337: checking for MPFR" >&5
+echo "configure:2343: checking for MPFR" >&5
 
   saved_LIBS="$LIBS"
   LIBS="$LIBS $gmplibs"
   cat > conftest.$ac_ext <<EOF
-#line 2342 "configure"
+#line 2348 "configure"
 #include "confdefs.h"
 #include <gmp.h>
 #include <mpfr.h>
@@ -2346,7 +2352,7 @@ int main() {
 mpfr_t n; mpfr_init(n);
 ; return 0; }
 EOF
-if { (eval echo configure:2350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -3397,7 +3403,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3401: checking for $ac_word" >&5
+echo "configure:3407: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3437,7 +3443,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3441: checking for $ac_word" >&5
+echo "configure:3447: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3476,7 +3482,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3480: checking for $ac_word" >&5
+echo "configure:3486: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_M4'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3515,7 +3521,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3519: checking for $ac_word" >&5
+echo "configure:3525: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3555,7 +3561,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3559: checking for $ac_word" >&5
+echo "configure:3565: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3594,7 +3600,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3598: checking for $ac_word" >&5
+echo "configure:3604: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3628,10 +3634,10 @@ case " $build_configdirs " in
   *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
   *)
 
-    # For an installed makeinfo, we require it to be from texinfo 4.2 or
+    # For an installed makeinfo, we require it to be from texinfo 4.4 or
     # higher, else we use the "missing" dummy.
     if ${MAKEINFO} --version \
-       | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])' >/dev/null 2>&1; then
+       | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
       :
     else
       MAKEINFO="$MISSING makeinfo"
@@ -3647,7 +3653,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3651: checking for $ac_word" >&5
+echo "configure:3657: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_EXPECT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3688,7 +3694,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3692: checking for $ac_word" >&5
+echo "configure:3698: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RUNTEST'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3736,7 +3742,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3740: checking for $ac_word" >&5
+echo "configure:3746: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3767,7 +3773,7 @@ fi
     # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3771: checking for $ac_word" >&5
+echo "configure:3777: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3811,7 +3817,7 @@ fi
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3815: checking for $ac_word" >&5
+echo "configure:3821: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3842,7 +3848,7 @@ fi
     # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3846: checking for $ac_word" >&5
+echo "configure:3852: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3886,7 +3892,7 @@ fi
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3890: checking for $ac_word" >&5
+echo "configure:3896: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3917,7 +3923,7 @@ fi
     # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3921: checking for $ac_word" >&5
+echo "configure:3927: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3961,7 +3967,7 @@ fi
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3965: checking for $ac_word" >&5
+echo "configure:3971: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3992,7 +3998,7 @@ fi
     # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3996: checking for $ac_word" >&5
+echo "configure:4002: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4036,7 +4042,7 @@ fi
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4040: checking for $ac_word" >&5
+echo "configure:4046: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LIPO'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4067,7 +4073,7 @@ fi
     # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4071: checking for $ac_word" >&5
+echo "configure:4077: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LIPO'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4111,7 +4117,7 @@ fi
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4115: checking for $ac_word" >&5
+echo "configure:4121: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4142,7 +4148,7 @@ fi
     # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4146: checking for $ac_word" >&5
+echo "configure:4152: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4186,7 +4192,7 @@ fi
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4190: checking for $ac_word" >&5
+echo "configure:4196: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4217,7 +4223,7 @@ fi
     # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4221: checking for $ac_word" >&5
+echo "configure:4227: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4256,7 +4262,7 @@ fi
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4260: checking for $ac_word" >&5
+echo "configure:4266: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4287,7 +4293,7 @@ fi
     # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4291: checking for $ac_word" >&5
+echo "configure:4297: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4326,7 +4332,7 @@ fi
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4330: checking for $ac_word" >&5
+echo "configure:4336: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4357,7 +4363,7 @@ fi
     # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4361: checking for $ac_word" >&5
+echo "configure:4367: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4401,7 +4407,7 @@ fi
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4405: checking for $ac_word" >&5
+echo "configure:4411: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4432,7 +4438,7 @@ fi
     # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4436: checking for $ac_word" >&5
+echo "configure:4442: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4476,7 +4482,7 @@ fi
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4480: checking for $ac_word" >&5
+echo "configure:4486: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4507,7 +4513,7 @@ fi
     # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4511: checking for $ac_word" >&5
+echo "configure:4517: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4571,7 +4577,7 @@ fi
  if test -n "$with_build_time_tools"; then
   for ncn_progname in cc gcc; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:4575: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:4581: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_CC_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -4588,7 +4594,7 @@ if test -z "$ac_cv_prog_CC_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4592: checking for $ac_word" >&5
+echo "configure:4598: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4619,7 +4625,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4623: checking for $ac_word" >&5
+echo "configure:4629: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4662,7 +4668,7 @@ fi
  if test -n "$with_build_time_tools"; then
   for ncn_progname in c++ g++ cxx gxx; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:4666: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:4672: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_CXX_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -4679,7 +4685,7 @@ if test -z "$ac_cv_prog_CXX_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4683: checking for $ac_word" >&5
+echo "configure:4689: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4710,7 +4716,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4714: checking for $ac_word" >&5
+echo "configure:4720: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4753,7 +4759,7 @@ fi
  if test -n "$with_build_time_tools"; then
   for ncn_progname in gcc; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:4757: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:4763: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_GCC_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -4770,7 +4776,7 @@ if test -z "$ac_cv_prog_GCC_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4774: checking for $ac_word" >&5
+echo "configure:4780: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GCC_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4801,7 +4807,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4805: checking for $ac_word" >&5
+echo "configure:4811: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GCC_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4839,7 +4845,7 @@ fi
  if test -n "$with_build_time_tools"; then
   for ncn_progname in gcj; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:4843: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:4849: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_GCJ_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -4856,7 +4862,7 @@ if test -z "$ac_cv_prog_GCJ_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4860: checking for $ac_word" >&5
+echo "configure:4866: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GCJ_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4887,7 +4893,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4891: checking for $ac_word" >&5
+echo "configure:4897: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GCJ_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4930,7 +4936,7 @@ fi
  if test -n "$with_build_time_tools"; then
   for ncn_progname in gfortran; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:4934: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:4940: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_GFORTRAN_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -4947,7 +4953,7 @@ if test -z "$ac_cv_prog_GFORTRAN_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4951: checking for $ac_word" >&5
+echo "configure:4957: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GFORTRAN_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4978,7 +4984,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4982: checking for $ac_word" >&5
+echo "configure:4988: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GFORTRAN_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5085,7 +5091,7 @@ rm conftest.c
 if test -z "$ac_cv_path_AR_FOR_TARGET" ; then
   if test -n "$with_build_time_tools"; then
     echo $ac_n "checking for ar in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:5089: checking for ar in $with_build_time_tools" >&5
+echo "configure:5095: checking for ar in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/ar; then
       AR_FOR_TARGET=`cd $with_build_time_tools && pwd`/ar
       ac_cv_path_AR_FOR_TARGET=$AR_FOR_TARGET
@@ -5103,7 +5109,7 @@ if test -z "$ac_cv_path_AR_FOR_TARGET" ; then
   # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5107: checking for $ac_word" >&5
+echo "configure:5113: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AR_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5140,7 +5146,7 @@ if test -z "$ac_cv_path_AR_FOR_TARGET" ; then
    if test -n "$with_build_time_tools"; then
   for ncn_progname in ar; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:5144: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:5150: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_AR_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -5157,7 +5163,7 @@ if test -z "$ac_cv_prog_AR_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5161: checking for $ac_word" >&5
+echo "configure:5167: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5188,7 +5194,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5192: checking for $ac_word" >&5
+echo "configure:5198: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5238,7 +5244,7 @@ fi
 if test -z "$ac_cv_path_AS_FOR_TARGET" ; then
   if test -n "$with_build_time_tools"; then
     echo $ac_n "checking for as in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:5242: checking for as in $with_build_time_tools" >&5
+echo "configure:5248: checking for as in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/as; then
       AS_FOR_TARGET=`cd $with_build_time_tools && pwd`/as
       ac_cv_path_AS_FOR_TARGET=$AS_FOR_TARGET
@@ -5256,7 +5262,7 @@ if test -z "$ac_cv_path_AS_FOR_TARGET" ; then
   # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5260: checking for $ac_word" >&5
+echo "configure:5266: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AS_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5293,7 +5299,7 @@ if test -z "$ac_cv_path_AS_FOR_TARGET" ; then
    if test -n "$with_build_time_tools"; then
   for ncn_progname in as; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:5297: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:5303: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_AS_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -5310,7 +5316,7 @@ if test -z "$ac_cv_prog_AS_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5314: checking for $ac_word" >&5
+echo "configure:5320: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5341,7 +5347,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5345: checking for $ac_word" >&5
+echo "configure:5351: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5391,7 +5397,7 @@ fi
 if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" ; then
   if test -n "$with_build_time_tools"; then
     echo $ac_n "checking for dlltool in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:5395: checking for dlltool in $with_build_time_tools" >&5
+echo "configure:5401: checking for dlltool in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/dlltool; then
       DLLTOOL_FOR_TARGET=`cd $with_build_time_tools && pwd`/dlltool
       ac_cv_path_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET
@@ -5409,7 +5415,7 @@ if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" ; then
   # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5413: checking for $ac_word" >&5
+echo "configure:5419: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5446,7 +5452,7 @@ if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" ; then
    if test -n "$with_build_time_tools"; then
   for ncn_progname in dlltool; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:5450: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:5456: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_DLLTOOL_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -5463,7 +5469,7 @@ if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5467: checking for $ac_word" >&5
+echo "configure:5473: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5494,7 +5500,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5498: checking for $ac_word" >&5
+echo "configure:5504: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5544,7 +5550,7 @@ fi
 if test -z "$ac_cv_path_LD_FOR_TARGET" ; then
   if test -n "$with_build_time_tools"; then
     echo $ac_n "checking for ld in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:5548: checking for ld in $with_build_time_tools" >&5
+echo "configure:5554: checking for ld in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/ld; then
       LD_FOR_TARGET=`cd $with_build_time_tools && pwd`/ld
       ac_cv_path_LD_FOR_TARGET=$LD_FOR_TARGET
@@ -5562,7 +5568,7 @@ if test -z "$ac_cv_path_LD_FOR_TARGET" ; then
   # Extract the first word of "ld", so it can be a program name with args.
 set dummy ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5566: checking for $ac_word" >&5
+echo "configure:5572: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_LD_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5599,7 +5605,7 @@ if test -z "$ac_cv_path_LD_FOR_TARGET" ; then
    if test -n "$with_build_time_tools"; then
   for ncn_progname in ld; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:5603: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:5609: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_LD_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -5616,7 +5622,7 @@ if test -z "$ac_cv_prog_LD_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5620: checking for $ac_word" >&5
+echo "configure:5626: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5647,7 +5653,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5651: checking for $ac_word" >&5
+echo "configure:5657: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5697,7 +5703,7 @@ fi
 if test -z "$ac_cv_path_LIPO_FOR_TARGET" ; then
   if test -n "$with_build_time_tools"; then
     echo $ac_n "checking for lipo in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:5701: checking for lipo in $with_build_time_tools" >&5
+echo "configure:5707: checking for lipo in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/lipo; then
       LIPO_FOR_TARGET=`cd $with_build_time_tools && pwd`/lipo
       ac_cv_path_LIPO_FOR_TARGET=$LIPO_FOR_TARGET
@@ -5715,7 +5721,7 @@ if test -z "$ac_cv_path_LIPO_FOR_TARGET" ; then
   # Extract the first word of "lipo", so it can be a program name with args.
 set dummy lipo; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5719: checking for $ac_word" >&5
+echo "configure:5725: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_LIPO_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5752,7 +5758,7 @@ if test -z "$ac_cv_path_LIPO_FOR_TARGET" ; then
    if test -n "$with_build_time_tools"; then
   for ncn_progname in lipo; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:5756: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:5762: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_LIPO_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -5769,7 +5775,7 @@ if test -z "$ac_cv_prog_LIPO_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5773: checking for $ac_word" >&5
+echo "configure:5779: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LIPO_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5800,7 +5806,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5804: checking for $ac_word" >&5
+echo "configure:5810: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LIPO_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5850,7 +5856,7 @@ fi
 if test -z "$ac_cv_path_NM_FOR_TARGET" ; then
   if test -n "$with_build_time_tools"; then
     echo $ac_n "checking for nm in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:5854: checking for nm in $with_build_time_tools" >&5
+echo "configure:5860: checking for nm in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/nm; then
       NM_FOR_TARGET=`cd $with_build_time_tools && pwd`/nm
       ac_cv_path_NM_FOR_TARGET=$NM_FOR_TARGET
@@ -5868,7 +5874,7 @@ if test -z "$ac_cv_path_NM_FOR_TARGET" ; then
   # Extract the first word of "nm", so it can be a program name with args.
 set dummy nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5872: checking for $ac_word" >&5
+echo "configure:5878: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5905,7 +5911,7 @@ if test -z "$ac_cv_path_NM_FOR_TARGET" ; then
    if test -n "$with_build_time_tools"; then
   for ncn_progname in nm; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:5909: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:5915: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_NM_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -5922,7 +5928,7 @@ if test -z "$ac_cv_prog_NM_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5926: checking for $ac_word" >&5
+echo "configure:5932: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5953,7 +5959,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5957: checking for $ac_word" >&5
+echo "configure:5963: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6003,7 +6009,7 @@ fi
 if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then
   if test -n "$with_build_time_tools"; then
     echo $ac_n "checking for objdump in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:6007: checking for objdump in $with_build_time_tools" >&5
+echo "configure:6013: checking for objdump in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/objdump; then
       OBJDUMP_FOR_TARGET=`cd $with_build_time_tools && pwd`/objdump
       ac_cv_path_OBJDUMP_FOR_TARGET=$OBJDUMP_FOR_TARGET
@@ -6021,7 +6027,7 @@ if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then
   # Extract the first word of "objdump", so it can be a program name with args.
 set dummy objdump; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6025: checking for $ac_word" >&5
+echo "configure:6031: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_OBJDUMP_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6058,7 +6064,7 @@ if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then
    if test -n "$with_build_time_tools"; then
   for ncn_progname in objdump; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:6062: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:6068: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_OBJDUMP_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -6075,7 +6081,7 @@ if test -z "$ac_cv_prog_OBJDUMP_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6079: checking for $ac_word" >&5
+echo "configure:6085: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6106,7 +6112,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6110: checking for $ac_word" >&5
+echo "configure:6116: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6156,7 +6162,7 @@ fi
 if test -z "$ac_cv_path_RANLIB_FOR_TARGET" ; then
   if test -n "$with_build_time_tools"; then
     echo $ac_n "checking for ranlib in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:6160: checking for ranlib in $with_build_time_tools" >&5
+echo "configure:6166: checking for ranlib in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/ranlib; then
       RANLIB_FOR_TARGET=`cd $with_build_time_tools && pwd`/ranlib
       ac_cv_path_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET
@@ -6174,7 +6180,7 @@ if test -z "$ac_cv_path_RANLIB_FOR_TARGET" ; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6178: checking for $ac_word" >&5
+echo "configure:6184: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_RANLIB_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6211,7 +6217,7 @@ if test -z "$ac_cv_path_RANLIB_FOR_TARGET" ; then
    if test -n "$with_build_time_tools"; then
   for ncn_progname in ranlib; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:6215: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:6221: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_RANLIB_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -6228,7 +6234,7 @@ if test -z "$ac_cv_prog_RANLIB_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6232: checking for $ac_word" >&5
+echo "configure:6238: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6259,7 +6265,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6263: checking for $ac_word" >&5
+echo "configure:6269: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6309,7 +6315,7 @@ fi
 if test -z "$ac_cv_path_STRIP_FOR_TARGET" ; then
   if test -n "$with_build_time_tools"; then
     echo $ac_n "checking for strip in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:6313: checking for strip in $with_build_time_tools" >&5
+echo "configure:6319: checking for strip in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/strip; then
       STRIP_FOR_TARGET=`cd $with_build_time_tools && pwd`/strip
       ac_cv_path_STRIP_FOR_TARGET=$STRIP_FOR_TARGET
@@ -6327,7 +6333,7 @@ if test -z "$ac_cv_path_STRIP_FOR_TARGET" ; then
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6331: checking for $ac_word" >&5
+echo "configure:6337: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_STRIP_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6364,7 +6370,7 @@ if test -z "$ac_cv_path_STRIP_FOR_TARGET" ; then
    if test -n "$with_build_time_tools"; then
   for ncn_progname in strip; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:6368: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:6374: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_STRIP_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -6381,7 +6387,7 @@ if test -z "$ac_cv_prog_STRIP_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6385: checking for $ac_word" >&5
+echo "configure:6391: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6412,7 +6418,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6416: checking for $ac_word" >&5
+echo "configure:6422: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6462,7 +6468,7 @@ fi
 if test -z "$ac_cv_path_WINDRES_FOR_TARGET" ; then
   if test -n "$with_build_time_tools"; then
     echo $ac_n "checking for windres in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:6466: checking for windres in $with_build_time_tools" >&5
+echo "configure:6472: checking for windres in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/windres; then
       WINDRES_FOR_TARGET=`cd $with_build_time_tools && pwd`/windres
       ac_cv_path_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET
@@ -6480,7 +6486,7 @@ if test -z "$ac_cv_path_WINDRES_FOR_TARGET" ; then
   # Extract the first word of "windres", so it can be a program name with args.
 set dummy windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6484: checking for $ac_word" >&5
+echo "configure:6490: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_WINDRES_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6517,7 +6523,7 @@ if test -z "$ac_cv_path_WINDRES_FOR_TARGET" ; then
    if test -n "$with_build_time_tools"; then
   for ncn_progname in windres; do
     echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
-echo "configure:6521: checking for ${ncn_progname} in $with_build_time_tools" >&5
+echo "configure:6527: checking for ${ncn_progname} in $with_build_time_tools" >&5
     if test -x $with_build_time_tools/${ncn_progname}; then
       ac_cv_prog_WINDRES_FOR_TARGET=$with_build_time_tools/${ncn_progname}
       echo "$ac_t""yes" 1>&6
@@ -6534,7 +6540,7 @@ if test -z "$ac_cv_prog_WINDRES_FOR_TARGET"; then
       # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6538: checking for $ac_word" >&5
+echo "configure:6544: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6565,7 +6571,7 @@ fi
       # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6569: checking for $ac_word" >&5
+echo "configure:6575: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6613,7 +6619,7 @@ fi
 RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
 
 echo $ac_n "checking where to find the target ar""... $ac_c" 1>&6
-echo "configure:6617: checking where to find the target ar" >&5
+echo "configure:6623: checking where to find the target ar" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$AR_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -6646,7 +6652,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target as""... $ac_c" 1>&6
-echo "configure:6650: checking where to find the target as" >&5
+echo "configure:6656: checking where to find the target as" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$AS_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -6679,7 +6685,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target cc""... $ac_c" 1>&6
-echo "configure:6683: checking where to find the target cc" >&5
+echo "configure:6689: checking where to find the target cc" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$CC_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -6712,7 +6718,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target c++""... $ac_c" 1>&6
-echo "configure:6716: checking where to find the target c++" >&5
+echo "configure:6722: checking where to find the target c++" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$CXX_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -6748,7 +6754,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target c++ for libstdc++""... $ac_c" 1>&6
-echo "configure:6752: checking where to find the target c++ for libstdc++" >&5
+echo "configure:6758: checking where to find the target c++ for libstdc++" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$RAW_CXX_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -6784,7 +6790,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target dlltool""... $ac_c" 1>&6
-echo "configure:6788: checking where to find the target dlltool" >&5
+echo "configure:6794: checking where to find the target dlltool" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$DLLTOOL_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -6817,7 +6823,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target gcc""... $ac_c" 1>&6
-echo "configure:6821: checking where to find the target gcc" >&5
+echo "configure:6827: checking where to find the target gcc" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$GCC_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -6850,7 +6856,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target gcj""... $ac_c" 1>&6
-echo "configure:6854: checking where to find the target gcj" >&5
+echo "configure:6860: checking where to find the target gcj" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$GCJ_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -6886,7 +6892,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target gfortran""... $ac_c" 1>&6
-echo "configure:6890: checking where to find the target gfortran" >&5
+echo "configure:6896: checking where to find the target gfortran" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$GFORTRAN_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -6922,7 +6928,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target ld""... $ac_c" 1>&6
-echo "configure:6926: checking where to find the target ld" >&5
+echo "configure:6932: checking where to find the target ld" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$LD_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -6955,7 +6961,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target lipo""... $ac_c" 1>&6
-echo "configure:6959: checking where to find the target lipo" >&5
+echo "configure:6965: checking where to find the target lipo" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$LIPO_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -6978,7 +6984,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target nm""... $ac_c" 1>&6
-echo "configure:6982: checking where to find the target nm" >&5
+echo "configure:6988: checking where to find the target nm" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$NM_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -7011,7 +7017,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target objdump""... $ac_c" 1>&6
-echo "configure:7015: checking where to find the target objdump" >&5
+echo "configure:7021: checking where to find the target objdump" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$OBJDUMP_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -7044,7 +7050,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target ranlib""... $ac_c" 1>&6
-echo "configure:7048: checking where to find the target ranlib" >&5
+echo "configure:7054: checking where to find the target ranlib" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$RANLIB_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -7077,7 +7083,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target strip""... $ac_c" 1>&6
-echo "configure:7081: checking where to find the target strip" >&5
+echo "configure:7087: checking where to find the target strip" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$STRIP_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -7110,7 +7116,7 @@ else
   fi
 fi
 echo $ac_n "checking where to find the target windres""... $ac_c" 1>&6
-echo "configure:7114: checking where to find the target windres" >&5
+echo "configure:7120: checking where to find the target windres" >&5
 if test "x${build}" != "x${host}" ; then
   if expr "x$WINDRES_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
@@ -7171,7 +7177,7 @@ fi
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:7175: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:7181: checking whether to enable maintainer-specific portions of Makefiles" >&5
 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -7230,6 +7236,38 @@ case ${enable_werror} in
 esac
 
 
+# Flags needed to enable html installing and building
+# Check whether --with-datarootdir or --without-datarootdir was given.
+if test "${with_datarootdir+set}" = set; then
+  withval="$with_datarootdir"
+  datarootdir="\${prefix}/${withval}"
+else
+  datarootdir="\${prefix}/share"
+fi
+
+
+# Check whether --with-docdir or --without-docdir was given.
+if test "${with_docdir+set}" = set; then
+  withval="$with_docdir"
+  docdir="\${prefix}/${withval}"
+else
+  docdir="\${datarootdir}/doc"
+fi
+
+
+# Check whether --with-htmldir or --without-htmldir was given.
+if test "${with_htmldir+set}" = set; then
+  withval="$with_htmldir"
+  htmldir="\${prefix}/${withval}"
+else
+  htmldir="\${docdir}"
+fi
+
+
+
+
+
+
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
@@ -7296,15 +7334,34 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
 # Transform confdefs.h into DEFS.
 # Protect against shell expansion while executing Makefile rules.
 # Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
-s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	(][^ 	(]*([^)]*)\)[ 	]*\(.*\),-D\1=\2,g
+t quote
+s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[ 	`~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output.  A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
 
 
 # Without the "./", some shells look in PATH for config.status.
@@ -7475,6 +7532,9 @@ s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
 s%@MAINT@%$MAINT%g
 s%@stage1_cflags@%$stage1_cflags%g
 s%@stage2_werror_flag@%$stage2_werror_flag%g
+s%@datarootdir@%$datarootdir%g
+s%@docdir@%$docdir%g
+s%@htmldir@%$htmldir%g
 
 CEOF
 EOF
diff --git a/configure.in b/configure.in
index da7c63f4f5b..b6ef515e01d 100644
--- a/configure.in
+++ b/configure.in
@@ -2203,10 +2203,10 @@ case " $build_configdirs " in
   *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
   *)
 changequote(,)
-    # For an installed makeinfo, we require it to be from texinfo 4.2 or
+    # For an installed makeinfo, we require it to be from texinfo 4.4 or
     # higher, else we use the "missing" dummy.
     if ${MAKEINFO} --version \
-       | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])' >/dev/null 2>&1; then
+       | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
       :
     else
       MAKEINFO="$MISSING makeinfo"
@@ -2384,4 +2384,24 @@ case ${enable_werror} in
 esac
 AC_SUBST(stage2_werror_flag)
 
+# Flags needed to enable html installing and building
+AC_ARG_WITH(datarootdir,
+[  --with-datarootdir	Use datarootdir as the data root directory.],
+[datarootdir="\${prefix}/${withval}"],
+[datarootdir="\${prefix}/share"])
+
+AC_ARG_WITH(docdir,
+[  --with-docdir	Install documentation in this directory.],
+[docdir="\${prefix}/${withval}"],
+[docdir="\${datarootdir}/doc"])
+
+AC_ARG_WITH(htmldir,
+[  --with-htmldir	Install html in this directory.],
+[htmldir="\${prefix}/${withval}"],
+[htmldir="\${docdir}"])
+
+AC_SUBST(datarootdir)
+AC_SUBST(docdir)
+AC_SUBST(htmldir)
+
 AC_OUTPUT(Makefile)
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
deleted file mode 100644
index 4a0de852933..00000000000
--- a/contrib/ChangeLog
+++ /dev/null
@@ -1,7 +0,0 @@
-2002-07-03  Nick Clifton  <nickc@cambridge.redhat.com>
-
-	* ChangeLog: Newly created.
-	* texi2pod.pl: Imported from FSF GCC sources.
-	
-	
-
diff --git a/contrib/texi2pod.pl b/contrib/texi2pod.pl
deleted file mode 100755
index e5560f303de..00000000000
--- a/contrib/texi2pod.pl
+++ /dev/null
@@ -1,431 +0,0 @@
-#! /usr/bin/perl -w
-
-#   Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
-
-# This file is part of GNU CC.
-
-# GNU CC is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# GNU CC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU CC; see the file COPYING.  If not, write to
-# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston MA 02111-1307, USA.
-
-# This does trivial (and I mean _trivial_) conversion of Texinfo
-# markup to Perl POD format.  It's intended to be used to extract
-# something suitable for a manpage from a Texinfo document.
-
-$output = 0;
-$skipping = 0;
-%sects = ();
-$section = "";
-@icstack = ();
-@endwstack = ();
-@skstack = ();
-@instack = ();
-$shift = "";
-%defs = ();
-$fnno = 1;
-$inf = "";
-$ibase = "";
-
-while ($_ = shift) {
-    if (/^-D(.*)$/) {
-	if ($1 ne "") {
-	    $flag = $1;
-	} else {
-	    $flag = shift;
-	}
-	$value = "";
-	($flag, $value) = ($flag =~ /^([^=]+)(?:=(.+))?/);
-	die "no flag specified for -D\n"
-	    unless $flag ne "";
-	die "flags may only contain letters, digits, hyphens, dashes and underscores\n"
-	    unless $flag =~ /^[a-zA-Z0-9_-]+$/;
-	$defs{$flag} = $value;
-    } elsif (/^-/) {
-	usage();
-    } else {
-	$in = $_, next unless defined $in;
-	$out = $_, next unless defined $out;
-	usage();
-    }
-}
-
-if (defined $in) {
-    $inf = gensym();
-    open($inf, "<$in") or die "opening \"$in\": $!\n";
-    $ibase = $1 if $in =~ m|^(.+)/[^/]+$|;
-} else {
-    $inf = \*STDIN;
-}
-
-if (defined $out) {
-    open(STDOUT, ">$out") or die "opening \"$out\": $!\n";
-}
-
-while(defined $inf) {
-while(<$inf>) {
-    # Certain commands are discarded without further processing.
-    /^\@(?:
-	 [a-z]+index		# @*index: useful only in complete manual
-	 |need			# @need: useful only in printed manual
-	 |(?:end\s+)?group	# @group .. @end group: ditto
-	 |page			# @page: ditto
-	 |node			# @node: useful only in .info file
-	 |(?:end\s+)?ifnottex   # @ifnottex .. @end ifnottex: use contents
-	)\b/x and next;
-
-    chomp;
-
-    # Look for filename and title markers.
-    /^\@setfilename\s+([^.]+)/ and $fn = $1, next;
-    /^\@settitle\s+([^.]+)/ and $tl = postprocess($1), next;
-
-    # Identify a man title but keep only the one we are interested in.
-    /^\@c\s+man\s+title\s+([A-Za-z0-9-]+)\s+(.+)/ and do {
-	if (exists $defs{$1}) {
-	    $fn = $1;
-	    $tl = postprocess($2);
-	}
-	next;
-    };
-
-    # Look for blocks surrounded by @c man begin SECTION ... @c man end.
-    # This really oughta be @ifman ... @end ifman and the like, but such
-    # would require rev'ing all other Texinfo translators.
-    /^\@c\s+man\s+begin\s+([A-Z]+)\s+([A-Za-z0-9-]+)/ and do {
-	$output = 1 if exists $defs{$2};
-        $sect = $1;
-	next;
-    };
-    /^\@c\s+man\s+begin\s+([A-Z]+)/ and $sect = $1, $output = 1, next;
-    /^\@c\s+man\s+end/ and do {
-	$sects{$sect} = "" unless exists $sects{$sect};
-	$sects{$sect} .= postprocess($section);
-	$section = "";
-	$output = 0;
-	next;
-    };
-
-    # handle variables
-    /^\@set\s+([a-zA-Z0-9_-]+)\s*(.*)$/ and do {
-	$defs{$1} = $2;
-	next;
-    };
-    /^\@clear\s+([a-zA-Z0-9_-]+)/ and do {
-	delete $defs{$1};
-	next;
-    };
-
-    next unless $output;
-
-    # Discard comments.  (Can't do it above, because then we'd never see
-    # @c man lines.)
-    /^\@c\b/ and next;
-
-    # End-block handler goes up here because it needs to operate even
-    # if we are skipping.
-    /^\@end\s+([a-z]+)/ and do {
-	# Ignore @end foo, where foo is not an operation which may
-	# cause us to skip, if we are presently skipping.
-	my $ended = $1;
-	next if $skipping && $ended !~ /^(?:ifset|ifclear|ignore|menu|iftex)$/;
-
-	die "\@end $ended without \@$ended at line $.\n" unless defined $endw;
-	die "\@$endw ended by \@end $ended at line $.\n" unless $ended eq $endw;
-
-	$endw = pop @endwstack;
-
-	if ($ended =~ /^(?:ifset|ifclear|ignore|menu|iftex)$/) {
-	    $skipping = pop @skstack;
-	    next;
-	} elsif ($ended =~ /^(?:example|smallexample|display)$/) {
-	    $shift = "";
-	    $_ = "";	# need a paragraph break
-	} elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) {
-	    $_ = "\n=back\n";
-	    $ic = pop @icstack;
-	} else {
-	    die "unknown command \@end $ended at line $.\n";
-	}
-    };
-
-    # We must handle commands which can cause skipping even while we
-    # are skipping, otherwise we will not process nested conditionals
-    # correctly.
-    /^\@ifset\s+([a-zA-Z0-9_-]+)/ and do {
-	push @endwstack, $endw;
-	push @skstack, $skipping;
-	$endw = "ifset";
-	$skipping = 1 unless exists $defs{$1};
-	next;
-    };
-
-    /^\@ifclear\s+([a-zA-Z0-9_-]+)/ and do {
-	push @endwstack, $endw;
-	push @skstack, $skipping;
-	$endw = "ifclear";
-	$skipping = 1 if exists $defs{$1};
-	next;
-    };
-
-    /^\@(ignore|menu|iftex)\b/ and do {
-	push @endwstack, $endw;
-	push @skstack, $skipping;
-	$endw = $1;
-	$skipping = 1;
-	next;
-    };
-
-    next if $skipping;
-
-    # Character entities.  First the ones that can be replaced by raw text
-    # or discarded outright:
-    s/\@copyright\{\}/(c)/g;
-    s/\@dots\{\}/.../g;
-    s/\@enddots\{\}/..../g;
-    s/\@([.!? ])/$1/g;
-    s/\@[:-]//g;
-    s/\@bullet(?:\{\})?/*/g;
-    s/\@TeX\{\}/TeX/g;
-    s/\@pounds\{\}/\#/g;
-    s/\@minus(?:\{\})?/-/g;
-    s/\\,/,/g;
-
-    # Now the ones that have to be replaced by special escapes
-    # (which will be turned back into text by unmunge())
-    s/&/&amp;/g;
-    s/\@\{/&lbrace;/g;
-    s/\@\}/&rbrace;/g;
-    s/\@\@/&at;/g;
-
-    # Inside a verbatim block, handle @var specially.
-    if ($shift ne "") {
-	s/\@var\{([^\}]*)\}/<$1>/g;
-    }
-
-    # POD doesn't interpret E<> inside a verbatim block.
-    if ($shift eq "") {
-	s/</&lt;/g;
-	s/>/&gt;/g;
-    } else {
-	s/</&LT;/g;
-	s/>/&GT;/g;
-    }
-
-    # Single line command handlers.
-
-    /^\@include\s+(.+)$/ and do {
-	push @instack, $inf;
-	$inf = gensym();
-
-	# Try cwd and $ibase.
-	open($inf, "<" . $1) 
-	    or open($inf, "<" . $ibase . "/" . $1)
-		or die "cannot open $1 or $ibase/$1: $!\n";
-	next;
-    };
-
-    /^\@(?:section|unnumbered|unnumberedsec|center)\s+(.+)$/
-	and $_ = "\n=head2 $1\n";
-    /^\@subsection\s+(.+)$/
-	and $_ = "\n=head3 $1\n";
-
-    # Block command handlers:
-    /^\@itemize\s+(\@[a-z]+|\*|-)/ and do {
-	push @endwstack, $endw;
-	push @icstack, $ic;
-	$ic = $1;
-	$_ = "\n=over 4\n";
-	$endw = "itemize";
-    };
-
-    /^\@enumerate(?:\s+([a-zA-Z0-9]+))?/ and do {
-	push @endwstack, $endw;
-	push @icstack, $ic;
-	if (defined $1) {
-	    $ic = $1 . ".";
-	} else {
-	    $ic = "1.";
-	}
-	$_ = "\n=over 4\n";
-	$endw = "enumerate";
-    };
-
-    /^\@([fv]?table)\s+(\@[a-z]+)/ and do {
-	push @endwstack, $endw;
-	push @icstack, $ic;
-	$endw = $1;
-	$ic = $2;
-	$ic =~ s/\@(?:samp|strong|key|gcctabopt|env)/B/;
-	$ic =~ s/\@(?:code|kbd)/C/;
-	$ic =~ s/\@(?:dfn|var|emph|cite|i)/I/;
-	$ic =~ s/\@(?:file)/F/;
-	$_ = "\n=over 4\n";
-    };
-
-    /^\@((?:small)?example|display)/ and do {
-	push @endwstack, $endw;
-	$endw = $1;
-	$shift = "\t";
-	$_ = "";	# need a paragraph break
-    };
-
-    /^\@itemx?\s*(.+)?$/ and do {
-	if (defined $1) {
-	    # Entity escapes prevent munging by the <> processing below.
-	    $_ = "\n=item $ic\&LT;$1\&GT;\n";
-	} else {
-	    $_ = "\n=item $ic\n";
-	    $ic =~ y/A-Ya-y/B-Zb-z/;
-	    $ic =~ s/(\d+)/$1 + 1/eg;
-	}
-    };
-
-    $section .= $shift.$_."\n";
-}
-# End of current file.
-close($inf);
-$inf = pop @instack;
-}
-
-die "No filename or title\n" unless defined $fn && defined $tl;
-
-$sects{NAME} = "$fn \- $tl\n";
-$sects{FOOTNOTES} .= "=back\n" if exists $sects{FOOTNOTES};
-
-for $sect (qw(NAME SYNOPSIS DESCRIPTION OPTIONS ENVIRONMENT FILES
-	      BUGS NOTES FOOTNOTES SEEALSO AUTHOR COPYRIGHT)) {
-    if(exists $sects{$sect}) {
-	$head = $sect;
-	$head =~ s/SEEALSO/SEE ALSO/;
-	print "=head1 $head\n\n";
-	print scalar unmunge ($sects{$sect});
-	print "\n";
-    }
-}
-
-sub usage
-{
-    die "usage: $0 [-D toggle...] [infile [outfile]]\n";
-}
-
-sub postprocess
-{
-    local $_ = $_[0];
-
-    # @value{foo} is replaced by whatever 'foo' is defined as.
-    while (m/(\@value\{([a-zA-Z0-9_-]+)\})/g) {
-	if (! exists $defs{$2}) {
-	    print STDERR "Option $2 not defined\n";
-	    s/\Q$1\E//;
-	} else {
-	    $value = $defs{$2};
-	    s/\Q$1\E/$value/;
-	}
-    }
-
-    # Formatting commands.
-    # Temporary escape for @r.
-    s/\@r\{([^\}]*)\}/R<$1>/g;
-    s/\@(?:dfn|var|emph|cite|i)\{([^\}]*)\}/I<$1>/g;
-    s/\@(?:code|kbd)\{([^\}]*)\}/C<$1>/g;
-    s/\@(?:gccoptlist|samp|strong|key|option|env|command|b)\{([^\}]*)\}/B<$1>/g;
-    s/\@sc\{([^\}]*)\}/\U$1/g;
-    s/\@file\{([^\}]*)\}/F<$1>/g;
-    s/\@w\{([^\}]*)\}/S<$1>/g;
-    s/\@(?:dmn|math)\{([^\}]*)\}/$1/g;
-
-    # Cross references are thrown away, as are @noindent and @refill.
-    # (@noindent is impossible in .pod, and @refill is unnecessary.)
-    # @* is also impossible in .pod; we discard it and any newline that
-    # follows it.  Similarly, our macro @gol must be discarded.
-
-    s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
-    s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
-    s/;\s+\@pxref\{(?:[^\}]*)\}//g;
-    s/\@noindent\s*//g;
-    s/\@refill//g;
-    s/\@gol//g;
-    s/\@\*\s*\n?//g;
-
-    # @uref can take one, two, or three arguments, with different
-    # semantics each time.  @url and @email are just like @uref with
-    # one argument, for our purposes.
-    s/\@(?:uref|url|email)\{([^\},]*)\}/&lt;B<$1>&gt;/g;
-    s/\@uref\{([^\},]*),([^\},]*)\}/$2 (C<$1>)/g;
-    s/\@uref\{([^\},]*),([^\},]*),([^\},]*)\}/$3/g;
-
-    # Un-escape <> at this point.
-    s/&LT;/</g;
-    s/&GT;/>/g;
-
-    # Now un-nest all B<>, I<>, R<>.  Theoretically we could have
-    # indefinitely deep nesting; in practice, one level suffices.
-    1 while s/([BIR])<([^<>]*)([BIR])<([^<>]*)>/$1<$2>$3<$4>$1</g;
-
-    # Replace R<...> with bare ...; eliminate empty markup, B<>;
-    # shift white space at the ends of [BI]<...> expressions outside
-    # the expression.
-    s/R<([^<>]*)>/$1/g;
-    s/[BI]<>//g;
-    s/([BI])<(\s+)([^>]+)>/$2$1<$3>/g;
-    s/([BI])<([^>]+?)(\s+)>/$1<$2>$3/g;
-
-    # Extract footnotes.  This has to be done after all other
-    # processing because otherwise the regexp will choke on formatting
-    # inside @footnote.
-    while (/\@footnote/g) {
-	s/\@footnote\{([^\}]+)\}/[$fnno]/;
-	add_footnote($1, $fnno);
-	$fnno++;
-    }
-
-    return $_;
-}
-
-sub unmunge
-{
-    # Replace escaped symbols with their equivalents.
-    local $_ = $_[0];
-
-    s/&lt;/E<lt>/g;
-    s/&gt;/E<gt>/g;
-    s/&lbrace;/\{/g;
-    s/&rbrace;/\}/g;
-    s/&at;/\@/g;
-    s/&amp;/&/g;
-    return $_;
-}
-
-sub add_footnote
-{
-    unless (exists $sects{FOOTNOTES}) {
-	$sects{FOOTNOTES} = "\n=over 4\n\n";
-    }
-
-    $sects{FOOTNOTES} .= "=item $fnno.\n\n"; $fnno++;
-    $sects{FOOTNOTES} .= $_[0];
-    $sects{FOOTNOTES} .= "\n\n";
-}
-
-# stolen from Symbol.pm
-{
-    my $genseq = 0;
-    sub gensym
-    {
-	my $name = "GEN" . $genseq++;
-	my $ref = \*{$name};
-	delete $::{$name};
-	return $ref;
-    }
-}
diff --git a/cpu/ChangeLog b/cpu/ChangeLog
index 2a888e0cf4e..c0019d8f1c8 100644
--- a/cpu/ChangeLog
+++ b/cpu/ChangeLog
@@ -1,3 +1,17 @@
+2006-04-10  DJ Delorie  <dj@redhat.com>
+
+	* m32c.opc (parse_unsigned_bitbase): Take a new parameter which
+	decides if this function accepts symbolic constants or not.
+	(parse_signed_bitbase): Likewise.
+	(parse_unsigned_bitbase8): Pass the new parameter.
+	(parse_unsigned_bitbase11): Likewise.
+	(parse_unsigned_bitbase16): Likewise.
+	(parse_unsigned_bitbase19): Likewise.
+	(parse_unsigned_bitbase27): Likewise.
+	(parse_signed_bitbase8): Likewise.
+	(parse_signed_bitbase11): Likewise.
+	(parse_signed_bitbase19): Likewise.
+	
 2006-03-13  DJ Delorie  <dj@redhat.com>
 
 	* m32c.cpu (Bit3-S): New.
diff --git a/cpu/m32c.opc b/cpu/m32c.opc
index f664e9a2cdd..6b9ef1125e4 100644
--- a/cpu/m32c.opc
+++ b/cpu/m32c.opc
@@ -608,13 +608,14 @@ parse_Bitno16R (CGEN_CPU_DESC cd, const char **strp,
 static const char *
 parse_unsigned_bitbase (CGEN_CPU_DESC cd, const char **strp,
 			int opindex, unsigned long *valuep,
-			unsigned bits)
+			unsigned bits, int allow_syms)
 {
   const char *errmsg = 0;
   unsigned long bit;
   unsigned long base;
   const char *newp = *strp;
   unsigned long long bitbase;
+  long have_zero = 0;
 
   errmsg = cgen_parse_unsigned_integer (cd, & newp, opindex, & bit);
   if (errmsg)
@@ -624,6 +625,11 @@ parse_unsigned_bitbase (CGEN_CPU_DESC cd, const char **strp,
     return "Missing base for bit,base:8";
 
   ++newp;
+
+  if (strncmp (newp, "0x0", 3) == 0 
+      || (newp[0] == '0' && newp[1] != 'x'))
+    have_zero = 1;
+
   errmsg = cgen_parse_unsigned_integer (cd, & newp, opindex, & base);
   if (errmsg)
     return errmsg;
@@ -633,6 +639,21 @@ parse_unsigned_bitbase (CGEN_CPU_DESC cd, const char **strp,
   if (bitbase >= (1ull << bits))
     return _("bit,base is out of range");
 
+  /* If this field may require a relocation then use larger displacement.  */
+  if (! have_zero && base == 0)
+    {
+      switch (allow_syms) {
+      case 0:
+	return _("bit,base out of range for symbol");
+      case 1:
+	break;
+      case 2:
+	if (strncmp (newp, "[sb]", 4) != 0)
+	  return _("bit,base out of range for symbol");
+	break;
+      }
+    }
+
   *valuep = bitbase;
   *strp = newp;
   return 0;
@@ -641,7 +662,7 @@ parse_unsigned_bitbase (CGEN_CPU_DESC cd, const char **strp,
 static const char *
 parse_signed_bitbase (CGEN_CPU_DESC cd, const char **strp,
 		      int opindex, signed long *valuep,
-		      unsigned bits)
+		      unsigned bits, int allow_syms)
 {
   const char *errmsg = 0;
   unsigned long bit;
@@ -649,6 +670,7 @@ parse_signed_bitbase (CGEN_CPU_DESC cd, const char **strp,
   const char *newp = *strp;
   long long bitbase;
   long long limit;
+  long have_zero = 0;
 
   errmsg = cgen_parse_unsigned_integer (cd, & newp, opindex, & bit);
   if (errmsg)
@@ -658,6 +680,11 @@ parse_signed_bitbase (CGEN_CPU_DESC cd, const char **strp,
     return "Missing base for bit,base:8";
 
   ++newp;
+
+  if (strncmp (newp, "0x0", 3) == 0 
+      || (newp[0] == '0' && newp[1] != 'x'))
+    have_zero = 1;
+
   errmsg = cgen_parse_signed_integer (cd, & newp, opindex, & base);
   if (errmsg)
     return errmsg;
@@ -668,6 +695,10 @@ parse_signed_bitbase (CGEN_CPU_DESC cd, const char **strp,
   if (bitbase < -limit || bitbase >= limit)
     return _("bit,base is out of range");
 
+  /* If this field may require a relocation then use larger displacement.  */
+  if (! have_zero && base == 0 && ! allow_syms)
+    return _("bit,base out of range for symbol");
+
   *valuep = bitbase;
   *strp = newp;
   return 0;
@@ -677,56 +708,56 @@ static const char *
 parse_unsigned_bitbase8 (CGEN_CPU_DESC cd, const char **strp,
 			 int opindex, unsigned long *valuep)
 {
-  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 8);
+  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 8, 0);
 }
 
 static const char *
 parse_unsigned_bitbase11 (CGEN_CPU_DESC cd, const char **strp,
 			 int opindex, unsigned long *valuep)
 {
-  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 11);
+  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 11, 0);
 }
 
 static const char *
 parse_unsigned_bitbase16 (CGEN_CPU_DESC cd, const char **strp,
 			  int opindex, unsigned long *valuep)
 {
-  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 16);
+  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 16, 1);
 }
 
 static const char *
 parse_unsigned_bitbase19 (CGEN_CPU_DESC cd, const char **strp,
 			 int opindex, unsigned long *valuep)
 {
-  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 19);
+  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 19, 2);
 }
 
 static const char *
 parse_unsigned_bitbase27 (CGEN_CPU_DESC cd, const char **strp,
 			 int opindex, unsigned long *valuep)
 {
-  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 27);
+  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 27, 1);
 }
 
 static const char *
 parse_signed_bitbase8 (CGEN_CPU_DESC cd, const char **strp,
 		       int opindex, signed long *valuep)
 {
-  return parse_signed_bitbase (cd, strp, opindex, valuep, 8);
+  return parse_signed_bitbase (cd, strp, opindex, valuep, 8, 1);
 }
 
 static const char *
 parse_signed_bitbase11 (CGEN_CPU_DESC cd, const char **strp,
 		       int opindex, signed long *valuep)
 {
-  return parse_signed_bitbase (cd, strp, opindex, valuep, 11);
+  return parse_signed_bitbase (cd, strp, opindex, valuep, 11, 0);
 }
 
 static const char *
 parse_signed_bitbase19 (CGEN_CPU_DESC cd, const char **strp,
 		       int opindex, signed long *valuep)
 {
-  return parse_signed_bitbase (cd, strp, opindex, valuep, 19);
+  return parse_signed_bitbase (cd, strp, opindex, valuep, 19, 1);
 }
 
 /* Parse the suffix as :<char> or as nothing followed by a whitespace.  */
diff --git a/djunpack.bat b/djunpack.bat
deleted file mode 100755
index f09f5ed3251..00000000000
--- a/djunpack.bat
+++ /dev/null
@@ -1,52 +0,0 @@
-@echo off
-Rem
-Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
-Rem format, or else stock DOS/Windows shells will refuse to run it.
-Rem
-Rem This batch file unpacks the GDB distribution while simultaneously
-Rem renaming some of the files whose names are invalid on DOS or conflict
-Rem with other file names after truncation to DOS 8+3 namespace.
-Rem
-Rem Invoke like this:
-Rem
-Rem     djunpack gdb-XYZ.tar
-Rem
-Rem where XYZ is the version number.  If the argument includes leading
-Rem directories, it MUST use backslashes, not forward slashes.
-Rem
-Rem The following 2 lines need to be changed with each new GDB release, to
-Rem be identical to the name of the top-level directory where the GDB
-Rem distribution unpacks itself.
-set GDBVER=gdb-5.0
-if "%GDBVER%"=="gdb-5.0" GoTo EnvOk
-Rem If their environment space is too small, re-exec with a larger one
-command.com /e:4096 /c %0 %1
-GoTo End
-:EnvOk
-if not exist %1 GoTo NoArchive
-djtar -x -p -o %GDBVER%/gdb/config/djgpp/fnchange.lst %1 > fnchange.tmp
-Rem The following uses a feature of COPY whereby it does not copy
-Rem empty files.  We need that because the previous line will create
-Rem an empty fnchange.tmp even if the command failed for some reason.
-copy fnchange.tmp junk.tmp > nul
-if not exist junk.tmp GoTo NoDjTar
-del junk.tmp
-sed -e 's,@V@,%GDBVER%,g' < fnchange.tmp > fnchange.lst
-Rem See the comment above about the reason for using COPY.
-copy fnchange.lst junk.tmp > nul
-if not exist junk.tmp GoTo NoSed
-del junk.tmp
-djtar -x -n fnchange.lst %1
-GoTo End
-:NoSed
-echo FAIL: Sed is not available.
-GoTo End
-:NoDjTar
-echo FAIL: DJTAR is not available or no fnchange.lst file in %1.
-GoTo End
-:NoArchive
-echo FAIL: the file %1 does not seem to exist.
-echo Remember that %1 cannot use forward slashes, only backslashes.
-GoTo End
-:End
-set GDBVER=
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 64fdee6c02b..0d2b80c07d6 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,11 @@
+2006-04-06  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* Makefile.in: Add install-html target. Add htmldir,
+	docdir and datarootdir.
+	* configure.texi: Document install-html target.
+	* configure.in: AC_SUBST datarootdir, docdir, htmldir.
+	* configure: Regenerate.
+
 2006-02-27  Carlos O'Donell  <carlos@codesourcery.com>
 
 	* Makefile.in: TEXI2HTML uses makeinfo. Define 
diff --git a/etc/Makefile.in b/etc/Makefile.in
index df461cfd59c..7d0607d960c 100644
--- a/etc/Makefile.in
+++ b/etc/Makefile.in
@@ -25,7 +25,10 @@ man6dir = $(mandir)/man6
 man7dir = $(mandir)/man7
 man8dir = $(mandir)/man8
 man9dir = $(mandir)/man9
+datarootdir = @datarootdir@
+docdir = @docdir@
 infodir = @infodir@
+htmldir = @htmldir@
 
 SHELL = /bin/sh
 
@@ -97,6 +100,20 @@ html:
 	  fi; \
 	done
 
+install-html: html
+	$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(htmldir)
+	if test ! -f standards.html; then cd $(srcdir); fi; \
+	if test -f standards.html; then \
+	  for i in standards.html*; do \
+	    $(INSTALL_DATA) $$i $(DESTDIR)$(htmldir)/$$i; \
+	  done; \
+	fi
+	if test ! -f configure.html; then cd $(srcdir); fi; \
+	if test -f configure.html; then \
+	  for i in configure.html*; do \
+	    $(INSTALL_DATA) $$i $(DESTDIR)$(htmldir)/$$i; \
+	  done; \
+	fi
 
 dvi:
 	for f in $(DVIFILES); do \
diff --git a/etc/configure b/etc/configure
index 101fcefecfc..82033e9eb39 100755
--- a/etc/configure
+++ b/etc/configure
@@ -1,26 +1,288 @@
 #! /bin/sh
-
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Generated by GNU Autoconf 2.59.
 #
+# Copyright (C) 2003 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
 
-# Defaults:
-ac_help=
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
 ac_default_prefix=/usr/local
-# Any additions from configure.in:
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="Makefile.in"
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA datarootdir docdir htmldir LIBOBJS LTLIBOBJS'
+ac_subst_files=''
 
 # Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
 # The variables have the same names as the options, with
 # dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
+cache_file=/dev/null
 exec_prefix=NONE
-host=NONE
 no_create=
-nonopt=NONE
 no_recursion=
 prefix=NONE
 program_prefix=NONE
@@ -29,10 +291,15 @@ program_transform_name=s,x,x,
 silent=
 site=
 srcdir=
-target=NONE
 verbose=
 x_includes=NONE
 x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
@@ -46,17 +313,9 @@ oldincludedir='/usr/include'
 infodir='${prefix}/info'
 mandir='${prefix}/man'
 
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
 ac_prev=
 for ac_option
 do
-
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
     eval "$ac_prev=\$ac_option"
@@ -64,59 +323,59 @@ do
     continue
   fi
 
-  case "$ac_option" in
-  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) ac_optarg= ;;
-  esac
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case "$ac_option" in
+  case $ac_option in
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir="$ac_optarg" ;;
+    bindir=$ac_optarg ;;
 
   -build | --build | --buil | --bui | --bu)
-    ac_prev=build ;;
+    ac_prev=build_alias ;;
   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build="$ac_optarg" ;;
+    build_alias=$ac_optarg ;;
 
   -cache-file | --cache-file | --cache-fil | --cache-fi \
   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
     ac_prev=cache_file ;;
   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file="$ac_optarg" ;;
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
 
   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
     ac_prev=datadir ;;
   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
   | --da=*)
-    datadir="$ac_optarg" ;;
+    datadir=$ac_optarg ;;
 
   -disable-* | --disable-*)
-    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
-      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
-    fi
-    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
-    eval "enable_${ac_feature}=no" ;;
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
 
   -enable-* | --enable-*)
-    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
-      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
-    fi
-    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
-    case "$ac_option" in
-      *=*) ;;
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
       *) ac_optarg=yes ;;
     esac
-    eval "enable_${ac_feature}='$ac_optarg'" ;;
+    eval "enable_$ac_feature='$ac_optarg'" ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -125,95 +384,47 @@ do
   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
   | --exec=* | --exe=* | --ex=*)
-    exec_prefix="$ac_optarg" ;;
+    exec_prefix=$ac_optarg ;;
 
   -gas | --gas | --ga | --g)
     # Obsolete; use --with-gas.
     with_gas=yes ;;
 
-  -help | --help | --hel | --he)
-    # Omit some internal or obsolete options to make the list less imposing.
-    # This message is too long to be a string in the A/UX 3.1 sh.
-    cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
-  --cache-file=FILE       cache test results in FILE
-  --help                  print this message
-  --no-create             do not create output files
-  --quiet, --silent       do not print \`checking...' messages
-  --version               print the version of autoconf that created configure
-Directory and file names:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [same as prefix]
-  --bindir=DIR            user executables in DIR [EPREFIX/bin]
-  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
-  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
-  --datadir=DIR           read-only architecture-independent data in DIR
-                          [PREFIX/share]
-  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
-  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
-                          [PREFIX/com]
-  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
-  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
-  --includedir=DIR        C header files in DIR [PREFIX/include]
-  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
-  --infodir=DIR           info documentation in DIR [PREFIX/info]
-  --mandir=DIR            man documentation in DIR [PREFIX/man]
-  --srcdir=DIR            find the sources in DIR [configure dir or ..]
-  --program-prefix=PREFIX prepend PREFIX to installed program names
-  --program-suffix=SUFFIX append SUFFIX to installed program names
-  --program-transform-name=PROGRAM
-                          run sed PROGRAM on installed program names
-EOF
-    cat << EOF
-Host type:
-  --build=BUILD           configure for building on BUILD [BUILD=HOST]
-  --host=HOST             configure for HOST [guessed]
-  --target=TARGET         configure for TARGET [TARGET=HOST]
-Features and packages:
-  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --x-includes=DIR        X include files are in DIR
-  --x-libraries=DIR       X library files are in DIR
-EOF
-    if test -n "$ac_help"; then
-      echo "--enable and --with options recognized:$ac_help"
-    fi
-    exit 0 ;;
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
 
   -host | --host | --hos | --ho)
-    ac_prev=host ;;
+    ac_prev=host_alias ;;
   -host=* | --host=* | --hos=* | --ho=*)
-    host="$ac_optarg" ;;
+    host_alias=$ac_optarg ;;
 
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
   | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir="$ac_optarg" ;;
+    includedir=$ac_optarg ;;
 
   -infodir | --infodir | --infodi | --infod | --info | --inf)
     ac_prev=infodir ;;
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir="$ac_optarg" ;;
+    infodir=$ac_optarg ;;
 
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir="$ac_optarg" ;;
+    libdir=$ac_optarg ;;
 
   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
   | --libexe | --libex | --libe)
     ac_prev=libexecdir ;;
   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
   | --libexe=* | --libex=* | --libe=*)
-    libexecdir="$ac_optarg" ;;
+    libexecdir=$ac_optarg ;;
 
   -localstatedir | --localstatedir | --localstatedi | --localstated \
   | --localstate | --localstat | --localsta | --localst \
@@ -222,19 +433,19 @@ EOF
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
-    localstatedir="$ac_optarg" ;;
+    localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
     ac_prev=mandir ;;
   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir="$ac_optarg" ;;
+    mandir=$ac_optarg ;;
 
   -nfp | --nfp | --nf)
     # Obsolete; use --without-fp.
     with_fp=no ;;
 
   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c)
+  | --no-cr | --no-c | -n)
     no_create=yes ;;
 
   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
@@ -248,26 +459,26 @@ EOF
   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir="$ac_optarg" ;;
+    oldincludedir=$ac_optarg ;;
 
   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
     ac_prev=prefix ;;
   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix="$ac_optarg" ;;
+    prefix=$ac_optarg ;;
 
   -program-prefix | --program-prefix | --program-prefi | --program-pref \
   | --program-pre | --program-pr | --program-p)
     ac_prev=program_prefix ;;
   -program-prefix=* | --program-prefix=* | --program-prefi=* \
   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix="$ac_optarg" ;;
+    program_prefix=$ac_optarg ;;
 
   -program-suffix | --program-suffix | --program-suffi | --program-suff \
   | --program-suf | --program-su | --program-s)
     ac_prev=program_suffix ;;
   -program-suffix=* | --program-suffix=* | --program-suffi=* \
   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix="$ac_optarg" ;;
+    program_suffix=$ac_optarg ;;
 
   -program-transform-name | --program-transform-name \
   | --program-transform-nam | --program-transform-na \
@@ -284,7 +495,7 @@ EOF
   | --program-transfo=* | --program-transf=* \
   | --program-trans=* | --program-tran=* \
   | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name="$ac_optarg" ;;
+    program_transform_name=$ac_optarg ;;
 
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
@@ -294,7 +505,7 @@ EOF
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
   | --sbi=* | --sb=*)
-    sbindir="$ac_optarg" ;;
+    sbindir=$ac_optarg ;;
 
   -sharedstatedir | --sharedstatedir | --sharedstatedi \
   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
@@ -305,58 +516,57 @@ EOF
   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
   | --sha=* | --sh=*)
-    sharedstatedir="$ac_optarg" ;;
+    sharedstatedir=$ac_optarg ;;
 
   -site | --site | --sit)
     ac_prev=site ;;
   -site=* | --site=* | --sit=*)
-    site="$ac_optarg" ;;
+    site=$ac_optarg ;;
 
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir="$ac_optarg" ;;
+    srcdir=$ac_optarg ;;
 
   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
   | --syscon | --sysco | --sysc | --sys | --sy)
     ac_prev=sysconfdir ;;
   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir="$ac_optarg" ;;
+    sysconfdir=$ac_optarg ;;
 
   -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target ;;
+    ac_prev=target_alias ;;
   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target="$ac_optarg" ;;
+    target_alias=$ac_optarg ;;
 
   -v | -verbose | --verbose | --verbos | --verbo | --verb)
     verbose=yes ;;
 
-  -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
-    exit 0 ;;
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
-      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
-    fi
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
     ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case "$ac_option" in
-      *=*) ;;
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
       *) ac_optarg=yes ;;
     esac
-    eval "with_${ac_package}='$ac_optarg'" ;;
+    eval "with_$ac_package='$ac_optarg'" ;;
 
   -without-* | --without-*)
-    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
-      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
-    fi
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    eval "with_${ac_package}=no" ;;
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -367,99 +577,110 @@ EOF
     ac_prev=x_includes ;;
   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes="$ac_optarg" ;;
+    x_includes=$ac_optarg ;;
 
   -x-libraries | --x-libraries | --x-librarie | --x-librari \
   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
     ac_prev=x_libraries ;;
   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries="$ac_optarg" ;;
+    x_libraries=$ac_optarg ;;
 
-  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
     ;;
 
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
   *)
-    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
-      echo "configure: warning: $ac_option: invalid host type" 1>&2
-    fi
-    if test "x$nonopt" != xNONE; then
-      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
-    fi
-    nonopt="$ac_option"
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
   esac
 done
 
 if test -n "$ac_prev"; then
-  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
 fi
 
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
-  exec 6>/dev/null
-else
-  exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
 
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+	      localstatedir libdir includedir oldincludedir infodir mandir
 do
-  case "$ac_arg" in
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c) ;;
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
-  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
-  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
-  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
   esac
 done
 
-# NLS nuisances.
-# Only set these to C if already set.  These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
 
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
 
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=Makefile.in
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
   # Try the directory containing this script, then its parent.
-  ac_prog=$0
-  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
-  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
   srcdir=$ac_confdir
   if test ! -r $srcdir/$ac_unique_file; then
     srcdir=..
@@ -469,13 +690,422 @@ else
 fi
 if test ! -r $srcdir/$ac_unique_file; then
   if test "$ac_srcdir_defaulted" = yes; then
-    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
   else
-    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
   fi
 fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+	   test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd $ac_popdir
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
 
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+	echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
 # Prefer explicitly selected file to automatically selected ones.
 if test -z "$CONFIG_SITE"; then
   if test "x$prefix" != xNONE; then
@@ -486,38 +1116,104 @@ if test -z "$CONFIG_SITE"; then
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
-    echo "loading site script $ac_site_file"
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
     . "$ac_site_file"
   fi
 done
 
 if test -r "$cache_file"; then
-  echo "loading cache $cache_file"
-  . $cache_file
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
 else
-  echo "creating cache $cache_file"
-  > $cache_file
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
 fi
 
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
-  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
-  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
-    ac_n= ac_c='
-' ac_t='	'
-  else
-    ac_n=-n ac_c= ac_t=
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
   fi
-else
-  ac_n= ac_c='\c' ac_t=
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 ac_aux_dir=
@@ -530,14 +1226,20 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install.sh -c"
     break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
 fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -546,317 +1248,993 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:555: checking for a BSD compatible install" >&5
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
 if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
-    # Account for people who put trailing slashes in PATH elements.
-    case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
-    *)
-      # OSF1 and SCO ODT 3.0 have their own names for install.
-      # Don't use installbsd from OSF since it installs stuff as root
-      # by default.
-      for ac_prog in ginstall scoinst install; do
-        if test -f $ac_dir/$ac_prog; then
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
-            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
 	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
 	  else
-	    ac_cv_path_install="$ac_dir/$ac_prog -c"
-	    break 2
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
 	  fi
 	fi
       done
-      ;;
-    esac
-  done
-  IFS="$ac_save_IFS"
+    done
+    ;;
+esac
+done
+
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
-    INSTALL="$ac_cv_path_install"
+    INSTALL=$ac_cv_path_install
   else
     # As a last resort, use the slow shell script.  We don't cache a
     # path for INSTALL within a source directory, because that will
     # break other packages using the cache if that directory is
     # removed, or if the path is relative.
-    INSTALL="$ac_install_sh"
+    INSTALL=$ac_install_sh
   fi
 fi
-echo "$ac_t""$INSTALL" 1>&6
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
-trap '' 1 2 15
-cat > confcache <<\EOF
+
+
+
+
+
+          ac_config_files="$ac_config_files Makefile"
+cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
-# scripts and configure runs.  It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
 #
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already.  You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
 #
-EOF
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
 # The following way of writing the cache mishandles newlines in values,
 # but we know of no workaround that is simple, portable, and efficient.
 # So, don't put newlines in cache variables' values.
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
-  *ac_space=\ *)
-    # `set' does not quote correctly, so add quotes (double-quote substitution
-    # turns \\\\ into \\, and sed turns \\ into \).
-    sed -n \
-      -e "s/'/'\\\\''/g" \
-      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
-    ;;
-  *)
-    # `set' quotes correctly as required by POSIX, so do not add quotes.
-    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
-    ;;
-  esac >> confcache
-if cmp -s $cache_file confcache; then
-  :
-else
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
   if test -w $cache_file; then
-    echo "updating cache $cache_file"
-    cat confcache > $cache_file
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
   else
     echo "not updating unwritable cache $cache_file"
   fi
 fi
 rm -f confcache
 
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
 test "x$prefix" = xNONE && prefix=$ac_default_prefix
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[	 ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[	 ]*$//;
+}'
 fi
 
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
 # Transform confdefs.h into DEFS.
 # Protect against shell expansion while executing Makefile rules.
 # Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
-s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
-
-
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\),-D\1=\2,g
+t quote
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[	 `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output.  A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
 
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
 # Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
 # Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
 
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
 do
-  case "\$ac_option" in
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
-    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
-    exit 0 ;;
-  -help | --help | --hel | --he | --h)
-    echo "\$ac_cs_usage"; exit 0 ;;
-  *) echo "\$ac_cs_usage"; exit 1 ;;
-  esac
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
 done
 
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
 
-trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
 
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
 
-CEOF
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
-  if test $ac_beg -gt 1; then
-    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
   else
-    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
   fi
-  if test ! -s conftest.s$ac_file; then
-    ac_more_lines=false
-    rm -f conftest.s$ac_file
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
   else
-    if test -z "$ac_sed_cmds"; then
-      ac_sed_cmds="sed -f conftest.s$ac_file"
-    else
-      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
-    fi
-    ac_file=`expr $ac_file + 1`
-    ac_beg=$ac_end
-    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+    as_ln_s='ln -s'
   fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.59,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
+
+  esac
+  shift
 done
-if test -z "$ac_sed_cmds"; then
-  ac_sed_cmds=cat
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
 fi
-EOF
 
-cat >> $CONFIG_STATUS <<EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
 
-CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
-       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-  *) ac_file_in="${ac_file}.in" ;;
+_ACEOF
+
+
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
   esac
+done
 
-  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
 
-  # Remove last slash and all that follows it.  Not all systems have dirname.
-  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
-  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-    # The file is in a subdirectory.
-    test ! -d "$ac_dir" && mkdir "$ac_dir"
-    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
-    # A "../" for each directory in $ac_dir_suffix.
-    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
-  else
-    ac_dir_suffix= ac_dots=
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@datarootdir@,$datarootdir,;t t
+s,@docdir@,$docdir,;t t
+s,@htmldir@,$htmldir,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
   fi
+fi # test -n "$CONFIG_FILES"
 
-  case "$ac_given_srcdir" in
-  .)  srcdir=.
-      if test -z "$ac_dots"; then top_srcdir=.
-      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
-  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
-  *) # Relative path.
-    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
-    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
   esac
 
-  case "$ac_given_INSTALL" in
-  [/$]*) INSTALL="$ac_given_INSTALL" ;;
-  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
-  esac
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
 
-  echo creating "$ac_file"
-  rm -f "$ac_file"
-  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
-  case "$ac_file" in
-  *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
-  *) ac_comsub= ;;
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
   esac
 
-  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
-  sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+				     sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
 
-EOF
-cat >> $CONFIG_STATUS <<EOF
+done
+_ACEOF
 
-EOF
-cat >> $CONFIG_STATUS <<\EOF
+cat >>$CONFIG_STATUS <<\_ACEOF
 
-exit 0
-EOF
+{ (exit 0); exit 0; }
+_ACEOF
 chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
 
diff --git a/etc/configure.in b/etc/configure.in
index b785068009e..38bc65902e7 100644
--- a/etc/configure.in
+++ b/etc/configure.in
@@ -4,4 +4,9 @@ AC_INIT(Makefile.in)
 
 AC_PROG_INSTALL
 
+AC_SUBST(datarootdir)
+AC_SUBST(docdir)
+AC_SUBST(htmldir)
+
+
 AC_OUTPUT(Makefile)
diff --git a/etc/configure.texi b/etc/configure.texi
index 385a7c44711..58c5285488f 100644
--- a/etc/configure.texi
+++ b/etc/configure.texi
@@ -276,7 +276,9 @@ directory is controlled by @samp{configure} options, as described below.
 
 In the Cygnus tree at present, the info files are built and installed as
 a separate step.  To build them, run @samp{make info}.  To install them,
-run @samp{make install-info}.
+run @samp{make install-info}. The equivalent html files are also built
+and installed in a separate step. To build the html files, run
+@samp{make html}. To install the html files run @samp{make install-html}.
 
 All @samp{configure} scripts support a wide variety of options.  The
 most interesting ones are @samp{--with} and @samp{--enable} options
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 53f3bb25131..e7425364fbb 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,203 @@
+2006-04-14  Sterling Augustine  <sterling@tensilica.com>
+
+	* config/tc-xtensa.c (emit_single_op): Do not relax MOVI
+	instructions when such transformations have been disabled.
+
+2006-04-10  Sterling Augustine  <sterling@tensilica.com>
+
+	* config/tc-xtensa.c (xg_assemble_vliw_tokens): Record loop target
+	symbols in RELAX[_CHECK]_ALIGN_NEXT_OPCODE frags.
+	(xtensa_fix_close_loop_end_frags): Use the recorded values instead of
+	decoding the loop instructions.  Remove current_offset variable.
+	(xtensa_fix_short_loop_frags): Likewise.
+	(min_bytes_to_other_loop_end): Remove current_offset argument.
+
+2006-04-09  Arnold Metselaar  <arnold.metselaar@planet.nl>
+
+	* config/tc-z80.c (z80_optimize_expr): Removed; redundant since 2006-04-04.
+	* config/tc-z80.h (z80_optimize_expr, md_optimize_expr): Removed.
+
+2006-04-07  Joerg Wunsch <j.gnu@uriah.heep.sax.de>
+
+	* gas/config/tc-avr.c (mcu_types): Add support for attiny261,
+	attiny461, attiny861, attiny25, attiny45, attiny85,attiny24,
+	attiny44, attiny84, at90pwm2, at90pwm3, atmega164, atmega324,
+	atmega644, atmega329, atmega3290, atmega649, atmega6490,
+	atmega406, atmega640, atmega1280, atmega1281, at90can32,
+	at90can64, at90usb646, at90usb647, at90usb1286 and
+	at90usb1287.
+	Move atmega48 and atmega88 from AVR_ISA_M8 to AVR_ISA_PWMx.
+
+2006-04-07  Paul Brook  <paul@codesourcery.com>
+
+	* config/tc-arm.c (parse_operands): Set default error message.
+
+2006-04-07  Paul Brook  <paul@codesourcery.com>
+
+	* config/tc-arm.c (parse_tb): Set inst.error before returning FAIL.
+
+2006-04-07  Paul Brook  <paul@codesourcery.com>
+
+	* config/tc-arm.c (md_apply_fix): Set H bit on blx instruction.
+
+2006-04-07  Paul Brook  <paul@codesourcery.com>
+
+	* config/tc-arm.c (THUMB2_LOAD_BIT): Define.
+	(move_or_literal_pool): Handle Thumb-2 instructions.
+	(do_t_ldst): Call move_or_literal_pool for =N addressing modes.
+
+2006-04-07  Alan Modra  <amodra@bigpond.net.au>
+
+	PR 2512.
+	* config/tc-i386.c (match_template): Move 64-bit operand tests
+	inside loop.
+
+2006-04-06  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* po/Make-in: Add install-html target.
+	* Makefile.am: Add install-html and install-html-recursive targets.
+	* Makefile.in: Regenerate.
+	* configure.in: AC_SUBST datarootdir, docdir, htmldir.
+	* configure: Regenerate.
+	* doc/Makefile.am: Add install-html and install-html-am targets.
+	* doc/Makefile.in: Regenerate.
+
+2006-04-06  Alan Modra  <amodra@bigpond.net.au>
+
+	* frags.c (frag_offset_fixed_p): Reinitialise offset before
+	second scan.
+
+2006-04-05  Richard Sandiford  <richard@codesourcery.com>
+	    Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* config/tc-sparc.c (sparc_target_format): Handle TE_VXWORKS.
+	(GOTT_BASE, GOTT_INDEX): New.
+	(tc_gen_reloc): Don't alter relocations against GOTT_BASE and
+	GOTT_INDEX when generating VxWorks PIC.
+	* configure.tgt (sparc*-*-vxworks*): Remove this special case;
+	use the generic *-*-vxworks* stanza instead.
+
+2006-04-04  Alan Modra  <amodra@bigpond.net.au>
+
+	PR 997
+	* frags.c (frag_offset_fixed_p): New function.
+	* frags.h (frag_offset_fixed_p): Declare.
+	* expr.c (expr): Use frag_offset_fixed_p when simplifying subtraction.
+	(resolve_expression): Likewise.
+
+2006-04-03  Sterling Augustine  <sterling@tensilica.com>
+
+	* config/tc-xtensa.c (init_op_placement_info_table): Check for formats
+	of the same length but different numbers of slots.
+
+2006-03-30  Andreas Schwab  <schwab@suse.de>
+
+	* configure.in: Fix help string for --enable-targets option.
+	* configure: Regenerate.
+
+2006-03-28  Nathan Sidwell  <nathan@codesourcery.com>
+
+	* gas/config/tc-m68k.c (find_cf_chip): Merge into ...
+	(m68k_ip): ... here.  Use for all chips.  Protect against buffer
+	overrun and avoid excessive copying.
+
+	* config/tc-m68k.c (m68000_control_regs, m68010_control_regs,
+	m68020_control_regs, m68040_control_regs, m68060_control_regs,
+	mcf_control_regs, mcf5208_control_regs, mcf5213_control_regs,
+	mcf5329_control_regs, mcf5249_control_regs, mcf528x_control_regs,
+	mcfv4e_control_regs, m68010_control_regs): Rename and reorder to ...
+	(m68000_ctrl, m68010_ctrl, m68020_ctrl, m68040_ctrl, m68060_ctrl,
+	mcf_ctrl, mcf5208_ctrl, mcf5213_ctrl, mcf5235_ctrl, mcf5249_ctrl, 
+	mcf5216_ctrl, mcf5250_ctrl, mcf5271_ctrl, mcf5272_ctrl,
+	mcf5282_ctrl, mcfv4e_ctrl): ... these.
+	(mcf5275_ctrl, mcf5329_ctrl, mcf5373_ctrl): New.
+	(struct m68k_cpu): Change chip field to control_regs.
+	(current_chip): Remove.
+	(control_regs): New.
+	(m68k_archs, m68k_extensions): Adjust.
+	(m68k_cpus): Reorder to be in cpu number order.  Adjust.
+	(CPU_ALLOW_MC, CPU_ALLOW_NEGATION): Remove.
+	(find_cf_chip): Reimplement for new organization of cpu table.
+	(select_control_regs): Remove.
+	(mri_chip): Adjust.
+	(struct save_opts): Save control regs, not chip.
+	(s_save, s_restore): Adjust.
+	(m68k_lookup_cpu): Give deprecated warning when necessary.
+	(m68k_init_arch): Adjust.
+	(md_show_usage): Adjust for new cpu table organization.
+
+2006-03-25  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* config/bfin-defs.h (Expr_Node_Type enum): Add Expr_Node_GOT_Reloc.
+	* config/bfin-lex.l: Recognize GOT17M4 and FUNCDESC_GOT17M4.
+	* config/bfin-parse.y: Include "libbfd.h", "elf/common.h" and
+	"elf/bfin.h".
+	(GOT17M4, FUNCDESC_GOT17M4): New tokens of type <value>.
+	(any_gotrel): New rule.
+	(got): Use it, and create Expr_Node_GOT_Reloc nodes.
+	* config/tc-bfin.c: Include "libbfd.h", "elf/common.h" and
+	"elf/bfin.h".
+	(DEFAULT_FLAGS, bfin_flags, bfin_pic_flag): New.
+	(bfin_pic_ptr): New function.
+	(md_pseudo_table): Add it for ".picptr".
+	(OPTION_FDPIC): New macro.
+	(md_longopts): Add -mfdpic.
+	(md_parse_option): Handle it.
+	(md_begin): Set BFD flags.
+	(md_apply_fix3, bfin_fix_adjustable): Handle new relocs.
+	(bfin_gen_ldstidxi): Adjust to match the trees that the parser gives
+	us for GOT relocs.
+	* Makefile.am (bfin-parse.o): Update dependencies.
+	(DEPTC_bfin_elf): Likewise.
+	* Makefile.in: Regenerate.
+
+2006-03-25  Richard Sandiford  <richard@codesourcery.com>
+
+	* config/tc-m68k.c (m68k_cpus): Change cpu_cf5208 entries to use
+	mcfemac instead of mcfmac.
+
+2006-03-22  Richard Sandiford  <richard@codesourcery.com>
+	    Daniel Jacobowitz  <dan@codesourcery.com>
+	    Phil Edwards  <phil@codesourcery.com>
+	    Zack Weinberg  <zack@codesourcery.com>
+	    Mark Mitchell  <mark@codesourcery.com>
+	    Nathan Sidwell  <nathan@codesourcery.com>
+
+	* config/tc-mips.c (mips_target_format): Handle vxworks targets.
+	(md_begin): Complain about -G being used for PIC.  Don't change
+	the text, data and bss alignments on VxWorks.
+	(reloc_needs_lo_p): Don't return true for R_MIPS_GOT16 when
+	generating VxWorks PIC.
+	(load_address): Extend SVR4_PIC handling to VXWORKS_PIC.
+	(macro): Likewise, but do not treat la $25 specially for
+	VxWorks PIC, and do not handle jal.
+	(OPTION_MVXWORKS_PIC): New macro.
+	(md_longopts): Add -mvxworks-pic.
+	(md_parse_option): Don't complain about using PIC and -G together here.
+	Handle OPTION_MVXWORKS_PIC.
+	(md_estimate_size_before_relax): Always use the first relaxation
+	sequence on VxWorks.
+	* config/tc-mips.h (VXWORKS_PIC): New.
+
+2006-03-21  Paul Brook  <paul@codesourcery.com>
+
+	* config/tc-arm.c (md_apply_fix): Fix typo in offset mask.
+
+2006-03-21  Sterling Augustine  <sterling@tensilica.com>
+
+	* config/tc-xtensa.c (enforce_three_byte_loop_align): New flag.
+	(xtensa_setup_hw_workarounds): Set this new flag for older hardware.
+	(get_loop_align_size): New.
+	(xtensa_end): Skip xtensa_mark_narrow_branches when not aligning.
+	(xtensa_mark_zcl_first_insns): Prevent widening of first loop frag.
+	(get_text_align_power): Rewrite to handle inputs in the range 2-8.
+	(get_noop_aligned_address): Use get_loop_align_size.
+	(get_aligned_diff): Likewise.
+
+2006-03-21  Paul Brook  <paul@codesourcery.com>
+
+	* config/tc-arm.c (insns): Correct opcodes for ldrbt and strbt.
+
 2006-03-20  Paul Brook  <paul@codesourcery.com>
 
 	* config/tc-arm.c (BAD_BRANCH, BAD_NOT_IT): Define.
diff --git a/gas/Makefile.am b/gas/Makefile.am
index 4cd7e2695da..08b9842fc6b 100644
--- a/gas/Makefile.am
+++ b/gas/Makefile.am
@@ -613,7 +613,8 @@ $(srcdir)/config/m68k-parse.h: ; @true
 bfin-parse.c: $(srcdir)/config/bfin-parse.y
 	$(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
 bfin-parse.h: bfin-parse.c
-bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h
+bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
 
 bfin-defs.h: ; @true
 $(srcdir)/config/bfin-defs.h: ; @true
@@ -671,6 +672,35 @@ MOSTLYCLEANFILES = $(STAGESTUFF) core \
 
 CLEANFILES = dep.sed DEPTC DEPTCA DEPOBJ DEPOBJA DEP2 DEP2A DEP1 DEPA DEP DEPDIR
 
+.PHONY: install-html install-html-am install-html-recursive
+
+install-html:	install-html-recursive
+
+install-html-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
 .PHONY: install-exec-local install-data-local
 .PHONY: install-exec-bindir install-exec-tooldir
 
@@ -1021,14 +1051,17 @@ DEPTC_bfin_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
   $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \
   $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h dwarf2dbg.h \
-  $(srcdir)/config/bfin-defs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
-  $(srcdir)/config/bfin-aux.h $(INCDIR)/opcode/bfin.h
+  $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
+  $(srcdir)/config/bfin-aux.h $(INCDIR)/opcode/bfin.h \
+  $(srcdir)/config/bfin-defs.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
 DEPTC_bfin_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
   $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h \
   dwarf2dbg.h struc-symbol.h $(srcdir)/config/bfin-defs.h \
   $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(srcdir)/config/bfin-aux.h \
-  $(INCDIR)/opcode/bfin.h
+  $(INCDIR)/opcode/bfin.h $(srcdir)/config/bfin-defs.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
 DEPTC_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \
   $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
   $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
diff --git a/gas/Makefile.in b/gas/Makefile.in
index 9dde01c8ca9..3eeed7f026d 100644
--- a/gas/Makefile.in
+++ b/gas/Makefile.in
@@ -213,6 +213,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 cgen_cpu_prefix = @cgen_cpu_prefix@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
 exec_prefix = @exec_prefix@
 extra_objects = @extra_objects@
 host = @host@
@@ -220,6 +222,7 @@ host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
@@ -802,15 +805,18 @@ DEPTC_bfin_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
   $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \
   $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h dwarf2dbg.h \
-  $(srcdir)/config/bfin-defs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
-  $(srcdir)/config/bfin-aux.h $(INCDIR)/opcode/bfin.h
+  $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
+  $(srcdir)/config/bfin-aux.h $(INCDIR)/opcode/bfin.h \
+  $(srcdir)/config/bfin-defs.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
 
 DEPTC_bfin_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
   $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h \
   dwarf2dbg.h struc-symbol.h $(srcdir)/config/bfin-defs.h \
   $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(srcdir)/config/bfin-aux.h \
-  $(INCDIR)/opcode/bfin.h
+  $(INCDIR)/opcode/bfin.h $(srcdir)/config/bfin-defs.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
 
 DEPTC_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \
   $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
@@ -2966,7 +2972,8 @@ $(srcdir)/config/m68k-parse.h: ; @true
 bfin-parse.c: $(srcdir)/config/bfin-parse.y
 	$(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
 bfin-parse.h: bfin-parse.c
-bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h
+bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
 
 bfin-defs.h: ; @true
 $(srcdir)/config/bfin-defs.h: ; @true
@@ -3006,6 +3013,35 @@ cgen.o: cgen.c cgen.h cgen-desc.h subsegs.h \
 	$(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-desc.h \
 	$(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-opc.h
 
+.PHONY: install-html install-html-am install-html-recursive
+
+install-html:	install-html-recursive
+
+install-html-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
 .PHONY: install-exec-local install-data-local
 .PHONY: install-exec-bindir install-exec-tooldir
 
diff --git a/gas/config/bfin-defs.h b/gas/config/bfin-defs.h
index 46ae61e2912..48bacb3ed7d 100644
--- a/gas/config/bfin-defs.h
+++ b/gas/config/bfin-defs.h
@@ -263,6 +263,7 @@ typedef enum
   Expr_Node_Binop,		/* Binary operator.  */
   Expr_Node_Unop,		/* Unary operator.  */
   Expr_Node_Reloc,		/* Symbol to be relocated.  */
+  Expr_Node_GOT_Reloc,		/* Symbol to be relocated using the GOT.  */
   Expr_Node_Constant 		/* Constant.  */
 } Expr_Node_Type;
 
diff --git a/gas/config/bfin-lex.l b/gas/config/bfin-lex.l
index c3af8420265..3a0077cd985 100644
--- a/gas/config/bfin-lex.l
+++ b/gas/config/bfin-lex.l
@@ -241,6 +241,8 @@ abort                                   return ABORT;
 [aA]0"."[wW]    _REG.regno = REG_A0w; return REG;
 [aA]0           _REG.regno = REG_A0;  return REG_A_DOUBLE_ZERO;
 [Gg][Oo][Tt]	return GOT;
+[Gg][Oo][Tt]"17"[Mm]"4" return GOT17M4;
+[Ff][Uu][Nn][Cc][Dd][Ee][Ss][Cc]"_"[Gg][Oo][Tt]"17"[Mm]"4" return FUNCDESC_GOT17M4;
 [Pp][Ll][Tt][Pp][Cc]	return PLTPC;
 
 
diff --git a/gas/config/bfin-parse.y b/gas/config/bfin-parse.y
index f1e488768c9..917c2d27ba0 100644
--- a/gas/config/bfin-parse.y
+++ b/gas/config/bfin-parse.y
@@ -21,10 +21,14 @@
 %{
 
 #include <stdio.h>
-#include "bfin-aux.h"
 #include <stdarg.h>
 #include <obstack.h>
 
+#include "bfin-aux.h"  // opcode generating auxiliaries
+#include "libbfd.h"
+#include "elf/common.h"
+#include "elf/bfin.h"
+
 #define DSP32ALU(aopcde, HL, dst1, dst0, src0, src1, s, x, aop) \
 	bfin_gen_dsp32alu (HL, aopcde, aop, s, x, dst0, dst1, src0, src1)
 
@@ -485,7 +489,8 @@ is_group2 (INSTR_T x)
 %token STATUS_REG
 %token MNOP
 %token SYMBOL NUMBER
-%token GOT AT PLTPC
+%token GOT GOT17M4 FUNCDESC_GOT17M4
+%token AT PLTPC
 
 /* Types.  */
 %type <instr> asm
@@ -544,7 +549,7 @@ is_group2 (INSTR_T x)
 %type <expr> got
 %type <expr> got_or_expr
 %type <expr> pltpc
-
+%type <value> any_gotrel GOT GOT17M4 FUNCDESC_GOT17M4
 
 /* Precedence rules.  */
 %left BAR
@@ -4111,9 +4116,20 @@ symbol: SYMBOL
 	}
 	;
 
-got:	symbol AT GOT
+any_gotrel:
+	GOT
+	{ $$ = BFD_RELOC_BFIN_GOT; }
+	| GOT17M4
+	{ $$ = BFD_RELOC_BFIN_GOT17M4; }
+	| FUNCDESC_GOT17M4
+	{ $$ = BFD_RELOC_BFIN_FUNCDESC_GOT17M4; }
+	;
+
+got:	symbol AT any_gotrel
 	{
-	$$ = $1;
+	Expr_Node_Value val;
+	val.i_value = $3;
+	$$ = Expr_Node_Create (Expr_Node_GOT_Reloc, val, $1, NULL);
 	}
 	;
 
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 583acf27ba5..5af2cd4efbd 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -560,6 +560,7 @@ struct asm_opcode
 #define THUMB_SIZE	2	/* Size of thumb instruction.  */
 #define THUMB_PP_PC_LR 0x0100
 #define THUMB_LOAD_BIT 0x0800
+#define THUMB2_LOAD_BIT 0x00100000
 
 #define BAD_ARGS	_("bad arguments to instruction")
 #define BAD_PC		_("r15 not allowed here")
@@ -3705,7 +3706,10 @@ parse_tb (char **str)
   int reg;
 
   if (skip_past_char (&p, '[') == FAIL)
-    return FAIL;
+    {
+      inst.error = _("'[' expected");
+      return FAIL;
+    }
 
   if ((reg = arm_reg_parse (&p, REG_TYPE_RN)) == FAIL)
     {
@@ -3715,7 +3719,10 @@ parse_tb (char **str)
   inst.operands[0].reg = reg;
 
   if (skip_past_comma (&p) == FAIL)
-    return FAIL;
+    {
+      inst.error = _("',' expected");
+      return FAIL;
+    }
   
   if ((reg = arm_reg_parse (&p, REG_TYPE_RN)) == FAIL)
     {
@@ -4132,7 +4139,13 @@ parse_operands (char *str, const unsigned char *pattern)
 
     failure:
       if (!backtrack_pos)
-	return FAIL;
+	{
+	  /* The parse routine should already have set inst.error, but set a
+	     defaut here just in case.  */
+	  if (!inst.error)
+	    inst.error = _("syntax error");
+	  return FAIL;
+	}
 
       /* Do not backtrack over a trailing optional argument that
 	 absorbed some text.  We will only fail again, with the
@@ -4140,7 +4153,11 @@ parse_operands (char *str, const unsigned char *pattern)
 	 probably less helpful than the current one.  */
       if (backtrack_index == i && backtrack_pos != str
 	  && upat[i+1] == OP_stop)
-	return FAIL;
+	{
+	  if (!inst.error)
+	    inst.error = _("syntax error");
+	  return FAIL;
+	}
 
       /* Try again, skipping the optional argument at backtrack_pos.  */
       str = backtrack_pos;
@@ -4443,7 +4460,14 @@ encode_arm_cp_address (int i, int wb_ok, int unind_ok, int reloc_override)
 static int
 move_or_literal_pool (int i, bfd_boolean thumb_p, bfd_boolean mode_3)
 {
-  if ((inst.instruction & (thumb_p ? THUMB_LOAD_BIT : LOAD_BIT)) == 0)
+  unsigned long tbit;
+
+  if (thumb_p)
+    tbit = (inst.instruction > 0xffff) ? THUMB2_LOAD_BIT : THUMB_LOAD_BIT;
+  else
+    tbit = LOAD_BIT;
+
+  if ((inst.instruction & tbit) == 0)
     {
       inst.error = _("invalid pseudo operation");
       return 1;
@@ -4457,7 +4481,7 @@ move_or_literal_pool (int i, bfd_boolean thumb_p, bfd_boolean mode_3)
     {
       if (thumb_p)
 	{
-	  if ((inst.reloc.exp.X_add_number & ~0xFF) == 0)
+	  if (!unified_syntax && (inst.reloc.exp.X_add_number & ~0xFF) == 0)
 	    {
 	      /* This can be done with a mov(1) instruction.  */
 	      inst.instruction	= T_OPCODE_MOV_I8 | (inst.operands[i].reg << 8);
@@ -5965,7 +5989,7 @@ encode_thumb32_addr_mode (int i, bfd_boolean is_t, bfd_boolean is_d)
   bfd_boolean is_pc = (inst.operands[i].reg == REG_PC);
 
   constraint (!inst.operands[i].isreg,
-	      _("Thumb does not support the ldr =N pseudo-operation"));
+	      _("Instruction does not support =N addresses"));
 
   inst.instruction |= inst.operands[i].reg << 16;
   if (inst.operands[i].immisreg)
@@ -6979,6 +7003,13 @@ do_t_ldst (void)
   opcode = inst.instruction;
   if (unified_syntax)
     {
+      if (!inst.operands[1].isreg)
+	{
+	  if (opcode <= 0xffff)
+	    inst.instruction = THUMB_OP32 (opcode);
+	  if (move_or_literal_pool (0, /*thumb_p=*/TRUE, /*mode_3=*/FALSE))
+	    return;
+	}
       if (inst.operands[1].isreg
 	  && !inst.operands[1].writeback
 	  && !inst.operands[1].shifted && !inst.operands[1].postind
@@ -9034,9 +9065,9 @@ static const struct asm_opcode insns[] =
   CL(teqp,	130f000,           2, (RR, SH),      cmp),
 
  TC3(ldrt,	4300000, f8500e00, 2, (RR, ADDR),    ldstt, t_ldstt),
- TC3(ldrbt,	4700000, f8300e00, 2, (RR, ADDR),    ldstt, t_ldstt),
+ TC3(ldrbt,	4700000, f8100e00, 2, (RR, ADDR),    ldstt, t_ldstt),
  TC3(strt,	4200000, f8400e00, 2, (RR, ADDR),    ldstt, t_ldstt),
- TC3(strbt,	4600000, f8200e00, 2, (RR, ADDR),    ldstt, t_ldstt),
+ TC3(strbt,	4600000, f8000e00, 2, (RR, ADDR),    ldstt, t_ldstt),
 
  TC3(stmdb,	9000000, e9000000, 2, (RRw, REGLST), ldmstm, t_ldmstm),
  TC3(stmfd,     9000000, e9000000, 2, (RRw, REGLST), ldmstm, t_ldmstm),
@@ -11912,6 +11943,14 @@ md_apply_fix (fixS *	fixP,
 	{
 	  newval = md_chars_to_number (buf, INSN_SIZE);
 	  newval |= (value >> 2) & 0x00ffffff;
+	  /* Set the H bit on BLX instructions.  */
+	  if (temp == 1)
+	    {
+	      if (value & 2)
+		newval |= 0x01000000;
+	      else
+		newval &= ~0x01000000;
+	    }
 	  md_number_to_chars (buf, newval, INSN_SIZE);
 	}
       break;
@@ -11925,7 +11964,7 @@ md_apply_fix (fixS *	fixP,
       if (fixP->fx_done || !seg->use_rela_p)
 	{
 	  newval = md_chars_to_number (buf, THUMB_SIZE);
-	  newval |= ((value & 0x2e) << 2) | ((value & 0x40) << 3);
+	  newval |= ((value & 0x3e) << 2) | ((value & 0x40) << 3);
 	  md_number_to_chars (buf, newval, THUMB_SIZE);
 	}
       break;
diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c
index d6294f3c5a4..7a95033d53a 100644
--- a/gas/config/tc-avr.c
+++ b/gas/config/tc-avr.c
@@ -89,34 +89,62 @@ static struct mcu_type_s mcu_types[] =
   {"at86rf401", AVR_ISA_2xxx,     bfd_mach_avr2},
   {"attiny13",  AVR_ISA_TINY2,    bfd_mach_avr2},
   {"attiny2313",AVR_ISA_TINY2,    bfd_mach_avr2},
+  {"attiny261", AVR_ISA_TINY2,    bfd_mach_avr2},
+  {"attiny461", AVR_ISA_TINY2,    bfd_mach_avr2},
+  {"attiny861", AVR_ISA_TINY2,    bfd_mach_avr2},
+  {"attiny24",  AVR_ISA_TINY2,    bfd_mach_avr2},
+  {"attiny44",  AVR_ISA_TINY2,    bfd_mach_avr2},
+  {"attiny84",  AVR_ISA_TINY2,    bfd_mach_avr2},
+  {"attiny25",  AVR_ISA_TINY2,    bfd_mach_avr2},
+  {"attiny45",  AVR_ISA_TINY2,    bfd_mach_avr2},
+  {"attiny85",  AVR_ISA_TINY2,    bfd_mach_avr2},
   {"atmega603", AVR_ISA_M603,     bfd_mach_avr3}, /* XXX -> m103 */
   {"atmega103", AVR_ISA_M103,     bfd_mach_avr3},
   {"at43usb320",AVR_ISA_M103,     bfd_mach_avr3},
   {"at43usb355",AVR_ISA_M603,     bfd_mach_avr3},
   {"at76c711",  AVR_ISA_M603,     bfd_mach_avr3},
-  {"atmega48",  AVR_ISA_M8,       bfd_mach_avr4},
+  {"atmega48",  AVR_ISA_PWMx,     bfd_mach_avr4},
   {"atmega8",   AVR_ISA_M8,       bfd_mach_avr4},
   {"atmega83",  AVR_ISA_M8,       bfd_mach_avr4}, /* XXX -> m8535 */
   {"atmega85",  AVR_ISA_M8,       bfd_mach_avr4}, /* XXX -> m8 */
-  {"atmega88",  AVR_ISA_M8,       bfd_mach_avr4},
+  {"atmega88",  AVR_ISA_PWMx,     bfd_mach_avr4},
   {"atmega8515",AVR_ISA_M8,       bfd_mach_avr4},
   {"atmega8535",AVR_ISA_M8,       bfd_mach_avr4},
+  {"at90pwm2",  AVR_ISA_PWMx,     bfd_mach_avr4},
+  {"at90pwm3",  AVR_ISA_PWMx,     bfd_mach_avr4},
   {"atmega16",  AVR_ISA_M323,     bfd_mach_avr5},
   {"atmega161", AVR_ISA_M161,     bfd_mach_avr5},
   {"atmega162", AVR_ISA_M323,     bfd_mach_avr5},
   {"atmega163", AVR_ISA_M161,     bfd_mach_avr5},
+  {"atmega164", AVR_ISA_M323,     bfd_mach_avr5},
   {"atmega165", AVR_ISA_M323,     bfd_mach_avr5},
   {"atmega168", AVR_ISA_M323,     bfd_mach_avr5},
   {"atmega169", AVR_ISA_M323,     bfd_mach_avr5},
   {"atmega32",  AVR_ISA_M323,     bfd_mach_avr5},
   {"atmega323", AVR_ISA_M323,     bfd_mach_avr5},
+  {"atmega324", AVR_ISA_M323,     bfd_mach_avr5},
   {"atmega325", AVR_ISA_M323,     bfd_mach_avr5},
+  {"atmega329", AVR_ISA_M323,     bfd_mach_avr5},
   {"atmega3250",AVR_ISA_M323,     bfd_mach_avr5},
+  {"atmega3290",AVR_ISA_M323,     bfd_mach_avr5},
+  {"atmega406", AVR_ISA_M323,     bfd_mach_avr5},
   {"atmega64",  AVR_ISA_M323,     bfd_mach_avr5},
+  {"atmega640", AVR_ISA_M323,     bfd_mach_avr5},
+  {"atmega644", AVR_ISA_M323,     bfd_mach_avr5},
   {"atmega128", AVR_ISA_M128,     bfd_mach_avr5},
+  {"atmega1280",AVR_ISA_M128,     bfd_mach_avr5},
+  {"atmega1281",AVR_ISA_M128,     bfd_mach_avr5},
   {"atmega645", AVR_ISA_M323,     bfd_mach_avr5},
+  {"atmega649", AVR_ISA_M323,     bfd_mach_avr5},
   {"atmega6450",AVR_ISA_M323,     bfd_mach_avr5},
+  {"atmega6490",AVR_ISA_M323,     bfd_mach_avr5},
+  {"at90can32" ,AVR_ISA_M323,     bfd_mach_avr5},
+  {"at90can64" ,AVR_ISA_M323,     bfd_mach_avr5},
   {"at90can128",AVR_ISA_M128,     bfd_mach_avr5},
+  {"at90usb646", AVR_ISA_M323,    bfd_mach_avr5},
+  {"at90usb647", AVR_ISA_M323,    bfd_mach_avr5},
+  {"at90usb1286",AVR_ISA_M128,    bfd_mach_avr5},
+  {"at90usb1287",AVR_ISA_M128,    bfd_mach_avr5},
   {"at94k",     AVR_ISA_94K,      bfd_mach_avr5},
   {NULL, 0, 0}
 };
diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c
index d9e88de19d5..43d48d624ea 100644
--- a/gas/config/tc-bfin.c
+++ b/gas/config/tc-bfin.c
@@ -28,6 +28,9 @@
 #ifdef OBJ_ELF
 #include "dwarf2dbg.h"
 #endif
+#include "libbfd.h"
+#include "elf/common.h"
+#include "elf/bfin.h"
 
 extern int yyparse (void);
 struct yy_buffer_state;
@@ -45,6 +48,12 @@ int last_insn_size;
 extern struct obstack mempool;
 FILE *errorf;
 
+/* Flags to set in the elf header */
+#define DEFAULT_FLAGS 0
+
+static flagword bfin_flags = DEFAULT_FLAGS;
+static const char *bfin_pic_flag = (const char *)0;
+
 /* Registers list.  */
 struct bfin_reg_entry
 {
@@ -202,11 +211,73 @@ static const struct bfin_reg_entry bfin_reg_info[] = {
   {0, 0}
 };
 
+/* Blackfin specific function to handle FD-PIC pointer initializations.  */
+
+static void
+bfin_pic_ptr (int nbytes)
+{
+  expressionS exp;
+  char *p;
+
+  if (nbytes != 4)
+    abort ();
+
+#ifdef md_flush_pending_output
+  md_flush_pending_output ();
+#endif
+
+  if (is_it_end_of_statement ())
+    {
+      demand_empty_rest_of_line ();
+      return;
+    }
+
+#ifdef md_cons_align
+  md_cons_align (nbytes);
+#endif
+
+  do
+    {
+      bfd_reloc_code_real_type reloc_type = BFD_RELOC_BFIN_FUNCDESC;
+      
+      if (strncasecmp (input_line_pointer, "funcdesc(", 9) == 0)
+	{
+	  input_line_pointer += 9;
+	  expression (&exp);
+	  if (*input_line_pointer == ')')
+	    input_line_pointer++;
+	  else
+	    as_bad ("missing ')'");
+	}
+      else
+	error ("missing funcdesc in picptr");
+
+      p = frag_more (4);
+      memset (p, 0, 4);
+      fix_new_exp (frag_now, p - frag_now->fr_literal, 4, &exp, 0,
+		   reloc_type);
+    }
+  while (*input_line_pointer++ == ',');
+
+  input_line_pointer--;			/* Put terminator back into stream. */
+  demand_empty_rest_of_line ();
+}
+
+static void
+bfin_s_bss (int ignore ATTRIBUTE_UNUSED)
+{
+  register int temp;
+
+  temp = get_absolute_expression ();
+  subseg_set (bss_section, (subsegT) temp);
+  demand_empty_rest_of_line ();
+}
 
 const pseudo_typeS md_pseudo_table[] = {
   {"align", s_align_bytes, 0},
   {"byte2", cons, 2},
   {"byte4", cons, 4},
+  {"picptr", bfin_pic_ptr, 4},
   {"code", obj_elf_section, 0},
   {"db", cons, 1},
   {"dd", cons, 4},
@@ -218,17 +289,6 @@ const pseudo_typeS md_pseudo_table[] = {
   {0, 0, 0}
 };
 
-static void
-bfin_s_bss (int ignore ATTRIBUTE_UNUSED)
-{
-  register int temp;
-
-  temp = get_absolute_expression ();
-  subseg_set (bss_section, (subsegT) temp);
-  demand_empty_rest_of_line ();
-}
-
-
 /* Characters that are used to denote comments and line separators. */
 const char comment_chars[] = "";
 const char line_comment_chars[] = "#";
@@ -245,16 +305,32 @@ const char FLT_CHARS[] = "fFdDxX";
 /* Define bfin-specific command-line options (there are none). */
 const char *md_shortopts = "";
 
-struct option md_longopts[] = {
-  {NULL, no_argument, NULL, 0}
+#define OPTION_FDPIC		(OPTION_MD_BASE)
+
+struct option md_longopts[] =
+{
+  { "mfdpic",		no_argument,		NULL, OPTION_FDPIC	   },
+  { NULL,		no_argument,		NULL, 0                 },
 };
+
 size_t md_longopts_size = sizeof (md_longopts);
 
 
 int
 md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED)
 {
-  return 0;
+  switch (c)
+    {
+    default:
+      return 0;
+
+    case OPTION_FDPIC:
+      bfin_flags |= EF_BFIN_FDPIC;
+      bfin_pic_flag = "-mfdpic";
+      break;
+    }
+
+  return 1;
 }
 
 void
@@ -267,6 +343,10 @@ md_show_usage (FILE * stream ATTRIBUTE_UNUSED)
 void
 md_begin ()
 {
+  /* Set the ELF flags if desired. */
+  if (bfin_flags)
+    bfd_set_private_flags (stdoutput, bfin_flags);
+
   /* Set the default machine type. */
   if (!bfd_set_arch_mach (stdoutput, bfd_arch_bfin, 0))
     as_warn ("Could not set architecture and machine.");
@@ -476,6 +556,8 @@ md_apply_fix (fixS *fixP, valueT *valueP, segT seg ATTRIBUTE_UNUSED)
   switch (fixP->fx_r_type)
     {
     case BFD_RELOC_BFIN_GOT:
+    case BFD_RELOC_BFIN_GOT17M4:
+    case BFD_RELOC_BFIN_FUNCDESC_GOT17M4:
       fixP->fx_no_overflow = 1;
       newval = md_chars_to_number (where, 2);
       newval |= 0x0 & 0x7f;
@@ -579,6 +661,7 @@ md_apply_fix (fixS *fixP, valueT *valueP, segT seg ATTRIBUTE_UNUSED)
       md_number_to_chars (where, value, 2);
       break;
 
+    case BFD_RELOC_BFIN_FUNCDESC:
     case BFD_RELOC_VTABLE_INHERIT:
     case BFD_RELOC_VTABLE_ENTRY:
       fixP->fx_done = FALSE;
@@ -725,8 +808,10 @@ bfin_fix_adjustable (fixS *fixP)
   switch (fixP->fx_r_type)
     {     
   /* Adjust_reloc_syms doesn't know about the GOT.  */
-    case BFD_RELOC_BFIN_GOT :
-    case BFD_RELOC_BFIN_PLTPC :
+    case BFD_RELOC_BFIN_GOT:
+    case BFD_RELOC_BFIN_GOT17M4:
+    case BFD_RELOC_BFIN_FUNCDESC_GOT17M4:
+    case BFD_RELOC_BFIN_PLTPC:
   /* We need the symbol name for the VTABLE entries.  */
     case BFD_RELOC_VTABLE_INHERIT:
     case BFD_RELOC_VTABLE_ENTRY:
@@ -982,6 +1067,8 @@ Expr_Node_Gen_Reloc (Expr_Node * head, int parent_reloc)
 	  break;
 	case BFD_RELOC_16:
 	case BFD_RELOC_BFIN_GOT:
+	case BFD_RELOC_BFIN_GOT17M4:
+	case BFD_RELOC_BFIN_FUNCDESC_GOT17M4:
 	  note1 = conscode (gencode (value), NULL_CODE);
 	  pcrel = 0;
 	  break;
@@ -1356,8 +1443,6 @@ bfin_gen_ldimmhalf (REG_T reg, int H, int S, int Z, Expr_Node * phword, int relo
 INSTR_T
 bfin_gen_ldstidxi (REG_T ptr, REG_T reg, int W, int sz, int Z, Expr_Node * poffset)
 {
-  int offset;
-  int value = 0;
   INIT (LDSTidxI);
 
   if (!IS_PREG (*ptr) || (!IS_DREG (*reg) && !Z))
@@ -1370,44 +1455,51 @@ bfin_gen_ldstidxi (REG_T ptr, REG_T reg, int W, int sz, int Z, Expr_Node * poffs
   ASSIGN_R (reg);
   ASSIGN (W);
   ASSIGN (sz);
-  switch (sz)
-    {
-    case 0:
-      value = EXPR_VALUE (poffset) >> 2;
-      break;
-    case 1:
-      value = EXPR_VALUE (poffset) >> 1;
-      break;
-    case 2:
-      value = EXPR_VALUE (poffset);
-      break;
-    }
-
 
   ASSIGN (Z);
 
-  offset = (value & 0xffff);
-  ASSIGN (offset);
-  /* TODO : test if you need to check this here.
-     The reloc case should automatically generate instruction
-     if constant.  */
-  if(poffset->type != Expr_Node_Constant){
-    /* A GOT relocation such as R0 = [P5 + symbol@GOT].
-       Distinguish between R0 = [P5 + symbol@GOT] and
-       P5 = [P5 + _current_shared_library_p5_offset_].  */
-    if(!strcmp(poffset->value.s_value, "_current_shared_library_p5_offset_")){
-      return  conscode (gencode (HI (c_code.opcode)),
-			Expr_Node_Gen_Reloc(poffset, BFD_RELOC_16));
+  if (poffset->type != Expr_Node_Constant)
+    {
+      /* a GOT relocation such as R0 = [P5 + symbol@GOT] */
+      /* distinguish between R0 = [P5 + symbol@GOT] and
+	 P5 = [P5 + _current_shared_library_p5_offset_]
+      */
+      if (poffset->type == Expr_Node_Reloc
+	  && !strcmp (poffset->value.s_value,
+		      "_current_shared_library_p5_offset_"))
+	{
+	  return  conscode (gencode (HI (c_code.opcode)),
+			    Expr_Node_Gen_Reloc(poffset, BFD_RELOC_16));
+	}
+      else if (poffset->type != Expr_Node_GOT_Reloc)
+	abort ();
+
+      return conscode (gencode (HI (c_code.opcode)),
+		       Expr_Node_Gen_Reloc(poffset->Left_Child,
+					   poffset->value.i_value));
     }
-    else
+  else
     {
-      return  conscode (gencode (HI (c_code.opcode)),
-			Expr_Node_Gen_Reloc(poffset, BFD_RELOC_BFIN_GOT));
+      int value, offset;
+      switch (sz)
+	{				// load/store access size
+	case 0:			// 32 bit
+	  value = EXPR_VALUE (poffset) >> 2;
+	  break;
+	case 1:			// 16 bit
+	  value = EXPR_VALUE (poffset) >> 1;
+	  break;
+	case 2:			// 8 bit
+	  value = EXPR_VALUE (poffset);
+	  break;
+	default:
+	  abort ();
+	}
+
+      offset = (value & 0xffff);
+      ASSIGN (offset);
+      return GEN_OPCODE32 ();
     }
-  }
-  else{
-    return GEN_OPCODE32 ();
-  }
 }
 
 
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index f42a9a4705b..be384bc99a7 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -1169,13 +1169,12 @@ ps (s)
 	   segment_name (S_GET_SEGMENT (s)));
 }
 
-struct type_name
+static struct type_name
   {
     unsigned int mask;
     char *tname;
   }
-
-static const type_names[] =
+const type_names[] =
 {
   { Reg8, "r8" },
   { Reg16, "r16" },
@@ -1238,6 +1237,18 @@ reloc (unsigned int size,
       if (size == 8)
 	switch (other)
 	  {
+	    case BFD_RELOC_X86_64_GOT32:
+	      return BFD_RELOC_X86_64_GOT64;
+	      break;
+	    case BFD_RELOC_X86_64_PLTOFF64:
+	      return BFD_RELOC_X86_64_PLTOFF64;
+	      break;
+	    case BFD_RELOC_X86_64_GOTPC32:
+	      other = BFD_RELOC_X86_64_GOTPC64;
+	      break;
+	    case BFD_RELOC_X86_64_GOTPCREL:
+	      other = BFD_RELOC_X86_64_GOTPCREL64;
+	      break;
 	    case BFD_RELOC_X86_64_TPOFF32:
 	      other = BFD_RELOC_X86_64_TPOFF64;
 	      break;
@@ -2252,19 +2263,7 @@ match_template ()
 			      : (i.suffix == LONG_DOUBLE_MNEM_SUFFIX
 				 ? No_xSuf : 0))))));
 
-  t = current_templates->start;
-  if (i.suffix == QWORD_MNEM_SUFFIX
-      && flag_code != CODE_64BIT
-      && (intel_syntax
-	  ? !(t->opcode_modifier & IgnoreSize)
-	    && !intel_float_operand (t->name)
-	  : intel_float_operand (t->name) != 2)
-      && (!(t->operand_types[0] & (RegMMX | RegXMM))
-	  || !(t->operand_types[t->operands > 1] & (RegMMX | RegXMM)))
-      && (t->base_opcode != 0x0fc7
-	  || t->extension_opcode != 1 /* cmpxchg8b */))
-    t = current_templates->end;
-  for (; t < current_templates->end; t++)
+  for (t = current_templates->start; t < current_templates->end; t++)
     {
       /* Must have right number of operands.  */
       if (i.operands != t->operands)
@@ -2276,6 +2275,19 @@ match_template ()
 	       && (t->opcode_modifier & IgnoreSize)))
 	continue;
 
+      /* In general, don't allow 64-bit operands in 32-bit mode.  */
+      if (i.suffix == QWORD_MNEM_SUFFIX
+	  && flag_code != CODE_64BIT
+	  && (intel_syntax
+	      ? (!(t->opcode_modifier & IgnoreSize)
+		 && !intel_float_operand (t->name))
+	      : intel_float_operand (t->name) != 2)
+	  && (!(t->operand_types[0] & (RegMMX | RegXMM))
+	      || !(t->operand_types[t->operands > 1] & (RegMMX | RegXMM)))
+	  && (t->base_opcode != 0x0fc7
+	      || t->extension_opcode != 1 /* cmpxchg8b */))
+	continue;
+
       /* Do not verify operands when there are none.  */
       else if (!t->operands)
 	{
@@ -3569,7 +3581,7 @@ check_prefix:
 #ifdef DEBUG386
   if (flag_debug)
     {
-      pi (line, &i);
+      pi ("" /*line*/, &i);
     }
 #endif /* DEBUG386  */
 }
@@ -3654,7 +3666,9 @@ output_disp (insn_start_frag, insn_start_off)
 	      if (GOT_symbol
 		  && GOT_symbol == i.op[n].disps->X_add_symbol
 		  && (((reloc_type == BFD_RELOC_32
-			|| reloc_type == BFD_RELOC_X86_64_32S)
+			|| reloc_type == BFD_RELOC_X86_64_32S
+			|| (reloc_type == BFD_RELOC_64
+			    && object_64bit))
 		       && (i.op[n].disps->X_op == O_symbol
 			   || (i.op[n].disps->X_op == O_add
 			       && ((symbol_get_value_expression
@@ -3678,10 +3692,17 @@ output_disp (insn_start_frag, insn_start_off)
 		    }
 
 		  if (!object_64bit)
-		    reloc_type = BFD_RELOC_386_GOTPC;
+		    {
+		      reloc_type = BFD_RELOC_386_GOTPC;
+		      i.op[n].imms->X_add_number += add;
+		    }
+		  else if (reloc_type == BFD_RELOC_64)
+		    reloc_type = BFD_RELOC_X86_64_GOTPC64;
 		  else
+		    /* Don't do the adjustment for x86-64, as there
+		       the pcrel addressing is relative to the _next_
+		       insn, and that is taken care of in other code.  */
 		    reloc_type = BFD_RELOC_X86_64_GOTPC32;
-		  i.op[n].disps->X_add_number += add;
 		}
 	      fix_new_exp (frag_now, p - frag_now->fr_literal, size,
 			   i.op[n].disps, pcrel, reloc_type);
@@ -3790,7 +3811,8 @@ output_imm (insn_start_frag, insn_start_off)
 	       * confusing to do it this way.  */
 
 	      if ((reloc_type == BFD_RELOC_32
-		   || reloc_type == BFD_RELOC_X86_64_32S)
+		   || reloc_type == BFD_RELOC_X86_64_32S
+		   || reloc_type == BFD_RELOC_64)
 		  && GOT_symbol
 		  && GOT_symbol == i.op[n].imms->X_add_symbol
 		  && (i.op[n].imms->X_op == O_symbol
@@ -3816,8 +3838,10 @@ output_imm (insn_start_frag, insn_start_off)
 
 		  if (!object_64bit)
 		    reloc_type = BFD_RELOC_386_GOTPC;
-		  else
+		  else if (size == 4)
 		    reloc_type = BFD_RELOC_X86_64_GOTPC32;
+		  else if (size == 8)
+		    reloc_type = BFD_RELOC_X86_64_GOTPC64;
 		  i.op[n].imms->X_add_number += add;
 		}
 	      fix_new_exp (frag_now, p - frag_now->fr_literal, size,
@@ -3870,12 +3894,19 @@ lex_got (enum bfd_reloc_code_real *reloc,
      int *adjust,
      unsigned int *types)
 {
+  /* Some of the relocations depend on the size of what field is to
+     be relocated.  But in our callers i386_immediate and i386_displacement
+     we don't yet know the operand size (this will be set by insn
+     matching).  Hence we record the word32 relocation here,
+     and adjust the reloc according to the real size in reloc().  */
   static const struct {
     const char *str;
     const enum bfd_reloc_code_real rel[2];
     const unsigned int types64;
   } gotrel[] = {
+    { "PLTOFF",   { 0,                        BFD_RELOC_X86_64_PLTOFF64 }, Imm64 },
     { "PLT",      { BFD_RELOC_386_PLT32,      BFD_RELOC_X86_64_PLT32    }, Imm32|Imm32S|Disp32 },
+    { "GOTPLT",   { 0,                        BFD_RELOC_X86_64_GOTPLT64 }, Imm64|Disp64 },
     { "GOTOFF",   { BFD_RELOC_386_GOTOFF,     BFD_RELOC_X86_64_GOTOFF64 }, Imm64|Disp64 },
     { "GOTPCREL", { 0,                        BFD_RELOC_X86_64_GOTPCREL }, Imm32|Imm32S|Disp32 },
     { "TLSGD",    { BFD_RELOC_386_TLS_GD,     BFD_RELOC_X86_64_TLSGD    }, Imm32|Imm32S|Disp32 },
@@ -3887,7 +3918,7 @@ lex_got (enum bfd_reloc_code_real *reloc,
     { "DTPOFF",   { BFD_RELOC_386_TLS_LDO_32, BFD_RELOC_X86_64_DTPOFF32 }, Imm32|Imm32S|Imm64|Disp32|Disp64 },
     { "GOTNTPOFF",{ BFD_RELOC_386_TLS_GOTIE,  0                         }, 0 },
     { "INDNTPOFF",{ BFD_RELOC_386_TLS_IE,     0                         }, 0 },
-    { "GOT",      { BFD_RELOC_386_GOT32,      BFD_RELOC_X86_64_GOT32    }, Imm32|Imm32S|Disp32 },
+    { "GOT",      { BFD_RELOC_386_GOT32,      BFD_RELOC_X86_64_GOT32    }, Imm32|Imm32S|Disp32|Imm64 },
     { "TLSDESC",  { BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_X86_64_GOTPC32_TLSDESC }, Imm32|Imm32S|Disp32 },
     { "TLSCALL",  { BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_X86_64_TLSDESC_CALL }, Imm32|Imm32S|Disp32 }
   };
@@ -4947,6 +4978,20 @@ md_convert_frag (abfd, sec, fragP)
 	}
     }
 
+  /* If size if less then four we are sure that the operand fits,
+     but if it's 4, then it could be that the displacement is larger
+     then -/+ 2GB.  */
+  if (DISP_SIZE_FROM_RELAX_STATE (fragP->fr_subtype) == 4
+      && object_64bit
+      && ((addressT) (displacement_from_opcode_start - extension
+                      + ((addressT) 1 << 31))
+          > (((addressT) 2 << 31) - 1)))
+    {
+      as_bad_where (fragP->fr_file, fragP->fr_line,
+		    _("jump target out of range"));
+      /* Make us emit 0.  */
+      displacement_from_opcode_start = extension;
+    }
   /* Now put displacement after opcode.  */
   md_number_to_chars ((char *) where_to_put_displacement,
 		      (valueT) (displacement_from_opcode_start - extension),
@@ -5708,6 +5753,11 @@ tc_gen_reloc (section, fixp)
     case BFD_RELOC_X86_64_TPOFF64:
     case BFD_RELOC_X86_64_GOTOFF64:
     case BFD_RELOC_X86_64_GOTPC32:
+    case BFD_RELOC_X86_64_GOT64:
+    case BFD_RELOC_X86_64_GOTPCREL64:
+    case BFD_RELOC_X86_64_GOTPC64:
+    case BFD_RELOC_X86_64_GOTPLT64:
+    case BFD_RELOC_X86_64_PLTOFF64:
     case BFD_RELOC_X86_64_GOTPC32_TLSDESC:
     case BFD_RELOC_X86_64_TLSDESC_CALL:
     case BFD_RELOC_RVA:
@@ -5776,6 +5826,12 @@ tc_gen_reloc (section, fixp)
       else
 	code = BFD_RELOC_X86_64_GOTPC32;
     }
+  if ((code == BFD_RELOC_64 || code == BFD_RELOC_64_PCREL)
+      && GOT_symbol
+      && fixp->fx_addsy == GOT_symbol)
+    {
+      code = BFD_RELOC_X86_64_GOTPC64;
+    }
 
   rel = (arelent *) xmalloc (sizeof (arelent));
   rel->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index 8b112631bd8..f370e6cf8e9 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -152,58 +152,86 @@ struct m68k_incant
 #define getone(x)	((((x)->m_opcode)>>16)&0xffff)
 #define gettwo(x)	(((x)->m_opcode)&0xffff)
 
-static const enum m68k_register m68000_control_regs[] = { 0 };
-static const enum m68k_register m68010_control_regs[] = {
+static const enum m68k_register m68000_ctrl[] = { 0 };
+static const enum m68k_register m68010_ctrl[] = {
   SFC, DFC, USP, VBR,
   0
 };
-static const enum m68k_register m68020_control_regs[] = {
+static const enum m68k_register m68020_ctrl[] = {
   SFC, DFC, USP, VBR, CACR, CAAR, MSP, ISP,
   0
 };
-static const enum m68k_register m68040_control_regs[] = {
+static const enum m68k_register m68040_ctrl[] = {
   SFC, DFC, CACR, TC, ITT0, ITT1, DTT0, DTT1,
   USP, VBR, MSP, ISP, MMUSR, URP, SRP,
   0
 };
-static const enum m68k_register m68060_control_regs[] = {
+static const enum m68k_register m68060_ctrl[] = {
   SFC, DFC, CACR, TC, ITT0, ITT1, DTT0, DTT1, BUSCR,
   USP, VBR, URP, SRP, PCR,
   0
 };
-static const enum m68k_register mcf_control_regs[] = {
+static const enum m68k_register mcf_ctrl[] = {
   CACR, TC, ACR0, ACR1, ACR2, ACR3, VBR, ROMBAR,
   RAMBAR0, RAMBAR1, MBAR,
   0
 };
-static const enum m68k_register mcf5208_control_regs[] = {
+static const enum m68k_register mcf5208_ctrl[] = {
   CACR, ACR0, ACR1, VBR, RAMBAR1,
   0
 };
-static const enum m68k_register mcf5213_control_regs[] = {
+static const enum m68k_register mcf5213_ctrl[] = {
   VBR, RAMBAR, FLASHBAR,
   0
 };
-static const enum m68k_register mcf5329_control_regs[] = {
-  CACR, ACR0, ACR1, VBR, RAMBAR,
+static const enum m68k_register mcf5216_ctrl[] = {
+  VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR,
   0
 };
-static const enum m68k_register mcf5249_control_regs[] = {
-  CACR, ACR0, ACR1, VBR, RAMBAR0, RAMBAR1, MBAR, MBAR2,
+static const enum m68k_register mcf5235_ctrl[] = {
+  VBR, CACR, ACR0, ACR1, RAMBAR,
   0
 };
-static const enum m68k_register mcf528x_control_regs[] = {
-  CACR, ACR0, ACR1, VBR, FLASHBAR, RAMBAR,
+static const enum m68k_register mcf5249_ctrl[] = {
+  VBR, CACR, ACR0, ACR1, RAMBAR0, RAMBAR1, MBAR, MBAR2,
   0
 };
-static const enum m68k_register mcfv4e_control_regs[] = {
+static const enum m68k_register mcf5250_ctrl[] = {
+  VBR,
+  0
+};
+static const enum m68k_register mcf5271_ctrl[] = {
+  VBR, CACR, ACR0, ACR1, RAMBAR,
+  0
+};
+static const enum m68k_register mcf5272_ctrl[] = {
+  VBR, CACR, ACR0, ACR1, ROMBAR, RAMBAR, MBAR,
+  0
+};
+static const enum m68k_register mcf5275_ctrl[] = {
+  VBR, CACR, ACR0, ACR1, RAMBAR,
+  0
+};
+static const enum m68k_register mcf5282_ctrl[] = {
+  VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR,
+  0
+};
+static const enum m68k_register mcf5329_ctrl[] = {
+  VBR, CACR, ACR0, ACR1, RAMBAR,
+  0
+};
+static const enum m68k_register mcf5373_ctrl[] = {
+  VBR, CACR, ACR0, ACR1, RAMBAR,
+  0
+};
+static const enum m68k_register mcfv4e_ctrl[] = {
   CACR, TC, ITT0, ITT1, DTT0, DTT1, BUSCR, VBR, PC, ROMBAR,
   ROMBAR1, RAMBAR0, RAMBAR1, MPCR, EDRAMBAR, SECMBAR, MBAR, MBAR0, MBAR1,
   PCR1U0, PCR1L0, PCR1U1, PCR1L1, PCR2U0, PCR2L0, PCR2U1, PCR2L1,
   PCR3U0, PCR3L0, PCR3U1, PCR3L1,
   0
 };
-#define cpu32_control_regs m68010_control_regs
+#define cpu32_ctrl m68010_ctrl
 
 static const enum m68k_register *control_regs;
 
@@ -366,7 +394,7 @@ static void s_m68k_arch (int);
 struct m68k_cpu
 {
   unsigned long arch;	/* Architecture features.  */
-  unsigned long chip;	/* Specific chip */
+  const enum m68k_register *control_regs;	/* Control regs on chip */
   const char *name;	/* Name */
   int alias;       	/* Alias for a cannonical name.  If 1, then
 			   succeeds canonical name, if -1 then
@@ -379,7 +407,6 @@ struct m68k_cpu
    disabled.  */
 static int current_architecture;
 static int not_current_architecture;
-static int current_chip;
 static const struct m68k_cpu *selected_arch;
 static const struct m68k_cpu *selected_cpu;
 static int initialized;
@@ -387,18 +414,18 @@ static int initialized;
 /* Architecture models.  */
 static const struct m68k_cpu m68k_archs[] =
 {
-  {m68000,					cpu_m68000, "68000", 0},
-  {m68010,					cpu_m68010, "68010", 0},
-  {m68020|m68881|m68851,			cpu_m68020, "68020", 0},
-  {m68030|m68881|m68851,			cpu_m68030, "68030", 0},
-  {m68040,					cpu_m68040, "68040", 0},
-  {m68060,					cpu_m68060, "68060", 0},
-  {cpu32|m68881,				cpu_cpu32, "cpu32", 0},
-  {mcfisa_a|mcfhwdiv,				0, "isaa", 0},
-  {mcfisa_a|mcfhwdiv|mcfisa_aa|mcfusp,		0, "isaaplus", 0},
-  {mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp,		0, "isab", 0},
-  {mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-   cpu_cf547x, "cfv4e", 0},
+  {m68000,					m68000_ctrl, "68000", 0},
+  {m68010,					m68010_ctrl, "68010", 0},
+  {m68020|m68881|m68851,			m68020_ctrl, "68020", 0},
+  {m68030|m68881|m68851,			m68020_ctrl, "68030", 0},
+  {m68040,					m68040_ctrl, "68040", 0},
+  {m68060,					m68060_ctrl, "68060", 0},
+  {cpu32|m68881,				cpu32_ctrl, "cpu32", 0},
+  {mcfisa_a|mcfhwdiv,				NULL, "isaa", 0},
+  {mcfisa_a|mcfhwdiv|mcfisa_aa|mcfusp,		NULL, "isaaplus", 0},
+  {mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp,		NULL, "isab", 0},
+  {mcfisa_a|mcfhwdiv|mcfisa_b|mcfmac|mcfusp,	mcf_ctrl, "cfv4", 0},
+  {mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "cfv4e", 0},
   {0,0,NULL, 0}
 };
 
@@ -406,116 +433,128 @@ static const struct m68k_cpu m68k_archs[] =
    for either.  */
 static const struct m68k_cpu m68k_extensions[] =
 {
-  {m68851,					0, "68851", -1},
-  {m68881,					0, "68881", -1},
-  {m68881,					0, "68882", -1},
+  {m68851,					NULL, "68851", -1},
+  {m68881,					NULL, "68881", -1},
+  {m68881,					NULL, "68882", -1},
   
-  {cfloat|m68881,				0, "float", 0},
+  {cfloat|m68881,				NULL, "float", 0},
   
-  {mcfhwdiv,					0, "div", 1},
-  {mcfusp,					0, "usp", 1},
-  {mcfmac,					0, "mac", 1},
-  {mcfemac,					0, "emac", 1},
+  {mcfhwdiv,					NULL, "div", 1},
+  {mcfusp,					NULL, "usp", 1},
+  {mcfmac,					NULL, "mac", 1},
+  {mcfemac,					NULL, "emac", 1},
    
-  {0,0,NULL, 0}
+  {0,NULL,NULL, 0}
 };
 
 /* Processor list */
 static const struct m68k_cpu m68k_cpus[] =
 {
-  { m68000,					cpu_m68000, "68000", 0},
-  { m68010,					cpu_m68010, "68010", 0},
-  { m68020|m68881|m68851,			cpu_m68020, "68020", 0},
-  { m68030|m68881|m68851,			cpu_m68030, "68030", 0},
-  { m68040,					cpu_m68040, "68040", 0},
-  { m68060,					cpu_m68060, "68060", 0},
-  { cpu32|m68881,				cpu_cpu32, "cpu32",  0},
-  { mcfisa_a,					cpu_cf5200, "5200", 0},
-  { mcfisa_a|mcfhwdiv|mcfmac,			cpu_cf5206e, "5206e", 0},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp,	cpu_cf5208, "5208", 0},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp,	cpu_cf5213, "5213", 0},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,cpu_cf521x, "521x", 0},
-  { mcfisa_a|mcfhwdiv|mcfemac,		cpu_cf5249, "5249", 0},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,cpu_cf528x, "528x", 0},
-  { mcfisa_a|mcfhwdiv|mcfmac,			cpu_cf5307, "5307", 0},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	cpu_cf5329, "5329", 0},
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfmac,	cpu_cf5407, "5407",0},
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-    cpu_cf547x, "547x", 0},
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-      						cpu_cf548x, "548x", 0},
-  /* Aliases (effectively, so far as gas is concerned) for the above
-     cpus.  */
-  { m68020|m68881|m68851,			cpu_m68020, "68k", 1},
-  { m68000,					cpu_m68000, "68008", 1},
-  { m68000,					cpu_m68000, "68302", 1},
-  { m68000,					cpu_m68000, "68306", 1},
-  { m68000,					cpu_m68000, "68307", 1},
-  { m68000,					cpu_m68000, "68322", 1},
-  { m68000,					cpu_m68000, "68356", 1},
-  { m68000,					cpu_m68000, "68ec000", 1},
-  { m68000,					cpu_m68000, "68hc000", 1},
-  { m68000,					cpu_m68000, "68hc001", 1},
-  { m68020|m68881|m68851,			cpu_m68020, "68ec020", 1},
-  { m68030|m68881|m68851,			cpu_m68030, "68ec030", 1},
-  { m68040,					cpu_m68040, "68ec040", 1},
-  { m68060,					cpu_m68060, "68ec060", 1},
-  { cpu32|m68881,				cpu_cpu32, "68330", 1},
-  { cpu32|m68881,				cpu_cpu32, "68331", 1},
-  { cpu32|m68881,				cpu_cpu32, "68332", 1},
-  { cpu32|m68881,				cpu_cpu32, "68333", 1},
-  { cpu32|m68881,				cpu_cpu32, "68334", 1},
-  { cpu32|m68881,				cpu_cpu32, "68336", 1},
-  { cpu32|m68881,				cpu_cpu32, "68340", 1},
-  { cpu32|m68881,				cpu_cpu32, "68341", 1},
-  { cpu32|m68881,				cpu_cpu32, "68349", 1},
-  { cpu32|m68881,				cpu_cpu32, "68360", 1},
-  { mcfisa_a,					cpu_cf5200, "5202", 1},
-  { mcfisa_a,					cpu_cf5200, "5204", 1},
-  { mcfisa_a,					cpu_cf5200, "5206", 1},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp,	cpu_cf5208, "5207", 1},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp,	cpu_cf5213, "5211", 1},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp,	cpu_cf5213, "5212", 1},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	cpu_cf521x, "5214", 1},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	cpu_cf521x, "5216", 1},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	cpu_cf5329, "5327", 1},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	cpu_cf5329, "5328", 1},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	cpu_cf528x, "5280", 1},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	cpu_cf528x, "5281", 1},
-  { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	cpu_cf528x, "5282", 1},
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfmac,	cpu_cf5407,	"cfv4", 1 },
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-    cpu_cf547x, "cfv4e", 1 },
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-    cpu_cf547x, "5470", 1 },
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-    cpu_cf547x, "5471", 1 },
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-    cpu_cf547x, "5472", 1 },
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-    cpu_cf547x, "5473", 1 },
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-    cpu_cf547x, "5474", 1 },
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-    cpu_cf547x, "5475", 1 },
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-    cpu_cf548x, "5480", 1 },
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-    cpu_cf548x, "5481", 1 },
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-    cpu_cf548x, "5482", 1 },
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-    cpu_cf548x, "5483", 1 },
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-    cpu_cf548x, "5484", 1 },
-  { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat,
-    cpu_cf548x, "5485", 1 },
-  {0,0,NULL, 0}
+  {m68000,					m68000_ctrl, "68000", 0},
+  {m68000,					m68000_ctrl, "68ec000", 1},
+  {m68000,					m68000_ctrl, "68hc000", 1},
+  {m68000,					m68000_ctrl, "68hc001", 1},
+  {m68000,					m68000_ctrl, "68008", 1},
+  {m68000,					m68000_ctrl, "68302", 1},
+  {m68000,					m68000_ctrl, "68306", 1},
+  {m68000,					m68000_ctrl, "68307", 1},
+  {m68000,					m68000_ctrl, "68322", 1},
+  {m68000,					m68000_ctrl, "68356", 1},
+  {m68010,					m68010_ctrl, "68010", 0},
+  {m68020|m68881|m68851,			m68020_ctrl, "68020", 0},
+  {m68020|m68881|m68851,			m68020_ctrl, "68k", 1},
+  {m68020|m68881|m68851,			m68020_ctrl, "68ec020", 1},
+  {m68030|m68881|m68851,			m68020_ctrl, "68030", 0},
+  {m68030|m68881|m68851,			m68020_ctrl, "68ec030", 1},
+  {m68040,					m68040_ctrl, "68040", 0},
+  {m68040,					m68040_ctrl, "68ec040", 1},
+  {m68060,					m68060_ctrl, "68060", 0},
+  {m68060,					m68060_ctrl, "68ec060", 1},
+  
+  {cpu32|m68881,				cpu32_ctrl, "cpu32",  0},
+  {cpu32|m68881,				cpu32_ctrl, "68330", 1},
+  {cpu32|m68881,				cpu32_ctrl, "68331", 1},
+  {cpu32|m68881,				cpu32_ctrl, "68332", 1},
+  {cpu32|m68881,				cpu32_ctrl, "68333", 1},
+  {cpu32|m68881,				cpu32_ctrl, "68334", 1},
+  {cpu32|m68881,				cpu32_ctrl, "68336", 1},
+  {cpu32|m68881,				cpu32_ctrl, "68340", 1},
+  {cpu32|m68881,				cpu32_ctrl, "68341", 1},
+  {cpu32|m68881,				cpu32_ctrl, "68349", 1},
+  {cpu32|m68881,				cpu32_ctrl, "68360", 1},
+  
+  {mcfisa_a,					mcf_ctrl, "5200", 0},
+  {mcfisa_a,					mcf_ctrl, "5202", 1},
+  {mcfisa_a,					mcf_ctrl, "5204", 1},
+  {mcfisa_a,					mcf_ctrl, "5206", 1},
+  
+  {mcfisa_a|mcfhwdiv|mcfmac,			mcf_ctrl, "5206e", 0},
+  
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5208_ctrl, "5207", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5208_ctrl, "5208", 0},
+  
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp,	mcf5213_ctrl, "5211", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp,	mcf5213_ctrl, "5212", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp,	mcf5213_ctrl, "5213", 0},
+  
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5216_ctrl, "5214", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5216_ctrl, "5216", 0},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5216_ctrl, "521x", 2},
+
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5235_ctrl, "5232", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5235_ctrl, "5233", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5235_ctrl, "5234", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5235_ctrl, "5235", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5235_ctrl, "523x", 0},
+  
+  {mcfisa_a|mcfhwdiv|mcfemac,			mcf5249_ctrl, "5249", 0},
+  {mcfisa_a|mcfhwdiv|mcfemac,			mcf5250_ctrl, "5250", 0},
+  
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5271_ctrl, "5270", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5271_ctrl, "5271", 0},
+  
+  {mcfisa_a|mcfhwdiv|mcfmac,			mcf5272_ctrl, "5272", 0},
+  
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5275_ctrl, "5274", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5275_ctrl, "5275", 0},
+  
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5282_ctrl, "5280", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5282_ctrl, "5281", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5282_ctrl, "5282", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5282_ctrl, "528x", 0},
+  
+  {mcfisa_a|mcfhwdiv|mcfmac,			mcf_ctrl, "5307", 0},
+  
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5329_ctrl, "5327", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5329_ctrl, "5328", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5329_ctrl, "5329", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5329_ctrl, "532x", 0},
+  
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5373_ctrl, "5372", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5373_ctrl, "5373", -1},
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,	mcf5373_ctrl, "537x", 0},
+  
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfmac,		mcf_ctrl, "5407",0},
+  
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5470", -1},
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5471", -1},
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5472", -1},
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5473", -1},
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5474", -1},
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5475", -1},
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "547x", 0},
+  
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5480", -1},
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5481", -1},
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5482", -1},
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5483", -1},
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5484", -1},
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "5485", -1},
+  {mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "548x", 0},
+  
+  {0,NULL,NULL, 0}
   };
 
-#define CPU_ALLOW_MC 1
-#define CPU_ALLOW_NEGATION 4
-
 static const struct m68k_cpu *m68k_lookup_cpu
 (const char *, const struct m68k_cpu *, int, int *);
 static int m68k_set_arch (const char *, int, int);
@@ -763,74 +802,6 @@ static char alt_notend_table[256];
       || (*s == ':'						\
 	  && alt_notend_table[(unsigned char) s[1]])))
 
-/* Return a human readable string holding the list of chips that are
-   valid for a particular architecture, suppressing aliases (unless
-   there is only one of them).  */
-
-static char *
-find_cf_chip (int architecture)
-{
-  static char buf[1024];
-  int i, j, n_chips, n_alias;
-  char *cp;
-
-  strcpy (buf, " (");
-  cp = buf + strlen (buf);
-
-  for (i = 0, n_chips = 0, n_alias = 0; m68k_cpus[i].name; ++i)
-    if (m68k_cpus[i].arch & architecture)
-      {
-	n_chips++;
-	if (m68k_cpus[i].alias)
-	  n_alias++;
-      }
-
-  if (n_chips == 0)
-    as_fatal (_("no matching ColdFire architectures found"));
-
-  if (n_alias > 1)
-    n_chips -= n_alias;
-      
-  for (i = 0, j = 0; m68k_cpus[i].name && j < n_chips; ++i)
-    if (m68k_cpus[i].arch & architecture)
-      {
-	if (j)
-	  {
-	    if ((j == n_chips - 1 && !(n_alias > 1)) || ! n_alias)
-	      {
-		if (n_chips == 2)
-		  {
-		    strncpy (cp, _(" or "), (sizeof (buf) - (cp - buf)));
-		    cp += strlen (cp);
-		  }
-		else
-		  {
-		    strncpy (cp, _(", or "), (sizeof (buf) - (cp - buf)));
-		    cp += strlen (cp);
-		  }
-	      }
-	    else
-	      {
-		strncpy (cp, ", ", (sizeof (buf) - (cp - buf)));
-		cp += strlen (cp);
-	      }
-	  }
-	strncpy (cp, m68k_cpus[i].name, (sizeof (buf) - (cp - buf)));
-	cp += strlen (cp);
-	j++;
-      }
-
-  if (n_alias > 1)
-    {
-      strncpy (cp, _(", or aliases"), (sizeof (buf) - (cp - buf)));
-      cp += strlen (cp);
-    }
-
-  strncpy (cp, ")", (sizeof (buf) - (cp - buf)));
-
-  return buf;
-}
-
 #ifdef OBJ_ELF
 
 /* Return zero if the reference to SYMBOL from within the same segment may
@@ -2033,92 +2004,100 @@ m68k_ip (char *instring)
 	  if (ok_arch
 	      && !(ok_arch & current_architecture))
 	    {
-	      char buf[200], *cp;
-
-	      strncpy (buf,
-		       _("invalid instruction for this architecture; needs "),
-		       sizeof (buf));
-	      cp = buf + strlen (buf);
+	      const struct m68k_cpu *cpu;
+	      int any = 0;
+	      size_t space = 400;
+	      char *buf = xmalloc (space + 1);
+	      size_t len;
+	      int paren = 1;
+
+	      the_ins.error = buf;
+	      /* Make sure there's a NUL at the end of the buffer -- strncpy
+		 won't write one when it runs out of buffer */
+	      buf[space] = 0;
+#define APPEND(STRING) \
+  (strncpy (buf, STRING, space), len = strlen (buf), buf += len, space -= len)
+
+	      APPEND (_("invalid instruction for this architecture; needs "));
 	      switch (ok_arch)
 		{
 		case mcfisa_a:
-		  strncpy (cp, _("ColdFire ISA_A"),
-			   sizeof (buf) - (cp - buf));
-		  cp += strlen (cp);
-		  strncpy (cp, find_cf_chip (ok_arch),
-			   sizeof (buf) - (cp - buf));
-		  cp += strlen (cp);
+		  APPEND (_("ColdFire ISA_A"));
 		  break;
 		case mcfhwdiv:
-		  strncpy (cp, _("ColdFire hardware divide"),
-			   sizeof (buf) - (cp - buf));
-		  cp += strlen (cp);
-		  strncpy (cp, find_cf_chip (ok_arch),
-			   sizeof (buf) - (cp - buf));
-		  cp += strlen (cp);
+		  APPEND (_("ColdFire hardware divide"));
 		  break;
 		case mcfisa_aa:
-		  strncpy (cp, _("ColdFire ISA_A+"),
-			   sizeof (buf) - (cp - buf));
-		  cp += strlen (cp);
-		  strncpy (cp, find_cf_chip (ok_arch),
-			   sizeof (buf) - (cp - buf));
-		  cp += strlen (cp);
+		  APPEND (_("ColdFire ISA_A+"));
 		  break;
 		case mcfisa_b:
-		  strncpy (cp, _("ColdFire ISA_B"),
-			   sizeof (buf) - (cp - buf));
-		  cp += strlen (cp);
-		  strncpy (cp, find_cf_chip (ok_arch),
-			   sizeof (buf) - (cp - buf));
-		  cp += strlen (cp);
+		  APPEND (_("ColdFire ISA_B"));
 		  break;
 		case cfloat:
-		  strncpy (cp, _("ColdFire fpu"), sizeof (buf) - (cp - buf));
-		  cp += strlen (cp);
-		  strncpy (cp, find_cf_chip (ok_arch),
-			   sizeof (buf) - (cp - buf));
-		  cp += strlen (cp);
+		  APPEND (_("ColdFire fpu"));
 		  break;
 		case mfloat:
-		  strcpy (cp, _("fpu (68040, 68060 or 68881/68882)"));
+		  APPEND (_("M68K fpu"));
 		  break;
 		case mmmu:
-		  strcpy (cp, _("mmu (68030 or 68851)"));
+		  APPEND (_("M68K mmu"));
 		  break;
 		case m68020up:
-		  strcpy (cp, _("68020 or higher"));
+		  APPEND (_("68020 or higher"));
 		  break;
 		case m68000up:
-		  strcpy (cp, _("68000 or higher"));
+		  APPEND (_("68000 or higher"));
 		  break;
 		case m68010up:
-		  strcpy (cp, _("68010 or higher"));
+		  APPEND (_("68010 or higher"));
 		  break;
 		default:
-		  {
-		    int got_one = 0, idx;
+		  paren = 0;
+		}
+	      if (paren)
+		APPEND (" (");
 
-		    for (idx = 0; m68k_cpus[idx].name; idx++)
+	      for (cpu = m68k_cpus; cpu->name; cpu++)
+		if (!cpu->alias && (cpu->arch & ok_arch))
+		  {
+		    const struct m68k_cpu *alias;
+
+		    if (any)
+		      APPEND (", ");
+		    any = 0;
+		    APPEND (cpu->name);
+		    APPEND (" [");
+		    if (cpu != m68k_cpus)
+		      for (alias = cpu - 1; alias->alias; alias--)
+			{
+			  if (any)
+			    APPEND (", ");
+			  APPEND (alias->name);
+			  any = 1;
+			}
+		    for (alias = cpu + 1; alias->alias; alias++)
 		      {
-			if ((m68k_cpus[idx].arch & ok_arch)
-			    && ! m68k_cpus[idx].alias)
-			  {
-			    if (got_one)
-			      {
-				strcpy (cp, " or ");
-				cp += strlen (cp);
-			      }
-			    got_one = 1;
-			    strcpy (cp, m68k_cpus[idx].name);
-			    cp += strlen (cp);
-			  }
+			if (any)
+			  APPEND (", ");
+			APPEND (alias->name);
+			any = 1;
 		      }
+		    
+		    APPEND ("]");
+		    any = 1;
 		  }
+	      if (paren)
+		APPEND (")");
+#undef APPEND
+	      if (!space)
+		{
+		  /* we ran out of space, so replace the end of the list
+		     with ellipsis.  */
+		  buf -= 4;
+		  while (*buf != ' ')
+		    buf--;
+		  strcpy (buf, " ...");
 		}
-	      cp = xmalloc (strlen (buf) + 1);
-	      strcpy (cp, buf);
-	      the_ins.error = cp;
 	    }
 	  else
 	    the_ins.error = _("operands mismatch");
@@ -4375,68 +4354,6 @@ md_begin (void)
 #endif
 }
 
-static void
-select_control_regs (void)
-{
-  /* Note which set of "movec" control registers is available.  */
-  switch (current_chip)
-    {
-    case 0:
-      if (verbose)
-	as_warn (_("architecture not yet selected: defaulting to 68020"));
-      control_regs = m68020_control_regs;
-      break;
-      
-    case cpu_m68000:
-      control_regs = m68000_control_regs;
-      break;
-    case cpu_m68010:
-      control_regs = m68010_control_regs;
-      break;
-    case cpu_m68020:
-    case cpu_m68030:
-      control_regs = m68020_control_regs;
-      break;
-    case cpu_m68040:
-      control_regs = m68040_control_regs;
-      break;
-    case cpu_m68060:
-      control_regs = m68060_control_regs;
-      break;
-    case cpu_cpu32:
-      control_regs = cpu32_control_regs;
-      break;
-    case cpu_cf5200:
-    case cpu_cf5206e:
-    case cpu_cf5307:
-    case cpu_cf5407:
-      control_regs = mcf_control_regs;
-      break;
-    case cpu_cf5249:
-      control_regs = mcf5249_control_regs;
-      break;
-    case cpu_cf528x:
-    case cpu_cf521x:
-      control_regs = mcf528x_control_regs;
-      break;
-    case cpu_cf547x:
-    case cpu_cf548x:
-      control_regs = mcfv4e_control_regs;
-      break;
-    case cpu_cf5208:
-      control_regs = mcf5208_control_regs;
-      break;
-    case cpu_cf5213:
-      control_regs = mcf5213_control_regs;
-      break;
-    case cpu_cf5329:
-      control_regs = mcf5329_control_regs;
-      break;
-    default:
-      abort ();
-    }
-}
-
 
 /* This is called when a label is defined.  */
 
@@ -5366,7 +5283,7 @@ mri_chip (void)
   else
     current_architecture &= m68881 | m68851;
   current_architecture |= m68k_cpus[i].arch & ~(m68881 | m68851);
-  current_chip = m68k_cpus[i].chip;
+  control_regs = m68k_cpus[i].control_regs;
 
   while (*input_line_pointer == '/')
     {
@@ -5383,9 +5300,6 @@ mri_chip (void)
 	current_architecture |= m68851;
       *input_line_pointer = c;
     }
-
-  /* Update info about available control registers.  */
-  select_control_regs ();
 }
 
 /* The MRI CHIP pseudo-op.  */
@@ -5731,7 +5645,7 @@ struct save_opts
   int keep_locals;
   int short_refs;
   int architecture;
-  int chip;
+  const enum m68k_register *control_regs;
   int quick;
   int rel32;
   int listing;
@@ -5756,7 +5670,7 @@ s_save (int ignore ATTRIBUTE_UNUSED)
   s->keep_locals = flag_keep_locals;
   s->short_refs = flag_short_refs;
   s->architecture = current_architecture;
-  s->chip = current_chip;
+  s->control_regs = control_regs;
   s->quick = m68k_quick;
   s->rel32 = m68k_rel32;
   s->listing = listing;
@@ -5790,7 +5704,7 @@ s_restore (int ignore ATTRIBUTE_UNUSED)
   flag_keep_locals = s->keep_locals;
   flag_short_refs = s->short_refs;
   current_architecture = s->architecture;
-  current_chip = s->chip;
+  control_regs = s->control_regs;
   m68k_quick = s->quick;
   m68k_rel32 = s->rel32;
   listing = s->listing;
@@ -7079,7 +6993,12 @@ m68k_lookup_cpu (const char *arg, const struct m68k_cpu *table,
 
   for (; table->name; table++)
     if (!strcmp (arg, table->name))
-      return table;
+      {
+	if (table->alias < -1 || table->alias > 1)
+	  as_bad (_("`%s' is deprecated, use `%s'"),
+		  table->name, table[table->alias < 0 ? 1 : -1].name);
+	return table;
+      }
   return 0;
 }
 
@@ -7305,14 +7224,18 @@ m68k_init_arch (void)
       not_current_architecture &= ~current_architecture;
     }
   if (selected_arch)
-    current_architecture |= selected_arch->arch;
+    {
+      current_architecture |= selected_arch->arch;
+      control_regs = selected_arch->control_regs;
+    }
   else
     current_architecture |= selected_cpu->arch;
-
-  current_architecture &= ~not_current_architecture;
   
+  current_architecture &= ~not_current_architecture;
+
   if (selected_cpu)
     {
+      control_regs = selected_cpu->control_regs;
       if (current_architecture & ~selected_cpu->arch)
 	{
 	  as_bad (_("selected processor does not have all features of selected architecture"));
@@ -7349,9 +7272,6 @@ m68k_init_arch (void)
     }
   /* What other incompatibilities could we check for?  */
 
-  /* Note which set of "movec" control registers is available.  */
-  select_control_regs ();
-
   if (cpu_of_arch (current_architecture) < m68020
       || arch_coldfire_p (current_architecture))
     md_relax_table[TAB (PCINDEX, BYTE)].rlx_more = 0;
@@ -7374,15 +7294,11 @@ md_show_usage (FILE *stream)
       if (strcasecmp (default_cpu, m68k_cpus[i].name) == 0)
 	{
 	  default_arch = m68k_cpus[i].arch;
-	  for (i = 0; m68k_cpus[i].name; i++)
-	    {
-	      if (m68k_cpus[i].arch == default_arch
-		  && !m68k_cpus[i].alias)
-		{
-		  default_cpu = m68k_cpus[i].name;
-		  break;
-		}
-	    }
+	  while (m68k_cpus[i].alias > 0)
+	    i--;
+	  while (m68k_cpus[i].alias < 0)
+	    i++;
+	  default_cpu = m68k_cpus[i].name;
 	}
     }
 
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 557fb4007c1..89416c9b488 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -1191,6 +1191,12 @@ mips_target_format (void)
     case bfd_target_coff_flavour:
       return "pe-mips";
     case bfd_target_elf_flavour:
+#ifdef TE_VXWORKS
+      if (!HAVE_64BIT_OBJECTS && !HAVE_NEWABI)
+	return (target_big_endian
+		? "elf32-bigmips-vxworks"
+		: "elf32-littlemips-vxworks");
+#endif
 #ifdef TE_TMIPS
       /* This is traditional mips.  */
       return (target_big_endian
@@ -1397,6 +1403,13 @@ md_begin (void)
   int i = 0;
   int broken = 0;
 
+  if (mips_pic != NO_PIC)
+    {
+      if (g_switch_seen && g_switch_value != 0)
+	as_bad (_("-G may not be used in position-independent code"));
+      g_switch_value = 0;
+    }
+
   if (! bfd_set_arch_mach (stdoutput, bfd_arch_mips, file_mips_arch))
     as_warn (_("Could not set architecture and machine"));
 
@@ -1524,10 +1537,11 @@ md_begin (void)
 
   if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
     {
-      /* On a native system, sections must be aligned to 16 byte
-	 boundaries.  When configured for an embedded ELF target, we
-	 don't bother.  */
-      if (strcmp (TARGET_OS, "elf") != 0)
+      /* On a native system other than VxWorks, sections must be aligned
+	 to 16 byte boundaries.  When configured for an embedded ELF
+	 target, we don't bother.  */
+      if (strcmp (TARGET_OS, "elf") != 0
+	  && strcmp (TARGET_OS, "vxworks") != 0)
 	{
 	  (void) bfd_set_section_alignment (stdoutput, text_section, 4);
 	  (void) bfd_set_section_alignment (stdoutput, data_section, 4);
@@ -1680,16 +1694,18 @@ md_assemble (char *str)
 }
 
 /* Return true if the given relocation might need a matching %lo().
-   Note that R_MIPS_GOT16 relocations only need a matching %lo() when
-   applied to local symbols.  */
+   This is only "might" because SVR4 R_MIPS_GOT16 relocations only
+   need a matching %lo() when applied to local symbols.  */
 
 static inline bfd_boolean
 reloc_needs_lo_p (bfd_reloc_code_real_type reloc)
 {
   return (HAVE_IN_PLACE_ADDENDS
 	  && (reloc == BFD_RELOC_HI16_S
-	      || reloc == BFD_RELOC_MIPS_GOT16
-	      || reloc == BFD_RELOC_MIPS16_HI16_S));
+	      || reloc == BFD_RELOC_MIPS16_HI16_S
+	      /* VxWorks R_MIPS_GOT16 relocs never need a matching %lo();
+		 all GOT16 relocations evaluate to "G".  */
+	      || (reloc == BFD_RELOC_MIPS_GOT16 && mips_pic != VXWORKS_PIC)));
 }
 
 /* Return true if the given fixup is followed by a matching R_MIPS_LO16
@@ -3898,7 +3914,7 @@ load_address (int reg, expressionS *ep, int *used_at)
 	    relax_end ();
 	}
     }
-  else if (mips_pic == SVR4_PIC && ! mips_big_got)
+  else if (!mips_big_got)
     {
       expressionS ex;
 
@@ -3959,7 +3975,7 @@ load_address (int reg, expressionS *ep, int *used_at)
 	    }
 	}
     }
-  else if (mips_pic == SVR4_PIC)
+  else if (mips_big_got)
     {
       expressionS ex;
 
@@ -5011,7 +5027,7 @@ macro (struct mips_cl_insn *ip)
 		relax_end ();
 	    }
 	}
-      else if (mips_pic == SVR4_PIC && ! mips_big_got && ! HAVE_NEWABI)
+      else if (!mips_big_got && !HAVE_NEWABI)
 	{
 	  int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT16;
 
@@ -5047,7 +5063,9 @@ macro (struct mips_cl_insn *ip)
 
 	  if (offset_expr.X_add_number == 0)
 	    {
-	      if (breg == 0 && (call || tempreg == PIC_CALL_REG))
+	      if (mips_pic == SVR4_PIC
+		  && breg == 0
+		  && (call || tempreg == PIC_CALL_REG))
 		lw_reloc_type = (int) BFD_RELOC_MIPS_CALL16;
 
 	      relax_start (offset_expr.X_add_symbol);
@@ -5104,7 +5122,7 @@ macro (struct mips_cl_insn *ip)
 	      used_at = 1;
 	    }
 	}
-      else if (mips_pic == SVR4_PIC && ! mips_big_got && HAVE_NEWABI)
+      else if (!mips_big_got && HAVE_NEWABI)
 	{
 	  int add_breg_early = 0;
 
@@ -5207,7 +5225,7 @@ macro (struct mips_cl_insn *ip)
 			   BFD_RELOC_MIPS_GOT_DISP, mips_gp_register);
 	    }
 	}
-      else if (mips_pic == SVR4_PIC && ! HAVE_NEWABI)
+      else if (mips_big_got && !HAVE_NEWABI)
 	{
 	  int gpdelay;
 	  int lui_reloc_type = (int) BFD_RELOC_MIPS_GOT_HI16;
@@ -5364,7 +5382,7 @@ macro (struct mips_cl_insn *ip)
 	    }
 	  relax_end ();
 	}
-      else if (mips_pic == SVR4_PIC && HAVE_NEWABI)
+      else if (mips_big_got && HAVE_NEWABI)
 	{
 	  int lui_reloc_type = (int) BFD_RELOC_MIPS_GOT_HI16;
 	  int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT_LO16;
@@ -5497,13 +5515,13 @@ macro (struct mips_cl_insn *ip)
     case M_JAL_2:
       if (mips_pic == NO_PIC)
 	macro_build (NULL, "jalr", "d,s", dreg, sreg);
-      else if (mips_pic == SVR4_PIC)
+      else
 	{
 	  if (sreg != PIC_CALL_REG)
 	    as_warn (_("MIPS PIC call to register other than $25"));
 
 	  macro_build (NULL, "jalr", "d,s", dreg, sreg);
-	  if (! HAVE_NEWABI)
+	  if (mips_pic == SVR4_PIC && !HAVE_NEWABI)
 	    {
 	      if (mips_cprestore_offset < 0)
 		as_warn (_("No .cprestore pseudo-op used in PIC code"));
@@ -5529,8 +5547,6 @@ macro (struct mips_cl_insn *ip)
 		}
 	    }
 	}
-      else
-	abort ();
 
       break;
 
@@ -5666,6 +5682,8 @@ macro (struct mips_cl_insn *ip)
 		}
 	    }
 	}
+      else if (mips_pic == VXWORKS_PIC)
+	as_bad (_("Non-PIC jump used in PIC library"));
       else
 	abort ();
 
@@ -6026,7 +6044,7 @@ macro (struct mips_cl_insn *ip)
 		relax_end ();
 	    }
 	}
-      else if (mips_pic == SVR4_PIC && ! mips_big_got)
+      else if (!mips_big_got)
 	{
 	  int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT16;
 
@@ -6080,7 +6098,7 @@ macro (struct mips_cl_insn *ip)
 			 tempreg, tempreg, breg);
 	  macro_build (&expr1, s, fmt, treg, BFD_RELOC_LO16, tempreg);
 	}
-      else if (mips_pic == SVR4_PIC && ! HAVE_NEWABI)
+      else if (mips_big_got && !HAVE_NEWABI)
 	{
 	  int gpdelay;
 
@@ -6129,7 +6147,7 @@ macro (struct mips_cl_insn *ip)
 			 tempreg, tempreg, breg);
 	  macro_build (&expr1, s, fmt, treg, BFD_RELOC_LO16, tempreg);
 	}
-      else if (mips_pic == SVR4_PIC && HAVE_NEWABI)
+      else if (mips_big_got && HAVE_NEWABI)
 	{
 	  /* If this is a reference to an external symbol, we want
 	       lui	$tempreg,<sym>		(BFD_RELOC_MIPS_GOT_HI16)
@@ -6249,14 +6267,12 @@ macro (struct mips_cl_insn *ip)
 	  macro_build_lui (&offset_expr, AT);
 	  used_at = 1;
 	}
-      else if (mips_pic == SVR4_PIC)
+      else
 	{
 	  macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", AT,
 		       BFD_RELOC_MIPS_GOT16, mips_gp_register);
 	  used_at = 1;
 	}
-      else
-	abort ();
 
       /* Now we load the register(s).  */
       if (HAVE_64BIT_GPRS)
@@ -6328,7 +6344,7 @@ macro (struct mips_cl_insn *ip)
 	{
 	  assert (strcmp (s, RDATA_SECTION_NAME) == 0);
 	  used_at = 1;
-	  if (mips_pic == SVR4_PIC)
+	  if (mips_pic != NO_PIC)
 	    macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", AT,
 			 BFD_RELOC_MIPS_GOT16, mips_gp_register);
 	  else
@@ -6547,7 +6563,7 @@ macro (struct mips_cl_insn *ip)
 	  if (mips_relax.sequence)
 	    relax_end ();
 	}
-      else if (mips_pic == SVR4_PIC && ! mips_big_got)
+      else if (!mips_big_got)
 	{
 	  /* If this is a reference to an external symbol, we want
 	       lw	$at,<sym>($gp)		(BFD_RELOC_MIPS_GOT16)
@@ -6594,7 +6610,7 @@ macro (struct mips_cl_insn *ip)
 
 	  mips_optimize = hold_mips_optimize;
 	}
-      else if (mips_pic == SVR4_PIC)
+      else if (mips_big_got)
 	{
 	  int gpdelay;
 
@@ -10646,6 +10662,8 @@ struct option md_longopts[] =
   {"mpdr", no_argument, NULL, OPTION_PDR},
 #define OPTION_NO_PDR	   (OPTION_ELF_BASE + 10)
   {"mno-pdr", no_argument, NULL, OPTION_NO_PDR},
+#define OPTION_MVXWORKS_PIC (OPTION_ELF_BASE + 11)
+  {"mvxworks-pic", no_argument, NULL, OPTION_MVXWORKS_PIC},
 #endif /* OBJ_ELF */
 
   {NULL, no_argument, NULL, 0}
@@ -10887,12 +10905,6 @@ md_parse_option (int c, char *arg)
 	}
       mips_pic = SVR4_PIC;
       mips_abicalls = TRUE;
-      if (g_switch_seen && g_switch_value != 0)
-	{
-	  as_bad (_("-G may not be used with SVR4 PIC code"));
-	  return 0;
-	}
-      g_switch_value = 0;
       break;
 
     case OPTION_NON_SHARED:
@@ -10916,11 +10928,6 @@ md_parse_option (int c, char *arg)
     case 'G':
       g_switch_value = atoi (arg);
       g_switch_seen = 1;
-      if (mips_pic == SVR4_PIC && g_switch_value != 0)
-	{
-	  as_bad (_("-G may not be used with SVR4 PIC code"));
-	  return 0;
-	}
       break;
 
 #ifdef OBJ_ELF
@@ -11026,6 +11033,10 @@ md_parse_option (int c, char *arg)
     case OPTION_NO_PDR:
       mips_flag_pdr = FALSE;
       break;
+
+    case OPTION_MVXWORKS_PIC:
+      mips_pic = VXWORKS_PIC;
+      break;
 #endif /* OBJ_ELF */
 
     default:
@@ -13166,6 +13177,9 @@ md_estimate_size_before_relax (fragS *fragp, asection *segtype)
     change = nopic_need_relax (fragp->fr_symbol, 0);
   else if (mips_pic == SVR4_PIC)
     change = pic_need_relax (fragp->fr_symbol, segtype);
+  else if (mips_pic == VXWORKS_PIC)
+    /* For vxworks, GOT16 relocations never have a corresponding LO16.  */
+    change = 0;
   else
     abort ();
 
diff --git a/gas/config/tc-mips.h b/gas/config/tc-mips.h
index bc642b0a177..5665d3decdd 100644
--- a/gas/config/tc-mips.h
+++ b/gas/config/tc-mips.h
@@ -75,6 +75,9 @@ enum mips_pic_level
 
   /* Generate PIC code as in the SVR4 MIPS ABI.  */
   SVR4_PIC,
+
+  /* VxWorks's PIC model.  */
+  VXWORKS_PIC
 };
 
 extern enum mips_pic_level mips_pic;
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 04bfb53638e..10a1411b526 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -334,6 +334,10 @@ sparc_target_format ()
 #endif
 #endif
 
+#ifdef TE_VXWORKS
+  return "elf32-sparc-vxworks";
+#endif
+
 #ifdef OBJ_ELF
   return sparc_arch_size == 64 ? "elf64-sparc" : "elf32-sparc";
 #endif
@@ -3527,6 +3531,10 @@ tc_gen_reloc (section, fixp)
 #define GOT_NAME "_GLOBAL_OFFSET_TABLE_"
 #else
 #define GOT_NAME "__GLOBAL_OFFSET_TABLE_"
+#endif
+#ifdef TE_VXWORKS
+#define GOTT_BASE "__GOTT_BASE__"
+#define GOTT_INDEX "__GOTT_INDEX__"
 #endif
 
   /* This code must be parallel to the OBJ_ELF tc_fix_adjustable.  */
@@ -3540,18 +3548,30 @@ tc_gen_reloc (section, fixp)
 	    code = BFD_RELOC_SPARC_WPLT30;
 	  break;
 	case BFD_RELOC_HI22:
-	  if (fixp->fx_addsy != NULL
-	      && strcmp (S_GET_NAME (fixp->fx_addsy), GOT_NAME) == 0)
-	    code = BFD_RELOC_SPARC_PC22;
-	  else
-	    code = BFD_RELOC_SPARC_GOT22;
+	  code = BFD_RELOC_SPARC_GOT22;
+	  if (fixp->fx_addsy != NULL)
+	    {
+	      if (strcmp (S_GET_NAME (fixp->fx_addsy), GOT_NAME) == 0)
+		code = BFD_RELOC_SPARC_PC22;
+#ifdef TE_VXWORKS
+	      if (strcmp (S_GET_NAME (fixp->fx_addsy), GOTT_BASE) == 0
+		  || strcmp (S_GET_NAME (fixp->fx_addsy), GOTT_INDEX) == 0)
+		code = BFD_RELOC_HI22; /* Unchanged.  */
+#endif
+	    }
 	  break;
 	case BFD_RELOC_LO10:
-	  if (fixp->fx_addsy != NULL
-	      && strcmp (S_GET_NAME (fixp->fx_addsy), GOT_NAME) == 0)
-	    code = BFD_RELOC_SPARC_PC10;
-	  else
-	    code = BFD_RELOC_SPARC_GOT10;
+	  code = BFD_RELOC_SPARC_GOT10;
+	  if (fixp->fx_addsy != NULL)
+	    {
+	      if (strcmp (S_GET_NAME (fixp->fx_addsy), GOT_NAME) == 0)
+		code = BFD_RELOC_SPARC_PC10;
+#ifdef TE_VXWORKS
+	      if (strcmp (S_GET_NAME (fixp->fx_addsy), GOTT_BASE) == 0
+		  || strcmp (S_GET_NAME (fixp->fx_addsy), GOTT_INDEX) == 0)
+		code = BFD_RELOC_LO10; /* Unchanged.  */
+#endif
+	    }
 	  break;
 	case BFD_RELOC_SPARC13:
 	  code = BFD_RELOC_SPARC_GOT13;
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 5a7f202335f..6cbecef20ed 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -566,6 +566,7 @@ static bfd_boolean workaround_short_loop = FALSE;
 static bfd_boolean maybe_has_short_loop = FALSE;
 static bfd_boolean workaround_close_loop_end = FALSE;
 static bfd_boolean maybe_has_close_loop_end = FALSE;
+static bfd_boolean enforce_three_byte_loop_align = FALSE;
 
 /* When workaround_short_loops is TRUE, all loops with early exits must
    have at least 3 instructions.  workaround_all_short_loops is a modifier
@@ -590,6 +591,7 @@ xtensa_setup_hw_workarounds (int earliest, int latest)
       workaround_short_loop |= TRUE;
       workaround_close_loop_end |= TRUE;
       workaround_all_short_loops |= TRUE;
+      enforce_three_byte_loop_align = TRUE;
     }
 }
 
@@ -4430,6 +4432,26 @@ next_frag_format_size (const fragS *fragP)
 }
 
 
+/* In early Xtensa Processors, for reasons that are unclear, the ISA
+   required two-byte instructions to be treated as three-byte instructions
+   for loop instruction alignment.  This restriction was removed beginning
+   with Xtensa LX.  Now the only requirement on loop instruction alignment
+   is that the first instruction of the loop must appear at an address that
+   does not cross a fetch boundary.  */
+
+static int
+get_loop_align_size (int insn_size)
+{
+  if (insn_size == XTENSA_UNDEFINED)
+    return xtensa_fetch_width;
+
+  if (enforce_three_byte_loop_align && insn_size == 2)
+    return 3;
+
+  return insn_size;
+}
+
+
 /* If the next legit fragment is an end-of-loop marker,
    switch its state so it will instantiate a NOP.  */
 
@@ -6551,7 +6573,8 @@ emit_single_op (TInsn *orig_insn)
        || orig_insn->opcode == xtensa_movi_n_opcode)
       && !cur_vinsn.inside_bundle
       && (orig_insn->tok[1].X_op == O_symbol
-	  || orig_insn->tok[1].X_op == O_pltrel))
+	  || orig_insn->tok[1].X_op == O_pltrel)
+      && !orig_insn->is_specific_opcode && use_transform ())
     xg_assembly_relax (&istack, orig_insn, now_seg, frag_now, 0, 1, 0);
   else
     if (xg_expand_assembly_insn (&istack, orig_insn))
@@ -6702,6 +6725,14 @@ xg_assemble_vliw_tokens (vliw_insn *vinsn)
     {
       int max_fill;
 
+      /* Remember the symbol that marks the end of the loop in the frag
+	 that marks the start of the loop.  This way we can easily find
+	 the end of the loop at the beginning, without adding special code
+	 to mark the loop instructions themselves.  */
+      symbolS *target_sym = NULL;
+      if (vinsn->slots[0].tok[1].X_op == O_symbol)
+	target_sym = vinsn->slots[0].tok[1].X_add_symbol;
+
       xtensa_set_frag_assembly_state (frag_now);
       frag_now->tc_frag_data.is_insn = TRUE;
 
@@ -6711,13 +6742,10 @@ xg_assemble_vliw_tokens (vliw_insn *vinsn)
 
       if (use_transform ())
 	frag_var (rs_machine_dependent, max_fill, max_fill,
-		  RELAX_ALIGN_NEXT_OPCODE,
-		  frag_now->fr_symbol,
-		  frag_now->fr_offset,
-		  NULL);
+		  RELAX_ALIGN_NEXT_OPCODE, target_sym, 0, NULL);
       else
 	frag_var (rs_machine_dependent, 0, 0,
-		  RELAX_CHECK_ALIGN_NEXT_OPCODE, 0, 0, NULL);
+		  RELAX_CHECK_ALIGN_NEXT_OPCODE, target_sym, 0, NULL);
       xtensa_set_frag_assembly_state (frag_now);
 
       xtensa_move_labels (frag_now, 0, FALSE);
@@ -6918,7 +6946,8 @@ xtensa_end (void)
 
   if (workaround_short_loop && maybe_has_short_loop)
     xtensa_fix_short_loop_frags ();
-  xtensa_mark_narrow_branches ();
+  if (align_targets)
+    xtensa_mark_narrow_branches ();
   xtensa_mark_zcl_first_insns ();
 
   xtensa_sanity_check ();
@@ -7113,7 +7142,24 @@ xtensa_mark_zcl_first_insns (void)
 	      /* Of course, sometimes (mostly for toy test cases) a
 		 zero-cost loop instruction is the last in a section.  */
 	      if (targ_frag)
-		targ_frag->tc_frag_data.is_first_loop_insn = TRUE;
+		{
+		  targ_frag->tc_frag_data.is_first_loop_insn = TRUE;
+		  /* Do not widen a frag that is the first instruction of a
+		     zero-cost loop.  It makes that loop harder to align.  */
+		  if (targ_frag->fr_type == rs_machine_dependent
+		      && targ_frag->fr_subtype == RELAX_SLOTS
+		      && (targ_frag->tc_frag_data.slot_subtypes[0]
+			  == RELAX_NARROW))
+		    {
+		      if (targ_frag->tc_frag_data.is_aligning_branch)
+			targ_frag->tc_frag_data.slot_subtypes[0] = RELAX_IMMED;
+		      else
+			{
+			  frag_wane (targ_frag);
+			  targ_frag->tc_frag_data.slot_subtypes[0] = 0;
+			}
+		    }
+		}
 	      if (fragP->fr_subtype == RELAX_CHECK_ALIGN_NEXT_OPCODE)
 		frag_wane (fragP);
 	    }
@@ -7301,7 +7347,7 @@ next_instr_is_loop_end (fragS *fragP)
    .fill 0.  */
 
 static offsetT min_bytes_to_other_loop_end
-  (fragS *, fragS *, offsetT, offsetT);
+  (fragS *, fragS *, offsetT);
 
 static void
 xtensa_fix_close_loop_end_frags (void)
@@ -7315,32 +7361,14 @@ xtensa_fix_close_loop_end_frags (void)
       fragS *fragP;
 
       fragS *current_target = NULL;
-      offsetT current_offset = 0;
 
       /* Walk over all of the fragments in a subsection.  */
       for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next)
 	{
 	  if (fragP->fr_type == rs_machine_dependent
-	      && ((fragP->fr_subtype == RELAX_IMMED)
-		  || ((fragP->fr_subtype == RELAX_SLOTS)
-		      && (fragP->tc_frag_data.slot_subtypes[0]
-			  == RELAX_IMMED))))
-	    {
-	      /* Read it.  If the instruction is a loop, get the target.  */
-	      TInsn t_insn;
-	      tinsn_from_chars (&t_insn, fragP->fr_opcode, 0);
-	      if (xtensa_opcode_is_loop (xtensa_default_isa,
-					 t_insn.opcode) == 1)
-		{
-		  /* Get the current fragment target.  */
-		  if (fragP->tc_frag_data.slot_symbols[0])
-		    {
-		      symbolS *sym = fragP->tc_frag_data.slot_symbols[0];
-		      current_target = symbol_get_frag (sym);
-		      current_offset = fragP->fr_offset;
-		    }
-		}
-	    }
+	      && ((fragP->fr_subtype == RELAX_ALIGN_NEXT_OPCODE)
+		  || (fragP->fr_subtype == RELAX_CHECK_ALIGN_NEXT_OPCODE)))
+	      current_target = symbol_get_frag (fragP->fr_symbol);
 
 	  if (current_target
 	      && fragP->fr_type == rs_machine_dependent
@@ -7352,8 +7380,7 @@ xtensa_fix_close_loop_end_frags (void)
 #define REQUIRED_LOOP_DIVIDING_BYTES 12
 	      /* Max out at 12.  */
 	      min_bytes = min_bytes_to_other_loop_end
-		(fragP->fr_next, current_target, current_offset,
-		 REQUIRED_LOOP_DIVIDING_BYTES);
+		(fragP->fr_next, current_target, REQUIRED_LOOP_DIVIDING_BYTES);
 
 	      if (min_bytes < REQUIRED_LOOP_DIVIDING_BYTES)
 		{
@@ -7394,7 +7421,6 @@ static offsetT unrelaxed_frag_min_size (fragS *);
 static offsetT
 min_bytes_to_other_loop_end (fragS *fragP,
 			     fragS *current_target,
-			     offsetT current_offset,
 			     offsetT max_size)
 {
   offsetT offset = 0;
@@ -7406,11 +7432,11 @@ min_bytes_to_other_loop_end (fragS *fragP,
     {
       if (current_fragP->tc_frag_data.is_loop_target
 	  && current_fragP != current_target)
-	return offset + current_offset;
+	return offset;
 
       offset += unrelaxed_frag_min_size (current_fragP);
 
-      if (offset + current_offset >= max_size)
+      if (offset >= max_size)
 	return max_size;
     }
   return max_size;
@@ -7497,35 +7523,22 @@ xtensa_fix_short_loop_frags (void)
     {
       fragS *fragP;
       fragS *current_target = NULL;
-      offsetT current_offset = 0;
       xtensa_opcode current_opcode = XTENSA_UNDEFINED;
 
       /* Walk over all of the fragments in a subsection.  */
       for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next)
 	{
-	  /* Check on the current loop.  */
 	  if (fragP->fr_type == rs_machine_dependent
-	      && ((fragP->fr_subtype == RELAX_IMMED)
-		  || ((fragP->fr_subtype == RELAX_SLOTS)
-		      && (fragP->tc_frag_data.slot_subtypes[0]
-			  == RELAX_IMMED))))
+	      && ((fragP->fr_subtype == RELAX_ALIGN_NEXT_OPCODE)
+		  || (fragP->fr_subtype == RELAX_CHECK_ALIGN_NEXT_OPCODE)))
 	    {
 	      TInsn t_insn;
-
-	      /* Read it.  If the instruction is a loop, get the target.  */
-	      tinsn_from_chars (&t_insn, fragP->fr_opcode, 0);
-	      if (xtensa_opcode_is_loop (xtensa_default_isa,
-					 t_insn.opcode) == 1)
-		{
-		  /* Get the current fragment target.  */
-		  if (fragP->tc_frag_data.slot_symbols[0])
-		    {
-		      symbolS *sym = fragP->tc_frag_data.slot_symbols[0];
-		      current_target = symbol_get_frag (sym);
-		      current_offset = fragP->fr_offset;
-		      current_opcode = t_insn.opcode;
-		    }
-		}
+	      fragS *loop_frag = next_non_empty_frag (fragP);
+	      tinsn_from_chars (&t_insn, loop_frag->fr_opcode, 0);
+	      current_target = symbol_get_frag (fragP->fr_symbol);
+	      current_opcode = t_insn.opcode;
+	      assert (xtensa_opcode_is_loop (xtensa_default_isa,
+					     current_opcode));
 	    }
 
 	  if (fragP->fr_type == rs_machine_dependent
@@ -7835,16 +7848,10 @@ is_local_forward_loop (const TInsn *insn, fragS *fragP)
 static int
 get_text_align_power (unsigned target_size)
 {
-  int i = 0;
-  unsigned power = 1;
-
-  assert (target_size <= INT_MAX);
-  while (target_size > power)
-    {
-      power <<= 1;
-      i += 1;
-    }
-  return i;
+  if (target_size <= 4)
+    return 2;
+  assert (target_size == 8);
+  return 3;
 }
 
 
@@ -8038,14 +8045,9 @@ get_noop_aligned_address (fragS *fragP, addressT address)
      instruction following the loop, not the LOOP instruction.  */
 
   if (first_insn == NULL)
-    return address;
-
-  assert (first_insn->tc_frag_data.is_first_loop_insn);
-
-  first_insn_size = frag_format_size (first_insn);
-
-  if (first_insn_size == 2 || first_insn_size == XTENSA_UNDEFINED)
-    first_insn_size = 3;	/* ISA specifies this */
+    first_insn_size = xtensa_fetch_width;
+  else
+    first_insn_size = get_loop_align_size (frag_format_size (first_insn));
 
   /* If it was 8, then we'll need a larger alignment for the section.  */
   align_power = get_text_align_power (first_insn_size);
@@ -8108,7 +8110,7 @@ get_aligned_diff (fragS *fragP, addressT address, offsetT *max_diff)
       return opt_diff;
 
     case RELAX_ALIGN_NEXT_OPCODE:
-      target_size = next_frag_format_size (fragP);
+      target_size = get_loop_align_size (next_frag_format_size (fragP));
       loop_insn_offset = 0;
       is_loop = next_frag_opcode_is_loop (fragP, &loop_opcode);
       assert (is_loop);
@@ -8119,9 +8121,6 @@ get_aligned_diff (fragS *fragP, addressT address, offsetT *max_diff)
 	  != RELAX_IMMED)
 	loop_insn_offset = get_expanded_loop_offset (loop_opcode);
 
-      if (target_size == 2)
-	target_size = 3; /* ISA specifies this */
-
       /* In an ideal world, which is what we are shooting for here,
 	 we wouldn't need to use any NOPs immediately prior to the
 	 LOOP instruction.  If this approach fails, relax_frag_loop_align
@@ -8725,7 +8724,7 @@ bytes_to_stretch (fragS *this_frag,
       /* We will need a NOP no matter what, but should we widen
 	 this instruction to help?
 
-	 This is a RELAX_FRAG_NARROW frag.  */
+	 This is a RELAX_NARROW frag.  */
       switch (desired_diff)
 	{
 	case 1:
@@ -10826,8 +10825,11 @@ init_op_placement_info_table (void)
 		  opi->issuef++;
 		  set_bit (fmt, opi->formats);
 		  set_bit (slot, opi->slots[fmt]);
-		  /* opi->slot_count[fmt]++; */
-		  if (fmt_length < opi->narrowest_size)
+		  if (fmt_length < opi->narrowest_size
+		      || (fmt_length == opi->narrowest_size
+			  && (xtensa_format_num_slots (isa, fmt)
+			      < xtensa_format_num_slots (isa,
+							 opi->narrowest))))
 		    {
 		      opi->narrowest = fmt;
 		      opi->narrowest_size = fmt_length;
diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c
index 76d46f55492..413e336a2c8 100644
--- a/gas/config/tc-z80.c
+++ b/gas/config/tc-z80.c
@@ -460,70 +460,6 @@ check_mach (int ins_type)
   ins_used |= ins_type;
 }
 
-/* This function tries to subtract two symbols, the generic code does
-   that too, but this function tries harder.
-   The behaviour of this function is not altered by extra
-   fragmentations caused by the code to produce listings.  */
-int
-z80_optimize_expr (expressionS *resultP, operatorT left_op,
-		   expressionS *right)
-{
-  int res, swap, som;
-  fragS *lfrag, *rfrag, *cur;
-
-  res = 0;
-  if (left_op == O_subtract
-      && right->X_op == O_symbol
-      && resultP->X_op == O_symbol)
-    {
-      lfrag = symbol_get_frag (resultP->X_add_symbol);
-      rfrag = symbol_get_frag (right->X_add_symbol);
-
-      if (S_GET_SEGMENT (right->X_add_symbol) !=  undefined_section
-	  && (S_GET_SEGMENT (right->X_add_symbol)
-	      == S_GET_SEGMENT (resultP->X_add_symbol)))
-	{
-	  for (swap = 0; (res == 0) && (swap < 2); ++swap)
-	    {
-	      if (swap)
-		{
-		  cur = lfrag;
-		  lfrag = rfrag;
-		  rfrag = cur;
-		}
-	      else
-		cur = rfrag;
-
-	      /* Now som == cur->fr_address - rfrag->address, except
-		 the latter may not have been computed yet.  */
-	      for (som = 0; cur && cur != lfrag; cur = cur->fr_next)
-		{
-		  if (cur->fr_type == rs_fill) /* Is the size fized?  */
-		    som += cur->fr_fix+cur->fr_offset*cur->fr_var;
-		  else
-		    break;
-		}
-
-	      if  (cur == lfrag)
-		{
-		  resultP->X_add_number -= right->X_add_number;
-		  resultP->X_add_number
-		    += (S_GET_VALUE (resultP->X_add_symbol)
-			- S_GET_VALUE (right->X_add_symbol));
-		  som -= lfrag->fr_address - rfrag->fr_address;
-		  /* Correct the result if the fr_address
-		     fields are not computed yet.  */
-		  resultP->X_add_number += (swap ? -som : som);
-		  resultP->X_op = O_constant;
-		  resultP->X_add_symbol = 0;
-		  res = 1;
-		}
-	    }
-	}
-    }
-  return res;
-}
-
 /* Check whether an expression is indirect.  */
 static int
 is_indir (const char *s)
diff --git a/gas/config/tc-z80.h b/gas/config/tc-z80.h
index 0ae318af575..0021fb3943a 100644
--- a/gas/config/tc-z80.h
+++ b/gas/config/tc-z80.h
@@ -55,12 +55,10 @@
 /* Define some functions to be called by generic code.  */
 #define md_end               z80_md_end
 #define md_start_line_hook() { if (z80_start_line_hook ()) continue; }
-#define md_optimize_expr     z80_optimize_expr
 #define TC_CONS_FIX_NEW z80_cons_fix_new
 
 extern void z80_md_end (void);
 extern int z80_start_line_hook (void);
-extern int z80_optimize_expr (expressionS *, operatorT, expressionS *);
 extern void z80_cons_fix_new (fragS *, int, int, expressionS *);
 
 #define WORKING_DOT_WORD
diff --git a/gas/configure b/gas/configure
index c97e02b37be..dca6497031c 100755
--- a/gas/configure
+++ b/gas/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL WARN_CFLAGS NO_WERROR GDBINIT cgen_cpu_prefix extra_objects target_cpu_type obj_format te_file install_tooldir atof BFDLIB OPCODES_LIB BFDVER_H ALL_OBJ_DEPS YACC LEX LEXLIB LEX_OUTPUT_ROOT CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBM LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL WARN_CFLAGS NO_WERROR GDBINIT cgen_cpu_prefix extra_objects target_cpu_type obj_format te_file install_tooldir atof BFDLIB OPCODES_LIB BFDVER_H ALL_OBJ_DEPS YACC LEX LEXLIB LEX_OUTPUT_ROOT CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBM datarootdir docdir htmldir LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -856,7 +856,7 @@ Optional Features:
   --enable-static=PKGS  build static libraries default=yes
   --enable-fast-install=PKGS  optimize for fast installation default=yes
   --disable-libtool-lock  avoid locking (might break parallel builds)
-    targets            alternative target configurations besides the primary
+   --enable-targets       alternative target configurations besides the primary
   --enable-commonbfdlib   build shared BFD/opcodes/libiberty library
   --enable-werror    treat compile warnings as errors
   --enable-build-warnings Enable build-time compiler warnings
@@ -11125,6 +11125,10 @@ fi
 
 
 
+
+
+
+
                               ac_config_files="$ac_config_files Makefile doc/Makefile po/Makefile.in:po/Make-in"
 
           ac_config_commands="$ac_config_commands default"
@@ -11882,6 +11886,9 @@ s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
 s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
 s,@MAINT@,$MAINT,;t t
 s,@LIBM@,$LIBM,;t t
+s,@datarootdir@,$datarootdir,;t t
+s,@docdir@,$docdir,;t t
+s,@htmldir@,$htmldir,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
diff --git a/gas/configure.in b/gas/configure.in
index f7a75cd4e29..fe69a51c925 100644
--- a/gas/configure.in
+++ b/gas/configure.in
@@ -23,7 +23,7 @@ AM_INIT_AUTOMAKE(gas, ${BFD_VERSION})
 AM_PROG_LIBTOOL
 
 AC_ARG_ENABLE(targets,
-[    targets            alternative target configurations besides the primary],
+[   --enable-targets       alternative target configurations besides the primary],
 [case "${enableval}" in
   yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
 	    ;;
@@ -669,6 +669,11 @@ GAS_CHECK_DECL_NEEDED(strstr, f, char *(*f)(), $gas_test_headers)
 
 AC_CHECK_DECLS([vsnprintf])
 
+dnl Required for html and install-html targets.
+AC_SUBST(datarootdir)
+AC_SUBST(docdir)
+AC_SUBST(htmldir)
+
 dnl This must come last.
 
 dnl We used to make symlinks to files in the source directory, but now
diff --git a/gas/configure.tgt b/gas/configure.tgt
index 6463631c739..696daaa128f 100644
--- a/gas/configure.tgt
+++ b/gas/configure.tgt
@@ -335,7 +335,7 @@ case ${generic_target} in
 
   sparc-*-rtems*)			fmt=elf ;;
   sparc-*-sunos4*)			fmt=aout em=sun3 ;;
-  sparc-*-aout | sparc*-*-vxworks*)	fmt=aout em=sparcaout ;;
+  sparc-*-aout)				fmt=aout em=sparcaout ;;
   sparc-*-coff)				fmt=coff ;;
   sparc-*-linux*aout*)			fmt=aout em=linux ;;
   sparc-*-linux-*)			fmt=elf em=linux ;;
diff --git a/gas/doc/Makefile.am b/gas/doc/Makefile.am
index e564a25d4e5..cc806ca3d80 100644
--- a/gas/doc/Makefile.am
+++ b/gas/doc/Makefile.am
@@ -70,6 +70,27 @@ $(srcdir)/as.info as.dvi as.html: $(srcdir)/as.texinfo asconfig.texi gasver.texi
 # cygnus option.
 install-data-local: install-info
 
+html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+
+install-html: install-html-am
+
+install-html-am: $(HTMLS)
+	@$(NORMAL_INSTALL)
+	test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
+	@list='$(HTMLS)'; for p in $$list; do \
+	  if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
+	  f=$(html__strip_dir) \
+	  if test -d "$$d$$p"; then \
+	    echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+	    echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+	  else \
+	    echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+	  fi; \
+	done
+
 # This one isn't ready for prime time yet.  Not even a little bit.
 
 noinst_TEXINFOS = internals.texi
diff --git a/gas/doc/Makefile.in b/gas/doc/Makefile.in
index 295835a69dd..687e4727a4f 100644
--- a/gas/doc/Makefile.in
+++ b/gas/doc/Makefile.in
@@ -170,6 +170,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 cgen_cpu_prefix = @cgen_cpu_prefix@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
 exec_prefix = @exec_prefix@
 extra_objects = @extra_objects@
 host = @host@
@@ -177,6 +179,7 @@ host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
@@ -250,6 +253,7 @@ CPU_DOCS = \
 	c-z80.texi \
 	c-z8k.texi
 
+html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 
 # This one isn't ready for prime time yet.  Not even a little bit.
 noinst_TEXINFOS = internals.texi
@@ -594,6 +598,25 @@ $(srcdir)/as.info as.dvi as.html: $(srcdir)/as.texinfo asconfig.texi gasver.texi
 # cygnus option.
 install-data-local: install-info
 
+install-html: install-html-am
+
+install-html-am: $(HTMLS)
+	@$(NORMAL_INSTALL)
+	test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
+	@list='$(HTMLS)'; for p in $$list; do \
+	  if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
+	  f=$(html__strip_dir) \
+	  if test -d "$$d$$p"; then \
+	    echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+	    echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+	  else \
+	    echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+	  fi; \
+	done
+
 # Maintenance
 
 # We need it for the taz target in ../../Makefile.in.
diff --git a/gas/expr.c b/gas/expr.c
index 3ae1bcc5819..69f0aaccdb6 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -1,6 +1,6 @@
 /* expr.c -operands, expressions-
    Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -1662,6 +1662,7 @@ expr (int rankarg,		/* Larger # is higher rank.  */
   while (op_left != O_illegal && op_rank[(int) op_left] > rank)
     {
       segT rightseg;
+      bfd_vma frag_off;
 
       input_line_pointer += op_chars;	/* -> after operator.  */
 
@@ -1741,12 +1742,15 @@ expr (int rankarg,		/* Larger # is higher rank.  */
       else if (op_left == O_subtract
 	       && right.X_op == O_symbol
 	       && resultP->X_op == O_symbol
-	       && (symbol_get_frag (right.X_add_symbol)
-		   == symbol_get_frag (resultP->X_add_symbol))
+	       && retval == rightseg
 	       && (SEG_NORMAL (rightseg)
-		   || right.X_add_symbol == resultP->X_add_symbol))
+		   || right.X_add_symbol == resultP->X_add_symbol)
+	       && frag_offset_fixed_p (symbol_get_frag (resultP->X_add_symbol),
+				       symbol_get_frag (right.X_add_symbol),
+				       &frag_off))
 	{
 	  resultP->X_add_number -= right.X_add_number;
+	  resultP->X_add_number -= frag_off / OCTETS_PER_BYTE;
 	  resultP->X_add_number += (S_GET_VALUE (resultP->X_add_symbol)
 				    - S_GET_VALUE (right.X_add_symbol));
 	  resultP->X_op = O_constant;
@@ -1900,6 +1904,7 @@ resolve_expression (expressionS *expressionP)
   valueT left, right;
   segT seg_left, seg_right;
   fragS *frag_left, *frag_right;
+  bfd_vma frag_off;
 
   switch (op)
     {
@@ -2002,13 +2007,15 @@ resolve_expression (expressionS *expressionP)
 	 on the input value.
 	 Otherwise, both operands must be absolute.  We already handled
 	 the case of addition or subtraction of a constant above.  */
+      frag_off = 0;
       if (!(seg_left == absolute_section
 	       && seg_right == absolute_section)
 	  && !(op == O_eq || op == O_ne)
 	  && !((op == O_subtract
 		|| op == O_lt || op == O_le || op == O_ge || op == O_gt)
 	       && seg_left == seg_right
-	       && (finalize_syms || frag_left == frag_right)
+	       && (finalize_syms
+		   || frag_offset_fixed_p (frag_left, frag_right, &frag_off))
 	       && (seg_left != reg_section || left == right)
 	       && (seg_left != undefined_section || add_symbol == op_symbol)))
 	{
@@ -2068,6 +2075,7 @@ resolve_expression (expressionS *expressionP)
 	    return 0;
 	}
 
+      right += frag_off / OCTETS_PER_BYTE;
       switch (op)
 	{
 	case O_add:			left += right; break;
diff --git a/gas/frags.c b/gas/frags.c
index 6dae8bc9c22..b08ef502cbf 100644
--- a/gas/frags.c
+++ b/gas/frags.c
@@ -1,6 +1,6 @@
 /* frags.c - manage frags -
    Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2003, 2004
+   1999, 2000, 2001, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -383,3 +383,56 @@ frag_append_1_char (int datum)
     }
   obstack_1grow (&frchain_now->frch_obstack, datum);
 }
+
+/* Return TRUE if FRAG1 and FRAG2 have a fixed relationship between
+   their start addresses.  Set OFFSET to the difference in address
+   not already accounted for in the frag FR_ADDRESS.  */
+
+bfd_boolean
+frag_offset_fixed_p (fragS *frag1, fragS *frag2, bfd_vma *offset)
+{
+  fragS *frag;
+  bfd_vma off;
+
+  /* Start with offset initialised to difference between the two frags.
+     Prior to assigning frag addresses this will be zero.  */
+  off = frag1->fr_address - frag2->fr_address;
+  if (frag1 == frag2)
+    {
+      *offset = off;
+      return TRUE;
+    }
+
+  /* Maybe frag2 is after frag1.  */
+  frag = frag1;
+  while (frag->fr_type == rs_fill)
+    {
+      off += frag->fr_fix + frag->fr_offset * frag->fr_var;
+      frag = frag->fr_next;
+      if (frag == NULL)
+	break;
+      if (frag == frag2)
+	{
+	  *offset = off;
+	  return TRUE;
+	}
+    }
+
+  /* Maybe frag1 is after frag2.  */
+  off = frag1->fr_address - frag2->fr_address;
+  frag = frag2;
+  while (frag->fr_type == rs_fill)
+    {
+      off -= frag->fr_fix + frag->fr_offset * frag->fr_var;
+      frag = frag->fr_next;
+      if (frag == NULL)
+	break;
+      if (frag == frag1)
+	{
+	  *offset = off;
+	  return TRUE;
+	}
+    }
+
+  return FALSE;
+}
diff --git a/gas/frags.h b/gas/frags.h
index e6c61709191..880446763a4 100644
--- a/gas/frags.h
+++ b/gas/frags.h
@@ -1,6 +1,6 @@
 /* frags.h - Header file for the frag concept.
    Copyright 1987, 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -148,4 +148,6 @@ char *frag_var (relax_stateT type,
 		offsetT offset,
 		char *opcode);
 
+bfd_boolean frag_offset_fixed_p (fragS *, fragS *, bfd_vma *);
+
 #endif /* FRAGS_H */
diff --git a/gas/po/Make-in b/gas/po/Make-in
index 77f21f1460f..8a72671a5b7 100644
--- a/gas/po/Make-in
+++ b/gas/po/Make-in
@@ -1,6 +1,6 @@
 # Makefile for program source directory in GNU NLS utilities package.
 # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003, 2006 Free Software Foundation, Inc.
 #
 # This file may be copied and used freely without restrictions.  It can
 # be used in projects which are not available under the GNU Public License
@@ -110,6 +110,7 @@ $(srcdir)/stamp-cat-id: $(PACKAGE).pot
 install: install-exec install-data
 install-exec:
 install-info:
+install-html:
 install-data: install-data-@USE_NLS@
 install-data-no: all
 install-data-yes: all
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index cde23291605..bbc6ee8d163 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,41 @@
+2006-04-16  Nick Clifton  <nickc@redhat.com>
+
+	* gas/arm/arch7.d: Skip test for non-ELF targets.
+	* gas/arm/blx-local.d: Likewise.
+	* gas/arm/svc.d: Likewise.
+	* gas/arm/thumb2_bcond.d: Likewise.
+	* gas/arm/thumb2_it_bad.d: Likewise.
+
+2006-04-07  Paul Brook  <paul@codesourcery.com>
+
+	* gas/arm/blx-local.d: New test.
+	* gas/arm/blx-local.d: New test.
+
+2006-04-07  Paul Brook  <paul@codesourcery.com>
+
+	* gas/arm/thumb2_pool.d: New test.
+	* gas/arm/thumb2_pool.s: New test.
+
+2006-04-05  Richard Sandiford  <richard@codesourcery.com>
+
+	* gas/sparc/vxworks-pic.s, gas/sparc/vxworks-pic.d: New test.
+	* gas/sparc/sparc.exp: Run it.  Remove sparc*-*-vxworks* XFAILs.
+
+2006-03-23  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* gas/i386/rep.s: Pad with .p2align.
+	* gas/i386/rep.d: Adjust.
+
+2006-03-22  Richard Sandiford  <richard@codesourcery.com>
+
+	* gas/mips/vxworks1.s, gas/mips/vxworks1.d,
+	* gas/mips/vxworks1-xgot.d: New tests.
+	* gas/mips/mips.exp: Run them.  Do not run other tests on VxWorks.
+	
+2006-03-21  Paul Brook  <paul@codesourcery.com>
+
+	* gas/arm/thumb32.d: Correct expected output.
+
 2006-03-20  Paul Brook  <paul@codesourcery.com>
 
 	* gas/arm/thumb2_bcond.d: New test.
diff --git a/gas/testsuite/gas/arm/arch7.d b/gas/testsuite/gas/arm/arch7.d
index f6563408282..992948b8331 100644
--- a/gas/testsuite/gas/arm/arch7.d
+++ b/gas/testsuite/gas/arm/arch7.d
@@ -1,5 +1,6 @@
 #name: ARM V7 instructions
 #as: -march=armv7r
+#skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
 #objdump: -dr --prefix-addresses --show-raw-insn
 
 .*: +file format .*arm.*
diff --git a/gas/testsuite/gas/arm/blx-local.d b/gas/testsuite/gas/arm/blx-local.d
new file mode 100644
index 00000000000..e187536b363
--- /dev/null
+++ b/gas/testsuite/gas/arm/blx-local.d
@@ -0,0 +1,15 @@
+#name: Local BLX instructions
+#objdump: -dr --prefix-addresses --show-raw-insn
+#skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+#as:
+
+# Test assembler resolution of blx instructions.
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+
+0+00 <[^>]*> fa000000 	blx	00+8 <foo>
+0+04 <[^>]*> fbffffff 	blx	00+a <foo2>
+0+08 <[^>]*> 46c0      	nop			\(mov r8, r8\)
+0+0a <[^>]*> 46c0      	nop			\(mov r8, r8\)
diff --git a/gas/testsuite/gas/arm/blx-local.s b/gas/testsuite/gas/arm/blx-local.s
new file mode 100644
index 00000000000..c85a562d90f
--- /dev/null
+++ b/gas/testsuite/gas/arm/blx-local.s
@@ -0,0 +1,16 @@
+        .text
+	.arch armv5t
+        .arm
+one:
+        blx     foo
+        blx     foo2
+
+        .thumb
+        .type foo, %function
+        .thumb_func
+foo:
+        nop
+        .type foo2, %function
+        .thumb_func
+foo2:
+        nop
diff --git a/gas/testsuite/gas/arm/svc.d b/gas/testsuite/gas/arm/svc.d
index 697756c7965..fdeb9302083 100644
--- a/gas/testsuite/gas/arm/svc.d
+++ b/gas/testsuite/gas/arm/svc.d
@@ -1,5 +1,6 @@
 # name: SWI/SVC instructions
 # objdump: -dr --prefix-addresses --show-raw-insn
+# skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
 
 .*: +file format .*arm.*
 
diff --git a/gas/testsuite/gas/arm/thumb2_bcond.d b/gas/testsuite/gas/arm/thumb2_bcond.d
index 90b8e2096d2..8ab75320e1a 100644
--- a/gas/testsuite/gas/arm/thumb2_bcond.d
+++ b/gas/testsuite/gas/arm/thumb2_bcond.d
@@ -1,5 +1,6 @@
 # as:
 # objdump: -dr --prefix-addresses --show-raw-insn
+# skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
 
 .*: +file format .*arm.*
 
diff --git a/gas/testsuite/gas/arm/thumb2_it_bad.d b/gas/testsuite/gas/arm/thumb2_it_bad.d
index 1cca8b9650c..f905c9f5e73 100644
--- a/gas/testsuite/gas/arm/thumb2_it_bad.d
+++ b/gas/testsuite/gas/arm/thumb2_it_bad.d
@@ -1,3 +1,4 @@
 #name: Invalid IT instructions
 #as:
+#skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
 #error-output: thumb2_it_bad.l
diff --git a/gas/testsuite/gas/arm/thumb2_pool.d b/gas/testsuite/gas/arm/thumb2_pool.d
new file mode 100644
index 00000000000..7bf0c605d5f
--- /dev/null
+++ b/gas/testsuite/gas/arm/thumb2_pool.d
@@ -0,0 +1,15 @@
+# as: -march=armv6t2
+# objdump: -dr --prefix-addresses --show-raw-insn
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0+000 <[^>]+> 4e04      	ldr	r6, \[pc, #16\]	\(00+14 <[^>]+>\)
+0+002 <[^>]+> 4904      	ldr	r1, \[pc, #16\]	\(00+14 <[^>]+>\)
+0+004 <[^>]+> f8df 600c 	ldr\.w	r6, \[pc, #12\]	; 00+14 <[^>]+>
+0+008 <[^>]+> f8df 9008 	ldr\.w	r9, \[pc, #8\]	; 00+14 <[^>]+>
+0+00c <[^>]+> bf00      	nop
+0+00e <[^>]+> f8df 5004 	ldr\.w	r5, \[pc, #4\]	; 00+14 <[^>]+>
+0+012 <[^>]+> 4900      	ldr	r1, \[pc, #0\]	\(00+14 <[^>]+>\)
+0+014 <[^>]+> (5678|1234) .*
+0+016 <[^>]+> (1234|5678) .*
diff --git a/gas/testsuite/gas/arm/thumb2_pool.s b/gas/testsuite/gas/arm/thumb2_pool.s
new file mode 100644
index 00000000000..844e77ec49f
--- /dev/null
+++ b/gas/testsuite/gas/arm/thumb2_pool.s
@@ -0,0 +1,13 @@
+	.text
+	.thumb
+	.syntax unified
+	.thumb_func
+thumb2_ldr:
+	ldr	r6, =0x12345678
+	ldr.n	r1, =0x12345678
+	ldr.w	r6, =0x12345678
+	ldr	r9, =0x12345678
+	nop
+	ldr.w	r5, =0x12345678
+	ldr	r1, =0x12345678
+	.pool
diff --git a/gas/testsuite/gas/arm/thumb32.d b/gas/testsuite/gas/arm/thumb32.d
index ae2ebf7f434..2977779aefd 100644
--- a/gas/testsuite/gas/arm/thumb32.d
+++ b/gas/testsuite/gas/arm/thumb32.d
@@ -523,8 +523,8 @@ Disassembly of section .text:
 0[0-9a-f]+ <[^>]+> e9c5 2300 	strd	r2, r3, \[r5\]
 0[0-9a-f]+ <[^>]+> e9c5 230c 	strd	r2, r3, \[r5, #48\]
 0[0-9a-f]+ <[^>]+> e945 230c 	strd	r2, r3, \[r5, #-48\]
-0[0-9a-f]+ <[^>]+> f835 1e00 	ldrht	r1, \[r5\]
-0[0-9a-f]+ <[^>]+> f835 1e30 	ldrht	r1, \[r5, #48\]
+0[0-9a-f]+ <[^>]+> f815 1e00 	ldrbt	r1, \[r5\]
+0[0-9a-f]+ <[^>]+> f815 1e30 	ldrbt	r1, \[r5, #48\]
 0[0-9a-f]+ <[^>]+> f915 1e00 	ldrsbt	r1, \[r5\]
 0[0-9a-f]+ <[^>]+> f915 1e30 	ldrsbt	r1, \[r5, #48\]
 0[0-9a-f]+ <[^>]+> f835 1e00 	ldrht	r1, \[r5\]
diff --git a/gas/testsuite/gas/i386/reloc64.d b/gas/testsuite/gas/i386/reloc64.d
index 8503d23eeae..11dfdb4fedd 100644
--- a/gas/testsuite/gas/i386/reloc64.d
+++ b/gas/testsuite/gas/i386/reloc64.d
@@ -19,6 +19,7 @@ Disassembly of section \.text:
 .*[ 	]+R_X86_64_PC32[ 	]+xtrn\+0xf+c
 .*[ 	]+R_X86_64_PC32[ 	]+xtrn\+0xf+c
 .*[ 	]+R_X86_64_PC8[ 	]+xtrn\+0xf+f
+.*[ 	]+R_X86_64_GOT64[ 	]+xtrn
 .*[ 	]+R_X86_64_GOT32[ 	]+xtrn
 .*[ 	]+R_X86_64_GOT32[ 	]+xtrn
 .*[ 	]+R_X86_64_GOTOFF64[ 	]+xtrn
@@ -26,7 +27,7 @@ Disassembly of section \.text:
 .*[ 	]+R_X86_64_GOTPCREL[ 	]+xtrn
 .*[ 	]+R_X86_64_GOTPCREL[ 	]+xtrn\+0xf+c
 .*[ 	]+R_X86_64_GOTPC32[ 	]+_GLOBAL_OFFSET_TABLE_\+0x0*2
-.*[ 	]+R_X86_64_GOTPC32[ 	]+_GLOBAL_OFFSET_TABLE_\+0xf+f
+.*[ 	]+R_X86_64_GOTPC32[ 	]+_GLOBAL_OFFSET_TABLE_\+0xf+c
 .*[ 	]+R_X86_64_GOTPC32[ 	]+_GLOBAL_OFFSET_TABLE_\+0x0*2
 .*[ 	]+R_X86_64_PLT32[ 	]+xtrn
 .*[ 	]+R_X86_64_PLT32[ 	]+xtrn
@@ -50,7 +51,9 @@ Disassembly of section \.data:
 #...
 .*[ 	]+R_X86_64_64[ 	]+xtrn
 .*[ 	]+R_X86_64_PC64[ 	]+xtrn
+.*[ 	]+R_X86_64_GOT64[ 	]+xtrn
 .*[ 	]+R_X86_64_GOTOFF64[ 	]+xtrn
+.*[ 	]+R_X86_64_GOTPCREL64[ 	]+xtrn
 .*[ 	]+R_X86_64_DTPOFF64[ 	]+xtrn
 .*[ 	]+R_X86_64_TPOFF64[ 	]+xtrn
 .*[ 	]+R_X86_64_32[ 	]+xtrn
diff --git a/gas/testsuite/gas/i386/reloc64.l b/gas/testsuite/gas/i386/reloc64.l
index 62a762bc7e0..87a5c772c32 100644
--- a/gas/testsuite/gas/i386/reloc64.l
+++ b/gas/testsuite/gas/i386/reloc64.l
@@ -1,6 +1,5 @@
 .*: Assembler messages:
 .*:29: Error: .*
-.*:33: Error: .*
 .*:35: Error: .*
 .*:36: Error: .*
 .*:37: Error: .*
@@ -50,8 +49,6 @@
 .*:123: Error: .*
 .*:125: Error: .*
 .*:126: Error: .*
-.*:131: Error: .*
-.*:133: Error: .*
 .*:136: Error: .*
 .*:137: Error: .*
 .*:138: Error: .*
diff --git a/gas/testsuite/gas/i386/reloc64.s b/gas/testsuite/gas/i386/reloc64.s
index 1ae14ddcbea..47ebfa8dc0a 100644
--- a/gas/testsuite/gas/i386/reloc64.s
+++ b/gas/testsuite/gas/i386/reloc64.s
@@ -30,7 +30,7 @@ bad	mov	xtrn(%eip), %eax
 	call	xtrn
 	jrcxz	xtrn
 
-bad	movabs	$xtrn@got, %rax
+	movabs	$xtrn@got, %rax
 	add	$xtrn@got, %rax
 bad	mov	$xtrn@got, %eax
 bad	mov	$xtrn@got, %ax
@@ -128,9 +128,9 @@ bad	call	xtrn@tpoff
  .data
 	.quad	xtrn
 	.quad	xtrn - .
-bad	.quad	xtrn@got
+	.quad	xtrn@got
 	.quad	xtrn@gotoff
-bad	.quad	xtrn@gotpcrel
+	.quad	xtrn@gotpcrel
 ill	.quad	_GLOBAL_OFFSET_TABLE_
 ill	.quad	_GLOBAL_OFFSET_TABLE_ - .
 bad	.quad	xtrn@plt
diff --git a/gas/testsuite/gas/i386/rep.d b/gas/testsuite/gas/i386/rep.d
index 9c07a6f767e..f43cc5feb6c 100644
--- a/gas/testsuite/gas/i386/rep.d
+++ b/gas/testsuite/gas/i386/rep.d
@@ -48,3 +48,4 @@ Disassembly of section .text:
   6e:	f3 67 ab[ 	]+rep addr16 stos %eax,%es:\(%di\)
   71:	f3 67 a7[ 	]+repz addr16 cmpsl %es:\(%di\),%ds:\(%si\)
   74:	f3 67 af[ 	]+repz addr16 scas %es:\(%di\),%eax
+	...
diff --git a/gas/testsuite/gas/i386/rep.s b/gas/testsuite/gas/i386/rep.s
index eb07d6c789d..cbda8b3dcd1 100644
--- a/gas/testsuite/gas/i386/rep.s
+++ b/gas/testsuite/gas/i386/rep.s
@@ -48,3 +48,5 @@ _start:
 	addr16 rep stosl
 	addr16 repz cmpsl
 	addr16 repz scasl
+
+	.p2align        4,0
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 25997775cf3..7843f2a9742 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -383,12 +383,14 @@ mips_arch_create sb1 	64	mips64	{ mips3d } \
 			{ -march=sb1 -mtune=sb1 } { -mmips:sb1 } \
 			{ mipsisa64sb1-*-* mipsisa64sb1el-*-* }
 
-
 #
-# And now begin the actual tests!
+# And now begin the actual tests!  VxWorks uses RELA rather than REL
+# relocations, so most of the generic dump tests will not work there.
 #
-
-if { [istarget mips*-*-*] } then {
+if { [istarget mips*-*-vxworks*] } {
+    run_dump_test "vxworks1"
+    run_dump_test "vxworks1-xgot"
+} elseif { [istarget mips*-*-*] } {
     set no_mips16 0
     set elf [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] || [istarget *-*-linux*] || [istarget *-*-netbsd*] ]
     set ecoff [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ]
@@ -777,4 +779,6 @@ if { [istarget mips*-*-*] } then {
         run_dump_test "mips16e-jrc"
         run_dump_test "mips16e-save"
     }
+    run_dump_test "vxworks1"
+    run_dump_test "vxworks1-xgot"
 }
diff --git a/gas/testsuite/gas/mips/vxworks1-xgot.d b/gas/testsuite/gas/mips/vxworks1-xgot.d
new file mode 100644
index 00000000000..5737a571658
--- /dev/null
+++ b/gas/testsuite/gas/mips/vxworks1-xgot.d
@@ -0,0 +1,102 @@
+#as: -mips2 -mvxworks-pic -xgot -mabi=32
+#source: vxworks1.s
+#objdump: -dr
+
+.*:     file format .*
+
+Disassembly of section \.text:
+
+00000000 <\.text>:
+#
+# la $4,local
+#
+.*:	3c040000 	lui	a0,0x0
+			.*: R_MIPS_GOT_HI16	\.data
+.*:	009c2021 	addu	a0,a0,gp
+.*:	8c840000 	lw	a0,0\(a0\)
+			.*: R_MIPS_GOT_LO16	\.data
+#
+# la $4,global
+#
+.*:	3c040000 	lui	a0,0x0
+			.*: R_MIPS_GOT_HI16	global
+.*:	009c2021 	addu	a0,a0,gp
+.*:	8c840000 	lw	a0,0\(a0\)
+			.*: R_MIPS_GOT_LO16	global
+#
+# lw $4,local
+#
+.*:	3c040000 	lui	a0,0x0
+			.*: R_MIPS_GOT_HI16	\.data
+.*:	009c2021 	addu	a0,a0,gp
+.*:	8c840000 	lw	a0,0\(a0\)
+			.*: R_MIPS_GOT_LO16	\.data
+.*:	8c840000 	lw	a0,0\(a0\)
+#
+# lw $4,global
+#
+.*:	3c040000 	lui	a0,0x0
+			.*: R_MIPS_GOT_HI16	global
+.*:	009c2021 	addu	a0,a0,gp
+.*:	8c840000 	lw	a0,0\(a0\)
+			.*: R_MIPS_GOT_LO16	global
+.*:	8c840000 	lw	a0,0\(a0\)
+#
+# sw $4,local
+#
+.*:	3c010000 	lui	at,0x0
+			.*: R_MIPS_GOT_HI16	\.data
+.*:	003c0821 	addu	at,at,gp
+.*:	8c210000 	lw	at,0\(at\)
+			.*: R_MIPS_GOT_LO16	\.data
+.*:	ac240000 	sw	a0,0\(at\)
+#
+# sw $4,global
+#
+.*:	3c010000 	lui	at,0x0
+			.*: R_MIPS_GOT_HI16	global
+.*:	003c0821 	addu	at,at,gp
+.*:	8c210000 	lw	at,0\(at\)
+			.*: R_MIPS_GOT_LO16	global
+.*:	ac240000 	sw	a0,0\(at\)
+#
+# ulw $4,local
+#
+.*:	3c010000 	lui	at,0x0
+			.*: R_MIPS_GOT_HI16	\.data
+.*:	003c0821 	addu	at,at,gp
+.*:	8c210000 	lw	at,0\(at\)
+			.*: R_MIPS_GOT_LO16	\.data
+.*:	88240000 	lwl	a0,0\(at\)
+.*:	98240003 	lwr	a0,3\(at\)
+#
+# ulw $4,global
+#
+.*:	3c010000 	lui	at,0x0
+			.*: R_MIPS_GOT_HI16	global
+.*:	003c0821 	addu	at,at,gp
+.*:	8c210000 	lw	at,0\(at\)
+			.*: R_MIPS_GOT_LO16	global
+.*:	88240000 	lwl	a0,0\(at\)
+.*:	98240003 	lwr	a0,3\(at\)
+#
+# usw $4,local
+#
+.*:	3c010000 	lui	at,0x0
+			.*: R_MIPS_GOT_HI16	\.data
+.*:	003c0821 	addu	at,at,gp
+.*:	8c210000 	lw	at,0\(at\)
+			.*: R_MIPS_GOT_LO16	\.data
+.*:	a8240000 	swl	a0,0\(at\)
+.*:	b8240003 	swr	a0,3\(at\)
+#
+# usw $4,global
+#
+.*:	3c010000 	lui	at,0x0
+			.*: R_MIPS_GOT_HI16	global
+.*:	003c0821 	addu	at,at,gp
+.*:	8c210000 	lw	at,0\(at\)
+			.*: R_MIPS_GOT_LO16	global
+.*:	a8240000 	swl	a0,0\(at\)
+.*:	b8240003 	swr	a0,3\(at\)
+	\.\.\.
diff --git a/gas/testsuite/gas/mips/vxworks1.d b/gas/testsuite/gas/mips/vxworks1.d
new file mode 100644
index 00000000000..2ca762e430f
--- /dev/null
+++ b/gas/testsuite/gas/mips/vxworks1.d
@@ -0,0 +1,71 @@
+#as: -mips2 -mvxworks-pic -mabi=32
+#objdump: -dr
+
+.*:     file format .*
+
+Disassembly of section \.text:
+
+00000000 <\.text>:
+#
+# la $4,local
+#
+.*:	8f840000 	lw	a0,0\(gp\)
+			.*: R_MIPS_GOT16	\.data
+#
+# la $4,global
+#
+.*:	8f840000 	lw	a0,0\(gp\)
+			.*: R_MIPS_GOT16	global
+#
+# lw $4,local
+#
+.*:	8f840000 	lw	a0,0\(gp\)
+			.*: R_MIPS_GOT16	\.data
+.*:	8c840000 	lw	a0,0\(a0\)
+#
+# lw $4,global
+#
+.*:	8f840000 	lw	a0,0\(gp\)
+			.*: R_MIPS_GOT16	global
+.*:	8c840000 	lw	a0,0\(a0\)
+#
+# sw $4,local
+#
+.*:	8f810000 	lw	at,0\(gp\)
+			.*: R_MIPS_GOT16	\.data
+.*:	ac240000 	sw	a0,0\(at\)
+#
+# sw $4,global
+#
+.*:	8f810000 	lw	at,0\(gp\)
+			.*: R_MIPS_GOT16	global
+.*:	ac240000 	sw	a0,0\(at\)
+#
+# ulw $4,local
+#
+.*:	8f810000 	lw	at,0\(gp\)
+			.*: R_MIPS_GOT16	\.data
+.*:	88240000 	lwl	a0,0\(at\)
+.*:	98240003 	lwr	a0,3\(at\)
+#
+# ulw $4,global
+#
+.*:	8f810000 	lw	at,0\(gp\)
+			.*: R_MIPS_GOT16	global
+.*:	88240000 	lwl	a0,0\(at\)
+.*:	98240003 	lwr	a0,3\(at\)
+#
+# usw $4,local
+#
+.*:	8f810000 	lw	at,0\(gp\)
+			.*: R_MIPS_GOT16	\.data
+.*:	a8240000 	swl	a0,0\(at\)
+.*:	b8240003 	swr	a0,3\(at\)
+#
+# usw $4,global
+#
+.*:	8f810000 	lw	at,0\(gp\)
+			.*: R_MIPS_GOT16	global
+.*:	a8240000 	swl	a0,0\(at\)
+.*:	b8240003 	swr	a0,3\(at\)
+	\.\.\.
diff --git a/gas/testsuite/gas/mips/vxworks1.s b/gas/testsuite/gas/mips/vxworks1.s
new file mode 100644
index 00000000000..4d670a320cd
--- /dev/null
+++ b/gas/testsuite/gas/mips/vxworks1.s
@@ -0,0 +1,16 @@
+	la	$4,local
+	la	$4,global
+	lw	$4,local
+	lw	$4,global
+	sw	$4,local
+	sw	$4,global
+	ulw	$4,local
+	ulw	$4,global
+	usw	$4,local
+	usw	$4,global
+	.space	16
+
+	.data
+	.global global
+local:	.word	4
+global:	.word	8
diff --git a/gas/testsuite/gas/sparc/sparc.exp b/gas/testsuite/gas/sparc/sparc.exp
index 4189ddbff73..a2e362dbba1 100644
--- a/gas/testsuite/gas/sparc/sparc.exp
+++ b/gas/testsuite/gas/sparc/sparc.exp
@@ -17,7 +17,7 @@ proc gas_64_check { } {
 }
 
 proc sparc_elf_setup { } {
-    setup_xfail "sparc*-*-*aout*" "sparc*-*-sunos4*" "sparc*-*-vxworks*"
+    setup_xfail "sparc*-*-*aout*" "sparc*-*-sunos4*"
     setup_xfail "sparc*-fujitsu-none" "sparc*-*-*n*bsd*"
     setup_xfail "sparc*-*-coff" "sparc*-*-lynxos*"
     clear_xfail "sparc64*-*-*n*bsd*"
@@ -50,6 +50,10 @@ if [istarget sparc*-*-*] {
     }
 }
 
+if [istarget sparc-*-vxworks*] {
+    run_dump_test "vxworks-pic"
+}
+
 if [istarget sparclet*-*-*] {
     run_dump_test "splet"
     run_dump_test "splet-2"
diff --git a/gas/testsuite/gas/sparc/vxworks-pic.d b/gas/testsuite/gas/sparc/vxworks-pic.d
new file mode 100644
index 00000000000..7e238fbdc45
--- /dev/null
+++ b/gas/testsuite/gas/sparc/vxworks-pic.d
@@ -0,0 +1,27 @@
+#as: -KPIC
+#objdump: -dr
+#name: VxWorks PIC
+
+.*:     file format .*
+
+Disassembly of section \.text:
+
+00000000 <\.text>:
+   0:	2f 00 00 00 	sethi  %hi\(0\), %l7
+			0: R_SPARC_HI22	__GOTT_BASE__
+   4:	ee 05 e0 00 	ld  \[ %l7 \], %l7
+			4: R_SPARC_LO10	__GOTT_BASE__
+   8:	ee 05 e0 00 	ld  \[ %l7 \], %l7
+			8: R_SPARC_LO10	__GOTT_INDEX__
+   c:	03 00 00 00 	sethi  %hi\(0\), %g1
+			c: R_SPARC_HI22	__GOTT_BASE__
+  10:	82 10 60 00 	mov  %g1, %g1	! 0x0
+			10: R_SPARC_LO10	__GOTT_BASE__
+  14:	03 00 00 00 	sethi  %hi\(0\), %g1
+			14: R_SPARC_HI22	__GOTT_INDEX__
+  18:	82 10 60 00 	mov  %g1, %g1	! 0x0
+			18: R_SPARC_LO10	__GOTT_INDEX__
+  1c:	03 00 00 00 	sethi  %hi\(0\), %g1
+			1c: R_SPARC_GOT22	__GOT_BASE__
+  20:	82 10 60 00 	mov  %g1, %g1	! 0x0
+			20: R_SPARC_GOT10	__GOT_BASE__
diff --git a/gas/testsuite/gas/sparc/vxworks-pic.s b/gas/testsuite/gas/sparc/vxworks-pic.s
new file mode 100644
index 00000000000..9d49e007904
--- /dev/null
+++ b/gas/testsuite/gas/sparc/vxworks-pic.s
@@ -0,0 +1,11 @@
+	sethi	%hi(__GOTT_BASE__), %l7
+	ld	[%l7+%lo(__GOTT_BASE__)],%l7
+	ld	[%l7+%lo(__GOTT_INDEX__)],%l7
+
+	sethi	%hi(__GOTT_BASE__), %g1
+	or	%g1, %lo(__GOTT_BASE__), %g1
+	sethi	%hi(__GOTT_INDEX__), %g1
+	or	%g1, %lo(__GOTT_INDEX__), %g1
+
+	sethi	%hi(__GOT_BASE__), %g1
+	or	%g1, %lo(__GOT_BASE__), %g1
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index 97d68b02197..6260b4854c9 100644
--- a/gprof/ChangeLog
+++ b/gprof/ChangeLog
@@ -1,3 +1,17 @@
+2006-04-06  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* po/Make-in: Add install-html target.
+	* Makefile.am: Add install-html, install-html-am and 
+	install-html-recursive targets. 
+	* Makefile.in: Regenerate.
+	* configure.in: AC_SUBST datarootdir, docdir, htmldir.
+	* configure: Regenerate.
+
+2006-03-21  Ben Elliston  <bje@au.ibm.com>
+
+	* corefile.c (core_init): Report that the executable is not in the
+	expected executable format rather than "a.out" format.
+
 2006-03-09  Nick Clifton  <nickc@redhat.com>
 
 	* po/sv.po: Updated Swedish translation.
diff --git a/gprof/Makefile.am b/gprof/Makefile.am
index 273db036ac0..1b862675353 100644
--- a/gprof/Makefile.am
+++ b/gprof/Makefile.am
@@ -75,6 +75,54 @@ gprof.1: $(srcdir)/gprof.texi config.texi
 	       (rm -f $@.T$$$$ && exit 1)
 	rm -f gprof.pod
 
+.PHONY: install-html install-html-am install-html-recursive
+
+html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+
+install-html: install-html-recursive  install-html-am
+
+install-html-am: $(HTMLS)
+	@$(NORMAL_INSTALL)
+	test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
+	@list='$(HTMLS)'; for p in $$list; do \
+	  if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
+	  f=$(html__strip_dir) \
+	  if test -d "$$d$$p"; then \
+	    echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+	    echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+	  else \
+	    echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+	  fi; \
+	done
+
+install-html-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
 # We want install to imply install-info as per GNU standards, despite the
 # cygnus option.
 install-data-local: install-info
diff --git a/gprof/Makefile.in b/gprof/Makefile.in
index 11cd6ee1d51..328a3da48d7 100644
--- a/gprof/Makefile.in
+++ b/gprof/Makefile.in
@@ -203,12 +203,15 @@ build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
@@ -259,6 +262,7 @@ TEXI2POD = perl $(srcdir)/../etc/texi2pod.pl
 POD2MAN = pod2man --center="GNU" --release="binutils-$(VERSION)" --section=1
 info_TEXINFOS = gprof.texi
 man_MANS = gprof.1
+html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 CLEANFILES = dep.sed DEP DEPA DEP1 DEP2
 all: $(BUILT_SOURCES) gconfig.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -820,6 +824,52 @@ gprof.1: $(srcdir)/gprof.texi config.texi
 	       (rm -f $@.T$$$$ && exit 1)
 	rm -f gprof.pod
 
+.PHONY: install-html install-html-am install-html-recursive
+
+install-html: install-html-recursive  install-html-am
+
+install-html-am: $(HTMLS)
+	@$(NORMAL_INSTALL)
+	test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
+	@list='$(HTMLS)'; for p in $$list; do \
+	  if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
+	  f=$(html__strip_dir) \
+	  if test -d "$$d$$p"; then \
+	    echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+	    echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+	  else \
+	    echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+	  fi; \
+	done
+
+install-html-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
 # We want install to imply install-info as per GNU standards, despite the
 # cygnus option.
 install-data-local: install-info
diff --git a/gprof/configure b/gprof/configure
index 6af2bdd7fef..35a019bd1d8 100755
--- a/gprof/configure
+++ b/gprof/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT WARN_CFLAGS NO_WERROR LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT WARN_CFLAGS NO_WERROR datarootdir docdir htmldir LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -3339,6 +3339,7 @@ cygwin* | mingw* |pw32*)
   ;;
 
 darwin* | rhapsody*)
+  # this will be overwritten by pass_all, but leave it in just in case
   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
   lt_cv_file_magic_cmd='/usr/bin/file -L'
   case "$host_os" in
@@ -3349,6 +3350,7 @@ darwin* | rhapsody*)
     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
     ;;
   esac
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
 freebsd* | kfreebsd*-gnu)
@@ -3409,14 +3411,7 @@ irix5* | irix6*)
 
 # This must be Linux ELF.
 linux-gnu*)
-  case $host_cpu in
-  alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* )
-    lt_cv_deplibs_check_method=pass_all ;;
-  *)
-    # glibc up to 2.1.1 does not perform some relocations on ARM
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
 netbsd* | knetbsd*-gnu)
@@ -3477,6 +3472,67 @@ deplibs_check_method=$lt_cv_deplibs_check_method
 
 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
 
+# find the maximum length of command line arguments
+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  cygwin* | mingw*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+  esac
+
+fi
+
+if test -n "$lt_cv_sys_max_cmd_len" ; then
+  echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
+else
+  echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
+fi
+
+
 # Only perform the check for file, if the check method requires it
 case $deplibs_check_method in
 file_magic*)
@@ -3810,7 +3866,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
 case $host in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 3813 "configure"' > conftest.$ac_ext
+  echo '#line 3869 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -3865,6 +3921,52 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case "`/usr/bin/file conftest.o`" in
+    *32-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_i386"
+          ;;
+        ppc64-*linux*|powerpc64-*linux*)
+          LD="${LD-ld} -m elf32ppclinux"
+          ;;
+        s390x-*linux*)
+          LD="${LD-ld} -m elf_s390"
+          ;;
+        sparc64-*linux*)
+          LD="${LD-ld} -m elf32_sparc"
+          ;;
+      esac
+      ;;
+    *64-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          LD="${LD-ld} -m elf64_s390"
+          ;;
+        sparc*-*linux*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
   SAVE_CFLAGS="$CFLAGS"
@@ -8403,6 +8505,10 @@ fi
 
 
 
+
+
+
+
                     ac_config_files="$ac_config_files Makefile po/Makefile.in:po/Make-in"
 
           ac_config_commands="$ac_config_commands default"
@@ -9136,6 +9242,9 @@ s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
 s,@MAINT@,$MAINT,;t t
 s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t
 s,@NO_WERROR@,$NO_WERROR,;t t
+s,@datarootdir@,$datarootdir,;t t
+s,@docdir@,$docdir,;t t
+s,@htmldir@,$htmldir,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
diff --git a/gprof/configure.in b/gprof/configure.in
index 9cdca4a42b2..5f0f59f96e8 100644
--- a/gprof/configure.in
+++ b/gprof/configure.in
@@ -44,6 +44,11 @@ fi
 
 AM_BINUTILS_WARNINGS
 
+dnl Required by html and install-html
+AC_SUBST(datarootdir)
+AC_SUBST(docdir)
+AC_SUBST(htmldir)
+
 AC_CONFIG_FILES([Makefile po/Makefile.in:po/Make-in])
 AC_CONFIG_COMMANDS([default],[[sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile]],[[]])
 AC_OUTPUT
diff --git a/gprof/corefile.c b/gprof/corefile.c
index e02d95833f4..a8620efc45f 100644
--- a/gprof/corefile.c
+++ b/gprof/corefile.c
@@ -155,7 +155,7 @@ core_init (const char *aout_name)
 
   if (!bfd_check_format (core_bfd, bfd_object))
     {
-      fprintf (stderr, _("%s: %s: not in a.out format\n"), whoami, aout_name);
+      fprintf (stderr, _("%s: %s: not in executable format\n"), whoami, aout_name);
       done (1);
     }
 
diff --git a/gprof/po/Make-in b/gprof/po/Make-in
index 9700c09f56c..3db414d03ee 100644
--- a/gprof/po/Make-in
+++ b/gprof/po/Make-in
@@ -1,6 +1,6 @@
 # Makefile for program source directory in GNU NLS utilities package.
 # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-# Copyright 2002, 2003 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2006 Free Software Foundation, Inc.
 #
 # This file may be copied and used freely without restrictions.  It can
 # be used in projects which are not available under the GNU Public License
@@ -110,6 +110,7 @@ $(srcdir)/stamp-cat-id: $(PACKAGE).pot
 install: install-exec install-data
 install-exec:
 install-info:
+install-html:
 install-data: install-data-@USE_NLS@
 install-data-no: all
 install-data-yes: all
diff --git a/include/ChangeLog b/include/ChangeLog
index 3c6907f56dc..0a3787aac37 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,22 @@
+2006-04-11  Jim Blandy  <jimb@codesourcery.com>
+
+	* libiberty.h (pex_input_file, pex_input_pipe): New declarations.
+
+2006-04-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* bfdlink.h (bfd_link_info): Replace need_relax_finalize with
+	relax_pass.
+
+2006-03-25  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* elf/bfin.h (R_BFIN_GOT17M4, R_BFIN_GOTHI, R_BFIN_GOTLO,
+	R_BFIN_FUNCDESC, R_BFIN_FUNCDESC_GOT17M4,  R_BFIN_FUNCDESC_GOTHI,
+	R_BFIN_FUNCDESC_GOTLO, R_BFIN_FUNCDESC_VALUE,
+	R_BFIN_FUNCDESC_GOTOFF17M4, R_BFIN_FUNCDESC_GOTOFFHI,
+	R_BFIN_FUNCDESC_GOTOFFLO, R_BFIN_GOTOFF17M4, R_BFIN_GOTOFFHI,
+	R_BFIN_GOTOFFLO): New relocs.
+	(EF_BFIN_PIC, EF_BFIN_FDPIC, EF_BFIN_PIC_FLAGS): New macros.
+
 2006-02-17  Shrirang Khisti  <shrirangk@kpitcummins.com>
             Anil Paranjape   <anilp1@kpitcummins.com>
             Shilin Shakti    <shilins@kpitcummins.com>
diff --git a/include/bfdlink.h b/include/bfdlink.h
index 3c978e80bfa..f4b7aa7cfa4 100644
--- a/include/bfdlink.h
+++ b/include/bfdlink.h
@@ -301,9 +301,6 @@ struct bfd_link_info
   /* TRUE if global symbols in discarded sections should be stripped.  */
   unsigned int strip_discarded: 1;
 
-  /* TRUE if the final relax pass is needed.  */
-  unsigned int need_relax_finalize: 1;
-
   /* TRUE if generating a position independent executable.  */
   unsigned int pie: 1;
 
@@ -398,6 +395,12 @@ struct bfd_link_info
      unloaded.  */
   const char *fini_function;
 
+  /* Number of relaxation passes.  Usually only one relaxation pass
+     is needed.  But a backend can have as many relaxation passes as
+     necessary.  During bfd_relax_section call, it is set to the
+     current pass, starting from 0.  */
+  int relax_pass;
+
   /* Non-zero if auto-import thunks for DATA items in pei386 DLLs
      should be generated/linked against.  Set to 1 if this feature
      is explicitly requested by the user, -1 if enabled by default.  */
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 9d47ffbac89..48ce81c1354 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,12 @@
+2006-03-22  Richard Sandiford  <richard@codesourcery.com>
+	    Daniel Jacobowitz  <dan@codesourcery.com>
+	    Phil Edwards  <phil@codesourcery.com>
+	    Zack Weinberg  <zack@codesourcery.com>
+	    Mark Mitchell  <mark@codesourcery.com>
+	    Nathan Sidwell  <nathan@codesourcery.com>
+
+	* mips.h (R_MIPS_COPY, R_MIPS_JUMP_SLOT): New relocs.
+
 2006-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
 	* hppa.h (SHF_HP_TLS, SHF_HP_NEAR_SHARED, SHF_HP_FAR_SHARED,
diff --git a/include/elf/bfin.h b/include/elf/bfin.h
index 09faab6ca1b..3c07cd166c8 100644
--- a/include/elf/bfin.h
+++ b/include/elf/bfin.h
@@ -43,6 +43,21 @@ START_RELOC_NUMBERS (elf_bfin_reloc_type)
   RELOC_NUMBER (R_byte2_data, 0x11)     /* 0x11, 0x00) .byte2 var = symbol */
   RELOC_NUMBER (R_byte4_data, 0x12)     /* 0x12, 0x00) .byte4 var = symbol and .var var=symbol */
   RELOC_NUMBER (R_pcrel11, 0x13)        /* 0x13, 0x00) lsetup part b */
+  RELOC_NUMBER (R_BFIN_GOT17M4, 0x14)
+  RELOC_NUMBER (R_BFIN_GOTHI, 0x15)
+  RELOC_NUMBER (R_BFIN_GOTLO, 0x16)
+  RELOC_NUMBER (R_BFIN_FUNCDESC, 0x17)
+  RELOC_NUMBER (R_BFIN_FUNCDESC_GOT17M4, 0x18)
+  RELOC_NUMBER (R_BFIN_FUNCDESC_GOTHI, 0x19)
+  RELOC_NUMBER (R_BFIN_FUNCDESC_GOTLO, 0x1a)
+  RELOC_NUMBER (R_BFIN_FUNCDESC_VALUE, 0x1b)
+  RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFF17M4, 0x1c)
+  RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFFHI, 0x1d)
+  RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFFLO, 0x1e)
+  RELOC_NUMBER (R_BFIN_GOTOFF17M4, 0x1f)
+  RELOC_NUMBER (R_BFIN_GOTOFFHI, 0x20)
+  RELOC_NUMBER (R_BFIN_GOTOFFLO, 0x21)
+
   RELOC_NUMBER (R_push, 0xE0)
   RELOC_NUMBER (R_const, 0xE1)
   RELOC_NUMBER (R_add, 0xE2)
@@ -69,4 +84,9 @@ START_RELOC_NUMBERS (elf_bfin_reloc_type)
   RELOC_NUMBER (R_BFIN_GNU_VTENTRY, 0x43) /* C++, gnu only */
 END_RELOC_NUMBERS (R_max)
 
+/* Processor specific flags for the ELF header e_flags field.  */
+#define EF_BFIN_PIC		0x00000001	/* -fpic */
+#define EF_BFIN_FDPIC		0x00000002      /* -mfdpic */
+
+#define	EF_BFIN_PIC_FLAGS	(EF_BFIN_PIC | EF_BFIN_FDPIC)
 #endif /* _ELF_BFIN_H */
diff --git a/include/elf/mips.h b/include/elf/mips.h
index 6afc12ffe83..f22bd4d4213 100644
--- a/include/elf/mips.h
+++ b/include/elf/mips.h
@@ -97,6 +97,9 @@ START_RELOC_NUMBERS (elf_mips_reloc_type)
   RELOC_NUMBER (R_MIPS16_HI16, 104)
   RELOC_NUMBER (R_MIPS16_LO16, 105)
   FAKE_RELOC (R_MIPS16_max, 106)
+  /* These relocations are specific to VxWorks.  */
+  RELOC_NUMBER (R_MIPS_COPY, 126)
+  RELOC_NUMBER (R_MIPS_JUMP_SLOT, 127)
   /* This was a GNU extension used by embedded-PIC.  It was co-opted by
      mips-linux for exception-handling data.  It is no longer used, but
      should continue to be supported by the linker for backward
diff --git a/include/elf/x86-64.h b/include/elf/x86-64.h
index 74655fbcd03..b09a558a35b 100644
--- a/include/elf/x86-64.h
+++ b/include/elf/x86-64.h
@@ -54,7 +54,16 @@ START_RELOC_NUMBERS (elf_x86_64_reloc_type)
      RELOC_NUMBER (R_X86_64_GOTOFF64, 25)     /* 64 bit offset to GOT */
      RELOC_NUMBER (R_X86_64_GOTPC32,  26)     /* 32 bit signed pc relative
                                                  offset to GOT */
-     /* 27 .. 33 */
+     RELOC_NUMBER (R_X86_64_GOT64,    27)     /* 64 bit GOT entry offset */
+     RELOC_NUMBER (R_X86_64_GOTPCREL64, 28)   /* 64 bit signed pc relative
+     						 offset to GOT entry */
+     RELOC_NUMBER (R_X86_64_GOTPC64,  29)     /* 64 bit signed pc relative
+     						 offset to GOT */
+     RELOC_NUMBER (R_X86_64_GOTPLT64, 30)     /* like GOT64, but indicates
+     						 that PLT entry is needed */
+     RELOC_NUMBER (R_X86_64_PLTOFF64, 31)     /* 64 bit GOT relative offset
+     						 to PLT entry */
+     /* 32 .. 33 */
      RELOC_NUMBER (R_X86_64_GOTPC32_TLSDESC, 34)
 					      /* 32 bit signed pc relative
 						 offset to TLS descriptor
diff --git a/include/libiberty.h b/include/libiberty.h
index c264cb2ab0e..6bd318e0fe5 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -448,6 +448,47 @@ extern const char *pex_run (struct pex_obj *obj, int flags,
 			    const char *outname, const char *errname,
 			    int *err);
 
+/* Return a `FILE' pointer FP for the standard input of the first
+   program in the pipeline; FP is opened for writing.  You must have
+   passed `PEX_USE_PIPES' to the `pex_init' call that returned OBJ.
+   You must close FP yourself with `fclose' to indicate that the
+   pipeline's input is complete.
+
+   The file descriptor underlying FP is marked not to be inherited by
+   child processes.
+
+   This call is not supported on systems which do not support pipes;
+   it returns with an error.  (We could implement it by writing a
+   temporary file, but then you would need to write all your data and
+   close FP before your first call to `pex_run' -- and that wouldn't
+   work on systems that do support pipes: the pipe would fill up, and
+   you would block.  So there isn't any easy way to conceal the
+   differences between the two types of systems.)
+
+   If you call both `pex_write_input' and `pex_read_output', be
+   careful to avoid deadlock.  If the output pipe fills up, so that
+   each program in the pipeline is waiting for the next to read more
+   data, and you fill the input pipe by writing more data to FP, then
+   there is no way to make progress: the only process that could read
+   data from the output pipe is you, but you are blocked on the input
+   pipe.  */
+
+extern FILE *pex_write_input (struct pex_obj *obj, int binary);
+
+/* Return a stream for a temporary file to pass to the first program
+   in the pipeline as input.  The file name is chosen as for pex_run.
+   pex_run closes the file automatically; don't close it yourself.  */
+
+extern FILE *pex_input_file (struct pex_obj *obj, int flags,
+                             const char *in_name);
+
+/* Return a stream for a pipe connected to the standard input of the
+   first program in the pipeline.  You must have passed
+   `PEX_USE_PIPES' to `pex_init'.  Close the returned stream
+   yourself.  */
+
+extern FILE *pex_input_pipe (struct pex_obj *obj, int binary);
+
 /* Read the standard output of the last program to be executed.
    pex_run can not be called after this.  BINARY should be non-zero if
    the file should be opened in binary mode; this is ignored on Unix.
diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog
index 158c55ce966..ad4411a2c47 100644
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,15 @@
+2006-04-07  Joerg Wunsch <j.gnu@uriah.heep.sax.de>
+
+	* avr.h (AVR_ISA_PWMx): New.
+
+2006-03-28  Nathan Sidwell  <nathan@codesourcery.com>
+
+	* m68k.h (cpu_m68k, cpu_cf, cpu_m68000, cpu_m68008, cpu_m68010,
+	cpu_m68020, cpu_m68ec030, cpu_m68040, cpu_m68060, cpu_m68851,
+	cpu_m68881, cpu_m68882, cpu_cpu32, cpu_cf5200, cpu_cf5206e,
+	cpu_cf5208, cpu_cf521x, cpu_cf5213, cpu_cf5249, cpu_cf528x,
+	cpu_cf5307, cpu_cf5329, cpu_cf5407, cpu_cf547x, cpu_cf548x): Remove.
+
 2006-03-10  Paul Brook  <paul@codesourcery.com>
 
 	* arm.h (ARM_AEXT_V7_ARM): Include v6ZK extensions.
diff --git a/include/opcode/avr.h b/include/opcode/avr.h
index b7a80b09612..55bb1610345 100644
--- a/include/opcode/avr.h
+++ b/include/opcode/avr.h
@@ -1,6 +1,6 @@
 /* Opcode table for the Atmel AVR micro controllers.
 
-   Copyright 2000, 2001, 2004 Free Software Foundation, Inc.
+   Copyright 2000, 2001, 2004, 2006 Free Software Foundation, Inc.
    Contributed by Denis Chertykov <denisc@overta.ru>
    
    This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#define AVR_ISA_1200  0x0001 /* in the beginning there was ... */
+#define AVR_ISA_1200  0x0001 /* In the beginning there was ...  */
 #define AVR_ISA_LPM   0x0002 /* device has LPM */
 #define AVR_ISA_LPMX  0x0004 /* device has LPM Rd,Z[+] */
 #define AVR_ISA_SRAM  0x0008 /* device has SRAM (LD, ST, PUSH, POP, ...) */
@@ -32,18 +32,19 @@
 #define AVR_ISA_MOVW  0x1000 /* device has MOVW */
 
 #define AVR_ISA_TINY1 (AVR_ISA_1200 | AVR_ISA_LPM)
-#define AVR_ISA_2xxx (AVR_ISA_TINY1 | AVR_ISA_SRAM)
+#define AVR_ISA_PWMx  (AVR_ISA_M8   | AVR_ISA_BRK)
+#define AVR_ISA_2xxx  (AVR_ISA_TINY1 | AVR_ISA_SRAM)
 #define AVR_ISA_TINY2 (AVR_ISA_2xxx | AVR_ISA_MOVW | AVR_ISA_LPMX | \
-                       AVR_ISA_SPM | AVR_ISA_BRK)
-#define AVR_ISA_M8   (AVR_ISA_2xxx | AVR_ISA_MUL | AVR_ISA_MOVW | \
-                      AVR_ISA_LPMX | AVR_ISA_SPM)
-#define AVR_ISA_M603 (AVR_ISA_2xxx | AVR_ISA_MEGA)
-#define AVR_ISA_M103 (AVR_ISA_M603 | AVR_ISA_ELPM)
-#define AVR_ISA_M161 (AVR_ISA_M603 | AVR_ISA_MUL | AVR_ISA_MOVW | \
-                      AVR_ISA_LPMX | AVR_ISA_SPM)
-#define AVR_ISA_94K  (AVR_ISA_M603 | AVR_ISA_MUL | AVR_ISA_MOVW | AVR_ISA_LPMX)
-#define AVR_ISA_M323 (AVR_ISA_M161 | AVR_ISA_BRK)
-#define AVR_ISA_M128 (AVR_ISA_M323 | AVR_ISA_ELPM | AVR_ISA_ELPMX)
+                       AVR_ISA_SPM  | AVR_ISA_BRK)
+#define AVR_ISA_M8    (AVR_ISA_2xxx | AVR_ISA_MUL | AVR_ISA_MOVW | \
+                       AVR_ISA_LPMX | AVR_ISA_SPM)
+#define AVR_ISA_M603  (AVR_ISA_2xxx | AVR_ISA_MEGA)
+#define AVR_ISA_M103  (AVR_ISA_M603 | AVR_ISA_ELPM)
+#define AVR_ISA_M161  (AVR_ISA_M603 | AVR_ISA_MUL | AVR_ISA_MOVW | \
+                       AVR_ISA_LPMX | AVR_ISA_SPM)
+#define AVR_ISA_94K   (AVR_ISA_M603 | AVR_ISA_MUL | AVR_ISA_MOVW | AVR_ISA_LPMX)
+#define AVR_ISA_M323  (AVR_ISA_M161 | AVR_ISA_BRK)
+#define AVR_ISA_M128  (AVR_ISA_M323 | AVR_ISA_ELPM | AVR_ISA_ELPMX)
 
 #define AVR_ISA_ALL   0xFFFF
 
diff --git a/include/opcode/m68k.h b/include/opcode/m68k.h
index 0d21658e9a4..d137d9d6219 100644
--- a/include/opcode/m68k.h
+++ b/include/opcode/m68k.h
@@ -53,44 +53,6 @@
 #define	mfloat  (m68881 | m68040 | m68060)
 #define	mmmu    (m68851 | m68030 | m68040 | m68060)
 
-/* CPU numbering.  There are too many of these to use a bit vector.
-   These are a one-of-many selection.  Choose a numbering scheme that
-   simply maps onto manufacturer's part numbers. */
-
-/* All m68k cpus */
-#define cpu_m68k 0
-/* All coldfire cpus */
-#define cpu_cf  1000000
-
-#define cpu_m68000  (cpu_m68k + 68000)
-#define	cpu_m68008  cpu_m68000 /* Synonym for -m68000.  otherwise unused.  */
-#define	cpu_m68010  (cpu_m68k + 68010)
-#define	cpu_m68020  (cpu_m68k + 68020)
-#define	cpu_m68030  (cpu_m68k + 68030)
-#define cpu_m68ec030 cpu_m68030 /* Similar enough to -m68030 to ignore
-			   differences; gas will deal with the few
-			   differences.  */
-#define	cpu_m68040  (cpu_m68k + 68040)
-/* There is no 68050.  */
-#define cpu_m68060  (cpu_m68k + 68060)
-#define	cpu_m68851  (cpu_m68k + 68851)
-#define	cpu_m68881  (cpu_m68k + 68881)
-#define	cpu_m68882   cpu_m68881 /* Synonym for -m68881.  otherwise unused.  */
-#define cpu_cpu32   (cpu_m68k + 32)
-
-#define cpu_cf5200  (cpu_cf + 5200)
-#define cpu_cf5206e (cpu_cf + 5206)
-#define cpu_cf5208  (cpu_cf + 5208)
-#define cpu_cf521x  (cpu_cf + 5210)
-#define cpu_cf5213  (cpu_cf + 5213)
-#define cpu_cf5249  (cpu_cf + 5249)
-#define cpu_cf528x  (cpu_cf + 5280)
-#define cpu_cf5307  (cpu_cf + 5307)
-#define cpu_cf5329  (cpu_cf + 5329)
-#define cpu_cf5407  (cpu_cf + 5407)
-#define cpu_cf547x  (cpu_cf + 5470)
-#define cpu_cf548x  (cpu_cf + 5480)
-
 /* The structure used to hold information for an opcode.  */
 
 struct m68k_opcode
diff --git a/intl/ChangeLog b/intl/ChangeLog
index 59bec969589..1799509adb2 100644
--- a/intl/ChangeLog
+++ b/intl/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-06  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* intl/Makefile.in: Add html info and dvi and install-html to .PHONY
+	Add install-html target.
+
 2006-02-27  Carlos O'Donell  <carlos@codesourcery.com>
 
 	* intl/Makefile.in: Add html target.
diff --git a/intl/Makefile.in b/intl/Makefile.in
index c8b918376be..ed579c7b232 100644
--- a/intl/Makefile.in
+++ b/intl/Makefile.in
@@ -1,5 +1,5 @@
 # Makefile for directory with message catalog handling in GNU NLS Utilities.
-# Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1995, 1996, 1997, 1998, 2006 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -149,8 +149,12 @@ uninstall:
 	  rm -f $(gettextsrcdir)/$$file; \
 	done
 
+.PHONY: html info dvi
 html info dvi:
 
+.PHONY: install-html
+install-html:
+
 $(OBJECTS): config.h libgettext.h
 bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
 dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9005e8f2d70..f8b1e9f3c38 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,117 @@
+2006-04-14  David Heine  <dlheine@tensilica.com>
+	    Bob Wilson  <bob.wilson@acm.org>
+
+	* emultempl/xtensaelf.em (elf_xtensa_before_allocation): Call new
+	function to strip inconsistent linkonce sections.
+	(input_section_linked_worker, input_section_linked): New.
+	(is_inconsistent_linkonce_section): New.
+	(xtensa_strip_inconsistent_linkonce_sections): New.
+
+2006-04-11  Diego Pettenò  <flameeyes@gentoo.org>
+
+	* emultempl/elf32.em: Add support for elf-hints.h on FreeBSD
+	and Dragonfly targets.
+	* configure.in (AC_CHECK_HEADERS): Add elf-hints.h.
+	* Makefile.am (HFILES): Add elf-hints-local.h.
+	* elf-hints-local.h: New file.
+	* Makefile.in: Regenerate.
+	* configure: Regenerate.
+
+2006-04-07  Bernhard Fischer  <aldot@gcc.gnu.org>
+
+	* ld.texinfo: Fix typo in documentation of --check-sections.
+
+2006-04-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+	* ldlang.c (load_symbols): Set as_needed and add_needed according
+	to the corresponding script's fields while processing it.
+
+2006-04-06  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* Makefile.am: Add install-html, install-html-am, and
+	install-html-recursive targets.
+	* Makefile.in: Regenerate.
+	* configure.in: AC_SUBST datarootdir, docdir, htmldir.
+	* configure: Regenerate.
+	* po/Make-in: Add install-html target.
+
+2006-04-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* emultempl/ia64elf.em: Set link_info.relax_pass to 2. Remove
+	link_info.need_relax_finalize.
+
+	* ldlang.c (relax_sections): New.
+	(lang_process): Use. Call relax_sections link_info.relax_pass
+	times.
+
+	* ldmain.c (main): Set link_info.relax_pass to 1. Remove
+	link_info.need_relax_finalize.
+
+2006-04-05  Alan Modra  <amodra@bigpond.net.au>
+
+	* Makefile.am (GENSCRIPTS): Pass prefix.
+	* Makefile.in: Regenerate.
+	* genscripts.sh: Adjust for extra parameter.
+	* emultempl/elf32.em (parse_ld_so_conf): Return true iff file
+	exists.
+	(check_ld_so_conf): Use ${prefix}/etc/ld.so.conf if it exists.
+	* NEWS: Update.
+
+2006-04-05  Richard Sandiford  <richard@codesourcery.com>
+	    Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* configure.tgt (sparc*-*-vxworks*): New stanza.
+	* emulparams/elf32_sparc_vxworks.sh: New file.
+	* Makefile.am (ALL_EMULATIONS): Add eelf32_sparc_vxworks.o.
+	(eelf32_sparc_vxworks.c): New rule.
+	* Makefile.in: Regenerate.
+
+2006-04-04  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* ldlang.c (lang_map): Print the list of discarded input sections.
+	(print_input_section): Change parameter and print zero-sized sections.
+	(print_statement): Adjust call to print_input_section.
+
+2006-04-01  Danny Smith  <dannysmith@users.sourceforge.net>
+
+	* deffilep.y (def_image_name): If LIBRARY or NAME statement
+	specifies an empty string, retain the name specified on command
+	line.
+	* ld.texinfo: Document above.
+
+2006-03-31  Jakub Jelinek  <jakub@redhat.com>
+
+	* ldmisc.c (vfinfo): Revert 2005-10-05 changes.  If
+	bfd_find_nearest_line succeeded for %C or %D, but filename
+	is NULL, print section+offset at the end.
+
+2006-03-25  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* emulparams/elf32bfinfd.sh: New file.
+	* emultempl/bfin.em: Delete.
+	* emulparams/bfin.sh: Lose reference to bfin.em.
+	* Makefile.am (eelf32bfin.c): Likewise.
+	(eelf32bfinfd.c): New.
+	* Makefile.in: Regenerate.
+	* configure.tgt (bfin-*-elf, bfin-*-uclinux): Add elf32bfinfd to
+	targ_extra_emuls.
+
+2006-03-22  Richard Sandiford  <richard@codesourcery.com>
+	    Daniel Jacobowitz  <dan@codesourcery.com>
+	    Phil Edwards  <phil@codesourcery.com>
+	    Zack Weinberg  <zack@codesourcery.com>
+	    Mark Mitchell  <mark@codesourcery.com>
+	    Nathan Sidwell  <nathan@codesourcery.com>
+
+	* configure.tgt (mips*el-*-vxworks*, mips*-*-vxworks*): Use
+	separate VxWorks emulations.
+	* emulparams/elf32ebmipvxworks.sh: New file.
+	* emulparams/elf32elmipvxworks.sh: New file.
+	* Makefile.am (ALL_EMULATIONS): Add eelf32ebmipvxworks.o and
+	eelf32elmipvxworks.o.
+	(eelf32ebmipvxworks.c, eelf32elmipvxworks.c): New rules.
+	* Makefile.in: Regenerate.
+
 2006-03-16  Alan Modra  <amodra@bigpond.net.au>
 
 	PR 2434
diff --git a/ld/Makefile.am b/ld/Makefile.am
index db64da4d966..3c4fa5ee666 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -147,8 +147,10 @@ ALL_EMULATIONS = \
 	eelf32_i960.o \
 	eelf32_i860.o \
 	eelf32_sparc.o \
+	eelf32_sparc_vxworks.o \
 	eelf32b4300.o \
 	eelf32bfin.o \
+	eelf32bfinfd.o \
 	eelf32cr16c.o \
 	eelf32bmip.o \
 	eelf32bmipn32.o \
@@ -158,7 +160,9 @@ ALL_EMULATIONS = \
 	eelf32ltsmip.o \
 	eelf32ltsmipn32.o \
 	eelf32ebmip.o \
+	eelf32ebmipvxworks.o \
 	eelf32elmip.o \
+	eelf32elmipvxworks.o \
 	eelf32fr30.o \
 	eelf32frv.o \
 	eelf32i370.o \
@@ -414,7 +418,7 @@ CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
 
 HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
 	ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
-	ldwrite.h mri.h deffile.h pe-dll.h
+	ldwrite.h mri.h deffile.h pe-dll.h elf-hints-local.h
 
 GENERATED_CFILES = ldgram.c ldlex.c deffilep.c
 GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h
@@ -471,7 +475,7 @@ stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
 
 # These all start with e so 'make clean' can find them.
 
-GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
+GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
 GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
 
 @TDIRS@
@@ -622,9 +626,13 @@ edelta68.c: $(srcdir)/emulparams/delta68.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/delta68.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} delta68 "$(tdir_delta68)"
 eelf32bfin.c: $(srcdir)/emulparams/bfin.sh \
-  $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/bfin.em \
+  $(srcdir)/emultempl/elf32.em \
   $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32bfin "$(tdir_elf32bfin)" bfin
+eelf32bfinfd.c: $(srcdir)/emulparams/elf32bfinfd.sh $(srcdir)/emulparams/bfin.sh \
+  $(srcdir)/emultempl/elf32.em \
+  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32bfinfd "$(tdir_elf32bfinfd)" elf32bfinfd
 eelf32_dlx.c: $(srcdir)/emulparams/elf32_dlx.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/dlx.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32_dlx "$(tdir_elf32_dlx)"
@@ -680,6 +688,11 @@ em32rlelf_linux.c: $(srcdir)/emulparams/m32rlelf_linux.sh \
 eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
+eelf32_sparc_vxworks.c: $(srcdir)/emulparams/elf32_sparc_vxworks.sh \
+  $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/elf32_sparc.sh \
+  $(srcdir)/emultempl/vxworks.em $(srcdir)/emultempl/elf32.em \
+  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32_sparc_vxworks "$(tdir_elf32_sparc_vxworks)"
 eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32_i860 "$(tdir_elf32_i860)"
@@ -725,10 +738,20 @@ eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
   $(srcdir)/emulparams/elf32bmip.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
+eelf32ebmipvxworks.c: $(srcdir)/emulparams/elf32ebmipvxworks.sh \
+  $(srcdir)/emulparams/elf32ebmip.sh $(srcdir)/emulparams/vxworks.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/vxworks.em \
+  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32ebmipvxworks "$(tdir_elf32ebmipvxworks)"
 eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
   $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
+eelf32elmipvxworks.c: $(srcdir)/emulparams/elf32elmipvxworks.sh \
+  $(srcdir)/emulparams/elf32elmip.sh $(srcdir)/emulparams/vxworks.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/vxworks.em \
+  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32elmipvxworks "$(tdir_elf32elmipvxworks)"
 eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \
   $(srcdir)/emultempl/irix.em \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -1713,6 +1736,54 @@ mostlyclean-local:
 	-rm -rf tmpdir
 CLEANFILES = dep.sed DEP DEPA DEP1 DEP2
 
+.PHONY: install-html install-html-am install-html-recursive
+
+html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+
+install-html: install-html-recursive  install-html-am
+
+install-html-am: $(HTMLS)
+	@$(NORMAL_INSTALL)
+	test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
+	@list='$(HTMLS)'; for p in $$list; do \
+	  if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
+	  f=$(html__strip_dir) \
+	  if test -d "$$d$$p"; then \
+	    echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+	    echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+	  else \
+	    echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+	  fi; \
+	done
+
+install-html-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
 .PHONY: install-exec-local install-data-local
 
 install-exec-local: ld-new$(EXEEXT)
diff --git a/ld/Makefile.in b/ld/Makefile.in
index dff417394dc..30b925596b7 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -232,12 +232,15 @@ build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
@@ -370,8 +373,10 @@ ALL_EMULATIONS = \
 	eelf32_i960.o \
 	eelf32_i860.o \
 	eelf32_sparc.o \
+	eelf32_sparc_vxworks.o \
 	eelf32b4300.o \
 	eelf32bfin.o \
+	eelf32bfinfd.o \
 	eelf32cr16c.o \
 	eelf32bmip.o \
 	eelf32bmipn32.o \
@@ -381,7 +386,9 @@ ALL_EMULATIONS = \
 	eelf32ltsmip.o \
 	eelf32ltsmipn32.o \
 	eelf32ebmip.o \
+	eelf32ebmipvxworks.o \
 	eelf32elmip.o \
+	eelf32elmipvxworks.o \
 	eelf32fr30.o \
 	eelf32frv.o \
 	eelf32i370.o \
@@ -637,7 +644,7 @@ CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
 
 HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
 	ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
-	ldwrite.h mri.h deffile.h pe-dll.h
+	ldwrite.h mri.h deffile.h pe-dll.h elf-hints-local.h
 
 GENERATED_CFILES = ldgram.c ldlex.c deffilep.c
 GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h
@@ -653,7 +660,7 @@ EMULATION_FILES = emultempl/pe.em emultempl/armcoff.em
 POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES)
 
 # These all start with e so 'make clean' can find them.
-GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
+GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
 GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
 
 # We need this for automake to use YLWRAP.
@@ -674,6 +681,7 @@ MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
 	ldemul-list.h crtbegin.o crtend.o ld.log ld.sum
 
 CLEANFILES = dep.sed DEP DEPA DEP1 DEP2
+html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 
 # Stuff that should be included in a distribution.  The diststuff
 # target is run by the taz target in ../Makefile.in.
@@ -805,7 +813,7 @@ distclean-libtool:
 	else \
 	  rc=$$?; \
 	  cd $(srcdir) && \
-	  $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
+	  $$restore $$backupdir/* `echo "$@" | sed 's|[^/]*$$||'`; \
 	fi; \
 	rm -rf $$backupdir; exit $$rc
 
@@ -1428,9 +1436,13 @@ edelta68.c: $(srcdir)/emulparams/delta68.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/delta68.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} delta68 "$(tdir_delta68)"
 eelf32bfin.c: $(srcdir)/emulparams/bfin.sh \
-  $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/bfin.em \
+  $(srcdir)/emultempl/elf32.em \
   $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32bfin "$(tdir_elf32bfin)" bfin
+eelf32bfinfd.c: $(srcdir)/emulparams/elf32bfinfd.sh $(srcdir)/emulparams/bfin.sh \
+  $(srcdir)/emultempl/elf32.em \
+  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32bfinfd "$(tdir_elf32bfinfd)" elf32bfinfd
 eelf32_dlx.c: $(srcdir)/emulparams/elf32_dlx.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/dlx.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32_dlx "$(tdir_elf32_dlx)"
@@ -1486,6 +1498,11 @@ em32rlelf_linux.c: $(srcdir)/emulparams/m32rlelf_linux.sh \
 eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
+eelf32_sparc_vxworks.c: $(srcdir)/emulparams/elf32_sparc_vxworks.sh \
+  $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/elf32_sparc.sh \
+  $(srcdir)/emultempl/vxworks.em $(srcdir)/emultempl/elf32.em \
+  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32_sparc_vxworks "$(tdir_elf32_sparc_vxworks)"
 eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32_i860 "$(tdir_elf32_i860)"
@@ -1531,10 +1548,20 @@ eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
   $(srcdir)/emulparams/elf32bmip.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
+eelf32ebmipvxworks.c: $(srcdir)/emulparams/elf32ebmipvxworks.sh \
+  $(srcdir)/emulparams/elf32ebmip.sh $(srcdir)/emulparams/vxworks.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/vxworks.em \
+  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32ebmipvxworks "$(tdir_elf32ebmipvxworks)"
 eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
   $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
+eelf32elmipvxworks.c: $(srcdir)/emulparams/elf32elmipvxworks.sh \
+  $(srcdir)/emulparams/elf32elmip.sh $(srcdir)/emulparams/vxworks.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/vxworks.em \
+  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32elmipvxworks "$(tdir_elf32elmipvxworks)"
 eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \
   $(srcdir)/emultempl/irix.em \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -2497,6 +2524,52 @@ ld.1: $(srcdir)/ld.texinfo configdoc.texi ldver.texi
 mostlyclean-local:
 	-rm -rf tmpdir
 
+.PHONY: install-html install-html-am install-html-recursive
+
+install-html: install-html-recursive  install-html-am
+
+install-html-am: $(HTMLS)
+	@$(NORMAL_INSTALL)
+	test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
+	@list='$(HTMLS)'; for p in $$list; do \
+	  if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
+	  f=$(html__strip_dir) \
+	  if test -d "$$d$$p"; then \
+	    echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+	    echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+	  else \
+	    echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+	  fi; \
+	done
+
+install-html-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
 .PHONY: install-exec-local install-data-local
 
 install-exec-local: ld-new$(EXEEXT)
diff --git a/ld/NEWS b/ld/NEWS
index 77659b686b2..27fb0ae1154 100644
--- a/ld/NEWS
+++ b/ld/NEWS
@@ -2,8 +2,10 @@
 
 * Support for the Infineon XC16X has been added by KPIT Cummins Infosystems.
 
-* Modify the Linux linker to seach /etc/ld.so.conf first before
-  checking default search directories for DT_NEEDED entries.
+* Modify the Linux linker search order to better match ld.so search order.
+  Look for DT_NEEDED libraries in paths specified by ld.so.conf before
+  searching the default directories, rather than vice versa.
+  Use $prefix/etc/ld.so.conf if it exists, otherwise /etc/ld.so.conf.
 
 * PE-COFF: Forward exports from DLL's can now be specified in .def files
   passed directly to ld.
diff --git a/ld/configure b/ld/configure
index 765b94bbf57..0cd6f5c99d1 100755
--- a/ld/configure
+++ b/ld/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL use_sysroot TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS NO_WERROR CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l YACC LEX LEXLIB LEX_OUTPUT_ROOT MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT HDEFINES HOSTING_CRT0 HOSTING_LIBS NATIVE_LIB_DIRS STRINGIFY EMUL EMULATION_OFILES EMUL_EXTRA_OFILES LIB_PATH EMULATION_LIBPATH TESTBFDLIB LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL use_sysroot TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS NO_WERROR CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l YACC LEX LEXLIB LEX_OUTPUT_ROOT MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT HDEFINES HOSTING_CRT0 HOSTING_LIBS NATIVE_LIB_DIRS STRINGIFY EMUL EMULATION_OFILES EMUL_EXTRA_OFILES LIB_PATH EMULATION_LIBPATH TESTBFDLIB datarootdir docdir htmldir LIBOBJS LTLIBOBJS'
 ac_subst_files='TDIRS'
 
 # Initialize some variables set by options.
@@ -8607,7 +8607,8 @@ fi
 
 
 
-for ac_header in string.h strings.h stdlib.h unistd.h
+
+for ac_header in string.h strings.h stdlib.h unistd.h elf-hints.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -9796,6 +9797,10 @@ _ACEOF
 
 fi
 
+
+
+
+
                     ac_config_files="$ac_config_files Makefile po/Makefile.in:po/Make-in"
           ac_config_commands="$ac_config_commands default"
 cat >confcache <<\_ACEOF
@@ -10544,6 +10549,9 @@ s,@EMUL_EXTRA_OFILES@,$EMUL_EXTRA_OFILES,;t t
 s,@LIB_PATH@,$LIB_PATH,;t t
 s,@EMULATION_LIBPATH@,$EMULATION_LIBPATH,;t t
 s,@TESTBFDLIB@,$TESTBFDLIB,;t t
+s,@datarootdir@,$datarootdir,;t t
+s,@docdir@,$docdir,;t t
+s,@htmldir@,$htmldir,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 /@TDIRS@/r $TDIRS
diff --git a/ld/configure.in b/ld/configure.in
index 41b641433f8..e020288c00c 100644
--- a/ld/configure.in
+++ b/ld/configure.in
@@ -99,7 +99,7 @@ AC_SUBST(HOSTING_CRT0)
 AC_SUBST(HOSTING_LIBS)
 AC_SUBST(NATIVE_LIB_DIRS)
 
-AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
+AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h elf-hints.h)
 AC_CHECK_FUNCS(sbrk realpath glob)
 AC_HEADER_DIRENT
 
@@ -253,5 +253,10 @@ if test x${EXTRA_SHLIB_EXTENSION} != x ; then
    [Additional extension a shared object might have.])
 fi
 
+dnl Required by html and install-html
+AC_SUBST(datarootdir)
+AC_SUBST(docdir)
+AC_SUBST(htmldir)
+
 AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
 [sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile])
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 56e1ae47559..d324e4ece25 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -83,8 +83,8 @@ xscale-*-elf)		targ_emul=armelf
 avr-*-*)		targ_emul=avr2
 			targ_extra_emuls="avr1 avr3 avr4 avr5"
 			;;
-bfin-*-elf)		targ_emul=elf32bfin ;;
-bfin-*-uclinux*)	targ_emul=elf32bfin ;;
+bfin-*-elf)		targ_emul=elf32bfin; targ_extra_emuls="elf32bfinfd" ;;
+bfin-*-uclinux*)	targ_emul=elf32bfin; targ_extra_emuls="elf32bfinfd" ;;
 cr16c-*-elf*)           targ_emul=elf32cr16c
 			;;
 cris-*-*aout*)		targ_emul=crisaout
@@ -324,9 +324,10 @@ mips*vr5000-*-elf*)	targ_emul=elf32b4300 ;;
 mips*el-*-elf*)		targ_emul=elf32elmip ;;
 mips*-*-elf*)		targ_emul=elf32ebmip ;;
 mips*-*-rtems*)		targ_emul=elf32ebmip ;;
-mips*el-*-vxworks*)	targ_emul=elf32elmip ;;
-mips*-*-vxworks*)	targ_emul=elf32ebmip
-		        targ_extra_emuls="elf32elmip" ;;
+mips*el-*-vxworks*)	targ_emul=elf32elmipvxworks
+			targ_extra_emuls="elf32ebmipvxworks" ;;
+mips*-*-vxworks*)	targ_emul=elf32ebmipvxworks
+		        targ_extra_emuls="elf32elmipvxworks" ;;
 mips*-*-windiss)	targ_emul=elf32mipswindiss ;;
 mips64*el-*-linux-*)	targ_emul=elf32ltsmipn32
 			targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
@@ -493,6 +494,7 @@ sparc*-*-aout)		targ_emul=sparcaout ;;
 sparc*-*-coff)		targ_emul=coff_sparc ;;
 sparc*-*-elf)		targ_emul=elf32_sparc ;;
 sparc*-*-sysv4*)	targ_emul=elf32_sparc ;;
+sparc*-*-vxworks*)	targ_emul=elf32_sparc_vxworks ;;
 sparc64-*-freebsd* | sparcv9-*-freebsd* | sparc64-*-kfreebsd*-gnu | sparcv9-*-kfreebsd*-gnu)
 			targ_emul=elf64_sparc_fbsd
 			targ_extra_emuls="elf64_sparc elf32_sparc"
diff --git a/ld/deffilep.y b/ld/deffilep.y
index 78da27a1d97..5c699f394f8 100644
--- a/ld/deffilep.y
+++ b/ld/deffilep.y
@@ -648,22 +648,30 @@ def_file_add_directive (def_file *my_def, const char *param, int len)
 static void
 def_image_name (const char *name, int base, int is_dll)
 {
-  const char* image_name = lbasename (name);
-  if (image_name != name)
-    einfo ("%s:%d: Warning: path components stripped from %s, '%s'\n",
-	  def_filename, linenumber, is_dll ? "LIBRARY" : "NAME", name);
-  if (def->name)
-    free (def->name);
-  /* Append the default suffix, if none specified.  */ 
-   if (strchr (image_name, '.') == 0)
-     {
-        const char * suffix = is_dll ? ".dll" : ".exe";
-
-        def->name = xmalloc (strlen (image_name) + strlen (suffix) + 1);
-        sprintf (def->name, "%s%s", image_name, suffix);
-     }
-  else
-    def->name = xstrdup (image_name);
+  /* If a LIBRARY or NAME statement is specified without a name, there is nothing
+     to do here.  We retain the output filename specified on command line.  */
+  if (*name)
+    {
+      const char* image_name = lbasename (name);
+      if (image_name != name)
+	einfo ("%s:%d: Warning: path components stripped from %s, '%s'\n",
+	       def_filename, linenumber, is_dll ? "LIBRARY" : "NAME",
+	       name);
+      if (def->name)
+	free (def->name);
+      /* Append the default suffix, if none specified.  */ 
+      if (strchr (image_name, '.') == 0)
+	{
+	  const char * suffix = is_dll ? ".dll" : ".exe";
+
+	  def->name = xmalloc (strlen (image_name) + strlen (suffix) + 1);
+	  sprintf (def->name, "%s%s", image_name, suffix);
+        }
+      else
+	def->name = xstrdup (image_name);
+    }
+
+  /* Honor a BASE address statement, even if LIBRARY string is empty.  */
   def->base_address = base;
   def->is_dll = is_dll;
 }
diff --git a/ld/elf-hints-local.h b/ld/elf-hints-local.h
new file mode 100644
index 00000000000..69408180ce4
--- /dev/null
+++ b/ld/elf-hints-local.h
@@ -0,0 +1,44 @@
+/* Copyright (c) 1997 John D. Polstra.
+   All rights reserved.
+ 
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+   2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+ 
+   THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+   ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+   FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+   OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+   SUCH DAMAGE.  */
+
+#ifndef	_ELF_HINTS_H_
+#define	_ELF_HINTS_H_
+
+/* Hints file produced by ldconfig.  */
+struct elfhints_hdr
+{
+  u_int32_t magic;		/* Magic number.  */
+  u_int32_t version;		/* File version (1).  */
+  u_int32_t strtab;		/* Offset of string table in file.  */
+  u_int32_t strsize;		/* Size of string table.  */
+  u_int32_t dirlist;		/* Offset of directory list in string table.  */
+  u_int32_t dirlistlen;		/* strlen(dirlist).  */
+  u_int32_t spare[26];		/* Room for expansion.  */
+};
+
+#define ELFHINTS_MAGIC	0x746e6845
+
+#define _PATH_ELF_HINTS	"/var/run/ld-elf.so.hints"
+
+#endif /* !_ELF_HINTS_H_ */
diff --git a/ld/emulparams/bfin.sh b/ld/emulparams/bfin.sh
index 86d21b253c9..5e7adda4dd9 100755
--- a/ld/emulparams/bfin.sh
+++ b/ld/emulparams/bfin.sh
@@ -10,6 +10,5 @@ ENTRY=__start
 TEMPLATE_NAME=elf32
 GENERATE_SHLIB_SCRIPT=yes
 EMBEDDED=yes
-EXTRA_EM_FILE=bfin
 DATA_END_SYMBOLS="__edata = .; PROVIDE (_edata = .);"
 END_SYMBOLS="__end = .; PROVIDE (_end = .);"
diff --git a/ld/emulparams/elf32_sparc_vxworks.sh b/ld/emulparams/elf32_sparc_vxworks.sh
new file mode 100644
index 00000000000..12a9b384408
--- /dev/null
+++ b/ld/emulparams/elf32_sparc_vxworks.sh
@@ -0,0 +1,4 @@
+. ${srcdir}/emulparams/elf32_sparc.sh
+OUTPUT_FORMAT="elf32-sparc-vxworks"
+unset DATA_PLT
+. ${srcdir}/emulparams/vxworks.sh
diff --git a/ld/emulparams/elf32bfinfd.sh b/ld/emulparams/elf32bfinfd.sh
new file mode 100644
index 00000000000..9047c6a750f
--- /dev/null
+++ b/ld/emulparams/elf32bfinfd.sh
@@ -0,0 +1,16 @@
+. ${srcdir}/emulparams/bfin.sh
+unset STACK_ADDR
+OUTPUT_FORMAT="elf32-bfinfdpic"
+MAXPAGESIZE=0x4000
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+EMBEDDED= # This gets us program headers mapped as part of the text segment.
+OTHER_GOT_SYMBOLS=
+OTHER_READONLY_SECTIONS="
+  .rofixup        : {
+    ${RELOCATING+__ROFIXUP_LIST__ = .;}
+    *(.rofixup)
+    ${RELOCATING+__ROFIXUP_END__ = .;}
+  }
+"
diff --git a/ld/emulparams/elf32ebmipvxworks.sh b/ld/emulparams/elf32ebmipvxworks.sh
new file mode 100644
index 00000000000..4145488ae28
--- /dev/null
+++ b/ld/emulparams/elf32ebmipvxworks.sh
@@ -0,0 +1,11 @@
+. ${srcdir}/emulparams/elf32bmip.sh
+
+OUTPUT_FORMAT="elf32-bigmips-vxworks"
+BIG_OUTPUT_FORMAT="elf32-bigmips-vxworks"
+LITTLE_OUTPUT_FORMAT="elf32-littlemips-vxworks"
+unset OTHER_GOT_SYMBOLS
+SHLIB_TEXT_START_ADDR=0
+unset TEXT_DYNAMIC
+unset DATA_ADDR
+
+. ${srcdir}/emulparams/vxworks.sh
diff --git a/ld/emulparams/elf32elmipvxworks.sh b/ld/emulparams/elf32elmipvxworks.sh
new file mode 100644
index 00000000000..c1239441c4e
--- /dev/null
+++ b/ld/emulparams/elf32elmipvxworks.sh
@@ -0,0 +1,11 @@
+. ${srcdir}/emulparams/elf32bmip.sh
+
+OUTPUT_FORMAT="elf32-littlemips-vxworks"
+BIG_OUTPUT_FORMAT="elf32-bigmips-vxworks"
+LITTLE_OUTPUT_FORMAT="elf32-littlemips-vxworks"
+unset OTHER_GOT_SYMBOLS
+SHLIB_TEXT_START_ADDR=0
+unset TEXT_DYNAMIC
+unset DATA_ADDR
+
+. ${srcdir}/emulparams/vxworks.sh
diff --git a/ld/emultempl/bfin.em b/ld/emultempl/bfin.em
deleted file mode 100644
index 1c1cd8d7518..00000000000
--- a/ld/emultempl/bfin.em
+++ /dev/null
@@ -1,174 +0,0 @@
-# This shell script emits a C file. -*- C -*-
-#   Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
-#   Written by Michael Sokolov <msokolov@ivan.Harhan.ORG>, based on armelf.em
-#
-# This file is part of GLD, the Gnu Linker.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# This file is sourced from elf32.em, and defines some extra routines for bfin
-# embedded systems using ELF and for some other systems using bfin ELF.  While
-# it is sourced from elf32.em for all bfin ELF configurations, here we include
-# only the features we want depending on the configuration.
-
-case ${target} in
-  bfin*-*-elf)
-    echo "#define SUPPORT_EMBEDDED_RELOCS" >>e${EMULATION_NAME}.c
-    ;;
-esac
-
-cat >>e${EMULATION_NAME}.c <<EOF
-
-#ifdef SUPPORT_EMBEDDED_RELOCS
-static void check_sections (bfd *, asection *, void *);
-#endif
-
-/* This function is run after all the input files have been opened.  */
-
-static void
-bfin_elf_after_open (void)
-{
-  /* Call the standard elf routine.  */
-  gld${EMULATION_NAME}_after_open ();
-
-#ifdef SUPPORT_EMBEDDED_RELOCS
-  if (command_line.embedded_relocs
-      && (! link_info.relocatable))
-    {
-      bfd *abfd;
-
-      /* In the embedded relocs mode we create a .emreloc section for each
-	 input file with a nonzero .data section.  The BFD backend will fill in
-	 these sections with magic numbers which can be used to relocate the
-	 data section at run time.  */
-      for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
-	{
-	  asection *datasec;
-
-	  /* As first-order business, make sure that each input BFD is either
-	     COFF or ELF.  We need to call a special BFD backend function to
-	     generate the embedded relocs, and we have such functions only for
-	     COFF and ELF.  */
-	  if (bfd_get_flavour (abfd) != bfd_target_coff_flavour
-	      && bfd_get_flavour (abfd) != bfd_target_elf_flavour)
-	    einfo ("%F%B: all input objects must be COFF or ELF for --embedded-relocs\n");
-
-	  datasec = bfd_get_section_by_name (abfd, ".data");
-
-	  /* Note that we assume that the reloc_count field has already
-	     been set up.  We could call bfd_get_reloc_upper_bound, but
-	     that returns the size of a memory buffer rather than a reloc
-	     count.  We do not want to call bfd_canonicalize_reloc,
-	     because although it would always work it would force us to
-	     read in the relocs into BFD canonical form, which would waste
-	     a significant amount of time and memory.  */
-	  if (datasec != NULL && datasec->reloc_count > 0)
-	    {
-	      asection *relsec;
-
-	      relsec = bfd_make_section (abfd, ".emreloc");
-	      if (relsec == NULL
-		  || ! bfd_set_section_flags (abfd, relsec,
-					      (SEC_ALLOC
-					       | SEC_LOAD
-					       | SEC_HAS_CONTENTS
-					       | SEC_IN_MEMORY))
-		  || ! bfd_set_section_alignment (abfd, relsec, 2)
-		  || ! bfd_set_section_size (abfd, relsec,
-					     datasec->reloc_count * 12))
-		einfo ("%F%B: can not create .emreloc section: %E\n");
-	    }
-
-	  /* Double check that all other data sections are empty, as is
-	     required for embedded PIC code.  */
-	  bfd_map_over_sections (abfd, check_sections, datasec);
-	}
-    }
-#endif /* SUPPORT_EMBEDDED_RELOCS */
-}
-
-#ifdef SUPPORT_EMBEDDED_RELOCS
-/* Check that of the data sections, only the .data section has
-   relocs.  This is called via bfd_map_over_sections.  */
-
-static void
-check_sections (bfd *abfd, asection *sec, void *datasec)
-{
-  if ((bfd_get_section_flags (abfd, sec) & SEC_DATA)
-      && sec != datasec
-      && sec->reloc_count != 0)
-    einfo ("%B%X: section %s has relocs; can not use --embedded-relocs\n",
-	   abfd, bfd_get_section_name (abfd, sec));
-}
-
-#endif /* SUPPORT_EMBEDDED_RELOCS */
-
-/* This function is called after the section sizes and offsets have
-   been set.  */
-
-static void
-bfin_elf_after_allocation (void)
-{
-  /* Call the standard elf routine.  */
-  after_allocation_default ();
-
-#ifdef SUPPORT_EMBEDDED_RELOCS
-  if (command_line.embedded_relocs
-      && (! link_info.relocatable))
-    {
-      bfd *abfd;
-
-      /* If we are generating embedded relocs, call a special BFD backend
-	 routine to do the work.  */
-      for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
-	{
-	  asection *datasec, *relsec;
-	  char *errmsg;
-
-	  datasec = bfd_get_section_by_name (abfd, ".data");
-
-	  if (datasec == NULL || datasec->reloc_count == 0)
-	    continue;
-
-	  relsec = bfd_get_section_by_name (abfd, ".emreloc");
-	  ASSERT (relsec != NULL);
-
-	  if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
-	    {
-	      if (! bfd_bfin_elf32_create_embedded_relocs (abfd, &link_info,
-							   datasec, relsec,
-							   &errmsg))
-		{
-		  if (errmsg == NULL)
-		    einfo ("%B%X: can not create runtime reloc information: %E\n",
-			   abfd);
-		  else
-		    einfo ("%X%B: can not create runtime reloc information: %s\n",
-			   abfd, errmsg);
-		}
-	    }
-	  else
-	    abort ();
-	}
-    }
-#endif /* SUPPORT_EMBEDDED_RELOCS */
-}
-
-EOF
-
-# We have our own after_open and after_allocation functions, but they call
-# the standard routines, so give them a different name.
-LDEMUL_AFTER_OPEN=bfin_elf_after_open
-LDEMUL_AFTER_ALLOCATION=bfin_elf_after_allocation
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 048917f3b5a..dffcff81b47 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -13,7 +13,7 @@ cat >e${EMULATION_NAME}.c <<EOF
 
 /* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
    Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
    ELF support by Ian Lance Taylor <ian@cygnus.com>
 
@@ -529,6 +529,68 @@ gld${EMULATION_NAME}_add_sysroot (const char *path)
 
 EOF
   case ${target} in
+    *-*-freebsd* | *-*-dragonfly*)
+      cat >>e${EMULATION_NAME}.c <<EOF
+/* Read the system search path the FreeBSD way rather than the Linux way.  */
+#ifdef HAVE_ELF_HINTS_H
+#include <elf-hints.h>
+#else
+#include "elf-hints-local.h"
+#endif
+
+static bfd_boolean
+gld${EMULATION_NAME}_check_ld_elf_hints (const char *name, int force)
+{
+  static bfd_boolean initialized;
+  static char *ld_elf_hints;
+  struct dt_needed needed;
+
+  if (!initialized)
+    {
+      FILE *f;
+      char *tmppath;
+
+      tmppath = concat (ld_sysroot, _PATH_ELF_HINTS, NULL);
+      f = fopen (tmppath, FOPEN_RB);
+      free (tmppath);
+      if (f != NULL)
+	{
+	  struct elfhints_hdr hdr;
+
+	  if (fread (&hdr, 1, sizeof (hdr), f) == sizeof (hdr)
+	      && hdr.magic == ELFHINTS_MAGIC
+	      && hdr.version == 1)
+	    {
+	      if (fseek (f, hdr.strtab + hdr.dirlist, SEEK_SET) != -1)
+		{
+		  char *b;
+
+		  b = xmalloc (hdr.dirlistlen + 1);
+		  if (fread (b, 1, hdr.dirlistlen + 1, f) ==
+		      hdr.dirlistlen + 1)
+		    ld_elf_hints = gld${EMULATION_NAME}_add_sysroot (b);
+		
+		  free (b);
+		}
+	    }
+	  fclose (f);
+	}
+
+      initialized = TRUE;
+    }
+
+  if (ld_elf_hints == NULL)
+    return FALSE;
+
+  needed.by = NULL;
+  needed.name = name;
+  return gld${EMULATION_NAME}_search_needed (ld_elf_hints, & needed,
+			       		     force);
+}
+EOF
+    # FreeBSD
+    ;;
+
     *-*-linux-* | *-*-k*bsd*-*)
       cat >>e${EMULATION_NAME}.c <<EOF
 /* For a native linker, check the file /etc/ld.so.conf for directories
@@ -541,7 +603,7 @@ struct gld${EMULATION_NAME}_ld_so_conf
   size_t len, alloc;
 };
 
-static void
+static bfd_boolean
 gld${EMULATION_NAME}_parse_ld_so_conf
      (struct gld${EMULATION_NAME}_ld_so_conf *info, const char *filename);
 
@@ -584,7 +646,7 @@ gld${EMULATION_NAME}_parse_ld_so_conf_include
     free (newp);
 }
 
-static void
+static bfd_boolean
 gld${EMULATION_NAME}_parse_ld_so_conf
      (struct gld${EMULATION_NAME}_ld_so_conf *info, const char *filename)
 {
@@ -593,7 +655,7 @@ gld${EMULATION_NAME}_parse_ld_so_conf
   size_t linelen;
 
   if (f == NULL)
-    return;
+    return FALSE;
 
   linelen = 256;
   line = xmalloc (linelen);
@@ -691,6 +753,7 @@ gld${EMULATION_NAME}_parse_ld_so_conf
   while (! feof (f));
   free (line);
   fclose (f);
+  return TRUE;
 }
 
 static bfd_boolean
@@ -705,11 +768,17 @@ gld${EMULATION_NAME}_check_ld_so_conf (const char *name, int force)
       char *tmppath;
       struct gld${EMULATION_NAME}_ld_so_conf info;
 
-      tmppath = concat (ld_sysroot, "/etc/ld.so.conf", NULL);
       info.path = NULL;
       info.len = info.alloc = 0;
-      gld${EMULATION_NAME}_parse_ld_so_conf (&info, tmppath);
+      tmppath = concat (ld_sysroot, "${prefix}/etc/ld.so.conf", NULL);
+      if (!gld${EMULATION_NAME}_parse_ld_so_conf (&info, tmppath))
+	{
+	  free (tmppath);
+	  tmppath = concat (ld_sysroot, "/etc/ld.so.conf", NULL);
+	  gld${EMULATION_NAME}_parse_ld_so_conf (&info, tmppath);
+	}
       free (tmppath);
+
       if (info.path)
 	{
 	  char *d = gld${EMULATION_NAME}_add_sysroot (info.path);
@@ -921,6 +990,14 @@ EOF
 fi
 if [ "x${USE_LIBPATH}" = xyes ] ; then
   case ${target} in
+    *-*-freebsd* | *-*-dragonfly*)
+      cat >>e${EMULATION_NAME}.c <<EOF
+	  if (gld${EMULATION_NAME}_check_ld_elf_hints (l->name, force))
+	    break;
+EOF
+    # FreeBSD
+    ;;
+
     *-*-linux-* | *-*-k*bsd*-*)
     # Linux
       cat >>e${EMULATION_NAME}.c <<EOF
diff --git a/ld/emultempl/ia64elf.em b/ld/emultempl/ia64elf.em
index d41fa00441a..ddc5370bfd9 100644
--- a/ld/emultempl/ia64elf.em
+++ b/ld/emultempl/ia64elf.em
@@ -32,7 +32,7 @@ static int itanium = 0;
 static void
 gld${EMULATION_NAME}_after_parse (void)
 {
-  link_info.need_relax_finalize = TRUE;
+  link_info.relax_pass = 2;
   bfd_elf${ELFSIZE}_ia64_after_parse (itanium);
 }
 
diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em
index 16feed1f797..f5d2ba9ceae 100644
--- a/ld/emultempl/xtensaelf.em
+++ b/ld/emultempl/xtensaelf.em
@@ -1,5 +1,5 @@
 # This shell script emits a C file. -*- C -*-
-#   Copyright 2003, 2004, 2005
+#   Copyright 2003, 2004, 2005, 2006
 #   Free Software Foundation, Inc.
 #
 # This file is part of GLD, the Gnu Linker.
@@ -32,6 +32,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
 
 static void xtensa_wild_group_interleave (lang_statement_union_type *);
 static void xtensa_colocate_output_literals (lang_statement_union_type *);
+static void xtensa_strip_inconsistent_linkonce_sections
+  (lang_statement_list_type *);
 
 
 /* Flag for the emulation-specific "--no-relax" option.  */
@@ -370,6 +372,8 @@ elf_xtensa_before_allocation (void)
   if (!disable_relaxation)
     command_line.relax = TRUE;
 
+  xtensa_strip_inconsistent_linkonce_sections (stat_ptr);
+
   gld${EMULATION_NAME}_before_allocation ();
 
   xtensa_wild_group_interleave (stat_ptr->head);
@@ -1157,6 +1161,145 @@ ld_count_children (lang_statement_union_type *s)
 #endif /* EXTRA_VALIDATION */
 
 
+/* Check if a particular section is included in the link.  This will only
+   be true for one instance of a particular linkonce section.  */
+
+static bfd_boolean input_section_found = FALSE;
+static asection *input_section_target = NULL;
+
+static void
+input_section_linked_worker (lang_statement_union_type *statement)
+{
+  if ((statement->header.type == lang_input_section_enum
+       && (statement->input_section.section == input_section_target)))
+    input_section_found = TRUE;
+}
+
+static bfd_boolean
+input_section_linked (asection *sec)
+{
+  input_section_found = FALSE;
+  input_section_target = sec;
+  lang_for_each_statement_worker (input_section_linked_worker, stat_ptr->head);
+  return input_section_found;
+}
+
+
+/* Strip out any linkonce literal sections or property tables where the
+   associated linkonce text is from a different object file.  Normally,
+   a matching set of linkonce sections is taken from the same object file,
+   but sometimes the files are compiled differently so that some of the
+   linkonce sections are not present in all files.  Stripping the
+   inconsistent sections like this is not completely robust -- a much
+   better solution is to use comdat groups.  */
+
+static int linkonce_len = sizeof (".gnu.linkonce.") - 1;
+
+static bfd_boolean
+is_inconsistent_linkonce_section (asection *sec)
+{
+  bfd *abfd = sec->owner;
+  const char *sec_name = bfd_get_section_name (abfd, sec);
+  char *prop_tag = 0;
+
+  if ((bfd_get_section_flags (abfd, sec) & SEC_LINK_ONCE) == 0
+      || strncmp (sec_name, ".gnu.linkonce.", linkonce_len) != 0)
+    return FALSE;
+
+  /* Check if this is an Xtensa property section.  */
+  if (strncmp (sec_name + linkonce_len, "p.", 2) == 0)
+    prop_tag = "p.";
+  else if (strncmp (sec_name + linkonce_len, "prop.", 5) == 0)
+    prop_tag = "prop.";
+  if (prop_tag)
+    {
+      int tag_len = strlen (prop_tag);
+      char *dep_sec_name = xmalloc (strlen (sec_name));
+      asection *dep_sec;
+
+      /* Get the associated linkonce text section and check if it is
+	 included in the link.  If not, this section is inconsistent
+	 and should be stripped.  */
+      strcpy (dep_sec_name, ".gnu.linkonce.");
+      strcat (dep_sec_name, sec_name + linkonce_len + tag_len);
+      dep_sec = bfd_get_section_by_name (abfd, dep_sec_name);
+      if (dep_sec == NULL || ! input_section_linked (dep_sec))
+	{
+	  free (dep_sec_name);
+	  return TRUE;
+	}
+      free (dep_sec_name);
+    }
+
+  return FALSE;
+}
+
+
+static void
+xtensa_strip_inconsistent_linkonce_sections (lang_statement_list_type *slist)
+{
+  lang_statement_union_type **s_p = &slist->head;
+  while (*s_p)
+    {
+      lang_statement_union_type *s = *s_p;
+      lang_statement_union_type *s_next = (*s_p)->header.next;
+
+      switch (s->header.type)
+	{
+	case lang_input_section_enum:
+	  if (is_inconsistent_linkonce_section (s->input_section.section))
+	    {
+	      *s_p = s_next;
+	      continue;
+	    }
+	  break;
+
+	case lang_constructors_statement_enum:
+	  xtensa_strip_inconsistent_linkonce_sections (&constructor_list);
+	  break;
+
+	case lang_output_section_statement_enum:
+	  if (s->output_section_statement.children.head)
+	    xtensa_strip_inconsistent_linkonce_sections
+	      (&s->output_section_statement.children);
+	  break;
+
+	case lang_wild_statement_enum:
+	  xtensa_strip_inconsistent_linkonce_sections
+	    (&s->wild_statement.children);
+	  break;
+
+	case lang_group_statement_enum:
+	  xtensa_strip_inconsistent_linkonce_sections
+	    (&s->group_statement.children);
+	  break;
+
+	case lang_data_statement_enum:
+	case lang_reloc_statement_enum:
+	case lang_object_symbols_statement_enum:
+	case lang_output_statement_enum:
+	case lang_target_statement_enum:
+	case lang_input_statement_enum:
+	case lang_assignment_statement_enum:
+	case lang_padding_statement_enum:
+	case lang_address_statement_enum:
+	case lang_fill_statement_enum:
+	  break;
+
+	default:
+	  FAIL ();
+	  break;
+	}
+
+      s_p = &(*s_p)->header.next;
+    }
+
+  /* Reset the tail of the list, in case the last entry was removed.  */
+  if (s_p != slist->tail)
+    slist->tail = s_p;
+}
+
+
 static void
 xtensa_wild_group_interleave_callback (lang_statement_union_type *statement)
 {
diff --git a/ld/genscripts.sh b/ld/genscripts.sh
index 76d5dd2560e..e9d4f153a7a 100755
--- a/ld/genscripts.sh
+++ b/ld/genscripts.sh
@@ -4,6 +4,7 @@
 # Usage: genscripts_extra.sh \
 #          srcdir \
 #          libdir \
+#          prefix \
 #          exec_prefix \
 #          host \
 #          target \
@@ -22,6 +23,7 @@
 #    /sources/ld \
 #    /usr/local/lib \
 #    /usr/local \
+#    /usr/local \
 #    sparc-sun-sunos4.1.3 \
 #    sparc-sun-sunos4.1.3 \
 #    sparc-sun-sunos4.1.3 \
@@ -59,17 +61,18 @@
 
 srcdir=$1
 libdir=$2
-exec_prefix=$3
-host=$4
-target=$5
-target_alias=$6
-EMULATION_LIBPATH=$7
-NATIVE_LIB_DIRS=$8
-use_sysroot=$9
+prefix=$3
+exec_prefix=$4
+host=$5
+target=$6
+target_alias=$7
+EMULATION_LIBPATH=$8
+NATIVE_LIB_DIRS=$9
 shift 9
-EMULATION_NAME=$1
-TOOL_LIB=$2
-CUSTOMIZER_SCRIPT=$3
+use_sysroot=$1
+EMULATION_NAME=$2
+TOOL_LIB=$3
+CUSTOMIZER_SCRIPT=$4
 
 # Can't use ${TOOL_LIB:-$target_alias} here due to an Ultrix shell bug.
 if [ "x${TOOL_LIB}" = "x" ] ; then
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index 1e3b3e873a6..339b32d045b 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -1117,7 +1117,7 @@ platforms which support shared libraries.
 @item --check-sections
 @itemx --no-check-sections
 Asks the linker @emph{not} to check section addresses after they have
-been assigned to see if there any overlaps.  Normally the linker will
+been assigned to see if there are any overlaps.  Normally the linker will
 perform this check, and if it finds any overlaps it will produce
 suitable error messages.  The linker does know about, and does make
 allowances for sections in overlays.  The default behaviour can be
@@ -5618,7 +5618,8 @@ specification @code{BASE = <number>} may be used to specify a
 non-default base address for the image. 
 
 If neither @code{LIBRARY <name>} nor  @code{NAME <name>} is specified,
-the internal name is the same as the filename specified on the command line. 
+or they specify an empty string, the internal name is the same as the
+filename specified on the command line.
 
 The complete specification of an export symbol is:
 
diff --git a/ld/ldlang.c b/ld/ldlang.c
index f6d849e19c9..c07a5921c12 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -81,6 +81,7 @@ static void print_statement (lang_statement_union_type *,
 static void print_statement_list (lang_statement_union_type *,
 				  lang_output_section_statement_type *);
 static void print_statements (void);
+static void print_input_section (asection *);
 static bfd_boolean lang_one_common (struct bfd_link_hash_entry *, void *);
 static void lang_record_phdrs (void);
 static void lang_do_version_exports_section (void);
@@ -1596,8 +1597,31 @@ void
 lang_map (void)
 {
   lang_memory_region_type *m;
+  bfd_boolean dis_header_printed = FALSE;
   bfd *p;
 
+  LANG_FOR_EACH_INPUT_STATEMENT (file)
+    {
+      asection *s;
+
+      if ((file->the_bfd->flags & (BFD_LINKER_CREATED | DYNAMIC)) != 0
+	  || file->just_syms_flag)
+	continue;
+
+      for (s = file->the_bfd->sections; s != NULL; s = s->next)
+	if (s->output_section == NULL
+	    || s->output_section->owner != output_bfd)
+	  {
+	    if (! dis_header_printed)
+	      {
+		fprintf (config.map_file, _("\nDiscarded input sections\n\n"));
+		dis_header_printed = TRUE;
+	      }
+
+	    print_input_section (s);
+	  }
+    }
+
   minfo (_("\nMemory Configuration\n\n"));
   fprintf (config.map_file, "%-16s %-18s %-18s %s\n",
 	   _("Name"), _("Origin"), _("Length"), _("Attributes"));
@@ -2299,6 +2323,7 @@ load_symbols (lang_input_statement_type *entry,
       lang_statement_list_type *hold;
       bfd_boolean bad_load = TRUE;
       bfd_boolean save_ldlang_sysrooted_script;
+      bfd_boolean save_as_needed, save_add_needed;
 
       err = bfd_get_error ();
 
@@ -2332,6 +2357,10 @@ load_symbols (lang_input_statement_type *entry,
       stat_ptr = place;
       save_ldlang_sysrooted_script = ldlang_sysrooted_script;
       ldlang_sysrooted_script = entry->sysrooted;
+      save_as_needed = as_needed;
+      as_needed = entry->as_needed;
+      save_add_needed = add_needed;
+      add_needed = entry->add_needed;
 
       ldfile_assumed_script = TRUE;
       parser_input = input_script;
@@ -2342,6 +2371,8 @@ load_symbols (lang_input_statement_type *entry,
       ldfile_assumed_script = FALSE;
 
       ldlang_sysrooted_script = save_ldlang_sysrooted_script;
+      as_needed = save_as_needed;
+      add_needed = save_add_needed;
       stat_ptr = hold;
 
       return ! bad_load;
@@ -3475,13 +3506,12 @@ print_all_symbols (sec)
 /* Print information about an input section to the map file.  */
 
 static void
-print_input_section (lang_input_section_type *in)
+print_input_section (asection *i)
 {
-  asection *i = in->section;
   bfd_size_type size = i->size;
 
   init_opb ();
-  if (size != 0)
+
     {
       int len;
       bfd_vma addr;
@@ -3501,7 +3531,7 @@ print_input_section (lang_input_section_type *in)
 	  ++len;
 	}
 
-      if (i->output_section != NULL && (i->flags & SEC_EXCLUDE) == 0)
+      if (i->output_section != NULL && i->output_section->owner == output_bfd)
 	addr = i->output_section->vma + i->output_offset;
       else
 	{
@@ -3528,7 +3558,7 @@ print_input_section (lang_input_section_type *in)
 	  minfo (_("%W (size before relaxing)\n"), i->rawsize);
 	}
 
-      if (i->output_section != NULL && (i->flags & SEC_EXCLUDE) == 0)
+      if (i->output_section != NULL && i->output_section->owner == output_bfd)
 	{
 	  if (command_line.reduce_memory_overheads)
 	    bfd_link_hash_traverse (link_info.hash, print_one_symbol, i);
@@ -3797,7 +3827,7 @@ print_statement (lang_statement_union_type *s,
       print_reloc_statement (&s->reloc_statement);
       break;
     case lang_input_section_enum:
-      print_input_section (&s->input_section);
+      print_input_section (s->input_section.section);
       break;
     case lang_padding_statement_enum:
       print_padding_statement (&s->padding_statement);
@@ -5388,6 +5418,37 @@ lang_gc_sections (void)
     bfd_gc_sections (output_bfd, &link_info);
 }
 
+/* Relax all sections until bfd_relax_section gives up.  */
+
+static void
+relax_sections (void)
+{
+  /* Keep relaxing until bfd_relax_section gives up.  */
+  bfd_boolean relax_again;
+
+  do
+    {
+      relax_again = FALSE; 
+
+      /* Note: pe-dll.c does something like this also.  If you find
+	 you need to change this code, you probably need to change
+	 pe-dll.c also.  DJ  */
+
+      /* Do all the assignments with our current guesses as to
+	 section sizes.  */
+      lang_do_assignments ();
+
+      /* We must do this after lang_do_assignments, because it uses
+	 size.  */
+      lang_reset_memory_regions ();
+
+      /* Perform another relax pass - this time we know where the
+	 globals are, so can make a better guess.  */
+      lang_size_sections (&relax_again, FALSE);
+    }
+  while (relax_again);
+}
+
 void
 lang_process (void)
 {
@@ -5484,38 +5545,17 @@ lang_process (void)
   /* Now run around and relax if we can.  */
   if (command_line.relax)
     {
-      /* Keep relaxing until bfd_relax_section gives up.  */
-      bfd_boolean relax_again;
+      /* We may need more than one relaxation pass.  */
+      int i = link_info.relax_pass;
 
-      do
-	{
-	  relax_again = FALSE;
-
-	  /* Note: pe-dll.c does something like this also.  If you find
-	     you need to change this code, you probably need to change
-	     pe-dll.c also.  DJ  */
-
-	  /* Do all the assignments with our current guesses as to
-	     section sizes.  */
-	  lang_do_assignments ();
-
-	  /* We must do this after lang_do_assignments, because it uses
-	     size.  */
-	  lang_reset_memory_regions ();
+      /* The backend can use it to determine the current pass.  */
+      link_info.relax_pass = 0;
 
-	  /* Perform another relax pass - this time we know where the
-	     globals are, so can make a better guess.  */
-	  lang_size_sections (&relax_again, FALSE);
-
-	  /* If the normal relax is done and the relax finalize pass
-	     is not performed yet, we perform another relax pass.  */
-	  if (!relax_again && link_info.need_relax_finalize)
-	    {
-	      link_info.need_relax_finalize = FALSE;
-	      relax_again = TRUE;
-	    }
+      while (i--)
+	{
+	  relax_sections ();
+	  link_info.relax_pass++;
 	}
-      while (relax_again);
 
       /* Final extra sizing to report errors.  */
       lang_do_assignments ();
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 3093bdb00c5..db87a40b6aa 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -313,7 +313,7 @@ main (int argc, char **argv)
   link_info.spare_dynamic_tags = 5;
   link_info.flags = 0;
   link_info.flags_1 = 0;
-  link_info.need_relax_finalize = FALSE;
+  link_info.relax_pass = 1;
   link_info.warn_shared_textrel = FALSE;
   link_info.gc_sections = FALSE;
 
diff --git a/ld/ldmisc.c b/ld/ldmisc.c
index 3ba4221e6ee..8af043aa2b2 100644
--- a/ld/ldmisc.c
+++ b/ld/ldmisc.c
@@ -1,6 +1,6 @@
 /* ldmisc.c
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005
+   2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support.
 
@@ -337,7 +337,7 @@ vfinfo (FILE *fp, const char *fmt, va_list arg, bfd_boolean is_warning)
 				&& strcmp (last_file, filename) != 0)
 			    || strcmp (last_function, functionname) != 0)
 			  {
-			    lfinfo (fp, _("%B: In function `%T'"),
+			    lfinfo (fp, _("%B: In function `%T':\n"),
 				    abfd, functionname);
 
 			    last_bfd = abfd;
@@ -353,20 +353,17 @@ vfinfo (FILE *fp, const char *fmt, va_list arg, bfd_boolean is_warning)
 			discard_last = FALSE;
 		      }
 		    else
-		      lfinfo (fp, "%B", abfd);
+		      lfinfo (fp, "%B:", abfd);
 
 		    if (filename != NULL)
-		      fprintf (fp, ":%s", filename);
+		      fprintf (fp, "%s:", filename);
 
 		    if (functionname != NULL && fmt[-1] == 'G')
-		      lfinfo (fp, ":%T", functionname);
-		    else if (filename != NULL)
-		      {
-			if (linenumber != 0)
-			  fprintf (fp, ":%u", linenumber);
-			else
-			  lfinfo (fp, ":(%A+0x%v)", section, offset);
-		      }
+		      lfinfo (fp, "%T", functionname);
+		    else if (filename != NULL && linenumber != 0)
+		      fprintf (fp, "%u", linenumber);
+		    else
+		      lfinfo (fp, "(%A+0x%v)", section, offset);
 		  }
 		else
 		  lfinfo (fp, "%B:(%A+0x%v)", abfd, section, offset);
diff --git a/ld/po/Make-in b/ld/po/Make-in
index 3223fc650d5..ca8233ed385 100644
--- a/ld/po/Make-in
+++ b/ld/po/Make-in
@@ -1,6 +1,6 @@
 # Makefile for program source directory in GNU NLS utilities package.
 # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003, 2006 Free Software Foundation, Inc.
 #
 # This file may be copied and used freely without restrictions.  It can
 # be used in projects which are not available under the GNU Public License
@@ -110,6 +110,7 @@ $(srcdir)/stamp-cat-id: $(PACKAGE).pot
 install: install-exec install-data
 install-exec:
 install-info:
+install-html:
 install-data: install-data-@USE_NLS@
 install-data-no: all
 install-data-yes: all
diff --git a/ld/po/ld.pot b/ld/po/ld.pot
index 567d0e5736f..549ecf46adc 100644
--- a/ld/po/ld.pot
+++ b/ld/po/ld.pot
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-10-24 11:45+0930\n"
+"POT-Creation-Date: 2006-03-25 18:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -333,20 +333,20 @@ msgstr ""
 msgid "Errors encountered processing file %s for interworking"
 msgstr ""
 
-#: emultempl/pe.em:1345 ldexp.c:522 ldlang.c:2928 ldlang.c:5785 ldlang.c:5816
-#: ldmain.c:1164
+#: emultempl/pe.em:1345 ldexp.c:522 ldlang.c:2946 ldlang.c:5800 ldlang.c:5831
+#: ldmain.c:1167
 msgid "%P%F: bfd_link_hash_lookup failed: %E\n"
 msgstr ""
 
-#: ldcref.c:153
+#: ldcref.c:154
 msgid "%X%P: bfd_hash_table_init of cref table failed: %E\n"
 msgstr ""
 
-#: ldcref.c:159
+#: ldcref.c:160
 msgid "%X%P: cref_hash_lookup failed: %E\n"
 msgstr ""
 
-#: ldcref.c:225
+#: ldcref.c:226
 #, c-format
 msgid ""
 "\n"
@@ -354,33 +354,33 @@ msgid ""
 "\n"
 msgstr ""
 
-#: ldcref.c:226
+#: ldcref.c:227
 msgid "Symbol"
 msgstr ""
 
-#: ldcref.c:234
+#: ldcref.c:235
 #, c-format
 msgid "File\n"
 msgstr ""
 
-#: ldcref.c:238
+#: ldcref.c:239
 #, c-format
 msgid "No symbols\n"
 msgstr ""
 
-#: ldcref.c:359 ldcref.c:481
+#: ldcref.c:360 ldcref.c:482
 msgid "%B%F: could not read symbols; %E\n"
 msgstr ""
 
-#: ldcref.c:363 ldcref.c:485 ldmain.c:1229 ldmain.c:1233
+#: ldcref.c:364 ldcref.c:486 ldmain.c:1232 ldmain.c:1236
 msgid "%B%F: could not read symbols: %E\n"
 msgstr ""
 
-#: ldcref.c:414
+#: ldcref.c:415
 msgid "%P: symbol `%T' missing from main hash table\n"
 msgstr ""
 
-#: ldcref.c:556 ldcref.c:563 ldmain.c:1276 ldmain.c:1283
+#: ldcref.c:557 ldcref.c:564 ldmain.c:1279 ldmain.c:1286
 msgid "%B%F: could not read relocs: %E\n"
 msgstr ""
 
@@ -388,7 +388,7 @@ msgstr ""
 #. in OUTSECNAME.  This reloc is from a section which is
 #. mapped into a section from which references to OUTSECNAME
 #. are prohibited.  We must report an error.
-#: ldcref.c:590
+#: ldcref.c:591
 msgid "%X%C: prohibited cross reference from %s to `%T' in %s\n"
 msgstr ""
 
@@ -482,16 +482,16 @@ msgstr ""
 msgid "%F%S cannot move location counter backwards (from %V to %V)\n"
 msgstr ""
 
-#: ldexp.c:750
+#: ldexp.c:748
 msgid "%P%F:%s: hash creation failed\n"
 msgstr ""
 
-#: ldexp.c:1002 ldexp.c:1027
+#: ldexp.c:1000 ldexp.c:1025
 #, c-format
 msgid "%F%S nonconstant expression for %s\n"
 msgstr ""
 
-#: ldexp.c:1084
+#: ldexp.c:1082
 #, c-format
 msgid "%F%S non constant expression for %s\n"
 msgstr ""
@@ -552,50 +552,46 @@ msgstr ""
 msgid "%P%F: cannot represent machine `%s'\n"
 msgstr ""
 
-#: ldlang.c:901 ldlang.c:5388
-msgid "%P%F: Failed to create hash table\n"
-msgstr ""
-
-#: ldlang.c:941
-msgid "%P%F: out of memory during initialization"
+#: ldlang.c:940 ldlang.c:982 ldlang.c:2695
+msgid "%P%F: can not create hash table: %E\n"
 msgstr ""
 
-#: ldlang.c:984
+#: ldlang.c:1025
 msgid "%P:%S: warning: redeclaration of memory region '%s'\n"
 msgstr ""
 
-#: ldlang.c:990
+#: ldlang.c:1031
 msgid "%P:%S: warning: memory region %s not declared\n"
 msgstr ""
 
-#: ldlang.c:1107
-msgid "%P%F: bfd_hash_lookup failed creating section `%s'\n"
+#: ldlang.c:1108 ldlang.c:1135
+msgid "%P%F: failed creating section `%s': %E\n"
 msgstr ""
 
-#: ldlang.c:1575
+#: ldlang.c:1601
 msgid ""
 "\n"
 "Memory Configuration\n"
 "\n"
 msgstr ""
 
-#: ldlang.c:1577
+#: ldlang.c:1603
 msgid "Name"
 msgstr ""
 
-#: ldlang.c:1577
+#: ldlang.c:1603
 msgid "Origin"
 msgstr ""
 
-#: ldlang.c:1577
+#: ldlang.c:1603
 msgid "Length"
 msgstr ""
 
-#: ldlang.c:1577
+#: ldlang.c:1603
 msgid "Attributes"
 msgstr ""
 
-#: ldlang.c:1617
+#: ldlang.c:1643
 #, c-format
 msgid ""
 "\n"
@@ -603,217 +599,217 @@ msgid ""
 "\n"
 msgstr ""
 
-#: ldlang.c:1683
+#: ldlang.c:1709
 msgid "%P%F: Illegal use of `%s' section\n"
 msgstr ""
 
-#: ldlang.c:1690
+#: ldlang.c:1716
 msgid "%P%F: output format %s cannot represent section called %s\n"
 msgstr ""
 
-#: ldlang.c:2295
+#: ldlang.c:2313
 msgid "%B: file not recognized: %E\n"
 msgstr ""
 
-#: ldlang.c:2296
+#: ldlang.c:2314
 msgid "%B: matching formats:"
 msgstr ""
 
-#: ldlang.c:2303
+#: ldlang.c:2321
 msgid "%F%B: file not recognized: %E\n"
 msgstr ""
 
-#: ldlang.c:2367
+#: ldlang.c:2385
 msgid "%F%B: member %B in archive is not an object\n"
 msgstr ""
 
-#: ldlang.c:2378 ldlang.c:2392
+#: ldlang.c:2396 ldlang.c:2410
 msgid "%F%B: could not read symbols: %E\n"
 msgstr ""
 
-#: ldlang.c:2647
+#: ldlang.c:2665
 msgid ""
 "%P: warning: could not find any targets that match endianness requirement\n"
 msgstr ""
 
-#: ldlang.c:2661
+#: ldlang.c:2679
 msgid "%P%F: target %s not found\n"
 msgstr ""
 
-#: ldlang.c:2663
+#: ldlang.c:2681
 msgid "%P%F: cannot open output file %s: %E\n"
 msgstr ""
 
-#: ldlang.c:2669
+#: ldlang.c:2687
 msgid "%P%F:%s: can not make object file: %E\n"
 msgstr ""
 
-#: ldlang.c:2673
+#: ldlang.c:2691
 msgid "%P%F:%s: can not set architecture: %E\n"
 msgstr ""
 
-#: ldlang.c:2677
-msgid "%P%F: can not create link hash table: %E\n"
-msgstr ""
-
-#: ldlang.c:2821
+#: ldlang.c:2839
 msgid "%P%F: bfd_hash_lookup failed creating symbol %s\n"
 msgstr ""
 
-#: ldlang.c:2839
+#: ldlang.c:2857
 msgid "%P%F: bfd_hash_allocate failed creating symbol %s\n"
 msgstr ""
 
-#: ldlang.c:3270
+#: ldlang.c:3288
 msgid " load address 0x%V"
 msgstr ""
 
-#: ldlang.c:3510
+#: ldlang.c:3528
 msgid "%W (size before relaxing)\n"
 msgstr ""
 
-#: ldlang.c:3597
+#: ldlang.c:3615
 #, c-format
 msgid "Address of section %s set to "
 msgstr ""
 
-#: ldlang.c:3750
+#: ldlang.c:3768
 #, c-format
 msgid "Fail with %d\n"
 msgstr ""
 
-#: ldlang.c:4021
+#: ldlang.c:4040
 msgid "%X%P: section %s [%V -> %V] overlaps section %s [%V -> %V]\n"
 msgstr ""
 
-#: ldlang.c:4046
+#: ldlang.c:4065
 msgid "%X%P: address 0x%v of %B section %s is not within region %s\n"
 msgstr ""
 
-#: ldlang.c:4055
+#: ldlang.c:4074
 msgid "%X%P: region %s is full (%B section %s)\n"
 msgstr ""
 
-#: ldlang.c:4095
+#: ldlang.c:4114
 #, c-format
 msgid ""
 "%F%S: non constant or forward reference address expression for section %s\n"
 msgstr ""
 
-#: ldlang.c:4120
+#: ldlang.c:4139
 msgid "%P%X: Internal error on COFF shared library section %s\n"
 msgstr ""
 
-#: ldlang.c:4176
+#: ldlang.c:4197
 msgid "%P%F: error: no memory region specified for loadable section `%s'\n"
 msgstr ""
 
-#: ldlang.c:4181
+#: ldlang.c:4202
 msgid "%P: warning: no memory region specified for loadable section `%s'\n"
 msgstr ""
 
-#: ldlang.c:4198
+#: ldlang.c:4224
 msgid "%P: warning: changing start of section %s by %lu bytes\n"
 msgstr ""
 
-#: ldlang.c:4369
+#: ldlang.c:4388
 msgid "%P%F: can't relax section: %E\n"
 msgstr ""
 
-#: ldlang.c:4617
+#: ldlang.c:4636
 msgid "%F%P: invalid data statement\n"
 msgstr ""
 
-#: ldlang.c:4650
+#: ldlang.c:4669
 msgid "%F%P: invalid reloc statement\n"
 msgstr ""
 
-#: ldlang.c:4783
+#: ldlang.c:4802
 msgid "%P%F:%s: can't set start address\n"
 msgstr ""
 
-#: ldlang.c:4796 ldlang.c:4815
+#: ldlang.c:4815 ldlang.c:4834
 msgid "%P%F: can't set start address\n"
 msgstr ""
 
-#: ldlang.c:4808
+#: ldlang.c:4827
 msgid "%P: warning: cannot find entry symbol %s; defaulting to %V\n"
 msgstr ""
 
-#: ldlang.c:4820
+#: ldlang.c:4839
 msgid "%P: warning: cannot find entry symbol %s; not setting start address\n"
 msgstr ""
 
-#: ldlang.c:4869
+#: ldlang.c:4888
 msgid ""
 "%P%F: Relocatable linking with relocations from format %s (%B) to format %s "
 "(%B) is not supported\n"
 msgstr ""
 
-#: ldlang.c:4879
+#: ldlang.c:4898
 msgid ""
 "%P: warning: %s architecture of input file `%B' is incompatible with %s "
 "output\n"
 msgstr ""
 
-#: ldlang.c:4901
+#: ldlang.c:4920
 msgid "%P%X: failed to merge target specific data of file %B\n"
 msgstr ""
 
-#: ldlang.c:4985
+#: ldlang.c:5004
 msgid ""
 "\n"
 "Allocating common symbols\n"
 msgstr ""
 
-#: ldlang.c:4986
+#: ldlang.c:5005
 msgid ""
 "Common symbol       size              file\n"
 "\n"
 msgstr ""
 
-#: ldlang.c:5112
+#: ldlang.c:5131
 msgid "%P%F: invalid syntax in flags\n"
 msgstr ""
 
-#: ldlang.c:5707
+#: ldlang.c:5406
+msgid "%P%F: Failed to create hash table\n"
+msgstr ""
+
+#: ldlang.c:5722
 msgid "%P%F: multiple STARTUP files\n"
 msgstr ""
 
-#: ldlang.c:5755
+#: ldlang.c:5770
 msgid "%X%P:%S: section has both a load address and a load region\n"
 msgstr ""
 
-#: ldlang.c:5992
+#: ldlang.c:6007
 msgid "%F%P: bfd_record_phdr failed: %E\n"
 msgstr ""
 
-#: ldlang.c:6012
+#: ldlang.c:6027
 msgid "%X%P: section `%s' assigned to non-existent phdr `%s'\n"
 msgstr ""
 
-#: ldlang.c:6403
+#: ldlang.c:6418
 msgid "%X%P: unknown language `%s' in version information\n"
 msgstr ""
 
-#: ldlang.c:6545
+#: ldlang.c:6560
 msgid ""
 "%X%P: anonymous version tag cannot be combined with other version tags\n"
 msgstr ""
 
-#: ldlang.c:6554
+#: ldlang.c:6569
 msgid "%X%P: duplicate version tag `%s'\n"
 msgstr ""
 
-#: ldlang.c:6574 ldlang.c:6583 ldlang.c:6600 ldlang.c:6610
+#: ldlang.c:6589 ldlang.c:6598 ldlang.c:6615 ldlang.c:6625
 msgid "%X%P: duplicate expression `%s' in version information\n"
 msgstr ""
 
-#: ldlang.c:6650
+#: ldlang.c:6665
 msgid "%X%P: unable to find version dependency `%s'\n"
 msgstr ""
 
-#: ldlang.c:6672
+#: ldlang.c:6687
 msgid "%X%P: unable to read .exports section contents\n"
 msgstr ""
 
@@ -877,7 +873,7 @@ msgstr ""
 msgid "%P: Error writing file `%s'\n"
 msgstr ""
 
-#: ldmain.c:535 pe-dll.c:1447
+#: ldmain.c:535 pe-dll.c:1494
 #, c-format
 msgid "%P: Error closing file `%s'\n"
 msgstr ""
@@ -896,196 +892,196 @@ msgstr ""
 msgid "%P%F: missing argument to -m\n"
 msgstr ""
 
-#: ldmain.c:783 ldmain.c:801 ldmain.c:831
+#: ldmain.c:784 ldmain.c:803 ldmain.c:834
 msgid "%P%F: bfd_hash_table_init failed: %E\n"
 msgstr ""
 
-#: ldmain.c:787 ldmain.c:805
+#: ldmain.c:788 ldmain.c:807
 msgid "%P%F: bfd_hash_lookup failed: %E\n"
 msgstr ""
 
-#: ldmain.c:819
+#: ldmain.c:821
 msgid "%X%P: error: duplicate retain-symbols-file\n"
 msgstr ""
 
-#: ldmain.c:861
+#: ldmain.c:864
 msgid "%P%F: bfd_hash_lookup for insertion failed: %E\n"
 msgstr ""
 
-#: ldmain.c:866
+#: ldmain.c:869
 msgid "%P: `-retain-symbols-file' overrides `-s' and `-S'\n"
 msgstr ""
 
-#: ldmain.c:941
+#: ldmain.c:944
 #, c-format
 msgid ""
 "Archive member included because of file (symbol)\n"
 "\n"
 msgstr ""
 
-#: ldmain.c:1011
+#: ldmain.c:1014
 msgid "%X%C: multiple definition of `%T'\n"
 msgstr ""
 
-#: ldmain.c:1014
+#: ldmain.c:1017
 msgid "%D: first defined here\n"
 msgstr ""
 
-#: ldmain.c:1018
+#: ldmain.c:1021
 msgid "%P: Disabling relaxation: it will not work with multiple definitions\n"
 msgstr ""
 
-#: ldmain.c:1048
+#: ldmain.c:1051
 msgid "%B: warning: definition of `%T' overriding common\n"
 msgstr ""
 
-#: ldmain.c:1051
+#: ldmain.c:1054
 msgid "%B: warning: common is here\n"
 msgstr ""
 
-#: ldmain.c:1058
+#: ldmain.c:1061
 msgid "%B: warning: common of `%T' overridden by definition\n"
 msgstr ""
 
-#: ldmain.c:1061
+#: ldmain.c:1064
 msgid "%B: warning: defined here\n"
 msgstr ""
 
-#: ldmain.c:1068
+#: ldmain.c:1071
 msgid "%B: warning: common of `%T' overridden by larger common\n"
 msgstr ""
 
-#: ldmain.c:1071
+#: ldmain.c:1074
 msgid "%B: warning: larger common is here\n"
 msgstr ""
 
-#: ldmain.c:1075
+#: ldmain.c:1078
 msgid "%B: warning: common of `%T' overriding smaller common\n"
 msgstr ""
 
-#: ldmain.c:1078
+#: ldmain.c:1081
 msgid "%B: warning: smaller common is here\n"
 msgstr ""
 
-#: ldmain.c:1082
+#: ldmain.c:1085
 msgid "%B: warning: multiple common of `%T'\n"
 msgstr ""
 
-#: ldmain.c:1084
+#: ldmain.c:1087
 msgid "%B: warning: previous common is here\n"
 msgstr ""
 
-#: ldmain.c:1104 ldmain.c:1142
+#: ldmain.c:1107 ldmain.c:1145
 msgid "%P: warning: global constructor %s used\n"
 msgstr ""
 
-#: ldmain.c:1152
+#: ldmain.c:1155
 msgid "%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n"
 msgstr ""
 
 #. We found a reloc for the symbol we are looking for.
-#: ldmain.c:1206 ldmain.c:1208 ldmain.c:1210 ldmain.c:1248 ldmain.c:1296
+#: ldmain.c:1209 ldmain.c:1211 ldmain.c:1213 ldmain.c:1251 ldmain.c:1299
 msgid "warning: "
 msgstr ""
 
-#: ldmain.c:1330
+#: ldmain.c:1334
 msgid "%F%P: bfd_hash_table_init failed: %E\n"
 msgstr ""
 
-#: ldmain.c:1337
+#: ldmain.c:1341
 msgid "%F%P: bfd_hash_lookup failed: %E\n"
 msgstr ""
 
-#: ldmain.c:1358
+#: ldmain.c:1362
 msgid "%X%C: undefined reference to `%T'\n"
 msgstr ""
 
-#: ldmain.c:1361
+#: ldmain.c:1365
 msgid "%C: warning: undefined reference to `%T'\n"
 msgstr ""
 
-#: ldmain.c:1367
+#: ldmain.c:1371
 msgid "%X%D: more undefined references to `%T' follow\n"
 msgstr ""
 
-#: ldmain.c:1370
+#: ldmain.c:1374
 msgid "%D: warning: more undefined references to `%T' follow\n"
 msgstr ""
 
-#: ldmain.c:1381
+#: ldmain.c:1385
 msgid "%X%B: undefined reference to `%T'\n"
 msgstr ""
 
-#: ldmain.c:1384
+#: ldmain.c:1388
 msgid "%B: warning: undefined reference to `%T'\n"
 msgstr ""
 
-#: ldmain.c:1390
+#: ldmain.c:1394
 msgid "%X%B: more undefined references to `%T' follow\n"
 msgstr ""
 
-#: ldmain.c:1393
+#: ldmain.c:1397
 msgid "%B: warning: more undefined references to `%T' follow\n"
 msgstr ""
 
-#: ldmain.c:1432
+#: ldmain.c:1436
 msgid " additional relocation overflows omitted from the output\n"
 msgstr ""
 
-#: ldmain.c:1445
+#: ldmain.c:1449
 msgid " relocation truncated to fit: %s against undefined symbol `%T'"
 msgstr ""
 
-#: ldmain.c:1450
+#: ldmain.c:1454
 msgid ""
 " relocation truncated to fit: %s against symbol `%T' defined in %A section "
 "in %B"
 msgstr ""
 
-#: ldmain.c:1462
+#: ldmain.c:1466
 msgid " relocation truncated to fit: %s against `%T'"
 msgstr ""
 
-#: ldmain.c:1479
+#: ldmain.c:1483
 #, c-format
 msgid "%X%C: dangerous relocation: %s\n"
 msgstr ""
 
-#: ldmain.c:1494
+#: ldmain.c:1498
 msgid "%X%C: reloc refers to symbol `%T' which is not being output\n"
 msgstr ""
 
-#: ldmisc.c:149
+#: ldmisc.c:147
 #, c-format
 msgid "no symbol"
 msgstr ""
 
-#: ldmisc.c:240
+#: ldmisc.c:238
 #, c-format
 msgid "built in linker script:%u"
 msgstr ""
 
-#: ldmisc.c:296 ldmisc.c:300
+#: ldmisc.c:294 ldmisc.c:298
 msgid "%B%F: could not read symbols\n"
 msgstr ""
 
-#: ldmisc.c:342
+#: ldmisc.c:340
 msgid "%B: In function `%T'"
 msgstr ""
 
-#: ldmisc.c:493
+#: ldmisc.c:510
 msgid "%F%P: internal error %s %d\n"
 msgstr ""
 
-#: ldmisc.c:539
+#: ldmisc.c:556
 msgid "%P: internal error: aborting at %s line %d in %s\n"
 msgstr ""
 
-#: ldmisc.c:542
+#: ldmisc.c:559
 msgid "%P: internal error: aborting at %s line %d\n"
 msgstr ""
 
-#: ldmisc.c:544
+#: ldmisc.c:561
 msgid "%P%F: please report this bug\n"
 msgstr ""
 
@@ -1116,20 +1112,20 @@ msgstr ""
 msgid "%P%F: bfd_new_link_order failed\n"
 msgstr ""
 
-#: ldwrite.c:341
+#: ldwrite.c:344
 msgid "%F%P: cannot create split section name for %s\n"
 msgstr ""
 
-#: ldwrite.c:353
+#: ldwrite.c:356
 msgid "%F%P: clone section failed: %E\n"
 msgstr ""
 
-#: ldwrite.c:391
+#: ldwrite.c:394
 #, c-format
 msgid "%8x something else\n"
 msgstr ""
 
-#: ldwrite.c:561
+#: ldwrite.c:564
 msgid "%F%P: final link failed: %E\n"
 msgstr ""
 
@@ -1802,34 +1798,44 @@ msgstr ""
 msgid "%P%F: invalid hex number `%s'\n"
 msgstr ""
 
-#: lexsup.c:1446
+#: lexsup.c:1447
 #, c-format
 msgid "Usage: %s [options] file...\n"
 msgstr ""
 
-#: lexsup.c:1448
+#: lexsup.c:1449
 #, c-format
 msgid "Options:\n"
 msgstr ""
 
+#: lexsup.c:1527
+#, c-format
+msgid "  @FILE"
+msgstr ""
+
+#: lexsup.c:1530
+#, c-format
+msgid "Read options from FILE\n"
+msgstr ""
+
 #. Note: Various tools (such as libtool) depend upon the
 #. format of the listings below - do not change them.
-#: lexsup.c:1531
+#: lexsup.c:1535
 #, c-format
 msgid "%s: supported targets:"
 msgstr ""
 
-#: lexsup.c:1539
+#: lexsup.c:1543
 #, c-format
 msgid "%s: supported emulations: "
 msgstr ""
 
-#: lexsup.c:1544
+#: lexsup.c:1548
 #, c-format
 msgid "%s: emulation specific options:\n"
 msgstr ""
 
-#: lexsup.c:1548
+#: lexsup.c:1552
 #, c-format
 msgid "Report bugs to %s\n"
 msgstr ""
@@ -1843,63 +1849,68 @@ msgstr ""
 msgid "%XUnsupported PEI architecture: %s\n"
 msgstr ""
 
-#: pe-dll.c:652
+#: pe-dll.c:604
+#, c-format
+msgid "%XCannot export %s: invalid export name\n"
+msgstr ""
+
+#: pe-dll.c:657
 #, c-format
 msgid "%XError, duplicate EXPORT with ordinals: %s (%d vs %d)\n"
 msgstr ""
 
-#: pe-dll.c:659
+#: pe-dll.c:664
 #, c-format
 msgid "Warning, duplicate EXPORT: %s\n"
 msgstr ""
 
-#: pe-dll.c:725
+#: pe-dll.c:751
 #, c-format
 msgid "%XCannot export %s: symbol not defined\n"
 msgstr ""
 
-#: pe-dll.c:731
+#: pe-dll.c:757
 #, c-format
 msgid "%XCannot export %s: symbol wrong type (%d vs %d)\n"
 msgstr ""
 
-#: pe-dll.c:738
+#: pe-dll.c:764
 #, c-format
 msgid "%XCannot export %s: symbol not found\n"
 msgstr ""
 
-#: pe-dll.c:850
+#: pe-dll.c:877
 #, c-format
 msgid "%XError, ordinal used twice: %d (%s vs %s)\n"
 msgstr ""
 
-#: pe-dll.c:1172
+#: pe-dll.c:1219
 #, c-format
 msgid "%XError: %d-bit reloc in dll\n"
 msgstr ""
 
-#: pe-dll.c:1300
+#: pe-dll.c:1347
 #, c-format
 msgid "%s: Can't open output def file %s\n"
 msgstr ""
 
-#: pe-dll.c:1443
+#: pe-dll.c:1490
 #, c-format
 msgid "; no contents available\n"
 msgstr ""
 
-#: pe-dll.c:2205
+#: pe-dll.c:2252
 msgid ""
 "%C: variable '%T' can't be auto-imported. Please read the documentation for "
 "ld's --enable-auto-import for details.\n"
 msgstr ""
 
-#: pe-dll.c:2235
+#: pe-dll.c:2282
 #, c-format
 msgid "%XCan't open .lib file: %s\n"
 msgstr ""
 
-#: pe-dll.c:2240
+#: pe-dll.c:2287
 #, c-format
 msgid "Creating library file: %s\n"
 msgstr ""
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index f968b4ce178..b851e597b67 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,43 @@
+2006-04-05  Richard Sandiford  <richard@codesourcery.com>
+
+	* ld-sparc/vxworks1.dd, ld-sparc/vxworks1.ld, ld-sparc/vxworks1-lib.dd,
+	* ld-sparc/vxworks1-lib.nd, ld-sparc/vxworks1-lib.rd,
+	* ld-sparc/vxworks1-lib.s, ld-sparc/vxworks1.rd, ld-sparc/vxworks1.s,
+	* ld-sparc/vxworks1-static.d, ld-sparc/vxworks2.s,
+	* ld-sparc/vxworks2.sd, ld-sparc/vxworks2-static.sd: New tests.
+	* ld-sparc/sparc.exp: Run them.
+
+2006-04-05  Ben Elliston  <bje@au.ibm.com>
+
+	* lib/ld-lib.exp: Comment cleanups.
+
+2006-03-27  Richard Sandiford  <richard@codesourcery.com>
+
+	* ld-mips-elf/tls-hidden3a.s, ld-mips-elf/tls-hidden3b.s,
+	* ld-mips-elf/tls-hidden3.d, ld-mips-elf/tls-hidden3.got,
+	* ld-mips-elf/tls-hidden3.ld, ld-mips-elf/tls-hidden3.r,
+	* ld-mips-elf/tls-hidden4a.s, ld-mips-elf/tls-hidden4b.s,
+	* ld-mips-elf/tls-hidden4.got, ld-mips-elf/tls-hidden4.r: New tests.
+	* ld-mips-elf/mips-elf.exp: Run them.
+
+2006-03-25  Richard Sandiford  <richard@codesourcery.com>
+
+	* ld-m68k/merge-error-1a.s, ld-m68k/merge-error-1b.s,
+	* ld-m68k/merge-error-1a.d, ld-m68k/merge-error-1b.d,
+	* ld-m68k/merge-error-1c.d, ld-m68k/merge-error-1d.d,
+	* ld-m68k/merge-error-1e.d, ld-m68k/merge-ok-1a.d,
+	* ld-m68k/merge-ok-1b.d: New tests.
+	* ld-m68k/m68k.exp: Run them.
+
+2006-03-22  Richard Sandiford  <richard@codesourcery.com>
+
+	* ld-mips/vxworks1.dd, ld-mips/vxworks1.ld, ld-mips/vxworks1-lib.dd,
+	* ld-mips/vxworks1-lib.nd, ld-mips/vxworks1-lib.rd,
+	* ld-mips/vxworks1-lib.s, ld-mips/vxworks1.rd, ld-mips/vxworks1.s,
+	* ld-mips/vxworks1-static.d, ld-mips/vxworks2.s, ld-mips/vxworks2.sd,
+	* ld-mips/vxworks2-static.sd: New tests.
+	* ld-mips/mips-elf.exp: Run them.
+
 2006-03-17  Alexandre Oliva  <aoliva@redhat.com>
 
 	* ld-powerpc/tls32.s: Verify that +32768 @plt addend is
diff --git a/ld/testsuite/ld-m68k/m68k.exp b/ld/testsuite/ld-m68k/m68k.exp
index 5323317486c..a1096a816ba 100644
--- a/ld/testsuite/ld-m68k/m68k.exp
+++ b/ld/testsuite/ld-m68k/m68k.exp
@@ -45,3 +45,11 @@ set m68k_mergeok_tests {
 	{isab.s isab-float.s} {{objdump -p isab-float.d}} "isab-float"}}
 
 run_ld_link_tests $m68k_mergeok_tests
+
+run_dump_test "merge-error-1a"
+run_dump_test "merge-error-1b"
+run_dump_test "merge-error-1c"
+run_dump_test "merge-error-1d"
+run_dump_test "merge-error-1e"
+run_dump_test "merge-ok-1a"
+run_dump_test "merge-ok-1b"
diff --git a/ld/testsuite/ld-m68k/merge-error-1a.d b/ld/testsuite/ld-m68k/merge-error-1a.d
new file mode 100644
index 00000000000..ab3ef6e8306
--- /dev/null
+++ b/ld/testsuite/ld-m68k/merge-error-1a.d
@@ -0,0 +1,4 @@
+#source: merge-error-1a.s -mcpu=cpu32
+#source: merge-error-1b.s -mcpu=68000
+#ld: -r
+#warning: .*
diff --git a/ld/testsuite/ld-m68k/merge-error-1a.s b/ld/testsuite/ld-m68k/merge-error-1a.s
new file mode 100644
index 00000000000..ee4894265f2
--- /dev/null
+++ b/ld/testsuite/ld-m68k/merge-error-1a.s
@@ -0,0 +1 @@
+	rts
diff --git a/ld/testsuite/ld-m68k/merge-error-1b.d b/ld/testsuite/ld-m68k/merge-error-1b.d
new file mode 100644
index 00000000000..291d42ff042
--- /dev/null
+++ b/ld/testsuite/ld-m68k/merge-error-1b.d
@@ -0,0 +1,4 @@
+#source: merge-error-1a.s -mcpu=cpu32
+#source: merge-error-1b.s -mcpu=5207
+#ld: -r
+#warning: .*
diff --git a/ld/testsuite/ld-m68k/merge-error-1b.s b/ld/testsuite/ld-m68k/merge-error-1b.s
new file mode 100644
index 00000000000..ee4894265f2
--- /dev/null
+++ b/ld/testsuite/ld-m68k/merge-error-1b.s
@@ -0,0 +1 @@
+	rts
diff --git a/ld/testsuite/ld-m68k/merge-error-1c.d b/ld/testsuite/ld-m68k/merge-error-1c.d
new file mode 100644
index 00000000000..e74528097c3
--- /dev/null
+++ b/ld/testsuite/ld-m68k/merge-error-1c.d
@@ -0,0 +1,4 @@
+#source: merge-error-1a.s -march=isaaplus
+#source: merge-error-1b.s -march=isab
+#ld: -r
+#warning: .*
diff --git a/ld/testsuite/ld-m68k/merge-error-1d.d b/ld/testsuite/ld-m68k/merge-error-1d.d
new file mode 100644
index 00000000000..310bf4326bd
--- /dev/null
+++ b/ld/testsuite/ld-m68k/merge-error-1d.d
@@ -0,0 +1,4 @@
+#source: merge-error-1a.s -march=isaa -mmac
+#source: merge-error-1b.s -march=isaa -memac
+#ld: -r
+#warning: .*
diff --git a/ld/testsuite/ld-m68k/merge-error-1e.d b/ld/testsuite/ld-m68k/merge-error-1e.d
new file mode 100644
index 00000000000..87a2bf93f3c
--- /dev/null
+++ b/ld/testsuite/ld-m68k/merge-error-1e.d
@@ -0,0 +1,4 @@
+#source: merge-error-1a.s -march=isaa -mno-div -mmac
+#source: merge-error-1b.s -march=isaa -mno-div -memac
+#ld: -r
+#warning: .*
diff --git a/ld/testsuite/ld-m68k/merge-ok-1a.d b/ld/testsuite/ld-m68k/merge-ok-1a.d
new file mode 100644
index 00000000000..96da5563d69
--- /dev/null
+++ b/ld/testsuite/ld-m68k/merge-ok-1a.d
@@ -0,0 +1,6 @@
+#source: merge-error-1a.s -mcpu=5207
+#source: merge-error-1b.s -mcpu=528x
+#ld: -r
+#objdump: -p
+#...
+private flags = 23: \[isa A\+\] \[emac\]
diff --git a/ld/testsuite/ld-m68k/merge-ok-1b.d b/ld/testsuite/ld-m68k/merge-ok-1b.d
new file mode 100644
index 00000000000..03ae2587234
--- /dev/null
+++ b/ld/testsuite/ld-m68k/merge-ok-1b.d
@@ -0,0 +1,6 @@
+#source: merge-error-1a.s -march=isaa -mno-div -mmac
+#source: merge-error-1b.s -march=isaa -mno-div -mfloat
+#ld: -r
+#objdump: -p
+#...
+private flags = 8051: \[cfv4e\] \[isa A\] \[nodiv\] \[float\] \[mac\]
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index aac341894b0..645b7e0e503 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -16,6 +16,34 @@
 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
 #
 
+if {[istarget "mips*-*-vxworks"]} {
+    set mipsvxtests {
+	{"VxWorks shared library test 1" "-shared -Tvxworks1.ld"
+	 "-mips2" {vxworks1-lib.s}
+	 {{readelf --relocs vxworks1-lib.rd} {objdump -dr vxworks1-lib.dd}
+	  {readelf --symbols vxworks1-lib.nd}}
+	 "libvxworks1.so"}
+	{"VxWorks executable test 1 (dynamic)" \
+	 "tmpdir/libvxworks1.so -Tvxworks1.ld -q --force-dynamic"
+	 "-mips2" {vxworks1.s}
+	 {{readelf --relocs vxworks1.rd} {objdump -dr vxworks1.dd}}
+	 "vxworks1"}
+	{"VxWorks executable test 2 (dynamic)" \
+	 "-Tvxworks1.ld -q --force-dynamic"
+	 "-mips2" {vxworks2.s}
+	 {{readelf --segments vxworks2.sd}}
+	 "vxworks2"}
+	{"VxWorks executable test 2 (static)"
+	 "-Tvxworks1.ld"
+	 "-mips2" {vxworks2.s}
+	 {{readelf --segments vxworks2-static.sd}}
+	 "vxworks2"}
+    }
+    run_ld_link_tests $mipsvxtests
+    run_dump_test "vxworks1-static"
+    return
+}
+
 if {![istarget mips*-*-*] || ![is_elf_format]} {
     return
 }
@@ -171,6 +199,17 @@ set mips_tls_tests {
      "-EB -march=mips1 -32 -KPIC" {tls-hidden2a.s tls-hidden2b.s}
      {{objdump -drj.text tls-hidden2.d} {objdump -sj.got tls-hidden2-got.d}}
      "tls-hidden2.so"}
+    {"Shared library with TLS and hidden symbols (3)"
+     "-shared -melf32btsmip -T tls-hidden3.ld"
+     "-EB -march=mips2 -32 -KPIC" {tls-hidden3a.s tls-hidden3b.s}
+     {{objdump -dj.text tls-hidden3.d} {objdump -sj.got tls-hidden3.got}
+      {readelf --relocs tls-hidden3.r}}
+     "tls-hidden3.so"}
+    {"Shared library with TLS and hidden symbols (4)"
+     "-shared -melf32btsmip -T tls-hidden3.ld"
+     "-EB -march=mips2 -32 -KPIC" {tls-hidden4a.s tls-hidden4b.s}
+     {{objdump -sj.got tls-hidden4.got} {readelf --relocs tls-hidden4.r}}
+     "tls-hidden4.so"}
 }
 
 if {[istarget mips*-*-linux*]} {
diff --git a/ld/testsuite/ld-mips-elf/tls-hidden3.d b/ld/testsuite/ld-mips-elf/tls-hidden3.d
new file mode 100644
index 00000000000..6d586869bfa
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/tls-hidden3.d
@@ -0,0 +1,24 @@
+
+.*:     file format .*
+
+Disassembly of section \.text:
+
+#
+# The TLS entries are ordered as follows:
+#
+#	foo0	(-0x7ff0 + 0x20)
+#	foo2	(-0x7ff0 + 0x24)
+#	foo3	(-0x7ff0 + 0x28)
+#	foo1	(-0x7ff0 + 0x2c)
+#
+# Any order would be acceptable, but it must match the .got dump.
+#
+00080c00 <\.text>:
+   80c00:	8f848030 	lw	a0,-32720\(gp\)
+   80c04:	8f84803c 	lw	a0,-32708\(gp\)
+   80c08:	8f848034 	lw	a0,-32716\(gp\)
+   80c0c:	8f848038 	lw	a0,-32712\(gp\)
+   80c10:	8f848030 	lw	a0,-32720\(gp\)
+   80c14:	8f84803c 	lw	a0,-32708\(gp\)
+   80c18:	8f848034 	lw	a0,-32716\(gp\)
+   80c1c:	8f848038 	lw	a0,-32712\(gp\)
diff --git a/ld/testsuite/ld-mips-elf/tls-hidden3.got b/ld/testsuite/ld-mips-elf/tls-hidden3.got
new file mode 100644
index 00000000000..8b9c87f86e2
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/tls-hidden3.got
@@ -0,0 +1,24 @@
+
+.*:     file format .*
+
+#
+# The GOT layout is:
+#
+#	- 2 reserved entries
+#	- 5 local page entries
+#	- 1 global entry for "undef"
+#	- 4 TLS entries
+#
+# The order of the TLS entries is:
+#
+#	foo0	(offset 0x20)
+#	foo2	(offset 0x24)
+#	foo3	(offset 0x28)
+#	foo1	(offset 0x2c)
+#
+# Any order would be acceptable, but it must match the .d dump.
+#
+Contents of section \.got:
+ 90000 00000000 80000000 00000000 00000000  .*
+ 90010 00000000 00000000 00000000 00000000  .*
+ 90020 0000abc0 0000abc8 0000abcc 0000abc4  .*
diff --git a/ld/testsuite/ld-mips-elf/tls-hidden3.ld b/ld/testsuite/ld-mips-elf/tls-hidden3.ld
new file mode 100644
index 00000000000..b3d0584c881
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/tls-hidden3.ld
@@ -0,0 +1,31 @@
+SECTIONS
+{
+  . = 0x80000;
+  .interp : { *(.interp) }
+  .hash : { *(.hash) }
+  .dynsym : { *(.dynsym) }
+  .dynstr : { *(.dynstr) }
+
+  . = ALIGN (0x400);
+  .rel.dyn : { *(.rel.dyn) }
+
+  . = ALIGN (0x400);
+  .MIPS.stubs : { *(.MIPS.stubs) }
+
+  . = ALIGN (0x400);
+  .text : { *(.text) }
+
+  . = ALIGN (0x10000);
+  _gp = . + 0x7ff0;
+  .got : { *(.got) }
+
+  . = ALIGN (0x400);
+  .tdata : { *(.tdata) }
+
+  /DISCARD/ : { *(.reginfo) }
+}
+
+VERSION
+{
+  { local: *; };
+}
diff --git a/ld/testsuite/ld-mips-elf/tls-hidden3.r b/ld/testsuite/ld-mips-elf/tls-hidden3.r
new file mode 100644
index 00000000000..500e7b17072
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/tls-hidden3.r
@@ -0,0 +1,13 @@
+
+Relocation section '\.rel\.dyn' at offset .* contains 6 entries:
+ Offset     Info    Type            Sym\.Value  Sym\. Name
+00000000  00000000 R_MIPS_NONE      
+#
+# The order of the next four entries doesn't matter.  The important thing
+# is that there is exactly one entry per GOT TLS slot.
+#
+00090020  0000002f R_MIPS_TLS_TPREL3
+0009002c  0000002f R_MIPS_TLS_TPREL3
+00090024  0000002f R_MIPS_TLS_TPREL3
+00090028  0000002f R_MIPS_TLS_TPREL3
+00090030  .*03 R_MIPS_REL32      00000000   undef
diff --git a/ld/testsuite/ld-mips-elf/tls-hidden3a.s b/ld/testsuite/ld-mips-elf/tls-hidden3a.s
new file mode 100644
index 00000000000..d1e6d646e7c
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/tls-hidden3a.s
@@ -0,0 +1,10 @@
+	.macro	load
+	lw	$4,%gottprel(foo\@)($gp)
+	.endm
+
+	.rept	4
+	load
+	.endr
+
+	.section .tdata,"awT",@progbits
+	.fill	0xabc0
diff --git a/ld/testsuite/ld-mips-elf/tls-hidden3b.s b/ld/testsuite/ld-mips-elf/tls-hidden3b.s
new file mode 100644
index 00000000000..0744b078f88
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/tls-hidden3b.s
@@ -0,0 +1,18 @@
+	.macro	load
+	.text
+	lw	$4,%gottprel(foo\@)($gp)
+
+	.global foo\@
+	.type   foo\@,@object
+	.size   foo\@,4
+	.section .tdata,"awT",@progbits
+foo\@:
+	.word   \@
+	.endm
+
+	.rept	4
+	load
+	.endr
+
+	.data
+	.word	undef
diff --git a/ld/testsuite/ld-mips-elf/tls-hidden4.got b/ld/testsuite/ld-mips-elf/tls-hidden4.got
new file mode 100644
index 00000000000..84120c04522
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/tls-hidden4.got
@@ -0,0 +1,28 @@
+
+.*:     file format .*
+
+Contents of section \.got:
+#
+# The order of the TLS entries in this GOT is:
+#
+#     foo2
+#     foo3
+#     foo0
+#     foo1
+#
+# The order and address don't matter; the important thing is that the
+# addresses match the relocs in the .r dump and that there is a separate
+# entry for each symbol.
+#
+#...
+ 1c4080 0000abc8 0000abcc 0000abc0 0000abc4  .*
+#
+# Likewise, but the order of the entries in this GOT is:
+#
+#     foo3
+#     foo2
+#     foo0
+#     foo1
+#...
+ 1d00c0 00000000 00000000 00000000 0000abcc  .*
+ 1d00d0 0000abc8 0000abc0 0000abc4           .*
diff --git a/ld/testsuite/ld-mips-elf/tls-hidden4.r b/ld/testsuite/ld-mips-elf/tls-hidden4.r
new file mode 100644
index 00000000000..f6809b5280c
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/tls-hidden4.r
@@ -0,0 +1,19 @@
+
+Relocation section '\.rel\.dyn' at offset .* contains .* entries:
+ Offset     Info    Type            Sym\.Value  Sym\. Name
+00000000  00000000 R_MIPS_NONE      
+#
+# The order and addresses of the next eight entries don't matter.  The
+# important thing is that there is exactly one entry per GOT TLS slot
+# and that the addresses match those in the .got dump.
+#
+001d00d4  0000002f R_MIPS_TLS_TPREL3
+001d00d8  0000002f R_MIPS_TLS_TPREL3
+001d00d0  0000002f R_MIPS_TLS_TPREL3
+001d00cc  0000002f R_MIPS_TLS_TPREL3
+001c4088  0000002f R_MIPS_TLS_TPREL3
+001c408c  0000002f R_MIPS_TLS_TPREL3
+001c4080  0000002f R_MIPS_TLS_TPREL3
+001c4084  0000002f R_MIPS_TLS_TPREL3
+.* R_MIPS_REL32 .*
+#pass
diff --git a/ld/testsuite/ld-mips-elf/tls-hidden4a.s b/ld/testsuite/ld-mips-elf/tls-hidden4a.s
new file mode 100644
index 00000000000..02a0d35b73e
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/tls-hidden4a.s
@@ -0,0 +1,18 @@
+	.macro	load
+	lw	$4,%gottprel(foo\@)($gp)
+	.endm
+
+	.rept	4
+	load
+	.endr
+
+	.macro	load2
+	lw	$4,%got(undefa\@)($gp)
+	.endm
+
+	.rept	0x3000
+	load2
+	.endr
+
+	.section .tdata,"awT",@progbits
+	.fill	0xabc0
diff --git a/ld/testsuite/ld-mips-elf/tls-hidden4b.s b/ld/testsuite/ld-mips-elf/tls-hidden4b.s
new file mode 100644
index 00000000000..d6deb002d62
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/tls-hidden4b.s
@@ -0,0 +1,27 @@
+	.macro	load
+	.text
+	lw	$4,%gottprel(foo\@)($gp)
+
+	.global foo\@
+	.type   foo\@,@object
+	.size   foo\@,4
+	.section .tdata,"awT",@progbits
+foo\@:
+	.word   \@
+	.endm
+
+	.rept	4
+	load
+	.endr
+
+	.text
+	.macro	load2
+	lw	$4,%got(undefb\@)($gp)
+	.endm
+
+	.rept	0x3000
+	load2
+	.endr
+
+	.data
+	.word	undef
diff --git a/ld/testsuite/ld-mips-elf/vxworks1-lib.dd b/ld/testsuite/ld-mips-elf/vxworks1-lib.dd
new file mode 100644
index 00000000000..ab060d98dd4
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1-lib.dd
@@ -0,0 +1,50 @@
+
+.*:     file format .*
+
+Disassembly of section \.plt:
+
+00080800 <_PROCEDURE_LINKAGE_TABLE_>:
+   80800:	8f990008 	lw	t9,8\(gp\)
+   80804:	00000000 	nop
+   80808:	03200008 	jr	t9
+   8080c:	00000000 	nop
+	\.\.\.
+   80818:	1000fff9 	b	80800 <_PROCEDURE_LINKAGE_TABLE_>
+   8081c:	24180000 	li	t8,0
+   80820:	1000fff7 	b	80800 <_PROCEDURE_LINKAGE_TABLE_>
+   80824:	24180001 	li	t8,1
+Disassembly of section \.text:
+
+00080c00 <foo>:
+   80c00:	27bdffe0 	addiu	sp,sp,-32
+   80c04:	afbf0000 	sw	ra,0\(sp\)
+   80c08:	afbc0004 	sw	gp,4\(sp\)
+   80c0c:	3c1c0000 	lui	gp,0x0
+   80c10:	8f9c0000 	lw	gp,0\(gp\)
+   80c14:	8f9c0000 	lw	gp,0\(gp\)
+   80c18:	8f820014 	lw	v0,20\(gp\)
+   80c1c:	8c430000 	lw	v1,0\(v0\)
+   80c20:	24630001 	addiu	v1,v1,1
+   80c24:	ac430000 	sw	v1,0\(v0\)
+   80c28:	8f99000c 	lw	t9,12\(gp\)
+   80c2c:	0320f809 	jalr	t9
+   80c30:	00000000 	nop
+   80c34:	8f99fff4 	lw	t9,-12\(gp\)
+   80c38:	0320f809 	jalr	t9
+   80c3c:	00000000 	nop
+   80c40:	8f99fff0 	lw	t9,-16\(gp\)
+   80c44:	0320f809 	jalr	t9
+   80c48:	00000000 	nop
+   80c4c:	8fbf0000 	lw	ra,0\(sp\)
+   80c50:	8fbc0004 	lw	gp,4\(sp\)
+   80c54:	03e00008 	jr	ra
+   80c58:	27bd0020 	addiu	sp,sp,32
+
+00080c5c <slocal>:
+   80c5c:	03e00008 	jr	ra
+   80c60:	00000000 	nop
+
+00080c64 <sglobal>:
+   80c64:	03e00008 	jr	ra
+   80c68:	00000000 	nop
+#pass
diff --git a/ld/testsuite/ld-mips-elf/vxworks1-lib.nd b/ld/testsuite/ld-mips-elf/vxworks1-lib.nd
new file mode 100644
index 00000000000..adbf7d77a32
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1-lib.nd
@@ -0,0 +1,9 @@
+#...
+Symbol table '\.dynsym' .*:
+#...
+.*: 00081410 * 0 * OBJECT * GLOBAL * DEFAULT * [0-9]+ _GLOBAL_OFFSET_TABLE_
+#...
+Symbol table '\.symtab' .*:
+#...
+.*: 00081410 * 0 * OBJECT * GLOBAL * DEFAULT * [0-9]+ _GLOBAL_OFFSET_TABLE_
+#pass
diff --git a/ld/testsuite/ld-mips-elf/vxworks1-lib.rd b/ld/testsuite/ld-mips-elf/vxworks1-lib.rd
new file mode 100644
index 00000000000..9a8b35e7802
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1-lib.rd
@@ -0,0 +1,18 @@
+
+Relocation section '\.rela\.dyn' at offset .* contains .* entries:
+ Offset     Info    Type            Sym\.Value  Sym\. Name \+ Addend
+00080c0c  .*05 R_MIPS_HI16       00000000   __GOTT_BASE__ \+ 0
+00080c10  .*06 R_MIPS_LO16       00000000   __GOTT_BASE__ \+ 0
+00080c14  .*01 R_MIPS_16         00000000   __GOTT_INDEX__ \+ 0
+0008141c  .*02 R_MIPS_32         00080c00   \.text \+ 5c
+00081c00  00000002 R_MIPS_32                                    00080c5c
+00081c04  00000002 R_MIPS_32                                    00081c00
+00081c08  .*02 R_MIPS_32         00081c08   dglobal \+ 0
+00081c0c  .*02 R_MIPS_32         00000000   dexternal \+ 0
+00081424  .*02 R_MIPS_32         00081800   x \+ 0
+00000000  00000000 R_MIPS_NONE                                  00000000
+#...
+Relocation section '\.rela\.plt' at offset .* contains 2 entries:
+ Offset     Info    Type            Sym\.Value  Sym\. Name \+ Addend
+00081400  .*7f R_MIPS_JUMP_SLOT  00000000   sexternal \+ 0
+00081404  .*7f R_MIPS_JUMP_SLOT  00080c64   sglobal \+ 0
diff --git a/ld/testsuite/ld-mips-elf/vxworks1-lib.s b/ld/testsuite/ld-mips-elf/vxworks1-lib.s
new file mode 100644
index 00000000000..827332c0c18
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1-lib.s
@@ -0,0 +1,52 @@
+	.text
+	.globl	foo
+	.type	foo, @function
+foo:
+	addiu	$sp,$sp,-32
+	sw	$31,($sp)
+	sw	$28,4($sp)
+	lui	$28,%hi(__GOTT_BASE__)
+	lw	$28,%lo(__GOTT_BASE__)($28)
+	lw	$28,%half(__GOTT_INDEX__)($28)
+	lw	$2,%got(x)($28)
+	lw	$3,($2)
+	addiu	$3,$3,1
+	sw	$3,($2)
+	lw	$25,%got(slocal)($gp)
+	jalr	$25
+	lw	$25,%call16(sglobal)($gp)
+	jalr	$25
+	lw	$25,%call16(sexternal)($gp)
+	jalr	$25
+	lw	$31,($sp)
+	lw	$28,4($sp)
+	addiu	$sp,$sp,32
+	jr	$31
+	.size	foo, .-foo
+
+	.type	slocal, @function
+slocal:
+	jr	$31
+	.size	slocal, .-slocal
+
+	.globl	sglobal
+	.type	sglobal, @function
+sglobal:
+	jr	$31
+	.size	sglobal, .-sglobal
+
+	.comm	x,4,4
+
+	.data
+	.type	dlocal, @object
+dlocal:
+	.word	slocal
+	.word	dlocal
+	.size	dlocal, .-dlocal
+
+	.globl	dglobal
+	.type	dglobal, @object
+dglobal:
+	.word	dglobal
+	.word	dexternal
+	.size	dglobal, .-dglobal
diff --git a/ld/testsuite/ld-mips-elf/vxworks1-static.d b/ld/testsuite/ld-mips-elf/vxworks1-static.d
new file mode 100644
index 00000000000..88c0baf1bbb
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1-static.d
@@ -0,0 +1,4 @@
+#name: VxWorks executable test 1 (static)
+#source: vxworks1.s
+#ld: tmpdir/libvxworks1.so -Tvxworks1.ld
+#error: Dynamic sections created in non-dynamic link
diff --git a/ld/testsuite/ld-mips-elf/vxworks1.dd b/ld/testsuite/ld-mips-elf/vxworks1.dd
new file mode 100644
index 00000000000..af9e3543240
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1.dd
@@ -0,0 +1,51 @@
+
+.*:     file format .*
+
+Disassembly of section \.plt:
+
+00080800 <_PROCEDURE_LINKAGE_TABLE_>:
+   80800:	3c190008 	lui	t9,0x8
+			80800: R_MIPS_HI16	_GLOBAL_OFFSET_TABLE_
+   80804:	27391410 	addiu	t9,t9,5136
+			80804: R_MIPS_LO16	_GLOBAL_OFFSET_TABLE_
+   80808:	8f390008 	lw	t9,8\(t9\)
+   8080c:	00000000 	nop
+   80810:	03200008 	jr	t9
+   80814:	00000000 	nop
+   80818:	1000fff9 	b	80800 <_PROCEDURE_LINKAGE_TABLE_>
+   8081c:	24180000 	li	t8,0
+   80820:	3c190008 	lui	t9,0x8
+			80820: R_MIPS_HI16	_GLOBAL_OFFSET_TABLE_\+0xfffffff0
+   80824:	27391400 	addiu	t9,t9,5120
+			80824: R_MIPS_LO16	_GLOBAL_OFFSET_TABLE_\+0xfffffff0
+   80828:	8f390000 	lw	t9,0\(t9\)
+   8082c:	00000000 	nop
+   80830:	03200008 	jr	t9
+   80834:	00000000 	nop
+   80838:	1000fff1 	b	80800 <_PROCEDURE_LINKAGE_TABLE_>
+   8083c:	24180001 	li	t8,1
+   80840:	3c190008 	lui	t9,0x8
+			80840: R_MIPS_HI16	_GLOBAL_OFFSET_TABLE_\+0xfffffff4
+   80844:	27391404 	addiu	t9,t9,5124
+			80844: R_MIPS_LO16	_GLOBAL_OFFSET_TABLE_\+0xfffffff4
+   80848:	8f390000 	lw	t9,0\(t9\)
+   8084c:	00000000 	nop
+   80850:	03200008 	jr	t9
+   80854:	00000000 	nop
+Disassembly of section \.text:
+
+00080c00 <_start>:
+   80c00:	0c020210 	jal	80840 <_PROCEDURE_LINKAGE_TABLE_\+0x40>
+			80c00: R_MIPS_26	\.plt\+0x40
+   80c04:	00000000 	nop
+   80c08:	0c020306 	jal	80c18 <sexternal>
+			80c08: R_MIPS_26	sexternal
+   80c0c:	00000000 	nop
+   80c10:	08020208 	j	80820 <_PROCEDURE_LINKAGE_TABLE_\+0x20>
+			80c10: R_MIPS_26	\.plt\+0x20
+   80c14:	00000000 	nop
+
+00080c18 <sexternal>:
+   80c18:	03e00008 	jr	ra
+   80c1c:	00000000 	nop
+#pass
diff --git a/ld/testsuite/ld-mips-elf/vxworks1.ld b/ld/testsuite/ld-mips-elf/vxworks1.ld
new file mode 100644
index 00000000000..74e2c2612a9
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1.ld
@@ -0,0 +1,32 @@
+SECTIONS
+{
+  . = 0x80000;
+  .interp : { *(.interp) }
+  .hash : { *(.hash) }
+  .dynsym : { *(.dynsym) }
+  .dynstr : { *(.dynstr) }
+
+  . = ALIGN (0x400);
+  .rela.dyn : { *(.rela.dyn) }
+  .rela.plt : { *(.rela.plt) }
+
+  . = ALIGN (0x400);
+  .plt : { *(.plt) }
+
+  . = ALIGN (0x400);
+  .text : { *(.text) }
+
+  . = ALIGN (0x1000);
+  .dynamic : { *(.dynamic) }
+
+  . = ALIGN (0x400);
+  .got : { *(.got.plt) *(.got) }
+
+  . = ALIGN (0x400);
+  .bss : { *(.bss) *(.dynbss) }
+
+  . = ALIGN (0x400);
+  .data : { *(.data) }
+
+  /DISCARD/ : { *(.reginfo) }
+}
diff --git a/ld/testsuite/ld-mips-elf/vxworks1.rd b/ld/testsuite/ld-mips-elf/vxworks1.rd
new file mode 100644
index 00000000000..f4793a22e0d
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1.rd
@@ -0,0 +1,32 @@
+
+Relocation section '\.rela\.dyn' at offset .* contains 1 entries:
+ Offset     Info    Type            Sym.Value  Sym. Name \+ Addend
+00081800  .*7e R_MIPS_COPY       00081800   dglobal \+ 0
+
+Relocation section '\.rela\.plt' at offset .* contains 2 entries:
+ Offset     Info    Type            Sym\.Value  Sym\. Name \+ Addend
+00081400  .*7f R_MIPS_JUMP_SLOT  00080820   sglobal \+ 0
+00081404  .*7f R_MIPS_JUMP_SLOT  00080840   foo \+ 0
+
+Relocation section '\.rela\.text' at offset .* contains 3 entries:
+ Offset     Info    Type            Sym\.Value  Sym\. Name \+ Addend
+00080c00  .*04 R_MIPS_26         00080800   \.plt \+ 40
+00080c08  .*04 R_MIPS_26         00080c18   sexternal \+ 0
+00080c10  .*04 R_MIPS_26         00080800   \.plt \+ 20
+
+Relocation section '\.rela\.data' at offset .* contains 3 entries:
+ Offset     Info    Type            Sym.Value  Sym. Name \+ Addend
+00081c00  .*02 R_MIPS_32         00081c00   .data \+ 0
+00081c04  .*02 R_MIPS_32         00081800   .bss \+ 0
+00081c08  .*02 R_MIPS_32         00081c04   dexternal \+ 0
+
+Relocation section '\.rela\.plt\.unloaded' at offset .* contains 8 entries:
+ Offset     Info    Type            Sym\.Value  Sym\. Name \+ Addend
+00080800  .*05 R_MIPS_HI16       00081410   _GLOBAL_OFFSET_TABLE_ \+ 0
+00080804  .*06 R_MIPS_LO16       00081410   _GLOBAL_OFFSET_TABLE_ \+ 0
+00081400  .*02 R_MIPS_32         00080800   _PROCEDURE_LINKAGE_TAB.* \+ 18
+00080820  .*05 R_MIPS_HI16       00081410   _GLOBAL_OFFSET_TABLE_ \+ fffffff0
+00080824  .*06 R_MIPS_LO16       00081410   _GLOBAL_OFFSET_TABLE_ \+ fffffff0
+00081404  .*02 R_MIPS_32         00080800   _PROCEDURE_LINKAGE_TAB.* \+ 38
+00080840  .*05 R_MIPS_HI16       00081410   _GLOBAL_OFFSET_TABLE_ \+ fffffff4
+00080844  .*06 R_MIPS_LO16       00081410   _GLOBAL_OFFSET_TABLE_ \+ fffffff4
diff --git a/ld/testsuite/ld-mips-elf/vxworks1.s b/ld/testsuite/ld-mips-elf/vxworks1.s
new file mode 100644
index 00000000000..33a247f7f69
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1.s
@@ -0,0 +1,27 @@
+	.text
+	.globl	_start
+	.type	_start, @function
+_start:
+	jal	foo
+	jal	sexternal
+	j	sglobal
+	.size	_start, .-_start
+
+	.globl	sexternal
+	.type	sexternal, @function
+sexternal:
+	jr	$31
+	.size	sexternal, .-sexternal
+
+	.data
+	.type	dlocal, @object
+dlocal:
+	.word	dlocal
+	.size	dlocal, .-dlocal
+
+	.globl	dexternal
+	.type	dexternal, @object
+dexternal:
+	.word	dglobal
+	.word	dexternal
+	.size	dexternal, .-dexternal
diff --git a/ld/testsuite/ld-mips-elf/vxworks2-static.sd b/ld/testsuite/ld-mips-elf/vxworks2-static.sd
new file mode 100644
index 00000000000..912755bc472
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks2-static.sd
@@ -0,0 +1,9 @@
+#...
+Elf file type is EXEC \(Executable file\)
+Entry point 0x80000
+#...
+Program Headers:
+  Type .*
+  LOAD .* 0x00080000 0x00080000 .* R E 0x1000
+
+#...
diff --git a/ld/testsuite/ld-mips-elf/vxworks2.s b/ld/testsuite/ld-mips-elf/vxworks2.s
new file mode 100644
index 00000000000..25f078e8acd
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks2.s
@@ -0,0 +1,5 @@
+	.globl	_start
+	.type	_start, @function
+_start:
+	jr	$31
+	.size	_start, .-_start
diff --git a/ld/testsuite/ld-mips-elf/vxworks2.sd b/ld/testsuite/ld-mips-elf/vxworks2.sd
new file mode 100644
index 00000000000..5ff87d3bef8
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks2.sd
@@ -0,0 +1,13 @@
+#...
+Elf file type is EXEC \(Executable file\)
+Entry point 0x80400
+#...
+Program Headers:
+  Type .*
+  PHDR .*
+#...
+  LOAD .* 0x00080000 0x00080000 .* R E 0x1000
+  LOAD .* 0x00081000 0x00081000 .* RW  0x1000
+  DYNAMIC .*
+
+#...
diff --git a/ld/testsuite/ld-sparc/sparc.exp b/ld/testsuite/ld-sparc/sparc.exp
index aa4c869a198..6e7e95cc563 100644
--- a/ld/testsuite/ld-sparc/sparc.exp
+++ b/ld/testsuite/ld-sparc/sparc.exp
@@ -19,6 +19,33 @@
 # Test SPARC linking; all types of relocs.  This tests the assembler and
 # tools like objdump as well as the linker.
 
+if {[istarget "sparc-*-vxworks"]} {
+    set sparcvxworkstests {
+	{"VxWorks shared library test 1" "-shared -Tvxworks1.ld"
+	 "-KPIC" {vxworks1-lib.s}
+	 {{readelf --relocs vxworks1-lib.rd} {objdump -dr vxworks1-lib.dd}
+	  {readelf --symbols vxworks1-lib.nd}}
+	 "libvxworks1.so"}
+	{"VxWorks executable test 1 (dynamic)" \
+	 "tmpdir/libvxworks1.so -Tvxworks1.ld -q --force-dynamic"
+	 "" {vxworks1.s}
+	 {{readelf --relocs vxworks1.rd} {objdump -dr vxworks1.dd}}
+	 "vxworks1"}
+	{"VxWorks executable test 2 (dynamic)" \
+	 "-Tvxworks1.ld -q --force-dynamic"
+	 "" {vxworks2.s}
+	 {{readelf --segments vxworks2.sd}}
+	 "vxworks2"}
+	{"VxWorks executable test 2 (static)"
+	 "-Tvxworks1.ld"
+	 "" {vxworks2.s}
+	 {{readelf --segments vxworks2-static.sd}}
+	 "vxworks2"}
+    }
+    run_ld_link_tests $sparcvxworkstests
+    run_dump_test "vxworks1-static"
+}
+
 if { !([istarget "sparc*-*-elf*"]
        || [istarget "sparc*-sun-solaris*"]
        || ([istarget "sparc*-*-linux*"]
diff --git a/ld/testsuite/ld-sparc/vxworks1-lib.dd b/ld/testsuite/ld-sparc/vxworks1-lib.dd
new file mode 100644
index 00000000000..49dab7bc4a8
--- /dev/null
+++ b/ld/testsuite/ld-sparc/vxworks1-lib.dd
@@ -0,0 +1,45 @@
+
+.*:     file format .*
+
+Disassembly of section \.plt:
+
+00080800 <_PROCEDURE_LINKAGE_TABLE_>:
+   80800:	c4 05 e0 08 	ld  \[ %l7 \+ 8 \], %g2
+   80804:	81 c0 80 00 	jmp  %g2
+   80808:	01 00 00 00 	nop 
+   8080c:	03 00 00 00 	sethi  %hi\(0\), %g1
+   80810:	82 10 60 0c 	or  %g1, 0xc, %g1	! c <_PROCEDURE_LINKAGE_TABLE_-0x807f4>
+   80814:	c2 05 c0 01 	ld  \[ %l7 \+ %g1 \], %g1
+   80818:	81 c0 40 00 	jmp  %g1
+   8081c:	01 00 00 00 	nop 
+   80820:	03 00 00 00 	sethi  %hi\(0\), %g1
+   80824:	10 bf ff f7 	b  80800 <_PROCEDURE_LINKAGE_TABLE_>
+   80828:	82 10 60 00 	mov  %g1, %g1	! 0 <_PROCEDURE_LINKAGE_TABLE_-0x80800>
+Disassembly of section \.text:
+
+00080c00 <foo>:
+   80c00:	9d e3 bf 98 	save  %sp, -104, %sp
+   80c04:	2f 00 00 00 	sethi  %hi\(0\), %l7
+   80c08:	ee 05 e0 00 	ld  \[ %l7 \], %l7
+   80c0c:	ee 05 e0 00 	ld  \[ %l7 \], %l7
+   80c10:	03 00 00 00 	sethi  %hi\(0\), %g1
+   80c14:	82 10 60 10 	or  %g1, 0x10, %g1	! 10 <_PROCEDURE_LINKAGE_TABLE_-0x807f0>
+   80c18:	c2 05 c0 01 	ld  \[ %l7 \+ %g1 \], %g1
+   80c1c:	c4 00 40 00 	ld  \[ %g1 \], %g2
+   80c20:	84 00 a0 01 	inc  %g2
+   80c24:	40 00 00 08 	call  80c44 <slocal>
+   80c28:	c4 20 40 00 	st  %g2, \[ %g1 \]
+   80c2c:	7f ff fe f8 	call  8080c <_PROCEDURE_LINKAGE_TABLE_\+0xc>
+   80c30:	01 00 00 00 	nop 
+   80c34:	7f ff fe f6 	call  8080c <_PROCEDURE_LINKAGE_TABLE_\+0xc>
+   80c38:	01 00 00 00 	nop 
+   80c3c:	81 c7 e0 08 	ret 
+   80c40:	81 e8 00 00 	restore 
+
+00080c44 <slocal>:
+   80c44:	81 c3 e0 08 	retl 
+   80c48:	01 00 00 00 	nop 
+
+00080c4c <sglobal>:
+   80c4c:	81 c3 e0 08 	retl 
+   80c50:	01 00 00 00 	nop 
diff --git a/ld/testsuite/ld-sparc/vxworks1-lib.nd b/ld/testsuite/ld-sparc/vxworks1-lib.nd
new file mode 100644
index 00000000000..cbc1c8c40f8
--- /dev/null
+++ b/ld/testsuite/ld-sparc/vxworks1-lib.nd
@@ -0,0 +1,9 @@
+#...
+Symbol table '\.dynsym' .*:
+#...
+.*: 00090400 * 0 * OBJECT * GLOBAL * DEFAULT * [0-9]+ _GLOBAL_OFFSET_TABLE_
+#...
+Symbol table '\.symtab' .*:
+#...
+.*: 00090400 * 0 * OBJECT * GLOBAL * DEFAULT * [0-9]+ _GLOBAL_OFFSET_TABLE_
+#pass
diff --git a/ld/testsuite/ld-sparc/vxworks1-lib.rd b/ld/testsuite/ld-sparc/vxworks1-lib.rd
new file mode 100644
index 00000000000..1390e78ab36
--- /dev/null
+++ b/ld/testsuite/ld-sparc/vxworks1-lib.rd
@@ -0,0 +1,12 @@
+
+Relocation section '\.rela\.plt' at offset .* contains 1 entries:
+ Offset     Info    Type            Sym\.Value  Sym\. Name \+ Addend
+0009040c  .*15 R_SPARC_JMP_SLOT  00000000   sexternal \+ 0
+
+Relocation section '\.rela\.dyn' at offset .* contains 5 entries:
+ Offset     Info    Type            Sym\.Value  Sym\. Name \+ Addend
+00090c00  00000016 R_SPARC_RELATIVE                             00080c44
+00080c04  .*09 R_SPARC_HI22      00000000   __GOTT_BASE__ \+ 0
+00080c08  .*0c R_SPARC_LO10      00000000   __GOTT_BASE__ \+ 0
+00080c0c  .*0c R_SPARC_LO10      00000000   __GOTT_INDEX__ \+ 0
+00090410  .*14 R_SPARC_GLOB_DAT  00090800   x \+ 0
diff --git a/ld/testsuite/ld-sparc/vxworks1-lib.s b/ld/testsuite/ld-sparc/vxworks1-lib.s
new file mode 100644
index 00000000000..e1221a22153
--- /dev/null
+++ b/ld/testsuite/ld-sparc/vxworks1-lib.s
@@ -0,0 +1,44 @@
+	.text
+	.globl	foo
+	.type	foo, %function
+foo:
+	save	%sp, -104, %sp
+	sethi	%hi(__GOTT_BASE__), %l7
+	ld	[%l7+%lo(__GOTT_BASE__)],%l7
+	ld	[%l7+%lo(__GOTT_INDEX__)],%l7
+	sethi	%hi(x), %g1
+	or	%g1, %lo(x), %g1
+	ld	[%l7+%g1], %g1
+	ld	[%g1], %g2
+	add	%g2, 1, %g2
+
+	call	slocal, 0
+	st	%g2, [%g1]
+
+	call	sexternal, 0
+	nop
+
+	call	sexternal, 0
+	nop
+
+	ret
+	restore
+	.size	foo, .-foo
+
+	.type	slocal, %function
+slocal:
+	retl
+	nop
+	.size	slocal, .-slocal
+
+	.globl	sglobal
+	.type	sglobal, %function
+sglobal:
+	retl
+	nop
+	.size	sglobal, .-sglobal
+
+	.data
+	.4byte	slocal
+
+	.comm	x,4,4
diff --git a/ld/testsuite/ld-sparc/vxworks1-static.d b/ld/testsuite/ld-sparc/vxworks1-static.d
new file mode 100644
index 00000000000..88c0baf1bbb
--- /dev/null
+++ b/ld/testsuite/ld-sparc/vxworks1-static.d
@@ -0,0 +1,4 @@
+#name: VxWorks executable test 1 (static)
+#source: vxworks1.s
+#ld: tmpdir/libvxworks1.so -Tvxworks1.ld
+#error: Dynamic sections created in non-dynamic link
diff --git a/ld/testsuite/ld-sparc/vxworks1.dd b/ld/testsuite/ld-sparc/vxworks1.dd
new file mode 100644
index 00000000000..16e72fdac31
--- /dev/null
+++ b/ld/testsuite/ld-sparc/vxworks1.dd
@@ -0,0 +1,52 @@
+
+.*:     file format .*
+
+Disassembly of section \.plt:
+
+00080800 <_PROCEDURE_LINKAGE_TABLE_>:
+   80800:	05 00 02 41 	sethi  %hi\(0x90400\), %g2
+			80800: R_SPARC_HI22	_GLOBAL_OFFSET_TABLE_\+0x8
+   80804:	84 10 a0 08 	or  %g2, 8, %g2	! 90408 <_GLOBAL_OFFSET_TABLE_\+0x8>
+			80804: R_SPARC_LO10	_GLOBAL_OFFSET_TABLE_\+0x8
+   80808:	c4 00 80 00 	ld  \[ %g2 \], %g2
+   8080c:	81 c0 80 00 	jmp  %g2
+   80810:	01 00 00 00 	nop 
+   80814:	03 00 02 41 	sethi  %hi\(0x90400\), %g1
+			80814: R_SPARC_HI22	_GLOBAL_OFFSET_TABLE_\+0xc
+   80818:	82 10 60 0c 	or  %g1, 0xc, %g1	! 9040c <sglobal@plt>
+			80818: R_SPARC_LO10	_GLOBAL_OFFSET_TABLE_\+0xc
+   8081c:	c2 00 40 00 	ld  \[ %g1 \], %g1
+   80820:	81 c0 40 00 	jmp  %g1
+   80824:	01 00 00 00 	nop 
+   80828:	03 00 00 00 	sethi  %hi\(0\), %g1
+   8082c:	10 bf ff f5 	b  80800 <_PROCEDURE_LINKAGE_TABLE_>
+   80830:	82 10 60 00 	mov  %g1, %g1	! 0 <_PROCEDURE_LINKAGE_TABLE_-0x80800>
+   80834:	03 00 02 41 	sethi  %hi\(0x90400\), %g1
+			80834: R_SPARC_HI22	_GLOBAL_OFFSET_TABLE_\+0x10
+   80838:	82 10 60 10 	or  %g1, 0x10, %g1	! 90410 <foo@plt>
+			80838: R_SPARC_LO10	_GLOBAL_OFFSET_TABLE_\+0x10
+   8083c:	c2 00 40 00 	ld  \[ %g1 \], %g1
+   80840:	81 c0 40 00 	jmp  %g1
+   80844:	01 00 00 00 	nop 
+   80848:	03 00 00 00 	sethi  %hi\(0\), %g1
+   8084c:	10 bf ff ed 	b  80800 <_PROCEDURE_LINKAGE_TABLE_>
+   80850:	82 10 60 01 	or  %g1, 1, %g1	! 1 <_PROCEDURE_LINKAGE_TABLE_-0x807ff>
+Disassembly of section \.text:
+
+00080c00 <_start>:
+   80c00:	9d e3 bf 98 	save  %sp, -104, %sp
+   80c04:	7f ff ff 0c 	call  80834 <_PROCEDURE_LINKAGE_TABLE_\+0x34>
+			80c04: R_SPARC_WDISP30	\.plt\+0x34
+   80c08:	01 00 00 00 	nop 
+   80c0c:	40 00 00 06 	call  80c24 <sexternal>
+			80c0c: R_SPARC_WDISP30	sexternal
+   80c10:	01 00 00 00 	nop 
+   80c14:	7f ff ff 00 	call  80814 <_PROCEDURE_LINKAGE_TABLE_\+0x14>
+			80c14: R_SPARC_WDISP30	\.plt\+0x14
+   80c18:	01 00 00 00 	nop 
+   80c1c:	81 c7 e0 08 	ret 
+   80c20:	81 e8 00 00 	restore 
+
+00080c24 <sexternal>:
+   80c24:	81 c3 e0 08 	retl 
+   80c28:	01 00 00 00 	nop 
diff --git a/ld/testsuite/ld-sparc/vxworks1.ld b/ld/testsuite/ld-sparc/vxworks1.ld
new file mode 100644
index 00000000000..979d7733548
--- /dev/null
+++ b/ld/testsuite/ld-sparc/vxworks1.ld
@@ -0,0 +1,30 @@
+SECTIONS
+{
+  . = 0x80000;
+  .interp : { *(.interp) }
+  .hash : { *(.hash) }
+  .dynsym : { *(.dynsym) }
+  .dynstr : { *(.dynstr) }
+
+  . = ALIGN (0x400);
+  .rela.dyn : { *(.rela.dyn) }
+  .rela.plt : { *(.rela.plt) }
+
+  . = ALIGN (0x400);
+  .plt : { *(.plt) }
+
+  . = ALIGN (0x400);
+  .text : { *(.text) }
+
+  . = ALIGN (0x10000);
+  .dynamic : { *(.dynamic) }
+
+  . = ALIGN (0x400);
+  .got : { *(.got.plt) *(.got) }
+
+  . = ALIGN (0x400);
+  .bss : { *(.bss) }
+
+  . = ALIGN (0x400);
+  .data : { *(.data) }
+}
diff --git a/ld/testsuite/ld-sparc/vxworks1.rd b/ld/testsuite/ld-sparc/vxworks1.rd
new file mode 100644
index 00000000000..e02146b4f87
--- /dev/null
+++ b/ld/testsuite/ld-sparc/vxworks1.rd
@@ -0,0 +1,22 @@
+
+Relocation section '\.rela\.plt' at offset .* contains 2 entries:
+ Offset     Info    Type            Sym\.Value  Sym\. Name \+ Addend
+0009040c  .*15 R_SPARC_JMP_SLOT  00080814   sglobal \+ 0
+00090410  .*15 R_SPARC_JMP_SLOT  00080834   foo \+ 0
+
+Relocation section '\.rela\.text' at offset .* contains 3 entries:
+ Offset     Info    Type            Sym\.Value  Sym\. Name \+ Addend
+00080c04  .*07 R_SPARC_WDISP30   00080800   \.plt \+ 34
+00080c0c  .*07 R_SPARC_WDISP30   00080c24   sexternal \+ 0
+00080c14  .*07 R_SPARC_WDISP30   00080800   \.plt \+ 14
+
+Relocation section '\.rela\.plt\.unloaded' at offset .* contains 8 entries:
+ Offset     Info    Type            Sym\.Value  Sym\. Name \+ Addend
+00080800  .*09 R_SPARC_HI22      00090400   _GLOBAL_OFFSET_TABLE_ \+ 8
+00080804  .*0c R_SPARC_LO10      00090400   _GLOBAL_OFFSET_TABLE_ \+ 8
+00080814  .*09 R_SPARC_HI22      00090400   _GLOBAL_OFFSET_TABLE_ \+ c
+00080818  .*0c R_SPARC_LO10      00090400   _GLOBAL_OFFSET_TABLE_ \+ c
+0009040c  .*03 R_SPARC_32        00080800   _PROCEDURE_LINKAGE_TAB.* \+ 28
+00080834  .*09 R_SPARC_HI22      00090400   _GLOBAL_OFFSET_TABLE_ \+ 10
+00080838  .*0c R_SPARC_LO10      00090400   _GLOBAL_OFFSET_TABLE_ \+ 10
+00090410  .*03 R_SPARC_32        00080800   _PROCEDURE_LINKAGE_TAB.* \+ 48
diff --git a/ld/testsuite/ld-sparc/vxworks1.s b/ld/testsuite/ld-sparc/vxworks1.s
new file mode 100644
index 00000000000..82106c8107b
--- /dev/null
+++ b/ld/testsuite/ld-sparc/vxworks1.s
@@ -0,0 +1,25 @@
+	.text
+	.globl	_start
+	.type	_start, %function
+_start:
+	save	%sp, -104, %sp
+
+	call	foo, 0
+	nop
+
+	call	sexternal, 0
+	nop
+
+	call	sglobal, 0
+	nop
+
+	ret
+	restore
+	.size	_start, .-_start
+
+	.globl	sexternal
+	.type	sexternal, %function
+sexternal:
+	retl
+	nop
+	.size	sexternal, .-sexternal
diff --git a/ld/testsuite/ld-sparc/vxworks2-static.sd b/ld/testsuite/ld-sparc/vxworks2-static.sd
new file mode 100644
index 00000000000..55fc529619b
--- /dev/null
+++ b/ld/testsuite/ld-sparc/vxworks2-static.sd
@@ -0,0 +1,9 @@
+#...
+Elf file type is EXEC \(Executable file\)
+Entry point 0x80000
+#...
+Program Headers:
+  Type .*
+  LOAD .* 0x00080000 0x00080000 .* R E 0x10000
+
+#...
diff --git a/ld/testsuite/ld-sparc/vxworks2.s b/ld/testsuite/ld-sparc/vxworks2.s
new file mode 100644
index 00000000000..0a883a97d38
--- /dev/null
+++ b/ld/testsuite/ld-sparc/vxworks2.s
@@ -0,0 +1,6 @@
+	.globl	_start
+	.type	_start, %function
+_start:
+	retl
+	nop
+	.end	_start
diff --git a/ld/testsuite/ld-sparc/vxworks2.sd b/ld/testsuite/ld-sparc/vxworks2.sd
new file mode 100644
index 00000000000..087656882a0
--- /dev/null
+++ b/ld/testsuite/ld-sparc/vxworks2.sd
@@ -0,0 +1,13 @@
+#...
+Elf file type is EXEC \(Executable file\)
+Entry point 0x80400
+#...
+Program Headers:
+  Type .*
+  PHDR .*
+#...
+  LOAD .* 0x00080000 0x00080000 .* R E 0x10000
+  LOAD .* 0x00090000 0x00090000 .* RW  0x10000
+  DYNAMIC .*
+
+#...
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 2cf6dabca0f..a0e734eb6c0 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1,6 +1,6 @@
 # Support routines for LD testsuite.
 #   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-#    2004, 2005 Free Software Foundation, Inc.
+#    2004, 2005, 2006 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -15,10 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
-#
-#
-# default_ld_version
-#	extract and print the version number of ld
+
+# Extract and print the version number of ld.
 #
 proc default_ld_version { ld } {
     global host_triplet
@@ -36,9 +34,7 @@ proc default_ld_version { ld } {
     }
 }
 
-#
-# default_ld_relocate
-#	link an object using relocation
+# Link an object using relocation.
 #
 proc default_ld_relocate { ld target objects } {
     global HOSTING_EMU
@@ -62,7 +58,7 @@ proc default_ld_relocate { ld target objects } {
 }
 
 # Check to see if ld is being invoked with a non-endian output format
-
+#
 proc is_endian_output_format { object_flags } {
 
     if {[string match "*-oformat binary*" $object_flags] ||      \
@@ -86,7 +82,7 @@ proc is_endian_output_format { object_flags } {
 # the site.exp file will include the switch "-mbig-endian"
 # (rather than "big-endian") which is not detected by proc
 # process_multilib_options.
-
+#
 proc big_or_little_endian {} {
 
     if [board_info [target_info name] exists multilib_flags] {
@@ -110,9 +106,7 @@ proc big_or_little_endian {} {
     return $flags
 }
 
-#
-# default_ld_link
-#	link a program using ld
+# Link a program using ld.
 #
 proc default_ld_link { ld target objects } {
     global HOSTING_EMU
@@ -147,9 +141,7 @@ proc default_ld_link { ld target objects } {
     }
 }
 
-#
-# default_ld_simple_link
-#	link a program using ld, without including any libraries
+# Link a program using ld, without including any libraries.
 #
 proc default_ld_simple_link { ld target objects } {
     global host_triplet
@@ -197,9 +189,7 @@ proc default_ld_simple_link { ld target objects } {
     }
 }
 
-#
-# default_ld_compile
-#	compile an object using cc
+# Compile an object using cc.
 #
 proc default_ld_compile { cc source object } {
     global CFLAGS
@@ -272,9 +262,7 @@ proc default_ld_compile { cc source object } {
     }
 }
 
-#
-# default_ld_assemble
-#	assemble a file
+# Assemble a file.
 #
 proc default_ld_assemble { as source object } {
     global ASFLAGS
@@ -302,9 +290,7 @@ proc default_ld_assemble { as source object } {
     }
 }
 
-#
-# default_ld_nm
-#	run nm on a file, putting the result in the array nm_output
+# Run nm on a file, putting the result in the array nm_output.
 #
 proc default_ld_nm { nm nmflags object } {
     global NMFLAGS
@@ -355,9 +341,7 @@ proc default_ld_nm { nm nmflags object } {
     }
 }
 
-#
-# is_elf_format
-#	true if the object format is known to be ELF
+# True if the object format is known to be ELF.
 #
 proc is_elf_format {} {
     if { ![istarget *-*-sysv4*] \
@@ -393,9 +377,8 @@ proc is_elf_format {} {
     return 1
 }
 
+# True if the object format is known to be 64-bit ELF.
 #
-# is_elf64
-#	true if the object format is known to be 64bit ELF
 proc is_elf64 { binary_file } {
     global READELF
     global READELFFLAGS
@@ -419,9 +402,8 @@ proc is_elf64 { binary_file } {
     return 0
 }
 
+# True if the object format is known to be a.out.
 #
-# is_aout_format
-#	true if the object format is known to be aout
 proc is_aout_format {} {
     if { [istarget *-*-*\[ab\]out*] \
 	     || [istarget *-*-linux*oldld*] \
@@ -449,9 +431,7 @@ proc is_aout_format {} {
     return 0
 }
 
-#
-# is_pecoff_format
-#	true if the object format is known to be PECOFF
+# True if the object format is known to be PE COFF.
 #
 proc is_pecoff_format {} {
     if { ![istarget *-*-mingw32*] \
@@ -463,11 +443,9 @@ proc is_pecoff_format {} {
     return 1
 }
 
-#
-# simple_diff
-#	compares two files line-by-line
-#	returns differences if exist
-#	returns null if file(s) cannot be opened
+# Compares two files line-by-line.
+#   Returns differences if exist.
+#   Returns null if file(s) cannot be opened.
 #
 proc simple_diff { file_1 file_2 } {
     global target
@@ -630,7 +608,7 @@ proc simple_diff { file_1 file_2 } {
 # `regexp_diff' to compare the output of the dumping tool against the
 # regexps in FILE.d.  `regexp_diff' is defined later in this file; see
 # further comments there.
-
+#
 proc run_dump_test { name } {
     global subdir srcdir
     global OBJDUMP NM AS OBJCOPY READELF LD
@@ -851,7 +829,7 @@ proc run_dump_test { name } {
 	    # redirected, exec *always* returns failure, regardless of the
 	    # program exit code.  Thankfully, we can retrieve the true
 	    # return status from a special variable.  Redirection would
-	    # cause a tcl-specific message to be appended, and we'd rather
+	    # cause a Tcl-specific message to be appended, and we'd rather
 	    # not deal with that if we can help it.
 	    global errorCode
 	    if { [lindex $errorCode 0] == "NONE" } {
@@ -1099,12 +1077,12 @@ proc file_contents { filename } {
 # 0:name 1:ld options 2:assembler options
 # 3:filenames of assembler files 4: action and options. 5: name of output file
 # 6:compiler flags (optional)
-
+#
 # Actions:
 # objdump: Apply objdump options on result.  Compare with regex (last arg).
 # nm: Apply nm options on result.  Compare with regex (last arg).
 # readelf: Apply readelf options on result.  Compare with regex (last arg).
-
+#
 proc run_ld_link_tests { ldtests } {
     global ld
     global as
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 68f6f385923..fb328da633c 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,51 @@
+2006-03-29  Jim Blandy  <jimb@codesourcery.com>
+
+ 	* pex-common.c (pex_input_file, pex_input_pipe): New functions.
+	(pex_init_common): Initialize obj->input_file.
+	(pex_run): Close any file opened by pex_input_file.
+ 	* pexecute.txh (pex_input_file, pex_input_pipe): New docs.
+ 	* pex-common.h (struct pex_obj): New field input_file.
+	(struct pex_funcs): New function ptr fdopenw.
+ 	* pex-unix.c (pex_unix_fdopenw): New function.
+ 	(funcs): List it as our fdopenw function.
+ 	* pex-win32.c (pex_win32_fdopenw): New function.
+ 	(funcs): List it as our fdopenw function.
+ 	* pex-djgpp.c (funcs): Leave fdopenw null.
+ 	* pex-msdos (funcs): Same.
+ 	* functions.texi: Regenerated.
+
+2006-04-10  Jim Blandy  <jimb@codesourcery.com>
+
+	* pex-common.c (temp_file): New function, containing guts of
+	pex-style temporary file name generation.
+	(pex_run): Use it.
+
+2006-04-06  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* Makefile.in: Add install-html, install-html-am, and
+	install-html-recursive targets. Define mkdir_p and 
+	NORMAL_INSTALL. 
+	* configure.ac: AC_SUBST datarootdir, docdir, htmldir.
+	* configure: Regenerate.
+	* testsuite/Makefile.in: Add install-html and html targets.
+
+2006-03-31  Mark Mitchell  <mark@codesourcery.com>
+
+	* pex-win32.c (<errno.h>): Include.
+	(fix_argv): Remove.
+	(argv_to_cmdline): New function.
+	(std_suffixes): New variable.
+	(no_suffixes): Likewise.
+	(find_executable): New function.
+	(win32_spawn): Likewise.
+	(spawn_script): Use win32_spawn instead of _spawnv[p].
+	(pex_win32_exec_child): Replace MSVCRT calls with Win32 API calls.
+	(pex_win32_wait): Likewise.
+
+2006-03-24  Jim Blandy  <jimb@codesourcery.com>
+
+	* pex-common.c (pex_run): Simplify output name handling.
+
 2006-03-12  Jim Blandy  <jimb@red-bean.com>
 
 	* pex-common.h (struct pex_obj): Doc fixes.
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index dcd5ebd86d1..95a82784b0b 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -1,6 +1,6 @@
 #
 # Makefile
-#   Copyright (C) 1990, 91-99, 2000, 2001, 2002, 2003, 2004, 2005
+#   Copyright (C) 1990, 91-99, 2000, 2001, 2002, 2003, 2004, 2005, 2006
 #   Free Software Foundation
 #
 # This file is part of the libiberty library.
@@ -245,7 +245,62 @@ info: libiberty.info info-subdir
 install-info: install-info-subdir
 clean-info: clean-info-subdir
 dvi: libiberty.dvi dvi-subdir
-html: libiberty.html
+
+# html, install-html targets
+HTMLS = libiberty.html
+
+html: $(HTMLS)
+
+.PHONY: install-html install-html-am install-html-recursive
+
+NORMAL_INSTALL = :
+mkdir_p = mkdir -p --
+ 
+html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+
+install-html: install-html-recursive  install-html-am
+
+install-html-am: $(HTMLS)
+	@$(NORMAL_INSTALL)
+	test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
+	@list='$(HTMLS)'; for p in $$list; do \
+	  if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
+	  f=$(html__strip_dir) \
+	  if test -d "$$d$$p"; then \
+	    echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+	    echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+	  else \
+	    echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+	  fi; \
+	done
+
+install-html-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
 
 TEXISRC = \
 	$(srcdir)/libiberty.texi \
diff --git a/libiberty/configure b/libiberty/configure
index 59633d520fc..ed7423a006e 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libiberty_topdir MAINT NOTMAINT MAKEINFO BUILD_INFO PERL HAVE_PERL build build_cpu build_vendor build_os host host_cpu host_vendor host_os AR ac_ct_AR RANLIB ac_ct_RANLIB CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP ac_libiberty_warn_cflags NO_MINUS_C_MINUS_O OUTPUT_OPTION INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA EGREP LIBOBJS CHECK target_header_dir pexecute INSTALL_DEST LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libiberty_topdir MAINT NOTMAINT MAKEINFO BUILD_INFO PERL HAVE_PERL build build_cpu build_vendor build_os host host_cpu host_vendor host_os AR ac_ct_AR RANLIB ac_ct_RANLIB CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP ac_libiberty_warn_cflags NO_MINUS_C_MINUS_O OUTPUT_OPTION INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA EGREP LIBOBJS CHECK target_header_dir pexecute INSTALL_DEST datarootdir docdir htmldir LTLIBOBJS'
 ac_subst_files='host_makefile_frag'
 
 # Initialize some variables set by options.
@@ -8677,6 +8677,10 @@ for l in x $LIBOBJS; do
 done
 LIBOBJS="$L"
 
+
+
+
+
 # We need multilib support, but only if configuring for the target.
                     ac_config_files="$ac_config_files Makefile testsuite/Makefile"
 
@@ -9354,6 +9358,9 @@ s,@CHECK@,$CHECK,;t t
 s,@target_header_dir@,$target_header_dir,;t t
 s,@pexecute@,$pexecute,;t t
 s,@INSTALL_DEST@,$INSTALL_DEST,;t t
+s,@datarootdir@,$datarootdir,;t t
+s,@docdir@,$docdir,;t t
+s,@htmldir@,$htmldir,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 /@host_makefile_frag@/r $host_makefile_frag
 s,@host_makefile_frag@,,;t t
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index a57685a14ec..76cf3d5333f 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -639,6 +639,11 @@ for l in x $LIBOBJS; do
 done
 LIBOBJS="$L"
 
+dnl Required by html and install-html
+AC_SUBST(datarootdir)
+AC_SUBST(docdir)
+AC_SUBST(htmldir)
+
 # We need multilib support, but only if configuring for the target.
 AC_CONFIG_FILES([Makefile testsuite/Makefile])
 AC_CONFIG_COMMANDS([default],
diff --git a/libiberty/functions.texi b/libiberty/functions.texi
index a09e2075fe1..fa92d702d79 100644
--- a/libiberty/functions.texi
+++ b/libiberty/functions.texi
@@ -668,14 +668,14 @@ reading and writing.
 
 @end deftypefn
 
-@c pexecute.txh:169
+@c pexecute.txh:231
 @deftypefn Extension void pex_free (struct pex_obj @var{obj})
 
 Clean up and free all data associated with @var{obj}.
 
 @end deftypefn
 
-@c pexecute.txh:144
+@c pexecute.txh:206
 @deftypefn Extension int pex_get_status (struct pex_obj *@var{obj}, int @var{count}, int *@var{vector})
 
 Returns the exit status of all programs run using @var{obj}.
@@ -685,7 +685,7 @@ to @code{pex_run}.  Returns 0 on error, 1 on success.
 
 @end deftypefn
 
-@c pexecute.txh:153
+@c pexecute.txh:215
 @deftypefn Extension int pex_get_times (struct pex_obj *@var{obj}, int @var{count}, struct pex_time *@var{vector})
 
 Returns the process execution times of all programs run using
@@ -702,7 +702,7 @@ process times, all the fields will be set to @code{0}.
 
 @end deftypefn
 
-@c pexecute.txh:1
+@c pexecute.txh:2
 @deftypefn Extension {struct pex_obj *} pex_init (int @var{flags}, const char *@var{pname}, const char *@var{tempbase})
 
 Prepare to execute one or more programs, with standard output of each
@@ -734,7 +734,70 @@ temporary files; it may be @code{NULL} to use a randomly chosen name.
 
 @end deftypefn
 
-@c pexecute.txh:175
+@c pexecute.txh:133
+@deftypefn Extension {FILE *} pex_input_file (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{in_name})
+
+Return a stream for a temporary file to pass to the first program in
+the pipeline as input.
+
+The name of the input file is chosen according to the same rules
+@code{pex_run} uses to choose output file names, based on
+@var{in_name}, @var{obj} and the @code{PEX_SUFFIX} bit in @var{flags}.
+
+Don't call @code{fclose} on the returned stream; the first call to
+@code{pex_run} closes it automatically.
+
+If @var{flags} includes @code{PEX_BINARY_OUTPUT}, open the stream in
+binary mode; otherwise, open it in the default mode.  Including
+@code{PEX_BINARY_OUTPUT} in @var{flags} has no effect on Unix.
+@end deftypefn
+
+@c pexecute.txh:150
+@deftypefn Extension {FILE *} pex_input_pipe (struct pex_obj *@var{obj}, int @var{binary})
+
+Return a stream @var{fp} for a pipe connected to the standard input of
+the first program in the pipeline; @var{fp} is opened for writing.
+You must have passed @code{PEX_USE_PIPES} to the @code{pex_init} call
+that returned @var{obj}.
+
+You must close @var{fp} using @code{fclose} yourself when you have
+finished writing data to the pipeline.
+
+The file descriptor underlying @var{fp} is marked not to be inherited
+by child processes.
+
+On systems that do not support pipes, this function returns
+@code{NULL}, and sets @code{errno} to @code{EINVAL}.  If you would
+like to write code that is portable to all systems the @code{pex}
+functions support, consider using @code{pex_input_file} instead.
+
+There are two opportunities for deadlock using
+@code{pex_input_pipe}:
+
+@itemize @bullet
+@item
+Most systems' pipes can buffer only a fixed amount of data; a process
+that writes to a full pipe blocks.  Thus, if you write to @file{fp}
+before starting the first process, you run the risk of blocking when
+there is no child process yet to read the data and allow you to
+continue.  @code{pex_input_pipe} makes no promises about the
+size of the pipe's buffer, so if you need to write any data at all
+before starting the first process in the pipeline, consider using
+@code{pex_input_file} instead.
+
+@item
+Using @code{pex_input_pipe} and @code{pex_read_output} together
+may also cause deadlock.  If the output pipe fills up, so that each
+program in the pipeline is waiting for the next to read more data, and
+you fill the input pipe by writing more data to @var{fp}, then there
+is no way to make progress: the only process that could read data from
+the output pipe is you, but you are blocked on the input pipe.
+
+@end itemize
+
+@end deftypefn
+
+@c pexecute.txh:237
 @deftypefn Extension {const char *} pex_one (int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{pname}, const char *@var{outname}, const char *@var{errname}, int *@var{status}, int *@var{err})
 
 An interface to permit the easy execution of a
@@ -747,7 +810,7 @@ be set to the exit status of the program.
 
 @end deftypefn
 
-@c pexecute.txh:132
+@c pexecute.txh:194
 @deftypefn Extension {FILE *} pex_read_output (struct pex_obj *@var{obj}, int @var{binary})
 
 Returns a @code{FILE} pointer which may be used to read the standard
@@ -760,7 +823,7 @@ it will be closed by @code{pex_free}.
 
 @end deftypefn
 
-@c pexecute.txh:32
+@c pexecute.txh:33
 @deftypefn Extension {const char *} pex_run (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{outname}, const char *@var{errname}, int *@var{err})
 
 Execute one program in a pipeline.  On success this returns
@@ -861,7 +924,7 @@ value, or to 0 if there is no relevant @code{errno}.
 
 @end deftypefn
 
-@c pexecute.txh:187
+@c pexecute.txh:249
 @deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int flags)
 
 This is the old interface to execute one or more programs.  It is
@@ -889,7 +952,7 @@ name is unset/removed.
 
 @end deftypefn
 
-@c pexecute.txh:195
+@c pexecute.txh:257
 @deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags})
 
 Another part of the old execution interface.
diff --git a/libiberty/pex-common.c b/libiberty/pex-common.c
index b2ca6e08ce2..ebe8c437590 100644
--- a/libiberty/pex-common.c
+++ b/libiberty/pex-common.c
@@ -67,6 +67,7 @@ pex_init_common (int flags, const char *pname, const char *tempbase,
   obj->status = NULL;
   obj->time = NULL;
   obj->number_waited = 0;
+  obj->input_file = NULL;
   obj->read_output = NULL;
   obj->remove_count = 0;
   obj->remove = NULL;
@@ -91,6 +92,56 @@ pex_add_remove (struct pex_obj *obj, const char *name, int allocated)
   obj->remove[obj->remove_count - 1] = add;
 }
 
+/* Generate a temporary file name based on OBJ, FLAGS, and NAME.
+   Return NULL if we were unable to reserve a temporary filename.
+
+   If non-NULL, the result is either allocated with malloc, or the
+   same pointer as NAME.  */
+static char *
+temp_file (struct pex_obj *obj, int flags, char *name)
+{
+  if (name == NULL)
+    {
+      if (obj->tempbase == NULL)
+        {
+          name = make_temp_file (NULL);
+        }
+      else
+        {
+          int len = strlen (obj->tempbase);
+          int out;
+
+          if (len >= 6
+              && strcmp (obj->tempbase + len - 6, "XXXXXX") == 0)
+            name = xstrdup (obj->tempbase);
+          else
+            name = concat (obj->tempbase, "XXXXXX", NULL);
+
+          out = mkstemps (name, 0);
+          if (out < 0)
+            {
+              free (name);
+              return NULL;
+            }
+
+          /* This isn't obj->funcs->close because we got the
+             descriptor from mkstemps, not from a function in
+             obj->funcs.  Calling close here is just like what
+             make_temp_file does.  */
+          close (out);
+        }
+    }
+  else if ((flags & PEX_SUFFIX) != 0)
+    {
+      if (obj->tempbase == NULL)
+        name = make_temp_file (name);
+      else
+        name = concat (obj->tempbase, name, NULL);
+    }
+
+  return name;
+}
+
 /* Run a program.  */
 
 const char *
@@ -111,6 +162,17 @@ pex_run (struct pex_obj *obj, int flags, const char *executable,
   outname = (char *) orig_outname;
   outname_allocated = 0;
 
+  /* If the user called pex_input_file, close the file now.  */
+  if (obj->input_file)
+    {
+      if (fclose (obj->input_file) == EOF)
+        {
+          errmsg = "closing pipeline input file";
+          goto error_exit;
+        }
+      obj->input_file = NULL;
+    }
+
   /* Set IN.  */
 
   if (obj->next_input_name != NULL)
@@ -161,49 +223,16 @@ pex_run (struct pex_obj *obj, int flags, const char *executable,
     }
   else if ((obj->flags & PEX_USE_PIPES) == 0)
     {
-      if (outname == NULL)
-	{
-	  if (obj->tempbase == NULL)
-	    {
-	      outname = make_temp_file (NULL);
-	      outname_allocated = 1;
-	    }
-	  else
-	    {
-	      int len = strlen (obj->tempbase);
-
-	      if (len >= 6
-		  && strcmp (obj->tempbase + len - 6, "XXXXXX") == 0)
-		outname = xstrdup (obj->tempbase);
-	      else
-		outname = concat (obj->tempbase, "XXXXXX", NULL);
-
-	      outname_allocated = 1;
-
-	      out = mkstemps (outname, 0);
-	      if (out < 0)
-		{
-		  *err = 0;
-		  errmsg = "could not create temporary output file";
-		  goto error_exit;
-		}
-
-	      /* This isn't obj->funcs->close because we got the
-		 descriptor from mkstemps, not from a function in
-		 obj->funcs.  Calling close here is just like what
-		 make_temp_file does.  */
-	      close (out);
-	      out = -1;
-	    }
-	}
-      else if ((flags & PEX_SUFFIX) != 0)
-	{
-	  if (obj->tempbase == NULL)
-	    outname = make_temp_file (outname);
-	  else
-	    outname = concat (obj->tempbase, outname, NULL);
-	  outname_allocated = 1;
-	}
+      outname = temp_file (obj, flags, outname);
+      if (! outname)
+        {
+          *err = 0;
+          errmsg = "could not create temporary file";
+          goto error_exit;
+        }
+
+      if (outname != orig_outname)
+        outname_allocated = 1;
 
       if ((obj->flags & PEX_SAVE_TEMPS) == 0)
 	{
@@ -211,17 +240,10 @@ pex_run (struct pex_obj *obj, int flags, const char *executable,
 	  outname_allocated = 0;
 	}
 
-      if (!outname_allocated)
-	{
-	  obj->next_input_name = outname;
-	  obj->next_input_name_allocated = 0;
-	}
-      else
-	{
-	  obj->next_input_name = outname;
-	  outname_allocated = 0;
-	  obj->next_input_name_allocated = 1;
-	}
+      /* Hand off ownership of outname to the next stage.  */
+      obj->next_input_name = outname;
+      obj->next_input_name_allocated = outname_allocated;
+      outname_allocated = 0;
     }
   else
     {
@@ -297,6 +319,87 @@ pex_run (struct pex_obj *obj, int flags, const char *executable,
   return errmsg;
 }
 
+/* Return a FILE pointer for a temporary file to fill with input for
+   the pipeline.  */
+FILE *
+pex_input_file (struct pex_obj *obj, int flags, const char *in_name)
+{
+  char *name = (char *) in_name;
+  FILE *f;
+
+  /* This must be called before the first pipeline stage is run, and
+     there must not have been any other input selected.  */
+  if (obj->count != 0
+      || (obj->next_input >= 0 && obj->next_input != STDIN_FILE_NO)
+      || obj->next_input_name)
+    {
+      errno = EINVAL;
+      return NULL;
+    }
+
+  name = temp_file (obj, flags, name);
+  if (! name)
+    return NULL;
+
+  f = fopen (name, (flags & PEX_BINARY_OUTPUT) ? "wb" : "w");
+  if (! f)
+    {
+      free (name);
+      return NULL;
+    }
+
+  obj->input_file = f;
+  obj->next_input_name = name;
+  obj->next_input_name_allocated = (name != in_name);
+
+  return f;
+}
+
+/* Return a stream for a pipe connected to the standard input of the
+   first stage of the pipeline.  */
+FILE *
+pex_input_pipe (struct pex_obj *obj, int binary)
+{
+  int p[2];
+  FILE *f;
+
+  /* You must call pex_input_pipe before the first pex_run or pex_one.  */
+  if (obj->count > 0)
+    goto usage_error;
+
+  /* You must be using pipes.  Implementations that don't support
+     pipes clear this flag before calling pex_init_common.  */
+  if (! (obj->flags & PEX_USE_PIPES))
+    goto usage_error;
+
+  /* If we have somehow already selected other input, that's a
+     mistake.  */
+  if ((obj->next_input >= 0 && obj->next_input != STDIN_FILE_NO)
+      || obj->next_input_name)
+    goto usage_error;
+
+  if (obj->funcs->pipe (obj, p, binary != 0) < 0)
+    return NULL;
+
+  f = obj->funcs->fdopenw (obj, p[WRITE_PORT], binary != 0);
+  if (! f)
+    {
+      int saved_errno = errno;
+      obj->funcs->close (obj, p[READ_PORT]);
+      obj->funcs->close (obj, p[WRITE_PORT]);
+      errno = saved_errno;
+      return NULL;
+    }
+
+  obj->next_input = p[READ_PORT];
+
+  return f;
+
+ usage_error:
+  errno = EINVAL;
+  return NULL;
+}
+
 /* Return a FILE pointer for the output of the last program
    executed.  */
 
diff --git a/libiberty/pex-common.h b/libiberty/pex-common.h
index b70b38d9736..8ded138148c 100644
--- a/libiberty/pex-common.h
+++ b/libiberty/pex-common.h
@@ -69,6 +69,8 @@ struct pex_obj
   struct pex_time *time;
   /* Number of children we have already waited for.  */
   int number_waited;
+  /* FILE created by pex_input_file.  */
+  FILE *input_file;
   /* FILE created by pex_read_output.  */
   FILE *read_output;
   /* Number of temporary files to remove.  */
@@ -121,6 +123,11 @@ struct pex_funcs
      PEX_USE_PIPES is set).  If BINARY is non-zero, open in binary
      mode.  Return pointer on success, NULL on error.  */
   FILE * (*fdopenr) (struct pex_obj *, int /* fd */, int /* binary */);
+  /* Get a FILE pointer to write to the file descriptor FD (only
+     called if PEX_USE_PIPES is set).  If BINARY is non-zero, open in
+     binary mode.  Arrange for FD not to be inherited by the child
+     processes.  Return pointer on success, NULL on error.  */
+  FILE * (*fdopenw) (struct pex_obj *, int /* fd */, int /* binary */);
   /* Free any system dependent data associated with OBJ.  May be
      NULL if there is nothing to do.  */
   void (*cleanup) (struct pex_obj *);
diff --git a/libiberty/pex-djgpp.c b/libiberty/pex-djgpp.c
index 6e58e3fd8dc..17fbf2cc7e4 100644
--- a/libiberty/pex-djgpp.c
+++ b/libiberty/pex-djgpp.c
@@ -62,6 +62,7 @@ const struct pex_funcs funcs =
   pex_djgpp_wait,
   NULL, /* pipe */
   NULL, /* fdopenr */
+  NULL, /* fdopenw */
   NULL  /* cleanup */
 };
 
diff --git a/libiberty/pex-msdos.c b/libiberty/pex-msdos.c
index 2256117d1bb..db22337aa2a 100644
--- a/libiberty/pex-msdos.c
+++ b/libiberty/pex-msdos.c
@@ -73,6 +73,7 @@ const struct pex_funcs funcs =
   pex_msdos_wait,
   NULL, /* pipe */
   NULL, /* fdopenr */
+  NULL, /* fdopenw */
   pex_msdos_cleanup
 };
 
diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c
index 35a545cb17b..c92a4297971 100644
--- a/libiberty/pex-unix.c
+++ b/libiberty/pex-unix.c
@@ -277,6 +277,7 @@ static int pex_unix_wait (struct pex_obj *, long, int *, struct pex_time *,
 			  int, const char **, int *);
 static int pex_unix_pipe (struct pex_obj *, int *, int);
 static FILE *pex_unix_fdopenr (struct pex_obj *, int, int);
+static FILE *pex_unix_fdopenw (struct pex_obj *, int, int);
 static void pex_unix_cleanup (struct pex_obj *);
 
 /* The list of functions we pass to the common routines.  */
@@ -290,6 +291,7 @@ const struct pex_funcs funcs =
   pex_unix_wait,
   pex_unix_pipe,
   pex_unix_fdopenr,
+  pex_unix_fdopenw,
   pex_unix_cleanup
 };
 
@@ -495,6 +497,15 @@ pex_unix_fdopenr (struct pex_obj *obj ATTRIBUTE_UNUSED, int fd,
   return fdopen (fd, "r");
 }
 
+static FILE *
+pex_unix_fdopenw (struct pex_obj *obj ATTRIBUTE_UNUSED, int fd,
+		  int binary ATTRIBUTE_UNUSED)
+{
+  if (fcntl (fd, F_SETFD, FD_CLOEXEC) < 0)
+    return NULL;
+  return fdopen (fd, "w");
+}
+
 static void
 pex_unix_cleanup (struct pex_obj *obj ATTRIBUTE_UNUSED)
 {
diff --git a/libiberty/pex-win32.c b/libiberty/pex-win32.c
index ed45e5b8bb8..046f393c6d9 100644
--- a/libiberty/pex-win32.c
+++ b/libiberty/pex-win32.c
@@ -41,6 +41,7 @@ Boston, MA 02110-1301, USA.  */
 #include <fcntl.h>
 #include <signal.h>
 #include <sys/stat.h>
+#include <errno.h>
 
 /* mingw32 headers may not define the following.  */
 
@@ -72,115 +73,6 @@ backslashify (char *s)
   return;
 }
 
-/* This is a kludge to get around the Microsoft C spawn functions' propensity
-   to remove the outermost set of double quotes from all arguments.  */
-
-static const char * const *
-fix_argv (char * const *argvec)
-{
-  char **argv;
-  int i;
-  char *command0;
-
-  /* See whether we need to change anything.  */
-  for (command0 = argvec[0]; *command0 != '\0'; command0++)
-    if (*command0 == '/')
-      break;
-  if (*command0 == '\0')
-    {
-      for (i = 1; argvec[i] != NULL; i++)
-	if (strpbrk (argvec[i], "\" \t") != NULL)
-	  break;
-
-      if (argvec[i] == NULL)
-	return (const char * const *) argvec;
-    }
-
-  for (i = 0; argvec[i] != NULL; i++)
-    ;
-  argv = XNEWVEC (char *, i + 2);
-
-  argv++;	/* Leave space at the beginning of argv
-		   for potential #! handling */
-
-  for (i = 0; argvec[i] != NULL; i++)
-    argv[i] = xstrdup (argvec[i]);
-  argv[i] = NULL;
-
-  backslashify (argv[0]);
-
-  for (i = 1; argv[i] != 0; i++)
-    {
-      int len, j;
-      char *temp, *newtemp;
-
-      temp = argv[i];
-      len = strlen (temp);
-      for (j = 0; j < len; j++)
-        {
-          if (temp[j] == '"')
-            {
-              newtemp = XNEWVEC (char, len + 2);
-              strncpy (newtemp, temp, j);
-              newtemp [j] = '\\';
-              strncpy (&newtemp [j+1], &temp [j], len-j);
-              newtemp [len+1] = 0;
-              temp = newtemp;
-              len++;
-              j++;
-            }
-        }
-
-      if (argv[i] != temp)
-	{
-	  free (argv[i]);
-	  argv[i] = temp;
-	}
-    }
-
-  for (i = 0; argv[i] != 0; i++)
-    {
-      if (strpbrk (argv[i], " \t"))
-        {
-	  int len, trailing_backslash;
-	  char *temp;
-
-	  len = strlen (argv[i]);
-	  trailing_backslash = 0;
-
-	  /* There is an added complication when an arg with embedded white
-	     space ends in a backslash (such as in the case of -iprefix arg
-	     passed to cpp). The resulting quoted strings gets misinterpreted
-	     by the command interpreter -- it thinks that the ending quote
-	     is escaped by the trailing backslash and things get confused.
-	     We handle this case by escaping the trailing backslash, provided
-	     it was not escaped in the first place.  */
-	  if (len > 1
-	      && argv[i][len-1] == '\\'
-	      && argv[i][len-2] != '\\')
-	    {
-	      trailing_backslash = 1;
-	      ++len;			/* to escape the final backslash. */
-	    }
-
-	  len += 2;			/* and for the enclosing quotes. */
-
-	  temp = XNEWVEC (char, len + 1);
-	  temp[0] = '"';
-	  strcpy (temp + 1, argv[i]);
-	  if (trailing_backslash)
-	    temp[len - 2] = '\\';
-	  temp[len - 1] = '"';
-	  temp[len] = '\0';
-
-	  free (argv[i]);
-	  argv[i] = temp;
-	}
-    }
-
-  return (const char * const *) argv;
-}
-
 static int pex_win32_open_read (struct pex_obj *, const char *, int);
 static int pex_win32_open_write (struct pex_obj *, const char *, int);
 static long pex_win32_exec_child (struct pex_obj *, int, const char *,
@@ -191,6 +83,7 @@ static int pex_win32_wait (struct pex_obj *, long, int *,
 			   struct pex_time *, int, const char **, int *);
 static int pex_win32_pipe (struct pex_obj *, int *, int);
 static FILE *pex_win32_fdopenr (struct pex_obj *, int, int);
+static FILE *pex_win32_fdopenw (struct pex_obj *, int, int);
 
 /* The list of functions we pass to the common routines.  */
 
@@ -203,6 +96,7 @@ const struct pex_funcs funcs =
   pex_win32_wait,
   pex_win32_pipe,
   pex_win32_fdopenr,
+  pex_win32_fdopenw,
   NULL /* cleanup */
 };
 
@@ -422,8 +316,225 @@ msys_rootify (const char *executable)
 }
 #endif
 
+/* Return a Windows command-line from ARGV.  It is the caller's
+   responsibility to free the string returned.  */
+
+static char *
+argv_to_cmdline (char *const *argv)
+{
+  char *cmdline;
+  char *p;
+  size_t cmdline_len;
+  int i, j, k;
+
+  cmdline_len = 0;
+  for (i = 0; argv[i]; i++)
+    {
+      /* We quote every last argument.  This simplifies the problem;
+	 we need only escape embedded double-quotes and immediately
+	 preceeding backslash characters.  A sequence of backslach characters
+	 that is not follwed by a double quote character will not be
+	 escaped.  */
+      for (j = 0; argv[i][j]; j++)
+	{
+	  if (argv[i][j] == '"')
+	    {
+	      /* Escape preceeding backslashes.  */
+	      for (k = j - 1; k >= 0 && argv[i][k] == '\\'; k--)
+		cmdline_len++;
+	      /* Escape the qote character.  */
+	      cmdline_len++;
+	    }
+	}
+      /* Trailing backslashes also need to be escaped because they will be
+         followed by the terminating quote.  */
+      for (k = j - 1; k >= 0 && argv[i][k] == '\\'; k--)
+	cmdline_len++;
+      cmdline_len += j;
+      cmdline_len += 3;  /* for leading and trailing quotes and space */
+    }
+  cmdline = xmalloc (cmdline_len);
+  p = cmdline;
+  for (i = 0; argv[i]; i++)
+    {
+      *p++ = '"';
+      for (j = 0; argv[i][j]; j++)
+	{
+	  if (argv[i][j] == '"')
+	    {
+	      for (k = j - 1; k >= 0 && argv[i][k] == '\\'; k--)
+		*p++ = '\\';
+	      *p++ = '\\';
+	    }
+	  *p++ = argv[i][j];
+	}
+      for (k = j - 1; k >= 0 && argv[i][k] == '\\'; k--)
+	*p++ = '\\';
+      *p++ = '"';
+      *p++ = ' ';
+    }
+  p[-1] = '\0';
+  return cmdline;
+}
+
+static const char *const
+std_suffixes[] = {
+  ".com",
+  ".exe",
+  ".bat",
+  ".cmd",
+  0
+};
+static const char *const
+no_suffixes[] = {
+  "",
+  0
+};
+
+/* Returns the full path to PROGRAM.  If SEARCH is true, look for
+   PROGRAM in each directory in PATH.  */
+
+static char *
+find_executable (const char *program, BOOL search)
+{
+  char *full_executable;
+  char *e;
+  size_t fe_len;
+  const char *path = 0;
+  const char *const *ext;
+  const char *p, *q;
+  size_t proglen = strlen (program);
+  int has_extension = !!strchr (program, '.');
+  int has_slash = (strchr (program, '/') || strchr (program, '\\'));
+  HANDLE h;
+
+  if (has_slash)
+    search = FALSE;
+
+  if (search)
+    path = getenv ("PATH");
+  if (!path)
+    path = "";
+
+  fe_len = 0;
+  for (p = path; *p; p = q)
+    {
+      q = p;
+      while (*q != ';' && *q != '\0')
+	q++;
+      if ((size_t)(q - p) > fe_len)
+	fe_len = q - p;
+      if (*q == ';')
+	q++;
+    }
+  fe_len = fe_len + 1 + proglen + (has_extension ? 1 : 5);
+  full_executable = xmalloc (fe_len);
+
+  p = path;
+  do
+    {
+      q = p;
+      while (*q != ';' && *q != '\0')
+	q++;
+
+      e = full_executable;
+      memcpy (e, p, q - p);
+      e += (q - p);
+      if (q - p)
+	*e++ = '\\';
+      strcpy (e, program);
+
+      if (*q == ';')
+	q++;
+
+      for (e = full_executable; *e; e++)
+	if (*e == '/')
+	  *e = '\\';
+
+      /* At this point, e points to the terminating NUL character for
+         full_executable.  */
+      for (ext = has_extension ? no_suffixes : std_suffixes; *ext; ext++)
+	{
+	  /* Remove any current extension.  */
+	  *e = '\0';
+	  /* Add the new one.  */
+	  strcat (full_executable, *ext);
+
+	  /* Attempt to open this file.  */
+	  h = CreateFile (full_executable, GENERIC_READ,
+			  FILE_SHARE_READ | FILE_SHARE_WRITE,
+			  0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+	  if (h != INVALID_HANDLE_VALUE)
+	    goto found;
+	}
+      p = q;
+    }
+  while (*p);
+  free (full_executable);
+  return 0;
+
+ found:
+  CloseHandle (h);
+  return full_executable;
+}
+
+/* Low-level process creation function.  */
+
 static long
-spawn_script (const char *executable, const char * const * argv)
+win32_spawn (const char *executable,
+	     BOOL search,
+	     char *const *argv,
+	     DWORD dwCreationFlags,
+	     LPSTARTUPINFO si,
+	     LPPROCESS_INFORMATION pi)
+{
+  char *full_executable;
+  char *cmdline;
+
+  full_executable = NULL;
+  cmdline = NULL;
+
+  full_executable = find_executable (executable, search);
+  if (!full_executable)
+    goto error;
+  cmdline = argv_to_cmdline (argv);
+  if (!cmdline)
+    goto error;
+    
+  /* Create the child process.  */  
+  if (!CreateProcess (full_executable, cmdline, 
+		      /*lpProcessAttributes=*/NULL,
+		      /*lpThreadAttributes=*/NULL,
+		      /*bInheritHandles=*/TRUE,
+		      dwCreationFlags,
+		      /*lpEnvironment=*/NULL,
+		      /*lpCurrentDirectory=*/NULL,
+		      si,
+		      pi))
+    {
+      free (full_executable);
+      return -1;
+    }
+
+  /* Clean up.  */
+  CloseHandle (pi->hThread);
+  free (full_executable);
+
+  return (long) pi->hProcess;
+
+ error:
+  if (cmdline)
+    free (cmdline);
+  if (full_executable)
+    free (full_executable);
+  return -1;
+}
+
+static long
+spawn_script (const char *executable, char *const *argv,
+	      DWORD dwCreationFlags,
+	      LPSTARTUPINFO si,
+	      LPPROCESS_INFORMATION pi)
 {
   int pid = -1;
   int save_errno = errno;
@@ -455,17 +566,21 @@ spawn_script (const char *executable, const char * const * argv)
 	      executable = strrchr (executable1, '\\') + 1;
 	      if (!executable)
 		executable = executable1;
-	      pid = _spawnvp (_P_NOWAIT, executable, argv);
+	      pid = win32_spawn (executable, TRUE, argv, 
+				 dwCreationFlags, si, pi);
 #else
 	      if (strchr (executable1, '\\') == NULL)
-		pid = _spawnvp (_P_NOWAIT, executable1, argv);
+		pid = win32_spawn (executable1, TRUE, argv, 
+				   dwCreationFlags, si, pi);
 	      else if (executable1[0] != '\\')
-		pid = _spawnv (_P_NOWAIT, executable1, argv);
+		pid = win32_spawn (executable1, FALSE, argv, 
+				   dwCreationFlags, si, pi);
 	      else
 		{
 		  const char *newex = mingw_rootify (executable1);
 		  *avhere = newex;
-		  pid = _spawnv (_P_NOWAIT, newex, argv);
+		  pid = win32_spawn (newex, FALSE, argv, 
+				     dwCreationFlags, si, pi);
 		  if (executable1 != newex)
 		    free ((char *) newex);
 		  if (pid < 0)
@@ -474,7 +589,8 @@ spawn_script (const char *executable, const char * const * argv)
 		      if (newex != executable1)
 			{
 			  *avhere = newex;
-			  pid = _spawnv (_P_NOWAIT, newex, argv);
+			  pid = win32_spawn (newex, FALSE, argv, 
+					     dwCreationFlags, si, pi);
 			  free ((char *) newex);
 			}
 		    }
@@ -496,149 +612,95 @@ pex_win32_exec_child (struct pex_obj *obj ATTRIBUTE_UNUSED, int flags,
 		      int in, int out, int errdes, const char **errmsg,
 		      int *err)
 {
-  int org_in, org_out, org_errdes;
   long pid;
-  const char * const * newargv;
-
-  org_in = -1;
-  org_out = -1;
-  org_errdes = -1;
-
-  if (in != STDIN_FILE_NO)
-    {
-      org_in = _dup (STDIN_FILE_NO);
-      if (org_in < 0)
-	{
-	  *err = errno;
-	  *errmsg = "_dup";
-	  return -1;
-	}
-      if (_dup2 (in, STDIN_FILE_NO) < 0)
-	{
-	  *err = errno;
-	  *errmsg = "_dup2";
-	  return -1;
-	}
-      if (_close (in) < 0)
-	{
-	  *err = errno;
-	  *errmsg = "_close";
-	  return -1;
-	}
-    }
-
-  if (out != STDOUT_FILE_NO)
-    {
-      org_out = _dup (STDOUT_FILE_NO);
-      if (org_out < 0)
-	{
-	  *err = errno;
-	  *errmsg = "_dup";
-	  return -1;
-	}
-      if (_dup2 (out, STDOUT_FILE_NO) < 0)
-	{
-	  *err = errno;
-	  *errmsg = "_dup2";
-	  return -1;
-	}
-      if (_close (out) < 0)
-	{
-	  *err = errno;
-	  *errmsg = "_close";
-	  return -1;
-	}
-    }
-
-  if (errdes != STDERR_FILE_NO
-      || (flags & PEX_STDERR_TO_STDOUT) != 0)
+  HANDLE stdin_handle;
+  HANDLE stdout_handle;
+  HANDLE stderr_handle;
+  DWORD dwCreationFlags;
+  OSVERSIONINFO version_info;
+  STARTUPINFO si;
+  PROCESS_INFORMATION pi;
+
+  stdin_handle = INVALID_HANDLE_VALUE;
+  stdout_handle = INVALID_HANDLE_VALUE;
+  stderr_handle = INVALID_HANDLE_VALUE;
+
+  stdin_handle = (HANDLE) _get_osfhandle (in);
+  stdout_handle = (HANDLE) _get_osfhandle (out);
+  if (!(flags & PEX_STDERR_TO_STDOUT))
+    stderr_handle = (HANDLE) _get_osfhandle (errdes);
+  else
+    stderr_handle = stdout_handle;
+
+  /* Determine the version of Windows we are running on.  */
+  version_info.dwOSVersionInfoSize = sizeof (version_info); 
+  GetVersionEx (&version_info);
+  if (version_info.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
+    /* On Windows 95/98/ME the CREATE_NO_WINDOW flag is not
+       supported, so we cannot avoid creating a console window.  */
+    dwCreationFlags = 0;
+  else
     {
-      org_errdes = _dup (STDERR_FILE_NO);
-      if (org_errdes < 0)
-	{
-	  *err = errno;
-	  *errmsg = "_dup";
-	  return -1;
-	}
-      if (_dup2 ((flags & PEX_STDERR_TO_STDOUT) != 0 ? STDOUT_FILE_NO : errdes,
-		 STDERR_FILE_NO) < 0)
-	{
-	  *err = errno;
-	  *errmsg = "_dup2";
-	  return -1;
-	}
-      if (errdes != STDERR_FILE_NO)
+      HANDLE conout_handle;
+
+      /* Determine whether or not we have an associated console.  */
+      conout_handle = CreateFile("CONOUT$", 
+				 GENERIC_WRITE,
+				 FILE_SHARE_WRITE,
+				 /*lpSecurityAttributes=*/NULL,
+				 OPEN_EXISTING,
+				 FILE_ATTRIBUTE_NORMAL,
+				 /*hTemplateFile=*/NULL);
+      if (conout_handle == INVALID_HANDLE_VALUE)
+	/* There is no console associated with this process.  Since
+	   the child is a console process, the OS would normally
+	   create a new console Window for the child.  Since we'll be
+	   redirecting the child's standard streams, we do not need
+	   the console window.  */ 
+	dwCreationFlags = CREATE_NO_WINDOW;
+      else 
 	{
-	  if (_close (errdes) < 0)
-	    {
-	      *err = errno;
-	      *errmsg = "_close";
-	      return -1;
-	    }
+	  /* There is a console associated with the process, so the OS
+	     will not create a new console.  And, if we use
+	     CREATE_NO_WINDOW in this situation, the child will have
+	     no associated console.  Therefore, if the child's
+	     standard streams are connected to the console, the output
+	     will be discarded.  */
+	  CloseHandle(conout_handle);
+	  dwCreationFlags = 0;
 	}
     }
 
-  newargv = fix_argv (argv);
-  pid = (((flags & PEX_SEARCH) != 0 ? _spawnvp : _spawnv)
-	 (_P_NOWAIT, executable, newargv));
-
+  /* Since the child will be a console process, it will, by default,
+     connect standard input/output to its console.  However, we want
+     the child to use the handles specifically designated above.  In
+     addition, if there is no console (such as when we are running in
+     a Cygwin X window), then we must redirect the child's
+     input/output, as there is no console for the child to use.  */
+  memset (&si, 0, sizeof (si));
+  si.cb = sizeof (si);
+  si.dwFlags = STARTF_USESTDHANDLES;
+  si.hStdInput = stdin_handle;
+  si.hStdOutput = stdout_handle;
+  si.hStdError = stderr_handle;
+
+  /* Create the child process.  */  
+  pid = win32_spawn (executable, (flags & PEX_SEARCH) != 0,
+		     argv, dwCreationFlags, &si, &pi);
   if (pid == -1)
-    pid = spawn_script (executable, newargv);
-
+    pid = spawn_script (executable, argv, dwCreationFlags, &si, &pi);
   if (pid == -1)
     {
-      *err = errno;
-      *errmsg = ((flags & PEX_SEARCH) != 0) ? "_spawnvp" : "_spawnv";
-    }
-
-  if (in != STDIN_FILE_NO)
-    {
-      if (_dup2 (org_in, STDIN_FILE_NO) < 0)
-	{
-	  *err = errno;
-	  *errmsg = "_dup2";
-	  return -1;
-	}
-      if (_close (org_in) < 0)
-	{
-	  *err = errno;
-	  *errmsg = "_close";
-	  return -1;
-	}
-    }
-
-  if (out != STDOUT_FILE_NO)
-    {
-      if (_dup2 (org_out, STDOUT_FILE_NO) < 0)
-	{
-	  *err = errno;
-	  *errmsg = "_dup2";
-	  return -1;
-	}
-      if (_close (org_out) < 0)
-	{
-	  *err = errno;
-	  *errmsg = "_close";
-	  return -1;
-	}
+      *err = ENOENT;
+      *errmsg = "CreateProcess";
     }
 
-  if (errdes != STDERR_FILE_NO
-      || (flags & PEX_STDERR_TO_STDOUT) != 0)
-    {
-      if (_dup2 (org_errdes, STDERR_FILE_NO) < 0)
-	{
-	  *err = errno;
-	  *errmsg = "_dup2";
-	  return -1;
-	}
-      if (_close (org_errdes) < 0)
-	{
-	  *err = errno;
-	  *errmsg = "_close";
-	  return -1;
-	}
-    }
+  /* Close the standard output and standard error handles in the
+     parent.  */ 
+  if (out != STDOUT_FILENO)
+    obj->funcs->close (obj, out);
+  if (errdes != STDERR_FILENO)
+    obj->funcs->close (obj, errdes);
 
   return pid;
 }
@@ -656,30 +718,34 @@ pex_win32_wait (struct pex_obj *obj ATTRIBUTE_UNUSED, long pid,
 		int *status, struct pex_time *time, int done ATTRIBUTE_UNUSED,
 		const char **errmsg, int *err)
 {
-  int termstat;
+  DWORD termstat;
+  HANDLE h;
 
   if (time != NULL)
     memset (time, 0, sizeof *time);
 
+  h = (HANDLE) pid;
+
   /* FIXME: If done is non-zero, we should probably try to kill the
      process.  */
-
-  if (_cwait (&termstat, pid, WAIT_CHILD) < 0)
+  if (WaitForSingleObject (h, INFINITE) != WAIT_OBJECT_0)
     {
-      *err = errno;
-      *errmsg = "_cwait";
+      CloseHandle (h);
+      *err = ECHILD;
+      *errmsg = "WaitForSingleObject";
       return -1;
     }
 
-  /* cwait returns the child process exit code in termstat.  A value
-     of 3 indicates that the child caught a signal, but not which one.
-     Since only SIGABRT, SIGFPE and SIGINT do anything, we report
-     SIGABRT.  */
-
+  GetExitCodeProcess (h, &termstat);
+  CloseHandle (h);
+ 
+  /* A value of 3 indicates that the child caught a signal, but not
+     which one.  Since only SIGABRT, SIGFPE and SIGINT do anything, we
+     report SIGABRT.  */
   if (termstat == 3)
     *status = SIGABRT;
   else
-    *status = ((termstat & 0xff) << 8);
+    *status = (termstat & 0xff) << 8;
 
   return 0;
 }
@@ -702,6 +768,18 @@ pex_win32_fdopenr (struct pex_obj *obj ATTRIBUTE_UNUSED, int fd,
   return fdopen (fd, binary ? "rb" : "r");
 }
 
+static FILE *
+pex_win32_fdopenw (struct pex_obj *obj ATTRIBUTE_UNUSED, int fd,
+		   int binary)
+{
+  HANDLE h = (HANDLE) _get_osfhandle (fd);
+  if (h == INVALID_HANDLE_VALUE)
+    return NULL;
+  if (! SetHandleInformation (h, HANDLE_FLAG_INHERIT, 0))
+    return NULL;
+  return fdopen (fd, binary ? "wb" : "w");
+}
+
 #ifdef MAIN
 #include <stdio.h>
 
diff --git a/libiberty/pexecute.txh b/libiberty/pexecute.txh
index 461ff33d018..7d45576eece 100644
--- a/libiberty/pexecute.txh
+++ b/libiberty/pexecute.txh
@@ -1,3 +1,4 @@
+@c -*- mode: texinfo -*-
 @deftypefn Extension {struct pex_obj *} pex_init (int @var{flags}, const char *@var{pname}, const char *@var{tempbase})
 
 Prepare to execute one or more programs, with standard output of each
@@ -129,6 +130,67 @@ value, or to 0 if there is no relevant @code{errno}.
 
 @end deftypefn
 
+@deftypefn Extension {FILE *} pex_input_file (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{in_name})
+
+Return a stream for a temporary file to pass to the first program in
+the pipeline as input.
+
+The name of the input file is chosen according to the same rules
+@code{pex_run} uses to choose output file names, based on
+@var{in_name}, @var{obj} and the @code{PEX_SUFFIX} bit in @var{flags}.
+
+Don't call @code{fclose} on the returned stream; the first call to
+@code{pex_run} closes it automatically.
+
+If @var{flags} includes @code{PEX_BINARY_OUTPUT}, open the stream in
+binary mode; otherwise, open it in the default mode.  Including
+@code{PEX_BINARY_OUTPUT} in @var{flags} has no effect on Unix.
+@end deftypefn
+
+@deftypefn Extension {FILE *} pex_input_pipe (struct pex_obj *@var{obj}, int @var{binary})
+
+Return a stream @var{fp} for a pipe connected to the standard input of
+the first program in the pipeline; @var{fp} is opened for writing.
+You must have passed @code{PEX_USE_PIPES} to the @code{pex_init} call
+that returned @var{obj}.
+
+You must close @var{fp} using @code{fclose} yourself when you have
+finished writing data to the pipeline.
+
+The file descriptor underlying @var{fp} is marked not to be inherited
+by child processes.
+
+On systems that do not support pipes, this function returns
+@code{NULL}, and sets @code{errno} to @code{EINVAL}.  If you would
+like to write code that is portable to all systems the @code{pex}
+functions support, consider using @code{pex_input_file} instead.
+
+There are two opportunities for deadlock using
+@code{pex_input_pipe}:
+
+@itemize @bullet
+@item
+Most systems' pipes can buffer only a fixed amount of data; a process
+that writes to a full pipe blocks.  Thus, if you write to @file{fp}
+before starting the first process, you run the risk of blocking when
+there is no child process yet to read the data and allow you to
+continue.  @code{pex_input_pipe} makes no promises about the
+size of the pipe's buffer, so if you need to write any data at all
+before starting the first process in the pipeline, consider using
+@code{pex_input_file} instead.
+
+@item
+Using @code{pex_input_pipe} and @code{pex_read_output} together
+may also cause deadlock.  If the output pipe fills up, so that each
+program in the pipeline is waiting for the next to read more data, and
+you fill the input pipe by writing more data to @var{fp}, then there
+is no way to make progress: the only process that could read data from
+the output pipe is you, but you are blocked on the input pipe.
+
+@end itemize
+
+@end deftypefn
+
 @deftypefn Extension {FILE *} pex_read_output (struct pex_obj *@var{obj}, int @var{binary})
 
 Returns a @code{FILE} pointer which may be used to read the standard
diff --git a/libiberty/testsuite/Makefile.in b/libiberty/testsuite/Makefile.in
index 67e1d2826ef..534626e952d 100644
--- a/libiberty/testsuite/Makefile.in
+++ b/libiberty/testsuite/Makefile.in
@@ -1,6 +1,6 @@
 #
 # Makefile
-#   Copyright (C) 1999, 2002
+#   Copyright (C) 1999, 2002, 2006
 #   Free Software Foundation
 #
 # This file is part of the libiberty library.
@@ -73,7 +73,7 @@ test-expandargv: $(srcdir)/test-expandargv.c ../libiberty.a
 		$(srcdir)/test-expandargv.c ../libiberty.a
 
 # Standard (either GNU or Cygnus) rules we don't use.
-info install-info clean-info dvi install etags tags installcheck:
+html install-html info install-info clean-info dvi install etags tags installcheck:
 
 # The standard clean rules.
 mostlyclean:
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index ae0eb648c08..0f098705acf 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,27 @@
+2006-04-12   Hochstein  <hochstein@algo.informatik.tu-darmstadt.de>
+
+	PR binutils/2454
+	* avr-dis.c (avr_operand): Arrange for a comment to appear before
+	the symolic form of an address, so that the output of objdump -d
+	can be reassembled.
+
+2006-04-10  DJ Delorie  <dj@redhat.com>
+
+	* m32c-asm.c: Regenerate.
+
+2006-04-06  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* Makefile.am: Add install-html target.
+	* Makefile.in: Regenerate.
+
+2006-04-06  Nick Clifton  <nickc@redhat.com>
+
+	* po/vi/po: Updated Vietnamese translation.
+
+2006-03-31  Paul Koning  <ni1d@arrl.net>
+
+	* pdp11-opc.c (pdp11_opcodes): Fix opcode for SEC instruction.
+
 2006-03-16  Bernd Schmidt  <bernd.schmidt@analog.com>
 
 	* bfin-dis.c (decode_dsp32shiftimm_0): Simplify and correct the
diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
index 8d0330729fd..57bdb4a716a 100644
--- a/opcodes/Makefile.am
+++ b/opcodes/Makefile.am
@@ -15,6 +15,9 @@ AM_CFLAGS = $(WARN_CFLAGS)
 bfdlibdir = @bfdlibdir@
 bfdincludedir = @bfdincludedir@
 
+.PHONY: install-html
+install-html:
+
 bfdlib_LTLIBRARIES = libopcodes.la
 
 # This is where bfd.h lives.
diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in
index a28ff0e76c0..78faab920ae 100644
--- a/opcodes/Makefile.in
+++ b/opcodes/Makefile.in
@@ -933,6 +933,9 @@ uninstall-info: uninstall-info-recursive
 	uninstall-bfdlibLTLIBRARIES uninstall-info-am
 
 
+.PHONY: install-html
+install-html:
+
 disassemble.lo: disassemble.c $(INCDIR)/dis-asm.h
 	$(LIBTOOL) --mode=compile $(COMPILE) -c @archdefs@ $(srcdir)/disassemble.c
 
diff --git a/opcodes/avr-dis.c b/opcodes/avr-dis.c
index 15300844183..7938dcadbaf 100644
--- a/opcodes/avr-dis.c
+++ b/opcodes/avr-dis.c
@@ -139,7 +139,12 @@ avr_operand (unsigned int insn, unsigned int insn2, unsigned int pc, int constra
     case 'h':
       *sym = 1;
       *sym_addr = ((((insn & 1) | ((insn & 0x1f0) >> 3)) << 16) | insn2) * 2;
-      sprintf (buf, "0x");
+      /* See PR binutils/2545.  Ideally we would like to display the hex
+	 value of the address only once, but this would mean recoding
+	 objdump_print_address() which would affect many targets.  */
+      sprintf (buf, "%#lx", * sym_addr);      
+      sprintf (comment, "0x");
+
       break;
       
     case 'L':
diff --git a/opcodes/m32c-asm.c b/opcodes/m32c-asm.c
index 9407ed8d2d1..5af5d75bab4 100644
--- a/opcodes/m32c-asm.c
+++ b/opcodes/m32c-asm.c
@@ -578,13 +578,14 @@ parse_Bitno16R (CGEN_CPU_DESC cd, const char **strp,
 static const char *
 parse_unsigned_bitbase (CGEN_CPU_DESC cd, const char **strp,
 			int opindex, unsigned long *valuep,
-			unsigned bits)
+			unsigned bits, int allow_syms)
 {
   const char *errmsg = 0;
   unsigned long bit;
   unsigned long base;
   const char *newp = *strp;
   unsigned long long bitbase;
+  long have_zero = 0;
 
   errmsg = cgen_parse_unsigned_integer (cd, & newp, opindex, & bit);
   if (errmsg)
@@ -594,6 +595,11 @@ parse_unsigned_bitbase (CGEN_CPU_DESC cd, const char **strp,
     return "Missing base for bit,base:8";
 
   ++newp;
+
+  if (strncmp (newp, "0x0", 3) == 0 
+      || (newp[0] == '0' && newp[1] != 'x'))
+    have_zero = 1;
+
   errmsg = cgen_parse_unsigned_integer (cd, & newp, opindex, & base);
   if (errmsg)
     return errmsg;
@@ -603,6 +609,21 @@ parse_unsigned_bitbase (CGEN_CPU_DESC cd, const char **strp,
   if (bitbase >= (1ull << bits))
     return _("bit,base is out of range");
 
+  /* If this field may require a relocation then use larger displacement.  */
+  if (! have_zero && base == 0)
+    {
+      switch (allow_syms) {
+      case 0:
+	return _("bit,base out of range for symbol");
+      case 1:
+	break;
+      case 2:
+	if (strncmp (newp, "[sb]", 4) != 0)
+	  return _("bit,base out of range for symbol");
+	break;
+      }
+    }
+
   *valuep = bitbase;
   *strp = newp;
   return 0;
@@ -611,7 +632,7 @@ parse_unsigned_bitbase (CGEN_CPU_DESC cd, const char **strp,
 static const char *
 parse_signed_bitbase (CGEN_CPU_DESC cd, const char **strp,
 		      int opindex, signed long *valuep,
-		      unsigned bits)
+		      unsigned bits, int allow_syms)
 {
   const char *errmsg = 0;
   unsigned long bit;
@@ -619,6 +640,7 @@ parse_signed_bitbase (CGEN_CPU_DESC cd, const char **strp,
   const char *newp = *strp;
   long long bitbase;
   long long limit;
+  long have_zero = 0;
 
   errmsg = cgen_parse_unsigned_integer (cd, & newp, opindex, & bit);
   if (errmsg)
@@ -628,6 +650,11 @@ parse_signed_bitbase (CGEN_CPU_DESC cd, const char **strp,
     return "Missing base for bit,base:8";
 
   ++newp;
+
+  if (strncmp (newp, "0x0", 3) == 0 
+      || (newp[0] == '0' && newp[1] != 'x'))
+    have_zero = 1;
+
   errmsg = cgen_parse_signed_integer (cd, & newp, opindex, & base);
   if (errmsg)
     return errmsg;
@@ -638,6 +665,10 @@ parse_signed_bitbase (CGEN_CPU_DESC cd, const char **strp,
   if (bitbase < -limit || bitbase >= limit)
     return _("bit,base is out of range");
 
+  /* If this field may require a relocation then use larger displacement.  */
+  if (! have_zero && base == 0 && ! allow_syms)
+    return _("bit,base out of range for symbol");
+
   *valuep = bitbase;
   *strp = newp;
   return 0;
@@ -647,56 +678,56 @@ static const char *
 parse_unsigned_bitbase8 (CGEN_CPU_DESC cd, const char **strp,
 			 int opindex, unsigned long *valuep)
 {
-  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 8);
+  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 8, 0);
 }
 
 static const char *
 parse_unsigned_bitbase11 (CGEN_CPU_DESC cd, const char **strp,
 			 int opindex, unsigned long *valuep)
 {
-  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 11);
+  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 11, 0);
 }
 
 static const char *
 parse_unsigned_bitbase16 (CGEN_CPU_DESC cd, const char **strp,
 			  int opindex, unsigned long *valuep)
 {
-  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 16);
+  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 16, 1);
 }
 
 static const char *
 parse_unsigned_bitbase19 (CGEN_CPU_DESC cd, const char **strp,
 			 int opindex, unsigned long *valuep)
 {
-  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 19);
+  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 19, 2);
 }
 
 static const char *
 parse_unsigned_bitbase27 (CGEN_CPU_DESC cd, const char **strp,
 			 int opindex, unsigned long *valuep)
 {
-  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 27);
+  return parse_unsigned_bitbase (cd, strp, opindex, valuep, 27, 1);
 }
 
 static const char *
 parse_signed_bitbase8 (CGEN_CPU_DESC cd, const char **strp,
 		       int opindex, signed long *valuep)
 {
-  return parse_signed_bitbase (cd, strp, opindex, valuep, 8);
+  return parse_signed_bitbase (cd, strp, opindex, valuep, 8, 1);
 }
 
 static const char *
 parse_signed_bitbase11 (CGEN_CPU_DESC cd, const char **strp,
 		       int opindex, signed long *valuep)
 {
-  return parse_signed_bitbase (cd, strp, opindex, valuep, 11);
+  return parse_signed_bitbase (cd, strp, opindex, valuep, 11, 0);
 }
 
 static const char *
 parse_signed_bitbase19 (CGEN_CPU_DESC cd, const char **strp,
 		       int opindex, signed long *valuep)
 {
-  return parse_signed_bitbase (cd, strp, opindex, valuep, 19);
+  return parse_signed_bitbase (cd, strp, opindex, valuep, 19, 1);
 }
 
 /* Parse the suffix as :<char> or as nothing followed by a whitespace.  */
diff --git a/opcodes/pdp11-opc.c b/opcodes/pdp11-opc.c
index 8b96e78a8fe..5fdb084eaaa 100644
--- a/opcodes/pdp11-opc.c
+++ b/opcodes/pdp11-opc.c
@@ -1,5 +1,5 @@
 /* Opcode table for PDP-11.
-   Copyright 2001, 2002 Free Software Foundation, Inc.
+   Copyright 2001, 2002, 2006 Free Software Foundation, Inc.
 
 This file is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ const struct pdp11_opcode pdp11_opcodes[] =
   { "cl_e",	0x00ae,	0xffff, PDP11_OPCODE_NO_OPS,	PDP11_BASIC },
   { "ccc",	0x00af,	0xffff, PDP11_OPCODE_NO_OPS,	PDP11_BASIC },
   { "se_0",	0x00b0,	0xffff, PDP11_OPCODE_NO_OPS,	PDP11_BASIC },
-  { "sec",	0x00a1,	0xffff, PDP11_OPCODE_NO_OPS,	PDP11_BASIC },
+  { "sec",	0x00b1,	0xffff, PDP11_OPCODE_NO_OPS,	PDP11_BASIC },
   { "sev",	0x00b2,	0xffff, PDP11_OPCODE_NO_OPS,	PDP11_BASIC },
   { "se_3",	0x00b3,	0xffff, PDP11_OPCODE_NO_OPS,	PDP11_BASIC },
   { "sez",	0x00b4,	0xffff, PDP11_OPCODE_NO_OPS,	PDP11_BASIC },
diff --git a/opcodes/po/Make-in b/opcodes/po/Make-in
index 5e35426ec1c..4f338bc5b6b 100644
--- a/opcodes/po/Make-in
+++ b/opcodes/po/Make-in
@@ -1,6 +1,6 @@
 # Makefile for program source directory in GNU NLS utilities package.
 # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
 #
 # This file may be copied and used freely without restrictions.  It can
 # be used in projects which are not available under the GNU Public License
@@ -110,6 +110,7 @@ $(srcdir)/stamp-cat-id: $(PACKAGE).pot
 install: install-exec install-data
 install-exec:
 install-info:
+install-html:
 install-data: install-data-@USE_NLS@
 install-data-no: all
 install-data-yes: all
diff --git a/opcodes/po/vi.po b/opcodes/po/vi.po
index 9cf88ed0f80..957c33d71c0 100644
--- a/opcodes/po/vi.po
+++ b/opcodes/po/vi.po
@@ -1,18 +1,20 @@
-#  Vietnamese Translation for opcodes-2.15.96.
+#  Vietnamese Translation for Opcodes.
 #  Copyright © 2005 Free Software Foundation, Inc.
 #  Clytie Siddall <clytie@riverland.net.au>, 2005.
 # 
 msgid ""
 msgstr ""
-"Project-Id-Version: opcodes 2.15.96\n"
+"Project-Id-Version: opcodes-2.15.96\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2005-03-05 20:32+1030\n"
-"PO-Revision-Date: 2005-05-04 21:52+0930\n"
+"PO-Revision-Date: 2006-04-05 15:14+0930\n"
 "Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
 "Language-Team: Vietnamese <gnomevi-list@lists.sourceforge.net>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0\n"
+"X-Generator: LocFactoryEditor 1.6b36\n"
 
 #: alpha-opc.c:331
 msgid "branch operand unaligned"
@@ -24,7 +26,7 @@ msgstr "chưa canh lề lời gợi ý nhảy"
 
 #: arc-dis.c:76
 msgid "Illegal limm reference in last instruction!\n"
-msgstr "Không cho phép tham chiếu loại limm trong câu lệnh cuối cùng.\n"
+msgstr "Không cho phép tham chiếu kiểu limm trong câu lệnh cuối cùng.\n"
 
 #: arm-dis.c:1267
 msgid "<illegal precision>"
@@ -65,7 +67,7 @@ msgstr "lỗi rã nội bộ"
 #: avr-dis.c:227
 #, c-format
 msgid "unknown constraint `%c'"
-msgstr "không biết ràng buộc `%c'"
+msgstr "không biết ràng buộc « %c »"
 
 #: cgen-asm.c:336 fr30-ibld.c:197 frv-ibld.c:197 ip2k-ibld.c:197
 #: iq2000-ibld.c:197 m32r-ibld.c:197 openrisc-ibld.c:197 xstormy16-ibld.c:197
@@ -120,13 +122,13 @@ msgstr "không chấp nhận câu lệnh"
 #: m32r-asm.c:569 openrisc-asm.c:483 xstormy16-asm.c:515
 #, c-format
 msgid "syntax error (expected char `%c', found `%c')"
-msgstr "gặp lỗi cú pháp (ngờ ký tự `%c', còn tìm `%c')"
+msgstr "gặp lỗi cú pháp (ngờ ký tự « %c », còn tìm « %c »)"
 
 #: fr30-asm.c:564 frv-asm.c:1539 ip2k-asm.c:771 iq2000-asm.c:706
 #: m32r-asm.c:579 openrisc-asm.c:493 xstormy16-asm.c:525
 #, c-format
 msgid "syntax error (expected char `%c', found end of instruction)"
-msgstr "gặp lỗi cú pháp (ngờ ký tự `%c', còn tìm kết thức câu lệnh)"
+msgstr "gặp lỗi cú pháp (ngờ ký tự « %c », còn tìm kết thức câu lệnh)"
 
 #: fr30-asm.c:592 frv-asm.c:1567 ip2k-asm.c:799 iq2000-asm.c:734
 #: m32r-asm.c:607 openrisc-asm.c:521 xstormy16-asm.c:553
@@ -142,19 +144,19 @@ msgstr "không chấp nhận dạng câu lệnh"
 #: m32r-asm.c:725 openrisc-asm.c:639 xstormy16-asm.c:671
 #, c-format
 msgid "bad instruction `%.50s...'"
-msgstr "câu lệnh sai `%.50s'"
+msgstr "câu lệnh sai « %.50s »"
 
 #: fr30-asm.c:713 frv-asm.c:1688 ip2k-asm.c:920 iq2000-asm.c:855
 #: m32r-asm.c:728 openrisc-asm.c:642 xstormy16-asm.c:674
 #, c-format
 msgid "bad instruction `%.50s'"
-msgstr "câu lệnh sai `%.50s'"
+msgstr "câu lệnh sai « %.50s »"
 
 #. Default text to print if an instruction isn't recognized.
 #: fr30-dis.c:41 frv-dis.c:41 ip2k-dis.c:41 iq2000-dis.c:41 m32r-dis.c:41
 #: mmix-dis.c:284 openrisc-dis.c:41 xstormy16-dis.c:41
 msgid "*unknown*"
-msgstr "*không biết*"
+msgstr " • không rõ •"
 
 #: fr30-dis.c:319 frv-dis.c:410 ip2k-dis.c:313 iq2000-dis.c:191 m32r-dis.c:262
 #: openrisc-dis.c:137 xstormy16-dis.c:170
@@ -178,7 +180,7 @@ msgstr "tác tử ở ngoại phạm vị (%lu không phải ở giữa 0 và %l
 #: m32r-ibld.c:667 openrisc-ibld.c:635 xstormy16-ibld.c:680
 #, c-format
 msgid "Unrecognized field %d while building insn.\n"
-msgstr "Không chấp nhận trường %d trong khi xây dụng câu lệnh.\n"
+msgstr "Không chấp nhận trường %d trong khi xây dựng câu lệnh.\n"
 
 #: fr30-ibld.c:939 frv-ibld.c:1177 ip2k-ibld.c:686 iq2000-ibld.c:892
 #: m32r-ibld.c:806 openrisc-ibld.c:737 xstormy16-ibld.c:828
@@ -190,25 +192,25 @@ msgstr "Không chấp nhận trường %d trong khi giải mã câu lệnh.\n"
 #: m32r-ibld.c:922 openrisc-ibld.c:817 xstormy16-ibld.c:941
 #, c-format
 msgid "Unrecognized field %d while getting int operand.\n"
-msgstr "Không chấp nhận trường %d trong khi gọi tác tử số nguyên.\n"
+msgstr "Không chấp nhận trường %d trong khi lấy tác tử số nguyên.\n"
 
 #: fr30-ibld.c:1217 frv-ibld.c:1719 ip2k-ibld.c:820 iq2000-ibld.c:1140
 #: m32r-ibld.c:1018 openrisc-ibld.c:877 xstormy16-ibld.c:1034
 #, c-format
 msgid "Unrecognized field %d while getting vma operand.\n"
-msgstr "Không chấp nhận trường %d trong khi gọi tác tử vma.\n"
+msgstr "Không chấp nhận trường %d trong khi lấy tác tử vma.\n"
 
 #: fr30-ibld.c:1351 frv-ibld.c:1989 ip2k-ibld.c:882 iq2000-ibld.c:1263
 #: m32r-ibld.c:1122 openrisc-ibld.c:946 xstormy16-ibld.c:1136
 #, c-format
 msgid "Unrecognized field %d while setting int operand.\n"
-msgstr "Không chấp nhận trường %d trong khi lập tác tử số nguyên.\n"
+msgstr "Không chấp nhận trường %d trong khi đặt tác tử số nguyên.\n"
 
 #: fr30-ibld.c:1473 frv-ibld.c:2247 ip2k-ibld.c:932 iq2000-ibld.c:1374
 #: m32r-ibld.c:1214 openrisc-ibld.c:1003 xstormy16-ibld.c:1226
 #, c-format
 msgid "Unrecognized field %d while setting vma operand.\n"
-msgstr "Không chấp nhận trường %d trong khi lập tác tử vma.\n"
+msgstr "Không chấp nhận trường %d trong khi đặt tác tử vma.\n"
 
 #: frv-asm.c:978
 msgid "register number must be even"
@@ -227,13 +229,13 @@ msgstr "Không hiểu 0x%x \n"
 #: h8500-dis.c:143
 #, c-format
 msgid "can't cope with insert %d\n"
-msgstr "không quản lý được điều chèn %d\n"
+msgstr "không thể xử lý điều chèn %d\n"
 
 #. Couldn't understand anything.
 #: h8500-dis.c:342
 #, c-format
 msgid "%02x\t\t*unknown*"
-msgstr "°không biết*%02x\t\t"
+msgstr "%02x\t\t • không rõ •"
 
 #: i386-dis.c:1733
 msgid "<internal disassembler error>"
@@ -247,21 +249,21 @@ msgstr "%s: Lá»—i"
 #: ia64-gen.c:310
 #, c-format
 msgid "%s: Warning: "
-msgstr "%s: Cảnh báo"
+msgstr "%s: Cảnh báo : "
 
 #: ia64-gen.c:496 ia64-gen.c:730
 #, c-format
 msgid "multiple note %s not handled\n"
-msgstr "không quản lý được đa chú thích %s\n"
+msgstr "không xử lý được đa chú thích %s\n"
 
 #: ia64-gen.c:607
 msgid "can't find ia64-ic.tbl for reading\n"
-msgstr "không tìm được ia64-ic.tbl để đọc\n"
+msgstr "không tìm thấy ia64-ic.tbl để đọc\n"
 
 #: ia64-gen.c:812
 #, c-format
 msgid "can't find %s for reading\n"
-msgstr "không tìm được %s để đọc\n"
+msgstr "không tìm thấy %s để đọc\n"
 
 #: ia64-gen.c:1036
 #, c-format
@@ -269,18 +271,18 @@ msgid ""
 "most recent format '%s'\n"
 "appears more restrictive than '%s'\n"
 msgstr ""
-"hình như dạng thức gần đây nhất '%s'\n"
-"giới hạn hơn '%s'\n"
+"dạng thức gần đây nhất « %s »\n"
+"có vẻ hạn hẹp hơn « %s »\n"
 
 #: ia64-gen.c:1047
 #, c-format
 msgid "overlapping field %s->%s\n"
-msgstr "trường chồng lấp %s->%s\n"
+msgstr "trường chồng lấp %s → %s\n"
 
 #: ia64-gen.c:1244
 #, c-format
 msgid "overwriting note %d with note %d (IC:%s)\n"
-msgstr "đang ghi đề chú thích %d với chú thích %d (IC:%s)\n"
+msgstr "đang ghi đè chú thích %d bằng chú thích %d (IC:%s)\n"
 
 #: ia64-gen.c:1443
 #, c-format
@@ -320,7 +322,7 @@ msgstr "đã định nghĩa còn chưa sử dụng hạng %s\n"
 #: ia64-gen.c:1541
 #, c-format
 msgid "Warning: rsrc %s (%s) has no chks%s\n"
-msgstr "Cảnh báo: tài nguyên %s (%s) không có cản trở %s\n"
+msgstr "Cảnh báo : tài nguyên %s (%s) không có cản trở %s\n"
 
 #: ia64-gen.c:1545
 #, c-format
@@ -345,7 +347,7 @@ msgstr "opcode (mã thi hành) %s không có hạng (những tác tử %d %d %d)
 #: ia64-gen.c:2816
 #, c-format
 msgid "unable to change directory to \"%s\", errno = %s\n"
-msgstr "không thay đổi được thư mục thành \"%s\", số lỗi = %s\n"
+msgstr "không thể chuyển đổi thư mục thành « %s », số lỗi = %s\n"
 
 #. We've been passed a w.  Return with an error message so that
 #. cgen will try the next parsing option.
@@ -356,7 +358,7 @@ msgstr "Tử khóa W không hợp lệ trong vị trí tác tử FR."
 #. Invalid offset present.
 #: ip2k-asm.c:117
 msgid "offset(IP) is not a valid form"
-msgstr "offset(IP) (hiệu số) không là dạng hợp lệ"
+msgstr "offset(IP) (hiệu số) không phải là dạng hợp lệ"
 
 #. Found something there in front of (DP) but it's out
 #. of range.
@@ -381,15 +383,15 @@ msgstr "tác tử ở ngoại phạm vị (không phải ở giữa số 1 và s
 #. Something is very wrong. opindex has to be one of the above.
 #: ip2k-asm.c:254
 msgid "parse_addr16: invalid opindex."
-msgstr "parse_addr16: (địa chỉ phân tách) opindex (chỉ mục loại tác tử) không hợp lệ."
+msgstr "parse_addr16: (địa chỉ phân tách) opindex (chỉ mục kiểu tác tử) không hợp lệ."
 
 #: ip2k-asm.c:309
 msgid "Byte address required. - must be even."
-msgstr "Cần đến địa chỉ byte - phải là số chẵn."
+msgstr "Cần đến địa chỉ byte — phải là số chẵn."
 
 #: ip2k-asm.c:318
 msgid "cgen_parse_address returned a symbol. Literal required."
-msgstr "cgen_parse_address (địa chỉ phân tách cgen) đã gọi một ký hiệu: còn cần đến hằng mã nguồn."
+msgstr "cgen_parse_address (địa chỉ phân tách cgen) đã trả gởi một ký hiệu: còn cần đến điều nghĩa chữ."
 
 #: ip2k-asm.c:376
 #, fuzzy, c-format
@@ -415,22 +417,22 @@ msgstr "hiệu số 21-bit ở ngoại phạm vị"
 #: iq2000-asm.c:210 iq2000-asm.c:240 iq2000-asm.c:277 iq2000-asm.c:310
 #: openrisc-asm.c:90 openrisc-asm.c:144
 msgid "missing `)'"
-msgstr "thiếu `)'"
+msgstr "thiếu dấu ngoặc đóng « ) »"
 
 #: m10200-dis.c:199
 #, c-format
 msgid "unknown\t0x%02x"
-msgstr "không biết\t0x%02x"
+msgstr "\t0x%02x không rõ"
 
 #: m10200-dis.c:339
 #, c-format
 msgid "unknown\t0x%04lx"
-msgstr "không biết\t0x%04lx"
+msgstr "\t0x%04lx không rõ"
 
 #: m10300-dis.c:767
 #, c-format
 msgid "unknown\t0x%04x"
-msgstr "không biết\t0x%04x"
+msgstr "\t0x%04x không rõ"
 
 #: m68k-dis.c:295
 #, c-format
@@ -552,7 +554,7 @@ msgid ""
 "   "
 msgstr ""
 "\n"
-"  Với những tùy chọn ở trên, hỗ trợ những giá trị theo đây cho \"ABI\":\n"
+"  Với những tùy chọn ở trên, hỗ trợ những giá trị theo đây cho « ABI »:\n"
 "   "
 
 #: mips-dis.c:1840 mips-dis.c:1848 mips-dis.c:1850
@@ -568,27 +570,27 @@ msgid ""
 "   "
 msgstr ""
 "\n"
-"  Với những tùy chọn ở trên, hỗ trợ những giá trị theo đây cho \"ARCH\":\n"
+"  Với những tùy chọn ở trên, hỗ trợ những giá trị theo đây cho « ARCH »:\n"
 "   "
 
 #: mmix-dis.c:34
 #, c-format
 msgid "Bad case %d (%s) in %s:%d\n"
-msgstr "Trường hợp sai %d (%s) trong %s:%d\n"
+msgstr "Chữ hoa/thường sai %d (%s) trong %s:%d\n"
 
 #: mmix-dis.c:44
 #, c-format
 msgid "Internal: Non-debugged code (test-case missing): %s:%d"
-msgstr "Nội bộ: chưa gỡ lỗi mã (thiếu trường hợp thử): %s:%d"
+msgstr "Nội bộ : chưa gỡ lỗi mã (thiếu trường hợp thử): %s:%d"
 
 #: mmix-dis.c:53
 msgid "(unknown)"
-msgstr "(không biết)"
+msgstr "(không rõ)"
 
 #: mmix-dis.c:519
 #, c-format
 msgid "*unknown operands type: %d*"
-msgstr "*không biết loại tác tử: %d*"
+msgstr "• không biết kiểu tác tử: %d •"
 
 #. I and Z are output operands and can`t be immediate
 #. * A is an address and we can`t have the address of
@@ -603,11 +605,11 @@ msgstr "$<chưa định nghĩa>"
 
 #: ppc-opc.c:794 ppc-opc.c:822
 msgid "invalid conditional option"
-msgstr "tùy chọn thuộc điều kiện không hợp lệ"
+msgstr "tùy chọn điều kiện không hợp lệ"
 
 #: ppc-opc.c:824
 msgid "attempt to set y bit when using + or - modifier"
-msgstr "cố lập «bit y» khi sử dụng điều sửa đổi + hay -"
+msgstr "cố lập « bit y » khi sử dụng điều sửa đổi + hay -"
 
 #: ppc-opc.c:852
 msgid "offset not a multiple of 16"
@@ -663,15 +665,15 @@ msgstr "không cho phép mặt nặ bit"
 
 #: ppc-opc.c:1205
 msgid "value out of range"
-msgstr "giá trị cành ở ngoại phạm vị"
+msgstr "giá trị ở ngoại phạm vị"
 
 #: ppc-opc.c:1273
 msgid "index register in load range"
-msgstr "thanh ghi cơ số trong phạm vị nạp"
+msgstr "thanh ghi cơ số trong phạm vị tải"
 
 #: ppc-opc.c:1289
 msgid "source and target register operands must be different"
-msgstr "tác tử thanh ghi cả hai loại nguồn và đích đều phải là khác nhau"
+msgstr "tác tử thanh ghi kiểu cả nguồn lẫn đích đều phải là khác nhau"
 
 #: ppc-opc.c:1304
 msgid "invalid register operand when updating"
@@ -688,27 +690,27 @@ msgstr "tác tử thanh ghi nguồn phải là số chẵn"
 #. Mark as non-valid instruction.
 #: sparc-dis.c:760
 msgid "unknown"
-msgstr "không biết"
+msgstr "không rõ"
 
 #: sparc-dis.c:835
 #, c-format
 msgid "Internal error:  bad sparc-opcode.h: \"%s\", %#.8lx, %#.8lx\n"
-msgstr "Lá»—i ná»™i bá»™: sparc-opcode.h sai: \"%s\", %#.8lx, %#.8lx\n"
+msgstr "Lỗi nội bộ : sparc-opcode.h sai: « %s », %#.8lx, %#.8lx\n"
 
 #: sparc-dis.c:846
 #, c-format
 msgid "Internal error: bad sparc-opcode.h: \"%s\", %#.8lx, %#.8lx\n"
-msgstr "Lá»—i ná»™i bá»™: sparc-opcode.h sai: \"%s\", %#.8lx, %#.8lx\n"
+msgstr "Lỗi nội bộ : sparc-opcode.h sai: « %s », %#.8lx, %#.8lx\n"
 
 #: sparc-dis.c:895
 #, c-format
 msgid "Internal error: bad sparc-opcode.h: \"%s\" == \"%s\"\n"
-msgstr "Lá»—i ná»™i bá»™: sparc-opcode.h sai: \"%s\" == \"%s\"\n"
+msgstr "Lỗi nội bộ : sparc-opcode.h sai: « %s » == \"%s\"\n"
 
 #: v850-dis.c:225
 #, c-format
 msgid "unknown operand shift: %x\n"
-msgstr "không biết phím shift (bên trái hay bên phải) của tác tử: %x\n"
+msgstr "không biết cách dịch tác tử: %x\n"
 
 #: v850-dis.c:237
 #, c-format
@@ -722,7 +724,7 @@ msgstr "không biết thanh ghi trong câu lệnh pop đống: %d\n"
 #. specific command line option is given to GAS.
 #: v850-opc.c:69
 msgid "displacement value is not in range and is not aligned"
-msgstr "giá trị di chuyển ở ngoại phạm vị và chưa canh lề nó"
+msgstr "giá trị di chuyển ở ngoại phạm vị và chưa được canh lề"
 
 #: v850-opc.c:70
 msgid "displacement value is out of range"
@@ -738,7 +740,7 @@ msgstr "giá trị trực tiếp ở ngoại phạm vị"
 
 #: v850-opc.c:84
 msgid "branch value not in range and to odd offset"
-msgstr "giá trị cành ở ngoại phạm vị và với hiệu số lẻ"
+msgstr "giá trị cành ở ngoại phạm vị và đối với hiệu số lẻ"
 
 #: v850-opc.c:86 v850-opc.c:118
 msgid "branch value out of range"
@@ -746,11 +748,11 @@ msgstr "giá trị cành ở ngoại phạm vị"
 
 #: v850-opc.c:89 v850-opc.c:121
 msgid "branch to odd offset"
-msgstr "nhánh với hiệu số lẻ"
+msgstr "nhánh đối với hiệu số lẻ"
 
 #: v850-opc.c:116
 msgid "branch value not in range and to an odd offset"
-msgstr "giá trị nhánh ở ngoại phạm vị và với hiệu số lẻ"
+msgstr "giá trị nhánh ở ngoại phạm vị và đối với hiệu số lẻ"
 
 #: v850-opc.c:347
 msgid "invalid register for stack adjustment"
@@ -766,11 +768,11 @@ msgstr "giá trị trực tiếp phải là số chẵn"
 
 #: xstormy16-asm.c:76
 msgid "Bad register in preincrement"
-msgstr "Thanh ghi sai trong điều trước lượng gia"
+msgstr "Thanh ghi sai trong tiền lượng gia"
 
 #: xstormy16-asm.c:81
 msgid "Bad register in postincrement"
-msgstr "Thanh ghi sai trong điều sau lượng gia"
+msgstr "Thanh ghi sai trong hậu lượng gia"
 
 #: xstormy16-asm.c:83
 msgid "Bad register name"
@@ -782,7 +784,7 @@ msgstr "Nhãn xung đột với tên thanh ghi"
 
 #: xstormy16-asm.c:91
 msgid "Label conflicts with `Rx'"
-msgstr "Nhãn xung đột với `Rx'"
+msgstr "Nhãn xung đột với « Rx »"
 
 #: xstormy16-asm.c:93
 msgid "Bad immediate expression"
@@ -802,4 +804,4 @@ msgstr "Tác tử không phải là một ký hiệu"
 
 #: xstormy16-asm.c:172
 msgid "Syntax error: No trailing ')'"
-msgstr "Lỗi cú pháp: không có ')' đi theo"
+msgstr "Lỗi cú pháp: không có dấu ngoặc đóng « ) » đi theo"
-- 
GitLab