summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorniklas <niklas@openbsd.org>1996-06-09 19:35:13 +0000
committerniklas <niklas@openbsd.org>1996-06-09 19:35:13 +0000
commit191aa56503508614b4308d555aa5d4ae85ef3df7 (patch)
tree43b15e150721ff924c753fa1c643a1de1407d0c4
parentDon't want DDB (diff)
downloadwireguard-openbsd-191aa56503508614b4308d555aa5d4ae85ef3df7.tar.xz
wireguard-openbsd-191aa56503508614b4308d555aa5d4ae85ef3df7.zip
Import of binutils, gas, ld & gprof from Cygnus 960609 tree
-rw-r--r--gnu/usr.bin/binutils/ChangeLog16
-rw-r--r--gnu/usr.bin/binutils/bfd/ChangeLog2
-rw-r--r--gnu/usr.bin/binutils/bfd/aoutx.h1
-rw-r--r--gnu/usr.bin/binutils/binutils/README4
-rw-r--r--gnu/usr.bin/binutils/gas/ChangeLog1339
-rw-r--r--gnu/usr.bin/binutils/gas/ChangeLog.118
-rw-r--r--gnu/usr.bin/binutils/gas/NEWS10
-rw-r--r--gnu/usr.bin/binutils/gas/acconfig.h5
-rw-r--r--gnu/usr.bin/binutils/gas/aclocal.m437
-rw-r--r--gnu/usr.bin/binutils/gas/app.c139
-rw-r--r--gnu/usr.bin/binutils/gas/as.c77
-rw-r--r--gnu/usr.bin/binutils/gas/as.h27
-rw-r--r--gnu/usr.bin/binutils/gas/atof-generic.c7
-rw-r--r--gnu/usr.bin/binutils/gas/cond.c8
-rw-r--r--gnu/usr.bin/binutils/gas/conf.in5
-rw-r--r--gnu/usr.bin/binutils/gas/config/alpha-opcode.h8
-rw-r--r--gnu/usr.bin/binutils/gas/config/atof-ieee.c149
-rw-r--r--gnu/usr.bin/binutils/gas/config/m68k-parse.h18
-rw-r--r--gnu/usr.bin/binutils/gas/config/m68k-parse.y76
-rw-r--r--gnu/usr.bin/binutils/gas/config/obj-aout.c20
-rw-r--r--gnu/usr.bin/binutils/gas/config/obj-aout.h18
-rw-r--r--gnu/usr.bin/binutils/gas/config/obj-bout.c20
-rw-r--r--gnu/usr.bin/binutils/gas/config/obj-bout.h19
-rw-r--r--gnu/usr.bin/binutils/gas/config/obj-coff.c393
-rw-r--r--gnu/usr.bin/binutils/gas/config/obj-coff.h20
-rw-r--r--gnu/usr.bin/binutils/gas/config/obj-elf.c94
-rw-r--r--gnu/usr.bin/binutils/gas/config/obj-elf.h2
-rw-r--r--gnu/usr.bin/binutils/gas/config/obj-multi.h3
-rw-r--r--gnu/usr.bin/binutils/gas/config/ppc-sol.mt1
-rw-r--r--gnu/usr.bin/binutils/gas/config/sco5.mt1
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-a29k.c68
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-a29k.h3
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-alpha.c18
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-arm.c27
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-arm.h4
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-h8300.c77
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-hppa.c90
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-i386.c145
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-i960.c139
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-i960.h4
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-m68k.c442
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-m88k.c8
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-m88k.h8
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-mips.c1040
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-mips.h7
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-ppc.c419
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-ppc.h28
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-sh.c237
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-sh.h25
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-sparc.c523
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-z8k.c4
-rw-r--r--gnu/usr.bin/binutils/gas/config/te-aux.h17
-rw-r--r--gnu/usr.bin/binutils/gas/config/te-delt88.h13
-rw-r--r--gnu/usr.bin/binutils/gas/config/te-linux.h2
-rw-r--r--gnu/usr.bin/binutils/gas/config/te-pe.h4
-rw-r--r--gnu/usr.bin/binutils/gas/config/te-psos.h22
-rw-r--r--gnu/usr.bin/binutils/gas/config/vms-conf.h3
-rw-r--r--gnu/usr.bin/binutils/gas/doc/Makefile.in4
-rw-r--r--gnu/usr.bin/binutils/gas/doc/as.16
-rw-r--r--gnu/usr.bin/binutils/gas/doc/as.texinfo111
-rw-r--r--gnu/usr.bin/binutils/gas/doc/c-i960.texi2
-rw-r--r--gnu/usr.bin/binutils/gas/doc/c-m68k.texi28
-rw-r--r--gnu/usr.bin/binutils/gas/doc/c-sparc.texi37
-rw-r--r--gnu/usr.bin/binutils/gas/doc/internals.texi40
-rw-r--r--gnu/usr.bin/binutils/gas/ecoff.c158
-rw-r--r--gnu/usr.bin/binutils/gas/expr.c67
-rw-r--r--gnu/usr.bin/binutils/gas/expr.h13
-rw-r--r--gnu/usr.bin/binutils/gas/flonum-konst.c86
-rw-r--r--gnu/usr.bin/binutils/gas/frags.c19
-rw-r--r--gnu/usr.bin/binutils/gas/gasp.c29
-rw-r--r--gnu/usr.bin/binutils/gas/gdbinit.in1
-rw-r--r--gnu/usr.bin/binutils/gas/hash.c266
-rw-r--r--gnu/usr.bin/binutils/gas/hash.h31
-rw-r--r--gnu/usr.bin/binutils/gas/input-scrub.c2
-rw-r--r--gnu/usr.bin/binutils/gas/mac-as.r6
-rw-r--r--gnu/usr.bin/binutils/gas/messages.c10
-rw-r--r--gnu/usr.bin/binutils/gas/mpw-config.in15
-rw-r--r--gnu/usr.bin/binutils/gas/mpw-make.sed25
-rw-r--r--gnu/usr.bin/binutils/gas/output-file.c4
-rw-r--r--gnu/usr.bin/binutils/gas/read.c453
-rw-r--r--gnu/usr.bin/binutils/gas/read.h14
-rw-r--r--gnu/usr.bin/binutils/gas/stabs.c72
-rw-r--r--gnu/usr.bin/binutils/gas/subsegs.c82
-rw-r--r--gnu/usr.bin/binutils/gas/subsegs.h11
-rw-r--r--gnu/usr.bin/binutils/gas/symbols.c73
-rw-r--r--gnu/usr.bin/binutils/gas/symbols.h1
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/ChangeLog137
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/all/gas.exp4
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsub.s16
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsubh.s25
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1.s18
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1h.s19
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2.s15
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2h.s16
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3.s15
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3h.s16
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4.s18
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4h.s19
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branches.s10
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branchesh.s12
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranch.s23
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranchh.s43
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compare.s6
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compareh.s10
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimal.s5
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimalh.s6
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmul.s5
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmulh.s12
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/extendh.s8
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/h8300.exp1312
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdec.s5
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdech.s14
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logical.s14
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logicalh.s31
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misc.s13
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misch.s27
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/mov32bug.s4
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movb.s15
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movbh.s20
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movlh.s18
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movw.s13
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movwh.s18
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpop.s5
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpoph.s8
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshift.s11
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshifth.s27
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/hppa/unsorted/unsorted.exp6
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/m68k/all.exp2
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/m68k/link.d1
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/m68k/link.s1
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/m68k/op68000.d6
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/add.d8
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/and.d28
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/beq.d8
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/bge.d8
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/bgeu.d8
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/blt.d8
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/bltu.d8
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/div.d24
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/jal-svr4pic.d2
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/jal-xgot.d42
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-empic.d18
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-svr4pic.d100
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-xgot.d618
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/la.d569
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-empic.d12
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-svr4pic.d12
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-xgot.d242
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb.d600
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-empic.d12
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-svr4pic.d12
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-xgot.d273
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld.d1005
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/li.d8
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-empic.d4
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-svr4pic.d4
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-xgot.d28
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/lifloat.d4
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/mul.d8
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/sb.d587
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/trunc.d8
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/uld.d410
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh-svr4pic.d89
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh-xgot.d154
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh.d550
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulw.d410
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/usd.d410
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/ush.d670
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mips/usw.d410
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mri/constants.d1
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mri/constants.s17
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mri/immconst.d22
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/mri/mri.exp1
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/asi.d1
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/membar.d1
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mism-1.s22
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mismatch.exp20
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/prefetch.d1
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/rdpr.d1
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/sparc.exp23
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.d169
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.s211
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.d11
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.s7
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth64.d1
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/gas/sparc/wrpr.d1
-rw-r--r--gnu/usr.bin/binutils/gas/testsuite/lib/gas-dg.exp2
-rw-r--r--gnu/usr.bin/binutils/gas/write.c50
-rw-r--r--gnu/usr.bin/binutils/gas/write.h4
-rw-r--r--gnu/usr.bin/binutils/gprof/ChangeLog131
-rw-r--r--gnu/usr.bin/binutils/gprof/Makefile.in10
-rw-r--r--gnu/usr.bin/binutils/gprof/__bb_exit_func.c4
-rw-r--r--gnu/usr.bin/binutils/gprof/alpha.h5
-rw-r--r--gnu/usr.bin/binutils/gprof/cg_arcs.c36
-rw-r--r--gnu/usr.bin/binutils/gprof/cg_arcs.h3
-rw-r--r--gnu/usr.bin/binutils/gprof/cg_print.c616
-rw-r--r--gnu/usr.bin/binutils/gprof/cg_print.h2
-rw-r--r--gnu/usr.bin/binutils/gprof/configure299
-rw-r--r--gnu/usr.bin/binutils/gprof/configure.in69
-rw-r--r--gnu/usr.bin/binutils/gprof/core.c214
-rw-r--r--gnu/usr.bin/binutils/gprof/gmon.h7
-rw-r--r--gnu/usr.bin/binutils/gprof/gmon_io.c24
-rw-r--r--gnu/usr.bin/binutils/gprof/gprof.c46
-rw-r--r--gnu/usr.bin/binutils/gprof/gprof.h5
-rw-r--r--gnu/usr.bin/binutils/gprof/gprof.texi46
-rw-r--r--gnu/usr.bin/binutils/gprof/hist.c11
-rw-r--r--gnu/usr.bin/binutils/gprof/symtab.c8
-rw-r--r--gnu/usr.bin/binutils/gprof/symtab.h7
-rw-r--r--gnu/usr.bin/binutils/gprof/vax.c1
-rw-r--r--gnu/usr.bin/binutils/ld/ChangeLog935
-rw-r--r--gnu/usr.bin/binutils/ld/Makefile.in520
-rw-r--r--gnu/usr.bin/binutils/ld/NEWS15
-rw-r--r--gnu/usr.bin/binutils/ld/TODO2
-rw-r--r--gnu/usr.bin/binutils/ld/acconfig.h6
-rw-r--r--gnu/usr.bin/binutils/ld/config.in6
-rw-r--r--gnu/usr.bin/binutils/ld/configure462
-rw-r--r--gnu/usr.bin/binutils/ld/configure.in118
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32b4300.sh5
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32bmip.sh10
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32l4300.sh5
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32lmip.sh10
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32lppc.sh4
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh4
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh4
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m68kaux.sh8
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m68klinux.sh7
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m68kpsos.sh6
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/mipsidt.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/mipsidtl.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/ppcmacos.sh4
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/sparcaout.sh6
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/z8002.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emultempl/aix.em67
-rw-r--r--gnu/usr.bin/binutils/ld/emultempl/elf32.em199
-rw-r--r--gnu/usr.bin/binutils/ld/emultempl/generic.em2
-rw-r--r--gnu/usr.bin/binutils/ld/emultempl/linux.em4
-rw-r--r--gnu/usr.bin/binutils/ld/emultempl/lnk960.em4
-rw-r--r--gnu/usr.bin/binutils/ld/emultempl/pe.em291
-rw-r--r--gnu/usr.bin/binutils/ld/emultempl/sunos.em53
-rw-r--r--gnu/usr.bin/binutils/ld/genscripts.sh22
-rw-r--r--gnu/usr.bin/binutils/ld/ld.165
-rw-r--r--gnu/usr.bin/binutils/ld/ld.h17
-rw-r--r--gnu/usr.bin/binutils/ld/ld.texinfo1073
-rw-r--r--gnu/usr.bin/binutils/ld/ldcref.c326
-rw-r--r--gnu/usr.bin/binutils/ld/ldctor.c32
-rw-r--r--gnu/usr.bin/binutils/ld/ldemul.c11
-rw-r--r--gnu/usr.bin/binutils/ld/ldemul.h9
-rw-r--r--gnu/usr.bin/binutils/ld/ldexp.c59
-rw-r--r--gnu/usr.bin/binutils/ld/ldgram.y126
-rw-r--r--gnu/usr.bin/binutils/ld/ldlang.c1220
-rw-r--r--gnu/usr.bin/binutils/ld/ldlang.h37
-rw-r--r--gnu/usr.bin/binutils/ld/ldlex.l1
-rw-r--r--gnu/usr.bin/binutils/ld/ldmain.c207
-rw-r--r--gnu/usr.bin/binutils/ld/ldmain.h1
-rw-r--r--gnu/usr.bin/binutils/ld/ldmisc.c698
-rw-r--r--gnu/usr.bin/binutils/ld/ldmisc.h16
-rw-r--r--gnu/usr.bin/binutils/ld/ldver.c64
-rw-r--r--gnu/usr.bin/binutils/ld/ldver.h7
-rw-r--r--gnu/usr.bin/binutils/ld/ldwrite.c207
-rw-r--r--gnu/usr.bin/binutils/ld/lexsup.c460
-rw-r--r--gnu/usr.bin/binutils/ld/mac-ld.r28
-rw-r--r--gnu/usr.bin/binutils/ld/mpw-config.in8
-rw-r--r--gnu/usr.bin/binutils/ld/mpw-eppcmac.c1224
-rw-r--r--gnu/usr.bin/binutils/ld/mpw-make.sed27
-rw-r--r--gnu/usr.bin/binutils/ld/mri.c13
-rw-r--r--gnu/usr.bin/binutils/ld/mri.h3
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/alpha.sc3
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/aout.sc1
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/elf.sc21
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/elfmips.sc175
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/elfppc.sc150
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/h8300.sc74
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/h8300h.sc73
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/i386msdos.sc4
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/m68kaux.sc46
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/m68kcoff.sc36
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/mips.sc7
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/pe.sc119
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/ppcpe.sc44
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/psos.sc61
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/sh.sc20
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ChangeLog83
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-bootstrap/bootstrap.exp24
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-empic/empic.exp24
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-sh/sh.exp2
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-shared/shared.exp54
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-srec/srec.exp41
-rw-r--r--gnu/usr.bin/binutils/ld/testsuite/ld-undefined/undefined.exp13
-rw-r--r--gnu/usr.bin/binutils/move-if-change17
290 files changed, 22058 insertions, 6848 deletions
diff --git a/gnu/usr.bin/binutils/ChangeLog b/gnu/usr.bin/binutils/ChangeLog
index 55a53065d96..5fdb7b0d8e0 100644
--- a/gnu/usr.bin/binutils/ChangeLog
+++ b/gnu/usr.bin/binutils/ChangeLog
@@ -1,3 +1,19 @@
+Fri Jun 7 18:16:52 1996 Harlan Stenn <harlan@pfcs.com>
+
+ * config.guess (i?86-ncr-sysv*): Emit minor release numbers.
+ Recognize the NCR 4850 machine and NCR Pentium-based platforms.
+
+Wed Jun 5 00:09:17 1996 Per Bothner <bothner@wombat.gnu.ai.mit.edu>
+
+ * config.guess: Combine mips-mips-riscos cases, and use cpp to
+ distinguish sysv/svr4/bsd variants.
+ Based on a patch from Harlan Stenn <harlan@pfcs.com>.
+
+Fri Jun 7 14:24:49 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * configure.in: Added copyright notice.
+ * move-if-change: Added copyright notice.
+
Thu Jun 6 16:27:05 1996 Michael Meissner <meissner@tiktok.cygnus.com>
* configure.in (powerpcle-*-solaris*): Until we get shared
diff --git a/gnu/usr.bin/binutils/bfd/ChangeLog b/gnu/usr.bin/binutils/bfd/ChangeLog
index 5653faa7c5f..d3b2b7de64e 100644
--- a/gnu/usr.bin/binutils/bfd/ChangeLog
+++ b/gnu/usr.bin/binutils/bfd/ChangeLog
@@ -3097,7 +3097,7 @@ Fri Oct 27 18:14:39 1995 Ian Lance Taylor <ian@cygnus.com>
Fri Oct 27 14:42:15 1995 Niklas Hallqvist <niklas@appli.se>
- * PORTING, aout-arm.c, aout-encap.c, aout-rce.c, aout-target.h,
+ * PORTING, aout-arm.c, aout-encap.c, aout-target.h,
aoutx.h, gen-aout.c, host-aout.c, hp300bsd.c, i386aout.c
i386bsd.c, i386dynix.c, i386linux.c, i386lynx.c, i386mach3.c,
i386netbsd.c, m68klynx.c, m88kmach3.c, mipsbsd.c, newsos3.c,
diff --git a/gnu/usr.bin/binutils/bfd/aoutx.h b/gnu/usr.bin/binutils/bfd/aoutx.h
index e0e647a9dff..4280505dc33 100644
--- a/gnu/usr.bin/binutils/bfd/aoutx.h
+++ b/gnu/usr.bin/binutils/bfd/aoutx.h
@@ -748,7 +748,6 @@ NAME(aout,machine_type) (arch, machine, unknown)
*unknown = false;
break;
-
default:
arch_flags = M_UNKNOWN;
}
diff --git a/gnu/usr.bin/binutils/binutils/README b/gnu/usr.bin/binutils/binutils/README
index fad44c749de..13eb283cdc6 100644
--- a/gnu/usr.bin/binutils/binutils/README
+++ b/gnu/usr.bin/binutils/binutils/README
@@ -130,5 +130,5 @@ for fixes, you should probably *not* be using this release.
We have little time to spend tracking down whatever random bugs you
may run into (except for configurations that Cygnus supports for
its customers). The general place to send bug reports or patches
-is to bug-gnu-utils@ai.mit.edu; you can also send them directly to
-raeburn@cygnus.com or ian@cygnus.com.
+is to bug-gnu-utils@prep.ai.mit.edu; you can also send them directly
+to raeburn@cygnus.com or ian@cygnus.com.
diff --git a/gnu/usr.bin/binutils/gas/ChangeLog b/gnu/usr.bin/binutils/gas/ChangeLog
index 468e6202549..33a29a41f90 100644
--- a/gnu/usr.bin/binutils/gas/ChangeLog
+++ b/gnu/usr.bin/binutils/gas/ChangeLog
@@ -1,11 +1,1344 @@
+Wed Jun 5 17:09:26 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * read.c (next_char_of_string): Warn if a newline is seen in the
+ middle of a string. Call bump_line_counters when appropriate.
+
+Wed Jun 5 17:08:36 1996 Richard Henderson <rth@tamu.edu>
+
+ * symbols.c (colon): Use LOCAL_LABEL.
+
+Tue Jun 4 10:55:16 1996 Tom Tromey <tromey@csk3.cygnus.com>
+
+ * Makefile.in (install): Don't check to see if tooldir exists.
+ Make $(tooldir) and $(tooldir)/bin.
+
+Tue Jun 4 10:14:53 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/ppc-sol.mt (TDEFINES): Don't turn on -mregnames by
+ default.
+
+Mon Jun 3 11:34:41 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c (mips_ip): Don't call as_warn if we are setting
+ insn_error. Don't put the string "ERROR" in insn_error. Set
+ insn_error rather than calling as_warn for an unsupported opcode.
+
+Sat Jun 1 21:51:55 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c (md_parse_option): Check for a 64 bit format
+ before permitting -64.
+ * output-file.c (output_file_create): Remove duplicate
+ bfd_perror.
+
+Fri May 31 01:08:06 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c (md_begin): If -64, create a .MIPS.options
+ section rather than a .reginfo section.
+ (mips_elf_final_processing): If -64, write out 64 bit RegInfo
+ information.
+
+ * config/tc-mips.c (load_register): If mips_isa < 3, permit a 32
+ bit value with the high bit set.
+
+Thu May 30 19:00:19 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * read.c (s_lcomm): Set section flags for .sbss section.
+
+ * config/tc-mips.c (mips_64): New static variable.
+ (mips_target_format): If mips_64, return elf64 targets rather than
+ elf32 ones.
+ (md_longopts): Add "32" and "64".
+ (md_parse_option): Handle -32 and -64.
+ (md_show_usage): Mention -32 and -64.
+ (cons_fix_new_mips): If mips_64, don't convert an 8 byte reloc to
+ a 4 byte one.
+
+Thu May 30 10:36:19 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/tc-ppc.c (comment_chars): Make '!' a comment character
+ for Solaris compatibility.
+
+ * stabs.c (s_stab_generic): Under PowerPC Solaris, convert a
+ .stabd with 4 arguments into a .stabn.
+
+Wed May 29 16:43:16 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c (macro): When passing X_add_number to
+ macro_build, cast it to int first.
+
+Tue May 28 13:29:39 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-z8k.c (md_apply_fix): Handle fx_r_type of 0, as
+ created by emit_expr.
+
+ * symbols.c (symbol_create): If bfd_make_empty_symbol fails, call
+ as_perror rather than assert.
+
+Fri May 24 18:24:11 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c (mips_ip): Mark sections created to hold
+ floating point information as read only.
+
+Fri May 24 12:07:54 1996 David Edelsohn <edelsohn@mhpcc.edu>
+
+ * config/tc-ppc.c (ppc_set_cpu): Change defaults to match AIX.
+
+Thu May 23 17:34:24 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * read.c (potable): Add .skip as a synonym for .space.
+
+ * stabs.c (s_stab_generic): For PowerPC ELF, allow .stabd to take
+ 4 arguments, providing the 4th argument is 0, to allow
+ compatibility with the Solaris assembler.
+
+Thu May 16 15:51:48 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-sh.h (struct sh_segment_info_type): Define.
+ (TC_SEGMENT_INFO_TYPE): Define.
+ (sh_frob_label): Declare.
+ (tc_frob_label): Define.
+ (sh_flush_pending_output): Declare.
+ (md_flush_pending_output): Define.
+ * config/tc-sh.c (md_assemble): If relaxing, emit a R_SH_CODE
+ reloc before the instruction if necessary.
+ (sh_frob_label): New function.
+ (sh_flush_pending_output): New function.
+ (sh_coff_frob_file): Ignore ALIGN, CODE, DATA, and LABEL relocs
+ when looking for the reloc for the target of .uses.
+ (md_convert_frag): Fix printf format (%0xlx to 0x%lx).
+ (sh_force_relocation): Force CODE, DATA, and LABEL relocs to be
+ emitted.
+ (md_apply_fix): Ignore CODE, DATA, and LABEL relocs.
+ (sh_coff_reloc_mangle): Force CODE, DATA, and LABEL relocs to use
+ the absolute symbol.
+
+ * subsegs.h (segment_info_type): Add tc_segment_info_data field if
+ TC_SEGMENT_INFO_TYPE is defined.
+
+Wed May 15 12:23:53 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-i386.c (md_assemble): Make sure the opcode suffix
+ matches the register size.
+
+Wed May 15 08:33:37 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/obj-coff.c (count_entries_in_chain): Ignore Fixups with
+ fx_done set.
+ (do_relocs_for): Likewise.
+ (fixup_segment): Don't just quit if linkrelax is set. Try to
+ apply non pc-relative sym1-sym2 fixups, even if linkrelax is
+ nonzero.
+
+Fri May 10 14:16:59 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/tc-ppc.c (ppc_elf_validate_fix): Allow GOT and section
+ relative relocations with -mrelocatable. Also allow unfixed
+ relocs in .ex_shared.
+
+Tue May 7 11:24:10 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-coff.c (yank_symbols): Check that FNAME_OFFSET is
+ non-zero before assuming this is a long file name.
+ (w_strings): Likewise.
+ (c_dot_file_symbol): Set FNAME_OFFSET to 1 for a long file name.
+
+ * config/obj-coff.c (w_strings): Move declaration of i inside
+ #ifdef block which uses it.
+
+Tue May 7 00:49:58 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-h8300.c (do_a_fix_imm): Rename last argument to
+ "relaxmode". Output relocs which identify various relaxing
+ possibilities for mov.[bwl] instructions.
+ (build_bytes): Pass in a relaxing mode to do_a_fix_imm.
+
+Mon May 6 15:26:28 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * config/tc-arm.h (TC_HANDLES_FX_DONE): Define.
+ (MD_APPLY_FIX3): Define.
+ * config/tc-arm.c (my_get_expression): Only watch for bad segments
+ if OBJ_AOUT.
+ (md_apply_fix3): Renamed from md_apply_fix.
+ If pcrel reloc and symbol is in different section, undo effects
+ of md_pcrel_from.
+
+Sat May 4 12:49:35 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-hppa.c (hppa_fix_adjustable): Don't adjust
+ any reloc with an LR% or RR% field selector for SOM.
+
+Sat May 4 11:26:19 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in: Add subsegs.h to appropriate TARG_CPU_DEP_*
+ variables.
+
+Fri May 3 17:58:31 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-coff.c (coff_frob_symbol): Don't merge a symbol with
+ SF_GET_STATICS set.
+ (yank_symbols): Likewise.
+
+Wed May 1 13:38:17 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * subsegs.h (segment_info_type): If MANY_SEGMENTS and not
+ BFD_ASSEMBLER, add name field.
+ * config/obj-coff.c: Include "libiberty.h".
+ (coff_header_append): Handle long section names.
+ (crawl_symbols): Just use the name field for the symbol name,
+ without worrying about null byte termination.
+ (w_strings): Handle long section names.
+ (write_object_file): Likewise. Also, use the name field, rather
+ than scnhdr.s_name.
+ (obj_coff_add_segment): Permit long section names.
+ (obj_coff_init_stab_section): Use the name field, rather than
+ scnhdr.s_name.
+ (adjust_stab_section): Likewise.
+ * config/te-pe.h (COFF_LONG_SECTION_NAMES): Define.
+
+ * config/tc-i960.c (brtab_emit): Don't set fx_im_disp field.
+ (mem_fmt): Likewise.
+ (md_apply_fix): Don't check fx_im_disp field.
+
+Thu Apr 25 11:39:51 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Add * after sparc*-*-vxworks.
+ * configure: Rebuild.
+
+ * app.c (do_scrub_begin): If tc_comment_chars is not defined,
+ define it to comment_chars. Use tc_comment_chars rather than
+ comment_chars.
+ (do_scrub_chars): Use tc_comment_chars rather than comment_chars.
+ * config/tc-m68k.h (tc_comment_chars): Define.
+ (m68k_comment_chars): Declare.
+ * config/tc-m68k.c (m68k_comment_chars): Rename from
+ comment_chars. Change into a pointer rather than an array.
+ (md_longopts): Add "bitwise-or".
+ (md_parse_option): Handle OPTION_BITWISE_OR.
+ (md_show_usage): Mention --bitwise-or.
+ * doc/c-m68k.texi: Document --bitwise-or.
+
+Wed Apr 24 11:28:38 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-m68k.c (m68k_ip): Prevent attempts to use long offsets
+ in 68000 mode.
+
+ * config/obj-coff.c (obj_coff_section): BFD_ASSEMBLER version:
+ call demand_empty_rest_of_line. Non BFD_ASSEMBLER version:
+ correct handling of input line pointer, and call
+ demand_empty_rest_of_line.
+
+Mon Apr 22 18:02:37 1996 Doug Evans <dje@blues.cygnus.com>
+
+ * config/tc-sparc.c (in_bitfield_range): New static function.
+ (sparc_ip): New cases X,Y. Use SPARC_OPCODE_ARCH_V9_P.
+ (md_apply_fix, cases BFD_RELOC_32_PCREL_S2,
+ BFD_RELOC_SPARC_{WDISP16,WDISP19}): Fix undefined code.
+ (md_apply_fix): New cases BFD_RELOC_SPARC_[56].
+ (tc_gen_reloc): New cases BFD_RELOC_SPARC_[56].
+
+Thu Apr 18 18:58:33 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-coff.c: BFD_ASSEMBLER:
+ (coff_last_bf): New static variable.
+ (coff_frob_symbol): Set endndx of a .bf symbol.
+ Non BFD_ASSEMBLER:
+ (obj_coff_endef): Call SF_SET_PROCESS on a .bf symbol.
+ (last_bfP): New static variable.
+ (yank_symbols): Set endndx of a .bf symbol.
+
+Thu Apr 18 11:53:58 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/tc-ppc.c (md_parse_option): Add support for Solaris's -le
+ and -s options. Add -be for good measure.
+
+Wed Apr 17 12:31:01 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * read.c (s_space): Support non-constant fill value. Handle fill
+ value correctly for a size other than 1.
+
+Tue Apr 16 15:17:40 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * config/tc-arm.c (my_get_float_expression): Update call to
+ gen_to_words, X_PRECISION changed from 6 to 5.
+
+Tue Apr 16 10:25:42 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/tc-ppc.c (register_name,reg_name_search): Move register
+ name lookup from PE specific code to all targets. Add support for
+ -mregnames/-mno-regnames to control whether register names are
+ expanded or not.
+ (md_assemble): Call register_name for all platforms.
+ (md_parse_option): Add support for -mregnames/-mno-regnames.
+
+ * configure.in (powerpcle*-*-solaris): Add support.
+ (powerpc*-*-linux): Ditto.
+ * configure: Regenerate.
+
+ * config/ppc-sol.mt: New config file for PowerPC Solaris.
+
+Mon Apr 15 12:26:33 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c (mips_frob_file): Permit multiple %hi relocs to
+ be associated with a single %lo reloc.
+
+ * config/tc-mips.c (load_address): Cast X_add_number to valueT
+ before comparing against MAX_GPREL_OFFSET, so that negative
+ numbers are handled correctly.
+ (macro): Likewise.
+
+Thu Apr 11 12:39:02 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-sparc.c (last_insn): New static variable.
+ (md_assemble): Warn about putting floating point branches in a
+ delay slot. If architecture is less than v9, insert NOP
+ instructions between floating point instructions and floating
+ point branches. (The SunOS assembler does both these operations.)
+ Save the last instruction opcode.
+ (sparc_ip): Add pinsn parameter. Change caller.
+
+ * config/tc-m68k.c (md_estimate_size_before_relax): Correct check
+ for byte jump to next instruction to skip empty frags.
+
+Wed Apr 10 16:48:12 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-alpha.c (alpha_ip): If we are going to call emit_add64
+ for addq with a 16 bit signed value, just emit a lda instruction
+ instead.
+
+Wed Apr 10 14:34:49 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-h8300.c (do_a_fix_imm): Don't cut off high bits
+ of a 32bit operand.
+
+Mon Apr 8 14:42:53 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Permit --enable-shared to specify a list of
+ directories.
+ * configure: Rebuild.
+
+Fri Apr 5 17:01:35 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-h8300.c (get_specific): Remove some #if 0 code.
+ (build_bytes): Remove all ABSMOV related code; it's unnecessary.
+
+Fri Apr 5 15:13:10 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * config/atof-ieee.c: Fix handling of denormalized extended
+ precision numbers and overflow/underflow detection.
+ (MAX_PRECISION, X_PRECISION, P_PRECISION): Changed from 6 to 5, to
+ not include the 16 bit gap in the m68k extended precision format.
+
+Fri Apr 5 14:29:23 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Add i386-*-freebsdelf* target; from John Polstra
+ <jdp@polstra.com>.
+ * configure: Rebuild.
+
+Fri Apr 5 18:39:28 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * config/tc-mips.c: Allow non-zero offsets from .sdata symbols to
+ be accessed using the $gp register.
+ * config/tc-mips.h (MAX_GPREL_OFFSET): Added.
+
+Wed Apr 3 10:56:14 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * config/tc-sparc.c (sparc_md_end): Set bfd machine number to
+ bfd_mach_sparc_sparclet if current_architecture is sparclet.
+
+Mon Apr 1 16:55:44 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * read.c (get_line_sb): Bump line counters based on
+ input_line_pointer[-1], not *input_line_pointer. Don't bother to
+ call LISTING_NEWLINE.
+ (s_macro): Don't call demand_empty_rest_of_line.
+ * app.c (do_scrub_chars): When handling C style comments, unget
+ ch2 rather than ch.
+
+Fri Mar 29 16:15:06 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * read.h (enum linkonce_type): Define.
+ (s_linkonce): Declare.
+ * read.c (potable): Add "linkonce".
+ (s_linkonce): New function.
+ * subsegs.h (segment_info_type): Add linkonce field to
+ MANY_SEGMENTS && ! BFD_ASSEMBLER section.
+ * config/obj-coff.h (obj_handle_link_once): Define if TE_PE.
+ (obj_coff_pe_handle_link_once): Declare if TE_PE.
+ * config/obj-coff.c: If TE_PE and not BFD_ASSEMBLER, #include
+ "coff/pe.h".
+ (obj_coff_pe_handle_link_once): New function, defined if TE_PE.
+ (c_section_symbol): If TE_PE, set the x_comdat field in the aux
+ entry based on the linkonce field in segment_info.
+ * doc/as.texinfo: Document .linkonce.
+
+Fri Mar 29 11:31:27 1996 J.T. Conklin (jtc@lisa.cygnus.com)
+
+ * doc/as.1: Changed to be recognized by catman -w on Solaris.
+
+Thu Mar 28 15:27:47 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * stabs.c (s_stab_generic): Call the listing functions before
+ doing the rest of the processing, which may involve freeing the
+ string. Pass string, not string + stroff, to OBJ_PROCESS_STAB in
+ SEPARATE_STAB_SECTIONS case.
+
+ * config/tc-hppa.c: Remove nested comment.
+ (tc_gen_reloc): Move label done inside the ifdef in which it is
+ used.
+ (md_apply_fix): Pass pointers to correct types to libhppa.h
+ functions. Always return a value.
+
+ * config/tc-mips.h (tc_frob_file): Define.
+ (mips_frob_file): Declare.
+ * config/tc-mips.c (struct mips_hi_fixup): Define.
+ (mips_hi_fixup_list): New static variable.
+ (imm_unmatched_hi): New static variable.
+ (md_assemble): Clear imm_reloc, imm_unmatched_hi, and
+ offset_reloc. Pass imm_unmatched_hi to append_insn.
+ (append_insn): Add unmatched_hi parameter. If it is set, add the
+ new fixup to mips_hi_fixup_list. Change all callers.
+ (mips_ip): Set imm_unmatched_hi when appropriate.
+ (mips_frob_file): New function.
+
+Thu Mar 28 11:47:59 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * configure.in (sparc-*-solaris2*): Renamed from sparc*-*-solaris2*.
+ * configure: Regenerated.
+
+Tue Mar 26 18:19:12 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * as.c (main): Call bfd_set_error_program_name.
+
+Fri Mar 22 11:13:00 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * as.h (strdup): Don't declare.
+ * stabs.c: Include libiberty.h
+ (get_stab_string_offset): Use xstrdup rather than strdup.
+ (s_stab_generic): Likewise.
+ * as.c (parse_args): Likewise.
+ * read.c (s_mri_sect): Likewise.
+
+ * gasp.c (change_base): Recognize \(...) construct documented to
+ pass through enclosed characters literally through to the output.
+ (process_assigns): Likewise. Also, be more careful to avoid
+ looking past the end of the buffer.
+
+Thu Mar 21 13:18:43 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-i386.c (md_parse_option): If OBJ_ELF, ignore -k for
+ FreeBSD compatibility. From John Polstra <jdp@polstra.com>.
+
+Wed Mar 20 18:13:32 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * doc/as.texinfo, doc/c-i960.texi: Fix typos.
+
+Wed Mar 20 17:05:16 1996 David Mosberger-Tang <davidm@azstarnet.com>
+
+ * config/alpha-opcode.h: Added cvtst instruction.
+
+Mon Mar 18 13:12:46 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ecoff.c (ecoff_stab): Don't try to make a symbol out of the stab
+ string. Extract the addend from the result of expression.
+
+Fri Mar 15 17:10:43 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * app.c (do_scrub_chars): If whitespace is seen in state 11, and
+ LABELS_WITHOUT_COLONS is not defined, and we are not in m68k MRI
+ mode, change the state to 3 rather than 1.
+
+Thu Mar 14 18:18:25 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-coff.h (C_REGISTER_SECTION): Change from 20 to 50, to
+ correspond to 11 March change.
+
+Thu Mar 14 15:27:10 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-h8300.c (build_bytes, MEMIND case): Generate
+ an R_MEM_INDIRECT reloc rather than R_RELBYTE.
+
+Tue Mar 12 12:21:10 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Rebuild with autoconf 2.8.
+
+Mon Mar 11 18:57:12 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/atof-ieee.c (gen_to_words): Improve handling of
+ X_PRECISION numbers. Based on patches from Andreas Schwab
+ <schwab@issan.informatik.uni-dortmund.de>.
+
+Mon Mar 11 09:59:53 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * as.h (SEG_NORMAL, SEG_LIST): Bump segment limit from 10 to 40.
+ (SEG_LAST): New.
+ * subsegs.c (MANY_SEGMENTS): Increase segment limit.
+ * obj-coff.c (seg_N_TYPE, seg_info_off_by_4): Likewise.
+ (do_relocs_for, w_symbols, obj_coff_add_segment, do_linenos_for,
+ crawl_symbols, coff_header_append): Loop to SEG_LAST rather than
+ SEG_E9.
+
+Thu Mar 7 15:17:39 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * config/tc-sparc.c (sparc_ip): Handle operand char 'O' (neg reg).
+
+Thu Mar 7 09:19:15 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-hppa.c (SUBSEG_MILLI): Define.
+ (pa_def_subspaces): Add $MILLICODE$.
+ (pa_spaces_begin): Set section flags for $MILLICODE$.
+
+Wed Mar 6 14:11:30 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-elf.c (obj_elf_section): Only SEC_LOAD if the type is
+ not SHT_NOBITS. Don't tamper with flags based on type if a
+ special section was found (revert Feb 29 change).
+
+ * config/tc-sh.c (sh_do_align): Only align using the nop pattern
+ if aligning to a longword boundary or greater.
+
+Tue Mar 5 15:10:43 1996 Jim Wilson <wilson@chestnut.cygnus.com>
+
+ * config/tc-sh.c (sh_do_align): Pass 1 not 2 to frag_align.
+
+Mon Mar 4 20:50:57 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * configure.in (i386-*-cygwin32): Don't use bfd_gas.
+ * configure: Regenerated.
+
+Mon Mar 4 10:13:06 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-hppa.c: Add default definitions for R_N0SEL and
+ R_N1SEL since they're not defined for old versions of hpux.
+
+ * config/tc-hppa.c (tc_gen_reloc): Fix typo in R_COMP2 code.
+ Set "sym_ptr_ptr" and "addend" fields to dummy values for
+ R_N0SEL and R_N1SEL.
+
+Fri Mar 1 10:20:52 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * flonum-konst.c: Add two more constants for 1e+-2048 and
+ 1e+-4096, and correct the other constants.
+
+ * symbols.c (resolve_symbol_value): Handle O_logical_not.
+
+Thu Feb 29 13:58:35 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/obj-elf.c (obj_elf_section): Allow predefined section
+ types to set the nobits type. Avoid a shadowed declaration.
+
+Wed Feb 28 15:38:56 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-hppa.c (hppa_fix_adjustable): For SOM, don't
+ reduce relocs using e_nlrsel field selectors.
+
+ * write.c (fix_new_exp): Don't use #elif. Some compilers
+ don't handle it.
+
+ * config/tc-hppa.c (selector_table): Add "n", "nl", and "nlr" to
+ the selector table.
+ (pa_chk_field_selector): Handle new field selectors for SOM.
+
+Tue Feb 27 14:42:27 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * configure.in (m68k-*-linux*aout*, m68k-*-linux*): New targets.
+ * configure: Rebuild.
+ * config/te-linux.h (LOCAL_LABELS_FB): Define.
+ * config/tc-m68k.h (TARGET_FORMAT) [TE_LINUX]: Define to
+ "a.out-m68k-linux".
+ * config/tc-m68k.c (comment_chars): Don't include '#' if TE_LINUX
+ is defined.
+
+Mon Feb 26 18:58:58 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-make.sed: Update to handle shared library support.
+
+Mon Feb 26 10:34:10 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * config/tc-sparc.c (sparc_ip): Print all architectures that support
+ the insn on mismatch.
+
+Fri Feb 23 21:44:39 1996 Rob Savoye <rob@chinadoll.cygnus.com>
+
+ * configure.in: Add support for a29-coff.
+ * configure: Rebuild.
+
+Thu Feb 22 16:39:43 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-sh.c (sh_coff_frob_file): Don't consider the address
+ of the section when looking for the R_SH_USES fixup, because the
+ frag addresses have not yet been adjusted.
+
+ * gdbinit.in: Set a breakpoint on as_warn_where.
+
+ * config/tc-mips.c (macro): Add missing arguments to macro_build
+ omitted in last change. From Jim Wilson <wilson@cygnus.com>.
+
+Wed Feb 21 17:00:32 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-h8300.c (tc_reloc_mangle): Change reloc based on size
+ if it is TC_CONS_RELOC. Set a size of 4 to R_RELLONG.
+
+Wed Feb 21 09:25:39 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * config/tc-sparc.c (sparc_ip): Recognize %asr0 for v8.
+
+Tue Feb 20 21:48:03 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * config/tc-sparc.c (parse_keyword_arg): Accept leading '%'.
+ (sparc_ip): Accept %asr[1..31] for v8 and %asr[%16..31] for v9.
+ Recognize [uU] format args as sparclet cpregs.
+
+Tue Feb 20 22:25:55 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-sh.c (sh_handle_align): Don't emit R_SH_ALIGN relocs
+ in bss_section.
+
+Mon Feb 19 14:16:24 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-sparc.h (TC_RELOC_RTSYM_LOC_FIXUP): Check S_IS_WEAK as
+ well as S_IS_EXTERNAL.
+ (tc_fix_adjustable): Likewise.
+ * config/tc-sparc.c (md_apply_fix): In OBJ_ELF case, check for
+ S_IS_WEAK as well as S_IS_EXTERNAL when deciding whether to return
+ early.
+ (tc_gen_reloc): Check S_IS_WEAK as wel as S_IS_EXTERNAL when
+ deciding whether to convert BFD_RELOC_32_PCREL_S2 if PIC.
+
+Mon Feb 19 02:15:57 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * config/tc-sparc.c (max_architecture): Change to sparclite for
+ 32 bit arch.
+ (default_compatible): Delete.
+ (sparc_ffs): New function.
+ (md_begin): Only call SPARC_OPCODE_CONFLICT_P once.
+ (sparc_ip): Rewrite architecture match and bump logic.
+
+Sun Feb 18 15:03:50 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Check for 'do not mix' from native linker before
+ trying to use -rpath.
+ * configure: Rebuild.
+
+Fri Feb 16 16:53:31 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-coff.h (SF_ADJ_LNNOPTR): Define (non BFD_ASSEMBLER).
+ (SF_GET_ADJ_LNNOPTR): Define (non BFD_ASSEMBLER).
+ (SF_SET_ADJ_LNNOPTR): Define (non BFD_ASSEMBLER).
+ * config/obj-coff.c (obj_coff_endef): Set ADJ_LNNOPTR when LNNOPTR
+ is set.
+ (w_symbols): If ADJ_LNNOPTR is set, add the section lnnoptr field
+ to the symbol lnnoptr field, to get the correct file offset.
+
+Thu Feb 15 14:48:38 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/obj-elf.c (elf_frob_symbol): On the PowerPC, force all
+ symbols that are not function, file, or section symbols to be
+ object types.
+
+Thu Feb 15 11:20:18 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Set and substitute RPATH_ENVVAR.
+ * configure: Rebuild.
+ * Makefile.in (RPATH_ENVVAR): New variable.
+ (check): Use $(RPATH_ENVVAR) rather than LD_LIBRARY_PATH.
+
+ * configure.in: Accept i686. From H.J. Lu <hjl@zoom.com>: i386
+ doesn't need opcodes. If configuring shared, opcodes needs bfd.
+ * configure: Rebuild.
+
+Wed Feb 14 16:33:12 1996 Martin Anantharaman <martin@mail.imech.uni-duisburg.de>
+
+ * read.c (s_mri_sect): Don't return '\0' in type. Set all
+ appropriate flags in BFD section.
+
+ * configure.in (m68k-*-psos*): New target.
+ * configure: Rebuild.
+ * config/te-psos.h: New file.
+ * config/tc-m68k.c (comment_chars): Don't include '#' if TE_PSOS
+ is defined.
+
+Wed Feb 14 13:43:24 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ From Alan Modra <alan@spri.levels.unisa.edu.au>:
+ * configure.in: Remove duplicate setting of cpu_type. Check
+ whether opcodes library is required for on all targets, not just
+ primary one.
+ * configure: Rebuild.
+
+ * config/tc-mips.c (mips_big_got): New static variable.
+ (s_extern): Don't declare.
+ (reg_needs_delay): New static function.
+ (macro_build): Permit GOT/CALL_HI/LO relocs.
+ (macro_build_lui): If place is not NULL, use the number in the
+ expression.
+ (load_address): Handle mips_big_got case.
+ (macro): Handle mips_big_got for M_LA_AB, M_JAL_A, and load and
+ store macros.
+ (OPTION_XGOT): Define.
+ (md_longopts): Add "xgot" if OBJ_ELF.
+ (md_parse_option): Handle -xgot.
+ (md_show_usage): Mention -xgot.
+ (md_apply_fix): Permit GOT/CALL_HI/LO relocs.
+ (tc_gen_reloc): Handle GOT/CALL_HI/LO relocs.
+
+Wed Feb 14 11:22:27 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * config/tc-m68k.c (m68k_ip) [operand kind '#']: When fixing
+ the byte relocation, point it to the low byte of the word.
+
+Tue Feb 13 15:31:18 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Set HDLFLAGS for *-*-hpux with --enable-shared.
+ * configure: Rebuild.
+
+Mon Feb 12 15:53:46 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * configure.in: Recognize any sparc* cpu.
+ * configure: Regenerated.
+
+Mon Feb 12 15:41:21 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * read.c (potable): Add "mri" and ".mri".
+ (s_mri): New function.
+ * read.h (s_mri): Declare.
+ * app.c (scrub_m68k_mri): New static variable.
+ (mri_pseudo): New static variable.
+ (do_scrub_begin): Add m68k_mri parameter. Use it rather than
+ flag_m68k_mri. Initialize scrub_m68k_mri.
+ (mri_state, mri_last_ch): New static variables.
+ (struct app_save): Add scrub_m68k_mri, mri_state, and mri_last_ch
+ fields.
+ (app_push): Save new fields.
+ (app_pop): Restore new fields.
+ (do_scrub_chars): Check scrub_m68k_mri rather than flag_mri_mri.
+ If TC_M68K, use a trivial state machine to look for occurrences of
+ the .mri pseudo-op, and change the mode appropriately.
+ * as.h (do_scrub_begin): Update prototype.
+ * input-scrub.c (input_scrub_begin): Pass flag_m68k_mri to
+ do_scrub_begin.
+ * config/tc-m68k.c (reg_prefix_optional_seen): New static
+ variable.
+ (m68k_mri_mode_change): New function.
+ (md_parse_option): Set reg_prefix_optional_seen.
+ * config/tc-m68k.h (m68k_mri_mode_change): Declare.
+ (MRI_MODE_CHANGE): Define.
+ * doc/as.texinfo: Document .mri pseudo-op.
+
+ * app.c (do_scrub_chars): In MRI mode, don't treat '#' as a
+ comment character.
+
+Mon Feb 12 15:16:29 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ Support for OBJ_ELF on m68k, mostly inside #ifdef OBJ_ELF:
+ * config/m68k-parse.h (enum pic_relocation): Define.
+ (struct m68k_exp): Add pic_reloc field.
+ * config/tc-m68k.h (TC_RELOC_RTSYM_LOC_FIXUP): Define.
+ (tc_fix_adjustable): Define to call tc_m68k_fix_adjustable.
+ (NO_RELOC): Define to BFD_RELOC_NONE if BFD_ASSEMBLER, to zero
+ otherwise.
+ * config/tc-m68k.c: Delete definition of NO_RELOC.
+ (struct m68k_it): Add pic_reloc field.
+ (add_fix): Copy over pic_reloc field.
+ (md_pseudo_table): Interpret .align parameter as byte count.
+ (mote_pseudo_table): Likewise.
+ (tc_m68k_fix_adjustable): New function.
+ (get_reloc_code): New function.
+ (md_assemble): Use it as last argument to fix_new_exp.
+ (md_apply_fix_2): For a relocation against a symbol don't put the
+ addend into the data.
+ (tc_gen_reloc): Different addend computation for OBJ_ELF.
+ (m68k_ip): Don't relax an operand that requires pic relocation.
+ (md_begin): Align .text, .data and .bss on 4 byte boundary by
+ default.
+ * write.c (fixup_segment): Don't add symbol value to addend if
+ TC_M68K and OBJ_ELF.
+ * config/m68k-parse.y (yylex): Handle @PLTPC, etc.
+ (motorola_operand): Add rule for `(zapc, EXPR)'.
+
+Mon Feb 12 10:07:33 1996 David Mosberger-Tang <davidm@azstarnet.com>
+
+ * ecoff.c (ecoff_directive_weakext): Fixed so that whitespace
+ *really* is permissible before the comma.
+
+Mon Feb 12 00:12:13 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-sh.c (sh_do_align): Align to a 2 byte boundary before
+ inserting nop instructions.
+
+Fri Feb 9 10:54:19 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/te-aux.h: Change include of aux.h to aux-coff.h.
+
+Thu Feb 8 20:02:58 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-i960.c (tc_coff_symbol_emit_hook): Correct storage
+ class setting for a CALLNAME symbol in COFF.
+
+ * read.c (potable): Pass negative numbers for new .balign[wl] and
+ .p2align[wl] pseudo-ops.
+ (s_align_bytes): Treat a negative argument as specifying the fill
+ length.
+ (s_align_ptwo): Likewise.
+
+Wed Feb 7 14:12:03 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * read.c (potable): Add balignw, balignl, p2alignw, and p2alignl.
+ (do_align): Take new len parameter. Change all callers. Pass it
+ to md_do_align.
+ (s_align_bytes): Arg now indicates the length of the fill pattern.
+ (s_align_ptwo): Likewise.
+ * config/obj-coff.c (write_object_file): Pass length to
+ md_do_align.
+ * config/tc-i386.h (md_do_align): Take new len parameter.
+ * config/tc-m88k.h (md_do_align): Likewise.
+ * config/tc-m88k.c (m88k_do_align): Likewise.
+ * config/tc-sh.h (md_do_align): Likewise.
+ * config/tc-sh.c (sh_do_align): Likewise.
+ * doc/as.texinfo: Document new pseudo-ops.
+
+ * config/obj-coff.c (fixup_mdeps): Divide offset by fr_var, as is
+ done in cvt_frag_to_fill.
+
+ * config/tc-sh.h (sh_do_align): Declare.
+ (md_do_align): Define.
+ * config/tc-sh.c (sh_do_align): New function.
+
+ * ecoff.c (ecoff_build_lineno): Don't try to store the address
+ difference if the next address is before the current one.
+
+ * config/tc-m68k.c (struct m68k_cpu): Add alias field.
+ (archs): Initialize new field.
+ (m68k_ip): Don't list alias names when listing CPUs which support
+ an instruction.
+
+ * as.c (main): Call parse_args before read_begin.
+ * app.c (do_scrub_chars): If flag_m68k_mri, don't put a dot in
+ front of generated pseudo-ops.
+ * read.c (potable): Ignore "name".
+ (s_app_file): Permit a single quote after the string, since one
+ may appear in m68k MRI mode.
+
+ * configure.in: Check for --enable-shared. If linking against
+ shared BFD and opcodes, fix library name on SunOS, and try to set
+ -rpath reasonably.
+ * configure: Rebuild.
+
+Tue Feb 6 15:16:17 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * as.h (flag_m68k_mri): Declare.
+ * as.c (parse_args): If TC_M68K, set flag_m68k_mri for -M.
+ * Many files: For MRI syntax that is specific to the m68k MRI
+ assembler, check flag_m68k_mri rather than flag_mri or
+ MRI_MODE_NEEDS_PSEUDO_DOT.
+
+Mon Feb 5 16:29:11 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-i960.c (ARCH_HX): Define.
+ (arch_tab): Add HX.
+ (targ_has_sfr): Handle ARCH_HX.
+ (targ_has_iclass): Handle ARCH_HX.
+ (tc_coff_fix2rtype): Add return 0 to avoid warning.
+ (tc_headers_hook): If the architecture was specified explicitly,
+ use it when setting the flags. Set the extern variable coff_flags
+ rather than headers->filehdr.f_flags, since the latter is set
+ unconditionally in obj-coff.c.
+ (i960_handle_align): Remove unused variable fixp.
+
+ Support for building bfd and opcodes as shared libraries, based on
+ patches from Alan Modra <alan@spri.levels.unisa.edu.au>:
+ * configure.in: Set OPCODES and BFD to search directories.
+ Substitute OPCODES_DEP and BFDDEP. On SunOS, set HLDFLAGS.
+ * configure: Rebuild.
+ * Makefile.in (LDFLAGS, HLDFLAGS): New variables.
+ (LIBDEPS): New variable.
+ (as.new0: Depend upon $(LIBDEPS) rather than $(LIBS). Use
+ $(HLDFLAGS) in link.
+ (check): Set LD_LIBRARY_PATH in the environment.
+
+Fri Feb 2 17:41:53 1996 Michael Meissner <meissner@wogglebug.tiac.net>
+
+ * config/tc-ppc.h (ELF_TC_SPECIAL_SECTIONS): Make .sdata2, .sbss2,
+ .PPC.EMB.sdata0, and .PPC.EMB.sbss0 sections all default to
+ read-only, not read/write.
+
+Fri Feb 2 14:09:25 1996 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * Makefile.in (INSTALL_XFORM): Remove -e.
+
+Fri Feb 2 12:32:15 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * write.c (write_relocs): Use S_IS_DEFINED and S_IS_COMMON rather
+ than comparing S_GET_SEGMENT to undefined_section.
+ (write_object_file): Skip symbols which were equated to an
+ undefined or common symbol.
+ * symbols.c (resolve_symbol_value): Use S_IS_DEFINED and
+ S_IS_COMMON rather than comparing S_GET_SEGMENT to
+ undefined_section.
+ (S_GET_VALUE): Likewise. Avoid recursion problems if S_IS_DEFINED
+ or S_IS_COMMON call S_GET_VALUE.
+ * config/obj-aout.h (S_IS_COMMON): Define if not BFD_ASSEMBLER.
+ * config/obj-aout.c (obj_emit_relocations): If a reloc is equated
+ to an undefined or common symbol, convert the reloc to be against
+ the target symbol.
+ (obj_crawl_symbol_chain): Skip symbols which were equated to an
+ undefined or common symbol.
+ * config/obj-bout.h (S_IS_COMMON): Define if not BFD_ASSEMBLER.
+ * config/obj-bout.c (obj_emit_relocations): If a reloc is equated
+ to an undefined or common symbol, convert the reloc to be against
+ the target symbol.
+ (obj_crawl_symbol_chain): Skip symbols which were equated to an
+ undefined or common symbol.
+ * config/obj-coff.c (do_relocs_for): Use S_IS_DEFINED and
+ S_IS_COMMON rather than comparing S_GET_SEGMENT to
+ undefined_section.
+ (yank_symbols): Skip symbols which were equated to an undefined or
+ common symbol.
+
+Thu Feb 1 15:34:32 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-aout.h (S_IS_LOCAL): Check for \002 as well as \001.
+ * config/obj-bout.h (S_IS_LOCAL): Likewise.
+
+ * configure.in: Make sure we only add m68k-parse.o to
+ ${extra_objects} once, no matter how many m68k targets have been
+ enabled.
+ * configure: Rebuild.
+
+Wed Jan 31 18:31:46 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * configure.in (i386-*-cygwin32, ppc-*-cygwin32): New.
+ * configure: Rebuild.
+
+Wed Jan 31 14:03:17 1996 Richard Henderson <rth@tamu.edu>
+
+ * config/tc-m68k.c (md_pseudo_table): Add "extend" and "ldouble".
+ * doc/c-m68k.texi: Document .extend and .ldouble.
+
+ * configure.in (m68*-apple-aux*): New target.
+ * config/te-aux.h: New file.
+ * config/obj-coff.c (compare_external_relocs): New static function
+ if TE_AUX.
+ (do_relocs_for): Sort relocs if TE_AUX.
+ (fixup_segment): If TE_AUX, store common symbol value in segment.
+ * config/tc-m68k.h (TARGET_FORMAT): Define if TE_AUX.
+
+Wed Jan 31 12:24:58 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-coff.h (S_IS_LOCAL): Check for \002 as well as \001.
+
+ * config/tc-mips.c (s_mips_globl): Set BSF_OBJECT if it is not
+ BSF_FUNCTION.
+ (s_cpload): Set BSF_OBJECT for _gp_disp symbol.
+ * read.c (s_lcomm): If S_SET_SIZE is defined, set the size of the
+ symbol.
+ * ecoff.c (add_procedure): Set the BSF_FUNCTION flag.
+ (ecoff_build_symbols): If S_SET_SIZE is defined, set the size of
+ an undefined symbol and the size of a function symbol.
+ * config/obj-elf.c (elf_frob_symbol): If TC_MIPS, set BSF_OBJECT
+ for all common symbols.
+
+Tue Jan 30 12:35:24 1996 Ken Raeburn <raeburn@cygnus.com>
+
+ * config/tc-i960.c (parse_memop): In MRI mode, don't use implicit
+ scaling of index.
+
+ * expr.c (operand): Accept 0x hex constants in MRI mode if not on
+ m68k.
+
+Mon Jan 29 12:21:30 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-elf.c (obj_elf_type): Set BSF_OBJECT flag for a type
+ of object. From Ronald F. Guilmette <rfg@monkeys.com>.
+
+ * ecoff.c (localsym_t): Add addend field.
+ (add_ecoff_symbol): Add addend argument. Change all callers.
+ (coff_sym_value): Make static.
+ (coff_sym_addend): New static variable.
+ (ecoff_directive_def): Initialize coff_sym_addend.
+ (ecoff_directive_val): Accept symbol + constant.
+ (ecoff_directive_endef): Pass coff_sym_addend to add_ecoff_symbol.
+ (ecoff_build_symbols): Include the addend in the symbol value.
+
+Fri Jan 26 19:28:52 1996 Kim Knuttila <krk@cygnus.com>
+
+ * config/tc-ppc.c (md_assemble): Ignore overflow on
+ BFD_RELOC_16_GOTOFF and BFD_RELOC_PPC_TOC16.
+
+Fri Jan 26 16:14:17 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/tc-ppc.c (md_apply_fix3): SDA21 relocations are now 4
+ bytes in size, so offset appropriately in big endian mode when
+ writing the bottom 2 bytes.
+
+Thu Jan 25 20:26:23 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * config/tc-sparc.c (default_compatible): New static local.
+ (md_begin): Initialize it. Rewrite warn_on_bump handling.
+ (sparc_ip): If no architecture or -bump specified, don't mark as
+ mismatched those in default_compatible.
+
+Thu Jan 25 12:21:53 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ SCO ELF support from Robert Lipe <robertl@arnet.com>:
+ * configure.in (i386-*-sco*elf*): Use fmt elf, targ sco5.
+ * configure: Rebuild.
+ * config/sco5.mt: New file; set TDEFINES to -DSCO_ELF.
+ * config/tc-i386.c (sco_id): New function, if SCO_ELF.
+ * config/tc-i386.h (tc_init_after_args): Define if SCO_ELF.
+ (sco_id): Declare if SCO_ELF.
+
+Thu Jan 25 03:10:53 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * config/tc-sparc.c (initial_architecture,can_bump_v9_p): Deleted.
+ ({max,warn_after}_architecture): New static locals.
+ (md_begin): Replace NUMOPCODES with sparc_num_opcodes.
+ If both architecture and -bump requested, set max_architecture to max.
+ (sparc_md_end): Simplify.
+ (sparc_ip): Replace references to can_bump_v9_p with max_architecture.
+ Rewrite code to bump architecture and check for conflicts.
+ (md_longopts): Recognize -xarch={v8plus,v8plusa} for compatibility
+ with Solaris assembler.
+ (md_parse_option): Likewise. Call sparc_opcode_lookup_arch.
+ (md_show_usage): Update.
+
+Wed Jan 24 22:11:03 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * Makefile.in (RUNTEST): Fix reference to $${srcdir}.
+
+Mon Jan 22 09:21:36 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * config/tc-sparc.h (TARGET_FORMAT): Use #ifdef SPARC_ARCH64 instead of
+ #ifdef sparcv9 when choosing value.
+ (ENV64): Delete.
+ (md_end): Define.
+ (sparc_md_end): Declare.
+ * config/tc-sparc.c (SPARC_V9): Renamed from sparcv9.
+ (initial_architecture): New static local.
+ (can_bump_v9_p): Likewise.
+ (NO_V9): Delete all occurrences.
+ (sparc_md_end): New function.
+ (sparc_ip): New local v9_arg_p. Rework fp reg number test.
+ Don't bump architecture to v9 unless can_bump_v9_p set.
+ (md_parse_option): -A<arch> passed, set can_bump_v9_p accordingly.
+ * configure.in (sparc64 target cpu): Don't set obj_format here.
+ (SPARC_V9): Renamed from sparcv9.
+ (sparc64-*-elf*): Define SPARC_ARCH64.
+ * configure: Regenerated.
+ * acconfig.h (SPARC_V9): Renamed from sparcv9.
+ (SPARC_ARCH64): Add.
+ * conf.in: Regenerated.
+ * config/vmsconf.h: Update.
+
+Mon Jan 22 17:24:47 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * config/tc-mips.c (load_register): Optimise "dli" loads.
+ (md_show_usage): add "-mcpu=vr4100" to help text.
+
+Mon Jan 22 11:53:00 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * symbols.c (resolve_symbol_value): If a symbol is equated to an
+ undefined symbol, preserve the X_op of O_symbol.
+ (S_GET_VALUE): Fix check to permit this case.
+ * write.c (write_relocs): If a reloc is against an undefined
+ symbol equated to another symbol, change the reloc to be against
+ the latter symbol.
+ * config/obj-coff.c (do_relocs_for): Likewise.
+
+ * config/tc-ppc.c (ppc_csect): An unnamed csect is storage class
+ XMC_PR.
+
+Mon Jan 22 10:59:48 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/obj-elf.c (elf/ppc.h): Include elf/ppc.h if target
+ computer is PowerPC.
+
+ * config/tc-ppc.c (md_apply_fix3): Add more embedded relocations.
+
+ * config/tc-ppc.h (ELF_TC_SPECIAL_SECTIONS): Add sections
+ mentioned in the eabi.
+
+Thu Jan 18 17:58:19 1996 Kim Knuttila <krk@cygnus.com>
+
+ * config/tc-ppc.c (ppc_reldata): Changed alignement on reldata_section
+ * config/tc-ppc.c (ppc_pdata): Changed the alignment on pdata_section
+
+Mon Jan 15 17:43:42 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/tc-ppc.c (mapping): Add more relocation suffixes.
+
+Sun Jan 14 21:29:36 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/tc-ppc.c (ppc_elf_validate_fix): Allow .gcc_except_table
+ as a section it is ok to have unadorned -mrelocatable pointers in.
+
+Sat Jan 13 11:09:08 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/tc-ppc.c (ppc_section*): Wrap these functions inside
+ #ifdef OBJ_ELF.
+
+Fri Jan 12 15:32:07 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/obj-elf.c (obj_elf_section): Add hooks so machine
+ dependent section attributes can be handled.
+
+ * config/tc-ppc.h: (md_elf_section_{letter,type,word,flags}): New
+ macros to add support for exclude section flag and ordered section
+ type.
+
+ * config/tc-ppc.c (ppc_elf_section_{letter,type,word,flags}): New
+ functions to add support for exclude section flag and ordered
+ section type.
+
+Fri Jan 12 12:04:00 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * subsegs.c (section_symbol): Don't try to look up the section
+ symbol in the hash table. It should be possible to have a symbol
+ with the same name as a section, but no connection to it.
+
+ * read.c (cons_worker): Only call mri_comment_end from flag_mri.
+ From James Carlson <carlson@xylogics.com>.
+
+ * expr.c (operand): Skip whitespace after a close parenthesis.
+ From James Carlson <carlson@xylogics.com>.
+
+Tue Jan 2 12:43:23 1996 Jim Wilson <wilson@chestnut.cygnus.com>
+
+ * config/tc-sh.c (md_apply_fix): Call as_bad_where instead of
+ as_warn_where for relocation overflow.
+ (parse_reg): Accept register name only if next character is
+ not alphanumeric.
+
+Sat Dec 30 23:42:51 1995 Jeffrey A Law (law@cygnus.com)
+
+ * ecoff.c (ecoff_stab): Simplify. Correctly handle sym + offset
+ addresses for static variables.
+
+Thu Dec 21 12:54:32 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/tc-ppc.c (mapping): Make @got give a real GOT relocation,
+ and xgot give the old toc16 relocation.
+ (md_apply_fix3): Support all GOT relocations.
+
+Wed Dec 20 14:57:17 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c (load_address): Correctly handle a constant in
+ SVR4_PIC case. From Richard Kenner <kenner@vlsi1.ultra.nyu.edu>.
+
+Fri Dec 15 14:25:07 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * config/tc-sh.c (parse_reg): Recognize SH3 registers.
+ (get_specific): Handle A_SSR, A_SPC and A_REG_B.
+ (build_Mbytes): Handle REG_B.
+
+Fri Dec 15 16:07:25 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ecoff.c (ecoff_build_aux): Use new bfd_big_endian macro.
+
+Fri Dec 15 12:11:48 1995 Raymond Jou <rjou@mexican.cygnus.com>
+
+ * mpw-make.sed: If linking, edit ALL_CFLAGS to CFLAGS.
+
+Thu Dec 14 15:09:52 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-coff.c (write_object_file): Set the s_align field to
+ the number of bytes, rather than to the power of 2.
+
+Tue Dec 12 12:19:37 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (DISTCLEAN_HERE): New variable.
+ (distclean): Use it.
+ (maintainer-clean): Depend upon clean-here rather than clean,
+ distclean, and clean-info. Run make maintainer-clean in doc.
+ Remove files listed in DISTCLEAN_HERE.
+ * doc/Makefile.in (maintainer-clean realclean): Split out from
+ distclean. Depend upon clean-info and distclean.
+
+Mon Dec 11 16:23:51 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mac-as.r: Fix copyright and version strings.
+ (cfrg): Use PROG_NAME instead of literal name.
+
+
+Mon Dec 11 14:14:08 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * read.c (read_a_source_file): If tc_unrecognized_line is defined,
+ call it.
+ * config/tc-a29k.h (tc_unrecognized_line): Define.
+ * config/tc-a29k.c (a29k_unrecognized_line): New function.
+ (md_operand): Handle a29k style local dollar labels.
+
+Wed Dec 6 17:52:52 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-multi.h: If OBJ_MAYBE_ELF, define OBJ_SYMFIELD_TYPE.
+
+Tue Dec 5 13:26:34 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * read.c (s_fill): If md_flush_pending_output is defined, call
+ it.
+
+Mon Dec 4 15:10:53 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * config/obj-coff.c (size_section, fill_section, fixup_mdeps):
+ Treat rs_align_code like rs_align.
+
+Sun Dec 3 16:46:54 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
+
+ * config/tc-arm.c (cp_address_required_here): Set pre_inc when
+ converting an absolute address into a PC-relative one.
+
+Fri Dec 1 11:57:56 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-config.in: Don't always use te-generic.h for emulation.
+ (powerpc-apple-macos): Use emulation te-macos.h.
+ * mpw-make.sed (install, install-only): Edit in Mac-specific
+ install procedure.
+
+Fri Dec 1 10:59:25 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Improve message about unsupported ELF targets.
+ * configure: Rebuild.
+
+ * config/tc-m88k.c (m88k_do_align): Correct check for whether fill
+ pattern is zero. From Manfred Hollstein.
+
+Thu Nov 30 13:25:49 1995 Kim Knuttila <krk@cygnus.com>
+
+ * config/tc-ppc.c (ppc_pe_section): To get the alignment right for
+ the various idata sections, we check the name on the .section pseudo.
+
+Thu Nov 30 11:23:42 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de>
+
+ * config/obj-coff.c (fixup_segment): If TC_M88K is defined, do not
+ add section's paddr to add_number; compatibility to native as and
+ ld forbids.
+
+Wed Nov 29 23:14:27 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * configure.in: Treat m68k-sysv4 like m68k-elf, not m68k-sysv3.
+
+ * hash.c (struct hash_entry): Moved here...
+ * hash.h (struct hash_entry): ...from here.
+
+ * config/obj-elf.c (elf_frob_symbol): Don't free and clear sy_obj
+ if it's already known to be null.
+
+Wed Nov 29 13:00:20 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/tc-ppc.c (md_apply_fix3): Don't adjust the value for 32
+ bit relocs converted to PC relative relocs. This turned out to
+ add the offset from the beginning of .text twice.
+
+Tue Nov 28 10:42:36 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * stabs.c (s_stab_generic): In 's' case, free string from
+ obstack.
+
+ * config/obj-elf.h (ELF_TARGET_SYMBOL_FIELDS): Remove unused field
+ sy_name_offset.
+ * config/obj-multi.h (ELF_TARGET_SYMBOL_FIELDS) [OBJ_MAYBE_ELF]:
+ Ditto.
+
+ * subsegs.h (segment_info_type): Make bitfields unsigned.
+
+ * expr.h (struct expressionS): Make X_op and X_unsigned bitfields,
+ and move them together. On most systems this will reduce the
+ structure size by one word.
+ (operatorT): Define O_max.
+ * expr.c (expr_begin): Verify that X_op is wide enough to hold
+ O_max.
+
+ * read.c (pop_insert): Print error returned by hash table
+ insertion code.
+
+ * as.c (dump_statistics): Split out from main; dump some hash
+ table stats and target-specific stats.
+ (start_time): No longer automatic to main.
+ (main): Set file-level start_time and call dump_statistics at
+ exit. Exit by calling xexit.
+ (show_usage): Make --statistics description less specific.
+ * subsegs.c (subsegs_print_statistics): New function.
+ * write.c (write_print_statistics): New function.
+ (n_fixups): New static variable.
+ (fix_new_internal): Increment it.
+ * read.c (read_print_statistics): New function.
+ * read.h (read_print_statistics): Declare.
+ * symbol.c (symbol_print_statistics): New function.
+ * symbol.h (symbol_print_statistics): Declare.
+ * hash.c (hash_print_statistics): New function.
+ * hash.h (hash_print_statistics): Declare.
+ * config/tc-i386.c (i386_print_statistics): New function.
+ * config/tc-i386.h (i386_print_statistics): Declare.
+ (tc_print_statistics): New macro.
+ * messages.c (as_fatal, as_assert, as_abort): Use xexit, not
+ exit.
+
+ * hash.c (DELETED): Rewrite to use a valid but unique address.
+ (START_POWER): Reduce to 10.
+ (enum stat_enum): New enumerator, replacing STAT_* index macros.
+ Add new values for counting strcmp calls.
+ (GROW_FACTOR): New macro.
+ (hash_grow): Use GROW_FACTOR. Rewrite for quick returns instead
+ of nesting blocks.
+ (FULL_VALUE): New macro. Use 1/4 of table size instead of 1/2.
+ (hash_new): Use FULL_VALUE.
+ (struct hash_control): Definition moved here.
+ (hash_code): Don't mask to low bits.
+ (hash_ask): Mask returned hash code here. Check hash value before
+ calling strcmp; count strcmp calls.
+ * hash.h (struct hash_control): Declare, don't define, here.
+ (HASH_STATLENGTH): Deleted.
+ (struct hash_entry): Add field for hash code.
+ (hash_say, hash_apply): Don't declare.
+
+ * hash.c (destroy): Return void.
+ (applicatee): Ditto.
+ (main): Fix declarations.
+ (hash_apply): Return void. Argument `function' returns void. Put
+ inside "#ifdef TEST".
+ (hash_say): Define only if TEST is defined.
+ * hash.h (hash_apply, hash_say): Declarations deleted.
+
+Mon Nov 27 13:18:25 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Rebuild with autoconf 2.7.
+
+Tue Nov 21 18:39:01 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * aclocal.m4 (AC_PROG_CC): Remove local definition.
+ * configure: Rebuild with autoconf 2.6.
+
+Mon Nov 20 17:26:00 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-ppc.c (ppc_debug_name_section_size): Remove.
+ (ppc_stabx): Don't increment ppc_debug_name_section_size.
+ (ppc_bc): Likewise.
+ (ppc_frob_file): Remove.
+ * config/tc-ppc.h (tc_frob_file): Don't define.
+ (ppc_frob_file): Don't declare.
+
+Mon Nov 20 13:37:05 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * Makefile.in (TARG_CPU_DEP_alpha): Mention alpha-opcode.h.
+ * config/alpha-opcode.h: Include one-operand variants of jmp and
+ jsr.
+
+ * config/te-delt88.h: Renamed from te-delta88.h, to avoid conflict
+ with te-delta.h in 8.3 file systems.
+ * configure.in: Adjusted.
+
+Thu Nov 16 12:49:38 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c (s_err): Remove; just use the one in read.c.
+
+ * config/m68k-parse.y (yylex): In MRI mode, '@' can start an octal
+ number.
+ * expr.c (operand): Handle MRI suffixes after unadorned 0.
+
Thu Nov 16 00:21:44 1995 Ken Raeburn <raeburn@cygnus.com>
Version 2.6 released.
* Makefile.in (VERSION): Updated to 2.6.
- * config/tc-mips.c (s_mipserr): Renamed from s_err, to avoid
- conflict with read.h.
-
* config/obj-coff.c (write_object_file): Change use of md_do_align
to pass a pointer rather than a fill value, to match other uses.
diff --git a/gnu/usr.bin/binutils/gas/ChangeLog.1 b/gnu/usr.bin/binutils/gas/ChangeLog.1
index 86c6d18d01b..aa7fc47240a 100644
--- a/gnu/usr.bin/binutils/gas/ChangeLog.1
+++ b/gnu/usr.bin/binutils/gas/ChangeLog.1
@@ -389,6 +389,12 @@ Wed Sep 6 21:13:06 1995 Ian Lance Taylor <ian@cygnus.com>
Wed Sep 6 15:03:53 1995 Jim Wilson <wilson@chestnut.cygnus.com>
+ * config/tc-sh.c (get_operands): Read third arg if it exists.
+ Otherwise, clear it.
+ (get_specific, case F_FR0): Add.
+
+Wed Sep 6 15:03:53 1995 Jim Wilson <wilson@chestnut.cygnus.com>
+
* config/tc-sh.c (get_specific): Delete arg_to_test.
(md_assemble): Increase operand array from 2 to 3.
@@ -1128,6 +1134,11 @@ Mon Aug 7 17:18:10 1995 Ian Lance Taylor <ian@cygnus.com>
(TARG_CPU_DEP_m68k): Depend upon $(srcdir)/config/m68k-parse.h.
(m68k-parse.c, m68k-parse.o): New targets.
+Mon Aug 7 02:54:20 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * config/tc-sh.c (parse_reg): Handle new FP registers.
+ (get_specific): Handle new operand types.
+
Fri Aug 4 12:29:21 1995 Ian Lance Taylor <ian@cygnus.com>
* expr.c (op_encoding): Make non-const. Don't set '"' to
@@ -1379,14 +1390,12 @@ Wed Jul 19 11:49:25 1995 Ian Lance Taylor <ian@cygnus.com>
* config/tc-m68k.c (md_convert_frag): Likewise.
* config/tc-m88k.h (md_convert_frag): Likewise.
* config/tc-ns32k.c (md_convert_frag): Likewise.
- * config/tc-rce.c (md_convert_frag): Likewise.
* config/tc-tahoe.c (md_convert_frag): Likewise.
* config/tc-vax.c (md_convert_frag): Likewise.
* config/tc-w65.c (md_convert_frag): Likewise.
* config/tc-z8k.c (md_convert_frag): Likewise.
* config/tc-h8300.h (TC_RELOC_MANGLE): Add segment argument.
* config/tc-h8500.h (TC_RELOC_MANGLE): Likewise.
- * config/tc-rce.h (TC_RELOC_MANGLE): Likewise.
* config/tc-w65.h (TC_RELOC_MANGLE): Likewise.
* config/tc-z8k.h (TC_RELOC_MANGLE): Likewise.
@@ -3506,7 +3515,6 @@ Tue Nov 29 13:58:10 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
(SIGTY): Macro deleted.
(main): Deleted disabled code for establishing signal handler.
-
Mon Nov 28 11:37:35 1994 Doug Evans <dje@canuck.cygnus.com>
* app.c (do_scrub_next_char): Insert missing newline at end of file
@@ -4789,6 +4797,10 @@ Tue Jul 26 18:21:24 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
{R,F}{,L}{2,4}, M, SFR_OK, LIT_OK, FP_OK, REG_ALIGN, MEMOP, I_*):
Macros deleted.
+ * config/tc-i960.c (ARCH_JX): Define.
+ (arch_tab): Include JX.
+ (targ_has_sfr, targ_has_iclass): Handle JX.
+ (tc_headers_hook): Set flags to F_I960JX for i960JX.
Fri Jul 15 15:36:51 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
diff --git a/gnu/usr.bin/binutils/gas/NEWS b/gnu/usr.bin/binutils/gas/NEWS
index e2a59f777e8..e315d67e69f 100644
--- a/gnu/usr.bin/binutils/gas/NEWS
+++ b/gnu/usr.bin/binutils/gas/NEWS
@@ -1,10 +1,18 @@
-*- text -*-
+Changes since 2.6:
+
+The PowerPC assembler now allows the use of symbolic register names (r0, etc.)
+if -mregnames is used. Symbolic names preceded by a '%' (%r0, etc.) can be
+used any time. PowerPC 860 move to/from SPR instructions have been added.
+
Changes since 2.5:
Gas now directly supports macros, without requiring GASP.
-Gas now has an MRI assembler compatibility mode.
+Gas now has an MRI assembler compatibility mode. Use -M or --mri to select MRI
+mode. The pseudo-op ``.mri 1'' will switch into the MRI mode until the ``.mri
+0'' is seen; this can be convenient for inline assembler code.
Added --defsym SYM=VALUE option.
diff --git a/gnu/usr.bin/binutils/gas/acconfig.h b/gnu/usr.bin/binutils/gas/acconfig.h
index 57fdd83e5bb..1626d38b5de 100644
--- a/gnu/usr.bin/binutils/gas/acconfig.h
+++ b/gnu/usr.bin/binutils/gas/acconfig.h
@@ -28,8 +28,9 @@
#undef MANY_SEGMENTS
-/* Needed only for sparc configuration */
-#undef sparcv9
+/* Needed only for sparc configuration. */
+#undef SPARC_V9
+#undef SPARC_ARCH64
/* Needed only for some configurations that can produce multiple output
formats. */
diff --git a/gnu/usr.bin/binutils/gas/aclocal.m4 b/gnu/usr.bin/binutils/gas/aclocal.m4
index b5f3ddc410b..60f54e95127 100644
--- a/gnu/usr.bin/binutils/gas/aclocal.m4
+++ b/gnu/usr.bin/binutils/gas/aclocal.m4
@@ -1,40 +1,3 @@
-dnl
-dnl This ugly hack is needed because the Cygnus configure script won't
-dnl tell us what CC is going to be, and "cc" isn't always right. (The
-dnl top-level Makefile will always override anything we choose here, so
-dnl the usual gcc/cc selection is useless.)
-dnl
-dnl It knows where it is in the tree; don't try using it elsewhere.
-dnl
-undefine([AC_PROG_CC])dnl
-AC_DEFUN(AC_PROG_CC,
-[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-dnl
-dnl The ugly bit...
-dnl
-AC_MSG_CHECKING([for CC])
-dnl Don't bother with cache.
-test -z "$CC" && CC=`egrep '^CC *=' ../Makefile | tail -1 | sed 's/^CC *= *//'`
-test -z "$CC" && CC=cc
-AC_MSG_RESULT(setting CC to $CC)
-AC_SUBST(CC)
-dnl
-dnl
-# Find out if we are using GNU C, under whatever name.
-cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes
-#endif
-EOF
-${CC-cc} -E conftest.c > conftest.out 2>&1
-if egrep yes conftest.out >/dev/null 2>&1; then
- GCC=yes
-else
- GCC=
-fi
-rm -f conftest*
-])dnl
-dnl
dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers)
AC_DEFUN(GAS_CHECK_DECL_NEEDED,[
AC_MSG_CHECKING(whether declaration is required for $1)
diff --git a/gnu/usr.bin/binutils/gas/app.c b/gnu/usr.bin/binutils/gas/app.c
index 794bcdd5649..bc8a9a0aa15 100644
--- a/gnu/usr.bin/binutils/gas/app.c
+++ b/gnu/usr.bin/binutils/gas/app.c
@@ -1,5 +1,6 @@
/* This is the Assembler Pre-Processor
- Copyright (C) 1987, 1990, 1991, 1992, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -32,6 +33,15 @@
#endif
#endif
+/* Whether we are scrubbing in m68k MRI mode. This is different from
+ flag_m68k_mri, because the two flags will be affected by the .mri
+ pseudo-op at different times. */
+static int scrub_m68k_mri;
+
+/* The pseudo-op which switches in and out of MRI mode. See the
+ comment in do_scrub_chars. */
+static const char mri_pseudo[] = ".mri 0";
+
static char lex[256];
static const char symbol_chars[] =
"$._ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
@@ -61,17 +71,20 @@ static int process_escape PARAMS ((int));
each and every time the assembler is run. xoxorich. */
void
-do_scrub_begin ()
+do_scrub_begin (m68k_mri)
+ int m68k_mri;
{
const char *p;
+ scrub_m68k_mri = m68k_mri;
+
lex[' '] = LEX_IS_WHITESPACE;
lex['\t'] = LEX_IS_WHITESPACE;
lex['\n'] = LEX_IS_NEWLINE;
lex[';'] = LEX_IS_LINE_SEPARATOR;
lex[':'] = LEX_IS_COLON;
- if (! flag_mri)
+ if (! m68k_mri)
{
lex['"'] = LEX_IS_STRINGQUOTE;
@@ -94,7 +107,11 @@ do_scrub_begin ()
lex[(unsigned char) *p] = LEX_IS_SYMBOL_COMPONENT;
} /* declare symbol characters */
- for (p = comment_chars; *p; p++)
+ /* The m68k backend wants to be able to change comment_chars. */
+#ifndef tc_comment_chars
+#define tc_comment_chars comment_chars
+#endif
+ for (p = tc_comment_chars; *p; p++)
{
lex[(unsigned char) *p] = LEX_IS_COMMENT_START;
} /* declare comment chars */
@@ -121,7 +138,7 @@ do_scrub_begin ()
lex['*'] = LEX_IS_TWOCHAR_COMMENT_2ND;
}
- if (flag_mri)
+ if (m68k_mri)
{
lex['\''] = LEX_IS_STRINGQUOTE;
lex[';'] = LEX_IS_COMMENT_START;
@@ -140,6 +157,8 @@ static char out_buf[20];
static int add_newlines;
static char *saved_input;
static int saved_input_len;
+static const char *mri_state;
+static char mri_last_ch;
/* Data structure for saving the state of app across #include's. Note that
app is called asynchronously to the parsing of the .include's, so our
@@ -155,6 +174,9 @@ struct app_save
int add_newlines;
char *saved_input;
int saved_input_len;
+ int scrub_m68k_mri;
+ const char *mri_state;
+ char mri_last_ch;
};
char *
@@ -170,6 +192,9 @@ app_push ()
saved->add_newlines = add_newlines;
saved->saved_input = saved_input;
saved->saved_input_len = saved_input_len;
+ saved->scrub_m68k_mri = scrub_m68k_mri;
+ saved->mri_state = mri_state;
+ saved->mri_last_ch = mri_last_ch;
/* do_scrub_begin() is not useful, just wastes time. */
@@ -193,6 +218,9 @@ app_pop (arg)
add_newlines = saved->add_newlines;
saved_input = saved->saved_input;
saved_input_len = saved->saved_input_len;
+ scrub_m68k_mri = saved->scrub_m68k_mri;
+ mri_state = saved->mri_state;
+ mri_last_ch = saved->mri_last_ch;
free (arg);
} /* app_pop() */
@@ -393,7 +421,10 @@ do_scrub_chars (get, tostart, tolen)
if (ch == '"')
{
UNGET (ch);
- out_string = "\n\t.appfile ";
+ if (scrub_m68k_mri)
+ out_string = "\n\tappfile ";
+ else
+ out_string = "\n\t.appfile ";
old_state = 7;
state = -1;
PUT (*out_string++);
@@ -459,7 +490,7 @@ do_scrub_chars (get, tostart, tolen)
PUT (ch);
}
#endif
- else if (flag_mri && ch == '\n')
+ else if (scrub_m68k_mri && ch == '\n')
{
/* Just quietly terminate the string. This permits lines like
bne label loop if we haven't reach end yet
@@ -548,7 +579,61 @@ do_scrub_chars (get, tostart, tolen)
/* flushchar: */
ch = GET ();
+
recycle:
+
+#ifdef TC_M68K
+ /* We want to have pseudo-ops which control whether we are in
+ MRI mode or not. Unfortunately, since m68k MRI mode affects
+ the scrubber, that means that we need a special purpose
+ recognizer here. */
+ if (mri_state == NULL)
+ {
+ if ((state == 0 || state == 1)
+ && ch == mri_pseudo[0])
+ mri_state = mri_pseudo + 1;
+ }
+ else
+ {
+ /* We advance to the next state if we find the right
+ character, or if we need a space character and we get any
+ whitespace character, or if we need a '0' and we get a
+ '1' (this is so that we only need one state to handle
+ ``.mri 0'' and ``.mri 1''). */
+ if (ch != '\0'
+ && (*mri_state == ch
+ || (*mri_state == ' '
+ && lex[ch] == LEX_IS_WHITESPACE)
+ || (*mri_state == '0'
+ && ch == '1')))
+ {
+ mri_last_ch = ch;
+ ++mri_state;
+ }
+ else if (*mri_state != '\0'
+ || (lex[ch] != LEX_IS_WHITESPACE
+ && lex[ch] != LEX_IS_NEWLINE))
+ {
+ /* We did not get the expected character, or we didn't
+ get a valid terminating character after seeing the
+ entire pseudo-op, so we must go back to the
+ beginning. */
+ mri_state = NULL;
+ }
+ else
+ {
+ /* We've read the entire pseudo-op. mips_last_ch is
+ either '0' or '1' indicating whether to enter or
+ leave MRI mode. */
+ do_scrub_begin (mri_last_ch == '1');
+
+ /* We continue handling the character as usual. The
+ main gas reader must also handle the .mri pseudo-op
+ to control expression parsing and the like. */
+ }
+ }
+#endif
+
if (ch == EOF)
{
if (state != 0)
@@ -588,7 +673,7 @@ do_scrub_chars (get, tostart, tolen)
/* cpp never outputs a leading space before the #, so
try to avoid being confused. */
not_cpp_line = 1;
- if (flag_mri)
+ if (scrub_m68k_mri)
{
/* In MRI mode, we keep these spaces. */
UNGET (ch);
@@ -605,7 +690,7 @@ do_scrub_chars (get, tostart, tolen)
not permitted between the label and the colon. */
if ((state == 2 || state == 11)
&& lex[ch] == LEX_IS_COLON
- && ! flag_mri)
+ && ! scrub_m68k_mri)
{
state = 1;
PUT (ch);
@@ -633,7 +718,7 @@ do_scrub_chars (get, tostart, tolen)
PUT (' ');
break;
case 3:
- if (flag_mri)
+ if (scrub_m68k_mri)
{
/* In MRI mode, we keep these spaces. */
UNGET (ch);
@@ -643,7 +728,7 @@ do_scrub_chars (get, tostart, tolen)
goto recycle; /* Sp in operands */
case 9:
case 10:
- if (flag_mri)
+ if (scrub_m68k_mri)
{
/* In MRI mode, we keep these spaces. */
state = 3;
@@ -654,7 +739,20 @@ do_scrub_chars (get, tostart, tolen)
state = 10; /* Sp after symbol char */
goto recycle;
case 11:
- state = 1;
+ if (flag_m68k_mri
+#ifdef LABELS_WITHOUT_COLONS
+ || 1
+#endif
+ )
+ state = 1;
+ else
+ {
+ /* We know that ch is not ':', since we tested that
+ case above. Therefore this is not a label, so it
+ must be the opcode, and we've just seen the
+ whitespace after it. */
+ state = 3;
+ }
UNGET (ch);
PUT (' '); /* Sp after label definition. */
break;
@@ -687,7 +785,7 @@ do_scrub_chars (get, tostart, tolen)
if (ch2 == EOF
|| lex[ch2] == LEX_IS_TWOCHAR_COMMENT_1ST)
break;
- UNGET (ch);
+ UNGET (ch2);
}
if (ch2 == EOF)
as_warn ("end of file in multiline comment");
@@ -853,7 +951,10 @@ do_scrub_chars (get, tostart, tolen)
UNGET (ch);
old_state = 4;
state = -1;
- out_string = "\t.appline ";
+ if (scrub_m68k_mri)
+ out_string = "\tappline ";
+ else
+ out_string = "\t.appline ";
PUT (*out_string++);
break;
}
@@ -862,12 +963,12 @@ do_scrub_chars (get, tostart, tolen)
start of a line. If this is also a normal comment
character, fall through. Otherwise treat it as a default
character. */
- if (strchr (comment_chars, ch) == NULL
- && (! flag_mri
+ if (strchr (tc_comment_chars, ch) == NULL
+ && (! scrub_m68k_mri
|| (ch != '!' && ch != '*')))
goto de_fault;
- if (flag_mri
- && (ch == '!' || ch == '*')
+ if (scrub_m68k_mri
+ && (ch == '!' || ch == '*' || ch == '#')
&& state != 1
&& state != 10)
goto de_fault;
@@ -901,7 +1002,7 @@ do_scrub_chars (get, tostart, tolen)
/* This is a common case. Quickly copy CH and all the
following symbol component or normal characters. */
- if (to + 1 < toend)
+ if (to + 1 < toend && mri_state == NULL)
{
char *s;
int len;
diff --git a/gnu/usr.bin/binutils/gas/as.c b/gnu/usr.bin/binutils/gas/as.c
index ec44c7e440d..b43642affa7 100644
--- a/gnu/usr.bin/binutils/gas/as.c
+++ b/gnu/usr.bin/binutils/gas/as.c
@@ -1,5 +1,6 @@
/* as.c - GAS main program.
- Copyright (C) 1987, 1990, 1991, 1992, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -112,7 +113,7 @@ Options:\n\
-nocpp ignored\n\
-o OBJFILE name the object-file output OBJFILE (default a.out)\n\
-R fold data section into text section\n\
---statistics print maximum bytes and total seconds used\n\
+--statistics print various measured statistics from execution\n\
--version print assembler version number and exit\n\
-W suppress warnings\n\
-w ignored\n\
@@ -408,6 +409,9 @@ parse_args (pargc, pargv)
case 'M':
flag_mri = 1;
+#ifdef TC_M68K
+ flag_m68k_mri = 1;
+#endif
break;
case 'R':
@@ -445,9 +449,7 @@ parse_args (pargc, pargv)
listing |= LISTING_SYMBOLS;
break;
case '=':
- listing_filename = strdup (optarg + 1);
- if (listing_filename == NULL)
- as_fatal ("virtual memory exhausted");
+ listing_filename = xstrdup (optarg + 1);
optarg += strlen (listing_filename);
break;
default:
@@ -473,17 +475,13 @@ parse_args (pargc, pargv)
case 'I':
{ /* Include file directory */
- char *temp = strdup (optarg);
- if (!temp)
- as_fatal ("virtual memory exhausted");
+ char *temp = xstrdup (optarg);
add_include_dir (temp);
break;
}
case 'o':
- out_file_name = strdup (optarg);
- if (!out_file_name)
- as_fatal ("virtual memory exhausted");
+ out_file_name = xstrdup (optarg);
break;
case 'w':
@@ -502,6 +500,9 @@ parse_args (pargc, pargv)
*pargv = new_argv;
}
+static void dump_statistics ();
+static long start_time;
+
int
main (argc, argv)
int argc;
@@ -510,7 +511,8 @@ main (argc, argv)
int macro_alternate;
int macro_strip_at;
int keep_it;
- long start_time = get_run_time ();
+
+ start_time = get_run_time ();
if (debug_memory)
{
@@ -539,6 +541,7 @@ main (argc, argv)
hex_init ();
#ifdef BFD_ASSEMBLER
bfd_init ();
+ bfd_set_error_program_name (myname);
#endif
#ifdef USE_EMULATIONS
@@ -549,11 +552,14 @@ main (argc, argv)
symbol_begin ();
frag_init ();
subsegs_begin ();
- read_begin ();
parse_args (&argc, &argv);
+ read_begin ();
input_scrub_begin ();
expr_begin ();
+ if (flag_print_statistics)
+ xatexit (dump_statistics);
+
macro_alternate = 0;
macro_strip_at = 0;
#ifdef TC_I960
@@ -615,28 +621,41 @@ main (argc, argv)
END_PROGRESS (myname);
- if (flag_print_statistics)
- {
- extern char **environ;
+ /* Use xexit instead of return, because under VMS environments they
+ may not place the same interpretation on the value given. */
+ if ((had_warnings () && flag_always_generate_output)
+ || had_errors () > 0)
+ xexit (EXIT_FAILURE);
+ xexit (EXIT_SUCCESS);
+}
+
+static void
+dump_statistics ()
+{
+ extern char **environ;
#ifdef HAVE_SBRK
- char *lim = (char *) sbrk (0);
+ char *lim = (char *) sbrk (0);
#endif
- long run_time = get_run_time () - start_time;
+ long run_time = get_run_time () - start_time;
- fprintf (stderr, "%s: total time in assembly: %ld.%06ld\n",
- myname, run_time / 1000000, run_time % 1000000);
+ fprintf (stderr, "%s: total time in assembly: %ld.%06ld\n",
+ myname, run_time / 1000000, run_time % 1000000);
#ifdef HAVE_SBRK
- fprintf (stderr, "%s: data size %ld\n",
- myname, (long) (lim - (char *) &environ));
+ fprintf (stderr, "%s: data size %ld\n",
+ myname, (long) (lim - (char *) &environ));
#endif
- }
- /* Use exit instead of return, because under VMS environments they
- may not place the same interpretation on the value given. */
- if ((had_warnings () && flag_always_generate_output)
- || had_errors () > 0)
- exit (EXIT_FAILURE);
- exit (EXIT_SUCCESS);
+ subsegs_print_statistics (stderr);
+ write_print_statistics (stderr);
+ symbol_print_statistics (stderr);
+ read_print_statistics (stderr);
+
+#ifdef tc_print_statistics
+ tc_print_statistics (stderr);
+#endif
+#ifdef obj_print_statistics
+ obj_print_statistics (stderr);
+#endif
}
diff --git a/gnu/usr.bin/binutils/gas/as.h b/gnu/usr.bin/binutils/gas/as.h
index a7e1ebe9ab1..2a001b03893 100644
--- a/gnu/usr.bin/binutils/gas/as.h
+++ b/gnu/usr.bin/binutils/gas/as.h
@@ -1,5 +1,6 @@
/* as.h - global header file
- Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -91,13 +92,6 @@ void *alloca ();
#include <sys/types.h>
#endif
-/* Some systems do declare this, but this seems to be the universal
- declaration, though the parameter type varies. (It ought to use
- `const' but many systems prototype it without.) Include it here
- for systems that don't declare it. If conflicts arise, just add
- another autoconf test... */
-extern char *strdup (/* const char * */);
-
#include <getopt.h>
/* The first getopt value for machine-independent long options.
150 isn't special; it's just an arbitrary non-ASCII char value. */
@@ -280,12 +274,16 @@ typedef addressT valueT;
#ifdef MANY_SEGMENTS
#include "bfd.h"
-#define N_SEGMENTS 10
-#define SEG_NORMAL(x) ((x) >= SEG_E0 && (x) <= SEG_E9)
-#define SEG_LIST SEG_E0,SEG_E1,SEG_E2,SEG_E3,SEG_E4,SEG_E5,SEG_E6,SEG_E7,SEG_E8,SEG_E9
+#define N_SEGMENTS 40
+#define SEG_NORMAL(x) ((x) >= SEG_E0 && (x) <= SEG_E39)
+#define SEG_LIST SEG_E0,SEG_E1,SEG_E2,SEG_E3,SEG_E4,SEG_E5,SEG_E6,SEG_E7,SEG_E8,SEG_E9,\
+ SEG_E10,SEG_E11,SEG_E12,SEG_E13,SEG_E14,SEG_E15,SEG_E16,SEG_E17,SEG_E18,SEG_E19,\
+ SEG_E20,SEG_E21,SEG_E22,SEG_E23,SEG_E24,SEG_E25,SEG_E26,SEG_E27,SEG_E28,SEG_E29,\
+ SEG_E30,SEG_E31,SEG_E32,SEG_E33,SEG_E34,SEG_E35,SEG_E36,SEG_E37,SEG_E38,SEG_E39
#define SEG_TEXT SEG_E0
#define SEG_DATA SEG_E1
#define SEG_BSS SEG_E2
+#define SEG_LAST SEG_E39
#else
#define N_SEGMENTS 3
#define SEG_NORMAL(x) ((x) == SEG_TEXT || (x) == SEG_DATA || (x) == SEG_BSS)
@@ -486,9 +484,12 @@ COMMON unsigned char flag_warn_displacement; /* -K */
/* True if local symbols should be retained. */
COMMON int flag_keep_locals; /* -L */
-/* True if we are assembling using MRI syntax. */
+/* True if we are assembling in MRI mode. */
COMMON int flag_mri;
+/* True if we are assembling in m68k MRI mode. */
+COMMON int flag_m68k_mri;
+
/* Should the data section be made read-only and appended to the text
section? */
COMMON unsigned char flag_readonly_data_in_text; /* -R */
@@ -602,7 +603,7 @@ void as_howmuch PARAMS ((FILE * stream));
void as_perror PARAMS ((const char *gripe, const char *filename));
void as_where PARAMS ((char **namep, unsigned int *linep));
void bump_line_counters PARAMS ((void));
-void do_scrub_begin PARAMS ((void));
+void do_scrub_begin PARAMS ((int));
void input_scrub_begin PARAMS ((void));
void input_scrub_close PARAMS ((void));
void input_scrub_end PARAMS ((void));
diff --git a/gnu/usr.bin/binutils/gas/atof-generic.c b/gnu/usr.bin/binutils/gas/atof-generic.c
index a78e9b640e5..9a00f0414de 100644
--- a/gnu/usr.bin/binutils/gas/atof-generic.c
+++ b/gnu/usr.bin/binutils/gas/atof-generic.c
@@ -1,5 +1,6 @@
/* atof_generic.c - turn a string of digits into a Flonum
- Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -246,7 +247,7 @@ atof_generic (address_of_string_pointer,
--number_of_digits_after_decimal;
#endif
- if (flag_mri)
+ if (flag_m68k_mri)
{
while (c == '_')
c = *++p;
@@ -256,7 +257,7 @@ atof_generic (address_of_string_pointer,
char digits_exponent_sign_char;
c = *++p;
- if (flag_mri)
+ if (flag_m68k_mri)
{
while (c == '_')
c = *++p;
diff --git a/gnu/usr.bin/binutils/gas/cond.c b/gnu/usr.bin/binutils/gas/cond.c
index fd8161ab7ce..e655451e6e4 100644
--- a/gnu/usr.bin/binutils/gas/cond.c
+++ b/gnu/usr.bin/binutils/gas/cond.c
@@ -1,5 +1,5 @@
/* cond.c - conditional assembly pseudo-ops, and .include
- Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 95, 1996 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -310,11 +310,7 @@ ignore_input ()
s = input_line_pointer;
-#ifndef MRI_MODE_NEEDS_PSEUDO_DOT
-#define MRI_MODE_NEEDS_PSEUDO_DOT 0
-#endif
-
- if ((flag_mri && ! MRI_MODE_NEEDS_PSEUDO_DOT)
+ if (flag_m68k_mri
#ifdef NO_PSEUDO_DOT
|| 1
#endif
diff --git a/gnu/usr.bin/binutils/gas/conf.in b/gnu/usr.bin/binutils/gas/conf.in
index e1b803f587d..5260c3063e2 100644
--- a/gnu/usr.bin/binutils/gas/conf.in
+++ b/gnu/usr.bin/binutils/gas/conf.in
@@ -55,8 +55,9 @@
#undef MANY_SEGMENTS
-/* Needed only for sparc configuration */
-#undef sparcv9
+/* Needed only for sparc configuration. */
+#undef SPARC_V9
+#undef SPARC_ARCH64
/* Needed only for some configurations that can produce multiple output
formats. */
diff --git a/gnu/usr.bin/binutils/gas/config/alpha-opcode.h b/gnu/usr.bin/binutils/gas/config/alpha-opcode.h
index c2e562ed11d..4ba58993697 100644
--- a/gnu/usr.bin/binutils/gas/config/alpha-opcode.h
+++ b/gnu/usr.bin/binutils/gas/config/alpha-opcode.h
@@ -191,9 +191,13 @@ static const struct alpha_opcode alpha_opcodes[] =
{ "jmp", 0x68000000, 0, "1,(2),i" }, /* 6o+5a+5b+2A+14d */
{ "jmp", 0x68000000, 0, "1,(2)" },
{ "jmp", 0x68000000, 0, "1,Bc" },
+{ "jmp", 0x6be00000, 0, "(2)" },
+{ "jmp", 0x6be00000, 0, "Bc" },
{ "jsr", 0x68004000, 0, "1,(2),i" },
{ "jsr", 0x68004000, 0, "1,(2)" },
{ "jsr", 0x68004000, 0, "1,Bc" }, /* macro: lda $pv,L;jsr .. */
+{ "jsr", 0x6b404000, 0, "(2)" },
+{ "jsr", 0x6b404000, 0, "Bc" },
{ "ret", 0x68008000, 0, "1,(2),i" },
{ "ret", 0x68008000, 0, "1,(2)" },
{ "ret", 0x6bfa8000, 0, "" }, /* macro: ret zero,(ra) */
@@ -435,7 +439,7 @@ static const struct alpha_opcode alpha_opcodes[] =
{ "mf_fpcr", 0x5c0004a0, 1, "E" },
{ "mt_fpcr", 0x5c000480, 1, "E" },
-/* Vax subset (opcode 0x15) */
+/* VAX subset (opcode 0x15) */
{ "addf", 0x54001000, 1, "e,f,g" },
{ "addf/c", 0x54000000, 1, "e,f,g" },
{ "addf/u", 0x54003000, 1, "e,f,g" },
@@ -649,6 +653,8 @@ static const struct alpha_opcode alpha_opcodes[] =
{ "cvtqt/suic", 0x5be0e7c0, 1, "f,g" },
{ "cvtqt/suim", 0x5be0efc0, 1, "f,g" },
{ "cvtqt/suid", 0x5be0ffc0, 1, "f,g" },
+{ "cvtst", 0x5be05580, 1, "f,g" }, /* note: floatop is same as cvtts! */
+{ "cvtst/s", 0x5be0d580, 1, "f,g" }, /* note: floatop is same as cvtts! */
{ "cvtts", 0x5be01580, 1, "f,g" },
{ "cvtts/c", 0x5be00580, 1, "f,g" },
{ "cvtts/m", 0x5be00d80, 1, "f,g" },
diff --git a/gnu/usr.bin/binutils/gas/config/atof-ieee.c b/gnu/usr.bin/binutils/gas/config/atof-ieee.c
index b577cdfb3c2..be3f7e536eb 100644
--- a/gnu/usr.bin/binutils/gas/config/atof-ieee.c
+++ b/gnu/usr.bin/binutils/gas/config/atof-ieee.c
@@ -27,11 +27,12 @@ extern FLONUM_TYPE generic_floating_point_number; /* Flonums returned here. */
extern const char EXP_CHARS[];
/* Precision in LittleNums. */
-#define MAX_PRECISION (6)
+/* Don't count the gap in the m68k extended precision format. */
+#define MAX_PRECISION (5)
#define F_PRECISION (2)
#define D_PRECISION (4)
-#define X_PRECISION (6)
-#define P_PRECISION (6)
+#define X_PRECISION (5)
+#define P_PRECISION (5)
/* Length in LittleNums of guard bits. */
#define GUARD (2)
@@ -258,6 +259,15 @@ gen_to_words (words, precision, exponent_bits)
int exponent_skippage;
LITTLENUM_TYPE word1;
LITTLENUM_TYPE *lp;
+ LITTLENUM_TYPE *words_end;
+
+ words_end = words + precision;
+#ifdef TC_M68K
+ if (precision == X_PRECISION)
+ /* On the m68k the extended precision format has a gap of 16 bits
+ between the exponent and the mantissa. */
+ words_end++;
+#endif
if (generic_floating_point_number.low > generic_floating_point_number.leader)
{
@@ -266,7 +276,8 @@ gen_to_words (words, precision, exponent_bits)
words[0] = 0x0000;
else
words[0] = 0x8000;
- memset (&words[1], '\0', sizeof (LITTLENUM_TYPE) * (precision - 1));
+ memset (&words[1], '\0',
+ (words_end - words - 1) * sizeof (LITTLENUM_TYPE));
return (return_value);
}
@@ -278,6 +289,27 @@ gen_to_words (words, precision, exponent_bits)
words[0] = 0x7fff;
words[1] = 0xffff;
}
+ else if (precision == X_PRECISION)
+ {
+#ifdef TC_M68K
+ words[0] = 0x7fff;
+ words[1] = 0;
+ words[2] = 0xffff;
+ words[3] = 0xffff;
+ words[4] = 0xffff;
+ words[5] = 0xffff;
+#else /* ! TC_M68K */
+#ifdef TC_I386
+ words[0] = 0xffff;
+ words[1] = 0xc000;
+ words[2] = 0;
+ words[3] = 0;
+ words[4] = 0;
+#else /* ! TC_I386 */
+ abort ();
+#endif /* ! TC_I386 */
+#endif /* ! TC_M68K */
+ }
else
{
words[0] = 0x7fff;
@@ -295,6 +327,27 @@ gen_to_words (words, precision, exponent_bits)
words[0] = 0x7f80;
words[1] = 0;
}
+ else if (precision == X_PRECISION)
+ {
+#ifdef TC_M68K
+ words[0] = 0x7fff;
+ words[1] = 0;
+ words[2] = 0;
+ words[3] = 0;
+ words[4] = 0;
+ words[5] = 0;
+#else /* ! TC_M68K */
+#ifdef TC_I386
+ words[0] = 0x7fff;
+ words[1] = 0x8000;
+ words[2] = 0;
+ words[3] = 0;
+ words[4] = 0;
+#else /* ! TC_I386 */
+ abort ();
+#endif /* ! TC_I386 */
+#endif /* ! TC_M68K */
+ }
else
{
words[0] = 0x7ff0;
@@ -312,6 +365,27 @@ gen_to_words (words, precision, exponent_bits)
words[0] = 0xff80;
words[1] = 0x0;
}
+ else if (precision == X_PRECISION)
+ {
+#ifdef TC_M68K
+ words[0] = 0xffff;
+ words[1] = 0;
+ words[2] = 0;
+ words[3] = 0;
+ words[4] = 0;
+ words[5] = 0;
+#else /* ! TC_M68K */
+#ifdef TC_I386
+ words[0] = 0xffff;
+ words[1] = 0x8000;
+ words[2] = 0;
+ words[3] = 0;
+ words[4] = 0;
+#else /* ! TC_I386 */
+ abort ();
+#endif /* ! TC_I386 */
+#endif /* ! TC_M68K */
+ }
else
{
words[0] = 0xfff0;
@@ -359,7 +433,7 @@ gen_to_words (words, precision, exponent_bits)
: (1 << (LITTLENUM_NUMBER_OF_BITS - 1)));
/* Assume 2's complement integers. */
- if (exponent_4 < 1 && exponent_4 >= -62)
+ if (exponent_4 <= 0)
{
int prec_bits;
int num_bits;
@@ -367,8 +441,16 @@ gen_to_words (words, precision, exponent_bits)
unget_bits (1);
num_bits = -exponent_4;
prec_bits = LITTLENUM_NUMBER_OF_BITS * precision - (exponent_bits + 1 + num_bits);
+#ifdef TC_I386
if (precision == X_PRECISION && exponent_bits == 15)
- prec_bits -= LITTLENUM_NUMBER_OF_BITS + 1;
+ {
+ /* On the i386 a denormalized extended precision float is
+ shifted down by one, effectively decreasing the exponent
+ bias by one. */
+ prec_bits -= 1;
+ num_bits += 1;
+ }
+#endif
if (num_bits >= LITTLENUM_NUMBER_OF_BITS - exponent_bits)
{
@@ -381,12 +463,10 @@ gen_to_words (words, precision, exponent_bits)
make_invalid_floating_point_number (words);
return (return_value);
}
+#ifdef TC_M68K
if (precision == X_PRECISION && exponent_bits == 15)
- {
- *lp++ = 0;
- *lp++ = 0;
- num_bits -= LITTLENUM_NUMBER_OF_BITS - 1;
- }
+ *lp++ = 0;
+#endif
while (num_bits >= LITTLENUM_NUMBER_OF_BITS)
{
num_bits -= LITTLENUM_NUMBER_OF_BITS;
@@ -400,17 +480,10 @@ gen_to_words (words, precision, exponent_bits)
if (precision == X_PRECISION && exponent_bits == 15)
{
*lp++ = word1;
+#ifdef TC_M68K
*lp++ = 0;
- if (num_bits == LITTLENUM_NUMBER_OF_BITS)
- {
- *lp++ = 0;
- *lp++ = next_bits (LITTLENUM_NUMBER_OF_BITS - 1);
- }
- else if (num_bits == LITTLENUM_NUMBER_OF_BITS - 1)
- *lp++ = 0;
- else
- *lp++ = next_bits (LITTLENUM_NUMBER_OF_BITS - 1 - num_bits);
- num_bits = 0;
+#endif
+ *lp++ = next_bits (LITTLENUM_NUMBER_OF_BITS - num_bits);
}
else
{
@@ -418,7 +491,7 @@ gen_to_words (words, precision, exponent_bits)
*lp++ = word1;
}
}
- while (lp < words + precision)
+ while (lp < words_end)
*lp++ = next_bits (LITTLENUM_NUMBER_OF_BITS);
/* Round the mantissa up, but don't change the number */
@@ -452,12 +525,12 @@ gen_to_words (words, precision, exponent_bits)
}
}
else if ((*lp & mask[prec_bits]) != mask[prec_bits])
- lp++;
+ *lp += 1;
}
return return_value;
}
- else if (exponent_4 & ~mask[exponent_bits])
+ else if (exponent_4 >= mask[exponent_bits])
{
/*
* Exponent overflow. Lose immediately.
@@ -479,16 +552,19 @@ gen_to_words (words, precision, exponent_bits)
*lp++ = word1;
- /* X_PRECISION is special: it has 16 bits of zero in the middle,
- followed by a 1 bit. */
+ /* X_PRECISION is special: on the 68k, it has 16 bits of zero in the
+ middle. Either way, it is then followed by a 1 bit. */
if (exponent_bits == 15 && precision == X_PRECISION)
{
+#ifdef TC_M68K
*lp++ = 0;
- *lp++ = 1 << (LITTLENUM_NUMBER_OF_BITS) | next_bits (LITTLENUM_NUMBER_OF_BITS - 1);
+#endif
+ *lp++ = (1 << (LITTLENUM_NUMBER_OF_BITS - 1)
+ | next_bits (LITTLENUM_NUMBER_OF_BITS - 1));
}
/* The rest of the words are just mantissa bits. */
- while (lp < words + precision)
+ while (lp < words_end)
*lp++ = next_bits (LITTLENUM_NUMBER_OF_BITS);
if (next_bits (1))
@@ -516,6 +592,23 @@ gen_to_words (words, precision, exponent_bits)
*lp = carry;
carry >>= LITTLENUM_NUMBER_OF_BITS;
}
+ if (precision == X_PRECISION && exponent_bits == 15)
+ {
+ /* Extended precision numbers have an explicit integer bit
+ that we may have to restore. */
+ if (lp == words)
+ {
+#ifdef TC_M68K
+ /* On the m68k there is a gap of 16 bits. We must
+ explicitly propagate the carry into the exponent. */
+ words[0] += words[1];
+ words[1] = 0;
+ lp++;
+#endif
+ /* Put back the integer bit. */
+ lp[1] |= 1 << (LITTLENUM_NUMBER_OF_BITS - 1);
+ }
+ }
if ((word1 ^ *words) & (1 << (LITTLENUM_NUMBER_OF_BITS - 1)))
{
/* We leave return_value alone: admit we read the
diff --git a/gnu/usr.bin/binutils/gas/config/m68k-parse.h b/gnu/usr.bin/binutils/gas/config/m68k-parse.h
index 532f56263d0..183e2b02dbd 100644
--- a/gnu/usr.bin/binutils/gas/config/m68k-parse.h
+++ b/gnu/usr.bin/binutils/gas/config/m68k-parse.h
@@ -194,6 +194,19 @@ struct m68k_indexreg
int scale;
};
+#ifdef OBJ_ELF
+/* The type of a PIC expression. */
+
+enum pic_relocation
+{
+ pic_none, /* not pic */
+ pic_plt_pcrel, /* @PLTPC */
+ pic_got_pcrel, /* @GOTPC */
+ pic_plt_off, /* @PLT */
+ pic_got_off /* @GOT */
+};
+#endif
+
/* The structure used to hold information about an expression. */
struct m68k_exp
@@ -201,6 +214,11 @@ struct m68k_exp
/* The size to use. */
enum m68k_size size;
+#ifdef OBJ_ELF
+ /* The type of pic relocation if any. */
+ enum pic_relocation pic_reloc;
+#endif
+
/* The expression itself. */
expressionS exp;
};
diff --git a/gnu/usr.bin/binutils/gas/config/m68k-parse.y b/gnu/usr.bin/binutils/gas/config/m68k-parse.y
index c6da9db8c67..66234264180 100644
--- a/gnu/usr.bin/binutils/gas/config/m68k-parse.y
+++ b/gnu/usr.bin/binutils/gas/config/m68k-parse.y
@@ -200,6 +200,16 @@ motorola_operand:
else
op->mode = DISP;
}
+ | '(' zapc ',' EXPR ')'
+ {
+ op->reg = $2;
+ op->disp = $4;
+ if (($2 >= ZADDR0 && $2 <= ZADDR7)
+ || $2 == ZPC)
+ op->mode = BASE;
+ else
+ op->mode = DISP;
+ }
| EXPR '(' zapc ')'
{
op->reg = $3;
@@ -708,6 +718,7 @@ yylex ()
char *s;
int parens;
int c = 0;
+ int tail = 0;
char *hold;
if (*str == ' ')
@@ -719,12 +730,21 @@ yylex ()
/* Various special characters are just returned directly. */
switch (*str)
{
+ case '@':
+ /* In MRI mode, this can be the start of an octal number. */
+ if (flag_mri)
+ {
+ if (isdigit (str[1])
+ || ((str[1] == '+' || str[1] == '-')
+ && isdigit (str[2])))
+ break;
+ }
+ /* Fall through. */
case '#':
case '&':
case ',':
case ')':
case '/':
- case '@':
case '[':
case ']':
return *str++;
@@ -906,7 +926,7 @@ yylex ()
yylval.exp.size = SIZE_UNSPEC;
if (s <= str + 2
|| (s[-2] != '.' && s[-2] != ':'))
- s = NULL;
+ tail = 0;
else
{
switch (s[-1])
@@ -926,14 +946,52 @@ yylex ()
yylval.exp.size = SIZE_LONG;
break;
default:
- s = NULL;
break;
}
if (yylval.exp.size != SIZE_UNSPEC)
- {
- c = s[-2];
- s[-2] = '\0';
- }
+ tail = 2;
+ }
+
+#ifdef OBJ_ELF
+ {
+ /* Look for @PLTPC, etc. */
+ char *cp;
+
+ yylval.exp.pic_reloc = pic_none;
+ cp = s - tail;
+ if (cp - 6 > str && cp[-6] == '@')
+ {
+ if (strncmp (cp - 6, "@PLTPC", 6) == 0)
+ {
+ yylval.exp.pic_reloc = pic_plt_pcrel;
+ tail += 6;
+ }
+ else if (strncmp (cp - 6, "@GOTPC", 6) == 0)
+ {
+ yylval.exp.pic_reloc = pic_got_pcrel;
+ tail += 6;
+ }
+ }
+ else if (cp - 4 > str && cp[-4] == '@')
+ {
+ if (strncmp (cp - 4, "@PLT", 4) == 0)
+ {
+ yylval.exp.pic_reloc = pic_plt_off;
+ tail += 4;
+ }
+ else if (strncmp (cp - 4, "@GOT", 4) == 0)
+ {
+ yylval.exp.pic_reloc = pic_got_off;
+ tail += 4;
+ }
+ }
+ }
+#endif
+
+ if (tail != 0)
+ {
+ c = s[-tail];
+ s[-tail] = 0;
}
hold = input_line_pointer;
@@ -942,9 +1000,9 @@ yylex ()
str = input_line_pointer;
input_line_pointer = hold;
- if (s != NULL)
+ if (tail != 0)
{
- s[-2] = c;
+ s[-tail] = c;
str = s;
}
diff --git a/gnu/usr.bin/binutils/gas/config/obj-aout.c b/gnu/usr.bin/binutils/gas/config/obj-aout.c
index 0a460646dfb..d4d8ee394f7 100644
--- a/gnu/usr.bin/binutils/gas/config/obj-aout.c
+++ b/gnu/usr.bin/binutils/gas/config/obj-aout.c
@@ -1,5 +1,6 @@
/* a.out object file format
- Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -230,6 +231,14 @@ obj_emit_relocations (where, fixP, segment_address_in_file)
for (; fixP; fixP = fixP->fx_next)
if (fixP->fx_done == 0)
{
+ symbolS *sym;
+
+ sym = fixP->fx_addsy;
+ while (sym->sy_value.X_op == O_symbol
+ && (! S_IS_DEFINED (sym) || S_IS_COMMON (sym)))
+ sym = sym->sy_value.X_add_symbol;
+ fixP->fx_addsy = sym;
+
tc_aout_fix_to_chars (*where, fixP, segment_address_in_file);
*where += md_reloc_size;
}
@@ -401,6 +410,15 @@ obj_crawl_symbol_chain (headers)
resolve_symbol_value (symbolP);
+ /* Skip symbols which were equated to undefined or common
+ symbols. */
+ if (symbolP->sy_value.X_op == O_symbol
+ && (! S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP)))
+ {
+ *symbolPP = symbol_next (symbolP);
+ continue;
+ }
+
/* OK, here is how we decide which symbols go out into the brave
new symtab. Symbols that do are:
diff --git a/gnu/usr.bin/binutils/gas/config/obj-aout.h b/gnu/usr.bin/binutils/gas/config/obj-aout.h
index 7f88e337bf1..734281749ba 100644
--- a/gnu/usr.bin/binutils/gas/config/obj-aout.h
+++ b/gnu/usr.bin/binutils/gas/config/obj-aout.h
@@ -1,5 +1,6 @@
/* obj-aout.h, a.out object file format for gas, the assembler.
- Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -91,17 +92,20 @@ extern void obj_aout_frob_file PARAMS ((void));
/* True if symbol has been defined, ie is in N_{TEXT,DATA,BSS,ABS} or N_EXT */
#define S_IS_DEFINED(s) ((S_GET_TYPE(s) != N_UNDF) || (S_GET_OTHER(s) != 0) || (S_GET_DESC(s) != 0))
+#define S_IS_COMMON(s) \
+ (S_GET_TYPE (s) == N_UNDF && S_GET_VALUE (s) != 0)
+
#define S_IS_REGISTER(s) ((s)->sy_symbol.n_type == N_REGISTER)
/* True if a debug special symbol entry */
#define S_IS_DEBUG(s) ((s)->sy_symbol.n_type & N_STAB)
/* True if a symbol is local symbol name */
-/* A symbol name whose name begin with ^A is a gas internal pseudo symbol
- nameless symbols come from .stab directives. */
-#define S_IS_LOCAL(s) (S_GET_NAME(s) && \
- !S_IS_DEBUG(s) && \
- (S_GET_NAME(s)[0] == '\001' || \
- (S_LOCAL_NAME(s) && !flag_keep_locals)))
+#define S_IS_LOCAL(s) \
+ (S_GET_NAME (s) \
+ && !S_IS_DEBUG (s) \
+ && (strchr (S_GET_NAME (s), '\001') != NULL \
+ || strchr (S_GET_NAME (s), '\002') != NULL \
+ || (S_LOCAL_NAME(s) && !flag_keep_locals)))
/* True if a symbol is not defined in this file */
#define S_IS_EXTERN(s) ((s)->sy_symbol.n_type & N_EXT)
/* True if the symbol has been generated because of a .stabd directive */
diff --git a/gnu/usr.bin/binutils/gas/config/obj-bout.c b/gnu/usr.bin/binutils/gas/config/obj-bout.c
index ba7cadc370d..0406f347408 100644
--- a/gnu/usr.bin/binutils/gas/config/obj-bout.c
+++ b/gnu/usr.bin/binutils/gas/config/obj-bout.c
@@ -1,5 +1,6 @@
/* b.out object file format
- Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -96,6 +97,14 @@ obj_emit_relocations (where, fixP, segment_address_in_file)
if (fixP->fx_done == 0
|| fixP->fx_r_type != NO_RELOC)
{
+ symbolS *sym;
+
+ sym = fixP->fx_addsy;
+ while (sym->sy_value.X_op == O_symbol
+ && (! S_IS_DEFINED (sym) || S_IS_COMMON (sym)))
+ sym = sym->sy_value.X_add_symbol;
+ fixP->fx_addsy = sym;
+
tc_bout_fix_to_chars (*where, fixP, segment_address_in_file);
*where += sizeof (struct relocation_info);
} /* if there's a symbol */
@@ -246,6 +255,15 @@ obj_crawl_symbol_chain (headers)
resolve_symbol_value (symbolP);
+ /* Skip symbols which were equated to undefined or common
+ symbols. */
+ if (symbolP->sy_value.X_op == O_symbol
+ && (! S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP)))
+ {
+ *symbolPP = symbol_next (symbolP);
+ continue;
+ }
+
/* OK, here is how we decide which symbols go out into the
brave new symtab. Symbols that do are:
diff --git a/gnu/usr.bin/binutils/gas/config/obj-bout.h b/gnu/usr.bin/binutils/gas/config/obj-bout.h
index 959ab942f8a..dddb19f9fe0 100644
--- a/gnu/usr.bin/binutils/gas/config/obj-bout.h
+++ b/gnu/usr.bin/binutils/gas/config/obj-bout.h
@@ -1,5 +1,6 @@
/* b.out object file format
- Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -181,17 +182,21 @@ struct relocation_info
/* True if symbol has been defined, ie is in N_{TEXT,DATA,BSS,ABS} or N_EXT */
#define S_IS_DEFINED(s) ((S_GET_TYPE(s) != N_UNDF) || (S_GET_DESC(s) != 0))
+
+#define S_IS_COMMON(s) \
+ (S_GET_TYPE (s) == N_UNDF && S_GET_VALUE (s) != 0)
+
#define S_IS_REGISTER(s) ((s)->sy_symbol.n_type == N_REGISTER)
/* True if a debug special symbol entry */
#define S_IS_DEBUG(s) ((s)->sy_symbol.n_type & N_STAB)
/* True if a symbol is local symbol name */
-/* A symbol name whose name begin with ^A is a gas internal pseudo symbol
- nameless symbols come from .stab directives. */
-#define S_IS_LOCAL(s) (S_GET_NAME(s) && \
- !S_IS_DEBUG(s) && \
- (S_GET_NAME(s)[0] == '\001' || \
- (S_LOCAL_NAME(s) && !flag_keep_locals)))
+#define S_IS_LOCAL(s) \
+ (S_GET_NAME (s) \
+ && !S_IS_DEBUG (s) \
+ && (strchr (S_GET_NAME (s), '\001') != NULL \
+ || strchr (S_GET_NAME (s), '\002') != NULL \
+ || (S_LOCAL_NAME(s) && !flag_keep_locals)))
/* True if a symbol is not defined in this file */
#define S_IS_EXTERN(s) ((s)->sy_symbol.n_type & N_EXT)
/* True if the symbol has been generated because of a .stabd directive */
diff --git a/gnu/usr.bin/binutils/gas/config/obj-coff.c b/gnu/usr.bin/binutils/gas/config/obj-coff.c
index 2757bb69d04..4710fc4cd69 100644
--- a/gnu/usr.bin/binutils/gas/config/obj-coff.c
+++ b/gnu/usr.bin/binutils/gas/config/obj-coff.c
@@ -1,5 +1,5 @@
/* coff object file format
- Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
Free Software Foundation, Inc.
This file is part of GAS.
@@ -15,12 +15,14 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with GAS; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
#include "as.h"
#include "obstack.h"
#include "subsegs.h"
+#include "libiberty.h"
/* I think this is probably always correct. */
#ifndef KEEP_RELOC_INFO
@@ -929,6 +931,7 @@ obj_read_begin_hook ()
symbolS *coff_last_function;
+static symbolS *coff_last_bf;
void
coff_frob_symbol (symp, punt)
@@ -959,6 +962,7 @@ coff_frob_symbol (symp, punt)
{
symbolS *real;
if (!SF_GET_LOCAL (symp)
+ && !SF_GET_STATICS (symp)
&& (real = symbol_find_base (S_GET_NAME (symp), DO_NOT_STRIP))
&& real != symp)
{
@@ -1060,6 +1064,15 @@ coff_frob_symbol (symp, punt)
&& ! *punt)
set_end = next_set_end;
+ if (! *punt
+ && S_GET_STORAGE_CLASS (symp) == C_FCN
+ && strcmp (S_GET_NAME (symp), ".bf") == 0)
+ {
+ if (coff_last_bf != NULL)
+ SA_SET_SYM_ENDNDX (coff_last_bf, symp);
+ coff_last_bf = symp;
+ }
+
if (coffsymbol (symp->bsym)->lineno)
{
int i;
@@ -1228,6 +1241,8 @@ obj_coff_section (ignore)
bfd_section_name (stdoutput, sec),
bfd_errmsg (bfd_get_error ()));
}
+
+ demand_empty_rest_of_line ();
}
void
@@ -1361,6 +1376,10 @@ symbol_dump ()
#include "libbfd.h"
#include "libcoff.h"
+#ifdef TE_PE
+#include "coff/pe.h"
+#endif
+
/* The NOP_OPCODE is for the alignment fill value. Fill with nop so
that we can stick sections together without causing trouble. */
#ifndef NOP_OPCODE
@@ -1378,16 +1397,10 @@ symbol_dump ()
const short seg_N_TYPE[] =
{ /* in: segT out: N_TYPE bits */
C_ABS_SECTION,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9,
- 10,
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
C_UNDEF_SECTION, /* SEG_UNKNOWN */
C_UNDEF_SECTION, /* SEG_GOOF */
C_UNDEF_SECTION, /* SEG_EXPR */
@@ -1447,42 +1460,39 @@ void obj_coff_section PARAMS ((int));
/* Section stuff
We allow more than just the standard 3 sections, infact, we allow
- 10 sections, (though the usual three have to be there).
+ 40 sections, (though the usual three have to be there).
This structure performs the mappings for us:
-
*/
-#define N_SEG 32
+
typedef struct
{
segT seg_t;
int i;
} seg_info_type;
-static const seg_info_type seg_info_off_by_4[N_SEG] =
+static const seg_info_type seg_info_off_by_4[] =
{
{SEG_PTV, },
{SEG_NTV, },
{SEG_DEBUG, },
{SEG_ABSOLUTE, },
{SEG_UNKNOWN, },
- {SEG_E0},
- {SEG_E1},
- {SEG_E2},
- {SEG_E3},
- {SEG_E4},
- {SEG_E5},
- {SEG_E6},
- {SEG_E7},
- {SEG_E8},
- {SEG_E9},
- {(segT)15},
- {(segT)16},
- {(segT)17},
- {(segT)18},
- {(segT)19},
- {(segT)20},
+ {SEG_E0}, {SEG_E1}, {SEG_E2}, {SEG_E3}, {SEG_E4},
+ {SEG_E5}, {SEG_E6}, {SEG_E7}, {SEG_E8}, {SEG_E9},
+ {SEG_E10},{SEG_E11},{SEG_E12},{SEG_E13},{SEG_E14},
+ {SEG_E15},{SEG_E16},{SEG_E17},{SEG_E18},{SEG_E19},
+ {SEG_E20},{SEG_E21},{SEG_E22},{SEG_E23},{SEG_E24},
+ {SEG_E25},{SEG_E26},{SEG_E27},{SEG_E28},{SEG_E29},
+ {SEG_E30},{SEG_E31},{SEG_E32},{SEG_E33},{SEG_E34},
+ {SEG_E35},{SEG_E36},{SEG_E37},{SEG_E38},{SEG_E39},
+ {(segT)40},
+ {(segT)41},
+ {(segT)42},
+ {(segT)43},
+ {(segT)44},
+ {(segT)45},
{(segT)0},
{(segT)0},
{(segT)0},
@@ -1550,6 +1560,7 @@ size_section (abfd, idx)
size += frag->fr_offset * frag->fr_var;
break;
case rs_align:
+ case rs_align_code:
size += frag->fr_fix;
size += relax_align (size, frag->fr_offset);
break;
@@ -1576,7 +1587,7 @@ count_entries_in_chain (idx)
nrelocs = 0;
while (fixup_ptr != (fixS *) NULL)
{
- if (TC_COUNT_RELOC (fixup_ptr))
+ if (fixup_ptr->fx_done == 0 && TC_COUNT_RELOC (fixup_ptr))
{
#ifdef TC_A29K
if (fixup_ptr->fx_r_type == RELOC_CONSTH)
@@ -1593,6 +1604,25 @@ count_entries_in_chain (idx)
return nrelocs;
}
+#ifdef TE_AUX
+
+static int compare_external_relocs PARAMS ((const PTR, const PTR));
+
+/* AUX's ld expects relocations to be sorted */
+static int
+compare_external_relocs (x, y)
+ const PTR x;
+ const PTR y;
+{
+ struct external_reloc *a = (struct external_reloc *) x;
+ struct external_reloc *b = (struct external_reloc *) y;
+ bfd_vma aadr = bfd_getb32 (a->r_vaddr);
+ bfd_vma badr = bfd_getb32 (b->r_vaddr);
+ return (aadr < badr ? -1 : badr < aadr ? 1 : 0);
+}
+
+#endif
+
/* output all the relocations for a section */
void
do_relocs_for (abfd, h, file_cursor)
@@ -1604,7 +1634,7 @@ do_relocs_for (abfd, h, file_cursor)
unsigned int idx;
unsigned long reloc_start = *file_cursor;
- for (idx = SEG_E0; idx < SEG_E9; idx++)
+ for (idx = SEG_E0; idx < SEG_LAST; idx++)
{
if (segment_info[idx].scnhdr.s_name[0])
{
@@ -1632,7 +1662,7 @@ do_relocs_for (abfd, h, file_cursor)
struct internal_reloc intr;
/* Only output some of the relocations */
- if (TC_COUNT_RELOC (fix_ptr))
+ if (fix_ptr->fx_done == 0 && TC_COUNT_RELOC (fix_ptr))
{
#ifdef TC_RELOC_MANGLE
TC_RELOC_MANGLE (&segment_info[idx], fix_ptr, &intr,
@@ -1652,6 +1682,11 @@ do_relocs_for (abfd, h, file_cursor)
intr.r_offset = 0;
#endif
+ while (symbol_ptr->sy_value.X_op == O_symbol
+ && (! S_IS_DEFINED (symbol_ptr)
+ || S_IS_COMMON (symbol_ptr)))
+ symbol_ptr = symbol_ptr->sy_value.X_add_symbol;
+
/* Turn the segment of the symbol into an offset. */
if (symbol_ptr)
{
@@ -1696,6 +1731,12 @@ do_relocs_for (abfd, h, file_cursor)
fix_ptr = fix_ptr->fx_next;
}
+#ifdef TE_AUX
+ /* Sort the reloc table */
+ qsort ((PTR) external_reloc_vec, nrelocs,
+ sizeof (struct external_reloc), compare_external_relocs);
+#endif
+
/* Write out the reloc table */
bfd_write ((PTR) external_reloc_vec, 1, external_reloc_size,
abfd);
@@ -1801,6 +1842,7 @@ fill_section (abfd, h, file_cursor)
assert (frag->fr_symbol == 0);
case rs_fill:
case rs_align:
+ case rs_align_code:
case rs_org:
if (frag->fr_fix)
{
@@ -1880,14 +1922,31 @@ coff_header_append (abfd, h)
bfd_write (buffer, i, 1, abfd);
bfd_write (buffero, H_GET_SIZEOF_OPTIONAL_HEADER (h), 1, abfd);
- for (i = SEG_E0; i < SEG_E9; i++)
+ for (i = SEG_E0; i < SEG_LAST; i++)
{
+#ifdef COFF_LONG_SECTION_NAMES
+ unsigned long string_size = 4;
+#endif
+
if (segment_info[i].scnhdr.s_name[0])
{
- unsigned int size =
- bfd_coff_swap_scnhdr_out (abfd,
- &(segment_info[i].scnhdr),
- buffer);
+ unsigned int size;
+
+#ifdef COFF_LONG_SECTION_NAMES
+ /* Support long section names as found in PE. This code
+ must coordinate with that in write_object_file and
+ w_strings. */
+ if (strlen (segment_info[i].name) > SCNNMLEN)
+ {
+ memset (segment_info[i].scnhdr.s_name, 0, SCNNMLEN);
+ sprintf (segment_info[i].scnhdr.s_name, "/%lu", string_size);
+ string_size += strlen (segment_info[i].name) + 1;
+ }
+#endif
+
+ size = bfd_coff_swap_scnhdr_out (abfd,
+ &(segment_info[i].scnhdr),
+ buffer);
if (size == 0)
as_bad ("bfd_coff_swap_scnhdr_out failed");
bfd_write (buffer, size, 1, abfd);
@@ -2110,6 +2169,8 @@ obj_coff_endef (ignore)
SA_GET_SYM_LNNOPTR (last_line_symbol) = function_lineoff;
SF_SET_PROCESS (last_line_symbol);
+ SF_SET_ADJ_LNNOPTR (last_line_symbol);
+ SF_SET_PROCESS (def_symbol_in_progress);
function_lineoff = -1;
}
/* Value is always set to . */
@@ -2466,6 +2527,24 @@ obj_coff_val (ignore)
demand_empty_rest_of_line ();
}
+#ifdef TE_PE
+
+/* Handle the .linkonce pseudo-op. This is parsed by s_linkonce in
+ read.c, which then calls this object file format specific routine. */
+
+void
+obj_coff_pe_handle_link_once (type)
+ enum linkonce_type type;
+{
+ seg_info (now_seg)->scnhdr.s_flags |= IMAGE_SCN_LNK_COMDAT;
+
+ /* We store the type in the seg_info structure, and use it to set up
+ the auxiliary entry for the section symbol in c_section_symbol. */
+ seg_info (now_seg)->linkonce = type;
+}
+
+#endif /* TE_PE */
+
void
obj_read_begin_hook ()
{
@@ -2490,6 +2569,7 @@ symbolS *symbol_extern_lastP;
stack *block_stack;
symbolS *last_functionP;
+static symbolS *last_bfP;
symbolS *last_tagP;
static unsigned int
@@ -2521,6 +2601,7 @@ yank_symbols ()
/* L* and C_EFCN symbols never merge. */
if (!SF_GET_LOCAL (symbolP)
+ && !SF_GET_STATICS (symbolP)
&& S_GET_STORAGE_CLASS (symbolP) != C_LABEL
&& symbolP->sy_value.X_op == O_constant
&& (real_symbolP = symbol_find_base (S_GET_NAME (symbolP), DO_NOT_STRIP))
@@ -2606,11 +2687,19 @@ yank_symbols ()
sizeof (symbolP->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_ary.x_dimen));
#endif
}
- /* The C_FCN doesn't need any additional information. I
- don't even know if this is needed for sdb. But the
- standard assembler generates it, so... */
- if (S_GET_STORAGE_CLASS (symbolP) == C_EFCN)
+ if (S_GET_STORAGE_CLASS (symbolP) == C_FCN)
+ {
+ if (strcmp (S_GET_NAME (symbolP), ".bf") == 0)
+ {
+ if (last_bfP != NULL)
+ SA_SET_SYM_ENDNDX (last_bfP, symbol_number);
+ last_bfP = symbolP;
+ }
+ }
+ else if (S_GET_STORAGE_CLASS (symbolP) == C_EFCN)
{
+ /* I don't even know if this is needed for sdb. But
+ the standard assembler generates it, so... */
if (last_functionP == (symbolS *) 0)
as_fatal ("C_EFCN symbol out of scope");
SA_SET_SYM_FSIZE (last_functionP,
@@ -2637,7 +2726,8 @@ yank_symbols ()
{
/* If the filename was too long to fit in the
auxent, put it in the string table */
- if (SA_GET_FILE_FNAME_ZEROS (symbolP) == 0)
+ if (SA_GET_FILE_FNAME_ZEROS (symbolP) == 0
+ && SA_GET_FILE_FNAME_OFFSET (symbolP) != 0)
{
SA_SET_FILE_FNAME_OFFSET (symbolP, string_byte_count);
string_byte_count += strlen (filename_list_scan->filename) + 1;
@@ -2669,6 +2759,13 @@ yank_symbols ()
symbol_remove (symbolP, &symbol_rootP, &symbol_lastP);
}
+ else if (symbolP->sy_value.X_op == O_symbol
+ && (! S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP)))
+ {
+ /* Skip symbols which were equated to undefined or common
+ symbols. */
+ symbol_remove (symbolP, &symbol_rootP, &symbol_lastP);
+ }
else if (!S_IS_DEFINED (symbolP)
&& !S_IS_DEBUG (symbolP)
&& !SF_GET_STATICS (symbolP) &&
@@ -2814,18 +2911,10 @@ crawl_symbols (h, abfd)
*/
- for (i = SEG_E0; i < SEG_E9; i++)
- {
- if (segment_info[i].scnhdr.s_name[0])
- {
- char name[9];
-
- strncpy (name, segment_info[i].scnhdr.s_name, 8);
- name[8] = '\0';
- segment_info[i].dot = c_section_symbol (name, i - SEG_E0 + 1);
- }
- }
-
+ for (i = SEG_E0; i < SEG_LAST; i++)
+ if (segment_info[i].scnhdr.s_name[0])
+ segment_info[i].dot = c_section_symbol (segment_info[i].name,
+ i - SEG_E0 + 1);
/* Take all the externals out and put them into another chain */
H_SET_SYMBOL_TABLE_SIZE (h, yank_symbols ());
@@ -2858,6 +2947,28 @@ w_strings (where)
/* Gotta do md_ byte-ordering stuff for string_byte_count first - KWK */
md_number_to_chars (where, (valueT) string_byte_count, 4);
where += 4;
+
+#ifdef COFF_LONG_SECTION_NAMES
+ /* Support long section names as found in PE. This code must
+ coordinate with that in coff_header_append and write_object_file. */
+ {
+ unsigned int i;
+
+ for (i = SEG_E0; i < SEG_LAST; i++)
+ {
+ if (segment_info[i].scnhdr.s_name[0]
+ && strlen (segment_info[i].name) > SCNNMLEN)
+ {
+ unsigned int size;
+
+ size = strlen (segment_info[i].name) + 1;
+ memcpy (where, segment_info[i].name, size);
+ where += size;
+ }
+ }
+ }
+#endif /* COFF_LONG_SECTION_NAMES */
+
for (symbolP = symbol_rootP;
symbolP;
symbolP = symbol_next (symbolP))
@@ -2871,7 +2982,8 @@ w_strings (where)
where += size;
}
if (S_GET_STORAGE_CLASS (symbolP) == C_FILE
- && SA_GET_FILE_FNAME_ZEROS (symbolP) == 0)
+ && SA_GET_FILE_FNAME_ZEROS (symbolP) == 0
+ && SA_GET_FILE_FNAME_OFFSET (symbolP) != 0)
{
size = strlen (filename_list_scan->filename) + 1;
memcpy (where, filename_list_scan->filename, size);
@@ -2890,7 +3002,7 @@ do_linenos_for (abfd, h, file_cursor)
unsigned int idx;
unsigned long start = *file_cursor;
- for (idx = SEG_E0; idx < SEG_E9; idx++)
+ for (idx = SEG_E0; idx < SEG_LAST; idx++)
{
segment_info_type *s = segment_info + idx;
@@ -2972,7 +3084,7 @@ extern void
write_object_file ()
{
int i;
- char *name;
+ const char *name;
struct frchain *frchain_ptr;
object_headers headers;
@@ -3008,7 +3120,7 @@ write_object_file ()
#ifdef md_do_align
{
static char nop = NOP_OPCODE;
- md_do_align (SUB_SEGMENT_ALIGN (now_seg), &nop, alignment_done);
+ md_do_align (SUB_SEGMENT_ALIGN (now_seg), &nop, 1, alignment_done);
}
#endif
frag_align (SUB_SEGMENT_ALIGN (now_seg), NOP_OPCODE);
@@ -3044,6 +3156,19 @@ write_object_file ()
{
H_SET_NUMBER_OF_SECTIONS (&headers,
H_GET_NUMBER_OF_SECTIONS (&headers) + 1);
+
+#ifdef COFF_LONG_SECTION_NAMES
+ /* Support long section names as found in PE. This code
+ must coordinate with that in coff_header_append and
+ w_strings. */
+ {
+ unsigned int len;
+
+ len = strlen (segment_info[i].name);
+ if (len > SCNNMLEN)
+ string_byte_count += len + 1;
+ }
+#endif /* COFF_LONG_SECTION_NAMES */
}
size = size_section (abfd, (unsigned int) i);
@@ -3051,7 +3176,7 @@ write_object_file ()
/* I think the section alignment is only used on the i960; the
i960 needs it, and it should do no harm on other targets. */
- segment_info[i].scnhdr.s_align = section_alignment[i];
+ segment_info[i].scnhdr.s_align = 1 << section_alignment[i];
if (i == SEG_E0)
H_SET_TEXT_SIZE (&headers, size);
@@ -3083,7 +3208,7 @@ write_object_file ()
correctly. */
for (i = SEG_E0; i < SEG_UNKNOWN; i++)
{
- name = segment_info[i].scnhdr.s_name;
+ name = segment_info[i].name;
if (name != NULL
&& strncmp (".stab", name, 5) == 0
@@ -3161,22 +3286,21 @@ segT
obj_coff_add_segment (name)
const char *name;
{
- unsigned int len;
unsigned int i;
- /* Find out if we've already got a section of this name. */
- len = strlen (name);
- if (len < sizeof (segment_info[i].scnhdr.s_name))
- ++len;
- else
- len = sizeof (segment_info[i].scnhdr.s_name);
- for (i = SEG_E0; i < SEG_E9 && segment_info[i].scnhdr.s_name[0]; i++)
- if (strncmp (segment_info[i].scnhdr.s_name, name, len) == 0
- && (len == sizeof (segment_info[i].scnhdr.s_name)
- || segment_info[i].scnhdr.s_name[len] == '\0'))
+#ifndef COFF_LONG_SECTION_NAMES
+ char buf[SCNNMLEN + 1];
+
+ strncpy (buf, name, SCNNMLEN);
+ buf[SCNNMLEN] = '\0';
+ name = buf;
+#endif
+
+ for (i = SEG_E0; i < SEG_LAST && segment_info[i].scnhdr.s_name[0]; i++)
+ if (strcmp (name, segment_info[i].name) == 0)
return (segT) i;
- if (i == SEG_E9)
+ if (i == SEG_LAST)
{
as_bad ("Too many new sections; can't add \"%s\"", name);
return now_seg;
@@ -3186,6 +3310,7 @@ obj_coff_add_segment (name)
strncpy (segment_info[i].scnhdr.s_name, name,
sizeof (segment_info[i].scnhdr.s_name));
segment_info[i].scnhdr.s_flags = STYP_REG;
+ segment_info[i].name = xstrdup (name);
return (segT) i;
}
@@ -3211,11 +3336,8 @@ obj_coff_section (ignore)
int ignore;
{
/* Strip out the section name */
- char *section_name;
- char *section_name_end;
+ char *section_name, *name;
char c;
- int argp;
- unsigned int len;
unsigned int exp;
long flags;
@@ -3236,26 +3358,21 @@ obj_coff_section (ignore)
section_name = input_line_pointer;
c = get_symbol_end ();
- section_name_end = input_line_pointer;
- len = section_name_end - section_name;
- input_line_pointer++;
- SKIP_WHITESPACE ();
+ name = xmalloc (input_line_pointer - section_name + 1);
+ strcpy (name, section_name);
- argp = 0;
- if (c == ',')
- argp = 1;
- else if (*input_line_pointer == ',')
- {
- argp = 1;
- ++input_line_pointer;
- SKIP_WHITESPACE ();
- }
+ *input_line_pointer = c;
exp = 0;
flags = 0;
- if (argp)
+
+ SKIP_WHITESPACE ();
+ if (*input_line_pointer == ',')
{
+ ++input_line_pointer;
+ SKIP_WHITESPACE ();
+
if (*input_line_pointer != '"')
exp = get_absolute_expression ();
else
@@ -3286,11 +3403,11 @@ obj_coff_section (ignore)
}
}
- subseg_new (section_name, (subsegT) exp);
+ subseg_new (name, (subsegT) exp);
segment_info[now_seg].scnhdr.s_flags |= flags;
- *section_name_end = c;
+ demand_empty_rest_of_line ();
}
@@ -3423,7 +3540,7 @@ c_dot_file_symbol (filename)
f->next = 0;
SA_SET_FILE_FNAME_ZEROS (symbolP, 0);
- SA_SET_FILE_FNAME_OFFSET (symbolP, 0);
+ SA_SET_FILE_FNAME_OFFSET (symbolP, 1);
if (filename_list_tail)
filename_list_tail->next = f;
@@ -3486,6 +3603,36 @@ c_section_symbol (name, idx)
SF_SET_STATICS (symbolP);
+#ifdef TE_PE
+ /* If the .linkonce pseudo-op was used for this section, we must
+ store the information in the auxiliary entry for the section
+ symbol. */
+ if (segment_info[idx].linkonce != LINKONCE_UNSET)
+ {
+ int type;
+
+ switch (segment_info[idx].linkonce)
+ {
+ default:
+ abort ();
+ case LINKONCE_DISCARD:
+ type = IMAGE_COMDAT_SELECT_ANY;
+ break;
+ case LINKONCE_ONE_ONLY:
+ type = IMAGE_COMDAT_SELECT_NODUPLICATES;
+ break;
+ case LINKONCE_SAME_SIZE:
+ type = IMAGE_COMDAT_SELECT_SAME_SIZE;
+ break;
+ case LINKONCE_SAME_CONTENTS:
+ type = IMAGE_COMDAT_SELECT_EXACT_MATCH;
+ break;
+ }
+
+ SYM_AUXENT (symbolP)->x_scn.x_comdat = type;
+ }
+#endif /* TE_PE */
+
return symbolP;
} /* c_section_symbol() */
@@ -3499,7 +3646,7 @@ w_symbols (abfd, where, symbol_rootP)
unsigned int i;
/* First fill in those values we have only just worked out */
- for (i = SEG_E0; i < SEG_E9; i++)
+ for (i = SEG_E0; i < SEG_LAST; i++)
{
symbolP = segment_info[i].dot;
if (symbolP)
@@ -3519,6 +3666,15 @@ w_symbols (abfd, where, symbol_rootP)
to the string in memory but must be a file offset. */
register char *temp;
+ /* We can't fix the lnnoptr field in yank_symbols with the other
+ adjustments, because we have to wait until we know where they
+ go in the file. */
+ if (SF_GET_ADJ_LNNOPTR (symbolP))
+ {
+ SA_GET_SYM_LNNOPTR (symbolP) +=
+ segment_info[S_GET_SEGMENT (symbolP)].scnhdr.s_lnnoptr;
+ }
+
tc_coff_symbol_emit_hook (symbolP);
temp = S_GET_NAME (symbolP);
@@ -3618,13 +3774,15 @@ fixup_mdeps (frags, h, this_segment)
switch (frags->fr_type)
{
case rs_align:
+ case rs_align_code:
case rs_org:
#ifdef HANDLE_ALIGN
HANDLE_ALIGN (frags);
#endif
frags->fr_type = rs_fill;
frags->fr_offset =
- (frags->fr_next->fr_address - frags->fr_address - frags->fr_fix);
+ ((frags->fr_next->fr_address - frags->fr_address - frags->fr_fix)
+ / frags->fr_var);
break;
case rs_machine_dependent:
md_convert_frag (h, this_segment, frags);
@@ -3659,9 +3817,6 @@ fixup_segment (segP, this_segment_type)
register fragS *fragP;
register segT add_symbol_segment = absolute_section;
- if (linkrelax)
- return;
-
for (fixP = segP->fix_root; fixP; fixP = fixP->fx_next)
{
fragP = fixP->fx_frag;
@@ -3670,6 +3825,22 @@ fixup_segment (segP, this_segment_type)
place = fragP->fr_literal + where;
size = fixP->fx_size;
add_symbolP = fixP->fx_addsy;
+ sub_symbolP = fixP->fx_subsy;
+ add_number = fixP->fx_offset;
+ pcrel = fixP->fx_pcrel;
+
+ /* We want function-relative stabs to work on systems which
+ may use a relaxing linker; thus we must handle the sym1-sym2
+ fixups function-relative stabs generates.
+
+ Of course, if you actually enable relaxing in the linker, the
+ line and block scoping information is going to be incorrect
+ in some cases. The only way to really fix this is to support
+ a reloc involving the difference of two symbols. */
+ if (linkrelax
+ && (!sub_symbolP || pcrel))
+ continue;
+
#ifdef TC_I960
if (fixP->fx_tcbit && SF_GET_CALLNAME (add_symbolP))
{
@@ -3686,9 +3857,6 @@ fixup_segment (segP, this_segment_type)
fixP->fx_addsy = add_symbolP = tc_get_bal_of_call (add_symbolP);
}
#endif
- sub_symbolP = fixP->fx_subsy;
- add_number = fixP->fx_offset;
- pcrel = fixP->fx_pcrel;
if (add_symbolP != NULL
&& add_symbolP->sy_mri_common)
@@ -3853,7 +4021,7 @@ fixup_segment (segP, this_segment_type)
default:
-#if defined(TC_A29K) || (defined(TE_PE) && defined(TC_I386))
+#if defined(TC_A29K) || (defined(TE_PE) && defined(TC_I386)) || defined(TC_M88K)
/* This really should be handled in the linker, but
backward compatibility forbids. */
add_number += S_GET_VALUE (add_symbolP);
@@ -3879,7 +4047,7 @@ fixup_segment (segP, this_segment_type)
continue;
} /* COBR */
#endif /* TC_I960 */
-#if (defined (TC_I386) || defined (TE_LYNX)) && !defined(TE_PE)
+#if (defined (TC_I386) || defined (TE_LYNX) || defined (TE_AUX)) && !defined(TE_PE)
/* 386 COFF uses a peculiar format in which the
value of a common symbol is stored in the .text
segment (I've checked this on SVR3.2 and SCO
@@ -3972,8 +4140,8 @@ obj_coff_init_stab_section (seg)
/* Zero it out. */
memset (p, 0, 12);
as_where (&file, (unsigned int *) NULL);
- stabstr_name = (char *) alloca (strlen (segment_info[seg].scnhdr.s_name) + 4);
- strcpy (stabstr_name, segment_info[seg].scnhdr.s_name);
+ stabstr_name = (char *) alloca (strlen (segment_info[seg].name) + 4);
+ strcpy (stabstr_name, segment_info[seg].name);
strcat (stabstr_name, "str");
stroff = get_stab_string_offset (file, stabstr_name);
know (stroff == 1);
@@ -3988,21 +4156,22 @@ adjust_stab_section(abfd, seg)
segT seg;
{
segT stabstrseg = SEG_UNKNOWN;
- char *secname, *name, *name2;
+ const char *secname, *name2;
+ char *name;
char *p = NULL;
int i, strsz = 0, nsyms;
fragS *frag = segment_info[seg].frchainP->frch_root;
/* Look for the associated string table section. */
- secname = segment_info[seg].scnhdr.s_name;
+ secname = segment_info[seg].name;
name = (char *) alloca (strlen (secname) + 4);
strcpy (name, secname);
strcat (name, "str");
for (i = SEG_E0; i < SEG_UNKNOWN; i++)
{
- name2 = segment_info[i].scnhdr.s_name;
+ name2 = segment_info[i].name;
if (name2 != NULL && strncmp(name2, name, 8) == 0)
{
stabstrseg = i;
diff --git a/gnu/usr.bin/binutils/gas/config/obj-coff.h b/gnu/usr.bin/binutils/gas/config/obj-coff.h
index b40bd3edba9..02b3da629b6 100644
--- a/gnu/usr.bin/binutils/gas/config/obj-coff.h
+++ b/gnu/usr.bin/binutils/gas/config/obj-coff.h
@@ -1,5 +1,5 @@
/* coff object file format
- Copyright (C) 1989, 90, 91, 92, 94, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90, 91, 92, 94, 95, 1996 Free Software Foundation, Inc.
This file is part of GAS.
@@ -14,8 +14,9 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with GAS; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
#ifndef OBJ_FORMAT_H
#define OBJ_FORMAT_H
@@ -415,7 +416,7 @@ typedef struct
#define C_DEBUG_SECTION N_DEBUG
#define C_NTV_SECTION N_TV
#define C_PTV_SECTION P_TV
-#define C_REGISTER_SECTION 20
+#define C_REGISTER_SECTION 50
/*
* Macros to extract information from a symbol table entry.
@@ -441,7 +442,8 @@ typedef struct
#define S_IS_LOCAL(s) \
((s)->sy_symbol.ost_entry.n_scnum == C_REGISTER_SECTION \
|| (S_LOCAL_NAME(s) && !flag_keep_locals) \
- || (strchr (S_GET_NAME (s), '\001') != NULL))
+ || strchr (S_GET_NAME (s), '\001') != NULL \
+ || strchr (S_GET_NAME (s), '\002') != NULL)
/* True if a symbol is not defined in this file */
#define S_IS_EXTERN(s) ((s)->sy_symbol.ost_entry.n_scnum == 0 \
&& S_GET_VALUE (s) == 0)
@@ -551,6 +553,7 @@ typedef struct
#define SF_TAG (0x00080000) /* Is a tag */
#define SF_DEBUG (0x00100000) /* Is in debug or abs section */
#define SF_GET_SEGMENT (0x00200000) /* Get the section of the forward symbol. */
+#define SF_ADJ_LNNOPTR (0x00400000) /* Has a lnnoptr */
/* All other bits are unused. */
/* Accessors */
@@ -568,6 +571,7 @@ typedef struct
#define SF_GET_TAGGED(s) (SF_GET (s) & SF_TAGGED)
#define SF_GET_TAG(s) (SF_GET (s) & SF_TAG)
#define SF_GET_GET_SEGMENT(s) (SF_GET (s) & SF_GET_SEGMENT)
+#define SF_GET_ADJ_LNNOPTR(s) (SF_GET (s) & SF_ADJ_LNNOPTR)
#define SF_GET_I960(s) (SF_GET (s) & SF_I960_MASK) /* used by i960 */
#define SF_GET_BALNAME(s) (SF_GET (s) & SF_BALNAME) /* used by i960 */
#define SF_GET_CALLNAME(s) (SF_GET (s) & SF_CALLNAME) /* used by i960 */
@@ -590,6 +594,7 @@ typedef struct
#define SF_SET_TAGGED(s) (SF_GET (s) |= SF_TAGGED)
#define SF_SET_TAG(s) (SF_GET (s) |= SF_TAG)
#define SF_SET_GET_SEGMENT(s) (SF_GET (s) |= SF_GET_SEGMENT)
+#define SF_SET_ADJ_LNNOPTR(s) (SF_GET (s) |= SF_ADJ_LNNOPTR)
#define SF_SET_I960(s,v) (SF_GET (s) |= ((v) & SF_I960_MASK)) /* used by i960 */
#define SF_SET_BALNAME(s) (SF_GET (s) |= SF_BALNAME) /* used by i960 */
#define SF_SET_CALLNAME(s) (SF_GET (s) |= SF_CALLNAME) /* used by i960 */
@@ -769,6 +774,11 @@ extern struct internal_scnhdr text_section_header;
? (S_SET_SEGMENT (dest, S_GET_SEGMENT (src)), 0) \
: 0)
+#ifdef TE_PE
+#define obj_handle_link_once(t) obj_coff_pe_handle_link_once (t)
+extern void obj_coff_pe_handle_link_once ();
+#endif
+
#endif /* not BFD_ASSEMBLER */
/* Stabs in a coff file go into their own section. */
diff --git a/gnu/usr.bin/binutils/gas/config/obj-elf.c b/gnu/usr.bin/binutils/gas/config/obj-elf.c
index 2ab7e256403..84eeb17ae06 100644
--- a/gnu/usr.bin/binutils/gas/config/obj-elf.c
+++ b/gnu/usr.bin/binutils/gas/config/obj-elf.c
@@ -1,5 +1,5 @@
/* ELF object file format
- Copyright (C) 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -13,9 +13,10 @@
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 GAS; see the file COPYING. If not, write
- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
#define OBJ_HEADER "obj-elf.h"
#include "as.h"
@@ -36,6 +37,10 @@
#include "elf/mips.h"
#endif
+#ifdef TC_PPC
+#include "elf/ppc.h"
+#endif
+
#ifdef NEED_ECOFF_DEBUG
static boolean elf_get_extr PARAMS ((asymbol *, EXTR *));
static void elf_set_index PARAMS ((asymbol *, bfd_size_type));
@@ -501,12 +506,12 @@ obj_elf_section (xxx)
if (flag_mri)
{
- char type;
+ char mri_type;
previous_section = now_seg;
previous_subsection = now_subseg;
- s_mri_sect (&type);
+ s_mri_sect (&mri_type);
#ifdef md_elf_section_change_hook
md_elf_section_change_hook ();
@@ -597,9 +602,20 @@ obj_elf_section (xxx)
attr |= SHF_EXECINSTR;
break;
default:
- as_warn ("Bad .section directive: want a,w,x in string");
- ignore_rest_of_line ();
- return;
+ {
+ char *bad_msg = "Bad .section directive: want a,w,x in string";
+#ifdef md_elf_section_letter
+ int md_attr = md_elf_section_letter (*input_line_pointer, &bad_msg);
+ if (md_attr)
+ attr |= md_attr;
+ else
+#endif
+ {
+ as_warn (bad_msg);
+ ignore_rest_of_line ();
+ return;
+ }
+ }
}
++input_line_pointer;
}
@@ -629,8 +645,16 @@ obj_elf_section (xxx)
}
else
{
- as_warn ("Unrecognized section type");
- ignore_rest_of_line ();
+#ifdef md_elf_section_type
+ int md_type = md_elf_section_type (&input_line_pointer);
+ if (md_type)
+ type = md_type;
+ else
+#endif
+ {
+ as_warn ("Unrecognized section type");
+ ignore_rest_of_line ();
+ }
}
}
}
@@ -667,9 +691,17 @@ obj_elf_section (xxx)
}
else
{
- as_warn ("Unrecognized section attribute");
- ignore_rest_of_line ();
- return;
+#ifdef md_elf_section_word
+ int md_attr = md_elf_section_word (&input_line_pointer);
+ if (md_attr)
+ attr |= md_attr;
+ else
+#endif
+ {
+ as_warn ("Unrecognized section attribute");
+ ignore_rest_of_line ();
+ return;
+ }
}
SKIP_WHITESPACE ();
}
@@ -699,7 +731,8 @@ obj_elf_section (xxx)
flags = (SEC_RELOC
| ((attr & SHF_WRITE) ? 0 : SEC_READONLY)
- | ((attr & SHF_ALLOC) ? SEC_ALLOC | SEC_LOAD : 0)
+ | ((attr & SHF_ALLOC) ? SEC_ALLOC : 0)
+ | (((attr & SHF_ALLOC) && type != SHT_NOBITS) ? SEC_LOAD : 0)
| ((attr & SHF_EXECINSTR) ? SEC_CODE : 0));
if (special_sections[i].name == NULL)
{
@@ -710,6 +743,10 @@ obj_elf_section (xxx)
flags |= SEC_ALLOC;
flags &=~ SEC_LOAD;
}
+
+#ifdef md_elf_section_flags
+ flags = md_elf_section_flags (flags, attr, type);
+#endif
}
bfd_set_section_flags (stdoutput, sec, flags);
@@ -903,10 +940,7 @@ obj_elf_size (ignore)
.type SYM,@function
The third (reportedly to be used on Irix 6.0) is
.type SYM STT_FUNC
-
- FIXME: We do not fully support this pseudo-op. In fact, the only
- case we do support is setting the type to STT_FUNC, which we do by
- setting the BSF_FUNCTION flag. */
+ */
static void
obj_elf_type (ignore)
@@ -940,7 +974,7 @@ obj_elf_type (ignore)
type = BSF_FUNCTION;
else if (strcmp (typename, "object") == 0
|| strcmp (typename, "STT_OBJECT") == 0)
- ;
+ type = BSF_OBJECT;
else
as_bad ("ignoring unrecognized symbol type \"%s\"", typename);
@@ -1115,9 +1149,9 @@ elf_frob_symbol (symp, puntp)
as_bad (".size expression too complicated to fix up");
break;
}
+ free (symp->sy_obj);
+ symp->sy_obj = 0;
}
- free (symp->sy_obj);
- symp->sy_obj = 0;
/* Double check weak symbols. */
if (symp->bsym->flags & BSF_WEAK)
@@ -1126,6 +1160,22 @@ elf_frob_symbol (symp, puntp)
as_bad ("Symbol `%s' can not be both weak and common",
S_GET_NAME (symp));
}
+
+#ifdef TC_MIPS
+ /* The Irix 5 assembler appears to set the type of any common symbol
+ to STT_OBJECT. We try to be compatible, since the Irix 5 linker
+ apparently sometimes cares. FIXME: What about Irix 6? */
+ if (S_IS_COMMON (symp))
+ symp->bsym->flags |= BSF_OBJECT;
+#endif
+
+#ifdef TC_PPC
+ /* Frob the PowerPC, so that the symbol always has object type
+ if it is not some other type. VxWorks needs this. */
+ if ((symp->bsym->flags & (BSF_FUNCTION | BSF_FILE | BSF_SECTION_SYM)) == 0
+ && S_IS_DEFINED (symp))
+ symp->bsym->flags |= BSF_OBJECT;
+#endif
}
void
diff --git a/gnu/usr.bin/binutils/gas/config/obj-elf.h b/gnu/usr.bin/binutils/gas/config/obj-elf.h
index eee6b2720fe..7e6c1b802dd 100644
--- a/gnu/usr.bin/binutils/gas/config/obj-elf.h
+++ b/gnu/usr.bin/binutils/gas/config/obj-elf.h
@@ -38,7 +38,7 @@
#define OBJ_SYMFIELD_TYPE expressionS *
/* Symbol fields used by the ELF back end. */
-#define ELF_TARGET_SYMBOL_FIELDS int local:1; unsigned long sy_name_offset;
+#define ELF_TARGET_SYMBOL_FIELDS int local:1;
/* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead. */
#define TARGET_SYMBOL_FIELDS ELF_TARGET_SYMBOL_FIELDS
diff --git a/gnu/usr.bin/binutils/gas/config/obj-multi.h b/gnu/usr.bin/binutils/gas/config/obj-multi.h
index 78c299afbb0..3b2e5f47b1e 100644
--- a/gnu/usr.bin/binutils/gas/config/obj-multi.h
+++ b/gnu/usr.bin/binutils/gas/config/obj-multi.h
@@ -23,7 +23,8 @@
#endif
#ifdef OBJ_MAYBE_ELF
-#define ELF_TARGET_SYMBOL_FIELDS int local:1; unsigned long sy_name_offset;
+#define OBJ_SYMFIELD_TYPE expressionS *
+#define ELF_TARGET_SYMBOL_FIELDS int local:1;
#else
#define ELF_TARGET_SYMBOL_FIELDS
#endif
diff --git a/gnu/usr.bin/binutils/gas/config/ppc-sol.mt b/gnu/usr.bin/binutils/gas/config/ppc-sol.mt
new file mode 100644
index 00000000000..2216647ccb0
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/config/ppc-sol.mt
@@ -0,0 +1 @@
+TDEFINES=-DTARGET_BYTES_LITTLE_ENDIAN=1 -DTARGET_SOLARIS_COMMENT
diff --git a/gnu/usr.bin/binutils/gas/config/sco5.mt b/gnu/usr.bin/binutils/gas/config/sco5.mt
new file mode 100644
index 00000000000..8879320c4e1
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/config/sco5.mt
@@ -0,0 +1 @@
+TDEFINES=-DSCO_ELF
diff --git a/gnu/usr.bin/binutils/gas/config/tc-a29k.c b/gnu/usr.bin/binutils/gas/config/tc-a29k.c
index 4c24f9e52a1..4c3ede1195b 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-a29k.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-a29k.c
@@ -1081,6 +1081,48 @@ md_show_usage (stream)
{
}
+/* This is called when a line is unrecognized. This is used to handle
+ definitions of a29k style local labels. */
+
+int
+a29k_unrecognized_line (c)
+ int c;
+{
+ int lab;
+ char *s;
+
+ if (c != '$'
+ || ! isdigit ((unsigned char) input_line_pointer[0]))
+ return 0;
+
+ s = input_line_pointer;
+
+ lab = 0;
+ while (isdigit ((unsigned char) *s))
+ {
+ lab = lab * 10 + *s - '0';
+ ++s;
+ }
+
+ if (*s != ':')
+ {
+ /* Not a label definition. */
+ return 0;
+ }
+
+ if (dollar_label_defined (lab))
+ {
+ as_bad ("label \"$%d\" redefined", lab);
+ return 0;
+ }
+
+ define_dollar_label (lab);
+ colon (dollar_label_name (lab, 0));
+ input_line_pointer = s + 1;
+
+ return 1;
+}
+
/* Default the values of symbols known that should be "predefined". We
don't bother to predefine them unless you actually use one, since there
are a lot of them. */
@@ -1158,6 +1200,31 @@ md_operand (expressionP)
else
expressionP->X_op = O_constant;
}
+ else if (input_line_pointer[0] == '$'
+ && isdigit ((unsigned char) input_line_pointer[1]))
+ {
+ long lab;
+ char *name;
+ symbolS *sym;
+
+ /* This is a local label. */
+ ++input_line_pointer;
+ lab = (long) get_absolute_expression ();
+ if (dollar_label_defined (lab))
+ {
+ name = dollar_label_name (lab, 0);
+ sym = symbol_find (name);
+ }
+ else
+ {
+ name = dollar_label_name (lab, 1);
+ sym = symbol_find_or_make (name);
+ }
+
+ expressionP->X_op = O_symbol;
+ expressionP->X_add_symbol = sym;
+ expressionP->X_add_number = 0;
+ }
else if (input_line_pointer[0] == '$')
{
char *s;
@@ -1193,7 +1260,6 @@ md_operand (expressionP)
}
else
{
- /* FIXME: We should handle a29k local labels here. */
return;
}
diff --git a/gnu/usr.bin/binutils/gas/config/tc-a29k.h b/gnu/usr.bin/binutils/gas/config/tc-a29k.h
index 1c36f07fc99..a63864f3013 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-a29k.h
+++ b/gnu/usr.bin/binutils/gas/config/tc-a29k.h
@@ -23,6 +23,9 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307
#define LEX_DOLLAR 1
+#define tc_unrecognized_line(c) a29k_unrecognized_line (c)
+extern int a29k_unrecognized_line PARAMS ((int));
+
#define tc_headers_hook(a) ; /* not used */
#define tc_headers_hook(a) ; /* not used */
#define tc_crawl_symbol_chain(a) ; /* not used */
diff --git a/gnu/usr.bin/binutils/gas/config/tc-alpha.c b/gnu/usr.bin/binutils/gas/config/tc-alpha.c
index 728fed5b562..c1bf8b32a48 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-alpha.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-alpha.c
@@ -2174,7 +2174,23 @@ alpha_ip (str, insns)
if (do_add64)
{
- emit_add64 (add64_in, add64_out, add64_addend);
+ /* If opcode represents an addq instruction, and the addend we
+ are using fits in a 16 bit range, we can change the addq
+ directly into an lda rather than emitting an lda followed by
+ an addq. */
+ if (OPCODE (opcode) == 0x10
+ && OP_FCN (opcode) == 0x20 /* addq */
+ && add64_in == ZERO
+ && add64_out == AT
+ && in_range_signed (add64_addend, 16))
+ {
+ opcode = (0x20000000 /* lda */
+ | (((opcode >> SC) & 0x1f) << SA)
+ | (((opcode >> SA) & 0x1f) << SB)
+ | (add64_addend & 0xffff));
+ }
+ else
+ emit_add64 (add64_in, add64_out, add64_addend);
}
insns[0].opcode = opcode;
diff --git a/gnu/usr.bin/binutils/gas/config/tc-arm.c b/gnu/usr.bin/binutils/gas/config/tc-arm.c
index aeaf9c4ea5c..72abd9bef79 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-arm.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-arm.c
@@ -1233,6 +1233,7 @@ cp_address_required_here (str)
inst.reloc.exp.X_add_number -= 8; /* PC rel adjust */
inst.reloc.pc_rel = 1;
inst.instruction |= (REG_PC << 16);
+ pre_inc = PRE_INDEX;
}
inst.instruction |= write_back | pre_inc;
@@ -1572,7 +1573,9 @@ my_get_float_expression (str)
&& exp.X_op == O_big
&& exp.X_add_number < 0)
{
- if (gen_to_words (words, 6, (long)15) == 0)
+ /* FIXME: 5 = X_PRECISION, should be #define'd where we can use it.
+ Ditto for 15. */
+ if (gen_to_words (words, 5, (long)15) == 0)
{
for (i = 0; i < NUM_FLOAT_VALS; i++)
{
@@ -1626,6 +1629,8 @@ my_get_expression (ep, str)
save_in = input_line_pointer;
input_line_pointer = *str;
seg = expression (ep);
+
+#ifdef OBJ_AOUT
if (seg != absolute_section
&& seg != text_section
&& seg != data_section
@@ -1637,10 +1642,11 @@ my_get_expression (ep, str)
input_line_pointer = save_in;
return 1;
}
+#endif
/* Get rid of any bignums now, so that we don't generate an error for which
we can't establish a line number later on. Big numbers are never valid
- in instructions, which is where is routine is always called. */
+ in instructions, which is where this routine is always called. */
if (ep->X_op == O_big
|| (ep->X_add_symbol
&& (walk_no_bignums (ep->X_add_symbol)
@@ -3465,9 +3471,10 @@ arm_psr_parse (ccp)
}
int
-md_apply_fix (fixP, val)
+md_apply_fix3 (fixP, val, seg)
fixS *fixP;
valueT *val;
+ segT seg;
{
offsetT value = *val;
offsetT newval, temp;
@@ -3476,12 +3483,22 @@ md_apply_fix (fixP, val)
assert (fixP->fx_r_type < BFD_RELOC_UNUSED);
- fixP->fx_addnumber = value; /* Remember value for emit_reloc */
-
/* Note whether this will delete the relocation. */
if (fixP->fx_addsy == 0 && !fixP->fx_pcrel)
fixP->fx_done = 1;
+ /* If this symbol is in a different section then we need to leave it for
+ the linker to deal with. Unfortunately, md_pcrel_from can't tell,
+ so we have to undo it's effects here. */
+ if (fixP->fx_pcrel)
+ {
+ if (S_IS_DEFINED (fixP->fx_addsy)
+ && S_GET_SEGMENT (fixP->fx_addsy) != seg)
+ value += md_pcrel_from (fixP);
+ }
+
+ fixP->fx_addnumber = value; /* Remember value for emit_reloc */
+
switch (fixP->fx_r_type)
{
case BFD_RELOC_ARM_IMMEDIATE:
diff --git a/gnu/usr.bin/binutils/gas/config/tc-arm.h b/gnu/usr.bin/binutils/gas/config/tc-arm.h
index 12f35abc9fc..0d5fa96cbfa 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-arm.h
+++ b/gnu/usr.bin/binutils/gas/config/tc-arm.h
@@ -97,6 +97,10 @@
#define md_operand(x)
+#define TC_HANDLES_FX_DONE
+
+#define MD_APPLY_FIX3
+
#define LOCAL_LABELS_FB 1
/* Use defaults for OBJ_AOUT. */
diff --git a/gnu/usr.bin/binutils/gas/config/tc-h8300.c b/gnu/usr.bin/binutils/gas/config/tc-h8300.c
index cab657b00e3..c9e320d896b 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-h8300.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-h8300.c
@@ -691,13 +691,6 @@ get_specific (opcode, operands)
&& ((op & SIZE) != (x & SIZE)))
found = 0;
}
-#if 0
- else if ((op & ABSMOV) && (x & ABS))
- {
- /* An absmov is only */
- /* Ok */
- }
-#endif
else if ((op & MODE) != (x & MODE))
{
found = 0;
@@ -745,11 +738,21 @@ check_operand (operand, width, string)
}
+/* RELAXMODE has one of 3 values:
+
+ 0 Output a "normal" reloc, no relaxing possible for this insn/reloc
+
+ 1 Output a relaxable 24bit absolute mov.w address relocation
+ (may relax into a 16bit absolute address).
+
+ 2 Output a relaxable 16/24 absolute mov.b address relocation
+ (may relax into an 8bit absolute address). */
+
static void
-do_a_fix_imm (offset, operand, relaxing)
+do_a_fix_imm (offset, operand, relaxmode)
int offset;
struct h8_op *operand;
- int relaxing;
+ int relaxmode;
{
int idx;
int size;
@@ -805,7 +808,12 @@ do_a_fix_imm (offset, operand, relaxing)
case L_24:
size = 4;
where = -1;
- idx = relaxing ? R_MOVLB1 : R_RELLONG;
+ if (relaxmode == 2)
+ idx = R_MOV24B1;
+ else if (relaxmode == 1)
+ idx = R_MOVL1;
+ else
+ idx = R_RELLONG;
break;
default:
as_bad("Can't work out size of operand.\n");
@@ -817,16 +825,19 @@ do_a_fix_imm (offset, operand, relaxing)
case L_16:
size = 2;
where = 0;
- idx = relaxing ? R_MOVB1 : R_RELWORD;
+ if (relaxmode == 2)
+ idx = R_MOV16B1;
+ else
+ idx = R_RELWORD;
+ operand->exp.X_add_number = (short)operand->exp.X_add_number;
break;
case L_8:
size = 1;
where = 0;
idx = R_RELBYTE;
+ operand->exp.X_add_number = (char)operand->exp.X_add_number;
}
- /* Sign extend any expression */
- operand->exp.X_add_number = (short)operand->exp.X_add_number;
fix_new_exp (frag_now,
offset + where,
size,
@@ -853,6 +864,7 @@ build_bytes (this_try, operand)
int absat;
int immat;
int nib;
+ int movb = 0;
char asnibbles[30];
char *p = asnibbles;
@@ -884,14 +896,6 @@ build_bytes (this_try, operand)
{
nib = dispreg;
}
-
- else if (c & ABSMOV)
- {
- operand[d].mode &= ~ABS;
- operand[d].mode |= ABSMOV;
- immat = nibble_count / 2;
- nib = 0;
- }
else if (c & ABS )
{
operand[d].mode = c;
@@ -946,6 +950,11 @@ build_bytes (this_try, operand)
operand[0].mode = 0;
}
+ if (c & MEMRELAX)
+ {
+ operand[d].mode |= MEMRELAX;
+ }
+
if (c & B31)
{
nib |= 0x8;
@@ -961,6 +970,11 @@ build_bytes (this_try, operand)
output[i] = (asnibbles[i * 2] << 4) | asnibbles[i * 2 + 1];
}
+ /* Note if this is a movb instruction -- there's a special relaxation
+ which only applies to them. */
+ if (strcmp (this_try->name, "mov.b") == 0)
+ movb = 1;
+
/* output any fixes */
for (i = 0; i < 2; i++)
{
@@ -968,11 +982,13 @@ build_bytes (this_try, operand)
if (x & (IMM | DISP))
{
- do_a_fix_imm (output - frag_now->fr_literal + immat, operand + i, 0);
+ do_a_fix_imm (output - frag_now->fr_literal + immat,
+ operand + i, x & MEMRELAX != 0);
}
else if (x & ABS)
{
- do_a_fix_imm (output - frag_now->fr_literal + absat, operand + i, 0);
+ do_a_fix_imm (output - frag_now->fr_literal + absat,
+ operand + i, x & MEMRELAX ? movb + 1 : 0);
}
else if (x & PCREL)
{
@@ -1007,15 +1023,8 @@ build_bytes (this_try, operand)
1,
&operand[i].exp,
0,
- R_RELBYTE);
+ R_MEM_INDIRECT);
}
-
- else if (x & ABSMOV)
- {
- /* This mov is either absolute long or thru a memory loc */
- do_a_fix_imm (output - frag_now->fr_literal + immat, operand + i, 1);
- }
-
else if (x & ABSJMP)
{
/* This jmp may be a jump or a branch */
@@ -1420,13 +1429,15 @@ tc_reloc_mangle (fix_ptr, intr, base)
/* If this relocation is attached to a symbol then it's ok
to output it */
- if (fix_ptr->fx_r_type == RELOC_32)
+ if (fix_ptr->fx_r_type == TC_CONS_RELOC)
{
/* cons likes to create reloc32's whatever the size of the reloc..
*/
switch (fix_ptr->fx_size)
{
-
+ case 4:
+ intr->r_type = R_RELLONG;
+ break;
case 2:
intr->r_type = R_RELWORD;
break;
diff --git a/gnu/usr.bin/binutils/gas/config/tc-hppa.c b/gnu/usr.bin/binutils/gas/config/tc-hppa.c
index 65ed66bfb1c..be326ec63d0 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-hppa.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-hppa.c
@@ -1,5 +1,5 @@
/* tc-hppa.c -- Assemble for the PA
- Copyright (C) 1989 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1996 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -90,6 +90,14 @@ typedef som_symbol_type obj_symbol_type;
#endif
#endif
+#ifndef R_N0SEL
+#define R_N0SEL 0xd8
+#endif
+
+#ifndef R_N1SEL
+#define R_N1SEL 0xd9
+#endif
+
/* Various structures and types used internally in tc-hppa.c. */
/* Unwind table and descriptor. FIXME: Sync this with GDB version. */
@@ -641,7 +649,7 @@ const pseudo_typeS md_pseudo_table[] =
first line of the input file. This is because the compiler outputs
#NO_APP at the beginning of its output.
- Also note that '/*' will always start a comment. */
+ Also note that C style comments will always work. */
const char line_comment_chars[] = "#";
/* This array holds the characters which act as line separators. */
@@ -961,6 +969,9 @@ static const struct selector_entry selector_table[] =
{"lr", e_lrsel},
{"ls", e_lssel},
{"lt", e_ltsel},
+ {"n", e_nsel},
+ {"nl", e_nlsel},
+ {"nlr", e_nlrsel},
{"p", e_psel},
{"r", e_rsel},
{"rd", e_rdsel},
@@ -978,8 +989,9 @@ static const struct selector_entry selector_table[] =
/* pre-defined subsegments (subspaces) for the HPPA. */
#define SUBSEG_CODE 0
-#define SUBSEG_DATA 0
#define SUBSEG_LIT 1
+#define SUBSEG_MILLI 2
+#define SUBSEG_DATA 0
#define SUBSEG_BSS 2
#define SUBSEG_UNWIND 3
#define SUBSEG_GDB_STRINGS 0
@@ -990,6 +1002,7 @@ static struct default_subspace_dict pa_def_subspaces[] =
{"$CODE$", 1, 1, 1, 0, 0, 0, 24, 0x2c, 0, 8, 0, 0, ".text", SUBSEG_CODE},
{"$DATA$", 1, 1, 0, 0, 0, 0, 24, 0x1f, 1, 8, 1, 1, ".data", SUBSEG_DATA},
{"$LIT$", 1, 1, 0, 0, 0, 0, 16, 0x2c, 0, 8, 0, 0, ".text", SUBSEG_LIT},
+ {"$MILLICODE$", 1, 1, 0, 0, 0, 0, 8, 0x2c, 0, 8, 0, 0, ".text", SUBSEG_MILLI},
{"$BSS$", 1, 1, 0, 0, 0, 1, 80, 0x1f, 1, 8, 1, 1, ".bss", SUBSEG_BSS},
#ifdef OBJ_ELF
{"$UNWIND$", 1, 1, 0, 0, 0, 0, 64, 0x2c, 0, 4, 0, 0, ".PARISC.unwind", SUBSEG_UNWIND},
@@ -2701,7 +2714,7 @@ tc_gen_reloc (section, fixp)
relocs[0]->howto = bfd_reloc_type_lookup (stdoutput, *codes[0]);
relocs[0]->address = fixp->fx_frag->fr_address + fixp->fx_where;
relocs[0]->addend = 0;
- relocs[0]->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+ relocs[1]->sym_ptr_ptr = &fixp->fx_addsy->bsym;
relocs[1]->howto = bfd_reloc_type_lookup (stdoutput, *codes[1]);
relocs[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
relocs[1]->addend = 0;
@@ -2747,6 +2760,8 @@ tc_gen_reloc (section, fixp)
case R_RSEL:
case R_BEGIN_BRTAB:
case R_END_BRTAB:
+ case R_N0SEL:
+ case R_N1SEL:
/* There is no symbol or addend associated with these fixups. */
relocs[i]->sym_ptr_ptr = &dummy_symbol->bsym;
relocs[i]->addend = 0;
@@ -2763,9 +2778,10 @@ tc_gen_reloc (section, fixp)
relocs[i]->addend = fixp->fx_offset;
}
}
+
+ done:
#endif
-done:
return relocs;
}
@@ -2894,7 +2910,7 @@ md_apply_fix (fixP, valp)
char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
struct hppa_fix_struct *hppa_fixP;
long new_val, result;
- unsigned int w1, w2, w;
+ unsigned int w1, w2, w, resulti;
hppa_fixP = (struct hppa_fix_struct *) fixP->tc_fix_data;
/* SOM uses R_HPPA_ENTRY and R_HPPA_EXIT relocations which can
@@ -2905,7 +2921,7 @@ md_apply_fix (fixP, valp)
|| fixP->fx_r_type == R_HPPA_EXIT
|| fixP->fx_r_type == R_HPPA_BEGIN_BRTAB
|| fixP->fx_r_type == R_HPPA_END_BRTAB)
- return;
+ return 1;
#endif
/* There should have been an HPPA specific fixup associated
@@ -2971,7 +2987,8 @@ md_apply_fix (fixP, valp)
bfd_put_32 (stdoutput,
bfd_get_32 (stdoutput, buf) & 0xffffc000,
buf);
- low_sign_unext (new_val, 14, &result);
+ low_sign_unext (new_val, 14, &resulti);
+ result = resulti;
break;
/* Handle all opcodes with the 'k' operand type. */
@@ -2982,7 +2999,8 @@ md_apply_fix (fixP, valp)
bfd_put_32 (stdoutput,
bfd_get_32 (stdoutput, buf) & 0xffe00000,
buf);
- dis_assemble_21 (new_val, &result);
+ dis_assemble_21 (new_val, &resulti);
+ result = resulti;
break;
/* Handle all the opcodes with the 'i' operand type. */
@@ -2993,20 +3011,21 @@ md_apply_fix (fixP, valp)
bfd_put_32 (stdoutput,
bfd_get_32 (stdoutput, buf) & 0xffff800,
buf);
- low_sign_unext (new_val, 11, &result);
+ low_sign_unext (new_val, 11, &resulti);
+ result = resulti;
break;
/* Handle all the opcodes with the 'w' operand type. */
case 12:
- CHECK_FIELD (new_val, 8199, -8184, 0)
+ CHECK_FIELD (new_val, 8199, -8184, 0);
/* Mask off 11 bits to be changed. */
- sign_unext ((new_val - 8) >> 2, 12, &result);
+ sign_unext ((new_val - 8) >> 2, 12, &resulti);
bfd_put_32 (stdoutput,
bfd_get_32 (stdoutput, buf) & 0xffffe002,
buf);
- dis_assemble_12 (result, &w1, &w);
+ dis_assemble_12 (resulti, &w1, &w);
result = ((w1 << 2) | w);
break;
@@ -3018,8 +3037,8 @@ md_apply_fix (fixP, valp)
bfd_put_32 (stdoutput,
bfd_get_32 (stdoutput, buf) & 0xffe0e002,
buf);
- sign_unext ((new_val - 8) >> 2, 17, &result);
- dis_assemble_17 (result, &w1, &w2, &w);
+ sign_unext ((new_val - 8) >> 2, 17, &resulti);
+ dis_assemble_17 (resulti, &w1, &w2, &w);
result = ((w2 << 2) | (w1 << 16) | w);
break;
@@ -3030,18 +3049,18 @@ md_apply_fix (fixP, valp)
default:
as_bad ("Unknown relocation encountered in md_apply_fix.");
- return;
+ return 0;
}
/* Insert the relocation. */
bfd_put_32 (stdoutput, bfd_get_32 (stdoutput, buf) | result, buf);
- return;
+ return 1;
}
else
{
printf ("no hppa_fixup entry for this fixup (fixP = 0x%x, type = 0x%x)\n",
(unsigned int) fixP, fixP->fx_r_type);
- return;
+ return 0;
}
}
@@ -3423,7 +3442,7 @@ pa_chk_field_selector (str)
{
int middle, low, high;
int cmp;
- char name[3];
+ char name[4];
/* Read past any whitespace. */
/* FIXME: should we read past newlines and formfeeds??? */
@@ -3437,6 +3456,13 @@ pa_chk_field_selector (str)
name[0] = tolower ((*str)[0]),
name[1] = tolower ((*str)[1]),
name[2] = 0;
+#ifdef OBJ_SOM
+ else if ((*str)[3] == '\'' || (*str)[3] == '%')
+ name[0] = tolower ((*str)[0]),
+ name[1] = tolower ((*str)[1]),
+ name[2] = tolower ((*str)[2]),
+ name[3] = 0;
+#endif
else
return e_fsel;
@@ -3454,6 +3480,10 @@ pa_chk_field_selector (str)
else
{
*str += strlen (name) + 1;
+#ifndef OBJ_SOM
+ if (selector_table[middle].field_selector == e_nsel)
+ return e_fsel;
+#endif
return selector_table[middle].field_selector;
}
}
@@ -3892,7 +3922,7 @@ pa_parse_nonneg_add_cmpltr (s, isbranch)
ISBRANCH specifies whether or not this is parsing a condition
completer for a branch (vs a nullification completer for a
- computational instruction. */
+ computational instruction). */
static int
pa_parse_neg_add_cmpltr (s, isbranch)
@@ -5633,6 +5663,16 @@ pa_spaces_begin ()
| SEC_READONLY
| SEC_HAS_CONTENTS));
}
+ else if (!strcmp (pa_def_subspaces[i].name, "$MILLICODE$")
+ && !USE_ALIASES)
+ {
+ applicable = bfd_applicable_section_flags (stdoutput);
+ bfd_set_section_flags (stdoutput, segment,
+ applicable & (SEC_ALLOC | SEC_LOAD
+ | SEC_RELOC
+ | SEC_READONLY
+ | SEC_HAS_CONTENTS));
+ }
else if (!strcmp (pa_def_subspaces[i].name, "$UNWIND$") && !USE_ALIASES)
{
applicable = bfd_applicable_section_flags (stdoutput);
@@ -6283,11 +6323,11 @@ hppa_fix_adjustable (fixp)
return 0;
}
- /* We can't adjust DP relative relocs that use LR% and RR% field
- selectors. That confuses the optimization pass in HP linker. */
- if (fixp->fx_r_type == R_DP_RELATIVE
- && (hppa_fix->fx_r_field == e_lrsel
- || hppa_fix->fx_r_field == e_rrsel))
+ /* We can't adjust any relocs that use LR% and RR% field selectors.
+ That confuses the HP linker. */
+ if (hppa_fix->fx_r_field == e_lrsel
+ || hppa_fix->fx_r_field == e_rrsel
+ || hppa_fix->fx_r_field == e_nlrsel)
return 0;
#endif
diff --git a/gnu/usr.bin/binutils/gas/config/tc-i386.c b/gnu/usr.bin/binutils/gas/config/tc-i386.c
index a624e4cb528..e09e0e13c95 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-i386.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-i386.c
@@ -560,6 +560,15 @@ md_begin ()
record_alignment (bss_section, 2);
#endif
}
+
+void
+i386_print_statistics (file)
+ FILE *file;
+{
+ hash_print_statistics (file, "i386 opcode", op_hash);
+ hash_print_statistics (file, "i386 register", reg_hash);
+ hash_print_statistics (file, "i386 prefix", prefix_hash);
+}
#ifdef DEBUG386
@@ -1150,6 +1159,39 @@ md_assemble (line)
DWORD_OPCODE_SUFFIX);
}
}
+ else if (i.suffix != 0
+ && i.reg_operands != 0
+ && (i.types[i.operands - 1] & Reg) != 0)
+ {
+ int bad;
+
+ /* If the last operand is a register, make sure it is
+ compatible with the suffix. */
+
+ bad = 0;
+ switch (i.suffix)
+ {
+ default:
+ abort ();
+ case BYTE_OPCODE_SUFFIX:
+ /* If this is an eight bit register, it's OK. If it's the
+ 16 or 32 bit version of an eight bit register, we will
+ just use the low portion, and that's OK too. */
+ if ((i.types[i.operands - 1] & Reg8) == 0
+ && i.regs[i.operands - 1]->reg_num >= 4)
+ bad = 1;
+ break;
+ case WORD_OPCODE_SUFFIX:
+ case DWORD_OPCODE_SUFFIX:
+ /* We don't insist on the presence or absence of the e
+ prefix on the register, but we reject eight bit
+ registers. */
+ if ((i.types[i.operands - 1] & Reg8) != 0)
+ bad = 1;
+ }
+ if (bad)
+ as_bad ("register does not match opcode suffix");
+ }
/* Make still unresolved immediate matches conform to size of immediate
given in i.suffix. Note: overlap2 cannot be an immediate!
@@ -2779,7 +2821,7 @@ parse_register (reg_string)
}
#ifdef OBJ_ELF
-CONST char *md_shortopts = "mVQ:";
+CONST char *md_shortopts = "kmVQ:";
#else
CONST char *md_shortopts = "m";
#endif
@@ -2800,6 +2842,10 @@ md_parse_option (c, arg)
break;
#ifdef OBJ_ELF
+ /* -k: Ignore for FreeBSD compatibility. */
+ case 'k':
+ break;
+
/* -V: SVR4 argument to print version ID. */
case 'V':
print_version_id ();
@@ -2929,7 +2975,7 @@ tc_gen_reloc (section, fixp)
MAP (4, 1, BFD_RELOC_32_PCREL);
default:
as_bad ("Can not do %d byte %srelocation", fixp->fx_size,
- fixp->fx_pcrel ? "pc-relative" : "");
+ fixp->fx_pcrel ? "pc-relative " : "");
}
}
#undef MAP
@@ -3033,5 +3079,100 @@ tc_coff_sizemachdep (frag)
#endif /* I386COFF */
#endif /* BFD_ASSEMBLER? */
+
+#ifdef SCO_ELF
+
+/* Heavily plagarized from obj_elf_version. The idea is to emit the
+ SCO specific identifier in the .notes section to satisfy the SCO
+ linker.
+
+ This looks more complicated than it really is. As opposed to the
+ "obvious" solution, this should handle the cross dev cases
+ correctly. (i.e, hosting on a 64 bit big endian processor, but
+ generating SCO Elf code) Efficiency isn't a concern, as there
+ should be exactly one of these sections per object module.
+
+ SCO OpenServer 5 identifies it's ELF modules with a standard ELF
+ .note section.
+
+ int_32 namesz = 4 ; Name size
+ int_32 descsz = 12 ; Descriptive information
+ int_32 type = 1 ;
+ char name[4] = "SCO" ; Originator name ALWAYS SCO + NULL
+ int_32 version = (major ver # << 16) | version of tools ;
+ int_32 source = (tool_id << 16 ) | 1 ;
+ int_32 info = 0 ; These are set by the SCO tools, but we
+ don't know enough about the source
+ environment to set them. SCO ld currently
+ ignores them, and recommends we set them
+ to zero. */
+
+#define SCO_MAJOR_VERSION 0x1
+#define SCO_MINOR_VERSION 0x1
+
+void
+sco_id ()
+{
+ char *name;
+ unsigned int c;
+ char ch;
+ char *p;
+ asection *seg = now_seg;
+ subsegT subseg = now_subseg;
+ Elf_Internal_Note i_note;
+ Elf_External_Note e_note;
+ asection *note_secp = (asection *) NULL;
+ int i, len;
+
+ /* create the .note section */
+
+ note_secp = subseg_new (".note", 0);
+ bfd_set_section_flags (stdoutput,
+ note_secp,
+ SEC_HAS_CONTENTS | SEC_READONLY);
+
+ /* process the version string */
+
+ i_note.namesz = 4;
+ i_note.descsz = 12; /* 12 descriptive bytes */
+ i_note.type = NT_VERSION; /* Contains a version string */
+
+ p = frag_more (sizeof (i_note.namesz));
+ md_number_to_chars (p, (valueT) i_note.namesz, 4);
+
+ p = frag_more (sizeof (i_note.descsz));
+ md_number_to_chars (p, (valueT) i_note.descsz, 4);
+
+ p = frag_more (sizeof (i_note.type));
+ md_number_to_chars (p, (valueT) i_note.type, 4);
+
+ p = frag_more (4);
+ strcpy (p, "SCO");
+
+ /* Note: this is the version number of the ELF we're representing */
+ p = frag_more (4);
+ md_number_to_chars (p, (SCO_MAJOR_VERSION << 16) | (SCO_MINOR_VERSION), 4);
+
+ /* Here, we pick a magic number for ourselves (yes, I "registered"
+ it with SCO. The bottom bit shows that we are compat with the
+ SCO ABI. */
+ p = frag_more (4);
+ md_number_to_chars (p, 0x4c520000 | 0x0001, 4);
+
+ /* If we knew (or cared) what the source language options were, we'd
+ fill them in here. SCO has given us permission to ignore these
+ and just set them to zero. */
+ p = frag_more (4);
+ md_number_to_chars (p, 0x0000, 4);
+
+ frag_align (2, 0);
+
+ /* We probably can't restore the current segment, for there likely
+ isn't one yet... */
+ if (seg && subseg)
+ subseg_set (seg, subseg);
+}
+
+#endif /* SCO_ELF */
/* end of tc-i386.c */
diff --git a/gnu/usr.bin/binutils/gas/config/tc-i960.c b/gnu/usr.bin/binutils/gas/config/tc-i960.c
index 1acf9ffad57..8466bedbb1a 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-i960.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-i960.c
@@ -445,6 +445,8 @@ static struct hash_control *areg_hash; /* Abase register hash table */
#define ARCH_KB 2
#define ARCH_MC 3
#define ARCH_CA 4
+#define ARCH_JX 5
+#define ARCH_HX 6
int architecture = ARCH_ANY; /* Architecture requested on invocation line */
int iclasses_seen; /* OR of instruction classes (I_* constants)
* for which we've actually assembled
@@ -936,6 +938,8 @@ static const struct tabentry arch_tab[] =
{"KC", ARCH_MC}, /* Synonym for MC */
{"MC", ARCH_MC},
{"CA", ARCH_CA},
+ {"JX", ARCH_JX},
+ {"HX", ARCH_HX},
{NULL, 0}
};
@@ -1217,7 +1221,6 @@ brtab_emit ()
0,
0,
NO_RELOC);
- fixP->fx_im_disp = 2; /* 32-bit displacement fix */
}
}
@@ -1756,7 +1759,6 @@ mem_fmt (args, oP, callx)
&expr,
0,
NO_RELOC);
- fixP->fx_im_disp = 2; /* 32-bit displacement fix */
/* Steve's linker relaxing hack. Mark this 32-bit relocation as
being in the instruction stream, specifically as part of a callx
instruction. */
@@ -2024,10 +2026,13 @@ parse_memop (memP, argP, optype)
p = strchr (indexP, '*');
if (p == NULL)
{
- /* No explicit scale -- use default for this
- *instruction type.
- */
- scale = def_scale[optype - MEM1];
+ /* No explicit scale -- use default for this instruction
+ type and assembler mode. */
+ if (flag_mri)
+ scale = 1;
+ else
+ /* GNU960 compatibility */
+ scale = def_scale[optype - MEM1];
}
else
{
@@ -2743,7 +2748,10 @@ targ_has_sfr (n)
case ARCH_KA:
case ARCH_KB:
case ARCH_MC:
+ case ARCH_JX:
return 0;
+ case ARCH_HX:
+ return ((0 <= n) && (n <= 4));
case ARCH_CA:
default:
return ((0 <= n) && (n <= 2));
@@ -2759,7 +2767,7 @@ static
int
targ_has_iclass (ic)
/* Instruction class; one of:
- I_BASE, I_CX, I_DEC, I_KX, I_FP, I_MIL, I_CASIM
+ I_BASE, I_CX, I_DEC, I_KX, I_FP, I_MIL, I_CASIM, I_CX2, I_HX, I_HX2
*/
int ic;
{
@@ -2774,6 +2782,10 @@ targ_has_iclass (ic)
return ic & (I_BASE | I_KX | I_FP | I_DEC | I_MIL);
case ARCH_CA:
return ic & (I_BASE | I_CX | I_CX2 | I_CASIM);
+ case ARCH_JX:
+ return ic & (I_BASE | I_CX2 | I_JX);
+ case ARCH_HX:
+ return ic & (I_BASE | I_CX2 | I_JX | I_HX);
default:
if ((iclasses_seen & (I_KX | I_FP | I_DEC | I_MIL))
&& (iclasses_seen & (I_CX | I_CX2)))
@@ -2836,31 +2848,15 @@ md_apply_fix (fixP, val)
char *place = fixP->fx_where + fixP->fx_frag->fr_literal;
if (!fixP->fx_bit_fixP)
- switch (fixP->fx_im_disp)
- {
- case 0:
- /* For callx, we always want to write out zero, and emit a
- symbolic relocation. */
- if (fixP->fx_bsr)
- val = 0;
-
- fixP->fx_addnumber = val;
- md_number_to_imm (place, val, fixP->fx_size, fixP);
- break;
- case 1:
- md_number_to_disp (place,
- (fixP->fx_pcrel
- ? val + fixP->fx_pcrel_adjust
- : val),
- fixP->fx_size);
- break;
- case 2: /* fix requested for .long .word etc */
- md_number_to_chars (place, val, fixP->fx_size);
- break;
- default:
- as_fatal ("Internal error in md_apply_fix() in file \"%s\"",
- __FILE__);
- }
+ {
+ /* For callx, we always want to write out zero, and emit a
+ symbolic relocation. */
+ if (fixP->fx_bsr)
+ val = 0;
+
+ fixP->fx_addnumber = val;
+ md_number_to_imm (place, val, fixP->fx_size, fixP);
+ }
else
md_number_to_field (place, val, fixP->fx_bit_fixP);
}
@@ -2942,6 +2938,7 @@ tc_coff_fix2rtype (fixP)
return R_IPRMED;
abort ();
+ return 0;
}
int
@@ -2964,35 +2961,58 @@ md_section_align (seg, addr)
return ((addr + (1 << section_alignment[(int) seg]) - 1) & (-1 << section_alignment[(int) seg]));
} /* md_section_align() */
+extern int coff_flags;
+
#ifdef OBJ_COFF
void
tc_headers_hook (headers)
object_headers *headers;
{
- if (iclasses_seen == I_BASE)
- {
- headers->filehdr.f_flags |= F_I960CORE;
- }
- else if (iclasses_seen & I_CX)
- {
- headers->filehdr.f_flags |= F_I960CA;
- }
- else if (iclasses_seen & I_CX2)
- {
- headers->filehdr.f_flags |= F_I960CA;
- }
- else if (iclasses_seen & I_MIL)
- {
- headers->filehdr.f_flags |= F_I960MC;
- }
- else if (iclasses_seen & (I_DEC | I_FP))
+ switch (architecture)
{
- headers->filehdr.f_flags |= F_I960KB;
+ case ARCH_KA:
+ coff_flags |= F_I960KA;
+ break;
+
+ case ARCH_KB:
+ coff_flags |= F_I960KB;
+ break;
+
+ case ARCH_MC:
+ coff_flags |= F_I960MC;
+ break;
+
+ case ARCH_CA:
+ coff_flags |= F_I960CA;
+ break;
+
+ case ARCH_JX:
+ coff_flags |= F_I960JX;
+ break;
+
+ case ARCH_HX:
+ coff_flags |= F_I960HX;
+ break;
+
+ default:
+ if (iclasses_seen == I_BASE)
+ coff_flags |= F_I960CORE;
+ else if (iclasses_seen & I_CX)
+ coff_flags |= F_I960CA;
+ else if (iclasses_seen & I_HX)
+ coff_flags |= F_I960HX;
+ else if (iclasses_seen & I_JX)
+ coff_flags |= F_I960JX;
+ else if (iclasses_seen & I_CX2)
+ coff_flags |= F_I960CA;
+ else if (iclasses_seen & I_MIL)
+ coff_flags |= F_I960MC;
+ else if (iclasses_seen & (I_DEC | I_FP))
+ coff_flags |= F_I960KB;
+ else
+ coff_flags |= F_I960KA;
+ break;
}
- else
- {
- headers->filehdr.f_flags |= F_I960KA;
- } /* set arch flag */
if (flag_readonly_data_in_text)
{
@@ -3147,7 +3167,10 @@ tc_coff_symbol_emit_hook (symbolP)
S_SET_NUMBER_AUXILIARY (symbolP, 2);
#endif
symbolP->sy_symbol.ost_auxent[1].x_bal.x_balntry = S_GET_VALUE (balP);
- S_SET_STORAGE_CLASS (symbolP, (!SF_GET_LOCAL (symbolP) ? C_LEAFEXT : C_LEAFSTAT));
+ if (S_GET_STORAGE_CLASS (symbolP) == C_EXT)
+ S_SET_STORAGE_CLASS (symbolP, C_LEAFEXT);
+ else
+ S_SET_STORAGE_CLASS (symbolP, C_LEAFSTAT);
S_SET_DATA_TYPE (symbolP, S_GET_DATA_TYPE (symbolP) | (DT_FCN << N_BTSHFT));
/* fix up the bal symbol */
S_SET_STORAGE_CLASS (balP, C_LABEL);
@@ -3159,8 +3182,6 @@ void
i960_handle_align (fragp)
fragS *fragp;
{
- fixS *fixp;
-
if (!linkrelax)
return;
@@ -3179,8 +3200,8 @@ i960_handle_align (fragp)
return;
/* alignment directive */
- fixp = fix_new (fragp, fragp->fr_fix, fragp->fr_offset, 0, 0, 0,
- (int) fragp->fr_type);
+ fix_new (fragp, fragp->fr_fix, fragp->fr_offset, 0, 0, 0,
+ (int) fragp->fr_type);
#endif /* OBJ_BOUT */
}
diff --git a/gnu/usr.bin/binutils/gas/config/tc-i960.h b/gnu/usr.bin/binutils/gas/config/tc-i960.h
index 65de57f626a..2f626c009cf 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-i960.h
+++ b/gnu/usr.bin/binutils/gas/config/tc-i960.h
@@ -1,5 +1,6 @@
/* tc-i960.h - Basic 80960 instruction formats.
- Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -43,7 +44,6 @@
#define SYMBOLS_NEED_BACKPOINTERS
#define LOCAL_LABELS_FB 1
#define BITFIELD_CONS_EXPRESSIONS
-#define MRI_MODE_NEEDS_PSEUDO_DOT 1
/* tailor the coff format */
#define BFD_ARCH bfd_arch_i960
diff --git a/gnu/usr.bin/binutils/gas/config/tc-m68k.c b/gnu/usr.bin/binutils/gas/config/tc-m68k.c
index 9135644825d..92655800646 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-m68k.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-m68k.c
@@ -1,5 +1,5 @@
/* tc-m68k.c -- Assemble for the m68k family
- Copyright (C) 1987, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1987, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -19,7 +19,6 @@
02111-1307, USA. */
#include <ctype.h>
-#define NO_RELOC 0
#include "as.h"
#include "obstack.h"
#include "subsegs.h"
@@ -27,12 +26,14 @@
#include "opcode/m68k.h"
#include "m68k-parse.h"
-/* This array holds the chars that always start a comment. If the
- pre-processor is disabled, these aren't very useful */
-#if defined (OBJ_ELF) || defined (TE_DELTA)
-const char comment_chars[] = "|#";
+/* This string holds the chars that always start a comment. If the
+ pre-processor is disabled, these aren't very useful. The macro
+ tc_comment_chars points to this. We use this, rather than the
+ usual comment_chars, so that the --bitwise-or option will work. */
+#if (defined (OBJ_ELF) && ! defined (TE_PSOS) && ! defined (TE_LINUX)) || defined (TE_DELTA)
+const char *m68k_comment_chars = "|#";
#else
-const char comment_chars[] = "|";
+const char *m68k_comment_chars = "|";
#endif
/* This array holds the chars that only start a comment at the beginning of
@@ -62,7 +63,8 @@ const int md_reloc_size = 8; /* Size of relocation record */
/* Are we trying to generate PIC code? If so, absolute references
ought to be made into linkage table references or pc-relative
- references. */
+ references. Not implemented. For ELF there are other means
+ to denote pic relocations. */
int flag_want_pic;
static int flag_short_refs; /* -l option */
@@ -74,6 +76,9 @@ int flag_reg_prefix_optional = REGISTER_PREFIX_OPTIONAL;
int flag_reg_prefix_optional;
#endif
+/* Whether --register-prefix-optional was used on the command line. */
+static int reg_prefix_optional_seen;
+
/* The floating point coprocessor to use by default. */
static enum m68k_register m68k_float_copnum = COP1;
@@ -199,6 +204,11 @@ struct m68k_it
significance of some values (in the branch instruction, for
example). */
int pcrel_fix;
+#ifdef OBJ_ELF
+ /* Whether this expression needs special pic relocation, and if
+ so, which. */
+ enum pic_relocation pic_reloc;
+#endif
}
reloc[5]; /* Five is enough??? */
};
@@ -252,6 +262,9 @@ add_fix (width, exp, pc_rel, pc_fix)
the_ins.reloc[the_ins.nrel].exp = exp->exp;
the_ins.reloc[the_ins.nrel].wid = width;
the_ins.reloc[the_ins.nrel].pcrel_fix = pc_fix;
+#ifdef OBJ_ELF
+ the_ins.reloc[the_ins.nrel].pic_reloc = exp->pic_reloc;
+#endif
the_ins.reloc[the_ins.nrel++].pcrel = pc_rel;
}
@@ -315,36 +328,37 @@ static int current_architecture;
struct m68k_cpu {
unsigned long arch;
const char *name;
+ int alias;
};
static const struct m68k_cpu archs[] = {
- { m68000, "68000" },
- { m68010, "68010" },
- { m68020, "68020" },
- { m68030, "68030" },
- { m68040, "68040" },
- { m68060, "68060" },
- { cpu32, "cpu32" },
- { m68881, "68881" },
- { m68851, "68851" },
+ { m68000, "68000", 0 },
+ { m68010, "68010", 0 },
+ { m68020, "68020", 0 },
+ { m68030, "68030", 0 },
+ { m68040, "68040", 0 },
+ { m68060, "68060", 0 },
+ { cpu32, "cpu32", 0 },
+ { m68881, "68881", 0 },
+ { m68851, "68851", 0 },
/* Aliases (effectively, so far as gas is concerned) for the above
cpus. */
- { m68020, "68k" },
- { m68000, "68302" },
- { m68000, "68008" },
- { m68000, "68ec000" },
- { m68000, "68hc000" },
- { m68000, "68hc001" },
- { m68020, "68ec020" },
- { m68030, "68ec030" },
- { m68040, "68ec040" },
- { cpu32, "68330" },
- { cpu32, "68331" },
- { cpu32, "68332" },
- { cpu32, "68333" },
- { cpu32, "68340" },
- { cpu32, "68360" },
- { m68881, "68882" },
+ { m68020, "68k", 1 },
+ { m68000, "68302", 1 },
+ { m68000, "68008", 1 },
+ { m68000, "68ec000", 1 },
+ { m68000, "68hc000", 1 },
+ { m68000, "68hc001", 1 },
+ { m68020, "68ec020", 1 },
+ { m68030, "68ec030", 1 },
+ { m68040, "68ec040", 1 },
+ { cpu32, "68330", 1 },
+ { cpu32, "68331", 1 },
+ { cpu32, "68332", 1 },
+ { cpu32, "68333", 1 },
+ { cpu32, "68340", 1 },
+ { cpu32, "68360", 1 },
+ { m68881, "68882", 1 },
};
static const int n_archs = sizeof (archs) / sizeof (archs[0]);
@@ -427,12 +441,14 @@ const pseudo_typeS md_pseudo_table[] =
{"even", s_even, 0},
{"skip", s_space, 0},
{"proc", s_proc, 0},
-#ifdef TE_SUN3
+#if defined (TE_SUN3) || defined (OBJ_ELF)
{"align", s_align_bytes, 0},
#endif
#ifdef OBJ_ELF
{"swbeg", s_ignore, 0},
#endif
+ {"extend", float_cons, 'x'},
+ {"ldouble", float_cons, 'x'},
/* The following pseudo-ops are supported for MRI compatibility. */
{"chip", s_chip, 0},
@@ -497,7 +513,11 @@ CONST pseudo_typeS mote_pseudo_table[] =
{"dsb", s_space, 1},
{"xdef", s_globl, 0},
+#ifdef OBJ_ELF
+ {"align", s_align_bytes, 0},
+#else
{"align", s_align_ptwo, 0},
+#endif
#ifdef M68KCOFF
{"sect", obj_coff_section, 0},
{"section", obj_coff_section, 0},
@@ -582,6 +602,145 @@ tc_coff_fix2rtype (fixP)
#endif
+#ifdef OBJ_ELF
+
+/* Compute the relocation code for a fixup of SIZE bytes, using pc
+ relative relocation if PCREL is non-zero. PIC says whether a special
+ pic relocation was requested. */
+
+static bfd_reloc_code_real_type get_reloc_code
+ PARAMS ((int, int, enum pic_relocation));
+
+static bfd_reloc_code_real_type
+get_reloc_code (size, pcrel, pic)
+ int size;
+ int pcrel;
+ enum pic_relocation pic;
+{
+ switch (pic)
+ {
+ case pic_got_pcrel:
+ switch (size)
+ {
+ case 1:
+ return BFD_RELOC_8_GOT_PCREL;
+ case 2:
+ return BFD_RELOC_16_GOT_PCREL;
+ case 4:
+ return BFD_RELOC_32_GOT_PCREL;
+ }
+ break;
+
+ case pic_got_off:
+ switch (size)
+ {
+ case 1:
+ return BFD_RELOC_8_GOTOFF;
+ case 2:
+ return BFD_RELOC_16_GOTOFF;
+ case 4:
+ return BFD_RELOC_32_GOTOFF;
+ }
+ break;
+
+ case pic_plt_pcrel:
+ switch (size)
+ {
+ case 1:
+ return BFD_RELOC_8_PLT_PCREL;
+ case 2:
+ return BFD_RELOC_16_PLT_PCREL;
+ case 4:
+ return BFD_RELOC_32_PLT_PCREL;
+ }
+ break;
+
+ case pic_plt_off:
+ switch (size)
+ {
+ case 1:
+ return BFD_RELOC_8_PLTOFF;
+ case 2:
+ return BFD_RELOC_16_PLTOFF;
+ case 4:
+ return BFD_RELOC_32_PLTOFF;
+ }
+ break;
+
+ case pic_none:
+ if (pcrel)
+ {
+ switch (size)
+ {
+ case 1:
+ return BFD_RELOC_8_PCREL;
+ case 2:
+ return BFD_RELOC_16_PCREL;
+ case 4:
+ return BFD_RELOC_32_PCREL;
+ }
+ }
+ else
+ {
+ switch (size)
+ {
+ case 1:
+ return BFD_RELOC_8;
+ case 2:
+ return BFD_RELOC_16;
+ case 4:
+ return BFD_RELOC_32;
+ }
+ }
+ }
+
+ as_bad ("Can not do %d byte %s%srelocation", size,
+ pcrel ? "pc-relative " : "",
+ pic == pic_none ? "" : "pic ");
+ return BFD_RELOC_NONE;
+}
+
+/* Here we decide which fixups can be adjusted to make them relative
+ to the beginning of the section instead of the symbol. Basically
+ we need to make sure that the dynamic relocations are done
+ correctly, so in some cases we force the original symbol to be
+ used. */
+int
+tc_m68k_fix_adjustable (fixP)
+ fixS *fixP;
+{
+ /* Prevent all adjustments to global symbols. */
+ if (S_IS_EXTERNAL (fixP->fx_addsy))
+ return 0;
+
+ /* adjust_reloc_syms doesn't know about the GOT */
+ switch (fixP->fx_r_type)
+ {
+ case BFD_RELOC_8_GOT_PCREL:
+ case BFD_RELOC_16_GOT_PCREL:
+ case BFD_RELOC_32_GOT_PCREL:
+ case BFD_RELOC_8_GOTOFF:
+ case BFD_RELOC_16_GOTOFF:
+ case BFD_RELOC_32_GOTOFF:
+ case BFD_RELOC_8_PLT_PCREL:
+ case BFD_RELOC_16_PLT_PCREL:
+ case BFD_RELOC_32_PLT_PCREL:
+ case BFD_RELOC_8_PLTOFF:
+ case BFD_RELOC_16_PLTOFF:
+ case BFD_RELOC_32_PLTOFF:
+ return 0;
+
+ default:
+ return 1;
+ }
+}
+
+#else /* !OBJ_ELF */
+
+#define get_reloc_code(SIZE,PCREL,OTHER) NO_RELOC
+
+#endif /* OBJ_ELF */
+
#ifdef BFD_ASSEMBLER
arelent *
@@ -595,28 +754,50 @@ tc_gen_reloc (section, fixp)
if (fixp->fx_tcbit)
abort ();
-#define F(SZ,PCREL) (((SZ) << 1) + (PCREL))
- switch (F (fixp->fx_size, fixp->fx_pcrel))
+ if (fixp->fx_r_type != BFD_RELOC_NONE)
+ code = fixp->fx_r_type;
+ else
{
+#define F(SZ,PCREL) (((SZ) << 1) + (PCREL))
+ switch (F (fixp->fx_size, fixp->fx_pcrel))
+ {
#define MAP(SZ,PCREL,TYPE) case F(SZ,PCREL): code = (TYPE); break
- MAP (1, 0, BFD_RELOC_8);
- MAP (2, 0, BFD_RELOC_16);
- MAP (4, 0, BFD_RELOC_32);
- MAP (1, 1, BFD_RELOC_8_PCREL);
- MAP (2, 1, BFD_RELOC_16_PCREL);
- MAP (4, 1, BFD_RELOC_32_PCREL);
- default:
- abort ();
+ MAP (1, 0, BFD_RELOC_8);
+ MAP (2, 0, BFD_RELOC_16);
+ MAP (4, 0, BFD_RELOC_32);
+ MAP (1, 1, BFD_RELOC_8_PCREL);
+ MAP (2, 1, BFD_RELOC_16_PCREL);
+ MAP (4, 1, BFD_RELOC_32_PCREL);
+ default:
+ abort ();
+ }
}
+#undef F
+#undef MAP
reloc = (arelent *) bfd_alloc_by_size_t (stdoutput, sizeof (arelent));
assert (reloc != 0);
reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
+#ifndef OBJ_ELF
if (fixp->fx_pcrel)
reloc->addend = fixp->fx_addnumber;
else
reloc->addend = 0;
+#else
+ if (!fixp->fx_pcrel)
+ reloc->addend = fixp->fx_addnumber;
+ else if ((fixp->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0)
+ reloc->addend = (section->vma
+ + (fixp->fx_pcrel_adjust == 64
+ ? -1 : fixp->fx_pcrel_adjust)
+ + fixp->fx_addnumber
+ + md_pcrel_from (fixp));
+ else
+ reloc->addend = (fixp->fx_offset
+ + (fixp->fx_pcrel_adjust == 64
+ ? -1 : fixp->fx_pcrel_adjust));
+#endif
reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
assert (reloc->howto != 0);
@@ -1360,7 +1541,8 @@ m68k_ip (instring)
for (idx = 0; idx < sizeof (archs) / sizeof (archs[0]);
idx++)
{
- if (archs[idx].arch & ok_arch)
+ if ((archs[idx].arch & ok_arch)
+ && ! archs[idx].alias)
{
if (got_one)
{
@@ -1563,6 +1745,9 @@ m68k_ip (instring)
&& cpu_of_arch (current_architecture) >= m68020)
|| opP->disp.size == SIZE_LONG)))
{
+ if (cpu_of_arch (current_architecture) < m68020)
+ opP->error =
+ "displacement too large for this architecture; needs 68020 or higher";
if (opP->reg == PC)
tmpreg = 0x3B; /* 7.3 */
else
@@ -1571,16 +1756,24 @@ m68k_ip (instring)
{
if (opP->reg == PC)
{
-#if 0
- addword (0x0170);
- add_fix ('l', &opP->disp, 1, 2);
- addword (0), addword (0);
-#else
- add_frag (adds (&opP->disp),
- offs (&opP->disp),
- TAB (PCLEA, SZ_UNDEF));
+ if (opP->disp.size == SIZE_LONG
+#ifdef OBJ_ELF
+ /* If the displacement needs pic
+ relocation it cannot be relaxed. */
+ || opP->disp.pic_reloc != pic_none
#endif
- break;
+ )
+ {
+ addword (0x0170);
+ add_fix ('l', &opP->disp, 1, 2);
+ }
+ else
+ {
+ add_frag (adds (&opP->disp),
+ offs (&opP->disp),
+ TAB (PCLEA, SZ_UNDEF));
+ break;
+ }
}
else
{
@@ -1726,7 +1919,13 @@ m68k_ip (instring)
else if (siz1 == SIZE_UNSPEC
&& opP->reg == PC
&& isvar (&opP->disp)
- && subs (&opP->disp) == NULL)
+ && subs (&opP->disp) == NULL
+#ifdef OBJ_ELF
+ /* If the displacement needs pic
+ relocation it cannot be relaxed. */
+ && opP->disp.pic_reloc == pic_none
+#endif
+ )
{
nextword += baseo & 0xff;
addword (nextword);
@@ -1862,6 +2061,11 @@ m68k_ip (instring)
if (isvar (&opP->disp)
&& !subs (&opP->disp)
&& adds (&opP->disp)
+#ifdef OBJ_ELF
+ /* If the displacement needs pic relocation it
+ cannot be relaxed. */
+ && opP->disp.pic_reloc == pic_none
+#endif
&& S_GET_SEGMENT (adds (&opP->disp)) == now_seg
&& cpu_of_arch (current_architecture) >= m68020
&& !flag_long_jumps
@@ -1931,7 +2135,8 @@ m68k_ip (instring)
opP->error = "out of range";
insop (tmpreg, opcode);
if (isvar (&opP->disp))
- the_ins.reloc[the_ins.nrel - 1].n = (opcode->m_codenum) * 2;
+ the_ins.reloc[the_ins.nrel - 1].n =
+ (opcode->m_codenum) * 2 + 1;
break;
case 'w':
if (!isword (tmpreg))
@@ -2001,6 +2206,13 @@ m68k_ip (instring)
if (subs (&opP->disp)) /* We can't relax it */
goto long_branch;
+#ifdef OBJ_ELF
+ /* If the displacement needs pic relocation it cannot be
+ relaxed. */
+ if (opP->disp.pic_reloc != pic_none)
+ goto long_branch;
+#endif
+
/* This could either be a symbol, or an absolute
address. No matter, the frag hacking will finger it
out. Not quite: it can't switch from BRANCH to
@@ -2934,7 +3146,8 @@ md_assemble (str)
n,
&the_ins.reloc[m].exp,
the_ins.reloc[m].pcrel,
- NO_RELOC);
+ get_reloc_code (n, the_ins.reloc[m].pcrel,
+ the_ins.reloc[m].pic_reloc));
fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
}
return;
@@ -2978,7 +3191,8 @@ md_assemble (str)
wid,
&the_ins.reloc[m].exp,
the_ins.reloc[m].pcrel,
- NO_RELOC);
+ get_reloc_code (wid, the_ins.reloc[m].pcrel,
+ the_ins.reloc[m].pic_reloc));
fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
}
(void) frag_var (rs_machine_dependent, 10, 0,
@@ -3014,7 +3228,8 @@ md_assemble (str)
wid,
&the_ins.reloc[m].exp,
the_ins.reloc[m].pcrel,
- NO_RELOC);
+ get_reloc_code (wid, the_ins.reloc[m].pcrel,
+ the_ins.reloc[m].pic_reloc));
fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
}
}
@@ -3181,6 +3396,12 @@ md_begin ()
#endif
init_regtable ();
+
+#ifdef OBJ_ELF
+ record_alignment (text_section, 2);
+ record_alignment (data_section, 2);
+ record_alignment (bss_section, 2);
+#endif
}
void
@@ -3276,6 +3497,43 @@ m68k_init_after_args ()
md_relax_table[TAB (PCINDEX, BYTE)].rlx_more = 0;
}
+/* This is called if we go in or out of MRI mode because of the .mri
+ pseudo-op. */
+
+void
+m68k_mri_mode_change (on)
+ int on;
+{
+ if (on)
+ {
+ if (! flag_reg_prefix_optional)
+ {
+ flag_reg_prefix_optional = 1;
+#ifdef REGISTER_PREFIX
+ init_regtable ();
+#endif
+ }
+ m68k_abspcadd = 1;
+ m68k_rel32 = 0;
+ }
+ else
+ {
+ if (! reg_prefix_optional_seen)
+ {
+#ifdef REGISTER_PREFIX_OPTIONAL
+ flag_reg_prefix_optional = REGISTER_PREFIX_OPTIONAL;
+#else
+ flag_reg_prefix_optional = 0;
+#endif
+#ifdef REGISTER_PREFIX
+ init_regtable ();
+#endif
+ }
+ m68k_abspcadd = 0;
+ m68k_rel32 = 1;
+ }
+}
+
/* Equal to MAX_PRECISION in atof-ieee.c */
#define MAX_LITTLENUMS 6
@@ -3367,6 +3625,15 @@ md_apply_fix_2 (fixP, val)
else
val &= 0x7fffffff;
+#ifdef OBJ_ELF
+ if (fixP->fx_addsy)
+ {
+ memset (buf, 0, fixP->fx_size);
+ fixP->fx_addnumber = val; /* Remember value for emit_reloc */
+ return;
+ }
+#endif
+
switch (fixP->fx_size)
{
/* The cast to offsetT below are necessary to make code correct for
@@ -3897,13 +4164,27 @@ md_estimate_size_before_relax (fragP, segment)
{
case TAB (BCC68000, BYTE):
case TAB (ABRANCH, BYTE):
- /* We can't do a short jump to the next instruction,
- so we force word mode. */
- if (fragP->fr_symbol && S_GET_VALUE (fragP->fr_symbol) == 0 &&
- fragP->fr_symbol->sy_frag == fragP->fr_next)
+ /* We can't do a short jump to the next instruction, so in that
+ case we force word mode. At this point S_GET_VALUE should
+ return the offset of the symbol within its frag. If the
+ symbol is at the start of a frag, and it is the next frag
+ with any data in it (usually this is just the next frag, but
+ assembler listings may introduce empty frags), we must use
+ word mode. */
+ if (fragP->fr_symbol && S_GET_VALUE (fragP->fr_symbol) == 0)
{
- fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT);
- fragP->fr_var += 2;
+ fragS *l;
+
+ for (l = fragP->fr_next;
+ l != fragP->fr_symbol->sy_frag;
+ l = l->fr_next)
+ if (l->fr_fix + l->fr_var != 0)
+ break;
+ if (l == fragP->fr_symbol->sy_frag)
+ {
+ fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT);
+ fragP->fr_var += 2;
+ }
}
break;
default:
@@ -5850,6 +6131,9 @@ s_mri_endw (ignore)
* -pic Indicates PIC.
* -k Indicates PIC. (Sun 3 only.)
*
+ * --bitwise-or
+ * Permit `|' to be used in expressions.
+ *
*/
#ifdef OBJ_ELF
@@ -5864,6 +6148,8 @@ struct option md_longopts[] = {
#define OPTION_REGISTER_PREFIX_OPTIONAL (OPTION_MD_BASE + 1)
{"register-prefix-optional", no_argument, NULL,
OPTION_REGISTER_PREFIX_OPTIONAL},
+#define OPTION_BITWISE_OR (OPTION_MD_BASE + 2)
+ {"bitwise-or", no_argument, NULL, OPTION_BITWISE_OR},
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof(md_longopts);
@@ -5968,10 +6254,31 @@ md_parse_option (c, arg)
case OPTION_REGISTER_PREFIX_OPTIONAL:
flag_reg_prefix_optional = 1;
+ reg_prefix_optional_seen = 1;
break;
- case 'Q':
+ /* -V: SVR4 argument to print version ID. */
case 'V':
+ print_version_id ();
+ break;
+
+ /* -Qy, -Qn: SVR4 arguments controlling whether a .comment section
+ should be emitted or not. FIXME: Not implemented. */
+ case 'Q':
+ break;
+
+ case OPTION_BITWISE_OR:
+ {
+ char *n, *t, *s;
+
+ n = (char *) xmalloc (strlen (m68k_comment_chars) + 1);
+ t = n;
+ for (s = m68k_comment_chars; *s != '\0'; s++)
+ if (*s != '|')
+ *t++ = *s;
+ *t = '\0';
+ m68k_comment_chars = n;
+ }
break;
default:
@@ -6002,7 +6309,8 @@ md_show_usage (stream)
-pic, -k generate position independent code\n\
-S turn jbsr into jsr\n\
--register-prefix-optional\n\
- recognize register names without prefix character\n");
+ recognize register names without prefix character\n\
+--bitwise-or do not treat `|' as a comment character\n");
}
#ifdef TEST2
diff --git a/gnu/usr.bin/binutils/gas/config/tc-m88k.c b/gnu/usr.bin/binutils/gas/config/tc-m88k.c
index e9b22738e72..ca49ac261ff 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-m88k.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-m88k.c
@@ -1,7 +1,8 @@
/* m88k.c -- Assembler for the Motorola 88000
Contributed by Devon Bowen of Buffalo University
and Torbjorn Granlund of the Swedish Institute of Computer Science.
- Copyright (C) 1989, 1990, 1991, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -1432,11 +1433,12 @@ md_pcrel_from (fixp)
/* When we align the .init section, insert the correct NOP pattern. */
int
-m88k_do_align (n, fill)
+m88k_do_align (n, fill, len)
int n;
const char *fill;
+ int len;
{
- if (!fill
+ if ((fill == NULL || (*fill == 0 && len == 1))
&& strcmp (obj_segment_name (now_seg), ".init") == 0)
{
static const unsigned char nop_pattern[] = { 0xf4, 0x00, 0x58, 0x00 };
diff --git a/gnu/usr.bin/binutils/gas/config/tc-m88k.h b/gnu/usr.bin/binutils/gas/config/tc-m88k.h
index f938ee46c71..d96852e30f7 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-m88k.h
+++ b/gnu/usr.bin/binutils/gas/config/tc-m88k.h
@@ -1,8 +1,8 @@
-
/* m88k.h -- Assembler for the Motorola 88000
Contributed by Devon Bowen of Buffalo University
and Torbjorn Granlund of the Swedish Institute of Computer Science.
- Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -98,7 +98,7 @@ struct reloc_info_m88k
/* We use a special alignment function to insert the correct nop
pattern in .init. */
-extern int m88k_do_align PARAMS ((int, const char *));
-#define md_do_align(n,fill,l) if (m88k_do_align(n,fill)) goto l
+extern int m88k_do_align PARAMS ((int, const char *, int));
+#define md_do_align(n,fill,len,l) if (m88k_do_align(n,fill,len)) goto l
#endif /* M88KCOFF */
diff --git a/gnu/usr.bin/binutils/gas/config/tc-mips.c b/gnu/usr.bin/binutils/gas/config/tc-mips.c
index 9c3270ddb7d..9286347f239 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-mips.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-mips.c
@@ -1,5 +1,5 @@
/* tc-mips.c -- assemble code for a MIPS chip.
- Copyright (C) 1993, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
Contributed by the OSF and Ralph Campbell.
Written by Keith Knowles and Ralph Campbell, working independently.
Modified for ECOFF and R4000 support by Ian Lance Taylor of Cygnus
@@ -18,8 +18,9 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with GAS; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
#include "as.h"
#include "config.h"
@@ -82,6 +83,10 @@ static char *mips_regmask_frag;
extern int target_big_endian;
+/* 1 is we should use the 64 bit MIPS ELF ABI, 0 if we should use the
+ 32 bit ABI. This has no meaning for ECOFF. */
+static int mips_64;
+
/* The default target format to use. */
const char *
mips_target_format ()
@@ -93,7 +98,9 @@ mips_target_format ()
case bfd_target_ecoff_flavour:
return target_big_endian ? "ecoff-bigmips" : "ecoff-littlemips";
case bfd_target_elf_flavour:
- return target_big_endian ? "elf32-bigmips" : "elf32-littlemips";
+ return (target_big_endian
+ ? (mips_64 ? "elf64-bigmips" : "elf32-bigmips")
+ : (mips_64 ? "elf64-littlemips" : "elf32-littlemips"));
default:
abort ();
}
@@ -160,6 +167,10 @@ enum mips_pic_level
static enum mips_pic_level mips_pic;
+/* 1 if we should generate 32 bit offsets from the GP register in
+ SVR4_PIC mode. Currently has no meaning in other modes. */
+static int mips_big_got;
+
/* 1 if trap instructions should used for overflow rather than break
instructions. */
static int mips_trap;
@@ -287,6 +298,31 @@ static int prev_insn_unreordered;
/* Non-zero if the previous previous instruction was in a .set
noreorder. */
static int prev_prev_insn_unreordered;
+
+/* For ECOFF and ELF, relocations against symbols are done in two
+ parts, with a HI relocation and a LO relocation. Each relocation
+ has only 16 bits of space to store an addend. This means that in
+ order for the linker to handle carries correctly, it must be able
+ to locate both the HI and the LO relocation. This means that the
+ relocations must appear in order in the relocation table.
+
+ In order to implement this, we keep track of each unmatched HI
+ relocation. We then sort them so that they immediately precede the
+ corresponding LO relocation. */
+
+struct mips_hi_fixup
+{
+ /* Next HI fixup. */
+ struct mips_hi_fixup *next;
+ /* This fixup. */
+ fixS *fixp;
+ /* The section this fixup is in. */
+ segT seg;
+};
+
+/* The list of unmatched HI relocs. */
+
+static struct mips_hi_fixup *mips_hi_fixup_list;
/* Since the MIPS does not have multiple forms of PC relative
instructions, we do not have to do relaxing as is done on other
@@ -375,10 +411,12 @@ static int prev_prev_insn_unreordered;
static int insn_uses_reg PARAMS ((struct mips_cl_insn *ip,
unsigned int reg, int fpr));
+static int reg_needs_delay PARAMS ((int));
static void append_insn PARAMS ((char *place,
struct mips_cl_insn * ip,
expressionS * p,
- bfd_reloc_code_real_type r));
+ bfd_reloc_code_real_type r,
+ boolean));
static void mips_no_prev_insn PARAMS ((void));
static void mips_emit_delays PARAMS ((void));
#ifdef USE_STDARG
@@ -407,8 +445,6 @@ static void mips_align PARAMS ((int to, int fill, symbolS *label));
static void s_align PARAMS ((int));
static void s_change_sec PARAMS ((int));
static void s_cons PARAMS ((int));
-static void s_mipserr PARAMS ((int));
-static void s_extern PARAMS ((int));
static void s_float_cons PARAMS ((int));
static void s_mips_globl PARAMS ((int));
static void s_option PARAMS ((int));
@@ -461,7 +497,7 @@ static const pseudo_typeS mips_pseudo_table[] =
chips. */
{"asciiz", stringer, 1},
{"bss", s_change_sec, 'b'},
- {"err", s_mipserr, 0},
+ {"err", s_err, 0},
{"half", s_cons, 1},
{"dword", s_cons, 3},
@@ -515,11 +551,21 @@ mips_pop_insert ()
static char *expr_end;
+/* Expressions which appear in instructions. These are set by
+ mips_ip. */
+
static expressionS imm_expr;
static expressionS offset_expr;
+
+/* Relocs associated with imm_expr and offset_expr. */
+
static bfd_reloc_code_real_type imm_reloc;
static bfd_reloc_code_real_type offset_reloc;
+/* This is set by mips_ip if imm_reloc is an unmatched HI16_S reloc. */
+
+static boolean imm_unmatched_hi;
+
/*
* This function is called once, at assembler startup time. It should
* set up all the tables, etc. that the MD part of the assembler will need.
@@ -728,18 +774,51 @@ md_begin ()
seg = now_seg;
subseg = now_subseg;
- sec = subseg_new (".reginfo", (subsegT) 0);
- /* The ABI says this section should be loaded so that the
- running program can access it. */
- (void) bfd_set_section_flags (stdoutput, sec,
- (SEC_ALLOC | SEC_LOAD
- | SEC_READONLY | SEC_DATA));
- (void) bfd_set_section_alignment (stdoutput, sec, 2);
+ if (! mips_64)
+ {
+ sec = subseg_new (".reginfo", (subsegT) 0);
+ /* The ABI says this section should be loaded so that the
+ running program can access it. */
+ (void) bfd_set_section_flags (stdoutput, sec,
+ (SEC_ALLOC | SEC_LOAD
+ | SEC_READONLY | SEC_DATA));
+ (void) bfd_set_section_alignment (stdoutput, sec, 2);
+
#ifdef OBJ_ELF
- mips_regmask_frag = frag_more (sizeof (Elf32_External_RegInfo));
+ mips_regmask_frag = frag_more (sizeof (Elf32_External_RegInfo));
#endif
+ }
+ else
+ {
+ /* The 64-bit ABI uses a .MIPS.options section rather than
+ .reginfo section. */
+ sec = subseg_new (".MIPS.options", (subsegT) 0);
+ (void) bfd_set_section_flags (stdoutput, sec,
+ (SEC_ALLOC | SEC_LOAD
+ | SEC_READONLY | SEC_DATA));
+ (void) bfd_set_section_alignment (stdoutput, sec, 3);
+
+#ifdef OBJ_ELF
+ /* Set up the option header. */
+ {
+ Elf_Internal_Options opthdr;
+ char *f;
+
+ opthdr.kind = ODK_REGINFO;
+ opthdr.size = (sizeof (Elf_External_Options)
+ + sizeof (Elf64_External_RegInfo));
+ opthdr.section = 0;
+ opthdr.info = 0;
+ f = frag_more (sizeof (Elf_External_Options));
+ bfd_mips_elf_swap_options_out (stdoutput, &opthdr,
+ (Elf_External_Options *) f);
+
+ mips_regmask_frag = frag_more (sizeof (Elf64_External_RegInfo));
+ }
+#endif
+ }
if (ECOFF_DEBUGGING)
{
@@ -771,7 +850,10 @@ md_assemble (str)
struct mips_cl_insn insn;
imm_expr.X_op = O_absent;
+ imm_reloc = BFD_RELOC_UNUSED;
+ imm_unmatched_hi = false;
offset_expr.X_op = O_absent;
+ offset_reloc = BFD_RELOC_UNUSED;
mips_ip (str, &insn);
if (insn_error)
@@ -786,11 +868,12 @@ md_assemble (str)
else
{
if (imm_expr.X_op != O_absent)
- append_insn ((char *) NULL, &insn, &imm_expr, imm_reloc);
+ append_insn ((char *) NULL, &insn, &imm_expr, imm_reloc,
+ imm_unmatched_hi);
else if (offset_expr.X_op != O_absent)
- append_insn ((char *) NULL, &insn, &offset_expr, offset_reloc);
+ append_insn ((char *) NULL, &insn, &offset_expr, offset_reloc, false);
else
- append_insn ((char *) NULL, &insn, NULL, BFD_RELOC_UNUSED);
+ append_insn ((char *) NULL, &insn, NULL, BFD_RELOC_UNUSED, false);
}
}
@@ -838,17 +921,46 @@ insn_uses_reg (ip, reg, fpr)
return 0;
}
+/* This function returns true if modifying a register requires a
+ delay. */
+
+static int
+reg_needs_delay (reg)
+ int reg;
+{
+ unsigned long prev_pinfo;
+
+ prev_pinfo = prev_insn.insn_mo->pinfo;
+ if (! mips_noreorder
+ && mips_isa < 4
+ && ((prev_pinfo & INSN_LOAD_COPROC_DELAY)
+ || (mips_isa < 2
+ && (prev_pinfo & INSN_LOAD_MEMORY_DELAY))))
+ {
+ /* A load from a coprocessor or from memory. All load
+ delays delay the use of general register rt for one
+ instruction on the r3000. The r6000 and r4000 use
+ interlocks. */
+ know (prev_pinfo & INSN_WRITE_GPR_T);
+ if (reg == ((prev_insn.insn_opcode >> OP_SH_RT) & OP_MASK_RT))
+ return 1;
+ }
+
+ return 0;
+}
+
/* Output an instruction. PLACE is where to put the instruction; if
it is NULL, this uses frag_more to get room. IP is the instruction
information. ADDRESS_EXPR is an operand of the instruction to be
used with RELOC_TYPE. */
static void
-append_insn (place, ip, address_expr, reloc_type)
+append_insn (place, ip, address_expr, reloc_type, unmatched_hi)
char *place;
struct mips_cl_insn *ip;
expressionS *address_expr;
bfd_reloc_code_real_type reloc_type;
+ boolean unmatched_hi;
{
register unsigned long prev_pinfo, pinfo;
char *f;
@@ -1080,10 +1192,24 @@ append_insn (place, ip, address_expr, reloc_type)
/* Don't generate a reloc if we are writing into a variant
frag. */
if (place == NULL)
- fixp = fix_new_exp (frag_now, f - frag_now->fr_literal, 4,
- address_expr,
- reloc_type == BFD_RELOC_16_PCREL_S2,
- reloc_type);
+ {
+ fixp = fix_new_exp (frag_now, f - frag_now->fr_literal, 4,
+ address_expr,
+ reloc_type == BFD_RELOC_16_PCREL_S2,
+ reloc_type);
+ if (unmatched_hi)
+ {
+ struct mips_hi_fixup *hi_fixup;
+
+ assert (reloc_type == BFD_RELOC_HI16_S);
+ hi_fixup = ((struct mips_hi_fixup *)
+ xmalloc (sizeof (struct mips_hi_fixup)));
+ hi_fixup->fixp = fixp;
+ hi_fixup->seg = now_seg;
+ hi_fixup->next = mips_hi_fixup_list;
+ mips_hi_fixup_list = hi_fixup;
+ }
+ }
}
}
@@ -1543,6 +1669,8 @@ macro_build (place, counter, ep, name, fmt, va_alist)
|| r == BFD_RELOC_LO16
|| r == BFD_RELOC_MIPS_GOT16
|| r == BFD_RELOC_MIPS_CALL16
+ || r == BFD_RELOC_MIPS_GOT_LO16
+ || r == BFD_RELOC_MIPS_CALL_LO16
|| (ep->X_op == O_subtract
&& now_seg == text_section
&& r == BFD_RELOC_PCREL_LO16));
@@ -1554,7 +1682,9 @@ macro_build (place, counter, ep, name, fmt, va_alist)
&& (ep->X_op == O_constant
|| (ep->X_op == O_symbol
&& (r == BFD_RELOC_HI16_S
- || r == BFD_RELOC_HI16))
+ || r == BFD_RELOC_HI16
+ || r == BFD_RELOC_MIPS_GOT_HI16
+ || r == BFD_RELOC_MIPS_CALL_HI16))
|| (ep->X_op == O_subtract
&& now_seg == text_section
&& r == BFD_RELOC_PCREL_HI16_S)));
@@ -1597,7 +1727,7 @@ macro_build (place, counter, ep, name, fmt, va_alist)
va_end (args);
assert (r == BFD_RELOC_UNUSED ? ep == NULL : ep != NULL);
- append_insn (place, &insn, ep, r);
+ append_insn (place, &insn, ep, r, false);
}
/*
@@ -1621,7 +1751,7 @@ macro_build_lui (place, counter, ep, regnum)
else
{
high_expr.X_op = O_constant;
- high_expr.X_add_number = 0;
+ high_expr.X_add_number = ep->X_add_number;
}
if (high_expr.X_op == O_constant)
@@ -1662,10 +1792,10 @@ macro_build_lui (place, counter, ep, regnum)
if (r == BFD_RELOC_UNUSED)
{
insn.insn_opcode |= high_expr.X_add_number;
- append_insn (place, &insn, NULL, r);
+ append_insn (place, &insn, NULL, r, false);
}
else
- append_insn (place, &insn, &high_expr, r);
+ append_insn (place, &insn, &high_expr, r, false);
}
/* set_at()
@@ -1741,13 +1871,15 @@ load_register (counter, reg, ep, dbl)
(int) BFD_RELOC_LO16);
return;
}
- else if (((ep->X_add_number &~ (offsetT) 0x7fffffff) == 0
- || ((ep->X_add_number &~ (offsetT) 0x7fffffff)
- == ~ (offsetT) 0x7fffffff))
- && (! dbl
- || ! ep->X_unsigned
- || sizeof (ep->X_add_number) > 4
- || (ep->X_add_number & 0x80000000) == 0))
+ else if ((((ep->X_add_number &~ (offsetT) 0x7fffffff) == 0
+ || ((ep->X_add_number &~ (offsetT) 0x7fffffff)
+ == ~ (offsetT) 0x7fffffff))
+ && (! dbl
+ || ! ep->X_unsigned
+ || sizeof (ep->X_add_number) > 4
+ || (ep->X_add_number & 0x80000000) == 0))
+ || (mips_isa < 3
+ && (ep->X_add_number &~ 0xffffffff) == 0))
{
/* 32 bit values require an lui. */
macro_build ((char *) NULL, counter, ep, "lui", "t,u", reg,
@@ -1810,6 +1942,23 @@ load_register (counter, reg, ep, dbl)
freg = 0;
else
{
+ if (hi32.X_add_number == 0xffffffff)
+ {
+ if ((lo32.X_add_number & 0xffff8000) == 0xffff8000)
+ {
+ macro_build ((char *) NULL, counter, &lo32, "addiu", "t,r,j", reg, 0,
+ (int) BFD_RELOC_LO16);
+ return;
+ }
+ if (lo32.X_add_number & 0x80000000)
+ {
+ macro_build ((char *) NULL, counter, &lo32, "lui", "t,u", reg,
+ (int) BFD_RELOC_HI16);
+ macro_build ((char *) NULL, counter, &lo32, "ori", "t,r,i", reg, reg,
+ (int) BFD_RELOC_LO16);
+ return;
+ }
+ }
load_register (counter, reg, &hi32, 0);
freg = reg;
}
@@ -1826,6 +1975,15 @@ load_register (counter, reg, ep, dbl)
{
expressionS mid16;
+ if ((freg == 0) && (lo32.X_add_number == 0xffffffff))
+ {
+ macro_build ((char *) NULL, counter, &lo32, "lui", "t,u", reg,
+ (int) BFD_RELOC_HI16);
+ macro_build ((char *) NULL, counter, NULL, "dsrl32", "d,w,<", reg,
+ reg, 32);
+ return;
+ }
+
if (freg != 0)
{
macro_build ((char *) NULL, counter, NULL, "dsll", "d,w,<", reg,
@@ -1876,7 +2034,8 @@ load_address (counter, reg, ep)
lui $reg,<sym> (BFD_RELOC_HI16_S)
addiu $reg,$reg,<sym> (BFD_RELOC_LO16)
If we have an addend, we always use the latter form. */
- if (ep->X_add_number != 0 || nopic_need_relax (ep->X_add_symbol))
+ if ((valueT) ep->X_add_number >= MAX_GPREL_OFFSET
+ || nopic_need_relax (ep->X_add_symbol))
p = NULL;
else
{
@@ -1895,7 +2054,7 @@ load_address (counter, reg, ep)
mips_isa < 3 ? "addiu" : "daddiu",
"t,r,j", reg, reg, (int) BFD_RELOC_LO16);
}
- else if (mips_pic == SVR4_PIC)
+ else if (mips_pic == SVR4_PIC && ! mips_big_got)
{
expressionS ex;
@@ -1924,7 +2083,69 @@ load_address (counter, reg, ep)
if (ex.X_add_number < -0x8000 || ex.X_add_number >= 0x8000)
as_bad ("PIC code offset overflow (max 16 signed bits)");
ex.X_op = O_constant;
- macro_build (p, counter, &ex,
+ macro_build ((char *) NULL, counter, &ex,
+ mips_isa < 3 ? "addiu" : "daddiu",
+ "t,r,j", reg, reg, (int) BFD_RELOC_LO16);
+ }
+ }
+ else if (mips_pic == SVR4_PIC)
+ {
+ expressionS ex;
+ int off;
+
+ /* This is the large GOT case. If this is a reference to an
+ external symbol, we want
+ lui $reg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
+ addu $reg,$reg,$gp
+ lw $reg,<sym>($reg) (BFD_RELOC_MIPS_GOT_LO16)
+ Otherwise, for a reference to a local symbol, we want
+ lw $reg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
+ nop
+ addiu $reg,$reg,<sym> (BFD_RELOC_LO16)
+ If there is a constant, it must be added in after. */
+ ex.X_add_number = ep->X_add_number;
+ ep->X_add_number = 0;
+ if (reg_needs_delay (GP))
+ off = 4;
+ else
+ off = 0;
+ frag_grow (32);
+ macro_build ((char *) NULL, counter, ep, "lui", "t,u", reg,
+ (int) BFD_RELOC_MIPS_GOT_HI16);
+ macro_build ((char *) NULL, counter, (expressionS *) NULL,
+ mips_isa < 3 ? "addu" : "daddu",
+ "d,v,t", reg, reg, GP);
+ macro_build ((char *) NULL, counter, ep,
+ mips_isa < 3 ? "lw" : "ld",
+ "t,o(b)", reg, (int) BFD_RELOC_MIPS_GOT_LO16, reg);
+ p = frag_var (rs_machine_dependent, 12 + off, 0,
+ RELAX_ENCODE (12, 12 + off, off, 8 + off, 0,
+ mips_warn_about_macros),
+ ep->X_add_symbol, (long) 0, (char *) NULL);
+ if (off > 0)
+ {
+ /* We need a nop before loading from $gp. This special
+ check is required because the lui which starts the main
+ instruction stream does not refer to $gp, and so will not
+ insert the nop which may be required. */
+ macro_build (p, counter, (expressionS *) NULL, "nop", "");
+ p += 4;
+ }
+ macro_build (p, counter, ep,
+ mips_isa < 3 ? "lw" : "ld",
+ "t,o(b)", reg, (int) BFD_RELOC_MIPS_GOT16, GP);
+ p += 4;
+ macro_build (p, counter, (expressionS *) NULL, "nop", "");
+ p += 4;
+ macro_build (p, counter, ep,
+ mips_isa < 3 ? "addiu" : "daddiu",
+ "t,r,j", reg, reg, (int) BFD_RELOC_LO16);
+ if (ex.X_add_number != 0)
+ {
+ if (ex.X_add_number < -0x8000 || ex.X_add_number >= 0x8000)
+ as_bad ("PIC code offset overflow (max 16 signed bits)");
+ ex.X_op = O_constant;
+ macro_build ((char *) NULL, counter, &ex,
mips_isa < 3 ? "addiu" : "daddiu",
"t,r,j", reg, reg, (int) BFD_RELOC_LO16);
}
@@ -2681,7 +2902,7 @@ macro (ip)
addiu $tempreg,$tempreg,<sym> (BFD_RELOC_LO16)
If we have a constant, we need two instructions anyhow,
so we may as well always use the latter form. */
- if (offset_expr.X_add_number != 0
+ if ((valueT) offset_expr.X_add_number >= MAX_GPREL_OFFSET
|| nopic_need_relax (offset_expr.X_add_symbol))
p = NULL;
else
@@ -2703,7 +2924,7 @@ macro (ip)
mips_isa < 3 ? "addiu" : "daddiu",
"t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16);
}
- else if (mips_pic == SVR4_PIC)
+ else if (mips_pic == SVR4_PIC && ! mips_big_got)
{
/* If this is a reference to an external symbol, and there
is no constant, we want
@@ -2829,6 +3050,214 @@ macro (ip)
used_at = 1;
}
}
+ else if (mips_pic == SVR4_PIC)
+ {
+ int gpdel;
+
+ /* This is the large GOT case. If this is a reference to an
+ external symbol, and there is no constant, we want
+ lui $tempreg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
+ addu $tempreg,$tempreg,$gp
+ lw $tempreg,<sym>($tempreg) (BFD_RELOC_MIPS_GOT_LO16)
+ For a local symbol, we want
+ lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
+ nop
+ addiu $tempreg,$tempreg,<sym> (BFD_RELOC_LO16)
+
+ If we have a small constant, and this is a reference to
+ an external symbol, we want
+ lui $tempreg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
+ addu $tempreg,$tempreg,$gp
+ lw $tempreg,<sym>($tempreg) (BFD_RELOC_MIPS_GOT_LO16)
+ nop
+ addiu $tempreg,$tempreg,<constant>
+ For a local symbol, we want
+ lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
+ nop
+ addiu $tempreg,$tempreg,<constant> (BFD_RELOC_LO16)
+
+ If we have a large constant, and this is a reference to
+ an external symbol, we want
+ lui $tempreg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
+ addu $tempreg,$tempreg,$gp
+ lw $tempreg,<sym>($tempreg) (BFD_RELOC_MIPS_GOT_LO16)
+ lui $at,<hiconstant>
+ addiu $at,$at,<loconstant>
+ addu $tempreg,$tempreg,$at
+ For a local symbol, we want
+ lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
+ lui $at,<hiconstant>
+ addiu $at,$at,<loconstant> (BFD_RELOC_LO16)
+ addu $tempreg,$tempreg,$at
+ */
+ expr1.X_add_number = offset_expr.X_add_number;
+ offset_expr.X_add_number = 0;
+ frag_grow (52);
+ if (reg_needs_delay (GP))
+ gpdel = 4;
+ else
+ gpdel = 0;
+ macro_build ((char *) NULL, &icnt, &offset_expr, "lui", "t,u",
+ tempreg, (int) BFD_RELOC_MIPS_GOT_HI16);
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
+ mips_isa < 3 ? "addu" : "daddu",
+ "d,v,t", tempreg, tempreg, GP);
+ macro_build ((char *) NULL, &icnt, &offset_expr,
+ dbl ? "ld" : "lw",
+ "t,o(b)", tempreg, (int) BFD_RELOC_MIPS_GOT_LO16,
+ tempreg);
+ if (expr1.X_add_number == 0)
+ {
+ int off;
+
+ if (breg == 0)
+ off = 0;
+ else
+ {
+ /* We're going to put in an addu instruction using
+ tempreg, so we may as well insert the nop right
+ now. */
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
+ "nop", "");
+ off = 4;
+ }
+
+ p = frag_var (rs_machine_dependent, 12 + gpdel, 0,
+ RELAX_ENCODE (12 + off, 12 + gpdel, gpdel,
+ 8 + gpdel, 0,
+ (breg == 0
+ ? mips_warn_about_macros
+ : 0)),
+ offset_expr.X_add_symbol, (long) 0,
+ (char *) NULL);
+ }
+ else if (expr1.X_add_number >= -0x8000
+ && expr1.X_add_number < 0x8000)
+ {
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
+ "nop", "");
+ macro_build ((char *) NULL, &icnt, &expr1,
+ mips_isa < 3 ? "addiu" : "daddiu",
+ "t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16);
+
+ p = frag_var (rs_machine_dependent, 12 + gpdel, 0,
+ RELAX_ENCODE (20, 12 + gpdel, gpdel, 8 + gpdel, 0,
+ (breg == 0
+ ? mips_warn_about_macros
+ : 0)),
+ offset_expr.X_add_symbol, (long) 0,
+ (char *) NULL);
+ }
+ else
+ {
+ int adj, dreg;
+
+ /* If we are going to add in a base register, and the
+ target register and the base register are the same,
+ then we are using AT as a temporary register. Since
+ we want to load the constant into AT, we add our
+ current AT (from the global offset table) and the
+ register into the register now, and pretend we were
+ not using a base register. */
+ if (breg != treg)
+ {
+ adj = 0;
+ dreg = tempreg;
+ }
+ else
+ {
+ assert (tempreg == AT);
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
+ "nop", "");
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
+ mips_isa < 3 ? "addu" : "daddu",
+ "d,v,t", treg, AT, breg);
+ dreg = treg;
+ adj = 8;
+ }
+
+ /* Set mips_optimize around the lui instruction to avoid
+ inserting an unnecessary nop after the lw. */
+ hold_mips_optimize = mips_optimize;
+ mips_optimize = 2;
+ macro_build_lui ((char *) NULL, &icnt, &expr1, AT);
+ mips_optimize = hold_mips_optimize;
+
+ macro_build ((char *) NULL, &icnt, &expr1,
+ mips_isa < 3 ? "addiu" : "daddiu",
+ "t,r,j", AT, AT, (int) BFD_RELOC_LO16);
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
+ mips_isa < 3 ? "addu" : "daddu",
+ "d,v,t", dreg, dreg, AT);
+
+ p = frag_var (rs_machine_dependent, 16 + gpdel + adj, 0,
+ RELAX_ENCODE (24 + adj, 16 + gpdel + adj, gpdel,
+ 8 + gpdel, 0,
+ (breg == 0
+ ? mips_warn_about_macros
+ : 0)),
+ offset_expr.X_add_symbol, (long) 0,
+ (char *) NULL);
+
+ used_at = 1;
+ }
+
+ if (gpdel > 0)
+ {
+ /* This is needed because this instruction uses $gp, but
+ the first instruction on the main stream does not. */
+ macro_build (p, &icnt, (expressionS *) NULL, "nop", "");
+ p += 4;
+ }
+ macro_build (p, &icnt, &offset_expr,
+ dbl ? "ld" : "lw",
+ "t,o(b)", tempreg, (int) BFD_RELOC_MIPS_GOT16, GP);
+ p += 4;
+ if (expr1.X_add_number >= -0x8000
+ && expr1.X_add_number < 0x8000)
+ {
+ macro_build (p, &icnt, (expressionS *) NULL, "nop", "");
+ p += 4;
+ macro_build (p, &icnt, &expr1,
+ mips_isa < 3 ? "addiu" : "daddiu",
+ "t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16);
+ /* FIXME: If add_number is 0, and there was no base
+ register, the external symbol case ended with a load,
+ so if the symbol turns out to not be external, and
+ the next instruction uses tempreg, an unnecessary nop
+ will be inserted. */
+ }
+ else
+ {
+ if (breg == treg)
+ {
+ /* We must add in the base register now, as in the
+ external symbol case. */
+ assert (tempreg == AT);
+ macro_build (p, &icnt, (expressionS *) NULL, "nop", "");
+ p += 4;
+ macro_build (p, &icnt, (expressionS *) NULL,
+ mips_isa < 3 ? "addu" : "daddu",
+ "d,v,t", treg, AT, breg);
+ p += 4;
+ tempreg = treg;
+ /* We set breg to 0 because we have arranged to add
+ it in in both cases. */
+ breg = 0;
+ }
+
+ macro_build_lui (p, &icnt, &expr1, AT);
+ p += 4;
+ macro_build (p, &icnt, &expr1,
+ mips_isa < 3 ? "addiu" : "daddiu",
+ "t,r,j", AT, AT, (int) BFD_RELOC_LO16);
+ p += 4;
+ macro_build (p, &icnt, (expressionS *) NULL,
+ mips_isa < 3 ? "addu" : "daddu",
+ "d,v,t", tempreg, tempreg, AT);
+ p += 4;
+ }
+ }
else if (mips_pic == EMBEDDED_PIC)
{
/* We use
@@ -2899,30 +3328,78 @@ macro (ip)
macro_build ((char *) NULL, &icnt, &offset_expr, "jal", "a");
else if (mips_pic == SVR4_PIC)
{
- /* If this is a reference to an external symbol, we want
+ /* If this is a reference to an external symbol, and we are
+ using a small GOT, we want
lw $25,<sym>($gp) (BFD_RELOC_MIPS_CALL16)
nop
jalr $25
nop
lw $gp,cprestore($sp)
The cprestore value is set using the .cprestore
- pseudo-op. If the symbol is not external, we want
+ pseudo-op. If we are using a big GOT, we want
+ lui $25,<sym> (BFD_RELOC_MIPS_CALL_HI16)
+ addu $25,$25,$gp
+ lw $25,<sym>($25) (BFD_RELOC_MIPS_CALL_LO16)
+ nop
+ jalr $25
+ nop
+ lw $gp,cprestore($sp)
+ If the symbol is not external, we want
lw $25,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
nop
addiu $25,$25,<sym> (BFD_RELOC_LO16)
jalr $25
nop
- lw $gp,cprestore($sp)
- */
- frag_grow (20);
- macro_build ((char *) NULL, &icnt, &offset_expr,
- mips_isa < 3 ? "lw" : "ld",
- "t,o(b)", PIC_CALL_REG,
- (int) BFD_RELOC_MIPS_CALL16, GP);
- macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", "");
- p = frag_var (rs_machine_dependent, 4, 0,
- RELAX_ENCODE (0, 4, -8, 0, 0, 0),
- offset_expr.X_add_symbol, (long) 0, (char *) NULL);
+ lw $gp,cprestore($sp) */
+ frag_grow (40);
+ if (! mips_big_got)
+ {
+ macro_build ((char *) NULL, &icnt, &offset_expr,
+ mips_isa < 3 ? "lw" : "ld",
+ "t,o(b)", PIC_CALL_REG,
+ (int) BFD_RELOC_MIPS_CALL16, GP);
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
+ "nop", "");
+ p = frag_var (rs_machine_dependent, 4, 0,
+ RELAX_ENCODE (0, 4, -8, 0, 0, 0),
+ offset_expr.X_add_symbol, (long) 0, (char *) NULL);
+ }
+ else
+ {
+ int gpdel;
+
+ if (reg_needs_delay (GP))
+ gpdel = 4;
+ else
+ gpdel = 0;
+ macro_build ((char *) NULL, &icnt, &offset_expr, "lui", "t,u",
+ PIC_CALL_REG, (int) BFD_RELOC_MIPS_CALL_HI16);
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
+ mips_isa < 3 ? "addu" : "daddu",
+ "d,v,t", PIC_CALL_REG, PIC_CALL_REG, GP);
+ macro_build ((char *) NULL, &icnt, &offset_expr,
+ mips_isa < 3 ? "lw" : "ld",
+ "t,o(b)", PIC_CALL_REG,
+ (int) BFD_RELOC_MIPS_CALL_LO16, PIC_CALL_REG);
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
+ "nop", "");
+ p = frag_var (rs_machine_dependent, 12 + gpdel, 0,
+ RELAX_ENCODE (16, 12 + gpdel, gpdel, 8 + gpdel,
+ 0, 0),
+ offset_expr.X_add_symbol, (long) 0, (char *) NULL);
+ if (gpdel > 0)
+ {
+ macro_build (p, &icnt, (expressionS *) NULL, "nop", "");
+ p += 4;
+ }
+ macro_build (p, &icnt, &offset_expr,
+ mips_isa < 3 ? "lw" : "ld",
+ "t,o(b)", PIC_CALL_REG,
+ (int) BFD_RELOC_MIPS_GOT16, GP);
+ p += 4;
+ macro_build (p, &icnt, (expressionS *) NULL, "nop", "");
+ p += 4;
+ }
macro_build (p, &icnt, &offset_expr,
mips_isa < 3 ? "addiu" : "daddiu",
"t,r,j", PIC_CALL_REG, PIC_CALL_REG,
@@ -3136,7 +3613,7 @@ macro (ip)
With a constant we always use the latter case. */
if (breg == 0)
{
- if (offset_expr.X_add_number != 0
+ if ((valueT) offset_expr.X_add_number >= MAX_GPREL_OFFSET
|| nopic_need_relax (offset_expr.X_add_symbol))
p = NULL;
else
@@ -3160,7 +3637,7 @@ macro (ip)
}
else
{
- if (offset_expr.X_add_number != 0
+ if ((valueT) offset_expr.X_add_number >= MAX_GPREL_OFFSET
|| nopic_need_relax (offset_expr.X_add_symbol))
p = NULL;
else
@@ -3188,7 +3665,7 @@ macro (ip)
(int) BFD_RELOC_LO16, tempreg);
}
}
- else if (mips_pic == SVR4_PIC)
+ else if (mips_pic == SVR4_PIC && ! mips_big_got)
{
/* If this is a reference to an external symbol, we want
lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
@@ -3230,6 +3707,70 @@ macro (ip)
macro_build ((char *) NULL, &icnt, &expr1, s, fmt, treg,
(int) BFD_RELOC_LO16, tempreg);
}
+ else if (mips_pic == SVR4_PIC)
+ {
+ int gpdel;
+
+ /* If this is a reference to an external symbol, we want
+ lui $tempreg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
+ addu $tempreg,$tempreg,$gp
+ lw $tempreg,<sym>($tempreg) (BFD_RELOC_MIPS_GOT_LO16)
+ <op> $treg,0($tempreg)
+ Otherwise we want
+ lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
+ nop
+ addiu $tempreg,$tempreg,<sym> (BFD_RELOC_LO16)
+ <op> $treg,0($tempreg)
+ If there is a base register, we add it to $tempreg before
+ the <op>. If there is a constant, we stick it in the
+ <op> instruction. We don't handle constants larger than
+ 16 bits, because we have no way to load the upper 16 bits
+ (actually, we could handle them for the subset of cases
+ in which we are not using $at). */
+ assert (offset_expr.X_op == O_symbol);
+ expr1.X_add_number = offset_expr.X_add_number;
+ offset_expr.X_add_number = 0;
+ if (expr1.X_add_number < -0x8000
+ || expr1.X_add_number >= 0x8000)
+ as_bad ("PIC code offset overflow (max 16 signed bits)");
+ if (reg_needs_delay (GP))
+ gpdel = 4;
+ else
+ gpdel = 0;
+ frag_grow (36);
+ macro_build ((char *) NULL, &icnt, &offset_expr, "lui", "t,u",
+ tempreg, (int) BFD_RELOC_MIPS_GOT_HI16);
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
+ mips_isa < 3 ? "addu" : "daddu",
+ "d,v,t", tempreg, tempreg, GP);
+ macro_build ((char *) NULL, &icnt, &offset_expr,
+ mips_isa < 3 ? "lw" : "ld",
+ "t,o(b)", tempreg, (int) BFD_RELOC_MIPS_GOT_LO16,
+ tempreg);
+ p = frag_var (rs_machine_dependent, 12 + gpdel, 0,
+ RELAX_ENCODE (12, 12 + gpdel, gpdel, 8 + gpdel, 0, 0),
+ offset_expr.X_add_symbol, (long) 0, (char *) NULL);
+ if (gpdel > 0)
+ {
+ macro_build (p, &icnt, (expressionS *) NULL, "nop", "");
+ p += 4;
+ }
+ macro_build (p, &icnt, &offset_expr,
+ mips_isa < 3 ? "lw" : "ld",
+ "t,o(b)", tempreg, (int) BFD_RELOC_MIPS_GOT16, GP);
+ p += 4;
+ macro_build (p, &icnt, (expressionS *) NULL, "nop", "");
+ p += 4;
+ macro_build (p, &icnt, &offset_expr,
+ mips_isa < 3 ? "addiu" : "daddiu",
+ "t,r,j", tempreg, tempreg, (int) BFD_RELOC_LO16);
+ if (breg != 0)
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
+ mips_isa < 3 ? "addu" : "daddu",
+ "d,v,t", tempreg, tempreg, breg);
+ macro_build ((char *) NULL, &icnt, &expr1, s, fmt, treg,
+ (int) BFD_RELOC_LO16, tempreg);
+ }
else if (mips_pic == EMBEDDED_PIC)
{
/* If there is no base register, we want
@@ -3501,7 +4042,7 @@ macro (ip)
If there is a base register, we add it to $at after the
lui instruction. If there is a constant, we always use
the last case. */
- if (offset_expr.X_add_number != 0
+ if ((valueT) offset_expr.X_add_number >= MAX_GPREL_OFFSET
|| nopic_need_relax (offset_expr.X_add_symbol))
{
p = NULL;
@@ -3582,7 +4123,7 @@ macro (ip)
coproc ? treg : treg + 1,
(int) BFD_RELOC_LO16, AT);
}
- else if (mips_pic == SVR4_PIC)
+ else if (mips_pic == SVR4_PIC && ! mips_big_got)
{
int off;
@@ -3637,6 +4178,106 @@ macro (ip)
offset_expr.X_add_symbol, (long) 0,
(char *) NULL);
}
+ else if (mips_pic == SVR4_PIC)
+ {
+ int gpdel, off;
+
+ /* If this is a reference to an external symbol, we want
+ lui $at,<sym> (BFD_RELOC_MIPS_GOT_HI16)
+ addu $at,$at,$gp
+ lw $at,<sym>($at) (BFD_RELOC_MIPS_GOT_LO16)
+ nop
+ <op> $treg,0($at)
+ <op> $treg+1,4($at)
+ Otherwise we want
+ lw $at,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
+ nop
+ <op> $treg,<sym>($at) (BFD_RELOC_LO16)
+ <op> $treg+1,<sym>+4($at) (BFD_RELOC_LO16)
+ If there is a base register we add it to $at before the
+ lwc1 instructions. If there is a constant we include it
+ in the lwc1 instructions. */
+ used_at = 1;
+ expr1.X_add_number = offset_expr.X_add_number;
+ offset_expr.X_add_number = 0;
+ if (expr1.X_add_number < -0x8000
+ || expr1.X_add_number >= 0x8000 - 4)
+ as_bad ("PIC code offset overflow (max 16 signed bits)");
+ if (reg_needs_delay (GP))
+ gpdel = 4;
+ else
+ gpdel = 0;
+ if (breg == 0)
+ off = 0;
+ else
+ off = 4;
+ frag_grow (56);
+ macro_build ((char *) NULL, &icnt, &offset_expr, "lui", "t,u",
+ AT, (int) BFD_RELOC_MIPS_GOT_HI16);
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
+ mips_isa < 3 ? "addu" : "daddu",
+ "d,v,t", AT, AT, GP);
+ macro_build ((char *) NULL, &icnt, &offset_expr,
+ mips_isa < 3 ? "lw" : "ld",
+ "t,o(b)", AT, (int) BFD_RELOC_MIPS_GOT_LO16, AT);
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", "");
+ if (breg != 0)
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
+ mips_isa < 3 ? "addu" : "daddu",
+ "d,v,t", AT, breg, AT);
+ macro_build ((char *) NULL, &icnt, &expr1, s, fmt,
+ coproc ? treg + 1 : treg,
+ (int) BFD_RELOC_LO16, AT);
+ expr1.X_add_number += 4;
+
+ /* Set mips_optimize to 2 to avoid inserting an undesired
+ nop. */
+ hold_mips_optimize = mips_optimize;
+ mips_optimize = 2;
+ macro_build ((char *) NULL, &icnt, &expr1, s, fmt,
+ coproc ? treg : treg + 1,
+ (int) BFD_RELOC_LO16, AT);
+ mips_optimize = hold_mips_optimize;
+ expr1.X_add_number -= 4;
+
+ p = frag_var (rs_machine_dependent, 16 + gpdel + off, 0,
+ RELAX_ENCODE (24 + off, 16 + gpdel + off, gpdel,
+ 8 + gpdel + off, 1, 0),
+ offset_expr.X_add_symbol, (long) 0,
+ (char *) NULL);
+ if (gpdel > 0)
+ {
+ macro_build (p, &icnt, (expressionS *) NULL, "nop", "");
+ p += 4;
+ }
+ macro_build (p, &icnt, &offset_expr,
+ mips_isa < 3 ? "lw" : "ld",
+ "t,o(b)", AT, (int) BFD_RELOC_MIPS_GOT16, GP);
+ p += 4;
+ macro_build (p, &icnt, (expressionS *) NULL, "nop", "");
+ p += 4;
+ if (breg != 0)
+ {
+ macro_build (p, &icnt, (expressionS *) NULL,
+ mips_isa < 3 ? "addu" : "daddu",
+ "d,v,t", AT, breg, AT);
+ p += 4;
+ }
+ macro_build (p, &icnt, &expr1, s, fmt,
+ coproc ? treg + 1 : treg,
+ (int) BFD_RELOC_LO16, AT);
+ p += 4;
+ expr1.X_add_number += 4;
+
+ /* Set mips_optimize to 2 to avoid inserting an undesired
+ nop. */
+ hold_mips_optimize = mips_optimize;
+ mips_optimize = 2;
+ macro_build (p, &icnt, &expr1, s, fmt,
+ coproc ? treg : treg + 1,
+ (int) BFD_RELOC_LO16, AT);
+ mips_optimize = hold_mips_optimize;
+ }
else if (mips_pic == EMBEDDED_PIC)
{
/* If there is no base register, we use
@@ -3817,9 +4458,9 @@ macro2 (ip)
case M_ROL_I:
macro_build ((char *) NULL, &icnt, NULL, "sll", "d,w,<", AT, sreg,
- imm_expr.X_add_number & 0x1f);
+ (int) (imm_expr.X_add_number & 0x1f));
macro_build ((char *) NULL, &icnt, NULL, "srl", "d,w,<", dreg, sreg,
- (0 - imm_expr.X_add_number) & 0x1f);
+ (int) ((0 - imm_expr.X_add_number) & 0x1f));
macro_build ((char *) NULL, &icnt, NULL, "or", "d,v,t", dreg, dreg, AT);
break;
@@ -3833,9 +4474,9 @@ macro2 (ip)
case M_ROR_I:
macro_build ((char *) NULL, &icnt, NULL, "srl", "d,w,<", AT, sreg,
- imm_expr.X_add_number & 0x1f);
+ (int) (imm_expr.X_add_number & 0x1f));
macro_build ((char *) NULL, &icnt, NULL, "sll", "d,w,<", dreg, sreg,
- (0 - imm_expr.X_add_number) & 0x1f);
+ (int) ((0 - imm_expr.X_add_number) & 0x1f));
macro_build ((char *) NULL, &icnt, NULL, "or", "d,v,t", dreg, dreg, AT);
break;
@@ -4361,12 +5002,11 @@ macro2 (ip)
as_warn ("Macro used $at after \".set noat\"");
}
+/* This routine assembles an instruction into its binary format. As a
+ side effect, it sets one of the global variables imm_reloc or
+ offset_reloc to the type of relocation to do if one of the operands
+ is an address expression. */
-/*
-This routine assembles an instruction into its binary format. As a side
-effect it sets one of the global variables imm_reloc or offset_reloc to the
-type of relocation to do if one of the operands is an address expression.
-*/
static void
mips_ip (str, ip)
char *str;
@@ -4399,8 +5039,7 @@ mips_ip (str, ip)
}
if ((insn = (struct mips_opcode *) hash_find (op_hash, str)) == NULL)
{
- as_warn ("`%s' not in hash table.", str);
- insn_error = "ERROR: Unrecognized opcode";
+ insn_error = "unrecognized opcode";
return;
}
argsStart = s;
@@ -4435,7 +5074,8 @@ mips_ip (str, ip)
++insn;
continue;
}
- as_warn ("Instruction not supported on this processor");
+ insn_error = "opcode not supported on this processor";
+ return;
}
ip->insn_mo = insn;
@@ -4897,6 +5537,12 @@ mips_ip (str, ip)
break;
}
new_seg = subseg_new (newname, (subsegT) 0);
+ if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
+ bfd_set_section_flags (stdoutput, new_seg,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_READONLY
+ | SEC_DATA));
frag_align (*args == 'l' ? 2 : 3, 0);
if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
record_alignment (new_seg, 4);
@@ -4935,7 +5581,10 @@ mips_ip (str, ip)
imm_expr.X_add_number =
(imm_expr.X_add_number >> 16) & 0xffff;
else if (c == 'h')
- imm_reloc = BFD_RELOC_HI16_S;
+ {
+ imm_reloc = BFD_RELOC_HI16_S;
+ imm_unmatched_hi = true;
+ }
else
imm_reloc = BFD_RELOC_HI16;
}
@@ -5047,7 +5696,10 @@ mips_ip (str, ip)
imm_expr.X_add_number =
(imm_expr.X_add_number >> 16) & 0xffff;
else if (c == 'h')
- imm_reloc = BFD_RELOC_HI16_S;
+ {
+ imm_reloc = BFD_RELOC_HI16_S;
+ imm_unmatched_hi = true;
+ }
else
imm_reloc = BFD_RELOC_HI16;
}
@@ -5093,7 +5745,7 @@ mips_ip (str, ip)
s = argsStart;
continue;
}
- insn_error = "ERROR: Illegal operands";
+ insn_error = "illegal operands";
return;
}
}
@@ -5321,10 +5973,16 @@ struct option md_longopts[] = {
#define OPTION_CALL_SHARED (OPTION_MD_BASE + 7)
#define OPTION_NON_SHARED (OPTION_MD_BASE + 8)
+#define OPTION_XGOT (OPTION_MD_BASE + 19)
+#define OPTION_32 (OPTION_MD_BASE + 20)
+#define OPTION_64 (OPTION_MD_BASE + 21)
#ifdef OBJ_ELF
{"KPIC", no_argument, NULL, OPTION_CALL_SHARED},
+ {"xgot", no_argument, NULL, OPTION_XGOT},
{"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
{"non_shared", no_argument, NULL, OPTION_NON_SHARED},
+ {"32", no_argument, NULL, OPTION_32},
+ {"64", no_argument, NULL, OPTION_64},
#endif
{NULL, no_argument, NULL, 0}
@@ -5545,9 +6203,9 @@ md_parse_option (c, arg)
g_switch_value = 0x7fffffff;
break;
- /* When generating ELF code, we permit -KPIC and -call_shared to
- select SVR4_PIC, and -non_shared to select no PIC. This is
- intended to be compatible with Irix 5. */
+ /* When generating ELF code, we permit -KPIC and -call_shared to
+ select SVR4_PIC, and -non_shared to select no PIC. This is
+ intended to be compatible with Irix 5. */
case OPTION_CALL_SHARED:
if (OUTPUT_FLAVOR != bfd_target_elf_flavour)
{
@@ -5572,6 +6230,13 @@ md_parse_option (c, arg)
mips_pic = NO_PIC;
break;
+ /* The -xgot option tells the assembler to use 32 offsets when
+ accessing the got in SVR4_PIC mode. It is for Irix
+ compatibility. */
+ case OPTION_XGOT:
+ mips_big_got = 1;
+ break;
+
case 'G':
if (! USE_GLOBAL_POINTER_OPT)
{
@@ -5588,6 +6253,28 @@ md_parse_option (c, arg)
g_switch_seen = 1;
break;
+ /* The -32 and -64 options tell the assembler to output the 32
+ bit or the 64 bit MIPS ELF format. */
+ case OPTION_32:
+ mips_64 = 0;
+ break;
+
+ case OPTION_64:
+ {
+ const char **list, **l;
+
+ list = bfd_target_list ();
+ for (l = list; *l != NULL; l++)
+ if (strcmp (*l, "elf64-bigmips") == 0
+ || strcmp (*l, "elf64-littlemips") == 0)
+ break;
+ if (*l == NULL)
+ as_fatal ("No compiled in support for 64 bit object file format");
+ free (list);
+ mips_64 = 1;
+ }
+ break;
+
default:
return 0;
}
@@ -5613,6 +6300,7 @@ MIPS options:\n\
-mips3, -mcpu=r4000 generate code for r4000\n\
-mips4, -mcpu=r8000 generate code for r8000\n\
-mcpu=vr4300 generate code for vr4300\n\
+-mcpu=vr4100 generate code for vr4100\n\
-m4650 permit R4650 instructions\n\
-no-m4650 do not permit R4650 instructions\n\
-m4010 permit R4010 instructions\n\
@@ -5627,7 +6315,10 @@ MIPS options:\n\
#ifdef OBJ_ELF
fprintf(stream, "\
-KPIC, -call_shared generate SVR4 position independent code\n\
--non_shared do not generate position independent code\n");
+-non_shared do not generate position independent code\n\
+-xgot assume a 32 bit GOT\n\
+-32 create 32 bit object file (default)\n\
+-64 create 64 bit object file\n");
#endif
}
@@ -5669,21 +6360,101 @@ cons_fix_new_mips (frag, where, nbytes, exp)
expressionS *exp;
{
/* If we are assembling in 32 bit mode, turn an 8 byte reloc into a
- 4 byte reloc.
- FIXME: There is no way to select anything but 32 bit mode right
- now. */
- if (nbytes == 8)
+ 4 byte reloc. */
+ if (nbytes == 8 && ! mips_64)
{
if (byte_order == BIG_ENDIAN)
where += 4;
nbytes = 4;
}
- if (nbytes != 2 && nbytes != 4)
+ if (nbytes != 2 && nbytes != 4 && nbytes != 8)
as_bad ("Unsupported reloc size %d", nbytes);
fix_new_exp (frag_now, where, (int) nbytes, exp, 0,
- nbytes == 2 ? BFD_RELOC_16 : BFD_RELOC_32);
+ (nbytes == 2
+ ? BFD_RELOC_16
+ : (nbytes == 4 ? BFD_RELOC_32 : BFD_RELOC_64)));
+}
+
+/* Sort any unmatched HI16_S relocs so that they immediately precede
+ the corresponding LO reloc. This is called before md_apply_fix and
+ tc_gen_reloc. Unmatched HI16_S relocs can only be generated by
+ explicit use of the %hi modifier. */
+
+void
+mips_frob_file ()
+{
+ struct mips_hi_fixup *l;
+
+ for (l = mips_hi_fixup_list; l != NULL; l = l->next)
+ {
+ segment_info_type *seginfo;
+ int pass;
+
+ assert (l->fixp->fx_r_type == BFD_RELOC_HI16_S);
+
+ /* Check quickly whether the next fixup happens to be a matching
+ %lo. */
+ if (l->fixp->fx_next != NULL
+ && l->fixp->fx_next->fx_r_type == BFD_RELOC_LO16
+ && l->fixp->fx_addsy == l->fixp->fx_next->fx_addsy
+ && l->fixp->fx_offset == l->fixp->fx_next->fx_offset)
+ continue;
+
+ /* Look through the fixups for this segment for a matching %lo.
+ When we find one, move the %hi just in front of it. We do
+ this in two passes. In the first pass, we try to find a
+ unique %lo. In the second pass, we permit multiple %hi
+ relocs for a single %lo (this is a GNU extension). */
+ seginfo = seg_info (l->seg);
+ for (pass = 0; pass < 2; pass++)
+ {
+ fixS *f, *prev;
+
+ prev = NULL;
+ for (f = seginfo->fix_root; f != NULL; f = f->fx_next)
+ {
+ /* Check whether this is a %lo fixup which matches l->fixp. */
+ if (f->fx_r_type == BFD_RELOC_LO16
+ && f->fx_addsy == l->fixp->fx_addsy
+ && f->fx_offset == l->fixp->fx_offset
+ && (pass == 1
+ || prev == NULL
+ || prev->fx_r_type != BFD_RELOC_HI16_S
+ || prev->fx_addsy != f->fx_addsy
+ || prev->fx_offset != f->fx_offset))
+ {
+ fixS **pf;
+
+ /* Move l->fixp before f. */
+ for (pf = &seginfo->fix_root;
+ *pf != l->fixp;
+ pf = &(*pf)->fx_next)
+ assert (*pf != NULL);
+
+ *pf = l->fixp->fx_next;
+
+ l->fixp->fx_next = f;
+ if (prev == NULL)
+ seginfo->fix_root = l->fixp;
+ else
+ prev->fx_next = l->fixp;
+
+ break;
+ }
+
+ prev = f;
+ }
+
+ if (f != NULL)
+ break;
+
+ if (pass == 1)
+ as_warn_where (l->fixp->fx_file, l->fixp->fx_line,
+ "Unmatched %%hi reloc");
+ }
+ }
}
/* When generating embedded PIC code we need to use a special
@@ -5742,6 +6513,10 @@ md_apply_fix (fixP, valueP)
case BFD_RELOC_MIPS_CALL16:
case BFD_RELOC_MIPS_GOT16:
case BFD_RELOC_MIPS_GPREL32:
+ case BFD_RELOC_MIPS_GOT_HI16:
+ case BFD_RELOC_MIPS_GOT_LO16:
+ case BFD_RELOC_MIPS_CALL_HI16:
+ case BFD_RELOC_MIPS_CALL_LO16:
if (fixP->fx_pcrel)
as_bad_where (fixP->fx_file, fixP->fx_line,
"Invalid PC relative reloc");
@@ -6170,13 +6945,6 @@ s_cons (log_size)
}
static void
-s_mipserr (x)
- int x;
-{
- as_fatal ("Encountered `.err', aborting assembly");
-}
-
-static void
s_float_cons (type)
int type;
{
@@ -6210,12 +6978,18 @@ s_mips_globl (x)
char *name;
int c;
symbolS *symbolP;
+ flagword flag;
name = input_line_pointer;
c = get_symbol_end ();
symbolP = symbol_find_or_make (name);
*input_line_pointer = c;
SKIP_WHITESPACE ();
+
+ /* On Irix 5, every global symbol that is not explicitly labelled as
+ being a function is apparently labelled as being an object. */
+ flag = BSF_OBJECT;
+
if (! is_end_of_line[(unsigned char) *input_line_pointer])
{
char *secname;
@@ -6229,9 +7003,11 @@ s_mips_globl (x)
*input_line_pointer = c;
if (sec != NULL && (sec->flags & SEC_CODE) != 0)
- symbolP->bsym->flags |= BSF_FUNCTION;
+ flag = BSF_FUNCTION;
}
+ symbolP->bsym->flags |= flag;
+
S_SET_EXTERNAL (symbolP);
demand_empty_rest_of_line ();
}
@@ -6410,6 +7186,9 @@ s_cpload (ignore)
ex.X_op_symbol = NULL;
ex.X_add_number = 0;
+ /* In ELF, this symbol is implicitly an STT_OBJECT symbol. */
+ ex.X_add_symbol->bsym->flags |= BSF_OBJECT;
+
macro_build_lui ((char *) NULL, &icnt, &ex, GP);
macro_build ((char *) NULL, &icnt, &ex, "addiu", "t,r,j", GP, GP,
(int) BFD_RELOC_LO16);
@@ -6752,18 +7531,29 @@ tc_gen_reloc (section, fixp)
if (fixp->fx_frag->fr_opcode != NULL
&& (fixp->fx_r_type == BFD_RELOC_MIPS_GPREL
|| fixp->fx_r_type == BFD_RELOC_MIPS_GOT16
- || fixp->fx_r_type == BFD_RELOC_MIPS_CALL16))
+ || fixp->fx_r_type == BFD_RELOC_MIPS_CALL16
+ || fixp->fx_r_type == BFD_RELOC_MIPS_GOT_HI16
+ || fixp->fx_r_type == BFD_RELOC_MIPS_GOT_LO16
+ || fixp->fx_r_type == BFD_RELOC_MIPS_CALL_HI16
+ || fixp->fx_r_type == BFD_RELOC_MIPS_CALL_LO16))
{
arelent *reloc2;
/* If this is not the last reloc in this frag, then we have two
- GPREL relocs, both of which are being replaced. Let the
- second one handle all of them. */
+ GPREL relocs, or a GOT_HI16/GOT_LO16 pair, or a
+ CALL_HI16/CALL_LO16, both of which are being replaced. Let
+ the second one handle all of them. */
if (fixp->fx_next != NULL
&& fixp->fx_frag == fixp->fx_next->fx_frag)
{
- assert (fixp->fx_r_type == BFD_RELOC_MIPS_GPREL
- && fixp->fx_next->fx_r_type == BFD_RELOC_MIPS_GPREL);
+ assert ((fixp->fx_r_type == BFD_RELOC_MIPS_GPREL
+ && fixp->fx_next->fx_r_type == BFD_RELOC_MIPS_GPREL)
+ || (fixp->fx_r_type == BFD_RELOC_MIPS_GOT_HI16
+ && (fixp->fx_next->fx_r_type
+ == BFD_RELOC_MIPS_GOT_LO16))
+ || (fixp->fx_r_type == BFD_RELOC_MIPS_CALL_HI16
+ && (fixp->fx_next->fx_r_type
+ == BFD_RELOC_MIPS_CALL_LO16)));
retval[0] = NULL;
return retval;
}
@@ -6797,10 +7587,17 @@ tc_gen_reloc (section, fixp)
}
else if (mips_pic == SVR4_PIC)
{
- if (fixp->fx_r_type != BFD_RELOC_MIPS_GOT16)
+ switch (fixp->fx_r_type)
{
- assert (fixp->fx_r_type == BFD_RELOC_MIPS_CALL16);
+ default:
+ abort ();
+ case BFD_RELOC_MIPS_GOT16:
+ break;
+ case BFD_RELOC_MIPS_CALL16:
+ case BFD_RELOC_MIPS_GOT_LO16:
+ case BFD_RELOC_MIPS_CALL_LO16:
fixp->fx_r_type = BFD_RELOC_MIPS_GOT16;
+ break;
}
}
else
@@ -6896,19 +7693,38 @@ mips_local_label (name)
void
mips_elf_final_processing ()
{
- Elf32_RegInfo s;
-
- /* Write out the .reginfo section. */
- s.ri_gprmask = mips_gprmask;
- s.ri_cprmask[0] = mips_cprmask[0];
- s.ri_cprmask[1] = mips_cprmask[1];
- s.ri_cprmask[2] = mips_cprmask[2];
- s.ri_cprmask[3] = mips_cprmask[3];
- /* The gp_value field is set by the MIPS ELF backend. */
-
- bfd_mips_elf32_swap_reginfo_out (stdoutput, &s,
- ((Elf32_External_RegInfo *)
- mips_regmask_frag));
+ /* Write out the register information. */
+ if (! mips_64)
+ {
+ Elf32_RegInfo s;
+
+ s.ri_gprmask = mips_gprmask;
+ s.ri_cprmask[0] = mips_cprmask[0];
+ s.ri_cprmask[1] = mips_cprmask[1];
+ s.ri_cprmask[2] = mips_cprmask[2];
+ s.ri_cprmask[3] = mips_cprmask[3];
+ /* The gp_value field is set by the MIPS ELF backend. */
+
+ bfd_mips_elf32_swap_reginfo_out (stdoutput, &s,
+ ((Elf32_External_RegInfo *)
+ mips_regmask_frag));
+ }
+ else
+ {
+ Elf64_Internal_RegInfo s;
+
+ s.ri_gprmask = mips_gprmask;
+ s.ri_pad = 0;
+ s.ri_cprmask[0] = mips_cprmask[0];
+ s.ri_cprmask[1] = mips_cprmask[1];
+ s.ri_cprmask[2] = mips_cprmask[2];
+ s.ri_cprmask[3] = mips_cprmask[3];
+ /* The gp_value field is set by the MIPS ELF backend. */
+
+ bfd_mips_elf64_swap_reginfo_out (stdoutput, &s,
+ ((Elf64_External_RegInfo *)
+ mips_regmask_frag));
+ }
/* Set the MIPS ELF flag bits. FIXME: There should probably be some
sort of BFD interface for this. */
diff --git a/gnu/usr.bin/binutils/gas/config/tc-mips.h b/gnu/usr.bin/binutils/gas/config/tc-mips.h
index eff230ebc32..56eae323731 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-mips.h
+++ b/gnu/usr.bin/binutils/gas/config/tc-mips.h
@@ -34,6 +34,10 @@
#define MAX_RELOC_EXPANSION 3
#define LOCAL_LABELS_FB 1
+/* Maximum symbol offset that can be encoded in a BFD_RELOC_MIPS_GPREL
+ relocation: */
+#define MAX_GPREL_OFFSET (0x7FF4)
+
#define LOCAL_LABEL(name) mips_local_label (name)
extern int mips_local_label PARAMS ((const char *));
@@ -78,6 +82,9 @@ extern int mips_parse_long_option PARAMS ((const char *));
#define tc_frob_label(sym) mips_define_label (sym)
extern void mips_define_label PARAMS ((struct symbol *));
+#define tc_frob_file() mips_frob_file ()
+extern void mips_frob_file PARAMS ((void));
+
#define TC_CONS_FIX_NEW cons_fix_new_mips
extern void cons_fix_new_mips ();
diff --git a/gnu/usr.bin/binutils/gas/config/tc-ppc.c b/gnu/usr.bin/binutils/gas/config/tc-ppc.c
index 9f5b1bded09..d46fbb055d1 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-ppc.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-ppc.c
@@ -1,5 +1,5 @@
/* tc-ppc.c -- Assemble for the PowerPC or POWER (RS/6000)
- Copyright (C) 1994 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of GAS, the GNU Assembler.
@@ -41,6 +41,17 @@ extern int target_big_endian;
/* Whether or not, we've set target_big_endian. */
static int set_target_endian = 0;
+/* Whether to use user friendly register names. */
+#ifndef TARGET_REG_NAMES_P
+#ifdef TE_PE
+#define TARGET_REG_NAMES_P true
+#else
+#define TARGET_REG_NAMES_P false
+#endif
+#endif
+
+static boolean reg_names_p = TARGET_REG_NAMES_P;
+
static void ppc_set_cpu PARAMS ((void));
static unsigned long ppc_insert_operand
PARAMS ((unsigned long insn, const struct powerpc_operand *operand,
@@ -75,6 +86,7 @@ static void ppc_toc PARAMS ((int));
#ifdef OBJ_ELF
static bfd_reloc_code_real_type ppc_elf_suffix PARAMS ((char **));
static void ppc_elf_cons PARAMS ((int));
+static void ppc_elf_rdata PARAMS ((int));
static void ppc_elf_validate_fix PARAMS ((fixS *, segT));
#endif
@@ -97,7 +109,11 @@ static void ppc_pe_tocd PARAMS ((int));
targets. */
/* Characters which always start a comment. */
+#ifdef TARGET_SOLARIS_COMMENT
+const char comment_chars[] = "#!";
+#else
const char comment_chars[] = "#";
+#endif
/* Characters which start a comment at the beginning of a line. */
const char line_comment_chars[] = "#";
@@ -153,6 +169,8 @@ const pseudo_typeS md_pseudo_table[] =
{ "long", ppc_elf_cons, 4 },
{ "word", ppc_elf_cons, 2 },
{ "short", ppc_elf_cons, 2 },
+ { "rdata", ppc_elf_rdata, 0 },
+ { "rodata", ppc_elf_rdata, 0 },
#endif
#ifdef TE_PE
@@ -178,9 +196,7 @@ const pseudo_typeS md_pseudo_table[] =
};
-#ifdef TE_PE
-/* The Windows NT PowerPC assembler uses predefined names. */
-
+/* Predefined register names if -mregnames (or default for Windows NT). */
/* In general, there are lots of them, in an attempt to be compatible */
/* with a number of other Windows NT assemblers. */
@@ -437,7 +453,58 @@ reg_name_search (name)
return -1;
}
-#endif
+/*
+ * Summary of register_name().
+ *
+ * in: Input_line_pointer points to 1st char of operand.
+ *
+ * out: A expressionS.
+ * The operand may have been a register: in this case, X_op == O_register,
+ * X_add_number is set to the register number, and truth is returned.
+ * Input_line_pointer->(next non-blank) char after operand, or is in its
+ * original state.
+ */
+
+static boolean
+register_name (expressionP)
+ expressionS *expressionP;
+{
+ int reg_number;
+ char *name;
+ char *start;
+ char c;
+
+ /* Find the spelling of the operand */
+ start = name = input_line_pointer;
+ if (name[0] == '%' && isalpha (name[1]))
+ name = ++input_line_pointer;
+
+ else if (!reg_names_p || !isalpha (name[0]))
+ return false;
+
+ c = get_symbol_end ();
+ reg_number = reg_name_search (name);
+
+ /* look to see if it's in the register table */
+ if (reg_number >= 0)
+ {
+ expressionP->X_op = O_register;
+ expressionP->X_add_number = reg_number;
+
+ /* make the rest nice */
+ expressionP->X_add_symbol = NULL;
+ expressionP->X_op_symbol = NULL;
+ *input_line_pointer = c; /* put back the delimiting char */
+ return true;
+ }
+ else
+ {
+ /* reset the line as if we had not done anything */
+ *input_line_pointer = c; /* put back the delimiting char */
+ input_line_pointer = start; /* reset input_line pointer */
+ return false;
+ }
+}
/* Local variables. */
@@ -510,9 +577,6 @@ static symbolS *ppc_current_block;
cause BFD to set the section number of a symbol to N_DEBUG. */
static asection *ppc_coff_debug_section;
-/* The size of the .debug section. */
-static bfd_size_type ppc_debug_name_section_size;
-
#endif /* OBJ_XCOFF */
#ifdef TE_PE
@@ -540,7 +604,7 @@ const int md_long_jump_size = 4;
#endif
#ifdef OBJ_ELF
-CONST char *md_shortopts = "um:VQ:";
+CONST char *md_shortopts = "b:l:usm:VQ:";
#else
CONST char *md_shortopts = "um:";
#endif
@@ -561,6 +625,32 @@ md_parse_option (c, arg)
external, which is the default for gas anyhow. */
break;
+#ifdef OBJ_ELF
+ case 'l':
+ /* Solaris as takes -le (presumably for little endian). For completeness
+ sake, recognize -be also. */
+ if (strcmp (arg, "e") == 0)
+ {
+ target_big_endian = 0;
+ set_target_endian = 1;
+ }
+ else
+ return 0;
+
+ break;
+
+ case 'b':
+ if (strcmp (arg, "e") == 0)
+ {
+ target_big_endian = 1;
+ set_target_endian = 1;
+ }
+ else
+ return 0;
+
+ break;
+#endif
+
case 'm':
/* -mpwrx and -mpwr2 mean to assemble for the IBM POWER/2
(RIOS2). */
@@ -597,6 +687,12 @@ md_parse_option (c, arg)
else if (strcmp (arg, "any") == 0)
ppc_cpu = PPC_OPCODE_ANY;
+ else if (strcmp (arg, "regnames") == 0)
+ reg_names_p = true;
+
+ else if (strcmp (arg, "no-regnames") == 0)
+ reg_names_p = false;
+
#ifdef OBJ_ELF
/* -mrelocatable/-mrelocatable-lib -- warn about initializations that require relocation */
else if (strcmp (arg, "relocatable") == 0)
@@ -645,6 +741,15 @@ md_parse_option (c, arg)
should be emitted or not. FIXME: Not implemented. */
case 'Q':
break;
+
+ /* Solaris takes -s to specify that .stabs go in a .stabs section,
+ rather than .stabs.excl, which is ignored by the linker.
+ FIXME: Not implemented. */
+ case 's':
+ if (arg)
+ return 0;
+
+ break;
#endif
default:
@@ -668,7 +773,9 @@ PowerPC options:\n\
generate code for Motorola PowerPC 603/604\n\
-mppc64, -m620 generate code for Motorola PowerPC 620\n\
-mcom generate code Power/PowerPC common instructions\n\
--many generate code for any architecture (PWR/PWRX/PPC)\n");
+-many generate code for any architecture (PWR/PWRX/PPC)\n\
+-mregnames Allow symbolic names for registers\n\
+-mno-regnames Do not allow symbolic names for registers\n");
#ifdef OBJ_ELF
fprintf(stream, "\
-mrelocatable support for GCC's -mrelocatble option\n\
@@ -687,17 +794,23 @@ PowerPC options:\n\
static void
ppc_set_cpu ()
{
+ const char *default_os = TARGET_OS;
const char *default_cpu = TARGET_CPU;
if (ppc_cpu == 0)
{
- if (strcmp (default_cpu, "rs6000") == 0)
+ if (strncmp (default_os, "aix", 3) == 0
+ && default_os[3] >= '4' && default_os[3] <= '9')
+ ppc_cpu = PPC_OPCODE_COMMON;
+ else if (strncmp (default_os, "aix3", 4) == 0)
+ ppc_cpu = PPC_OPCODE_POWER;
+ else if (strcmp (default_cpu, "rs6000") == 0)
ppc_cpu = PPC_OPCODE_POWER;
else if (strcmp (default_cpu, "powerpc") == 0
|| strcmp (default_cpu, "powerpcle") == 0)
ppc_cpu = PPC_OPCODE_PPC;
else
- as_fatal ("Unknown default cpu = %s", default_cpu);
+ as_fatal ("Unknown default cpu = %s, os = %s", default_cpu, default_os);
}
}
@@ -911,12 +1024,12 @@ ppc_elf_suffix (str_p)
#define MAP(str,reloc) { str, sizeof(str)-1, reloc }
static struct map_bfd mapping[] = {
- MAP ("got", BFD_RELOC_PPC_TOC16),
MAP ("l", BFD_RELOC_LO16),
MAP ("h", BFD_RELOC_HI16),
MAP ("ha", BFD_RELOC_HI16_S),
MAP ("brtaken", BFD_RELOC_PPC_B16_BRTAKEN),
MAP ("brntaken", BFD_RELOC_PPC_B16_BRNTAKEN),
+ MAP ("got", BFD_RELOC_16_GOTOFF),
MAP ("got@l", BFD_RELOC_LO16_GOTOFF),
MAP ("got@h", BFD_RELOC_HI16_GOTOFF),
MAP ("got@ha", BFD_RELOC_HI16_S_GOTOFF),
@@ -935,6 +1048,23 @@ ppc_elf_suffix (str_p)
MAP ("sectoff@l", BFD_RELOC_LO16_BASEREL),
MAP ("sectoff@h", BFD_RELOC_HI16_BASEREL),
MAP ("sectoff@ha", BFD_RELOC_HI16_S_BASEREL),
+ MAP ("naddr", BFD_RELOC_PPC_EMB_NADDR32),
+ MAP ("naddr16", BFD_RELOC_PPC_EMB_NADDR16),
+ MAP ("naddr@l", BFD_RELOC_PPC_EMB_NADDR16_LO),
+ MAP ("naddr@h", BFD_RELOC_PPC_EMB_NADDR16_HI),
+ MAP ("naddr@ha", BFD_RELOC_PPC_EMB_NADDR16_HA),
+ MAP ("sdai16", BFD_RELOC_PPC_EMB_SDAI16),
+ MAP ("sda2rel", BFD_RELOC_PPC_EMB_SDA2REL),
+ MAP ("sda2i16", BFD_RELOC_PPC_EMB_SDA2I16),
+ MAP ("sda21", BFD_RELOC_PPC_EMB_SDA21),
+ MAP ("mrkref", BFD_RELOC_PPC_EMB_MRKREF),
+ MAP ("relsect", BFD_RELOC_PPC_EMB_RELSEC16),
+ MAP ("relsect@l", BFD_RELOC_PPC_EMB_RELST_LO),
+ MAP ("relsect@h", BFD_RELOC_PPC_EMB_RELST_HI),
+ MAP ("relsect@ha", BFD_RELOC_PPC_EMB_RELST_HA),
+ MAP ("bitfld", BFD_RELOC_PPC_EMB_BIT_FLD),
+ MAP ("relsda", BFD_RELOC_PPC_EMB_RELSDA),
+ MAP ("xgot", BFD_RELOC_PPC_TOC16),
{ (char *)0, 0, BFD_RELOC_UNUSED }
};
@@ -1009,6 +1139,21 @@ ppc_elf_cons (nbytes)
demand_empty_rest_of_line ();
}
+/* Solaris pseduo op to change to the .rodata section. */
+static void
+ppc_elf_rdata (xxx)
+ int xxx;
+{
+ char *save_line = input_line_pointer;
+ static char section[] = ".rodata\n";
+
+ /* Just pretend this is .section .rodata */
+ input_line_pointer = section;
+ obj_elf_section (xxx);
+
+ input_line_pointer = save_line;
+}
+
/* Validate any relocations emitted for -mrelocatable, possibly adding
fixups for word relocations in writable segments, so we can adjust
them at runtime. */
@@ -1021,11 +1166,21 @@ ppc_elf_validate_fix (fixp, seg)
&& !fixp->fx_done
&& !fixp->fx_pcrel
&& fixp->fx_r_type <= BFD_RELOC_UNUSED
+ && fixp->fx_r_type != BFD_RELOC_16_GOTOFF
+ && fixp->fx_r_type != BFD_RELOC_HI16_GOTOFF
+ && fixp->fx_r_type != BFD_RELOC_LO16_GOTOFF
+ && fixp->fx_r_type != BFD_RELOC_HI16_S_GOTOFF
+ && fixp->fx_r_type != BFD_RELOC_32_BASEREL
+ && fixp->fx_r_type != BFD_RELOC_LO16_BASEREL
+ && fixp->fx_r_type != BFD_RELOC_HI16_BASEREL
+ && fixp->fx_r_type != BFD_RELOC_HI16_S_BASEREL
&& strcmp (segment_name (seg), ".got2") != 0
&& strcmp (segment_name (seg), ".dtors") != 0
&& strcmp (segment_name (seg), ".ctors") != 0
&& strcmp (segment_name (seg), ".fixup") != 0
- && strcmp (segment_name (seg), ".stab") != 0)
+ && strcmp (segment_name (seg), ".stab") != 0
+ && strcmp (segment_name (seg), ".gcc_except_table") != 0
+ && strcmp (segment_name (seg), ".ex_shared") != 0)
{
if ((seg->flags & (SEC_READONLY | SEC_CODE)) != 0
|| fixp->fx_r_type != BFD_RELOC_CTOR)
@@ -1039,51 +1194,6 @@ ppc_elf_validate_fix (fixp, seg)
#endif /* OBJ_ELF */
#ifdef TE_PE
-/*
- * Summary of register_name().
- *
- * in: Input_line_pointer points to 1st char of operand.
- *
- * out: A expressionS.
- * The operand may have been a register: in this case, X_op == O_register,
- * X_add_number is set to the register number, and truth is returned.
- * Input_line_pointer->(next non-blank) char after operand, or is in its
- * original state.
- */
-
-static int
-register_name (expressionP)
- expressionS *expressionP;
-{
- int reg_number;
- char *name;
- char c;
-
- /* Find the spelling of the operand */
- name = input_line_pointer;
- c = get_symbol_end ();
- reg_number = reg_name_search (name);
-
- /* look to see if it's in the register table */
- if (reg_number >= 0)
- {
- expressionP->X_op = O_register;
- expressionP->X_add_number = reg_number;
-
- /* make the rest nice */
- expressionP->X_add_symbol = NULL;
- expressionP->X_op_symbol = NULL;
- *input_line_pointer = c; /* put back the delimiting char */
- return 1;
- }
- else
- {
- /* reset the line as if we had not done anything */
- *input_line_pointer = c; /* put back the delimiting char */
- input_line_pointer = name; /* reset input_line pointer */
- return 0;
- }
-}
/*
* Summary of parse_toc_entry().
@@ -1448,26 +1558,24 @@ md_assemble (str)
ex.X_add_symbol = NULL;
ex.X_op_symbol = NULL;
}
+
else
- {
- if (!register_name(&ex))
- {
- expression (&ex);
- }
- }
+#endif /* TE_PE */
+ if (!register_name(&ex))
+ expression (&ex);
str = input_line_pointer;
input_line_pointer = hold;
-#else
- expression (&ex);
- str = input_line_pointer;
- input_line_pointer = hold;
-#endif
if (ex.X_op == O_illegal)
as_bad ("illegal operand");
else if (ex.X_op == O_absent)
as_bad ("missing operand");
+ else if (ex.X_op == O_register)
+ {
+ insn = ppc_insert_operand (insn, operand, ex.X_add_number,
+ (char *) NULL, 0);
+ }
else if (ex.X_op == O_constant)
{
#ifdef OBJ_ELF
@@ -1498,13 +1606,6 @@ md_assemble (str)
insn = ppc_insert_operand (insn, operand, ex.X_add_number,
(char *) NULL, 0);
}
-#ifdef TE_PE
- else if (ex.X_op == O_register)
- {
- insn = ppc_insert_operand (insn, operand, ex.X_add_number,
- (char *) NULL, 0);
- }
-#endif
#ifdef OBJ_ELF
else if ((reloc = ppc_elf_suffix (&str)) != BFD_RELOC_UNUSED)
{
@@ -1611,6 +1712,8 @@ md_assemble (str)
foo+100000@ha. */
switch (fixups[i].reloc)
{
+ case BFD_RELOC_16_GOTOFF:
+ case BFD_RELOC_PPC_TOC16:
case BFD_RELOC_LO16:
case BFD_RELOC_HI16:
case BFD_RELOC_HI16_S:
@@ -1732,6 +1835,64 @@ ppc_macro (str, macro)
md_assemble (complete);
}
+#ifdef OBJ_ELF
+/* For ELF, add support for SHF_EXCLUDE and SHT_ORDERED */
+
+int
+ppc_section_letter (letter, ptr_msg)
+ int letter;
+ char **ptr_msg;
+{
+ if (letter == 'e')
+ return SHF_EXCLUDE;
+
+ *ptr_msg = "Bad .section directive: want a,w,x,e in string";
+ return 0;
+}
+
+int
+ppc_section_word (ptr_str)
+ char **ptr_str;
+{
+ if (strncmp (*ptr_str, "exclude", sizeof ("exclude")-1) == 0)
+ {
+ *ptr_str += sizeof ("exclude")-1;
+ return SHF_EXCLUDE;
+ }
+
+ return 0;
+}
+
+int
+ppc_section_type (ptr_str)
+ char **ptr_str;
+{
+ if (strncmp (*ptr_str, "ordered", sizeof ("ordered")-1) == 0)
+ {
+ *ptr_str += sizeof ("ordered")-1;
+ return SHT_ORDERED;
+ }
+
+ return 0;
+}
+
+int
+ppc_section_flags (flags, attr, type)
+ int flags;
+ int attr;
+ int type;
+{
+ if (type == SHT_ORDERED)
+ flags |= SEC_ALLOC | SEC_LOAD | SEC_SORT_ENTRIES;
+
+ if (attr & SHF_EXCLUDE)
+ flags |= SEC_EXCLUDE;
+
+ return flags;
+}
+#endif /* OBJ_ELF */
+
+
/* Pseudo-op handling. */
/* The .byte pseudo-op. This is similar to the normal .byte
@@ -1955,6 +2116,12 @@ ppc_csect (ignore)
*input_line_pointer = endc;
+ if (S_GET_NAME (sym)[0] == '\0')
+ {
+ /* An unnamed csect is assumed to be [PR]. */
+ sym->sy_tc.class = XMC_PR;
+ }
+
ppc_change_csect (sym);
if (*input_line_pointer == ',')
@@ -2243,13 +2410,6 @@ ppc_stabx (ignore)
ppc_current_csect->sy_tc.within = sym;
}
- if (strlen (name) > SYMNMLEN)
- {
- /* For some reason, each name is preceded by a two byte length
- and followed by a null byte. */
- ppc_debug_name_section_size += strlen (name) + 3;
- }
-
demand_empty_rest_of_line ();
}
@@ -2577,9 +2737,6 @@ ppc_bc (ignore)
ppc_frob_label (sym);
- if (strlen (name) > SYMNMLEN)
- ppc_debug_name_section_size += strlen (name) + 3;
-
demand_empty_rest_of_line ();
}
@@ -2808,7 +2965,7 @@ ppc_pdata(ignore)
(SEC_ALLOC | SEC_LOAD | SEC_RELOC
| SEC_READONLY | SEC_DATA ));
- bfd_set_section_alignment (stdoutput, pdata_section, 3);
+ bfd_set_section_alignment (stdoutput, pdata_section, 2);
}
else
{
@@ -2880,7 +3037,7 @@ ppc_reldata(ignore)
( SEC_ALLOC | SEC_LOAD | SEC_RELOC
| SEC_DATA ));
- bfd_set_section_alignment (stdoutput, reldata_section, 3);
+ bfd_set_section_alignment (stdoutput, reldata_section, 2);
}
else
{
@@ -3138,8 +3295,6 @@ ppc_pe_section (ignore)
segT sec;
int align;
- align = 4; /* default alignment to 16 byte boundary */
-
section_name = input_line_pointer;
c = get_symbol_end ();
@@ -3153,6 +3308,29 @@ ppc_pe_section (ignore)
exp = 0;
flags = SEC_NO_FLAGS;
+ if (strcmp (name, ".idata$2") == 0)
+ {
+ align = 0;
+ }
+ else if (strcmp (name, ".idata$3") == 0)
+ {
+ align = 0;
+ }
+ else if (strcmp (name, ".idata$4") == 0)
+ {
+ align = 2;
+ }
+ else if (strcmp (name, ".idata$5") == 0)
+ {
+ align = 2;
+ }
+ else if (strcmp (name, ".idata$6") == 0)
+ {
+ align = 1;
+ }
+ else
+ align = 4; /* default alignment to 16 byte boundary */
+
if (*input_line_pointer == ',')
{
++input_line_pointer;
@@ -3794,25 +3972,6 @@ ppc_frob_section (sec)
vma += bfd_section_size (stdoutput, sec);
}
-/* Adjust the file by adding a .debug section if needed. */
-
-void
-ppc_frob_file ()
-{
- if (ppc_debug_name_section_size > 0)
- {
- asection *sec;
-
- sec = bfd_make_section (stdoutput, ".debug");
- if (sec == (asection *) NULL
- || ! bfd_set_section_size (stdoutput, sec,
- ppc_debug_name_section_size)
- || ! bfd_set_section_flags (stdoutput, sec,
- SEC_HAS_CONTENTS | SEC_LOAD))
- as_fatal ("can't make .debug section");
- }
-}
-
#endif /* OBJ_XCOFF */
/* Turn a string in input_line_pointer into a floating point constant
@@ -4216,13 +4375,13 @@ md_apply_fix3 (fixp, valuep, seg)
case BFD_RELOC_32:
case BFD_RELOC_CTOR:
if (fixp->fx_pcrel)
- {
- fixp->fx_r_type = BFD_RELOC_32_PCREL;
- value += fixp->fx_frag->fr_address + fixp->fx_where;
- } /* fall through */
+ fixp->fx_r_type = BFD_RELOC_32_PCREL;
+ /* fall through */
case BFD_RELOC_RVA:
case BFD_RELOC_32_PCREL:
+ case BFD_RELOC_32_BASEREL:
+ case BFD_RELOC_PPC_EMB_NADDR32:
md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where,
value, 4);
break;
@@ -4230,10 +4389,29 @@ md_apply_fix3 (fixp, valuep, seg)
case BFD_RELOC_LO16:
case BFD_RELOC_HI16:
case BFD_RELOC_HI16_S:
- case BFD_RELOC_PPC_TOC16:
case BFD_RELOC_16:
case BFD_RELOC_GPREL16:
case BFD_RELOC_16_GOT_PCREL:
+ case BFD_RELOC_16_GOTOFF:
+ case BFD_RELOC_LO16_GOTOFF:
+ case BFD_RELOC_HI16_GOTOFF:
+ case BFD_RELOC_HI16_S_GOTOFF:
+ case BFD_RELOC_LO16_BASEREL:
+ case BFD_RELOC_HI16_BASEREL:
+ case BFD_RELOC_HI16_S_BASEREL:
+ case BFD_RELOC_PPC_EMB_NADDR16:
+ case BFD_RELOC_PPC_EMB_NADDR16_LO:
+ case BFD_RELOC_PPC_EMB_NADDR16_HI:
+ case BFD_RELOC_PPC_EMB_NADDR16_HA:
+ case BFD_RELOC_PPC_EMB_SDAI16:
+ case BFD_RELOC_PPC_EMB_SDA2REL:
+ case BFD_RELOC_PPC_EMB_SDA2I16:
+ case BFD_RELOC_PPC_EMB_RELSEC16:
+ case BFD_RELOC_PPC_EMB_RELST_LO:
+ case BFD_RELOC_PPC_EMB_RELST_HI:
+ case BFD_RELOC_PPC_EMB_RELST_HA:
+ case BFD_RELOC_PPC_EMB_RELSDA:
+ case BFD_RELOC_PPC_TOC16:
if (fixp->fx_pcrel)
abort ();
@@ -4241,6 +4419,17 @@ md_apply_fix3 (fixp, valuep, seg)
value, 2);
break;
+ /* Because SDA21 modifies the register field, the size is set to 4
+ bytes, rather than 2, so offset it here appropriately */
+ case BFD_RELOC_PPC_EMB_SDA21:
+ if (fixp->fx_pcrel)
+ abort ();
+
+ md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where
+ + ((target_big_endian) ? 2 : 0),
+ value, 2);
+ break;
+
case BFD_RELOC_8:
if (fixp->fx_pcrel)
abort ();
diff --git a/gnu/usr.bin/binutils/gas/config/tc-ppc.h b/gnu/usr.bin/binutils/gas/config/tc-ppc.h
index a5ab89e7c88..b8f10ed813c 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-ppc.h
+++ b/gnu/usr.bin/binutils/gas/config/tc-ppc.h
@@ -189,10 +189,6 @@ extern void ppc_adjust_symtab PARAMS ((void));
/* Niclas Andersson <nican@ida.liu.se> says this is needed. */
#define SUB_SEGMENT_ALIGN(SEG) 2
-/* Finish up the file. */
-#define tc_frob_file() ppc_frob_file ()
-extern void ppc_frob_file PARAMS ((void));
-
#endif /* OBJ_XCOFF */
#ifdef OBJ_ELF
@@ -211,6 +207,29 @@ extern void ppc_frob_file PARAMS ((void));
|| ((FIXP)->fx_addsy && !(FIXP)->fx_subsy && (FIXP)->fx_addsy->bsym \
&& (FIXP)->fx_addsy->bsym->section != SEC))
+/* Support for SHF_EXCLUDE and SHT_ORDERED */
+extern int ppc_section_letter PARAMS ((int, char **));
+extern int ppc_section_type PARAMS ((char **));
+extern int ppc_section_word PARAMS ((char **));
+extern int ppc_section_flags PARAMS ((int, int, int));
+
+#define md_elf_section_letter(LETTER, PTR_MSG) ppc_section_letter (LETTER, PTR_MSG)
+#define md_elf_section_type(PTR_STR) ppc_section_type (PTR_STR)
+#define md_elf_section_word(PTR_STR) ppc_section_word (PTR_STR)
+#define md_elf_section_flags(FLAGS, ATTR, TYPE) ppc_section_flags (FLAGS, ATTR, TYPE)
+
+/* Add extra PPC sections -- Note, for now, make .sbss2 and .PPC.EMB.sbss0 a
+ normal section, and not a bss section so that the linker doesn't crater
+ when trying to make more than 2 sections. */
+#define ELF_TC_SPECIAL_SECTIONS \
+ { ".tags", SHT_ORDERED, SHF_ALLOC }, \
+ { ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, \
+ { ".sbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, \
+ { ".sdata2", SHT_PROGBITS, SHF_ALLOC }, \
+ { ".sbss2", SHT_PROGBITS, SHF_ALLOC }, \
+ { ".PPC.EMB.sdata0", SHT_PROGBITS, SHF_ALLOC }, \
+ { ".PPC.EMB.sbss0", SHT_PROGBITS, SHF_ALLOC },
+
#endif /* OBJ_ELF */
/* call md_apply_fix3 with segment instead of md_apply_fix */
@@ -220,3 +239,4 @@ extern void ppc_frob_file PARAMS ((void));
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section(FIXP, SEC)
#define md_operand(x)
+
diff --git a/gnu/usr.bin/binutils/gas/config/tc-sh.c b/gnu/usr.bin/binutils/gas/config/tc-sh.c
index c7a164861bb..2d6653a4f80 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-sh.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-sh.c
@@ -1,6 +1,6 @@
/* tc-sh.c -- Assemble code for the Hitachi Super-H
- Copyright (C) 1993, 1994, 1995 Free Software Foundation.
+ Copyright (C) 1993, 94, 95, 1996 Free Software Foundation.
This file is part of GAS, the GNU Assembler.
@@ -192,6 +192,8 @@ md_begin ()
static int reg_m;
static int reg_n;
+static int reg_b;
+
static expressionS immediate; /* absolute expression */
typedef struct
@@ -209,18 +211,33 @@ parse_reg (src, mode, reg)
int *mode;
int *reg;
{
+ /* We use !isalnum for the next character after the register name, to
+ make sure that we won't accidentally recognize a symbol name such as
+ 'sram' as being a reference to the register 'sr'. */
+
+ if (src[0] == 'r')
+ {
+ if (src[1] >= '0' && src[1] <= '7' && strncmp(&src[2], "_bank", 5) == 0
+ && ! isalnum (src[7]))
+ {
+ *mode = A_REG_B;
+ *reg = (src[1] - '0');
+ return 7;
+ }
+ }
+
if (src[0] == 'r')
{
if (src[1] == '1')
{
- if (src[2] >= '0' && src[2] <= '5')
+ if (src[2] >= '0' && src[2] <= '5' && ! isalnum (src[3]))
{
*mode = A_REG_N;
*reg = 10 + src[2] - '0';
return 3;
}
}
- if (src[1] >= '0' && src[1] <= '9')
+ if (src[1] >= '0' && src[1] <= '9' && ! isalnum (src[2]))
{
*mode = A_REG_N;
*reg = (src[1] - '0');
@@ -228,41 +245,53 @@ parse_reg (src, mode, reg)
}
}
- if (src[0] == 's' && src[1] == 'r')
+ if (src[0] == 's' && src[1] == 's' && src[2] == 'r' && ! isalnum (src[3]))
+ {
+ *mode = A_SSR;
+ return 3;
+ }
+
+ if (src[0] == 's' && src[1] == 'p' && src[2] == 'c' && ! isalnum (src[3]))
+ {
+ *mode = A_SPC;
+ return 3;
+ }
+
+ if (src[0] == 's' && src[1] == 'r' && ! isalnum (src[2]))
{
*mode = A_SR;
return 2;
}
- if (src[0] == 's' && src[1] == 'p')
+ if (src[0] == 's' && src[1] == 'p' && ! isalnum (src[2]))
{
*mode = A_REG_N;
*reg = 15;
return 2;
}
- if (src[0] == 'p' && src[1] == 'r')
+ if (src[0] == 'p' && src[1] == 'r' && ! isalnum (src[2]))
{
*mode = A_PR;
return 2;
}
- if (src[0] == 'p' && src[1] == 'c')
+ if (src[0] == 'p' && src[1] == 'c' && ! isalnum (src[2]))
{
*mode = A_DISP_PC;
return 2;
}
- if (src[0] == 'g' && src[1] == 'b' && src[2] == 'r')
+ if (src[0] == 'g' && src[1] == 'b' && src[2] == 'r' && ! isalnum (src[3]))
{
*mode = A_GBR;
return 3;
}
- if (src[0] == 'v' && src[1] == 'b' && src[2] == 'r')
+ if (src[0] == 'v' && src[1] == 'b' && src[2] == 'r' && ! isalnum (src[3]))
{
*mode = A_VBR;
return 3;
}
- if (src[0] == 'm' && src[1] == 'a' && src[2] == 'c')
+ if (src[0] == 'm' && src[1] == 'a' && src[2] == 'c' && ! isalnum (src[4]))
{
if (src[3] == 'l')
{
@@ -275,6 +304,37 @@ parse_reg (src, mode, reg)
return 4;
}
}
+ if (src[0] == 'f' && src[1] == 'r')
+ {
+ if (src[2] == '1')
+ {
+ if (src[3] >= '0' && src[3] <= '5' && ! isalnum (src[4]))
+ {
+ *mode = F_REG_N;
+ *reg = 10 + src[3] - '0';
+ return 4;
+ }
+ }
+ if (src[2] >= '0' && src[2] <= '9' && ! isalnum (src[3]))
+ {
+ *mode = F_REG_N;
+ *reg = (src[2] - '0');
+ return 3;
+ }
+ }
+ if (src[0] == 'f' && src[1] == 'p' && src[2] == 'u' && src[3] == 'l'
+ && ! isalnum (src[4]))
+ {
+ *mode = FPUL_N;
+ return 4;
+ }
+
+ if (src[0] == 'f' && src[1] == 'p' && src[2] == 's' && src[3] == 'c'
+ && src[4] == 'r' && ! isalnum (src[5]))
+ {
+ *mode = FPSCR_N;
+ return 5;
+ }
return 0;
}
@@ -506,16 +566,30 @@ get_operands (info, args, operand)
ptr++;
}
get_operand (&ptr, operand + 1);
+ if (info->arg[2])
+ {
+ if (*ptr == ',')
+ {
+ ptr++;
+ }
+ get_operand (&ptr, operand + 2);
+ }
+ else
+ {
+ operand[2].type = 0;
+ }
}
else
{
operand[1].type = 0;
+ operand[2].type = 0;
}
}
else
{
operand[0].type = 0;
operand[1].type = 0;
+ operand[2].type = 0;
}
return ptr;
}
@@ -574,6 +648,10 @@ get_specific (opcode, operands)
if (user->type != A_R0_GBR || user->reg != 0)
goto fail;
break;
+ case F_FR0:
+ if (user->type != F_REG_N || user->reg != 0)
+ goto fail;
+ break;
case A_REG_N:
case A_INC_N:
@@ -581,6 +659,9 @@ get_specific (opcode, operands)
case A_IND_N:
case A_IND_R0_REG_N:
case A_DISP_REG_N:
+ case F_REG_N:
+ case FPUL_N:
+ case FPSCR_N:
/* Opcode needs rn */
if (user->type != arg)
goto fail;
@@ -589,8 +670,16 @@ get_specific (opcode, operands)
case A_GBR:
case A_SR:
case A_VBR:
+ case A_SSR:
+ case A_SPC:
+ if (user->type != arg)
+ goto fail;
+ break;
+
+ case A_REG_B:
if (user->type != arg)
goto fail;
+ reg_b = user->reg;
break;
case A_REG_M:
@@ -605,6 +694,14 @@ get_specific (opcode, operands)
reg_m = user->reg;
break;
+ case F_REG_M:
+ case FPUL_M:
+ case FPSCR_M:
+ /* Opcode needs rn */
+ if (user->type != arg - F_REG_M + F_REG_N)
+ goto fail;
+ reg_m = user->reg;
+ break;
default:
printf ("unhandled %d\n", arg);
@@ -714,6 +811,9 @@ build_Mytes (opcode, operand)
case REG_M:
nbuf[index] = reg_m;
break;
+ case REG_B:
+ nbuf[index] = reg_b | 0x08;
+ break;
case DISP_4:
insert (output + low_byte, R_SH_IMM4, 0);
break;
@@ -800,6 +900,15 @@ md_assemble (str)
return;
}
+ if (sh_relax
+ && ! seg_info (now_seg)->tc_segment_info_data.in_code)
+ {
+ /* Output a CODE reloc to tell the linker that the following
+ bytes are instructions, not data. */
+ fix_new (frag_now, frag_now_fix (), 2, &abs_symbol, 0, 0, R_SH_CODE);
+ seg_info (now_seg)->tc_segment_info_data.in_code = 1;
+ }
+
if (opcode->arg[0] == A_BDISP12
|| opcode->arg[0] == A_BDISP8)
{
@@ -830,6 +939,45 @@ md_assemble (str)
}
+/* This routine is called each time a label definition is seen. It
+ emits a R_SH_LABEL reloc if necessary. */
+
+void
+sh_frob_label ()
+{
+ static fragS *last_label_frag;
+ static int last_label_offset;
+
+ if (sh_relax
+ && seg_info (now_seg)->tc_segment_info_data.in_code)
+ {
+ int offset;
+
+ offset = frag_now_fix ();
+ if (frag_now != last_label_frag
+ || offset != last_label_offset)
+ {
+ fix_new (frag_now, offset, 2, &abs_symbol, 0, 0, R_SH_LABEL);
+ last_label_frag = frag_now;
+ last_label_offset = offset;
+ }
+ }
+}
+
+/* This routine is called when the assembler is about to output some
+ data. It emits a R_SH_DATA reloc if necessary. */
+
+void
+sh_flush_pending_output ()
+{
+ if (sh_relax
+ && seg_info (now_seg)->tc_segment_info_data.in_code)
+ {
+ fix_new (frag_now, frag_now_fix (), 2, &abs_symbol, 0, 0, R_SH_DATA);
+ seg_info (now_seg)->tc_segment_info_data.in_code = 0;
+ }
+}
+
void
DEFUN (tc_crawl_symbol_chain, (headers),
object_headers * headers)
@@ -1039,7 +1187,6 @@ sh_coff_frob_file ()
{
symbolS *sym;
bfd_vma val;
- bfd_vma paddr;
fixS *fscan;
int iscan;
int count;
@@ -1064,11 +1211,14 @@ sh_coff_frob_file ()
/* Look through the fixups again, this time looking for one
at the same location as sym. */
val = S_GET_VALUE (sym);
- paddr = segment_info[iseg].scnhdr.s_paddr;
for (fscan = segment_info[iseg].fix_root;
fscan != NULL;
fscan = fscan->fx_next)
- if (val == paddr + fscan->fx_frag->fr_address + fscan->fx_where)
+ if (val == fscan->fx_frag->fr_address + fscan->fx_where
+ && fscan->fx_r_type != R_SH_ALIGN
+ && fscan->fx_r_type != R_SH_CODE
+ && fscan->fx_r_type != R_SH_DATA
+ && fscan->fx_r_type != R_SH_LABEL)
break;
if (fscan == NULL)
{
@@ -1102,7 +1252,6 @@ sh_coff_frob_file ()
count = 0;
for (iscan = SEG_E0; iscan < SEG_UNKNOWN; iscan++)
{
- paddr = segment_info[iscan].scnhdr.s_paddr;
for (fscan = segment_info[iscan].fix_root;
fscan != NULL;
fscan = fscan->fx_next)
@@ -1247,7 +1396,7 @@ md_convert_frag (headers, seg, fragP)
case C (COND_JUMP, COND32):
case C (COND_JUMP, UNDEF_WORD_DISP):
if (fragP->fr_symbol == NULL)
- as_bad ("at %0xlx, displacement overflows 8-bit field",
+ as_bad ("at 0x%lx, displacement overflows 8-bit field",
(unsigned long) fragP->fr_address);
else
as_bad ("at 0x%lx, displacement to %sdefined symbol %s overflows 8-bit field ",
@@ -1329,7 +1478,8 @@ sh_handle_align (frag)
if (sh_relax
&& frag->fr_type == rs_align
&& frag->fr_address + frag->fr_fix > 0
- && frag->fr_offset > 1)
+ && frag->fr_offset > 1
+ && now_seg != bss_section)
fix_new (frag, frag->fr_fix, 2, &abs_symbol, frag->fr_offset, 0,
R_SH_ALIGN);
}
@@ -1364,7 +1514,10 @@ sh_force_relocation (fix)
return (fix->fx_pcrel
|| SWITCH_TABLE (fix)
|| fix->fx_r_type == R_SH_COUNT
- || fix->fx_r_type == R_SH_ALIGN);
+ || fix->fx_r_type == R_SH_ALIGN
+ || fix->fx_r_type == R_SH_CODE
+ || fix->fx_r_type == R_SH_DATA
+ || fix->fx_r_type == R_SH_LABEL);
}
/* Apply a fixup to the object file. */
@@ -1432,28 +1585,28 @@ md_apply_fix (fixP, val)
variable val. */
val = (val + 2) / 4;
if (val & ~0xff)
- as_warn_where (fixP->fx_file, fixP->fx_line, "pcrel too far");
+ as_bad_where (fixP->fx_file, fixP->fx_line, "pcrel too far");
buf[lowbyte] = val;
break;
case R_SH_PCRELIMM8BY2:
val /= 2;
if (val & ~0xff)
- as_warn_where (fixP->fx_file, fixP->fx_line, "pcrel too far");
+ as_bad_where (fixP->fx_file, fixP->fx_line, "pcrel too far");
buf[lowbyte] = val;
break;
case R_SH_PCDISP8BY2:
val /= 2;
if (val < -0x80 || val > 0x7f)
- as_warn_where (fixP->fx_file, fixP->fx_line, "pcrel too far");
+ as_bad_where (fixP->fx_file, fixP->fx_line, "pcrel too far");
buf[lowbyte] = val;
break;
case R_SH_PCDISP:
val /= 2;
if (val < -0x800 || val >= 0x7ff)
- as_warn_where (fixP->fx_file, fixP->fx_line, "pcrel too far");
+ as_bad_where (fixP->fx_file, fixP->fx_line, "pcrel too far");
buf[lowbyte] = val & 0xff;
buf[highbyte] |= (val >> 8) & 0xf;
break;
@@ -1495,6 +1648,9 @@ md_apply_fix (fixP, val)
case R_SH_COUNT:
case R_SH_ALIGN:
+ case R_SH_CODE:
+ case R_SH_DATA:
+ case R_SH_LABEL:
/* Nothing to do here. */
break;
@@ -1594,6 +1750,38 @@ tc_coff_sizemachdep (frag)
return md_relax_table[frag->fr_subtype].rlx_length;
}
+/* When we align the .text section, insert the correct NOP pattern. */
+
+int
+sh_do_align (n, fill, len)
+ int n;
+ const char *fill;
+ int len;
+{
+ if ((fill == NULL || (*fill == 0 && len == 1))
+ && (now_seg == text_section
+#ifdef BFD_ASSEMBLER
+ || (now_seg->flags & SEC_CODE) != 0
+#endif
+ || strcmp (obj_segment_name (now_seg), ".init") == 0)
+ && n > 1)
+ {
+ static const unsigned char big_nop_pattern[] = { 0x00, 0x09 };
+ static const unsigned char little_nop_pattern[] = { 0x09, 0x00 };
+
+ /* First align to a 2 byte boundary, in case there is an odd
+ .byte. */
+ frag_align (1, 0);
+ if (target_big_endian)
+ frag_align_pattern (n, big_nop_pattern, sizeof big_nop_pattern);
+ else
+ frag_align_pattern (n, little_nop_pattern, sizeof little_nop_pattern);
+ return 1;
+ }
+
+ return 0;
+}
+
#ifdef OBJ_COFF
/* Adjust a reloc for the SH. This is similar to the generic code,
@@ -1675,6 +1863,13 @@ sh_coff_reloc_mangle (seg, fix, intr, paddr)
/* This reloc is always absolute. */
symbol_ptr = NULL;
}
+ else if (fix->fx_r_type == R_SH_CODE
+ || fix->fx_r_type == R_SH_DATA
+ || fix->fx_r_type == R_SH_LABEL)
+ {
+ /* These relocs are always absolute. */
+ symbol_ptr = NULL;
+ }
/* Turn the segment of the symbol into an offset. */
if (symbol_ptr != NULL)
diff --git a/gnu/usr.bin/binutils/gas/config/tc-sh.h b/gnu/usr.bin/binutils/gas/config/tc-sh.h
index c2170552723..5be23502fca 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-sh.h
+++ b/gnu/usr.bin/binutils/gas/config/tc-sh.h
@@ -1,6 +1,6 @@
/* This file is tc-sh.h
- Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 1996 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -72,4 +72,27 @@ extern const struct relax_type md_relax_table[];
#define tc_frob_file sh_coff_frob_file
extern void sh_coff_frob_file PARAMS (());
+/* We use a special alignment function to insert the correct nop
+ pattern. */
+extern int sh_do_align PARAMS ((int, const char *, int));
+#define md_do_align(n,fill,len,l) if (sh_do_align (n,fill,len)) goto l
+
+/* We record, for each section, whether we have most recently output a
+ CODE reloc or a DATA reloc. */
+struct sh_segment_info_type
+{
+ int in_code : 1;
+};
+#define TC_SEGMENT_INFO_TYPE struct sh_segment_info_type
+
+/* We call a routine to emit a reloc for a label, so that the linker
+ can align loads and stores without crossing a label. */
+extern void sh_frob_label PARAMS ((void));
+#define tc_frob_label(sym) sh_frob_label ()
+
+/* We call a routine to flush pending output in order to output a DATA
+ reloc when required. */
+extern void sh_flush_pending_output PARAMS ((void));
+#define md_flush_pending_output() sh_flush_pending_output ()
+
/* end of tc-sh.h */
diff --git a/gnu/usr.bin/binutils/gas/config/tc-sparc.c b/gnu/usr.bin/binutils/gas/config/tc-sparc.c
index e439a55a71b..c09676477a4 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-sparc.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-sparc.c
@@ -1,5 +1,5 @@
/* tc-sparc.c -- Assemble for the SPARC
- Copyright (C) 1989, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90-95, 1996 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -13,9 +13,10 @@
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 GAS; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public
+ License along with GAS; see the file COPYING. If not, write
+ to the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <ctype.h>
@@ -26,16 +27,32 @@
/* careful, this file includes data *declarations* */
#include "opcode/sparc.h"
-static void sparc_ip PARAMS ((char *));
+static void sparc_ip PARAMS ((char *, const struct sparc_opcode **));
-#ifdef sparcv9
-static enum sparc_architecture current_architecture = v9;
+/* Current architecture. We don't bump up unless necessary. */
+static enum sparc_opcode_arch_val current_architecture = SPARC_OPCODE_ARCH_V6;
+
+/* The maximum architecture level we can bump up to.
+ In a 32 bit environment, don't allow bumping up to v9 by default.
+ The native assembler works this way. The user is required to pass
+ an explicit argument before we'll create v9 object files. However, if
+ we don't see any v9 insns, a v9 object file is not created. */
+#ifdef SPARC_ARCH64
+static enum sparc_opcode_arch_val max_architecture = SPARC_OPCODE_ARCH_V9;
#else
-static enum sparc_architecture current_architecture = v6;
+/* ??? This should be V8, but sparclite support was added by making it the
+ default. GCC now passes -Asparclite, so maybe sometime in the future
+ we can set this to V8. */
+static enum sparc_opcode_arch_val max_architecture = SPARC_OPCODE_ARCH_SPARCLITE;
#endif
+
static int architecture_requested;
static int warn_on_bump;
+/* If warn_on_bump and the needed architecture is higher than this
+ architecture, issue a warning. */
+static enum sparc_opcode_arch_val warn_after_architecture;
+
/* Non-zero if we are generating PIC code. */
int sparc_pic_code;
@@ -62,12 +79,10 @@ const pseudo_typeS md_pseudo_table[] =
{"seg", s_seg, 0},
{"skip", s_space, 0},
{"word", cons, 4},
-#ifndef NO_V9
{"xword", cons, 8},
#ifdef OBJ_ELF
{"uaxword", cons, 8},
#endif
-#endif
#ifdef OBJ_ELF
/* these are specific to sparc/svr4 */
{"pushsection", obj_elf_section, 0},
@@ -124,6 +139,8 @@ struct sparc_it
struct sparc_it the_insn, set_insn;
+/* Return non-zero if VAL is in the range -(MAX+1) to MAX. */
+
static INLINE int
in_signed_range (val, max)
bfd_signed_vma val, max;
@@ -137,6 +154,36 @@ in_signed_range (val, max)
return 1;
}
+/* Return non-zero if VAL is in the range -(MAX/2+1) to MAX.
+ (e.g. -15 to +31). */
+
+static INLINE int
+in_bitfield_range (val, max)
+ bfd_signed_vma val, max;
+{
+ if (max <= 0)
+ abort ();
+ if (val > max)
+ return 0;
+ if (val < ~(max >> 1))
+ return 0;
+ return 1;
+}
+
+static int
+sparc_ffs (mask)
+ unsigned int mask;
+{
+ int i;
+
+ if (mask == 0)
+ return -1;
+
+ for (i = 0; (mask & 1) == 0; ++i)
+ mask >>= 1;
+ return i;
+}
+
#if 0
static void print_insn PARAMS ((struct sparc_it *insn));
#endif
@@ -152,6 +199,9 @@ static int special_case;
#define SPECIAL_CASE_SET 1
#define SPECIAL_CASE_FDIV 2
+/* The last instruction to be assembled. */
+static const struct sparc_opcode *last_insn;
+
/*
* sort of like s_lcomm
*
@@ -502,7 +552,7 @@ s_proc (ignore)
++input_line_pointer;
}
-#ifndef NO_V9
+/* sparc64 priviledged registers */
struct priv_reg_entry
{
@@ -539,10 +589,9 @@ cmp_reg_entry (p, q)
return strcmp (q->name, p->name);
}
-#endif
-
/* This function is called once, at assembler startup time. It should
set up all the tables, etc. that the MD part of the assembler will need. */
+
void
md_begin ()
{
@@ -552,7 +601,7 @@ md_begin ()
op_hash = hash_new ();
- while (i < NUMOPCODES)
+ while (i < sparc_num_opcodes)
{
const char *name = sparc_opcodes[i].name;
retval = hash_insert (op_hash, name, &sparc_opcodes[i]);
@@ -572,7 +621,7 @@ md_begin ()
}
++i;
}
- while (i < NUMOPCODES
+ while (i < sparc_num_opcodes
&& !strcmp (sparc_opcodes[i].name, name));
}
@@ -588,23 +637,95 @@ md_begin ()
for (i = 'A'; i <= 'F'; ++i)
toHex[i] = i + 10 - 'A';
-#ifndef NO_V9
qsort (priv_reg_table, sizeof (priv_reg_table) / sizeof (priv_reg_table[0]),
sizeof (priv_reg_table[0]), cmp_reg_entry);
-#endif
target_big_endian = 1;
+
+ /* If -bump, record the architecture level at which we start issuing
+ warnings. The behaviour is different depending upon whether an
+ architecture was explicitly specified. If it wasn't, we issue warnings
+ for all upwards bumps. If it was, we don't start issuing warnings until
+ we need to bump beyond the requested architecture or when we bump between
+ conflicting architectures. */
+
+ if (warn_on_bump
+ && architecture_requested)
+ {
+ /* `max_architecture' records the requested architecture.
+ Issue warnings if we go above it. */
+ warn_after_architecture = max_architecture;
+
+ /* Find the highest architecture level that doesn't conflict with
+ the requested one. */
+ for (max_architecture = SPARC_OPCODE_ARCH_MAX;
+ max_architecture > warn_after_architecture;
+ --max_architecture)
+ if (! SPARC_OPCODE_CONFLICT_P (max_architecture,
+ warn_after_architecture))
+ break;
+ }
+}
+
+/* Called after all assembly has been done. */
+
+void
+sparc_md_end ()
+{
+#ifdef SPARC_ARCH64
+ if (current_architecture == SPARC_OPCODE_ARCH_V9A)
+ bfd_set_arch_mach (stdoutput, bfd_arch_sparc, bfd_mach_sparc_v9a);
+ else
+ bfd_set_arch_mach (stdoutput, bfd_arch_sparc, bfd_mach_sparc_v9);
+#else
+ if (current_architecture == SPARC_OPCODE_ARCH_V9)
+ bfd_set_arch_mach (stdoutput, bfd_arch_sparc, bfd_mach_sparc_v8plus);
+ else if (current_architecture == SPARC_OPCODE_ARCH_V9A)
+ bfd_set_arch_mach (stdoutput, bfd_arch_sparc, bfd_mach_sparc_v8plusa);
+ else if (current_architecture == SPARC_OPCODE_ARCH_SPARCLET)
+ bfd_set_arch_mach (stdoutput, bfd_arch_sparc, bfd_mach_sparc_sparclet);
+ else
+ {
+ /* The sparclite is treated like a normal sparc. Perhaps it shouldn't
+ be but for now it is (since that's the way it's always been
+ treated). */
+ bfd_set_arch_mach (stdoutput, bfd_arch_sparc, bfd_mach_sparc);
+ }
+#endif
}
void
md_assemble (str)
char *str;
{
+ const struct sparc_opcode *insn;
char *toP;
int rsd;
know (str);
- sparc_ip (str);
+ sparc_ip (str, &insn);
+
+ /* We warn about attempts to put a floating point branch in a delay
+ slot. */
+ if (insn != NULL
+ && last_insn != NULL
+ && (insn->flags & F_FBR) != 0
+ && (last_insn->flags & F_DELAYED) != 0)
+ as_warn ("FP branch in delay slot");
+
+ /* SPARC before v9 requires a nop instruction between a floating
+ point instruction and a floating point branch. We insert one
+ automatically, with a warning. */
+ if (max_architecture < SPARC_OPCODE_ARCH_V9
+ && insn != NULL
+ && last_insn != NULL
+ && (insn->flags & F_FBR) != 0
+ && (last_insn->flags & F_FLOAT) != 0)
+ {
+ as_warn ("FP branch preceded by FP instruction; NOP inserted");
+ toP = frag_more (4);
+ md_number_to_chars (toP, (valueT) 0x01000000, 4);
+ }
/* See if "set" operand is absolute and small; skip sethi if so. */
if (special_case == SPECIAL_CASE_SET
@@ -636,6 +757,8 @@ md_assemble (str)
the_insn.reloc);
}
+ last_insn = insn;
+
switch (special_case)
{
case SPECIAL_CASE_SET:
@@ -691,7 +814,7 @@ BSR (val, amount)
}
/* Parse an argument that can be expressed as a keyword.
- (eg: #StoreStore).
+ (eg: #StoreStore or %ccfr).
The result is a boolean indicating success.
If successful, INPUT_POINTER is updated. */
@@ -705,7 +828,7 @@ parse_keyword_arg (lookup_fn, input_pointerP, valueP)
char c, *p, *q;
p = *input_pointerP;
- for (q = p + (*p == '#'); isalpha (*q) || *q == '_'; ++q)
+ for (q = p + (*p == '#' || *p == '%'); isalpha (*q) || *q == '_'; ++q)
continue;
c = *q;
*q = 0;
@@ -752,8 +875,9 @@ parse_const_expr_arg (input_pointerP, valueP)
}
static void
-sparc_ip (str)
+sparc_ip (str, pinsn)
char *str;
+ const struct sparc_opcode **pinsn;
{
char *error_message = "";
char *s;
@@ -766,6 +890,7 @@ sparc_ip (str)
int match = 0;
int comma = 0;
long immediate_max = 0;
+ int v9_arg_p;
for (s = str; islower (*s) || (*s >= '0' && *s <= '3'); ++s)
;
@@ -788,6 +913,7 @@ sparc_ip (str)
as_fatal ("Unknown opcode: `%s'", str);
}
insn = (struct sparc_opcode *) hash_find (op_hash, str);
+ *pinsn = insn;
if (insn == NULL)
{
as_bad ("Unknown opcode: `%s'", str);
@@ -804,6 +930,7 @@ sparc_ip (str)
opcode = insn->match;
memset (&the_insn, '\0', sizeof (the_insn));
the_insn.reloc = BFD_RELOC_NONE;
+ v9_arg_p = 0;
/*
* Build the opcode, checking as we go to make
@@ -813,7 +940,6 @@ sparc_ip (str)
{
switch (*args)
{
-#ifndef NO_V9
case 'K':
{
int kmask = 0;
@@ -888,7 +1014,7 @@ sparc_ip (str)
case '!':
case '?':
- /* Parse a privileged register. */
+ /* Parse a sparc64 privileged register. */
if (*s == '%')
{
struct priv_reg_entry *p = priv_reg_table;
@@ -921,7 +1047,6 @@ sparc_ip (str)
error_message = ": unrecognizable privileged register";
goto error;
}
-#endif
case 'M':
case 'm':
@@ -939,11 +1064,22 @@ sparc_ip (str)
++s;
}
- if (num < 16 || 31 < num)
+ if (current_architecture >= SPARC_OPCODE_ARCH_V9)
{
- error_message = ": asr number must be between 15 and 31";
- goto error;
- } /* out of range */
+ if (num < 16 || 31 < num)
+ {
+ error_message = ": asr number must be between 16 and 31";
+ goto error;
+ }
+ }
+ else
+ {
+ if (num < 0 || 31 < num)
+ {
+ error_message = ": asr number must be between 0 and 31";
+ goto error;
+ }
+ }
opcode |= (*args == 'M' ? RS1 (num) : RD (num));
continue;
@@ -952,12 +1088,10 @@ sparc_ip (str)
{
error_message = ": expecting %asrN";
goto error;
- } /* if %asr followed by a number. */
-
- } /* if %asr */
+ }
+ } /* if %asr */
break;
-#ifndef NO_V9
case 'I':
the_insn.reloc = BFD_RELOC_SPARC_11;
immediate_max = 0x03FF;
@@ -968,6 +1102,28 @@ sparc_ip (str)
immediate_max = 0x01FF;
goto immediate;
+ case 'X':
+ /* V8 systems don't understand BFD_RELOC_SPARC_5. */
+ if (SPARC_OPCODE_ARCH_V9_P (max_architecture))
+ the_insn.reloc = BFD_RELOC_SPARC_5;
+ else
+ the_insn.reloc = BFD_RELOC_SPARC13;
+ /* These fields are unsigned, but for upward compatibility,
+ allow negative values as well. */
+ immediate_max = 0x1f;
+ goto immediate;
+
+ case 'Y':
+ /* V8 systems don't understand BFD_RELOC_SPARC_6. */
+ if (SPARC_OPCODE_ARCH_V9_P (max_architecture))
+ the_insn.reloc = BFD_RELOC_SPARC_6;
+ else
+ the_insn.reloc = BFD_RELOC_SPARC13;
+ /* These fields are unsigned, but for upward compatibility,
+ allow negative values as well. */
+ immediate_max = 0x3f;
+ goto immediate;
+
case 'k':
the_insn.reloc = /* RELOC_WDISP2_14 */ BFD_RELOC_SPARC_WDISP16;
the_insn.pcrel = 1;
@@ -1081,7 +1237,6 @@ sparc_ip (str)
continue;
}
break;
-#endif /* NO_V9 */
case '\0': /* end of args */
if (*s == '\0')
@@ -1166,6 +1321,7 @@ sparc_ip (str)
break;
case 'r': /* next operand must be a register */
+ case 'O':
case '1':
case '2':
case 'd':
@@ -1260,7 +1416,6 @@ sparc_ip (str)
it goes in the opcode. */
switch (*args)
{
-
case '1':
opcode |= mask << 14;
continue;
@@ -1276,6 +1431,10 @@ sparc_ip (str)
case 'r':
opcode |= (mask << 25) | (mask << 14);
continue;
+
+ case 'O':
+ opcode |= (mask << 25) | (mask << 0);
+ continue;
}
}
break;
@@ -1319,23 +1478,27 @@ sparc_ip (str)
break;
} /* register must be multiple of 4 */
-#ifndef NO_V9
if (mask >= 64)
{
- error_message = ": There are only 64 f registers; [0-63]";
+ if (SPARC_OPCODE_ARCH_V9_P (max_architecture))
+ error_message = ": There are only 64 f registers; [0-63]";
+ else
+ error_message = ": There are only 32 f registers; [0-31]";
goto error;
} /* on error */
- if (mask >= 32)
- {
- mask -= 31;
- } /* wrap high bit */
-#else
- if (mask >= 32)
+ else if (mask >= 32)
{
- error_message = ": There are only 32 f registers; [0-31]";
- goto error;
- } /* on error */
-#endif
+ if (SPARC_OPCODE_ARCH_V9_P (max_architecture))
+ {
+ v9_arg_p = 1;
+ mask -= 31; /* wrap high bit */
+ }
+ else
+ {
+ error_message = ": There are only 32 f registers; [0-31]";
+ goto error;
+ }
+ }
}
else
{
@@ -1344,7 +1507,6 @@ sparc_ip (str)
switch (*args)
{
-
case 'v':
case 'V':
case 'e':
@@ -1416,13 +1578,13 @@ sparc_ip (str)
the_insn.reloc = BFD_RELOC_LO10;
s += 3;
}
-#ifndef NO_V9
else if (c == 'u'
&& s[2] == 'h'
&& s[3] == 'i')
{
the_insn.reloc = BFD_RELOC_SPARC_HH22;
s += 4;
+ v9_arg_p = 1;
}
else if (c == 'u'
&& s[2] == 'l'
@@ -1430,8 +1592,8 @@ sparc_ip (str)
{
the_insn.reloc = BFD_RELOC_SPARC_HM10;
s += 4;
+ v9_arg_p = 1;
}
-#endif /* NO_V9 */
else
break;
}
@@ -1478,7 +1640,6 @@ sparc_ip (str)
&& the_insn.exp.X_add_symbol == 0
&& the_insn.exp.X_op_symbol == 0)
{
-#ifndef NO_V9
/* Handle %uhi/%ulo by moving the upper word to the lower
one and pretending it's %hi/%lo. We also need to watch
for %hi/%lo: the top word needs to be zeroed otherwise
@@ -1493,14 +1654,14 @@ sparc_ip (str)
the_insn.reloc = BFD_RELOC_LO10;
the_insn.exp.X_add_number = BSR (the_insn.exp.X_add_number, 32);
break;
- default:
- break;
case BFD_RELOC_HI22:
case BFD_RELOC_LO10:
the_insn.exp.X_add_number &= 0xffffffff;
break;
+ default:
+ break;
}
-#endif
+
/* For pc-relative call instructions, we reject
constants to get better code. */
if (the_insn.pcrel
@@ -1617,7 +1778,6 @@ sparc_ip (str)
}
break;
-#ifndef NO_V9
case 'o':
if (strncmp (s, "%asi", 4) != 0)
break;
@@ -1635,7 +1795,6 @@ sparc_ip (str)
break;
s += 4;
continue;
-#endif /* NO_V9 */
case 't':
if (strncmp (s, "%tbr", 4) != 0)
@@ -1649,7 +1808,6 @@ sparc_ip (str)
s += 4;
continue;
-#ifndef NO_V9
case 'x':
{
char *push = input_line_pointer;
@@ -1671,7 +1829,6 @@ sparc_ip (str)
input_line_pointer = push;
continue;
}
-#endif
case 'y':
if (strncmp (s, "%y", 2) != 0)
@@ -1679,6 +1836,20 @@ sparc_ip (str)
s += 2;
continue;
+ case 'u':
+ case 'U':
+ {
+ /* Parse a sparclet cpreg. */
+ int cpreg;
+ if (! parse_keyword_arg (sparc_encode_sparclet_cpreg, &s, &cpreg))
+ {
+ error_message = ": invalid cpreg name";
+ goto error;
+ }
+ opcode |= (*args == 'U' ? RS1 (cpreg) : RD (cpreg));
+ continue;
+ }
+
default:
as_fatal ("failed sanity check.");
} /* switch on arg code */
@@ -1691,7 +1862,7 @@ sparc_ip (str)
if (match == 0)
{
/* Args don't match. */
- if (((unsigned) (&insn[1] - sparc_opcodes)) < NUMOPCODES
+ if (((unsigned) (&insn[1] - sparc_opcodes)) < sparc_num_opcodes
&& (insn->name == insn[1].name
|| !strcmp (insn->name, insn[1].name)))
{
@@ -1707,39 +1878,75 @@ sparc_ip (str)
}
else
{
- if (insn->architecture > current_architecture
- || (insn->architecture != current_architecture
- && current_architecture > v8))
+ /* We have a match. Now see if the architecture is ok. */
+ int needed_arch_mask = insn->architecture;
+
+ if (v9_arg_p)
{
- if ((!architecture_requested || warn_on_bump)
- && !ARCHITECTURES_CONFLICT_P (current_architecture,
- insn->architecture)
- && !ARCHITECTURES_CONFLICT_P (insn->architecture,
- current_architecture))
- {
- if (warn_on_bump)
- {
- as_warn ("architecture bumped from \"%s\" to \"%s\" on \"%s\"",
- architecture_pname[current_architecture],
- architecture_pname[insn->architecture],
- str);
- } /* if warning */
+ needed_arch_mask &= ~ ((1 << SPARC_OPCODE_ARCH_V9)
+ | (1 << SPARC_OPCODE_ARCH_V9A));
+ needed_arch_mask |= (1 << SPARC_OPCODE_ARCH_V9);
+ }
+
+ if (needed_arch_mask & SPARC_OPCODE_SUPPORTED (current_architecture))
+ ; /* ok */
+ /* Can we bump up the architecture? */
+ else if (needed_arch_mask & SPARC_OPCODE_SUPPORTED (max_architecture))
+ {
+ enum sparc_opcode_arch_val needed_architecture =
+ sparc_ffs (SPARC_OPCODE_SUPPORTED (max_architecture)
+ & needed_arch_mask);
- current_architecture = insn->architecture;
+ assert (needed_architecture <= SPARC_OPCODE_ARCH_MAX);
+ if (warn_on_bump
+ && needed_architecture > warn_after_architecture)
+ {
+ as_warn ("architecture bumped from \"%s\" to \"%s\" on \"%s\"",
+ sparc_opcode_archs[current_architecture].name,
+ sparc_opcode_archs[needed_architecture].name,
+ str);
+ warn_after_architecture = needed_architecture;
}
- else
+ current_architecture = needed_architecture;
+ }
+ /* Conflict. */
+ /* ??? This seems to be a bit fragile. What if the next entry in
+ the opcode table is the one we want and it is supported?
+ It is possible to arrange the table today so that this can't
+ happen but what about tomorrow? */
+ else
+ {
+ int arch,printed_one_p = 0;
+ char *p;
+ char required_archs[SPARC_OPCODE_ARCH_MAX * 16];
+
+ /* Create a list of the architectures that support the insn. */
+ needed_arch_mask &= ~ SPARC_OPCODE_SUPPORTED (max_architecture);
+ p = required_archs;
+ arch = sparc_ffs (needed_arch_mask);
+ while ((1 << arch) <= needed_arch_mask)
{
- as_bad ("Architecture mismatch on \"%s\".", str);
- as_tsktsk (" (Requires %s; current architecture is %s.)",
- architecture_pname[insn->architecture],
- architecture_pname[current_architecture]);
- return;
- } /* if bump ok else error */
- } /* if architecture higher */
- } /* if no match */
+ if ((1 << arch) & needed_arch_mask)
+ {
+ if (printed_one_p)
+ *p++ = '|';
+ strcpy (p, sparc_opcode_archs[arch].name);
+ p += strlen (p);
+ printed_one_p = 1;
+ }
+ ++arch;
+ }
+
+ as_bad ("Architecture mismatch on \"%s\".", str);
+ as_tsktsk (" (Requires %s; requested architecture is %s.)",
+ required_archs,
+ sparc_opcode_archs[max_architecture].name);
+ return;
+ }
+ } /* if no match */
break;
- } /* forever looking for a match */
+ } /* forever looking for a match */
the_insn.opcode = opcode;
}
@@ -1875,7 +2082,8 @@ md_apply_fix (fixP, value)
don't want to include the value of an externally visible symbol. */
if (fixP->fx_addsy != NULL)
{
- if ((S_IS_EXTERN (fixP->fx_addsy)
+ if ((S_IS_EXTERNAL (fixP->fx_addsy)
+ || S_IS_WEAK (fixP->fx_addsy)
|| (sparc_pic_code && ! fixP->fx_pcrel))
&& S_GET_SEGMENT (fixP->fx_addsy) != absolute_section
&& S_GET_SEGMENT (fixP->fx_addsy) != undefined_section
@@ -1930,18 +2138,19 @@ md_apply_fix (fixP, value)
break;
case BFD_RELOC_32_PCREL_S2:
- val = (val >>= 2);
+ val = val >> 2;
+ /* FIXME: This increment-by-one deserves a comment of why it's
+ being done! */
if (! sparc_pic_code
|| fixP->fx_addsy == NULL
|| (fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0)
++val;
buf[0] |= (val >> 24) & 0x3f;
- buf[1] = (val >> 16);
+ buf[1] = val >> 16;
buf[2] = val >> 8;
buf[3] = val;
break;
-#ifndef NO_V9
case BFD_RELOC_64:
{
bfd_vma valh = BSR (val, 32);
@@ -1957,61 +2166,70 @@ md_apply_fix (fixP, value)
break;
case BFD_RELOC_SPARC_11:
- if (((val > 0) && (val & ~0x7ff))
- || ((val < 0) && (~(val - 1) & ~0x7ff)))
- {
- as_bad ("relocation overflow.");
- } /* on overflow */
+ if (! in_signed_range (val, 0x7ff))
+ as_bad ("relocation overflow.");
buf[2] |= (val >> 8) & 0x7;
- buf[3] = val & 0xff;
+ buf[3] = val;
break;
case BFD_RELOC_SPARC_10:
- if (((val > 0) && (val & ~0x3ff))
- || ((val < 0) && (~(val - 1) & ~0x3ff)))
- {
- as_bad ("relocation overflow.");
- } /* on overflow */
+ if (! in_signed_range (val, 0x3ff))
+ as_bad ("relocation overflow.");
buf[2] |= (val >> 8) & 0x3;
- buf[3] = val & 0xff;
+ buf[3] = val;
+ break;
+
+ case BFD_RELOC_SPARC_6:
+ if (! in_bitfield_range (val, 0x3f))
+ as_bad ("relocation overflow.");
+
+ buf[3] |= val & 0x3f;
+ break;
+
+ case BFD_RELOC_SPARC_5:
+ if (! in_bitfield_range (val, 0x1f))
+ as_bad ("relocation overflow.");
+
+ buf[3] |= val & 0x1f;
break;
case BFD_RELOC_SPARC_WDISP16:
+ /* FIXME: simplify */
if (((val > 0) && (val & ~0x3fffc))
|| ((val < 0) && (~(val - 1) & ~0x3fffc)))
{
as_bad ("relocation overflow.");
- } /* on overflow */
+ }
- val = (val >>= 2) + 1;
+ /* FIXME: The +1 deserves a comment. */
+ val = (val >> 2) + 1;
buf[1] |= ((val >> 14) & 0x3) << 4;
buf[2] |= (val >> 8) & 0x3f;
- buf[3] = val & 0xff;
+ buf[3] = val;
break;
case BFD_RELOC_SPARC_WDISP19:
+ /* FIXME: simplify */
if (((val > 0) && (val & ~0x1ffffc))
|| ((val < 0) && (~(val - 1) & ~0x1ffffc)))
{
as_bad ("relocation overflow.");
- } /* on overflow */
+ }
- val = (val >>= 2) + 1;
+ /* FIXME: The +1 deserves a comment. */
+ val = (val >> 2) + 1;
buf[1] |= (val >> 16) & 0x7;
buf[2] = (val >> 8) & 0xff;
- buf[3] = val & 0xff;
+ buf[3] = val;
break;
case BFD_RELOC_SPARC_HH22:
val = BSR (val, 32);
/* intentional fallthrough */
-#endif /* NO_V9 */
-#ifndef NO_V9
case BFD_RELOC_SPARC_LM22:
-#endif
case BFD_RELOC_HI22:
if (!fixP->fx_addsy)
{
@@ -2033,14 +2251,12 @@ md_apply_fix (fixP, value)
} /* on overflow */
buf[1] |= (val >> 16) & 0x3f;
buf[2] = val >> 8;
- buf[3] = val & 0xff;
+ buf[3] = val;
break;
-#ifndef NO_V9
case BFD_RELOC_SPARC_HM10:
val = BSR (val, 32);
/* intentional fallthrough */
-#endif /* NO_V9 */
case BFD_RELOC_LO10:
if (!fixP->fx_addsy)
@@ -2111,6 +2327,8 @@ tc_gen_reloc (section, fixp)
case BFD_RELOC_SPARC_WDISP19:
case BFD_RELOC_SPARC_WDISP22:
case BFD_RELOC_64:
+ case BFD_RELOC_SPARC_5:
+ case BFD_RELOC_SPARC_6:
case BFD_RELOC_SPARC_10:
case BFD_RELOC_SPARC_11:
case BFD_RELOC_SPARC_HH22:
@@ -2141,7 +2359,8 @@ tc_gen_reloc (section, fixp)
{
case BFD_RELOC_32_PCREL_S2:
if (! S_IS_DEFINED (fixp->fx_addsy)
- || S_IS_EXTERNAL (fixp->fx_addsy))
+ || S_IS_EXTERNAL (fixp->fx_addsy)
+ || S_IS_WEAK (fixp->fx_addsy))
code = BFD_RELOC_SPARC_WPLT30;
break;
case BFD_RELOC_HI22:
@@ -2269,23 +2488,32 @@ print_insn (insn)
* -bump
* Warn on architecture bumps. See also -A.
*
- * -Av6, -Av7, -Av8, -Av9, -Asparclite
+ * -Av6, -Av7, -Av8, -Av9, -Av9a, -Asparclite
+ * -xarch=v8plus, -xarch=v8plusa
* Select the architecture. Instructions or features not
* supported by the selected architecture cause fatal errors.
*
* The default is to start at v6, and bump the architecture up
- * whenever an instruction is seen at a higher level.
+ * whenever an instruction is seen at a higher level. If 32 bit
+ * environments, v9 is not bumped up to, the user must pass -Av9.
+ *
+ * -xarch=v8plus{,a} is for compatibility with the Sun assembler.
*
* If -bump is specified, a warning is printing when bumping to
* higher levels.
*
* If an architecture is specified, all instructions must match
* that architecture. Any higher level instructions are flagged
- * as errors.
+ * as errors. Note that in the 32 bit environment specifying
+ * -Av9 does not automatically create a v9 object file, a v9
+ * insn must be seen.
*
- * if both an architecture and -bump are specified, the
+ * If both an architecture and -bump are specified, the
* architecture starts at the specified level, but bumps are
- * warnings.
+ * warnings. Note that we can't set `current_architecture' to
+ * the requested level in this case: in the 32 bit environment,
+ * we still must avoid creating v9 object files unless v9 insns
+ * are seen.
*
* Note:
* Bumping between incompatible architectures is always an
@@ -2306,6 +2534,8 @@ struct option md_longopts[] = {
{"bump", no_argument, NULL, OPTION_BUMP},
#define OPTION_SPARC (OPTION_MD_BASE + 1)
{"sparc", no_argument, NULL, OPTION_SPARC},
+#define OPTION_XARCH (OPTION_MD_BASE + 2)
+ {"xarch", required_argument, NULL, OPTION_XARCH},
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof(md_longopts);
@@ -2319,35 +2549,38 @@ md_parse_option (c, arg)
{
case OPTION_BUMP:
warn_on_bump = 1;
+ warn_after_architecture = SPARC_OPCODE_ARCH_V6;
break;
+ case OPTION_XARCH:
+ /* ??? We could add v8plus and v8plusa to sparc_opcode_archs.
+ But we might want v8plus to mean something different than v9
+ someday, and we'd recognize more -xarch options than Sun's
+ assembler does (which may lead to a conflict someday). */
+ if (strcmp (arg, "v8plus") == 0)
+ arg = "v9";
+ else if (strcmp (arg, "v8plusa") == 0)
+ arg = "v9a";
+ else
+ {
+ as_bad ("invalid architecture -xarch=%s", arg);
+ return 0;
+ }
+
+ /* fall through */
+
case 'A':
{
- char *p = arg;
- const char **arch;
+ enum sparc_opcode_arch_val new_arch = sparc_opcode_lookup_arch (arg);
- for (arch = architecture_pname; *arch != NULL; ++arch)
+ if (new_arch == SPARC_OPCODE_ARCH_BAD)
{
- if (strcmp (p, *arch) == 0)
- break;
- }
-
- if (*arch == NULL)
- {
- as_bad ("invalid architecture -A%s", p);
+ as_bad ("invalid architecture -A%s", arg);
return 0;
}
else
{
- enum sparc_architecture new_arch = arch - architecture_pname;
-#ifdef NO_V9
- if (new_arch == v9)
- {
- as_error ("v9 support not compiled in");
- return 0;
- }
-#endif
- current_architecture = new_arch;
+ max_architecture = new_arch;
architecture_requested = 1;
}
}
@@ -2393,22 +2626,24 @@ md_parse_option (c, arg)
return 0;
}
- return 1;
+ return 1;
}
void
md_show_usage (stream)
FILE *stream;
{
- const char **arch;
+ const struct sparc_opcode_arch *arch;
+
fprintf(stream, "SPARC options:\n");
- for (arch = architecture_pname; *arch; arch++)
+ for (arch = &sparc_opcode_archs[0]; arch->name; arch++)
{
- if (arch != architecture_pname)
+ if (arch != &sparc_opcode_archs[0])
fprintf (stream, " | ");
- fprintf (stream, "-A%s", *arch);
+ fprintf (stream, "-A%s", arch->name);
}
- fprintf (stream, "\n\
+ fprintf (stream, "\n-xarch=v8plus | -xarch=v8plusa\n");
+ fprintf (stream, "\
specify variant of SPARC architecture\n\
-bump warn when assembler switches architectures\n\
-sparc ignored\n");
diff --git a/gnu/usr.bin/binutils/gas/config/tc-z8k.c b/gnu/usr.bin/binutils/gas/config/tc-z8k.c
index 1d062cdfd44..267d4e29c47 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-z8k.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-z8k.c
@@ -1504,6 +1504,10 @@ md_apply_fix (fixP, val)
break;
#endif
+ case 0:
+ md_number_to_chars (buf, val, fixP->fx_size);
+ break;
+
default:
abort ();
diff --git a/gnu/usr.bin/binutils/gas/config/te-aux.h b/gnu/usr.bin/binutils/gas/config/te-aux.h
new file mode 100644
index 00000000000..da6fa0164cf
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/config/te-aux.h
@@ -0,0 +1,17 @@
+#define TE_AUX
+
+/* From obj-coff.h:
+ This internal_lineno crap is to stop namespace pollution from the
+ bfd internal coff headerfile. */
+#define internal_lineno bfd_internal_lineno
+#include "coff/aux-coff.h" /* override bits in coff/internal.h */
+#undef internal_lineno
+
+#define COFF_NOLOAD_PROBLEM
+#define KEEP_RELOC_INFO
+
+#include "obj-format.h"
+
+#ifndef LOCAL_LABELS_FB
+#define LOCAL_LABELS_FB 1
+#endif
diff --git a/gnu/usr.bin/binutils/gas/config/te-delt88.h b/gnu/usr.bin/binutils/gas/config/te-delt88.h
new file mode 100644
index 00000000000..adcd6b7f7b6
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/config/te-delt88.h
@@ -0,0 +1,13 @@
+/* This file is te-delta88.h. */
+
+#define TE_DELTA88 1
+
+#define COFF_NOLOAD_PROBLEM 1
+
+/* Added these, because if we don't know what we're targetting we may
+ need an assembler version of libgcc, and that will use local
+ labels. */
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+#include "obj-format.h"
diff --git a/gnu/usr.bin/binutils/gas/config/te-linux.h b/gnu/usr.bin/binutils/gas/config/te-linux.h
index a98a726f220..c235a7ab8a8 100644
--- a/gnu/usr.bin/binutils/gas/config/te-linux.h
+++ b/gnu/usr.bin/binutils/gas/config/te-linux.h
@@ -1,2 +1,4 @@
#define TE_LINUX
+#define LOCAL_LABELS_FB 1
+
#include "obj-format.h"
diff --git a/gnu/usr.bin/binutils/gas/config/te-pe.h b/gnu/usr.bin/binutils/gas/config/te-pe.h
index 8aa685384d4..1c1f0b27bc1 100644
--- a/gnu/usr.bin/binutils/gas/config/te-pe.h
+++ b/gnu/usr.bin/binutils/gas/config/te-pe.h
@@ -1,3 +1,7 @@
#define TE_PE
#define LEX_AT 1 /* can have @'s inside labels */
+
+/* The PE format supports long section names. */
+#define COFF_LONG_SECTION_NAMES
+
#include "obj-format.h"
diff --git a/gnu/usr.bin/binutils/gas/config/te-psos.h b/gnu/usr.bin/binutils/gas/config/te-psos.h
new file mode 100644
index 00000000000..2ad4153b81a
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/config/te-psos.h
@@ -0,0 +1,22 @@
+/*
+ * This file is te-psos.h for embedded systems running pSOS.
+ * Contributed by Martin Anantharaman (martin@mail.imech.uni-duisburg.de)
+ */
+
+#define TE_PSOS
+
+/* Added these, because if we don't know what we're targetting we may
+ need an assembler version of libgcc, and that will use local
+ labels. */
+
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+/* This makes GAS more versatile and blocks some ELF'isms in
+ tc-m68k.h. */
+
+#define REGISTER_PREFIX_OPTIONAL 1
+
+#include "obj-format.h"
+
+/* end of te-psos.h */
diff --git a/gnu/usr.bin/binutils/gas/config/vms-conf.h b/gnu/usr.bin/binutils/gas/config/vms-conf.h
index 3c5b743320a..c948d1a0331 100644
--- a/gnu/usr.bin/binutils/gas/config/vms-conf.h
+++ b/gnu/usr.bin/binutils/gas/config/vms-conf.h
@@ -66,7 +66,8 @@
#undef MANY_SEGMENTS
/* Needed only for sparc configuration */
-#undef sparcv9
+#undef SPARC_V9
+#undef SPARC_ARCH64
/* Define if you have the remove function. */
#define HAVE_REMOVE
diff --git a/gnu/usr.bin/binutils/gas/doc/Makefile.in b/gnu/usr.bin/binutils/gas/doc/Makefile.in
index 5bfff97960a..80e34969b97 100644
--- a/gnu/usr.bin/binutils/gas/doc/Makefile.in
+++ b/gnu/usr.bin/binutils/gas/doc/Makefile.in
@@ -157,7 +157,7 @@ as.me: $(srcdir)/as.texinfo asconfig.texi
clean mostlyclean: clean-dvi clean-info
rm -f asconfig.texi
-distclean maintainer-clean realclean:
+distclean:
rm -f Makefile config.status asconfig.texi \
as.?? as.??s as.aux as.log as.toc \
gasp.?? gasp.??s gasp.aux gasp.log gasp.toc
@@ -168,6 +168,8 @@ clean-dvi:
clean-info:
rm -f as.info* gasp.info*
+maintainer-clean realclean: clean-info distclean
+
force:
Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
diff --git a/gnu/usr.bin/binutils/gas/doc/as.1 b/gnu/usr.bin/binutils/gas/doc/as.1
index 451ce5b4c0d..1ff0d0bf18b 100644
--- a/gnu/usr.bin/binutils/gas/doc/as.1
+++ b/gnu/usr.bin/binutils/gas/doc/as.1
@@ -1,9 +1,9 @@
-.\" Copyright (c) 1991, 1992 Free Software Foundation
+.\" Copyright (c) 1991, 1992, 1996 Free Software Foundation
.\" See section COPYING for conditions for redistribution
-.TH as 1 "21 January 1992" "cygnus support" "GNU Development Tools"
+.TH as 1 "29 March 1996" "cygnus support" "GNU Development Tools"
.SH NAME
-GNU as\-\-the portable GNU assembler.
+GNU as \- the portable GNU assembler.
.SH SYNOPSIS
.na
diff --git a/gnu/usr.bin/binutils/gas/doc/as.texinfo b/gnu/usr.bin/binutils/gas/doc/as.texinfo
index d890b1150ed..e6345cd741d 100644
--- a/gnu/usr.bin/binutils/gas/doc/as.texinfo
+++ b/gnu/usr.bin/binutils/gas/doc/as.texinfo
@@ -1,5 +1,5 @@
\input texinfo @c -*-Texinfo-*-
-@c Copyright (c) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+@c Copyright (c) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
@c UPDATE!! On future updates--
@c (1) check for new machine-dep cmdline options in
@c md_parse_option definitions in config/tc-*.c
@@ -82,7 +82,7 @@ END-INFO-DIR-ENTRY
@ifinfo
This file documents the GNU Assembler "@value{AS}".
-Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -137,7 +137,7 @@ done.
@end tex
@vskip 0pt plus 1filll
-Copyright @copyright{} 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -208,7 +208,9 @@ Here is a brief summary of how to invoke @code{@value{AS}}. For details,
@c HPPA has no machine-dependent assembler options (yet).
@end ifset
@ifset SPARC
- [ -Av6 | -Av7 | -Av8 | -Av9 | -Asparclite | -bump ]
+@c The order here is important. See c-sparc.texi.
+ [ -Av6 | -Av7 | -Av8 | -Asparclite | -Av9 | -Av9a ]
+ [ -xarch=v8plus | -xarch=v8plusa ] [ -bump ]
@end ifset
@ifset Z8000
@c Z8000 has no machine-dependent assembler options
@@ -396,9 +398,13 @@ The following options are available when @code{@value{AS}} is configured
for the SPARC architecture:
@table @code
-@item -Av6 | -Av7 | -Av8 | -Av9 | -Asparclite
+@item -Av6 | -Av7 | -Av8 | -Asparclite | -Av9 | -Av9a
Explicitly select a variant of the SPARC architecture.
+@item -xarch=v8plus | -xarch=v8plusa
+For compatibility with the Solaris v9 assembler. These options are
+equivalent to -Av9 and -Av9a, respectively.
+
@item -bump
Warn when the assembler switches to another architecture.
@end table
@@ -2885,6 +2891,7 @@ Some machine configurations provide additional directives.
@end ifclear
* Ln:: @code{.ln @var{line-number}}
+* Linkonce:: @code{.linkonce [@var{type}]}
* List:: @code{.list}
* Long:: @code{.long @var{expressions}}
@ignore
@@ -2892,6 +2899,7 @@ Some machine configurations provide additional directives.
@end ignore
* Macro:: @code{.macro @var{name} @var{args}}@dots{}
+* MRI:: @code{.mri @var{val}}
* Nolist:: @code{.nolist}
* Octa:: @code{.octa @var{bignums}}
@@ -2915,6 +2923,7 @@ Some machine configurations provide additional directives.
* Size:: @code{.size}
@end ifset
+* Skip:: @code{.skip @var{size} , @var{fill}}
* Space:: @code{.space @var{size} , @var{fill}}
@ifset have-stabs
* Stab:: @code{.stabd, .stabn, .stabs}
@@ -2974,7 +2983,7 @@ the padding bytes. It (and the comma) may be omitted. If it is
omitted, the padding bytes are zero.
The way the required alignment is specified varies from system to system.
-For the a29k, hppa, m86k, m88k, w65, sparc, and Hitachi SH, and i386 using ELF
+For the a29k, hppa, m68k, m88k, w65, sparc, and Hitachi SH, and i386 using ELF
format,
the first expression is the
alignment request in bytes. For example @samp{.align 8} advances
@@ -3030,7 +3039,7 @@ trailing zero byte) into consecutive addresses.
a zero byte. The ``z'' in @samp{.asciz} stands for ``zero''.
@node Balign
-@section @code{.balign @var{abs-expr} , @var{abs-expr}}
+@section @code{.balign[wl] @var{abs-expr} , @var{abs-expr}}
@cindex padding the location counter given number of bytes
@cindex @code{balign} directive
@@ -3044,6 +3053,17 @@ The second expression (also absolute) gives the value to be stored in
the padding bytes. It (and the comma) may be omitted. If it is
omitted, the padding bytes are zero.
+@cindex @code{balignw} directive
+@cindex @code{balignl} directive
+The @code{.balignw} and @code{.balignl} directives are variants of the
+@code{.balign} directive. The @code{.balignw} directive treats the fill
+pattern as a two byte word value. The @code{.balignl} directives treats the
+fill pattern as a four byte longword value. For example, @code{.balignw
+4,0x368d} will align to a multiple of 4. If it skips two bytes, they will be
+filled in with the value 0x368d (the exact placement of the bytes depends upon
+the endianness of the processor). If it skips 1 or 3 bytes, the fill value is
+undefined.
+
@node Byte
@section @code{.byte @var{expressions}}
@@ -3347,7 +3367,7 @@ considered part of the source program being assembled if the argument
(which must be an @var{absolute expression}) is non-zero. The end of
the conditional section of code must be marked by @code{.endif}
(@pxref{Endif,,@code{.endif}}); optionally, you may include code for the
-alternative condition, flagged by @code{.else} (@pxref{Else,,@code{.else}}.
+alternative condition, flagged by @code{.else} (@pxref{Else,,@code{.else}}).
The following variants of @code{.if} are also supported:
@table @code
@@ -3365,7 +3385,7 @@ Not yet implemented.
@cindex @code{ifndef} directive
@cindex @code{ifnotdef} directive
@item .ifndef @var{symbol}
-@itemx ifnotdef @var{symbol}
+@itemx .ifnotdef @var{symbol}
Assembles the following section of code if the specified @var{symbol}
has not been defined. Both spelling variants are equivalent.
@@ -3529,6 +3549,43 @@ used by compilers to generate auxiliary symbol information for
debugging.
@end ifclear
+@node Linkonce
+@section @code{.linkonce [@var{type}]}
+@cindex COMDAT
+@cindex @code{linkonce} directive
+@cindex common sections
+Mark the current section so that the linker only includes a single copy of it.
+This may be used to include the same section in several different object files,
+but ensure that the linker will only include it once in the final output file.
+The @code{.linkonce} pseudo-op must be used for each instance of the section.
+Duplicate sections are detected based on the section name, so it should be
+unique.
+
+This directive is only supported by a few object file formats; as of this
+writing, the only object file format which supports it is the Portable
+Executable format used on Windows NT.
+
+The @var{type} argument is optional. If specified, it must be one of the
+following strings. For example:
+@smallexample
+.linkonce same_size
+@end smallexample
+Not all types may be supported on all object file formats.
+
+@table @code
+@item discard
+Silently discard duplicate sections. This is the default.
+
+@item one_only
+Warn if there are duplicate sections, but still keep only one copy.
+
+@item same_size
+Warn if any of the duplicates have different sizes.
+
+@item same_contents
+Warn if any of the duplicates do not have exactly the same contents.
+@end table
+
@node Ln
@section @code{.ln @var{line-number}}
@@ -3550,6 +3607,16 @@ output format.
@end ifset
@end ifset
+@node MRI
+@section @code{.mri @var{val}}
+
+@cindex @code{mri} directive
+@cindex MRI mode, temporarily
+If @var{val} is non-zero, this tells @code{@value{AS}} to enter MRI mode. If
+@var{val} is zero, this tells @code{@value{AS}} to exit MRI mode. This change
+affects code assembled until the next @code{.mri} directive, or until the end
+of the file. @xref{M, MRI mode, MRI mode}.
+
@node List
@section @code{.list}
@@ -3746,7 +3813,7 @@ absolute expression. If the comma and @var{fill} are omitted,
@var{fill} defaults to zero.
@node P2align
-@section @code{.p2align @var{abs-expr} , @var{abs-expr}}
+@section @code{.p2align[wl] @var{abs-expr} , @var{abs-expr}}
@cindex padding the location counter given a power of two
@cindex @code{p2align} directive
@@ -3761,6 +3828,17 @@ The second expression (also absolute) gives the value to be stored in
the padding bytes. It (and the comma) may be omitted. If it is
omitted, the padding bytes are zero.
+@cindex @code{p2alignw} directive
+@cindex @code{p2alignl} directive
+The @code{.p2alignw} and @code{.p2alignl} directives are variants of the
+@code{.p2align} directive. The @code{.p2alignw} directive treats the fill
+pattern as a two byte word value. The @code{.p2alignl} directives treats the
+fill pattern as a four byte longword value. For example, @code{.p2alignw
+2,0x368d} will align to a multiple of 4. If it skips two bytes, they will be
+filled in with the value 0x368d (the exact placement of the bytes depends upon
+the endianness of the processor). If it skips 1 or 3 bytes, the fill value is
+undefined.
+
@node Psize
@section @code{.psize @var{lines} , @var{columns}}
@@ -3952,6 +4030,16 @@ ignores it.
@end ifset
@ifclear no-space-dir
+@node Skip
+@section @code{.skip @var{size} , @var{fill}}
+
+@cindex @code{skip} directive
+@cindex filling memory
+This directive emits @var{size} bytes, each of value @var{fill}. Both
+@var{size} and @var{fill} are absolute expressions. If the comma and
+@var{fill} are omitted, @var{fill} is assumed to be zero. This is the same as
+@samp{.space}.
+
@node Space
@section @code{.space @var{size} , @var{fill}}
@@ -3959,7 +4047,8 @@ ignores it.
@cindex filling memory
This directive emits @var{size} bytes, each of value @var{fill}. Both
@var{size} and @var{fill} are absolute expressions. If the comma
-and @var{fill} are omitted, @var{fill} is assumed to be zero.
+and @var{fill} are omitted, @var{fill} is assumed to be zero. This is the same
+as @samp{.skip}.
@ifset HPPA
@quotation
diff --git a/gnu/usr.bin/binutils/gas/doc/c-i960.texi b/gnu/usr.bin/binutils/gas/doc/c-i960.texi
index 31d720c1b1d..177030ab0be 100644
--- a/gnu/usr.bin/binutils/gas/doc/c-i960.texi
+++ b/gnu/usr.bin/binutils/gas/doc/c-i960.texi
@@ -153,7 +153,7 @@ an alignment. @xref{Lcomm,,@code{.lcomm}}.
@end table
@table @code
-@cindex @code{extended} directive, i96
+@cindex @code{extended} directive, i960
@item .extended @var{flonums}
@code{.extended} expects zero or more flonums, separated by commas; for
each flonum, @samp{.extended} emits an @sc{ieee} extended-format (80-bit)
diff --git a/gnu/usr.bin/binutils/gas/doc/c-m68k.texi b/gnu/usr.bin/binutils/gas/doc/c-m68k.texi
index 3a26b5180a4..bf104496cb7 100644
--- a/gnu/usr.bin/binutils/gas/doc/c-m68k.texi
+++ b/gnu/usr.bin/binutils/gas/doc/c-m68k.texi
@@ -1,4 +1,4 @@
-@c Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+@c Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@ifset GENERIC
@@ -53,6 +53,13 @@ normally required. If this is done, it will generally be impossible to
refer to C variables and functions with the same names as register
names.
+@cindex @samp{--bitwise-or} option, M680x0
+Normally the character @samp{|} is treated as a comment character, which
+means that it can not be used in expressions. The @samp{--bitwise-or}
+option turns @samp{|} into a normal character. In this mode, you must
+either use C style comments, or start comments with a @samp{#} character
+at the beginning of a line.
+
@cindex @samp{-m68000} and related options
@cindex architecture options, M680x0
@cindex M680x0 architecture options
@@ -280,13 +287,13 @@ The floating point formats generated by directives are these.
@cindex @code{double} directive, M680x0
@item .double
@code{Double} precision floating point constants.
-@end table
-There is no directive to produce regions of memory holding
-extended precision numbers, however they can be used as
-immediate operands to floating-point instructions. Adding a
-directive to create extended precision numbers would not be
-hard, but it has not yet seemed necessary.
+@cindex @code{extend} directive M680x0
+@cindex @code{ldouble} directive M680x0
+@item .extend
+@itemx .ldouble
+@code{Extended} precision (@code{long double}) floating point constants.
+@end table
@node M68K-Directives
@section 680x0 Machine Directives
@@ -446,7 +453,8 @@ when it encounters @samp{fj@var{XX} foo}.
@cindex line comment character, M680x0
@cindex comments, M680x0
The immediate character is @samp{#} for Sun compatibility. The
-line-comment character is @samp{|}. If a @samp{#} appears at the
-beginning of a line, it is treated as a comment unless it looks like
-@samp{# line file}, in which case it is treated normally.
+line-comment character is @samp{|} (unless the @samp{--bitwise-or}
+option is used). If a @samp{#} appears at the beginning of a line, it
+is treated as a comment unless it looks like @samp{# line file}, in
+which case it is treated normally.
diff --git a/gnu/usr.bin/binutils/gas/doc/c-sparc.texi b/gnu/usr.bin/binutils/gas/doc/c-sparc.texi
index ae979a9fac4..8e707e4befa 100644
--- a/gnu/usr.bin/binutils/gas/doc/c-sparc.texi
+++ b/gnu/usr.bin/binutils/gas/doc/c-sparc.texi
@@ -25,30 +25,53 @@
@cindex SPARC options
@cindex architectures, SPARC
@cindex SPARC architectures
-The SPARC chip family includes several successive levels (or other
-variants) of chip, using the same core instruction set, but including
-a few additional instructions at each level.
+The SPARC chip family includes several successive levels, using the same
+core instruction set, but including a few additional instructions at
+each level. There are exceptions to this however. For details on what
+instructions each variant supports, please see the chip's architecture
+reference manual.
By default, @code{@value{AS}} assumes the core instruction set (SPARC
v6), but ``bumps'' the architecture level as needed: it switches to
successively higher architectures as it encounters instructions that
only exist in the higher levels.
+If not configured for SPARC v9 (@code{sparc64-*-*}) GAS will not bump
+passed sparclite by default, an option must be passed to enable the
+v9 instructions.
+
+GAS treats sparclite as being compatible with v8, unless an architecture
+is explicitly requested. SPARC v9 is always incompatible with sparclite.
+
+@c The order here is the same as the order of enum sparc_opcode_arch_val
+@c to give the user a sense of the order of the "bumping".
+
@table @code
@kindex -Av6
@kindex Av7
@kindex -Av8
-@kindex -Av9
+@kindex -Asparclet
@kindex -Asparclite
-@item -Av6 | -Av7 | -Av8 | -Av9 | -Asparclite
+@kindex -Av9
+@kindex -Av9a
+@item -Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite | -Av9 | -Av9a
Use one of the @samp{-A} options to select one of the SPARC
architectures explicitly. If you select an architecture explicitly,
@code{@value{AS}} reports a fatal error if it encounters an instruction
or feature requiring a higher level.
+@c Leave this commented out until all UltraSPARC insns are supported.
+@c @samp{-Av9a} enables the SPARC v9 instruction set with UltraSPARC extensions.
+
+@item -xarch=v8plus | -xarch=v8plusa
+For compatibility with the Solaris v9 assembler. These options are
+equivalent to -Av9 and -Av9a, respectively.
+
@item -bump
-Permit the assembler to ``bump'' the architecture level as required, but
-warn whenever it is necessary to switch to another level.
+Warn whenever it is necessary to switch to another level.
+If an architecture level is explicitly requested, GAS will not issue
+warnings until that level is reached, and will then bump the level
+as required (except between incompatible levels).
@end table
@ignore
diff --git a/gnu/usr.bin/binutils/gas/doc/internals.texi b/gnu/usr.bin/binutils/gas/doc/internals.texi
index fa43fb4ec8a..030bebed2ec 100644
--- a/gnu/usr.bin/binutils/gas/doc/internals.texi
+++ b/gnu/usr.bin/binutils/gas/doc/internals.texi
@@ -745,6 +745,46 @@ examined to make this determination.
@end deftypefun
+@node Hash tables
+@section Hash tables
+@cindex hash tables
+
+@deftypefun {struct hash_control *} hash_new (void)
+
+Creates the hash table control structure.
+
+@end deftypefun
+
+@deftypefun void hash_die (struct hash_control *)
+
+@end deftypefun
+
+@deftypefun PTR hash_delete (struct hash_control *, const char *)
+
+Deletes entry from the hash table, returns the value it had.
+
+@end deftypefun
+
+@deftypefun PTR hash_replace (struct hash_control *, const char *, PTR)
+
+Updates the value for an entry already in the table, returning the old value.
+If no entry was found, just returns NULL.
+
+@end deftypefun
+
+@deftypefun {const char *} hash_insert (struct hash_control *, const char *, PTR)
+
+Inserting a value already in the table is an error.
+Returns an error message or NULL.
+
+@end deftypefun
+
+@deftypefun {const char *} hash_jam (struct hash_control *, const char *, PTR)
+
+Inserts if the value isn't already present, updates it if it is.
+
+@end deftypefun
+
@node Writing a new target
@section Writing a new target
diff --git a/gnu/usr.bin/binutils/gas/ecoff.c b/gnu/usr.bin/binutils/gas/ecoff.c
index bad9f91fd72..cc72397cbbc 100644
--- a/gnu/usr.bin/binutils/gas/ecoff.c
+++ b/gnu/usr.bin/binutils/gas/ecoff.c
@@ -1,5 +1,5 @@
/* ECOFF debugging support.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file was put together by Ian Lance Taylor <ian@cygnus.com>. A
good deal of it comes directly from mips-tfile.c, by Michael
@@ -18,8 +18,9 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with GAS; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
#include "as.h"
@@ -832,6 +833,7 @@ typedef struct scope {
typedef struct localsym {
const char *name; /* symbol name */
symbolS *as_sym; /* symbol as seen by gas */
+ bfd_vma addend; /* addend to as_sym value */
struct efdr *file_ptr; /* file pointer */
struct ecoff_proc *proc_ptr; /* proc pointer */
struct localsym *begin_ptr; /* symbol at start of block */
@@ -1425,7 +1427,7 @@ static symint_t add_string PARAMS ((varray_t *vp,
shash_t **ret_hash));
static localsym_t *add_ecoff_symbol PARAMS ((const char *str, st_t type,
sc_t storage, symbolS *sym,
- symint_t value,
+ bfd_vma addend, symint_t value,
symint_t indx));
static symint_t add_aux_sym_symint PARAMS ((symint_t aux_word));
static symint_t add_aux_sym_rndx PARAMS ((int file_index,
@@ -1600,11 +1602,12 @@ add_string (vp, hash_tbl, str, ret_hash)
/* Add debugging information for a symbol. */
static localsym_t *
-add_ecoff_symbol (str, type, storage, sym_value, value, indx)
+add_ecoff_symbol (str, type, storage, sym_value, addend, value, indx)
const char *str; /* symbol name */
st_t type; /* symbol type */
sc_t storage; /* storage class */
symbolS *sym_value; /* associated symbol. */
+ bfd_vma addend; /* addend to sym_value. */
symint_t value; /* value of symbol */
symint_t indx; /* index to local/aux. syms */
{
@@ -1634,6 +1637,7 @@ add_ecoff_symbol (str, type, storage, sym_value, value, indx)
psym->as_sym = sym_value;
if (sym_value != (symbolS *) NULL)
sym_value->ecoff_symbol = psym;
+ psym->addend = addend;
psym->file_ptr = cur_file_ptr;
psym->proc_ptr = cur_proc_ptr;
psym->begin_ptr = (localsym_t *) NULL;
@@ -2104,6 +2108,7 @@ add_unknown_tag (ptag)
st_Block,
sc_Info,
(symbolS *) NULL,
+ (bfd_vma) 0,
(symint_t) 0,
(symint_t) 0);
@@ -2111,6 +2116,7 @@ add_unknown_tag (ptag)
st_End,
sc_Info,
(symbolS *) NULL,
+ (bfd_vma) 0,
(symint_t) 0,
(symint_t) 0);
@@ -2128,6 +2134,7 @@ add_procedure (func)
{
register varray_t *vp;
register proc_t *new_proc_ptr;
+ symbolS *sym;
#ifdef ECOFF_DEBUG
if (debug)
@@ -2154,10 +2161,14 @@ add_procedure (func)
new_proc_ptr->pdr.lnLow = -1;
new_proc_ptr->pdr.lnHigh = -1;
+ /* Set the BSF_FUNCTION flag for the symbol. */
+ sym = symbol_find_or_make (func);
+ sym->bsym->flags |= BSF_FUNCTION;
+
/* Push the start of the function. */
new_proc_ptr->sym = add_ecoff_symbol ((const char *) NULL, st_Proc, sc_Text,
- symbol_find_or_make (func),
- (symint_t) 0, (symint_t) 0);
+ sym, (bfd_vma) 0, (symint_t) 0,
+ (symint_t) 0);
++proc_cnt;
@@ -2225,7 +2236,7 @@ add_file (file_name, indx, fake)
symbol_new ("L0\001", now_seg,
(valueT) frag_now_fix (),
frag_now),
- 0, ECOFF_MARK_STAB (N_SOL));
+ (bfd_vma) 0, 0, ECOFF_MARK_STAB (N_SOL));
return;
}
@@ -2292,7 +2303,7 @@ add_file (file_name, indx, fake)
/* Push the start of the filename. We assume that the filename
will be stored at string offset 1. */
(void) add_ecoff_symbol (file_name, st_File, sc_Text,
- (symbolS *) NULL,
+ (symbolS *) NULL, (bfd_vma) 0,
(symint_t) 0, (symint_t) 0);
fil_ptr->fdr.rss = 1;
fil_ptr->name = &fil_ptr->strings.last->datum->byte[1];
@@ -2321,9 +2332,9 @@ add_file (file_name, indx, fake)
symbol_new ("L0\001", now_seg,
(valueT) frag_now_fix (),
frag_now),
- 0, ECOFF_MARK_STAB (N_SO));
+ (bfd_vma) 0, 0, ECOFF_MARK_STAB (N_SO));
(void) add_ecoff_symbol ("void:t1=1", st_Nil, sc_Nil,
- (symbolS *) NULL, 0,
+ (symbolS *) NULL, (bfd_vma) 0, 0,
ECOFF_MARK_STAB (N_LSYM));
}
#endif
@@ -2438,7 +2449,7 @@ ecoff_directive_begin (ignore)
(void) add_ecoff_symbol ((const char *) NULL, st_Block, sc_Text,
symbol_find_or_make (name),
- (symint_t) 0, (symint_t) 0);
+ (bfd_vma) 0, (symint_t) 0, (symint_t) 0);
*input_line_pointer = name_end;
@@ -2483,7 +2494,7 @@ ecoff_directive_bend (ignore)
as_warn (".bend directive names unknown symbol");
else
(void) add_ecoff_symbol ((const char *) NULL, st_End, sc_Text, endsym,
- (symint_t) 0, (symint_t) 0);
+ (bfd_vma) 0, (symint_t) 0, (symint_t) 0);
*input_line_pointer = name_end;
@@ -2503,7 +2514,8 @@ static st_t coff_symbol_typ;
static int coff_is_function;
static char *coff_tag;
static valueT coff_value;
-symbolS *coff_sym_value;
+static symbolS *coff_sym_value;
+static bfd_vma coff_sym_addend;
static int coff_inside_enumeration;
/* Handle a .def directive: start defining a symbol. */
@@ -2541,6 +2553,7 @@ ecoff_directive_def (ignore)
coff_tag = (char *) NULL;
coff_value = 0;
coff_sym_value = (symbolS *) NULL;
+ coff_sym_addend = 0;
}
*input_line_pointer = name_end;
@@ -2779,6 +2792,8 @@ void
ecoff_directive_val (ignore)
int ignore;
{
+ expressionS exp;
+
if (coff_sym_name == (char *) NULL)
{
as_warn (".val pseudo-op used outside of .def/.endef; ignored");
@@ -2786,26 +2801,20 @@ ecoff_directive_val (ignore)
return;
}
- if (! is_name_beginner ((unsigned char) *input_line_pointer))
- coff_value = get_absolute_expression ();
- else
+ expression (&exp);
+ if (exp.X_op != O_constant && exp.X_op != O_symbol)
{
- char *name;
- char name_end;
-
- name = input_line_pointer;
- name_end = get_symbol_end ();
-
- if (strcmp (name, ".") == 0)
- as_warn ("`.val .' not supported");
- else
- coff_sym_value = symbol_find_or_make (name);
-
- *input_line_pointer = name_end;
+ as_bad (".val expression is too copmlex");
+ demand_empty_rest_of_line ();
+ return;
+ }
- /* FIXME: gcc can generate address expressions here in unusual
- cases (search for "obscure" in sdbout.c), although this is
- very unlikely for a MIPS chip. */
+ if (exp.X_op == O_constant)
+ coff_value = exp.X_add_number;
+ else
+ {
+ coff_sym_value = exp.X_add_symbol;
+ coff_sym_addend = exp.X_add_number;
}
demand_empty_rest_of_line ();
@@ -2967,6 +2976,7 @@ ecoff_directive_endef (ignore)
coff_symbol_typ,
coff_storage_class,
coff_sym_value,
+ coff_sym_addend,
(symint_t) coff_value,
indx);
@@ -3036,10 +3046,10 @@ ecoff_directive_end (ignore)
else
{
(void) add_ecoff_symbol ((const char *) NULL, st_End, sc_Text,
- symbol_new ("L0\001", now_seg,
- (valueT) frag_now_fix (),
- frag_now),
- (symint_t) 0, (symint_t) 0);
+ symbol_new ("L0\001", now_seg,
+ (valueT) frag_now_fix (),
+ frag_now),
+ (bfd_vma) 0, (symint_t) 0, (symint_t) 0);
if (stabs_seen && generate_asm_lineno)
{
@@ -3049,7 +3059,8 @@ ecoff_directive_end (ignore)
strcpy (n, name);
strcat (n, ":F1");
(void) add_ecoff_symbol ((const char *) n, stGlobal, scText,
- ent, 0, ECOFF_MARK_STAB (N_FUN));
+ ent, (bfd_vma) 0, 0,
+ ECOFF_MARK_STAB (N_FUN));
}
}
@@ -3304,7 +3315,7 @@ ecoff_directive_loc (ignore)
symbol_new ("L0\001", now_seg,
(valueT) frag_now_fix (),
frag_now),
- 0, lineno);
+ (bfd_vma) 0, 0, lineno);
return;
}
@@ -3348,7 +3359,8 @@ mark_stabs (ignore)
stabs_seen = 1;
(void) add_ecoff_symbol (stabs_symbol, stNil, scInfo,
(symbolS *) NULL,
- (symint_t) -1, ECOFF_MARK_STAB (0));
+ (bfd_vma) 0, (symint_t) -1,
+ ECOFF_MARK_STAB (0));
}
}
@@ -3370,7 +3382,7 @@ ecoff_directive_weakext (ignore)
SKIP_WHITESPACE ();
- if (c == ',')
+ if (*input_line_pointer == ',')
{
if (S_IS_DEFINED (symbolP))
{
@@ -3444,6 +3456,7 @@ ecoff_stab (sec, what, string, type, other, desc)
efdr_t *save_file_ptr = cur_file_ptr;
symbolS *sym;
symint_t value;
+ bfd_vma addend;
st_t st;
sc_t sc;
symint_t indx;
@@ -3510,6 +3523,7 @@ ecoff_stab (sec, what, string, type, other, desc)
*input_line_pointer = name_end;
value = 0;
+ addend = 0;
st = st_Label;
sc = sc_Text;
indx = desc;
@@ -3529,6 +3543,7 @@ ecoff_stab (sec, what, string, type, other, desc)
sc = sc_Nil;
sym = (symbolS *) NULL;
value = get_absolute_expression ();
+ addend = 0;
}
else if (! is_name_beginner ((unsigned char) *input_line_pointer))
{
@@ -3539,23 +3554,30 @@ ecoff_stab (sec, what, string, type, other, desc)
{
char *name;
char name_end;
-
- name = input_line_pointer;
- name_end = get_symbol_end ();
-
- sym = symbol_find_or_make (name);
+ expressionS exp;
sc = sc_Nil;
st = st_Nil;
- value = 0;
- *input_line_pointer = name_end;
- if (name_end == '+' || name_end == '-')
+ expression (&exp);
+ if (exp.X_op == O_constant)
+ {
+ sym = NULL;
+ value = exp.X_add_number;
+ addend = 0;
+ }
+ else if (exp.X_op == O_symbol)
+ {
+ sym = exp.X_add_symbol;
+ value = 0;
+ addend = exp.X_add_number;
+ }
+ else
{
- ++input_line_pointer;
- value = get_absolute_expression ();
- if (name_end == '-')
- value = - value;
+ as_bad (".stabs expression too complex");
+ sym = NULL;
+ value = 0;
+ addend = 0;
}
}
@@ -3568,7 +3590,7 @@ ecoff_stab (sec, what, string, type, other, desc)
if (sym != (symbolS *) NULL)
hold = sym->ecoff_symbol;
- (void) add_ecoff_symbol (string, st, sc, sym, value, indx);
+ (void) add_ecoff_symbol (string, st, sc, sym, addend, value, indx);
if (sym != (symbolS *) NULL)
sym->ecoff_symbol = hold;
@@ -3738,16 +3760,17 @@ ecoff_build_lineno (backend, buf, bufend, offset, linecntptr)
before it is used. */
count = 1;
}
- else
+ else if (l->next->frag->fr_address + l->next->paddr
+ > l->frag->fr_address + l->paddr)
{
count = ((l->next->frag->fr_address + l->next->paddr
- (l->frag->fr_address + l->paddr))
>> 2);
- if (count <= 0)
- {
- /* Don't change last, so we still get the right delta. */
- continue;
- }
+ }
+ else
+ {
+ /* Don't change last, so we still get the right delta. */
+ continue;
}
if (l->file != file || l->proc != proc)
@@ -3992,7 +4015,8 @@ ecoff_build_symbols (backend, buf, bufend, offset)
sym_ptr->ecoff_sym.asym.value =
(S_GET_VALUE (as_sym)
+ bfd_get_section_vma (stdoutput,
- S_GET_SEGMENT (as_sym)));
+ S_GET_SEGMENT (as_sym))
+ + sym_ptr->addend);
sym_ptr->ecoff_sym.weakext = S_IS_WEAK (as_sym);
@@ -4049,6 +4073,9 @@ ecoff_build_symbols (backend, buf, bufend, offset)
sym_ptr->ecoff_sym.asym.value =
as_sym->ecoff_extern_size;
}
+#ifdef S_SET_SIZE
+ S_SET_SIZE (as_sym, as_sym->ecoff_extern_size);
+#endif
}
else if (S_IS_COMMON (as_sym))
{
@@ -4166,6 +4193,10 @@ ecoff_build_symbols (backend, buf, bufend, offset)
sym_ptr->ecoff_sym.asym.value =
(S_GET_VALUE (as_sym)
- S_GET_VALUE (begin_ptr->as_sym));
+#ifdef S_SET_SIZE
+ S_SET_SIZE (begin_ptr->as_sym,
+ sym_ptr->ecoff_sym.asym.value);
+#endif
}
else if (begin_type == st_Block
&& sym_ptr->ecoff_sym.asym.sc != (int) sc_Info)
@@ -4337,7 +4368,7 @@ ecoff_build_aux (backend, buf, bufend, offset)
long iaux;
vlinks_t *file_link;
- bigendian = stdoutput->xvec->header_byteorder_big_p;
+ bigendian = bfd_big_endian (stdoutput);
aux_out = (union aux_ext *) (*buf + offset);
@@ -4650,7 +4681,7 @@ ecoff_build_debug (hdr, bufp, backend)
cur_file_ptr = sym->ecoff_file;
add_ecoff_symbol ((const char *) NULL, st_Nil, sc_Nil, sym,
- S_GET_VALUE (sym), indexNil);
+ (bfd_vma) 0, S_GET_VALUE (sym), indexNil);
}
cur_proc_ptr = hold_proc_ptr;
cur_file_ptr = hold_file_ptr;
@@ -4678,6 +4709,7 @@ ecoff_build_debug (hdr, bufp, backend)
(void) add_ecoff_symbol ((const char *) NULL,
st_End, sc_Text,
(symbolS *) NULL,
+ (bfd_vma) 0,
(symint_t) 0,
(symint_t) 0);
}
@@ -5255,7 +5287,7 @@ generate_ecoff_stab (what, string, type, other, desc)
if (sym != (symbolS *) NULL)
hold = sym->ecoff_symbol;
- (void) add_ecoff_symbol (string, st, sc, sym, value, indx);
+ (void) add_ecoff_symbol (string, st, sc, sym, (bfd_vma) 0, value, indx);
if (sym != (symbolS *) NULL)
sym->ecoff_symbol = hold;
diff --git a/gnu/usr.bin/binutils/gas/expr.c b/gnu/usr.bin/binutils/gas/expr.c
index 221fd1a16b4..f4069600594 100644
--- a/gnu/usr.bin/binutils/gas/expr.c
+++ b/gnu/usr.bin/binutils/gas/expr.c
@@ -1,5 +1,6 @@
/* expr.c -operands, expressions-
- Copyright (C) 1987, 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -166,7 +167,7 @@ integer_constant (radix, expressionP)
#define valuesize 32
#endif
- if (flag_mri && radix == 0)
+ if (flag_m68k_mri && radix == 0)
{
int flt = 0;
@@ -294,7 +295,7 @@ integer_constant (radix, expressionP)
}
}
- if (flag_mri && suffix != NULL && input_line_pointer - 1 == suffix)
+ if (flag_m68k_mri && suffix != NULL && input_line_pointer - 1 == suffix)
c = *input_line_pointer++;
if (small)
@@ -563,13 +564,13 @@ operand (expressionP)
case '9':
input_line_pointer--;
- integer_constant (flag_mri ? 0 : 10, expressionP);
+ integer_constant (flag_m68k_mri ? 0 : 10, expressionP);
break;
case '0':
/* non-decimal radix */
- if (flag_mri)
+ if (flag_m68k_mri)
{
char *s;
@@ -587,9 +588,13 @@ operand (expressionP)
c = *input_line_pointer;
switch (c)
{
+ case 'o':
+ case 'O':
+ case 'q':
+ case 'Q':
case '8':
case '9':
- if (flag_mri)
+ if (flag_m68k_mri)
{
integer_constant (0, expressionP);
break;
@@ -614,14 +619,14 @@ operand (expressionP)
case 'x':
case 'X':
- if (flag_mri)
+ if (flag_m68k_mri)
goto default_case;
input_line_pointer++;
integer_constant (16, expressionP);
break;
case 'b':
- if (LOCAL_LABELS_FB)
+ if (LOCAL_LABELS_FB && ! flag_m68k_mri)
{
switch (input_line_pointer[1])
{
@@ -659,7 +664,7 @@ operand (expressionP)
}
case 'B':
input_line_pointer++;
- if (flag_mri)
+ if (flag_m68k_mri)
goto default_case;
integer_constant (2, expressionP);
break;
@@ -672,7 +677,7 @@ operand (expressionP)
case '5':
case '6':
case '7':
- integer_constant (flag_mri ? 0 : 8, expressionP);
+ integer_constant (flag_m68k_mri ? 0 : 8, expressionP);
break;
case 'f':
@@ -718,6 +723,12 @@ operand (expressionP)
case 'd':
case 'D':
+ if (flag_m68k_mri)
+ {
+ integer_constant (0, expressionP);
+ break;
+ }
+ /* Fall through. */
case 'F':
case 'r':
case 'e':
@@ -752,21 +763,22 @@ operand (expressionP)
as_bad ("Missing ')' assumed");
input_line_pointer--;
}
+ SKIP_WHITESPACE ();
/* here with input_line_pointer->char after "(...)" */
return segment;
case 'E':
- if (! flag_mri || *input_line_pointer != '\'')
+ if (! flag_m68k_mri || *input_line_pointer != '\'')
goto de_fault;
as_bad ("EBCDIC constants are not supported");
/* Fall through. */
case 'A':
- if (! flag_mri || *input_line_pointer != '\'')
+ if (! flag_m68k_mri || *input_line_pointer != '\'')
goto de_fault;
++input_line_pointer;
/* Fall through. */
case '\'':
- if (! flag_mri)
+ if (! flag_m68k_mri)
{
/* Warning: to conform to other people's assemblers NO
ESCAPEMENT is permitted for a single quote. The next
@@ -786,7 +798,7 @@ operand (expressionP)
case '"':
/* Double quote is the bitwise not operator in MRI mode. */
- if (! flag_mri)
+ if (! flag_m68k_mri)
goto de_fault;
/* Fall through. */
case '!':
@@ -831,10 +843,10 @@ operand (expressionP)
/* $ is the program counter when in MRI mode, or when DOLLAR_DOT
is defined. */
#ifndef DOLLAR_DOT
- if (! flag_mri)
+ if (! flag_m68k_mri)
goto de_fault;
#endif
- if (flag_mri && hex_p (*input_line_pointer))
+ if (flag_m68k_mri && hex_p (*input_line_pointer))
{
/* In MRI mode, $ is also used as the prefix for a
hexadecimal constant. */
@@ -911,19 +923,19 @@ operand (expressionP)
break;
case '%':
- if (! flag_mri)
+ if (! flag_m68k_mri)
goto de_fault;
integer_constant (2, expressionP);
break;
case '@':
- if (! flag_mri)
+ if (! flag_m68k_mri)
goto de_fault;
integer_constant (8, expressionP);
break;
case ':':
- if (! flag_mri)
+ if (! flag_m68k_mri)
goto de_fault;
/* In MRI mode, this is a floating point constant represented
@@ -934,7 +946,7 @@ operand (expressionP)
break;
case '*':
- if (! flag_mri || is_part_of_name (*input_line_pointer))
+ if (! flag_m68k_mri || is_part_of_name (*input_line_pointer))
goto de_fault;
current_location (expressionP);
@@ -955,7 +967,7 @@ operand (expressionP)
c = get_symbol_end ();
#ifdef TC_I960
- /* The MRI i960 assemblers permits
+ /* The MRI i960 assembler permits
lda sizeof code,g13
*/
if (flag_mri
@@ -1219,17 +1231,22 @@ static operator_rankT op_rank[] =
void
expr_begin ()
{
-#ifdef TC_M68K
/* In MRI mode for the m68k, multiplication and division have lower
precedence than the bit wise operators. */
- if (flag_mri)
+ if (flag_m68k_mri)
{
op_rank[O_multiply] = 5;
op_rank[O_divide] = 5;
op_rank[O_modulus] = 5;
op_encoding['"'] = O_bit_not;
}
-#endif
+
+ /* Verify that X_op field is wide enough. */
+ {
+ expressionS e;
+ e.X_op = O_max;
+ assert (e.X_op == O_max);
+ }
}
/* Return the encoding for the operator at INPUT_LINE_POINTER.
@@ -1286,7 +1303,7 @@ operator ()
/* We accept !! as equivalent to ^ for MRI compatibility. */
if (input_line_pointer[1] != '!')
{
- if (flag_mri)
+ if (flag_m68k_mri)
return O_bit_inclusive_or;
return op_encoding[c];
}
diff --git a/gnu/usr.bin/binutils/gas/expr.h b/gnu/usr.bin/binutils/gas/expr.h
index 35a1c7ebbca..5af0f738ed6 100644
--- a/gnu/usr.bin/binutils/gas/expr.h
+++ b/gnu/usr.bin/binutils/gas/expr.h
@@ -100,26 +100,27 @@ typedef enum
/* (X_add_symbol && X_op_symbol) + X_add_number. */
O_logical_and,
/* (X_add_symbol || X_op_symbol) + X_add_number. */
- O_logical_or
+ O_logical_or,
+ /* this must be the largest value */
+ O_max
} operatorT;
typedef struct expressionS
{
- /* The type of the expression. */
- operatorT X_op;
/* The main symbol. */
struct symbol *X_add_symbol;
/* The second symbol, if needed. */
struct symbol *X_op_symbol;
/* A number to add. */
offsetT X_add_number;
+ /* The type of the expression. */
+ unsigned X_op : 5;
/* Non-zero if X_add_number should be regarded as unsigned. This is
only valid for O_constant expressions. It is only used when an
O_constant must be extended into a bignum (i.e., it is not used
when performing arithmetic on these values).
- FIXME: This field is not set very reliably.
- If we ever need more flags here, we can make them bitfields. */
- int X_unsigned;
+ FIXME: This field is not set very reliably. */
+ unsigned int X_unsigned : 1;
} expressionS;
/* "result" should be type (expressionS *). */
diff --git a/gnu/usr.bin/binutils/gas/flonum-konst.c b/gnu/usr.bin/binutils/gas/flonum-konst.c
index ab6c4725641..22bba05974b 100644
--- a/gnu/usr.bin/binutils/gas/flonum-konst.c
+++ b/gnu/usr.bin/binutils/gas/flonum-konst.c
@@ -1,5 +1,6 @@
/* flonum_const.c - Useful Flonum constants
- Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -14,8 +15,9 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with GAS; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
#include <ansidecl.h>
#include "flonum.h"
@@ -24,7 +26,7 @@
I really understood this stuff. */
-const int table_size_of_flonum_powers_of_ten = 11;
+const int table_size_of_flonum_powers_of_ten = 13;
static const LITTLENUM_TYPE zero[] =
{1};
@@ -44,7 +46,7 @@ static const LITTLENUM_TYPE zero[] =
/* JF: If this equals 6553/(2^16)+39321/(2^32)+... it approaches .1 */
static const LITTLENUM_TYPE minus_1[] =
{
- 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321,
+ 39322, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321,
39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 6553};
static const LITTLENUM_TYPE plus_1[] =
{10};
@@ -52,7 +54,7 @@ static const LITTLENUM_TYPE plus_1[] =
/* JF: If this equals 655/(2^16) + 23592/(2^32) + ... it approaches .01 */
static const LITTLENUM_TYPE minus_2[] =
{
- 10485, 36700, 62914, 23592, 49807, 10485, 36700, 62914, 23592, 49807,
+ 10486, 36700, 62914, 23592, 49807, 10485, 36700, 62914, 23592, 49807,
10485, 36700, 62914, 23592, 49807, 10485, 36700, 62914, 23592, 655};
static const LITTLENUM_TYPE plus_2[] =
{100};
@@ -60,7 +62,7 @@ static const LITTLENUM_TYPE plus_2[] =
/* This approaches .0001 */
static const LITTLENUM_TYPE minus_3[] =
{
- 52533, 20027, 37329, 65116, 64067, 60397, 14784, 18979, 33659, 19503,
+ 52534, 20027, 37329, 65116, 64067, 60397, 14784, 18979, 33659, 19503,
2726, 9542, 629, 2202, 40475, 10590, 4299, 47815, 36280, 6};
static const LITTLENUM_TYPE plus_3[] =
{10000};
@@ -68,7 +70,7 @@ static const LITTLENUM_TYPE plus_3[] =
/* JF: this approaches 1e-8 */
static const LITTLENUM_TYPE minus_4[] =
{
- 22516, 49501, 54293, 19424, 60699, 6716, 24348, 22618, 23904, 21327,
+ 22517, 49501, 54293, 19424, 60699, 6716, 24348, 22618, 23904, 21327,
3919, 44703, 19149, 28803, 48959, 6259, 50273, 62237, 42};
/* This equals 1525 * 2^16 + 57600 */
static const LITTLENUM_TYPE plus_4[] =
@@ -98,45 +100,67 @@ static const LITTLENUM_TYPE plus_7[] =
static const LITTLENUM_TYPE minus_8[] =
{
- 45849, 19069, 18068, 36324, 37948, 48745, 10873, 64360, 15961, 20566,
+ 27579, 64807, 12543, 794, 13907, 61297, 12013, 64360, 15961, 20566,
24178, 15922, 59427, 110};
static const LITTLENUM_TYPE plus_8[] =
{
- 15873, 11925, 39177, 991, 14589, 19735, 25347, 65086, 53853, 938,
- 37209, 47086, 33626, 23253, 32586, 42547, 9731, 59679, 590};
+ 15873, 11925, 39177, 991, 14589, 3861, 58415, 9076, 62956, 54223,
+ 56328, 50180, 45274, 48333, 32537, 42547, 9731, 59679, 590};
static const LITTLENUM_TYPE minus_9[] =
{
- 63601, 55221, 43562, 33661, 29067, 28203, 65417, 64352, 22462, 41110,
- 12570, 28635, 23199, 50572, 28471, 27074, 46375, 64028, 13106, 63700,
- 32698, 17493, 32420, 34382, 22750, 20681, 12300};
+ 11042, 8464, 58971, 63429, 6022, 63485, 5500, 53464, 47545, 50068,
+ 56988, 22819, 49708, 54493, 9920, 47667, 40409, 35764, 10383, 54466,
+ 32702, 17493, 32420, 34382, 22750, 20681, 12300};
static const LITTLENUM_TYPE plus_9[] =
{
- 63564, 61556, 29377, 54467, 18621, 28141, 36415, 61241, 47119, 30026,
- 19740, 46002, 13541, 61413, 30480, 38664, 32205, 50593, 51112, 48904,
- 48263, 43814, 286, 30826, 52813, 62575, 61390, 24540, 21495, 5};
+ 20678, 27614, 28272, 53066, 55311, 54677, 29038, 9906, 26288, 44486,
+ 13860, 7445, 54106, 15426, 21518, 25599, 29632, 52309, 61207, 26105,
+ 10482, 21948, 51191, 32988, 60892, 62574, 61390, 24540, 21495, 5};
static const LITTLENUM_TYPE minus_10[] =
{
- 50313, 34681, 1464, 25889, 19575, 41125, 17635, 4598, 49708, 13427,
- 17287, 56115, 53783, 38255, 32415, 17778, 31596, 7557, 20951, 18477,
- 40353, 1178, 44405, 11837, 11571, 50963, 15649, 11698, 40675, 2308,};
+ 6214, 48771, 23471, 30163, 31763, 38013, 57001, 11770, 18263, 36366,
+ 20742, 45086, 56969, 53231, 37856, 55814, 38057, 15692, 46761, 8713,
+ 6102, 20083, 8269, 11839, 11571, 50963, 15649, 11698, 40675, 2308};
static const LITTLENUM_TYPE plus_10[] =
{
- 18520, 53764, 54535, 61910, 61962, 59843, 46270, 58053, 12473, 63785,
- 2449, 43230, 50044, 47595, 10403, 35766, 32607, 1124, 24966, 35044,
- 25524, 23631, 18826, 14518, 58448, 14562, 49618, 5588, 25396, 28};
+ 63839, 36576, 45712, 44516, 37803, 29482, 4966, 30556, 37961, 23310,
+ 27070, 44972, 29507, 48257, 45209, 7494, 17831, 38728, 41577, 29443,
+ 36016, 7955, 35339, 35479, 36011, 14553, 49618, 5588, 25396, 28};
static const LITTLENUM_TYPE minus_11[] =
{
- 6223, 59909, 62437, 59960, 14652, 45336, 48800, 7647, 51962, 37982,
- 60436, 58176, 26767, 8440, 9831, 48556, 20994, 14148, 6757, 17221,
- 60624, 46129, 53210, 44085, 54016, 24259, 11232, 21229, 21313, 81,};
+ 16663, 56882, 61983, 7804, 36555, 32060, 34502, 1000, 14356, 21681,
+ 6605, 34767, 51411, 59048, 53614, 39850, 30079, 6496, 6846, 26841,
+ 40778, 19578, 59899, 44085, 54016, 24259, 11232, 21229, 21313, 81};
static const LITTLENUM_TYPE plus_11[] =
{
- 36159, 2055, 33615, 61362, 23581, 62454, 9748, 15275, 39284, 58636,
- 16269, 42793, 47240, 45774, 50861, 48400, 9413, 40281, 4030, 9572,
- 7984, 33038, 59522, 19450, 40593, 24486, 54320, 6661, 55766, 805,};
+ 92, 9054, 62707, 17993, 7821, 56838, 13992, 21321, 29637, 48426,
+ 42982, 38668, 49574, 28820, 18200, 18927, 53979, 16219, 37484, 2516,
+ 44642, 14665, 11587, 41926, 13556, 23956, 54320, 6661, 55766, 805};
+
+static const LITTLENUM_TYPE minus_12[] =
+{
+ 33202, 45969, 58804, 56734, 16482, 26007, 44984, 49334, 31007, 32944,
+ 44517, 63329, 47131, 15291, 59465, 2264, 23218, 11829, 59771, 38798,
+ 31051, 28748, 23129, 40541, 41562, 35108, 50620, 59014, 51817, 6613};
+static const LITTLENUM_TYPE plus_12[] =
+{
+ 10098, 37922, 58070, 7432, 10470, 63465, 23718, 62190, 47420, 7009,
+ 38443, 4587, 45596, 38472, 52129, 52779, 29012, 13559, 48688, 31678,
+ 41753, 58662, 10668, 36067, 29906, 56906, 21461, 46556, 59571, 9};
+
+static const LITTLENUM_TYPE minus_13[] =
+{
+ 45309, 27592, 37144, 34637, 34328, 41671, 34620, 24135, 53401, 22112,
+ 21576, 45147, 39310, 44051, 48572, 3676, 46544, 59768, 33350, 2323,
+ 49524, 61568, 3903, 36487, 36356, 30903, 14975, 9035, 29715, 667};
+static const LITTLENUM_TYPE plus_13[] =
+{
+ 18788, 16960, 6318, 45685, 55400, 46230, 35794, 25588, 7253, 55541,
+ 49716, 59760, 63592, 8191, 63765, 58530, 44667, 13294, 10001, 55586,
+ 47887, 18738, 9509, 40896, 42506, 52580, 4171, 325, 12329, 98};
/* Shut up complaints about differing pointer types. They only differ
in the const attribute, but there isn't any easy way to do this
@@ -157,6 +181,8 @@ const FLONUM_TYPE flonum_negative_powers_of_ten[] =
{X minus_9, X minus_9 + 26, X minus_9 + 26, -80, '+'},
{X minus_10, X minus_10 + 29, X minus_10 + 29, -136, '+'},
{X minus_11, X minus_11 + 29, X minus_11 + 29, -242, '+'},
+ {X minus_12, X minus_12 + 29, X minus_12 + 29, -455, '+'},
+ {X minus_13, X minus_13 + 29, X minus_13 + 29, -880, '+'},
};
const FLONUM_TYPE flonum_positive_powers_of_ten[] =
@@ -173,6 +199,8 @@ const FLONUM_TYPE flonum_positive_powers_of_ten[] =
{X plus_9, X plus_9 + 29, X plus_9 + 29, 24, '+'},
{X plus_10, X plus_10 + 29, X plus_10 + 29, 77, '+'},
{X plus_11, X plus_11 + 29, X plus_11 + 29, 183, '+'},
+ {X plus_12, X plus_12 + 29, X plus_12 + 29, 396, '+'},
+ {X plus_13, X plus_13 + 29, X plus_13 + 29, 821, '+'},
};
#ifdef VMS
diff --git a/gnu/usr.bin/binutils/gas/frags.c b/gnu/usr.bin/binutils/gas/frags.c
index 7c6d38c61ca..ba399d9e3f3 100644
--- a/gnu/usr.bin/binutils/gas/frags.c
+++ b/gnu/usr.bin/binutils/gas/frags.c
@@ -272,15 +272,10 @@ frag_wane (fragP)
fragP->fr_var = 0;
}
-/*
- * frag_align()
- *
- * Make a frag for ".align foo,bar". Call is "frag_align (foo,bar);".
- * Foo & bar are absolute integers.
- *
- * Call to close off the current frag with a ".align", then start a new
- * (so far empty) frag, in the same subsegment as the last frag.
- */
+/* Make an alignment frag. The size of this frag will be adjusted to
+ force the next frag to have the appropriate alignment. ALIGNMENT
+ is the power of two to which to align. FILL_CHARACTER is the
+ character to use to fill in any bytes which are skipped. */
void
frag_align (alignment, fill_character)
@@ -300,6 +295,12 @@ frag_align (alignment, fill_character)
}
}
+/* Make an alignment frag like frag_align, but fill with a repeating
+ pattern rather than a single byte. ALIGNMENT is the power of two
+ to which to align. FILL_PATTERN is the fill pattern to repeat in
+ the bytes which are skipped. N_FILL is the number of bytes in
+ FILL_PATTERN. */
+
void
frag_align_pattern (alignment, fill_pattern, n_fill)
int alignment;
diff --git a/gnu/usr.bin/binutils/gas/gasp.c b/gnu/usr.bin/binutils/gas/gasp.c
index f92d34ff995..673f4406b8e 100644
--- a/gnu/usr.bin/binutils/gas/gasp.c
+++ b/gnu/usr.bin/binutils/gas/gasp.c
@@ -1103,7 +1103,21 @@ change_base (idx, in, out)
while (idx < in->len)
{
- if (idx < in->len - 1 && in->ptr[idx + 1] == '\'' && ! mri)
+ if (in->ptr[idx] == '\\'
+ && idx + 1 < in->len
+ && in->ptr[idx + 1] == '(')
+ {
+ idx += 2;
+ while (idx < in->len
+ && in->ptr[idx] != ')')
+ {
+ sb_add_char (out, in->ptr[idx]);
+ idx++;
+ }
+ if (idx < in->len)
+ idx++;
+ }
+ else if (idx < in->len - 1 && in->ptr[idx + 1] == '\'' && ! mri)
{
int base;
int value;
@@ -1761,11 +1775,24 @@ process_assigns (idx, in, buf)
{
hash_entry *ptr;
if (in->ptr[idx] == '\\'
+ && idx + 1 < in->len
+ && in->ptr[idx + 1] == '(')
+ {
+ do
+ {
+ sb_add_char (buf, in->ptr[idx]);
+ idx++;
+ }
+ while (idx < in->len && in->ptr[idx - 1] != ')');
+ }
+ else if (in->ptr[idx] == '\\'
+ && idx + 1 < in->len
&& in->ptr[idx + 1] == '&')
{
idx = condass_lookup_name (in, idx + 2, buf, 1);
}
else if (in->ptr[idx] == '\\'
+ && idx + 1 < in->len
&& in->ptr[idx + 1] == '$')
{
idx = condass_lookup_name (in, idx + 2, buf, 0);
diff --git a/gnu/usr.bin/binutils/gas/gdbinit.in b/gnu/usr.bin/binutils/gas/gdbinit.in
index 997c10a9aa4..e946726ec67 100644
--- a/gnu/usr.bin/binutils/gas/gdbinit.in
+++ b/gnu/usr.bin/binutils/gas/gdbinit.in
@@ -2,6 +2,7 @@ dir @srcdir@
dir .
break as_warn
+break as_warn_where
break as_bad
break as_bad_where
break as_fatal
diff --git a/gnu/usr.bin/binutils/gas/hash.c b/gnu/usr.bin/binutils/gas/hash.c
index 45d365c8991..b773caa010e 100644
--- a/gnu/usr.bin/binutils/gas/hash.c
+++ b/gnu/usr.bin/binutils/gas/hash.c
@@ -136,26 +136,39 @@
#define error as_fatal
-#define DELETED ((PTR)1) /* guarenteed invalid address */
-#define START_POWER (11) /* power of two: size of new hash table */
+static char _deleted_[1];
+#define DELETED ((PTR)_deleted_) /* guarenteed unique address */
+#define START_POWER (10) /* power of two: size of new hash table */
/* TRUE if a symbol is in entry @ ptr. */
#define islive(ptr) (ptr->hash_string && ptr->hash_string!=DELETED)
-/* Number of slots in hash table. The wall does not count here.
- We expect this is always a power of 2. */
-#define STAT_SIZE (0)
-#define STAT_ACCESS (1) /* number of hash_ask()s */
+enum stat_enum {
+ /* Number of slots in hash table. The wall does not count here.
+ We expect this is always a power of 2. */
+ STAT_SIZE = 0,
+ /* Number of hash_ask calls. */
+ STAT_ACCESS,
+ STAT_ACCESS_w,
+ /* Number of collisions (total). This may exceed STAT_ACCESS if we
+ have lots of collisions/access. */
+ STAT_COLLIDE,
+ STAT_COLLIDE_w,
+ /* Slots used right now. */
+ STAT_USED,
+ /* How many string compares? */
+ STAT_STRCMP,
+ STAT_STRCMP_w,
+ /* Size of statistics block... this must be last. */
+ STATLENGTH
+};
#define STAT__READ (0) /* reading */
#define STAT__WRITE (1) /* writing */
-/* Number of collisions (total). This may exceed STAT_ACCESS if we
- have lots of collisions/access. */
-#define STAT_COLLIDE (3)
-#define STAT_USED (5) /* slots used right now */
-#define STATLENGTH (6) /* size of statistics block */
-#if STATLENGTH != HASH_STATLENGTH
-Panic! Please make #include "stat.h" agree with previous definitions!
-#endif
+
+/* When we grow a hash table, by what power of two do we increase it? */
+#define GROW_FACTOR 1
+/* When should we grow it? */
+#define FULL_VALUE(N) ((N) / 2)
/* #define SUSPECT to do runtime checks */
/* #define TEST to be a test jig for hash...() */
@@ -170,6 +183,26 @@ Panic! Please make #include "stat.h" agree with previous definitions!
#define START_FULL (4)
#endif
+struct hash_entry
+{
+ const char *hash_string; /* points to where the symbol string is */
+ /* NULL means slot is not used */
+ /* DELETED means slot was deleted */
+ PTR hash_value; /* user's datum, associated with symbol */
+ unsigned long h;
+};
+
+struct hash_control {
+ struct hash_entry *hash_where;/* address of hash table */
+ int hash_sizelog; /* Log of ( hash_mask + 1 ) */
+ int hash_mask; /* masks a hash into index into table */
+ int hash_full; /* when hash_stat[STAT_USED] exceeds this, */
+ /* grow table */
+ struct hash_entry *hash_wall; /* point just after last (usable) entry */
+ /* here we have some statistics */
+ int hash_stat[STATLENGTH]; /* lies & statistics */
+};
+
/*------------------ plan ---------------------------------- i = internal
struct hash_control * c;
@@ -267,7 +300,7 @@ hash_new ()
retval->hash_where = room;
retval->hash_wall =
wall = room + (1 << START_POWER);
- retval->hash_full = (1 << START_POWER) / 2;
+ retval->hash_full = FULL_VALUE (1 << START_POWER);
for (entry = room; entry <= wall; entry++)
entry->hash_string = NULL;
return retval;
@@ -291,6 +324,7 @@ hash_die (handle)
free ((char *) handle);
}
+#ifdef TEST
/*
* h a s h _ s a y ( )
*
@@ -304,7 +338,7 @@ hash_die (handle)
* Then contents of hash_stat[] are read out (in ascending order)
* until your buffer or hash_stat[] is exausted.
*/
-void
+static void
hash_say (handle, buffer, bufsiz)
struct hash_control *handle;
int buffer[ /*bufsiz*/ ];
@@ -324,6 +358,7 @@ hash_say (handle, buffer, bufsiz)
}
}
}
+#endif
/*
* h a s h _ d e l e t e ( )
@@ -438,7 +473,7 @@ hash_insert (handle, string, value)
*
* Regardless of what was in the symbol table before, after hash_jam()
* the named symbol has the given value. The symbol is either inserted or
- * (its value is) relpaced.
+ * (its value is) replaced.
* An error message string is returned, 0 means OK.
*
* WARNING: this may decide to grow the hashed symbol table.
@@ -515,69 +550,48 @@ hash_grow (handle) /* make a hash table grow */
* attempt to get enough room for a hash table twice as big
*/
temp = handle->hash_stat[STAT_SIZE];
- if ((newwhere = ((struct hash_entry *)
- xmalloc ((unsigned long) ((temp + temp + 1)
- * sizeof (struct hash_entry)))))
- != NULL)
- /* +1 for wall slot */
- {
- retval = 0; /* assume success until proven otherwise */
- /*
- * have enough room: now we do all the work.
- * double the size of everything in handle,
- * note: hash_mask frob works for 1's & for 2's complement machines
- */
- handle->hash_mask = handle->hash_mask + handle->hash_mask + 1;
- handle->hash_stat[STAT_SIZE] <<= 1;
- newsize = handle->hash_stat[STAT_SIZE];
- handle->hash_where = newwhere;
- handle->hash_full <<= 1;
- handle->hash_sizelog += 1;
- handle->hash_stat[STAT_USED] = 0;
- handle->hash_wall =
- newwall = newwhere + newsize;
- /*
- * set all those pesky new slots to vacant.
- */
- for (newtrack = newwhere; newtrack <= newwall; newtrack++)
- {
- newtrack->hash_string = NULL;
- }
- /*
- * we will do a scan of the old table, the hard way, using the
- * new control block to re-insert the data into new hash table.
- */
- handle->hash_stat[STAT_USED] = 0; /* inserts will bump it up to correct */
- for (oldtrack = oldwhere; oldtrack < oldwall; oldtrack++)
- if (((string = oldtrack->hash_string) != NULL) && string != DELETED)
- if ((retval = hash_jam (handle, string, oldtrack->hash_value)))
- break;
+ newwhere = ((struct hash_entry *)
+ xmalloc ((unsigned long) ((temp << GROW_FACTOR + 1)
+ /* +1 for wall slot */
+ * sizeof (struct hash_entry))));
+ if (newwhere == NULL)
+ return "no_room";
+
+ /*
+ * have enough room: now we do all the work.
+ * double the size of everything in handle.
+ */
+ handle->hash_mask = ((handle->hash_mask + 1) << GROW_FACTOR) - 1;
+ handle->hash_stat[STAT_SIZE] <<= GROW_FACTOR;
+ newsize = handle->hash_stat[STAT_SIZE];
+ handle->hash_where = newwhere;
+ handle->hash_full <<= GROW_FACTOR;
+ handle->hash_sizelog += GROW_FACTOR;
+ handle->hash_wall = newwall = newwhere + newsize;
+ /* Set all those pesky new slots to vacant. */
+ for (newtrack = newwhere; newtrack <= newwall; newtrack++)
+ newtrack->hash_string = NULL;
+ /* We will do a scan of the old table, the hard way, using the
+ * new control block to re-insert the data into new hash table. */
+ handle->hash_stat[STAT_USED] = 0;
+ for (oldtrack = oldwhere; oldtrack < oldwall; oldtrack++)
+ if (((string = oldtrack->hash_string) != NULL) && string != DELETED)
+ if ((retval = hash_jam (handle, string, oldtrack->hash_value)))
+ return retval;
#ifdef SUSPECT
- if (!retval && handle->hash_stat[STAT_USED] != oldused)
- {
- retval = "hash_used";
- }
+ if (handle->hash_stat[STAT_USED] != oldused)
+ return "hash_used";
#endif
- if (!retval)
- {
- /*
- * we have a completely faked up control block.
- * return the old hash table.
- */
- free ((char *) oldwhere);
- /*
- * Here with success. retval is already 0.
- */
- }
- }
- else
- {
- retval = "no room";
- }
- return retval;
+
+ /* We have a completely faked up control block.
+ Return the old hash table. */
+ free ((char *) oldwhere);
+
+ return 0;
}
+#ifdef TEST
/*
* h a s h _ a p p l y ( )
*
@@ -606,28 +620,20 @@ hash_grow (handle) /* make a hash table grow */
* In future we may use the value returned by your nominated function.
* One idea is to abort the scan if, after applying the function to a
* certain node, the function returns a certain code.
- * To be safe, please make your functions of type char *. If you always
- * return NULL, then the scan will complete, visiting every symbol in
- * the table exactly once. ALL OTHER RETURNED VALUES have no meaning yet!
- * Caveat Actor!
*
* The function you supply should be of the form:
- * char * myfunct(string,value)
+ * void myfunct(string,value)
* char * string; |* the symbol's name *|
* char * value; |* the symbol's value *|
* {
* |* ... *|
- * return(NULL);
* }
*
- * The returned value of hash_apply() is (char*)NULL. In future it may return
- * other values. NULL means "completed scan OK". Other values have no meaning
- * yet. (The function has no graceful failures.)
*/
-char *
+void
hash_apply (handle, function)
struct hash_control *handle;
- char *(*function) ();
+ void (*function) ();
{
struct hash_entry *entry;
struct hash_entry *wall;
@@ -640,8 +646,8 @@ hash_apply (handle, function)
(*function) (entry->hash_string, entry->hash_value);
}
}
- return (NULL);
}
+#endif
/*
* h a s h _ f i n d ( )
@@ -681,19 +687,32 @@ hash_ask (handle, string, access_type)
const char *s;
struct hash_entry *slot;
int collision; /* count collisions */
+ int strcmps;
+ int hcode;
/* start looking here */
- slot = handle->hash_where + hash_code (handle, string);
+ hcode = hash_code (handle, string);
+ slot = handle->hash_where + (hcode & handle->hash_mask);
handle->hash_stat[STAT_ACCESS + access_type] += 1;
- collision = 0;
+ collision = strcmps = 0;
hash_found = FALSE;
while (((s = slot->hash_string) != NULL) && s != DELETED)
{
- if (string == s || !strcmp (string, s))
- hash_found = TRUE;
- if (hash_found)
- break;
+ if (string == s)
+ {
+ hash_found = TRUE;
+ break;
+ }
+ if (slot->h == hcode)
+ {
+ if (!strcmp (string, s))
+ {
+ hash_found = TRUE;
+ break;
+ }
+ strcmps++;
+ }
collision++;
slot++;
}
@@ -710,11 +729,20 @@ hash_ask (handle, string, access_type)
slot = handle->hash_where;/* now look again */
while (((s = slot->hash_string) != NULL) && s != DELETED)
{
- if (string == s || !strcmp (string, s))
+ if (string == s)
{
hash_found = TRUE;
break;
}
+ if (slot->h == hcode)
+ {
+ if (!strcmp (string, s))
+ {
+ hash_found = TRUE;
+ break;
+ }
+ strcmps++;
+ }
collision++;
slot++;
}
@@ -727,7 +755,10 @@ hash_ask (handle, string, access_type)
*/
}
handle->hash_stat[STAT_COLLIDE + access_type] += collision;
- return (slot); /* also return hash_found */
+ handle->hash_stat[STAT_STRCMP + access_type] += strcmps;
+ if (!hash_found)
+ slot->h = hcode;
+ return slot; /* also return hash_found */
}
/*
@@ -755,7 +786,7 @@ hash_code (handle, string)
h += c;
h = (h << 3) + (h >> n) + c;
}
- return (h & handle->hash_mask);
+ return h;
#else
/* from bfd */
unsigned long h = 0;
@@ -770,10 +801,41 @@ hash_code (handle, string)
}
h += len + (len << 17);
h ^= h >> 2;
- return h & handle->hash_mask;
+ return h;
#endif
}
+void
+hash_print_statistics (file, name, h)
+ FILE *file;
+ const char *name;
+ struct hash_control *h;
+{
+ unsigned long sz, used, pct;
+
+ if (h == 0)
+ return;
+
+ sz = h->hash_stat[STAT_SIZE];
+ used = h->hash_stat[STAT_USED];
+ pct = (used * 100 + sz / 2) / sz;
+
+ fprintf (file, "%s hash statistics:\n\t%d/%d slots used (%d%%)\n",
+ name, used, sz, pct);
+
+#define P(name, off) \
+ fprintf (file, "\t%-16s %6dr + %6dw = %7d\n", name, \
+ h->hash_stat[off+STAT__READ], \
+ h->hash_stat[off+STAT__WRITE], \
+ h->hash_stat[off+STAT__READ] + h->hash_stat[off+STAT__WRITE])
+
+ P ("accesses:", STAT_ACCESS);
+ P ("collisions:", STAT_COLLIDE);
+ P ("string compares:", STAT_STRCMP);
+
+#undef P
+}
+
/*
* Here is a test program to exercise above.
*/
@@ -799,8 +861,8 @@ int number; /* number 0:TABLES-1 of current hashed */
main ()
{
- char (*applicatee ());
- char *destroy ();
+ void applicatee ();
+ void destroy ();
char *what ();
int *ip;
@@ -915,24 +977,22 @@ what (description)
return (retval);
}
-char *
+void
destroy (string, value)
char *string;
char *value;
{
free (string);
free (value);
- return (NULL);
}
-char *
+void
applicatee (string, value)
char *string;
char *value;
{
printf ("%.20s-%.20s\n", string, value);
- return (NULL);
}
whattable () /* determine number: what hash table to use */
diff --git a/gnu/usr.bin/binutils/gas/hash.h b/gnu/usr.bin/binutils/gas/hash.h
index 8f5076a5055..fb229c8086a 100644
--- a/gnu/usr.bin/binutils/gas/hash.h
+++ b/gnu/usr.bin/binutils/gas/hash.h
@@ -20,34 +20,11 @@
#ifndef hashH
#define hashH
-struct hash_entry
-{
- const char *hash_string; /* points to where the symbol string is */
- /* NULL means slot is not used */
- /* DELETED means slot was deleted */
- PTR hash_value; /* user's datum, associated with symbol */
-};
-
-
-#define HASH_STATLENGTH (6)
-struct hash_control
-{
- struct hash_entry *hash_where;/* address of hash table */
- int hash_sizelog; /* Log of ( hash_mask + 1 ) */
- int hash_mask; /* masks a hash into index into table */
- int hash_full; /* when hash_stat[STAT_USED] exceeds this, */
- /* grow table */
- struct hash_entry *hash_wall; /* point just after last (usable) entry */
- /* here we have some statistics */
- int hash_stat[HASH_STATLENGTH]; /* lies & statistics */
- /* we need STAT_USED & STAT_SIZE */
-};
-
+struct hash_control;
/* returns control block */
struct hash_control *hash_new PARAMS ((void));
void hash_die PARAMS ((struct hash_control *));
-void hash_say PARAMS ((struct hash_control *, int *buffer, int bufsiz));
/* returns previous value */
PTR hash_delete PARAMS ((struct hash_control *, const char *str));
/* returns previous value */
@@ -55,14 +32,14 @@ PTR hash_replace PARAMS ((struct hash_control *, const char *str, PTR val));
/* returns error string or null */
const char *hash_insert PARAMS ((struct hash_control *, const char *str,
PTR val));
-/* return of 0 means OK */
-char *hash_apply PARAMS ((struct hash_control *,
- char *(*fn) (const char *str, PTR val)));
/* returns value */
PTR hash_find PARAMS ((struct hash_control *, const char *str));
/* returns error text or null (internal) */
const char *hash_jam PARAMS ((struct hash_control *, const char *str,
PTR val));
+
+void hash_print_statistics PARAMS ((FILE *, const char *,
+ struct hash_control *));
#endif /* #ifdef hashH */
/* end of hash.c */
diff --git a/gnu/usr.bin/binutils/gas/input-scrub.c b/gnu/usr.bin/binutils/gas/input-scrub.c
index 52e569be531..d640bd09620 100644
--- a/gnu/usr.bin/binutils/gas/input-scrub.c
+++ b/gnu/usr.bin/binutils/gas/input-scrub.c
@@ -206,7 +206,7 @@ input_scrub_begin ()
logical_input_file = (char *) NULL;
physical_input_file = NULL; /* No file read yet. */
next_saved_file = NULL; /* At EOF, don't pop to any other file */
- do_scrub_begin ();
+ do_scrub_begin (flag_m68k_mri);
}
void
diff --git a/gnu/usr.bin/binutils/gas/mac-as.r b/gnu/usr.bin/binutils/gas/mac-as.r
index 644c588b794..f36c033cb07 100644
--- a/gnu/usr.bin/binutils/gas/mac-as.r
+++ b/gnu/usr.bin/binutils/gas/mac-as.r
@@ -11,7 +11,7 @@ resource 'vers' (1) {
0,
verUs,
VERSION_STRING,
- VERSION_STRING " (c) 1986-95 FSF, Inc. "
+ VERSION_STRING " (C) 1986-95 FSF, Inc."
};
resource 'vers' (2, purgeable) {
@@ -21,7 +21,7 @@ resource 'vers' (2, purgeable) {
0,
verUs,
VERSION_STRING,
- "GAS " /* fill in major/minor versions */ "for MPW"
+ "GAS " VERSION_STRING " for MPW"
};
#ifdef WANT_CFRG
@@ -35,7 +35,7 @@ resource 'cfrg' (0) {
kNoVersionNum, kNoVersionNum,
0,0,
kIsApp, kOnDiskFlat, kZeroOffset, kWholeFork,
- "as"
+ PROG_NAME
}
};
diff --git a/gnu/usr.bin/binutils/gas/messages.c b/gnu/usr.bin/binutils/gas/messages.c
index a1af0758430..cf16c758f6a 100644
--- a/gnu/usr.bin/binutils/gas/messages.c
+++ b/gnu/usr.bin/binutils/gas/messages.c
@@ -421,7 +421,7 @@ as_bad_where (file, line, format, va_alist)
* Send to stderr a string as a fatal message, and print location of error in
* input file(s).
* Please only use this for when we DON'T have some recovery action.
- * It exit()s with a warning status.
+ * It xexit()s with a warning status.
*/
#ifdef USE_STDARG
@@ -436,7 +436,7 @@ as_fatal (const char *format,...)
vfprintf (stderr, format, args);
(void) putc ('\n', stderr);
va_end (args);
- exit (EXIT_FAILURE);
+ xexit (EXIT_FAILURE);
} /* as_fatal() */
#else
/*VARARGS1*/
@@ -453,7 +453,7 @@ as_fatal (format, va_alist)
vfprintf (stderr, format, args);
(void) putc ('\n', stderr);
va_end (args);
- exit (EXIT_FAILURE);
+ xexit (EXIT_FAILURE);
} /* as_fatal() */
#endif /* not NO_STDARG */
@@ -474,7 +474,7 @@ as_assert (file, line, fn)
fprintf (stderr, " in %s", fn);
fprintf (stderr, " at %s line %d.\n", file, line);
fprintf (stderr, "Please report this bug.\n");
- exit (EXIT_FAILURE);
+ xexit (EXIT_FAILURE);
}
/* as_abort: Print a friendly message saying how totally hosed we are,
@@ -489,7 +489,7 @@ as_abort (file, line, fn)
if (fn)
fprintf (stderr, " in %s", fn);
fprintf (stderr, "\nPlease report this bug.\n");
- exit (EXIT_FAILURE);
+ xexit (EXIT_FAILURE);
}
/* Support routines. */
diff --git a/gnu/usr.bin/binutils/gas/mpw-config.in b/gnu/usr.bin/binutils/gas/mpw-config.in
index ae7e2982404..4a588c1ed90 100644
--- a/gnu/usr.bin/binutils/gas/mpw-config.in
+++ b/gnu/usr.bin/binutils/gas/mpw-config.in
@@ -19,21 +19,32 @@ Set TDEFINES ""
Set EXTRA_OBJECTS ""
+# Default emulation.
+
+Set em generic
+
If "{target_canonical}" =~ /m68k-apple-macos/
Set obj_format "coff"
Set TDEFINES '-d M68KCOFF'
Set EXTRA_OBJECTS '"{o}"m68k-parse.c.o'
+
Else If "{target_canonical}" =~ /powerpc-apple-macos/
Set obj_format "coff"
Set bfd_gas yes
+ Set em macos
+
Else If "{target_canonical}" =~ /i386-unknown-go32/
Set obj_format "coff"
Set TDEFINES '-d I386COFF'
+
Else If "{target_canonical}" =~ /m68k-unknown-coff/
Set TDEFINES '-d M68KCOFF'
+
Else If "{target_canonical}" =~ /mips-idt-ecoff/
Set bfd_gas yes
Set TDEFINES '-d TARGET_BYTES_BIG_ENDIAN'
+
+
Else If "{target_canonical}" =~ /sh-hitachi-hms/
Set obj_format "coff"
forward-include "{srcroot}"opcodes:sh-opc.h 'opcodes/sh-opc.h'
@@ -45,9 +56,7 @@ forward-include "{srcdir}"config:tc-{short_arch_name}.h targ-cpu.h
forward-include "{srcdir}"config:obj-{obj_format}.c obj-format.c
forward-include "{srcdir}"config:obj-{obj_format}.h obj-format.h
-# Default emulation.
-
-forward-include "{srcdir}"config:te-generic.h targ-env.h
+forward-include "{srcdir}"config:te-{em}.h targ-env.h
# Special cases for float handling.
diff --git a/gnu/usr.bin/binutils/gas/mpw-make.sed b/gnu/usr.bin/binutils/gas/mpw-make.sed
index 4f2d5530045..e40bf746876 100644
--- a/gnu/usr.bin/binutils/gas/mpw-make.sed
+++ b/gnu/usr.bin/binutils/gas/mpw-make.sed
@@ -18,6 +18,13 @@ LOCAL_LOADLIBES = \
/@OPCODES_LIB@/s/@OPCODES_LIB@/::opcodes:libopcodes.o/
/@BFDLIB@/s/@BFDLIB@/::bfd:libbfd.o/
+# Point at the libraries directly.
+/@OPCODES_DEP@/s/@OPCODES_DEP@/::opcodes:libopcodes.o/
+/@BFDDEP@/s/@BFDDEP@/::bfd:libbfd.o/
+
+# Don't need this.
+/@HLDFLAGS@/s/@HLDFLAGS@//
+
/extra_objects@/s/extra_objects@/{EXTRA_OBJECTS}/
/LOADLIBES/s/{LOADLIBES}/{EXTRALIBS}/
@@ -53,6 +60,9 @@ LOCAL_LOADLIBES = \
/{OBJS}/s/{OBJS} \\Option-f "{o}"config.h/{OBJS} \\Option-f/
/gasp.c/s/gasp\.c "{o}"config.h/gasp.c/
+# ALL_CFLAGS includes TDEFINES, which is not desirable at link time.
+/CC_LD/s/ALL_CFLAGS/CFLAGS/g
+
# The resource file is called mac-as.r.
/as.new.r/s/as\.new\.r/mac-as.r/
/gasp.new.r/s/gasp\.new\.r/mac-as.r/
@@ -74,6 +84,21 @@ LOCAL_LOADLIBES = \
$a\
stamps \\Option-f config-stamp\
+/^install \\Option-f/,/^$/c\
+install \\Option-f all install-only\
+\
+install-only \\Option-f\
+ If "`Exists "{prefix}"`" == ""\
+ Echo "{prefix}" does not exist, cannot install anything\
+ Exit 1\
+ End If\
+ If "`Exists "{bindir}"`" == ""\
+ NewFolder "{bindir}"\
+ End If\
+ Duplicate -y :as.new "{bindir}"as\
+ Duplicate -y :gasp.new "{bindir}"gasp\
+
+
# Whack out config-rebuilding targets, they won't work.
/^Makefile \\Option-f/,/^$/d
/^config.status \\Option-f/,/^$/d
diff --git a/gnu/usr.bin/binutils/gas/output-file.c b/gnu/usr.bin/binutils/gas/output-file.c
index 47a66fc87e0..c53281bb522 100644
--- a/gnu/usr.bin/binutils/gas/output-file.c
+++ b/gnu/usr.bin/binutils/gas/output-file.c
@@ -1,5 +1,6 @@
/* output-file.c - Deal with the output file
- Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1987, 90, 91, 93, 92, 94, 95, 1996
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -48,7 +49,6 @@ output_file_create (name)
}
else if (!(stdoutput = bfd_openw (name, TARGET_FORMAT)))
{
- bfd_perror (name);
as_perror ("FATAL: Can't create %s", name);
exit (EXIT_FAILURE);
}
diff --git a/gnu/usr.bin/binutils/gas/read.c b/gnu/usr.bin/binutils/gas/read.c
index 3bf1f108065..19d02077886 100644
--- a/gnu/usr.bin/binutils/gas/read.c
+++ b/gnu/usr.bin/binutils/gas/read.c
@@ -1,5 +1,5 @@
/* read.c - read a source file -
- Copyright (C) 1986, 1987, 1990, 1991, 1993, 1994
+ Copyright (C) 1986, 87, 90, 91, 92, 93, 94, 95, 1996
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -202,7 +202,7 @@ symbolS *mri_common_symbol;
static int mri_pending_align;
static int scrub_from_string PARAMS ((char **));
-static void do_align PARAMS ((int, char *));
+static void do_align PARAMS ((int, char *, int));
static int hex_float PARAMS ((int, char *));
static void do_org PARAMS ((segT, expressionS *, int));
char *demand_copy_string PARAMS ((int *lenP));
@@ -246,6 +246,8 @@ static const pseudo_typeS potable[] =
{"ascii", stringer, 0},
{"asciz", stringer, 1},
{"balign", s_align_bytes, 0},
+ {"balignw", s_align_bytes, -2},
+ {"balignl", s_align_bytes, -4},
/* block */
{"byte", cons, 1},
{"comm", s_comm, 0},
@@ -325,12 +327,16 @@ static const pseudo_typeS potable[] =
{"irepc", s_irp, 1},
{"lcomm", s_lcomm, 0},
{"lflags", listing_flags, 0}, /* Listing flags */
+ {"linkonce", s_linkonce, 0},
{"list", listing_list, 1}, /* Turn listing on */
{"llen", listing_psize, 1},
{"long", cons, 4},
{"lsym", s_lsym, 0},
{"macro", s_macro, 0},
{"mexit", s_mexit, 0},
+ {"mri", s_mri, 0},
+ {".mri", s_mri, 0}, /* Special case so .mri works in MRI mode. */
+ {"name", s_ignore, 0},
{"noformat", s_ignore, 0},
{"nolist", listing_list, 0}, /* Turn listing off */
{"nopage", listing_nopage, 0},
@@ -338,6 +344,8 @@ static const pseudo_typeS potable[] =
{"offset", s_struct, 0},
{"org", s_org, 0},
{"p2align", s_align_ptwo, 0},
+ {"p2alignw", s_align_ptwo, -2},
+ {"p2alignl", s_align_ptwo, -4},
{"page", listing_eject, 0},
{"plen", listing_psize, 0},
{"print", s_print, 0},
@@ -355,6 +363,7 @@ static const pseudo_typeS potable[] =
{"single", float_cons, 'f'},
/* size */
{"space", s_space, 0},
+ {"skip", s_space, 0},
{"spc", s_ignore, 0},
{"stabd", s_stab, 'd'},
{"stabn", s_stab, 'n'},
@@ -401,7 +410,8 @@ pop_insert (table)
{
errtxt = hash_insert (po_hash, pop->poc_name, (char *) pop);
if (errtxt && (!pop_override_ok || strcmp (errtxt, "exists")))
- as_fatal ("error constructing %s pseudo-op table", pop_table_name);
+ as_fatal ("error constructing %s pseudo-op table: %s", pop_table_name,
+ errtxt);
}
}
@@ -505,7 +515,7 @@ read_a_source_file (name)
line_label = NULL;
- if (flag_mri
+ if (flag_m68k_mri
#ifdef LABELS_WITHOUT_COLONS
|| 1
#endif
@@ -524,7 +534,7 @@ read_a_source_file (name)
/* In MRI mode, the EQU pseudoop must be
handled specially. */
- if (flag_mri)
+ if (flag_m68k_mri)
{
char *rest = input_line_pointer + 1;
@@ -594,7 +604,7 @@ read_a_source_file (name)
*/
if (TC_START_LABEL(c, input_line_pointer))
{
- if (flag_mri)
+ if (flag_m68k_mri)
{
char *rest = input_line_pointer + 1;
@@ -648,11 +658,7 @@ read_a_source_file (name)
}
#endif
-#ifndef MRI_MODE_NEEDS_PSEUDO_DOT
-#define MRI_MODE_NEEDS_PSEUDO_DOT 0
-#endif
-
- if ((flag_mri && ! MRI_MODE_NEEDS_PSEUDO_DOT)
+ if (flag_m68k_mri
#ifdef NO_PSEUDO_DOT
|| 1
#endif
@@ -666,8 +672,7 @@ read_a_source_file (name)
}
if (pop != NULL
- || ((! flag_mri || MRI_MODE_NEEDS_PSEUDO_DOT)
- && *s == '.'))
+ || (! flag_m68k_mri && *s == '.'))
{
/*
* PSEUDO - OP.
@@ -690,7 +695,7 @@ read_a_source_file (name)
|| (pop->poc_handler == s_space
&& pop->poc_val == 1))))
{
- do_align (1, (char *) NULL);
+ do_align (1, (char *) NULL, 0);
mri_pending_align = 0;
}
@@ -727,7 +732,7 @@ read_a_source_file (name)
if (mri_pending_align)
{
- do_align (1, (char *) NULL);
+ do_align (1, (char *) NULL, 0);
mri_pending_align = 0;
}
@@ -741,7 +746,7 @@ read_a_source_file (name)
#endif
)
{
- if (flag_mri && *input_line_pointer == '\'')
+ if (flag_m68k_mri && *input_line_pointer == '\'')
inquote = ! inquote;
input_line_pointer++;
}
@@ -940,6 +945,11 @@ read_a_source_file (name)
HANDLE_CONDITIONAL_ASSEMBLY ();
+#ifdef tc_unrecognized_line
+ if (tc_unrecognized_line (c))
+ continue;
+#endif
+
/* as_warn("Junk character %d.",c); Now done by ignore_rest */
input_line_pointer--; /* Report unknown char as ignored. */
ignore_rest_of_line ();
@@ -985,7 +995,7 @@ mri_comment_field (stopcp)
char *s;
int inquote = 0;
- know (flag_mri);
+ know (flag_m68k_mri);
for (s = input_line_pointer;
((! is_end_of_line[(unsigned char) *s] && *s != ' ' && *s != '\t')
@@ -1037,12 +1047,13 @@ s_abort (ignore)
/* Guts of .align directive. */
static void
-do_align (n, fill)
+do_align (n, fill, len)
int n;
char *fill;
+ int len;
{
#ifdef md_do_align
- md_do_align (n, fill, just_record_alignment);
+ md_do_align (n, fill, len, just_record_alignment);
#endif
if (!fill)
{
@@ -1058,10 +1069,17 @@ do_align (n, fill)
{
fill = &zero;
}
+ len = 1;
}
+
/* Only make a frag if we HAVE to. . . */
if (n && !need_pass_2)
- frag_align (n, *fill);
+ {
+ if (len <= 1)
+ frag_align (n, *fill);
+ else
+ frag_align_pattern (n, fill, len);
+ }
#ifdef md_do_align
just_record_alignment:
@@ -1086,7 +1104,12 @@ s_align_bytes (arg)
stop = mri_comment_field (&stopc);
if (is_end_of_line[(unsigned char) *input_line_pointer])
- temp = arg; /* Default value from pseudo-op table */
+ {
+ if (arg < 0)
+ temp = 0;
+ else
+ temp = arg; /* Default value from pseudo-op table */
+ }
else
temp = get_absolute_expression ();
@@ -1108,12 +1131,36 @@ s_align_bytes (arg)
temp = i;
if (*input_line_pointer == ',')
{
+ offsetT fillval;
+ int len;
+
input_line_pointer++;
- temp_fill = get_absolute_expression ();
- do_align (temp, &temp_fill);
+ fillval = get_absolute_expression ();
+ if (arg >= 0)
+ len = 1;
+ else
+ len = - arg;
+ if (len <= 1)
+ {
+ temp_fill = fillval;
+ do_align (temp, &temp_fill, len);
+ }
+ else
+ {
+ char ab[16];
+
+ if (len > sizeof ab)
+ abort ();
+ md_number_to_chars (ab, fillval, len);
+ do_align (temp, ab, len);
+ }
}
else
- do_align (temp, (char *) 0);
+ {
+ if (arg < 0)
+ as_warn ("expected fill pattern missing");
+ do_align (temp, (char *) NULL, 0);
+ }
if (flag_mri)
mri_comment_end (stop, stopc);
@@ -1123,8 +1170,8 @@ s_align_bytes (arg)
/* For machines where ".align 4" means align to 2**4 boundary. */
void
-s_align_ptwo (ignore)
- int ignore;
+s_align_ptwo (arg)
+ int arg;
{
register int temp;
char temp_fill;
@@ -1145,12 +1192,36 @@ s_align_ptwo (ignore)
}
if (*input_line_pointer == ',')
{
+ offsetT fillval;
+ int len;
+
input_line_pointer++;
- temp_fill = get_absolute_expression ();
- do_align (temp, &temp_fill);
+ fillval = get_absolute_expression ();
+ if (arg >= 0)
+ len = 1;
+ else
+ len = - arg;
+ if (len <= 1)
+ {
+ temp_fill = fillval;
+ do_align (temp, &temp_fill, len);
+ }
+ else
+ {
+ char ab[16];
+
+ if (len > sizeof ab)
+ abort ();
+ md_number_to_chars (ab, fillval, len);
+ do_align (temp, ab, len);
+ }
}
else
- do_align (temp, (char *) 0);
+ {
+ if (arg < 0)
+ as_warn ("expected fill pattern missing");
+ do_align (temp, (char *) NULL, 0);
+ }
if (flag_mri)
mri_comment_end (stop, stopc);
@@ -1387,6 +1458,14 @@ s_app_file (appfile)
the buffer. Passing -2 to new_logical_line tells it to
account for it. */
new_logical_line (s, appfile ? -2 : -1);
+
+ /* In MRI mode, the preprocessor may have inserted an extraneous
+ backquote. */
+ if (flag_m68k_mri
+ && *input_line_pointer == '\''
+ && is_end_of_line[(unsigned char) input_line_pointer[1]])
+ ++input_line_pointer;
+
demand_empty_rest_of_line ();
#ifdef LISTING
if (listing)
@@ -1489,6 +1568,9 @@ s_fill (ignore)
register long temp_fill = 0;
char *p;
+#ifdef md_flush_pending_output
+ md_flush_pending_output ();
+#endif
temp_repeat = get_absolute_expression ();
if (*input_line_pointer == ',')
@@ -1609,6 +1691,83 @@ s_irp (irpc)
buffer_limit = input_scrub_next_buffer (&input_line_pointer);
}
+/* Handle the .linkonce pseudo-op. This tells the assembler to mark
+ the section to only be linked once. However, this is not supported
+ by most object file formats. This takes an optional argument,
+ which is what to do about duplicates. */
+
+void
+s_linkonce (ignore)
+ int ignore;
+{
+ enum linkonce_type type;
+
+ SKIP_WHITESPACE ();
+
+ type = LINKONCE_DISCARD;
+
+ if (! is_end_of_line[(unsigned char) *input_line_pointer])
+ {
+ char *s;
+ char c;
+
+ s = input_line_pointer;
+ c = get_symbol_end ();
+ if (strcasecmp (s, "discard") == 0)
+ type = LINKONCE_DISCARD;
+ else if (strcasecmp (s, "one_only") == 0)
+ type = LINKONCE_ONE_ONLY;
+ else if (strcasecmp (s, "same_size") == 0)
+ type = LINKONCE_SAME_SIZE;
+ else if (strcasecmp (s, "same_contents") == 0)
+ type = LINKONCE_SAME_CONTENTS;
+ else
+ as_warn ("unrecognized .linkonce type `%s'", s);
+
+ *input_line_pointer = c;
+ }
+
+#ifdef obj_handle_link_once
+ obj_handle_link_once (type);
+#else /* ! defined (obj_handle_link_once) */
+#ifdef BFD_ASSEMBLER
+ {
+ flagword flags;
+
+ if ((bfd_applicable_section_flags (stdoutput) & SEC_LINK_ONCE) == 0)
+ as_warn (".linkonce is not supported for this object file format");
+
+ flags = bfd_get_section_flags (stdoutput, now_seg);
+ flags |= SEC_LINK_ONCE;
+ switch (type)
+ {
+ default:
+ abort ();
+ case LINKONCE_DISCARD:
+ flags |= SEC_LINK_DUPLICATES_DISCARD;
+ break;
+ case LINKONCE_ONE_ONLY:
+ flags |= SEC_LINK_DUPLICATES_ONE_ONLY;
+ break;
+ case LINKONCE_SAME_SIZE:
+ flags |= SEC_LINK_DUPLICATES_SAME_SIZE;
+ break;
+ case LINKONCE_SAME_CONTENTS:
+ flags |= SEC_LINK_DUPLICATES_SAME_CONTENTS;
+ break;
+ }
+ if (! bfd_set_section_flags (stdoutput, now_seg, flags))
+ as_bad ("bfd_set_section_flags: %s",
+ bfd_errmsg (bfd_get_error ()));
+ }
+#else /* ! defined (BFD_ASSEMBLER) */
+ as_warn (".linkonce is not supported for this object file format");
+#endif /* ! defined (BFD_ASSEMBLER) */
+#endif /* ! defined (obj_handle_link_once) */
+
+ demand_empty_rest_of_line ();
+}
+
void
s_lcomm (needs_align)
/* 1 if this was a ".bss" directive, which may require a 3rd argument
@@ -1662,6 +1821,11 @@ s_lcomm (needs_align)
{
bss_seg = subseg_new (".sbss", 1);
seg_info (bss_seg)->bss = 1;
+#ifdef BFD_ASSEMBLER
+ if (! bfd_set_section_flags (stdoutput, bss_seg, SEC_ALLOC))
+ as_warn ("error setting flags for \".sbss\": %s",
+ bfd_errmsg (bfd_get_error ()));
+#endif
}
}
#endif
@@ -1761,6 +1925,10 @@ s_lcomm (needs_align)
S_SET_STORAGE_CLASS (symbolP, C_STAT);
}
#endif /* OBJ_COFF */
+
+#ifdef S_SET_SIZE
+ S_SET_SIZE (symbolP, temp);
+#endif
}
else
as_bad ("Ignoring attempt to re-define symbol `%s'.",
@@ -1839,6 +2007,9 @@ static int
get_line_sb (line)
sb *line;
{
+ if (input_line_pointer[-1] == '\n')
+ bump_line_counters ();
+
if (input_line_pointer >= buffer_limit)
{
buffer_limit = input_scrub_next_buffer (&input_line_pointer);
@@ -1851,11 +2022,8 @@ get_line_sb (line)
while (input_line_pointer < buffer_limit
&& is_end_of_line[(unsigned char) *input_line_pointer])
{
- if (*input_line_pointer == '\n')
- {
- bump_line_counters ();
- LISTING_NEWLINE ();
- }
+ if (input_line_pointer[-1] == '\n')
+ bump_line_counters ();
++input_line_pointer;
}
return 1;
@@ -1884,8 +2052,6 @@ s_macro (ignore)
if (line_label != NULL)
sb_add_string (&label, S_GET_NAME (line_label));
- demand_empty_rest_of_line ();
-
err = define_macro (0, &s, &label, get_line_sb);
if (err != NULL)
as_bad_where (file, line, "%s", err);
@@ -1912,6 +2078,37 @@ s_mexit (ignore)
buffer_limit = input_scrub_next_buffer (&input_line_pointer);
}
+/* Switch in and out of MRI mode. */
+
+void
+s_mri (ignore)
+ int ignore;
+{
+ int on, old_flag;
+
+ on = get_absolute_expression ();
+ old_flag = flag_mri;
+ if (on != 0)
+ {
+ flag_mri = 1;
+#ifdef TC_M68K
+ flag_m68k_mri = 1;
+#endif
+ }
+ else
+ {
+ flag_mri = 0;
+ flag_m68k_mri = 0;
+ }
+
+#ifdef MRI_MODE_CHANGE
+ if (on != old_flag)
+ MRI_MODE_CHANGE (on);
+#endif
+
+ demand_empty_rest_of_line ();
+}
+
/* Handle changing the location counter. */
static void
@@ -1953,17 +2150,15 @@ s_org (ignore)
expressionS exp;
register long temp_fill;
-#ifdef TC_M68K
/* The m68k MRI assembler has a different meaning for .org. It
means to create an absolute section at a given address. We can't
support that--use a linker script instead. */
- if (flag_mri)
+ if (flag_m68k_mri)
{
as_bad ("MRI style ORG pseudo-op not supported");
ignore_rest_of_line ();
return;
}
-#endif
/* Don't believe the documentation of BSD 4.2 AS. There is no such
thing as a sub-segment-relative origin. Any absolute origin is
@@ -1995,9 +2190,9 @@ s_org (ignore)
/* Handle parsing for the MRI SECT/SECTION pseudo-op. This should be
called by the obj-format routine which handles section changing
when in MRI mode. It will create a new section, and return it. It
- will set *TYPE to the section type: one of '\0' (unspecified), 'C'
- (code), 'D' (data), 'M' (mixed), or 'R' (romable). If
- BFD_ASSEMBLER is defined, the flags will be set in the section. */
+ will set *TYPE to the section type: one of 'C' (code), 'D' (data),
+ 'M' (mixed), or 'R' (romable). If BFD_ASSEMBLER is defined, the
+ flags will be set in the section. */
void
s_mri_sect (type)
@@ -2025,9 +2220,7 @@ s_mri_sect (type)
*input_line_pointer = '\0';
}
- name = strdup (name);
- if (name == NULL)
- as_fatal ("virtual memory exhausted");
+ name = xstrdup (name);
*input_line_pointer = c;
@@ -2042,7 +2235,7 @@ s_mri_sect (type)
record_alignment (seg, align);
}
- *type = '\0';
+ *type = 'C';
if (*input_line_pointer == ',')
{
c = *++input_line_pointer;
@@ -2059,11 +2252,11 @@ s_mri_sect (type)
flags = SEC_NO_FLAGS;
if (*type == 'C')
- flags = SEC_CODE;
- else if (*type == 'D')
- flags = SEC_DATA;
+ flags = SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE;
+ else if (*type == 'D' || *type == 'M')
+ flags = SEC_ALLOC | SEC_LOAD | SEC_DATA;
else if (*type == 'R')
- flags = SEC_ROM;
+ flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_READONLY | SEC_ROM;
if (flags != SEC_NO_FLAGS)
{
if (! bfd_set_section_flags (stdoutput, seg, flags))
@@ -2093,9 +2286,7 @@ s_mri_sect (type)
name = input_line_pointer;
c = get_symbol_end ();
- name = strdup (name);
- if (name == NULL)
- as_fatal ("virtual memory exhausted");
+ name = xstrdup (name);
*input_line_pointer = c;
@@ -2308,7 +2499,7 @@ s_space (mult)
int mult;
{
expressionS exp;
- long temp_fill;
+ expressionS val;
char *p = 0;
char *stop = NULL;
char stopc;
@@ -2320,72 +2511,94 @@ s_space (mult)
if (flag_mri)
stop = mri_comment_field (&stopc);
- /* Just like .fill, but temp_size = 1 */
expression (&exp);
- if (exp.X_op == O_constant)
- {
- long repeat;
- repeat = exp.X_add_number;
- if (mult)
- repeat *= mult;
- if (repeat <= 0)
- {
- if (! flag_mri || repeat < 0)
- as_warn (".space repeat count is %s, ignored",
- repeat ? "negative" : "zero");
- goto getout;
- }
+ SKIP_WHITESPACE ();
+ if (*input_line_pointer == ',')
+ {
+ ++input_line_pointer;
+ expression (&val);
+ }
+ else
+ {
+ val.X_op = O_constant;
+ val.X_add_number = 0;
+ }
- /* If we are in the absolute section, just bump the offset. */
- if (now_seg == absolute_section)
+ if (val.X_op != O_constant
+ || val.X_add_number < - 0x80
+ || val.X_add_number > 0xff
+ || (mult != 0 && mult != 1 && val.X_add_number != 0))
+ {
+ if (exp.X_op != O_constant)
+ as_bad ("Unsupported variable size or fill value");
+ else
{
- abs_section_offset += repeat;
- goto getout;
- }
+ offsetT i;
- /* If we are secretly in an MRI common section, then creating
- space just increases the size of the common symbol. */
- if (mri_common_symbol != NULL)
- {
- S_SET_VALUE (mri_common_symbol,
- S_GET_VALUE (mri_common_symbol) + repeat);
- goto getout;
+ if (mult == 0)
+ mult = 1;
+ for (i = 0; i < exp.X_add_number; i++)
+ emit_expr (&val, mult);
}
-
- if (!need_pass_2)
- p = frag_var (rs_fill, 1, 1, (relax_substateT) 0, (symbolS *) 0,
- repeat, (char *) 0);
}
else
{
- if (now_seg == absolute_section)
+ if (exp.X_op == O_constant)
{
- as_bad ("space allocation too complex in absolute section");
- subseg_set (text_section, 0);
+ long repeat;
+
+ repeat = exp.X_add_number;
+ if (mult)
+ repeat *= mult;
+ if (repeat <= 0)
+ {
+ if (! flag_mri || repeat < 0)
+ as_warn (".space repeat count is %s, ignored",
+ repeat ? "negative" : "zero");
+ goto getout;
+ }
+
+ /* If we are in the absolute section, just bump the offset. */
+ if (now_seg == absolute_section)
+ {
+ abs_section_offset += repeat;
+ goto getout;
+ }
+
+ /* If we are secretly in an MRI common section, then
+ creating space just increases the size of the common
+ symbol. */
+ if (mri_common_symbol != NULL)
+ {
+ S_SET_VALUE (mri_common_symbol,
+ S_GET_VALUE (mri_common_symbol) + repeat);
+ goto getout;
+ }
+
+ if (!need_pass_2)
+ p = frag_var (rs_fill, 1, 1, (relax_substateT) 0, (symbolS *) 0,
+ repeat, (char *) 0);
}
- if (mri_common_symbol != NULL)
+ else
{
- as_bad ("space allocation too complex in common section");
- mri_common_symbol = NULL;
+ if (now_seg == absolute_section)
+ {
+ as_bad ("space allocation too complex in absolute section");
+ subseg_set (text_section, 0);
+ }
+ if (mri_common_symbol != NULL)
+ {
+ as_bad ("space allocation too complex in common section");
+ mri_common_symbol = NULL;
+ }
+ if (!need_pass_2)
+ p = frag_var (rs_space, 1, 1, (relax_substateT) 0,
+ make_expr_symbol (&exp), 0L, (char *) 0);
}
- if (!need_pass_2)
- p = frag_var (rs_space, 1, 1, (relax_substateT) 0,
- make_expr_symbol (&exp), 0L, (char *) 0);
- }
- SKIP_WHITESPACE ();
- if (*input_line_pointer == ',')
- {
- input_line_pointer++;
- temp_fill = get_absolute_expression ();
- }
- else
- {
- temp_fill = 0;
- }
- if (p)
- {
- *p = temp_fill;
+
+ if (p)
+ *p = val.X_add_number;
}
getout:
@@ -2713,7 +2926,8 @@ cons_worker (nbytes, rva)
if (is_it_end_of_statement ())
{
- mri_comment_end (stop, stopc);
+ if (flag_mri)
+ mri_comment_end (stop, stopc);
demand_empty_rest_of_line ();
return;
}
@@ -2721,7 +2935,7 @@ cons_worker (nbytes, rva)
c = 0;
do
{
- if (flag_mri)
+ if (flag_m68k_mri)
parse_mri_cons (&exp, (unsigned int) nbytes);
else
TC_PARSE_CONS_EXPRESSION (&exp, (unsigned int) nbytes);
@@ -3541,6 +3755,11 @@ next_char_of_string ()
c = NOT_A_CHAR;
break;
+ case '\n':
+ as_warn ("Unterminated string: Newline inserted.");
+ bump_line_counters ();
+ break;
+
#ifndef NO_STRING_ESCAPES
case '\\':
switch (c = *input_line_pointer++)
@@ -3622,6 +3841,7 @@ next_char_of_string ()
/* To be compatible with BSD 4.2 as: give the luser a linefeed!! */
as_warn ("Unterminated string: Newline inserted.");
c = '\n';
+ bump_line_counters ();
break;
default:
@@ -3725,9 +3945,7 @@ demand_copy_C_string (len_pointer)
{
register int len;
- for (len = *len_pointer;
- len > 0;
- len--)
+ for (len = *len_pointer; len > 0; len--)
{
if (*s == 0)
{
@@ -3738,7 +3956,7 @@ demand_copy_C_string (len_pointer)
}
}
}
- return (s);
+ return s;
}
/*
@@ -3848,7 +4066,7 @@ s_include (arg)
FILE *try;
char *path;
- if (! flag_mri)
+ if (! flag_m68k_mri)
filename = demand_copy_string (&i);
else
{
@@ -3926,4 +4144,11 @@ s_ignore (arg)
}
+void
+read_print_statistics (file)
+ FILE *file;
+{
+ hash_print_statistics (file, "pseudo-op table", po_hash);
+}
+
/* end of read.c */
diff --git a/gnu/usr.bin/binutils/gas/read.h b/gnu/usr.bin/binutils/gas/read.h
index 3e07f6552bb..2798347ec99 100644
--- a/gnu/usr.bin/binutils/gas/read.h
+++ b/gnu/usr.bin/binutils/gas/read.h
@@ -69,6 +69,16 @@ extern symbolS *line_label;
/* This is used to support MRI common sections. */
extern symbolS *mri_common_symbol;
+/* Possible arguments to .linkonce. */
+enum linkonce_type
+{
+ LINKONCE_UNSET = 0,
+ LINKONCE_DISCARD,
+ LINKONCE_ONE_ONLY,
+ LINKONCE_SAME_SIZE,
+ LINKONCE_SAME_CONTENTS
+};
+
unsigned int get_stab_string_offset PARAMS ((const char *string,
const char *stabstr_secname));
@@ -113,9 +123,11 @@ void s_ignore PARAMS ((int arg));
void s_include PARAMS ((int arg));
void s_irp PARAMS ((int arg));
void s_lcomm PARAMS ((int needs_align));
+void s_linkonce PARAMS ((int));
void s_lsym PARAMS ((int));
void s_macro PARAMS ((int));
void s_mexit PARAMS ((int));
+void s_mri PARAMS ((int));
void s_mri_common PARAMS ((int));
void s_org PARAMS ((int));
void s_print PARAMS ((int));
@@ -130,4 +142,6 @@ void stringer PARAMS ((int append_zero));
void s_xstab PARAMS ((int what));
void s_rva PARAMS ((int));
+void read_print_statistics PARAMS ((FILE *));
+
/* end of read.h */
diff --git a/gnu/usr.bin/binutils/gas/stabs.c b/gnu/usr.bin/binutils/gas/stabs.c
index 4335b39f4dd..b72a8477045 100644
--- a/gnu/usr.bin/binutils/gas/stabs.c
+++ b/gnu/usr.bin/binutils/gas/stabs.c
@@ -18,6 +18,7 @@ License along with GAS; see the file COPYING. If not, write
to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "as.h"
+#include "libiberty.h"
#include "obstack.h"
#include "subsegs.h"
@@ -95,12 +96,7 @@ get_stab_string_offset (string, stabstr_secname)
#ifdef BFD_ASSEMBLER
bfd_set_section_flags (stdoutput, seg, SEC_READONLY | SEC_DEBUGGING);
if (seg->name == stabstr_secname)
- {
- char *newsecname = strdup (stabstr_secname);
- if (newsecname == 0)
- as_fatal ("out of memory");
- seg->name = newsecname;
- }
+ seg->name = xstrdup (stabstr_secname);
#endif
}
@@ -228,6 +224,42 @@ s_stab_generic (what, stab_secname, stabstr_secname)
SKIP_WHITESPACE ();
}
+#ifdef TC_PPC
+#ifdef OBJ_ELF
+ /* Solaris on PowerPC has decided that .stabd can take 4 arguments, so if we were
+ given 4 arguments, make it a .stabn */
+ else if (what == 'd')
+ {
+ char *save_location = input_line_pointer;
+
+ SKIP_WHITESPACE ();
+ if (*input_line_pointer == ',')
+ {
+ input_line_pointer++;
+ what = 'n';
+ }
+ else
+ input_line_pointer = save_location;
+ }
+#endif /* OBJ_ELF */
+#endif /* TC_PPC */
+
+#ifndef NO_LISTING
+ if (listing)
+ {
+ switch (type)
+ {
+ case N_SLINE:
+ listing_source_line ((unsigned int) desc);
+ break;
+ case N_SO:
+ case N_SOL:
+ listing_source_file (string);
+ break;
+ }
+ }
+#endif /* ! NO_LISTING */
+
/* We have now gathered the type, other, and desc information. For
.stabs or .stabn, input_line_pointer is now pointing at the
value. */
@@ -259,9 +291,8 @@ s_stab_generic (what, stab_secname, stabstr_secname)
seg = subseg_new (stab_secname, 0);
if (cached_secname)
free (cached_secname);
- cached_secname = strdup (stab_secname);
- if (cached_secname)
- cached_sec = seg;
+ cached_secname = xstrdup (stab_secname);
+ cached_sec = seg;
}
if (! seg_info (seg)->hadone)
@@ -277,6 +308,11 @@ s_stab_generic (what, stab_secname, stabstr_secname)
}
stroff = get_stab_string_offset (string, stabstr_secname);
+ if (what == 's')
+ {
+ /* release the string */
+ obstack_free (&notes, string);
+ }
/* At least for now, stabs in a special stab section are always
output as 12 byte blocks of information. */
@@ -310,7 +346,7 @@ s_stab_generic (what, stab_secname, stabstr_secname)
}
#ifdef OBJ_PROCESS_STAB
- OBJ_PROCESS_STAB (seg, what, string + stroff, type, other, desc);
+ OBJ_PROCESS_STAB (seg, what, string, type, other, desc);
#endif
subseg_set (saved_seg, saved_subseg);
@@ -324,22 +360,6 @@ s_stab_generic (what, stab_secname, stabstr_secname)
#endif
}
-#ifndef NO_LISTING
- if (listing)
- {
- switch (type)
- {
- case N_SLINE:
- listing_source_line ((unsigned int) desc);
- break;
- case N_SO:
- case N_SOL:
- listing_source_file (string);
- break;
- }
- }
-#endif /* ! NO_LISTING */
-
demand_empty_rest_of_line ();
}
diff --git a/gnu/usr.bin/binutils/gas/subsegs.c b/gnu/usr.bin/binutils/gas/subsegs.c
index c0c701dcf14..eb8476f0101 100644
--- a/gnu/usr.bin/binutils/gas/subsegs.c
+++ b/gnu/usr.bin/binutils/gas/subsegs.c
@@ -45,6 +45,9 @@ char const *const seg_name[] =
"absolute",
#ifdef MANY_SEGMENTS
"e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9",
+ "e10", "e11", "e12", "e13", "e14", "e15", "e16", "e17", "e18", "e19",
+ "e20", "e21", "e22", "e23", "e24", "e25", "e26", "e27", "e28", "e29",
+ "e30", "e31", "e32", "e33", "e34", "e35", "e36", "e37", "e38", "e39",
#else
"text",
"data",
@@ -513,32 +516,81 @@ section_symbol (sec)
abort ();
if (seginfo->sym)
return seginfo->sym;
- s = symbol_find (sec->name);
- if (!s)
- {
+
#ifndef EMIT_SECTION_SYMBOLS
#define EMIT_SECTION_SYMBOLS 1
#endif
- if (! EMIT_SECTION_SYMBOLS
+ if (! EMIT_SECTION_SYMBOLS
#ifdef BFD_ASSEMBLER
- && symbol_table_frozen
+ && symbol_table_frozen
#endif
- )
- /* Here we know it won't be going into the symbol table. */
- s = symbol_create (sec->name, sec, 0, &zero_address_frag);
- else
- s = symbol_new (sec->name, sec, 0, &zero_address_frag);
- S_CLEAR_EXTERNAL (s);
+ )
+ /* Here we know it won't be going into the symbol table. */
+ s = symbol_create (sec->name, sec, 0, &zero_address_frag);
+ else
+ s = symbol_new (sec->name, sec, 0, &zero_address_frag);
+ S_CLEAR_EXTERNAL (s);
+
+ /* Use the BFD section symbol, if possible. */
+ if (obj_sec_sym_ok_for_reloc (sec))
+ s->bsym = sec->symbol;
- /* Use the BFD section symbol, if possible. */
- if (obj_sec_sym_ok_for_reloc (sec))
- s->bsym = sec->symbol;
- }
seginfo->sym = s;
return s;
}
#endif /* BFD_ASSEMBLER */
+void
+subsegs_print_statistics (file)
+ FILE *file;
+{
+ frchainS *frchp;
+ fprintf (file, "frag chains:\n");
+ for (frchp = frchain_root; frchp; frchp = frchp->frch_next)
+ {
+ int count = 0;
+ fragS *fragp;
+
+ /* If frch_subseg is non-zero, it's probably been chained onto
+ the end of a previous subsection. Don't count it again. */
+ if (frchp->frch_subseg != 0)
+ continue;
+
+ /* Skip gas-internal sections. */
+ if (segment_name (frchp->frch_seg)[0] == '*')
+ continue;
+
+ for (fragp = frchp->frch_root; fragp; fragp = fragp->fr_next)
+ {
+#if 0
+ switch (fragp->fr_type)
+ {
+ case rs_fill:
+ fprintf (file, "f"); break;
+ case rs_align:
+ fprintf (file, "a"); break;
+ case rs_align_code:
+ fprintf (file, "c"); break;
+ case rs_org:
+ fprintf (file, "o"); break;
+ case rs_machine_dependent:
+ fprintf (file, "m"); break;
+ case rs_space:
+ fprintf (file, "s"); break;
+ case 0:
+ fprintf (file, "0"); break;
+ default:
+ fprintf (file, "?"); break;
+ }
+#endif
+ count++;
+ }
+ fprintf (file, "\n");
+ fprintf (file, "\t%p %-10s\t%10d frags\n", frchp,
+ segment_name (frchp->frch_seg), count);
+ }
+}
+
/* end of subsegs.c */
diff --git a/gnu/usr.bin/binutils/gas/subsegs.h b/gnu/usr.bin/binutils/gas/subsegs.h
index b568955a146..62186c63e87 100644
--- a/gnu/usr.bin/binutils/gas/subsegs.h
+++ b/gnu/usr.bin/binutils/gas/subsegs.h
@@ -67,14 +67,14 @@ extern frchainS *frchain_now;
typedef struct
{
frchainS *frchainP;
- int hadone : 1;
+ unsigned int hadone : 1;
/* This field is set if this is a .bss section which does not really
have any contents. Once upon a time a .bss section did not have
any frags, but that is no longer true. This field prevent the
SEC_HAS_CONTENTS flag from being set for the section even if
there are frags. */
- int bss : 1;
+ unsigned int bss : 1;
int user_stuff;
@@ -85,7 +85,10 @@ typedef struct
#if defined (MANY_SEGMENTS) && !defined (BFD_ASSEMBLER)
struct internal_scnhdr scnhdr;
+ enum linkonce_type linkonce;
+ const char *name;
#endif
+
symbolS *dot;
struct lineno_list *lineno_list_head;
@@ -112,6 +115,10 @@ typedef struct
#ifdef NEED_LITERAL_POOL
unsigned long literal_pool_size;
#endif
+
+#ifdef TC_SEGMENT_INFO_TYPE
+ TC_SEGMENT_INFO_TYPE tc_segment_info_data;
+#endif
} segment_info_type;
#ifdef BFD_ASSEMBLER
diff --git a/gnu/usr.bin/binutils/gas/symbols.c b/gnu/usr.bin/binutils/gas/symbols.c
index b874eb5e0c9..5397dd84867 100644
--- a/gnu/usr.bin/binutils/gas/symbols.c
+++ b/gnu/usr.bin/binutils/gas/symbols.c
@@ -1,5 +1,5 @@
/* symbols.c -symbol table-
- Copyright (C) 1987, 1990, 1991, 1992, 1993, 1994
+ Copyright (C) 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -129,7 +129,8 @@ symbol_create (name, segment, valu, frag)
#ifdef BFD_ASSEMBLER
symbolP->bsym = bfd_make_empty_symbol (stdoutput);
- assert (symbolP->bsym != 0);
+ if (symbolP->bsym == NULL)
+ as_perror ("%s", "bfd_make_empty_symbol");
symbolP->bsym->udata.p = (PTR) symbolP;
#endif
S_SET_NAME (symbolP, preserved_copy_of_name);
@@ -172,7 +173,7 @@ colon (sym_name) /* just seen "x:" - rattle symbols & frags */
/* Sun local labels go out of scope whenever a non-local symbol is
defined. */
- if (LOCAL_LABELS_DOLLAR && *sym_name != 'L')
+ if (LOCAL_LABELS_DOLLAR && ! LOCAL_LABEL (sym_name))
dollar_label_clear ();
#ifndef WORKING_DOT_WORD
@@ -664,33 +665,37 @@ resolve_symbol_value (symp)
break;
}
-#if 0 /* I thought this was needed for some of the i386-svr4 PIC
- support, but it appears I was wrong, and it breaks rs6000
- support. */
- if (S_GET_SEGMENT (symp->sy_value.X_add_symbol) != undefined_section
- && S_GET_SEGMENT (symp->sy_value.X_add_symbol) != expr_section)
-#endif
- {
- if (symp->sy_value.X_add_number == 0)
- copy_symbol_attributes (symp, symp->sy_value.X_add_symbol);
-
- S_SET_VALUE (symp,
- (symp->sy_value.X_add_number
- + symp->sy_frag->fr_address
- + S_GET_VALUE (symp->sy_value.X_add_symbol)));
- if (S_GET_SEGMENT (symp) == expr_section
- || S_GET_SEGMENT (symp) == undefined_section)
- S_SET_SEGMENT (symp,
- S_GET_SEGMENT (symp->sy_value.X_add_symbol));
- }
+ if (symp->sy_value.X_add_number == 0)
+ copy_symbol_attributes (symp, symp->sy_value.X_add_symbol);
+
+ S_SET_VALUE (symp,
+ (symp->sy_value.X_add_number
+ + symp->sy_frag->fr_address
+ + S_GET_VALUE (symp->sy_value.X_add_symbol)));
+ if (S_GET_SEGMENT (symp) == expr_section
+ || S_GET_SEGMENT (symp) == undefined_section)
+ S_SET_SEGMENT (symp,
+ S_GET_SEGMENT (symp->sy_value.X_add_symbol));
+
+ /* If we have equated this symbol to an undefined symbol, we
+ keep X_op set to O_symbol. This permits the routine
+ which writes out relocation to detect this case, and
+ convert the relocation to be against the symbol to which
+ this symbol is equated. */
+ if (! S_IS_DEFINED (symp) || S_IS_COMMON (symp))
+ symp->sy_value.X_op = O_symbol;
+
resolved = symp->sy_value.X_add_symbol->sy_resolved;
break;
case O_uminus:
case O_bit_not:
+ case O_logical_not:
resolve_symbol_value (symp->sy_value.X_add_symbol);
if (symp->sy_value.X_op == O_uminus)
val = - S_GET_VALUE (symp->sy_value.X_add_symbol);
+ else if (symp->sy_value.X_op == O_logical_not)
+ val = ! S_GET_VALUE (symp->sy_value.X_add_symbol);
else
val = ~ S_GET_VALUE (symp->sy_value.X_add_symbol);
S_SET_VALUE (symp,
@@ -1194,7 +1199,22 @@ S_GET_VALUE (s)
if (!s->sy_resolved && !s->sy_resolving && s->sy_value.X_op != O_constant)
resolve_symbol_value (s);
if (s->sy_value.X_op != O_constant)
- as_bad ("Attempt to get value of unresolved symbol %s", S_GET_NAME (s));
+ {
+ static symbolS *recur;
+
+ /* FIXME: In non BFD assemblers, S_IS_DEFINED and S_IS_COMMON
+ may call S_GET_VALUE. We use a static symbol to avoid the
+ immediate recursion. */
+ if (recur == s)
+ return (valueT) s->sy_value.X_add_number;
+ recur = s;
+ if (! s->sy_resolved
+ || s->sy_value.X_op != O_symbol
+ || (S_IS_DEFINED (s) && ! S_IS_COMMON (s)))
+ as_bad ("Attempt to get value of unresolved symbol %s",
+ S_GET_NAME (s));
+ recur = NULL;
+ }
return (valueT) s->sy_value.X_add_number;
}
@@ -1591,4 +1611,11 @@ print_expr (exp)
fprintf (stderr, "\n");
}
+void
+symbol_print_statistics (file)
+ FILE *file;
+{
+ hash_print_statistics (file, "symbol table", sy_hash);
+}
+
/* end of symbols.c */
diff --git a/gnu/usr.bin/binutils/gas/symbols.h b/gnu/usr.bin/binutils/gas/symbols.h
index 30792d511ec..af01d4403cc 100644
--- a/gnu/usr.bin/binutils/gas/symbols.h
+++ b/gnu/usr.bin/binutils/gas/symbols.h
@@ -45,6 +45,7 @@ symbolS *symbol_create PARAMS ((CONST char *name, segT segment, valueT value,
symbolS *colon PARAMS ((const char *sym_name));
void local_colon PARAMS ((int n));
void symbol_begin PARAMS ((void));
+void symbol_print_statistics PARAMS ((FILE *));
void symbol_table_insert PARAMS ((symbolS * symbolP));
void resolve_symbol_value PARAMS ((symbolS *));
diff --git a/gnu/usr.bin/binutils/gas/testsuite/ChangeLog b/gnu/usr.bin/binutils/gas/testsuite/ChangeLog
index 49dcd6cb60b..995269af53e 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/ChangeLog
+++ b/gnu/usr.bin/binutils/gas/testsuite/ChangeLog
@@ -1,3 +1,123 @@
+Thu Jun 6 12:30:05 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * gas/m68k/all.exp: Pass -m68020 when assembling the disperr.s
+ test.
+
+Fri May 31 10:11:13 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gas/h8300/h8300.exp: Fix add.l test for H8/300H.
+
+Wed May 29 16:35:43 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * gas/mips/jal-xgot.d: Correct for 64 bit output.
+
+Thu Apr 25 19:31:59 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * gas/sparc/sparc.exp: Only run sparclet tests if sparclet.
+
+Wed Apr 24 17:06:18 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * gas/m68k/op68000.d: Add statements now caught by gas.
+
+Mon Apr 22 16:45:12 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * gas/sparc/splet.[ds]: New tests for sparclet extensions.
+ * gas/sparc/sparc.exp: Run them.
+
+Mon Apr 15 17:25:18 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * gas/mips/la.d: Updated for April 5 MIPS assembler changes.
+ * gas/mips/lb.d, gas/mips/ld.d, gas/mips/sb.d: Likewise.
+ * gas/mips/uld.d, gas/mips/ulh.d, gas/mips/ulw.d: Likewise.
+ * gas/mips/usd.d, gas/mips/ush.d, gas/mips/usw.d: Likewise.
+
+Wed Apr 10 14:27:51 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gas/h8300/mov32bug.s: New test.
+ * gas/h8300/h8300.exp: Run it.
+
+Fri Apr 5 10:13:28 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gas/h8300/{addsubh.s,bitops1h.s,bitops2h.s}: New h8300h tests.
+ * gas/h8300/{bitops3h.s,bitops4h.s,branchesh.s}: New h8300h tests.
+ * gas/h8300/{cbranchh.s,compareh.s,decimalh.s}: New h8300h tests.
+ * gas/h8300/{divmulh.s,incdech.s,logicalh.s}: New h8300h tests.
+ * gas/h8300/{misch.s,movbh.s,movwh.s}: New h8300h tests.
+ * gas/h8300/{pushpoph.s,rotshifth.s}: New h8300h tests.
+ * gas/h8300/h8300.exp: Run them.
+
+ * gas/h8300/{movb.s,movw.s}: Correct predecrement syntax.
+
+ * gas/h8300/h8300.exp: Fix typos in bitops4 and movb tests.
+
+ * gas/h8300/{addsub.s,bitops1.s,bitops2.s}: New h8300 tests.
+ * gas/h8300/{bitops3.s,bitops4.s,branches.s}: New h8300 tests.
+ * gas/h8300/{cbranch.s,compare.s,decimal.s}: New h8300 tests.
+ * gas/h8300/{divmul.s,incdec.s,logical.s}: New h8300 tests.
+ * gas/h8300/{misc.s,movb.s,movw.s}: New h8300 tests.
+ * gas/h8300/{pushpop.s,rotshift.s}: New h8300 tests.
+ * gas/h8300/h8300.exp: Run them.
+
+Fri Mar 15 17:16:24 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * gas/sparc/synth.d: Don't require sparc in the file format, since
+ it won't be there on SunOS.
+
+Thu Mar 7 14:51:23 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * gas/sparc/synth.[ds]: New testcase.
+ * gas/sparc/sparc.exp: Run it.
+
+Fri Mar 1 12:01:48 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gas/all/gas.exp: xfail difference of two undefined symbols
+ and difference of forward references for the h8300.
+
+Thu Feb 22 16:40:31 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * gas/mips/lb-xgot.d: Correct.
+
+Mon Feb 19 02:43:36 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * gas/sparc/{asi,membar,prefetch,rdpr,synth64,wrpr}.d: Pass -Av9
+ to gas.
+ * gas/sparc/addend.exp: Execute for any sparc cpu.
+ * gas/sparc/{mismatch.exp,mism-1.s}: New test.
+
+Wed Feb 14 13:49:59 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * gas/mips/jal-xgot.d, gas/mips/la-xgot.d: New tests.
+ * gas/mips/lb-xgot.d, gas/mips/ld-xgot.d: New tests.
+ * gas/mips/lif-xgot.d, gas/mips/ulh-xgot.d: New tests.
+ * gas/mips/mips.exp: Run new tests if svr4pic.
+
+Sat Jan 27 13:27:45 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * lib/gas-dg.exp (gas-dg-test): Delete default_flags and libs args.
+
+Fri Jan 26 14:24:01 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gas/hppa/unsorted/unsorted.exp: Update for objdump changes.
+
+Wed Jan 10 12:40:31 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * gas/mips/*.d: Update for changes to disassembler.
+
+Wed Jan 3 22:59:53 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * gas/mips/ulh-svr4pic.d: Update for tc-mips.c load_address
+ change.
+
+Fri Nov 17 10:32:25 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * gas/mri/immconst.d: New test.
+ * gas/mri/mri.exp: Run it.
+ * gas/mri/constants.s: Test immediate constants.
+ * gas/mri/constants.d: Corresponding change.
+
+ * gas/m68k/link.s: Add nop to pad to eight byte boundary.
+ * gas/m68k/link.d: Corresponding change.
+
Sun Nov 12 21:28:11 1995 Jeffrey A Law (law@cygnus.com)
* gas/hppa/unsorted/brlenbug.s: New test.
@@ -47,6 +167,10 @@ Mon Sep 25 12:31:46 1995 Ian Lance Taylor <ian@cygnus.com>
* gas/mri/mri.exp: Add setup_xfail for arm*-*-* for constants
test.
+Thu Sep 21 01:26:08 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gas/sh/fp.s (fmac): Update for new assembly syntax.
+
Mon Sep 18 14:04:34 1995 Ian Lance Taylor <ian@cygnus.com>
* lib/gas-defs.exp (gas_run): Call prune_system_crud.
@@ -149,6 +273,13 @@ Mon Aug 14 16:03:07 1995 Ian Lance Taylor <ian@cygnus.com>
* gasp/gasp.exp: Run them. Also, clean up the test names used in
pass and fail.
+start-sanitize-sh3e
+Sun Aug 13 00:39:24 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gas/sh/basic.exp: Update now that we know the right
+ bit patters for the new sts instructions.
+
+end-sanitize-sh3e
Thu Aug 10 00:46:21 1995 Ian Lance Taylor <ian@cygnus.com>
* gas/mri/char.d: Fix for little endian machines.
@@ -190,6 +321,12 @@ Mon Aug 7 22:39:28 1995 Ian Lance Taylor <ian@cygnus.com>
* gas/m68k/all.exp: Run new tests. Run schwab test for
m68k-*-coff*.
+start-sanitize-sh3e
+Mon Aug 7 03:01:32 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gas/sh/*: New tests for the hitachi-sh.
+
+end-sanitize-sh3e
Tue Aug 1 18:02:47 1995 Ian Lance Taylor <ian@cygnus.com>
* gas/mri/*: New tests for MRI mode.
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/all/gas.exp b/gnu/usr.bin/binutils/gas/testsuite/gas/all/gas.exp
index a5035df9e9d..26abb8ee6bd 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/all/gas.exp
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/all/gas.exp
@@ -23,6 +23,8 @@ gas_test "float.s" "" "" "simple FP constants"
# This test is meaningless for the PA; the difference of two undefined
# symbols is something that is (and must be) supported on the PA.
if ![istarget hppa*-*-*] then {
+ # the h8300 fails because we skip all the logic in fixup_segment
+ setup_xfail "h8300*-*-*"
gas_test_error "diff1.s" "" "difference of two undefined symbols"
}
@@ -80,6 +82,8 @@ proc do_930509a {} {
# This test is meaningless for the PA; the difference of two symbols
# must not be resolved by the assembler.
if ![istarget hppa*-*-*] then {
+ # the h8300 fails because we skip all the logic in fixup_segment
+ setup_xfail "h8300*-*-*"
do_930509a
}
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsub.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsub.s
new file mode 100644
index 00000000000..802b0d7621f
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsub.s
@@ -0,0 +1,16 @@
+ .text
+h8300_add_sub:
+ add.b #16,r1l
+ add.b r1h,r1l
+ add.w r1,r2
+ adds #1,r4
+ adds #2,r5
+ addx r0l,r1l
+ addx #16,r2h
+ sub.b r0l,r1l
+ sub.w r0,r1
+ subs #1,r4
+ subs #2,r5
+ subx r0l,r1l
+ subx #16,r2h
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsubh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsubh.s
new file mode 100644
index 00000000000..1f885d3fc5f
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/addsubh.s
@@ -0,0 +1,25 @@
+ .h8300h
+ .text
+h8300h_add_sub:
+ add.b #16,r1l
+ add.b r1h,r1l
+ add.w #32,r1
+ add.w r1,r2
+ add.l #64,er1
+ add.l er1,er2
+ adds #1,er4
+ adds #2,er5
+ adds #4,er6
+ addx r0l,r1l
+ addx #16,r2h
+ sub.b r0l,r1l
+ sub.w #16,r1
+ sub.w r0,r1
+ sub.l #64,er1
+ sub.l er1,er2
+ subs #1,er4
+ subs #2,er5
+ subs #4,er6
+ subx r0l,r1l
+ subx #16,r2h
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1.s
new file mode 100644
index 00000000000..3c107a1b822
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1.s
@@ -0,0 +1,18 @@
+ .text
+h8300_bit_ops_1:
+ band #0,r0l
+ band #0,@r0
+ band #0,@64:8
+ bclr #0,r0l
+ bclr #0,@r0
+ bclr #0,@64:8
+ bclr r1l,r0l
+ bclr r1l,@r0
+ bclr r1l,@64:8
+ biand #0,r0l
+ biand #0,@r0
+ biand #0,@64:8
+ bild #0,r0l
+ bild #0,@r0
+ bild #0,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1h.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1h.s
new file mode 100644
index 00000000000..4139a590e8f
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops1h.s
@@ -0,0 +1,19 @@
+ .h8300h
+ .text
+h8300h_bit_ops_1:
+ band #0,r0l
+ band #0,@er0
+ band #0,@64:8
+ bclr #0,r0l
+ bclr #0,@er0
+ bclr #0,@64:8
+ bclr r1l,r0l
+ bclr r1l,@er0
+ bclr r1l,@64:8
+ biand #0,r0l
+ biand #0,@er0
+ biand #0,@64:8
+ bild #0,r0l
+ bild #0,@er0
+ bild #0,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2.s
new file mode 100644
index 00000000000..3996e5a469f
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2.s
@@ -0,0 +1,15 @@
+ .text
+h8300_bit_ops_2:
+ bior #0,r0l
+ bior #0,@r0
+ bior #0,@64:8
+ bist #0,r0l
+ bist #0,@r0
+ bist #0,@64:8
+ bixor #0,r0l
+ bixor #0,@r0
+ bixor #0,@64:8
+ bld #0,r0l
+ bld #0,@r0
+ bld #0,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2h.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2h.s
new file mode 100644
index 00000000000..22be74e4b78
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops2h.s
@@ -0,0 +1,16 @@
+ .h8300h
+ .text
+h8300h_bit_ops_2:
+ bior #0,r0l
+ bior #0,@er0
+ bior #0,@64:8
+ bist #0,r0l
+ bist #0,@er0
+ bist #0,@64:8
+ bixor #0,r0l
+ bixor #0,@er0
+ bixor #0,@64:8
+ bld #0,r0l
+ bld #0,@er0
+ bld #0,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3.s
new file mode 100644
index 00000000000..78c9bfb482e
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3.s
@@ -0,0 +1,15 @@
+ .text
+h8300_bit_ops_3:
+ bnot #0,r0l
+ bnot #0,@r0
+ bnot #0,@64:8
+ bnot r1l,r0l
+ bnot r1l,@r0
+ bnot r1l,@64:8
+ bset #0,r0l
+ bset #0,@r0
+ bset #0,@64:8
+ bset r1l,r0l
+ bset r1l,@r0
+ bset r1l,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3h.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3h.s
new file mode 100644
index 00000000000..fdeda609080
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops3h.s
@@ -0,0 +1,16 @@
+ .h8300h
+ .text
+h8300h_bit_ops_3:
+ bnot #0,r0l
+ bnot #0,@er0
+ bnot #0,@64:8
+ bnot r1l,r0l
+ bnot r1l,@er0
+ bnot r1l,@64:8
+ bset #0,r0l
+ bset #0,@er0
+ bset #0,@64:8
+ bset r1l,r0l
+ bset r1l,@er0
+ bset r1l,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4.s
new file mode 100644
index 00000000000..f7e66d8b251
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4.s
@@ -0,0 +1,18 @@
+ .text
+h8300_bit_ops_4:
+ bor #0,r0l
+ bor #0,@r0
+ bor #0,@64:8
+ bst #0,r0l
+ bst #0,@r0
+ bst #0,@64:8
+ btst #0,r0l
+ btst #0,@r0
+ btst #0,@64:8
+ btst r1l,r0l
+ btst r1l,@r0
+ btst r1l,@64:8
+ bxor #0,r0l
+ bxor #0,@r0
+ bxor #0,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4h.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4h.s
new file mode 100644
index 00000000000..ed35e17dcbd
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/bitops4h.s
@@ -0,0 +1,19 @@
+ .h8300h
+ .text
+h8300h_bit_ops_4:
+ bor #0,r0l
+ bor #0,@er0
+ bor #0,@64:8
+ bst #0,r0l
+ bst #0,@er0
+ bst #0,@64:8
+ btst #0,r0l
+ btst #0,@er0
+ btst #0,@64:8
+ btst r1l,r0l
+ btst r1l,@er0
+ btst r1l,@64:8
+ bxor #0,r0l
+ bxor #0,@er0
+ bxor #0,@64:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branches.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branches.s
new file mode 100644
index 00000000000..25806153c42
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branches.s
@@ -0,0 +1,10 @@
+ .text
+h8300_branches:
+ bsr h8300_branches
+ jmp h8300_branches
+ jmp @r0
+ jmp @@16:8
+ jsr h8300_branches
+ jsr @r0
+ jsr @@16:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branchesh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branchesh.s
new file mode 100644
index 00000000000..7cbc62f3e2b
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/branchesh.s
@@ -0,0 +1,12 @@
+ .h8300h
+ .text
+h8300h_branches:
+ bsr h8300h_branches:8
+ bsr h8300h_branches:16
+ jmp h8300h_branches
+ jmp @er0
+ jmp @@16:8
+ jsr h8300h_branches
+ jsr @er0
+ jsr @@16:8
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranch.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranch.s
new file mode 100644
index 00000000000..ae3d53ed88c
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranch.s
@@ -0,0 +1,23 @@
+ .text
+h8300_cbranch:
+ bra h8300_cbranch
+ bt h8300_cbranch
+ brn h8300_cbranch
+ bf h8300_cbranch
+ bhi h8300_cbranch
+ bls h8300_cbranch
+ bcc h8300_cbranch
+ bhs h8300_cbranch
+ bcs h8300_cbranch
+ blo h8300_cbranch
+ bne h8300_cbranch
+ beq h8300_cbranch
+ bvc h8300_cbranch
+ bvs h8300_cbranch
+ bpl h8300_cbranch
+ bmi h8300_cbranch
+ bge h8300_cbranch
+ blt h8300_cbranch
+ bgt h8300_cbranch
+ ble h8300_cbranch
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranchh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranchh.s
new file mode 100644
index 00000000000..3582bb162ce
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/cbranchh.s
@@ -0,0 +1,43 @@
+ .text
+h8300h_cbranch:
+ bra h8300h_cbranch:8
+ bt h8300h_cbranch:8
+ brn h8300h_cbranch:8
+ bf h8300h_cbranch:8
+ bhi h8300h_cbranch:8
+ bls h8300h_cbranch:8
+ bcc h8300h_cbranch:8
+ bhs h8300h_cbranch:8
+ bcs h8300h_cbranch:8
+ blo h8300h_cbranch:8
+ bne h8300h_cbranch:8
+ beq h8300h_cbranch:8
+ bvc h8300h_cbranch:8
+ bvs h8300h_cbranch:8
+ bpl h8300h_cbranch:8
+ bmi h8300h_cbranch:8
+ bge h8300h_cbranch:8
+ blt h8300h_cbranch:8
+ bgt h8300h_cbranch:8
+ ble h8300h_cbranch:8
+ bra h8300h_cbranch:16
+ bt h8300h_cbranch:16
+ brn h8300h_cbranch:16
+ bf h8300h_cbranch:16
+ bhi h8300h_cbranch:16
+ bls h8300h_cbranch:16
+ bcc h8300h_cbranch:16
+ bhs h8300h_cbranch:16
+ bcs h8300h_cbranch:16
+ blo h8300h_cbranch:16
+ bne h8300h_cbranch:16
+ beq h8300h_cbranch:16
+ bvc h8300h_cbranch:16
+ bvs h8300h_cbranch:16
+ bpl h8300h_cbranch:16
+ bmi h8300h_cbranch:16
+ bge h8300h_cbranch:16
+ blt h8300h_cbranch:16
+ bgt h8300h_cbranch:16
+ ble h8300h_cbranch:16
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compare.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compare.s
new file mode 100644
index 00000000000..60c1a417d76
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compare.s
@@ -0,0 +1,6 @@
+ .text
+h8300_cmp:
+ cmp.b #0,r0l
+ cmp.b r0h,r0l
+ cmp.w r0,r1
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compareh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compareh.s
new file mode 100644
index 00000000000..c81e88e0c20
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/compareh.s
@@ -0,0 +1,10 @@
+ .h8300h
+ .text
+h8300h_cmp:
+ cmp.b #0,r0l
+ cmp.b r0h,r0l
+ cmp.w #32,r0
+ cmp.w r0,r1
+ cmp.l #64,er0
+ cmp.l er0,er1
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimal.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimal.s
new file mode 100644
index 00000000000..8d4c0a0da9d
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimal.s
@@ -0,0 +1,5 @@
+ .text
+h8300_decimal:
+ daa r0l
+ das r0l
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimalh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimalh.s
new file mode 100644
index 00000000000..939240568eb
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/decimalh.s
@@ -0,0 +1,6 @@
+ .h8300h
+ .text
+h8300h_decimal:
+ daa r0l
+ das r0l
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmul.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmul.s
new file mode 100644
index 00000000000..37372ce4841
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmul.s
@@ -0,0 +1,5 @@
+ .text
+h8300_div_mul:
+ divxu r0l,r1
+ mulxu r0l,r1
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmulh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmulh.s
new file mode 100644
index 00000000000..db60f8f49aa
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/divmulh.s
@@ -0,0 +1,12 @@
+ .h8300h
+ .text
+h8300h_div_mul:
+ divxu.b r0l,r1
+ divxu.w r0,er1
+ divxs.b r0l,r1
+ divxs.w r0,er1
+ mulxu.b r0l,r1
+ mulxu.w r0,er1
+ mulxs.b r0l,r1
+ mulxs.w r0,er1
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/extendh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/extendh.s
new file mode 100644
index 00000000000..c034c833ee6
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/extendh.s
@@ -0,0 +1,8 @@
+ .h8300h
+ .text
+h8300h_extend:
+ exts.w r0
+ exts.l er0
+ extu.w r0
+ extu.l er0
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/h8300.exp b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/h8300.exp
index 9bd44268595..de2d7c31576 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/h8300.exp
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/h8300.exp
@@ -1,7 +1,1319 @@
#
# Some H8/300 tests
#
+proc do_h8300_add_sub {} {
+ set testname "addsub.s: h8300 add/sub tests"
+ set x 0
+
+ gas_start "addsub.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 8910\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 0819\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 0912\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 0B04\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 0B85\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 0E89\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 9210\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 1889\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 1901\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 1B04\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 1B85\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 1E89\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 B210\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 13] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_logical {} {
+ set testname "logical.s: h8300 logical tests"
+ set x 0
+
+ gas_start "logical.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 E910\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 1691\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 0610\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 C810\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 1498\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 0410\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c D810\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 1589\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 0510\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 1788\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 1708\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 11] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_cbranch {} {
+ set testname "cbranch.s: h8300 conditional branch tests"
+ set x 0
+
+ gas_start "cbranch.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 4000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 4000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 4100\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 4100\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 4200\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 4300\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 4400\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 4400\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 4500\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 4500\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 4600\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 4700\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 4800\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 4900\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c 4A00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 4B00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 4C00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0022 4D00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 4E00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0026 4F00\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 20] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_bitops1 {} {
+ set testname "bitops1.s: h8300 bitops tests #1"
+ set x 0
+
+ gas_start "bitops1.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 7608\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 7C007600\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 7E407600\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 7208\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 7D007200\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 7F407200\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 6298\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 7D006290\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 7F406290\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 7688\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 7C007680\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 7E407680\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0028 7788\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002a 7C007780\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002e 7E407780\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 15] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_bitops2 {} {
+ set testname "bitops2.s: h8300 bitops tests #2"
+ set x 0
+
+ gas_start "bitops2.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 7488\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 7C007480\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 7E407480\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 6788\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 7D006780\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 7F406780\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 7588\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 7C007580\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 7E407580\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 7708\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 7C007700\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 7E407700\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 12] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_bitops3 {} {
+ set testname "bitops3.s: h8300 bitops tests #3"
+ set x 0
+
+ gas_start "bitops3.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 7108\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 7D007100\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 7F407100\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 6198\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 7D006190\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 7F406190\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 7008\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 7D007000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 7F407000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 6098\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 7D006090\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 7F406090\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 12] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_bitops4 {} {
+ set testname "bitops4.s: h8300 bitops tests #4"
+ set x 0
+
+ gas_start "bitops4.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 7408\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 7C007400\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 7E407400\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 6708\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 7D006700\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 7F406700\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 7308\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 7C007300\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 7E407300\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 6398\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 7C006390\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 7E406390\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0028 7508\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002a 7C007500\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002e 7E407500\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 15] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_branches {} {
+ set testname "branches.s: h8300 branch tests"
+ set x 0
+
+ gas_start "branches.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 5500\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 5A000000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 5900\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 5B00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 5E000000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 5D00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 5F00\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 7] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_compare {} {
+ set testname "compare.s: h8300 compare tests"
+ set x 0
+
+ gas_start "compare.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 A800\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 1C08\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 1D01\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 3] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_decimal {} {
+ set testname "decimal.s: h8300 decimal tests"
+ set x 0
+
+ gas_start "decimal.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 0F08\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 1F08\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 2] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_incdec {} {
+ set testname "incdec.s: h8300 incdec tests"
+ set x 0
+
+ gas_start "incdec.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 1A08\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 0A08\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 2] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_divmul {} {
+ set testname "divmul.s: h8300 divmul tests"
+ set x 0
+
+ gas_start "divmul.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 5181\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 5081\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 2] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_misc {} {
+ set testname "misc.s: h8300 misc tests"
+ set x 0
+
+ gas_start "misc.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 7B5C598F\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 0700\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 0308\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 0000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 5670\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 5470\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 0180\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 0208\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 8] then { pass $testname } else { fail $testname }
+
+ setup_xfail "h8300*-*-*"
+ fail "h8300 movfpe/movtpe tests"
+}
+
+proc do_h8300_movb {} {
+ set testname "movb.s: h8300 movb tests"
+ set x 0
+
+ gas_start "movb.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 0C89\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 F810\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 6818\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 6E180010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 6C18\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 2810\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 6A080000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 6898\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 6E980010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 6C98\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 3810\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c 6A880000\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 12] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_movw {} {
+ set testname "movw.s: h8300 movw tests"
+ set x 0
+
+ gas_start "movw.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 0D01\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 79000010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 6910\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 6F100010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 6D10\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 6B000000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 6990\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 6F900010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 6D90\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 6B800000\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 10] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_pushpop {} {
+ set testname "pushpop.s: h8300 pushpop tests"
+ set x 0
+
+ gas_start "pushpop.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 6D70\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 6DF0\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 2] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300_rotate_shift {} {
+ set testname "rotshift.s: h8300 rotate and shift tests"
+ set x 0
+
+ gas_start "rotshift.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 1288\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 1388\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 1208\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 1308\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 1088\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 1188\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 1008\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 1108\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 8] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_add_sub {} {
+ set testname "addsubh.s: h8300h add/sub tests"
+ set x 0
+
+ gas_start "addsubh.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 8910\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 0819\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 79110020\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 0912\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 7A110000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 0A92\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 0B04\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 0B85\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 0B96\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 0E89\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 9210\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c 1889\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 79310010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0022 1901\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 7A310000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002a 1A92\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002c 1B04\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002e 1B85\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0030 1B96\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0032 1E89\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0034 B210\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 21] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_logical {} {
+ set testname "logicalh.s: h8300h logical tests"
+ set x 0
+
+ gas_start "logicalh.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 E910\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 1691\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 79610020\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 6611\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 7A610000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 01F06611\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 0610\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 C810\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 1498\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 79410020\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 6411\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 7A410000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0026 01F06411\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002a 0410\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002c D810\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002e 1589\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0030 79510020\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0034 6511\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0036 7A510000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 003c 01F06511\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0040 0510\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0042 1788\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0044 1790\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0046 17B0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0048 1708\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 004a 1710\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 004c 1730\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 27] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_cbranch {} {
+ set testname "cbranchh.s: h8300h conditional branch tests"
+ set x 0
+
+ gas_start "cbranchh.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 4000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 4000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 4100\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 4100\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 4200\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 4300\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 4400\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 4400\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 4500\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 4500\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 4600\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 4700\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 4800\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 4900\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c 4A00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 4B00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 4C00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0022 4D00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 4E00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0026 4F00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0028 58000000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002c 58000000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0030 58100000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0034 58100000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0038 58200000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 003c 58300000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0040 58400000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0044 58400000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0048 58500000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 004c 58500000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0050 58600000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0054 58700000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0058 58800000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 005c 58900000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0060 58A00000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0064 58B00000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0068 58C00000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 006c 58D00000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0070 58E00000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0074 58F00000\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 40] then { pass $testname } else { fail $testname }
+}
+proc do_h8300h_bitops1 {} {
+ set testname "bitops1h.s: h8300h bitops tests #1"
+ set x 0
+
+ gas_start "bitops1h.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 7608\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 7C007600\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 7E407600\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 7208\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 7D007200\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 7F407200\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 6298\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 7D006290\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 7F406290\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 7688\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 7C007680\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 7E407680\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0028 7788\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002a 7C007780\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002e 7E407780\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 15] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_bitops2 {} {
+ set testname "bitops2h.s: h8300h bitops tests #2"
+ set x 0
+
+ gas_start "bitops2h.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 7488\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 7C007480\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 7E407480\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 6788\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 7D006780\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 7F406780\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 7588\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 7C007580\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 7E407580\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 7708\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 7C007700\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 7E407700\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 12] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_bitops3 {} {
+ set testname "bitops3h.s: h8300h bitops tests #3"
+ set x 0
+
+ gas_start "bitops3h.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 7108\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 7D007100\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 7F407100\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 6198\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 7D006190\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 7F406190\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 7008\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 7D007000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 7F407000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 6098\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 7D006090\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 7F406090\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 12] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_bitops4 {} {
+ set testname "bitops4h.s: h8300h bitops tests #4"
+ set x 0
+
+ gas_start "bitops4h.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 7408\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 7C007400\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 7E407400\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 6708\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 7D006700\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 7F406700\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 7308\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 7C007300\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 7E407300\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 6398\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 7C006390\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 7E406390\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0028 7508\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002a 7C007500\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002e 7E407500\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 15] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_branches {} {
+ set testname "branchesh.s: h8300h branch tests"
+ set x 0
+
+ gas_start "branchesh.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 5500\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 5C000000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 5A000000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 5900\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 5B00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 5E000000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 5D00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 5F00\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 8] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_compare {} {
+ set testname "compareh.s: h8300h compare tests"
+ set x 0
+
+ gas_start "compareh.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 A800\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 1C08\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 79200020\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 1D01\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 7A200000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 1F81\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 6] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_decimal {} {
+ set testname "decimalh.s: h8300h decimal tests"
+ set x 0
+
+ gas_start "decimalh.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 0F08\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 1F08\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 2] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_incdec {} {
+ set testname "incdech.s: h8300h incdec tests"
+ set x 0
+
+ gas_start "incdech.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 1A08\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 1B50\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 1BD0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 1B70\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 1BF0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 0A08\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 0B50\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 0BD0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 0B70\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 0BF0\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 10] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_divmul {} {
+ set testname "divmulh.s: h8300h divmul tests"
+ set x 0
+
+ gas_start "divmulh.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 5181\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 5301\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 01D05181\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 01D05301\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 5081\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 5201\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 01C05081\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 01C05201\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 8] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_misc {} {
+ set testname "misch.s: h8300h misc tests"
+ set x 0
+
+ gas_start "misch.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 7B5C598F\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 0700\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 0308\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 01406900\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 01406F00\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 01407800\[^\n\]*\n +\[0-9\]+ +6B200000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c 01406D00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 01406B00\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0026 01406B20\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002e 0000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0030 5670\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0032 5470\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0034 0180\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0036 0208\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0038 01406980\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 003c 01406F80\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0042 01407800\[^\n\]*\n +\[0-9\]+ +6BA00000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 004c 01406D80\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0050 01406B80\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0056 01406BA0\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 20] then { pass $testname } else { fail $testname }
+
+ setup_xfail "h8300*-*-*"
+ fail "h8300 movfpe/movtpe tests"
+
+ setup_xfail "h8300*-*-*"
+ fail "h8300 eepmov.w tests"
+}
+
+proc do_h8300h_movb {} {
+ set testname "movbh.s: h8300h movb tests"
+ set x 0
+
+ gas_start "movbh.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 0C89\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 F810\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 6818\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 6E180010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 78106A28\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 6C18\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 2810\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 6A080000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 6A280000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 6898\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0022 6E980010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0026 78106AA8\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002e 6C98\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0030 3810\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0032 6A880000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0036 6AA80000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 16] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_movw {} {
+ set testname "movwh.s: h8300h movw tests"
+ set x 0
+
+ gas_start "movwh.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 0D01\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 79000010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 6910\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 6F100010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 78106B20\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 6D10\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 6B000000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 6B200000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 6990\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0022 6F900010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0026 78106BA0\[^\n\]*\n +\[0-9\]+ +00000020\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002e 6D90\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0030 6B800000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0034 6BA00000\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 14] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_movl {} {
+ set testname "movlh.s: h8300h movl tests"
+ set x 0
+
+ gas_start "movlh.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 0F81\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 7A000000\[^\n\]*\n +\[0-9\]+ +0040\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 01006910\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 01006F10\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 01007810\[^\n\]*\n +\[0-9\]+ +6B200000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c 01006D10\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 01006B00\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0026 01006B20\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002e 01006990\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0032 01006F90\[^\n\]*\n +\[0-9\]+ +0010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0038 01007890\[^\n\]*\n +\[0-9\]+ +6BA00000\[^\n\]*\n +\[0-9\]+ +0020\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0042 01006D90\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0046 01006B80\[^\n\]*\n +\[0-9\]+ +0000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 004c 01006BA0\[^\n\]*\n +\[0-9\]+ +00000000\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 14] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_pushpop {} {
+ set testname "pushpoph.s: h8300h pushpop tests"
+ set x 0
+
+ gas_start "pushpoph.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 6D70\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 01006D70\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 6DF0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 01006DF0\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 4] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_rotate_shift {} {
+ set testname "rotshifth.s: h8300h rotate and shift tests"
+ set x 0
+
+ gas_start "rotshifth.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 1288\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 1290\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 12B0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 1388\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 1390\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 13B0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 1208\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 1210\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 1230\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 1308\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 1310\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 1330\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 1088\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 1090\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c 10B0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 1188\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 1190\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0022 11B0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 1008\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0026 1010\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0028 1030\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002a 1108\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002c 1110\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002e 1130\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 24] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_extend {} {
+ set testname "extendh.s: h8300h extend tests"
+ set x 0
+
+ gas_start "extendh.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 17D0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 17F0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 1750\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 1770\[^\n\]*\n" { set x [expr $x+1] }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 4] then { pass $testname } else { fail $testname }
+}
+
+proc do_h8300h_mov32bug {} {
+ set testname "mov32bug.s: h8300h mov32bug test"
+ set x 0
+
+ if [gas_test_old "mov32bug.s" "" "Proper relocation for mov.l (part 1)"] then {
+ objdump_start_no_subdir "a.out" "-r"
+
+ while 1 {
+ expect {
+ -re "00000002\[^\n\]*32\[^\n\]*_a.0x88ca6c00\[^\n\]*\n"
+ { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ objdump_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 1] then { pass $testname } else { fail $testname }
+}
+
if [istarget h8300*-*-*] then {
+ # Test the basic h8300 instruction parser
+ do_h8300_add_sub
+ do_h8300_logical
+ do_h8300_cbranch
+ do_h8300_bitops1
+ do_h8300_bitops2
+ do_h8300_bitops3
+ do_h8300_bitops4
+ do_h8300_branches
+ do_h8300_compare
+ do_h8300_decimal
+ do_h8300_incdec
+ do_h8300_divmul
+ do_h8300_misc
+ do_h8300_movb
+ do_h8300_movw
+ do_h8300_pushpop
+ do_h8300_rotate_shift
+
+ # Now test the h8300h instruction parser
+ do_h8300h_add_sub
+ do_h8300h_logical
+ do_h8300h_cbranch
+ do_h8300h_bitops1
+ do_h8300h_bitops2
+ do_h8300h_bitops3
+ do_h8300h_bitops4
+ do_h8300h_branches
+ do_h8300h_compare
+ do_h8300h_decimal
+ do_h8300h_incdec
+ do_h8300h_divmul
+ do_h8300h_misc
+ do_h8300h_movb
+ do_h8300h_movw
+ do_h8300h_movl
+ do_h8300_pushpop
+ do_h8300h_rotate_shift
+ do_h8300h_extend
+
+ do_h8300h_mov32bug
+
+ # Now some random tests
set svr4pic [expr [istarget *-*-elf*] || [istarget *-*-irix5*] ]
set empic [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ]
set aout [expr [istarget *-*-bsd*] || [istarget *-*-netbsd*]]
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdec.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdec.s
new file mode 100644
index 00000000000..26188277317
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdec.s
@@ -0,0 +1,5 @@
+ .text
+h8300_incdec:
+ dec r0l
+ inc r0l
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdech.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdech.s
new file mode 100644
index 00000000000..bb93fc54b36
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/incdech.s
@@ -0,0 +1,14 @@
+ .h8300h
+ .text
+h8300h_incdec:
+ dec.b r0l
+ dec.w #1,r0
+ dec.w #2,r0
+ dec.l #1,er0
+ dec.l #2,er0
+ inc.b r0l
+ inc.w #1,r0
+ inc.w #2,r0
+ inc.l #1,er0
+ inc.l #2,er0
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logical.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logical.s
new file mode 100644
index 00000000000..3f7e3b7145d
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logical.s
@@ -0,0 +1,14 @@
+ .text
+h8300_logical:
+ and #16,r1l
+ and r1l,r1h
+ andc #16,ccr
+ or #16,r0l
+ or r1l,r0l
+ orc #16,ccr
+ xor #16,r0l
+ xor r0l,r1l
+ xorc #16,ccr
+ neg r0l
+ not r0l
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logicalh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logicalh.s
new file mode 100644
index 00000000000..9e95f11d454
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/logicalh.s
@@ -0,0 +1,31 @@
+ .h8300h
+ .text
+h8300h_logical:
+ and.b #16,r1l
+ and.b r1l,r1h
+ and.w #32,r1
+ and.w r1,r1
+ and.l #64,er1
+ and.l er1,er1
+ andc #16,ccr
+ or.b #16,r0l
+ or.b r1l,r0l
+ or.w #32,r1
+ or.w r1,r1
+ or.l #64,er1
+ or.l er1,er1
+ orc #16,ccr
+ xor.b #16,r0l
+ xor.b r0l,r1l
+ xor.w #32,r1
+ xor.w r1,r1
+ xor.l #64,er1
+ xor.l er1,er1
+ xorc #16,ccr
+ neg.b r0l
+ neg.w r0
+ neg.l er0
+ not.b r0l
+ not.w r0
+ not.l er0
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misc.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misc.s
new file mode 100644
index 00000000000..1f6f8084b67
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misc.s
@@ -0,0 +1,13 @@
+ .text
+h8300_misc:
+ eepmov
+ ldc #0,ccr
+ ldc r0l,ccr
+; movfpe 16:16,r0l
+; movtpe r0l,16:16
+ nop
+ rte
+ rts
+ sleep
+ stc ccr,r0l
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misch.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misch.s
new file mode 100644
index 00000000000..4127c86695e
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/misch.s
@@ -0,0 +1,27 @@
+ .h8300h
+ .text
+h8300h_misc:
+ eepmov.b
+; eepmov.w
+ ldc.b #0,ccr
+ ldc.b r0l,ccr
+ ldc.w @er0,ccr
+ ldc.w @(16:16,er0),ccr
+ ldc.w @(32:24,er0),ccr
+ ldc.w @er0+,ccr
+ ldc.w @h8300h_misc:16,ccr
+ ldc.w @h8300h_misc:24,ccr
+; movfpe 16:16,r0l
+; movtpe r0l,16:16
+ nop
+ rte
+ rts
+ sleep
+ stc.b ccr,r0l
+ stc.w ccr,@er0
+ stc.w ccr,@(16:16,er0)
+ stc.w ccr,@(32:24,er0)
+ stc.w ccr,@-er0
+ stc.w ccr,@h8300h_misc:16
+ stc.w ccr,@h8300h_misc:24
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/mov32bug.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/mov32bug.s
new file mode 100644
index 00000000000..68393e3f54e
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/mov32bug.s
@@ -0,0 +1,4 @@
+ .h8300h
+ .global _a
+blah:
+ mov.l #_a-2000000000,er2
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movb.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movb.s
new file mode 100644
index 00000000000..fa040c0a7bf
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movb.s
@@ -0,0 +1,15 @@
+ .text
+h8300_movb:
+ mov.b r0l,r1l
+ mov.b #16,r0l
+ mov.b @r1,r0l
+ mov.b @(16:16,r1),r0l
+ mov.b @r1+,r0l
+ mov.b @16:8,r0l
+ mov.b @h8300_movb:16,r0l
+ mov.b r0l,@r1
+ mov.b r0l,@(16:16,r1)
+ mov.b r0l,@-r1
+ mov.b r0l,@16:8
+ mov.b r0l,@h8300_movb:16
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movbh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movbh.s
new file mode 100644
index 00000000000..7d711f8512e
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movbh.s
@@ -0,0 +1,20 @@
+ .h8300h
+ .text
+h8300h_movb:
+ mov.b r0l,r1l
+ mov.b #16,r0l
+ mov.b @er1,r0l
+ mov.b @(16:16,er1),r0l
+ mov.b @(32:24,er1),r0l
+ mov.b @er1+,r0l
+ mov.b @16:8,r0l
+ mov.b @h8300h_movb:16,r0l
+ mov.b @h8300h_movb:24,r0l
+ mov.b r0l,@er1
+ mov.b r0l,@(16:16,er1)
+ mov.b r0l,@(32:24,er1)
+ mov.b r0l,@-er1
+ mov.b r0l,@16:8
+ mov.b r0l,@h8300h_movb:16
+ mov.b r0l,@h8300h_movb:24
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movlh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movlh.s
new file mode 100644
index 00000000000..0cc78e8d361
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movlh.s
@@ -0,0 +1,18 @@
+ .h8300h
+ .text
+h8300h_movl:
+ mov.l er0,er1
+ mov.l #64,er0
+ mov.l @er1,er0
+ mov.l @(16:16,er1),er0
+ mov.l @(32:24,er1),er0
+ mov.l @er1+,er0
+ mov.l @h8300h_movl:16,er0
+ mov.l @h8300h_movl:24,er0
+ mov.l er0,@er1
+ mov.l er0,@(16:16,er1)
+ mov.l er0,@(32:24,er1)
+ mov.l er0,@-er1
+ mov.l er0,@h8300h_movl:16
+ mov.l er0,@h8300h_movl:24
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movw.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movw.s
new file mode 100644
index 00000000000..0cc64f8d522
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movw.s
@@ -0,0 +1,13 @@
+ .text
+h8300_movw:
+ mov.w r0,r1
+ mov.w #16,r0
+ mov.w @r1,r0
+ mov.w @(16:16,r1),r0
+ mov.w @r1+,r0
+ mov.w @h8300_movw:16,r0
+ mov.w r0,@r1
+ mov.w r0,@(16:16,r1)
+ mov.w r0,@-r1
+ mov.w r0,@h8300_movw:16
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movwh.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movwh.s
new file mode 100644
index 00000000000..595057cb3d7
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/movwh.s
@@ -0,0 +1,18 @@
+ .h8300h
+ .text
+h8300h_movw:
+ mov.w r0,r1
+ mov.w #16,r0
+ mov.w @er1,r0
+ mov.w @(16:16,er1),r0
+ mov.w @(32:24,er1),r0
+ mov.w @er1+,r0
+ mov.w @h8300h_movw:16,r0
+ mov.w @h8300h_movw:24,r0
+ mov.w r0,@er1
+ mov.w r0,@(16:16,er1)
+ mov.w r0,@(32:24,er1)
+ mov.w r0,@-er1
+ mov.w r0,@h8300h_movw:16
+ mov.w r0,@h8300h_movw:24
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpop.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpop.s
new file mode 100644
index 00000000000..941b7357537
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpop.s
@@ -0,0 +1,5 @@
+ .text
+h8300_push_pop:
+ pop r0
+ push r0
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpoph.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpoph.s
new file mode 100644
index 00000000000..6049639f567
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/pushpoph.s
@@ -0,0 +1,8 @@
+ .h8300h
+ .text
+h8300h_push_pop:
+ pop.w r0
+ pop.l er0
+ push.w r0
+ push.l er0
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshift.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshift.s
new file mode 100644
index 00000000000..a9aa87df95e
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshift.s
@@ -0,0 +1,11 @@
+ .text
+h8300_rotate_shift:
+ rotl r0l
+ rotr r0l
+ rotxl r0l
+ rotxr r0l
+ shal r0l
+ shar r0l
+ shll r0l
+ shlr r0l
+
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshifth.s b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshifth.s
new file mode 100644
index 00000000000..c7abe40a28f
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/h8300/rotshifth.s
@@ -0,0 +1,27 @@
+ .h8300h
+ .text
+h8300h_rotate_shift:
+ rotl.b r0l
+ rotl.w r0
+ rotl.l er0
+ rotr.b r0l
+ rotr.w r0
+ rotr.l er0
+ rotxl.b r0l
+ rotxl.w r0
+ rotxl.l er0
+ rotxr.b r0l
+ rotxr.w r0
+ rotxr.l er0
+ shal.b r0l
+ shal.w r0
+ shal.l er0
+ shar.b r0l
+ shar.w r0
+ shar.l er0
+ shll.b r0l
+ shll.w r0
+ shll.l er0
+ shlr.b r0l
+ shlr.w r0
+ shlr.l er0
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/hppa/unsorted/unsorted.exp b/gnu/usr.bin/binutils/gas/testsuite/gas/hppa/unsorted/unsorted.exp
index 0364a276559..52a63da1ba0 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/hppa/unsorted/unsorted.exp
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/hppa/unsorted/unsorted.exp
@@ -32,7 +32,7 @@ proc do_subspace_align_test {} {
if [istarget hppa*-*-*elf*] then {
while 1 {
expect {
- -re "data\[^\n\]*align 2..6\[^\n\]*\n" { set x 1 }
+ -re "data\[^\n\]* 2..6\[^\n\]*\n" { set x 1 }
-re "\[^\n\]*\n" { }
timeout { perror "timeout\n"; break }
eof { break }
@@ -41,7 +41,7 @@ proc do_subspace_align_test {} {
} else {
while 1 {
expect {
- -re "DATA\[^\n\]*align 2..6\[^\n\]*\n" { set x 1 }
+ -re "DATA\[^\n\]* 2..6\[^\n\]*\n" { set x 1 }
-re "\[^\n\]*\n" { }
timeout { perror "timeout\n"; break }
eof { break }
@@ -251,7 +251,7 @@ if [istarget hppa*-*-*] then {
# Test for a buglet in the handling of common symbols
do_common_test
- * Test for an off-by-2 bug in range check for conditional branches
+ # Test for an off-by-2 bug in range check for conditional branches
gas_test_error "brlenbug.s" "" "Check for error(s) in branch length"
}
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/all.exp b/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/all.exp
index 1f6d75386a6..cc6086dc71f 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/all.exp
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/all.exp
@@ -6,7 +6,7 @@ if [istarget m68*-*-*] then {
gas_test "pic1.s" "" "" "PIC generation"
- gas_test "disperr.s" "" "" "Incorrect Displacement too long error"
+ gas_test "disperr.s" "-m68020" "" "Incorrect Displacement too long error"
gas_test_error "p2410.s" "" "out-of-range 'bras'"
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/link.d b/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/link.d
index 389273aabaa..98322744abc 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/link.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/link.d
@@ -14,3 +14,4 @@ Disassembly of section .text:
0+016 <foo\+16> linkw %fp,#32767
0+01a <foo\+1a> linkl %fp,#32768
0+020 <foo\+20> linkl %fp,#32769
+0+026 <foo\+26> nop
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/link.s b/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/link.s
index 82d5348b41a..1a321dd3222 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/link.s
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/link.s
@@ -10,3 +10,4 @@ foo:
link %a6,&0x7fff
link %a6,&0x8000
link %a6,&0x8001
+ nop
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/op68000.d b/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/op68000.d
index 0845d2bdae7..872be616b3d 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/op68000.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/m68k/op68000.d
@@ -29,6 +29,7 @@
.*statement `tstl @\(1000,%d0:w:2\)' ignored
.*statement `tstl @\(%d0:w:2\)' ignored
.*statement `tstl @\(1000\)' ignored
+.*statement `tstl %a0@\(100000\)' ignored
.*statement `tstl \(1000,%a0,%d0.w\*2\)' ignored
.*statement `tstl \(1000,%d0,%a0\)' ignored
.*statement `tstl \(1000,%a1.w\*2,%a0\)' ignored
@@ -37,6 +38,8 @@
.*statement `tstl \(1000,%d0.w\*2\)' ignored
.*statement `tstl 1000\(%d0.w\*2\)' ignored
.*statement `tstl \(%d0.w\*2\)' ignored
+.*statement `tstl \(100000,%a0\)' ignored
+.*statement `tstl 100000\(%a0\)' ignored
.*statement `tstl %za1@\(1000,%d0:w:2\)' ignored
.*statement `tstl %za1@\(100000\)' ignored
.*statement `tstl \(1000,%za1,%d0.w\*2\)' ignored
@@ -110,6 +113,7 @@
.*statement `tstl 8\(%pc,%d0.w\*2\)' ignored
.*statement `tstl \(%pc,%d0.w\*2\)' ignored
.*statement `tstl %pc@\(1000,%d0:w:2\)' ignored
+.*statement `tstl %pc@\(100000\)' ignored
.*statement `tstl \(1000,%pc,%d0.w\*2\)' ignored
.*statement `tstl \(1000,%d0,%pc\)' ignored
.*statement `tstl \(1000,%a1.w\*2,%pc\)' ignored
@@ -117,6 +121,8 @@
.*statement `tstl 1000\(%pc,%d0.w\*2\)' ignored
.*statement `tstl 1000\(%d0,%pc\)' ignored
.*statement `tstl 1000\(%a1,%pc\)' ignored
+.*statement `tstl \(100000,%pc\)' ignored
+.*statement `tstl 100000\(%pc\)' ignored
.*statement `tstl %zpc@\(1000,%d0:w:2\)' ignored
.*statement `tstl %zpc@\(100000\)' ignored
.*statement `tstl \(1000,%zpc,%d0.w\*2\)' ignored
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/add.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/add.d
index 1bd3b891c94..c6070711445 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/add.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/add.d
@@ -9,13 +9,13 @@ No symbols in .*
Disassembly of section .text:
0+0000 addi \$a0,\$a0,0
0+0004 addi \$a0,\$a0,1
-0+0008 li \$at,32768
+0+0008 li \$at,0x8000
0+000c add \$a0,\$a0,\$at
0+0010 addi \$a0,\$a0,-32768
-0+0014 lui \$at,1
+0+0014 lui \$at,0x1
0+0018 add \$a0,\$a0,\$at
-0+001c lui \$at,1
-0+0020 ori \$at,\$at,42405
+0+001c lui \$at,0x1
+0+0020 ori \$at,\$at,0xa5a5
0+0024 add \$a0,\$a0,\$at
0+0028 addiu \$a0,\$a0,1
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/and.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/and.d
index 449adfe55f1..14ec29abb25 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/and.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/and.d
@@ -7,29 +7,29 @@
No symbols in .*
Disassembly of section .text:
-0+0000 andi \$a0,\$a0,0
-0+0004 andi \$a0,\$a0,1
-0+0008 andi \$a0,\$a0,32768
+0+0000 andi \$a0,\$a0,0x0
+0+0004 andi \$a0,\$a0,0x1
+0+0008 andi \$a0,\$a0,0x8000
0+000c li \$at,-32768
0+0010 and \$a0,\$a0,\$at
-0+0014 lui \$at,1
+0+0014 lui \$at,0x1
0+0018 and \$a0,\$a0,\$at
-0+001c lui \$at,1
-0+0020 ori \$at,\$at,42405
+0+001c lui \$at,0x1
+0+0020 ori \$at,\$at,0xa5a5
0+0024 and \$a0,\$a0,\$at
-0+0028 ori \$a0,\$a1,0
+0+0028 ori \$a0,\$a1,0x0
0+002c nor \$a0,\$a0,\$zero
-0+0030 ori \$a0,\$a1,1
+0+0030 ori \$a0,\$a1,0x1
0+0034 nor \$a0,\$a0,\$zero
-0+0038 ori \$a0,\$a1,32768
+0+0038 ori \$a0,\$a1,0x8000
0+003c nor \$a0,\$a0,\$zero
0+0040 li \$at,-32768
0+0044 nor \$a0,\$a1,\$at
-0+0048 lui \$at,1
+0+0048 lui \$at,0x1
0+004c nor \$a0,\$a1,\$at
-0+0050 lui \$at,1
-0+0054 ori \$at,\$at,42405
+0+0050 lui \$at,0x1
+0+0054 ori \$at,\$at,0xa5a5
0+0058 nor \$a0,\$a1,\$at
-0+005c ori \$a0,\$a1,0
-0+0060 xori \$a0,\$a1,0
+0+005c ori \$a0,\$a1,0x0
+0+0060 xori \$a0,\$a1,0x0
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/beq.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/beq.d
index 959a7a646ee..88bc1e5a834 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/beq.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/beq.d
@@ -13,17 +13,17 @@ Disassembly of section .text:
0+0010 <[^>]*> li \$at,1
0+0014 <[^>]*> beq \$a0,\$at,0+0000 <text_label>
...
-0+001c <[^>]*> li \$at,32768
+0+001c <[^>]*> li \$at,0x8000
0+0020 <[^>]*> beq \$a0,\$at,0+0000 <text_label>
...
0+0028 <[^>]*> li \$at,-32768
0+002c <[^>]*> beq \$a0,\$at,0+0000 <text_label>
...
-0+0034 <[^>]*> lui \$at,1
+0+0034 <[^>]*> lui \$at,0x1
0+0038 <[^>]*> beq \$a0,\$at,0+0000 <text_label>
...
-0+0040 <[^>]*> lui \$at,1
-0+0044 <[^>]*> ori \$at,\$at,42405
+0+0040 <[^>]*> lui \$at,0x1
+0+0044 <[^>]*> ori \$at,\$at,0xa5a5
0+0048 <[^>]*> beq \$a0,\$at,0+0000 <text_label>
...
0+0050 <[^>]*> bnez \$a0,0+0000 <text_label>
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/bge.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/bge.d
index 7b89d397941..b600f6ef684 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/bge.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/bge.d
@@ -20,19 +20,19 @@ Disassembly of section .text:
0+002c <[^>]*> slti \$at,\$a0,2
0+0030 <[^>]*> beqz \$at,0+0000 <text_label>
...
-0+0038 <[^>]*> li \$at,32768
+0+0038 <[^>]*> li \$at,0x8000
0+003c <[^>]*> slt \$at,\$a0,\$at
0+0040 <[^>]*> beqz \$at,0+0000 <text_label>
...
0+0048 <[^>]*> slti \$at,\$a0,-32768
0+004c <[^>]*> beqz \$at,0+0000 <text_label>
...
-0+0054 <[^>]*> lui \$at,1
+0+0054 <[^>]*> lui \$at,0x1
0+0058 <[^>]*> slt \$at,\$a0,\$at
0+005c <[^>]*> beqz \$at,0+0000 <text_label>
...
-0+0064 <[^>]*> lui \$at,1
-0+0068 <[^>]*> ori \$at,\$at,42405
+0+0064 <[^>]*> lui \$at,0x1
+0+0068 <[^>]*> ori \$at,\$at,0xa5a5
0+006c <[^>]*> slt \$at,\$a0,\$at
0+0070 <[^>]*> beqz \$at,0+0000 <text_label>
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/bgeu.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/bgeu.d
index 796d27c65e9..83f017903aa 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/bgeu.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/bgeu.d
@@ -16,19 +16,19 @@ Disassembly of section .text:
0+001c <[^>]*> sltiu \$at,\$a0,2
0+0020 <[^>]*> beqz \$at,0+0000 <text_label>
...
-0+0028 <[^>]*> li \$at,32768
+0+0028 <[^>]*> li \$at,0x8000
0+002c <[^>]*> sltu \$at,\$a0,\$at
0+0030 <[^>]*> beqz \$at,0+0000 <text_label>
...
0+0038 <[^>]*> sltiu \$at,\$a0,-32768
0+003c <[^>]*> beqz \$at,0+0000 <text_label>
...
-0+0044 <[^>]*> lui \$at,1
+0+0044 <[^>]*> lui \$at,0x1
0+0048 <[^>]*> sltu \$at,\$a0,\$at
0+004c <[^>]*> beqz \$at,0+0000 <text_label>
...
-0+0054 <[^>]*> lui \$at,1
-0+0058 <[^>]*> ori \$at,\$at,42405
+0+0054 <[^>]*> lui \$at,0x1
+0+0058 <[^>]*> ori \$at,\$at,0xa5a5
0+005c <[^>]*> sltu \$at,\$a0,\$at
0+0060 <[^>]*> beqz \$at,0+0000 <text_label>
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/blt.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/blt.d
index b0924e45ed3..d49afa30179 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/blt.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/blt.d
@@ -20,19 +20,19 @@ Disassembly of section .text:
0+002c <[^>]*> slti \$at,\$a0,2
0+0030 <[^>]*> bnez \$at,0+0000 <text_label>
...
-0+0038 <[^>]*> li \$at,32768
+0+0038 <[^>]*> li \$at,0x8000
0+003c <[^>]*> slt \$at,\$a0,\$at
0+0040 <[^>]*> bnez \$at,0+0000 <text_label>
...
0+0048 <[^>]*> slti \$at,\$a0,-32768
0+004c <[^>]*> bnez \$at,0+0000 <text_label>
...
-0+0054 <[^>]*> lui \$at,1
+0+0054 <[^>]*> lui \$at,0x1
0+0058 <[^>]*> slt \$at,\$a0,\$at
0+005c <[^>]*> bnez \$at,0+0000 <text_label>
...
-0+0064 <[^>]*> lui \$at,1
-0+0068 <[^>]*> ori \$at,\$at,42405
+0+0064 <[^>]*> lui \$at,0x1
+0+0068 <[^>]*> ori \$at,\$at,0xa5a5
0+006c <[^>]*> slt \$at,\$a0,\$at
0+0070 <[^>]*> bnez \$at,0+0000 <text_label>
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/bltu.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/bltu.d
index 0a1b77840a9..fc59953d3ff 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/bltu.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/bltu.d
@@ -16,19 +16,19 @@ Disassembly of section .text:
0+001c <[^>]*> sltiu \$at,\$a0,2
0+0020 <[^>]*> bnez \$at,0+0000 <text_label>
...
-0+0028 <[^>]*> li \$at,32768
+0+0028 <[^>]*> li \$at,0x8000
0+002c <[^>]*> sltu \$at,\$a0,\$at
0+0030 <[^>]*> bnez \$at,0+0000 <text_label>
...
0+0038 <[^>]*> sltiu \$at,\$a0,-32768
0+003c <[^>]*> bnez \$at,0+0000 <text_label>
...
-0+0044 <[^>]*> lui \$at,1
+0+0044 <[^>]*> lui \$at,0x1
0+0048 <[^>]*> sltu \$at,\$a0,\$at
0+004c <[^>]*> bnez \$at,0+0000 <text_label>
...
-0+0054 <[^>]*> lui \$at,1
-0+0058 <[^>]*> ori \$at,\$at,42405
+0+0054 <[^>]*> lui \$at,0x1
+0+0058 <[^>]*> ori \$at,\$at,0xa5a5
0+005c <[^>]*> sltu \$at,\$a0,\$at
0+0060 <[^>]*> bnez \$at,0+0000 <text_label>
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/div.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/div.d
index d8eb4820ac9..ffec71dd6e9 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/div.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/div.d
@@ -14,7 +14,7 @@ Disassembly of section .text:
0+0010 break 0x7
0+0014 li \$at,-1
0+0018 bne \$a1,\$at,0+002c
-0+001c lui \$at,32768
+0+001c lui \$at,0x8000
0+0020 bne \$a0,\$at,0+002c
...
0+0028 break 0x6
@@ -26,7 +26,7 @@ Disassembly of section .text:
0+0044 break 0x7
0+0048 li \$at,-1
0+004c bne \$a2,\$at,0+0060
-0+0050 lui \$at,32768
+0+0050 lui \$at,0x8000
0+0054 bne \$a1,\$at,0+0060
...
0+005c break 0x6
@@ -42,11 +42,11 @@ Disassembly of section .text:
...
0+0088 div \$zero,\$a1,\$at
0+008c mflo \$a0
-0+0090 li \$at,32768
+0+0090 li \$at,0x8000
...
0+0098 div \$zero,\$a0,\$at
0+009c mflo \$a0
-0+00a0 li \$at,32768
+0+00a0 li \$at,0x8000
...
0+00a8 div \$zero,\$a1,\$at
0+00ac mflo \$a0
@@ -58,20 +58,20 @@ Disassembly of section .text:
...
0+00c8 div \$zero,\$a1,\$at
0+00cc mflo \$a0
-0+00d0 lui \$at,1
+0+00d0 lui \$at,0x1
...
0+00d8 div \$zero,\$a0,\$at
0+00dc mflo \$a0
-0+00e0 lui \$at,1
+0+00e0 lui \$at,0x1
...
0+00e8 div \$zero,\$a1,\$at
0+00ec mflo \$a0
-0+00f0 lui \$at,1
-0+00f4 ori \$at,\$at,42405
+0+00f0 lui \$at,0x1
+0+00f4 ori \$at,\$at,0xa5a5
0+00f8 div \$zero,\$a0,\$at
0+00fc mflo \$a0
-0+0100 lui \$at,1
-0+0104 ori \$at,\$at,42405
+0+0100 lui \$at,0x1
+0+0104 ori \$at,\$at,0xa5a5
0+0108 div \$zero,\$a1,\$at
0+010c mflo \$a0
...
@@ -95,7 +95,7 @@ Disassembly of section .text:
0+0160 break 0x7
0+0164 li \$at,-1
0+0168 bne \$a2,\$at,0+017c
-0+016c lui \$at,32768
+0+016c lui \$at,0x8000
0+0170 bne \$a1,\$at,0+017c
...
0+0178 break 0x6
@@ -121,7 +121,7 @@ Disassembly of section .text:
...
0+01d0 ddivu \$zero,\$a1,\$at
0+01d4 mflo \$a0
-0+01d8 li \$at,32768
+0+01d8 li \$at,0x8000
...
0+01e0 ddiv \$zero,\$a1,\$at
0+01e4 mfhi \$a0
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/jal-svr4pic.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/jal-svr4pic.d
index 9600bcc3f2b..02a48049282 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/jal-svr4pic.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/jal-svr4pic.d
@@ -7,7 +7,7 @@
.*: +file format .*mips.*
Disassembly of section .text:
-0+0000 <[^>]*> lui \$gp,0
+0+0000 <[^>]*> lui \$gp,0x0
[ ]*RELOC: 0+0000 R_MIPS_HI16 _gp_disp
0+0004 <[^>]*> addiu \$gp,\$gp,0
[ ]*RELOC: 0+0004 R_MIPS_LO16 _gp_disp
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/jal-xgot.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/jal-xgot.d
new file mode 100644
index 00000000000..8879aa4463e
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/jal-xgot.d
@@ -0,0 +1,42 @@
+#objdump: -dr
+#name: MIPS jal-xgot
+#as: -mips1 -KPIC -xgot
+#source: jal-svr4pic.s
+
+# Test the jal macro with -KPIC -xgot.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> lui \$gp,0x0
+[ ]*RELOC: 0+0000 R_MIPS_HI16 _gp_disp
+0+0004 <[^>]*> addiu \$gp,\$gp,0
+[ ]*RELOC: 0+0004 R_MIPS_LO16 _gp_disp
+0+0008 <[^>]*> addu \$gp,\$gp,\$t9
+0+000c <[^>]*> sw \$gp,0\(\$sp\)
+0+0010 <[^>]*> jalr \$t9
+...
+0+0018 <[^>]*> lw \$gp,0\(\$sp\)
+0+001c <[^>]*> jalr \$a0,\$t9
+...
+0+0024 <[^>]*> lw \$gp,0\(\$sp\)
+...
+0+002c <[^>]*> lw \$t9,0\(\$gp\)
+[ ]*RELOC: 0+002c R_MIPS_GOT16 .text
+...
+0+0034 <[^>]*> addiu \$t9,\$t9,0
+[ ]*RELOC: 0+0034 R_MIPS_LO16 .text
+0+0038 <[^>]*> jalr \$t9
+...
+0+0040 <[^>]*> lw \$gp,0\(\$sp\)
+0+0044 <[^>]*> lui \$t9,0x0
+[ ]*RELOC: 0+0044 R_MIPS_CALL_HI16 external_text_label
+0+0048 <[^>]*> addu \$t9,\$t9,\$gp
+0+004c <[^>]*> lw \$t9,0\(\$t9\)
+[ ]*RELOC: 0+004c R_MIPS_CALL_LO16 external_text_label
+...
+0+0054 <[^>]*> jalr \$t9
+...
+0+005c <[^>]*> lw \$gp,0\(\$sp\)
+0+0060 <[^>]*> b 0+0000 <text_label>
+...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-empic.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-empic.d
index f7bb3e494d0..228a946aa51 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-empic.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-empic.d
@@ -9,23 +9,23 @@
Disassembly of section .text:
0+0000 <[^>]*> li \$a0,0
0+0004 <[^>]*> li \$a0,1
-0+0008 <[^>]*> li \$a0,32768
+0+0008 <[^>]*> li \$a0,0x8000
0+000c <[^>]*> li \$a0,-32768
-0+0010 <[^>]*> lui \$a0,1
-0+0014 <[^>]*> lui \$a0,1
-0+0018 <[^>]*> ori \$a0,\$a0,42405
+0+0010 <[^>]*> lui \$a0,0x1
+0+0014 <[^>]*> lui \$a0,0x1
+0+0018 <[^>]*> ori \$a0,\$a0,0xa5a5
0+001c <[^>]*> li \$a0,0
0+0020 <[^>]*> addu \$a0,\$a0,\$a1
0+0024 <[^>]*> li \$a0,1
0+0028 <[^>]*> addu \$a0,\$a0,\$a1
-0+002c <[^>]*> li \$a0,32768
+0+002c <[^>]*> li \$a0,0x8000
0+0030 <[^>]*> addu \$a0,\$a0,\$a1
0+0034 <[^>]*> li \$a0,-32768
0+0038 <[^>]*> addu \$a0,\$a0,\$a1
-0+003c <[^>]*> lui \$a0,1
+0+003c <[^>]*> lui \$a0,0x1
0+0040 <[^>]*> addu \$a0,\$a0,\$a1
-0+0044 <[^>]*> lui \$a0,1
-0+0048 <[^>]*> ori \$a0,\$a0,42405
+0+0044 <[^>]*> lui \$a0,0x1
+0+0048 <[^>]*> ori \$a0,\$a0,0xa5a5
0+004c <[^>]*> addu \$a0,\$a0,\$a1
0+0050 <[^>]*> addiu \$a0,\$gp,-16384
[ ]*RELOC: 0+0050 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
@@ -97,7 +97,7 @@ Disassembly of section .text:
0+00f0 <[^>]*> addiu \$a0,\$gp,-15383
[ ]*RELOC: 0+00f0 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
0+00f4 <[^>]*> addu \$a0,\$a0,\$a1
-0+00f8 <[^>]*> lui \$a0,0
+0+00f8 <[^>]*> lui \$a0,0x0
[ ]*RELOC: 0+00f8 RELHI external_text_label
0+00fc <[^>]*> addiu \$a0,\$a0,252
[ ]*RELOC: 0+00fc RELLO external_text_label
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-svr4pic.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-svr4pic.d
index f17c3552cef..d77bb38a755 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-svr4pic.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-svr4pic.d
@@ -10,23 +10,23 @@
Disassembly of section .text:
0+0000 <[^>]*> li \$a0,0
0+0004 <[^>]*> li \$a0,1
-0+0008 <[^>]*> li \$a0,32768
+0+0008 <[^>]*> li \$a0,0x8000
0+000c <[^>]*> li \$a0,-32768
-0+0010 <[^>]*> lui \$a0,1
-0+0014 <[^>]*> lui \$a0,1
-0+0018 <[^>]*> ori \$a0,\$a0,42405
+0+0010 <[^>]*> lui \$a0,0x1
+0+0014 <[^>]*> lui \$a0,0x1
+0+0018 <[^>]*> ori \$a0,\$a0,0xa5a5
0+001c <[^>]*> li \$a0,0
0+0020 <[^>]*> addu \$a0,\$a0,\$a1
0+0024 <[^>]*> li \$a0,1
0+0028 <[^>]*> addu \$a0,\$a0,\$a1
-0+002c <[^>]*> li \$a0,32768
+0+002c <[^>]*> li \$a0,0x8000
0+0030 <[^>]*> addu \$a0,\$a0,\$a1
0+0034 <[^>]*> li \$a0,-32768
0+0038 <[^>]*> addu \$a0,\$a0,\$a1
-0+003c <[^>]*> lui \$a0,1
+0+003c <[^>]*> lui \$a0,0x1
0+0040 <[^>]*> addu \$a0,\$a0,\$a1
-0+0044 <[^>]*> lui \$a0,1
-0+0048 <[^>]*> ori \$a0,\$a0,42405
+0+0044 <[^>]*> lui \$a0,0x1
+0+0048 <[^>]*> ori \$a0,\$a0,0xa5a5
0+004c <[^>]*> addu \$a0,\$a0,\$a1
0+0050 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0050 R_MIPS_GOT16 .data
@@ -84,39 +84,39 @@ Disassembly of section .text:
[ ]*RELOC: 0+00d4 R_MIPS_LO16 .bss
0+00d8 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+00d8 R_MIPS_GOT16 .data
-0+00dc <[^>]*> lui \$at,1
+0+00dc <[^>]*> lui \$at,0x1
0+00e0 <[^>]*> addiu \$at,\$at,-32768
[ ]*RELOC: 0+00e0 R_MIPS_LO16 .data
0+00e4 <[^>]*> addu \$a0,\$a0,\$at
0+00e8 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+00e8 R_MIPS_GOT16 big_external_data_label
-0+00ec <[^>]*> lui \$at,1
+0+00ec <[^>]*> lui \$at,0x1
0+00f0 <[^>]*> addiu \$at,\$at,-32768
0+00f4 <[^>]*> addu \$a0,\$a0,\$at
0+00f8 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+00f8 R_MIPS_GOT16 small_external_data_label
-0+00fc <[^>]*> lui \$at,1
+0+00fc <[^>]*> lui \$at,0x1
0+0100 <[^>]*> addiu \$at,\$at,-32768
0+0104 <[^>]*> addu \$a0,\$a0,\$at
0+0108 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0108 R_MIPS_GOT16 big_external_common
-0+010c <[^>]*> lui \$at,1
+0+010c <[^>]*> lui \$at,0x1
0+0110 <[^>]*> addiu \$at,\$at,-32768
0+0114 <[^>]*> addu \$a0,\$a0,\$at
0+0118 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0118 R_MIPS_GOT16 small_external_common
-0+011c <[^>]*> lui \$at,1
+0+011c <[^>]*> lui \$at,0x1
0+0120 <[^>]*> addiu \$at,\$at,-32768
0+0124 <[^>]*> addu \$a0,\$a0,\$at
0+0128 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0128 R_MIPS_GOT16 .bss
-0+012c <[^>]*> lui \$at,1
+0+012c <[^>]*> lui \$at,0x1
0+0130 <[^>]*> addiu \$at,\$at,-32768
[ ]*RELOC: 0+0130 R_MIPS_LO16 .bss
0+0134 <[^>]*> addu \$a0,\$a0,\$at
0+0138 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0138 R_MIPS_GOT16 .bss
-0+013c <[^>]*> lui \$at,1
+0+013c <[^>]*> lui \$at,0x1
0+0140 <[^>]*> addiu \$at,\$at,-31768
[ ]*RELOC: 0+0140 R_MIPS_LO16 .bss
0+0144 <[^>]*> addu \$a0,\$a0,\$at
@@ -153,77 +153,77 @@ Disassembly of section .text:
[ ]*RELOC: 0+0198 R_MIPS_LO16 .bss
0+019c <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+019c R_MIPS_GOT16 .data
-0+01a0 <[^>]*> lui \$at,1
+0+01a0 <[^>]*> lui \$at,0x1
0+01a4 <[^>]*> addiu \$at,\$at,0
[ ]*RELOC: 0+01a4 R_MIPS_LO16 .data
0+01a8 <[^>]*> addu \$a0,\$a0,\$at
0+01ac <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+01ac R_MIPS_GOT16 big_external_data_label
-0+01b0 <[^>]*> lui \$at,1
+0+01b0 <[^>]*> lui \$at,0x1
0+01b4 <[^>]*> addiu \$at,\$at,0
0+01b8 <[^>]*> addu \$a0,\$a0,\$at
0+01bc <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+01bc R_MIPS_GOT16 small_external_data_label
-0+01c0 <[^>]*> lui \$at,1
+0+01c0 <[^>]*> lui \$at,0x1
0+01c4 <[^>]*> addiu \$at,\$at,0
0+01c8 <[^>]*> addu \$a0,\$a0,\$at
0+01cc <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+01cc R_MIPS_GOT16 big_external_common
-0+01d0 <[^>]*> lui \$at,1
+0+01d0 <[^>]*> lui \$at,0x1
0+01d4 <[^>]*> addiu \$at,\$at,0
0+01d8 <[^>]*> addu \$a0,\$a0,\$at
0+01dc <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+01dc R_MIPS_GOT16 small_external_common
-0+01e0 <[^>]*> lui \$at,1
+0+01e0 <[^>]*> lui \$at,0x1
0+01e4 <[^>]*> addiu \$at,\$at,0
0+01e8 <[^>]*> addu \$a0,\$a0,\$at
0+01ec <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+01ec R_MIPS_GOT16 .bss
-0+01f0 <[^>]*> lui \$at,1
+0+01f0 <[^>]*> lui \$at,0x1
0+01f4 <[^>]*> addiu \$at,\$at,0
[ ]*RELOC: 0+01f4 R_MIPS_LO16 .bss
0+01f8 <[^>]*> addu \$a0,\$a0,\$at
0+01fc <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+01fc R_MIPS_GOT16 .bss
-0+0200 <[^>]*> lui \$at,1
+0+0200 <[^>]*> lui \$at,0x1
0+0204 <[^>]*> addiu \$at,\$at,1000
[ ]*RELOC: 0+0204 R_MIPS_LO16 .bss
0+0208 <[^>]*> addu \$a0,\$a0,\$at
0+020c <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+020c R_MIPS_GOT16 .data
-0+0210 <[^>]*> lui \$at,2
+0+0210 <[^>]*> lui \$at,0x2
0+0214 <[^>]*> addiu \$at,\$at,-23131
[ ]*RELOC: 0+0214 R_MIPS_LO16 .data
0+0218 <[^>]*> addu \$a0,\$a0,\$at
0+021c <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+021c R_MIPS_GOT16 big_external_data_label
-0+0220 <[^>]*> lui \$at,2
+0+0220 <[^>]*> lui \$at,0x2
0+0224 <[^>]*> addiu \$at,\$at,-23131
0+0228 <[^>]*> addu \$a0,\$a0,\$at
0+022c <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+022c R_MIPS_GOT16 small_external_data_label
-0+0230 <[^>]*> lui \$at,2
+0+0230 <[^>]*> lui \$at,0x2
0+0234 <[^>]*> addiu \$at,\$at,-23131
0+0238 <[^>]*> addu \$a0,\$a0,\$at
0+023c <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+023c R_MIPS_GOT16 big_external_common
-0+0240 <[^>]*> lui \$at,2
+0+0240 <[^>]*> lui \$at,0x2
0+0244 <[^>]*> addiu \$at,\$at,-23131
0+0248 <[^>]*> addu \$a0,\$a0,\$at
0+024c <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+024c R_MIPS_GOT16 small_external_common
-0+0250 <[^>]*> lui \$at,2
+0+0250 <[^>]*> lui \$at,0x2
0+0254 <[^>]*> addiu \$at,\$at,-23131
0+0258 <[^>]*> addu \$a0,\$a0,\$at
0+025c <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+025c R_MIPS_GOT16 .bss
-0+0260 <[^>]*> lui \$at,2
+0+0260 <[^>]*> lui \$at,0x2
0+0264 <[^>]*> addiu \$at,\$at,-23131
[ ]*RELOC: 0+0264 R_MIPS_LO16 .bss
0+0268 <[^>]*> addu \$a0,\$a0,\$at
0+026c <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+026c R_MIPS_GOT16 .bss
-0+0270 <[^>]*> lui \$at,2
+0+0270 <[^>]*> lui \$at,0x2
0+0274 <[^>]*> addiu \$at,\$at,-22131
[ ]*RELOC: 0+0274 R_MIPS_LO16 .bss
0+0278 <[^>]*> addu \$a0,\$a0,\$at
@@ -301,45 +301,45 @@ Disassembly of section .text:
0+0348 <[^>]*> addu \$a0,\$a0,\$a1
0+034c <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+034c R_MIPS_GOT16 .data
-0+0350 <[^>]*> lui \$at,1
+0+0350 <[^>]*> lui \$at,0x1
0+0354 <[^>]*> addiu \$at,\$at,-32768
[ ]*RELOC: 0+0354 R_MIPS_LO16 .data
0+0358 <[^>]*> addu \$a0,\$a0,\$at
0+035c <[^>]*> addu \$a0,\$a0,\$a1
0+0360 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0360 R_MIPS_GOT16 big_external_data_label
-0+0364 <[^>]*> lui \$at,1
+0+0364 <[^>]*> lui \$at,0x1
0+0368 <[^>]*> addiu \$at,\$at,-32768
0+036c <[^>]*> addu \$a0,\$a0,\$at
0+0370 <[^>]*> addu \$a0,\$a0,\$a1
0+0374 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0374 R_MIPS_GOT16 small_external_data_label
-0+0378 <[^>]*> lui \$at,1
+0+0378 <[^>]*> lui \$at,0x1
0+037c <[^>]*> addiu \$at,\$at,-32768
0+0380 <[^>]*> addu \$a0,\$a0,\$at
0+0384 <[^>]*> addu \$a0,\$a0,\$a1
0+0388 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0388 R_MIPS_GOT16 big_external_common
-0+038c <[^>]*> lui \$at,1
+0+038c <[^>]*> lui \$at,0x1
0+0390 <[^>]*> addiu \$at,\$at,-32768
0+0394 <[^>]*> addu \$a0,\$a0,\$at
0+0398 <[^>]*> addu \$a0,\$a0,\$a1
0+039c <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+039c R_MIPS_GOT16 small_external_common
-0+03a0 <[^>]*> lui \$at,1
+0+03a0 <[^>]*> lui \$at,0x1
0+03a4 <[^>]*> addiu \$at,\$at,-32768
0+03a8 <[^>]*> addu \$a0,\$a0,\$at
0+03ac <[^>]*> addu \$a0,\$a0,\$a1
0+03b0 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+03b0 R_MIPS_GOT16 .bss
-0+03b4 <[^>]*> lui \$at,1
+0+03b4 <[^>]*> lui \$at,0x1
0+03b8 <[^>]*> addiu \$at,\$at,-32768
[ ]*RELOC: 0+03b8 R_MIPS_LO16 .bss
0+03bc <[^>]*> addu \$a0,\$a0,\$at
0+03c0 <[^>]*> addu \$a0,\$a0,\$a1
0+03c4 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+03c4 R_MIPS_GOT16 .bss
-0+03c8 <[^>]*> lui \$at,1
+0+03c8 <[^>]*> lui \$at,0x1
0+03cc <[^>]*> addiu \$at,\$at,-31768
[ ]*RELOC: 0+03cc R_MIPS_LO16 .bss
0+03d0 <[^>]*> addu \$a0,\$a0,\$at
@@ -384,90 +384,90 @@ Disassembly of section .text:
0+0444 <[^>]*> addu \$a0,\$a0,\$a1
0+0448 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0448 R_MIPS_GOT16 .data
-0+044c <[^>]*> lui \$at,1
+0+044c <[^>]*> lui \$at,0x1
0+0450 <[^>]*> addiu \$at,\$at,0
[ ]*RELOC: 0+0450 R_MIPS_LO16 .data
0+0454 <[^>]*> addu \$a0,\$a0,\$at
0+0458 <[^>]*> addu \$a0,\$a0,\$a1
0+045c <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+045c R_MIPS_GOT16 big_external_data_label
-0+0460 <[^>]*> lui \$at,1
+0+0460 <[^>]*> lui \$at,0x1
0+0464 <[^>]*> addiu \$at,\$at,0
0+0468 <[^>]*> addu \$a0,\$a0,\$at
0+046c <[^>]*> addu \$a0,\$a0,\$a1
0+0470 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0470 R_MIPS_GOT16 small_external_data_label
-0+0474 <[^>]*> lui \$at,1
+0+0474 <[^>]*> lui \$at,0x1
0+0478 <[^>]*> addiu \$at,\$at,0
0+047c <[^>]*> addu \$a0,\$a0,\$at
0+0480 <[^>]*> addu \$a0,\$a0,\$a1
0+0484 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0484 R_MIPS_GOT16 big_external_common
-0+0488 <[^>]*> lui \$at,1
+0+0488 <[^>]*> lui \$at,0x1
0+048c <[^>]*> addiu \$at,\$at,0
0+0490 <[^>]*> addu \$a0,\$a0,\$at
0+0494 <[^>]*> addu \$a0,\$a0,\$a1
0+0498 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0498 R_MIPS_GOT16 small_external_common
-0+049c <[^>]*> lui \$at,1
+0+049c <[^>]*> lui \$at,0x1
0+04a0 <[^>]*> addiu \$at,\$at,0
0+04a4 <[^>]*> addu \$a0,\$a0,\$at
0+04a8 <[^>]*> addu \$a0,\$a0,\$a1
0+04ac <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+04ac R_MIPS_GOT16 .bss
-0+04b0 <[^>]*> lui \$at,1
+0+04b0 <[^>]*> lui \$at,0x1
0+04b4 <[^>]*> addiu \$at,\$at,0
[ ]*RELOC: 0+04b4 R_MIPS_LO16 .bss
0+04b8 <[^>]*> addu \$a0,\$a0,\$at
0+04bc <[^>]*> addu \$a0,\$a0,\$a1
0+04c0 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+04c0 R_MIPS_GOT16 .bss
-0+04c4 <[^>]*> lui \$at,1
+0+04c4 <[^>]*> lui \$at,0x1
0+04c8 <[^>]*> addiu \$at,\$at,1000
[ ]*RELOC: 0+04c8 R_MIPS_LO16 .bss
0+04cc <[^>]*> addu \$a0,\$a0,\$at
0+04d0 <[^>]*> addu \$a0,\$a0,\$a1
0+04d4 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+04d4 R_MIPS_GOT16 .data
-0+04d8 <[^>]*> lui \$at,2
+0+04d8 <[^>]*> lui \$at,0x2
0+04dc <[^>]*> addiu \$at,\$at,-23131
[ ]*RELOC: 0+04dc R_MIPS_LO16 .data
0+04e0 <[^>]*> addu \$a0,\$a0,\$at
0+04e4 <[^>]*> addu \$a0,\$a0,\$a1
0+04e8 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+04e8 R_MIPS_GOT16 big_external_data_label
-0+04ec <[^>]*> lui \$at,2
+0+04ec <[^>]*> lui \$at,0x2
0+04f0 <[^>]*> addiu \$at,\$at,-23131
0+04f4 <[^>]*> addu \$a0,\$a0,\$at
0+04f8 <[^>]*> addu \$a0,\$a0,\$a1
0+04fc <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+04fc R_MIPS_GOT16 small_external_data_label
-0+0500 <[^>]*> lui \$at,2
+0+0500 <[^>]*> lui \$at,0x2
0+0504 <[^>]*> addiu \$at,\$at,-23131
0+0508 <[^>]*> addu \$a0,\$a0,\$at
0+050c <[^>]*> addu \$a0,\$a0,\$a1
0+0510 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0510 R_MIPS_GOT16 big_external_common
-0+0514 <[^>]*> lui \$at,2
+0+0514 <[^>]*> lui \$at,0x2
0+0518 <[^>]*> addiu \$at,\$at,-23131
0+051c <[^>]*> addu \$a0,\$a0,\$at
0+0520 <[^>]*> addu \$a0,\$a0,\$a1
0+0524 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0524 R_MIPS_GOT16 small_external_common
-0+0528 <[^>]*> lui \$at,2
+0+0528 <[^>]*> lui \$at,0x2
0+052c <[^>]*> addiu \$at,\$at,-23131
0+0530 <[^>]*> addu \$a0,\$a0,\$at
0+0534 <[^>]*> addu \$a0,\$a0,\$a1
0+0538 <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+0538 R_MIPS_GOT16 .bss
-0+053c <[^>]*> lui \$at,2
+0+053c <[^>]*> lui \$at,0x2
0+0540 <[^>]*> addiu \$at,\$at,-23131
[ ]*RELOC: 0+0540 R_MIPS_LO16 .bss
0+0544 <[^>]*> addu \$a0,\$a0,\$at
0+0548 <[^>]*> addu \$a0,\$a0,\$a1
0+054c <[^>]*> lw \$a0,0\(\$gp\)
[ ]*RELOC: 0+054c R_MIPS_GOT16 .bss
-0+0550 <[^>]*> lui \$at,2
+0+0550 <[^>]*> lui \$at,0x2
0+0554 <[^>]*> addiu \$at,\$at,-22131
[ ]*RELOC: 0+0554 R_MIPS_LO16 .bss
0+0558 <[^>]*> addu \$a0,\$a0,\$at
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-xgot.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-xgot.d
new file mode 100644
index 00000000000..e50adf76861
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la-xgot.d
@@ -0,0 +1,618 @@
+#objdump: -dr
+#name: MIPS la-xgot
+#as: -mips1 -KPIC -xgot
+#source: la.s
+
+# Test the la macro with -KPIC -xgot.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> li \$a0,0
+0+0004 <[^>]*> li \$a0,1
+0+0008 <[^>]*> li \$a0,0x8000
+0+000c <[^>]*> li \$a0,-32768
+0+0010 <[^>]*> lui \$a0,0x1
+0+0014 <[^>]*> lui \$a0,0x1
+0+0018 <[^>]*> ori \$a0,\$a0,0xa5a5
+0+001c <[^>]*> li \$a0,0
+0+0020 <[^>]*> addu \$a0,\$a0,\$a1
+0+0024 <[^>]*> li \$a0,1
+0+0028 <[^>]*> addu \$a0,\$a0,\$a1
+0+002c <[^>]*> li \$a0,0x8000
+0+0030 <[^>]*> addu \$a0,\$a0,\$a1
+0+0034 <[^>]*> li \$a0,-32768
+0+0038 <[^>]*> addu \$a0,\$a0,\$a1
+0+003c <[^>]*> lui \$a0,0x1
+0+0040 <[^>]*> addu \$a0,\$a0,\$a1
+0+0044 <[^>]*> lui \$a0,0x1
+0+0048 <[^>]*> ori \$a0,\$a0,0xa5a5
+0+004c <[^>]*> addu \$a0,\$a0,\$a1
+0+0050 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0050 R_MIPS_GOT16 .data
+...
+0+0058 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+0058 R_MIPS_LO16 .data
+0+005c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+005c R_MIPS_GOT_HI16 big_external_data_label
+0+0060 <[^>]*> addu \$a0,\$a0,\$gp
+0+0064 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0064 R_MIPS_GOT_LO16 big_external_data_label
+0+0068 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0068 R_MIPS_GOT_HI16 small_external_data_label
+0+006c <[^>]*> addu \$a0,\$a0,\$gp
+0+0070 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0070 R_MIPS_GOT_LO16 small_external_data_label
+0+0074 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0074 R_MIPS_GOT_HI16 big_external_common
+0+0078 <[^>]*> addu \$a0,\$a0,\$gp
+0+007c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+007c R_MIPS_GOT_LO16 big_external_common
+0+0080 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0080 R_MIPS_GOT_HI16 small_external_common
+0+0084 <[^>]*> addu \$a0,\$a0,\$gp
+0+0088 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0088 R_MIPS_GOT_LO16 small_external_common
+0+008c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+008c R_MIPS_GOT16 .bss
+...
+0+0094 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+0094 R_MIPS_LO16 .bss
+0+0098 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0098 R_MIPS_GOT16 .bss
+...
+0+00a0 <[^>]*> addiu \$a0,\$a0,1000
+[ ]*RELOC: 0+00a0 R_MIPS_LO16 .bss
+0+00a4 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+00a4 R_MIPS_GOT16 .data
+...
+0+00ac <[^>]*> addiu \$a0,\$a0,1
+[ ]*RELOC: 0+00ac R_MIPS_LO16 .data
+0+00b0 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00b0 R_MIPS_GOT_HI16 big_external_data_label
+0+00b4 <[^>]*> addu \$a0,\$a0,\$gp
+0+00b8 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00b8 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+00c0 <[^>]*> addiu \$a0,\$a0,1
+0+00c4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00c4 R_MIPS_GOT_HI16 small_external_data_label
+0+00c8 <[^>]*> addu \$a0,\$a0,\$gp
+0+00cc <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00cc R_MIPS_GOT_LO16 small_external_data_label
+...
+0+00d4 <[^>]*> addiu \$a0,\$a0,1
+0+00d8 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00d8 R_MIPS_GOT_HI16 big_external_common
+0+00dc <[^>]*> addu \$a0,\$a0,\$gp
+0+00e0 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00e0 R_MIPS_GOT_LO16 big_external_common
+...
+0+00e8 <[^>]*> addiu \$a0,\$a0,1
+0+00ec <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00ec R_MIPS_GOT_HI16 small_external_common
+0+00f0 <[^>]*> addu \$a0,\$a0,\$gp
+0+00f4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00f4 R_MIPS_GOT_LO16 small_external_common
+...
+0+00fc <[^>]*> addiu \$a0,\$a0,1
+0+0100 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0100 R_MIPS_GOT16 .bss
+...
+0+0108 <[^>]*> addiu \$a0,\$a0,1
+[ ]*RELOC: 0+0108 R_MIPS_LO16 .bss
+0+010c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+010c R_MIPS_GOT16 .bss
+...
+0+0114 <[^>]*> addiu \$a0,\$a0,1001
+[ ]*RELOC: 0+0114 R_MIPS_LO16 .bss
+0+0118 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0118 R_MIPS_GOT16 .data
+0+011c <[^>]*> lui \$at,0x1
+0+0120 <[^>]*> addiu \$at,\$at,-32768
+[ ]*RELOC: 0+0120 R_MIPS_LO16 .data
+0+0124 <[^>]*> addu \$a0,\$a0,\$at
+0+0128 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0128 R_MIPS_GOT_HI16 big_external_data_label
+0+012c <[^>]*> addu \$a0,\$a0,\$gp
+0+0130 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0130 R_MIPS_GOT_LO16 big_external_data_label
+0+0134 <[^>]*> lui \$at,0x1
+0+0138 <[^>]*> addiu \$at,\$at,-32768
+0+013c <[^>]*> addu \$a0,\$a0,\$at
+0+0140 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0140 R_MIPS_GOT_HI16 small_external_data_label
+0+0144 <[^>]*> addu \$a0,\$a0,\$gp
+0+0148 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0148 R_MIPS_GOT_LO16 small_external_data_label
+0+014c <[^>]*> lui \$at,0x1
+0+0150 <[^>]*> addiu \$at,\$at,-32768
+0+0154 <[^>]*> addu \$a0,\$a0,\$at
+0+0158 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0158 R_MIPS_GOT_HI16 big_external_common
+0+015c <[^>]*> addu \$a0,\$a0,\$gp
+0+0160 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0160 R_MIPS_GOT_LO16 big_external_common
+0+0164 <[^>]*> lui \$at,0x1
+0+0168 <[^>]*> addiu \$at,\$at,-32768
+0+016c <[^>]*> addu \$a0,\$a0,\$at
+0+0170 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0170 R_MIPS_GOT_HI16 small_external_common
+0+0174 <[^>]*> addu \$a0,\$a0,\$gp
+0+0178 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0178 R_MIPS_GOT_LO16 small_external_common
+0+017c <[^>]*> lui \$at,0x1
+0+0180 <[^>]*> addiu \$at,\$at,-32768
+0+0184 <[^>]*> addu \$a0,\$a0,\$at
+0+0188 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0188 R_MIPS_GOT16 .bss
+0+018c <[^>]*> lui \$at,0x1
+0+0190 <[^>]*> addiu \$at,\$at,-32768
+[ ]*RELOC: 0+0190 R_MIPS_LO16 .bss
+0+0194 <[^>]*> addu \$a0,\$a0,\$at
+0+0198 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0198 R_MIPS_GOT16 .bss
+0+019c <[^>]*> lui \$at,0x1
+0+01a0 <[^>]*> addiu \$at,\$at,-31768
+[ ]*RELOC: 0+01a0 R_MIPS_LO16 .bss
+0+01a4 <[^>]*> addu \$a0,\$a0,\$at
+0+01a8 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+01a8 R_MIPS_GOT16 .data
+...
+0+01b0 <[^>]*> addiu \$a0,\$a0,-32768
+[ ]*RELOC: 0+01b0 R_MIPS_LO16 .data
+0+01b4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01b4 R_MIPS_GOT_HI16 big_external_data_label
+0+01b8 <[^>]*> addu \$a0,\$a0,\$gp
+0+01bc <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01bc R_MIPS_GOT_LO16 big_external_data_label
+...
+0+01c4 <[^>]*> addiu \$a0,\$a0,-32768
+0+01c8 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01c8 R_MIPS_GOT_HI16 small_external_data_label
+0+01cc <[^>]*> addu \$a0,\$a0,\$gp
+0+01d0 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01d0 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+01d8 <[^>]*> addiu \$a0,\$a0,-32768
+0+01dc <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01dc R_MIPS_GOT_HI16 big_external_common
+0+01e0 <[^>]*> addu \$a0,\$a0,\$gp
+0+01e4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01e4 R_MIPS_GOT_LO16 big_external_common
+...
+0+01ec <[^>]*> addiu \$a0,\$a0,-32768
+0+01f0 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01f0 R_MIPS_GOT_HI16 small_external_common
+0+01f4 <[^>]*> addu \$a0,\$a0,\$gp
+0+01f8 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01f8 R_MIPS_GOT_LO16 small_external_common
+...
+0+0200 <[^>]*> addiu \$a0,\$a0,-32768
+0+0204 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0204 R_MIPS_GOT16 .bss
+...
+0+020c <[^>]*> addiu \$a0,\$a0,-32768
+[ ]*RELOC: 0+020c R_MIPS_LO16 .bss
+0+0210 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0210 R_MIPS_GOT16 .bss
+...
+0+0218 <[^>]*> addiu \$a0,\$a0,-31768
+[ ]*RELOC: 0+0218 R_MIPS_LO16 .bss
+0+021c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+021c R_MIPS_GOT16 .data
+0+0220 <[^>]*> lui \$at,0x1
+0+0224 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0224 R_MIPS_LO16 .data
+0+0228 <[^>]*> addu \$a0,\$a0,\$at
+0+022c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+022c R_MIPS_GOT_HI16 big_external_data_label
+0+0230 <[^>]*> addu \$a0,\$a0,\$gp
+0+0234 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0234 R_MIPS_GOT_LO16 big_external_data_label
+0+0238 <[^>]*> lui \$at,0x1
+0+023c <[^>]*> addiu \$at,\$at,0
+0+0240 <[^>]*> addu \$a0,\$a0,\$at
+0+0244 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0244 R_MIPS_GOT_HI16 small_external_data_label
+0+0248 <[^>]*> addu \$a0,\$a0,\$gp
+0+024c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+024c R_MIPS_GOT_LO16 small_external_data_label
+0+0250 <[^>]*> lui \$at,0x1
+0+0254 <[^>]*> addiu \$at,\$at,0
+0+0258 <[^>]*> addu \$a0,\$a0,\$at
+0+025c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+025c R_MIPS_GOT_HI16 big_external_common
+0+0260 <[^>]*> addu \$a0,\$a0,\$gp
+0+0264 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0264 R_MIPS_GOT_LO16 big_external_common
+0+0268 <[^>]*> lui \$at,0x1
+0+026c <[^>]*> addiu \$at,\$at,0
+0+0270 <[^>]*> addu \$a0,\$a0,\$at
+0+0274 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0274 R_MIPS_GOT_HI16 small_external_common
+0+0278 <[^>]*> addu \$a0,\$a0,\$gp
+0+027c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+027c R_MIPS_GOT_LO16 small_external_common
+0+0280 <[^>]*> lui \$at,0x1
+0+0284 <[^>]*> addiu \$at,\$at,0
+0+0288 <[^>]*> addu \$a0,\$a0,\$at
+0+028c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+028c R_MIPS_GOT16 .bss
+0+0290 <[^>]*> lui \$at,0x1
+0+0294 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0294 R_MIPS_LO16 .bss
+0+0298 <[^>]*> addu \$a0,\$a0,\$at
+0+029c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+029c R_MIPS_GOT16 .bss
+0+02a0 <[^>]*> lui \$at,0x1
+0+02a4 <[^>]*> addiu \$at,\$at,1000
+[ ]*RELOC: 0+02a4 R_MIPS_LO16 .bss
+0+02a8 <[^>]*> addu \$a0,\$a0,\$at
+0+02ac <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+02ac R_MIPS_GOT16 .data
+0+02b0 <[^>]*> lui \$at,0x2
+0+02b4 <[^>]*> addiu \$at,\$at,-23131
+[ ]*RELOC: 0+02b4 R_MIPS_LO16 .data
+0+02b8 <[^>]*> addu \$a0,\$a0,\$at
+0+02bc <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+02bc R_MIPS_GOT_HI16 big_external_data_label
+0+02c0 <[^>]*> addu \$a0,\$a0,\$gp
+0+02c4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+02c4 R_MIPS_GOT_LO16 big_external_data_label
+0+02c8 <[^>]*> lui \$at,0x2
+0+02cc <[^>]*> addiu \$at,\$at,-23131
+0+02d0 <[^>]*> addu \$a0,\$a0,\$at
+0+02d4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+02d4 R_MIPS_GOT_HI16 small_external_data_label
+0+02d8 <[^>]*> addu \$a0,\$a0,\$gp
+0+02dc <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+02dc R_MIPS_GOT_LO16 small_external_data_label
+0+02e0 <[^>]*> lui \$at,0x2
+0+02e4 <[^>]*> addiu \$at,\$at,-23131
+0+02e8 <[^>]*> addu \$a0,\$a0,\$at
+0+02ec <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+02ec R_MIPS_GOT_HI16 big_external_common
+0+02f0 <[^>]*> addu \$a0,\$a0,\$gp
+0+02f4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+02f4 R_MIPS_GOT_LO16 big_external_common
+0+02f8 <[^>]*> lui \$at,0x2
+0+02fc <[^>]*> addiu \$at,\$at,-23131
+0+0300 <[^>]*> addu \$a0,\$a0,\$at
+0+0304 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0304 R_MIPS_GOT_HI16 small_external_common
+0+0308 <[^>]*> addu \$a0,\$a0,\$gp
+0+030c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+030c R_MIPS_GOT_LO16 small_external_common
+0+0310 <[^>]*> lui \$at,0x2
+0+0314 <[^>]*> addiu \$at,\$at,-23131
+0+0318 <[^>]*> addu \$a0,\$a0,\$at
+0+031c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+031c R_MIPS_GOT16 .bss
+0+0320 <[^>]*> lui \$at,0x2
+0+0324 <[^>]*> addiu \$at,\$at,-23131
+[ ]*RELOC: 0+0324 R_MIPS_LO16 .bss
+0+0328 <[^>]*> addu \$a0,\$a0,\$at
+0+032c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+032c R_MIPS_GOT16 .bss
+0+0330 <[^>]*> lui \$at,0x2
+0+0334 <[^>]*> addiu \$at,\$at,-22131
+[ ]*RELOC: 0+0334 R_MIPS_LO16 .bss
+0+0338 <[^>]*> addu \$a0,\$a0,\$at
+0+033c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+033c R_MIPS_GOT16 .data
+...
+0+0344 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+0344 R_MIPS_LO16 .data
+0+0348 <[^>]*> addu \$a0,\$a0,\$a1
+0+034c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+034c R_MIPS_GOT_HI16 big_external_data_label
+0+0350 <[^>]*> addu \$a0,\$a0,\$gp
+0+0354 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0354 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+035c <[^>]*> addu \$a0,\$a0,\$a1
+0+0360 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0360 R_MIPS_GOT_HI16 small_external_data_label
+0+0364 <[^>]*> addu \$a0,\$a0,\$gp
+0+0368 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0368 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+0370 <[^>]*> addu \$a0,\$a0,\$a1
+0+0374 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0374 R_MIPS_GOT_HI16 big_external_common
+0+0378 <[^>]*> addu \$a0,\$a0,\$gp
+0+037c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+037c R_MIPS_GOT_LO16 big_external_common
+...
+0+0384 <[^>]*> addu \$a0,\$a0,\$a1
+0+0388 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0388 R_MIPS_GOT_HI16 small_external_common
+0+038c <[^>]*> addu \$a0,\$a0,\$gp
+0+0390 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0390 R_MIPS_GOT_LO16 small_external_common
+...
+0+0398 <[^>]*> addu \$a0,\$a0,\$a1
+0+039c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+039c R_MIPS_GOT16 .bss
+...
+0+03a4 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+03a4 R_MIPS_LO16 .bss
+0+03a8 <[^>]*> addu \$a0,\$a0,\$a1
+0+03ac <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+03ac R_MIPS_GOT16 .bss
+...
+0+03b4 <[^>]*> addiu \$a0,\$a0,1000
+[ ]*RELOC: 0+03b4 R_MIPS_LO16 .bss
+0+03b8 <[^>]*> addu \$a0,\$a0,\$a1
+0+03bc <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+03bc R_MIPS_GOT16 .data
+...
+0+03c4 <[^>]*> addiu \$a0,\$a0,1
+[ ]*RELOC: 0+03c4 R_MIPS_LO16 .data
+0+03c8 <[^>]*> addu \$a0,\$a0,\$a1
+0+03cc <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+03cc R_MIPS_GOT_HI16 big_external_data_label
+0+03d0 <[^>]*> addu \$a0,\$a0,\$gp
+0+03d4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+03d4 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+03dc <[^>]*> addiu \$a0,\$a0,1
+0+03e0 <[^>]*> addu \$a0,\$a0,\$a1
+0+03e4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+03e4 R_MIPS_GOT_HI16 small_external_data_label
+0+03e8 <[^>]*> addu \$a0,\$a0,\$gp
+0+03ec <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+03ec R_MIPS_GOT_LO16 small_external_data_label
+...
+0+03f4 <[^>]*> addiu \$a0,\$a0,1
+0+03f8 <[^>]*> addu \$a0,\$a0,\$a1
+0+03fc <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+03fc R_MIPS_GOT_HI16 big_external_common
+0+0400 <[^>]*> addu \$a0,\$a0,\$gp
+0+0404 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0404 R_MIPS_GOT_LO16 big_external_common
+...
+0+040c <[^>]*> addiu \$a0,\$a0,1
+0+0410 <[^>]*> addu \$a0,\$a0,\$a1
+0+0414 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0414 R_MIPS_GOT_HI16 small_external_common
+0+0418 <[^>]*> addu \$a0,\$a0,\$gp
+0+041c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+041c R_MIPS_GOT_LO16 small_external_common
+...
+0+0424 <[^>]*> addiu \$a0,\$a0,1
+0+0428 <[^>]*> addu \$a0,\$a0,\$a1
+0+042c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+042c R_MIPS_GOT16 .bss
+...
+0+0434 <[^>]*> addiu \$a0,\$a0,1
+[ ]*RELOC: 0+0434 R_MIPS_LO16 .bss
+0+0438 <[^>]*> addu \$a0,\$a0,\$a1
+0+043c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+043c R_MIPS_GOT16 .bss
+...
+0+0444 <[^>]*> addiu \$a0,\$a0,1001
+[ ]*RELOC: 0+0444 R_MIPS_LO16 .bss
+0+0448 <[^>]*> addu \$a0,\$a0,\$a1
+0+044c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+044c R_MIPS_GOT16 .data
+0+0450 <[^>]*> lui \$at,0x1
+0+0454 <[^>]*> addiu \$at,\$at,-32768
+[ ]*RELOC: 0+0454 R_MIPS_LO16 .data
+0+0458 <[^>]*> addu \$a0,\$a0,\$at
+0+045c <[^>]*> addu \$a0,\$a0,\$a1
+0+0460 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0460 R_MIPS_GOT_HI16 big_external_data_label
+0+0464 <[^>]*> addu \$a0,\$a0,\$gp
+0+0468 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0468 R_MIPS_GOT_LO16 big_external_data_label
+0+046c <[^>]*> lui \$at,0x1
+0+0470 <[^>]*> addiu \$at,\$at,-32768
+0+0474 <[^>]*> addu \$a0,\$a0,\$at
+0+0478 <[^>]*> addu \$a0,\$a0,\$a1
+0+047c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+047c R_MIPS_GOT_HI16 small_external_data_label
+0+0480 <[^>]*> addu \$a0,\$a0,\$gp
+0+0484 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0484 R_MIPS_GOT_LO16 small_external_data_label
+0+0488 <[^>]*> lui \$at,0x1
+0+048c <[^>]*> addiu \$at,\$at,-32768
+0+0490 <[^>]*> addu \$a0,\$a0,\$at
+0+0494 <[^>]*> addu \$a0,\$a0,\$a1
+0+0498 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0498 R_MIPS_GOT_HI16 big_external_common
+0+049c <[^>]*> addu \$a0,\$a0,\$gp
+0+04a0 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+04a0 R_MIPS_GOT_LO16 big_external_common
+0+04a4 <[^>]*> lui \$at,0x1
+0+04a8 <[^>]*> addiu \$at,\$at,-32768
+0+04ac <[^>]*> addu \$a0,\$a0,\$at
+0+04b0 <[^>]*> addu \$a0,\$a0,\$a1
+0+04b4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+04b4 R_MIPS_GOT_HI16 small_external_common
+0+04b8 <[^>]*> addu \$a0,\$a0,\$gp
+0+04bc <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+04bc R_MIPS_GOT_LO16 small_external_common
+0+04c0 <[^>]*> lui \$at,0x1
+0+04c4 <[^>]*> addiu \$at,\$at,-32768
+0+04c8 <[^>]*> addu \$a0,\$a0,\$at
+0+04cc <[^>]*> addu \$a0,\$a0,\$a1
+0+04d0 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+04d0 R_MIPS_GOT16 .bss
+0+04d4 <[^>]*> lui \$at,0x1
+0+04d8 <[^>]*> addiu \$at,\$at,-32768
+[ ]*RELOC: 0+04d8 R_MIPS_LO16 .bss
+0+04dc <[^>]*> addu \$a0,\$a0,\$at
+0+04e0 <[^>]*> addu \$a0,\$a0,\$a1
+0+04e4 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+04e4 R_MIPS_GOT16 .bss
+0+04e8 <[^>]*> lui \$at,0x1
+0+04ec <[^>]*> addiu \$at,\$at,-31768
+[ ]*RELOC: 0+04ec R_MIPS_LO16 .bss
+0+04f0 <[^>]*> addu \$a0,\$a0,\$at
+0+04f4 <[^>]*> addu \$a0,\$a0,\$a1
+0+04f8 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+04f8 R_MIPS_GOT16 .data
+...
+0+0500 <[^>]*> addiu \$a0,\$a0,-32768
+[ ]*RELOC: 0+0500 R_MIPS_LO16 .data
+0+0504 <[^>]*> addu \$a0,\$a0,\$a1
+0+0508 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0508 R_MIPS_GOT_HI16 big_external_data_label
+0+050c <[^>]*> addu \$a0,\$a0,\$gp
+0+0510 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0510 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0518 <[^>]*> addiu \$a0,\$a0,-32768
+0+051c <[^>]*> addu \$a0,\$a0,\$a1
+0+0520 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0520 R_MIPS_GOT_HI16 small_external_data_label
+0+0524 <[^>]*> addu \$a0,\$a0,\$gp
+0+0528 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0528 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+0530 <[^>]*> addiu \$a0,\$a0,-32768
+0+0534 <[^>]*> addu \$a0,\$a0,\$a1
+0+0538 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0538 R_MIPS_GOT_HI16 big_external_common
+0+053c <[^>]*> addu \$a0,\$a0,\$gp
+0+0540 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0540 R_MIPS_GOT_LO16 big_external_common
+...
+0+0548 <[^>]*> addiu \$a0,\$a0,-32768
+0+054c <[^>]*> addu \$a0,\$a0,\$a1
+0+0550 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0550 R_MIPS_GOT_HI16 small_external_common
+0+0554 <[^>]*> addu \$a0,\$a0,\$gp
+0+0558 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0558 R_MIPS_GOT_LO16 small_external_common
+...
+0+0560 <[^>]*> addiu \$a0,\$a0,-32768
+0+0564 <[^>]*> addu \$a0,\$a0,\$a1
+0+0568 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0568 R_MIPS_GOT16 .bss
+...
+0+0570 <[^>]*> addiu \$a0,\$a0,-32768
+[ ]*RELOC: 0+0570 R_MIPS_LO16 .bss
+0+0574 <[^>]*> addu \$a0,\$a0,\$a1
+0+0578 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0578 R_MIPS_GOT16 .bss
+...
+0+0580 <[^>]*> addiu \$a0,\$a0,-31768
+[ ]*RELOC: 0+0580 R_MIPS_LO16 .bss
+0+0584 <[^>]*> addu \$a0,\$a0,\$a1
+0+0588 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0588 R_MIPS_GOT16 .data
+0+058c <[^>]*> lui \$at,0x1
+0+0590 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0590 R_MIPS_LO16 .data
+0+0594 <[^>]*> addu \$a0,\$a0,\$at
+0+0598 <[^>]*> addu \$a0,\$a0,\$a1
+0+059c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+059c R_MIPS_GOT_HI16 big_external_data_label
+0+05a0 <[^>]*> addu \$a0,\$a0,\$gp
+0+05a4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+05a4 R_MIPS_GOT_LO16 big_external_data_label
+0+05a8 <[^>]*> lui \$at,0x1
+0+05ac <[^>]*> addiu \$at,\$at,0
+0+05b0 <[^>]*> addu \$a0,\$a0,\$at
+0+05b4 <[^>]*> addu \$a0,\$a0,\$a1
+0+05b8 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+05b8 R_MIPS_GOT_HI16 small_external_data_label
+0+05bc <[^>]*> addu \$a0,\$a0,\$gp
+0+05c0 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+05c0 R_MIPS_GOT_LO16 small_external_data_label
+0+05c4 <[^>]*> lui \$at,0x1
+0+05c8 <[^>]*> addiu \$at,\$at,0
+0+05cc <[^>]*> addu \$a0,\$a0,\$at
+0+05d0 <[^>]*> addu \$a0,\$a0,\$a1
+0+05d4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+05d4 R_MIPS_GOT_HI16 big_external_common
+0+05d8 <[^>]*> addu \$a0,\$a0,\$gp
+0+05dc <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+05dc R_MIPS_GOT_LO16 big_external_common
+0+05e0 <[^>]*> lui \$at,0x1
+0+05e4 <[^>]*> addiu \$at,\$at,0
+0+05e8 <[^>]*> addu \$a0,\$a0,\$at
+0+05ec <[^>]*> addu \$a0,\$a0,\$a1
+0+05f0 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+05f0 R_MIPS_GOT_HI16 small_external_common
+0+05f4 <[^>]*> addu \$a0,\$a0,\$gp
+0+05f8 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+05f8 R_MIPS_GOT_LO16 small_external_common
+0+05fc <[^>]*> lui \$at,0x1
+0+0600 <[^>]*> addiu \$at,\$at,0
+0+0604 <[^>]*> addu \$a0,\$a0,\$at
+0+0608 <[^>]*> addu \$a0,\$a0,\$a1
+0+060c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+060c R_MIPS_GOT16 .bss
+0+0610 <[^>]*> lui \$at,0x1
+0+0614 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0614 R_MIPS_LO16 .bss
+0+0618 <[^>]*> addu \$a0,\$a0,\$at
+0+061c <[^>]*> addu \$a0,\$a0,\$a1
+0+0620 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0620 R_MIPS_GOT16 .bss
+0+0624 <[^>]*> lui \$at,0x1
+0+0628 <[^>]*> addiu \$at,\$at,1000
+[ ]*RELOC: 0+0628 R_MIPS_LO16 .bss
+0+062c <[^>]*> addu \$a0,\$a0,\$at
+0+0630 <[^>]*> addu \$a0,\$a0,\$a1
+0+0634 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0634 R_MIPS_GOT16 .data
+0+0638 <[^>]*> lui \$at,0x2
+0+063c <[^>]*> addiu \$at,\$at,-23131
+[ ]*RELOC: 0+063c R_MIPS_LO16 .data
+0+0640 <[^>]*> addu \$a0,\$a0,\$at
+0+0644 <[^>]*> addu \$a0,\$a0,\$a1
+0+0648 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0648 R_MIPS_GOT_HI16 big_external_data_label
+0+064c <[^>]*> addu \$a0,\$a0,\$gp
+0+0650 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0650 R_MIPS_GOT_LO16 big_external_data_label
+0+0654 <[^>]*> lui \$at,0x2
+0+0658 <[^>]*> addiu \$at,\$at,-23131
+0+065c <[^>]*> addu \$a0,\$a0,\$at
+0+0660 <[^>]*> addu \$a0,\$a0,\$a1
+0+0664 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0664 R_MIPS_GOT_HI16 small_external_data_label
+0+0668 <[^>]*> addu \$a0,\$a0,\$gp
+0+066c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+066c R_MIPS_GOT_LO16 small_external_data_label
+0+0670 <[^>]*> lui \$at,0x2
+0+0674 <[^>]*> addiu \$at,\$at,-23131
+0+0678 <[^>]*> addu \$a0,\$a0,\$at
+0+067c <[^>]*> addu \$a0,\$a0,\$a1
+0+0680 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0680 R_MIPS_GOT_HI16 big_external_common
+0+0684 <[^>]*> addu \$a0,\$a0,\$gp
+0+0688 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0688 R_MIPS_GOT_LO16 big_external_common
+0+068c <[^>]*> lui \$at,0x2
+0+0690 <[^>]*> addiu \$at,\$at,-23131
+0+0694 <[^>]*> addu \$a0,\$a0,\$at
+0+0698 <[^>]*> addu \$a0,\$a0,\$a1
+0+069c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+069c R_MIPS_GOT_HI16 small_external_common
+0+06a0 <[^>]*> addu \$a0,\$a0,\$gp
+0+06a4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+06a4 R_MIPS_GOT_LO16 small_external_common
+0+06a8 <[^>]*> lui \$at,0x2
+0+06ac <[^>]*> addiu \$at,\$at,-23131
+0+06b0 <[^>]*> addu \$a0,\$a0,\$at
+0+06b4 <[^>]*> addu \$a0,\$a0,\$a1
+0+06b8 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+06b8 R_MIPS_GOT16 .bss
+0+06bc <[^>]*> lui \$at,0x2
+0+06c0 <[^>]*> addiu \$at,\$at,-23131
+[ ]*RELOC: 0+06c0 R_MIPS_LO16 .bss
+0+06c4 <[^>]*> addu \$a0,\$a0,\$at
+0+06c8 <[^>]*> addu \$a0,\$a0,\$a1
+0+06cc <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+06cc R_MIPS_GOT16 .bss
+0+06d0 <[^>]*> lui \$at,0x2
+0+06d4 <[^>]*> addiu \$at,\$at,-22131
+[ ]*RELOC: 0+06d4 R_MIPS_LO16 .bss
+0+06d8 <[^>]*> addu \$a0,\$a0,\$at
+0+06dc <[^>]*> addu \$a0,\$a0,\$a1
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la.d
index 218fa6e6198..98fa2161e5f 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/la.d
@@ -9,387 +9,376 @@
Disassembly of section .text:
0+0000 <[^>]*> li \$a0,0
0+0004 <[^>]*> li \$a0,1
-0+0008 <[^>]*> li \$a0,32768
+0+0008 <[^>]*> li \$a0,0x8000
0+000c <[^>]*> li \$a0,-32768
-0+0010 <[^>]*> lui \$a0,1
-0+0014 <[^>]*> lui \$a0,1
-0+0018 <[^>]*> ori \$a0,\$a0,42405
+0+0010 <[^>]*> lui \$a0,0x1
+0+0014 <[^>]*> lui \$a0,0x1
+0+0018 <[^>]*> ori \$a0,\$a0,0xa5a5
0+001c <[^>]*> li \$a0,0
0+0020 <[^>]*> addu \$a0,\$a0,\$a1
0+0024 <[^>]*> li \$a0,1
0+0028 <[^>]*> addu \$a0,\$a0,\$a1
-0+002c <[^>]*> li \$a0,32768
+0+002c <[^>]*> li \$a0,0x8000
0+0030 <[^>]*> addu \$a0,\$a0,\$a1
0+0034 <[^>]*> li \$a0,-32768
0+0038 <[^>]*> addu \$a0,\$a0,\$a1
-0+003c <[^>]*> lui \$a0,1
+0+003c <[^>]*> lui \$a0,0x1
0+0040 <[^>]*> addu \$a0,\$a0,\$a1
-0+0044 <[^>]*> lui \$a0,1
-0+0048 <[^>]*> ori \$a0,\$a0,42405
+0+0044 <[^>]*> lui \$a0,0x1
+0+0048 <[^>]*> ori \$a0,\$a0,0xa5a5
0+004c <[^>]*> addu \$a0,\$a0,\$a1
-0+0050 <[^>]*> lui \$a0,0
+0+0050 <[^>]*> lui \$a0,0x0
[ ]*RELOC: 0+0050 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0054 <[^>]*> addiu \$a0,\$a0,[-0-9]+
[ ]*RELOC: 0+0054 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0058 <[^>]*> lui \$a0,0
+0+0058 <[^>]*> lui \$a0,0x0
[ ]*RELOC: 0+0058 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+005c <[^>]*> addiu \$a0,\$a0,0
[ ]*RELOC: 0+005c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+0060 <[^>]*> addiu \$a0,\$gp,0
[ ]*RELOC: 0+0060 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
-0+0064 <[^>]*> lui \$a0,0
+0+0064 <[^>]*> lui \$a0,0x0
[ ]*RELOC: 0+0064 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0068 <[^>]*> addiu \$a0,\$a0,0
[ ]*RELOC: 0+0068 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
0+006c <[^>]*> addiu \$a0,\$gp,0
[ ]*RELOC: 0+006c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
-0+0070 <[^>]*> lui \$a0,0
+0+0070 <[^>]*> lui \$a0,0x0
[ ]*RELOC: 0+0070 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+0074 <[^>]*> addiu \$a0,\$a0,[-0-9]+
[ ]*RELOC: 0+0074 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
0+0078 <[^>]*> addiu \$a0,\$gp,[-0-9]+
[ ]*RELOC: 0+0078 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
-0+007c <[^>]*> lui \$a0,0
+0+007c <[^>]*> lui \$a0,0x0
[ ]*RELOC: 0+007c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0080 <[^>]*> addiu \$a0,\$a0,[-0-9]+
[ ]*RELOC: 0+0080 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0084 <[^>]*> lui \$a0,0
+0+0084 <[^>]*> lui \$a0,0x0
[ ]*RELOC: 0+0084 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0088 <[^>]*> addiu \$a0,\$a0,[-0-9]+
[ ]*RELOC: 0+0088 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+008c <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+008c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0090 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0090 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0094 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0094 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0098 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0098 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+009c <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+009c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+008c <[^>]*> addiu \$a0,\$gp,[-0-9]+
+[ ]*RELOC: 0+008c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+0090 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0090 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0094 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+0094 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0098 <[^>]*> addiu \$a0,\$gp,[-0-9]+
+[ ]*RELOC: 0+0098 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+009c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+009c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+00a0 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+00a0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+00a4 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+00a4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+00a8 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+00a8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+00ac <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+00ac [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+00b0 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+00b0 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+00b4 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+00b4 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+00b8 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+00b8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+00bc <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+00bc [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+00c0 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+00c0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+00c4 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+00c4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+00c8 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+00c8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+00cc <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+00cc [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+00d0 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+00d0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+00d4 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+00d4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+00d8 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+00d8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+00dc <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+00dc [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+00e0 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+00e0 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+00e4 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+00e4 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+00e8 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+00e8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+00ec <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+00ec [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+00f0 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+00f0 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+00f4 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+00f4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+00f8 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+00f8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+00fc <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+00fc [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0100 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0100 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0104 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0104 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0108 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0108 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+010c <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+010c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0110 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0110 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0114 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0114 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0118 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0118 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+011c <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+011c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0120 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0120 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0124 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0124 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0128 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0128 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+012c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+012c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0130 <[^>]*> addiu \$a0,\$a0,0
-[ ]*RELOC: 0+0130 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0134 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0134 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0138 <[^>]*> addiu \$a0,\$a0,0
-[ ]*RELOC: 0+0138 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+013c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+013c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0140 <[^>]*> addiu \$a0,\$a0,0
-[ ]*RELOC: 0+0140 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0144 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0144 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0148 <[^>]*> addiu \$a0,\$a0,0
-[ ]*RELOC: 0+0148 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+014c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+014c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0150 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0150 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0154 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0154 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0158 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0158 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+015c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+015c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0160 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0160 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0164 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0164 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0168 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0168 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+016c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+016c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0170 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0170 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0174 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0174 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0178 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0178 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+017c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+017c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0180 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0180 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0184 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0184 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0188 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0188 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+018c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+018c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0190 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0190 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0194 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0194 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0198 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0198 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+00a0 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+00a4 <[^>]*> addiu \$a0,\$gp,[-0-9]+
+[ ]*RELOC: 0+00a4 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00a8 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+00a8 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+00ac <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+00ac [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+00b0 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+00b0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+00b4 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+00b4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+00b8 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+00b8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+00bc <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+00bc [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+00c0 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+00c0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+00c4 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+00c4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+00c8 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+00c8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+00cc <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+00cc [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+00d0 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+00d0 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+00d4 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+00d4 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+00d8 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+00d8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+00dc <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+00dc [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+00e0 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00e0 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+00e4 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+00e4 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+00e8 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00e8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+00ec <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+00ec [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+00f0 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00f0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+00f4 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+00f4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+00f8 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00f8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+00fc <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+00fc [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0100 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0100 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0104 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+0104 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0108 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0108 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+010c <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+010c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0110 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0110 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0114 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+0114 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0118 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0118 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+011c <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+011c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0120 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0120 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0124 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+0124 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0128 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0128 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+012c <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+012c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0130 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0130 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0134 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+0134 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0138 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0138 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+013c <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+013c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0140 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0140 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0144 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+0144 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0148 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0148 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+014c <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+014c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0150 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0150 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0154 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+0154 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0158 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0158 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+015c <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+015c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0160 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0160 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+0164 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+0164 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0168 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0168 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+016c <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+016c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0170 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0170 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0174 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+0174 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0178 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0178 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+017c <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+017c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0180 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0180 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0184 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+0184 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0188 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0188 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+018c <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+018c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0190 <[^>]*> addu \$a0,\$a0,\$a1
+0+0194 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0194 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0198 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+0198 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+019c <[^>]*> addu \$a0,\$a0,\$a1
-0+01a0 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+01a0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+01a4 <[^>]*> addiu \$a0,\$a0,0
-[ ]*RELOC: 0+01a4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+01a8 <[^>]*> addu \$a0,\$a0,\$a1
-0+01ac <[^>]*> addiu \$a0,\$gp,0
-[ ]*RELOC: 0+01ac [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+01a0 <[^>]*> addiu \$a0,\$gp,0
+[ ]*RELOC: 0+01a0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+01a4 <[^>]*> addu \$a0,\$a0,\$a1
+0+01a8 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01a8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+01ac <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+01ac [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
0+01b0 <[^>]*> addu \$a0,\$a0,\$a1
-0+01b4 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+01b4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+01b8 <[^>]*> addiu \$a0,\$a0,0
-[ ]*RELOC: 0+01b8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+01bc <[^>]*> addu \$a0,\$a0,\$a1
-0+01c0 <[^>]*> addiu \$a0,\$gp,0
-[ ]*RELOC: 0+01c0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+01b4 <[^>]*> addiu \$a0,\$gp,0
+[ ]*RELOC: 0+01b4 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+01b8 <[^>]*> addu \$a0,\$a0,\$a1
+0+01bc <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01bc [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+01c0 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+01c0 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
0+01c4 <[^>]*> addu \$a0,\$a0,\$a1
-0+01c8 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+01c8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+01cc <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+01cc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+01d0 <[^>]*> addu \$a0,\$a0,\$a1
-0+01d4 <[^>]*> addiu \$a0,\$gp,[-0-9]+
-[ ]*RELOC: 0+01d4 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+01c8 <[^>]*> addiu \$a0,\$gp,[-0-9]+
+[ ]*RELOC: 0+01c8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+01cc <[^>]*> addu \$a0,\$a0,\$a1
+0+01d0 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01d0 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+01d4 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+01d4 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+01d8 <[^>]*> addu \$a0,\$a0,\$a1
-0+01dc <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+01dc [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+01dc <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01dc [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+01e0 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+01e0 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+01e0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+01e4 <[^>]*> addu \$a0,\$a0,\$a1
-0+01e8 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+01e8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+01ec <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+01ec [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+01f0 <[^>]*> addu \$a0,\$a0,\$a1
-0+01f4 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+01f4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+01f8 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+01f8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+01fc <[^>]*> addu \$a0,\$a0,\$a1
-0+0200 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0200 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0204 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0204 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0208 <[^>]*> addu \$a0,\$a0,\$a1
-0+020c <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+020c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0210 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0210 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+01e8 <[^>]*> addiu \$a0,\$gp,[-0-9]+
+[ ]*RELOC: 0+01e8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+01ec <[^>]*> addu \$a0,\$a0,\$a1
+0+01f0 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01f0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+01f4 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+01f4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+01f8 <[^>]*> addu \$a0,\$a0,\$a1
+0+01fc <[^>]*> addiu \$a0,\$gp,[-0-9]+
+[ ]*RELOC: 0+01fc [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+0200 <[^>]*> addu \$a0,\$a0,\$a1
+0+0204 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0204 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0208 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+0208 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+020c <[^>]*> addu \$a0,\$a0,\$a1
+0+0210 <[^>]*> addiu \$a0,\$gp,[-0-9]+
+[ ]*RELOC: 0+0210 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
0+0214 <[^>]*> addu \$a0,\$a0,\$a1
-0+0218 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0218 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0218 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0218 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+021c <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+021c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+021c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+0220 <[^>]*> addu \$a0,\$a0,\$a1
-0+0224 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0224 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0224 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0224 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0228 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0228 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+0228 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+022c <[^>]*> addu \$a0,\$a0,\$a1
-0+0230 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0230 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0230 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0230 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+0234 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0234 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+0234 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
0+0238 <[^>]*> addu \$a0,\$a0,\$a1
-0+023c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+023c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+023c <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+023c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0240 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0240 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+0240 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
0+0244 <[^>]*> addu \$a0,\$a0,\$a1
-0+0248 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0248 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+0248 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0248 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+024c <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+024c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+024c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
0+0250 <[^>]*> addu \$a0,\$a0,\$a1
-0+0254 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0254 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0254 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0254 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+0258 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0258 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+0258 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
0+025c <[^>]*> addu \$a0,\$a0,\$a1
-0+0260 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0260 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0260 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0260 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+0264 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0264 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+0264 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
0+0268 <[^>]*> addu \$a0,\$a0,\$a1
-0+026c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+026c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+026c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+026c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0270 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0270 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+0270 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+0274 <[^>]*> addu \$a0,\$a0,\$a1
-0+0278 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0278 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0278 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0278 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+027c <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+027c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+027c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+0280 <[^>]*> addu \$a0,\$a0,\$a1
-0+0284 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0284 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0284 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0284 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+0288 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0288 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+0288 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
0+028c <[^>]*> addu \$a0,\$a0,\$a1
-0+0290 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0290 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0290 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0290 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0294 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0294 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+0294 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
0+0298 <[^>]*> addu \$a0,\$a0,\$a1
-0+029c <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+029c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+029c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+029c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+02a0 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+02a0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+02a0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
0+02a4 <[^>]*> addu \$a0,\$a0,\$a1
-0+02a8 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+02a8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+02a8 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+02a8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+02ac <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+02ac [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+02ac [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
0+02b0 <[^>]*> addu \$a0,\$a0,\$a1
-0+02b4 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+02b4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+02b4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+02b4 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+02b8 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+02b8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+02b8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
0+02bc <[^>]*> addu \$a0,\$a0,\$a1
-0+02c0 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+02c0 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+02c0 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+02c0 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+02c4 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+02c4 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+02c4 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+02c8 <[^>]*> addu \$a0,\$a0,\$a1
-0+02cc <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+02cc [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+02d0 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+02d0 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+02cc <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+02cc [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+02d0 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+02d0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+02d4 <[^>]*> addu \$a0,\$a0,\$a1
-0+02d8 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+02d8 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+02dc <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+02dc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+02d8 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+02d8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+02dc <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+02dc [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
0+02e0 <[^>]*> addu \$a0,\$a0,\$a1
-0+02e4 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+02e4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+02e4 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+02e4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+02e8 <[^>]*> addiu \$a0,\$a0,0
-[ ]*RELOC: 0+02e8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+02e8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
0+02ec <[^>]*> addu \$a0,\$a0,\$a1
-0+02f0 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+02f0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+02f0 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+02f0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+02f4 <[^>]*> addiu \$a0,\$a0,0
-[ ]*RELOC: 0+02f4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+02f4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
0+02f8 <[^>]*> addu \$a0,\$a0,\$a1
-0+02fc <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+02fc [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0300 <[^>]*> addiu \$a0,\$a0,0
-[ ]*RELOC: 0+0300 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+02fc <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+02fc [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0300 <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+0300 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
0+0304 <[^>]*> addu \$a0,\$a0,\$a1
-0+0308 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0308 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+030c <[^>]*> addiu \$a0,\$a0,0
-[ ]*RELOC: 0+030c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0308 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0308 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+030c <[^>]*> addiu \$a0,\$a0,[-0-9]+
+[ ]*RELOC: 0+030c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
0+0310 <[^>]*> addu \$a0,\$a0,\$a1
-0+0314 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0314 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0314 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0314 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0318 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0318 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+0318 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+031c <[^>]*> addu \$a0,\$a0,\$a1
-0+0320 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0320 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0320 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0320 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0324 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0324 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+0324 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+0328 <[^>]*> addu \$a0,\$a0,\$a1
-0+032c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+032c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+032c <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+032c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+0330 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0330 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+0330 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
0+0334 <[^>]*> addu \$a0,\$a0,\$a1
-0+0338 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0338 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0338 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0338 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+033c <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+033c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+033c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
0+0340 <[^>]*> addu \$a0,\$a0,\$a1
-0+0344 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0344 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+0344 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0344 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+0348 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0348 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+0348 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
0+034c <[^>]*> addu \$a0,\$a0,\$a1
-0+0350 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0350 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0350 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0350 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+0354 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0354 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+0354 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
0+0358 <[^>]*> addu \$a0,\$a0,\$a1
-0+035c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+035c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+035c <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+035c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+0360 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0360 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+0360 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
0+0364 <[^>]*> addu \$a0,\$a0,\$a1
-0+0368 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0368 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+036c <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+036c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0370 <[^>]*> addu \$a0,\$a0,\$a1
-0+0374 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0374 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0378 <[^>]*> addiu \$a0,\$a0,[-0-9]+
-[ ]*RELOC: 0+0378 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+037c <[^>]*> addu \$a0,\$a0,\$a1
+...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-empic.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-empic.d
index a1c2e877405..27b0465f838 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-empic.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-empic.d
@@ -10,23 +10,23 @@
Disassembly of section .text:
0+0000 <[^>]*> lb \$a0,0\(\$zero\)
0+0004 <[^>]*> lb \$a0,1\(\$zero\)
-0+0008 <[^>]*> lui \$a0,1
+0+0008 <[^>]*> lui \$a0,0x1
0+000c <[^>]*> lb \$a0,-32768\(\$a0\)
0+0010 <[^>]*> lb \$a0,-32768\(\$zero\)
-0+0014 <[^>]*> lui \$a0,1
+0+0014 <[^>]*> lui \$a0,0x1
0+0018 <[^>]*> lb \$a0,0\(\$a0\)
-0+001c <[^>]*> lui \$a0,2
+0+001c <[^>]*> lui \$a0,0x2
0+0020 <[^>]*> lb \$a0,-23131\(\$a0\)
0+0024 <[^>]*> lb \$a0,0\(\$a1\)
0+0028 <[^>]*> lb \$a0,1\(\$a1\)
-0+002c <[^>]*> lui \$a0,1
+0+002c <[^>]*> lui \$a0,0x1
0+0030 <[^>]*> addu \$a0,\$a0,\$a1
0+0034 <[^>]*> lb \$a0,-32768\(\$a0\)
0+0038 <[^>]*> lb \$a0,-32768\(\$a1\)
-0+003c <[^>]*> lui \$a0,1
+0+003c <[^>]*> lui \$a0,0x1
0+0040 <[^>]*> addu \$a0,\$a0,\$a1
0+0044 <[^>]*> lb \$a0,0\(\$a0\)
-0+0048 <[^>]*> lui \$a0,2
+0+0048 <[^>]*> lui \$a0,0x2
0+004c <[^>]*> addu \$a0,\$a0,\$a1
0+0050 <[^>]*> lb \$a0,-23131\(\$a0\)
0+0054 <[^>]*> lb \$a0,-16384\(\$gp\)
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-svr4pic.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-svr4pic.d
index 590626d1576..235d1052f94 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-svr4pic.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-svr4pic.d
@@ -10,23 +10,23 @@
Disassembly of section .text:
0+0000 <[^>]*> lb \$a0,0\(\$zero\)
0+0004 <[^>]*> lb \$a0,1\(\$zero\)
-0+0008 <[^>]*> lui \$a0,1
+0+0008 <[^>]*> lui \$a0,0x1
0+000c <[^>]*> lb \$a0,-32768\(\$a0\)
0+0010 <[^>]*> lb \$a0,-32768\(\$zero\)
-0+0014 <[^>]*> lui \$a0,1
+0+0014 <[^>]*> lui \$a0,0x1
0+0018 <[^>]*> lb \$a0,0\(\$a0\)
-0+001c <[^>]*> lui \$a0,2
+0+001c <[^>]*> lui \$a0,0x2
0+0020 <[^>]*> lb \$a0,-23131\(\$a0\)
0+0024 <[^>]*> lb \$a0,0\(\$a1\)
0+0028 <[^>]*> lb \$a0,1\(\$a1\)
-0+002c <[^>]*> lui \$a0,1
+0+002c <[^>]*> lui \$a0,0x1
0+0030 <[^>]*> addu \$a0,\$a0,\$a1
0+0034 <[^>]*> lb \$a0,-32768\(\$a0\)
0+0038 <[^>]*> lb \$a0,-32768\(\$a1\)
-0+003c <[^>]*> lui \$a0,1
+0+003c <[^>]*> lui \$a0,0x1
0+0040 <[^>]*> addu \$a0,\$a0,\$a1
0+0044 <[^>]*> lb \$a0,0\(\$a0\)
-0+0048 <[^>]*> lui \$a0,2
+0+0048 <[^>]*> lui \$a0,0x2
0+004c <[^>]*> addu \$a0,\$a0,\$a1
0+0050 <[^>]*> lb \$a0,-23131\(\$a0\)
0+0054 <[^>]*> lw \$a0,0\(\$gp\)
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-xgot.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-xgot.d
new file mode 100644
index 00000000000..f42d3139ff4
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb-xgot.d
@@ -0,0 +1,242 @@
+#objdump: -dr
+#name: MIPS lb-xgot
+#as: -mips1 -KPIC -xgot
+#source: lb-pic.s
+
+# Test the lb macro with -KPIC -xgot.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> lb \$a0,0\(\$zero\)
+0+0004 <[^>]*> lb \$a0,1\(\$zero\)
+0+0008 <[^>]*> lui \$a0,0x1
+0+000c <[^>]*> lb \$a0,-32768\(\$a0\)
+0+0010 <[^>]*> lb \$a0,-32768\(\$zero\)
+0+0014 <[^>]*> lui \$a0,0x1
+0+0018 <[^>]*> lb \$a0,0\(\$a0\)
+0+001c <[^>]*> lui \$a0,0x2
+0+0020 <[^>]*> lb \$a0,-23131\(\$a0\)
+0+0024 <[^>]*> lb \$a0,0\(\$a1\)
+0+0028 <[^>]*> lb \$a0,1\(\$a1\)
+0+002c <[^>]*> lui \$a0,0x1
+0+0030 <[^>]*> addu \$a0,\$a0,\$a1
+0+0034 <[^>]*> lb \$a0,-32768\(\$a0\)
+0+0038 <[^>]*> lb \$a0,-32768\(\$a1\)
+0+003c <[^>]*> lui \$a0,0x1
+0+0040 <[^>]*> addu \$a0,\$a0,\$a1
+0+0044 <[^>]*> lb \$a0,0\(\$a0\)
+0+0048 <[^>]*> lui \$a0,0x2
+0+004c <[^>]*> addu \$a0,\$a0,\$a1
+0+0050 <[^>]*> lb \$a0,-23131\(\$a0\)
+0+0054 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0054 R_MIPS_GOT16 .data
+...
+0+005c <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+005c R_MIPS_LO16 .data
+...
+0+0064 <[^>]*> lb \$a0,0\(\$a0\)
+0+0068 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0068 R_MIPS_GOT_HI16 big_external_data_label
+0+006c <[^>]*> addu \$a0,\$a0,\$gp
+0+0070 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0070 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0078 <[^>]*> lb \$a0,0\(\$a0\)
+0+007c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+007c R_MIPS_GOT_HI16 small_external_data_label
+0+0080 <[^>]*> addu \$a0,\$a0,\$gp
+0+0084 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0084 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+008c <[^>]*> lb \$a0,0\(\$a0\)
+0+0090 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0090 R_MIPS_GOT_HI16 big_external_common
+0+0094 <[^>]*> addu \$a0,\$a0,\$gp
+0+0098 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0098 R_MIPS_GOT_LO16 big_external_common
+...
+0+00a0 <[^>]*> lb \$a0,0\(\$a0\)
+0+00a4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00a4 R_MIPS_GOT_HI16 small_external_common
+0+00a8 <[^>]*> addu \$a0,\$a0,\$gp
+0+00ac <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00ac R_MIPS_GOT_LO16 small_external_common
+...
+0+00b4 <[^>]*> lb \$a0,0\(\$a0\)
+0+00b8 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+00b8 R_MIPS_GOT16 .bss
+...
+0+00c0 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+00c0 R_MIPS_LO16 .bss
+...
+0+00c8 <[^>]*> lb \$a0,0\(\$a0\)
+0+00cc <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+00cc R_MIPS_GOT16 .bss
+...
+0+00d4 <[^>]*> addiu \$a0,\$a0,1000
+[ ]*RELOC: 0+00d4 R_MIPS_LO16 .bss
+...
+0+00dc <[^>]*> lb \$a0,0\(\$a0\)
+0+00e0 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+00e0 R_MIPS_GOT16 .data
+...
+0+00e8 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+00e8 R_MIPS_LO16 .data
+...
+0+00f0 <[^>]*> lb \$a0,1\(\$a0\)
+0+00f4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00f4 R_MIPS_GOT_HI16 big_external_data_label
+0+00f8 <[^>]*> addu \$a0,\$a0,\$gp
+0+00fc <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00fc R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0104 <[^>]*> lb \$a0,1\(\$a0\)
+0+0108 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0108 R_MIPS_GOT_HI16 small_external_data_label
+0+010c <[^>]*> addu \$a0,\$a0,\$gp
+0+0110 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0110 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+0118 <[^>]*> lb \$a0,1\(\$a0\)
+0+011c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+011c R_MIPS_GOT_HI16 big_external_common
+0+0120 <[^>]*> addu \$a0,\$a0,\$gp
+0+0124 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0124 R_MIPS_GOT_LO16 big_external_common
+...
+0+012c <[^>]*> lb \$a0,1\(\$a0\)
+0+0130 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0130 R_MIPS_GOT_HI16 small_external_common
+0+0134 <[^>]*> addu \$a0,\$a0,\$gp
+0+0138 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0138 R_MIPS_GOT_LO16 small_external_common
+...
+0+0140 <[^>]*> lb \$a0,1\(\$a0\)
+0+0144 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0144 R_MIPS_GOT16 .bss
+...
+0+014c <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+014c R_MIPS_LO16 .bss
+...
+0+0154 <[^>]*> lb \$a0,1\(\$a0\)
+0+0158 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0158 R_MIPS_GOT16 .bss
+...
+0+0160 <[^>]*> addiu \$a0,\$a0,1000
+[ ]*RELOC: 0+0160 R_MIPS_LO16 .bss
+...
+0+0168 <[^>]*> lb \$a0,1\(\$a0\)
+0+016c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+016c R_MIPS_GOT16 .data
+...
+0+0174 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+0174 R_MIPS_LO16 .data
+...
+0+017c <[^>]*> addu \$a0,\$a0,\$a1
+0+0180 <[^>]*> lb \$a0,0\(\$a0\)
+0+0184 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0184 R_MIPS_GOT_HI16 big_external_data_label
+0+0188 <[^>]*> addu \$a0,\$a0,\$gp
+0+018c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+018c R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0194 <[^>]*> addu \$a0,\$a0,\$a1
+0+0198 <[^>]*> lb \$a0,0\(\$a0\)
+0+019c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+019c R_MIPS_GOT_HI16 small_external_data_label
+0+01a0 <[^>]*> addu \$a0,\$a0,\$gp
+0+01a4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01a4 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+01ac <[^>]*> addu \$a0,\$a0,\$a1
+0+01b0 <[^>]*> lb \$a0,0\(\$a0\)
+0+01b4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01b4 R_MIPS_GOT_HI16 big_external_common
+0+01b8 <[^>]*> addu \$a0,\$a0,\$gp
+0+01bc <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01bc R_MIPS_GOT_LO16 big_external_common
+...
+0+01c4 <[^>]*> addu \$a0,\$a0,\$a1
+0+01c8 <[^>]*> lb \$a0,0\(\$a0\)
+0+01cc <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01cc R_MIPS_GOT_HI16 small_external_common
+0+01d0 <[^>]*> addu \$a0,\$a0,\$gp
+0+01d4 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01d4 R_MIPS_GOT_LO16 small_external_common
+...
+0+01dc <[^>]*> addu \$a0,\$a0,\$a1
+0+01e0 <[^>]*> lb \$a0,0\(\$a0\)
+0+01e4 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+01e4 R_MIPS_GOT16 .bss
+...
+0+01ec <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+01ec R_MIPS_LO16 .bss
+...
+0+01f4 <[^>]*> addu \$a0,\$a0,\$a1
+0+01f8 <[^>]*> lb \$a0,0\(\$a0\)
+0+01fc <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+01fc R_MIPS_GOT16 .bss
+...
+0+0204 <[^>]*> addiu \$a0,\$a0,1000
+[ ]*RELOC: 0+0204 R_MIPS_LO16 .bss
+...
+0+020c <[^>]*> addu \$a0,\$a0,\$a1
+0+0210 <[^>]*> lb \$a0,0\(\$a0\)
+0+0214 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0214 R_MIPS_GOT16 .data
+...
+0+021c <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+021c R_MIPS_LO16 .data
+...
+0+0224 <[^>]*> addu \$a0,\$a0,\$a1
+0+0228 <[^>]*> lb \$a0,1\(\$a0\)
+0+022c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+022c R_MIPS_GOT_HI16 big_external_data_label
+0+0230 <[^>]*> addu \$a0,\$a0,\$gp
+0+0234 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0234 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+023c <[^>]*> addu \$a0,\$a0,\$a1
+0+0240 <[^>]*> lb \$a0,1\(\$a0\)
+0+0244 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0244 R_MIPS_GOT_HI16 small_external_data_label
+0+0248 <[^>]*> addu \$a0,\$a0,\$gp
+0+024c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+024c R_MIPS_GOT_LO16 small_external_data_label
+...
+0+0254 <[^>]*> addu \$a0,\$a0,\$a1
+0+0258 <[^>]*> lb \$a0,1\(\$a0\)
+0+025c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+025c R_MIPS_GOT_HI16 big_external_common
+0+0260 <[^>]*> addu \$a0,\$a0,\$gp
+0+0264 <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0264 R_MIPS_GOT_LO16 big_external_common
+...
+0+026c <[^>]*> addu \$a0,\$a0,\$a1
+0+0270 <[^>]*> lb \$a0,1\(\$a0\)
+0+0274 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0274 R_MIPS_GOT_HI16 small_external_common
+0+0278 <[^>]*> addu \$a0,\$a0,\$gp
+0+027c <[^>]*> lw \$a0,0\(\$a0\)
+[ ]*RELOC: 0+027c R_MIPS_GOT_LO16 small_external_common
+...
+0+0284 <[^>]*> addu \$a0,\$a0,\$a1
+0+0288 <[^>]*> lb \$a0,1\(\$a0\)
+0+028c <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+028c R_MIPS_GOT16 .bss
+...
+0+0294 <[^>]*> addiu \$a0,\$a0,0
+[ ]*RELOC: 0+0294 R_MIPS_LO16 .bss
+...
+0+029c <[^>]*> addu \$a0,\$a0,\$a1
+0+02a0 <[^>]*> lb \$a0,1\(\$a0\)
+0+02a4 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+02a4 R_MIPS_GOT16 .bss
+...
+0+02ac <[^>]*> addiu \$a0,\$a0,1000
+[ ]*RELOC: 0+02ac R_MIPS_LO16 .bss
+...
+0+02b4 <[^>]*> addu \$a0,\$a0,\$a1
+0+02b8 <[^>]*> lb \$a0,1\(\$a0\)
+...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb.d
index 9a9061e261a..1808d024205 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lb.d
@@ -9,399 +9,387 @@
Disassembly of section .text:
0+0000 <[^>]*> lb \$a0,0\(\$zero\)
0+0004 <[^>]*> lb \$a0,1\(\$zero\)
-0+0008 <[^>]*> lui \$a0,1
+0+0008 <[^>]*> lui \$a0,0x1
0+000c <[^>]*> lb \$a0,-32768\(\$a0\)
0+0010 <[^>]*> lb \$a0,-32768\(\$zero\)
-0+0014 <[^>]*> lui \$a0,1
+0+0014 <[^>]*> lui \$a0,0x1
0+0018 <[^>]*> lb \$a0,0\(\$a0\)
-0+001c <[^>]*> lui \$a0,2
+0+001c <[^>]*> lui \$a0,0x2
0+0020 <[^>]*> lb \$a0,-23131\(\$a0\)
0+0024 <[^>]*> lb \$a0,0\(\$a1\)
0+0028 <[^>]*> lb \$a0,1\(\$a1\)
-0+002c <[^>]*> lui \$a0,1
+0+002c <[^>]*> lui \$a0,0x1
0+0030 <[^>]*> addu \$a0,\$a0,\$a1
0+0034 <[^>]*> lb \$a0,-32768\(\$a0\)
0+0038 <[^>]*> lb \$a0,-32768\(\$a1\)
-0+003c <[^>]*> lui \$a0,1
+0+003c <[^>]*> lui \$a0,0x1
0+0040 <[^>]*> addu \$a0,\$a0,\$a1
0+0044 <[^>]*> lb \$a0,0\(\$a0\)
-0+0048 <[^>]*> lui \$a0,2
+0+0048 <[^>]*> lui \$a0,0x2
0+004c <[^>]*> addu \$a0,\$a0,\$a1
0+0050 <[^>]*> lb \$a0,-23131\(\$a0\)
-0+0054 <[^>]*> lui \$a0,0
+0+0054 <[^>]*> lui \$a0,0x0
[ ]*RELOC: 0+0054 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0058 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
[ ]*RELOC: 0+0058 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+005c <[^>]*> lui \$a0,0
+0+005c <[^>]*> lui \$a0,0x0
[ ]*RELOC: 0+005c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0060 <[^>]*> lb \$a0,0\(\$a0\)
[ ]*RELOC: 0+0060 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+0064 <[^>]*> lb \$a0,0\(\$gp\)
[ ]*RELOC: 0+0064 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
-0+0068 <[^>]*> lui \$a0,0
+0+0068 <[^>]*> lui \$a0,0x0
[ ]*RELOC: 0+0068 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+006c <[^>]*> lb \$a0,0\(\$a0\)
[ ]*RELOC: 0+006c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
0+0070 <[^>]*> lb \$a0,0\(\$gp\)
[ ]*RELOC: 0+0070 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
-0+0074 <[^>]*> lui \$a0,0
+0+0074 <[^>]*> lui \$a0,0x0
[ ]*RELOC: 0+0074 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+0078 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
[ ]*RELOC: 0+0078 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
0+007c <[^>]*> lb \$a0,-16384\(\$gp\)
[ ]*RELOC: 0+007c [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
-0+0080 <[^>]*> lui \$a0,0
+0+0080 <[^>]*> lui \$a0,0x0
[ ]*RELOC: 0+0080 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0084 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
[ ]*RELOC: 0+0084 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0088 <[^>]*> lui \$a0,0
+0+0088 <[^>]*> lui \$a0,0x0
[ ]*RELOC: 0+0088 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+008c <[^>]*> lb \$a0,1\(\$a0\)
[ ]*RELOC: 0+008c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0090 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0090 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0094 <[^>]*> lb \$a0,1\(\$a0\)
-[ ]*RELOC: 0+0094 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0098 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0098 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+009c <[^>]*> lb \$a0,1\(\$a0\)
-[ ]*RELOC: 0+009c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+00a0 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+00a0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+00a4 <[^>]*> lb \$a0,1\(\$a0\)
-[ ]*RELOC: 0+00a4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+00a8 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+00a8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+00ac <[^>]*> lb \$a0,[0-9]+\(\$a0\)
-[ ]*RELOC: 0+00ac [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+00b0 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+00b0 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+00b4 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
-[ ]*RELOC: 0+00b4 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+00b8 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+00b8 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+00bc <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+00bc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+00c0 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+00c0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+00c4 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+00c4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+00c8 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+00c8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+00cc <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+00cc [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+00d0 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+00d0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+00d4 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+00d4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+00d8 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+00d8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+00dc <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+00dc [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+00e0 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+00e0 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+00e4 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+00e4 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+00e8 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+00e8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+00ec <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+00ec [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+00f0 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+00f0 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+00f4 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+00f4 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+00f8 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+00f8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+00fc <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+00fc [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0100 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0100 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0104 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0104 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0108 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0108 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+010c <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+010c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0110 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0110 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0114 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0114 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0118 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0118 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+011c <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+011c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0120 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0120 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0124 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0124 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0128 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0128 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+012c <[^>]*> lb \$a0,[0-9]+\(\$a0\)
-[ ]*RELOC: 0+012c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0130 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0130 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0134 <[^>]*> lb \$a0,0\(\$a0\)
-[ ]*RELOC: 0+0134 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0138 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0138 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+013c <[^>]*> lb \$a0,0\(\$a0\)
-[ ]*RELOC: 0+013c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0140 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0140 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0144 <[^>]*> lb \$a0,0\(\$a0\)
-[ ]*RELOC: 0+0144 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0148 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0148 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+014c <[^>]*> lb \$a0,0\(\$a0\)
-[ ]*RELOC: 0+014c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0150 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0150 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0154 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
-[ ]*RELOC: 0+0154 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0158 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0158 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+015c <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+015c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0160 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0160 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0164 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0164 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0168 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0168 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+016c <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+016c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0170 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0170 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0174 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0174 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0178 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0178 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+017c <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+017c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0180 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0180 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0184 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0184 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0188 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0188 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+018c <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+018c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0190 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0190 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0194 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0194 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0198 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0198 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0090 <[^>]*> lb \$a0,1\(\$gp\)
+[ ]*RELOC: 0+0090 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+0094 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0094 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0098 <[^>]*> lb \$a0,1\(\$a0\)
+[ ]*RELOC: 0+0098 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+009c <[^>]*> lb \$a0,1\(\$gp\)
+[ ]*RELOC: 0+009c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00a0 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00a0 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+00a4 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
+[ ]*RELOC: 0+00a4 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+00a8 <[^>]*> lb \$a0,[-0-9]+\(\$gp\)
+[ ]*RELOC: 0+00a8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00ac <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+00ac [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+00b0 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+00b0 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+00b4 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+00b4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+00b8 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+00b8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+00bc <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+00bc [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+00c0 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+00c0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+00c4 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+00c4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+00c8 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+00c8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+00cc <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+00cc [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+00d0 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+00d0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+00d4 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+00d4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+00d8 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+00d8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+00dc <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+00dc [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+00e0 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+00e0 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+00e4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00e4 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+00e8 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+00e8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+00ec <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00ec [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+00f0 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+00f0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+00f4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00f4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+00f8 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+00f8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+00fc <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+00fc [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0100 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0100 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0104 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0104 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0108 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0108 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+010c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+010c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0110 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0110 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0114 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0114 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0118 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0118 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+011c <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+011c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0120 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
+[ ]*RELOC: 0+0120 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0124 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0124 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0128 <[^>]*> lb \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0128 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+012c <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+012c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+0130 <[^>]*> lb \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0130 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0134 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0134 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0138 <[^>]*> lb \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0138 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+013c <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+013c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0140 <[^>]*> lb \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0140 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0144 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0144 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0148 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
+[ ]*RELOC: 0+0148 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+014c <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+014c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0150 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0150 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0154 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0154 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0158 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0158 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+015c <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+015c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0160 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0160 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0164 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0164 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+0168 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0168 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+016c <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+016c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0170 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0170 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0174 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0174 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0178 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0178 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+017c <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+017c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0180 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0180 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0184 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0184 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0188 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0188 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+018c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+018c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0190 <[^>]*> addu \$a0,\$a0,\$a1
+0+0194 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
+[ ]*RELOC: 0+0194 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0198 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0198 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+019c <[^>]*> addu \$a0,\$a0,\$a1
-0+01a0 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
-[ ]*RELOC: 0+01a0 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+01a4 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+01a4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+01a8 <[^>]*> addu \$a0,\$a0,\$a1
-0+01ac <[^>]*> lb \$a0,0\(\$a0\)
-[ ]*RELOC: 0+01ac [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+01b0 <[^>]*> addu \$a0,\$a1,\$gp
+0+01a0 <[^>]*> lb \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01a0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+01a4 <[^>]*> addu \$a0,\$a1,\$gp
+0+01a8 <[^>]*> lb \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01a8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+01ac <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01ac [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+01b0 <[^>]*> addu \$a0,\$a0,\$a1
0+01b4 <[^>]*> lb \$a0,0\(\$a0\)
-[ ]*RELOC: 0+01b4 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
-0+01b8 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+01b8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+01bc <[^>]*> addu \$a0,\$a0,\$a1
-0+01c0 <[^>]*> lb \$a0,0\(\$a0\)
-[ ]*RELOC: 0+01c0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+01c4 <[^>]*> addu \$a0,\$a1,\$gp
-0+01c8 <[^>]*> lb \$a0,0\(\$a0\)
-[ ]*RELOC: 0+01c8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
-0+01cc <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+01cc [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+01d0 <[^>]*> addu \$a0,\$a0,\$a1
-0+01d4 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
-[ ]*RELOC: 0+01d4 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+01d8 <[^>]*> addu \$a0,\$a1,\$gp
-0+01dc <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+01dc [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
-0+01e0 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+01e0 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+01b4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+01b8 <[^>]*> addu \$a0,\$a1,\$gp
+0+01bc <[^>]*> lb \$a0,0\(\$a0\)
+[ ]*RELOC: 0+01bc [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+01c0 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01c0 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+01c4 <[^>]*> addu \$a0,\$a0,\$a1
+0+01c8 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
+[ ]*RELOC: 0+01c8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+01cc <[^>]*> addu \$a0,\$a1,\$gp
+0+01d0 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+01d0 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+01d4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01d4 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+01d8 <[^>]*> addu \$a0,\$a0,\$a1
+0+01dc <[^>]*> lb \$a0,[0-9]+\(\$a0\)
+[ ]*RELOC: 0+01dc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+01e0 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01e0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+01e4 <[^>]*> addu \$a0,\$a0,\$a1
-0+01e8 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
-[ ]*RELOC: 0+01e8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+01ec <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+01ec [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+01f0 <[^>]*> addu \$a0,\$a0,\$a1
-0+01f4 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+01f4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+01f8 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+01f8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+01fc <[^>]*> addu \$a0,\$a0,\$a1
-0+0200 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0200 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0204 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0204 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0208 <[^>]*> addu \$a0,\$a0,\$a1
-0+020c <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+020c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0210 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0210 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0214 <[^>]*> addu \$a0,\$a0,\$a1
+0+01e8 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+01e8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+01ec <[^>]*> addu \$a0,\$a1,\$gp
+0+01f0 <[^>]*> lb \$a0,1\(\$a0\)
+[ ]*RELOC: 0+01f0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+01f4 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+01f4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+01f8 <[^>]*> addu \$a0,\$a0,\$a1
+0+01fc <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+01fc [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0200 <[^>]*> addu \$a0,\$a1,\$gp
+0+0204 <[^>]*> lb \$a0,1\(\$a0\)
+[ ]*RELOC: 0+0204 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+0208 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0208 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+020c <[^>]*> addu \$a0,\$a0,\$a1
+0+0210 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
+[ ]*RELOC: 0+0210 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0214 <[^>]*> addu \$a0,\$a1,\$gp
0+0218 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0218 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+021c <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+021c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+0218 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+021c <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+021c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0220 <[^>]*> addu \$a0,\$a0,\$a1
-0+0224 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
-[ ]*RELOC: 0+0224 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0228 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0228 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0224 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0224 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0228 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0228 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+022c <[^>]*> addu \$a0,\$a0,\$a1
-0+0230 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
-[ ]*RELOC: 0+0230 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0234 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0234 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0230 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0230 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0234 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0234 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+0238 <[^>]*> addu \$a0,\$a0,\$a1
0+023c <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+023c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0240 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0240 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+023c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0240 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0240 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0244 <[^>]*> addu \$a0,\$a0,\$a1
0+0248 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0248 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+024c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+024c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+0248 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+024c <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+024c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+0250 <[^>]*> addu \$a0,\$a0,\$a1
0+0254 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0254 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0258 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0258 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+0254 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0258 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0258 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+025c <[^>]*> addu \$a0,\$a0,\$a1
0+0260 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0260 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0264 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0264 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+0260 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0264 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0264 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+0268 <[^>]*> addu \$a0,\$a0,\$a1
0+026c <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+026c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0270 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0270 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+026c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0270 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0270 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0274 <[^>]*> addu \$a0,\$a0,\$a1
0+0278 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0278 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+027c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+027c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+0278 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+027c <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+027c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0280 <[^>]*> addu \$a0,\$a0,\$a1
0+0284 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0284 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0288 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0288 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+0284 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0288 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0288 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+028c <[^>]*> addu \$a0,\$a0,\$a1
0+0290 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0290 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0294 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+0294 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+0290 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0294 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+0294 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0298 <[^>]*> addu \$a0,\$a0,\$a1
0+029c <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+029c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+02a0 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+02a0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+029c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+02a0 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+02a0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+02a4 <[^>]*> addu \$a0,\$a0,\$a1
0+02a8 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+02a8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+02ac <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+02ac [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+02a8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+02ac <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+02ac [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+02b0 <[^>]*> addu \$a0,\$a0,\$a1
0+02b4 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+02b4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+02b8 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+02b8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+02b4 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+02b8 <[^>]*> lui \$a0,0x0
+[ ]*RELOC: 0+02b8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+02bc <[^>]*> addu \$a0,\$a0,\$a1
0+02c0 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+02c0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+02c4 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+02c4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+02c0 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+02c4 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+02c4 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+02c8 <[^>]*> addu \$a0,\$a0,\$a1
-0+02cc <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+02cc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+02d0 <[^>]*> lui \$a0,0
-[ ]*RELOC: 0+02d0 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+02cc <[^>]*> lb \$a0,[0-9]+\(\$a0\)
+[ ]*RELOC: 0+02cc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+02d0 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+02d0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+02d4 <[^>]*> addu \$a0,\$a0,\$a1
-0+02d8 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+02d8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+02dc <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+02dc [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+02d8 <[^>]*> lb \$a0,0\(\$a0\)
+[ ]*RELOC: 0+02d8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+02dc <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+02dc [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+02e0 <[^>]*> addu \$a0,\$a0,\$a1
-0+02e4 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
-[ ]*RELOC: 0+02e4 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+02e8 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+02e8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+02e4 <[^>]*> lb \$a0,0\(\$a0\)
+[ ]*RELOC: 0+02e4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+02e8 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+02e8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+02ec <[^>]*> addu \$a0,\$a0,\$a1
0+02f0 <[^>]*> lb \$a0,0\(\$a0\)
-[ ]*RELOC: 0+02f0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+02f4 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+02f4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+02f0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+02f4 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+02f4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+02f8 <[^>]*> addu \$a0,\$a0,\$a1
0+02fc <[^>]*> lb \$a0,0\(\$a0\)
-[ ]*RELOC: 0+02fc [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0300 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0300 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+02fc [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0300 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0300 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+0304 <[^>]*> addu \$a0,\$a0,\$a1
-0+0308 <[^>]*> lb \$a0,0\(\$a0\)
-[ ]*RELOC: 0+0308 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+030c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+030c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0308 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
+[ ]*RELOC: 0+0308 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+030c <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+030c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+0310 <[^>]*> addu \$a0,\$a0,\$a1
-0+0314 <[^>]*> lb \$a0,0\(\$a0\)
-[ ]*RELOC: 0+0314 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0318 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0318 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0314 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0314 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0318 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0318 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+031c <[^>]*> addu \$a0,\$a0,\$a1
-0+0320 <[^>]*> lb \$a0,[0-9]+\(\$a0\)
-[ ]*RELOC: 0+0320 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0324 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0324 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0320 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+0320 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0324 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0324 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0328 <[^>]*> addu \$a0,\$a0,\$a1
0+032c <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+032c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0330 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0330 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+032c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0330 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0330 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+0334 <[^>]*> addu \$a0,\$a0,\$a1
0+0338 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0338 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+033c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+033c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+0338 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+033c <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+033c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0340 <[^>]*> addu \$a0,\$a0,\$a1
0+0344 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0344 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0348 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0348 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+0344 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0348 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0348 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+034c <[^>]*> addu \$a0,\$a0,\$a1
0+0350 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0350 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0354 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0354 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+0350 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0354 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0354 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+0358 <[^>]*> addu \$a0,\$a0,\$a1
0+035c <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+035c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0360 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0360 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+035c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0360 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+0360 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+0364 <[^>]*> addu \$a0,\$a0,\$a1
0+0368 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0368 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+036c <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+036c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0370 <[^>]*> addu \$a0,\$a0,\$a1
-0+0374 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0374 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0378 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+0378 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+037c <[^>]*> addu \$a0,\$a0,\$a1
-0+0380 <[^>]*> lb \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+0380 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0384 <[^>]*> lbu \$a0,0\(\$zero\)
-0+0388 <[^>]*> lh \$a0,0\(\$zero\)
-0+038c <[^>]*> lhu \$a0,0\(\$zero\)
-0+0390 <[^>]*> lw \$a0,0\(\$zero\)
-0+0394 <[^>]*> lwl \$a0,0\(\$zero\)
-0+0398 <[^>]*> lwr \$a0,0\(\$zero\)
-0+039c <[^>]*> ll \$a0,0\(\$zero\)
-0+03a0 <[^>]*> lwc1 \$f4,0\(\$zero\)
-0+03a4 <[^>]*> lwc2 \$4,0\(\$zero\)
-0+03a8 <[^>]*> lwc3 \$4,0\(\$zero\)
+[ ]*RELOC: 0+0368 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+036c <[^>]*> lbu \$a0,0\(\$zero\)
+0+0370 <[^>]*> lh \$a0,0\(\$zero\)
+0+0374 <[^>]*> lhu \$a0,0\(\$zero\)
+0+0378 <[^>]*> lw \$a0,0\(\$zero\)
+0+037c <[^>]*> lwl \$a0,0\(\$zero\)
+0+0380 <[^>]*> lwr \$a0,0\(\$zero\)
+0+0384 <[^>]*> ll \$a0,0\(\$zero\)
+0+0388 <[^>]*> lwc1 \$f4,0\(\$zero\)
+0+038c <[^>]*> lwc2 \$4,0\(\$zero\)
+0+0390 <[^>]*> lwc3 \$4,0\(\$zero\)
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-empic.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-empic.d
index d9d3f6e7bd8..1f5a60274e3 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-empic.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-empic.d
@@ -12,15 +12,15 @@ Disassembly of section .text:
0+0004 <[^>]*> lw \$a1,4\(\$zero\)
0+0008 <[^>]*> lw \$a0,1\(\$zero\)
0+000c <[^>]*> lw \$a1,5\(\$zero\)
-0+0010 <[^>]*> lui \$at,1
+0+0010 <[^>]*> lui \$at,0x1
0+0014 <[^>]*> lw \$a0,-32768\(\$at\)
0+0018 <[^>]*> lw \$a1,-32764\(\$at\)
0+001c <[^>]*> lw \$a0,-32768\(\$zero\)
0+0020 <[^>]*> lw \$a1,-32764\(\$zero\)
-0+0024 <[^>]*> lui \$at,1
+0+0024 <[^>]*> lui \$at,0x1
0+0028 <[^>]*> lw \$a0,0\(\$at\)
0+002c <[^>]*> lw \$a1,4\(\$at\)
-0+0030 <[^>]*> lui \$at,2
+0+0030 <[^>]*> lui \$at,0x2
0+0034 <[^>]*> lw \$a0,-23131\(\$at\)
0+0038 <[^>]*> lw \$a1,-23127\(\$at\)
...
@@ -29,18 +29,18 @@ Disassembly of section .text:
...
0+004c <[^>]*> lw \$a0,1\(\$a1\)
0+0050 <[^>]*> lw \$a1,5\(\$a1\)
-0+0054 <[^>]*> lui \$at,1
+0+0054 <[^>]*> lui \$at,0x1
0+0058 <[^>]*> addu \$at,\$a1,\$at
0+005c <[^>]*> lw \$a0,-32768\(\$at\)
0+0060 <[^>]*> lw \$a1,-32764\(\$at\)
...
0+0068 <[^>]*> lw \$a0,-32768\(\$a1\)
0+006c <[^>]*> lw \$a1,-32764\(\$a1\)
-0+0070 <[^>]*> lui \$at,1
+0+0070 <[^>]*> lui \$at,0x1
0+0074 <[^>]*> addu \$at,\$a1,\$at
0+0078 <[^>]*> lw \$a0,0\(\$at\)
0+007c <[^>]*> lw \$a1,4\(\$at\)
-0+0080 <[^>]*> lui \$at,2
+0+0080 <[^>]*> lui \$at,0x2
0+0084 <[^>]*> addu \$at,\$a1,\$at
0+0088 <[^>]*> lw \$a0,-23131\(\$at\)
0+008c <[^>]*> lw \$a1,-23127\(\$at\)
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-svr4pic.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-svr4pic.d
index d6c93ecb51c..80348083c64 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-svr4pic.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-svr4pic.d
@@ -12,15 +12,15 @@ Disassembly of section .text:
0+0004 <[^>]*> lw \$a1,4\(\$zero\)
0+0008 <[^>]*> lw \$a0,1\(\$zero\)
0+000c <[^>]*> lw \$a1,5\(\$zero\)
-0+0010 <[^>]*> lui \$at,1
+0+0010 <[^>]*> lui \$at,0x1
0+0014 <[^>]*> lw \$a0,-32768\(\$at\)
0+0018 <[^>]*> lw \$a1,-32764\(\$at\)
0+001c <[^>]*> lw \$a0,-32768\(\$zero\)
0+0020 <[^>]*> lw \$a1,-32764\(\$zero\)
-0+0024 <[^>]*> lui \$at,1
+0+0024 <[^>]*> lui \$at,0x1
0+0028 <[^>]*> lw \$a0,0\(\$at\)
0+002c <[^>]*> lw \$a1,4\(\$at\)
-0+0030 <[^>]*> lui \$at,2
+0+0030 <[^>]*> lui \$at,0x2
0+0034 <[^>]*> lw \$a0,-23131\(\$at\)
0+0038 <[^>]*> lw \$a1,-23127\(\$at\)
...
@@ -29,18 +29,18 @@ Disassembly of section .text:
...
0+004c <[^>]*> lw \$a0,1\(\$a1\)
0+0050 <[^>]*> lw \$a1,5\(\$a1\)
-0+0054 <[^>]*> lui \$at,1
+0+0054 <[^>]*> lui \$at,0x1
0+0058 <[^>]*> addu \$at,\$a1,\$at
0+005c <[^>]*> lw \$a0,-32768\(\$at\)
0+0060 <[^>]*> lw \$a1,-32764\(\$at\)
...
0+0068 <[^>]*> lw \$a0,-32768\(\$a1\)
0+006c <[^>]*> lw \$a1,-32764\(\$a1\)
-0+0070 <[^>]*> lui \$at,1
+0+0070 <[^>]*> lui \$at,0x1
0+0074 <[^>]*> addu \$at,\$a1,\$at
0+0078 <[^>]*> lw \$a0,0\(\$at\)
0+007c <[^>]*> lw \$a1,4\(\$at\)
-0+0080 <[^>]*> lui \$at,2
+0+0080 <[^>]*> lui \$at,0x2
0+0084 <[^>]*> addu \$at,\$a1,\$at
0+0088 <[^>]*> lw \$a0,-23131\(\$at\)
0+008c <[^>]*> lw \$a1,-23127\(\$at\)
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-xgot.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-xgot.d
new file mode 100644
index 00000000000..822f033d9fe
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld-xgot.d
@@ -0,0 +1,273 @@
+#objdump: -dr
+#name: MIPS ld-xgot
+#as: -mips1 -KPIC -xgot
+#source: ld-pic.s
+
+# Test the ld macro with -KPIC -xgot.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> lw \$a0,0\(\$zero\)
+0+0004 <[^>]*> lw \$a1,4\(\$zero\)
+0+0008 <[^>]*> lw \$a0,1\(\$zero\)
+0+000c <[^>]*> lw \$a1,5\(\$zero\)
+0+0010 <[^>]*> lui \$at,0x1
+0+0014 <[^>]*> lw \$a0,-32768\(\$at\)
+0+0018 <[^>]*> lw \$a1,-32764\(\$at\)
+0+001c <[^>]*> lw \$a0,-32768\(\$zero\)
+0+0020 <[^>]*> lw \$a1,-32764\(\$zero\)
+0+0024 <[^>]*> lui \$at,0x1
+0+0028 <[^>]*> lw \$a0,0\(\$at\)
+0+002c <[^>]*> lw \$a1,4\(\$at\)
+0+0030 <[^>]*> lui \$at,0x2
+0+0034 <[^>]*> lw \$a0,-23131\(\$at\)
+0+0038 <[^>]*> lw \$a1,-23127\(\$at\)
+...
+0+0040 <[^>]*> lw \$a0,0\(\$a1\)
+0+0044 <[^>]*> lw \$a1,4\(\$a1\)
+...
+0+004c <[^>]*> lw \$a0,1\(\$a1\)
+0+0050 <[^>]*> lw \$a1,5\(\$a1\)
+0+0054 <[^>]*> lui \$at,0x1
+0+0058 <[^>]*> addu \$at,\$a1,\$at
+0+005c <[^>]*> lw \$a0,-32768\(\$at\)
+0+0060 <[^>]*> lw \$a1,-32764\(\$at\)
+...
+0+0068 <[^>]*> lw \$a0,-32768\(\$a1\)
+0+006c <[^>]*> lw \$a1,-32764\(\$a1\)
+0+0070 <[^>]*> lui \$at,0x1
+0+0074 <[^>]*> addu \$at,\$a1,\$at
+0+0078 <[^>]*> lw \$a0,0\(\$at\)
+0+007c <[^>]*> lw \$a1,4\(\$at\)
+0+0080 <[^>]*> lui \$at,0x2
+0+0084 <[^>]*> addu \$at,\$a1,\$at
+0+0088 <[^>]*> lw \$a0,-23131\(\$at\)
+0+008c <[^>]*> lw \$a1,-23127\(\$at\)
+0+0090 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0090 R_MIPS_GOT16 .data
+...
+0+0098 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0098 R_MIPS_LO16 .data
+0+009c <[^>]*> lw \$a1,4\(\$at\)
+[ ]*RELOC: 0+009c R_MIPS_LO16 .data
+0+00a0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00a0 R_MIPS_GOT_HI16 big_external_data_label
+0+00a4 <[^>]*> addu \$at,\$at,\$gp
+0+00a8 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+00a8 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+00b0 <[^>]*> lw \$a0,0\(\$at\)
+0+00b4 <[^>]*> lw \$a1,4\(\$at\)
+0+00b8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00b8 R_MIPS_GOT_HI16 small_external_data_label
+0+00bc <[^>]*> addu \$at,\$at,\$gp
+0+00c0 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+00c0 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+00c8 <[^>]*> lw \$a0,0\(\$at\)
+0+00cc <[^>]*> lw \$a1,4\(\$at\)
+0+00d0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00d0 R_MIPS_GOT_HI16 big_external_common
+0+00d4 <[^>]*> addu \$at,\$at,\$gp
+0+00d8 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+00d8 R_MIPS_GOT_LO16 big_external_common
+...
+0+00e0 <[^>]*> lw \$a0,0\(\$at\)
+0+00e4 <[^>]*> lw \$a1,4\(\$at\)
+0+00e8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00e8 R_MIPS_GOT_HI16 small_external_common
+0+00ec <[^>]*> addu \$at,\$at,\$gp
+0+00f0 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+00f0 R_MIPS_GOT_LO16 small_external_common
+...
+0+00f8 <[^>]*> lw \$a0,0\(\$at\)
+0+00fc <[^>]*> lw \$a1,4\(\$at\)
+0+0100 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0100 R_MIPS_GOT16 .bss
+...
+0+0108 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0108 R_MIPS_LO16 .bss
+0+010c <[^>]*> lw \$a1,4\(\$at\)
+[ ]*RELOC: 0+010c R_MIPS_LO16 .bss
+0+0110 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0110 R_MIPS_GOT16 .bss
+...
+0+0118 <[^>]*> lw \$a0,1000\(\$at\)
+[ ]*RELOC: 0+0118 R_MIPS_LO16 .bss
+0+011c <[^>]*> lw \$a1,1004\(\$at\)
+[ ]*RELOC: 0+011c R_MIPS_LO16 .bss
+0+0120 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0120 R_MIPS_GOT16 .data
+...
+0+0128 <[^>]*> lw \$a0,1\(\$at\)
+[ ]*RELOC: 0+0128 R_MIPS_LO16 .data
+0+012c <[^>]*> lw \$a1,5\(\$at\)
+[ ]*RELOC: 0+012c R_MIPS_LO16 .data
+0+0130 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0130 R_MIPS_GOT_HI16 big_external_data_label
+0+0134 <[^>]*> addu \$at,\$at,\$gp
+0+0138 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0138 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0140 <[^>]*> lw \$a0,1\(\$at\)
+0+0144 <[^>]*> lw \$a1,5\(\$at\)
+0+0148 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0148 R_MIPS_GOT_HI16 small_external_data_label
+0+014c <[^>]*> addu \$at,\$at,\$gp
+0+0150 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0150 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+0158 <[^>]*> lw \$a0,1\(\$at\)
+0+015c <[^>]*> lw \$a1,5\(\$at\)
+0+0160 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0160 R_MIPS_GOT_HI16 big_external_common
+0+0164 <[^>]*> addu \$at,\$at,\$gp
+0+0168 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0168 R_MIPS_GOT_LO16 big_external_common
+...
+0+0170 <[^>]*> lw \$a0,1\(\$at\)
+0+0174 <[^>]*> lw \$a1,5\(\$at\)
+0+0178 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0178 R_MIPS_GOT_HI16 small_external_common
+0+017c <[^>]*> addu \$at,\$at,\$gp
+0+0180 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0180 R_MIPS_GOT_LO16 small_external_common
+...
+0+0188 <[^>]*> lw \$a0,1\(\$at\)
+0+018c <[^>]*> lw \$a1,5\(\$at\)
+0+0190 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0190 R_MIPS_GOT16 .bss
+...
+0+0198 <[^>]*> lw \$a0,1\(\$at\)
+[ ]*RELOC: 0+0198 R_MIPS_LO16 .bss
+0+019c <[^>]*> lw \$a1,5\(\$at\)
+[ ]*RELOC: 0+019c R_MIPS_LO16 .bss
+0+01a0 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+01a0 R_MIPS_GOT16 .bss
+...
+0+01a8 <[^>]*> lw \$a0,1001\(\$at\)
+[ ]*RELOC: 0+01a8 R_MIPS_LO16 .bss
+0+01ac <[^>]*> lw \$a1,1005\(\$at\)
+[ ]*RELOC: 0+01ac R_MIPS_LO16 .bss
+0+01b0 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+01b0 R_MIPS_GOT16 .data
+...
+0+01b8 <[^>]*> addu \$at,\$a1,\$at
+0+01bc <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+01bc R_MIPS_LO16 .data
+0+01c0 <[^>]*> lw \$a1,4\(\$at\)
+[ ]*RELOC: 0+01c0 R_MIPS_LO16 .data
+0+01c4 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01c4 R_MIPS_GOT_HI16 big_external_data_label
+0+01c8 <[^>]*> addu \$at,\$at,\$gp
+0+01cc <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+01cc R_MIPS_GOT_LO16 big_external_data_label
+...
+0+01d4 <[^>]*> addu \$at,\$a1,\$at
+0+01d8 <[^>]*> lw \$a0,0\(\$at\)
+0+01dc <[^>]*> lw \$a1,4\(\$at\)
+0+01e0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01e0 R_MIPS_GOT_HI16 small_external_data_label
+0+01e4 <[^>]*> addu \$at,\$at,\$gp
+0+01e8 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+01e8 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+01f0 <[^>]*> addu \$at,\$a1,\$at
+0+01f4 <[^>]*> lw \$a0,0\(\$at\)
+0+01f8 <[^>]*> lw \$a1,4\(\$at\)
+0+01fc <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01fc R_MIPS_GOT_HI16 big_external_common
+0+0200 <[^>]*> addu \$at,\$at,\$gp
+0+0204 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0204 R_MIPS_GOT_LO16 big_external_common
+...
+0+020c <[^>]*> addu \$at,\$a1,\$at
+0+0210 <[^>]*> lw \$a0,0\(\$at\)
+0+0214 <[^>]*> lw \$a1,4\(\$at\)
+0+0218 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0218 R_MIPS_GOT_HI16 small_external_common
+0+021c <[^>]*> addu \$at,\$at,\$gp
+0+0220 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0220 R_MIPS_GOT_LO16 small_external_common
+...
+0+0228 <[^>]*> addu \$at,\$a1,\$at
+0+022c <[^>]*> lw \$a0,0\(\$at\)
+0+0230 <[^>]*> lw \$a1,4\(\$at\)
+0+0234 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0234 R_MIPS_GOT16 .bss
+...
+0+023c <[^>]*> addu \$at,\$a1,\$at
+0+0240 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0240 R_MIPS_LO16 .bss
+0+0244 <[^>]*> lw \$a1,4\(\$at\)
+[ ]*RELOC: 0+0244 R_MIPS_LO16 .bss
+0+0248 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0248 R_MIPS_GOT16 .bss
+...
+0+0250 <[^>]*> addu \$at,\$a1,\$at
+0+0254 <[^>]*> lw \$a0,1000\(\$at\)
+[ ]*RELOC: 0+0254 R_MIPS_LO16 .bss
+0+0258 <[^>]*> lw \$a1,1004\(\$at\)
+[ ]*RELOC: 0+0258 R_MIPS_LO16 .bss
+0+025c <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+025c R_MIPS_GOT16 .data
+...
+0+0264 <[^>]*> addu \$at,\$a1,\$at
+0+0268 <[^>]*> lw \$a0,1\(\$at\)
+[ ]*RELOC: 0+0268 R_MIPS_LO16 .data
+0+026c <[^>]*> lw \$a1,5\(\$at\)
+[ ]*RELOC: 0+026c R_MIPS_LO16 .data
+0+0270 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0270 R_MIPS_GOT_HI16 big_external_data_label
+0+0274 <[^>]*> addu \$at,\$at,\$gp
+0+0278 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0278 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0280 <[^>]*> addu \$at,\$a1,\$at
+0+0284 <[^>]*> lw \$a0,1\(\$at\)
+0+0288 <[^>]*> lw \$a1,5\(\$at\)
+0+028c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+028c R_MIPS_GOT_HI16 small_external_data_label
+0+0290 <[^>]*> addu \$at,\$at,\$gp
+0+0294 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0294 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+029c <[^>]*> addu \$at,\$a1,\$at
+0+02a0 <[^>]*> lw \$a0,1\(\$at\)
+0+02a4 <[^>]*> lw \$a1,5\(\$at\)
+0+02a8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02a8 R_MIPS_GOT_HI16 big_external_common
+0+02ac <[^>]*> addu \$at,\$at,\$gp
+0+02b0 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+02b0 R_MIPS_GOT_LO16 big_external_common
+...
+0+02b8 <[^>]*> addu \$at,\$a1,\$at
+0+02bc <[^>]*> lw \$a0,1\(\$at\)
+0+02c0 <[^>]*> lw \$a1,5\(\$at\)
+0+02c4 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02c4 R_MIPS_GOT_HI16 small_external_common
+0+02c8 <[^>]*> addu \$at,\$at,\$gp
+0+02cc <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+02cc R_MIPS_GOT_LO16 small_external_common
+...
+0+02d4 <[^>]*> addu \$at,\$a1,\$at
+0+02d8 <[^>]*> lw \$a0,1\(\$at\)
+0+02dc <[^>]*> lw \$a1,5\(\$at\)
+0+02e0 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+02e0 R_MIPS_GOT16 .bss
+...
+0+02e8 <[^>]*> addu \$at,\$a1,\$at
+0+02ec <[^>]*> lw \$a0,1\(\$at\)
+[ ]*RELOC: 0+02ec R_MIPS_LO16 .bss
+0+02f0 <[^>]*> lw \$a1,5\(\$at\)
+[ ]*RELOC: 0+02f0 R_MIPS_LO16 .bss
+0+02f4 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+02f4 R_MIPS_GOT16 .bss
+...
+0+02fc <[^>]*> addu \$at,\$a1,\$at
+0+0300 <[^>]*> lw \$a0,1001\(\$at\)
+[ ]*RELOC: 0+0300 R_MIPS_LO16 .bss
+0+0304 <[^>]*> lw \$a1,1005\(\$at\)
+[ ]*RELOC: 0+0304 R_MIPS_LO16 .bss
+...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld.d
index 779e40cf7ac..788d089f421 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ld.d
@@ -10,15 +10,15 @@ Disassembly of section .text:
0+0004 <[^>]*> lw \$a1,4\(\$zero\)
0+0008 <[^>]*> lw \$a0,1\(\$zero\)
0+000c <[^>]*> lw \$a1,5\(\$zero\)
-0+0010 <[^>]*> lui \$at,1
+0+0010 <[^>]*> lui \$at,0x1
0+0014 <[^>]*> lw \$a0,-32768\(\$at\)
0+0018 <[^>]*> lw \$a1,-32764\(\$at\)
0+001c <[^>]*> lw \$a0,-32768\(\$zero\)
0+0020 <[^>]*> lw \$a1,-32764\(\$zero\)
-0+0024 <[^>]*> lui \$at,1
+0+0024 <[^>]*> lui \$at,0x1
0+0028 <[^>]*> lw \$a0,0\(\$at\)
0+002c <[^>]*> lw \$a1,4\(\$at\)
-0+0030 <[^>]*> lui \$at,2
+0+0030 <[^>]*> lui \$at,0x2
0+0034 <[^>]*> lw \$a0,-23131\(\$at\)
0+0038 <[^>]*> lw \$a1,-23127\(\$at\)
...
@@ -27,28 +27,28 @@ Disassembly of section .text:
...
0+004c <[^>]*> lw \$a0,1\(\$a1\)
0+0050 <[^>]*> lw \$a1,5\(\$a1\)
-0+0054 <[^>]*> lui \$at,1
+0+0054 <[^>]*> lui \$at,0x1
0+0058 <[^>]*> addu \$at,\$a1,\$at
0+005c <[^>]*> lw \$a0,-32768\(\$at\)
0+0060 <[^>]*> lw \$a1,-32764\(\$at\)
...
0+0068 <[^>]*> lw \$a0,-32768\(\$a1\)
0+006c <[^>]*> lw \$a1,-32764\(\$a1\)
-0+0070 <[^>]*> lui \$at,1
+0+0070 <[^>]*> lui \$at,0x1
0+0074 <[^>]*> addu \$at,\$a1,\$at
0+0078 <[^>]*> lw \$a0,0\(\$at\)
0+007c <[^>]*> lw \$a1,4\(\$at\)
-0+0080 <[^>]*> lui \$at,2
+0+0080 <[^>]*> lui \$at,0x2
0+0084 <[^>]*> addu \$at,\$a1,\$at
0+0088 <[^>]*> lw \$a0,-23131\(\$at\)
0+008c <[^>]*> lw \$a1,-23127\(\$at\)
-0+0090 <[^>]*> lui \$at,0
+0+0090 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+0090 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0094 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
[ ]*RELOC: 0+0094 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+0098 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
[ ]*RELOC: 0+0098 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+009c <[^>]*> lui \$at,0
+0+009c <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+009c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+00a0 <[^>]*> lw \$a0,0\(\$at\)
[ ]*RELOC: 0+00a0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
@@ -58,7 +58,7 @@ Disassembly of section .text:
[ ]*RELOC: 0+00a8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
0+00ac <[^>]*> lw \$a1,[-0-9]+\(\$gp\)
[ ]*RELOC: 0+00ac [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
-0+00b0 <[^>]*> lui \$at,0
+0+00b0 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00b0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+00b4 <[^>]*> lw \$a0,0\(\$at\)
[ ]*RELOC: 0+00b4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
@@ -68,7 +68,7 @@ Disassembly of section .text:
[ ]*RELOC: 0+00bc [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
0+00c0 <[^>]*> lw \$a1,[-0-9]+\(\$gp\)
[ ]*RELOC: 0+00c0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
-0+00c4 <[^>]*> lui \$at,0
+0+00c4 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00c4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+00c8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
[ ]*RELOC: 0+00c8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
@@ -78,570 +78,561 @@ Disassembly of section .text:
[ ]*RELOC: 0+00d0 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
0+00d4 <[^>]*> lw \$a1,[-0-9]+\(\$gp\)
[ ]*RELOC: 0+00d4 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
-0+00d8 <[^>]*> lui \$at,0
+0+00d8 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00d8 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+00dc <[^>]*> lw \$a0,[-0-9]+\(\$at\)
[ ]*RELOC: 0+00dc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+00e0 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
[ ]*RELOC: 0+00e0 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+00e4 <[^>]*> lui \$at,0
+0+00e4 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00e4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+00e8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
[ ]*RELOC: 0+00e8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+00ec <[^>]*> lw \$a1,[-0-9]+\(\$at\)
[ ]*RELOC: 0+00ec [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+00f0 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00f0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+00f4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+00f4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+00f8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+00f8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+00fc <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00fc [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0100 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+0+00f0 <[^>]*> lw \$a0,1\(\$gp\)
+[ ]*RELOC: 0+00f0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+00f4 <[^>]*> lw \$a1,5\(\$gp\)
+[ ]*RELOC: 0+00f4 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+00f8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00f8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+00fc <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+00fc [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0100 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
[ ]*RELOC: 0+0100 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0104 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0104 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0108 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0108 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+010c <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+010c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0110 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0110 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0114 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0114 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0118 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0118 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+011c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+011c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0120 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0120 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0104 <[^>]*> lw \$a0,1\(\$gp\)
+[ ]*RELOC: 0+0104 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+0108 <[^>]*> lw \$a1,5\(\$gp\)
+[ ]*RELOC: 0+0108 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+010c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+010c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0110 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0110 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0114 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0114 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0118 <[^>]*> lw \$a0,[-0-9]+\(\$gp\)
+[ ]*RELOC: 0+0118 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+011c <[^>]*> lw \$a1,[-0-9]+\(\$gp\)
+[ ]*RELOC: 0+011c [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+0120 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0120 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0124 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0124 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+0124 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+0128 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0128 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+012c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+012c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+0128 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+012c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+012c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0130 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0130 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+0130 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+0134 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0134 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0138 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0138 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+0134 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0138 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0138 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+013c <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+013c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+013c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
0+0140 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0140 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0144 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0144 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+0140 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0144 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0144 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0148 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0148 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+0148 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
0+014c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+014c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0150 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0150 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+014c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0150 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0150 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+0154 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0154 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+0154 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
0+0158 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0158 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+015c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+015c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+0158 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+015c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+015c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+0160 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0160 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+0160 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
0+0164 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0164 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0168 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0168 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+0164 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0168 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0168 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+016c <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+016c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+016c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
0+0170 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0170 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0174 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0174 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+0170 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0174 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0174 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0178 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0178 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+0178 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+017c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+017c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0180 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0180 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+017c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0180 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0180 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0184 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0184 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+0184 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+0188 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0188 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+018c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+018c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+0188 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+018c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+018c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+0190 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0190 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+0190 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
0+0194 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0194 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0198 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0198 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+0194 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0198 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0198 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+019c <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+019c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+019c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
0+01a0 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01a0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+01a4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01a4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+01a0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+01a4 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01a4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+01a8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01a8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+01a8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
0+01ac <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01ac [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+01b0 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01b0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+01ac [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+01b0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01b0 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+01b4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01b4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+01b4 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
0+01b8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01b8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+01bc <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01bc [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+01b8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+01bc <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01bc [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+01c0 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01c0 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+01c0 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
0+01c4 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01c4 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+01c8 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01c8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+01c4 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+01c8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+01c8 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+01cc <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01cc [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+01cc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+01d0 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01d0 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+01d4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+01d4 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+01d8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01d8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+01d0 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+01d4 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+01d4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+01d8 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+01d8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+01dc <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01dc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+01e0 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+01e0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+01dc [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+01e0 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+01e0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+01e4 <[^>]*> lw \$a0,0\(\$at\)
-[ ]*RELOC: 0+01e4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+01e4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
0+01e8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01e8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+01ec <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+01ec [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+01e8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+01ec <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+01ec [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+01f0 <[^>]*> lw \$a0,0\(\$at\)
-[ ]*RELOC: 0+01f0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+01f0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
0+01f4 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01f4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+01f8 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+01f8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+01f4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+01f8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+01f8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+01fc <[^>]*> lw \$a0,0\(\$at\)
-[ ]*RELOC: 0+01fc [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+01fc [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
0+0200 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0200 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0204 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0204 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0208 <[^>]*> lw \$a0,0\(\$at\)
-[ ]*RELOC: 0+0208 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+0200 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0204 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0204 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0208 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0208 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
0+020c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+020c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0210 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0210 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+020c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0210 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0210 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+0214 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0214 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+0214 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
0+0218 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0218 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+021c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+021c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+0218 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+021c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+021c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0220 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0220 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+0220 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+0224 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0224 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0228 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0228 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+0224 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0228 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0228 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+022c <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+022c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+022c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+0230 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0230 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0234 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0234 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+0230 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0234 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0234 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+0238 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0238 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+0238 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
0+023c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+023c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0240 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0240 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+023c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0240 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0240 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0244 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0244 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+0244 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
0+0248 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0248 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+024c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+024c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+0248 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+024c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+024c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+0250 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0250 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+0250 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
0+0254 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0254 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0258 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0258 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+0254 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0258 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0258 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+025c <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+025c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+025c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
0+0260 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0260 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0264 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0264 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+0260 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0264 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0264 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+0268 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0268 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+0268 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
0+026c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+026c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0270 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0270 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0274 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0274 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0278 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0278 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+027c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+027c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0280 <[^>]*> addu \$at,\$a1,\$at
-0+0284 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0284 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0288 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0288 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+028c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+028c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0290 <[^>]*> addu \$at,\$a1,\$at
-0+0294 <[^>]*> lw \$a0,0\(\$at\)
-[ ]*RELOC: 0+0294 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0298 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0298 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+026c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0270 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0270 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0274 <[^>]*> addu \$at,\$a1,\$at
+0+0278 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0278 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+027c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+027c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0280 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0280 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0284 <[^>]*> addu \$at,\$a1,\$at
+0+0288 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0288 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+028c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+028c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
...
-0+02a0 <[^>]*> addu \$at,\$a1,\$gp
-0+02a4 <[^>]*> lw \$a0,0\(\$at\)
-[ ]*RELOC: 0+02a4 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
-0+02a8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02a8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
-0+02ac <[^>]*> lui \$at,0
-[ ]*RELOC: 0+02ac [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+02b0 <[^>]*> addu \$at,\$a1,\$at
-0+02b4 <[^>]*> lw \$a0,0\(\$at\)
-[ ]*RELOC: 0+02b4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+02b8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02b8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0294 <[^>]*> addu \$at,\$a1,\$gp
+0+0298 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0298 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+029c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+029c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+02a0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02a0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+02a4 <[^>]*> addu \$at,\$a1,\$at
+0+02a8 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+02a8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+02ac <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+02ac [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
...
-0+02c0 <[^>]*> addu \$at,\$a1,\$gp
-0+02c4 <[^>]*> lw \$a0,0\(\$at\)
-[ ]*RELOC: 0+02c4 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
-0+02c8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02c8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
-0+02cc <[^>]*> lui \$at,0
-[ ]*RELOC: 0+02cc [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+02d0 <[^>]*> addu \$at,\$a1,\$at
-0+02d4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02d4 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+02d8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02d8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+02b4 <[^>]*> addu \$at,\$a1,\$gp
+0+02b8 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+02b8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+02bc <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+02bc [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+02c0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02c0 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+02c4 <[^>]*> addu \$at,\$a1,\$at
+0+02c8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+02c8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+02cc <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+02cc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
...
-0+02e0 <[^>]*> addu \$at,\$a1,\$gp
-0+02e4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02e4 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
-0+02e8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02e8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
-0+02ec <[^>]*> lui \$at,0
-[ ]*RELOC: 0+02ec [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+02f0 <[^>]*> addu \$at,\$a1,\$at
-0+02f4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02f4 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+02f8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02f8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+02fc <[^>]*> lui \$at,0
-[ ]*RELOC: 0+02fc [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0300 <[^>]*> addu \$at,\$a1,\$at
-0+0304 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0304 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0308 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0308 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+030c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+030c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0310 <[^>]*> addu \$at,\$a1,\$at
-0+0314 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0314 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0318 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0318 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+031c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+031c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0320 <[^>]*> addu \$at,\$a1,\$at
-0+0324 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0324 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0328 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0328 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+032c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+032c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0330 <[^>]*> addu \$at,\$a1,\$at
-0+0334 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0334 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0338 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0338 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+033c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+033c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0340 <[^>]*> addu \$at,\$a1,\$at
-0+0344 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0344 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0348 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0348 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+034c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+034c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0350 <[^>]*> addu \$at,\$a1,\$at
-0+0354 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0354 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0358 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0358 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+035c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+035c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0360 <[^>]*> addu \$at,\$a1,\$at
-0+0364 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0364 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0368 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0368 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+036c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+036c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0370 <[^>]*> addu \$at,\$a1,\$at
-0+0374 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0374 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0378 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0378 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+037c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+037c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0380 <[^>]*> addu \$at,\$a1,\$at
-0+0384 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0384 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0388 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0388 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+038c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+038c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0390 <[^>]*> addu \$at,\$a1,\$at
-0+0394 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0394 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0398 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0398 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+039c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+039c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+03a0 <[^>]*> addu \$at,\$a1,\$at
-0+03a4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+03a4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+03a8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+03a8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+03ac <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+03ac [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+03b0 <[^>]*> addu \$at,\$a1,\$at
-0+03b4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+03b4 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+03b8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+03b8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+03bc <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+03bc [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+03c0 <[^>]*> addu \$at,\$a1,\$at
-0+03c4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+03c4 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+03c8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+03c8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+03cc <[^>]*> lui \$at,0
-[ ]*RELOC: 0+03cc [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+03d0 <[^>]*> addu \$at,\$a1,\$at
-0+03d4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+03d4 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+03d8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+03d8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+03dc <[^>]*> lui \$at,0
-[ ]*RELOC: 0+03dc [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+03e0 <[^>]*> addu \$at,\$a1,\$at
-0+03e4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+03e4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+03e8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+03e8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+03ec <[^>]*> lui \$at,0
-[ ]*RELOC: 0+03ec [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+03f0 <[^>]*> addu \$at,\$a1,\$at
-0+03f4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+03f4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+03f8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+03f8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+03fc <[^>]*> lui \$at,0
-[ ]*RELOC: 0+03fc [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0400 <[^>]*> addu \$at,\$a1,\$at
-0+0404 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0404 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0408 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0408 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+040c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+040c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0410 <[^>]*> addu \$at,\$a1,\$at
-0+0414 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0414 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0418 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0418 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+041c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+041c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0420 <[^>]*> addu \$at,\$a1,\$at
-0+0424 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0424 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0428 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0428 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+042c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+042c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0430 <[^>]*> addu \$at,\$a1,\$at
-0+0434 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0434 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0438 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0438 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+043c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+043c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0440 <[^>]*> addu \$at,\$a1,\$at
-0+0444 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0444 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0448 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0448 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+044c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+044c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0450 <[^>]*> addu \$at,\$a1,\$at
-0+0454 <[^>]*> lw \$a0,0\(\$at\)
-[ ]*RELOC: 0+0454 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0458 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0458 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+045c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+045c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0460 <[^>]*> addu \$at,\$a1,\$at
-0+0464 <[^>]*> lw \$a0,0\(\$at\)
-[ ]*RELOC: 0+0464 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0468 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0468 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+046c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+046c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0470 <[^>]*> addu \$at,\$a1,\$at
-0+0474 <[^>]*> lw \$a0,0\(\$at\)
-[ ]*RELOC: 0+0474 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0478 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0478 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+047c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+047c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0480 <[^>]*> addu \$at,\$a1,\$at
-0+0484 <[^>]*> lw \$a0,0\(\$at\)
-[ ]*RELOC: 0+0484 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0488 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0488 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+048c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+048c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0490 <[^>]*> addu \$at,\$a1,\$at
-0+0494 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0494 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0498 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0498 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+049c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+049c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+04a0 <[^>]*> addu \$at,\$a1,\$at
-0+04a4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+04a4 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+04a8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+04a8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+04ac <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+04ac [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+04b0 <[^>]*> addu \$at,\$a1,\$at
-0+04b4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+04b4 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+04b8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+04b8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+04bc <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+04bc [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+04c0 <[^>]*> addu \$at,\$a1,\$at
-0+04c4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+04c4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+04c8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+04c8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+04cc <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+04cc [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+04d0 <[^>]*> addu \$at,\$a1,\$at
-0+04d4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+04d4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+04d8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+04d8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+04dc <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+04dc [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+04e0 <[^>]*> addu \$at,\$a1,\$at
-0+04e4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+04e4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+04e8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+04e8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+04ec <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+04ec [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+04f0 <[^>]*> addu \$at,\$a1,\$at
-0+04f4 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+04f4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+04f8 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+04f8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+04fc <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+04fc [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0500 <[^>]*> addu \$at,\$a1,\$at
-0+0504 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0504 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0508 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0508 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+050c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+050c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0510 <[^>]*> addu \$at,\$a1,\$at
-0+0514 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0514 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0518 <[^>]*> lw \$a1,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0518 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+051c <[^>]*> lwc1 \$f[45],0\(\$zero\)
-0+0520 <[^>]*> lwc1 \$f[45],4\(\$zero\)
-0+0524 <[^>]*> lwc1 \$f[45],1\(\$zero\)
-0+0528 <[^>]*> lwc1 \$f[45],5\(\$zero\)
-0+052c <[^>]*> lui \$at,1
-0+0530 <[^>]*> lwc1 \$f[45],-32768\(\$at\)
-0+0534 <[^>]*> lwc1 \$f[45],-32764\(\$at\)
-0+0538 <[^>]*> lwc1 \$f[45],-32768\(\$zero\)
-0+053c <[^>]*> lwc1 \$f[45],-32764\(\$zero\)
-0+0540 <[^>]*> lwc1 \$f[45],0\(\$a1\)
-0+0544 <[^>]*> lwc1 \$f[45],4\(\$a1\)
-0+0548 <[^>]*> lwc1 \$f[45],1\(\$a1\)
-0+054c <[^>]*> lwc1 \$f[45],5\(\$a1\)
-0+0550 <[^>]*> lui \$at,1
-0+0554 <[^>]*> addu \$at,\$a1,\$at
-0+0558 <[^>]*> lwc1 \$f[45],-32768\(\$at\)
-0+055c <[^>]*> lwc1 \$f[45],-32764\(\$at\)
-0+0560 <[^>]*> lwc1 \$f[45],-32768\(\$a1\)
-0+0564 <[^>]*> lwc1 \$f[45],-32764\(\$a1\)
-0+0568 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0568 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+056c <[^>]*> addu \$at,\$a1,\$at
-0+0570 <[^>]*> lwc1 \$f[45],[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0570 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0574 <[^>]*> lwc1 \$f[45],[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0574 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+02d4 <[^>]*> addu \$at,\$a1,\$gp
+0+02d8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+02d8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+02dc <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+02dc [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+02e0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02e0 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+02e4 <[^>]*> addu \$at,\$a1,\$at
+0+02e8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+02e8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+02ec <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+02ec [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+02f0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02f0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+02f4 <[^>]*> addu \$at,\$a1,\$at
+0+02f8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+02f8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+02fc <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+02fc [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
...
-0+057c <[^>]*> swc1 \$f[45],0\(\$zero\)
-0+0580 <[^>]*> swc1 \$f[45],4\(\$zero\)
-0+0584 <[^>]*> swc1 \$f[45],1\(\$zero\)
-0+0588 <[^>]*> swc1 \$f[45],5\(\$zero\)
-0+058c <[^>]*> lui \$at,1
-0+0590 <[^>]*> swc1 \$f[45],-32768\(\$at\)
-0+0594 <[^>]*> swc1 \$f[45],-32764\(\$at\)
-0+0598 <[^>]*> swc1 \$f[45],-32768\(\$zero\)
-0+059c <[^>]*> swc1 \$f[45],-32764\(\$zero\)
-0+05a0 <[^>]*> swc1 \$f[45],0\(\$a1\)
-0+05a4 <[^>]*> swc1 \$f[45],4\(\$a1\)
-0+05a8 <[^>]*> swc1 \$f[45],1\(\$a1\)
-0+05ac <[^>]*> swc1 \$f[45],5\(\$a1\)
-0+05b0 <[^>]*> lui \$at,1
-0+05b4 <[^>]*> addu \$at,\$a1,\$at
-0+05b8 <[^>]*> swc1 \$f[45],-32768\(\$at\)
-0+05bc <[^>]*> swc1 \$f[45],-32764\(\$at\)
-0+05c0 <[^>]*> swc1 \$f[45],-32768\(\$a1\)
-0+05c4 <[^>]*> swc1 \$f[45],-32764\(\$a1\)
-0+05c8 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+05c8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+05cc <[^>]*> addu \$at,\$a1,\$at
-0+05d0 <[^>]*> swc1 \$f[45],[-0-9]+\(\$at\)
-[ ]*RELOC: 0+05d0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+05d4 <[^>]*> swc1 \$f[45],[-0-9]+\(\$at\)
-[ ]*RELOC: 0+05d4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+05d8 <[^>]*> sw \$a0,0\(\$zero\)
-0+05dc <[^>]*> sw \$a1,4\(\$zero\)
-0+05e0 <[^>]*> lui \$a0,[-0-9]+
-[ ]*RELOC: 0+05e0 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+05e4 <[^>]*> daddu \$a0,\$a0,\$a1
-0+05e8 <[^>]*> ld \$a0,[-0-9]+\(\$a0\)
-[ ]*RELOC: 0+05e8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+05ec <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+05ec [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+05f0 <[^>]*> daddu \$at,\$at,\$a1
-0+05f4 <[^>]*> sd \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+05f4 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0304 <[^>]*> addu \$at,\$a1,\$gp
+0+0308 <[^>]*> lw \$a0,1\(\$at\)
+[ ]*RELOC: 0+0308 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+030c <[^>]*> lw \$a1,5\(\$at\)
+[ ]*RELOC: 0+030c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+0310 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0310 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0314 <[^>]*> addu \$at,\$a1,\$at
+0+0318 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0318 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+031c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+031c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+...
+0+0324 <[^>]*> addu \$at,\$a1,\$gp
+0+0328 <[^>]*> lw \$a0,1\(\$at\)
+[ ]*RELOC: 0+0328 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+032c <[^>]*> lw \$a1,5\(\$at\)
+[ ]*RELOC: 0+032c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+0330 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0330 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0334 <[^>]*> addu \$at,\$a1,\$at
+0+0338 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0338 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+033c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+033c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+...
+0+0344 <[^>]*> addu \$at,\$a1,\$gp
+0+0348 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0348 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+034c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+034c [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+0350 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0350 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0354 <[^>]*> addu \$at,\$a1,\$at
+0+0358 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0358 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+035c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+035c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0360 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0360 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0364 <[^>]*> addu \$at,\$a1,\$at
+0+0368 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0368 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+036c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+036c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0370 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0370 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+0374 <[^>]*> addu \$at,\$a1,\$at
+0+0378 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0378 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+037c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+037c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0380 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0380 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0384 <[^>]*> addu \$at,\$a1,\$at
+0+0388 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0388 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+038c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+038c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0390 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0390 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0394 <[^>]*> addu \$at,\$a1,\$at
+0+0398 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0398 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+039c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+039c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+03a0 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+03a0 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+03a4 <[^>]*> addu \$at,\$a1,\$at
+0+03a8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+03a8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+03ac <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+03ac [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+03b0 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+03b0 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+03b4 <[^>]*> addu \$at,\$a1,\$at
+0+03b8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+03b8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+03bc <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+03bc [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+03c0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+03c0 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+03c4 <[^>]*> addu \$at,\$a1,\$at
+0+03c8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+03c8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+03cc <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+03cc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+03d0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+03d0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+03d4 <[^>]*> addu \$at,\$a1,\$at
+0+03d8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+03d8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+03dc <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+03dc [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+03e0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+03e0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+03e4 <[^>]*> addu \$at,\$a1,\$at
+0+03e8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+03e8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+03ec <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+03ec [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+03f0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+03f0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+03f4 <[^>]*> addu \$at,\$a1,\$at
+0+03f8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+03f8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+03fc <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+03fc [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0400 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0400 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0404 <[^>]*> addu \$at,\$a1,\$at
+0+0408 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0408 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+040c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+040c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0410 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0410 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0414 <[^>]*> addu \$at,\$a1,\$at
+0+0418 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0418 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+041c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+041c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0420 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0420 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0424 <[^>]*> addu \$at,\$a1,\$at
+0+0428 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0428 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+042c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+042c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0430 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0430 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0434 <[^>]*> addu \$at,\$a1,\$at
+0+0438 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0438 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+043c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+043c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0440 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0440 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0444 <[^>]*> addu \$at,\$a1,\$at
+0+0448 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0448 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+044c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+044c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0450 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0450 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+0454 <[^>]*> addu \$at,\$a1,\$at
+0+0458 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0458 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+045c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+045c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0460 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0460 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0464 <[^>]*> addu \$at,\$a1,\$at
+0+0468 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0468 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+046c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+046c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0470 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0470 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0474 <[^>]*> addu \$at,\$a1,\$at
+0+0478 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0478 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+047c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+047c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0480 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0480 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0484 <[^>]*> addu \$at,\$a1,\$at
+0+0488 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0488 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+048c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+048c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0490 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0490 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0494 <[^>]*> addu \$at,\$a1,\$at
+0+0498 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0498 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+049c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+049c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+04a0 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+04a0 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+04a4 <[^>]*> addu \$at,\$a1,\$at
+0+04a8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+04a8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+04ac <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+04ac [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+04b0 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+04b0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+04b4 <[^>]*> addu \$at,\$a1,\$at
+0+04b8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+04b8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+04bc <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+04bc [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+04c0 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+04c0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+04c4 <[^>]*> addu \$at,\$a1,\$at
+0+04c8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+04c8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+04cc <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+04cc [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+04d0 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+04d0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+04d4 <[^>]*> addu \$at,\$a1,\$at
+0+04d8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+04d8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+04dc <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+04dc [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+04e0 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+04e0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+04e4 <[^>]*> addu \$at,\$a1,\$at
+0+04e8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+04e8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+04ec <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+04ec [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+04f0 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+04f0 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+04f4 <[^>]*> addu \$at,\$a1,\$at
+0+04f8 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+04f8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+04fc <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+04fc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0500 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0500 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0504 <[^>]*> addu \$at,\$a1,\$at
+0+0508 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0508 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+050c <[^>]*> lw \$a1,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+050c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0510 <[^>]*> lwc1 \$f[45],0\(\$zero\)
+0+0514 <[^>]*> lwc1 \$f[45],4\(\$zero\)
+0+0518 <[^>]*> lwc1 \$f[45],1\(\$zero\)
+0+051c <[^>]*> lwc1 \$f[45],5\(\$zero\)
+0+0520 <[^>]*> lui \$at,0x1
+0+0524 <[^>]*> lwc1 \$f[45],-32768\(\$at\)
+0+0528 <[^>]*> lwc1 \$f[45],-32764\(\$at\)
+0+052c <[^>]*> lwc1 \$f[45],-32768\(\$zero\)
+0+0530 <[^>]*> lwc1 \$f[45],-32764\(\$zero\)
+0+0534 <[^>]*> lwc1 \$f[45],0\(\$a1\)
+0+0538 <[^>]*> lwc1 \$f[45],4\(\$a1\)
+0+053c <[^>]*> lwc1 \$f[45],1\(\$a1\)
+0+0540 <[^>]*> lwc1 \$f[45],5\(\$a1\)
+0+0544 <[^>]*> lui \$at,0x1
+0+0548 <[^>]*> addu \$at,\$a1,\$at
+0+054c <[^>]*> lwc1 \$f[45],-32768\(\$at\)
+0+0550 <[^>]*> lwc1 \$f[45],-32764\(\$at\)
+0+0554 <[^>]*> lwc1 \$f[45],-32768\(\$a1\)
+0+0558 <[^>]*> lwc1 \$f[45],-32764\(\$a1\)
+0+055c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+055c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0560 <[^>]*> addu \$at,\$a1,\$at
+0+0564 <[^>]*> lwc1 \$f[45],[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0564 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0568 <[^>]*> lwc1 \$f[45],[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0568 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+...
+0+0570 <[^>]*> swc1 \$f[45],0\(\$zero\)
+0+0574 <[^>]*> swc1 \$f[45],4\(\$zero\)
+0+0578 <[^>]*> swc1 \$f[45],1\(\$zero\)
+0+057c <[^>]*> swc1 \$f[45],5\(\$zero\)
+0+0580 <[^>]*> lui \$at,0x1
+0+0584 <[^>]*> swc1 \$f[45],-32768\(\$at\)
+0+0588 <[^>]*> swc1 \$f[45],-32764\(\$at\)
+0+058c <[^>]*> swc1 \$f[45],-32768\(\$zero\)
+0+0590 <[^>]*> swc1 \$f[45],-32764\(\$zero\)
+0+0594 <[^>]*> swc1 \$f[45],0\(\$a1\)
+0+0598 <[^>]*> swc1 \$f[45],4\(\$a1\)
+0+059c <[^>]*> swc1 \$f[45],1\(\$a1\)
+0+05a0 <[^>]*> swc1 \$f[45],5\(\$a1\)
+0+05a4 <[^>]*> lui \$at,0x1
+0+05a8 <[^>]*> addu \$at,\$a1,\$at
+0+05ac <[^>]*> swc1 \$f[45],-32768\(\$at\)
+0+05b0 <[^>]*> swc1 \$f[45],-32764\(\$at\)
+0+05b4 <[^>]*> swc1 \$f[45],-32768\(\$a1\)
+0+05b8 <[^>]*> swc1 \$f[45],-32764\(\$a1\)
+0+05bc <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+05bc [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+05c0 <[^>]*> addu \$at,\$a1,\$at
+0+05c4 <[^>]*> swc1 \$f[45],[-0-9]+\(\$at\)
+[ ]*RELOC: 0+05c4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+05c8 <[^>]*> swc1 \$f[45],[-0-9]+\(\$at\)
+[ ]*RELOC: 0+05c8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+05cc <[^>]*> sw \$a0,0\(\$zero\)
+0+05d0 <[^>]*> sw \$a1,4\(\$zero\)
+0+05d4 <[^>]*> lui \$a0,[-0-9x]+
+[ ]*RELOC: 0+05d4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+05d8 <[^>]*> daddu \$a0,\$a0,\$a1
+0+05dc <[^>]*> ld \$a0,[-0-9]+\(\$a0\)
+[ ]*RELOC: 0+05dc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+05e0 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+05e0 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+05e4 <[^>]*> daddu \$at,\$at,\$a1
+0+05e8 <[^>]*> sd \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+05e8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/li.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/li.d
index 7563521d3b7..dd5968b69ce 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/li.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/li.d
@@ -9,9 +9,9 @@ No symbols in .*
Disassembly of section .text:
0+0000 li \$a0,0
0+0004 li \$a0,1
-0+0008 li \$a0,32768
+0+0008 li \$a0,0x8000
0+000c li \$a0,-32768
-0+0010 lui \$a0,1
-0+0014 lui \$a0,1
-0+0018 ori \$a0,\$a0,42405
+0+0010 lui \$a0,0x1
+0+0014 lui \$a0,0x1
+0+0018 ori \$a0,\$a0,0xa5a5
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-empic.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-empic.d
index 622cbf580cf..6ce3b2d43d2 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-empic.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-empic.d
@@ -16,6 +16,6 @@ Disassembly of section .text:
[ ]*RELOC: 0+000c [A-Z0-9_]*LITERAL[A-Z0-9_]* .lit8.*
0+0010 <[^>]*> lwc1 \$f[45],-16364\(\$gp\)
[ ]*RELOC: 0+0010 [A-Z0-9_]*LITERAL[A-Z0-9_]* .lit8.*
-0+0014 <[^>]*> lui \$a0,16256
-0+0018 <[^>]*> lui \$at,16256
+0+0014 <[^>]*> lui \$a0,0x3f80
+0+0018 <[^>]*> lui \$at,0x3f80
0+001c <[^>]*> mtc1 \$at,\$f4
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-svr4pic.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-svr4pic.d
index 5981e7a9274..9965bfaba8c 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-svr4pic.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-svr4pic.d
@@ -22,7 +22,7 @@ Disassembly of section .text:
[ ]*RELOC: 0+0018 R_MIPS_LO16 .rodata
0+001c <[^>]*> lwc1 \$f4,12\(\$at\)
[ ]*RELOC: 0+001c R_MIPS_LO16 .rodata
-0+0020 <[^>]*> lui \$a0,16256
-0+0024 <[^>]*> lui \$at,16256
+0+0020 <[^>]*> lui \$a0,0x3f80
+0+0024 <[^>]*> lui \$at,0x3f80
0+0028 <[^>]*> mtc1 \$at,\$f4
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-xgot.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-xgot.d
new file mode 100644
index 00000000000..156a58e22d4
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lif-xgot.d
@@ -0,0 +1,28 @@
+#objdump: -dr
+#name: MIPS lifloat-xgot
+#as: -mips1 -KPIC -xgot
+#source: lifloat.s
+
+# Test the li.d and li.s macros with -KPIC -xgot.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0000 R_MIPS_GOT16 .rodata
+...
+0+0008 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0008 R_MIPS_LO16 .rodata
+0+000c <[^>]*> lw \$a1,4\(\$at\)
+[ ]*RELOC: 0+000c R_MIPS_LO16 .rodata
+0+0010 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0010 R_MIPS_GOT16 .rodata
+...
+0+0018 <[^>]*> lwc1 \$f5,8\(\$at\)
+[ ]*RELOC: 0+0018 R_MIPS_LO16 .rodata
+0+001c <[^>]*> lwc1 \$f4,12\(\$at\)
+[ ]*RELOC: 0+001c R_MIPS_LO16 .rodata
+0+0020 <[^>]*> lui \$a0,0x3f80
+0+0024 <[^>]*> lui \$at,0x3f80
+0+0028 <[^>]*> mtc1 \$at,\$f4
+...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lifloat.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lifloat.d
index 3090b24ecce..05e855e99bf 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lifloat.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/lifloat.d
@@ -7,7 +7,7 @@
.*: +file format .*mips.*
Disassembly of section .text:
-0+0000 <[^>]*> lui \$at,0
+0+0000 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+0000 [A-Z0-9_]*HI[A-Z0-9_]* .ro?data.*
0+0004 <[^>]*> lw \$a0,[-0-9]+\(\$at\)
[ ]*RELOC: 0+0004 [A-Z0-9_]*LO[A-Z0-9_]* .ro?data.*
@@ -17,7 +17,7 @@ Disassembly of section .text:
[ ]*RELOC: 0+000c [A-Z0-9_]*LITERAL[A-Z0-9_]* .lit8.*
0+0010 <[^>]*> lwc1 \$f[45],[-0-9]+\(\$gp\)
[ ]*RELOC: 0+0010 [A-Z0-9_]*LITERAL[A-Z0-9_]* .lit8.*
-0+0014 <[^>]*> lui \$a0,16256
+0+0014 <[^>]*> lui \$a0,0x3f80
0+0018 <[^>]*> lwc1 \$f4,[-0-9]+\(\$gp\)
[ ]*RELOC: 0+0018 [A-Z0-9_]*LITERAL[A-Z0-9_]* .lit4.*
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/mul.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/mul.d
index ce1f27eda8e..342473e41b5 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/mul.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/mul.d
@@ -20,7 +20,7 @@ Disassembly of section .text:
...
0+0030 mult \$a1,\$at
0+0034 mflo \$a0
-0+0038 li \$at,32768
+0+0038 li \$at,0x8000
...
0+0040 mult \$a1,\$at
0+0044 mflo \$a0
@@ -28,12 +28,12 @@ Disassembly of section .text:
...
0+0050 mult \$a1,\$at
0+0054 mflo \$a0
-0+0058 lui \$at,1
+0+0058 lui \$at,0x1
...
0+0060 mult \$a1,\$at
0+0064 mflo \$a0
-0+0068 lui \$at,1
-0+006c ori \$at,\$at,42405
+0+0068 lui \$at,0x1
+0+006c ori \$at,\$at,0xa5a5
0+0070 mult \$a1,\$at
0+0074 mflo \$a0
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/sb.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/sb.d
index 476805aecd4..d03c708ee92 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/sb.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/sb.d
@@ -9,399 +9,388 @@
Disassembly of section .text:
0+0000 <[^>]*> sb \$a0,0\(\$zero\)
0+0004 <[^>]*> sb \$a0,1\(\$zero\)
-0+0008 <[^>]*> lui \$at,1
+0+0008 <[^>]*> lui \$at,0x1
0+000c <[^>]*> sb \$a0,-32768\(\$at\)
0+0010 <[^>]*> sb \$a0,-32768\(\$zero\)
-0+0014 <[^>]*> lui \$at,1
+0+0014 <[^>]*> lui \$at,0x1
0+0018 <[^>]*> sb \$a0,0\(\$at\)
-0+001c <[^>]*> lui \$at,2
+0+001c <[^>]*> lui \$at,0x2
0+0020 <[^>]*> sb \$a0,-23131\(\$at\)
0+0024 <[^>]*> sb \$a0,0\(\$a1\)
0+0028 <[^>]*> sb \$a0,1\(\$a1\)
-0+002c <[^>]*> lui \$at,1
+0+002c <[^>]*> lui \$at,0x1
0+0030 <[^>]*> addu \$at,\$at,\$a1
0+0034 <[^>]*> sb \$a0,-32768\(\$at\)
0+0038 <[^>]*> sb \$a0,-32768\(\$a1\)
-0+003c <[^>]*> lui \$at,1
+0+003c <[^>]*> lui \$at,0x1
0+0040 <[^>]*> addu \$at,\$at,\$a1
0+0044 <[^>]*> sb \$a0,0\(\$at\)
-0+0048 <[^>]*> lui \$at,2
+0+0048 <[^>]*> lui \$at,0x2
0+004c <[^>]*> addu \$at,\$at,\$a1
0+0050 <[^>]*> sb \$a0,-23131\(\$at\)
-0+0054 <[^>]*> lui \$at,0
+0+0054 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+0054 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0058 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
[ ]*RELOC: 0+0058 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+005c <[^>]*> lui \$at,0
+0+005c <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+005c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0060 <[^>]*> sb \$a0,0\(\$at\)
[ ]*RELOC: 0+0060 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+0064 <[^>]*> sb \$a0,0\(\$gp\)
[ ]*RELOC: 0+0064 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
-0+0068 <[^>]*> lui \$at,0
+0+0068 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+0068 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+006c <[^>]*> sb \$a0,0\(\$at\)
[ ]*RELOC: 0+006c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
0+0070 <[^>]*> sb \$a0,0\(\$gp\)
[ ]*RELOC: 0+0070 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
-0+0074 <[^>]*> lui \$at,0
+0+0074 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+0074 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+0078 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
[ ]*RELOC: 0+0078 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
0+007c <[^>]*> sb \$a0,[-0-9]+\(\$gp\)
[ ]*RELOC: 0+007c [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
-0+0080 <[^>]*> lui \$at,0
+0+0080 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+0080 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0084 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
[ ]*RELOC: 0+0084 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0088 <[^>]*> lui \$at,0
+0+0088 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+0088 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+008c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
[ ]*RELOC: 0+008c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0090 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0090 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0094 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0094 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0098 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0098 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+009c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+009c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+00a0 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00a0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0090 <[^>]*> sb \$a0,1\(\$gp\)
+[ ]*RELOC: 0+0090 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+0094 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0094 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0098 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0098 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+009c <[^>]*> sb \$a0,1\(\$gp\)
+[ ]*RELOC: 0+009c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00a0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00a0 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+00a4 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+00a4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+00a8 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00a8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+00ac <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+00ac [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+00b0 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00b0 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+00b4 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+00b4 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+00b8 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+00b8 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+00bc <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+00bc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+00c0 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+00c0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+00c4 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+00c4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+00c8 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+00c8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+00cc <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+00cc [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+00d0 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+00d0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+00d4 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+00d4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+00d8 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+00d8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+00dc <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+00dc [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+00e0 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+00e0 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+00e4 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+00e4 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+00e8 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+00e8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+00ec <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+00ec [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+00f0 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00f0 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+00f4 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+00f4 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+00f8 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00f8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+00fc <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+00fc [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0100 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0100 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0104 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0104 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0108 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0108 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+010c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+010c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0110 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0110 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0114 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0114 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0118 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0118 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+011c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+011c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0120 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0120 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0124 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0124 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0128 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0128 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+012c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+012c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0130 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0130 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0134 <[^>]*> sb \$a0,0\(\$at\)
-[ ]*RELOC: 0+0134 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0138 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0138 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+013c <[^>]*> sb \$a0,0\(\$at\)
-[ ]*RELOC: 0+013c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0140 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0140 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0144 <[^>]*> sb \$a0,0\(\$at\)
-[ ]*RELOC: 0+0144 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0148 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0148 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+014c <[^>]*> sb \$a0,0\(\$at\)
-[ ]*RELOC: 0+014c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0150 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0150 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0154 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0154 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0158 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0158 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+015c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+015c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0160 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0160 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0164 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0164 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0168 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0168 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+016c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+016c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0170 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0170 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0174 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0174 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0178 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0178 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+017c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+017c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0180 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0180 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0184 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0184 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0188 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0188 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+018c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+018c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0190 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0190 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+00a4 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+00a8 <[^>]*> sb \$a0,[-0-9]+\(\$gp\)
+[ ]*RELOC: 0+00a8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00ac <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+00ac [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+00b0 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+00b0 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+00b4 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+00b4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+00b8 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+00b8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+00bc <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+00bc [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+00c0 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+00c0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+00c4 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+00c4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+00c8 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+00c8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+00cc <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+00cc [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+00d0 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+00d0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+00d4 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+00d4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+00d8 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+00d8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+00dc <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+00dc [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+00e0 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+00e0 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+00e4 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00e4 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+00e8 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+00e8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+00ec <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00ec [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+00f0 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+00f0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+00f4 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00f4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+00f8 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+00f8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+00fc <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00fc [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0100 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0100 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0104 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0104 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0108 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0108 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+010c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+010c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0110 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0110 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0114 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0114 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0118 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0118 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+011c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+011c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0120 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0120 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0124 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0124 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0128 <[^>]*> sb \$a0,0\(\$at\)
+[ ]*RELOC: 0+0128 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+012c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+012c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+0130 <[^>]*> sb \$a0,0\(\$at\)
+[ ]*RELOC: 0+0130 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0134 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0134 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0138 <[^>]*> sb \$a0,0\(\$at\)
+[ ]*RELOC: 0+0138 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+013c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+013c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0140 <[^>]*> sb \$a0,0\(\$at\)
+[ ]*RELOC: 0+0140 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0144 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0144 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0148 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0148 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+014c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+014c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0150 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0150 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0154 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0154 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0158 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0158 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+015c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+015c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0160 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0160 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0164 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0164 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+0168 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0168 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+016c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+016c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0170 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0170 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0174 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0174 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0178 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0178 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+017c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+017c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0180 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0180 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0184 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0184 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0188 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0188 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+018c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+018c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0190 <[^>]*> addu \$at,\$at,\$a1
0+0194 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0194 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0198 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0198 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+0194 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0198 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0198 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+019c <[^>]*> addu \$at,\$at,\$a1
-0+01a0 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01a0 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+01a4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01a4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+01a8 <[^>]*> addu \$at,\$at,\$a1
-0+01ac <[^>]*> sb \$a0,0\(\$at\)
-[ ]*RELOC: 0+01ac [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+01b0 <[^>]*> addu \$at,\$a1,\$gp
+0+01a0 <[^>]*> sb \$a0,0\(\$at\)
+[ ]*RELOC: 0+01a0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+01a4 <[^>]*> addu \$at,\$a1,\$gp
+0+01a8 <[^>]*> sb \$a0,0\(\$at\)
+[ ]*RELOC: 0+01a8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+01ac <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01ac [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+01b0 <[^>]*> addu \$at,\$at,\$a1
0+01b4 <[^>]*> sb \$a0,0\(\$at\)
-[ ]*RELOC: 0+01b4 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
-0+01b8 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01b8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+01bc <[^>]*> addu \$at,\$at,\$a1
-0+01c0 <[^>]*> sb \$a0,0\(\$at\)
-[ ]*RELOC: 0+01c0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+01c4 <[^>]*> addu \$at,\$a1,\$gp
-0+01c8 <[^>]*> sb \$a0,0\(\$at\)
-[ ]*RELOC: 0+01c8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
-0+01cc <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01cc [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+01d0 <[^>]*> addu \$at,\$at,\$a1
-0+01d4 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01d4 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+01d8 <[^>]*> addu \$at,\$a1,\$gp
+[ ]*RELOC: 0+01b4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+01b8 <[^>]*> addu \$at,\$a1,\$gp
+0+01bc <[^>]*> sb \$a0,0\(\$at\)
+[ ]*RELOC: 0+01bc [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+01c0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01c0 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+01c4 <[^>]*> addu \$at,\$at,\$a1
+0+01c8 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+01c8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+01cc <[^>]*> addu \$at,\$a1,\$gp
+0+01d0 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+01d0 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+01d4 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01d4 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+01d8 <[^>]*> addu \$at,\$at,\$a1
0+01dc <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01dc [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
-0+01e0 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01e0 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+01dc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+01e0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01e0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+01e4 <[^>]*> addu \$at,\$at,\$a1
0+01e8 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01e8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+01ec <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01ec [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+01f0 <[^>]*> addu \$at,\$at,\$a1
-0+01f4 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+01f4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+01f8 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01f8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+01fc <[^>]*> addu \$at,\$at,\$a1
-0+0200 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0200 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0204 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0204 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0208 <[^>]*> addu \$at,\$at,\$a1
-0+020c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+020c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0210 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0210 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0214 <[^>]*> addu \$at,\$at,\$a1
+[ ]*RELOC: 0+01e8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+01ec <[^>]*> addu \$at,\$a1,\$gp
+0+01f0 <[^>]*> sb \$a0,1\(\$at\)
+[ ]*RELOC: 0+01f0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+01f4 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01f4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+01f8 <[^>]*> addu \$at,\$at,\$a1
+0+01fc <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+01fc [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0200 <[^>]*> addu \$at,\$a1,\$gp
+0+0204 <[^>]*> sb \$a0,1\(\$at\)
+[ ]*RELOC: 0+0204 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+0208 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0208 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+020c <[^>]*> addu \$at,\$at,\$a1
+0+0210 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0210 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0214 <[^>]*> addu \$at,\$a1,\$gp
0+0218 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0218 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+021c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+021c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+0218 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+021c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+021c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0220 <[^>]*> addu \$at,\$at,\$a1
0+0224 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0224 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0228 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0228 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+0224 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0228 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0228 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+022c <[^>]*> addu \$at,\$at,\$a1
0+0230 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0230 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0234 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0234 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+0230 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0234 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0234 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+0238 <[^>]*> addu \$at,\$at,\$a1
0+023c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+023c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0240 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0240 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+023c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0240 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0240 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0244 <[^>]*> addu \$at,\$at,\$a1
0+0248 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0248 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+024c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+024c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+0248 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+024c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+024c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+0250 <[^>]*> addu \$at,\$at,\$a1
0+0254 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0254 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0258 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0258 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+0254 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0258 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0258 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+025c <[^>]*> addu \$at,\$at,\$a1
0+0260 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0260 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0264 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0264 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+0260 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0264 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0264 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+0268 <[^>]*> addu \$at,\$at,\$a1
0+026c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+026c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0270 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0270 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+026c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0270 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0270 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0274 <[^>]*> addu \$at,\$at,\$a1
0+0278 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0278 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+027c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+027c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+0278 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+027c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+027c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0280 <[^>]*> addu \$at,\$at,\$a1
0+0284 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0284 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0288 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0288 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+0284 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0288 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0288 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+028c <[^>]*> addu \$at,\$at,\$a1
0+0290 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0290 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0294 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0294 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+0290 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0294 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0294 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0298 <[^>]*> addu \$at,\$at,\$a1
0+029c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+029c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+02a0 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+02a0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+029c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+02a0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02a0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+02a4 <[^>]*> addu \$at,\$at,\$a1
0+02a8 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02a8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+02ac <[^>]*> lui \$at,0
-[ ]*RELOC: 0+02ac [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+02a8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+02ac <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02ac [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+02b0 <[^>]*> addu \$at,\$at,\$a1
0+02b4 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02b4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+02b8 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+02b8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+02b4 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+02b8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02b8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+02bc <[^>]*> addu \$at,\$at,\$a1
0+02c0 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02c0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+02c4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+02c4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+[ ]*RELOC: 0+02c0 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+02c4 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02c4 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+02c8 <[^>]*> addu \$at,\$at,\$a1
0+02cc <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02cc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+02d0 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+02d0 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+02cc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+02d0 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02d0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+02d4 <[^>]*> addu \$at,\$at,\$a1
-0+02d8 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02d8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+02dc <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02dc [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+02d8 <[^>]*> sb \$a0,0\(\$at\)
+[ ]*RELOC: 0+02d8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+02dc <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02dc [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+02e0 <[^>]*> addu \$at,\$at,\$a1
-0+02e4 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+02e4 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+02e8 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02e8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+02e4 <[^>]*> sb \$a0,0\(\$at\)
+[ ]*RELOC: 0+02e4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+02e8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02e8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+02ec <[^>]*> addu \$at,\$at,\$a1
0+02f0 <[^>]*> sb \$a0,0\(\$at\)
-[ ]*RELOC: 0+02f0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+02f4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02f4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+02f0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+02f4 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02f4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+02f8 <[^>]*> addu \$at,\$at,\$a1
0+02fc <[^>]*> sb \$a0,0\(\$at\)
-[ ]*RELOC: 0+02fc [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0300 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0300 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+02fc [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0300 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0300 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+0304 <[^>]*> addu \$at,\$at,\$a1
-0+0308 <[^>]*> sb \$a0,0\(\$at\)
-[ ]*RELOC: 0+0308 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+030c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+030c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0308 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0308 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+030c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+030c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+0310 <[^>]*> addu \$at,\$at,\$a1
-0+0314 <[^>]*> sb \$a0,0\(\$at\)
-[ ]*RELOC: 0+0314 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0318 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0318 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0314 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
+[ ]*RELOC: 0+0314 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0318 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0318 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+031c <[^>]*> addu \$at,\$at,\$a1
0+0320 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0320 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0324 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0324 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+[ ]*RELOC: 0+0320 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0324 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0324 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0328 <[^>]*> addu \$at,\$at,\$a1
0+032c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+032c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0330 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0330 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+[ ]*RELOC: 0+032c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0330 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0330 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
0+0334 <[^>]*> addu \$at,\$at,\$a1
0+0338 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0338 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+033c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+033c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+[ ]*RELOC: 0+0338 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+033c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+033c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0340 <[^>]*> addu \$at,\$at,\$a1
0+0344 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0344 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0348 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0348 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+[ ]*RELOC: 0+0344 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0348 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0348 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
0+034c <[^>]*> addu \$at,\$at,\$a1
0+0350 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0350 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0354 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0354 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+[ ]*RELOC: 0+0350 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0354 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0354 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+0358 <[^>]*> addu \$at,\$at,\$a1
0+035c <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+035c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0360 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0360 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+[ ]*RELOC: 0+035c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0360 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0360 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
0+0364 <[^>]*> addu \$at,\$at,\$a1
0+0368 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0368 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+036c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+036c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0370 <[^>]*> addu \$at,\$at,\$a1
-0+0374 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0374 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0378 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0378 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+037c <[^>]*> addu \$at,\$at,\$a1
-0+0380 <[^>]*> sb \$a0,[-0-9]+\(\$at\)
-[ ]*RELOC: 0+0380 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0384 <[^>]*> sw \$a0,0\(\$zero\)
-0+0388 <[^>]*> sw \$a1,4\(\$zero\)
-0+038c <[^>]*> sh \$a0,0\(\$zero\)
-0+0390 <[^>]*> sw \$a0,0\(\$zero\)
-0+0394 <[^>]*> sc \$a0,0\(\$zero\)
-0+0398 <[^>]*> swc1 \$f4,0\(\$zero\)
-0+039c <[^>]*> swc2 \$4,0\(\$zero\)
-0+03a0 <[^>]*> swc3 \$4,0\(\$zero\)
-0+03a4 <[^>]*> swc1 \$f4,0\(\$zero\)
-0+03a8 <[^>]*> swl \$a0,0\(\$zero\)
-0+03ac <[^>]*> swr \$a0,0\(\$zero\)
+[ ]*RELOC: 0+0368 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+036c <[^>]*> sw \$a0,0\(\$zero\)
+0+0370 <[^>]*> sw \$a1,4\(\$zero\)
+0+0374 <[^>]*> sh \$a0,0\(\$zero\)
+0+0378 <[^>]*> sw \$a0,0\(\$zero\)
+0+037c <[^>]*> sc \$a0,0\(\$zero\)
+0+0380 <[^>]*> swc1 \$f4,0\(\$zero\)
+0+0384 <[^>]*> swc2 \$4,0\(\$zero\)
+0+0388 <[^>]*> swc3 \$4,0\(\$zero\)
+0+038c <[^>]*> swc1 \$f4,0\(\$zero\)
+0+0390 <[^>]*> swl \$a0,0\(\$zero\)
+0+0394 <[^>]*> swr \$a0,0\(\$zero\)
+...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/trunc.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/trunc.d
index 4404eb4748b..99eb6f3314b 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/trunc.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/trunc.d
@@ -11,8 +11,8 @@ Disassembly of section .text:
0+0000 cfc1 \$a0,\$31
0+0004 cfc1 \$a0,\$31
...
-0+000c ori \$at,\$a0,3
-0+0010 xori \$at,\$at,2
+0+000c ori \$at,\$a0,0x3
+0+0010 xori \$at,\$at,0x2
0+0014 ctc1 \$at,\$31
...
0+001c cvt.w.d \$f4,\$f6
@@ -21,8 +21,8 @@ Disassembly of section .text:
0+0028 cfc1 \$a0,\$31
0+002c cfc1 \$a0,\$31
...
-0+0034 ori \$at,\$a0,3
-0+0038 xori \$at,\$at,2
+0+0034 ori \$at,\$a0,0x3
+0+0038 xori \$at,\$at,0x2
0+003c ctc1 \$at,\$31
...
0+0044 cvt.w.s \$f4,\$f6
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/uld.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/uld.d
index a3cf4031bf3..595c0b4462a 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/uld.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/uld.d
@@ -11,29 +11,29 @@ Disassembly of section .text:
0+0004 <[^>]*> ldr \$a0,[07]\(\$zero\)
0+0008 <[^>]*> ldl \$a0,[18]\(\$zero\)
0+000c <[^>]*> ldr \$a0,[18]\(\$zero\)
-0+0010 <[^>]*> li \$at,32768
+0+0010 <[^>]*> li \$at,0x8000
0+0014 <[^>]*> ldl \$a0,[07]\(\$at\)
0+0018 <[^>]*> ldr \$a0,[07]\(\$at\)
0+001c <[^>]*> ldl \$a0,-3276[18]\(\$zero\)
0+0020 <[^>]*> ldr \$a0,-3276[18]\(\$zero\)
-0+0024 <[^>]*> lui \$at,1
+0+0024 <[^>]*> lui \$at,0x1
0+0028 <[^>]*> ldl \$a0,[07]\(\$at\)
0+002c <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0030 <[^>]*> lui \$at,1
-0+0034 <[^>]*> ori \$at,\$at,42405
+0+0030 <[^>]*> lui \$at,0x1
+0+0034 <[^>]*> ori \$at,\$at,0xa5a5
0+0038 <[^>]*> ldl \$a0,[07]\(\$at\)
0+003c <[^>]*> ldr \$a0,[07]\(\$at\)
0+0040 <[^>]*> ldl \$a0,[07]\(\$a1\)
0+0044 <[^>]*> ldr \$a0,[07]\(\$a1\)
0+0048 <[^>]*> ldl \$a0,[18]\(\$a1\)
0+004c <[^>]*> ldr \$a0,[-0-9]+\(\$a1\)
-0+0050 <[^>]*> lui \$at,[-0-9]+
+0+0050 <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+0050 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0054 <[^>]*> daddiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0054 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+0058 <[^>]*> ldl \$a0,[07]\(\$at\)
0+005c <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0060 <[^>]*> lui \$at,0
+0+0060 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+0060 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0064 <[^>]*> daddiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0064 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
@@ -43,7 +43,7 @@ Disassembly of section .text:
[ ]*RELOC: 0+0070 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
0+0074 <[^>]*> ldl \$a0,[07]\(\$at\)
0+0078 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+007c <[^>]*> lui \$at,0
+0+007c <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+007c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0080 <[^>]*> daddiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0080 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
@@ -53,7 +53,7 @@ Disassembly of section .text:
[ ]*RELOC: 0+008c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
0+0090 <[^>]*> ldl \$a0,[07]\(\$at\)
0+0094 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0098 <[^>]*> lui \$at,[-0-9]+
+0+0098 <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+0098 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+009c <[^>]*> daddiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+009c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
@@ -63,214 +63,208 @@ Disassembly of section .text:
[ ]*RELOC: 0+00a8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
0+00ac <[^>]*> ldl \$a0,[07]\(\$at\)
0+00b0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+00b4 <[^>]*> lui \$at,0
+0+00b4 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00b4 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+00b8 <[^>]*> daddiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+00b8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+00bc <[^>]*> ldl \$a0,[07]\(\$at\)
0+00c0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+00c4 <[^>]*> lui \$at,0
+0+00c4 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00c4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+00c8 <[^>]*> daddiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+00c8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+00cc <[^>]*> ldl \$a0,[07]\(\$at\)
0+00d0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+00d4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00d4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+00d8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+00d8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+00dc <[^>]*> ldl \$a0,[07]\(\$at\)
-0+00e0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+00e4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00e4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+00e8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+00e8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+00ec <[^>]*> ldl \$a0,[07]\(\$at\)
-0+00f0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+00f4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00f4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+00f8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+00f8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+00fc <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0100 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0104 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0104 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0108 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0108 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+010c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0110 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0114 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0114 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0118 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0118 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+011c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0120 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0124 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0124 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0128 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0128 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+012c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0130 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0134 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0134 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0138 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0138 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+013c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0140 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0144 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0144 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0148 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0148 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+014c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0150 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0154 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0154 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0158 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0158 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+015c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0160 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0164 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0164 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0168 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0168 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+016c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0170 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0174 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0174 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0178 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0178 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+017c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0180 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0184 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0184 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0188 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0188 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+018c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0190 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0194 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0194 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0198 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0198 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+019c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+01a0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+01a4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01a4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+01a8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01a8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+01ac <[^>]*> ldl \$a0,[07]\(\$at\)
-0+01b0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+01b4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01b4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+01b8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01b8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+01bc <[^>]*> ldl \$a0,[07]\(\$at\)
-0+01c0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+01c4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01c4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+01c8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01c8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+01cc <[^>]*> ldl \$a0,[07]\(\$at\)
-0+01d0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+01d4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01d4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+01d8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01d8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+01dc <[^>]*> ldl \$a0,[07]\(\$at\)
-0+01e0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+01e4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01e4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+01e8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01e8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+01ec <[^>]*> ldl \$a0,[07]\(\$at\)
-0+01f0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+01f4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01f4 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+01f8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01f8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+01fc <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0200 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0204 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0204 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0208 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0208 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+020c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0210 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0214 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0214 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0218 <[^>]*> daddiu \$at,\$at,0
-[ ]*RELOC: 0+0218 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+021c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0220 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0224 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0224 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0228 <[^>]*> daddiu \$at,\$at,0
-[ ]*RELOC: 0+0228 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+022c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0230 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0234 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0234 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0238 <[^>]*> daddiu \$at,\$at,0
-[ ]*RELOC: 0+0238 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+023c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0240 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0244 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0244 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0248 <[^>]*> daddiu \$at,\$at,0
-[ ]*RELOC: 0+0248 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+024c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0250 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0254 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0254 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0258 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0258 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+025c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0260 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0264 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0264 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0268 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0268 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+026c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0270 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0274 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0274 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0278 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0278 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+027c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0280 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0284 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0284 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0288 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0288 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+028c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+0290 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+0294 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0294 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0298 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0298 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+029c <[^>]*> ldl \$a0,[07]\(\$at\)
-0+02a0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+02a4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02a4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+02a8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02a8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+02ac <[^>]*> ldl \$a0,[07]\(\$at\)
-0+02b0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+02b4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02b4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+02b8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02b8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+02bc <[^>]*> ldl \$a0,[07]\(\$at\)
-0+02c0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+02c4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02c4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+02c8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02c8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+02cc <[^>]*> ldl \$a0,[07]\(\$at\)
-0+02d0 <[^>]*> ldr \$a0,[07]\(\$at\)
-0+02d4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02d4 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+02d8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02d8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+02dc <[^>]*> ldl \$a0,[07]\(\$at\)
-0+02e0 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+00d4 <[^>]*> daddiu \$at,\$gp,1
+[ ]*RELOC: 0+00d4 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+00d8 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+00dc <[^>]*> ldr \$a0,[07]\(\$at\)
+0+00e0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00e0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+00e4 <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+00e4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+00e8 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+00ec <[^>]*> ldr \$a0,[07]\(\$at\)
+0+00f0 <[^>]*> daddiu \$at,\$gp,1
+[ ]*RELOC: 0+00f0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00f4 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+00f8 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+00fc <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00fc [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0100 <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0100 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0104 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0108 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+010c <[^>]*> daddiu \$at,\$gp,[-0-9]+
+[ ]*RELOC: 0+010c [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+0110 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0114 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0118 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0118 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+011c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+011c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0120 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0124 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0128 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0128 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+012c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+012c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0130 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0134 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0138 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0138 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+013c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+013c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0140 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0144 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0148 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0148 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+014c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+014c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0150 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0154 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0158 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0158 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+015c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+015c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0160 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0164 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0168 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0168 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+016c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+016c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0170 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0174 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0178 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0178 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+017c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+017c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0180 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0184 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0188 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0188 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+018c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+018c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0190 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0194 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0198 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0198 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+019c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+019c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+01a0 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+01a4 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+01a8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01a8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+01ac <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01ac [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+01b0 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+01b4 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+01b8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01b8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+01bc <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01bc [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+01c0 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+01c4 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+01c8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01c8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+01cc <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01cc [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+01d0 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+01d4 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+01d8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01d8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+01dc <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01dc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+01e0 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+01e4 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+01e8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01e8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+01ec <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01ec [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+01f0 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+01f4 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+01f8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+01f8 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+01fc <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01fc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0200 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0204 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0208 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0208 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+020c <[^>]*> daddiu \$at,\$at,0
+[ ]*RELOC: 0+020c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0210 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0214 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0218 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0218 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+021c <[^>]*> daddiu \$at,\$at,0
+[ ]*RELOC: 0+021c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0220 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0224 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0228 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0228 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+022c <[^>]*> daddiu \$at,\$at,0
+[ ]*RELOC: 0+022c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0230 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0234 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0238 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0238 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+023c <[^>]*> daddiu \$at,\$at,0
+[ ]*RELOC: 0+023c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0240 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0244 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0248 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0248 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+024c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+024c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0250 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0254 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0258 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0258 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+025c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+025c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0260 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0264 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0268 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0268 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+026c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+026c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0270 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0274 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0278 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0278 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+027c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+027c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0280 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0284 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0288 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0288 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+028c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+028c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0290 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+0294 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+0298 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0298 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+029c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+029c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+02a0 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+02a4 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+02a8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02a8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+02ac <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02ac [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+02b0 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+02b4 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+02b8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02b8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+02bc <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02bc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+02c0 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+02c4 <[^>]*> ldr \$a0,[07]\(\$at\)
+0+02c8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02c8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+02cc <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02cc [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+02d0 <[^>]*> ldl \$a0,[07]\(\$at\)
+0+02d4 <[^>]*> ldr \$a0,[07]\(\$at\)
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh-svr4pic.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh-svr4pic.d
index 45a27ff3244..b77e0b5276f 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh-svr4pic.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh-svr4pic.d
@@ -64,54 +64,61 @@ Disassembly of section .text:
0+00ac <[^>]*> lw \$at,0\(\$gp\)
[ ]*RELOC: 0+00ac R_MIPS_GOT16 .data
...
-0+00b4 <[^>]*> addiu \$at,\$at,1
+0+00b4 <[^>]*> addiu \$at,\$at,0
[ ]*RELOC: 0+00b4 R_MIPS_LO16 .data
-0+00b8 <[^>]*> lwl \$a0,0\(\$at\)
-0+00bc <[^>]*> lwr \$a0,3\(\$at\)
-0+00c0 <[^>]*> lw \$at,0\(\$gp\)
-[ ]*RELOC: 0+00c0 R_MIPS_GOT16 big_external_data_label
+0+00b8 <[^>]*> addiu \$at,\$at,1
+0+00bc <[^>]*> lwl \$a0,0\(\$at\)
+0+00c0 <[^>]*> lwr \$a0,3\(\$at\)
+0+00c4 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+00c4 R_MIPS_GOT16 big_external_data_label
...
-0+00c8 <[^>]*> sb \$a0,1\(\$at\)
-0+00cc <[^>]*> srl \$a0,\$a0,0x8
-0+00d0 <[^>]*> sb \$a0,0\(\$at\)
-0+00d4 <[^>]*> lbu \$at,1\(\$at\)
-0+00d8 <[^>]*> sll \$a0,\$a0,0x8
-0+00dc <[^>]*> or \$a0,\$a0,\$at
-0+00e0 <[^>]*> lw \$at,0\(\$gp\)
-[ ]*RELOC: 0+00e0 R_MIPS_GOT16 small_external_data_label
+0+00cc <[^>]*> addiu \$at,\$at,1
+0+00d0 <[^>]*> sb \$a0,1\(\$at\)
+0+00d4 <[^>]*> srl \$a0,\$a0,0x8
+0+00d8 <[^>]*> sb \$a0,0\(\$at\)
+0+00dc <[^>]*> lbu \$at,1\(\$at\)
+0+00e0 <[^>]*> sll \$a0,\$a0,0x8
+0+00e4 <[^>]*> or \$a0,\$a0,\$at
+0+00e8 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+00e8 R_MIPS_GOT16 small_external_data_label
...
-0+00e8 <[^>]*> swl \$a0,0\(\$at\)
-0+00ec <[^>]*> swr \$a0,3\(\$at\)
-0+00f0 <[^>]*> lw \$at,0\(\$gp\)
-[ ]*RELOC: 0+00f0 R_MIPS_GOT16 big_external_common
+0+00f0 <[^>]*> addiu \$at,\$at,1
+0+00f4 <[^>]*> swl \$a0,0\(\$at\)
+0+00f8 <[^>]*> swr \$a0,3\(\$at\)
+0+00fc <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+00fc R_MIPS_GOT16 big_external_common
...
-0+00f8 <[^>]*> lb \$a0,0\(\$at\)
-0+00fc <[^>]*> lbu \$at,1\(\$at\)
-0+0100 <[^>]*> sll \$a0,\$a0,0x8
-0+0104 <[^>]*> or \$a0,\$a0,\$at
-0+0108 <[^>]*> lw \$at,0\(\$gp\)
-[ ]*RELOC: 0+0108 R_MIPS_GOT16 small_external_common
+0+0104 <[^>]*> addiu \$at,\$at,1
+0+0108 <[^>]*> lb \$a0,0\(\$at\)
+0+010c <[^>]*> lbu \$at,1\(\$at\)
+0+0110 <[^>]*> sll \$a0,\$a0,0x8
+0+0114 <[^>]*> or \$a0,\$a0,\$at
+0+0118 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0118 R_MIPS_GOT16 small_external_common
...
-0+0110 <[^>]*> lbu \$a0,0\(\$at\)
-0+0114 <[^>]*> lbu \$at,1\(\$at\)
-0+0118 <[^>]*> sll \$a0,\$a0,0x8
-0+011c <[^>]*> or \$a0,\$a0,\$at
-0+0120 <[^>]*> lw \$at,0\(\$gp\)
-[ ]*RELOC: 0+0120 R_MIPS_GOT16 .bss
-...
-0+0128 <[^>]*> addiu \$at,\$at,1
-[ ]*RELOC: 0+0128 R_MIPS_LO16 .bss
-0+012c <[^>]*> lwl \$a0,0\(\$at\)
-0+0130 <[^>]*> lwr \$a0,3\(\$at\)
+0+0120 <[^>]*> addiu \$at,\$at,1
+0+0124 <[^>]*> lbu \$a0,0\(\$at\)
+0+0128 <[^>]*> lbu \$at,1\(\$at\)
+0+012c <[^>]*> sll \$a0,\$a0,0x8
+0+0130 <[^>]*> or \$a0,\$a0,\$at
0+0134 <[^>]*> lw \$at,0\(\$gp\)
[ ]*RELOC: 0+0134 R_MIPS_GOT16 .bss
...
-0+013c <[^>]*> addiu \$at,\$at,1001
+0+013c <[^>]*> addiu \$at,\$at,0
[ ]*RELOC: 0+013c R_MIPS_LO16 .bss
-0+0140 <[^>]*> sb \$a0,1\(\$at\)
-0+0144 <[^>]*> srl \$a0,\$a0,0x8
-0+0148 <[^>]*> sb \$a0,0\(\$at\)
-0+014c <[^>]*> lbu \$at,1\(\$at\)
-0+0150 <[^>]*> sll \$a0,\$a0,0x8
-0+0154 <[^>]*> or \$a0,\$a0,\$at
+0+0140 <[^>]*> addiu \$at,\$at,1
+0+0144 <[^>]*> lwl \$a0,0\(\$at\)
+0+0148 <[^>]*> lwr \$a0,3\(\$at\)
+0+014c <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+014c R_MIPS_GOT16 .bss
+...
+0+0154 <[^>]*> addiu \$at,\$at,1000
+[ ]*RELOC: 0+0154 R_MIPS_LO16 .bss
+0+0158 <[^>]*> addiu \$at,\$at,1
+0+015c <[^>]*> sb \$a0,1\(\$at\)
+0+0160 <[^>]*> srl \$a0,\$a0,0x8
+0+0164 <[^>]*> sb \$a0,0\(\$at\)
+0+0168 <[^>]*> lbu \$at,1\(\$at\)
+0+016c <[^>]*> sll \$a0,\$a0,0x8
+0+0170 <[^>]*> or \$a0,\$a0,\$at
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh-xgot.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh-xgot.d
new file mode 100644
index 00000000000..dfa749805fb
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh-xgot.d
@@ -0,0 +1,154 @@
+#objdump: -dr
+#name: MIPS ulh-xgot
+#as: -mips1 -KPIC -xgot
+#source: ulh-pic.s
+
+# Test the unaligned load and store macros with -KPIC -xgot.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0000 R_MIPS_GOT16 .data
+...
+0+0008 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0008 R_MIPS_LO16 .data
+...
+0+0010 <[^>]*> lb \$a0,0\(\$at\)
+0+0014 <[^>]*> lbu \$at,1\(\$at\)
+0+0018 <[^>]*> sll \$a0,\$a0,0x8
+0+001c <[^>]*> or \$a0,\$a0,\$at
+0+0020 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0020 R_MIPS_GOT_HI16 big_external_data_label
+0+0024 <[^>]*> addu \$at,\$at,\$gp
+0+0028 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0028 R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0030 <[^>]*> lbu \$a0,0\(\$at\)
+0+0034 <[^>]*> lbu \$at,1\(\$at\)
+0+0038 <[^>]*> sll \$a0,\$a0,0x8
+0+003c <[^>]*> or \$a0,\$a0,\$at
+0+0040 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0040 R_MIPS_GOT_HI16 small_external_data_label
+0+0044 <[^>]*> addu \$at,\$at,\$gp
+0+0048 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0048 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+0050 <[^>]*> lwl \$a0,0\(\$at\)
+0+0054 <[^>]*> lwr \$a0,3\(\$at\)
+0+0058 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0058 R_MIPS_GOT_HI16 big_external_common
+0+005c <[^>]*> addu \$at,\$at,\$gp
+0+0060 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0060 R_MIPS_GOT_LO16 big_external_common
+...
+0+0068 <[^>]*> sb \$a0,1\(\$at\)
+0+006c <[^>]*> srl \$a0,\$a0,0x8
+0+0070 <[^>]*> sb \$a0,0\(\$at\)
+0+0074 <[^>]*> lbu \$at,1\(\$at\)
+0+0078 <[^>]*> sll \$a0,\$a0,0x8
+0+007c <[^>]*> or \$a0,\$a0,\$at
+0+0080 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0080 R_MIPS_GOT_HI16 small_external_common
+0+0084 <[^>]*> addu \$at,\$at,\$gp
+0+0088 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0088 R_MIPS_GOT_LO16 small_external_common
+...
+0+0090 <[^>]*> swl \$a0,0\(\$at\)
+0+0094 <[^>]*> swr \$a0,3\(\$at\)
+0+0098 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0098 R_MIPS_GOT16 .bss
+...
+0+00a0 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+00a0 R_MIPS_LO16 .bss
+...
+0+00a8 <[^>]*> lb \$a0,0\(\$at\)
+0+00ac <[^>]*> lbu \$at,1\(\$at\)
+0+00b0 <[^>]*> sll \$a0,\$a0,0x8
+0+00b4 <[^>]*> or \$a0,\$a0,\$at
+0+00b8 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+00b8 R_MIPS_GOT16 .bss
+...
+0+00c0 <[^>]*> addiu \$at,\$at,1000
+[ ]*RELOC: 0+00c0 R_MIPS_LO16 .bss
+...
+0+00c8 <[^>]*> lbu \$a0,0\(\$at\)
+0+00cc <[^>]*> lbu \$at,1\(\$at\)
+0+00d0 <[^>]*> sll \$a0,\$a0,0x8
+0+00d4 <[^>]*> or \$a0,\$a0,\$at
+0+00d8 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+00d8 R_MIPS_GOT16 .data
+...
+0+00e0 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+00e0 R_MIPS_LO16 .data
+...
+0+00e8 <[^>]*> addiu \$at,\$at,1
+0+00ec <[^>]*> lwl \$a0,0\(\$at\)
+0+00f0 <[^>]*> lwr \$a0,3\(\$at\)
+0+00f4 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00f4 R_MIPS_GOT_HI16 big_external_data_label
+0+00f8 <[^>]*> addu \$at,\$at,\$gp
+0+00fc <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+00fc R_MIPS_GOT_LO16 big_external_data_label
+...
+0+0104 <[^>]*> addiu \$at,\$at,1
+0+0108 <[^>]*> sb \$a0,1\(\$at\)
+0+010c <[^>]*> srl \$a0,\$a0,0x8
+0+0110 <[^>]*> sb \$a0,0\(\$at\)
+0+0114 <[^>]*> lbu \$at,1\(\$at\)
+0+0118 <[^>]*> sll \$a0,\$a0,0x8
+0+011c <[^>]*> or \$a0,\$a0,\$at
+0+0120 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0120 R_MIPS_GOT_HI16 small_external_data_label
+0+0124 <[^>]*> addu \$at,\$at,\$gp
+0+0128 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0128 R_MIPS_GOT_LO16 small_external_data_label
+...
+0+0130 <[^>]*> addiu \$at,\$at,1
+0+0134 <[^>]*> swl \$a0,0\(\$at\)
+0+0138 <[^>]*> swr \$a0,3\(\$at\)
+0+013c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+013c R_MIPS_GOT_HI16 big_external_common
+0+0140 <[^>]*> addu \$at,\$at,\$gp
+0+0144 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0144 R_MIPS_GOT_LO16 big_external_common
+...
+0+014c <[^>]*> addiu \$at,\$at,1
+0+0150 <[^>]*> lb \$a0,0\(\$at\)
+0+0154 <[^>]*> lbu \$at,1\(\$at\)
+0+0158 <[^>]*> sll \$a0,\$a0,0x8
+0+015c <[^>]*> or \$a0,\$a0,\$at
+0+0160 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0160 R_MIPS_GOT_HI16 small_external_common
+0+0164 <[^>]*> addu \$at,\$at,\$gp
+0+0168 <[^>]*> lw \$at,0\(\$at\)
+[ ]*RELOC: 0+0168 R_MIPS_GOT_LO16 small_external_common
+...
+0+0170 <[^>]*> addiu \$at,\$at,1
+0+0174 <[^>]*> lbu \$a0,0\(\$at\)
+0+0178 <[^>]*> lbu \$at,1\(\$at\)
+0+017c <[^>]*> sll \$a0,\$a0,0x8
+0+0180 <[^>]*> or \$a0,\$a0,\$at
+0+0184 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+0184 R_MIPS_GOT16 .bss
+...
+0+018c <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+018c R_MIPS_LO16 .bss
+...
+0+0194 <[^>]*> addiu \$at,\$at,1
+0+0198 <[^>]*> lwl \$a0,0\(\$at\)
+0+019c <[^>]*> lwr \$a0,3\(\$at\)
+0+01a0 <[^>]*> lw \$at,0\(\$gp\)
+[ ]*RELOC: 0+01a0 R_MIPS_GOT16 .bss
+...
+0+01a8 <[^>]*> addiu \$at,\$at,1000
+[ ]*RELOC: 0+01a8 R_MIPS_LO16 .bss
+...
+0+01b0 <[^>]*> addiu \$at,\$at,1
+0+01b4 <[^>]*> sb \$a0,1\(\$at\)
+0+01b8 <[^>]*> srl \$a0,\$a0,0x8
+0+01bc <[^>]*> sb \$a0,0\(\$at\)
+0+01c0 <[^>]*> lbu \$at,1\(\$at\)
+0+01c4 <[^>]*> sll \$a0,\$a0,0x8
+0+01c8 <[^>]*> or \$a0,\$a0,\$at
+...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh.d
index 12edb28de11..825192662c1 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulh.d
@@ -15,7 +15,7 @@ Disassembly of section .text:
0+0014 <[^>]*> lbu \$at,[12]\(\$zero\)
0+0018 <[^>]*> sll \$a0,\$a0,0x8
0+001c <[^>]*> or \$a0,\$a0,\$at
-0+0020 <[^>]*> li \$at,32768
+0+0020 <[^>]*> li \$at,0x8000
0+0024 <[^>]*> lb \$a0,[01]\(\$at\)
0+0028 <[^>]*> lbu \$at,[01]\(\$at\)
0+002c <[^>]*> sll \$a0,\$a0,0x8
@@ -24,13 +24,13 @@ Disassembly of section .text:
0+0038 <[^>]*> lbu \$at,-3276[78]\(\$zero\)
0+003c <[^>]*> sll \$a0,\$a0,0x8
0+0040 <[^>]*> or \$a0,\$a0,\$at
-0+0044 <[^>]*> lui \$at,1
+0+0044 <[^>]*> lui \$at,0x1
0+0048 <[^>]*> lb \$a0,[01]\(\$at\)
0+004c <[^>]*> lbu \$at,[01]\(\$at\)
0+0050 <[^>]*> sll \$a0,\$a0,0x8
0+0054 <[^>]*> or \$a0,\$a0,\$at
-0+0058 <[^>]*> lui \$at,1
-0+005c <[^>]*> ori \$at,\$at,42405
+0+0058 <[^>]*> lui \$at,0x1
+0+005c <[^>]*> ori \$at,\$at,0xa5a5
0+0060 <[^>]*> lb \$a0,[01]\(\$at\)
0+0064 <[^>]*> lbu \$at,[01]\(\$at\)
0+0068 <[^>]*> sll \$a0,\$a0,0x8
@@ -43,7 +43,7 @@ Disassembly of section .text:
0+0084 <[^>]*> lbu \$at,[12]\(\$a1\)
0+0088 <[^>]*> sll \$a0,\$a0,0x8
0+008c <[^>]*> or \$a0,\$a0,\$at
-0+0090 <[^>]*> lui \$at,[-0-9]+
+0+0090 <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+0090 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0094 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0094 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
@@ -51,7 +51,7 @@ Disassembly of section .text:
0+009c <[^>]*> lbu \$at,[01]\(\$at\)
0+00a0 <[^>]*> sll \$a0,\$a0,0x8
0+00a4 <[^>]*> or \$a0,\$a0,\$at
-0+00a8 <[^>]*> lui \$at,0
+0+00a8 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00a8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+00ac <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+00ac [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
@@ -65,7 +65,7 @@ Disassembly of section .text:
0+00c8 <[^>]*> lbu \$at,[01]\(\$at\)
0+00cc <[^>]*> sll \$a0,\$a0,0x8
0+00d0 <[^>]*> or \$a0,\$a0,\$at
-0+00d4 <[^>]*> lui \$at,0
+0+00d4 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00d4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+00d8 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+00d8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
@@ -79,7 +79,7 @@ Disassembly of section .text:
0+00f4 <[^>]*> lbu \$at,[01]\(\$at\)
0+00f8 <[^>]*> sll \$a0,\$a0,0x8
0+00fc <[^>]*> or \$a0,\$a0,\$at
-0+0100 <[^>]*> lui \$at,[-0-9]+
+0+0100 <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+0100 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+0104 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0104 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
@@ -93,7 +93,7 @@ Disassembly of section .text:
0+0120 <[^>]*> lbu \$at,[01]\(\$at\)
0+0124 <[^>]*> sll \$a0,\$a0,0x8
0+0128 <[^>]*> or \$a0,\$a0,\$at
-0+012c <[^>]*> lui \$at,0
+0+012c <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+012c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0130 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0130 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
@@ -101,7 +101,7 @@ Disassembly of section .text:
0+0138 <[^>]*> lbu \$at,[01]\(\$at\)
0+013c <[^>]*> sll \$a0,\$a0,0x8
0+0140 <[^>]*> or \$a0,\$a0,\$at
-0+0144 <[^>]*> lui \$at,0
+0+0144 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+0144 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0148 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0148 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
@@ -109,272 +109,266 @@ Disassembly of section .text:
0+0150 <[^>]*> lbu \$at,[01]\(\$at\)
0+0154 <[^>]*> sll \$a0,\$a0,0x8
0+0158 <[^>]*> or \$a0,\$a0,\$at
-0+015c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+015c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0160 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0160 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0164 <[^>]*> lb \$a0,[01]\(\$at\)
-0+0168 <[^>]*> lbu \$at,[01]\(\$at\)
-0+016c <[^>]*> sll \$a0,\$a0,0x8
-0+0170 <[^>]*> or \$a0,\$a0,\$at
-0+0174 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0174 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0178 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0178 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+017c <[^>]*> lb \$a0,[01]\(\$at\)
-0+0180 <[^>]*> lbu \$at,[01]\(\$at\)
-0+0184 <[^>]*> sll \$a0,\$a0,0x8
-0+0188 <[^>]*> or \$a0,\$a0,\$at
-0+018c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+018c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0190 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0190 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0194 <[^>]*> lb \$a0,[01]\(\$at\)
-0+0198 <[^>]*> lbu \$at,[01]\(\$at\)
-0+019c <[^>]*> sll \$a0,\$a0,0x8
-0+01a0 <[^>]*> or \$a0,\$a0,\$at
-0+01a4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01a4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+01a8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01a8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+01ac <[^>]*> lb \$a0,[01]\(\$at\)
-0+01b0 <[^>]*> lbu \$at,[01]\(\$at\)
-0+01b4 <[^>]*> sll \$a0,\$a0,0x8
-0+01b8 <[^>]*> or \$a0,\$a0,\$at
-0+01bc <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01bc [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+01c0 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01c0 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+01c4 <[^>]*> lb \$a0,[01]\(\$at\)
-0+01c8 <[^>]*> lbu \$at,[01]\(\$at\)
-0+01cc <[^>]*> sll \$a0,\$a0,0x8
-0+01d0 <[^>]*> or \$a0,\$a0,\$at
-0+01d4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+01d4 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+01d8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01d8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+01dc <[^>]*> lb \$a0,[01]\(\$at\)
-0+01e0 <[^>]*> lbu \$at,[01]\(\$at\)
-0+01e4 <[^>]*> sll \$a0,\$a0,0x8
-0+01e8 <[^>]*> or \$a0,\$a0,\$at
-0+01ec <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+01ec [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+01f0 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01f0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+01f4 <[^>]*> lb \$a0,[01]\(\$at\)
-0+01f8 <[^>]*> lbu \$at,[01]\(\$at\)
-0+01fc <[^>]*> sll \$a0,\$a0,0x8
-0+0200 <[^>]*> or \$a0,\$a0,\$at
-0+0204 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0204 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0208 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0208 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+020c <[^>]*> lb \$a0,[01]\(\$at\)
-0+0210 <[^>]*> lbu \$at,[01]\(\$at\)
-0+0214 <[^>]*> sll \$a0,\$a0,0x8
-0+0218 <[^>]*> or \$a0,\$a0,\$at
-0+021c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+021c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0220 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0220 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0224 <[^>]*> lb \$a0,[01]\(\$at\)
-0+0228 <[^>]*> lbu \$at,[01]\(\$at\)
-0+022c <[^>]*> sll \$a0,\$a0,0x8
-0+0230 <[^>]*> or \$a0,\$a0,\$at
-0+0234 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0234 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0238 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0238 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+023c <[^>]*> lb \$a0,[01]\(\$at\)
-0+0240 <[^>]*> lbu \$at,[01]\(\$at\)
-0+0244 <[^>]*> sll \$a0,\$a0,0x8
-0+0248 <[^>]*> or \$a0,\$a0,\$at
-0+024c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+024c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0250 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0250 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0254 <[^>]*> lb \$a0,[01]\(\$at\)
-0+0258 <[^>]*> lbu \$at,[01]\(\$at\)
-0+025c <[^>]*> sll \$a0,\$a0,0x8
-0+0260 <[^>]*> or \$a0,\$a0,\$at
-0+0264 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0264 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0268 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0268 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+026c <[^>]*> lb \$a0,[01]\(\$at\)
-0+0270 <[^>]*> lbu \$at,[01]\(\$at\)
-0+0274 <[^>]*> sll \$a0,\$a0,0x8
-0+0278 <[^>]*> or \$a0,\$a0,\$at
-0+027c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+027c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0280 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0280 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0284 <[^>]*> lb \$a0,[01]\(\$at\)
-0+0288 <[^>]*> lbu \$at,[01]\(\$at\)
-0+028c <[^>]*> sll \$a0,\$a0,0x8
-0+0290 <[^>]*> or \$a0,\$a0,\$at
-0+0294 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0294 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0298 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0298 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+029c <[^>]*> lb \$a0,[01]\(\$at\)
-0+02a0 <[^>]*> lbu \$at,[01]\(\$at\)
-0+02a4 <[^>]*> sll \$a0,\$a0,0x8
-0+02a8 <[^>]*> or \$a0,\$a0,\$at
-0+02ac <[^>]*> lui \$at,0
-[ ]*RELOC: 0+02ac [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+02b0 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02b0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+02b4 <[^>]*> lb \$a0,[01]\(\$at\)
-0+02b8 <[^>]*> lbu \$at,[01]\(\$at\)
-0+02bc <[^>]*> sll \$a0,\$a0,0x8
-0+02c0 <[^>]*> or \$a0,\$a0,\$at
-0+02c4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+02c4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+02c8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02c8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+02cc <[^>]*> lb \$a0,[01]\(\$at\)
-0+02d0 <[^>]*> lbu \$at,[01]\(\$at\)
-0+02d4 <[^>]*> sll \$a0,\$a0,0x8
-0+02d8 <[^>]*> or \$a0,\$a0,\$at
-0+02dc <[^>]*> lui \$at,0
-[ ]*RELOC: 0+02dc [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+02e0 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02e0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+02e4 <[^>]*> lb \$a0,[01]\(\$at\)
-0+02e8 <[^>]*> lbu \$at,[01]\(\$at\)
-0+02ec <[^>]*> sll \$a0,\$a0,0x8
-0+02f0 <[^>]*> or \$a0,\$a0,\$at
-0+02f4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+02f4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+02f8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02f8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+02fc <[^>]*> lb \$a0,[01]\(\$at\)
-0+0300 <[^>]*> lbu \$at,[01]\(\$at\)
-0+0304 <[^>]*> sll \$a0,\$a0,0x8
-0+0308 <[^>]*> or \$a0,\$a0,\$at
-0+030c <[^>]*> lui \$at,0
-[ ]*RELOC: 0+030c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0310 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0310 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0314 <[^>]*> lb \$a0,[01]\(\$at\)
-0+0318 <[^>]*> lbu \$at,[01]\(\$at\)
-0+031c <[^>]*> sll \$a0,\$a0,0x8
-0+0320 <[^>]*> or \$a0,\$a0,\$at
-0+0324 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0324 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0328 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0328 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+032c <[^>]*> lb \$a0,[01]\(\$at\)
-0+0330 <[^>]*> lbu \$at,[01]\(\$at\)
-0+0334 <[^>]*> sll \$a0,\$a0,0x8
-0+0338 <[^>]*> or \$a0,\$a0,\$at
-0+033c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+033c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0340 <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+0340 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0344 <[^>]*> lb \$a0,[01]\(\$at\)
-0+0348 <[^>]*> lbu \$at,[01]\(\$at\)
-0+034c <[^>]*> sll \$a0,\$a0,0x8
-0+0350 <[^>]*> or \$a0,\$a0,\$at
-0+0354 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0354 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0358 <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+0358 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+035c <[^>]*> lb \$a0,[01]\(\$at\)
-0+0360 <[^>]*> lbu \$at,[01]\(\$at\)
-0+0364 <[^>]*> sll \$a0,\$a0,0x8
-0+0368 <[^>]*> or \$a0,\$a0,\$at
-0+036c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+036c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0370 <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+0370 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0374 <[^>]*> lb \$a0,[01]\(\$at\)
-0+0378 <[^>]*> lbu \$at,[01]\(\$at\)
-0+037c <[^>]*> sll \$a0,\$a0,0x8
-0+0380 <[^>]*> or \$a0,\$a0,\$at
-0+0384 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0384 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0388 <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+0388 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+038c <[^>]*> lb \$a0,[01]\(\$at\)
-0+0390 <[^>]*> lbu \$at,[01]\(\$at\)
-0+0394 <[^>]*> sll \$a0,\$a0,0x8
-0+0398 <[^>]*> or \$a0,\$a0,\$at
-0+039c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+039c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+03a0 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+03a0 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+03a4 <[^>]*> lb \$a0,[01]\(\$at\)
-0+03a8 <[^>]*> lbu \$at,[01]\(\$at\)
-0+03ac <[^>]*> sll \$a0,\$a0,0x8
-0+03b0 <[^>]*> or \$a0,\$a0,\$at
-0+03b4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+03b4 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+03b8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+03b8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+03bc <[^>]*> lb \$a0,[01]\(\$at\)
-0+03c0 <[^>]*> lbu \$at,[01]\(\$at\)
-0+03c4 <[^>]*> sll \$a0,\$a0,0x8
-0+03c8 <[^>]*> or \$a0,\$a0,\$at
-0+03cc <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+03cc [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+03d0 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+03d0 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+03d4 <[^>]*> lb \$a0,[01]\(\$at\)
-0+03d8 <[^>]*> lbu \$at,[01]\(\$at\)
-0+03dc <[^>]*> sll \$a0,\$a0,0x8
-0+03e0 <[^>]*> or \$a0,\$a0,\$at
-0+03e4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+03e4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+03e8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+03e8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+03ec <[^>]*> lb \$a0,[01]\(\$at\)
-0+03f0 <[^>]*> lbu \$at,[01]\(\$at\)
-0+03f4 <[^>]*> sll \$a0,\$a0,0x8
-0+03f8 <[^>]*> or \$a0,\$a0,\$at
-0+03fc <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+03fc [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0400 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0400 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0404 <[^>]*> lb \$a0,[01]\(\$at\)
-0+0408 <[^>]*> lbu \$at,[01]\(\$at\)
-0+040c <[^>]*> sll \$a0,\$a0,0x8
-0+0410 <[^>]*> or \$a0,\$a0,\$at
-0+0414 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0414 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0418 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0418 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+041c <[^>]*> lb \$a0,[01]\(\$at\)
-0+0420 <[^>]*> lbu \$at,[01]\(\$at\)
-0+0424 <[^>]*> sll \$a0,\$a0,0x8
-0+0428 <[^>]*> or \$a0,\$a0,\$at
-0+042c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+042c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0430 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0430 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0434 <[^>]*> lb \$a0,[01]\(\$at\)
-0+0438 <[^>]*> lbu \$at,[01]\(\$at\)
-0+043c <[^>]*> sll \$a0,\$a0,0x8
-0+0440 <[^>]*> or \$a0,\$a0,\$at
-0+0444 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0444 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0448 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0448 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+044c <[^>]*> lb \$a0,[01]\(\$at\)
-0+0450 <[^>]*> lbu \$at,[01]\(\$at\)
-0+0454 <[^>]*> sll \$a0,\$a0,0x8
-0+0458 <[^>]*> or \$a0,\$a0,\$at
-0+045c <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+045c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0460 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0460 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0464 <[^>]*> lb \$a0,[01]\(\$at\)
-0+0468 <[^>]*> lbu \$at,[01]\(\$at\)
-0+046c <[^>]*> sll \$a0,\$a0,0x8
-0+0470 <[^>]*> or \$a0,\$a0,\$at
-0+0474 <[^>]*> lbu \$a0,[01]\(\$zero\)
-0+0478 <[^>]*> lbu \$at,[01]\(\$zero\)
-0+047c <[^>]*> sll \$a0,\$a0,0x8
-0+0480 <[^>]*> or \$a0,\$a0,\$at
+0+015c <[^>]*> addiu \$at,\$gp,1
+[ ]*RELOC: 0+015c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+0160 <[^>]*> lb \$a0,[01]\(\$at\)
+0+0164 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0168 <[^>]*> sll \$a0,\$a0,0x8
+0+016c <[^>]*> or \$a0,\$a0,\$at
+0+0170 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0170 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0174 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0174 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0178 <[^>]*> lb \$a0,[01]\(\$at\)
+0+017c <[^>]*> lbu \$at,[01]\(\$at\)
+0+0180 <[^>]*> sll \$a0,\$a0,0x8
+0+0184 <[^>]*> or \$a0,\$a0,\$at
+0+0188 <[^>]*> addiu \$at,\$gp,1
+[ ]*RELOC: 0+0188 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+018c <[^>]*> lb \$a0,[01]\(\$at\)
+0+0190 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0194 <[^>]*> sll \$a0,\$a0,0x8
+0+0198 <[^>]*> or \$a0,\$a0,\$at
+0+019c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+019c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+01a0 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01a0 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+01a4 <[^>]*> lb \$a0,[01]\(\$at\)
+0+01a8 <[^>]*> lbu \$at,[01]\(\$at\)
+0+01ac <[^>]*> sll \$a0,\$a0,0x8
+0+01b0 <[^>]*> or \$a0,\$a0,\$at
+0+01b4 <[^>]*> addiu \$at,\$gp,[-0-9]+
+[ ]*RELOC: 0+01b4 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+01b8 <[^>]*> lb \$a0,[01]\(\$at\)
+0+01bc <[^>]*> lbu \$at,[01]\(\$at\)
+0+01c0 <[^>]*> sll \$a0,\$a0,0x8
+0+01c4 <[^>]*> or \$a0,\$a0,\$at
+0+01c8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+01c8 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+01cc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01cc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+01d0 <[^>]*> lb \$a0,[01]\(\$at\)
+0+01d4 <[^>]*> lbu \$at,[01]\(\$at\)
+0+01d8 <[^>]*> sll \$a0,\$a0,0x8
+0+01dc <[^>]*> or \$a0,\$a0,\$at
+0+01e0 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+01e0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+01e4 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01e4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+01e8 <[^>]*> lb \$a0,[01]\(\$at\)
+0+01ec <[^>]*> lbu \$at,[01]\(\$at\)
+0+01f0 <[^>]*> sll \$a0,\$a0,0x8
+0+01f4 <[^>]*> or \$a0,\$a0,\$at
+0+01f8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+01f8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+01fc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01fc [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0200 <[^>]*> lb \$a0,[01]\(\$at\)
+0+0204 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0208 <[^>]*> sll \$a0,\$a0,0x8
+0+020c <[^>]*> or \$a0,\$a0,\$at
+0+0210 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0210 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0214 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0214 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0218 <[^>]*> lb \$a0,[01]\(\$at\)
+0+021c <[^>]*> lbu \$at,[01]\(\$at\)
+0+0220 <[^>]*> sll \$a0,\$a0,0x8
+0+0224 <[^>]*> or \$a0,\$a0,\$at
+0+0228 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0228 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+022c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+022c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0230 <[^>]*> lb \$a0,[01]\(\$at\)
+0+0234 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0238 <[^>]*> sll \$a0,\$a0,0x8
+0+023c <[^>]*> or \$a0,\$a0,\$at
+0+0240 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0240 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0244 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0244 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0248 <[^>]*> lb \$a0,[01]\(\$at\)
+0+024c <[^>]*> lbu \$at,[01]\(\$at\)
+0+0250 <[^>]*> sll \$a0,\$a0,0x8
+0+0254 <[^>]*> or \$a0,\$a0,\$at
+0+0258 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0258 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+025c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+025c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0260 <[^>]*> lb \$a0,[01]\(\$at\)
+0+0264 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0268 <[^>]*> sll \$a0,\$a0,0x8
+0+026c <[^>]*> or \$a0,\$a0,\$at
+0+0270 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0270 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0274 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0274 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0278 <[^>]*> lb \$a0,[01]\(\$at\)
+0+027c <[^>]*> lbu \$at,[01]\(\$at\)
+0+0280 <[^>]*> sll \$a0,\$a0,0x8
+0+0284 <[^>]*> or \$a0,\$a0,\$at
+0+0288 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0288 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+028c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+028c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0290 <[^>]*> lb \$a0,[01]\(\$at\)
+0+0294 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0298 <[^>]*> sll \$a0,\$a0,0x8
+0+029c <[^>]*> or \$a0,\$a0,\$at
+0+02a0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02a0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+02a4 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02a4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+02a8 <[^>]*> lb \$a0,[01]\(\$at\)
+0+02ac <[^>]*> lbu \$at,[01]\(\$at\)
+0+02b0 <[^>]*> sll \$a0,\$a0,0x8
+0+02b4 <[^>]*> or \$a0,\$a0,\$at
+0+02b8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02b8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+02bc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02bc [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+02c0 <[^>]*> lb \$a0,[01]\(\$at\)
+0+02c4 <[^>]*> lbu \$at,[01]\(\$at\)
+0+02c8 <[^>]*> sll \$a0,\$a0,0x8
+0+02cc <[^>]*> or \$a0,\$a0,\$at
+0+02d0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02d0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+02d4 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02d4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+02d8 <[^>]*> lb \$a0,[01]\(\$at\)
+0+02dc <[^>]*> lbu \$at,[01]\(\$at\)
+0+02e0 <[^>]*> sll \$a0,\$a0,0x8
+0+02e4 <[^>]*> or \$a0,\$a0,\$at
+0+02e8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+02e8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+02ec <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02ec [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+02f0 <[^>]*> lb \$a0,[01]\(\$at\)
+0+02f4 <[^>]*> lbu \$at,[01]\(\$at\)
+0+02f8 <[^>]*> sll \$a0,\$a0,0x8
+0+02fc <[^>]*> or \$a0,\$a0,\$at
+0+0300 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0300 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0304 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0304 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0308 <[^>]*> lb \$a0,[01]\(\$at\)
+0+030c <[^>]*> lbu \$at,[01]\(\$at\)
+0+0310 <[^>]*> sll \$a0,\$a0,0x8
+0+0314 <[^>]*> or \$a0,\$a0,\$at
+0+0318 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0318 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+031c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+031c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0320 <[^>]*> lb \$a0,[01]\(\$at\)
+0+0324 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0328 <[^>]*> sll \$a0,\$a0,0x8
+0+032c <[^>]*> or \$a0,\$a0,\$at
+0+0330 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0330 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0334 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0334 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0338 <[^>]*> lb \$a0,[01]\(\$at\)
+0+033c <[^>]*> lbu \$at,[01]\(\$at\)
+0+0340 <[^>]*> sll \$a0,\$a0,0x8
+0+0344 <[^>]*> or \$a0,\$a0,\$at
+0+0348 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0348 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+034c <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+034c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0350 <[^>]*> lb \$a0,[01]\(\$at\)
+0+0354 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0358 <[^>]*> sll \$a0,\$a0,0x8
+0+035c <[^>]*> or \$a0,\$a0,\$at
+0+0360 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0360 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0364 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0364 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0368 <[^>]*> lb \$a0,[01]\(\$at\)
+0+036c <[^>]*> lbu \$at,[01]\(\$at\)
+0+0370 <[^>]*> sll \$a0,\$a0,0x8
+0+0374 <[^>]*> or \$a0,\$a0,\$at
+0+0378 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0378 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+037c <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+037c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0380 <[^>]*> lb \$a0,[01]\(\$at\)
+0+0384 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0388 <[^>]*> sll \$a0,\$a0,0x8
+0+038c <[^>]*> or \$a0,\$a0,\$at
+0+0390 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0390 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0394 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0394 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0398 <[^>]*> lb \$a0,[01]\(\$at\)
+0+039c <[^>]*> lbu \$at,[01]\(\$at\)
+0+03a0 <[^>]*> sll \$a0,\$a0,0x8
+0+03a4 <[^>]*> or \$a0,\$a0,\$at
+0+03a8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+03a8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+03ac <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+03ac [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+03b0 <[^>]*> lb \$a0,[01]\(\$at\)
+0+03b4 <[^>]*> lbu \$at,[01]\(\$at\)
+0+03b8 <[^>]*> sll \$a0,\$a0,0x8
+0+03bc <[^>]*> or \$a0,\$a0,\$at
+0+03c0 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+03c0 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+03c4 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+03c4 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+03c8 <[^>]*> lb \$a0,[01]\(\$at\)
+0+03cc <[^>]*> lbu \$at,[01]\(\$at\)
+0+03d0 <[^>]*> sll \$a0,\$a0,0x8
+0+03d4 <[^>]*> or \$a0,\$a0,\$at
+0+03d8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+03d8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+03dc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+03dc [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+03e0 <[^>]*> lb \$a0,[01]\(\$at\)
+0+03e4 <[^>]*> lbu \$at,[01]\(\$at\)
+0+03e8 <[^>]*> sll \$a0,\$a0,0x8
+0+03ec <[^>]*> or \$a0,\$a0,\$at
+0+03f0 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+03f0 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+03f4 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+03f4 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+03f8 <[^>]*> lb \$a0,[01]\(\$at\)
+0+03fc <[^>]*> lbu \$at,[01]\(\$at\)
+0+0400 <[^>]*> sll \$a0,\$a0,0x8
+0+0404 <[^>]*> or \$a0,\$a0,\$at
+0+0408 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0408 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+040c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+040c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0410 <[^>]*> lb \$a0,[01]\(\$at\)
+0+0414 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0418 <[^>]*> sll \$a0,\$a0,0x8
+0+041c <[^>]*> or \$a0,\$a0,\$at
+0+0420 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0420 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0424 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0424 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0428 <[^>]*> lb \$a0,[01]\(\$at\)
+0+042c <[^>]*> lbu \$at,[01]\(\$at\)
+0+0430 <[^>]*> sll \$a0,\$a0,0x8
+0+0434 <[^>]*> or \$a0,\$a0,\$at
+0+0438 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0438 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+043c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+043c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0440 <[^>]*> lb \$a0,[01]\(\$at\)
+0+0444 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0448 <[^>]*> sll \$a0,\$a0,0x8
+0+044c <[^>]*> or \$a0,\$a0,\$at
+0+0450 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0450 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0454 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0454 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0458 <[^>]*> lb \$a0,[01]\(\$at\)
+0+045c <[^>]*> lbu \$at,[01]\(\$at\)
+0+0460 <[^>]*> sll \$a0,\$a0,0x8
+0+0464 <[^>]*> or \$a0,\$a0,\$at
+0+0468 <[^>]*> lbu \$a0,[01]\(\$zero\)
+0+046c <[^>]*> lbu \$at,[01]\(\$zero\)
+0+0470 <[^>]*> sll \$a0,\$a0,0x8
+0+0474 <[^>]*> or \$a0,\$a0,\$at
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulw.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulw.d
index 7cf20570860..29d2318bcc1 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulw.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ulw.d
@@ -11,29 +11,29 @@ Disassembly of section .text:
0+0004 <[^>]*> lwr \$a0,[03]\(\$zero\)
0+0008 <[^>]*> lwl \$a0,[14]\(\$zero\)
0+000c <[^>]*> lwr \$a0,[14]\(\$zero\)
-0+0010 <[^>]*> li \$at,32768
+0+0010 <[^>]*> li \$at,0x8000
0+0014 <[^>]*> lwl \$a0,[03]\(\$at\)
0+0018 <[^>]*> lwr \$a0,[03]\(\$at\)
0+001c <[^>]*> lwl \$a0,-3276[58]\(\$zero\)
0+0020 <[^>]*> lwr \$a0,-3276[58]\(\$zero\)
-0+0024 <[^>]*> lui \$at,1
+0+0024 <[^>]*> lui \$at,0x1
0+0028 <[^>]*> lwl \$a0,[03]\(\$at\)
0+002c <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0030 <[^>]*> lui \$at,1
-0+0034 <[^>]*> ori \$at,\$at,42405
+0+0030 <[^>]*> lui \$at,0x1
+0+0034 <[^>]*> ori \$at,\$at,0xa5a5
0+0038 <[^>]*> lwl \$a0,[03]\(\$at\)
0+003c <[^>]*> lwr \$a0,[03]\(\$at\)
0+0040 <[^>]*> lwl \$a0,[03]\(\$a1\)
0+0044 <[^>]*> lwr \$a0,[03]\(\$a1\)
0+0048 <[^>]*> lwl \$a0,[14]\(\$a1\)
0+004c <[^>]*> lwr \$a0,[-0-9]+\(\$a1\)
-0+0050 <[^>]*> lui \$at,[-0-9]+
+0+0050 <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+0050 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0054 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0054 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+0058 <[^>]*> lwl \$a0,[03]\(\$at\)
0+005c <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0060 <[^>]*> lui \$at,0
+0+0060 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+0060 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0064 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0064 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
@@ -43,7 +43,7 @@ Disassembly of section .text:
[ ]*RELOC: 0+0070 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
0+0074 <[^>]*> lwl \$a0,[03]\(\$at\)
0+0078 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+007c <[^>]*> lui \$at,0
+0+007c <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+007c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0080 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0080 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
@@ -53,7 +53,7 @@ Disassembly of section .text:
[ ]*RELOC: 0+008c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
0+0090 <[^>]*> lwl \$a0,[03]\(\$at\)
0+0094 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0098 <[^>]*> lui \$at,[-0-9]+
+0+0098 <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+0098 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+009c <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+009c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
@@ -63,214 +63,208 @@ Disassembly of section .text:
[ ]*RELOC: 0+00a8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
0+00ac <[^>]*> lwl \$a0,[03]\(\$at\)
0+00b0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+00b4 <[^>]*> lui \$at,0
+0+00b4 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00b4 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+00b8 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+00b8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+00bc <[^>]*> lwl \$a0,[03]\(\$at\)
0+00c0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+00c4 <[^>]*> lui \$at,0
+0+00c4 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00c4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+00c8 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+00c8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+00cc <[^>]*> lwl \$a0,[03]\(\$at\)
0+00d0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+00d4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00d4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+00d8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+00d8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+00dc <[^>]*> lwl \$a0,[03]\(\$at\)
-0+00e0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+00e4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00e4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+00e8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+00e8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+00ec <[^>]*> lwl \$a0,[03]\(\$at\)
-0+00f0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+00f4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00f4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+00f8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+00f8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+00fc <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0100 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0104 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0104 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0108 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0108 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+010c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0110 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0114 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0114 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0118 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0118 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+011c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0120 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0124 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0124 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0128 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0128 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+012c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0130 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0134 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0134 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0138 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0138 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+013c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0140 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0144 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0144 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0148 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0148 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+014c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0150 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0154 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0154 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0158 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0158 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+015c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0160 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0164 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0164 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0168 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0168 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+016c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0170 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0174 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0174 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0178 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0178 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+017c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0180 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0184 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0184 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0188 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0188 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+018c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0190 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0194 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0194 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0198 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0198 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+019c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+01a0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+01a4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01a4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+01a8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01a8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+01ac <[^>]*> lwl \$a0,[03]\(\$at\)
-0+01b0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+01b4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01b4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+01b8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01b8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+01bc <[^>]*> lwl \$a0,[03]\(\$at\)
-0+01c0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+01c4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01c4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+01c8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01c8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+01cc <[^>]*> lwl \$a0,[03]\(\$at\)
-0+01d0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+01d4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01d4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+01d8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01d8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+01dc <[^>]*> lwl \$a0,[03]\(\$at\)
-0+01e0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+01e4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01e4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+01e8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01e8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+01ec <[^>]*> lwl \$a0,[03]\(\$at\)
-0+01f0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+01f4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01f4 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+01f8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01f8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+01fc <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0200 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0204 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0204 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0208 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0208 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+020c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0210 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0214 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0214 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0218 <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+0218 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+021c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0220 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0224 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0224 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0228 <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+0228 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+022c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0230 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0234 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0234 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0238 <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+0238 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+023c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0240 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0244 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0244 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0248 <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+0248 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+024c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0250 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0254 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0254 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0258 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0258 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+025c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0260 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0264 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0264 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0268 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0268 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+026c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0270 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0274 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0274 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0278 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0278 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+027c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0280 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0284 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0284 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0288 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0288 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+028c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+0290 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+0294 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0294 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0298 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0298 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+029c <[^>]*> lwl \$a0,[03]\(\$at\)
-0+02a0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+02a4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02a4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+02a8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02a8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+02ac <[^>]*> lwl \$a0,[03]\(\$at\)
-0+02b0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+02b4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02b4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+02b8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02b8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+02bc <[^>]*> lwl \$a0,[03]\(\$at\)
-0+02c0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+02c4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02c4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+02c8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02c8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+02cc <[^>]*> lwl \$a0,[03]\(\$at\)
-0+02d0 <[^>]*> lwr \$a0,[03]\(\$at\)
-0+02d4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02d4 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+02d8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02d8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+02dc <[^>]*> lwl \$a0,[03]\(\$at\)
-0+02e0 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+00d4 <[^>]*> addiu \$at,\$gp,1
+[ ]*RELOC: 0+00d4 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+00d8 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+00dc <[^>]*> lwr \$a0,[03]\(\$at\)
+0+00e0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00e0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+00e4 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+00e4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+00e8 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+00ec <[^>]*> lwr \$a0,[03]\(\$at\)
+0+00f0 <[^>]*> addiu \$at,\$gp,1
+[ ]*RELOC: 0+00f0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00f4 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+00f8 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+00fc <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00fc [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0100 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0100 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0104 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0108 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+010c <[^>]*> addiu \$at,\$gp,[-0-9]+
+[ ]*RELOC: 0+010c [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+0110 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0114 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0118 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0118 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+011c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+011c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0120 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0124 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0128 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0128 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+012c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+012c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0130 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0134 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0138 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0138 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+013c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+013c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0140 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0144 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0148 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0148 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+014c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+014c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0150 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0154 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0158 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0158 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+015c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+015c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0160 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0164 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0168 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0168 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+016c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+016c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0170 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0174 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0178 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0178 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+017c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+017c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0180 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0184 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0188 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0188 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+018c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+018c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0190 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0194 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0198 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0198 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+019c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+019c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+01a0 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+01a4 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+01a8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01a8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+01ac <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01ac [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+01b0 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+01b4 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+01b8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01b8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+01bc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01bc [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+01c0 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+01c4 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+01c8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01c8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+01cc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01cc [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+01d0 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+01d4 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+01d8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01d8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+01dc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01dc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+01e0 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+01e4 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+01e8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01e8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+01ec <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01ec [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+01f0 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+01f4 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+01f8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+01f8 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+01fc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01fc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0200 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0204 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0208 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0208 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+020c <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+020c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0210 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0214 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0218 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0218 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+021c <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+021c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0220 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0224 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0228 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0228 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+022c <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+022c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0230 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0234 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0238 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0238 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+023c <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+023c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0240 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0244 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0248 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0248 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+024c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+024c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0250 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0254 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0258 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0258 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+025c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+025c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0260 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0264 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0268 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0268 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+026c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+026c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0270 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0274 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0278 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0278 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+027c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+027c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0280 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0284 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0288 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0288 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+028c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+028c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0290 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+0294 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+0298 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0298 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+029c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+029c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+02a0 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+02a4 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+02a8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02a8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+02ac <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02ac [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+02b0 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+02b4 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+02b8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02b8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+02bc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02bc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+02c0 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+02c4 <[^>]*> lwr \$a0,[03]\(\$at\)
+0+02c8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02c8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+02cc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02cc [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+02d0 <[^>]*> lwl \$a0,[03]\(\$at\)
+0+02d4 <[^>]*> lwr \$a0,[03]\(\$at\)
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/usd.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/usd.d
index 908febc3e2c..479967e2935 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/usd.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/usd.d
@@ -11,29 +11,29 @@ Disassembly of section .text:
0+0004 <[^>]*> sdr \$a0,[07]\(\$zero\)
0+0008 <[^>]*> sdl \$a0,[18]\(\$zero\)
0+000c <[^>]*> sdr \$a0,[18]\(\$zero\)
-0+0010 <[^>]*> li \$at,32768
+0+0010 <[^>]*> li \$at,0x8000
0+0014 <[^>]*> sdl \$a0,[07]\(\$at\)
0+0018 <[^>]*> sdr \$a0,[07]\(\$at\)
0+001c <[^>]*> sdl \$a0,-3276[18]\(\$zero\)
0+0020 <[^>]*> sdr \$a0,-3276[18]\(\$zero\)
-0+0024 <[^>]*> lui \$at,1
+0+0024 <[^>]*> lui \$at,0x1
0+0028 <[^>]*> sdl \$a0,[07]\(\$at\)
0+002c <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0030 <[^>]*> lui \$at,1
-0+0034 <[^>]*> ori \$at,\$at,42405
+0+0030 <[^>]*> lui \$at,0x1
+0+0034 <[^>]*> ori \$at,\$at,0xa5a5
0+0038 <[^>]*> sdl \$a0,[07]\(\$at\)
0+003c <[^>]*> sdr \$a0,[07]\(\$at\)
0+0040 <[^>]*> sdl \$a0,[07]\(\$a1\)
0+0044 <[^>]*> sdr \$a0,[07]\(\$a1\)
0+0048 <[^>]*> sdl \$a0,[18]\(\$a1\)
0+004c <[^>]*> sdr \$a0,[-0-9]+\(\$a1\)
-0+0050 <[^>]*> lui \$at,[-0-9]+
+0+0050 <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+0050 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0054 <[^>]*> daddiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0054 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+0058 <[^>]*> sdl \$a0,[07]\(\$at\)
0+005c <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0060 <[^>]*> lui \$at,[-0-9]+
+0+0060 <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+0060 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0064 <[^>]*> daddiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0064 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
@@ -43,7 +43,7 @@ Disassembly of section .text:
[ ]*RELOC: 0+0070 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
0+0074 <[^>]*> sdl \$a0,[07]\(\$at\)
0+0078 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+007c <[^>]*> lui \$at,0
+0+007c <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+007c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0080 <[^>]*> daddiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0080 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
@@ -53,7 +53,7 @@ Disassembly of section .text:
[ ]*RELOC: 0+008c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
0+0090 <[^>]*> sdl \$a0,[07]\(\$at\)
0+0094 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0098 <[^>]*> lui \$at,[-0-9]+
+0+0098 <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+0098 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+009c <[^>]*> daddiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+009c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
@@ -63,214 +63,208 @@ Disassembly of section .text:
[ ]*RELOC: 0+00a8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
0+00ac <[^>]*> sdl \$a0,[07]\(\$at\)
0+00b0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+00b4 <[^>]*> lui \$at,0
+0+00b4 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00b4 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+00b8 <[^>]*> daddiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+00b8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+00bc <[^>]*> sdl \$a0,[07]\(\$at\)
0+00c0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+00c4 <[^>]*> lui \$at,0
+0+00c4 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00c4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+00c8 <[^>]*> daddiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+00c8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+00cc <[^>]*> sdl \$a0,[07]\(\$at\)
0+00d0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+00d4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00d4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+00d8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+00d8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+00dc <[^>]*> sdl \$a0,[07]\(\$at\)
-0+00e0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+00e4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00e4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+00e8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+00e8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+00ec <[^>]*> sdl \$a0,[07]\(\$at\)
-0+00f0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+00f4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00f4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+00f8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+00f8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+00fc <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0100 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0104 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0104 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0108 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0108 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+010c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0110 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0114 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0114 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0118 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0118 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+011c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0120 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0124 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0124 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0128 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0128 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+012c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0130 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0134 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0134 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0138 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0138 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+013c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0140 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0144 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0144 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0148 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0148 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+014c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0150 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0154 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0154 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0158 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0158 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+015c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0160 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0164 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0164 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0168 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0168 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+016c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0170 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0174 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0174 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0178 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0178 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+017c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0180 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0184 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0184 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0188 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0188 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+018c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0190 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0194 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0194 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0198 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0198 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+019c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+01a0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+01a4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01a4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+01a8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01a8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+01ac <[^>]*> sdl \$a0,[07]\(\$at\)
-0+01b0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+01b4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01b4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+01b8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01b8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+01bc <[^>]*> sdl \$a0,[07]\(\$at\)
-0+01c0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+01c4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01c4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+01c8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01c8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+01cc <[^>]*> sdl \$a0,[07]\(\$at\)
-0+01d0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+01d4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01d4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+01d8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01d8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+01dc <[^>]*> sdl \$a0,[07]\(\$at\)
-0+01e0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+01e4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01e4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+01e8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01e8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+01ec <[^>]*> sdl \$a0,[07]\(\$at\)
-0+01f0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+01f4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01f4 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+01f8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01f8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+01fc <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0200 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0204 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0204 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0208 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0208 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+020c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0210 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0214 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0214 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0218 <[^>]*> daddiu \$at,\$at,0
-[ ]*RELOC: 0+0218 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+021c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0220 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0224 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0224 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0228 <[^>]*> daddiu \$at,\$at,0
-[ ]*RELOC: 0+0228 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+022c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0230 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0234 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0234 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0238 <[^>]*> daddiu \$at,\$at,0
-[ ]*RELOC: 0+0238 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+023c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0240 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0244 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0244 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0248 <[^>]*> daddiu \$at,\$at,0
-[ ]*RELOC: 0+0248 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+024c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0250 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0254 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0254 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0258 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0258 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+025c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0260 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0264 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0264 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0268 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0268 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+026c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0270 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0274 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0274 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0278 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0278 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+027c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0280 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0284 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0284 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0288 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0288 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+028c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+0290 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+0294 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0294 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0298 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0298 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+029c <[^>]*> sdl \$a0,[07]\(\$at\)
-0+02a0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+02a4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02a4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+02a8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02a8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+02ac <[^>]*> sdl \$a0,[07]\(\$at\)
-0+02b0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+02b4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02b4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+02b8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02b8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+02bc <[^>]*> sdl \$a0,[07]\(\$at\)
-0+02c0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+02c4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02c4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+02c8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02c8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+02cc <[^>]*> sdl \$a0,[07]\(\$at\)
-0+02d0 <[^>]*> sdr \$a0,[07]\(\$at\)
-0+02d4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02d4 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+02d8 <[^>]*> daddiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02d8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+02dc <[^>]*> sdl \$a0,[07]\(\$at\)
-0+02e0 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+00d4 <[^>]*> daddiu \$at,\$gp,1
+[ ]*RELOC: 0+00d4 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+00d8 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+00dc <[^>]*> sdr \$a0,[07]\(\$at\)
+0+00e0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00e0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+00e4 <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+00e4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+00e8 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+00ec <[^>]*> sdr \$a0,[07]\(\$at\)
+0+00f0 <[^>]*> daddiu \$at,\$gp,1
+[ ]*RELOC: 0+00f0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00f4 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+00f8 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+00fc <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00fc [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0100 <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0100 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0104 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0108 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+010c <[^>]*> daddiu \$at,\$gp,[-0-9]+
+[ ]*RELOC: 0+010c [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+0110 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0114 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0118 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0118 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+011c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+011c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0120 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0124 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0128 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0128 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+012c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+012c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0130 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0134 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0138 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0138 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+013c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+013c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0140 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0144 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0148 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0148 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+014c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+014c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0150 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0154 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0158 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0158 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+015c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+015c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0160 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0164 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0168 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0168 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+016c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+016c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0170 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0174 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0178 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0178 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+017c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+017c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0180 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0184 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0188 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0188 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+018c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+018c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0190 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0194 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0198 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0198 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+019c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+019c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+01a0 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+01a4 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+01a8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01a8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+01ac <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01ac [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+01b0 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+01b4 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+01b8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01b8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+01bc <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01bc [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+01c0 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+01c4 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+01c8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01c8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+01cc <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01cc [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+01d0 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+01d4 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+01d8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01d8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+01dc <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01dc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+01e0 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+01e4 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+01e8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01e8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+01ec <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01ec [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+01f0 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+01f4 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+01f8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+01f8 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+01fc <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01fc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0200 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0204 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0208 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0208 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+020c <[^>]*> daddiu \$at,\$at,0
+[ ]*RELOC: 0+020c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0210 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0214 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0218 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0218 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+021c <[^>]*> daddiu \$at,\$at,0
+[ ]*RELOC: 0+021c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0220 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0224 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0228 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0228 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+022c <[^>]*> daddiu \$at,\$at,0
+[ ]*RELOC: 0+022c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0230 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0234 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0238 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0238 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+023c <[^>]*> daddiu \$at,\$at,0
+[ ]*RELOC: 0+023c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0240 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0244 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0248 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0248 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+024c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+024c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0250 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0254 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0258 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0258 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+025c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+025c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0260 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0264 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0268 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0268 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+026c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+026c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0270 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0274 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0278 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0278 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+027c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+027c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0280 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0284 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0288 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0288 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+028c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+028c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0290 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+0294 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+0298 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0298 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+029c <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+029c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+02a0 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+02a4 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+02a8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02a8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+02ac <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02ac [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+02b0 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+02b4 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+02b8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02b8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+02bc <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02bc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+02c0 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+02c4 <[^>]*> sdr \$a0,[07]\(\$at\)
+0+02c8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02c8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+02cc <[^>]*> daddiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02cc [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+02d0 <[^>]*> sdl \$a0,[07]\(\$at\)
+0+02d4 <[^>]*> sdr \$a0,[07]\(\$at\)
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ush.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ush.d
index a073618dc1c..eb209b7dafd 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ush.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/ush.d
@@ -13,7 +13,7 @@ Disassembly of section .text:
0+000c <[^>]*> sb \$a0,[12]\(\$zero\)
0+0010 <[^>]*> srl \$at,\$a0,0x8
0+0014 <[^>]*> sb \$at,[12]\(\$zero\)
-0+0018 <[^>]*> li \$at,32768
+0+0018 <[^>]*> li \$at,0x8000
0+001c <[^>]*> sb \$a0,[01]\(\$at\)
0+0020 <[^>]*> srl \$a0,\$a0,0x8
0+0024 <[^>]*> sb \$a0,[01]\(\$at\)
@@ -23,15 +23,15 @@ Disassembly of section .text:
0+0034 <[^>]*> sb \$a0,-3276[78]\(\$zero\)
0+0038 <[^>]*> srl \$at,\$a0,0x8
0+003c <[^>]*> sb \$at,-3276[78]\(\$zero\)
-0+0040 <[^>]*> lui \$at,1
+0+0040 <[^>]*> lui \$at,0x1
0+0044 <[^>]*> sb \$a0,[01]\(\$at\)
0+0048 <[^>]*> srl \$a0,\$a0,0x8
0+004c <[^>]*> sb \$a0,[01]\(\$at\)
0+0050 <[^>]*> lbu \$at,[01]\(\$at\)
0+0054 <[^>]*> sll \$a0,\$a0,0x8
0+0058 <[^>]*> or \$a0,\$a0,\$at
-0+005c <[^>]*> lui \$at,1
-0+0060 <[^>]*> ori \$at,\$at,42405
+0+005c <[^>]*> lui \$at,0x1
+0+0060 <[^>]*> ori \$at,\$at,0xa5a5
0+0064 <[^>]*> sb \$a0,[01]\(\$at\)
0+0068 <[^>]*> srl \$a0,\$a0,0x8
0+006c <[^>]*> sb \$a0,[01]\(\$at\)
@@ -44,7 +44,7 @@ Disassembly of section .text:
0+0088 <[^>]*> sb \$a0,[12]\(\$a1\)
0+008c <[^>]*> srl \$at,\$a0,0x8
0+0090 <[^>]*> sb \$at,[12]\(\$a1\)
-0+0094 <[^>]*> lui \$at,[-0-9]+
+0+0094 <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+0094 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0098 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0098 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
@@ -54,7 +54,7 @@ Disassembly of section .text:
0+00a8 <[^>]*> lbu \$at,[01]\(\$at\)
0+00ac <[^>]*> sll \$a0,\$a0,0x8
0+00b0 <[^>]*> or \$a0,\$a0,\$at
-0+00b4 <[^>]*> lui \$at,0
+0+00b4 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00b4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+00b8 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+00b8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
@@ -72,7 +72,7 @@ Disassembly of section .text:
0+00e4 <[^>]*> lbu \$at,[01]\(\$at\)
0+00e8 <[^>]*> sll \$a0,\$a0,0x8
0+00ec <[^>]*> or \$a0,\$a0,\$at
-0+00f0 <[^>]*> lui \$at,[-0-9]+
+0+00f0 <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+00f0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+00f4 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+00f4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
@@ -90,7 +90,7 @@ Disassembly of section .text:
0+0120 <[^>]*> lbu \$at,[01]\(\$at\)
0+0124 <[^>]*> sll \$a0,\$a0,0x8
0+0128 <[^>]*> or \$a0,\$a0,\$at
-0+012c <[^>]*> lui \$at,[-0-9]+
+0+012c <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+012c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+0130 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0130 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
@@ -108,7 +108,7 @@ Disassembly of section .text:
0+015c <[^>]*> lbu \$at,[01]\(\$at\)
0+0160 <[^>]*> sll \$a0,\$a0,0x8
0+0164 <[^>]*> or \$a0,\$a0,\$at
-0+0168 <[^>]*> lui \$at,0
+0+0168 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+0168 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+016c <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+016c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
@@ -118,7 +118,7 @@ Disassembly of section .text:
0+017c <[^>]*> lbu \$at,[01]\(\$at\)
0+0180 <[^>]*> sll \$a0,\$a0,0x8
0+0184 <[^>]*> or \$a0,\$a0,\$at
-0+0188 <[^>]*> lui \$at,0
+0+0188 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+0188 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+018c <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+018c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
@@ -128,334 +128,328 @@ Disassembly of section .text:
0+019c <[^>]*> lbu \$at,[01]\(\$at\)
0+01a0 <[^>]*> sll \$a0,\$a0,0x8
0+01a4 <[^>]*> or \$a0,\$a0,\$at
-0+01a8 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01a8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+01ac <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01ac [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+01b0 <[^>]*> sb \$a0,[01]\(\$at\)
-0+01b4 <[^>]*> srl \$a0,\$a0,0x8
-0+01b8 <[^>]*> sb \$a0,[01]\(\$at\)
-0+01bc <[^>]*> lbu \$at,[01]\(\$at\)
-0+01c0 <[^>]*> sll \$a0,\$a0,0x8
-0+01c4 <[^>]*> or \$a0,\$a0,\$at
-0+01c8 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01c8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+01cc <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01cc [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+01d0 <[^>]*> sb \$a0,[01]\(\$at\)
-0+01d4 <[^>]*> srl \$a0,\$a0,0x8
-0+01d8 <[^>]*> sb \$a0,[01]\(\$at\)
-0+01dc <[^>]*> lbu \$at,[01]\(\$at\)
-0+01e0 <[^>]*> sll \$a0,\$a0,0x8
-0+01e4 <[^>]*> or \$a0,\$a0,\$at
-0+01e8 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01e8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+01ec <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01ec [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+01a8 <[^>]*> addiu \$at,\$gp,1
+[ ]*RELOC: 0+01a8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+01ac <[^>]*> sb \$a0,[01]\(\$at\)
+0+01b0 <[^>]*> srl \$a0,\$a0,0x8
+0+01b4 <[^>]*> sb \$a0,[01]\(\$at\)
+0+01b8 <[^>]*> lbu \$at,[01]\(\$at\)
+0+01bc <[^>]*> sll \$a0,\$a0,0x8
+0+01c0 <[^>]*> or \$a0,\$a0,\$at
+0+01c4 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01c4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+01c8 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01c8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+01cc <[^>]*> sb \$a0,[01]\(\$at\)
+0+01d0 <[^>]*> srl \$a0,\$a0,0x8
+0+01d4 <[^>]*> sb \$a0,[01]\(\$at\)
+0+01d8 <[^>]*> lbu \$at,[01]\(\$at\)
+0+01dc <[^>]*> sll \$a0,\$a0,0x8
+0+01e0 <[^>]*> or \$a0,\$a0,\$at
+0+01e4 <[^>]*> addiu \$at,\$gp,1
+[ ]*RELOC: 0+01e4 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+01e8 <[^>]*> sb \$a0,[01]\(\$at\)
+0+01ec <[^>]*> srl \$a0,\$a0,0x8
0+01f0 <[^>]*> sb \$a0,[01]\(\$at\)
-0+01f4 <[^>]*> srl \$a0,\$a0,0x8
-0+01f8 <[^>]*> sb \$a0,[01]\(\$at\)
-0+01fc <[^>]*> lbu \$at,[01]\(\$at\)
-0+0200 <[^>]*> sll \$a0,\$a0,0x8
-0+0204 <[^>]*> or \$a0,\$a0,\$at
-0+0208 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0208 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+020c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+020c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+01f4 <[^>]*> lbu \$at,[01]\(\$at\)
+0+01f8 <[^>]*> sll \$a0,\$a0,0x8
+0+01fc <[^>]*> or \$a0,\$a0,\$at
+0+0200 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0200 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0204 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0204 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0208 <[^>]*> sb \$a0,[01]\(\$at\)
+0+020c <[^>]*> srl \$a0,\$a0,0x8
0+0210 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0214 <[^>]*> srl \$a0,\$a0,0x8
-0+0218 <[^>]*> sb \$a0,[01]\(\$at\)
-0+021c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0220 <[^>]*> sll \$a0,\$a0,0x8
-0+0224 <[^>]*> or \$a0,\$a0,\$at
-0+0228 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0228 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+022c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+022c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0230 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0234 <[^>]*> srl \$a0,\$a0,0x8
-0+0238 <[^>]*> sb \$a0,[01]\(\$at\)
-0+023c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0240 <[^>]*> sll \$a0,\$a0,0x8
-0+0244 <[^>]*> or \$a0,\$a0,\$at
-0+0248 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0248 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+024c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+024c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0250 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0254 <[^>]*> srl \$a0,\$a0,0x8
-0+0258 <[^>]*> sb \$a0,[01]\(\$at\)
-0+025c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0260 <[^>]*> sll \$a0,\$a0,0x8
-0+0264 <[^>]*> or \$a0,\$a0,\$at
-0+0268 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0268 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+026c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+026c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0270 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0274 <[^>]*> srl \$a0,\$a0,0x8
-0+0278 <[^>]*> sb \$a0,[01]\(\$at\)
-0+027c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0280 <[^>]*> sll \$a0,\$a0,0x8
-0+0284 <[^>]*> or \$a0,\$a0,\$at
-0+0288 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0288 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+028c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+028c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0290 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0294 <[^>]*> srl \$a0,\$a0,0x8
-0+0298 <[^>]*> sb \$a0,[01]\(\$at\)
-0+029c <[^>]*> lbu \$at,[01]\(\$at\)
-0+02a0 <[^>]*> sll \$a0,\$a0,0x8
-0+02a4 <[^>]*> or \$a0,\$a0,\$at
-0+02a8 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02a8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+02ac <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02ac [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+02b0 <[^>]*> sb \$a0,[01]\(\$at\)
-0+02b4 <[^>]*> srl \$a0,\$a0,0x8
-0+02b8 <[^>]*> sb \$a0,[01]\(\$at\)
-0+02bc <[^>]*> lbu \$at,[01]\(\$at\)
-0+02c0 <[^>]*> sll \$a0,\$a0,0x8
-0+02c4 <[^>]*> or \$a0,\$a0,\$at
-0+02c8 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02c8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+02cc <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02cc [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+02d0 <[^>]*> sb \$a0,[01]\(\$at\)
-0+02d4 <[^>]*> srl \$a0,\$a0,0x8
-0+02d8 <[^>]*> sb \$a0,[01]\(\$at\)
-0+02dc <[^>]*> lbu \$at,[01]\(\$at\)
-0+02e0 <[^>]*> sll \$a0,\$a0,0x8
-0+02e4 <[^>]*> or \$a0,\$a0,\$at
-0+02e8 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02e8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+02ec <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02ec [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+02f0 <[^>]*> sb \$a0,[01]\(\$at\)
-0+02f4 <[^>]*> srl \$a0,\$a0,0x8
-0+02f8 <[^>]*> sb \$a0,[01]\(\$at\)
-0+02fc <[^>]*> lbu \$at,[01]\(\$at\)
-0+0300 <[^>]*> sll \$a0,\$a0,0x8
-0+0304 <[^>]*> or \$a0,\$a0,\$at
-0+0308 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0308 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+030c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+030c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+0310 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0314 <[^>]*> srl \$a0,\$a0,0x8
-0+0318 <[^>]*> sb \$a0,[01]\(\$at\)
-0+031c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0320 <[^>]*> sll \$a0,\$a0,0x8
-0+0324 <[^>]*> or \$a0,\$a0,\$at
-0+0328 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0328 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+032c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+032c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0330 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0334 <[^>]*> srl \$a0,\$a0,0x8
-0+0338 <[^>]*> sb \$a0,[01]\(\$at\)
-0+033c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0340 <[^>]*> sll \$a0,\$a0,0x8
-0+0344 <[^>]*> or \$a0,\$a0,\$at
-0+0348 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0348 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+034c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+034c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0350 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0354 <[^>]*> srl \$a0,\$a0,0x8
-0+0358 <[^>]*> sb \$a0,[01]\(\$at\)
-0+035c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0360 <[^>]*> sll \$a0,\$a0,0x8
-0+0364 <[^>]*> or \$a0,\$a0,\$at
-0+0368 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0368 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+036c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+036c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0370 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0374 <[^>]*> srl \$a0,\$a0,0x8
-0+0378 <[^>]*> sb \$a0,[01]\(\$at\)
-0+037c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0380 <[^>]*> sll \$a0,\$a0,0x8
-0+0384 <[^>]*> or \$a0,\$a0,\$at
-0+0388 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0388 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+038c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+038c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0390 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0394 <[^>]*> srl \$a0,\$a0,0x8
-0+0398 <[^>]*> sb \$a0,[01]\(\$at\)
-0+039c <[^>]*> lbu \$at,[01]\(\$at\)
-0+03a0 <[^>]*> sll \$a0,\$a0,0x8
-0+03a4 <[^>]*> or \$a0,\$a0,\$at
-0+03a8 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+03a8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+03ac <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+03ac [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+03b0 <[^>]*> sb \$a0,[01]\(\$at\)
-0+03b4 <[^>]*> srl \$a0,\$a0,0x8
-0+03b8 <[^>]*> sb \$a0,[01]\(\$at\)
-0+03bc <[^>]*> lbu \$at,[01]\(\$at\)
-0+03c0 <[^>]*> sll \$a0,\$a0,0x8
-0+03c4 <[^>]*> or \$a0,\$a0,\$at
-0+03c8 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+03c8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+03cc <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+03cc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+03d0 <[^>]*> sb \$a0,[01]\(\$at\)
-0+03d4 <[^>]*> srl \$a0,\$a0,0x8
-0+03d8 <[^>]*> sb \$a0,[01]\(\$at\)
-0+03dc <[^>]*> lbu \$at,[01]\(\$at\)
-0+03e0 <[^>]*> sll \$a0,\$a0,0x8
-0+03e4 <[^>]*> or \$a0,\$a0,\$at
-0+03e8 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+03e8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+03ec <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+03ec [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+03f0 <[^>]*> sb \$a0,[01]\(\$at\)
-0+03f4 <[^>]*> srl \$a0,\$a0,0x8
-0+03f8 <[^>]*> sb \$a0,[01]\(\$at\)
-0+03fc <[^>]*> lbu \$at,[01]\(\$at\)
-0+0400 <[^>]*> sll \$a0,\$a0,0x8
-0+0404 <[^>]*> or \$a0,\$a0,\$at
-0+0408 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0408 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+040c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+040c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+0410 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0414 <[^>]*> srl \$a0,\$a0,0x8
-0+0418 <[^>]*> sb \$a0,[01]\(\$at\)
-0+041c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0420 <[^>]*> sll \$a0,\$a0,0x8
-0+0424 <[^>]*> or \$a0,\$a0,\$at
-0+0428 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0428 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+042c <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+042c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0430 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0434 <[^>]*> srl \$a0,\$a0,0x8
-0+0438 <[^>]*> sb \$a0,[01]\(\$at\)
-0+043c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0440 <[^>]*> sll \$a0,\$a0,0x8
-0+0444 <[^>]*> or \$a0,\$a0,\$at
-0+0448 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0448 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+044c <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+044c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0450 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0454 <[^>]*> srl \$a0,\$a0,0x8
-0+0458 <[^>]*> sb \$a0,[01]\(\$at\)
-0+045c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0460 <[^>]*> sll \$a0,\$a0,0x8
-0+0464 <[^>]*> or \$a0,\$a0,\$at
-0+0468 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0468 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+046c <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+046c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0470 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0474 <[^>]*> srl \$a0,\$a0,0x8
-0+0478 <[^>]*> sb \$a0,[01]\(\$at\)
-0+047c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0480 <[^>]*> sll \$a0,\$a0,0x8
-0+0484 <[^>]*> or \$a0,\$a0,\$at
-0+0488 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0488 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+048c <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+048c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0490 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0494 <[^>]*> srl \$a0,\$a0,0x8
-0+0498 <[^>]*> sb \$a0,[01]\(\$at\)
-0+049c <[^>]*> lbu \$at,[01]\(\$at\)
-0+04a0 <[^>]*> sll \$a0,\$a0,0x8
-0+04a4 <[^>]*> or \$a0,\$a0,\$at
-0+04a8 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+04a8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+04ac <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+04ac [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+04b0 <[^>]*> sb \$a0,[01]\(\$at\)
-0+04b4 <[^>]*> srl \$a0,\$a0,0x8
-0+04b8 <[^>]*> sb \$a0,[01]\(\$at\)
-0+04bc <[^>]*> lbu \$at,[01]\(\$at\)
-0+04c0 <[^>]*> sll \$a0,\$a0,0x8
-0+04c4 <[^>]*> or \$a0,\$a0,\$at
-0+04c8 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+04c8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+04cc <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+04cc [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+04d0 <[^>]*> sb \$a0,[01]\(\$at\)
-0+04d4 <[^>]*> srl \$a0,\$a0,0x8
-0+04d8 <[^>]*> sb \$a0,[01]\(\$at\)
-0+04dc <[^>]*> lbu \$at,[01]\(\$at\)
-0+04e0 <[^>]*> sll \$a0,\$a0,0x8
-0+04e4 <[^>]*> or \$a0,\$a0,\$at
-0+04e8 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+04e8 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+04ec <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+04ec [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+04f0 <[^>]*> sb \$a0,[01]\(\$at\)
-0+04f4 <[^>]*> srl \$a0,\$a0,0x8
-0+04f8 <[^>]*> sb \$a0,[01]\(\$at\)
-0+04fc <[^>]*> lbu \$at,[01]\(\$at\)
-0+0500 <[^>]*> sll \$a0,\$a0,0x8
-0+0504 <[^>]*> or \$a0,\$a0,\$at
-0+0508 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0508 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+050c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+050c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+0510 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0514 <[^>]*> srl \$a0,\$a0,0x8
-0+0518 <[^>]*> sb \$a0,[01]\(\$at\)
-0+051c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0520 <[^>]*> sll \$a0,\$a0,0x8
-0+0524 <[^>]*> or \$a0,\$a0,\$at
-0+0528 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0528 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+052c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+052c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+0530 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0534 <[^>]*> srl \$a0,\$a0,0x8
-0+0538 <[^>]*> sb \$a0,[01]\(\$at\)
-0+053c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0540 <[^>]*> sll \$a0,\$a0,0x8
-0+0544 <[^>]*> or \$a0,\$a0,\$at
-0+0548 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0548 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+054c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+054c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+0550 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0554 <[^>]*> srl \$a0,\$a0,0x8
-0+0558 <[^>]*> sb \$a0,[01]\(\$at\)
-0+055c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0560 <[^>]*> sll \$a0,\$a0,0x8
-0+0564 <[^>]*> or \$a0,\$a0,\$at
-0+0568 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0568 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+056c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+056c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+0570 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0574 <[^>]*> srl \$a0,\$a0,0x8
-0+0578 <[^>]*> sb \$a0,[01]\(\$at\)
-0+057c <[^>]*> lbu \$at,[01]\(\$at\)
-0+0580 <[^>]*> sll \$a0,\$a0,0x8
-0+0584 <[^>]*> or \$a0,\$a0,\$at
-0+0588 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0588 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+058c <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+058c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+0590 <[^>]*> sb \$a0,[01]\(\$at\)
-0+0594 <[^>]*> srl \$a0,\$a0,0x8
-0+0598 <[^>]*> sb \$a0,[01]\(\$at\)
-0+059c <[^>]*> lbu \$at,[01]\(\$at\)
-0+05a0 <[^>]*> sll \$a0,\$a0,0x8
-0+05a4 <[^>]*> or \$a0,\$a0,\$at
-0+05a8 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+05a8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+05ac <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+05ac [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+05b0 <[^>]*> sb \$a0,[01]\(\$at\)
-0+05b4 <[^>]*> srl \$a0,\$a0,0x8
-0+05b8 <[^>]*> sb \$a0,[01]\(\$at\)
-0+05bc <[^>]*> lbu \$at,[01]\(\$at\)
-0+05c0 <[^>]*> sll \$a0,\$a0,0x8
-0+05c4 <[^>]*> or \$a0,\$a0,\$at
+0+0214 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0218 <[^>]*> sll \$a0,\$a0,0x8
+0+021c <[^>]*> or \$a0,\$a0,\$at
+0+0220 <[^>]*> addiu \$at,\$gp,[-0-9]+
+[ ]*RELOC: 0+0220 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+0224 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0228 <[^>]*> srl \$a0,\$a0,0x8
+0+022c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0230 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0234 <[^>]*> sll \$a0,\$a0,0x8
+0+0238 <[^>]*> or \$a0,\$a0,\$at
+0+023c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+023c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0240 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0240 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0244 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0248 <[^>]*> srl \$a0,\$a0,0x8
+0+024c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0250 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0254 <[^>]*> sll \$a0,\$a0,0x8
+0+0258 <[^>]*> or \$a0,\$a0,\$at
+0+025c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+025c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0260 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0260 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0264 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0268 <[^>]*> srl \$a0,\$a0,0x8
+0+026c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0270 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0274 <[^>]*> sll \$a0,\$a0,0x8
+0+0278 <[^>]*> or \$a0,\$a0,\$at
+0+027c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+027c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+0280 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0280 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0284 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0288 <[^>]*> srl \$a0,\$a0,0x8
+0+028c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0290 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0294 <[^>]*> sll \$a0,\$a0,0x8
+0+0298 <[^>]*> or \$a0,\$a0,\$at
+0+029c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+029c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+02a0 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02a0 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+02a4 <[^>]*> sb \$a0,[01]\(\$at\)
+0+02a8 <[^>]*> srl \$a0,\$a0,0x8
+0+02ac <[^>]*> sb \$a0,[01]\(\$at\)
+0+02b0 <[^>]*> lbu \$at,[01]\(\$at\)
+0+02b4 <[^>]*> sll \$a0,\$a0,0x8
+0+02b8 <[^>]*> or \$a0,\$a0,\$at
+0+02bc <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02bc [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+02c0 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02c0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+02c4 <[^>]*> sb \$a0,[01]\(\$at\)
+0+02c8 <[^>]*> srl \$a0,\$a0,0x8
+0+02cc <[^>]*> sb \$a0,[01]\(\$at\)
+0+02d0 <[^>]*> lbu \$at,[01]\(\$at\)
+0+02d4 <[^>]*> sll \$a0,\$a0,0x8
+0+02d8 <[^>]*> or \$a0,\$a0,\$at
+0+02dc <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02dc [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+02e0 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02e0 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+02e4 <[^>]*> sb \$a0,[01]\(\$at\)
+0+02e8 <[^>]*> srl \$a0,\$a0,0x8
+0+02ec <[^>]*> sb \$a0,[01]\(\$at\)
+0+02f0 <[^>]*> lbu \$at,[01]\(\$at\)
+0+02f4 <[^>]*> sll \$a0,\$a0,0x8
+0+02f8 <[^>]*> or \$a0,\$a0,\$at
+0+02fc <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02fc [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+0300 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0300 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0304 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0308 <[^>]*> srl \$a0,\$a0,0x8
+0+030c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0310 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0314 <[^>]*> sll \$a0,\$a0,0x8
+0+0318 <[^>]*> or \$a0,\$a0,\$at
+0+031c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+031c [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0320 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0320 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0324 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0328 <[^>]*> srl \$a0,\$a0,0x8
+0+032c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0330 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0334 <[^>]*> sll \$a0,\$a0,0x8
+0+0338 <[^>]*> or \$a0,\$a0,\$at
+0+033c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+033c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0340 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0340 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0344 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0348 <[^>]*> srl \$a0,\$a0,0x8
+0+034c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0350 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0354 <[^>]*> sll \$a0,\$a0,0x8
+0+0358 <[^>]*> or \$a0,\$a0,\$at
+0+035c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+035c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+0360 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0360 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0364 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0368 <[^>]*> srl \$a0,\$a0,0x8
+0+036c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0370 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0374 <[^>]*> sll \$a0,\$a0,0x8
+0+0378 <[^>]*> or \$a0,\$a0,\$at
+0+037c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+037c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0380 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0380 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0384 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0388 <[^>]*> srl \$a0,\$a0,0x8
+0+038c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0390 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0394 <[^>]*> sll \$a0,\$a0,0x8
+0+0398 <[^>]*> or \$a0,\$a0,\$at
+0+039c <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+039c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+03a0 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+03a0 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+03a4 <[^>]*> sb \$a0,[01]\(\$at\)
+0+03a8 <[^>]*> srl \$a0,\$a0,0x8
+0+03ac <[^>]*> sb \$a0,[01]\(\$at\)
+0+03b0 <[^>]*> lbu \$at,[01]\(\$at\)
+0+03b4 <[^>]*> sll \$a0,\$a0,0x8
+0+03b8 <[^>]*> or \$a0,\$a0,\$at
+0+03bc <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+03bc [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+03c0 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+03c0 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+03c4 <[^>]*> sb \$a0,[01]\(\$at\)
+0+03c8 <[^>]*> srl \$a0,\$a0,0x8
+0+03cc <[^>]*> sb \$a0,[01]\(\$at\)
+0+03d0 <[^>]*> lbu \$at,[01]\(\$at\)
+0+03d4 <[^>]*> sll \$a0,\$a0,0x8
+0+03d8 <[^>]*> or \$a0,\$a0,\$at
+0+03dc <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+03dc [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+03e0 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+03e0 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+03e4 <[^>]*> sb \$a0,[01]\(\$at\)
+0+03e8 <[^>]*> srl \$a0,\$a0,0x8
+0+03ec <[^>]*> sb \$a0,[01]\(\$at\)
+0+03f0 <[^>]*> lbu \$at,[01]\(\$at\)
+0+03f4 <[^>]*> sll \$a0,\$a0,0x8
+0+03f8 <[^>]*> or \$a0,\$a0,\$at
+0+03fc <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+03fc [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+0400 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0400 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0404 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0408 <[^>]*> srl \$a0,\$a0,0x8
+0+040c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0410 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0414 <[^>]*> sll \$a0,\$a0,0x8
+0+0418 <[^>]*> or \$a0,\$a0,\$at
+0+041c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+041c [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0420 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0420 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0424 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0428 <[^>]*> srl \$a0,\$a0,0x8
+0+042c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0430 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0434 <[^>]*> sll \$a0,\$a0,0x8
+0+0438 <[^>]*> or \$a0,\$a0,\$at
+0+043c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+043c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+0440 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0440 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0444 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0448 <[^>]*> srl \$a0,\$a0,0x8
+0+044c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0450 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0454 <[^>]*> sll \$a0,\$a0,0x8
+0+0458 <[^>]*> or \$a0,\$a0,\$at
+0+045c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+045c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0460 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0460 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0464 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0468 <[^>]*> srl \$a0,\$a0,0x8
+0+046c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0470 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0474 <[^>]*> sll \$a0,\$a0,0x8
+0+0478 <[^>]*> or \$a0,\$a0,\$at
+0+047c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+047c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0480 <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+0480 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0484 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0488 <[^>]*> srl \$a0,\$a0,0x8
+0+048c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0490 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0494 <[^>]*> sll \$a0,\$a0,0x8
+0+0498 <[^>]*> or \$a0,\$a0,\$at
+0+049c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+049c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+04a0 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+04a0 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+04a4 <[^>]*> sb \$a0,[01]\(\$at\)
+0+04a8 <[^>]*> srl \$a0,\$a0,0x8
+0+04ac <[^>]*> sb \$a0,[01]\(\$at\)
+0+04b0 <[^>]*> lbu \$at,[01]\(\$at\)
+0+04b4 <[^>]*> sll \$a0,\$a0,0x8
+0+04b8 <[^>]*> or \$a0,\$a0,\$at
+0+04bc <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+04bc [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+04c0 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+04c0 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+04c4 <[^>]*> sb \$a0,[01]\(\$at\)
+0+04c8 <[^>]*> srl \$a0,\$a0,0x8
+0+04cc <[^>]*> sb \$a0,[01]\(\$at\)
+0+04d0 <[^>]*> lbu \$at,[01]\(\$at\)
+0+04d4 <[^>]*> sll \$a0,\$a0,0x8
+0+04d8 <[^>]*> or \$a0,\$a0,\$at
+0+04dc <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+04dc [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+04e0 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+04e0 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+04e4 <[^>]*> sb \$a0,[01]\(\$at\)
+0+04e8 <[^>]*> srl \$a0,\$a0,0x8
+0+04ec <[^>]*> sb \$a0,[01]\(\$at\)
+0+04f0 <[^>]*> lbu \$at,[01]\(\$at\)
+0+04f4 <[^>]*> sll \$a0,\$a0,0x8
+0+04f8 <[^>]*> or \$a0,\$a0,\$at
+0+04fc <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+04fc [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+0500 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0500 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0504 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0508 <[^>]*> srl \$a0,\$a0,0x8
+0+050c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0510 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0514 <[^>]*> sll \$a0,\$a0,0x8
+0+0518 <[^>]*> or \$a0,\$a0,\$at
+0+051c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+051c [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+0520 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0520 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0524 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0528 <[^>]*> srl \$a0,\$a0,0x8
+0+052c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0530 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0534 <[^>]*> sll \$a0,\$a0,0x8
+0+0538 <[^>]*> or \$a0,\$a0,\$at
+0+053c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+053c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+0540 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0540 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0544 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0548 <[^>]*> srl \$a0,\$a0,0x8
+0+054c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0550 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0554 <[^>]*> sll \$a0,\$a0,0x8
+0+0558 <[^>]*> or \$a0,\$a0,\$at
+0+055c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+055c [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+0560 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0560 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0564 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0568 <[^>]*> srl \$a0,\$a0,0x8
+0+056c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0570 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0574 <[^>]*> sll \$a0,\$a0,0x8
+0+0578 <[^>]*> or \$a0,\$a0,\$at
+0+057c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+057c [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0580 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0580 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0584 <[^>]*> sb \$a0,[01]\(\$at\)
+0+0588 <[^>]*> srl \$a0,\$a0,0x8
+0+058c <[^>]*> sb \$a0,[01]\(\$at\)
+0+0590 <[^>]*> lbu \$at,[01]\(\$at\)
+0+0594 <[^>]*> sll \$a0,\$a0,0x8
+0+0598 <[^>]*> or \$a0,\$a0,\$at
+0+059c <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+059c [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+05a0 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+05a0 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+05a4 <[^>]*> sb \$a0,[01]\(\$at\)
+0+05a8 <[^>]*> srl \$a0,\$a0,0x8
+0+05ac <[^>]*> sb \$a0,[01]\(\$at\)
+0+05b0 <[^>]*> lbu \$at,[01]\(\$at\)
+0+05b4 <[^>]*> sll \$a0,\$a0,0x8
+0+05b8 <[^>]*> or \$a0,\$a0,\$at
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/usw.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/usw.d
index bfce270e2d8..3e35dadb2ce 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mips/usw.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mips/usw.d
@@ -11,29 +11,29 @@ Disassembly of section .text:
0+0004 <[^>]*> swr \$a0,[03]\(\$zero\)
0+0008 <[^>]*> swl \$a0,[14]\(\$zero\)
0+000c <[^>]*> swr \$a0,[14]\(\$zero\)
-0+0010 <[^>]*> li \$at,32768
+0+0010 <[^>]*> li \$at,0x8000
0+0014 <[^>]*> swl \$a0,[03]\(\$at\)
0+0018 <[^>]*> swr \$a0,[03]\(\$at\)
0+001c <[^>]*> swl \$a0,-3276[58]\(\$zero\)
0+0020 <[^>]*> swr \$a0,-3276[58]\(\$zero\)
-0+0024 <[^>]*> lui \$at,1
+0+0024 <[^>]*> lui \$at,0x1
0+0028 <[^>]*> swl \$a0,[03]\(\$at\)
0+002c <[^>]*> swr \$a0,[03]\(\$at\)
-0+0030 <[^>]*> lui \$at,1
-0+0034 <[^>]*> ori \$at,\$at,42405
+0+0030 <[^>]*> lui \$at,0x1
+0+0034 <[^>]*> ori \$at,\$at,0xa5a5
0+0038 <[^>]*> swl \$a0,[03]\(\$at\)
0+003c <[^>]*> swr \$a0,[03]\(\$at\)
0+0040 <[^>]*> swl \$a0,[03]\(\$a1\)
0+0044 <[^>]*> swr \$a0,[03]\(\$a1\)
0+0048 <[^>]*> swl \$a0,[14]\(\$a1\)
0+004c <[^>]*> swr \$a0,[-0-9]+\(\$a1\)
-0+0050 <[^>]*> lui \$at,[-0-9]+
+0+0050 <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+0050 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+0054 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0054 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+0058 <[^>]*> swl \$a0,[03]\(\$at\)
0+005c <[^>]*> swr \$a0,[03]\(\$at\)
-0+0060 <[^>]*> lui \$at,[-0-9]+
+0+0060 <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+0060 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+0064 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0064 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
@@ -43,7 +43,7 @@ Disassembly of section .text:
[ ]*RELOC: 0+0070 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
0+0074 <[^>]*> swl \$a0,[03]\(\$at\)
0+0078 <[^>]*> swr \$a0,[03]\(\$at\)
-0+007c <[^>]*> lui \$at,0
+0+007c <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+007c [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
0+0080 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+0080 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
@@ -53,7 +53,7 @@ Disassembly of section .text:
[ ]*RELOC: 0+008c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
0+0090 <[^>]*> swl \$a0,[03]\(\$at\)
0+0094 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0098 <[^>]*> lui \$at,[-0-9]+
+0+0098 <[^>]*> lui \$at,[-0-9x]+
[ ]*RELOC: 0+0098 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
0+009c <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+009c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
@@ -63,214 +63,208 @@ Disassembly of section .text:
[ ]*RELOC: 0+00a8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
0+00ac <[^>]*> swl \$a0,[03]\(\$at\)
0+00b0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+00b4 <[^>]*> lui \$at,0
+0+00b4 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00b4 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
0+00b8 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+00b8 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
0+00bc <[^>]*> swl \$a0,[03]\(\$at\)
0+00c0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+00c4 <[^>]*> lui \$at,0
+0+00c4 <[^>]*> lui \$at,0x0
[ ]*RELOC: 0+00c4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
0+00c8 <[^>]*> addiu \$at,\$at,[-0-9]+
[ ]*RELOC: 0+00c8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
0+00cc <[^>]*> swl \$a0,[03]\(\$at\)
0+00d0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+00d4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00d4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+00d8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+00d8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+00dc <[^>]*> swl \$a0,[03]\(\$at\)
-0+00e0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+00e4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00e4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+00e8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+00e8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+00ec <[^>]*> swl \$a0,[03]\(\$at\)
-0+00f0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+00f4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+00f4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+00f8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+00f8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+00fc <[^>]*> swl \$a0,[03]\(\$at\)
-0+0100 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0104 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0104 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0108 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0108 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+010c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0110 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0114 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0114 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0118 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0118 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+011c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0120 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0124 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0124 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0128 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0128 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+012c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0130 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0134 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0134 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0138 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0138 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+013c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0140 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0144 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0144 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0148 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0148 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+014c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0150 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0154 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0154 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0158 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0158 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+015c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0160 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0164 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0164 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0168 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0168 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+016c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0170 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0174 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0174 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0178 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0178 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+017c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0180 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0184 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0184 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0188 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0188 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+018c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0190 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0194 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+0194 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0198 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0198 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+019c <[^>]*> swl \$a0,[03]\(\$at\)
-0+01a0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+01a4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01a4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+01a8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01a8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+01ac <[^>]*> swl \$a0,[03]\(\$at\)
-0+01b0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+01b4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01b4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+01b8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01b8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+01bc <[^>]*> swl \$a0,[03]\(\$at\)
-0+01c0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+01c4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01c4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+01c8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01c8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+01cc <[^>]*> swl \$a0,[03]\(\$at\)
-0+01d0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+01d4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01d4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+01d8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01d8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+01dc <[^>]*> swl \$a0,[03]\(\$at\)
-0+01e0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+01e4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01e4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+01e8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01e8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+01ec <[^>]*> swl \$a0,[03]\(\$at\)
-0+01f0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+01f4 <[^>]*> lui \$at,0
-[ ]*RELOC: 0+01f4 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+01f8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+01f8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+01fc <[^>]*> swl \$a0,[03]\(\$at\)
-0+0200 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0204 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0204 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0208 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0208 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+020c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0210 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0214 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0214 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0218 <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+0218 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+021c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0220 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0224 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0224 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0228 <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+0228 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+022c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0230 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0234 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0234 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+0238 <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+0238 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+023c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0240 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0244 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0244 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+0248 <[^>]*> addiu \$at,\$at,0
-[ ]*RELOC: 0+0248 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+024c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0250 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0254 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0254 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+0258 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0258 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+025c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0260 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0264 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0264 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+0268 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0268 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+026c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0270 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0274 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0274 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
-0+0278 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0278 [A-Z0-9_]*LO[A-Z0-9_]* .data.*
-0+027c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0280 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0284 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0284 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
-0+0288 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0288 [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
-0+028c <[^>]*> swl \$a0,[03]\(\$at\)
-0+0290 <[^>]*> swr \$a0,[03]\(\$at\)
-0+0294 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+0294 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
-0+0298 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+0298 [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
-0+029c <[^>]*> swl \$a0,[03]\(\$at\)
-0+02a0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+02a4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02a4 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
-0+02a8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02a8 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
-0+02ac <[^>]*> swl \$a0,[03]\(\$at\)
-0+02b0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+02b4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02b4 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
-0+02b8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02b8 [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
-0+02bc <[^>]*> swl \$a0,[03]\(\$at\)
-0+02c0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+02c4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02c4 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
-0+02c8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02c8 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
-0+02cc <[^>]*> swl \$a0,[03]\(\$at\)
-0+02d0 <[^>]*> swr \$a0,[03]\(\$at\)
-0+02d4 <[^>]*> lui \$at,[-0-9]+
-[ ]*RELOC: 0+02d4 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
-0+02d8 <[^>]*> addiu \$at,\$at,[-0-9]+
-[ ]*RELOC: 0+02d8 [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
-0+02dc <[^>]*> swl \$a0,[03]\(\$at\)
-0+02e0 <[^>]*> swr \$a0,[03]\(\$at\)
+0+00d4 <[^>]*> addiu \$at,\$gp,1
+[ ]*RELOC: 0+00d4 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+00d8 <[^>]*> swl \$a0,[03]\(\$at\)
+0+00dc <[^>]*> swr \$a0,[03]\(\$at\)
+0+00e0 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00e0 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+00e4 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+00e4 [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+00e8 <[^>]*> swl \$a0,[03]\(\$at\)
+0+00ec <[^>]*> swr \$a0,[03]\(\$at\)
+0+00f0 <[^>]*> addiu \$at,\$gp,1
+[ ]*RELOC: 0+00f0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00f4 <[^>]*> swl \$a0,[03]\(\$at\)
+0+00f8 <[^>]*> swr \$a0,[03]\(\$at\)
+0+00fc <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+00fc [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+0100 <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+0100 [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0104 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0108 <[^>]*> swr \$a0,[03]\(\$at\)
+0+010c <[^>]*> addiu \$at,\$gp,[-0-9]+
+[ ]*RELOC: 0+010c [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+0110 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0114 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0118 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0118 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+011c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+011c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0120 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0124 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0128 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0128 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+012c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+012c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0130 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0134 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0138 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0138 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+013c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+013c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0140 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0144 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0148 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0148 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+014c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+014c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0150 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0154 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0158 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0158 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+015c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+015c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0160 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0164 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0168 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0168 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+016c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+016c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0170 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0174 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0178 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0178 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+017c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+017c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0180 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0184 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0188 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0188 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+018c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+018c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0190 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0194 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0198 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+0198 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+019c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+019c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+01a0 <[^>]*> swl \$a0,[03]\(\$at\)
+0+01a4 <[^>]*> swr \$a0,[03]\(\$at\)
+0+01a8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01a8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+01ac <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01ac [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+01b0 <[^>]*> swl \$a0,[03]\(\$at\)
+0+01b4 <[^>]*> swr \$a0,[03]\(\$at\)
+0+01b8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01b8 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+01bc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01bc [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+01c0 <[^>]*> swl \$a0,[03]\(\$at\)
+0+01c4 <[^>]*> swr \$a0,[03]\(\$at\)
+0+01c8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01c8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+01cc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01cc [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+01d0 <[^>]*> swl \$a0,[03]\(\$at\)
+0+01d4 <[^>]*> swr \$a0,[03]\(\$at\)
+0+01d8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01d8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+01dc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01dc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+01e0 <[^>]*> swl \$a0,[03]\(\$at\)
+0+01e4 <[^>]*> swr \$a0,[03]\(\$at\)
+0+01e8 <[^>]*> lui \$at,0x0
+[ ]*RELOC: 0+01e8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+01ec <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01ec [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+01f0 <[^>]*> swl \$a0,[03]\(\$at\)
+0+01f4 <[^>]*> swr \$a0,[03]\(\$at\)
+0+01f8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+01f8 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+01fc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+01fc [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0200 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0204 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0208 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0208 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+020c <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+020c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0210 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0214 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0218 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0218 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+021c <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+021c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0220 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0224 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0228 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0228 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+022c <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+022c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+0230 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0234 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0238 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0238 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+023c <[^>]*> addiu \$at,\$at,0
+[ ]*RELOC: 0+023c [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+0240 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0244 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0248 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0248 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+024c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+024c [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+0250 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0254 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0258 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0258 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+025c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+025c [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+0260 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0264 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0268 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0268 [A-Z0-9_]*HI[A-Z0-9_]* .data.*
+0+026c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+026c [A-Z0-9_]*LO[A-Z0-9_]* .data.*
+0+0270 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0274 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0278 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0278 [A-Z0-9_]*HI[A-Z0-9_]* big_external_data_label
+0+027c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+027c [A-Z0-9_]*LO[A-Z0-9_]* big_external_data_label
+0+0280 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0284 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0288 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0288 [A-Z0-9_]*HI[A-Z0-9_]* small_external_data_label
+0+028c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+028c [A-Z0-9_]*LO[A-Z0-9_]* small_external_data_label
+0+0290 <[^>]*> swl \$a0,[03]\(\$at\)
+0+0294 <[^>]*> swr \$a0,[03]\(\$at\)
+0+0298 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+0298 [A-Z0-9_]*HI[A-Z0-9_]* big_external_common
+0+029c <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+029c [A-Z0-9_]*LO[A-Z0-9_]* big_external_common
+0+02a0 <[^>]*> swl \$a0,[03]\(\$at\)
+0+02a4 <[^>]*> swr \$a0,[03]\(\$at\)
+0+02a8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02a8 [A-Z0-9_]*HI[A-Z0-9_]* small_external_common
+0+02ac <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02ac [A-Z0-9_]*LO[A-Z0-9_]* small_external_common
+0+02b0 <[^>]*> swl \$a0,[03]\(\$at\)
+0+02b4 <[^>]*> swr \$a0,[03]\(\$at\)
+0+02b8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02b8 [A-Z0-9_]*HI[A-Z0-9_]* .bss.*
+0+02bc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02bc [A-Z0-9_]*LO[A-Z0-9_]* .bss.*
+0+02c0 <[^>]*> swl \$a0,[03]\(\$at\)
+0+02c4 <[^>]*> swr \$a0,[03]\(\$at\)
+0+02c8 <[^>]*> lui \$at,[-0-9x]+
+[ ]*RELOC: 0+02c8 [A-Z0-9_]*HI[A-Z0-9_]* .sbss.*
+0+02cc <[^>]*> addiu \$at,\$at,[-0-9]+
+[ ]*RELOC: 0+02cc [A-Z0-9_]*LO[A-Z0-9_]* .sbss.*
+0+02d0 <[^>]*> swl \$a0,[03]\(\$at\)
+0+02d4 <[^>]*> swr \$a0,[03]\(\$at\)
...
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mri/constants.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mri/constants.d
index 8674d107455..7210022284d 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mri/constants.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mri/constants.d
@@ -4,6 +4,7 @@
# Test MRI style constants
+0*0 T foo
0*a A s01
0*a A s02
0*a A s03
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mri/constants.s b/gnu/usr.bin/binutils/gas/testsuite/gas/mri/constants.s
index 02cccb92b2a..0034e6765e1 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mri/constants.s
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mri/constants.s
@@ -12,3 +12,20 @@ s10 equ 'a'
s11 equ A'a'
s12 equ 'abcd'
s13 equ 'a''b'
+
+ xdef foo
+foo
+ moveq.l #%1010,d0
+ moveq.l #1010b,d0
+ moveq.l #@12,d0
+ moveq.l #12o,d0
+ moveq.l #12q,d0
+ moveq.l #10,d0
+ moveq.l #10d,d0
+ moveq.l #$a,d0
+ moveq.l #0ah,d0
+ moveq.l #'a',d0
+ moveq.l #A'a',d0
+ nop
+
+ end
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mri/immconst.d b/gnu/usr.bin/binutils/gas/testsuite/gas/mri/immconst.d
new file mode 100644
index 00000000000..531affdf7c7
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mri/immconst.d
@@ -0,0 +1,22 @@
+#objdump: -d
+#name: MRI immediate constants
+#as: -M
+#source: constants.s
+
+# Test MRI immediate constants
+
+.*: file format .*
+
+Disassembly of section .text:
+0+000 <foo> moveq #10,%d0
+0+002 <foo\+2> moveq #10,%d0
+0+004 <foo\+4> moveq #10,%d0
+0+006 <foo\+6> moveq #10,%d0
+0+008 <foo\+8> moveq #10,%d0
+0+00a <foo\+a> moveq #10,%d0
+0+00c <foo\+c> moveq #10,%d0
+0+00e <foo\+e> moveq #10,%d0
+0+010 <foo\+10> moveq #10,%d0
+0+012 <foo\+12> moveq #97,%d0
+0+014 <foo\+14> moveq #97,%d0
+0+016 <foo\+16> nop
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/mri/mri.exp b/gnu/usr.bin/binutils/gas/testsuite/gas/mri/mri.exp
index 1fffe8b5483..6725f1395b4 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/mri/mri.exp
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/mri/mri.exp
@@ -13,6 +13,7 @@ if ![istarget "m68*-*-*"] {
run_dump_test label
run_dump_test equ
run_dump_test constants
+run_dump_test immconst
run_dump_test float
run_dump_test char
run_dump_test expr
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/asi.d b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/asi.d
index 3e69bcaaa17..7a5f36af6f0 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/asi.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/asi.d
@@ -1,3 +1,4 @@
+#as: -Av9
#objdump: -dr
#name: sparc64 asi
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/membar.d b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/membar.d
index 1fe8259f81e..98f8c465c33 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/membar.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/membar.d
@@ -1,3 +1,4 @@
+#as: -Av9
#objdump: -dr
#name: sparc64 membar
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mism-1.s b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mism-1.s
new file mode 100644
index 00000000000..fac5e482704
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mism-1.s
@@ -0,0 +1,22 @@
+! Test architecture mismatch warnings.
+! We don't test every possible mismatch, we just want to be reasonable sure
+! the mismatch checking code works.
+!
+! { dg-do assemble { target sparc*-*-* } }
+! { dg-options -Av6 }
+
+! sparclite
+
+ divscc %g1,%g2,%g3 ! { dg-error "mismatch|sparclite" "sparclite divscc mismatch" }
+
+ scan %g1,%g2,%g3 ! { dg-error "mismatch|sparclite" "sparclite scan mismatch" }
+
+! v9
+
+ movrz %g1,%g2,%g3 ! { dg-error "mismatch|v9" "v9 fp reg mismatch" }
+
+! v9a
+
+ shutdown ! { dg-error "mismatch|v9a" "v9a shutdown mismatch" }
+
+foo:
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mismatch.exp b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mismatch.exp
new file mode 100644
index 00000000000..6f89de2a244
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/mismatch.exp
@@ -0,0 +1,20 @@
+# Test architecture mismatch errors.
+#
+# GAS issues two lines of error text for each mismatch:
+#
+# mm-lite.s:7: Error: Architecture mismatch on "divscc".
+# mm-lite.s:7: (Requires sparclite; requested architecture is v8.)
+#
+# The suggested regexp argument to dg-error is "mismatch|<arch>".
+
+if [istarget sparc*-*-*] {
+
+ load_lib gas-dg.exp
+
+ dg-init
+
+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/mism-*.s]] "" ""
+
+ dg-finish
+
+}
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/prefetch.d b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/prefetch.d
index 7a447520988..44f1493cee2 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/prefetch.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/prefetch.d
@@ -1,3 +1,4 @@
+#as: -Av9
#objdump: -dr
#name: sparc64 prefetch
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/rdpr.d b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/rdpr.d
index af72aba2deb..52317924f6a 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/rdpr.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/rdpr.d
@@ -1,3 +1,4 @@
+#as: -Av9
#objdump: -dr
#name: sparc64 rdpr
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/sparc.exp b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/sparc.exp
index d71e5bd0d11..2ec14ec67d2 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/sparc.exp
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/sparc.exp
@@ -5,13 +5,20 @@
# disassembly. The way to fix this is to include a hex dump of the insns
# and test that as well. Later.
-if [istarget sparc*-*-*] then {
- set sparc64 [istarget sparc64*-*-*]
+if [istarget sparc*-*-*] {
+ run_dump_test "synth"
+}
+
+
+if [istarget sparc64*-*-*] {
+ run_dump_test "asi"
+ run_dump_test "membar"
+ run_dump_test "prefetch"
+ run_dump_test "synth64"
+ run_dump_test "rdpr"
+ run_dump_test "wrpr"
+}
- if $sparc64 { run_dump_test "asi" }
- if $sparc64 { run_dump_test "membar" }
- if $sparc64 { run_dump_test "prefetch" }
- if $sparc64 { run_dump_test "synth64" }
- if $sparc64 { run_dump_test "rdpr" }
- if $sparc64 { run_dump_test "wrpr" }
+if [istarget sparclet*-*-*] {
+ run_dump_test "splet"
}
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.d b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.d
new file mode 100644
index 00000000000..cee258eeaac
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.d
@@ -0,0 +1,169 @@
+#as: -Asparclet
+#objdump: -dr
+#name: sparclet extensions
+
+.*: +file format .*
+
+Disassembly of section .text:
+0+0000 <start> rd %y, %l0
+0+0004 <start\+4> rd %asr1, %l0
+0+0008 <start\+8> rd %asr15, %l0
+0+000c <start\+c> rd %asr17, %l0
+0+0010 <start\+10> rd %asr18, %l0
+0+0014 <start\+14> rd %asr19, %l0
+0+0018 <start\+18> rd %asr20, %l0
+0+001c <start\+1c> rd %asr21, %l0
+0+0020 <start\+20> rd %asr22, %l0
+0+0024 <start\+24> mov %l0, %y
+0+0028 <start\+28> mov %l0, %asr1
+0+002c <start\+2c> mov %l0, %asr15
+0+0030 <start\+30> mov %l0, %asr17
+0+0034 <start\+34> mov %l0, %asr18
+0+0038 <start\+38> mov %l0, %asr19
+0+003c <start\+3c> mov %l0, %asr20
+0+0040 <start\+40> mov %l0, %asr21
+0+0044 <start\+44> mov %l0, %asr22
+0+0048 <test_umul> umul %g1, %g2, %g3
+0+004c <test_umul\+4> umul %g1, %g2, %g3
+0+0050 <test_smul> smul %g1, %g2, %g3
+0+0054 <test_smul\+4> smul %g1, %g2, %g3
+0+0058 <test_stbar> stbar
+0+005c <test_stbar\+4> stbar
+0+0060 <test_stbar\+8> unimp 0x1
+0+0064 <test_stbar\+c> flush %l1
+0+0068 <test_scan> scan %l1, -1, %l3
+0+006c <test_scan\+4> scan %l1, 0, %l3
+0+0070 <test_scan\+8> scan %l1, %l1, %l3
+0+0074 <test_shuffle> shuffle %l0, 1, %l1
+0+0078 <test_shuffle\+4> shuffle %l0, 2, %l1
+0+007c <test_shuffle\+8> shuffle %l0, 4, %l1
+0+0080 <test_shuffle\+c> shuffle %l0, 8, %l1
+0+0084 <test_shuffle\+10> shuffle %l0, 0x10, %l1
+0+0088 <test_shuffle\+14> shuffle %l0, 0x18, %l1
+0+008c <test_umac> umac %l1, %l2, %l0
+0+0090 <test_umac\+4> umac %l1, 2, %l0
+0+0094 <test_umac\+8> umac %l1, 2, %l0
+0+0098 <test_umacd> umacd %l2, %l4, %l0
+0+009c <test_umacd\+4> umacd %l2, 3, %l0
+0+00a0 <test_umacd\+8> umacd %l2, 3, %l0
+0+00a4 <test_smac> smac %l1, %l2, %l0
+0+00a8 <test_smac\+4> smac %l1, -42, %l0
+0+00ac <test_smac\+8> smac %l1, -42, %l0
+0+00b0 <test_smacd> smacd %l2, %l4, %l0
+0+00b4 <test_smacd\+4> smacd %l2, 0x7b, %l0
+0+00b8 <test_smacd\+8> smacd %l2, 0x7b, %l0
+0+00bc <test_umuld> umuld %o2, %o4, %o0
+0+00c0 <test_umuld\+4> umuld %o2, 0x234, %o0
+0+00c4 <test_umuld\+8> umuld %o2, 0x567, %o0
+0+00c8 <test_smuld> smuld %i2, %i4, %i0
+0+00cc <test_smuld\+4> smuld %i2, -4096, %i0
+0+00d0 <test_smuld\+8> smuld %i4, 0xfff, %i0
+0+00d4 <test_coprocessor> cpush %l0, %l1
+0+00d8 <test_coprocessor\+4> cpush %l0, 1
+0+00dc <test_coprocessor\+8> cpusha %l0, %l1
+0+00e0 <test_coprocessor\+c> cpush %l0, 1
+0+00e4 <test_coprocessor\+10> cpull %l0
+0+00e8 <test_coprocessor\+14> crdcxt %ccsr, %l0
+0+00ec <test_coprocessor\+18> crdcxt %ccfr, %l0
+0+00f0 <test_coprocessor\+1c> crdcxt %ccpr, %l0
+0+00f4 <test_coprocessor\+20> crdcxt %cccrcr, %l0
+0+00f8 <test_coprocessor\+24> cwrcxt %l0, %ccsr
+0+00fc <test_coprocessor\+28> cwrcxt %l0, %ccfr
+0+0100 <test_coprocessor\+2c> cwrcxt %l0, %ccpr
+0+0104 <test_coprocessor\+30> cwrcxt %l0, %cccrcr
+0+0108 <test_coprocessor\+34> cbn 0000010c <test_coprocessor\+38>
+.*RELOC: 0+0108 WDISP22 stop\+0xfffffef8
+0+010c <test_coprocessor\+38> nop
+0+0110 <test_coprocessor\+3c> cbn,a 00000114 <test_coprocessor\+40>
+.*RELOC: 0+0110 WDISP22 stop\+0xfffffef0
+0+0114 <test_coprocessor\+40> nop
+0+0118 <test_coprocessor\+44> cbe 0000011c <test_coprocessor\+48>
+.*RELOC: 0+0118 WDISP22 stop\+0xfffffee8
+0+011c <test_coprocessor\+48> nop
+0+0120 <test_coprocessor\+4c> cbe,a 00000124 <test_coprocessor\+50>
+.*RELOC: 0+0120 WDISP22 stop\+0xfffffee0
+0+0124 <test_coprocessor\+50> nop
+0+0128 <test_coprocessor\+54> cbf 0000012c <test_coprocessor\+58>
+.*RELOC: 0+0128 WDISP22 stop\+0xfffffed8
+0+012c <test_coprocessor\+58> nop
+0+0130 <test_coprocessor\+5c> cbf,a 00000134 <test_coprocessor\+60>
+.*RELOC: 0+0130 WDISP22 stop\+0xfffffed0
+0+0134 <test_coprocessor\+60> nop
+0+0138 <test_coprocessor\+64> cbef 0000013c <test_coprocessor\+68>
+.*RELOC: 0+0138 WDISP22 stop\+0xfffffec8
+0+013c <test_coprocessor\+68> nop
+0+0140 <test_coprocessor\+6c> cbef,a 00000144 <test_coprocessor\+70>
+.*RELOC: 0+0140 WDISP22 stop\+0xfffffec0
+0+0144 <test_coprocessor\+70> nop
+0+0148 <test_coprocessor\+74> cbr 0000014c <test_coprocessor\+78>
+.*RELOC: 0+0148 WDISP22 stop\+0xfffffeb8
+0+014c <test_coprocessor\+78> nop
+0+0150 <test_coprocessor\+7c> cbr,a 00000154 <test_coprocessor\+80>
+.*RELOC: 0+0150 WDISP22 stop\+0xfffffeb0
+0+0154 <test_coprocessor\+80> nop
+0+0158 <test_coprocessor\+84> cber 0000015c <test_coprocessor\+88>
+.*RELOC: 0+0158 WDISP22 stop\+0xfffffea8
+0+015c <test_coprocessor\+88> nop
+0+0160 <test_coprocessor\+8c> cber,a 00000164 <test_coprocessor\+90>
+.*RELOC: 0+0160 WDISP22 stop\+0xfffffea0
+0+0164 <test_coprocessor\+90> nop
+0+0168 <test_coprocessor\+94> cbfr 0000016c <test_coprocessor\+98>
+.*RELOC: 0+0168 WDISP22 stop\+0xfffffe98
+0+016c <test_coprocessor\+98> nop
+0+0170 <test_coprocessor\+9c> cbfr,a 00000174 <test_coprocessor\+a0>
+.*RELOC: 0+0170 WDISP22 stop\+0xfffffe90
+0+0174 <test_coprocessor\+a0> nop
+0+0178 <test_coprocessor\+a4> cbefr 0000017c <test_coprocessor\+a8>
+.*RELOC: 0+0178 WDISP22 stop\+0xfffffe88
+0+017c <test_coprocessor\+a8> nop
+0+0180 <test_coprocessor\+ac> cbefr,a 00000184 <test_coprocessor\+b0>
+.*RELOC: 0+0180 WDISP22 stop\+0xfffffe80
+0+0184 <test_coprocessor\+b0> nop
+0+0188 <test_coprocessor\+b4> cba 0000018c <test_coprocessor\+b8>
+.*RELOC: 0+0188 WDISP22 stop\+0xfffffe78
+0+018c <test_coprocessor\+b8> nop
+0+0190 <test_coprocessor\+bc> cba,a 00000194 <test_coprocessor\+c0>
+.*RELOC: 0+0190 WDISP22 stop\+0xfffffe70
+0+0194 <test_coprocessor\+c0> nop
+0+0198 <test_coprocessor\+c4> cbne 0000019c <test_coprocessor\+c8>
+.*RELOC: 0+0198 WDISP22 stop\+0xfffffe68
+0+019c <test_coprocessor\+c8> nop
+0+01a0 <test_coprocessor\+cc> cbne,a 000001a4 <test_coprocessor\+d0>
+.*RELOC: 0+01a0 WDISP22 stop\+0xfffffe60
+0+01a4 <test_coprocessor\+d0> nop
+0+01a8 <test_coprocessor\+d4> cbnf 000001ac <test_coprocessor\+d8>
+.*RELOC: 0+01a8 WDISP22 stop\+0xfffffe58
+0+01ac <test_coprocessor\+d8> nop
+0+01b0 <test_coprocessor\+dc> cbnf,a 000001b4 <test_coprocessor\+e0>
+.*RELOC: 0+01b0 WDISP22 stop\+0xfffffe50
+0+01b4 <test_coprocessor\+e0> nop
+0+01b8 <test_coprocessor\+e4> cbnef 000001bc <test_coprocessor\+e8>
+.*RELOC: 0+01b8 WDISP22 stop\+0xfffffe48
+0+01bc <test_coprocessor\+e8> nop
+0+01c0 <test_coprocessor\+ec> cbnef,a 000001c4 <test_coprocessor\+f0>
+.*RELOC: 0+01c0 WDISP22 stop\+0xfffffe40
+0+01c4 <test_coprocessor\+f0> nop
+0+01c8 <test_coprocessor\+f4> cbnr 000001cc <test_coprocessor\+f8>
+.*RELOC: 0+01c8 WDISP22 stop\+0xfffffe38
+0+01cc <test_coprocessor\+f8> nop
+0+01d0 <test_coprocessor\+fc> cbnr,a 000001d4 <test_coprocessor\+100>
+.*RELOC: 0+01d0 WDISP22 stop\+0xfffffe30
+0+01d4 <test_coprocessor\+100> nop
+0+01d8 <test_coprocessor\+104> cbner 000001dc <test_coprocessor\+108>
+.*RELOC: 0+01d8 WDISP22 stop\+0xfffffe28
+0+01dc <test_coprocessor\+108> nop
+0+01e0 <test_coprocessor\+10c> cbner,a 000001e4 <test_coprocessor\+110>
+.*RELOC: 0+01e0 WDISP22 stop\+0xfffffe20
+0+01e4 <test_coprocessor\+110> nop
+0+01e8 <test_coprocessor\+114> cbnfr 000001ec <test_coprocessor\+118>
+.*RELOC: 0+01e8 WDISP22 stop\+0xfffffe18
+0+01ec <test_coprocessor\+118> nop
+0+01f0 <test_coprocessor\+11c> cbnfr,a 000001f4 <test_coprocessor\+120>
+.*RELOC: 0+01f0 WDISP22 stop\+0xfffffe10
+0+01f4 <test_coprocessor\+120> nop
+0+01f8 <test_coprocessor\+124> cbnefr 000001fc <test_coprocessor\+128>
+.*RELOC: 0+01f8 WDISP22 stop\+0xfffffe08
+0+01fc <test_coprocessor\+128> nop
+0+0200 <test_coprocessor\+12c> cbnefr,a 00000204 <test_coprocessor\+130>
+.*RELOC: 0+0200 WDISP22 stop\+0xfffffe00
+0+0204 <test_coprocessor\+130> nop
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.s b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.s
new file mode 100644
index 00000000000..0dfd5074bde
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/splet.s
@@ -0,0 +1,211 @@
+ .text
+ .global start
+
+! Starting point
+start:
+
+! test all ASRs
+
+ rd %asr0, %l0
+ rd %asr1, %l0
+ rd %asr15, %l0
+ rd %asr17, %l0
+ rd %asr18, %l0
+ rd %asr19, %l0 ! should stop the processor
+ rd %asr20, %l0
+ rd %asr21, %l0
+ rd %asr22, %l0
+
+ wr %l0, 0, %asr0
+ wr %l0, 0, %asr1
+ wr %l0, 0, %asr15
+ wr %l0, 0, %asr17
+ wr %l0, 0, %asr18
+ wr %l0, 0, %asr19
+ wr %l0, 0, %asr20
+ wr %l0, 0, %asr21
+ wr %l0, 0, %asr22
+
+! test UMUL with no overflow inside Y
+test_umul:
+ umul %g1, %g2, %g3
+
+! test UMUL with an overflow inside Y
+
+ umul %g1, %g2, %g3 ! %g3 must be equal to 0
+
+! test SMUL with negative result
+test_smul:
+ smul %g1, %g2, %g3
+
+! test SMUL with positive result
+
+ smul %g1, %g2, %g3
+
+! test STBAR: there are two possible syntaxes
+test_stbar:
+ stbar ! is a valid V8 syntax, at least a synthetic
+ ! instruction
+ rd %asr15, %g0 ! other solution
+
+! test UNIMP
+ unimp 1
+
+! test FLUSH
+ flush %l1 ! is the official V8 syntax
+
+! test SCAN: find first 0
+test_scan:
+ scan %l1, 0xffffffff, %l3
+
+! test scan: find first 1
+
+ scan %l1, 0, %l3
+
+! test scan: find first bit != bit-0
+
+ scan %l1, %l1, %l3
+
+! test SHUFFLE
+test_shuffle:
+ shuffle %l0, 0x1, %l1
+ shuffle %l0, 0x2, %l1
+ shuffle %l0, 0x4, %l1
+ shuffle %l0, 0x8, %l1
+ shuffle %l0, 0x10, %l1
+ shuffle %l0, 0x18, %l1
+
+! test UMAC
+test_umac:
+ umac %l1, %l2, %l0
+ umac %l1, 2, %l0
+ umac 2, %l1, %l0
+
+! test UMACD
+test_umacd:
+ umacd %l2, %l4, %l0
+ umacd %l2, 3, %l0
+ umacd 3, %l2, %l0
+
+! test SMAC
+test_smac:
+ smac %l1, %l2, %l0
+ smac %l1, -42, %l0
+ smac -42, %l1, %l0
+
+! test SMACD
+test_smacd:
+ smacd %l2, %l4, %l0
+ smacd %l2, 123, %l0
+ smacd 123, %l2, %l0
+
+! test UMULD
+test_umuld:
+ umuld %o2, %o4, %o0
+ umuld %o2, 0x234, %o0
+ umuld 0x567, %o2, %o0
+
+! test SMULD
+test_smuld:
+ smuld %i2, %i4, %i0
+ smuld %i2, -4096, %i0
+ smuld 4095, %i4, %i0
+
+! Coprocessor instructions
+test_coprocessor:
+! %ccsr is register # 0
+! %ccfr is register # 1
+! %ccpr is register # 3
+! %cccrcr is register # 2
+
+! test CPUSH: just syntax
+
+ cpush %l0, %l1
+ cpush %l0, 1
+ cpusha %l0, %l1
+ cpusha %l0, 1
+
+! test CPULL: just syntax
+
+ cpull %l0
+
+! test CPRDCXT: just syntax
+
+ crdcxt %ccsr, %l0
+ crdcxt %ccfr, %l0
+ crdcxt %ccpr, %l0
+ crdcxt %cccrcr, %l0
+
+! test CPWRCXT: just syntax
+
+ cwrcxt %l0, %ccsr
+ cwrcxt %l0, %ccfr
+ cwrcxt %l0, %ccpr
+ cwrcxt %l0, %cccrcr
+
+! test CBccc: just syntax
+
+ cbn stop
+ nop
+ cbn,a stop
+ nop
+ cbe stop
+ nop
+ cbe,a stop
+ nop
+ cbf stop
+ nop
+ cbf,a stop
+ nop
+ cbef stop
+ nop
+ cbef,a stop
+ nop
+ cbr stop
+ nop
+ cbr,a stop
+ nop
+ cber stop
+ nop
+ cber,a stop
+ nop
+ cbfr stop
+ nop
+ cbfr,a stop
+ nop
+ cbefr stop
+ nop
+ cbefr,a stop
+ nop
+ cba stop
+ nop
+ cba,a stop
+ nop
+ cbne stop
+ nop
+ cbne,a stop
+ nop
+ cbnf stop
+ nop
+ cbnf,a stop
+ nop
+ cbnef stop
+ nop
+ cbnef,a stop
+ nop
+ cbnr stop
+ nop
+ cbnr,a stop
+ nop
+ cbner stop
+ nop
+ cbner,a stop
+ nop
+ cbnfr stop
+ nop
+ cbnfr,a stop
+ nop
+ cbnefr stop
+ nop
+ cbnefr,a stop
+ nop
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.d b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.d
new file mode 100644
index 00000000000..5fc1be8817a
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.d
@@ -0,0 +1,11 @@
+#as: -Av7
+#objdump: -dr
+#name: sparc synth
+
+.*: +file format .*
+
+Disassembly of section .text:
+0+0000 <foo> xnor %g1, %g0, %g2
+0+0004 <foo\+4> xnor %g1, %g0, %g1
+0+0008 <foo\+8> neg %g1, %g2
+0+000c <foo\+c> neg %g1
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.s b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.s
new file mode 100644
index 00000000000..9e066289487
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth.s
@@ -0,0 +1,7 @@
+# common (v8 or v9) synthetic insns
+ .text
+foo:
+ not %g1,%g2
+ not %g1
+ neg %g1,%g2
+ neg %g1
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth64.d b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth64.d
index a0608e8c058..282b4ae0506 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth64.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/synth64.d
@@ -1,3 +1,4 @@
+#as: -Av9
#objdump: -dr
#name: sparc64 synth64
diff --git a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/wrpr.d b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/wrpr.d
index 62ece233ad7..cbe1ed79ec2 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/wrpr.d
+++ b/gnu/usr.bin/binutils/gas/testsuite/gas/sparc/wrpr.d
@@ -1,3 +1,4 @@
+#as: -Av9
#objdump: -dr
#name: sparc64 wrpr
diff --git a/gnu/usr.bin/binutils/gas/testsuite/lib/gas-dg.exp b/gnu/usr.bin/binutils/gas/testsuite/lib/gas-dg.exp
index 629c0ac5ad0..ebb9f5b17f5 100644
--- a/gnu/usr.bin/binutils/gas/testsuite/lib/gas-dg.exp
+++ b/gnu/usr.bin/binutils/gas/testsuite/lib/gas-dg.exp
@@ -7,7 +7,7 @@ load_lib dg.exp
# but we currently don't support that. Assembler testcases aren't usually
# that elaborate anyway. :-)
-proc gas-dg-test { prog do_what tool_flags default_tool_flags libs } {
+proc gas-dg-test { prog do_what tool_flags } {
# FIXME: the gas testsuite doesn't define tmpdir. Use outdir?
set output_file "./a.out"
diff --git a/gnu/usr.bin/binutils/gas/write.c b/gnu/usr.bin/binutils/gas/write.c
index 506644f234e..10aba1e481d 100644
--- a/gnu/usr.bin/binutils/gas/write.c
+++ b/gnu/usr.bin/binutils/gas/write.c
@@ -1,5 +1,5 @@
/* write.c - emit .o file
- Copyright (C) 1986, 87, 90, 91, 92, 93, 94, 1995
+ Copyright (C) 1986, 87, 90, 91, 92, 93, 94, 95, 1996
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -94,6 +94,8 @@ int magic_number_for_object_file = DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE;
#endif /* BFD_ASSEMBLER */
+static int n_fixups;
+
#ifdef BFD_ASSEMBLER
static fixS *fix_new_internal PARAMS ((fragS *, int where, int size,
symbolS *add, symbolS *sub,
@@ -133,6 +135,8 @@ fix_new_internal (frag, where, size, add_symbol, sub_symbol, offset, pcrel,
{
fixS *fixP;
+ n_fixups++;
+
fixP = (fixS *) obstack_alloc (&notes, sizeof (fixS));
fixP->fx_frag = frag;
@@ -268,11 +272,13 @@ fix_new_exp (frag, where, size, exp, pcrel, r_type)
#if defined(BFD_ASSEMBLER)
r_type = BFD_RELOC_RVA;
-#elif defined(TC_RVA_RELOC)
+#else
+#if defined(TC_RVA_RELOC)
r_type = TC_RVA_RELOC;
#else
as_fatal("rva not supported");
#endif
+#endif
break;
case O_uminus:
@@ -799,12 +805,23 @@ write_relocs (abfd, sec, xxx)
{
arelent *reloc;
bfd_reloc_status_type s;
+ symbolS *sym;
if (fixp->fx_done)
{
n--;
continue;
}
+
+ /* If this is an undefined symbol which was equated to another
+ symbol, then use generate the reloc against the latter symbol
+ rather than the former. */
+ sym = fixp->fx_addsy;
+ while (sym->sy_value.X_op == O_symbol
+ && (! S_IS_DEFINED (sym) || S_IS_COMMON (sym)))
+ sym = sym->sy_value.X_add_symbol;
+ fixp->fx_addsy = sym;
+
reloc = tc_gen_reloc (sec, fixp);
if (!reloc)
{
@@ -844,6 +861,7 @@ write_relocs (abfd, sec, xxx)
arelent **reloc;
char *data;
bfd_reloc_status_type s;
+ symbolS *sym;
int j;
if (fixp->fx_done)
@@ -851,6 +869,16 @@ write_relocs (abfd, sec, xxx)
n--;
continue;
}
+
+ /* If this is an undefined symbol which was equated to another
+ symbol, then use generate the reloc against the latter symbol
+ rather than the former. */
+ sym = fixp->fx_addsy;
+ while (sym->sy_value.X_op == O_symbol
+ && (! S_IS_DEFINED (sym) || S_IS_COMMON (sym)))
+ sym = sym->sy_value.X_add_symbol;
+ fixp->fx_addsy = sym;
+
reloc = tc_gen_reloc (sec, fixp);
for (j = 0; reloc[j]; j++)
@@ -1642,6 +1670,15 @@ write_object_file ()
resolve_symbol_value (symp);
}
+ /* Skip symbols which were equated to undefined or common
+ symbols. */
+ if (symp->sy_value.X_op == O_symbol
+ && (! S_IS_DEFINED (symp) || S_IS_COMMON (symp)))
+ {
+ symbol_remove (symp, &symbol_rootP, &symbol_lastP);
+ continue;
+ }
+
/* So far, common symbols have been treated like undefined symbols.
Put them in the common section now. */
if (S_IS_DEFINED (symp) == 0
@@ -2405,9 +2442,11 @@ fixup_segment (fixP, this_segment_type)
else
{
seg_reloc_count++;
+#if !(defined (TC_M68K) && defined (OBJ_ELF))
#if !defined (TC_I386) || !(defined (OBJ_ELF) || defined (OBJ_COFF))
add_number += S_GET_VALUE (add_symbolP);
#endif
+#endif
}
}
}
@@ -2534,6 +2573,13 @@ number_to_chars_littleendian (buf, val, n)
}
}
+void
+write_print_statistics (file)
+ FILE *file;
+{
+ fprintf (stderr, "fixups: %d\n", n_fixups);
+}
+
/* for debugging */
extern int indent_level;
extern void print_symbol_value_1 ();
diff --git a/gnu/usr.bin/binutils/gas/write.h b/gnu/usr.bin/binutils/gas/write.h
index b15c713814b..d767197f73d 100644
--- a/gnu/usr.bin/binutils/gas/write.h
+++ b/gnu/usr.bin/binutils/gas/write.h
@@ -99,7 +99,9 @@ struct fix
/* If NULL, no bitfix's to do. */
/* Only i960-coff and ns32k use this, and i960-coff stores an
- integer. This can probably be folded into tc_fix_data, below. */
+ integer. This can probably be folded into tc_fix_data, below.
+ @@ Alpha also uses it, but only to disable certain relocation
+ processing. */
bit_fixS *fx_bit_fixP;
#ifdef BFD_ASSEMBLER
diff --git a/gnu/usr.bin/binutils/gprof/ChangeLog b/gnu/usr.bin/binutils/gprof/ChangeLog
index c5089b5e098..8551292f67c 100644
--- a/gnu/usr.bin/binutils/gprof/ChangeLog
+++ b/gnu/usr.bin/binutils/gprof/ChangeLog
@@ -1,4 +1,133 @@
-Thu Nov 16 17:34:01 1995 Ken Raeburn <raeburn@cygnus.com>
+Mon Apr 8 14:44:33 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Permit --enable-shared to specify a list of
+ directories.
+ * configure: Rebuild.
+
+Thu Mar 21 17:18:25 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * core.c (core_create_function_syms): Move filename and func_name
+ inside ifdef where they are used.
+
+ * core.c (core_sym_class): Parenthesize && within ||.
+ * symtab.c (symtab_finalize): Correct parenthesization.
+
+ * cg_print.h (cg_print_file_ordering): Declare.
+ (cg_print_function_ordering): Declare.
+
+ * __bb_exit_func.c (__bb_exit_func): Replace bcopy with memcpy.
+ * cg_arcs.c (arc_add): Likewise.
+ * cg_print.c (cg_print_function_ordering): Likewise.
+
+Thu Mar 21 17:02:02 1996 David Mosberger-Tang <davidm@azstarnet.com>
+
+ * gprof.c (default_excluded_list): Add "__mcount".
+
+ * gprof.c (main): Change ifdef __osf__ to __alpha__.
+
+ * gmon_io.c (gmon_out_read): If BSD44_FORMAT is defined, get the
+ profiling rate from the header.
+
+ * gmon.h (struct raw_phdr): Only include pad if both __alpha__ and
+ __osf__ are defined. Add new fields if BSD44_FORMAT is defined.
+
+ * alpha.h (MIN_INSN_SIZE): Define.
+ * core.c (MIN_INSN_SIZE): If not defined, define as 1.
+ (core_sym_class): Ignore debugging symbols.
+ (core_create_line_syms): Use MIN_INSN_SIZE when gathering line
+ information.
+
+Wed Mar 20 18:15:47 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * cg_print.c (cg_print_function_ordering): Fix __GNUC__ misspelled
+ as __GNU_C__.
+ (order_and_dump_functions_by_arcs): Likewise.
+
+Tue Mar 12 12:19:50 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Rebuild with autoconf 2.8.
+
+Sun Feb 18 15:06:18 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Check for 'do not mix' from native linker before
+ trying to use -rpath.
+ * configure: Rebuild.
+
+Tue Feb 13 15:32:53 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Set HDLFLAGS for *-*-hpux with --enable-shared.
+ * configure: Rebuild.
+
+Wed Feb 7 14:03:17 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Don't set CC. Look for --enable-shared. Set
+ BFDLIB and HLDFLAGS and substitute them.
+ * configure: Rebuild.
+ * Makefile.in (LIBS): Use @BFDLIB@.
+ (HLDFLAGS): New variable.
+ (gprof): Use $(HLDFLAGS).
+
+Mon Feb 5 16:34:44 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ Support for building bfd and opcodes as shared libraries, based on
+ patches from Alan Modra <alan@spri.levels.unisa.edu.au>:
+ * Makefile.in (LIBDEPS): New variable.
+ (LIBS): Use -L../bfd -lbfd.
+ (gprof): Depend upon $(LIBDEPS) rather than $(LIBS).
+
+Sat Dec 30 10:11:03 1995 Jeffrey A Law (law@cygnus.com)
+
+ * gprof.c (long_options): Add "--function-ordering" and
+ "--file-ordering" options.
+ (usage): Add new options to usage message.
+ (main): Handle new options.
+ * gprof.h (STYLE_FUNCTION_ORDER): Define.
+ (STYLE_FILE_ORDER): Define.
+ (function_mapping_file): Declare.
+ * cg_arcs.c (arcs, numarcs): New globals.
+ (arc_add): Put new arcs into the arc array so the function/file
+ ordering code can examine them.
+ * cg_arcs.h (struct arc): New field "has_been_placed".
+ (arcs, numarcs): Declare new globals.
+ * core.c (symbol_map, symbol_map_count): New globals.
+ (read_function_mappings): New function to read in a function
+ to object map file.
+ (core_init): Call read_function_mappings if a function mapping
+ file exists.
+ (core_create_function_syms): Handle function to object file
+ mappings.
+ * symtab.h (struct sym): New fields "mapped", "has_been_placed",
+ "nuses", "prev".
+ * cg_print.c (cmp_arc_count): New function for sorting arcs.
+ (cmp_fun_nuses): Likewise for functions.
+ (cg_print_function_ordering): New function to print a suggested
+ function ordering.
+ (cg_print_file_ordering): Likewise for ordering .o files.
+ (order_and_dump_functions_by_arcs): Helper function for function
+ and object file ordering code.
+
+Sun Dec 24 21:32:27 1995 Jeffrey A Law (law@cygnus.com)
+
+ * core.c (core_sym_class): Ignore symbols without BSF_FUNCTION
+ set if ignore_non_function is set.
+ * gprof.h (ignore_non_functions): Declare.
+ * gprof.c (ignore_non_functions): Define.
+ (long_options): Add "ignore-non-functions".
+ (usage): Add new options.
+ (main): Recognize "-D" and "--ignore-non-functions" option.
+
+Tue Nov 21 13:24:39 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * Makefile.in (.m.c): Strip out directory name from function
+ name.
+
+ * hist.c (scale_and_align_entries): Don't use DEFUN_VOID. Do
+ UNITS_TO_CODE adjustment unconditionally; compiler can optimize
+ away zero-offset case. Refer to scaled_addr, not aligned_addr.
+
+ * vax.c: Don't include vax.h here.
+
+Thu Nov 16 03:41:37 1995 Ken Raeburn <raeburn@cygnus.com>
Version 2.6 released.
diff --git a/gnu/usr.bin/binutils/gprof/Makefile.in b/gnu/usr.bin/binutils/gprof/Makefile.in
index d9a6f24fe77..1f5e0f02a57 100644
--- a/gnu/usr.bin/binutils/gprof/Makefile.in
+++ b/gnu/usr.bin/binutils/gprof/Makefile.in
@@ -40,7 +40,8 @@ SRCS= $(MY_TARGET).c basic_blocks.c call_graph.c \
gmon_io.c gprof.c hertz.c hist.c source.c search_list.c symtab.c \
sym_ids.c utils.c
-LIBS = ../bfd/libbfd.a ../libiberty/libiberty.a
+LIBDEPS = ../bfd/libbfd.a ../libiberty/libiberty.a
+LIBS = @BFDLIB@ ../libiberty/libiberty.a
OBJS= $(MY_TARGET).o basic_blocks.o bsd_callg_bl.o call_graph.o \
cg_arcs.o cg_dfn.o cg_print.o core.o flat_bl.o fsf_callg_bl.o \
@@ -52,6 +53,7 @@ GEN_FILES = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
CFLAGS=-g -DDEBUG
LDFLAGS=
+HLDFLAGS = @HLDFLAGS@
.c.o:
$(CC) -c $(CFLAGS) -I. -I$(srcdir) -I../bfd -I$(srcdir)/../include -I$(srcdir)/../bfd -DMACHINE_H=\"$(MY_TARGET).h\" $(TCFLAGS) $(HCFLAGS) $<
@@ -62,7 +64,7 @@ all: $(GEN_FILES) $(PROG)
.m.c:
awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \
- FUNCTION=`(echo $*|sed -e 's/_bl//')`_blurb \
+ FUNCTION=`(echo $*|sed -e 's,.*/,,g' -e 's/_bl//')`_blurb \
FILE=$*.m $(srcdir)/$*.m
diststuff: $(GEN_FILES) info
@@ -100,8 +102,8 @@ install: all
$(INSTALL_XFORM) gprof $(bindir)/gprof
$(INSTALL_XFORM1) $(srcdir)/gprof.1 $(man1dir)/gprof.1
-gprof: $(OBJS) $(LIBS)
- $(CC) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIBS)
+gprof: $(OBJS) $(LIBDEPS)
+ $(CC) -o $(PROG) $(HLDFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
mostlyclean:
-rm -f *.o core gprof nohup.out \
diff --git a/gnu/usr.bin/binutils/gprof/__bb_exit_func.c b/gnu/usr.bin/binutils/gprof/__bb_exit_func.c
index 512056ed4af..813321566c7 100644
--- a/gnu/usr.bin/binutils/gprof/__bb_exit_func.c
+++ b/gnu/usr.bin/binutils/gprof/__bb_exit_func.c
@@ -54,8 +54,8 @@ __bb_exit_func (void)
perror(OUT_NAME);
return;
} /* if */
- bcopy(GMON_MAGIC, &ghdr.cookie[0], 4);
- bcopy(&version, &ghdr.version, sizeof(version));
+ memcpy(&ghdr.cookie[0], GMON_MAGIC, 4);
+ memcpy(&ghdr.version, &version, sizeof(version));
fwrite(&ghdr, sizeof(ghdr), 1, fp);
for (ptr = __bb_head; ptr != 0; ptr = ptr->next) {
diff --git a/gnu/usr.bin/binutils/gprof/alpha.h b/gnu/usr.bin/binutils/gprof/alpha.h
index 9eb92bc2620..b91324ed8db 100644
--- a/gnu/usr.bin/binutils/gprof/alpha.h
+++ b/gnu/usr.bin/binutils/gprof/alpha.h
@@ -28,4 +28,9 @@
#define OFFSET_TO_CODE 0
#define UNITS_TO_CODE (OFFSET_TO_CODE / sizeof(UNIT))
+/*
+ * Minimum size of an instruction (in bytes):
+ */
+#define MIN_INSN_SIZE 4
+
#endif /* alpha_h */
diff --git a/gnu/usr.bin/binutils/gprof/cg_arcs.c b/gnu/usr.bin/binutils/gprof/cg_arcs.c
index 8b6184b6bcc..b63102948b0 100644
--- a/gnu/usr.bin/binutils/gprof/cg_arcs.c
+++ b/gnu/usr.bin/binutils/gprof/cg_arcs.c
@@ -27,6 +27,8 @@
Sym *cycle_header;
int num_cycles;
+Arc **arcs;
+int numarcs;
/*
* Return TRUE iff PARENT has an arc to covers the address
@@ -65,7 +67,8 @@ void
DEFUN (arc_add, (parent, child, count),
Sym * parent AND Sym * child AND int count)
{
- Arc *arc;
+ static int maxarcs = 0;
+ Arc *arc, **newarcs;
DBG (TALLYDEBUG, printf ("[arc_add] %d arcs from %s to %s\n",
count, parent->name, child->name));
@@ -85,6 +88,37 @@ DEFUN (arc_add, (parent, child, count),
arc->child = child;
arc->count = count;
+ /* If this isn't an arc for a recursive call to parent, then add it
+ to the array of arcs. */
+ if (parent != child)
+ {
+ /* If we've exhausted space in our current array, get a new one
+ and copy the contents. We might want to throttle the doubling
+ factor one day. */
+ if (numarcs == maxarcs)
+ {
+ /* Determine how much space we want to allocate. */
+ if (maxarcs == 0)
+ maxarcs = 1;
+ maxarcs *= 2;
+
+ /* Allocate the new array. */
+ newarcs = (Arc **)xmalloc(sizeof (Arc *) * maxarcs);
+
+ /* Copy the old array's contents into the new array. */
+ memcpy (newarcs, arcs, numarcs * sizeof (Arc *));
+
+ /* Free up the old array. */
+ free (arcs);
+
+ /* And make the new array be the current array. */
+ arcs = newarcs;
+ }
+
+ /* Place this arc in the arc array. */
+ arcs[numarcs++] = arc;
+ }
+
/* prepend this child to the children of this parent: */
arc->next_child = parent->cg.children;
parent->cg.children = arc;
diff --git a/gnu/usr.bin/binutils/gprof/cg_arcs.h b/gnu/usr.bin/binutils/gprof/cg_arcs.h
index 25d5b616737..132ee73667a 100644
--- a/gnu/usr.bin/binutils/gprof/cg_arcs.h
+++ b/gnu/usr.bin/binutils/gprof/cg_arcs.h
@@ -20,6 +20,7 @@ typedef struct arc
double child_time; /* child-time inherited along arc */
struct arc *next_parent; /* next parent of CHILD */
struct arc *next_child; /* next child of PARENT */
+ int has_been_placed; /* have this arc's functions been placed? */
}
Arc;
@@ -29,5 +30,7 @@ extern Sym *cycle_header; /* cycle headers */
extern void arc_add PARAMS ((Sym * parent, Sym * child, int count));
extern Arc *arc_lookup PARAMS ((Sym * parent, Sym * child));
extern Sym **cg_assemble PARAMS ((void));
+extern Arc **arcs;
+extern int numarcs;
#endif /* cg_arcs_h */
diff --git a/gnu/usr.bin/binutils/gprof/cg_print.c b/gnu/usr.bin/binutils/gprof/cg_print.c
index 460bc045c47..015f710ce32 100644
--- a/gnu/usr.bin/binutils/gprof/cg_print.c
+++ b/gnu/usr.bin/binutils/gprof/cg_print.c
@@ -11,6 +11,9 @@
#define EQUALTO 0
#define GREATERTHAN 1
+static void order_and_dump_functions_by_arcs PARAMS ((Arc **, unsigned long,
+ int, Arc **,
+ unsigned long *));
/* declarations of automatically generated functions to output blurbs: */
extern void bsd_callg_blurb PARAMS ((FILE * fp));
extern void fsf_callg_blurb PARAMS ((FILE * fp));
@@ -654,3 +657,616 @@ DEFUN_VOID (cg_print_index)
}
free (name_sorted_syms);
}
+
+/* Compare two arcs based on their usage counts. We want to sort
+ in descending order. */
+static int
+DEFUN (cmp_arc_count, (left, right), const PTR left AND const PTR right)
+{
+ const Arc **npp1 = (const Arc **) left;
+ const Arc **npp2 = (const Arc **) right;
+
+ if ((*npp1)->count > (*npp2)->count)
+ return -1;
+ else if ((*npp1)->count < (*npp2)->count)
+ return 1;
+ else
+ return 0;
+}
+
+/* Compare two funtions based on their usage counts. We want to sort
+ in descending order. */
+static int
+DEFUN (cmp_fun_nuses, (left, right), const PTR left AND const PTR right)
+{
+ const Sym **npp1 = (const Sym **) left;
+ const Sym **npp2 = (const Sym **) right;
+
+ if ((*npp1)->nuses > (*npp2)->nuses)
+ return -1;
+ else if ((*npp1)->nuses < (*npp2)->nuses)
+ return 1;
+ else
+ return 0;
+}
+
+/* Print a suggested function ordering based on the profiling data.
+
+ We perform 4 major steps when ordering functions:
+
+ * Group unused functions together and place them at the
+ end of the function order.
+
+ * Search the highest use arcs (those which account for 90% of
+ the total arc count) for functions which have several parents.
+
+ Group those with the most call sites together (currently the
+ top 1.25% which have at least five different call sites).
+
+ These are emitted at the start of the function order.
+
+ * Use a greedy placement algorithm to place functions which
+ occur in the top 99% of the arcs in the profile. Some provisions
+ are made to handle high usage arcs where the parent and/or
+ child has already been placed.
+
+ * Run the same greedy placement algorithm on the remaining
+ arcs to place the leftover functions.
+
+
+ The various "magic numbers" should (one day) be tuneable by command
+ line options. They were arrived at by benchmarking a few applications
+ with various values to see which values produced better overall function
+ orderings.
+
+ Of course, profiling errors, machine limitations (PA long calls), and
+ poor cutoff values for the placement algorithm may limit the usefullness
+ of the resulting function order. Improvements would be greatly appreciated.
+
+ Suggestions:
+
+ * Place the functions with many callers near the middle of the
+ list to reduce long calls.
+
+ * Propagate arc usage changes as functions are placed. Ie if
+ func1 and func2 are placed together, arcs to/from those arcs
+ to the same parent/child should be combined, then resort the
+ arcs to choose the next one.
+
+ * Implement some global positioning algorithm to place the
+ chains made by the greedy local positioning algorithm. Probably
+ by examining arcs which haven't been placed yet to tie two
+ chains together.
+
+ * Take a function's size and time into account in the algorithm;
+ size in particular is important on the PA (long calls). Placing
+ many small functions onto their own page may be wise.
+
+ * Use better profiling information; many published algorithms
+ are based on call sequences through time, rather than just
+ arc counts.
+
+ * Prodecure cloning could improve performance when a small number
+ of arcs account for most of the calls to a particular function.
+
+ * Use relocation information to avoid moving unused functions
+ completely out of the code stream; this would avoid severe lossage
+ when the profile data bears little resemblance to actual runs.
+
+ * Propagation of arc usages should also improve .o link line
+ ordering which shares the same arc placement algorithm with
+ the function ordering code (in fact it is a degenerate case
+ of function ordering). */
+
+void
+DEFUN_VOID (cg_print_function_ordering)
+{
+ unsigned long index, used, unused, scratch_index;
+ unsigned long unplaced_arc_count, high_arc_count, scratch_arc_count;
+#ifdef __GNUC__
+ unsigned long long total_arcs, tmp_arcs_count;
+#else
+ unsigned long total_arcs, tmp_arcs_count;
+#endif
+ Sym **unused_syms, **used_syms, **scratch_syms;
+ Arc **unplaced_arcs, **high_arcs, **scratch_arcs;
+
+ index = 0;
+ used = 0;
+ unused = 0;
+ scratch_index = 0;
+ unplaced_arc_count = 0;
+ high_arc_count = 0;
+ scratch_arc_count = 0;
+
+ /* First group all the unused functions together. */
+ unused_syms = (Sym **) xmalloc (symtab.len * sizeof (Sym *));
+ used_syms = (Sym **) xmalloc (symtab.len * sizeof (Sym *));
+ scratch_syms = (Sym **) xmalloc (symtab.len * sizeof (Sym *));
+ high_arcs = (Arc **) xmalloc (numarcs * sizeof (Arc *));
+ scratch_arcs = (Arc **) xmalloc (numarcs * sizeof (Arc *));
+ unplaced_arcs = (Arc **) xmalloc (numarcs * sizeof (Arc *));
+
+ /* Walk through all the functions; mark those which are never
+ called as placed (we'll emit them as a group later). */
+ for (index = 0, used = 0, unused = 0; index < symtab.len; index++)
+ {
+ if (symtab.base[index].ncalls == 0)
+ {
+ /* Filter out gprof generated names. */
+ if (strcmp (symtab.base[index].name, "<locore>")
+ && strcmp (symtab.base[index].name, "<hicore>"))
+ {
+ unused_syms[unused++] = &symtab.base[index];
+ symtab.base[index].has_been_placed = 1;
+ }
+ }
+ else
+ {
+ used_syms[used++] = &symtab.base[index];
+ symtab.base[index].has_been_placed = 0;
+ symtab.base[index].next = 0;
+ symtab.base[index].prev = 0;
+ symtab.base[index].nuses = 0;
+ }
+ }
+
+ /* Sort the arcs from most used to least used. */
+ qsort (arcs, numarcs, sizeof (Arc *), cmp_arc_count);
+
+ /* Compute the total arc count. Also mark arcs as unplaced.
+
+ Note we don't compensate for overflow if that happens!
+ Overflow is much less likely when this file is compiled
+ with GCC as it can double-wide integers via long long. */
+ total_arcs = 0;
+ for (index = 0; index < numarcs; index++)
+ {
+ total_arcs += arcs[index]->count;
+ arcs[index]->has_been_placed = 0;
+ }
+
+ /* We want to pull out those functions which are referenced
+ by many highly used arcs and emit them as a group. This
+ could probably use some tuning. */
+ tmp_arcs_count = 0;
+ for (index = 0; index < numarcs; index++)
+ {
+ tmp_arcs_count += arcs[index]->count;
+
+ /* Count how many times each parent and child are used up
+ to our threshhold of arcs (90%). */
+ if ((double)tmp_arcs_count / (double)total_arcs > 0.90)
+ break;
+
+ arcs[index]->child->nuses++;
+ }
+
+ /* Now sort a temporary symbol table based on the number of
+ times each function was used in the highest used arcs. */
+ memcpy (scratch_syms, used_syms, used * sizeof (Sym *));
+ qsort (scratch_syms, used, sizeof (Sym *), cmp_fun_nuses);
+
+ /* Now pick out those symbols we're going to emit as
+ a group. We take up to 1.25% of the used symbols. */
+ for (index = 0; index < used / 80; index++)
+ {
+ Sym *sym = scratch_syms[index];
+ Arc *arc;
+
+ /* If we hit symbols that aren't used from many call sites,
+ then we can quit. We choose five as the low limit for
+ no particular reason. */
+ if (sym->nuses == 5)
+ break;
+
+ /* We're going to need the arcs between these functions.
+ Unfortunately, we don't know all these functions
+ until we're done. So we keep track of all the arcs
+ to the functions we care about, then prune out those
+ which are uninteresting.
+
+ An interesting variation would be to quit when we found
+ multi-call site functions which account for some percentage
+ of the arcs. */
+
+ arc = sym->cg.children;
+ while (arc)
+ {
+ if (arc->parent != arc->child)
+ scratch_arcs[scratch_arc_count++] = arc;
+ arc->has_been_placed = 1;
+ arc = arc->next_child;
+ }
+
+ arc = sym->cg.parents;
+ while (arc)
+ {
+ if (arc->parent != arc->child)
+ scratch_arcs[scratch_arc_count++] = arc;
+ arc->has_been_placed = 1;
+ arc = arc->next_parent;
+ }
+
+ /* Keep track of how many symbols we're going to place. */
+ scratch_index = index;
+
+ /* A lie, but it makes identifying these functions easier
+ later. */
+ sym->has_been_placed = 1;
+ }
+
+ /* Now walk through the temporary arcs and copy those we care about
+ into the high arcs array. */
+ for (index = 0; index < scratch_arc_count; index++)
+ {
+ Arc *arc = scratch_arcs[index];
+
+ /* If this arc refers to highly used functions, then
+ then we want to keep it. */
+ if (arc->child->has_been_placed
+ && arc->parent->has_been_placed)
+ {
+ high_arcs[high_arc_count++] = scratch_arcs[index];
+
+ /* We need to turn of has_been_placed since we're going to
+ use the main arc placement algorithm on these arcs. */
+ arc->child->has_been_placed = 0;
+ arc->parent->has_been_placed = 0;
+ }
+ }
+
+ /* Dump the multi-site high usage functions which are not going
+ to be ordered by the main ordering algorithm. */
+ for (index = 0; index < scratch_index; index++)
+ {
+ if (scratch_syms[index]->has_been_placed)
+ printf ("%s\n", scratch_syms[index]->name);
+ }
+
+ /* Now we can order the multi-site high use functions based on the
+ arcs between them. */
+ qsort (high_arcs, high_arc_count, sizeof (Arc *), cmp_arc_count);
+ order_and_dump_functions_by_arcs (high_arcs, high_arc_count, 1,
+ unplaced_arcs, &unplaced_arc_count);
+
+ /* Order and dump the high use functions left, these typically
+ have only a few call sites. */
+ order_and_dump_functions_by_arcs (arcs, numarcs, 0,
+ unplaced_arcs, &unplaced_arc_count);
+
+ /* Now place the rarely used functions. */
+ order_and_dump_functions_by_arcs (unplaced_arcs, unplaced_arc_count, 1,
+ scratch_arcs, &scratch_arc_count);
+
+ /* Output any functions not emitted by the order_and_dump calls. */
+ for (index = 0; index < used; index++)
+ if (used_syms[index]->has_been_placed == 0)
+ printf("%s\n", used_syms[index]->name);
+
+ /* Output the unused functions. */
+ for (index = 0; index < unused; index++)
+ printf("%s\n", unused_syms[index]->name);
+
+ unused_syms = (Sym **) xmalloc (symtab.len * sizeof (Sym *));
+ used_syms = (Sym **) xmalloc (symtab.len * sizeof (Sym *));
+ scratch_syms = (Sym **) xmalloc (symtab.len * sizeof (Sym *));
+ high_arcs = (Arc **) xmalloc (numarcs * sizeof (Arc *));
+ scratch_arcs = (Arc **) xmalloc (numarcs * sizeof (Arc *));
+ unplaced_arcs = (Arc **) xmalloc (numarcs * sizeof (Arc *));
+
+ free (unused_syms);
+ free (used_syms);
+ free (scratch_syms);
+ free (high_arcs);
+ free (scratch_arcs);
+ free (unplaced_arcs);
+}
+
+/* Place functions based on the arcs in ARCS with NUMARCS entries;
+ place unused arcs into UNPLACED_ARCS/UNPLACED_ARC_COUNT.
+
+ If ALL is nonzero, then place all functions referenced by ARCS,
+ else only place those referenced in the top 99% of the arcs in ARCS. */
+
+#define MOST 0.99
+static void
+order_and_dump_functions_by_arcs (arcs, numarcs, all,
+ unplaced_arcs, unplaced_arc_count)
+ Arc **arcs;
+ unsigned long numarcs;
+ int all;
+ Arc **unplaced_arcs;
+ unsigned long *unplaced_arc_count;
+{
+#ifdef __GNUC__
+ unsigned long long tmp_arcs, total_arcs;
+#else
+ unsigned long tmp_arcs, total_arcs;
+#endif
+ unsigned int index;
+
+ /* If needed, compute the total arc count.
+
+ Note we don't compensate for overflow if that happens! */
+ if (! all)
+ {
+ total_arcs = 0;
+ for (index = 0; index < numarcs; index++)
+ total_arcs += arcs[index]->count;
+ }
+ else
+ total_arcs = 0;
+
+ tmp_arcs = 0;
+ for (index = 0; index < numarcs; index++)
+ {
+ Sym *sym1, *sym2;
+ Sym *child, *parent;
+
+ tmp_arcs += arcs[index]->count;
+
+ /* Ignore this arc if it's already been placed. */
+ if (arcs[index]->has_been_placed)
+ continue;
+
+ child = arcs[index]->child;
+ parent = arcs[index]->parent;
+
+ /* If we're not using all arcs, and this is a rarely used
+ arc, then put it on the unplaced_arc list. Similarly
+ if both the parent and child of this arc have been placed. */
+ if ((! all && (double)tmp_arcs / (double)total_arcs > MOST)
+ || child->has_been_placed || parent->has_been_placed)
+ {
+ unplaced_arcs[(*unplaced_arc_count)++] = arcs[index];
+ continue;
+ }
+
+ /* If all slots in the parent and child are full, then there isn't
+ anything we can do right now. We'll place this arc on the
+ unplaced arc list in the hope that a global positioning
+ algorithm can use it to place function chains. */
+ if (parent->next && parent->prev && child->next && child->prev)
+ {
+ unplaced_arcs[(*unplaced_arc_count)++] = arcs[index];
+ continue;
+ }
+
+ /* If the parent is unattached, then find the closest
+ place to attach it onto child's chain. Similarly
+ for the opposite case. */
+ if (!parent->next && !parent->prev)
+ {
+ int next_count = 0;
+ int prev_count = 0;
+ Sym *prev = child;
+ Sym *next = child;
+
+ /* Walk to the beginning and end of the child's chain. */
+ while (next->next)
+ {
+ next = next->next;
+ next_count++;
+ }
+
+ while (prev->prev)
+ {
+ prev = prev->prev;
+ prev_count++;
+ }
+
+ /* Choose the closest. */
+ child = next_count < prev_count ? next : prev;
+ }
+ else if (! child->next && !child->prev)
+ {
+ int next_count = 0;
+ int prev_count = 0;
+ Sym *prev = parent;
+ Sym *next = parent;
+
+ while (next->next)
+ {
+ next = next->next;
+ next_count++;
+ }
+
+ while (prev->prev)
+ {
+ prev = prev->prev;
+ prev_count++;
+ }
+
+ parent = prev_count < next_count ? prev : next;
+ }
+ else
+ {
+ /* Couldn't find anywhere to attach the functions,
+ put the arc on the unplaced arc list. */
+ unplaced_arcs[(*unplaced_arc_count)++] = arcs[index];
+ continue;
+ }
+
+ /* Make sure we don't tie two ends together. */
+ sym1 = parent;
+ if (sym1->next)
+ while (sym1->next)
+ sym1 = sym1->next;
+ else
+ while (sym1->prev)
+ sym1 = sym1->prev;
+
+ sym2 = child;
+ if (sym2->next)
+ while (sym2->next)
+ sym2 = sym2->next;
+ else
+ while (sym2->prev)
+ sym2 = sym2->prev;
+
+ if (sym1 == child
+ && sym2 == parent)
+ {
+ /* This would tie two ends together. */
+ unplaced_arcs[(*unplaced_arc_count)++] = arcs[index];
+ continue;
+ }
+
+ if (parent->next)
+ {
+ /* Must attach to the parent's prev field. */
+ if (! child->next)
+ {
+ /* parent-prev and child-next */
+ parent->prev = child;
+ child->next = parent;
+ arcs[index]->has_been_placed = 1;
+ }
+ }
+ else if (parent->prev)
+ {
+ /* Must attach to the parent's next field. */
+ if (! child->prev)
+ {
+ /* parent-next and child-prev */
+ parent->next = child;
+ child->prev = parent;
+ arcs[index]->has_been_placed = 1;
+ }
+ }
+ else
+ {
+ /* Can attach to either field in the parent, depends
+ on where we've got space in the child. */
+ if (child->prev)
+ {
+ /* parent-prev and child-next */
+ parent->prev = child;
+ child->next = parent;
+ arcs[index]->has_been_placed = 1;
+ }
+ else
+ {
+ /* parent-next and child-prev */
+ parent->next = child;
+ child->prev = parent;
+ arcs[index]->has_been_placed = 1;
+ }
+ }
+ }
+
+ /* Dump the chains of functions we've made. */
+ for (index = 0; index < numarcs; index++)
+ {
+ Sym *sym;
+ if (arcs[index]->parent->has_been_placed
+ || arcs[index]->child->has_been_placed)
+ continue;
+
+ sym = arcs[index]->parent;
+
+ /* If this symbol isn't attached to any other
+ symbols, then we've got a rarely used arc.
+
+ Skip it for now, we'll deal with them later. */
+ if (sym->next == NULL
+ && sym->prev == NULL)
+ continue;
+
+ /* Get to the start of this chain. */
+ while (sym->prev)
+ sym = sym->prev;
+
+ while (sym)
+ {
+ /* Mark it as placed. */
+ sym->has_been_placed = 1;
+ printf ("%s\n", sym->name);
+ sym = sym->next;
+ }
+ }
+
+ /* If we want to place all the arcs, then output those which weren't
+ placed by the main algorithm. */
+ if (all)
+ for (index = 0; index < numarcs; index++)
+ {
+ Sym *sym;
+ if (arcs[index]->parent->has_been_placed
+ || arcs[index]->child->has_been_placed)
+ continue;
+
+ sym = arcs[index]->parent;
+
+ sym->has_been_placed = 1;
+ printf ("%s\n", sym->name);
+ }
+}
+
+/* Print a suggested .o ordering for files on a link line based
+ on profiling information. This uses the function placement
+ code for the bulk of its work. */
+
+struct function_map {
+ char *function_name;
+ char *file_name;
+};
+
+void
+DEFUN_VOID (cg_print_file_ordering)
+{
+ unsigned long scratch_arc_count, index;
+ Arc **scratch_arcs;
+ extern struct function_map *symbol_map;
+ extern int symbol_map_count;
+ char *last;
+
+ scratch_arc_count = 0;
+
+ scratch_arcs = (Arc **) xmalloc (numarcs * sizeof (Arc *));
+ for (index = 0; index < numarcs; index++)
+ {
+ if (! arcs[index]->parent->mapped
+ || ! arcs[index]->child->mapped)
+ arcs[index]->has_been_placed = 1;
+ }
+
+ order_and_dump_functions_by_arcs (arcs, numarcs, 0,
+ scratch_arcs, &scratch_arc_count);
+
+ /* Output .o's not handled by the main placement algorithm. */
+ for (index = 0; index < symtab.len; index++)
+ {
+ if (symtab.base[index].mapped
+ && ! symtab.base[index].has_been_placed)
+ printf ("%s\n", symtab.base[index].name);
+ }
+
+ /* Now output any .o's that didn't have any text symbols. */
+ last = NULL;
+ for (index = 0; index < symbol_map_count; index++)
+ {
+ int index2;
+
+ /* Don't bother searching if this symbol is the
+ same as the previous one. */
+ if (last && !strcmp (last, symbol_map[index].file_name))
+ continue;
+
+ for (index2 = 0; index2 < symtab.len; index2++)
+ {
+ if (! symtab.base[index2].mapped)
+ continue;
+
+ if (!strcmp (symtab.base[index2].name, symbol_map[index].file_name))
+ break;
+ }
+
+ /* If we didn't find it in the symbol table, then it must be a .o
+ with no text symbols. Output it last. */
+ if (index2 == symtab.len)
+ printf ("%s\n", symbol_map[index].file_name);
+ last = symbol_map[index].file_name;
+ }
+}
diff --git a/gnu/usr.bin/binutils/gprof/cg_print.h b/gnu/usr.bin/binutils/gprof/cg_print.h
index 13511c728a0..782c4aa04c2 100644
--- a/gnu/usr.bin/binutils/gprof/cg_print.h
+++ b/gnu/usr.bin/binutils/gprof/cg_print.h
@@ -8,5 +8,7 @@ extern double print_time; /* total of time being printed */
extern void cg_print PARAMS ((Sym ** cg));
extern void cg_print_index PARAMS ((void));
+extern void cg_print_file_ordering PARAMS ((void));
+extern void cg_print_function_ordering PARAMS ((void));
#endif /* cg_print_h */
diff --git a/gnu/usr.bin/binutils/gprof/configure b/gnu/usr.bin/binutils/gprof/configure
index 2408cbd8f26..282bbe2ebbd 100644
--- a/gnu/usr.bin/binutils/gprof/configure
+++ b/gnu/usr.bin/binutils/gprof/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.4
+# Generated automatically using autoconf version 2.8
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -11,6 +11,8 @@
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
+ac_help="$ac_help
+ --enable-shared build shared BFD library"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -33,9 +35,22 @@ target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
+MFLAGS= MAKEFLAGS=
ac_prev=
for ac_option
@@ -57,9 +72,14 @@ do
case "$ac_option" in
- -build | --build | --buil | --bui | --bu | --b)
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
build="$ac_optarg" ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
@@ -69,6 +89,12 @@ do
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file="$ac_optarg" ;;
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
-disable-* | --disable-*)
ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
# Reject names that are not valid shell variable names.
@@ -119,12 +145,29 @@ Configuration:
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
- --exec-prefix=PREFIX install architecture-dependent files in 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
+ --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]
@@ -136,8 +179,10 @@ Features and packages:
--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
---enable and --with options recognized:$ac_help
EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
exit 0 ;;
-host | --host | --hos | --ho)
@@ -145,6 +190,44 @@ EOF
-host=* | --host=* | --hos=* | --ho=*)
host="$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" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ 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" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
@@ -157,6 +240,15 @@ EOF
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
@@ -197,6 +289,23 @@ EOF
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
@@ -207,6 +316,13 @@ EOF
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
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" ;;
+
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
@@ -216,7 +332,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.4"
+ echo "configure generated by autoconf version 2.8"
exit 0 ;;
-with-* | --with-*)
@@ -262,7 +378,7 @@ EOF
-*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
;;
- *)
+ *)
if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
echo "configure: warning: $ac_option: invalid host type" 1>&2
fi
@@ -382,8 +498,8 @@ 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 2>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5'
+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'
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
@@ -399,7 +515,17 @@ fi
-CC=${CC-cc}
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ case "${enableval}" in
+ yes) shared=true ;;
+ no) shared=false ;;
+ *bfd*) shared=true ;;
+ *) shared=false ;;
+esac
+fi
+
# 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
@@ -418,7 +544,6 @@ else
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc"
fi
fi
CC="$ac_cv_prog_CC"
@@ -428,6 +553,55 @@ else
echo "$ac_t""no" 1>&6
fi
+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
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ ac_prog_rejected=no
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
@@ -438,12 +612,13 @@ else
yes;
#endif
EOF
-if ${CC-cc} -E conftest.c 2>&5 | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:616: \"$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
fi
fi
+
echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test $ac_cv_prog_gcc = yes; then
GCC=yes
@@ -461,7 +636,8 @@ fi
rm -f conftest*
fi
- echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
+
+echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
if test $ac_cv_prog_gcc_g = yes; then
CFLAGS="-g -O"
else
@@ -500,7 +676,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
#
# The rules are:
# 1. You are not allowed to specify --host, --target, and nonopt at the
-# same time.
+# same time.
# 2. Host defaults to nonopt.
# 3. If nonopt is not specified, then host defaults to the current host,
# as determined by config.guess.
@@ -582,8 +758,10 @@ test "$host_alias" != "$target_alias" &&
if test "$program_transform_name" = s,x,x,; then
program_transform_name=
else
- # Double any \ or $.
- echo 's,\\,\\\\,g; s,\$,$$,g' > conftestsed
+ # Double any \ or $. echo might interpret backslashes.
+ cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
rm -f conftestsed
fi
@@ -603,11 +781,70 @@ i[345]86-*-*) MY_TARGET=i386 ;;
sparc-*-*) MY_TARGET=sparc ;;
tahoe-*-*) MY_TARGET=tahoe ;;
vax-*-*) MY_TARGET=vax ;;
-ns32k-*-*|*-pc532-*) MY_TARGET=ns532;;
+ns32k-*-*) MY_TARGET=ns532;;
*-*-*) MY_TARGET=dummy ;;
esac
+
+BFDLIB='-L../bfd -lbfd'
+
+# We need to handle some special cases if BFD was built shared.
+if test "${shared}" = "true"; then
+ case "${host}" in
+ *-*-sunos*)
+ # On SunOS, we must link against the name we are going to install,
+ # not -lbfd, since SunOS does not support SONAME.
+ BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
+ ;;
+ esac
+fi
+
+
+HLDFLAGS=
+# If we have shared libraries, try to set rpath reasonably.
+if test "${shared}" = "true"; then
+ case "${host}" in
+ *-*-hpux*)
+ HLDFLAGS='-Wl,+s,+b,$(libdir)'
+ ;;
+ *-*-irix5*)
+ HLDFLAGS='-Wl,-rpath,$(libdir)'
+ ;;
+ *-*-linux*aout*)
+ ;;
+ *-*-linux*)
+ HLDFLAGS='-Wl,-rpath,$(libdir)'
+ ;;
+ *-*-sysv4* | *-*-solaris*)
+ HLDFLAGS='-R $(libdir)'
+ ;;
+ esac
+fi
+
+# On SunOS, if the linker supports the -rpath option, use it to
+# prevent ../bfd and ../opcodes from being included in the run time
+# search path.
+case "${host}" in
+ *-*-sunos*)
+ echo 'main () { }' > conftest.c
+ ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
+ if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
+ :
+ elif grep 'No such file' conftest.t >/dev/null 2>&1; then
+ :
+ elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
+ :
+ elif test "${shared}" = "true"; then
+ HLDFLAGS='-Wl,-rpath=$(libdir)'
+ else
+ HLDFLAGS='-Wl,-rpath='
+ fi
+ rm -f conftest.t conftest.c conftest
+ ;;
+esac
+
+
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@@ -661,7 +898,7 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
# 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%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
s%\[%\\&%g
s%\]%\\&%g
@@ -696,7 +933,7 @@ do
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.4"
+ echo "$CONFIG_STATUS generated by autoconf version 2.8"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -707,10 +944,12 @@ done
ac_given_srcdir=$srcdir
trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
-# 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
+# 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%@CFLAGS@%$CFLAGS%g
@@ -722,6 +961,18 @@ 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%@CC@%$CC%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
@@ -739,6 +990,8 @@ s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@MY_TARGET@%$MY_TARGET%g
+s%@BFDLIB@%$BFDLIB%g
+s%@HLDFLAGS@%$HLDFLAGS%g
CEOF
EOF
diff --git a/gnu/usr.bin/binutils/gprof/configure.in b/gnu/usr.bin/binutils/gprof/configure.in
index 7849a858962..4b0a616b59a 100644
--- a/gnu/usr.bin/binutils/gprof/configure.in
+++ b/gnu/usr.bin/binutils/gprof/configure.in
@@ -2,7 +2,15 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.3)dnl
AC_INIT(gprof.c)
-CC=${CC-cc}
+AC_ARG_ENABLE(shared,
+[ --enable-shared build shared BFD library],
+[case "${enableval}" in
+ yes) shared=true ;;
+ no) shared=false ;;
+ *bfd*) shared=true ;;
+ *) shared=false ;;
+esac])dnl
+
AC_PROG_CC
AC_CANONICAL_SYSTEM
@@ -21,4 +29,63 @@ ns32k-*-*) MY_TARGET=ns532;;
esac
AC_SUBST(MY_TARGET)
+
+BFDLIB='-L../bfd -lbfd'
+
+# We need to handle some special cases if BFD was built shared.
+if test "${shared}" = "true"; then
+ case "${host}" in
+ *-*-sunos*)
+ # On SunOS, we must link against the name we are going to install,
+ # not -lbfd, since SunOS does not support SONAME.
+ BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
+ ;;
+ esac
+fi
+AC_SUBST(BFDLIB)
+
+HLDFLAGS=
+# If we have shared libraries, try to set rpath reasonably.
+if test "${shared}" = "true"; then
+ case "${host}" in
+ *-*-hpux*)
+ HLDFLAGS='-Wl,+s,+b,$(libdir)'
+ ;;
+ *-*-irix5*)
+ HLDFLAGS='-Wl,-rpath,$(libdir)'
+ ;;
+ *-*-linux*aout*)
+ ;;
+ *-*-linux*)
+ HLDFLAGS='-Wl,-rpath,$(libdir)'
+ ;;
+ *-*-sysv4* | *-*-solaris*)
+ HLDFLAGS='-R $(libdir)'
+ ;;
+ esac
+fi
+
+# On SunOS, if the linker supports the -rpath option, use it to
+# prevent ../bfd and ../opcodes from being included in the run time
+# search path.
+case "${host}" in
+ *-*-sunos*)
+ echo 'main () { }' > conftest.c
+ ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
+ if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
+ :
+ elif grep 'No such file' conftest.t >/dev/null 2>&1; then
+ :
+ elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
+ :
+ elif test "${shared}" = "true"; then
+ HLDFLAGS='-Wl,-rpath=$(libdir)'
+ else
+ HLDFLAGS='-Wl,-rpath='
+ fi
+ rm -f conftest.t conftest.c conftest
+ ;;
+esac
+AC_SUBST(HLDFLAGS)
+
AC_OUTPUT(Makefile)
diff --git a/gnu/usr.bin/binutils/gprof/core.c b/gnu/usr.bin/binutils/gprof/core.c
index 19c6e590f99..3117599eba0 100644
--- a/gnu/usr.bin/binutils/gprof/core.c
+++ b/gnu/usr.bin/binutils/gprof/core.c
@@ -3,12 +3,111 @@
#include "core.h"
#include "symtab.h"
+#ifndef MIN_INSN_SIZE
+/* If not defined in MACHINE_H, assume smallest instruction is 1 byte
+ long. THis is safe but may be needlessly slow on machines where
+ all instructions are longer. */
+#define MIN_INSN_SIZE 1
+#endif
+
bfd *core_bfd;
int core_num_syms;
asymbol **core_syms;
asection *core_text_sect;
PTR core_text_space;
+/* For mapping symbols to specific .o files during file ordering. */
+struct function_map {
+ char *function_name;
+ char *file_name;
+};
+
+struct function_map *symbol_map;
+int symbol_map_count;
+
+static void
+DEFUN (read_function_mappings, (filename), const char *filename)
+{
+ FILE *file = fopen (filename, "r");
+ char dummy[1024];
+ int count = 0;
+
+ if (!file)
+ {
+ fprintf (stderr, "%s: could not open %s.\n", whoami, filename);
+ done (1);
+ }
+
+ /* First parse the mapping file so we know how big we need to
+ make our tables. We also do some sanity checks at this
+ time. */
+ while (!feof (file))
+ {
+ int matches;
+
+ matches = fscanf (file, "%[^\n:]", dummy);
+ if (!matches)
+ {
+ fprintf (stderr, "%s: unable to parse mapping file %s.\n",
+ whoami, filename);
+ done (1);
+ }
+
+ /* Just skip messages about files with no symbols. */
+ if (!strncmp (dummy, "No symbols in ", 14))
+ {
+ fscanf (file, "\n");
+ continue;
+ }
+
+ /* Don't care what else is on this line at this point. */
+ fscanf (file, "%[^\n]\n", dummy);
+ count++;
+ }
+
+ /* Now we know how big we need to make our table. */
+ symbol_map = xmalloc (count * sizeof (struct function_map));
+
+ /* Rewind the input file so we can read it again. */
+ rewind (file);
+
+ /* Read each entry and put it into the table. */
+ count = 0;
+ while (!feof (file))
+ {
+ int matches;
+ char *tmp;
+
+ matches = fscanf (file, "%[^\n:]", dummy);
+ if (!matches)
+ {
+ fprintf (stderr, "%s: unable to parse mapping file %s.\n",
+ whoami, filename);
+ done (1);
+ }
+
+ /* Just skip messages about files with no symbols. */
+ if (!strncmp (dummy, "No symbols in ", 14))
+ {
+ fscanf (file, "\n");
+ continue;
+ }
+
+ /* dummy has the filename, go ahead and copy it. */
+ symbol_map[count].file_name = xmalloc (strlen (dummy) + 1);
+ strcpy (symbol_map[count].file_name, dummy);
+
+ /* Now we need the function name. */
+ fscanf (file, "%[^\n]\n", dummy);
+ tmp = strrchr (dummy, ' ') + 1;
+ symbol_map[count].function_name = xmalloc (strlen (tmp) + 1);
+ strcpy (symbol_map[count].function_name, tmp);
+ count++;
+ }
+
+ /* Record the size of the map table for future reference. */
+ symbol_map_count = count;
+}
void
DEFUN (core_init, (a_out_name), const char *a_out_name)
@@ -59,6 +158,9 @@ DEFUN (core_init, (a_out_name), const char *a_out_name)
bfd_errmsg (bfd_get_error ()));
done (1);
}
+
+ if (function_mapping_file)
+ read_function_mappings (function_mapping_file);
}
@@ -104,15 +206,15 @@ DEFUN (core_sym_class, (sym), asymbol * sym)
char sym_prefix;
int i;
- /*
- * Must be a text symbol, and static text symbols don't qualify if
- * ignore_static_funcs set.
- */
- if (!sym->section)
+ if (sym->section == NULL || (sym->flags & BSF_DEBUGGING) != 0)
{
return 0;
}
+ /*
+ * Must be a text symbol, and static text symbols don't qualify if
+ * ignore_static_funcs set.
+ */
if (ignore_static_funcs && (sym->flags & BSF_LOCAL))
{
DBG (AOUTDEBUG, printf ("[core_sym_class] %s: not a function\n",
@@ -168,7 +270,7 @@ DEFUN (core_sym_class, (sym), asymbol * sym)
* other systems. Perhaps it should be made configurable.
*/
sym_prefix = bfd_get_symbol_leading_char (core_bfd);
- if (sym_prefix && sym_prefix != sym->name[0]
+ if ((sym_prefix && sym_prefix != sym->name[0])
/*
* GCC may add special symbols to help gdb figure out the file
* language. We want to ignore these, since sometimes they mask
@@ -179,6 +281,12 @@ DEFUN (core_sym_class, (sym), asymbol * sym)
{
return 0;
}
+
+ /* If the object file supports marking of function symbols, then we can
+ zap anything that doesn't have BSF_FUNCTION set. */
+ if (ignore_non_functions && (sym->flags & BSF_FUNCTION) == 0)
+ return 0;
+
return 't'; /* it's a static text symbol */
}
@@ -224,9 +332,8 @@ void
DEFUN (core_create_function_syms, (core_bfd), bfd * core_bfd)
{
bfd_vma min_vma = ~0, max_vma = 0;
- const char *filename, *func_name;
int class;
- long i;
+ long i, j, found, skip;
/* pass 1 - determine upper bound on number of function names: */
symtab.len = 0;
@@ -236,7 +343,24 @@ DEFUN (core_create_function_syms, (core_bfd), bfd * core_bfd)
{
continue;
}
- ++symtab.len;
+
+ /* This should be replaced with a binary search or hashed
+ search. Gross.
+
+ Don't create a symtab entry for a function that has
+ a mapping to a file, unless it's the first function
+ in the file. */
+ skip = 0;
+ for (j = 0; j < symbol_map_count; j++)
+ if (!strcmp (core_syms[i]->name, symbol_map[j].function_name))
+ {
+ if (j > 0 && ! strcmp (symbol_map [j].file_name,
+ symbol_map [j - 1].file_name))
+ skip = 1;
+ break;
+ }
+ if (!skip)
+ ++symtab.len;
}
if (symtab.len == 0)
@@ -261,13 +385,41 @@ DEFUN (core_create_function_syms, (core_bfd), bfd * core_bfd)
core_syms[i]->value, core_syms[i]->name));
continue;
}
+ /* This should be replaced with a binary search or hashed
+ search. Gross. */
+
+ skip = 0;
+ found = 0;
+ for (j = 0; j < symbol_map_count; j++)
+ if (!strcmp (core_syms[i]->name, symbol_map[j].function_name))
+ {
+ if (j > 0 && ! strcmp (symbol_map [j].file_name,
+ symbol_map [j - 1].file_name))
+ skip = 1;
+ else
+ found = j;
+ break;
+ }
+
+ if (skip)
+ continue;
sym_init (symtab.limit);
/* symbol offsets are always section-relative: */
symtab.limit->addr = core_syms[i]->value + core_syms[i]->section->vma;
- symtab.limit->name = core_syms[i]->name;
+ if (symbol_map_count
+ && !strcmp (core_syms[i]->name, symbol_map[found].function_name))
+ {
+ symtab.limit->name = symbol_map[found].file_name;
+ symtab.limit->mapped = 1;
+ }
+ else
+ {
+ symtab.limit->name = core_syms[i]->name;
+ symtab.limit->mapped = 0;
+ }
#ifdef __osf__
/*
@@ -278,24 +430,28 @@ DEFUN (core_create_function_syms, (core_bfd), bfd * core_bfd)
* labels do not appear in the symbol table info, so this isn't
* necessary.
*/
- if (get_src_info (symtab.limit->addr, &filename, &func_name,
- &symtab.limit->line_num))
- {
- symtab.limit->file = source_file_lookup_path (filename);
-
- if (strcmp (symtab.limit->name, func_name) != 0)
- {
- /*
- * The symbol's address maps to a different name, so
- * it can't be a function-entry point. This happens
- * for labels, for example.
- */
- DBG (AOUTDEBUG,
- printf ("[core_create_function_syms: rej %s (maps to %s)\n",
- symtab.limit->name, func_name));
- continue;
- }
- }
+ {
+ const char *filename, *func_name;
+
+ if (get_src_info (symtab.limit->addr, &filename, &func_name,
+ &symtab.limit->line_num))
+ {
+ symtab.limit->file = source_file_lookup_path (filename);
+
+ if (strcmp (symtab.limit->name, func_name) != 0)
+ {
+ /*
+ * The symbol's address maps to a different name, so
+ * it can't be a function-entry point. This happens
+ * for labels, for example.
+ */
+ DBG (AOUTDEBUG,
+ printf ("[core_create_function_syms: rej %s (maps to %s)\n",
+ symtab.limit->name, func_name));
+ continue;
+ }
+ }
+ }
#endif
symtab.limit->is_func = TRUE;
@@ -384,7 +540,7 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
prev_offset = -min_dist;
prev_filename[0] = '\0';
prev_line_num = 0;
- for (offset = 0; offset < core_text_sect->_raw_size; ++offset)
+ for (offset = 0; offset < core_text_sect->_raw_size; offset += MIN_INSN_SIZE)
{
vma = core_text_sect->vma + offset;
if (!get_src_info (vma, &filename, &dummy.name, &dummy.line_num)
diff --git a/gnu/usr.bin/binutils/gprof/gmon.h b/gnu/usr.bin/binutils/gprof/gmon.h
index 74cd4b8c552..488f11ef8af 100644
--- a/gnu/usr.bin/binutils/gprof/gmon.h
+++ b/gnu/usr.bin/binutils/gprof/gmon.h
@@ -40,12 +40,17 @@ struct raw_phdr
char low_pc[sizeof (bfd_vma)]; /* base pc address of sample buffer */
char high_pc[sizeof (bfd_vma)]; /* max pc address of sampled buffer */
char ncnt[4]; /* size of sample buffer (plus this header) */
-#ifdef __osf__
+
+#if defined (__alpha__) && defined (__osf__)
/*
* DEC's OSF v3.0 uses 4 bytes of padding to bring the header to
* a size that is a multiple of 8.
*/
char pad[4];
+#elif defined (BSD44_FORMAT)
+ char version[4]; /* version number */
+ char profrate[4]; /* profiling clock rate */
+ char spare[3*4]; /* reserved */
#endif
};
diff --git a/gnu/usr.bin/binutils/gprof/gmon_io.c b/gnu/usr.bin/binutils/gprof/gmon_io.c
index 82c3caa37ae..1f0e1acbf24 100644
--- a/gnu/usr.bin/binutils/gprof/gmon_io.c
+++ b/gnu/usr.bin/binutils/gprof/gmon_io.c
@@ -180,9 +180,27 @@ DEFUN (gmon_out_read, (filename), const char *filename)
filename);
done (1);
}
- tmp.low_pc = get_vma (core_bfd, (bfd_byte *) & raw.low_pc[0]);
- tmp.high_pc = get_vma (core_bfd, (bfd_byte *) & raw.high_pc[0]);
- tmp.ncnt = bfd_get_32 (core_bfd, (bfd_byte *) & raw.ncnt[0]);
+ tmp.low_pc = get_vma (core_bfd, (bfd_byte *) &raw.low_pc[0]);
+ tmp.high_pc = get_vma (core_bfd, (bfd_byte *) &raw.high_pc[0]);
+ tmp.ncnt = bfd_get_32 (core_bfd, (bfd_byte *) &raw.ncnt[0]);
+
+#ifdef BSD44_FORMAT
+ {
+ int profrate;
+
+ profrate = bfd_get_32 (core_bfd, (bfd_byte *) &raw.version[0]);
+ if (!s_highpc)
+ hz = profrate;
+ else if (hz != profrate)
+ {
+ fprintf (stderr,
+ "%s: profiling rate incompatible with first gmon file\n",
+ filename);
+ done (1);
+ }
+ }
+#endif
+
if (s_highpc && (tmp.low_pc != h.low_pc ||
tmp.high_pc != h.high_pc || tmp.ncnt != h.ncnt))
{
diff --git a/gnu/usr.bin/binutils/gprof/gprof.c b/gnu/usr.bin/binutils/gprof/gprof.c
index 5da3180a93e..e99f2d25caf 100644
--- a/gnu/usr.bin/binutils/gprof/gprof.c
+++ b/gnu/usr.bin/binutils/gprof/gprof.c
@@ -33,6 +33,7 @@
#define VERSION "2.6"
const char *whoami;
+const char *function_mapping_file;
const char *a_out_name = A_OUTNAME;
long hz = HZ_WRONG;
@@ -50,6 +51,7 @@ bool ignore_zeros = TRUE;
bool line_granularity = FALSE;
bool print_descriptions = TRUE;
bool print_path = FALSE;
+bool ignore_non_functions = FALSE;
File_Format file_format = FF_AUTO;
bool first_output = TRUE;
@@ -67,7 +69,7 @@ bfd *abfd;
*/
static char *default_excluded_list[] =
{
- "_gprof_mcount", "mcount", "_mcount", "__mcleanup",
+ "_gprof_mcount", "mcount", "_mcount", "__mcount", "__mcleanup",
"<locore>", "<hicore>",
0
};
@@ -76,6 +78,7 @@ static struct option long_options[] =
{
{"line", no_argument, 0, 'l'},
{"no-static", no_argument, 0, 'a'},
+ {"ignore-non-functions", no_argument, 0, 'D'},
/* output styles: */
@@ -87,6 +90,8 @@ static struct option long_options[] =
{"no-graph", optional_argument, 0, 'Q'},
{"exec-counts", optional_argument, 0, 'C'},
{"no-exec-counts", optional_argument, 0, 'Z'},
+ {"function-ordering", no_argument, 0, 'r'},
+ {"file-ordering", required_argument, 0, 'R'},
{"file-info", no_argument, 0, 'i'},
{"sum", no_argument, 0, 's'},
@@ -129,16 +134,17 @@ static void
DEFUN (usage, (stream, status), FILE * stream AND int status)
{
fprintf (stream, "\
-Usage: %s [-[abchilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]\n\
+Usage: %s [-[abcDhilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]\n\
[-d[num]] [-k from/to] [-m min-count] [-t table-length]\n\
[--[no-]annotated-source[=name]] [--[no-]exec-counts[=name]]\n\
[--[no-]flat-profile[=name]] [--[no-]graph[=name]]\n\
[--[no-]time=name] [--all-lines] [--brief] [--debug[=level]]\n\
+ [--function-ordering] [--file-ordering]\n\
[--directory-path=dirs] [--display-unused-functions]\n\
[--file-format=name] [--file-info] [--help] [--line] [--min-count=n]\n\
[--no-static] [--print-path] [--separate-files]\n\
[--static-call-graph] [--sum] [--table-length=len] [--traditional]\n\
- [--version] [--width=n]\n\
+ [--version] [--width=n] [--ignore-non-functions]\n\
[image-file] [profile-file...]\n",
whoami);
done (status);
@@ -156,7 +162,7 @@ DEFUN (main, (argc, argv), int argc AND char **argv)
xmalloc_set_program_name (whoami);
while ((ch = getopt_long (argc, argv,
- "aA::bBcCd::e:E:f:F:hiI:J::k:lLm:n::N::O:p::P::q::Q::st:Tvw:xyzZ::",
+ "aA::bBcCdD::e:E:f:F:hiI:J::k:lLm:n::N::O:p::P::q::Q::st:Tvw:xyzZ::",
long_options, 0))
!= EOF)
{
@@ -206,6 +212,9 @@ DEFUN (main, (argc, argv), int argc AND char **argv)
printf ("%s: debugging not supported; -d ignored\n", whoami);
#endif /* DEBUG */
break;
+ case 'D':
+ ignore_non_functions = TRUE;
+ break;
case 'E':
sym_id_add (optarg, EXCL_TIME);
case 'e':
@@ -317,6 +326,15 @@ DEFUN (main, (argc, argv), int argc AND char **argv)
output_style |= STYLE_CALL_GRAPH;
user_specified |= STYLE_CALL_GRAPH;
break;
+ case 'r':
+ output_style |= STYLE_FUNCTION_ORDER;
+ user_specified |= STYLE_FUNCTION_ORDER;
+ break;
+ case 'R':
+ output_style |= STYLE_FILE_ORDER;
+ user_specified |= STYLE_FILE_ORDER;
+ function_mapping_file = optarg;
+ break;
case 'Q':
if (optarg)
{
@@ -386,6 +404,16 @@ DEFUN (main, (argc, argv), int argc AND char **argv)
}
}
+ /* Don't allow both ordering options, they modify the arc data in-place. */
+ if ((user_specified & STYLE_FUNCTION_ORDER)
+ && (user_specified & STYLE_FILE_ORDER))
+ {
+ fprintf (stderr,"\
+%s: Only one of --function-ordering and --file-ordering may be specified.\n",
+ whoami);
+ done (1);
+ }
+
/* append value of GPROF_PATH to source search list if set: */
str = (char *) getenv ("GPROF_PATH");
if (str)
@@ -409,7 +437,7 @@ DEFUN (main, (argc, argv), int argc AND char **argv)
{
sym_id_add (*sp, EXCL_TIME);
sym_id_add (*sp, EXCL_GRAPH);
-#ifdef __osf__
+#ifdef __alpha__
sym_id_add (*sp, EXCL_FLAT);
#endif
}
@@ -576,6 +604,14 @@ DEFUN (main, (argc, argv), int argc AND char **argv)
{
print_annotated_source ();
}
+ if (output_style & STYLE_FUNCTION_ORDER)
+ {
+ cg_print_function_ordering ();
+ }
+ if (output_style & STYLE_FILE_ORDER)
+ {
+ cg_print_file_ordering ();
+ }
return 0;
}
diff --git a/gnu/usr.bin/binutils/gprof/gprof.h b/gnu/usr.bin/binutils/gprof/gprof.h
index e4177a9a0bb..c61886a4803 100644
--- a/gnu/usr.bin/binutils/gprof/gprof.h
+++ b/gnu/usr.bin/binutils/gprof/gprof.h
@@ -79,6 +79,8 @@
#define STYLE_EXEC_COUNTS (1<<3)
#define STYLE_ANNOTATED_SOURCE (1<<4)
#define STYLE_GMON_INFO (1<<5)
+#define STYLE_FUNCTION_ORDER (1<<6)
+#define STYLE_FILE_ORDER (1<<7)
#define ANYDEBUG (1<<0) /* 1 */
#define DFNDEBUG (1<<1) /* 2 */
@@ -111,6 +113,7 @@ typedef int bool;
typedef unsigned char UNIT[2]; /* unit of profiling */
extern const char *whoami; /* command-name, for error messages */
+extern const char *function_mapping_file; /* file mapping functions to files */
extern const char *a_out_name; /* core filename */
extern long hz; /* ticks per second */
@@ -128,6 +131,8 @@ extern bool ignore_zeros; /* ignore unused symbols/files */
extern bool line_granularity; /* function or line granularity? */
extern bool print_descriptions; /* output profile description */
extern bool print_path; /* print path or just filename? */
+extern bool ignore_non_functions;/* Ignore non-function symbols. */
+
extern File_Format file_format; /* requested file format */
extern bool first_output; /* no output so far? */
diff --git a/gnu/usr.bin/binutils/gprof/gprof.texi b/gnu/usr.bin/binutils/gprof/gprof.texi
index ba05b594d65..bb1490de7e5 100644
--- a/gnu/usr.bin/binutils/gprof/gprof.texi
+++ b/gnu/usr.bin/binutils/gprof/gprof.texi
@@ -294,6 +294,12 @@ function that was loaded directly before it in the executable file.
@c This is compatible with Unix @code{gprof}, but a bad idea.
This option affects both the flat profile and the call graph.
+@item -D
+The @samp{-D} option causes @code{gprof} to ignore symbols which
+are not known to be functions. This option will give more accurate
+profile data on systems where it is supported (Solaris and HPUX for
+example).
+
@item -e @var{function_name}
The @samp{-e @var{function}} option tells @code{gprof} to not print
information about the function @var{function_name} (and its
@@ -388,6 +394,46 @@ cumulative data in the file @file{gmon.sum}.
@item -T
The @samp{-T} option causes @code{gprof} to print its output in
``traditional'' BSD style.
+
+@item --function-ordering
+The @samp{--function-ordering} option causes @code{gprof} to print a
+suggested function ordering for the program based on profiling data.
+This option suggests an ordering which may improve paging, tlb and
+cache behavior for the program on systems which support arbitrary
+ordering of functions in an executable.
+
+The exact details of how to force the linker to place functions
+in a particular order is system dependent and out of the scope of this
+manual.
+
+@item --file-ordering @var{map_file}
+The @samp{--file-ordering} option causes @code{gprof} to print a
+suggested .o link line ordering for the program based on profiling data.
+This option suggests an ordering which may improve paging, tlb and
+cache behavior for the program on systems which do not support arbitrary
+ordering of functions in an executable.
+
+Use of the @samp{-a} argument is highly recommended with this option.
+
+The @var{map_file} argument is a pathname to a file which provides
+function name to object file mappings. The format of the file is similar to
+the output of the program @code{nm}.
+
+@smallexample
+@group
+c-parse.o:00000000 T yyparse
+c-parse.o:00000004 C yyerrflag
+c-lang.o:00000000 T maybe_objc_method_name
+c-lang.o:00000000 T print_lang_statistics
+c-lang.o:00000000 T recognize_objc_keyword
+c-decl.o:00000000 T print_lang_identifier
+c-decl.o:00000000 T print_lang_type
+@dots{}
+
+@end group
+@end smallexample
+
+GNU @code{nm} @samp{--extern-only} @samp{--defined-only} @samp{-v} @samp{--print-file-name} can be used to create @var{map_file}.
@end table
@node Flat Profile
diff --git a/gnu/usr.bin/binutils/gprof/hist.c b/gnu/usr.bin/binutils/gprof/hist.c
index 69cc3ea004a..717424d5791 100644
--- a/gnu/usr.bin/binutils/gprof/hist.c
+++ b/gnu/usr.bin/binutils/gprof/hist.c
@@ -210,28 +210,25 @@ DEFUN (hist_write_hist, (ofp, filename), FILE * ofp AND const char *filename)
* next bin.
*/
static void
-DEFUN_VOID (scale_and_align_entries)
+scale_and_align_entries ()
{
Sym *sym;
-#if OFFSET_TO_CODE > 0
bfd_vma bin_of_entry;
bfd_vma bin_of_code;
-#endif
for (sym = symtab.base; sym < symtab.limit; sym++)
{
sym->hist.scaled_addr = sym->addr / sizeof (UNIT);
-#if OFFSET_TO_CODE > 0
bin_of_entry = (sym->hist.scaled_addr - lowpc) / hist_scale;
bin_of_code = (sym->hist.scaled_addr + UNITS_TO_CODE - lowpc) / hist_scale;
if (bin_of_entry < bin_of_code)
{
DBG (SAMPLEDEBUG,
printf ("[scale_and_align_entries] pushing 0x%lx to 0x%lx\n",
- sym->hist.scaled_addr, sym->aligned_addr + UNITS_TO_CODE));
- sym->aligned_addr += UNITS_TO_CODE;
+ sym->hist.scaled_addr,
+ sym->hist.scaled_addr + UNITS_TO_CODE));
+ sym->hist.scaled_addr += UNITS_TO_CODE;
}
-#endif /* OFFSET_TO_CODE > 0 */
}
}
diff --git a/gnu/usr.bin/binutils/gprof/symtab.c b/gnu/usr.bin/binutils/gprof/symtab.c
index 6fd48c3c8f5..b38ae6a62de 100644
--- a/gnu/usr.bin/binutils/gprof/symtab.c
+++ b/gnu/usr.bin/binutils/gprof/symtab.c
@@ -93,10 +93,10 @@ DEFUN (symtab_finalize, (tab), Sym_Table * tab)
* symbols (such as __gnu_compiled, __c89_used, etc.).
*/
if ((!src->is_static && dst[-1].is_static)
- || ((src->is_static == dst[-1].is_static) &&
- (src->name[0] != '_' && dst[-1].name[0] == '_')
- || (src->name[0]
- && src->name[1] != '_' && dst[-1].name[1] == '_')))
+ || ((src->is_static == dst[-1].is_static)
+ && ((src->name[0] != '_' && dst[-1].name[0] == '_')
+ || (src->name[0]
+ && src->name[1] != '_' && dst[-1].name[1] == '_'))))
{
DBG (AOUTDEBUG | IDDEBUG,
printf ("[symtab_finalize] favor %s@%c%c over %s@%c%c",
diff --git a/gnu/usr.bin/binutils/gprof/symtab.h b/gnu/usr.bin/binutils/gprof/symtab.h
index 07c7751ed6d..304e6b5c020 100644
--- a/gnu/usr.bin/binutils/gprof/symtab.h
+++ b/gnu/usr.bin/binutils/gprof/symtab.h
@@ -36,9 +36,14 @@ typedef struct sym
int line_num; /* source line number */
unsigned int is_func:1, /* is this a function entry point? */
is_static:1, /* is this a local (static) symbol? */
- is_bb_head:1; /* is this the head of a basic-blk? */
+ is_bb_head:1, /* is this the head of a basic-blk? */
+ mapped:1, /* this symbol was mapped to another name */
+ has_been_placed:1; /* have we placed this symbol? */
int ncalls; /* how many times executed */
+ int nuses; /* how many times this symbol appears in
+ a particular context */
struct sym *next; /* for building chains of syms */
+ struct sym *prev; /* for building chains of syms */
/* profile-specific information: */
diff --git a/gnu/usr.bin/binutils/gprof/vax.c b/gnu/usr.bin/binutils/gprof/vax.c
index 9d7fa835d00..6a1034c82d3 100644
--- a/gnu/usr.bin/binutils/gprof/vax.c
+++ b/gnu/usr.bin/binutils/gprof/vax.c
@@ -21,7 +21,6 @@
#include "core.h"
#include "hist.h"
#include "symtab.h"
-#include "vax.h"
/*
* A symbol to be the child of indirect calls:
diff --git a/gnu/usr.bin/binutils/ld/ChangeLog b/gnu/usr.bin/binutils/ld/ChangeLog
index 7292ee104fe..61b3e27062c 100644
--- a/gnu/usr.bin/binutils/ld/ChangeLog
+++ b/gnu/usr.bin/binutils/ld/ChangeLog
@@ -1,7 +1,938 @@
+Fri Jun 7 11:27:42 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/sunos.em: Include libiberty.h.
+ (gld${EMULATION_NAME}_set_symbols): New static function to add
+ LD_LIBRARY_PATH to the list of search directories.
+ (ld_${EMULATION_NAME}_emulation): Add new set_symbols routine.
+
+Thu Jun 6 11:50:31 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * emulparams/elf32bmip.sh (OTHER_GOT_SYMBOLS): Use ALIGN(16)
+ rather than . when computing _gp value. From Per Fogelstrom.
+ * emulparams/elf32lmip.sh (OTHER_GOT_SYMBOLS): Likewise.
+
+ * ldmain.c (main): Don't close and unlink the file on error, since
+ remove_output will do it anyhow.
+ * ldlang.c (open_output): Set boolean variable to true, not 1.
+
+Wed Jun 5 18:34:14 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * emulparams/{elf32b4300.sh,elf32l4300.sh} (SCRIPT_NAME): Use
+ elfmips instead of elf.
+
+Tue Jun 4 18:43:07 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldcref.c: New file.
+ * ld.h (add_cref, output_cref): Declare.
+ * ldmain.c (main): Initialize notice_all field. If it is set at
+ end of link, call output_cref.
+ (notice): Rename from notice_ysym. Check notice_all.
+ * ldmisc.c (finfo): Make globally visible.
+ * ldmisc.h (finfo): Declare.
+ * lexsup.c (OPTION_CREF): Define.
+ (ld_options): Add "cref".
+ (parse_args): Handle OPTION_CREF.
+ * Makefile.in: Rebuild dependencies.
+ (CFILES): Add ldcref.c.
+ (OFILES): Add ldcref.o.
+ * ld.texinfo, ld.1: Document --cref.
+
+Tue Jun 4 12:12:25 1996 Tom Tromey <tromey@csk3.cygnus.com>
+
+ * Makefile.in (install): Make $(tooldir) and $(tooldir)/bin.
+
+Fri May 31 12:40:55 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/pe.em (sort_sections): Don't assume that a
+ wild_statement has a section name.
+
+Wed May 29 13:13:35 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * scripttempl/elfmips.sc: Quote test -z argument.
+
+ * ld.texinfo: Clarify the CONSTRUCTORS command.
+
+Thu May 23 16:07:44 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/aix.em (gld${EMULATION_NAME}_read_file): Initialize
+ file, not impfile.
+
+Wed May 22 11:31:30 1996 Doug Evans <dje@seba.cygnus.com>
+
+ * ldlang.c (wild_doit): Don't copy over SEC_LINK_{ONCE,DUPLICATES}
+ if final link.
+ * emultempl/pe.em (sfunc): Renamed to sort_by_file_name.
+ (sort_by_section_name, sort_sections_1): New functions.
+ (sort_sections): Only sort by file name sections in .idata.
+ Add "Grouped Sections" support.
+ (gld${EMULATION_NAME}_place_orphan): Rewrite to support Grouped
+ Sections.
+ (gld${EMULATION_NAME}_place_section): Delete.
+ * scripttempl/pe.sc (.text,.data,.rdata): Add *(.foo\$).
+ (.CRT,.rsrc): Rewrite to use Grouped Section support.
+
+Tue May 21 14:31:48 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-eppcmac.c: Update to reflect changes to aix.em.
+
+Sun May 19 16:59:44 1996 Doug Evans <dje@seba.cygnus.com>
+
+ * ldlang.c (dprint_statement): Stop printing at end of list.
+
+Sat May 18 13:12:05 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ Support for --force-exe-suffix
+ * ld.h (args_type): Add force_exe_suffix.
+ * ld.texinfo: Add documentation.
+ * ldmain.c (main): Add support for option.
+ * lexsup.c (OPTION_FORCE_EXE_SUFFIX): New.
+ (ld_options, parse_args): Add support for option.
+
+Wed May 15 12:50:25 1996 Jim Wilson <wilson@chestnut.cygnus.com>
+
+ * emultempl/pe.em (set_pe_value): Pass 0 not 16 to strtoul call.
+
+Fri May 10 16:28:44 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * scripttempl/elfppc.sc (__stack): Make __stack 0 if it was
+ referenced but not defined.
+
+Thu May 9 08:52:23 1996 Rob Savoye <rob@chinadoll.cygnus.com>
+
+ * emulparams/{elf32bmip.sh,elf32lmip.sh,mipsidt.sh,mipsidtl.sh}:
+ Set a new variable to signify if the final target is an embedded
+ system.
+ * scripttempl/{mips.sc,elfmips.sc}: Don't add SIZEOF_HEADERS to
+ .text for an embedded system.
+
+Tue May 7 10:56:11 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * scripttempl/pe.em (gld${EMULATION_NAME}_place_orphan): New function.
+ (gld${EMULATION_NAME}_place_section): New function.
+ (hold_{section,use,text,rdata,data}): New static locals.
+ (ld_${EMULATION_NAME}_emulation): Update orphan field.
+ * scripttempl/pe.sc: Whitespace cleanup. Semicolon usage cleanup.
+ (INIT,FINI): Delete, unused.
+ (.text): Document orphan .text.foo sections.
+ (.rdata): Document orphan .rdata.foo sections.
+ (.data): Document orphan .data.foo sections.
+
+Tue May 7 11:35:46 1996 Jeffrey A Law (law@cygnus.com)
+
+ * scripttempl/h8300.sc: Place ".tiny" sections right
+ after ".data" sections.
+ * scripttempl/h8300h.sc: Place ".tiny" sections into
+ the "tiny" memory region, 0xff8000 through 0xffff00.
+
+ * scripttempl/h8300.sc: Set the entry point to the value of
+ "_start" rather than the start of the text segment.
+ * scripttempl/h8300h.sc: Likewise.
+
+ * scripttempl/h8300.sc: Place .rodata sections before .text
+ sections in main ram.
+ * scripttempl/h8300h.sc: Likewise.
+
+Mon May 6 23:32:30 1996 Jeffrey A Law (law@cygnus.com)
+
+ * scripttempl/h8300h.sc: Use "eight", not "eightbit" for the
+ 8-bit region and 8-bit sections.
+
+Wed May 1 17:50:06 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * ldlang.c (section_already_linked): Fix typos.
+
+Mon Apr 29 20:31:06 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * scripttempl/pe.sc (.endjunk): Define __end__.
+
+Mon Apr 29 17:05:13 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldlang.c (longest_section_name): Remove.
+ (SECTION_NAME_MAP_LENGTH): Define.
+ (print_size, print_alignment, print_fill, print_section): Remove.
+ (print_flags): Remove.
+ (lang_map): Rewrite.
+ (print_output_section_statement): Rewrite.
+ (print_assignment): Rewrite.
+ (print_one_symbol): Rewrite.
+ (print_input_section): Rewrite.
+ (print_fill_statement): Rewrite.
+ (print_data_statement): Rewrite.
+ (print_address_statement): New static function.
+ (print_reloc_statement): Rewrite.
+ (print_padding_statement): Rewrite.
+ (print_wild_statement): Rewrite.
+ (print_statement_list): Clean up.
+ (print_statement): Clean up. Some minor output changes.
+ (print_statements): Clean up.
+ (load_symbols): Put another - before -whole-archive.
+ * ldexp.c (exp_print_tree): Change etree_value and etree_rel to
+ print 0x and to omit leading zeroes. For etree_rel, use %B to
+ print the BFD. For etree_assign, remove the space after the
+ destination name.
+ * ldwrite.c: Include "libiberty.h".
+ (clone_section): Call xstrdup, not strdup.
+ (ldwrite): Don't print any map information.
+ (print_symbol_table, print_file_stuff, print_symbol): Remove.
+ * ldmain.c (main): Call lang_map when appropriate.
+ * ldmisc.c (vfinfo): Add support for %W.
+ (print_address): Remove.
+ * ldmisc.h (print_address): Don't declare.
+ * Makefile.in: Rebuild dependencies.
+
+Mon Apr 29 10:29:07 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * configure.host (m68*-*-linux*): Add -dynamic-linker to
+ HOSTING_CRT0. Search -lgcc both before and after -lc in
+ HOSTING_LIBS. Look for crt{begin,end}.o in the compiler directory
+ at first.
+ (i[345]86-*-linux*): Look for crt{begin,end}.o in the compiler
+ directory at first.
+
+Fri Apr 26 14:42:27 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldmisc.h (demangle): Declare.
+ * ldmisc.c: Include "libiberty.h". Include demangle.h with "",
+ not <>.
+ (demangle): Make non-static. Remove remove_underscore paramter.
+ Always return an allocated string.
+ (vfinfo): Free result of demangle. Add case 'G'. Use %T to print
+ functionname, rather than calling demangle. Print a colon between
+ the BFD(section+offset) and the line number.
+ * ldmain.c (add_archive_element): Improve format of archive
+ information in map file.
+ (constructor_callback): Don't print anything to the map file.
+ * ldlang.c (lang_one_common): Improve format of common symbol
+ information in map file.
+ * ldctor.c (ldctor_build_sets): If producing a map file, print set
+ information.
+ * ldwrite.c (print_symbol_table): Print a newline before the
+ header in the map file.
+ * Makefile.in: Rebuild dependencies.
+
+ * ldmisc.c (vfinfo): Reindent.
+
+Mon Apr 22 12:07:32 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldlang.c (lang_size_sections): If _cooked_size is not 0, then
+ don't clobber it when not relaxing.
+
+ * ld.h (ld_config_type): Remove traditional_format field.
+ * ldmain.c (main): Use link_info.traditional_format rather than
+ config.traditional_format.
+ * ldlang.c (ldlang_open_output): Likewise.
+ * lexsup.c (parse_args): Likewise.
+ * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Likewise.
+ * mpw-eppcmac.c (gldppcmacos_parse_args): Likewise.
+
+ * ldlang.c (wild_doit): Discard debugging sections if we are
+ stripping debugging information.
+
+ * emulparams/z8002.sh (ARCH): Set to z8002, not z8k.
+
+Tue Apr 16 16:38:32 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldexp.c (fold_binary): Correct handling of subtraction with
+ absolute values.
+ (fold_name): Permit symbols in lang_allocating_phase_enum.
+
+ * scripttempl/aout.sc: Only PROVIDE __stack when RELOCATING. Undo
+ accidental changes in last patch.
+
+Tue Apr 16 10:25:42 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.tgt (powerpc*-*-{sysv,linux}): Add aliases.
+ (powerpcle*-*-{sysv,solaris}): Ditto.
+
+Mon Apr 15 14:50:56 1996 Rob Savoye <rob@chinadoll.cygnus.com>
+
+ * scripttempl/aout.sc: Add PROVIDE (__stack = 0) so I can use it
+ in m68k/crt0.S without things blowing up.
+
+Fri Apr 12 16:40:56 1996 Rob Savoye <rob@chinadoll.cygnus.com>
+
+ * scripttempl/m68kcoff.sc: Remove default address for .data so
+ .text, .data, and .bss are all sequential.
+
+Thu Apr 11 12:05:35 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * scripttempl/m68kcoff.sc: Remove regions and simplify.
+
+Wed Apr 10 14:41:53 1996 Jeffrey A Law (law@cygnus.com)
+
+ * scripttempl/h8300.sc: Add the "8-bit area" in the upper 256
+ bytes of the address space. Put data from the ".eight" sections
+ into the 8-bit area.
+ * scripttempl/h8300h.sc: Likewise.
+
+Tue Apr 9 14:10:42 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * emultempl/generic.em (gld${EMULATION_NAME}_before_parse):
+ Pass $ARCH to ldfile_set_output_arch instead of setting
+ ldfile_output_architecture directly.
+
+Tue Apr 9 14:22:15 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * scripttempl/elfppc.sc (.init,.fini): Put .init, .fini section
+ next to .text. Put _etext after .text, .init, .fini, and
+ .rodata{,2} sections.
+
+Tue Apr 9 12:18:57 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld.texinfo: Rearrange option documentation.
+
+ * lexsup.c (ld_options): New static array.
+ (parse_args): Build shortopts and longopts from ld_options array.
+ (help): New static function.
+ * ldver.h (help): Don't declare.
+ * ldver.c (ldversion): Reindent.
+ (help): Remove.
+
+ * ld.texinfo, ld.1: Mention -E as a synonym for -export-dynamic.
+
+Mon Apr 8 11:56:23 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/elf32.em: When checking for a native emulation, check
+ that the current emulation is the default emulation.
+ * emultempl/sunos.em: Likewise.
+
+ * configure.in: Permit --enable-shared to specify a list of
+ directories.
+ * configure: Rebuild.
+
+ * lexsup.c (parse_args): Add -E as a synonym for -export-dynamic,
+ for HP/UX compatibility.
+
+Fri Apr 5 14:30:14 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_check_ld_so_conf): New
+ static function, if ${host} = ${target}.
+ (gld${EMULATION_NAME}_after_open): Call check_ld_so_conf to find a
+ needed shared library if ${host} = $[target}.
+
+ * configure.host (i[345]86-*-linux*): Add -dynamic-linker to
+ HOSTING_CRT0. Search -lgcc both before and after -lc in
+ HOSTING_LIBS.
+
+ * configure.tgt: Add i[345]86-*-freebsdelf* target; from John
+ Polstra <jdp@polstra.com>.
+
+Fri Apr 5 18:11:25 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * emulparams/elf32{b,l}4300.sh (MACHINE): Add explicit
+ architecture number.
+ * scripttempl/elf.sc: Use $MACHINE definition if present.
+ * configure.tgt (targ_extra_emuls): Force 4100 build to use same
+ template as 4300.
+
+Mon Apr 1 17:35:40 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldlang.c (lang_size_sections): Change region check to handle
+ regions which end at the highest possible address correctly.
+ From Roland Weber <roweber@ira.uka.de>.
+
+ * ldlang.c (section_already_linked): New static function.
+ (wild_doit): Discard sections with SEC_EXCLUDE set if not doing a
+ relocateable link. Don't worry about section being NULL, since it
+ never should be. Don't call init_os unless the section is going
+ to be added.
+ (ldlang_add_file): Call section_already_linked for each section.
+ * ldmain.c (multiple_definition): Don't warn about multiple
+ definitions in sections which are being discarded.
+
+Sun Mar 31 00:30:47 1996 steve chamberlain <sac@slash.cygnus.com>
+
+ * scripttempl/{ppcpe.sc, pe.sc} (.junk): Remove and use /DISCARD/.
+ * emultempl/pe.em (init): Remove special case PPC code.
+
+Fri Mar 29 00:01:29 1996 Jeffrey A Law (law@cygnus.com)
+
+ * scripttempl/h8300.sc: Make vectors section 0xc4 bytes long
+ so as not to overwrite the magic syscall entry at 0xc4.
+ * scripttempl/h8300h.sc: Likewise.
+
+Thu Mar 28 11:05:47 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * configure.tgt (sparc64-*-solaris2*): Delete.
+ Stick with sparc-*-solaris2*.
+
+Wed Mar 27 12:33:24 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld.h (DISCARD_SECTION_NAME): Define to "/DISCARD/".
+ * ldlang.c (init_os): Fail on an attempt to initialize any section
+ named DISCARD_SECTION_NAME.
+ (wild_doit): Discard input sections assigned to an output section
+ named DISCARD_SECTION_NAME.
+ * ld.texinfo: Document use of /DISCARD/.
+
+ * ldlang.c: Fix some indentation and comments.
+
+Tue Mar 26 18:14:49 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldmain.c (main): Call bfd_set_error_program_name.
+
+Thu Mar 21 13:17:34 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld.texinfo: Fix a couple of indexing entries. Mention that
+ --verbose displays builtin linker scripts.
+
+ * ldmisc.c (vfinfo): case 'I': If the file is not in an archive,
+ and the local symbol name does not match the filename, print the
+ filename as well.
+
+ Patches from John Polstra <jdp@polstra.com> for FreeBSD ELF:
+ * lexsup.c (parse_args): -Bshareable is a synonym for -shared.
+ * emulparams/elf_i386.sh (NONPAGED_TEXT_START_ADDR): Make the same
+ as TEXT_START_ADDR.
+
+Wed Mar 20 18:18:25 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * ld.texinfo: Fix typos. Use @pxref only inside parentheses.
+
+Wed Mar 20 16:56:15 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldmain.c (add_wrap): New function.
+ * ldmain.h (add_wrap): Declare.
+ * lexsup.c (parse_args): Call add_wrap.
+
+Tue Mar 19 16:44:20 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * configure.host (sparc*-*-solaris2* host): Accept any sparc variant.
+
+Wed Mar 13 17:47:31 1996 Jeffrey A Law (law@cygnus.com)
+
+ * scripttempl/h8300.sc: Change name of page zero memory
+ from "null" to "vectors". Create an output section for
+ vectors. Add comments on how to explicitly place items
+ in the vector table.
+ * scripttempl/h8300h.sc: Likewise.
+
+Wed Mar 13 12:40:18 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/lnk960.em (machine_table): Add jx and hx.
+
+ * genscripts.sh: Don't use ${9:-xx}, since Ultrix /bin/sh doesn't
+ support it.
+
+Tue Mar 12 12:43:59 1996 David Mosberger-Tang <davidm@koala.azstarnet.com>
+
+ * ld.h (ld_config_type): Add warn_multiple_gp field.
+ * lexsup.c (parse_args): Handle --warn-multiple-gp.
+ * ldmain.c (warning_callback): Suppress multiple gp values warning
+ if --warn_multiple_gp was not used.
+ * ld.texinfo, ld.1: Document --warn-multiple-gp.
+
+Tue Mar 12 12:02:21 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * lexsup.c (parse_args): Handle --wrap.
+ * ldmain.c (main): Initialize link_info.wrap_hash.
+ * ldexp.c (fold_name): Use bfd_wrapped_link_hash_lookup in DEFINED
+ and NAME cases.
+ * ld.texinfo, ld.1: Document --wrap.
+
+ * configure: Rebuild with autoconf 2.8.
+
+ Don't do SunOS style dynamic linking for sparc-aout:
+ * configure.tgt (sparc64-*-aout*): Use sparcaout, not sun4.
+ (sparclite*-fujitsu-*, sparc*-*-aout): Likewise.
+ (sparc*-wrs-vxworks*): Likewise.
+ * emulparams/sparcaout.sh: New file.
+ * Makefile.in (ALL_EMULATIONS): Add esparcaout.o.
+ (esparcaout.c): New target.
+
+Wed Mar 6 16:06:52 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * scripttempl/elfppc.sc (.sdata2, .sbss2): Implement Feb 2 change
+ in a different manner to work around differences in shell variable
+ expansion.
+
+Wed Mar 6 18:08:18 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldemul.h (ldemul_unrecognized_file): Declare.
+ (ldemulation_xfer_type): Add unrecognized_file field.
+ * ldemul.c (ldemul_unrecognized_file): New function.
+ * ldlang.c (load_symbols): If a file can not be recognized, call
+ ldemul_unrecognized_file before trying it as a linker script.
+ * aix.em (gld${EMULATION_NAME}_unrecognized_file): New static
+ function.
+ (gld${EMULATION_NAME}_read_file): Use FOPEN_RT, not "r".
+ (ld_${EMULATION_NAME}_emulation): Initialize unrecognized_file.
+
+Mon Mar 4 14:11:17 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldlang.c (wild): Handle foo.a(.text) by mapping each included
+ member of foo.a separately. From Jouke Numan <jnuman@bazis.nl>.
+
+Fri Mar 1 10:24:59 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_find_exp_assignment):
+ Search trinary.cond rather than searching trinary.lhs twice.
+
+Tue Feb 27 15:08:43 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-make.sed: Edit out shared library support.
+ (@TDIRS@): Edit out, can't use genscripts.
+
+Tue Feb 27 15:09:21 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * configure.tgt (m68k-*-linuxaout*, m68k-*-linux*): New targets.
+ * emulparams/m68klinux.sh: New file.
+ * emultempl/linux.em (gld${EMULATION_NAME}_before_allocation):
+ Call bfd_${EMULATION_NAME}_size_dynamic_sections instead of
+ bfd_linux_size_dynamic_sections.
+ * Makefile.in (ALL_EMULATIONS): Add em68klinux.o.
+ (em68klinux.c): New target.
+ * configure.host (m68*-*-linuxaout*, m68*-*-linux*): New hosts.
+
+Tue Feb 27 12:55:46 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (ALL_EMULATIONS): Sort into alphabetical order.
+ Fill in missing entries.
+
+ * lexsup.c (parse_args): Recognize --no-whole-archive.
+ * ldlang.h (lang_input_statement_type): Add whole_archive field.
+ * ldlang.c (new_afile): Set whole_archive field.
+ (load_symbols): Check input file specific whole_archive field
+ rather than global variable.
+ * ld.texinfo, ld.1: Document --no-whole-archive.
+
+Tue Feb 20 16:07:00 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.tgt: Correct gldi960 to gld960.
+
+Mon Feb 19 11:16:44 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_check_needed): Check
+ the SONAME if it is available.
+ (gld${EMULATION_NAME}_stat_needed): Use the SONAME, not the
+ filename, when checking for conflicting library versions. Don't
+ assume that the suffix is only numbers and dots.
+
+ * ld.texinfo: Mention that -R can be used for -rpath.
+
+Sun Feb 18 15:05:17 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host: Check for 'do not mix' from native linker before
+ trying to use -rpath.
+
+Thu Feb 15 13:58:06 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Remove explicit substitution of CFLAGS; autoconf
+ does it anyhow.
+ * configure: Rebuild.
+ * Makefile.in (LDFLAGS): Set to @LDFLAGS@.
+
+ * configure.in: Call AC_PROG_CC before configure.host.
+ * configure: Rebuild.
+ * configure.host: Remove go32 host, since it should no longer be
+ necessary. Don't set CC for romp host.
+
+ * scripttempl/elf.sc: Don't skip a page in virtual memory space if
+ the text segment ends exactly on a page boundary.
+
+ * configure.in: Substitute RPATH_ENVVAR.
+ * configure: Rebuild.
+ * configure.host: Set RPATH_ENVVAR.
+ * Makefile.in (RPATH_ENVVAR): New variable.
+ (check): Use $(RPATH_ENVVAR) rather than LD_LIBRARY_PATH.
+
+Wed Feb 14 18:49:01 1996 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * configure.in: Redo emulation handling so that each emulation
+ searches the correct tool directory, based on the target alias.
+ For example, "configure --enable-targets=m68k-coff i386-linux"
+ will search /usr/local/i386-linux/lib for linux and
+ /usr/local/m68k-coff/lib for m68k-coff.
+ * configure: Rebuild.
+ * configure.tgt: Add special tdir settings for Linux.
+ * Makefile.in: Add @TDIRS@. Pass "$(tdir_EMUL)" to ${GENSCRIPTS}
+ for each eEMUL.c target.
+ * genscripts.sh: Accept specific alias as 9th argument, and use it
+ in LIB_PATH.
+
+Wed Feb 14 16:38:36 1996 Martin Anantharaman <martin@mail.imech.uni-duisburg.de>
+
+ * ldlang.c (lang_set_startof): Don't do anything for a
+ relocateable link.
+
+ * ldgram.y (mri_script_file): Call mri_draw_tree.
+ * mri.c (mri_draw_tree): Make globally visible. Don't bother to
+ create memory regions.
+ (mri_load): Don't call mri_draw_tree.
+ * mri.h (mri_draw_tree): Declare.
+
+ * configure.tgt (m68*-*-psos): New target.
+ * emulparams/m68kpsos.sh: New file.
+ * scripttempl/psos.sc: New file.
+ * Makefile.in (ALL_EMULATIONS): Add em68kpsos.o.
+ (em68kpsos.c): New target.
+
+Wed Feb 14 11:09:25 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.tgt (*-*-ieee*): New target; use vanilla.
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Strip
+ `:foo' from ${ARCH}.
+
+Tue Feb 13 15:58:58 1996 Bryan Ford <baford@snake.cs.utah.edu>
+
+ * scripttempl/i386msdos.sc: Don't pad the .text section. Put
+ .rodata in .data.
+
+Tue Feb 13 14:04:19 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host: Set HDLFLAGS for *-*-hpux with --enable-shared.
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_stat_needed): Warn if
+ it looks like we might be linking in two different versions of the
+ same shared library. Based on a patch from H J Lu <hjl@zoom.com>.
+
+Thu Feb 8 19:25:54 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldlang.c (lang_size_sections): Increment the section size when a
+ padding statement is encountered.
+
+Wed Feb 7 14:01:33 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Look for --enable-shared. Change the value of
+ BFDLIB when linking against a shared library on SunOS.
+ * configure: Rebuild.
+ * configure.host: If using a shared BFD library, try to pass a
+ reasonable -rpath option when linking.
+ * Makefile.in (BFDLIB): Set to @BFDLIB@.
+
+Tue Feb 6 12:29:14 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * emulparams/elf64_sparc.sh (ARCH): Change to `sparc:v9'.
+ * emultempl/generic.em: Strip `:foo' from ${ARCH}.
+
+Mon Feb 5 16:25:30 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ Support for building bfd and opcodes as shared libraries, based on
+ patches from Alan Modra <alan@spri.levels.unisa.edu.au>:
+ * configure.in (HLDFLAGS): New substitution.
+ * configure: Rebuild.
+ * configure.host: Set HLDFLAGS on SunOS.
+ * Makefile.in (HLDFLAGS): New variable.
+ (BFDDEP): New variable.
+ (BFDLIB): Change to -L../bfd -lbfd.
+ ($(LD_PROG)): Depend upon $(BFDDEP) rathern than $(BFDLIB). Use
+ $(HLDFLAGS) in link.
+ (check): Set LD_LIBRARY_PATH in the environment.
+
+Fri Feb 2 19:26:25 1996 Michael Meissner <meissner@wogglebug.tiac.net>
+
+ * scripttempl/elfppc.sc (.sdata2, .sbss2): Put .sdata2 and .sbss
+ in the read-only section, not read/write unless we are making a
+ shared library.
+ (.debug*): Add dwarf debug sections.
+ (.rela.{sdata*,sbss*}): Add sections.
+
+Fri Feb 2 16:50:21 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Regenerate.
+
+Thu Feb 1 10:50:46 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * emulparams/elf_i386.sh (TEXT_START_ADDR): Change to 0x8048000,
+ for SVR4 compatibility.
+
+ * ldexp.c (exp_fold_tree): Correct handling of ABSOLUTE.
+
+Wed Jan 31 17:30:19 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * configure.tgt (i[345]86-*-cygwin32, powerpcle-*-cygwin32): New.
+ * emultempl/pe.em (definfo init): Make the default stack reserve
+ of a PPC larger.
+
+Wed Jan 31 14:34:23 1996 Richard Henderson <rth@tamu.edu>
+
+ * configure.tgt (m68*-apple-aux*): New target.
+ * emulparams/m68kaux.sh: New file.
+ * scripttempl/m68kaux.sc: New file.
+ * Makefile.in (ALL_EMULATIONS): Add em68kaux.o.
+ (em68kaux.c): New target.
+
+Tue Jan 30 13:18:56 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Ignore
+ -bnoentry, since the right thing tends to happen anyhow.
+
+Mon Jan 29 12:29:26 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld.texinfo, ld.1: Document -export-dynamic.
+
+Fri Jan 26 11:11:55 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * emultempl/sunos.em: Check for native compile by comparing
+ ${target} and ${host}.
+
+Thu Jan 25 16:46:58 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * emulparams/{elf32b4300.sh, elf32l4300.sh}: Changed
+ TEXT_START_ADDR to allow use on IDT and PMON systems.
+
+Wed Jan 24 20:59:40 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * emultempl/pe.em (gld_${EMULATION_NAME}_parse_args):
+ correct spelling.
+
+Wed Jan 24 16:59:19 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * configure.tgt (sparc64-*-solaris2*): New configuration.
+ (sparc64-*-aout*): Renamed from sparc64*.
+
+Mon Jan 22 13:01:35 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * Makefile.in (GENSCRIPTS): Pass @host@ @target@ @target_alias@.
+ * genscripts.sh: Set host, target and target_alias variables.
+ Check for native compile by comparing ${target} and ${host}.
+ * emultempl/elf32.em: Likewise.
+ * scripttempl/elfmips.sc: Test ${target}, not ${target_alias}.
+
+Mon Jan 22 11:03:23 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * scripttempl/elfppc.sc: Refine eabi support to better support
+ .sdata, .sdata2, .sbss, etc. sections.
+
+Tue Jan 16 15:16:58 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldgram.y (%union): Add phdr field.
+ (phdr): Use phdr_qualifiers rather than opt_hdrs and opt_at.
+ (phdr_qualifiers): New nonterminal. Add support for FLAGS.
+ (opt_hdrs, hdr): Remove.
+ (phdr_val): New nonterminal.
+ * ldlang.c (lang_new_phdr): Replace hdrs parameter with filehdr
+ and phdrs parameters. Add flags parameter.
+ (lang_record_phdrs): Update for changes to lang_phdr. Pass flags
+ to bfd_record_phdr.
+ * ldlang.h (struct lang_phdr): Replace hdrs field with filehdr and
+ phdrs fields. Add flags field.
+ (LANG_PHDR_FILEHDR, LANG_PHDR_PHDRS): Remove.
+ (lang_new_phdr): Update declaration.
+ * ld.texinfo: Document FLAGS.
+
+Mon Jan 15 15:07:19 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation):
+ Don't make a shared library because of an undefined reference to
+ __GLOBAL_OFFSET_TABLE_.
+
+ Add some Irix 5 support, mostly from Kazumoto Kojima
+ <kkojima@info.kanagawa-u.ac.jp>:
+ * emulparams/elf32bmip.sh (SCRIPT_NAME): Change to elfmips.
+ (SHLIB_TEXT_START_ADDR): Define.
+ (OTHER_GOT_SYMBOLS): Define.
+ (OTHER_READWRITE_SECTIONS): Remove initialization of _gp.
+ (EXECUTABLE_SYMBOLS): Don't define.
+ (DYNAMIC_LINK): Don't define.
+ * emulparams/elf32lmip.sh: Same changes as elf32bmip.sh.
+ * scripttempl/elfmips.sc: New file.
+ * configure.host (mips*-dec-bsd*): Change mips to mips*.
+ (mips*-sgi-irix4*): Likewise.
+ (mips*-sgi-irix5*): New entry.
+ * Makefile.in (eelf32bmip.c): Depend upon elfmips.sc rather than
+ elf.sc.
+ (eelf32lmip.c): Likewise.
+
+Sat Jan 13 09:41:43 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * scripttempl/elfppc.sc: Remove support for .rel.* sections. Add
+ .rela.got.neg section.
+
+Fri Jan 12 14:56:19 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * scripttempl/sh.sc: Only build constructors when CONSTRUCTING.
+
+ * ldmisc.c: Include <stdarg.h> rather than <varargs.h> if
+ ANSI_PROTOTYPES is defined. Remove special handling of
+ WINDOWS_NT. Various indendation fixes.
+ (vfinfo): Change fmt parameter to const char *.
+ (info_msg): Write <stdarg.h> version.
+ (einfo, minfo, finfo): Likewise.
+ (info_assert): Change file parameter to const char *.
+ * ldmisc.h (einfo, minfo, info_msg): If ANSI_PROTOTYPES is
+ defined, use a real prototype.
+ (info_assert): Change first parameter to be const char *.
+
+Fri Jan 12 13:29:55 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * scripttempl/elfppc.sc: Add support for .sdata2/.sbss2, etc. Add
+ in old support that 2.7.2 needs, but the current compiler does
+ not.
+
+ * Makefile.in (eelf32{,l}ppc.c): Fix up dependencies to use the
+ correct Linker script template.
+
+ * emulparams/elf32{,l}ppc.sh (TEXT_START_ADDR): Set to 0x40000,
+ not 0x400000.
+ (DATA_ADDR,NONPAGED_TEXT_START_ADDR): Delete.
+
+Tue Jan 9 15:53:02 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * scripttempl/alpha.sc: Put .rconst right after .rdata.
+
+Fri Jan 5 14:07:45 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * emultempl/pe.em (gld_${EMULATION_NAME}_before_allocation):
+ sort using right pointer.
+
+Fri Jan 5 12:25:47 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * scripttempl/elfppc.sc: Remove support for creating special
+ labels for eabi section begin/end here. The compiler now uses
+ crt{i,n}.o to create these symbols.
+
+Thu Jan 4 17:08:58 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host: Change existing Linux HOSTING_CRT0 to be used
+ for a.out only, and put in appropriate HOSTING_CRT0 and
+ HOSTING_LIBS values for Linux ELF.
+
+Thu Jan 4 12:02:05 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * scripttempl/h8300.sc: Use all 64K for ram.
+ * scripttempl/h8300h.sc: Define 256K ram size.
+
+Thu Dec 21 15:57:18 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/aix.em (gld${EMULATION_NAME}_before_allocation): Pass
+ export_defines as true to bfd_xcoff_size_dynamic_sections if -unix
+ was used, regardless of whether -bE was used.
+
+Tue Dec 19 17:35:38 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/aix.em (gld${EMULATION_NAME}_after_open): Only set
+ relocateable before calling ldctor_build_sets if the output file
+ is in an XCOFF format.
+
+Fri Dec 15 16:34:36 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldwrite.c (build_link_order): When handling a data statement, if
+ the endianness of the output file is unknown, use the endianness
+ of the input file.
+
+Tue Dec 12 13:55:41 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-config.in: Recognize mips-*-* as equivalent to
+ mips-idt-ecoff.
+ * mpw-eppcmacos.c: Rename to shorter mpw-eppcmac.c.
+ * mpw-ld.r: Add version resources.
+ (cfrg): Use symbolic instead of literal name for executable.
+
+Mon Dec 11 15:13:41 1995 Kim Knuttila <krk@cygnus.com>
+
+ * scripttempl/ppcpe.sc (FINI): Moved the .reloc section.
+
+Wed Dec 6 14:33:50 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * ldlang.c (print_statement{,s}): Delete duplicate prototype.
+ (print_statement_list): Renamed from print_statement. All callers
+ updated.
+ (print_statement): New function to print just one statement.
+ (print_{data,reloc,padding}_statement): Don't crash if
+ output_section == NULL.
+ (dprint_statement): New function.
+
+ * emultempl/pe.em (gld_${EMULATION_NAME}_before_allocation): Fix
+ call to sort_sections.
+
+Wed Dec 6 14:59:06 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/aix.em (unix_ld): New static variable.
+ (gld${EMULATION_NAME}_parse_args): Handle -unix.
+ (gld${EMULATION_NAME}_before_allocation): If unix_ld, pass
+ gc as false and export_defineds as true to size_dynamic_sections.
+
+ * ldexp.c (exp_fold_tree): Permit assignments to dot in the final
+ phase if the current section is abs_output_section.
+
+
+Tue Dec 5 09:49:39 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * emultempl/pe.em (gld_${EMULATION_NAME}_before_allocation): Fix call
+ to sort_sections.
+
+Fri Dec 1 16:48:36 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldgram.y (PHDRS): New token.
+ (ifile_p1): Accept phdrs.
+ (section): Accept phdr_opt at the end of the section definition.
+ (phdr_op): New nonterminal.
+ (phdrs, phdr_list, phdr, phdr_type, opt_hdrs, hdr): Likewise.
+ * ldlex.l: Accept PHDRS.
+ * ldlang.h (struct lang_output_section_phdr_list): Define.
+ (lang_output_section_statement_type): Add phdrs field.
+ (struct lang_phdr): Define.
+ (LANG_PHDR_FILEHDR, LANG_PHDR_PHDRS): Define.
+ (lang_new_phdr): Declare.
+ * ldlang.c (lang_phdr_list): New static variable.
+ (lang_output_section_statement_lookup): Initialize phdrs field.
+ (lang_process): Call lang_record_phdrs.
+ (lang_new_phdr): New function.
+ (lang_section_in_phdr): New function.
+ (lang_record_phdrs): New static function.
+ * ld.texinfo: Document PHDRS.
+
+Thu Nov 30 13:14:30 1995 Kim Knuttila <krk@cygnus.com>
+
+ * scripttempl/ppcpe.sc: Moved .edata into its own section to
+ expose it.
+
+Thu Nov 30 11:32:34 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de>
+
+ * configure.host (m68*-motorola-sysv): Define HOSTING_CRT0 and
+ HOSTING_LIBS for testing.
+ (m88*-motorola-sysv3): Define HOSTING_CRT0 and HOSTING_LIBS for
+ testing.
+
+Tue Nov 28 12:14:53 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * lexsup.c (parse_args): Set config.dynamic_link to false for -N
+ and -n.
+
+Mon Nov 27 13:12:09 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Rebuild with autoconf 2.7.
+
+Fri Nov 24 18:35:35 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * scripttempl/pe.sc: Two .junk's is too much junk.
+
+Tue Nov 21 16:14:32 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Use BFD_NEED_DECLARATION.
+ * acconfig.h: Put NEED_DECLARATION_FREE in @TOP@ section.
+ * configure, config.in: Rebuild with autoconf 2.6.
+
+ * ldmain.c (constructor_callback): Don't warn about BFD_RELOC_CTOR
+ being unsupported if this is not a relocateable link and the input
+ BFD supports it, since ldctor_build_sets can cope with that case.
+
+Fri Nov 17 16:23:15 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.tgt (powerpc-*-macos*): New target.
+ * emulparams/ppcmacos.sh: New file, PowerMac emulation.
+ * Makefile.in (ALL_EMULATIONS): Add eppcmacos.o.
+ (eppcmacos.c): New target.
+ * mpw-eppcmacos.c: Update.
+ * mpw-make.sed: Edit out attempts to use {GENSCRIPTS}.
+
+Fri Nov 17 10:37:27 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (CC_FOR_TARGET): Use @host@ and @target@, not
+ $(host_canonical) and $(target_canonical).
+ (CXX_FOR_TARGET): Likewise.
+
+Thu Nov 16 11:23:42 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * scripttempl/pe.sc (.endjunk): Move definition of `end' to here
+ so the malloc heap begins at a sane place.
+
Thu Nov 16 03:09:32 1995 Ken Raeburn <raeburn@cygnus.com>
Version 2.6 released.
- * ldver.c (ldversion): Updated to 2.6.
+ * ldver.c (ldversion): Update to 2.6.
* Makefile.in (mostlyclean): Delete ldemul-list.h here, but not
$(GENERATED_*FILES), since they need to be retained by distclean.
@@ -139,7 +1070,7 @@ Fri Oct 27 18:03:17 1995 Niklas Hallqvist <niklas@appli.se>
hp300bsd,hp3hpux,hppaelf.sh,i386aout,i386bsd,i386coff,i386go32,
i386linux,i386lynx,i386nbsd,lnk960,m68kaout,m68kcoff,m68klynx,
m88kbcs,mipsbig,mipsbsd,mipsidt,mipsidtl,mipslit,news,ns32knbsd,
- pc532machaout,rce,riscix,sa29200,sh,shl,sparclynx,sparcnbsd,
+ pc532machaout,riscix,sa29200,sh,shl,sparclynx,sparcnbsd,
st2000,sun3,sun4,vanilla,vax,vsta,w65,z8001,z8002}.sh: Changed
PAGE_SIZE to TARGET_PAGE_SIZE.
diff --git a/gnu/usr.bin/binutils/ld/Makefile.in b/gnu/usr.bin/binutils/ld/Makefile.in
index 175752de119..d08afa99f95 100644
--- a/gnu/usr.bin/binutils/ld/Makefile.in
+++ b/gnu/usr.bin/binutils/ld/Makefile.in
@@ -1,5 +1,6 @@
# Makefile for the GNU linker ld (version 2)
-# Copyright (C) 1989, 90, 91, 92, 93, 1994 Free Software Foundation, Inc.
+# Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
+# Free Software Foundation, Inc.
# This file is part of GNU ld.
@@ -61,6 +62,9 @@ AR = ar
AR_FLAGS = qv
CC = @CC@
CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
+HLDFLAGS = @HLDFLAGS@
+RPATH_ENVVAR = @RPATH_ENVVAR@
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
RANLIB = ranlib
@@ -70,7 +74,7 @@ LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
EMUL = @EMUL@
EMULATION_OFILES = @EMULATION_OFILES@
-# Seach path to override the default search path for -lfoo libraries.
+# Search path to override the default search path for -lfoo libraries.
# If LIB_PATH is empty, the ones in the script (if any) are left alone.
# (The default is usually /lib:/usr/lib:/usr/local/lib, unless building
# a cross-linker, in which case the default is empty. See genscripts.sh.)
@@ -138,7 +142,7 @@ CC_FOR_TARGET = ` \
echo $$r/../gcc/xgcc -B$$r/../gcc/; \
fi; \
else \
- if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
+ if [ "@host@" = "@target@" ] ; then \
echo $(CC); \
else \
echo gcc | sed '$(program_transform_name)'; \
@@ -154,7 +158,7 @@ CXX_FOR_TARGET = ` \
echo $$r/../gcc/xgcc -B$$r/../gcc/; \
fi; \
else \
- if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
+ if [ "@host@" = "@target@" ] ; then \
echo $(CXX); \
else \
echo gcc | sed '$(program_transform_name)'; \
@@ -186,28 +190,98 @@ ALL_CFLAGS = $(INCLUDES) @HDEFINES@ $(CFLAGS)
.c.o:
$(CC) -c $(ALL_CFLAGS) $<
-# for self hosting
-BFDLIB = ../bfd/libbfd.a
+BFDDEP = ../bfd/libbfd.a
+BFDLIB = @BFDLIB@
LIBIBERTY = ../libiberty/libiberty.a
-ALL_EMULATIONS = ea29k.o ealpha.o earmaoutl.o earmaoutb.o \
- ecoff_sparc.o eebmon29k.o \
- eelf32_sparc.o eelf32bmip.o eelf32lmip.o eelf32ppc.o eelf32lppc.o \
- eelf64_sparc.o eelf_i386.o egld960.o ego32.o eh8300.o \
- eh8300h.o eh8500.o eh8500b.o eh8500c.o eh8500m.o eh8500s.o \
- ehp300bsd.o ehp3hpux.o ehppaelf.o ei386aout.o ei386bsd.o \
- ei386coff.o ei386go32.o ei386linux.o ei386lynx.o ei386mach.o \
- ei386nbsd.o ei386nw.o elnk960.o em68k4knbsd.o em68kaout.o em68kcoff.o \
- em68kelf.o em68klynx.o em68knbsd.o em88kbcs.o emipsbig.o emipsbsd.o \
- emipsidt.o emipsidtl.o emipslit.o enews.o ens32knbsd.o eppcnw.o \
- eriscix.o esa29200.o eshl.o esh.o esparclynx.o esparcnbsd.o \
- est2000.o esun3.o esun4.o evanilla.o evax.o evsta.o \
- ez8001.o ez8002.o ei386pe.o earmpe.o eelf32b4300.o eelf32l4300.o \
- eaixppc.o eaixrs6.o edelta68.o eppcpe.o
+ALL_EMULATIONS = \
+ ea29k.o \
+ eaixppc.o \
+ eaixrs6.o \
+ ealpha.o \
+ earmaoutb.o \
+ earmaoutl.o \
+ earmcoff.o \
+ earmpe.o \
+ ecoff_sparc.o \
+ edelta68.o \
+ eebmon29k.o \
+ eelf32_sparc.o \
+ eelf32b4300.o \
+ eelf32bmip.o \
+ eelf32l4300.o \
+ eelf32lmip.o \
+ eelf32lppc.o \
+ eelf32ppc.o \
+ eelf64_sparc.o \
+ eelf_i386.o \
+ egld960.o \
+ egld960coff.o \
+ ego32.o \
+ eh8300.o \
+ eh8300h.o \
+ eh8500.o \
+ eh8500b.o \
+ eh8500c.o \
+ eh8500m.o \
+ eh8500s.o \
+ ehp300bsd.o \
+ ehp3hpux.o \
+ ehppaelf.o \
+ ei386aout.o \
+ ei386bsd.o \
+ ei386coff.o \
+ ei386go32.o \
+ ei386linux.o \
+ ei386lynx.o \
+ ei386mach.o \
+ ei386moss.o \
+ ei386msdos.o \
+ ei386nbsd.o \
+ ei386nw.o \
+ ei386pe.o \
+ elnk960.o \
+ em68k4knbsd.o \
+ em68kaout.o \
+ em68kaux.o \
+ em68kcoff.o \
+ em68kelf.o \
+ em68klinux.o \
+ em68klynx.o \
+ em68knbsd.o \
+ em68kpsos.o \
+ em88kbcs.o \
+ emipsbig.o \
+ emipsbsd.o \
+ emipsidt.o \
+ emipsidtl.o \
+ emipslit.o \
+ enews.o \
+ ens32knbsd.o \
+ epc532machaout.o \
+ eppcmacos.o \
+ eppcnw.o \
+ eppcpe.o \
+ eriscix.o \
+ esa29200.o \
+ esh.o \
+ eshl.o \
+ esparcaout.o \
+ esparclynx.o \
+ esparcnbsd.o \
+ est2000.o \
+ esun3.o \
+ esun4.o \
+ evanilla.o \
+ evax.o \
+ evsta.o \
+ ew65.o \
+ ez8001.o \
+ ez8002.o
CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
- mri.c
+ mri.c ldcref.c
HFILES = config.h ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
@@ -218,7 +292,7 @@ GENERATED_HFILES = ldgram.h ldemul-list.h
OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \
- ldfile.o ${EMULATION_OFILES}
+ ldfile.o ldcref.o ${EMULATION_OFILES}
LINTSOURCES = $(CFILES) $(GENERATED_CFILES) e*.c
@@ -265,135 +339,178 @@ ldlex.c: ldlex.l
# These all start with e so 'make clean' can find them.
-GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host_alias@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@"
+GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@"
GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
+@TDIRS@
-esun4.c: $(srcdir)/emulparams/sun4.sh \
- $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sun4
-esun3.c: $(srcdir)/emulparams/sun3.sh \
- $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sun3
+ea29k.c: $(srcdir)/emulparams/a29k.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} a29k "$(tdir_a29k)"
+eaixppc.c: $(srcdir)/emulparams/aixppc.sh \
+ $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} aixppc "$(tdir_aixppc)"
+eaixrs6.c: $(srcdir)/emulparams/aixrs6.sh \
+ $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} aixrs6 "$(tdir_aixrs6)"
+ealpha.c: $(srcdir)/emulparams/alpha.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/alpha.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} alpha "$(tdir_alpha)"
+earmaoutb.c: $(srcdir)/emulparams/armaoutb.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armaoutb "$(tdir_armaoutb)"
+earmaoutl.c: $(srcdir)/emulparams/armaoutl.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armaoutl "$(tdir_armaoutl)"
+earmcoff.c: $(srcdir)/emulparams/armcoff.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armcoff "$(tdir_armcoff)"
earmpe.c: $(srcdir)/emulparams/armpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armpe
-evsta.c: $(srcdir)/emulparams/vsta.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} vsta
+ ${GENSCRIPTS} armpe "$(tdir_armpe)"
+ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} coff_sparc "$(tdir_coff_sparc)"
+edelta68.c: $(srcdir)/emulparams/delta68.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/delta68.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} delta68 "$(tdir_delta68)"
+eebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} ebmon29k "$(tdir_ebmon29k)"
+eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
+eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
+eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfmips.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)"
+eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)"
+eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfmips.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)"
+eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)"
+eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
+eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf64_sparc "$(tdir_elf64_sparc)"
+eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
+egld960.c: $(srcdir)/emulparams/gld960.sh \
+ $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} gld960 "$(tdir_gld960)"
+egld960coff.c: $(srcdir)/emulparams/gld960coff.sh \
+ $(srcdir)/emultempl/gld960c.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} gld960coff "$(tdir_gld960coff)"
ego32.c: $(srcdir)/emulparams/go32.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} go32
-enews.c: $(srcdir)/emulparams/news.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} news
-evax.c: $(srcdir)/emulparams/vax.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} vax
+ ${GENSCRIPTS} go32 "$(tdir_go32)"
+eh8300.c: $(srcdir)/emulparams/h8300.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300 "$(tdir_h8300)"
+eh8300h.c: $(srcdir)/emulparams/h8300h.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300h "$(tdir_h8300h)"
+eh8500.c: $(srcdir)/emulparams/h8500.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8500 "$(tdir_h8500)"
+eh8500b.c: $(srcdir)/emulparams/h8500b.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500b.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8500b "$(tdir_h8500b)"
+eh8500c.c: $(srcdir)/emulparams/h8500c.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500c.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8500c "$(tdir_h8500c)"
+eh8500m.c: $(srcdir)/emulparams/h8500m.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500m.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8500m "$(tdir_h8500m)"
+eh8500s.c: $(srcdir)/emulparams/h8500s.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500s.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8500s "$(tdir_h8500s)"
ehp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hp300bsd
+ ${GENSCRIPTS} hp300bsd "$(tdir_hp300bsd)"
ehp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hp3hpux
-ei386pe.c: $(srcdir)/emulparams/i386pe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386pe
-eppcpe.c: $(srcdir)/emulparams/ppcpe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/ppcpe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ppcpe
+ ${GENSCRIPTS} hp3hpux "$(tdir_hp3hpux)"
ehppaelf.c: $(srcdir)/emulparams/hppaelf.sh \
$(srcdir)/emultempl/hppaelf.em $(srcdir)/scripttempl/hppaelf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hppaelf
+ ${GENSCRIPTS} hppaelf "$(tdir_hppaelf)"
ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386aout
+ ${GENSCRIPTS} i386aout "$(tdir_i386aout)"
+ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386bsd "$(tdir_i386bsd)"
+ei386coff.c: $(srcdir)/emulparams/i386coff.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386coff "$(tdir_i386coff)"
ei386go32.c: $(srcdir)/emulparams/i386go32.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386go32
+ ${GENSCRIPTS} i386go32 "$(tdir_i386go32)"
+ei386linux.c: $(srcdir)/emulparams/i386linux.sh \
+ $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386linux "$(tdir_i386linux)"
+ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386lynx.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386lynx "$(tdir_i386lynx)"
ei386mach.c: $(srcdir)/emulparams/i386mach.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386mach
+ ${GENSCRIPTS} i386mach "$(tdir_i386mach)"
ei386moss.c: $(srcdir)/emulparams/i386moss.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386moss
+ ${GENSCRIPTS} i386moss "$(tdir_i386moss)"
ei386msdos.c: $(srcdir)/emulparams/i386msdos.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386msdos.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386msdos
-eebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ebmon29k
-esa29200.c: $(srcdir)/emulparams/sa29200.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sa29200
-ea29k.c: $(srcdir)/emulparams/a29k.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} a29k
-em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
- $(srcdir)/emultempl/m88kbcs.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m88kbcs
-eh8300.c: $(srcdir)/emulparams/h8300.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300
-eh8300h.c: $(srcdir)/emulparams/h8300h.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300h
-eh8500.c: $(srcdir)/emulparams/h8500.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500
-eh8500b.c: $(srcdir)/emulparams/h8500b.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500b.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500b
-eh8500c.c: $(srcdir)/emulparams/h8500c.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500c.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500c
-eh8500m.c: $(srcdir)/emulparams/h8500m.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500m.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500m
-eh8500s.c: $(srcdir)/emulparams/h8500s.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500s.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500s
-esh.c: $(srcdir)/emulparams/sh.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sh
-eshl.c: $(srcdir)/emulparams/shl.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shl
-est2000.c: $(srcdir)/emulparams/st2000.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} st2000
-evanilla.c: $(srcdir)/emulparams/vanilla.sh \
- $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} vanilla
+ ${GENSCRIPTS} i386msdos "$(tdir_i386msdos)"
+ei386nbsd.c: $(srcdir)/emulparams/i386nbsd.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386nbsd "$(tdir_i386nbsd)"
+ei386nw.c: $(srcdir)/emulparams/i386nw.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386nw "$(tdir_i386nw)"
+ei386pe.c: $(srcdir)/emulparams/i386pe.sh \
+ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386pe "$(tdir_i386pe)"
elnk960.c: $(srcdir)/emulparams/lnk960.sh \
$(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} lnk960
-egld960.c: $(srcdir)/emulparams/gld960.sh \
- $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} gld960
-egld960coff.c: $(srcdir)/emulparams/gld960coff.sh \
- $(srcdir)/emultempl/gld960c.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} gld960coff
+ ${GENSCRIPTS} lnk960 "$(tdir_lnk960)"
+em68k4knbsd.c: $(srcdir)/emulparams/m68k4knbsd.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68k4knbsd "$(tdir_m68k4knbsd)"
+em68kaout.c: $(srcdir)/emulparams/m68kaout.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68kaout "$(tdir_m68kaout)"
+em68kaux.c: $(srcdir)/emulparams/m68kaux.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kaux.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68kaux "$(tdir_m68kaux)"
em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kcoff
+ ${GENSCRIPTS} m68kcoff "$(tdir_m68kcoff)"
em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kelf
+ ${GENSCRIPTS} m68kelf "$(tdir_m68kelf)"
+em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
+ $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68klinux "$(tdir_m68klinux)"
em68klynx.c: $(srcdir)/emulparams/m68klynx.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68klynx.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68klynx
-ei386coff.c: $(srcdir)/emulparams/i386coff.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386coff
-ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386lynx.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386lynx
-emipslit.c: $(srcdir)/emulparams/mipslit.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mipslit
-ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
+ ${GENSCRIPTS} m68klynx "$(tdir_m68klynx)"
+em68knbsd.c: $(srcdir)/emulparams/m68knbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386bsd
+ ${GENSCRIPTS} m68knbsd "$(tdir_m68knbsd)"
+em68kpsos.c: $(srcdir)/emulparams/m68kpsos.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/psos.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68kpsos "$(tdir_m68kpsos)"
+em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
+ $(srcdir)/emultempl/m88kbcs.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m88kbcs "$(tdir_m88kbcs)"
emipsbig.c: $(srcdir)/emulparams/mipsbig.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
${GENSCRIPTS} mipsbig
@@ -402,113 +519,82 @@ emipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \
${GENSCRIPTS} mipsbsd
emipsidt.c: $(srcdir)/emulparams/mipsidt.sh \
$(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mipsidt
+ ${GENSCRIPTS} mipsidt "$(tdir_mipsidt)"
emipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
$(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mipsidtl
-eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386
-eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32bmip
-eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32lmip
-eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32b4300
-eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32l4300
-ealpha.c: $(srcdir)/emulparams/alpha.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/alpha.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} alpha
-ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} coff_sparc
-esparclynx.c: $(srcdir)/emulparams/sparclynx.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparclynx.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sparclynx
-eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppc
-eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32lppc
-eriscix.c: $(srcdir)/emulparams/riscix.sh \
+ ${GENSCRIPTS} mipsidtl "$(tdir_mipsidtl)"
+emipslit.c: $(srcdir)/emulparams/mipslit.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} mipslit "$(tdir_mipslit)"
+enews.c: $(srcdir)/emulparams/news.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} riscix
-em68kaout.c: $(srcdir)/emulparams/m68kaout.sh \
+ ${GENSCRIPTS} news "$(tdir_news)"
+ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kaout
-ei386linux.c: $(srcdir)/emulparams/i386linux.sh \
- $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386linux
-eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32_sparc
-eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64_sparc
-
+ ${GENSCRIPTS} ns32knbsd "$(tdir_ns32knbsd)"
epc532machaout.c: $(srcdir)/emulparams/pc532machaout.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} pc532machaout
-
-ew65.c: $(srcdir)/emulparams/w65.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/w65.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} w65
-
-ei386nw.c: $(srcdir)/emulparams/i386nw.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386nw
+ ${GENSCRIPTS} pc532machaout "$(tdir_pc532machaout)"
+eppcmacos.c: $(srcdir)/emulparams/ppcmacos.sh \
+ $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} ppcmacos "$(tdir_ppcmacos)"
eppcnw.c: $(srcdir)/emulparams/ppcnw.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ppcnw
-
-ei386nbsd.c: $(srcdir)/emulparams/i386nbsd.sh \
+ ${GENSCRIPTS} ppcnw "$(tdir_ppcnw)"
+eppcpe.c: $(srcdir)/emulparams/ppcpe.sh \
+ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/ppcpe.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} ppcpe "$(tdir_ppcpe)"
+eriscix.c: $(srcdir)/emulparams/riscix.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386nbsd
-em68k4knbsd.c: $(srcdir)/emulparams/m68k4knbsd.sh \
+ ${GENSCRIPTS} riscix "$(tdir_riscix)"
+esa29200.c: $(srcdir)/emulparams/sa29200.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} sa29200 "$(tdir_sa29200)"
+esh.c: $(srcdir)/emulparams/sh.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} sh "$(tdir_sh)"
+eshl.c: $(srcdir)/emulparams/shl.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} shl "$(tdir_shl)"
+esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68k4knbsd
-em68knbsd.c: $(srcdir)/emulparams/m68knbsd.sh \
+ ${GENSCRIPTS} sparcaout "$(tdir_sparcaout)"
+esparclynx.c: $(srcdir)/emulparams/sparclynx.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparclynx.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} sparclynx "$(tdir_sparclynx)"
+esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68knbsd
-ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
+ ${GENSCRIPTS} sparcnbsd "$(tdir_sparcnbsd)"
+est2000.c: $(srcdir)/emulparams/st2000.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} st2000 "$(tdir_st2000)"
+esun3.c: $(srcdir)/emulparams/sun3.sh \
+ $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} sun3 "$(tdir_sun3)"
+esun4.c: $(srcdir)/emulparams/sun4.sh \
+ $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} sun4 "$(tdir_sun4)"
+evanilla.c: $(srcdir)/emulparams/vanilla.sh \
+ $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} vanilla "$(tdir_vanilla)"
+evax.c: $(srcdir)/emulparams/vax.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ns32knbsd
-esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \
+ ${GENSCRIPTS} vax "$(tdir_vax)"
+evsta.c: $(srcdir)/emulparams/vsta.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sparcnbsd
-earmaoutl.c: $(srcdir)/emulparams/armaoutl.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armaoutl
-earmaoutb.c: $(srcdir)/emulparams/armaoutb.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armaoutb
-earmcoff.c: $(srcdir)/emulparams/armcoff.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armcoff
+ ${GENSCRIPTS} vsta "$(tdir_vsta)"
+ew65.c: $(srcdir)/emulparams/w65.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/w65.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} w65 "$(tdir_w65)"
ez8001.c: $(srcdir)/emulparams/z8001.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} z8001
+ ${GENSCRIPTS} z8001 "$(tdir_z8001)"
ez8002.c: $(srcdir)/emulparams/z8002.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} z8002
-eaixppc.c: $(srcdir)/emulparams/aixppc.sh \
- $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} aixppc
-eaixrs6.c: $(srcdir)/emulparams/aixrs6.sh \
- $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} aixrs6
-edelta68.c: $(srcdir)/emulparams/delta68.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/delta68.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} delta68
+ ${GENSCRIPTS} z8002 "$(tdir_z8002)"
-$(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
- $(CC) $(CFLAGS) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(EXTRALIBS)
+$(LD_PROG): $(OFILES) $(BFDDEP) $(LIBIBERTY)
+ $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(EXTRALIBS)
# The generated emulation files mostly have the same dependencies.
$(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
@@ -558,6 +644,8 @@ check: site.exp
r=`pwd`; export r; \
srcroot=`cd ${srcdir}; pwd` ; export srcroot ; \
EXPECT=${EXPECT} ; export EXPECT ; \
+ $(RPATH_ENVVAR)=$$r/../bfd:$$r/../opcodes:$$$(RPATH_ENVVAR); \
+ export $(RPATH_ENVVAR); \
if [ -f $$r/../expect/expect ] ; then \
TCL_LIBRARY=$${srcroot}/../tcl/library ; \
export TCL_LIBRARY ; \
@@ -807,6 +895,8 @@ install:
for f in ldscripts/*; do \
$(INSTALL_DATA) $$f $(scriptdir)/$$f ; \
done
+ test -d $(tooldir) || mkdir $(tooldir)
+ test -d $(tooldir)/bin || mkdir $(tooldir)/bin
-n=`echo ld | sed '$(program_transform_name)'`; \
rm -f $(tooldir)/bin/ld; \
ln $(bindir)/$$n $(tooldir)/bin/ld >/dev/null 2>/dev/null \
@@ -907,15 +997,15 @@ ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
ldemul.h ldlex.h ldfile.h ldctor.h
ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
- ld.h ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h \
- ldfile.h
+ $(INCDIR)/libiberty.h $(INCDIR)/demangle.h ld.h ldmisc.h \
+ ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h ldfile.h
ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
ld.h ldver.h ldemul.h ldmain.h
ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
- $(INCDIR)/bfdlink.h ld.h ldexp.h ldlang.h ldwrite.h \
- ldmisc.h ldgram.h ldmain.h
+ $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h ld.h ldexp.h \
+ ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h
lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/getopt.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
@@ -924,6 +1014,10 @@ lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/obstack.h \
sysdep.h config.h $(INCDIR)/fopen-same.h ld.h ldexp.h \
ldlang.h ldmisc.h mri.h ldgram.h
+ldcref.o: ldcref.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h ld.h ldmain.h \
+ ldmisc.h
ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/bfdlink.h ld.h ldexp.h ldver.h ldlang.h ldemul.h \
diff --git a/gnu/usr.bin/binutils/ld/NEWS b/gnu/usr.bin/binutils/ld/NEWS
index 7cc3a59b9a3..7d367b8bc12 100644
--- a/gnu/usr.bin/binutils/ld/NEWS
+++ b/gnu/usr.bin/binutils/ld/NEWS
@@ -1,5 +1,20 @@
-*- text -*-
+Changes since version 2.6:
+
+* New option --cref to print out a cross reference table.
+
+* New option --wrap SYMBOL.
+
+* New option --no-whole-archive, to turn off the effect of --whole-archive.
+
+* Input sections assigned to the output section /DISCARD/ in the linker script
+ are not included in the output file.
+
+* The SunOS and ELF linkers now merge stabs debugging information which uses
+ the N_BINCL and N_EINCL stab types. This reduces the amount of debugging
+ information generated.
+
Changes since version 2.5:
* When an ELF section name is representable as a C identifier (this is not true
diff --git a/gnu/usr.bin/binutils/ld/TODO b/gnu/usr.bin/binutils/ld/TODO
index cd4a59b028f..31cd98ba236 100644
--- a/gnu/usr.bin/binutils/ld/TODO
+++ b/gnu/usr.bin/binutils/ld/TODO
@@ -4,8 +4,6 @@ Support the "traditional" BSD -A flag (incremental loading).
(There is a -A flag in ld now, but it is used to specify the
architecture. That should probably be changed.)
-Shared library support is missing.
-
Support for dynamic loading (a la dld, but bfd-based) would be nice.
Avoid re-open (and re-seeking) output bfd and archives.
diff --git a/gnu/usr.bin/binutils/ld/acconfig.h b/gnu/usr.bin/binutils/ld/acconfig.h
index 930d663d2c6..75c00ffbc06 100644
--- a/gnu/usr.bin/binutils/ld/acconfig.h
+++ b/gnu/usr.bin/binutils/ld/acconfig.h
@@ -1,5 +1,7 @@
-/* Do we need to use the b modifier when opening binary files? */
-#undef USE_BINARY_FOPEN
/* Whether free must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_FREE
+@TOP@
+
+/* Do we need to use the b modifier when opening binary files? */
+#undef USE_BINARY_FOPEN
diff --git a/gnu/usr.bin/binutils/ld/config.in b/gnu/usr.bin/binutils/ld/config.in
index b4cf7292a1a..d4446c47c61 100644
--- a/gnu/usr.bin/binutils/ld/config.in
+++ b/gnu/usr.bin/binutils/ld/config.in
@@ -1,11 +1,11 @@
/* config.in. Generated automatically from configure.in by autoheader. */
-/* Do we need to use the b modifier when opening binary files? */
-#undef USE_BINARY_FOPEN
-
/* Whether free must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_FREE
+/* Do we need to use the b modifier when opening binary files? */
+#undef USE_BINARY_FOPEN
+
/* Define if you have the sbrk function. */
#undef HAVE_SBRK
diff --git a/gnu/usr.bin/binutils/ld/configure b/gnu/usr.bin/binutils/ld/configure
index f94a854f9a1..027e210c96b 100644
--- a/gnu/usr.bin/binutils/ld/configure
+++ b/gnu/usr.bin/binutils/ld/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.4
+# Generated automatically using autoconf version 2.8
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -13,6 +13,8 @@ ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
--enable-targets alternative target configurations"
+ac_help="$ac_help
+ --enable-shared build shared BFD library"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -35,9 +37,22 @@ target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
+MFLAGS= MAKEFLAGS=
ac_prev=
for ac_option
@@ -59,9 +74,14 @@ do
case "$ac_option" in
- -build | --build | --buil | --bui | --bu | --b)
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
build="$ac_optarg" ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
@@ -71,6 +91,12 @@ do
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file="$ac_optarg" ;;
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
-disable-* | --disable-*)
ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
# Reject names that are not valid shell variable names.
@@ -121,12 +147,29 @@ Configuration:
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
- --exec-prefix=PREFIX install architecture-dependent files in 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
+ --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]
@@ -138,8 +181,10 @@ Features and packages:
--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
---enable and --with options recognized:$ac_help
EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
exit 0 ;;
-host | --host | --hos | --ho)
@@ -147,6 +192,44 @@ EOF
-host=* | --host=* | --hos=* | --ho=*)
host="$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" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ 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" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
@@ -159,6 +242,15 @@ EOF
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
@@ -199,6 +291,23 @@ EOF
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
@@ -209,6 +318,13 @@ EOF
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
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" ;;
+
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
@@ -218,7 +334,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.4"
+ echo "configure generated by autoconf version 2.8"
exit 0 ;;
-with-* | --with-*)
@@ -264,7 +380,7 @@ EOF
-*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
;;
- *)
+ *)
if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
echo "configure: warning: $ac_option: invalid host type" 1>&2
fi
@@ -384,8 +500,8 @@ 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 2>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5'
+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'
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
@@ -402,8 +518,8 @@ fi
# Check whether --enable-targets or --disable-targets was given.
-enableval="$enable_targets"
-if test -n "$enableval"; then
+if test "${enable_targets+set}" = set; then
+ enableval="$enable_targets"
case "${enableval}" in
yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
;;
@@ -411,6 +527,16 @@ if test -n "$enableval"; then
*) enable_targets=$enableval ;;
esac
fi
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ case "${enableval}" in
+ yes) shared=true ;;
+ no) shared=false ;;
+ *bfd*) shared=true ;;
+ *) shared=false ;;
+esac
+fi
@@ -440,7 +566,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
#
# The rules are:
# 1. You are not allowed to specify --host, --target, and nonopt at the
-# same time.
+# same time.
# 2. Host defaults to nonopt.
# 3. If nonopt is not specified, then host defaults to the current host,
# as determined by config.guess.
@@ -528,8 +654,10 @@ fi
if test "$program_transform_name" = s,x,x,; then
program_transform_name=
else
- # Double any \ or $.
- echo 's,\\,\\\\,g; s,\$,$$,g' > conftestsed
+ # Double any \ or $. echo might interpret backslashes.
+ cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
rm -f conftestsed
fi
@@ -545,23 +673,119 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
# host-specific stuff:
-. ${srcdir}/configure.host
+# 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
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+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
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ ac_prog_rejected=no
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
-echo $ac_n "checking for CC""... $ac_c" 1>&6
-test -z "$CC" && test -r ../Makefile && CC=`egrep '^CC *=' ../Makefile | tail -1 | sed 's/^CC *= *//'`
-test -z "$CC" && CC=cc
-echo "$ac_t""setting CC to $CC" 1>&6
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
-cat > conftest.c <<EOF
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
#ifdef __GNUC__
yes;
#endif
EOF
-if ${CC-cc} -E conftest.c 2>&5 | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:763: \"$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
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+if test $ac_cv_prog_gcc = yes; then
GCC=yes
if test "${CFLAGS+set}" != set; then
- echo 'void f(){}' > conftest.c
- if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_gcc_g=yes
+else
+ ac_cv_prog_gcc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
+ if test $ac_cv_prog_gcc_g = yes; then
CFLAGS="-g -O"
else
CFLAGS="-O"
@@ -571,7 +795,10 @@ else
GCC=
test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
-rm -f conftest*
+
+
+. ${srcdir}/configure.host
+
@@ -579,6 +806,21 @@ rm -f conftest*
+# For most hosts we can use a simple definition to pick up the BFD and
+# opcodes libraries. However, if we are building shared libraries, we
+# need to handle some hosts specially.
+BFDLIB='-L../bfd -lbfd'
+if test "${shared}" = "true"; then
+ case "${host}" in
+ *-*-sunos*)
+ # On SunOS, we must link against the name we are going to install,
+ # not -lbfd, since SunOS does not support SONAME.
+ BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
+ ;;
+ esac
+fi
+
+
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
@@ -594,12 +836,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 598 "configure"
+#line 840 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:846: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -608,12 +851,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 612 "configure"
+#line 855 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -641,11 +885,12 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 645 "configure"
+#line 889 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -659,7 +904,7 @@ rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
+ ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
@@ -676,13 +921,13 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 680 "configure"
+#line 925 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
-char $ac_func();
+char $ac_func();
int main() { return 0; }
int t() {
@@ -698,7 +943,7 @@ $ac_func();
; return 0; }
EOF
-if eval $ac_link; then
+if { (eval echo configure:947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -710,7 +955,7 @@ rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
@@ -729,7 +974,7 @@ if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 733 "configure"
+#line 978 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -738,7 +983,7 @@ int t() {
DIR *dirp = 0;
; return 0; }
EOF
-if eval $ac_compile; then
+if { (eval echo configure:987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -750,7 +995,7 @@ rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
+ ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdedfghijklmnopqrstuvwxyz./\055' 'ABCDEDFGHIJKLMNOPQRSTUVWXYZ___'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
@@ -762,13 +1007,14 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for -ldir""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_lib_dir'+set}'`\" = set"; then
+ac_lib_var=`echo dir_opendir | tr '.-/+' '___p'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 772 "configure"
+#line 1018 "configure"
#include "confdefs.h"
int main() { return 0; }
@@ -776,18 +1022,18 @@ int t() {
opendir()
; return 0; }
EOF
-if eval $ac_link; then
+if { (eval echo configure:1026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
- eval "ac_cv_lib_dir=yes"
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
rm -rf conftest*
- eval "ac_cv_lib_dir=no"
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
-if eval "test \"`echo '$ac_cv_lib_'dir`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
LIBS="$LIBS -ldir"
else
@@ -796,13 +1042,14 @@ fi
else
echo $ac_n "checking for -lx""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_lib_x'+set}'`\" = set"; then
+ac_lib_var=`echo x_opendir | tr '.-/+' '___p'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 806 "configure"
+#line 1053 "configure"
#include "confdefs.h"
int main() { return 0; }
@@ -810,18 +1057,18 @@ int t() {
opendir()
; return 0; }
EOF
-if eval $ac_link; then
+if { (eval echo configure:1061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
- eval "ac_cv_lib_x=yes"
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
rm -rf conftest*
- eval "ac_cv_lib_x=no"
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
-if eval "test \"`echo '$ac_cv_lib_'x`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
LIBS="$LIBS -lx"
else
@@ -831,8 +1078,9 @@ fi
fi
+
case "${host}" in
-i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-win32)
+i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32)
cat >> confdefs.h <<\EOF
#define USE_BINARY_FOPEN 1
EOF
@@ -844,7 +1092,7 @@ if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 848 "configure"
+#line 1096 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -856,10 +1104,10 @@ else
#endif
int main() { return 0; }
int t() {
-int (*pfn) = (int (*)) free
+char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if eval $ac_compile; then
+if { (eval echo configure:1111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -872,66 +1120,64 @@ fi
echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6
if test $bfd_cv_decl_needed_free = yes; then
- cat >> confdefs.h <<\EOF
-#define NEED_DECLARATION_FREE 1
+ bfd_tr_decl=NEED_DECLARATION_`echo free | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $bfd_tr_decl 1
EOF
fi
-# target-specific stuff:
-# Canonicalize the secondary target names.
-if test -n "$enable_targets"; then
- for targ in `echo $enable_targets | sed 's/,/ /g'`
- do
- result=`$ac_config_sub $targ 2>/dev/null`
- if test -n "$result"; then
- canon_targets="$canon_targets $result"
- else
- # Allow targets that config.sub doesn't recognize, like "all".
- canon_targets="$canon_targets $targ"
- fi
- done
-fi
+# target-specific stuff:
-all_targets=false
+all_targets=
EMUL=
all_emuls=
+TDIRS=
-for targ in $target $canon_targets
+for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
do
- if test "x$targ" = "xall"; then
- all_targets=true
+ if test "$targ_alias" = "all"; then
+ all_targets=true
+ else
+ # Canonicalize the secondary target names.
+ result=`$ac_config_sub $targ_alias 2>/dev/null`
+ if test -n "$result"; then
+ targ=$result
else
- . ${srcdir}/configure.tgt
-
- if test "x$targ" = "x$target"; then
- EMUL=${targ_emul}
- fi
-
- all_emuls="${all_emuls} ${targ_emul} ${targ_extra_emuls}"
+ targ=$targ_alias
fi
-done
+ . ${srcdir}/configure.tgt
+ if test "$targ" = "$target"; then
+ EMUL=$targ_emul
+ fi
-if test x${all_targets} = xfalse; then
- # uniq the list.
- f=""
- for i in $all_emuls ; do
- case " $f " in
- *" e$i.o "*) ;;
- *) f="$f e$i.o" ;;
+ for i in $targ_emul $targ_extra_emuls; do
+ case " $all_emuls " in
+ *" e${i}.o "*) ;;
+ *)
+ all_emuls="$all_emuls e${i}.o"
+ eval result=\$tdir_$i
+ test -z "$result" && result=$targ_alias
+ TDIRS="$TDIRS\\
+tdir_$i=$result"
+ ;;
esac
done
+ fi
+done
- EMULATION_OFILES="$f"
-else # all_targets is true
- EMULATION_OFILES='$(ALL_EMULATIONS)'
-fi # all_targets is true
+if test x${all_targets} = xtrue; then
+ EMULATION_OFILES='$(ALL_EMULATIONS)'
+else
+ EMULATION_OFILES=$all_emuls
+fi
+
trap '' 1 2 15
cat > confcache <<\EOF
@@ -1009,7 +1255,7 @@ do
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.4"
+ echo "$CONFIG_STATUS generated by autoconf version 2.8"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -1020,10 +1266,12 @@ done
ac_given_srcdir=$srcdir
trap 'rm -fr `echo "Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
-# 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
+# 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%@CFLAGS@%$CFLAGS%g
@@ -1035,6 +1283,18 @@ 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%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
@@ -1051,12 +1311,16 @@ s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@CC@%$CC%g
+s%@HLDFLAGS@%$HLDFLAGS%g
+s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g
s%@HDEFINES@%$HDEFINES%g
s%@HOSTING_CRT0@%$HOSTING_CRT0%g
s%@HOSTING_LIBS@%$HOSTING_LIBS%g
s%@NATIVE_LIB_DIRS@%$NATIVE_LIB_DIRS%g
+s%@BFDLIB@%$BFDLIB%g
s%@CPP@%$CPP%g
s%@EMUL@%$EMUL%g
+s%@TDIRS@%$TDIRS%g
s%@EMULATION_OFILES@%$EMULATION_OFILES%g
CEOF
@@ -1151,7 +1415,7 @@ EOF
# Transform confdefs.h into a sed script conftest.vals that substitutes
# the proper values into config.h.in to produce config.h. And first:
-# Protect against being on the right side of a sed subst in config.status.
+# Protect against being on the right side of a sed subst in config.status.
# Protect against being in an unquoted here document in config.status.
rm -f conftest.vals
cat > conftest.hdr <<\EOF
diff --git a/gnu/usr.bin/binutils/ld/configure.in b/gnu/usr.bin/binutils/ld/configure.in
index eebefd384a2..5cb26ed6d8f 100644
--- a/gnu/usr.bin/binutils/ld/configure.in
+++ b/gnu/usr.bin/binutils/ld/configure.in
@@ -11,6 +11,14 @@ AC_ARG_ENABLE(targets,
no) enable_targets= ;;
*) enable_targets=$enableval ;;
esac])dnl
+AC_ARG_ENABLE(shared,
+[ --enable-shared build shared BFD library],
+[case "${enableval}" in
+ yes) shared=true ;;
+ no) shared=false ;;
+ *bfd*) shared=true ;;
+ *) shared=false ;;
+esac])dnl
AC_CONFIG_HEADER(config.h:config.in)
@@ -26,91 +34,89 @@ AC_ARG_PROGRAM
# host-specific stuff:
+AC_PROG_CC
+
. ${srcdir}/configure.host
-AC_PROG_CC
-AC_SUBST(CFLAGS)
+AC_SUBST(HLDFLAGS)
+AC_SUBST(RPATH_ENVVAR)
AC_SUBST(HDEFINES)
AC_SUBST(HOSTING_CRT0)
AC_SUBST(HOSTING_LIBS)
AC_SUBST(NATIVE_LIB_DIRS)
+# For most hosts we can use a simple definition to pick up the BFD and
+# opcodes libraries. However, if we are building shared libraries, we
+# need to handle some hosts specially.
+BFDLIB='-L../bfd -lbfd'
+if test "${shared}" = "true"; then
+ case "${host}" in
+ *-*-sunos*)
+ # On SunOS, we must link against the name we are going to install,
+ # not -lbfd, since SunOS does not support SONAME.
+ BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
+ ;;
+ esac
+fi
+AC_SUBST(BFDLIB)
+
AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
AC_CHECK_FUNCS(sbrk)
AC_HEADER_DIRENT
BFD_BINARY_FOPEN
-AC_MSG_CHECKING([whether free must be declared])
-AC_CACHE_VAL(bfd_cv_decl_needed_free,
-[AC_TRY_COMPILE([
-#include <stdio.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif],
-[int (*pfn) = (int (*)) free],
-bfd_cv_decl_needed_free=no, bfd_cv_decl_needed_free=yes)])
-AC_MSG_RESULT($bfd_cv_decl_needed_free)
-if test $bfd_cv_decl_needed_free = yes; then
- AC_DEFINE(NEED_DECLARATION_FREE)
-fi
+BFD_NEED_DECLARATION(free)
# target-specific stuff:
-# Canonicalize the secondary target names.
-if test -n "$enable_targets"; then
- for targ in `echo $enable_targets | sed 's/,/ /g'`
- do
- result=`$ac_config_sub $targ 2>/dev/null`
- if test -n "$result"; then
- canon_targets="$canon_targets $result"
- else
- # Allow targets that config.sub doesn't recognize, like "all".
- canon_targets="$canon_targets $targ"
- fi
- done
-fi
-
-all_targets=false
+all_targets=
EMUL=
all_emuls=
+TDIRS=
-for targ in $target $canon_targets
+for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
do
- if test "x$targ" = "xall"; then
- all_targets=true
+ if test "$targ_alias" = "all"; then
+ all_targets=true
+ else
+ # Canonicalize the secondary target names.
+ result=`$ac_config_sub $targ_alias 2>/dev/null`
+ if test -n "$result"; then
+ targ=$result
else
- . ${srcdir}/configure.tgt
+ targ=$targ_alias
+ fi
- if test "x$targ" = "x$target"; then
- EMUL=${targ_emul}
- fi
+ . ${srcdir}/configure.tgt
- all_emuls="${all_emuls} ${targ_emul} ${targ_extra_emuls}"
+ if test "$targ" = "$target"; then
+ EMUL=$targ_emul
fi
-done
-
-AC_SUBST(EMUL)
-if test x${all_targets} = xfalse; then
- # uniq the list.
- f=""
- for i in $all_emuls ; do
- case " $f " in
- *" e$i.o "*) ;;
- *) f="$f e$i.o" ;;
+ for i in $targ_emul $targ_extra_emuls; do
+ case " $all_emuls " in
+ *" e${i}.o "*) ;;
+ *)
+ all_emuls="$all_emuls e${i}.o"
+ eval result=\$tdir_$i
+ test -z "$result" && result=$targ_alias
+ TDIRS="$TDIRS\\
+tdir_$i=$result"
+ ;;
esac
done
+ fi
+done
- EMULATION_OFILES="$f"
-
-else # all_targets is true
- EMULATION_OFILES='$(ALL_EMULATIONS)'
-fi # all_targets is true
+AC_SUBST(EMUL)
+AC_SUBST(TDIRS)
+if test x${all_targets} = xtrue; then
+ EMULATION_OFILES='$(ALL_EMULATIONS)'
+else
+ EMULATION_OFILES=$all_emuls
+fi
AC_SUBST(EMULATION_OFILES)
AC_OUTPUT(Makefile,
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32b4300.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32b4300.sh
index b8755889d1f..3ccdad39d04 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32b4300.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32b4300.sh
@@ -1,8 +1,8 @@
-SCRIPT_NAME=elf
+SCRIPT_NAME=elfmips
OUTPUT_FORMAT="elf32-bigmips"
BIG_OUTPUT_FORMAT="elf32-bigmips"
LITTLE_OUTPUT_FORMAT="elf32-littlemips"
-TEXT_START_ADDR=0xa001af20
+TEXT_START_ADDR=0xa0020000
DATA_ADDR=.
MAXPAGESIZE=0x40000
OTHER_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
@@ -20,6 +20,7 @@ OTHER_SECTIONS='
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
'
ARCH=mips
+MACHINE=4000
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
DYNAMIC_LINK=false
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32bmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32bmip.sh
index 470497d8fc6..3bc284e6d0c 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32bmip.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32bmip.sh
@@ -1,4 +1,4 @@
-SCRIPT_NAME=elf
+SCRIPT_NAME=elfmips
OUTPUT_FORMAT="elf32-bigmips"
BIG_OUTPUT_FORMAT="elf32-bigmips"
LITTLE_OUTPUT_FORMAT="elf32-littlemips"
@@ -6,16 +6,18 @@ TEXT_START_ADDR=0x0400000
DATA_ADDR=0x10000000
MAXPAGESIZE=0x40000
NONPAGED_TEXT_START_ADDR=0x0400000
+SHLIB_TEXT_START_ADDR=0x5ffe0000
OTHER_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
+OTHER_GOT_SYMBOLS='
+ _gp = ALIGN(16) + 0x7ff0;
+'
OTHER_READWRITE_SECTIONS='
- _gp = . + 0x8000;
.lit8 : { *(.lit8) }
.lit4 : { *(.lit4) }
'
TEXT_START_SYMBOLS='_ftext = . ;'
DATA_START_SYMBOLS='_fdata = . ;'
OTHER_BSS_SYMBOLS='_fbss = .;'
-EXECUTABLE_SYMBOLS='_DYNAMIC_LINK = 0;'
OTHER_SECTIONS='
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
@@ -23,4 +25,4 @@ OTHER_SECTIONS='
ARCH=mips
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
-DYNAMIC_LINK=false
+EMBEDDED=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32l4300.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32l4300.sh
index aeac8a88efb..f3cd085a577 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32l4300.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32l4300.sh
@@ -1,8 +1,8 @@
-SCRIPT_NAME=elf
+SCRIPT_NAME=elfmips
OUTPUT_FORMAT="elf32-littlemips"
BIG_OUTPUT_FORMAT="elf32-bigmips"
LITTLE_OUTPUT_FORMAT="elf32-littlemips"
-TEXT_START_ADDR=0xa001af20
+TEXT_START_ADDR=0xa0020000
DATA_ADDR=.
MAXPAGESIZE=0x40000
OTHER_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
@@ -20,6 +20,7 @@ OTHER_SECTIONS='
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
'
ARCH=mips
+MACHINE=4000
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
DYNAMIC_LINK=false
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32lmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32lmip.sh
index bb91f350cce..c892dc17cbb 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32lmip.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32lmip.sh
@@ -1,4 +1,4 @@
-SCRIPT_NAME=elf
+SCRIPT_NAME=elfmips
OUTPUT_FORMAT="elf32-littlemips"
BIG_OUTPUT_FORMAT="elf32-bigmips"
LITTLE_OUTPUT_FORMAT="elf32-littlemips"
@@ -6,16 +6,18 @@ TEXT_START_ADDR=0x0400000
DATA_ADDR=0x10000000
MAXPAGESIZE=0x40000
NONPAGED_TEXT_START_ADDR=0x0400000
+SHLIB_TEXT_START_ADDR=0x5ffe0000
OTHER_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
+OTHER_GOT_SYMBOLS='
+ _gp = ALIGN(16) + 0x7ff0;
+'
OTHER_READWRITE_SECTIONS='
- _gp = . + 0x8000;
.lit8 : { *(.lit8) }
.lit4 : { *(.lit4) }
'
TEXT_START_SYMBOLS='_ftext = . ;'
DATA_START_SYMBOLS='_fdata = . ;'
OTHER_BSS_SYMBOLS='_fbss = .;'
-EXECUTABLE_SYMBOLS='_DYNAMIC_LINK = 0;'
OTHER_SECTIONS='
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
@@ -23,4 +25,4 @@ OTHER_SECTIONS='
ARCH=mips
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
-DYNAMIC_LINK=false
+EMBEDDED=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32lppc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32lppc.sh
index 50a34af9d5b..65daf8c9eee 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32lppc.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32lppc.sh
@@ -2,8 +2,6 @@ TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
SCRIPT_NAME=elfppc
OUTPUT_FORMAT="elf32-powerpcle"
-TEXT_START_ADDR=0x0400000
-DATA_ADDR=0x10000000
+TEXT_START_ADDR=0x40000
MAXPAGESIZE=0x40000
-NONPAGED_TEXT_START_ADDR=0x0400000
ARCH=powerpc
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh
index f2b44849fcb..4c1e7b31949 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh
@@ -2,8 +2,6 @@ TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
SCRIPT_NAME=elfppc
OUTPUT_FORMAT="elf32-powerpc"
-TEXT_START_ADDR=0x0400000
-DATA_ADDR=0x10000000
+TEXT_START_ADDR=0x40000
MAXPAGESIZE=0x40000
-NONPAGED_TEXT_START_ADDR=0x0400000
ARCH=powerpc
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh
index 668809bdd50..4a9dc0b767a 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh
@@ -3,4 +3,4 @@ OUTPUT_FORMAT="elf64-sparc"
TEXT_START_ADDR=0x100200
MAXPAGESIZE=0x100000
NONPAGED_TEXT_START_ADDR=0x100200
-ARCH=sparc
+ARCH="sparc:v9"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh
index b841d9cd189..b11b7d71886 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh
@@ -1,8 +1,8 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-i386"
-TEXT_START_ADDR=0x08000000
+TEXT_START_ADDR=0x08048000
MAXPAGESIZE=0x1000
-NONPAGED_TEXT_START_ADDR=0x08000000
+NONPAGED_TEXT_START_ADDR=0x08048000
ARCH=i386
NOP=0x9090
TEMPLATE_NAME=elf32
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m68kaux.sh b/gnu/usr.bin/binutils/ld/emulparams/m68kaux.sh
new file mode 100644
index 00000000000..19e86cc6cd1
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/m68kaux.sh
@@ -0,0 +1,8 @@
+SCRIPT_NAME=m68kaux
+OUTPUT_FORMAT="coff-m68k-aux"
+SEGMENT_SIZE=0x40000
+TARGET_PAGE_SIZE=0x1000
+TEXT_START_ADDR="$SEGMENT_SIZE + SIZEOF_HEADERS"
+NON_PAGED_TEXT_START_ADDR=SIZEOF_HEADERS
+DATA_ALIGNMENT_="(. & (-$SEGMENT_SIZE | $TARGET_PAGE_SIZE-1)) + $SEGMENT_SIZE"
+ARCH=m68k
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m68klinux.sh b/gnu/usr.bin/binutils/ld/emulparams/m68klinux.sh
new file mode 100644
index 00000000000..56c3dad9bfc
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/m68klinux.sh
@@ -0,0 +1,7 @@
+SCRIPT_NAME=aout
+OUTPUT_FORMAT="a.out-m68k-linux"
+TARGET_PAGE_SIZE=0x1000
+TEXT_START_ADDR=0x1020
+NONPAGED_TEXT_START_ADDR=0
+ARCH=m68k
+TEMPLATE_NAME=linux
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m68kpsos.sh b/gnu/usr.bin/binutils/ld/emulparams/m68kpsos.sh
new file mode 100644
index 00000000000..34eb8ca549c
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/m68kpsos.sh
@@ -0,0 +1,6 @@
+SCRIPT_NAME=psos
+OUTPUT_FORMAT="elf32-m68k"
+TEXT_START_ADDR=0x20000
+MAXPAGESIZE=0x1000
+ARCH=m68k
+TEMPLATE_NAME=elf32
diff --git a/gnu/usr.bin/binutils/ld/emulparams/mipsidt.sh b/gnu/usr.bin/binutils/ld/emulparams/mipsidt.sh
index cb2d87d3322..63176f5fdea 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/mipsidt.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/mipsidt.sh
@@ -8,3 +8,4 @@ ENTRY=start
TEXT_START_ADDR=0xa0012000
DATA_ADDR=.
TEMPLATE_NAME=mipsecoff
+EMBEDDED=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/mipsidtl.sh b/gnu/usr.bin/binutils/ld/emulparams/mipsidtl.sh
index 57e00261df8..02279ded635 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/mipsidtl.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/mipsidtl.sh
@@ -8,3 +8,4 @@ ENTRY=start
TEXT_START_ADDR=0xa0012000
DATA_ADDR=.
TEMPLATE_NAME=mipsecoff
+EMBEDDED=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/ppcmacos.sh b/gnu/usr.bin/binutils/ld/emulparams/ppcmacos.sh
new file mode 100644
index 00000000000..b6b800c2c6c
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/ppcmacos.sh
@@ -0,0 +1,4 @@
+TEMPLATE_NAME=aix
+SCRIPT_NAME=aix
+OUTPUT_FORMAT="xcoff-powermac"
+ARCH=powerpc
diff --git a/gnu/usr.bin/binutils/ld/emulparams/sparcaout.sh b/gnu/usr.bin/binutils/ld/emulparams/sparcaout.sh
new file mode 100644
index 00000000000..5e01c28e57d
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/sparcaout.sh
@@ -0,0 +1,6 @@
+SCRIPT_NAME=aout
+OUTPUT_FORMAT="a.out-sunos-big"
+TEXT_START_ADDR=0x2020
+TARGET_PAGE_SIZE=0x2000
+NONPAGED_TEXT_START_ADDR=0x2000
+ARCH=sparc
diff --git a/gnu/usr.bin/binutils/ld/emulparams/z8002.sh b/gnu/usr.bin/binutils/ld/emulparams/z8002.sh
index 711b8f38727..299b5f5a45d 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/z8002.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/z8002.sh
@@ -3,4 +3,4 @@ OUTPUT_FORMAT="coff-z8k"
OUTPUT_ARCH="z8002"
TEXT_START_ADDR=0x0
TARGET_PAGE_SIZE=128
-ARCH=z8k
+ARCH=z8002
diff --git a/gnu/usr.bin/binutils/ld/emultempl/aix.em b/gnu/usr.bin/binutils/ld/emultempl/aix.em
index c40b86c2953..42aa1e162e0 100644
--- a/gnu/usr.bin/binutils/ld/emultempl/aix.em
+++ b/gnu/usr.bin/binutils/ld/emultempl/aix.em
@@ -75,6 +75,9 @@ static unsigned short modtype = ('1' << 8) | 'L';
permitted). */
static int textro;
+/* Whether to implement Unix like linker semantics. */
+static int unix_ld;
+
/* Structure used to hold import file list. */
struct filelist
@@ -137,6 +140,7 @@ gld${EMULATION_NAME}_parse_args (argc, argv)
#define OPTION_PD (OPTION_NOSTRCMPCT + 1)
#define OPTION_PT (OPTION_PD + 1)
#define OPTION_STRCMPCT (OPTION_PT + 1)
+#define OPTION_UNIX (OPTION_STRCMPCT + 1)
static struct option longopts[] = {
{"basis", no_argument, NULL, OPTION_IGNORE},
@@ -164,6 +168,7 @@ gld${EMULATION_NAME}_parse_args (argc, argv)
{"bmodtype", required_argument, NULL, OPTION_MODTYPE},
{"bnoautoimp", no_argument, NULL, OPTION_NOAUTOIMP},
{"bnodelcsect", no_argument, NULL, OPTION_IGNORE},
+ {"bnoentry", no_argument, NULL, OPTION_IGNORE},
{"bnogc", no_argument, &gc, 0},
{"bnso", no_argument, NULL, OPTION_NOAUTOIMP},
{"bnostrcmpct", no_argument, NULL, OPTION_NOSTRCMPCT},
@@ -177,6 +182,7 @@ gld${EMULATION_NAME}_parse_args (argc, argv)
{"bstrcmpct", no_argument, NULL, OPTION_STRCMPCT},
{"btextro", no_argument, &textro, 1},
{"static", no_argument, NULL, OPTION_NOAUTOIMP},
+ {"unix", no_argument, NULL, OPTION_UNIX},
{NULL, no_argument, NULL, 0}
};
@@ -333,7 +339,7 @@ gld${EMULATION_NAME}_parse_args (argc, argv)
break;
case OPTION_NOSTRCMPCT:
- config.traditional_format = true;
+ link_info.traditional_format = true;
break;
case OPTION_PD:
@@ -382,13 +388,56 @@ gld${EMULATION_NAME}_parse_args (argc, argv)
break;
case OPTION_STRCMPCT:
- config.traditional_format = false;
+ link_info.traditional_format = false;
+ break;
+
+ case OPTION_UNIX:
+ unix_ld = true;
break;
}
return 1;
}
+/* This is called when an input file can not be recognized as a BFD
+ object or an archive. If the file starts with #!, we must treat it
+ as an import file. This is for AIX compatibility. */
+
+static boolean
+gld${EMULATION_NAME}_unrecognized_file (entry)
+ lang_input_statement_type *entry;
+{
+ FILE *e;
+ boolean ret;
+
+ e = fopen (entry->filename, FOPEN_RT);
+ if (e == NULL)
+ return false;
+
+ ret = false;
+
+ if (getc (e) == '#' && getc (e) == '!')
+ {
+ struct filelist *n;
+ struct filelist **flpp;
+
+ n = (struct filelist *) xmalloc (sizeof (struct filelist));
+ n->next = NULL;
+ n->name = entry->filename;
+ flpp = &import_files;
+ while (*flpp != NULL)
+ flpp = &(*flpp)->next;
+ *flpp = n;
+
+ ret = true;
+ entry->loaded = true;
+ }
+
+ fclose (e);
+
+ return ret;
+}
+
/* This is called after the input files have been opened. */
static void
@@ -400,9 +449,11 @@ gld${EMULATION_NAME}_after_open ()
/* Call ldctor_build_sets, after pretending that this is a
relocateable link. We do this because AIX requires relocation
entries for all references to symbols, even in a final
- executable. */
+ executable. Of course, we only want to do this if we are
+ producing an XCOFF output file. */
r = link_info.relocateable;
- link_info.relocateable = true;
+ if (strstr (bfd_get_target (output_bfd), "xcoff") != NULL)
+ link_info.relocateable = true;
ldctor_build_sets ();
link_info.relocateable = r;
@@ -494,9 +545,10 @@ gld${EMULATION_NAME}_before_allocation ()
if (! bfd_xcoff_size_dynamic_sections (output_bfd, &link_info, libpath,
entry_symbol, file_align,
maxstack, maxdata,
- gc ? true : false,
+ gc && ! unix_ld ? true : false,
modtype,
textro ? true : false,
+ unix_ld,
special_sections))
einfo ("%P%F: failed to set dynamic section sizes: %E\n");
@@ -626,7 +678,7 @@ gld${EMULATION_NAME}_read_file (filename, import)
o = (struct obstack *) xmalloc (sizeof (struct obstack));
obstack_specify_allocation (o, 0, 0, xmalloc, gld${EMULATION_NAME}_free);
- f = fopen (filename, "r");
+ f = fopen (filename, FOPEN_RT);
if (f == NULL)
{
bfd_set_error (bfd_error_system_call);
@@ -692,7 +744,7 @@ gld${EMULATION_NAME}_read_file (filename, import)
(void) obstack_finish (o);
keep = true;
imppath = s;
- impfile = NULL;
+ file = NULL;
while (! isspace ((unsigned char) *s) && *s != '(' && *s != '\0')
{
if (*s == '/')
@@ -986,5 +1038,6 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
0, /* place_orphan */
0, /* set_symbols */
gld${EMULATION_NAME}_parse_args,
+ gld${EMULATION_NAME}_unrecognized_file
};
EOF
diff --git a/gnu/usr.bin/binutils/ld/emultempl/elf32.em b/gnu/usr.bin/binutils/ld/emultempl/elf32.em
index 8b2f6259748..45cab9ffb99 100644
--- a/gnu/usr.bin/binutils/ld/emultempl/elf32.em
+++ b/gnu/usr.bin/binutils/ld/emultempl/elf32.em
@@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* 32 bit ELF emulation code for ${EMULATION_NAME}
- Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1991, 93, 94, 95, 1996 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
ELF support by Ian Lance Taylor <ian@cygnus.com>
@@ -66,7 +66,7 @@ static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
static void
gld${EMULATION_NAME}_before_parse()
{
- ldfile_output_architecture = bfd_arch_${ARCH};
+ ldfile_output_architecture = bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`;
config.dynamic_link = ${DYNAMIC_LINK-true};
}
@@ -131,6 +131,95 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
return true;
}
+EOF
+if [ "x${host}" = "x${target}" ] ; then
+ if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
+cat >>e${EMULATION_NAME}.c <<EOF
+
+/* For a native linker, check the file /etc/ld.so.conf for directories
+ in which we may find shared libraries. /etc/ld.so.conf is really
+ only meaningful on Linux, but we check it on other systems anyhow. */
+
+static boolean gld${EMULATION_NAME}_check_ld_so_conf PARAMS ((const char *));
+
+static boolean
+gld${EMULATION_NAME}_check_ld_so_conf (name)
+ const char *name;
+{
+ static boolean initialized;
+ static char *ld_so_conf;
+
+ if (! initialized)
+ {
+ FILE *f;
+
+ f = fopen ("/etc/ld.so.conf", FOPEN_RT);
+ if (f != NULL)
+ {
+ char *b;
+ size_t len, alloc;
+ int c;
+
+ len = 0;
+ alloc = 100;
+ b = (char *) xmalloc (alloc);
+
+ while ((c = getc (f)) != EOF)
+ {
+ if (len + 1 >= alloc)
+ {
+ alloc *= 2;
+ b = (char *) xrealloc (b, alloc);
+ }
+ if (c != ':'
+ && c != ' '
+ && c != '\t'
+ && c != '\n'
+ && c != ',')
+ {
+ b[len] = c;
+ ++len;
+ }
+ else
+ {
+ if (len > 0 && b[len - 1] != ':')
+ {
+ b[len] = ':';
+ ++len;
+ }
+ }
+ }
+
+ if (len > 0 && b[len - 1] == ':')
+ --len;
+
+ if (len > 0)
+ b[len] = '\0';
+ else
+ {
+ free (b);
+ b = NULL;
+ }
+
+ fclose (f);
+
+ ld_so_conf = b;
+ }
+
+ initialized = true;
+ }
+
+ if (ld_so_conf == NULL)
+ return false;
+
+ return gld${EMULATION_NAME}_search_needed (ld_so_conf, name);
+}
+
+EOF
+ fi
+fi
+cat >>e${EMULATION_NAME}.c <<EOF
+
/* These variables are required to pass information back and forth
between after_open and check_needed and stat_needed. */
@@ -199,12 +288,14 @@ gld${EMULATION_NAME}_after_open ()
continue;
}
EOF
-if [ "x${host_alias}" = "x${target_alias}" ] ; then
+if [ "x${host}" = "x${target}" ] ; then
+ if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
cat >>e${EMULATION_NAME}.c <<EOF
lib_path = (const char *) getenv ("LD_LIBRARY_PATH");
if (gld${EMULATION_NAME}_search_needed (lib_path, l->name))
continue;
EOF
+ fi
fi
cat >>e${EMULATION_NAME}.c <<EOF
len = strlen (l->name);
@@ -222,6 +313,16 @@ cat >>e${EMULATION_NAME}.c <<EOF
}
if (search != NULL)
continue;
+EOF
+if [ "x${host}" = "x${target}" ] ; then
+ if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
+cat >>e${EMULATION_NAME}.c <<EOF
+ if (gld${EMULATION_NAME}_check_ld_so_conf (l->name))
+ continue;
+EOF
+ fi
+fi
+cat >>e${EMULATION_NAME}.c <<EOF
einfo ("%P: warning: %s, needed by %B, not found\n",
l->name, l->by);
@@ -334,19 +435,42 @@ static void
gld${EMULATION_NAME}_check_needed (s)
lang_input_statement_type *s;
{
+ if (global_found)
+ return;
+
if (s->filename != NULL
&& strcmp (s->filename, global_needed->name) == 0)
- global_found = true;
- else if (s->search_dirs_flag
- && s->filename != NULL
- && strchr (global_needed->name, '/') == NULL)
+ {
+ global_found = true;
+ return;
+ }
+
+ if (s->the_bfd != NULL)
+ {
+ const char *soname;
+
+ soname = bfd_elf_get_dt_soname (s->the_bfd);
+ if (soname != NULL
+ && strcmp (soname, global_needed->name) == 0)
+ {
+ global_found = true;
+ return;
+ }
+ }
+
+ if (s->search_dirs_flag
+ && s->filename != NULL
+ && strchr (global_needed->name, '/') == NULL)
{
const char *f;
f = strrchr (s->filename, '/');
if (f != NULL
&& strcmp (f + 1, global_needed->name) == 0)
- global_found = true;
+ {
+ global_found = true;
+ return;
+ }
}
}
@@ -357,21 +481,58 @@ static void
gld${EMULATION_NAME}_stat_needed (s)
lang_input_statement_type *s;
{
+ struct stat st;
+ const char *suffix;
+ const char *soname;
+ const char *f;
+
if (global_found)
return;
- if (s->the_bfd != NULL)
+ if (s->the_bfd == NULL)
+ return;
+
+ if (bfd_stat (s->the_bfd, &st) != 0)
{
- struct stat st;
+ einfo ("%P:%B: bfd_stat failed: %E\n", s->the_bfd);
+ return;
+ }
- if (bfd_stat (s->the_bfd, &st) != 0)
- einfo ("%P:%B: bfd_stat failed: %E\n", s->the_bfd);
- else
- {
- if (st.st_dev == global_stat.st_dev
- && st.st_ino == global_stat.st_ino)
- global_found = true;
- }
+ if (st.st_dev == global_stat.st_dev
+ && st.st_ino == global_stat.st_ino)
+ {
+ global_found = true;
+ return;
}
+
+ /* We issue a warning if it looks like we are including two
+ different versions of the same shared library. For example,
+ there may be a problem if -lc picks up libc.so.6 but some other
+ shared library has a DT_NEEDED entry of libc.so.5. This is a
+ hueristic test, and it will only work if the name looks like
+ NAME.so.VERSION. FIXME: Depending on file names is error-prone.
+ If we really want to issue warnings about mixing version numbers
+ of shared libraries, we need to find a better way. */
+
+ if (strchr (global_needed->name, '/') != NULL)
+ return;
+ suffix = strstr (global_needed->name, ".so.");
+ if (suffix == NULL)
+ return;
+ suffix += sizeof ".so." - 1;
+
+ soname = bfd_elf_get_dt_soname (s->the_bfd);
+ if (soname == NULL)
+ soname = s->filename;
+
+ f = strrchr (soname, '/');
+ if (f != NULL)
+ ++f;
+ else
+ f = soname;
+
+ if (strncmp (f, global_needed->name, suffix - global_needed->name) == 0)
+ einfo ("%P: warning: %s, needed by %B, may conflict with %s\n",
+ global_needed->name, global_needed->by, f);
}
/* This is called after the sections have been attached to output
@@ -536,7 +697,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp)
break;
case etree_trinary:
- gld${EMULATION_NAME}_find_exp_assignment (exp->trinary.lhs);
+ gld${EMULATION_NAME}_find_exp_assignment (exp->trinary.cond);
gld${EMULATION_NAME}_find_exp_assignment (exp->trinary.lhs);
gld${EMULATION_NAME}_find_exp_assignment (exp->trinary.rhs);
break;
diff --git a/gnu/usr.bin/binutils/ld/emultempl/generic.em b/gnu/usr.bin/binutils/ld/emultempl/generic.em
index 6b8e6758e31..1c0c8eb214d 100644
--- a/gnu/usr.bin/binutils/ld/emultempl/generic.em
+++ b/gnu/usr.bin/binutils/ld/emultempl/generic.em
@@ -42,7 +42,7 @@ static void
gld${EMULATION_NAME}_before_parse()
{
#ifndef TARGET_ /* I.e., if not generic. */
- ldfile_output_architecture = bfd_arch_${ARCH};
+ ldfile_set_output_arch ("`echo ${ARCH}`");
#endif /* not TARGET_ */
}
diff --git a/gnu/usr.bin/binutils/ld/emultempl/linux.em b/gnu/usr.bin/binutils/ld/emultempl/linux.em
index 1f9d37eec2b..6860c3ffaf2 100644
--- a/gnu/usr.bin/binutils/ld/emultempl/linux.em
+++ b/gnu/usr.bin/binutils/ld/emultempl/linux.em
@@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* Linux a.out emulation code for ${EMULATION_NAME}
- Copyright (C) 1991, 1993, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
Linux support by Eric Youngdale <ericy@cais.cais.com>
@@ -125,7 +125,7 @@ gld${EMULATION_NAME}_before_allocation ()
/* Let the backend work out the sizes of any sections required by
dynamic linking. */
- if (! bfd_linux_size_dynamic_sections (output_bfd, &link_info))
+ if (! bfd_${EMULATION_NAME}_size_dynamic_sections (output_bfd, &link_info))
einfo ("%P%F: failed to set dynamic section sizes: %E\n");
}
diff --git a/gnu/usr.bin/binutils/ld/emultempl/lnk960.em b/gnu/usr.bin/binutils/ld/emultempl/lnk960.em
index 8f6ad40c6c9..066d46bb328 100644
--- a/gnu/usr.bin/binutils/ld/emultempl/lnk960.em
+++ b/gnu/usr.bin/binutils/ld/emultempl/lnk960.em
@@ -200,6 +200,8 @@ machine_table[] =
{ bfd_mach_i960_ca ,"CA" },
{ bfd_mach_i960_ka_sa ,"KA" },
{ bfd_mach_i960_ka_sa ,"SA" },
+ { bfd_mach_i960_jx ,"JX" },
+ { bfd_mach_i960_hx ,"HX" },
{ bfd_mach_i960_core ,"core" },
{ bfd_mach_i960_kb_sb ,"kb" },
@@ -209,6 +211,8 @@ machine_table[] =
{ bfd_mach_i960_ca ,"ca" },
{ bfd_mach_i960_ka_sa ,"ka" },
{ bfd_mach_i960_ka_sa ,"sa" },
+ { bfd_mach_i960_jx ,"jx" },
+ { bfd_mach_i960_hx ,"hx" },
{ 0, (char *) NULL }
};
diff --git a/gnu/usr.bin/binutils/ld/emultempl/pe.em b/gnu/usr.bin/binutils/ld/emultempl/pe.em
index 3e40d78ddb0..55257390890 100644
--- a/gnu/usr.bin/binutils/ld/emultempl/pe.em
+++ b/gnu/usr.bin/binutils/ld/emultempl/pe.em
@@ -25,7 +25,6 @@ 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. */
-
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
@@ -46,9 +45,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define TARGET_IS_${EMULATION_NAME}
+static void gld_${EMULATION_NAME}_set_symbols PARAMS ((void));
+static void gld_${EMULATION_NAME}_after_open PARAMS ((void));
static void gld_${EMULATION_NAME}_before_parse PARAMS ((void));
-static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *isfile));
-
+static void gld_${EMULATION_NAME}_before_allocation PARAMS ((void));
+static boolean gld${EMULATION_NAME}_place_orphan
+ PARAMS ((lang_input_statement_type *, asection *));
+static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *));
+static int gld_${EMULATION_NAME}_parse_args PARAMS ((int, char **));
+
+#if 0 /* argument to qsort so don't prototype */
+static int sort_by_file_name PARAMS ((void *, void *));
+static int sort_by_section_name PARAMS ((void *, void *));
+#endif
+static lang_statement_union_type **sort_sections_1
+ PARAMS ((lang_statement_union_type **, lang_statement_union_type *, int,
+ int (*)()));
+static void sort_sections PARAMS ((lang_statement_union_type *));
static struct internal_extra_pe_aouthdr pe;
static int dll;
@@ -58,7 +71,8 @@ gld_${EMULATION_NAME}_before_parse()
{
ldfile_output_architecture = bfd_arch_${ARCH};
}
-
+
+/* PE format extra command line options. */
/* Used for setting flags in the PE header. */
#define OPTION_BASE_FILE (300 + 1)
@@ -76,7 +90,7 @@ gld_${EMULATION_NAME}_before_parse()
#define OPTION_SUBSYSTEM (OPTION_STACK + 1)
#define OPTION_HEAP (OPTION_SUBSYSTEM + 1)
- static struct option longopts[] = {
+static struct option longopts[] = {
/* PE options */
{"base-file", required_argument, NULL, OPTION_BASE_FILE},
{"dll", no_argument, NULL, OPTION_DLL},
@@ -99,8 +113,6 @@ gld_${EMULATION_NAME}_before_parse()
/* PE/WIN32; added routines to get the subsystem type, heap and/or stack
parameters which may be input from the command line */
-
-
typedef struct {
void *ptr;
int size;
@@ -194,7 +206,7 @@ set_pe_value (name)
{
char *end;
- set_pe_name (name, strtoul (optarg, &end, 16));
+ set_pe_name (name, strtoul (optarg, &end, 0));
if (end == optarg)
{
einfo ("%P%F: invalid hex number for PE parameter '%s'\n", optarg);
@@ -266,10 +278,10 @@ gld_${EMULATION_NAME}_parse_args(argc, argv)
/* PE options */
case OPTION_HEAP:
- set_pe_stack_heap ("__heap_reserve__", "__heap_commit__");
+ set_pe_stack_heap ("__size_of_heap_reserve__", "__size_of_heap_commit__");
break;
case OPTION_STACK:
- set_pe_stack_heap ("__stack_reserve__", "__stack_commit__");
+ set_pe_stack_heap ("__size_of_stack_reserve__", "__size_of_stack_commit__");
break;
case OPTION_SUBSYSTEM:
set_pe_subsystem ();
@@ -307,9 +319,9 @@ gld_${EMULATION_NAME}_parse_args(argc, argv)
}
return 1;
}
-
+
static void
-gld_${EMULATION_NAME}_set_symbols()
+gld_${EMULATION_NAME}_set_symbols()
{
/* Run through and invent symbols for all the
names and insert the defaults. */
@@ -321,9 +333,10 @@ gld_${EMULATION_NAME}_set_symbols()
? NT_DLL_IMAGE_BASE : NT_EXE_IMAGE_BASE;
/* Glue the assignments into the abs section */
- save=stat_ptr;
+ save = stat_ptr;
stat_ptr = &(abs_output_section->children);
+
for (j = 0; init[j].ptr; j++)
{
long val = init[j].value;
@@ -360,12 +373,13 @@ gld_${EMULATION_NAME}_after_open()
pe_data(output_bfd)->dll = init[DLLOFF].value;
}
+
+/* Callback functions for qsort in sort_sections. */
-/* Callback function for qsort in sort_sections. */
-
-static int sfunc (a, b)
-void *a;
-void *b;
+static int
+sort_by_file_name (a, b)
+ void *a;
+ void *b;
{
lang_statement_union_type **ra = a;
lang_statement_union_type **rb = b;
@@ -373,8 +387,64 @@ void *b;
(*rb)->input_section.ifile->filename);
}
-/* Sort the input sections of archives into filename order. */
-
+static int
+sort_by_section_name (a, b)
+ void *a;
+ void *b;
+{
+ lang_statement_union_type **ra = a;
+ lang_statement_union_type **rb = b;
+ return strcmp ((*ra)->input_section.section->name,
+ (*rb)->input_section.section->name);
+}
+
+/* Subroutine of sort_sections to a contiguous subset of a list of sections.
+ NEXT_AFTER is the element after the last one to sort.
+ The result is a pointer to the last element's "next" pointer. */
+
+static lang_statement_union_type **
+sort_sections_1 (startptr, next_after, count, sort_func)
+ lang_statement_union_type **startptr,*next_after;
+ int count;
+ int (*sort_func) ();
+{
+ lang_statement_union_type **vec;
+ lang_statement_union_type *p;
+ int i;
+
+ if (count == 0)
+ return startptr;
+
+ vec = (lang_statement_union_type **)
+ alloca (count * sizeof (lang_statement_union_type *));
+
+ for (p = *startptr, i = 0; i < count; i++, p = p->next)
+ vec[i] = p;
+
+ qsort (vec, count, sizeof (vec[0]), sort_func);
+
+ /* Fill in the next pointers again. */
+ *startptr = vec[0];
+ for (i = 0; i < count - 1; i++)
+ vec[i]->header.next = vec[i + 1];
+ vec[i]->header.next = next_after;
+ return &(vec[i]->header.next);
+}
+
+/* Sort the .idata\$foo input sections of archives into filename order.
+ The reason is so dlltool can arrange to have the pe dll import information
+ generated correctly - the head of the list goes into dh.o, the tail into
+ dt.o, and the guts into ds[nnnn].o. Note that this is only needed for the
+ .idata section.
+ FIXME: This may no longer be necessary with grouped sections. Instead of
+ sorting on dh.o, ds[nnnn].o, dt.o, one could, for example, have dh.o use
+ .idata\$4h, have ds[nnnn].o use .idata\$4s[nnnn], and have dt.o use .idata\$4t.
+ This would have to be elaborated upon to handle multiple dll's
+ [assuming such an eloboration is possible of course].
+
+ We also sort sections in '\$' wild statements. These are created by the
+ place_orphans routine to implement grouped sections. */
+
static void
sort_sections (s)
lang_statement_union_type *s;
@@ -389,51 +459,64 @@ sort_sections (s)
{
lang_statement_union_type **p = &s->wild_statement.children.head;
- /* Sort any children in the same archive. Run through all
- the children of this wild statement, when an
- input_section in an archive is found, scan forward to
- find all input_sections which are in the same archive.
- Sort them by their filename and then re-thread the
- pointer chain. */
+ /* Is this the .idata section? */
+ if (s->wild_statement.section_name != NULL
+ && strncmp (s->wild_statement.section_name, ".idata", 6) == 0)
+ {
+ /* Sort any children in the same archive. Run through all
+ the children of this wild statement, when an
+ input_section in an archive is found, scan forward to
+ find all input_sections which are in the same archive.
+ Sort them by their filename and then re-thread the
+ pointer chain. */
+
+ while (*p)
+ {
+ lang_statement_union_type *start = *p;
+ if (start->header.type != lang_input_section_enum
+ || !start->input_section.ifile->the_bfd->my_archive)
+ p = &(start->header.next);
+ else
+ {
+ lang_statement_union_type *end;
+ int count;
+
+ for (end = start, count = 0;
+ end && end->header.type == lang_input_section_enum
+ && (end->input_section.ifile->the_bfd->my_archive
+ == start->input_section.ifile->the_bfd->my_archive);
+ end = end->next)
+ count++;
+
+ p = sort_sections_1 (p, end, count, sort_by_file_name);
+ }
+ }
+ break;
+ }
- while (*p)
+ /* If this is a collection of grouped sections, sort them.
+ The linker script must explicitly mention "*(.foo\$)".
+ Don't sort them if \$ is not the last character (not sure if
+ this is really useful, but it allows explicitly mentioning
+ some \$ sections and letting the linker handle the rest). */
+ if (s->wild_statement.section_name != NULL)
{
- lang_statement_union_type *start = *p;
- if (start->header.type != lang_input_section_enum
- || !start->input_section.ifile->the_bfd->my_archive)
- p = &(start->header.next);
- else
+ char *q = strchr (s->wild_statement.section_name, '\$');
+
+ if (q && q[1] == 0)
{
- lang_statement_union_type **vec;
lang_statement_union_type *end;
- lang_statement_union_type *np;
int count;
- int i;
-
- for (end = start, count = 0;
- end && end->header.type == lang_input_section_enum
- && (end->input_section.ifile->the_bfd->my_archive
- == start->input_section.ifile->the_bfd->my_archive);
- end = end->next)
- count++;
-
- np = end;
-
- vec = (lang_statement_union_type **)
- alloca (count * sizeof (lang_statement_union_type *));
-
- for (end = start, i = 0; i < count; i++, end = end->next)
- vec[i] = end;
-
- qsort (vec, count, sizeof (vec[0]), sfunc);
- /* Fill in the next pointers again. */
- *p = vec[0];
- for (i = 0; i < count - 1; i++)
- vec[i]->header.next = vec[i + 1];
- vec[i]->header.next = np;
- p = &(vec[i]->header.next);
+ for (end = *p, count = 0; end; end = end->next)
+ {
+ if (end->header.type != lang_input_section_enum)
+ abort ();
+ count++;
+ }
+ (void) sort_sections_1 (p, end, count, sort_by_section_name);
}
+ break;
}
}
break;
@@ -460,9 +543,95 @@ gld_${EMULATION_NAME}_before_allocation()
ppc_allocate_toc_section (&link_info);
#endif
- sort_sections (*stat_ptr);
+ sort_sections (stat_ptr->head);
}
+
+/* Place an orphan section. We use this to put sections with a '\$' in them
+ into the right place. Any section with a '\$' in them (e.g. .text\$foo)
+ gets mapped to the output section with everything from the '\$' on stripped
+ (e.g. .text).
+ See the Microsoft Portable Executable and Common Object File Format
+ Specification 4.1, section 4.2, Grouped Sections. */
+
+/*ARGSUSED*/
+static boolean
+gld${EMULATION_NAME}_place_orphan (file, s)
+ lang_input_statement_type *file;
+ asection *s;
+{
+ const char *secname;
+ char *output_secname, *ps;
+ lang_output_section_statement_type *os;
+ lang_statement_list_type *ptr;
+ lang_statement_union_type *l;
+
+ if ((s->flags & SEC_ALLOC) == 0)
+ return false;
+
+ /* Don't process grouped sections unless doing a final link.
+ If they're marked as COMDAT sections, we don't want .text\$foo to
+ end up in .text and then have .text disappear because it's marked
+ link-once-discard. */
+ if (link_info.relocateable)
+ return false;
+
+ secname = bfd_get_section_name (s->owner, s);
+
+ /* Everything from the '\$' on gets deleted so don't allow '\$' as the
+ first character. */
+ if (*secname == '\$')
+ einfo ("%P%F: section %s has '\$' as first character\n", secname);
+ if (strchr (secname + 1, '\$') == NULL)
+ return false;
+
+ /* Look up the output section. The Microsoft specs say sections names in
+ image files never contain a '\$'. Fortunately, lang_..._lookup creates
+ the section if it doesn't exist. */
+ output_secname = buystring (secname);
+ ps = strchr (output_secname + 1, '\$');
+ *ps = 0;
+ os = lang_output_section_statement_lookup (output_secname);
+
+ /* Find the '\$' wild statement for this section. We currently require the
+ linker script to explicitly mention "*(.foo\$)".
+ FIXME: ppcpe.sc has .CRT\$foo in the .rdata section. According to the
+ Microsoft docs this isn't correct so it's not (currently) handled. */
+
+ ps[0] = '\$';
+ ps[1] = 0;
+ for (l = os->children.head; l; l = l->next)
+ {
+ if (l->header.type == lang_wild_statement_enum
+ && strcmp (l->wild_statement.section_name, output_secname) == 0)
+ break;
+ }
+ ps[0] = 0;
+ if (l == NULL)
+#if 1
+ einfo ("%P%F: *(%s\$) missing from linker script\n", output_secname);
+#else /* FIXME: This block is untried. It exists to convey the intent,
+ should one decide to not require *(.foo\$) to appear in the linker
+ script. */
+ {
+ lang_wild_statement_type *new = new_stat (lang_wild_statement,
+ &os->children);
+ new->section_name = xmalloc (strlen (output_secname) + 2);
+ sprintf (new->section_name, "%s\$", output_secname);
+ new->filename = NULL;
+ lang_list_init (&new->children);
+ l = new;
+ }
+#endif
+
+ /* Link the input section in and we're done for now.
+ The sections still have to be sorted, but that has to wait until
+ all such sections have been processed by us. The sorting is done by
+ sort_sections. */
+ wild_doit (&l->wild_statement.children, s, os, file);
+ return true;
+}
+
static char *
gld_${EMULATION_NAME}_get_script(isfile)
int *isfile;
@@ -492,7 +661,6 @@ echo '; }' >> e${EMULATION_NAME}
cat >>e${EMULATION_NAME}.c <<EOF
-
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
{
gld_${EMULATION_NAME}_before_parse,
@@ -510,9 +678,8 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
NULL, /* finish */
NULL, /* create output section statements */
NULL, /* open dynamic archive */
- NULL, /* place orphan */
+ gld${EMULATION_NAME}_place_orphan,
gld_${EMULATION_NAME}_set_symbols,
gld_${EMULATION_NAME}_parse_args
};
EOF
-
diff --git a/gnu/usr.bin/binutils/ld/emultempl/sunos.em b/gnu/usr.bin/binutils/ld/emultempl/sunos.em
index abcc9739279..5f36bd1ae37 100644
--- a/gnu/usr.bin/binutils/ld/emultempl/sunos.em
+++ b/gnu/usr.bin/binutils/ld/emultempl/sunos.em
@@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
+#include "libiberty.h"
#include "ld.h"
#include "ldmain.h"
@@ -57,6 +58,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif
static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
+static void gld${EMULATION_NAME}_set_symbols PARAMS ((void));
static void gld${EMULATION_NAME}_create_output_section_statements
PARAMS ((void));
static void gld${EMULATION_NAME}_find_so
@@ -87,6 +89,46 @@ gld${EMULATION_NAME}_before_parse()
config.dynamic_link = true;
}
+/* This is called after the command line arguments have been parsed,
+ but before the linker script has been read. If this is a native
+ linker, we add the directories in LD_LIBRARY_PATH to the search
+ list. */
+
+static void
+gld${EMULATION_NAME}_set_symbols ()
+{
+EOF
+if [ "x${host}" = "x${target}" ] ; then
+ if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
+cat >>e${EMULATION_NAME}.c <<EOF
+ const char *env;
+
+ env = (const char *) getenv ("LD_LIBRARY_PATH");
+ if (env != NULL)
+ {
+ char *l;
+
+ l = xstrdup (env);
+ while (1)
+ {
+ char *c;
+
+ c = strchr (l, ':');
+ if (c != NULL)
+ *c++ = '\0';
+ if (*l != '\0')
+ ldfile_add_library_path (l, false);
+ if (c == NULL)
+ break;
+ l = c;
+ }
+ }
+EOF
+ fi
+fi
+cat >>e${EMULATION_NAME}.c <<EOF
+}
+
/* Despite the name, we use this routine to search for dynamic
libraries. On SunOS this requires a directory search. We need to
find the .so file with the highest version number. The user may
@@ -404,12 +446,14 @@ gld${EMULATION_NAME}_after_open ()
continue;
}
EOF
-if [ "x${host_alias}" = "x${target_alias}" ] ; then
+if [ "x${host}" = "x${target}" ] ; then
+ if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
cat >>e${EMULATION_NAME}.c <<EOF
lib_path = (const char *) getenv ("LD_LIBRARY_PATH");
if (gld${EMULATION_NAME}_search_needed (lib_path, lname))
continue;
EOF
+ fi
fi
cat >>e${EMULATION_NAME}.c <<EOF
if (command_line.rpath != NULL)
@@ -617,7 +661,8 @@ gld${EMULATION_NAME}_before_allocation ()
if (h->type == bfd_link_hash_undefined
&& h->u.undef.abfd != NULL
&& (h->u.undef.abfd->flags & DYNAMIC) == 0
- && strcmp (h->root.string, "__DYNAMIC") != 0)
+ && strcmp (h->root.string, "__DYNAMIC") != 0
+ && strcmp (h->root.string, "__GLOBAL_OFFSET_TABLE_") != 0)
{
find_assign = h->root.string;
found_assign = false;
@@ -964,6 +1009,8 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
"${OUTPUT_FORMAT}",
NULL, /* finish */
gld${EMULATION_NAME}_create_output_section_statements,
- NULL /* open_dynamic_library */
+ NULL, /* open_dynamic_library */
+ NULL, /* place_orphan */
+ gld${EMULATION_NAME}_set_symbols
};
EOF
diff --git a/gnu/usr.bin/binutils/ld/genscripts.sh b/gnu/usr.bin/binutils/ld/genscripts.sh
index 1d2b8660b28..eea99cf6184 100644
--- a/gnu/usr.bin/binutils/ld/genscripts.sh
+++ b/gnu/usr.bin/binutils/ld/genscripts.sh
@@ -1,21 +1,23 @@
#!/bin/sh
# genscripts.sh - generate the ld-emulation-target specific files
#
-# Usage: genscripts.sh srcdir libdir host_alias target_alias \
-# default_emulation this_emulation
+# Usage: genscripts.sh srcdir libdir host target target_alias \
+# default_emulation native_lib_dirs this_emulation tool_dir
#
# Sample usage:
# genscripts.sh /djm/ld-devo/devo/ld /usr/local/lib sparc-sun-sunos4.1.3 \
-# sparc-sun-sunos4.1.3 sun4 sun3
+# sparc-sun-sunos4.1.3 sparc-sun-sunos4.1.3 sun4 "" sun3 sparc-sun-sunos4.1.3
# produces sun3.x sun3.xbn sun3.xn sun3.xr sun3.xu em_sun3.c
srcdir=$1
libdir=$2
-host_alias=$3
-target_alias=$4
-DEFAULT_EMULATION=$5
-NATIVE_LIB_DIRS=$6
-EMULATION_NAME=$7
+host=$3
+target=$4
+target_alias=$5
+DEFAULT_EMULATION=$6
+NATIVE_LIB_DIRS=$7
+EMULATION_NAME=$8
+tool_lib=`echo ${libdir} | sed -e 's|/lib$||'`/${9-$target_alias}/lib
# Include the emulation-specific parameters:
. ${srcdir}/emulparams/${EMULATION_NAME}.sh
@@ -34,7 +36,7 @@ fi
# To force a logically empty LIB_PATH, do LIBPATH=":".
if [ "x${LIB_PATH}" = "x" ] ; then
- if [ "x${host_alias}" = "x${target_alias}" ] ; then
+ if [ "x${host}" = "x${target}" ] ; then
if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
# Native.
LIB_PATH=/lib:/usr/lib
@@ -58,7 +60,7 @@ if [ "x${LIB_PATH}" = "x" ] ; then
fi
# Always search $(tooldir)/lib, aka /usr/local/TARGET/lib.
-LIB_PATH=${LIB_PATH}:`echo ${libdir} | sed -e s'|/lib$||'`/${target_alias}/lib
+LIB_PATH=${LIB_PATH}:${tool_lib}
LIB_SEARCH_DIRS=`echo ${LIB_PATH} | tr ':' ' ' | sed -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\1);/g'`
diff --git a/gnu/usr.bin/binutils/ld/ld.1 b/gnu/usr.bin/binutils/ld/ld.1
index a12596e2230..ef3633ee5fc 100644
--- a/gnu/usr.bin/binutils/ld/ld.1
+++ b/gnu/usr.bin/binutils/ld/ld.1
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1991, 92, 93, 94, 1995 Free Software Foundation
+.\" Copyright (c) 1991, 92, 93, 94, 95, 1996 Free Software Foundation
.\" See section COPYING for conditions for redistribution
.TH ld 1 "17 August 1992" "cygnus support" "GNU Development Tools"
.de BP
@@ -33,6 +33,7 @@ ld \- the GNU linker
.RB "[\|" "\-c\ "\c
.I commandfile\c
\&\|]
+.RB "[\|" \-\-cref "\|]"
.RB "[\|" \-d | \-dc | \-dp\c
\|]
.br
@@ -45,6 +46,8 @@ ld \- the GNU linker
.I entry\c
\&\|]
.RB "[\|" \-embedded\-relocs "\|]"
+.RB "[\|" \-E "\|]"
+.RB "[\|" \-export\-dynamic "\|]"
.RB "[\|" \-F "\|]"
.RB "[\|" "\-F\ "\c
.I format\c
@@ -118,8 +121,13 @@ ld \- the GNU linker
.RB "[\|" \-\-version "\|]"
.RB "[\|" \-warn\-common "\|]"
.RB "[\|" \-warn\-constructors "\|]"
+.RB "[\|" \-warn\-multiple\-gp "\|]"
.RB "[\|" \-warn\-once "\|]"
.RB "[\|" \-\-whole\-archive "\|]"
+.RB "[\|" \-\-no\-whole\-archive "\|]"
+.RB "[\|" "\-\-wrap\ "\c
+.I symbol\c
+\&\|]
.RB "[\|" \-X "\|]"
.RB "[\|" \-x "\|]"
.ad b
@@ -402,6 +410,12 @@ line by bracketing it between `\|\c
\|' characters.
.TP
+.B \-\-cref
+Output a cross reference table. If a linker map file is being
+generated, the cross reference table is printed to the map file.
+Otherwise, it is printed on the standard output.
+
+.TP
.B \-d
.TP
.B \-dc
@@ -458,6 +472,15 @@ was statically initialized to pointer values. See the code in
testsuite/ld-empic for details.
.TP
+.B \-E
+.TP
+.B \-export\-dynamic
+When creating an ELF file, add all symbols to the dynamic symbol table.
+Normally, the dynamic symbol table contains only symbols which are used
+by a dynamic object. This option is needed for some uses of
+.I dlopen.
+
+.TP
.B \-F
.TP
.BI "-F" "format"
@@ -722,8 +745,9 @@ option may also be used on SunOS. By default, on SunOS, the linker
will form a runtime search patch out of all the
.B \-L
options it is given. If a
-.B \-rpath option is used, the runtime search path
-will be formed exclusively using the
+.B \-rpath
+option is used, the runtime search path will be formed exclusively
+using the
.B \-rpath
options, ignoring
the
@@ -898,17 +922,42 @@ few object file formats. For formats like COFF or ELF, the linker can
not detect the use of global constructors.
.TP
+.B \-warn\-multiple\-gp
+Warn if the output file requires multiple global-pointer values. This
+option is only meaningful for certain processors, such as the Alpha.
+
+.TP
.B \-warn\-once
Only warn once for each undefined symbol, rather than once per module
which refers to it.
.TP
.B \-\-whole\-archive
-For each archive mentioned on the command line, include every object
-file in the archive in the link, rather than searching the archive for
-the required object files. This is normally used to turn an archive
-file into a shared library, forcing every object to be included in the
-resulting shared library.
+For each archive mentioned on the command line after the
+.B \-\-whole\-archive
+option, include every object file in the archive in the link, rather
+than searching the archive for the required object files. This is
+normally used to turn an archive file into a shared library, forcing
+every object to be included in the resulting shared library.
+
+.TP
+.B \-\-no\-whole\-archive
+Turn off the effect of the
+.B \-\-whole\-archive
+option for archives which appear later on the command line.
+
+.TP
+.BI "--wrap " "symbol"
+Use a wrapper function for
+.I symbol.
+Any undefined reference to
+.I symbol
+will be resolved to
+.BI "__wrap_" "symbol".
+Any undefined reference to
+.BI "__real_" "symbol"
+will be resolved to
+.I symbol.
.TP
.B \-X
diff --git a/gnu/usr.bin/binutils/ld/ld.h b/gnu/usr.bin/binutils/ld/ld.h
index 855b673fd68..1a06d2baecf 100644
--- a/gnu/usr.bin/binutils/ld/ld.h
+++ b/gnu/usr.bin/binutils/ld/ld.h
@@ -28,6 +28,10 @@
/* Look in this variable for a target format */
#define TARGET_ENVIRON "GNUTARGET"
+/* Input sections which are put in a section of this name are actually
+ discarded. */
+#define DISCARD_SECTION_NAME "/DISCARD/"
+
/* Extra information we hold on sections */
typedef struct user_section_struct
{
@@ -80,6 +84,9 @@ typedef struct
/* If true, build MIPS embedded PIC relocation tables in the output
file. */
boolean embedded_relocs;
+
+ /* If true, force generation of a file with a .exe file. */
+ boolean force_exe_suffix;
} args_type;
extern args_type command_line;
@@ -92,9 +99,6 @@ typedef struct
boolean magic_demand_paged;
boolean make_executable;
- /* If true, request BFD to use the traditional format. */
- boolean traditional_format;
-
/* If true, doing a dynamic link. */
boolean dynamic_link;
@@ -110,6 +114,10 @@ typedef struct
/* If true, only warn once about a particular undefined symbol. */
boolean warn_once;
+ /* If true, warn if multiple global-pointers are needed (Alpha
+ only). */
+ boolean warn_multiple_gp;
+
boolean sort_common;
boolean text_read_only;
@@ -140,4 +148,7 @@ extern int parsing_defsym;
extern int yyparse PARAMS ((void));
+extern void add_cref PARAMS ((const char *, bfd *, asection *, bfd_vma));
+extern void output_cref PARAMS ((FILE *));
+
#endif
diff --git a/gnu/usr.bin/binutils/ld/ld.texinfo b/gnu/usr.bin/binutils/ld/ld.texinfo
index b782ce21edf..aae0935e75d 100644
--- a/gnu/usr.bin/binutils/ld/ld.texinfo
+++ b/gnu/usr.bin/binutils/ld/ld.texinfo
@@ -17,7 +17,7 @@ END-INFO-DIR-ENTRY
@ifinfo
This file documents the @sc{gnu} linker LD.
-Copyright (C) 1991, 92, 93, 94, 1995 Free Software Foundation, Inc.
+Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -64,7 +64,7 @@ notice identical to this one except for the removal of this paragraph
@end tex
@vskip 0pt plus 1filll
-Copyright @copyright{} 1991, 92, 93, 94, 1995 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -160,40 +160,8 @@ you have many choices to control its behavior.
@cindex command line
@cindex options
-Here is a summary of the options you can use on the @code{ld} command
-line:
-
-@c FIXME! -relax only avail h8/300, i960. Conditionals screwed in examples.
-@smallexample
-ld [ -o @var{output} ] @var{objfile}@dots{}
- [ -A@var{architecture} ] [ -b @var{input-format} ]
- [ -Bstatic ] [ -Bdynamic ] [ -Bsymbolic ]
- [ -c @var{MRI-commandfile} ] [ -d | -dc | -dp ]
- [ -defsym @var{symbol}=@var{expression} ]
- [ -dynamic-linker @var{file} ] [ -embedded-relocs ]
- [ -e @var{entry} ] [ -F ] [ -F @var{format} ]
- [ -format @var{input-format} ] [ -g ] [ -G @var{size} ]
- [ -help ] [ -i ] [ -l@var{archive} ] [ -L@var{searchdir} ]
- [ -M ] [ -Map @var{mapfile} ] [ -m @var{emulation} ]
- [ -N | -n ] [ -noinhibit-exec ] [ -no-keep-memory ]
- [ -oformat @var{output-format} ] [ -R @var{filename} ]
- [ -relax ] [ -retain-symbols-file @var{filename} ]
- [ -r | -Ur ] [ -rpath @var{dir} ] [-rpath-link @var{dir} ]
- [ -S ] [ -s ] [ -soname @var{name} ] [ -shared ]
- [ -sort-common ] [ -stats ] [ -T @var{commandfile} ]
- [ -Ttext @var{org} ] [ -Tdata @var{org} ]
- [ -Tbss @var{org} ] [ -t ] [ -traditional-format ]
- [ -u @var{symbol}] [-V] [-v] [ -verbose] [ -version ]
- [ -warn-common ] [ -warn-constructors] [ -warn-once ]
- [ -y @var{symbol} ] [ -X ] [-x ]
- [ -( [ archives ] -) ]
- [ --start-group [ archives ] --end-group ]
- [ -split-by-reloc @var{count} ] [ -split-by-file ]
- [ --whole-archive ]
-@end smallexample
-
-This plethora of command-line options may seem intimidating, but in
-actual practice few of them are used in any particular context.
+The linker supports a plethora of command-line options, but in actual
+practice few of them are used in any particular context.
@cindex standard Unix system
For instance, a frequent use of @code{ld} is to link standard Unix
object files on a standard, supported Unix system. On such a system, to
@@ -209,28 +177,17 @@ the library @code{libc.a}, which will come from the standard search
directories. (See the discussion of the @samp{-l} option below.)
The command-line options to @code{ld} may be specified in any order, and
-may be repeated at will. Repeating most options with a
-different argument will either have no further effect, or override prior
+may be repeated at will. Repeating most options with a different
+argument will either have no further effect, or override prior
occurrences (those further to the left on the command line) of that
-option.
-
-@ifclear SingleFormat
-The exceptions---which may meaningfully be used more than once---are
-@samp{-A}, @samp{-b} (or its synonym @samp{-format}), @samp{-defsym},
-@samp{-L}, @samp{-l}, @samp{-R}, @samp{-u}, and @samp{-(} (or its
-synonym @samp{--start-group})..
-@end ifclear
-@ifset SingleFormat
-The exceptions---which may meaningfully be used more than once---are
-@samp{-A}, @samp{-defsym}, @samp{-L}, @samp{-l}, @samp{-R}, @samp{-u},
-and @samp{-(} (or its synonym @samp{--start-group}).
-@end ifset
+option. Options which may be meaningfully specified more than once are
+noted in the descriptions below.
@cindex object files
-The list of object files to be linked together, shown as @var{objfile}@dots{},
-may follow, precede, or be mixed in with command-line options, except that
-an @var{objfile} argument may not be placed between an option and
-its argument.
+Non-option arguments are objects files which are to be linked together.
+They may follow, precede, or be mixed in with command-line options,
+except that an object file argument may not be placed between an option
+and its argument.
Usually the linker is invoked with at least one object file, but you can
specify other forms of binary input files using @samp{-l}, @samp{-R},
@@ -261,10 +218,20 @@ requires them. For example, @samp{--oformat srec} and
of multiple-letter options are accepted.
@table @code
+@kindex -a@var{keyword}
+@item -a@var{keyword}
+This option is supported for HP/UX compatibility. The @var{keyword}
+argument must be one of the strings @samp{archive}, @samp{shared}, or
+@samp{default}. @samp{-aarchive} is functionally equivalent to
+@samp{-Bstatic}, and the other two keywords are functionally equivalent
+to @samp{-Bdynamic}. This option may be used any number of times.
+
@ifset I960
@cindex architectures
@kindex -A@var{arch}
@item -A@var{architecture}
+@kindex --architecture=@var{arch}
+@itemx --architecture=@var{architecture}
In the current release of @code{ld}, this option is useful only for the
Intel 960 family of architectures. In that @code{ld} configuration, the
@var{architecture} argument identifies the particular architecture in
@@ -279,9 +246,11 @@ other architecture families.
@ifclear SingleFormat
@cindex binary input format
@kindex -b @var{format}
+@kindex --format=@var{format}
@cindex input format
@cindex input format
@item -b @var{input-format}
+@itemx --format=@var{input-format}
@code{ld} may be configured to support more than one kind of object
file. If your @code{ld} is configured this way, you can use the
@samp{-b} option to specify the binary format for input object files
@@ -291,8 +260,7 @@ to specify this, as @code{ld} should be configured to expect as a
default input format the most usual format on each machine.
@var{input-format} is a text string, the name of a particular format
supported by the BFD libraries. (You can list the available binary
-formats with @samp{objdump -i}.) @w{@samp{-format @var{input-format}}}
-has the same effect, as does the script command @code{TARGET}.
+formats with @samp{objdump -i}.)
@xref{BFD}.
You may want to use this option if you are linking files with an unusual
@@ -311,28 +279,11 @@ format from a script, using the command @code{TARGET}; see @ref{Option
Commands}.
@end ifclear
-@kindex -Bstatic
-@item -Bstatic
-Do not link against shared libraries. This is only meaningful on
-platforms for which shared libraries are supported.
-
-@kindex -Bdynamic
-@item -Bdynamic
-Link against dynamic libraries. This is only meaningful on platforms
-for which shared libraries are supported. This option is normally the
-default on such platforms.
-
-@kindex -Bsymbolic
-@item -Bsymbolic
-When creating a shared library, bind references to global symbols to the
-definition within the shared library, if any. Normally, it is possible
-for a program linked against a shared library to override the definition
-within the shared library. This option is only meaningful on ELF
-platforms which support shared libraries.
-
@kindex -c @var{MRI-cmdfile}
+@kindex --mri-script=@var{MRI-cmdfile}
@cindex compatibility, MRI
@item -c @var{MRI-commandfile}
+@itemx --mri-script=@var{MRI-commandfile}
For compatibility with linkers produced by MRI, @code{ld} accepts script
files written in an alternate, restricted command language, described in
@ref{MRI,,MRI Compatible Script Files}. Introduce MRI script files with
@@ -355,48 +306,26 @@ specified (with @samp{-r}). The script command
@code{FORCE_COMMON_ALLOCATION} has the same effect. @xref{Option
Commands}.
-@cindex symbols, from command line
-@kindex -defsym @var{symbol}=@var{exp}
-@item -defsym @var{symbol}=@var{expression}
-Create a global symbol in the output file, containing the absolute
-address given by @var{expression}. You may use this option as many
-times as necessary to define multiple symbols in the command line. A
-limited form of arithmetic is supported for the @var{expression} in this
-context: you may give a hexadecimal constant or the name of an existing
-symbol, or use @code{+} and @code{-} to add or subtract hexadecimal
-constants or symbols. If you need more elaborate expressions, consider
-using the linker command language from a script (@pxref{Assignment, ,
-Assignment: Symbol Definitions}). @emph{Note:} there should be no
-white space between @var{symbol}, the equals sign (``@key{=}''), and
-@var{expression}.
-
-@ifset GENERIC
-@cindex dynamic linker, from command line
-@kindex -dynamic-linker @var{file}
-@item -dynamic-linker @var{file}
-Set the name of the dynamic linker. This is only meaningful when
-generating dynamically linked ELF executables. The default dynamic
-linker is normally correct; don't use this unless you know what you are
-doing.
-@end ifset
-
-@cindex MIPS embedded PIC code
-@kindex -embedded-relocs
-@item -embedded-relocs
-This option is only meaningful when linking MIPS embedded PIC code,
-generated by the -membedded-pic option to the @sc{gnu} compiler and
-assembler. It causes the linker to create a table which may be used at
-runtime to relocate any data which was statically initialized to pointer
-values. See the code in testsuite/ld-empic for details.
-
@cindex entry point, from command line
@kindex -e @var{entry}
+@kindex --entry=@var{entry}
@item -e @var{entry}
+@itemx --entry=@var{entry}
Use @var{entry} as the explicit symbol for beginning execution of your
program, rather than the default entry point. @xref{Entry Point}, for a
discussion of defaults and other ways of specifying the
entry point.
+@cindex dynamic symbol table
+@kindex -E
+@kindex -export-dynamic
+@item -E
+@itemx -export-dynamic
+When creating a dynamically linked executable, add all symbols to the
+dynamic symbol table. Normally, the dynamic symbol table contains only
+symbols which are used by a dynamic object. This option is needed for
+some uses of @code{dlopen}.
+
@ifclear SingleFormat
@kindex -F
@item -F
@@ -409,28 +338,43 @@ option or the @code{TARGET} command in linker scripts for output files,
the @code{GNUTARGET} environment variable) are more flexible, but
@code{ld} accepts the @samp{-F} option for compatibility with scripts
written to call the old linker.
-
-@kindex -format
-@item -format @var{input-format}
-Synonym for @samp{-b @var{input-format}}.
@end ifclear
+@kindex --force-exe-suffix
+@item --force-exe-suffix
+Make sure that an output file has a .exe suffix.
+
+If a successfully built fully linked output file does not have a
+@code{.exe} or @code{.dll} suffix, this option forces the linker to copy
+the output file to one of the same name with a @code{.exe} suffix. This
+option is useful when using unmodified Unix makefiles on a Microsoft
+Windows host, since some versions of Windows won't run an image unless
+it ends in a @code{.exe} suffix.
+
@kindex -g
@item -g
Ignored. Provided for compatibility with other tools.
@kindex -G
+@kindex --gpsize
@cindex object size
@item -G@var{value}
-@itemx -G @var{value}
+@itemx --gpsize=@var{value}
Set the maximum size of objects to be optimized using the GP register to
-@var{size} under MIPS ECOFF. Ignored for other object file formats.
+@var{size}. This is only meaningful for object file formats such as
+MIPS ECOFF which supports putting large and small objects into different
+sections. This is ignored for other object file formats.
-@cindex help
-@cindex usage
-@kindex -help
-@item -help
-Print a summary of the command-line options on the standard output and exit.
+@cindex runtime library name
+@kindex -h@var{name}
+@kindex -soname=@var{name}
+@item -h@var{name}
+@itemx -soname=@var{name}
+When creating an ELF shared object, set the internal DT_SONAME field to
+the specified name. When an executable is linked with a shared object
+which has a DT_SONAME field, then when the executable is run the dynamic
+linker will attempt to load the shared object specified by the DT_SONAME
+field rather than the using the file name given to the linker.
@kindex -i
@cindex incremental link
@@ -439,16 +383,20 @@ Perform an incremental link (same as option @samp{-r}).
@cindex archive files, from cmd line
@kindex -l@var{archive}
-@item -l@var{ar}
-Add archive file @var{archive} to the list of files to link. This
+@kindex --library=@var{archive}
+@item -l@var{archive}
+@itemx --library=@var{archive}
+Add archive file @var{archive} to the list of files to link. This
option may be used any number of times. @code{ld} will search its
-path-list for occurrences of @code{lib@var{ar}.a} for every @var{archive}
-specified.
+path-list for occurrences of @code{lib@var{archive}.a} for every
+@var{archive} specified. File extensions other than @code{.a} may be
+used on certain systems.
@cindex search directory, from cmd line
@kindex -L@var{dir}
+@kindex --library-path=@var{dir}
@item -L@var{searchdir}
-@itemx -L @var{searchdir}
+@itemx --library-path=@var{searchdir}
Add path @var{searchdir} to the list of paths that @code{ld} will search
for archive libraries and @code{ld} control scripts. You may use this
option any number of times. The directories are searched in the order
@@ -467,66 +415,323 @@ The paths can also be specified in a link script with the
@code{SEARCH_DIR} command. Directories specified this way are searched
at the point in which the linker script appears in the command line.
-@cindex link map
-@kindex -M
-@item -M
-Print (to the standard output) a link map---diagnostic information about
-where symbols are mapped by @code{ld}, and information on global common
-storage allocation.
-
-@cindex link map
-@kindex -Map
-@item -Map @var{mapfile}
-Print to the file @var{mapfile} a link map---diagnostic information
-about where symbols are mapped by @code{ld}, and information on global
-common storage allocation.
-
@cindex emulation
@kindex -m @var{emulation}
@item -m@var{emulation}
-@itemx -m @var{emulation}
Emulate the @var{emulation} linker. You can list the available
emulations with the @samp{--verbose} or @samp{-V} options. The default
depends on how your @code{ld} was configured.
+@cindex link map
+@kindex -M
+@kindex --print-map
+@item -M
+@itemx --print-map
+Print (to the standard output) a link map---diagnostic information about
+where symbols are mapped by @code{ld}, and information on global common
+storage allocation.
+
+@kindex -n
+@cindex read-only text
+@cindex NMAGIC
+@kindex --nmagic
+@item -n
+@itemx --nmagic
+Set the text segment to be read only, and mark the output as
+@code{NMAGIC} if possible.
+
@kindex -N
+@kindex --omagic
@cindex read/write from cmd line
-@kindex OMAGIC
+@cindex OMAGIC
@item -N
+@itemx --omagic
Set the text and data sections to be readable and writable. Also, do
not page-align the data segment. If the output format supports Unix
style magic numbers, mark the output as @code{OMAGIC}.
-@kindex -n
-@cindex read-only text
-@kindex NMAGIC
-@item -n
-Set the text segment to be read only, and mark the output as
-@code{NMAGIC} if possible.
+@kindex -o @var{output}
+@kindex --output=@var{output}
+@cindex naming the output file
+@item -o @var{output}
+@itemx --output=@var{output}
+Use @var{output} as the name for the program produced by @code{ld}; if this
+option is not specified, the name @file{a.out} is used by default. The
+script command @code{OUTPUT} can also specify the output file name.
-@cindex output file after errors
-@kindex -noinhibit-exec
-@item -noinhibit-exec
-Retain the executable output file whenever it is still usable.
-Normally, the linker will not produce an output file if it encounters
-errors during the link process; it exits without writing an output file
-when it issues any error whatsoever.
+@cindex partial link
+@cindex relocatable output
+@kindex -r
+@kindex --relocateable
+@item -r
+@itemx --relocateable
+Generate relocatable output---i.e., generate an output file that can in
+turn serve as input to @code{ld}. This is often called @dfn{partial
+linking}. As a side effect, in environments that support standard Unix
+magic numbers, this option also sets the output file's magic number to
+@code{OMAGIC}.
+@c ; see @code{-N}.
+If this option is not specified, an absolute file is produced. When
+linking C++ programs, this option @emph{will not} resolve references to
+constructors; to do that, use @samp{-Ur}.
+
+This option does the same thing as @samp{-i}.
+
+@kindex -R @var{file}
+@kindex --just-symbols=@var{file}
+@cindex symbol-only input
+@item -R @var{filename}
+@itemx --just-symbols=@var{filename}
+Read symbol names and their addresses from @var{filename}, but do not
+relocate it or include it in the output. This allows your output file
+to refer symbolically to absolute locations of memory defined in other
+programs. You may use this option more than once.
+
+For compatibility with other ELF linkers, if the @code{-R} option is
+followed by a directory name, rather than a file name, it is treated as
+the @code{-rpath} option.
+
+@kindex -s
+@kindex --strip-all
+@cindex strip all symbols
+@item -s
+@itemx --strip-all
+Omit all symbol information from the output file.
+
+@kindex -S
+@kindex --strip-debug
+@cindex strip debugger symbols
+@item -S
+@itemx --strip-debug
+Omit debugger symbol information (but not all symbols) from the output file.
+
+@kindex -t
+@kindex --trace
+@cindex input files, displaying
+@item -t
+@itemx --trace
+Print the names of the input files as @code{ld} processes them.
+
+@kindex -T @var{script}
+@kindex --script=@var{script}
+@cindex script files
+@item -T @var{commandfile}
+@itemx --script=@var{commandfile}
+Read link commands from the file @var{commandfile}. These commands
+replace @code{ld}'s default link script (rather than adding
+to it), so @var{commandfile} must specify everything necessary to describe
+the target format. @xref{Commands}. If @var{commandfile} does not
+exist, @code{ld} looks for it in the directories specified by any
+preceding @samp{-L} options. Multiple @samp{-T} options accumulate.
+
+@kindex -u @var{symbol}
+@kindex --undefined=@var{symbol}
+@cindex undefined symbol
+@item -u @var{symbol}
+@itemx --undefined=@var{symbol}
+Force @var{symbol} to be entered in the output file as an undefined symbol.
+Doing this may, for example, trigger linking of additional modules from
+standard libraries. @samp{-u} may be repeated with different option
+arguments to enter additional undefined symbols.
+@c Nice idea, but no such command: This option is equivalent
+@c to the @code{EXTERN} linker command.
+
+@kindex -v
+@kindex -V
+@kindex --version
+@cindex version
+@item -v
+@itemx --version
+@itemx -V
+Display the version number for @code{ld}. The @code{-V} option also
+lists the supported emulations.
+
+@kindex -x
+@kindex --discard-all
+@cindex deleting local symbols
+@item -x
+@itemx --discard-all
+Delete all local symbols.
+
+@kindex -X
+@kindex --discard-locals
+@cindex local symbols, deleting
+@cindex L, deleting symbols beginning
+@item -X
+@itemx --discard-locals
+Delete all temporary local symbols. For most targets, this is all local
+symbols whose names begin with @samp{L}.
+
+@kindex -y @var{symbol}
+@kindex --trace-symbol=@var{symbol}
+@cindex symbol tracing
+@item -y @var{symbol}
+@itemx --trace-symbol=@var{symbol}
+Print the name of each linked file in which @var{symbol} appears. This
+option may be given any number of times. On many systems it is necessary
+to prepend an underscore.
+
+This option is useful when you have an undefined symbol in your link but
+don't know where the reference is coming from.
+
+@kindex -Y @var{path}
+@item -Y @var{path}
+Add @var{path} to the default library search path. This option exists
+for Solaris compatibility.
+
+@kindex -z @var{keyword}
+@item -z @var{keyword}
+This option is ignored for Solaris compatibility.
+
+@kindex -(
+@cindex groups of archives
+@item -( @var{archives} -)
+@itemx --start-group @var{archives} --end-group
+The @var{archives} should be a list of archive files. They may be
+either explicit file names, or @samp{-l} options.
+
+The specified archives are searched repeatedly until no new undefined
+references are created. Normally, an archive is searched only once in
+the order that it is specified on the command line. If a symbol in that
+archive is needed to resolve an undefined symbol referred to by an
+object in an archive that appears later on the command line, the linker
+would not be able to resolve that reference. By grouping the archives,
+they all be searched repeatedly until all possible references are
+resolved.
+
+Using this option has a significant performance cost. It is best to use
+it only when there are unavoidable circular references between two or
+more archives.
+
+@kindex -assert @var{keyword}
+@item -assert @var{keyword}
+This option is ignored for SunOS compatibility.
+
+@kindex -Bdynamic
+@kindex -dy
+@kindex -call_shared
+@item -Bdynamic
+@itemx -dy
+@itemx -call_shared
+Link against dynamic libraries. This is only meaningful on platforms
+for which shared libraries are supported. This option is normally the
+default on such platforms. The different variants of this option are
+for compatibility with various systems. You may use this option
+multiple times on the command line: it affects library searching for
+@code{-l} options which follow it.
+
+@kindex -Bstatic
+@kindex -dn
+@kindex -non_shared
+@kindex -static
+@item -Bstatic
+@itemx -dn
+@itemx -non_shared
+@itemx -static
+Do not link against shared libraries. This is only meaningful on
+platforms for which shared libraries are supported. The different
+variants of this option are for compatibility with various systems. You
+may use this option multiple times on the command line: it affects
+library searching for @code{-l} options which follow it.
+
+@kindex -Bsymbolic
+@item -Bsymbolic
+When creating a shared library, bind references to global symbols to the
+definition within the shared library, if any. Normally, it is possible
+for a program linked against a shared library to override the definition
+within the shared library. This option is only meaningful on ELF
+platforms which support shared libraries.
+
+@cindex cross reference table
+@kindex --cref
+@item --cref
+Output a cross reference table. If a linker map file is being
+generated, the cross reference table is printed to the map file.
+Otherwise, it is printed on the standard output.
+
+The format of the table is intentionally simple, so that it may be
+easily processed by a script if necessary. The symbols are printed out,
+sorted by name. For each symbol, a list of file names is given. If the
+symbol is defined, the first file listed is the location of the
+definition. The remaining files contain references to the symbol.
+
+@cindex symbols, from command line
+@kindex --defsym @var{symbol}=@var{exp}
+@item --defsym @var{symbol}=@var{expression}
+Create a global symbol in the output file, containing the absolute
+address given by @var{expression}. You may use this option as many
+times as necessary to define multiple symbols in the command line. A
+limited form of arithmetic is supported for the @var{expression} in this
+context: you may give a hexadecimal constant or the name of an existing
+symbol, or use @code{+} and @code{-} to add or subtract hexadecimal
+constants or symbols. If you need more elaborate expressions, consider
+using the linker command language from a script (@pxref{Assignment, ,
+Assignment: Symbol Definitions}). @emph{Note:} there should be no
+white space between @var{symbol}, the equals sign (``@key{=}''), and
+@var{expression}.
+
+@cindex dynamic linker, from command line
+@kindex --dynamic-linker @var{file}
+@item --dynamic-linker @var{file}
+Set the name of the dynamic linker. This is only meaningful when
+generating dynamically linked ELF executables. The default dynamic
+linker is normally correct; don't use this unless you know what you are
+doing.
+
+@cindex big-endian objects
+@cindex endianness
+@kindex -EB
+@item -EB
+Link big-endian objects. This affects the default output format.
+
+@cindex little-endian objects
+@kindex -EL
+@item -EL
+Link little-endian objects. This affects the default output format.
+
+@cindex MIPS embedded PIC code
+@kindex -embedded-relocs
+@item -embedded-relocs
+This option is only meaningful when linking MIPS embedded PIC code,
+generated by the -membedded-pic option to the @sc{gnu} compiler and
+assembler. It causes the linker to create a table which may be used at
+runtime to relocate any data which was statically initialized to pointer
+values. See the code in testsuite/ld-empic for details.
+
+@cindex help
+@cindex usage
+@kindex --help
+@item --help
+Print a summary of the command-line options on the standard output and exit.
+
+@cindex link map
+@kindex -Map
+@item -Map @var{mapfile}
+Print to the file @var{mapfile} a link map---diagnostic information
+about where symbols are mapped by @code{ld}, and information on global
+common storage allocation.
@cindex memory usage
-@kindex -no-keep-memory
-@item -no-keep-memory
+@kindex --no-keep-memory
+@item --no-keep-memory
@code{ld} normally optimizes for speed over memory usage by caching the
symbol tables of input files in memory. This option tells @code{ld} to
instead optimize for memory usage, by rereading the symbol tables as
necessary. This may be required if @code{ld} runs out of memory space
while linking a large executable.
-@kindex -o @var{output}
-@cindex naming the output file
-@item -o @var{output}
-Use @var{output} as the name for the program produced by @code{ld}; if this
-option is not specified, the name @file{a.out} is used by default. The
-script command @code{OUTPUT} can also specify the output file name.
+@kindex --no-whole-archive
+@item --no-whole-archive
+Turn off the effect of the @code{--whole-archive} option for subsequent
+archive files.
+
+@cindex output file after errors
+@kindex --noinhibit-exec
+@item --noinhibit-exec
+Retain the executable output file whenever it is still usable.
+Normally, the linker will not produce an output file if it encounters
+errors during the link process; it exits without writing an output file
+when it issues any error whatsoever.
@ifclear SingleFormat
@kindex -oformat
@@ -544,21 +749,21 @@ command @code{OUTPUT_FORMAT} can also specify the output format, but
this option overrides it. @xref{BFD}.
@end ifclear
-@kindex -R @var{file}
-@cindex symbol-only input
-@item -R @var{filename}
-Read symbol names and their addresses from @var{filename}, but do not
-relocate it or include it in the output. This allows your output file
-to refer symbolically to absolute locations of memory defined in other
-programs.
-
-@kindex -relax
+@kindex -qmagic
+@item -qmagic
+This option is ignored for Linux compatibility.
+
+@kindex -Qy
+@item -Qy
+This option is ignored for SVR4 compatibility.
+
+@kindex --relax
@cindex synthesizing linker
@cindex relaxing addressing modes
-@item -relax
+@item --relax
An option with machine dependent effects.
@ifset GENERIC
-Currently this option is only supported on the H8/300 and the Intel 960.
+This option is only supported on a few targets.
@end ifset
@ifset H8300
@xref{H8/300,,@code{ld} and the H8/300}.
@@ -567,10 +772,10 @@ Currently this option is only supported on the H8/300 and the Intel 960.
@xref{i960,, @code{ld} and the Intel 960 family}.
@end ifset
-On some platforms, the @samp{-relax} option performs global optimizations that
-become possible when the linker resolves addressing in the program, such
-as relaxing address modes and synthesizing new instructions in the
-output object file.
+On some platforms, the @samp{--relax} option performs global
+optimizations that become possible when the linker resolves addressing
+in the program, such as relaxing address modes and synthesizing new
+instructions in the output object file.
@ifset GENERIC
On platforms where this is not supported, @samp{-relax} is accepted, but
@@ -580,7 +785,7 @@ ignored.
@cindex retaining specified symbols
@cindex stripping all but some symbols
@cindex symbols, retaining selectively
-@item -retain-symbols-file @var{filename}
+@item --retain-symbols-file @var{filename}
Retain @emph{only} the symbols listed in the file @var{filename},
discarding all others. @var{filename} is simply a flat file, with one
symbol name per line. This option is especially useful in environments
@@ -617,6 +822,10 @@ runtime search path will be formed exclusively using the @code{-rpath}
options, ignoring the @code{-L} options. This can be useful when using
gcc, which adds many @code{-L} options which may be on NFS mounted
filesystems.
+
+For compatibility with other ELF linkers, if the @code{-R} option is
+followed by a directory name, rather than a file name, it is treated as
+the @code{-rpath} option.
@end ifset
@ifset GENERIC
@@ -665,110 +874,46 @@ If the required shared library is not found, the linker will issue a
warning and continue with the link.
@end ifset
-@cindex partial link
-@cindex relocatable output
-@kindex -r
-@item -r
-Generate relocatable output---i.e., generate an output file that can in
-turn serve as input to @code{ld}. This is often called @dfn{partial
-linking}. As a side effect, in environments that support standard Unix
-magic numbers, this option also sets the output file's magic number to
-@code{OMAGIC}.
-@c ; see @code{-N}.
-If this option is not specified, an absolute file is produced. When
-linking C++ programs, this option @emph{will not} resolve references to
-constructors; to do that, use @samp{-Ur}.
-
-This option does the same thing as @samp{-i}.
-
-@kindex -S
-@cindex strip debugger symbols
-@item -S
-Omit debugger symbol information (but not all symbols) from the output file.
-
-@kindex -s
-@cindex strip all symbols
-@item -s
-Omit all symbol information from the output file.
-
-@ifset GENERIC
-@cindex runtime library name
-@kindex -soname
-@item -soname @var{name}
-When creating an ELF shared object, set the internal DT_SONAME field to
-the specified name. When an executable is linked with a shared object
-which has a DT_SONAME field, then when the executable is run the dynamic
-linker will attempt to load the shared object specified by the DT_SONAME
-field rather than the using the file name given to the linker.
-@end ifset
-
+@kindex -shared
+@kindex -Bshareable
@item -shared
+@itemx -Bshareable
@cindex shared libraries
-@kindex -shared
-Create a shared library. This is currently only supported on ELF and
-SunOS platforms. On SunOS, the linker will automatically create a
+Create a shared library. This is currently only supported on ELF, XCOFF
+and SunOS platforms. On SunOS, the linker will automatically create a
shared library if the @code{-e} option is not used and there are
undefined symbols in the link.
-@item -sort-common
-@kindex -sort-common
-Normally, when @code{ld} places the global common symbols in the
-appropriate output sections, it sorts them by size. First come all the
-one byte symbols, then all the two bytes, then all the four bytes, and
-then everything else. This is to prevent gaps between symbols due to
-alignment constraints. This option disables that sorting.
-
-@kindex split
-@item -split-by-reloc @var{count}
-Trys to creates extra sections in the output file so that no single output section
-in the file contains more than @var{count} relocations. This
-is useful when generating huge relocatable for downloading into
-certain real time kernels with the COFF object file format; since
-COFF cannot represent more than 65535 relocations in a single section.
-Note that this will fail to work with object file formats which do not
-support arbitrary sections. The linker will not split up individual input
-sections for redistribution, so if a single input section contains
+@item --sort-common
+@kindex --sort-common
+This option tells @code{ld} to sort the common symbols by size when it
+places them in the appropriate output sections. First come all the one
+byte symbols, then all the two bytes, then all the four bytes, and then
+everything else. This is to prevent gaps between symbols due to
+alignment constraints.
+
+@kindex --split-by-file
+@item --split-by-file
+Similar to @code{--split-by-reloc} but creates a new output section for
+each input file.
+
+@kindex --split-by-reloc
+@item --split-by-reloc @var{count}
+Trys to creates extra sections in the output file so that no single
+output section in the file contains more than @var{count} relocations.
+This is useful when generating huge relocatable for downloading into
+certain real time kernels with the COFF object file format; since COFF
+cannot represent more than 65535 relocations in a single section. Note
+that this will fail to work with object file formats which do not
+support arbitrary sections. The linker will not split up individual
+input sections for redistribution, so if a single input section contains
more than @var{count} relocations one output section will contain that
many relocations.
-@kindex split
-@item -split-by-file
-Similar to -split-by-reloc but creates a new output section for each
-input file.
-
-@item -stats
-Compute and display statistics about the operation of the linker,
-such as execution time and memory usage.
-
-@kindex -Tbss @var{org}
-@kindex -Tdata @var{org}
-@kindex -Ttext @var{org}
-@cindex segment origins, cmd line
-@item -Tbss @var{org}
-@itemx -Tdata @var{org}
-@itemx -Ttext @var{org}
-Use @var{org} as the starting address for---respectively---the
-@code{bss}, @code{data}, or the @code{text} segment of the output file.
-@var{org} must be a single hexadecimal integer;
-for compatibility with other linkers, you may omit the leading
-@samp{0x} usually associated with hexadecimal values.
-
-@kindex -T @var{script}
-@cindex script files
-@item -T @var{commandfile}
-@itemx -T@var{commandfile}
-Read link commands from the file @var{commandfile}. These commands
-replace @code{ld}'s default link script (rather than adding
-to it), so @var{commandfile} must specify everything necessary to describe
-the target format. @xref{Commands}. If @var{commandfile} does not
-exist, @code{ld} looks for it in the directories specified by any
-preceding @samp{-L} options. Multiple @samp{-T} options accumulate.
-
-@kindex -t
-@cindex verbose
-@cindex input files, displaying
-@item -t
-Print the names of the input files as @code{ld} processes them.
+@kindex --stats
+@item --stats
+Compute and display statistics about the operation of the linker, such
+as execution time and memory usage.
@kindex -traditional-format
@cindex traditional format
@@ -785,15 +930,18 @@ full debugging information by over 30 percent. Unfortunately, the SunOS
trouble). The @samp{-traditional-format} switch tells @code{ld} to not
combine duplicate entries.
-@kindex -u @var{symbol}
-@cindex undefined symbol
-@item -u @var{symbol}
-Force @var{symbol} to be entered in the output file as an undefined symbol.
-Doing this may, for example, trigger linking of additional modules from
-standard libraries. @samp{-u} may be repeated with different option
-arguments to enter additional undefined symbols.
-@c Nice idea, but no such command: This option is equivalent
-@c to the @code{EXTERN} linker command.
+@kindex -Tbss @var{org}
+@kindex -Tdata @var{org}
+@kindex -Ttext @var{org}
+@cindex segment origins, cmd line
+@item -Tbss @var{org}
+@itemx -Tdata @var{org}
+@itemx -Ttext @var{org}
+Use @var{org} as the starting address for---respectively---the
+@code{bss}, @code{data}, or the @code{text} segment of the output file.
+@var{org} must be a single hexadecimal integer;
+for compatibility with other linkers, you may omit the leading
+@samp{0x} usually associated with hexadecimal values.
@kindex -Ur
@cindex constructors
@@ -808,22 +956,11 @@ be added to. Use @samp{-Ur} only for the last partial link, and
@samp{-r} for the others.
@kindex --verbose
-@cindex version
+@cindex verbose
@item --verbose
Display the version number for @code{ld} and list the linker emulations
-supported. Display which input files can and cannot be opened.
-
-@kindex -v
-@kindex -V
-@cindex version
-@item -v
-@itemx -V
-Display the version number for @code{ld}. The @code{-V} option also
-lists the supported emulations.
-
-@kindex -version
-@item -version
-Display the version number for @code{ld} and exit.
+supported. Display which input files can and cannot be opened. Display
+the linker script if using a default builtin script.
@kindex -warn-comon
@cindex warnings, on combining symbols
@@ -916,6 +1053,20 @@ Warn if any global constructors are used. This is only useful for a few
object file formats. For formats like COFF or ELF, the linker can not
detect the use of global constructors.
+@kindex -warn-multiple-gp
+@item -warn-multiple-gp
+Warn if multiple global pointer values are required in the output file.
+This is only meaningful for certain processors, such as the Alpha.
+Specifically, some processors put large-valued constants in a special
+section. A special register (the global pointer) points into the middle
+of this section, so that constants can be loaded efficiently via a
+base-register relative addressing mode. Since the offset in
+base-register relative mode is fixed and relatively small (e.g., 16
+bits), this limits the maximum size of the constant pool. Thus, in
+large programs, it is often necessary to use multiple global pointer
+values in order to be able to address all possible constants. This
+option causes a warning to be issued whenever this case occurs.
+
@kindex -warn-once
@cindex warnings, on undefined symbols
@cindex undefined symbols, warnings on
@@ -925,53 +1076,48 @@ which refers to it.
@kindex --whole-archive
@cindex including an entire archive
-For each archive mentioned on the command line, include every object
-file in the archive in the link, rather than searching the archive for
-the required object files. This is normally used to turn an archive
-file into a shared library, forcing every object to be included in the
-resulting shared library.
-
-@kindex -X
-@cindex local symbols, deleting
-@cindex L, deleting symbols beginning
-@item -X
-Delete all temporary local symbols. For most targets, this is all local
-symbols whose names begin with @samp{L}.
-
-@kindex -x
-@cindex deleting local symbols
-@item -x
-Delete all local symbols.
+@item --whole-archive
+For each archive mentioned on the command line after the
+@code{--whole-archive} option, include every object file in the archive
+in the link, rather than searching the archive for the required object
+files. This is normally used to turn an archive file into a shared
+library, forcing every object to be included in the resulting shared
+library. This option may be used more than once.
+
+@kindex --wrap
+@item --wrap @var{symbol}
+Use a wrapper function for @var{symbol}. Any undefined reference to
+@var{symbol} will be resolved to @code{__wrap_@var{symbol}}. Any
+undefined reference to @code{__real_@var{symbol}} will be resolved to
+@var{symbol}.
+
+This can be used to provide a wrapper for a system function. The
+wrapper function should be called @code{__wrap_@var{symbol}}. If it
+wishes to call the system function, it should call
+@code{__real_@var{symbol}}.
+
+Here is a trivial example:
-@kindex -y @var{symbol}
-@cindex symbol tracing
-@item -y @var{symbol}
-Print the name of each linked file in which @var{symbol} appears. This
-option may be given any number of times. On many systems it is necessary
-to prepend an underscore.
-
-This option is useful when you have an undefined symbol in your link but
-don't know where the reference is coming from.
+@smallexample
+void *
+__wrap_malloc (int c)
+@{
+ printf ("malloc called with %ld\n", c);
+ return __real_malloc (c);
+@}
+@end smallexample
-@kindex -(
-@cindex groups of archives
-@item -( @var{archives} -)
-@itemx --start-group @var{archives} --end-group
-The @var{archives} should be a list of archive files. They may be
-either explicit file names, or @samp{-l} options.
+If you link other code with this file using @code{--wrap malloc}, then
+all calls to @code{malloc} will call the function @code{__wrap_malloc}
+instead. The call to @code{__real_malloc} in @code{__wrap_malloc} will
+call the real @code{malloc} function.
-The specified archives are searched repeatedly until no new undefined
-references are created. Normally, an archive is searched only once in
-the order that it is specified on the command line. If a symbol in that
-archive is needed to resolve an undefined symbol referred to by an
-object in an archive that appears later on the command line, the linker
-would not be able to resolve that reference. By grouping the archives,
-they all be searched repeatedly until all possible references are
-resolved.
+You may wish to provide a @code{__real_malloc} function as well, so that
+links without the @code{--wrap} option will succeed. If you do this,
+you should not put the definition of @code{__real_malloc} in the same
+file as @code{__wrap_malloc}; if you do, the assembler may resolve the
+call before the linker has a chance to wrap it to @code{malloc}.
-Using this option has a significant performance cost. It is best to use
-it only when there are unavoidable circular references between two or
-more archives.
@end table
@ifset UsesEnvVars
@@ -1026,6 +1172,7 @@ as a supported object or archive format, it reports an error.
* Expressions:: Expressions
* MEMORY:: MEMORY Command
* SECTIONS:: SECTIONS Command
+* PHDRS:: PHDRS Command
* Entry Point:: The Entry Point
* Option Commands:: Option Commands
@end menu
@@ -1087,6 +1234,7 @@ You may call special purpose built-in functions.
* Evaluation:: Evaluation
* Assignment:: Assignment: Defining Symbols
* Arithmetic Functions:: Built-In Functions
+* Semicolons:: Semicolon Usage
@end menu
@node Integers
@@ -1116,7 +1264,7 @@ _as_hex = 0xdead;
@cindex negative integers
To write a negative integer, use
-the prefix operator @samp{-}; @pxref{Operators}.
+the prefix operator @samp{-} (@pxref{Operators}).
@smallexample
_as_neg = -57005;
@end smallexample
@@ -1235,7 +1383,7 @@ precedence associativity Operators Notes
@end smallexample
Notes:
(1) Prefix operators
-(2) @xref{Assignment}
+(2) @xref{Assignment}.
@c TEXI2ROFF-KILL
@end ifinfo
@tex
@@ -1528,6 +1676,22 @@ paging.
@end table
+@node Semicolons
+@subsection Semicolons
+
+Semicolons (``@key{;}'') are required in the following places. In all
+other places they can appear for aesthetic reasons but are otherwise ignored.
+
+@table @code
+@item Assignment
+Semicolons must appear at the end of assignment expressions.
+@xref{Assignment}
+
+@item PHDRS
+Semicolons must appear at the end of a @code{PHDRS} statement.
+@xref{PHDRS}
+@end table
+
@node MEMORY
@section Memory Layout
@kindex MEMORY
@@ -1635,7 +1799,7 @@ sections go into it.
You can also use the first two operations---defining the entry point and
defining symbols---outside the @code{SECTIONS} command: @pxref{Entry
-Point}, and @pxref{Assignment}. They are permitted here as well for
+Point}, and @ref{Assignment}. They are permitted here as well for
your convenience in reading the script, so that symbols and the entry
point can be defined at meaningful points in your output-file layout.
@@ -1687,11 +1851,15 @@ sequence of characters, but any name which does not conform to the standard
@code{ld} symbol name syntax must be quoted.
@xref{Symbols, , Symbol Names}.
+The special @var{secname} @samp{/DISCARD/} may be used to discard input
+sections. Any sections which are assigned to an output section named
+@samp{/DISCARD/} are not included in the final link output.
+
The linker will not create output sections which do not have any
contents. This is for convenience when referring to input sections that
may or may not exist. For example,
@smallexample
-.foo @{ *(.foo @}
+.foo @{ *(.foo) @}
@end smallexample
will only create a @samp{.foo} section in the output file if there is a
@samp{.foo} section in at least one input file.
@@ -1734,7 +1902,7 @@ statement.
@kindex @var{filename}(@var{section})
@cindex files and sections, section defn
@item @var{filename}( @var{section} )
-@itemx @var{filename}( @var{section}, @var{section}, @dots{} )
+@itemx @var{filename}( @var{section} , @var{section}, @dots{} )
@itemx @var{filename}( @var{section} @var{section} @dots{} )
You can name one or more sections from your input files, for
insertion in the current output section. If you wish to specify a list
@@ -1847,7 +2015,7 @@ SECTIONS @{
The foregoing statements arrange, in your output file, data originating
from your input files. You can also place data directly in an output
section from the link command script. Most of these additional
-statements involve expressions; @pxref{Expressions}. Although these
+statements involve expressions (@pxref{Expressions}). Although these
statements are shown separately here for ease of presentation, no such
segregation is needed within a section definition in the @code{SECTIONS}
command; you can intermix them freely with any of the statements we've
@@ -1990,17 +2158,18 @@ optional portions:
SECTIONS @{
@dots{}
@var{secname} @var{start} BLOCK(@var{align}) (NOLOAD) : AT ( @var{ldadr} )
- @{ @var{contents} @} >@var{region} =@var{fill}
+ @{ @var{contents} @} >@var{region} :@var{phdr} =@var{fill}
@dots{}
@}
@end group
@end smallexample
@var{secname} and @var{contents} are required. @xref{Section
-Definition}, and @pxref{Section Placement} for details on
+Definition}, and @ref{Section Placement}, for details on
@var{contents}. The remaining elements---@var{start},
@code{BLOCK(@var{align)}}, @code{(NOLOAD)}, @code{AT ( @var{ldadr} )},
-@code{>@var{region}}, and @code{=@var{fill}}---are all optional.
+@code{>@var{region}}, @code{:@var{phdr}}, and @code{=@var{fill}}---are
+all optional.
@table @code
@cindex start address, section
@@ -2109,6 +2278,17 @@ for (dst = _bstart; dst< _bend; dst++)
Assign this section to a previously defined region of memory.
@xref{MEMORY}.
+@kindex :@var{phdr}
+@cindex section, assigning to program header
+@cindex program headers and sections
+@item :@var{phdr}
+Assign this section to a segment described by a program header.
+@xref{PHDRS}. If a section is assigned to one or more segments, then
+all subsequent allocated sections will be assigned to those segments as
+well, unless they use an explicitly @code{:@var{phdr}} modifier. To
+prevent a section from being assigned to a segment when it would
+normally default to one, use @code{:NONE}.
+
@kindex =@var{fill}
@cindex section fill pattern
@cindex fill pattern, entire section
@@ -2123,6 +2303,144 @@ of a section definition.
@end table
+@node PHDRS
+@section ELF Program Headers
+@kindex PHDRS
+@kindex program headers
+@kindex ELF program headers
+
+The ELF object file format uses @dfn{program headers}, which are read by
+the system loader and describe how the program should be loaded into
+memory. These program headers must be set correctly in order to run the
+program on a native ELF system. The linker will create reasonable
+program headers by default. However, in some cases, it is desirable to
+specify the program headers more precisely; the @code{PHDRS} command may
+be used for this purpose. When the @code{PHDRS} command is used, the
+linker will not generate any program headers itself.
+
+The @code{PHDRS} command is only meaningful when generating an ELF
+output file. It is ignored in other cases. This manual does not
+describe the details of how the system loader interprets program
+headers; for more information, see the ELF ABI. The program headers of
+an ELF file may be displayed using the @samp{-p} option of the
+@code{objdump} command.
+
+This is the syntax of the @code{PHDRS} command. The words @code{PHDRS},
+@code{FILEHDR}, @code{AT}, and @code{FLAGS} are keywords.
+
+@smallexample
+@group
+PHDRS
+@{
+ @var{name} @var{type} [ FILEHDR ] [ PHDRS ] [ AT ( @var{address} ) ]
+ [ FLAGS ( @var{flags} ) ] ;
+@}
+@end group
+@end smallexample
+
+The @var{name} is used only for reference in the @code{SECTIONS} command
+of the linker script. It does not get put into the output file.
+
+Certain program header types describe segments of memory which are
+loaded from the file by the system loader. In the linker script, the
+contents of these segments are specified by directing allocated output
+sections to be placed in the segment. To do this, the command
+describing the output section in the @code{SECTIONS} command should use
+@samp{:@var{name}}, where @var{name} is the name of the program header
+as it appears in the @code{PHDRS} command. @xref{Section Options}.
+
+It is normal for certain sections to appear in more than one segment.
+This merely implies that one segment of memory contains another. This
+is specified by repeating @samp{:@var{name}}, using it once for each
+program header in which the section is to appear.
+
+If a section is placed in one or more segments using @samp{:@var{name}},
+then all subsequent allocated sections which do not specify
+@samp{:@var{name}} are placed in the same segments. This is for
+convenience, since generally a whole set of contiguous sections will be
+placed in a single segment. To prevent a section from being assigned to
+a segment when it would normally default to one, use @code{:NONE}.
+
+The @code{FILEHDR} and @code{PHDRS} keywords which may appear after the
+program header type also indicate contents of the segment of memory.
+The @code{FILEHDR} keyword means that the segment should include the ELF
+file header. The @code{PHDRS} keyword means that the segment should
+include the ELF program headers themselves.
+
+The @var{type} may be one of the following. The numbers indicate the
+value of the keyword.
+
+@table @asis
+@item @code{PT_NULL} (0)
+Indicates an unused program header.
+
+@item @code{PT_LOAD} (1)
+Indicates that this program header describes a segment to be loaded from
+the file.
+
+@item @code{PT_DYNAMIC} (2)
+Indicates a segment where dynamic linking information can be found.
+
+@item @code{PT_INTERP} (3)
+Indicates a segment where the name of the program interpreter may be
+found.
+
+@item @code{PT_NOTE} (4)
+Indicates a segment holding note information.
+
+@item @code{PT_SHLIB} (5)
+A reserved program header type, defined but not specified by the ELF
+ABI.
+
+@item @code{PT_PHDR} (6)
+Indicates a segment where the program headers may be found.
+
+@item @var{expression}
+An expression giving the numeric type of the program header. This may
+be used for types not defined above.
+@end table
+
+It is possible to specify that a segment should be loaded at a
+particular address in memory. This is done using an @code{AT}
+expression. This is identical to the @code{AT} command used in the
+@code{SECTIONS} command (@pxref{Section Options}). Using the @code{AT}
+command for a program header overrides any information in the
+@code{SECTIONS} command.
+
+Normally the segment flags are set based on the sections. The
+@code{FLAGS} keyword may be used to explicitly specify the segment
+flags. The value of @var{flags} must be an integer. It is used to
+set the @code{p_flags} field of the program header.
+
+Here is an example of the use of @code{PHDRS}. This shows a typical set
+of program headers used on a native ELF system.
+
+@example
+@group
+PHDRS
+@{
+ headers PT_PHDR PHDRS ;
+ interp PT_INTERP ;
+ text PT_LOAD FILEHDR PHDRS ;
+ data PT_LOAD ;
+ dynamic PT_DYNAMIC ;
+@}
+
+SECTIONS
+@{
+ . = SIZEOF_HEADERS;
+ .interp : @{ *(.interp) @} :text :interp
+ .text : @{ *(.text) @} :text
+ .rodata : @{ *(.rodata) @} /* defaults to :text */
+ @dots{}
+ . = . + 0x1000; /* move to a new page in memory */
+ .data : @{ *(.data) @} :data
+ .dynamic : @{ *(.dynamic) @} :data :dynamic
+ @dots{}
+@}
+@end group
+@end example
+
@node Entry Point
@section The Entry Point
@kindex ENTRY(@var{symbol})
@@ -2187,18 +2505,49 @@ command-line options.
@cindex C++ constructors, arranging in link
@cindex constructors, arranging in link
@item CONSTRUCTORS
-This command ties up C++ style constructor and destructor records. The
-details of the constructor representation vary from one object format to
-another, but usually lists of constructors and destructors appear as
-special sections. The @code{CONSTRUCTORS} command specifies where the
-linker is to place the data from these sections, relative to the rest of
-the linked output. Constructor data is marked by the symbol
-@w{@code{__CTOR_LIST__}} at the start, and @w{@code{__CTOR_LIST_END}} at
-the end; destructor data is bracketed similarly, between
-@w{@code{__DTOR_LIST__}} and @w{@code{__DTOR_LIST_END}}. (The compiler
-must arrange to actually run this code; @sc{gnu} C++ calls constructors from
-a subroutine @code{__main}, which it inserts automatically into the
-startup code for @code{main}, and destructors from @code{_exit}.)
+When linking using the @code{a.out} object file format, the linker uses
+an unusual set construct to support C++ global constructors and
+destructors. When linking object file formats which do not support
+arbitrary sections, such as @code{ECOFF} and @code{XCOFF}, the linker
+will automatically recognize C++ global constructors and destructors by
+name. For these object file formats, the @code{CONSTRUCTORS} command
+tells the linker where this information should be placed. The
+@code{CONSTRUCTORS} command is ignored for other object file formats.
+
+The symbol @w{@code{__CTOR_LIST__}} marks the start of the global
+constructors, and the symbol @w{@code{__DTOR_LIST}} marks the end. The
+first word in the list is the number of entries, followed by the address
+of each constructor or destructor, followed by a zero word. The
+compiler must arrange to actually run the code. For these object file
+formats @sc{gnu} C++ calls constructors from a subroutine @code{__main};
+a call to @code{__main} is automatically inserted into the startup code
+for @code{main}. @sc{gnu} C++ runs destructors either by using
+@code{atexit}, or directly from the function @code{exit}.
+
+For object file formats such as @code{COFF} or @code{ELF} which support
+multiple sections, @sc{gnu} C++ will normally arrange to put the
+addresses of global constructors and destructors into the @code{.ctors}
+and @code{.dtors} sections. Placing the following sequence into your
+linker script will build the sort of table which the @sc{gnu} C++
+runtime code expects to see.
+
+@smallexample
+ __CTOR_LIST__ = .;
+ LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
+ *(.ctors)
+ LONG(0)
+ __CTOR_END__ = .;
+ __DTOR_LIST__ = .;
+ LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
+ *(.dtors)
+ LONG(0)
+ __DTOR_END__ = .;
+@end smallexample
+
+Normally the compiler and linker will handle these issues automatically,
+and you will not need to concern yourself with them. However, you may
+need to consider this if you are using C++ and writing your own linker
+scripts.
@need 1000
@kindex FLOAT
diff --git a/gnu/usr.bin/binutils/ld/ldcref.c b/gnu/usr.bin/binutils/ld/ldcref.c
new file mode 100644
index 00000000000..bdce17d4fd0
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/ldcref.c
@@ -0,0 +1,326 @@
+/* ldcref.c -- output a cross reference table
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ Written by Ian Lance Taylor <ian@cygnus.com>
+
+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 holds routines that manage the cross reference table. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "bfdlink.h"
+#include "libiberty.h"
+
+#include "ld.h"
+#include "ldmain.h"
+#include "ldmisc.h"
+
+/* We keep an instance of this structure for each reference to a
+ symbol from a given object. */
+
+struct cref_ref
+{
+ /* The next reference. */
+ struct cref_ref *next;
+ /* The object. */
+ bfd *abfd;
+ /* True if the symbol is defined. */
+ unsigned int def : 1;
+ /* True if the symbol is common. */
+ unsigned int common : 1;
+ /* True if the symbol is undefined. */
+ unsigned int undef : 1;
+};
+
+/* We keep a hash table of symbols. Each entry looks like this. */
+
+struct cref_hash_entry
+{
+ struct bfd_hash_entry root;
+ /* The demangled name. */
+ char *demangled;
+ /* References to and definitions of this symbol. */
+ struct cref_ref *refs;
+};
+
+/* This is what the hash table looks like. */
+
+struct cref_hash_table
+{
+ struct bfd_hash_table root;
+};
+
+/* Local functions. */
+
+static struct bfd_hash_entry *cref_hash_newfunc
+ PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
+static boolean cref_fill_array PARAMS ((struct cref_hash_entry *, PTR));
+static int cref_sort_array PARAMS ((const PTR, const PTR));
+static void output_one_cref PARAMS ((FILE *, struct cref_hash_entry *));
+
+/* Look up an entry in the cref hash table. */
+
+#define cref_hash_lookup(table, string, create, copy) \
+ ((struct cref_hash_entry *) \
+ bfd_hash_lookup (&(table)->root, (string), (create), (copy)))
+
+/* Traverse the cref hash table. */
+
+#define cref_hash_traverse(table, func, info) \
+ (bfd_hash_traverse \
+ (&(table)->root, \
+ (boolean (*) PARAMS ((struct bfd_hash_entry *, PTR))) (func), \
+ (info)))
+
+/* The cref hash table. */
+
+static struct cref_hash_table cref_table;
+
+/* Whether the cref hash table has been initialized. */
+
+static boolean cref_initialized;
+
+/* The number of symbols seen so far. */
+
+static size_t cref_symcount;
+
+/* Create an entry in a cref hash table. */
+
+static struct bfd_hash_entry *
+cref_hash_newfunc (entry, table, string)
+ struct bfd_hash_entry *entry;
+ struct bfd_hash_table *table;
+ const char *string;
+{
+ struct cref_hash_entry *ret = (struct cref_hash_entry *) entry;
+
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (ret == NULL)
+ ret = ((struct cref_hash_entry *)
+ bfd_hash_allocate (table, sizeof (struct cref_hash_entry)));
+ if (ret == NULL)
+ return (struct bfd_hash_entry *) ret;
+
+ /* Call the allocation method of the superclass. */
+ ret = ((struct cref_hash_entry *)
+ bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));
+ if (ret != NULL)
+ {
+ /* Set local fields. */
+ ret->demangled = NULL;
+ ret->refs = NULL;
+
+ /* Keep a count of the number of entries created in the hash
+ table. */
+ ++cref_symcount;
+ }
+
+ return (struct bfd_hash_entry *) ret;
+}
+
+/* Add a symbol to the cref hash table. This is called for every
+ symbol that is seen during the link. */
+
+/*ARGSUSED*/
+void
+add_cref (name, abfd, section, value)
+ const char *name;
+ bfd *abfd;
+ asection *section;
+ bfd_vma value;
+{
+ struct cref_hash_entry *h;
+ struct cref_ref *r;
+
+ if (! cref_initialized)
+ {
+ if (! bfd_hash_table_init (&cref_table.root, cref_hash_newfunc))
+ einfo ("%X%P: bfd_hash_table_init of cref table failed: %E\n");
+ cref_initialized = true;
+ }
+
+ h = cref_hash_lookup (&cref_table, name, true, false);
+ if (h == NULL)
+ einfo ("%X%P: cref_hash_lookup failed: %E\n");
+
+ for (r = h->refs; r != NULL; r = r->next)
+ if (r->abfd == abfd)
+ break;
+
+ if (r == NULL)
+ {
+ r = (struct cref_ref *) xmalloc (sizeof *r);
+ r->next = h->refs;
+ h->refs = r;
+ r->abfd = abfd;
+ r->def = false;
+ r->common = false;
+ r->undef = false;
+ }
+
+ if (bfd_is_und_section (section))
+ r->undef = true;
+ else if (bfd_is_com_section (section))
+ r->common = true;
+ else
+ r->def = true;
+}
+
+/* Copy the addresses of the hash table entries into an array. This
+ is called via cref_hash_traverse. We also fill in the demangled
+ name. */
+
+static boolean
+cref_fill_array (h, data)
+ struct cref_hash_entry *h;
+ PTR data;
+{
+ struct cref_hash_entry ***pph = (struct cref_hash_entry ***) data;
+
+ ASSERT (h->demangled == NULL);
+ h->demangled = demangle (h->root.string);
+
+ **pph = h;
+
+ ++*pph;
+
+ return true;
+}
+
+/* Sort an array of cref hash table entries by name. */
+
+static int
+cref_sort_array (a1, a2)
+ const PTR a1;
+ const PTR a2;
+{
+ const struct cref_hash_entry **p1 = (const struct cref_hash_entry **) a1;
+ const struct cref_hash_entry **p2 = (const struct cref_hash_entry **) a2;
+
+ return strcmp ((*p1)->demangled, (*p2)->demangled);
+}
+
+/* Write out the cref table. */
+
+#define FILECOL (50)
+
+void
+output_cref (fp)
+ FILE *fp;
+{
+ int len;
+ struct cref_hash_entry **csyms, **csym_fill, **csym, **csym_end;
+
+ fprintf (fp, "\nCross Reference Table\n\n");
+ fprintf (fp, "Symbol");
+ len = sizeof "Symbol" - 1;
+ while (len < FILECOL)
+ {
+ putc (' ' , fp);
+ ++len;
+ }
+ fprintf (fp, "File\n");
+
+ if (! cref_initialized)
+ {
+ fprintf (fp, "No symbols\n");
+ return;
+ }
+
+ csyms = ((struct cref_hash_entry **)
+ xmalloc (cref_symcount * sizeof (*csyms)));
+
+ csym_fill = csyms;
+ cref_hash_traverse (&cref_table, cref_fill_array, &csym_fill);
+ ASSERT (csym_fill - csyms == cref_symcount);
+
+ qsort (csyms, cref_symcount, sizeof (*csyms), cref_sort_array);
+
+ csym_end = csyms + cref_symcount;
+ for (csym = csyms; csym < csym_end; csym++)
+ output_one_cref (fp, *csym);
+}
+
+/* Output one entry in the cross reference table. */
+
+static void
+output_one_cref (fp, h)
+ FILE *fp;
+ struct cref_hash_entry *h;
+{
+ int len;
+ struct bfd_link_hash_entry *hl;
+ struct cref_ref *r;
+
+ hl = bfd_link_hash_lookup (link_info.hash, h->root.string, false,
+ false, true);
+ if (hl == NULL)
+ einfo ("%P: symbol `%T' missing from main hash table\n",
+ h->root.string);
+ else
+ {
+ /* If this symbol is defined in a dynamic object but never
+ referenced by a normal object, then don't print it. */
+ if (hl->type == bfd_link_hash_defined)
+ {
+ if (hl->u.def.section->output_section == NULL)
+ return;
+ if ((hl->u.def.section->owner->flags & DYNAMIC) != 0)
+ {
+ for (r = h->refs; r != NULL; r = r->next)
+ if ((r->abfd->flags & DYNAMIC) == 0)
+ break;
+ if (r == NULL)
+ return;
+ }
+ }
+ }
+
+ fprintf (fp, "%s ", h->demangled);
+ len = strlen (h->demangled) + 1;
+
+ for (r = h->refs; r != NULL; r = r->next)
+ {
+ if (r->def)
+ {
+ while (len < FILECOL)
+ {
+ putc (' ', fp);
+ ++len;
+ }
+ finfo (fp, "%B\n", r->abfd);
+ len = 0;
+ }
+ }
+
+ for (r = h->refs; r != NULL; r = r->next)
+ {
+ if (! r->def)
+ {
+ while (len < FILECOL)
+ {
+ putc (' ', fp);
+ ++len;
+ }
+ finfo (fp, "%B\n", r->abfd);
+ len = 0;
+ }
+ }
+
+ ASSERT (len == 0);
+}
diff --git a/gnu/usr.bin/binutils/ld/ldctor.c b/gnu/usr.bin/binutils/ld/ldctor.c
index 5ebc494596d..d986f321287 100644
--- a/gnu/usr.bin/binutils/ld/ldctor.c
+++ b/gnu/usr.bin/binutils/ld/ldctor.c
@@ -120,6 +120,7 @@ ldctor_build_sets ()
{
static boolean called;
lang_statement_list_type *old;
+ boolean header_printed;
struct set_info *p;
/* The emulation code may call us directly, but we only want to do
@@ -133,6 +134,7 @@ ldctor_build_sets ()
lang_list_init (stat_ptr);
+ header_printed = false;
for (p = sets; p != (struct set_info *) NULL; p = p->next)
{
struct set_element *e;
@@ -201,6 +203,36 @@ ldctor_build_sets ()
for (e = p->elements; e != (struct set_element *) NULL; e = e->next)
{
+ if (config.map_file != NULL)
+ {
+ int len;
+
+ if (! header_printed)
+ {
+ minfo ("\nSet Symbol\n\n");
+ header_printed = true;
+ }
+
+ minfo ("%s", p->h->root.string);
+ len = strlen (p->h->root.string);
+
+ if (len >= 19)
+ {
+ print_nl ();
+ len = 0;
+ }
+ while (len < 20)
+ {
+ print_space ();
+ ++len;
+ }
+
+ if (e->name != NULL)
+ minfo ("%T\n", e->name);
+ else
+ minfo ("%G\n", e->section->owner, e->section, e->value);
+ }
+
if (link_info.relocateable)
lang_add_reloc (p->reloc, howto, e->section, e->name,
exp_intop (e->value));
diff --git a/gnu/usr.bin/binutils/ld/ldemul.c b/gnu/usr.bin/binutils/ld/ldemul.c
index 84826e9fd36..d0243b29cc7 100644
--- a/gnu/usr.bin/binutils/ld/ldemul.c
+++ b/gnu/usr.bin/binutils/ld/ldemul.c
@@ -145,6 +145,17 @@ ldemul_parse_args (argc, argv)
return 0;
}
+/* Let the emulation code handle an unrecognized file. */
+
+boolean
+ldemul_unrecognized_file (entry)
+ lang_input_statement_type *entry;
+{
+ if (ld_emulation->unrecognized_file)
+ return (*ld_emulation->unrecognized_file) (entry);
+ return false;
+}
+
char *
ldemul_choose_target()
{
diff --git a/gnu/usr.bin/binutils/ld/ldemul.h b/gnu/usr.bin/binutils/ld/ldemul.h
index 2d768e4759c..65c04fe70c5 100644
--- a/gnu/usr.bin/binutils/ld/ldemul.h
+++ b/gnu/usr.bin/binutils/ld/ldemul.h
@@ -40,6 +40,8 @@ extern void ldemul_create_output_section_statements PARAMS ((void));
extern boolean ldemul_place_orphan
PARAMS ((struct lang_input_statement_struct *, asection *));
extern int ldemul_parse_args PARAMS ((int, char **));
+extern boolean ldemul_unrecognized_file
+ PARAMS ((struct lang_input_statement_struct *));
extern boolean ldemul_open_dynamic_archive
PARAMS ((const char *, struct search_dirs *,
struct lang_input_statement_struct *));
@@ -112,14 +114,17 @@ typedef struct ld_emulation_xfer_struct
/* Run after assigning parsing with the args, but before
reading the script. Used to initialize symbols used in the script. */
-
void (*set_symbols) PARAMS ((void));
/* Run to parse args which the base linker doesn't
understand. Return non zero on sucess. */
-
int (*parse_args) PARAMS ((int, char **));
+ /* Run to handle files which are not recognized as object files or
+ archives. Return true if the file was handled. */
+ boolean (*unrecognized_file)
+ PARAMS ((struct lang_input_statement_struct *));
+
} ld_emulation_xfer_type;
typedef enum
diff --git a/gnu/usr.bin/binutils/ld/ldexp.c b/gnu/usr.bin/binutils/ld/ldexp.c
index dcc0cae200a..6b143c7be7f 100644
--- a/gnu/usr.bin/binutils/ld/ldexp.c
+++ b/gnu/usr.bin/binutils/ld/ldexp.c
@@ -1,5 +1,5 @@
/* This module handles expression trees.
-Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation, Inc.
+Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support (sac@cygnus.com).
This file is part of GLD, the Gnu Linker.
@@ -238,8 +238,9 @@ fold_binary (tree, current_section, allocation_done, dot, dotp)
value from a relative value is meaningful, and is an
exception. */
if (current_section != abs_output_section
- && (result.section == abs_output_section
- || other.section == abs_output_section)
+ && (other.section == abs_output_section
+ || (result.section == abs_output_section
+ && tree->type.node_code == '+'))
&& (tree->type.node_code == '+'
|| tree->type.node_code == '-'))
{
@@ -247,7 +248,7 @@ fold_binary (tree, current_section, allocation_done, dot, dotp)
/* If there is only one absolute term, make sure it is the
second one. */
- if (result.section == abs_output_section)
+ if (other.section != abs_output_section)
{
hold = result;
result = other;
@@ -345,8 +346,9 @@ fold_name (tree, current_section, allocation_done, dot)
{
struct bfd_link_hash_entry *h;
- h = bfd_link_hash_lookup (link_info.hash, tree->name.name,
- false, false, true);
+ h = bfd_wrapped_link_hash_lookup (output_bfd, &link_info,
+ tree->name.name,
+ false, false, true);
result.value = (h != (struct bfd_link_hash_entry *) NULL
&& (h->type == bfd_link_hash_defined
|| h->type == bfd_link_hash_defweak
@@ -368,15 +370,17 @@ fold_name (tree, current_section, allocation_done, dot)
{
struct bfd_link_hash_entry *h;
- h = bfd_link_hash_lookup (link_info.hash, tree->name.name,
- false, false, true);
+ h = bfd_wrapped_link_hash_lookup (output_bfd, &link_info,
+ tree->name.name,
+ false, false, true);
if (h != NULL
&& (h->type == bfd_link_hash_defined
|| h->type == bfd_link_hash_defweak))
{
if (bfd_is_abs_section (h->u.def.section))
result = new_abs (h->u.def.value);
- else if (allocation_done == lang_final_phase_enum)
+ else if (allocation_done == lang_final_phase_enum
+ || allocation_done == lang_allocating_phase_enum)
{
lang_output_section_statement_type *os;
@@ -475,28 +479,15 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
}
break;
case ABSOLUTE:
- if (allocation_done != lang_first_phase_enum)
- {
- if (current_section
- == (lang_output_section_statement_type*)NULL)
+ if (allocation_done != lang_first_phase_enum && result.valid)
{
- /* Outside a section, so it's all ok */
-
- }
- else {
- /* Inside a section, subtract the base of the section,
- so when it's added again (in an assignment), everything comes out fine
- */
+ result.value += result.section->bfd_section->vma;
result.section = abs_output_section;
- result.value -= current_section->bfd_section->vma;
- result.valid = true;
}
- }
else
- {
- result.valid = false;
- }
-
+ {
+ result.valid = false;
+ }
break;
case '~':
make_abs(&result);
@@ -549,7 +540,9 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
/* Assignment to dot can only be done during allocation */
if (tree->type.node_class == etree_provide)
einfo ("%F%S can not PROVIDE assignment to location counter\n");
- if (allocation_done == lang_allocating_phase_enum) {
+ if (allocation_done == lang_allocating_phase_enum
+ || (allocation_done == lang_final_phase_enum
+ && current_section == abs_output_section)) {
result = exp_fold_tree(tree->assign.src,
current_section,
lang_allocating_phase_enum, dot, dotp);
@@ -781,14 +774,12 @@ exp_print_tree (tree)
{
switch (tree->type.node_class) {
case etree_value:
- print_address(tree->value.value);
+ minfo ("0x%v", tree->value.value);
return;
case etree_rel:
if (tree->rel.section->owner != NULL)
- fprintf (config.map_file, "%s:",
- bfd_get_filename (tree->rel.section->owner));
- fprintf (config.map_file, "%s+", tree->rel.section->name);
- print_address (tree->rel.value);
+ minfo ("%B:", tree->rel.section->owner);
+ minfo ("%s+0x%v", tree->rel.section->name, tree->rel.value);
return;
case etree_assign:
#if 0
@@ -800,7 +791,7 @@ exp_print_tree (tree)
fprintf(config.map_file,"%s (UNDEFINED)",tree->assign.dst->name);
}
#endif
- fprintf(config.map_file,"%s ",tree->assign.dst);
+ fprintf(config.map_file,"%s",tree->assign.dst);
exp_print_token(tree->type.node_code);
exp_print_tree(tree->assign.src);
break;
diff --git a/gnu/usr.bin/binutils/ld/ldgram.y b/gnu/usr.bin/binutils/ld/ldgram.y
index b08d00a58c1..a20437caebe 100644
--- a/gnu/usr.bin/binutils/ld/ldgram.y
+++ b/gnu/usr.bin/binutils/ld/ldgram.y
@@ -1,5 +1,5 @@
/* A YACC grammer to parse a superset of the AT&T linker scripting languaue.
- Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
This file is part of GNU ld.
@@ -68,14 +68,22 @@ static int error_index;
char *name;
int token;
union etree_union *etree;
+ struct phdr_info
+ {
+ boolean filehdr;
+ boolean phdrs;
+ union etree_union *at;
+ union etree_union *flags;
+ } phdr;
}
-%type <etree> exp opt_exp_with_type mustbe_exp opt_at
+%type <etree> exp opt_exp_with_type mustbe_exp opt_at phdr_type phdr_val
%type <integer> fill_opt
%type <name> memspec_opt casesymlist
%token <integer> INT
%token <name> NAME LNAME
%type <integer> length
+%type <phdr> phdr_qualifiers
%right <token> PLUSEQ MINUSEQ MULTEQ DIVEQ '=' LSHIFTEQ RSHIFTEQ ANDEQ OREQ
%right <token> '?' ':'
@@ -95,7 +103,7 @@ static int error_index;
%token END
%left <token> '('
%token <token> ALIGN_K BLOCK QUAD LONG SHORT BYTE
-%token SECTIONS
+%token SECTIONS PHDRS
%token '{' '}'
%token SIZEOF_HEADERS OUTPUT_FORMAT FORCE_COMMON_ALLOCATION OUTPUT_ARCH
%token SIZEOF_HEADERS
@@ -136,12 +144,15 @@ defsym_expr:
/* SYNTAX WITHIN AN MRI SCRIPT FILE */
mri_script_file:
- { ldlex_mri_script();
- PUSH_ERROR("MRI style script");
+ {
+ ldlex_mri_script ();
+ PUSH_ERROR ("MRI style script");
}
mri_script_lines
- { ldlex_popstate();
- POP_ERROR();
+ {
+ ldlex_popstate ();
+ mri_draw_tree ();
+ POP_ERROR ();
}
;
@@ -257,6 +268,7 @@ ifile_list:
ifile_p1:
memory
| sections
+ | phdrs
| startup
| high_level_library
| low_level_library
@@ -633,13 +645,12 @@ section: NAME { ldlex_expression(); }
lang_enter_output_section_statement($1,$3,typebits,0,0,0,$4);
}
statement_list_opt
- '}' {ldlex_expression();} memspec_opt fill_opt
+ '}' {ldlex_expression();} memspec_opt phdr_opt fill_opt
{
ldlex_popstate();
- lang_leave_output_section_statement($12, $11);
+ lang_leave_output_section_statement($13, $11);
}
-opt_comma
-
+ opt_comma
;
type:
@@ -666,6 +677,99 @@ memspec_opt:
{ $$ = $2; }
| { $$ = "*default*"; }
;
+
+phdr_opt:
+ /* empty */
+ | phdr_opt ':' NAME
+ {
+ lang_section_in_phdr ($3);
+ }
+ ;
+
+phdrs:
+ PHDRS '{' phdr_list '}'
+ ;
+
+phdr_list:
+ /* empty */
+ | phdr_list phdr
+ ;
+
+phdr:
+ NAME { ldlex_expression (); }
+ phdr_type phdr_qualifiers { ldlex_popstate (); }
+ ';'
+ {
+ lang_new_phdr ($1, $3, $4.filehdr, $4.phdrs, $4.at,
+ $4.flags);
+ }
+ ;
+
+phdr_type:
+ exp
+ {
+ $$ = $1;
+
+ if ($1->type.node_class == etree_name
+ && $1->type.node_code == NAME)
+ {
+ const char *s;
+ unsigned int i;
+ static const char * const phdr_types[] =
+ {
+ "PT_NULL", "PT_LOAD", "PT_DYNAMIC",
+ "PT_INTERP", "PT_NOTE", "PT_SHLIB",
+ "PT_PHDR"
+ };
+
+ s = $1->name.name;
+ for (i = 0;
+ i < sizeof phdr_types / sizeof phdr_types[0];
+ i++)
+ if (strcmp (s, phdr_types[i]) == 0)
+ {
+ $$ = exp_intop (i);
+ break;
+ }
+ }
+ }
+ ;
+
+phdr_qualifiers:
+ /* empty */
+ {
+ memset (&$$, 0, sizeof (struct phdr_info));
+ }
+ | NAME phdr_val phdr_qualifiers
+ {
+ $$ = $3;
+ if (strcmp ($1, "FILEHDR") == 0 && $2 == NULL)
+ $$.filehdr = true;
+ else if (strcmp ($1, "PHDRS") == 0 && $2 == NULL)
+ $$.phdrs = true;
+ else if (strcmp ($1, "FLAGS") == 0 && $2 != NULL)
+ $$.flags = $2;
+ else
+ einfo ("%X%P:%S: PHDRS syntax error at `%s'\n", $1);
+ }
+ | AT '(' exp ')' phdr_qualifiers
+ {
+ $$ = $5;
+ $$.at = $3;
+ }
+ ;
+
+phdr_val:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ | '(' exp ')'
+ {
+ $$ = $2;
+ }
+ ;
+
%%
void
yyerror(arg)
diff --git a/gnu/usr.bin/binutils/ld/ldlang.c b/gnu/usr.bin/binutils/ld/ldlang.c
index 88f15e4d2fe..44173fff09f 100644
--- a/gnu/usr.bin/binutils/ld/ldlang.c
+++ b/gnu/usr.bin/binutils/ld/ldlang.c
@@ -1,5 +1,5 @@
/* Linker command language support.
- Copyright (C) 1991, 92, 93, 94, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -34,9 +34,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307
#include "ldfile.h"
/* FORWARDS */
-static void print_statements PARAMS ((void));
-static void print_statement PARAMS ((lang_statement_union_type *,
- lang_output_section_statement_type *));
static lang_statement_union_type *new_statement PARAMS ((enum statement_enum,
size_t,
lang_statement_list_type*));
@@ -57,21 +54,17 @@ static lang_input_statement_type *first_file;
static lang_statement_list_type lang_output_section_statement;
static CONST char *current_target;
static CONST char *output_target;
-static int longest_section_name = 8;
static lang_statement_list_type statement_list;
+static struct lang_phdr *lang_phdr_list;
-static void print_size PARAMS ((size_t value));
-static void print_alignment PARAMS ((unsigned int value));
-static void print_fill PARAMS ((fill_type value));
-static void print_section PARAMS ((const char *name));
static void lang_for_each_statement_worker
PARAMS ((void (*func) (lang_statement_union_type *),
lang_statement_union_type *s));
static lang_input_statement_type *new_afile
PARAMS ((const char *name, lang_input_file_enum_type file_type,
const char *target, boolean add_to_list));
-static void print_flags PARAMS ((int *ignore_flags));
static void init_os PARAMS ((lang_output_section_statement_type *s));
+static void section_already_linked PARAMS ((bfd *, asection *, PTR));
static void wild_section PARAMS ((lang_wild_statement_type *ptr,
const char *section,
lang_input_statement_type *file,
@@ -102,6 +95,7 @@ static void print_input_statement PARAMS ((lang_input_statement_type *statm));
static void print_input_section PARAMS ((lang_input_section_type *in));
static void print_fill_statement PARAMS ((lang_fill_statement_type *fill));
static void print_data_statement PARAMS ((lang_data_statement_type *data));
+static void print_address_statement PARAMS ((lang_address_statement_type *));
static void print_reloc_statement PARAMS ((lang_reloc_statement_type *reloc));
static void print_padding_statement PARAMS ((lang_padding_statement_type *s));
static void print_wild_statement
@@ -111,6 +105,8 @@ static void print_group
PARAMS ((lang_group_statement_type *, lang_output_section_statement_type *));
static void print_statement PARAMS ((lang_statement_union_type *s,
lang_output_section_statement_type *os));
+static void print_statement_list PARAMS ((lang_statement_union_type *s,
+ lang_output_section_statement_type *os));
static void print_statements PARAMS ((void));
static bfd_vma insert_pad PARAMS ((lang_statement_union_type **this_ptr,
fill_type fill, unsigned int power,
@@ -128,6 +124,7 @@ static void lang_place_orphans PARAMS ((void));
static int topower PARAMS ((int));
static void lang_set_startof PARAMS ((void));
static void reset_memory_regions PARAMS ((void));
+static void lang_record_phdrs PARAMS ((void));
/* EXPORTS */
lang_output_section_statement_type *abs_output_section;
@@ -155,6 +152,8 @@ etree_type *base; /* Relocation base - or null */
#define outside_symbol_address(q) ((q)->value + outside_section_address(q->section))
+#define SECTION_NAME_MAP_LENGTH (16)
+
PTR
stat_alloc (size)
size_t size;
@@ -162,34 +161,6 @@ stat_alloc (size)
return obstack_alloc (&stat_obstack, size);
}
-static void
-print_size (value)
- size_t value;
-{
- fprintf (config.map_file, "%5x", (unsigned) value);
-}
-
-static void
-print_alignment (value)
- unsigned int value;
-{
- fprintf (config.map_file, "2**%1u", value);
-}
-
-static void
-print_fill (value)
- fill_type value;
-{
- fprintf (config.map_file, "%04x", (unsigned) value);
-}
-
-static void
-print_section (name)
- CONST char *name;
-{
- fprintf (config.map_file, "%*s", -longest_section_name, name);
-}
-
/*----------------------------------------------------------------------
lang_for_each_statement walks the parse tree and calls the provided
function for each node
@@ -233,6 +204,7 @@ lang_for_each_statement_worker (func, s)
case lang_assignment_statement_enum:
case lang_padding_statement_enum:
case lang_address_statement_enum:
+ case lang_fill_statement_enum:
break;
default:
FAIL ();
@@ -372,6 +344,7 @@ new_afile (name, file_type, target, add_to_list)
p->symbol_count = 0;
p->common_output_section = (asection *) NULL;
p->dynamic = config.dynamic_link;
+ p->whole_archive = whole_archive;
p->loaded = false;
lang_statement_append (&input_file_chain,
(lang_statement_union_type *) p,
@@ -526,6 +499,7 @@ lang_output_section_statement_lookup (name)
lookup->subsection_alignment = -1;
lookup->section_alignment = -1;
lookup->load_base = (union etree_union *) NULL;
+ lookup->phdrs = NULL;
lang_statement_append (&lang_output_section_statement,
(lang_statement_union_type *) lookup,
@@ -534,63 +508,39 @@ lang_output_section_statement_lookup (name)
return lookup;
}
-/*ARGSUSED*/
-static void
-print_flags (ignore_flags)
- int *ignore_flags;
-{
- fprintf (config.map_file, "(");
-#if 0
- if (flags->flag_read)
- fprintf (outfile, "R");
- if (flags->flag_write)
- fprintf (outfile, "W");
- if (flags->flag_executable)
- fprintf (outfile, "X");
- if (flags->flag_loadable)
- fprintf (outfile, "L");
-#endif
- fprintf (config.map_file, ")");
-}
-
void
lang_map ()
{
lang_memory_region_type *m;
- fprintf (config.map_file, "**MEMORY CONFIGURATION**\n\n");
-#ifdef BFD64
- fprintf (config.map_file, "name\t\torigin\t\tlength\t\tattributes\n");
-#else
- fprintf (config.map_file,
- "name\t\torigin length r_size c_size is attributes\n");
+ minfo ("\nMemory Configuration\n\n");
+ fprintf (config.map_file, "%-16s %-18s %-18s\n",
+ "Name", "Origin", "Length");
-#endif
for (m = lang_memory_region_list;
m != (lang_memory_region_type *) NULL;
m = m->next)
{
- fprintf (config.map_file, "%-16s", m->name);
- print_address (m->origin);
- print_space ();
- print_address ((bfd_vma)m->length);
- print_space ();
- print_address ((bfd_vma)m->old_length);
- print_space();
- print_address (m->current - m->origin);
- print_space();
- if (m->old_length)
- fprintf (config.map_file, " %2d%% ",
- (int) ((m->current - m->origin) * 100 / m->old_length));
- print_flags (&m->flags);
- fprintf (config.map_file, "\n");
- }
- fprintf (config.map_file, "\n\n**LINK EDITOR MEMORY MAP**\n\n");
- fprintf (config.map_file, "output input virtual\n");
- fprintf (config.map_file, "section section address tsize\n\n");
+ char buf[100];
+ int len;
- print_statements ();
+ fprintf (config.map_file, "%-16s ", m->name);
+ sprintf_vma (buf, m->origin);
+ minfo ("0x%s ", buf);
+ len = strlen (buf);
+ while (len < 16)
+ {
+ print_space ();
+ ++len;
+ }
+
+ minfo ("0x%V\n", m->length);
+ }
+
+ fprintf (config.map_file, "\nLinker script and memory map\n\n");
+
+ print_statements ();
}
/*
@@ -600,10 +550,13 @@ static void
init_os (s)
lang_output_section_statement_type * s;
{
-/* asection *section = bfd_get_section_by_name(output_bfd, s->name);*/
- section_userdata_type *new =
- (section_userdata_type *)
- stat_alloc (sizeof (section_userdata_type));
+ section_userdata_type *new;
+
+ if (strcmp (s->name, DISCARD_SECTION_NAME) == 0)
+ einfo ("%P%F: Illegal use of `%s' section", DISCARD_SECTION_NAME);
+
+ new = ((section_userdata_type *)
+ stat_alloc (sizeof (section_userdata_type)));
s->bfd_section = bfd_get_section_by_name (output_bfd, s->name);
if (s->bfd_section == (asection *) NULL)
@@ -619,70 +572,191 @@ init_os (s)
/* vma to allow us to output a section through itself */
s->bfd_section->output_offset = 0;
get_userdata (s->bfd_section) = (PTR) new;
-
}
-/***********************************************************************
- The wild routines.
+/* Sections marked with the SEC_LINK_ONCE flag should only be linked
+ once into the output. This routine checks each sections, and
+ arranges to discard it if a section of the same name has already
+ been linked. This code assumes that all relevant sections have the
+ SEC_LINK_ONCE flag set; that is, it does not depend solely upon the
+ section name. This is called via bfd_map_over_sections. */
- These expand statements like *(.text) and foo.o to a list of
- explicit actions, like foo.o(.text), bar.o(.text) and
- foo.o(.text,.data) .
+/*ARGSUSED*/
+static void
+section_already_linked (abfd, sec, ignore)
+ bfd *abfd;
+ asection *sec;
+ PTR ignore;
+{
+ struct sec_link_once
+ {
+ struct sec_link_once *next;
+ asection *sec;
+ };
+ static struct sec_link_once *sec_link_once_list;
+ flagword flags;
+ const char *name;
+ struct sec_link_once *l;
- The toplevel routine, wild, takes a statement, section, file and
- target. If either the section or file is null it is taken to be the
- wildcard. Seperate lang_input_section statements are created for
- each part of the expanstion, and placed after the statement provided.
+ flags = bfd_get_section_flags (abfd, sec);
-*/
+ if ((flags & SEC_LINK_ONCE) == 0)
+ return;
+
+ name = bfd_get_section_name (abfd, sec);
+
+ for (l = sec_link_once_list; l != NULL; l = l->next)
+ {
+ if (strcmp (name, bfd_get_section_name (l->sec->owner, l->sec)) == 0)
+ {
+ /* The section has already been linked. See if we should
+ issue a warning. */
+ switch (flags & SEC_LINK_DUPLICATES)
+ {
+ default:
+ abort ();
+
+ case SEC_LINK_DUPLICATES_DISCARD:
+ break;
+
+ case SEC_LINK_DUPLICATES_ONE_ONLY:
+ einfo ("%P: %B: warning: ignoring duplicate section `%s'\n",
+ abfd, name);
+ break;
+
+ case SEC_LINK_DUPLICATES_SAME_CONTENTS:
+ /* FIXME: We should really dig out the contents of both
+ sections and memcmp them. The COFF/PE spec says that
+ the Microsoft linker does not implement this
+ correctly, so I'm not going to bother doing it
+ either. */
+ /* Fall through. */
+ case SEC_LINK_DUPLICATES_SAME_SIZE:
+ if (bfd_section_size (abfd, sec)
+ != bfd_section_size (l->sec->owner, l->sec))
+ einfo ("%P: %B: warning: duplicate section `%s' has different size\n",
+ abfd, name);
+ break;
+ }
+
+ /* Set the output_section field so that wild_doit does not
+ create a lang_input_section structure for this section. */
+ sec->output_section = bfd_abs_section_ptr;
+
+ return;
+ }
+ }
+
+ /* This is the first section with this name. Record it. */
+
+ l = (struct sec_link_once *) xmalloc (sizeof *l);
+ l->sec = sec;
+ l->next = sec_link_once_list;
+ sec_link_once_list = l;
+}
+
+/* The wild routines.
+
+ These expand statements like *(.text) and foo.o to a list of
+ explicit actions, like foo.o(.text), bar.o(.text) and
+ foo.o(.text, .data). */
+
+/* Add SECTION to the output section OUTPUT. Do this by creating a
+ lang_input_section statement which is placed at PTR. FILE is the
+ input file which holds SECTION. */
void
wild_doit (ptr, section, output, file)
- lang_statement_list_type * ptr;
- asection * section;
- lang_output_section_statement_type * output;
- lang_input_statement_type * file;
+ lang_statement_list_type *ptr;
+ asection *section;
+ lang_output_section_statement_type *output;
+ lang_input_statement_type *file;
{
- if (output->bfd_section == (asection *) NULL)
- init_os (output);
+ flagword flags;
+ boolean discard;
- if (section != (asection *) NULL
- && section->output_section == (asection *) NULL)
- {
- /* Add a section reference to the list */
- lang_input_section_type *new = new_stat (lang_input_section, ptr);
+ flags = bfd_get_section_flags (section->owner, section);
- new->section = section;
- new->ifile = file;
- section->output_section = output->bfd_section;
+ discard = false;
- /* We don't copy the SEC_NEVER_LOAD flag from an input section to
- an output section, because we want to be able to include a
- SEC_NEVER_LOAD section in the middle of an otherwise loaded
- section (I don't know why we want to do this, but we do).
- build_link_order in ldwrite.c handles this case by turning the
- embedded SEC_NEVER_LOAD section into a fill. */
- section->output_section->flags |=
- section->flags & (flagword) (~ SEC_NEVER_LOAD);
+ /* If we are doing a final link, discard sections marked with
+ SEC_EXCLUDE. */
+ if (! link_info.relocateable
+ && (flags & SEC_EXCLUDE) != 0)
+ discard = true;
- if (!output->loadable)
- {
- /* Turn off load flag */
- output->bfd_section->flags &= ~SEC_LOAD;
- output->bfd_section->flags |= SEC_NEVER_LOAD;
- }
- if (section->alignment_power > output->bfd_section->alignment_power)
+ /* Discard input sections which are assigned to a section named
+ DISCARD_SECTION_NAME. */
+ if (strcmp (output->name, DISCARD_SECTION_NAME) == 0)
+ discard = true;
+
+ /* Discard debugging sections if we are stripping debugging
+ information. */
+ if ((link_info.strip == strip_debugger || link_info.strip == strip_all)
+ && (flags & SEC_DEBUGGING) != 0)
+ discard = true;
+
+ if (discard)
{
- output->bfd_section->alignment_power = section->alignment_power;
+ if (section->output_section == NULL)
+ {
+ /* This prevents future calls from assigning this section. */
+ section->output_section = bfd_abs_section_ptr;
+ }
+ return;
}
- /* If supplied an aligmnet, then force it */
- if (output->section_alignment != -1)
+
+ if (section->output_section == NULL)
{
- output->bfd_section->alignment_power = output->section_alignment;
+ lang_input_section_type *new;
+
+ if (output->bfd_section == NULL)
+ init_os (output);
+
+ /* Add a section reference to the list */
+ new = new_stat (lang_input_section, ptr);
+
+ new->section = section;
+ new->ifile = file;
+ section->output_section = output->bfd_section;
+
+ /* We don't copy the SEC_NEVER_LOAD flag from an input section
+ to an output section, because we want to be able to include a
+ SEC_NEVER_LOAD section in the middle of an otherwise loaded
+ section (I don't know why we want to do this, but we do).
+ build_link_order in ldwrite.c handles this case by turning
+ the embedded SEC_NEVER_LOAD section into a fill.
+
+ If final link, don't copy the SEC_LINK_ONCE flags, they've already
+ been processed. One reason to do this is that on pe format targets,
+ .text$foo sections go into .text and it's odd to see .text with
+ SEC_LINK_ONCE set. */
+
+ section->output_section->flags |=
+ section->flags & (flagword) (~ (SEC_NEVER_LOAD
+ | (! link_info.relocateable
+ ? SEC_LINK_ONCE | SEC_LINK_DUPLICATES
+ : 0)));
+
+ if (! output->loadable)
+ {
+ /* Turn off load flag */
+ output->bfd_section->flags &= ~SEC_LOAD;
+ output->bfd_section->flags |= SEC_NEVER_LOAD;
+ }
+
+ if (section->alignment_power > output->bfd_section->alignment_power)
+ output->bfd_section->alignment_power = section->alignment_power;
+
+ /* If supplied an aligment, then force it. */
+ if (output->section_alignment != -1)
+ output->bfd_section->alignment_power = output->section_alignment;
}
- }
}
+/* Expand a wild statement for a particular FILE. SECTION may be
+ NULL, in which case it is a wild card. */
+
static void
wild_section (ptr, section, file, output)
lang_wild_statement_type *ptr;
@@ -712,16 +786,13 @@ wild_section (ptr, section, file, output)
}
}
-/* passed a file name (which must have been seen already and added to
- the statement tree. We will see if it has been opened already and
- had its symbols read. If not then we'll read it.
+/* This is passed a file name which must have been seen already and
+ added to the statement tree. We will see if it has been opened
+ already and had its symbols read. If not then we'll read it. */
- Archives are pecuilar here. We may open them once, but if they do
- not define anything we need at the time, they won't have all their
- symbols read. If we need them later, we'll have to redo it. */
static lang_input_statement_type *
lookup_name (name)
- CONST char *name;
+ const char *name;
{
lang_input_statement_type *search;
@@ -789,11 +860,16 @@ load_symbols (entry, place)
|| place == NULL)
einfo ("%F%B: file not recognized: %E\n", entry->the_bfd);
- /* Try to interpret the file as a linker script. */
-
bfd_close (entry->the_bfd);
entry->the_bfd = NULL;
+ /* See if the emulation has some special knowledge. */
+
+ if (ldemul_unrecognized_file (entry))
+ return;
+
+ /* Try to interpret the file as a linker script. */
+
ldfile_open_command_file (entry->filename);
hold = stat_ptr;
@@ -825,7 +901,7 @@ load_symbols (entry, place)
break;
case bfd_archive:
- if (whole_archive)
+ if (entry->whole_archive)
{
bfd *member = bfd_openr_next_archived_file (entry->the_bfd,
(bfd *) NULL);
@@ -835,7 +911,7 @@ load_symbols (entry, place)
einfo ("%F%B: object %B in archive is not object\n",
entry->the_bfd, member);
if (! ((*link_info.callbacks->add_archive_element)
- (&link_info, member, "-whole-archive")))
+ (&link_info, member, "--whole-archive")))
abort ();
if (! bfd_link_add_symbols (member, &link_info))
einfo ("%F%B: could not read symbols: %E\n", member);
@@ -855,13 +931,18 @@ load_symbols (entry, place)
entry->loaded = true;
}
+/* Handle a wild statement. SECTION or FILE or both may be NULL,
+ indicating that it is a wildcard. Separate lang_input_section
+ statements are created for each part of the expansion; they are
+ added after the wild statement S. OUTPUT is the output section. */
+
static void
wild (s, section, file, target, output)
- lang_wild_statement_type * s;
- CONST char *section;
- CONST char *file;
- CONST char *target;
- lang_output_section_statement_type * output;
+ lang_wild_statement_type *s;
+ const char *section;
+ const char *file;
+ const char *target;
+ lang_output_section_statement_type *output;
{
lang_input_statement_type *f;
@@ -878,25 +959,51 @@ wild (s, section, file, target, output)
else
{
/* Perform the iteration over a single file */
- wild_section (s, section, lookup_name (file), output);
+ f = lookup_name (file);
+ if (f->the_bfd == NULL
+ || ! bfd_check_format (f->the_bfd, bfd_archive))
+ wild_section (s, section, f, output);
+ else
+ {
+ bfd *member;
+
+ /* This is an archive file. We must map each member of the
+ archive separately. */
+ member = bfd_openr_next_archived_file (f->the_bfd, (bfd *) NULL);
+ while (member != NULL)
+ {
+ /* When lookup_name is called, it will call the
+ add_symbols entry point for the archive. For each
+ element of the archive which is included, BFD will
+ call ldlang_add_file, which will set the usrdata
+ field of the member to the lang_input_statement. */
+ if (member->usrdata != NULL)
+ {
+ wild_section (s, section,
+ (lang_input_statement_type *) member->usrdata,
+ output);
+ }
+
+ member = bfd_openr_next_archived_file (f->the_bfd, member);
+ }
+ }
}
+
if (section != (char *) NULL
&& strcmp (section, "COMMON") == 0
- && default_common_section == (lang_output_section_statement_type *) NULL)
+ && default_common_section == NULL)
{
- /* Remember the section that common is going to incase we later
- get something which doesn't know where to put it */
+ /* Remember the section that common is going to in case we later
+ get something which doesn't know where to put it. */
default_common_section = output;
}
}
-/*
- read in all the files
- */
+/* Open the output file. */
static bfd *
open_output (name)
- CONST char *name;
+ const char *name;
{
bfd *output;
@@ -918,7 +1025,7 @@ open_output (name)
einfo ("%P%F: cannot open output file %s: %E\n", name);
}
- delete_output_file_on_failure = 1;
+ delete_output_file_on_failure = true;
/* output->flags |= D_PAGED;*/
@@ -958,7 +1065,7 @@ ldlang_open_output (statement)
output_bfd->flags |= WP_TEXT;
else
output_bfd->flags &= ~WP_TEXT;
- if (config.traditional_format)
+ if (link_info.traditional_format)
output_bfd->flags |= BFD_TRADITIONAL_FORMAT;
else
output_bfd->flags &= ~BFD_TRADITIONAL_FORMAT;
@@ -1202,70 +1309,45 @@ print_output_section_statement (output_section_statement)
lang_output_section_statement_type * output_section_statement;
{
asection *section = output_section_statement->bfd_section;
+ int len;
- print_nl ();
- print_section (output_section_statement->name);
+ if (output_section_statement != abs_output_section)
+ {
+ minfo ("\n%s", output_section_statement->name);
+ if (section != NULL)
+ {
+ print_dot = section->vma;
- if (section)
- {
- print_dot = section->vma;
- print_space ();
- print_section ("");
- print_space ();
- print_address (section->vma);
- print_space ();
- print_size (section->_raw_size);
- print_space ();
- print_size(section->_cooked_size);
- print_space ();
- print_alignment (section->alignment_power);
- print_space ();
-#if 0
- fprintf (config.map_file, "%s flags", output_section_statement->region->name);
- print_flags (stdout, &output_section_statement->flags);
-#endif
- if (section->flags & SEC_LOAD)
- fprintf (config.map_file, "load ");
- if (section->flags & SEC_ALLOC)
- fprintf (config.map_file, "alloc ");
- if (section->flags & SEC_RELOC)
- fprintf (config.map_file, "reloc ");
- if (section->flags & SEC_HAS_CONTENTS)
- fprintf (config.map_file, "contents ");
+ len = strlen (output_section_statement->name);
+ if (len >= SECTION_NAME_MAP_LENGTH - 1)
+ {
+ print_nl ();
+ len = 0;
+ }
+ while (len < SECTION_NAME_MAP_LENGTH)
+ {
+ print_space ();
+ ++len;
+ }
- }
- else
- {
- fprintf (config.map_file, " (no attached output section)");
- }
- print_nl ();
- if (output_section_statement->load_base)
- {
- bfd_vma b = exp_get_abs_int(output_section_statement->load_base,
- 0, "output base", lang_final_phase_enum);
- fprintf (config.map_file, "Output address ");
- fprintf_vma (config.map_file, b);
- fprintf (config.map_file, "\n");
- }
- if (output_section_statement->section_alignment >= 0
- || output_section_statement->subsection_alignment >= 0)
- {
- fprintf (config.map_file, "\t\t\t\t\tforced alignment ");
- if (output_section_statement->section_alignment >= 0)
- {
- fprintf (config.map_file, "section 2**%d ",output_section_statement->section_alignment );
- }
- if ( output_section_statement->subsection_alignment >= 0)
- {
- fprintf (config.map_file, "subsection 2**%d ",output_section_statement->subsection_alignment );
+ minfo ("0x%V %W", section->vma, section->_raw_size);
+
+ if (output_section_statement->load_base != NULL)
+ {
+ bfd_vma addr;
+
+ addr = exp_get_abs_int (output_section_statement->load_base, 0,
+ "load base", lang_final_phase_enum);
+ minfo (" load address 0x%V", addr);
+ }
+ }
+
+ print_nl ();
}
-
- print_nl ();
- }
- print_statement (output_section_statement->children.head,
- output_section_statement);
+ print_statement_list (output_section_statement->children.head,
+ output_section_statement);
}
static void
@@ -1273,32 +1355,29 @@ print_assignment (assignment, output_section)
lang_assignment_statement_type * assignment;
lang_output_section_statement_type * output_section;
{
+ int i;
etree_value_type result;
- print_section ("");
- print_space ();
- print_section ("");
- print_space ();
- print_address (print_dot);
- print_space ();
- result = exp_fold_tree (assignment->exp->assign.src,
- output_section,
- lang_final_phase_enum,
- print_dot,
- &print_dot);
+ for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++)
+ print_space ();
+ result = exp_fold_tree (assignment->exp->assign.src, output_section,
+ lang_final_phase_enum, print_dot, &print_dot);
if (result.valid)
- {
- print_address (result.value);
- }
+ minfo ("0x%V", result.value + result.section->bfd_section->vma);
else
{
- fprintf (config.map_file, "*undefined*");
+ minfo ("*undef* ");
+#ifdef BFD64
+ minfo (" ");
+#endif
}
- print_space ();
+
+ minfo (" ");
+
exp_print_tree (assignment->exp);
- fprintf (config.map_file, "\n");
+ print_nl ();
}
static void
@@ -1311,34 +1390,37 @@ print_input_statement (statm)
}
}
-/* Print all the defined symbols for the abfd provided by in the supplied
- section.
-*/
+/* Print all symbols defined in a particular section. This is called
+ via bfd_link_hash_traverse. */
static boolean
print_one_symbol (hash_entry, ptr)
-struct bfd_link_hash_entry *hash_entry;
-PTR ptr;
-{
- asection * sec = (asection *)ptr;
-
- if (hash_entry->type == bfd_link_hash_defined
- || hash_entry->type == bfd_link_hash_defweak)
- {
- if (sec == hash_entry->u.def.section) {
- print_section ("");
- fprintf (config.map_file, " ");
- print_section ("");
- fprintf (config.map_file, " ");
- print_address (hash_entry->u.def.value + outside_section_address (sec));
- fprintf (config.map_file, " %s", hash_entry->root.string);
- print_nl ();
- }
+ struct bfd_link_hash_entry *hash_entry;
+ PTR ptr;
+{
+ asection *sec = (asection *) ptr;
+
+ if ((hash_entry->type == bfd_link_hash_defined
+ || hash_entry->type == bfd_link_hash_defweak)
+ && sec == hash_entry->u.def.section)
+ {
+ int i;
+
+ for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++)
+ print_space ();
+ minfo ("0x%V ",
+ (hash_entry->u.def.value
+ + hash_entry->u.def.section->output_offset
+ + hash_entry->u.def.section->output_section->vma));
+
+ minfo (" %T\n", hash_entry->root.string);
}
return true;
}
+/* Print information about an input section to the map file. */
+
static void
print_input_section (in)
lang_input_section_type * in;
@@ -1348,57 +1430,50 @@ print_input_section (in)
if (size != 0)
{
- print_section ("");
- fprintf (config.map_file, " ");
- print_section (i->name);
- fprintf (config.map_file, " ");
- if (i->output_section)
+ print_space ();
+
+ minfo ("%s", i->name);
+
+ if (i->output_section != NULL)
{
- print_address (i->output_section->vma + i->output_offset);
- fprintf (config.map_file, " ");
- print_size (i->_raw_size);
- fprintf (config.map_file, " ");
- print_size(i->_cooked_size);
- fprintf (config.map_file, " ");
- print_alignment (i->alignment_power);
- fprintf (config.map_file, " ");
- if (in->ifile)
- {
+ int len;
- bfd *abfd = in->ifile->the_bfd;
+ len = 1 + strlen (i->name);
+ if (len >= SECTION_NAME_MAP_LENGTH - 1)
+ {
+ print_nl ();
+ len = 0;
+ }
+ while (len < SECTION_NAME_MAP_LENGTH)
+ {
+ print_space ();
+ ++len;
+ }
- if (in->ifile->just_syms_flag == true)
- {
- fprintf (config.map_file, "symbols only ");
- }
+ minfo ("0x%V %W %B\n",
+ i->output_section->vma + i->output_offset, size,
+ i->owner);
- fprintf (config.map_file, " %s ", abfd->xvec->name);
- if (abfd->my_archive != (bfd *) NULL)
- {
- fprintf (config.map_file, "[%s]%s", abfd->my_archive->filename,
- abfd->filename);
- }
- else
+ if (i->_cooked_size != 0 && i->_cooked_size != i->_raw_size)
+ {
+ len = SECTION_NAME_MAP_LENGTH + 3;
+#ifdef BFD64
+ len += 16;
+#else
+ len += 8;
+#endif
+ while (len > 0)
{
- fprintf (config.map_file, "%s", abfd->filename);
+ print_space ();
+ --len;
}
- fprintf (config.map_file, "(overhead %d bytes)", (int) bfd_alloc_size (abfd));
- print_nl ();
- /* Print all the symbols */
- bfd_link_hash_traverse (link_info.hash, print_one_symbol, (PTR) i);
- }
- else
- {
- print_nl ();
+ minfo ("%W (size before relaxing)\n", i->_raw_size);
}
+ bfd_link_hash_traverse (link_info.hash, print_one_symbol, (PTR) i);
- print_dot = outside_section_address (i) + size;
- }
- else
- {
- fprintf (config.map_file, "No output section allocated\n");
+ print_dot = i->output_section->vma + i->output_offset + size;
}
}
}
@@ -1407,48 +1482,70 @@ static void
print_fill_statement (fill)
lang_fill_statement_type * fill;
{
- fprintf (config.map_file, "FILL mask ");
- print_fill (fill->fill);
+ fprintf (config.map_file, " FILL mask 0x%x\n", fill->fill);
}
static void
print_data_statement (data)
lang_data_statement_type * data;
{
-/* bfd_vma value; */
- print_section ("");
- print_space ();
- print_section ("");
- print_space ();
-/* ASSERT(print_dot == data->output_vma);*/
+ int i;
+ bfd_vma addr;
+ bfd_size_type size;
+ const char *name;
+
+ for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++)
+ print_space ();
+
+ addr = data->output_vma;
+ if (data->output_section != NULL)
+ addr += data->output_section->vma;
- print_address (data->output_vma + data->output_section->vma);
- print_space ();
- print_address (data->value);
- print_space ();
switch (data->type)
{
+ default:
+ abort ();
case BYTE:
- fprintf (config.map_file, "BYTE ");
- print_dot += BYTE_SIZE;
+ size = BYTE_SIZE;
+ name = "BYTE";
break;
case SHORT:
- fprintf (config.map_file, "SHORT ");
- print_dot += SHORT_SIZE;
+ size = SHORT_SIZE;
+ name = "SHORT";
break;
case LONG:
- fprintf (config.map_file, "LONG ");
- print_dot += LONG_SIZE;
+ size = LONG_SIZE;
+ name = "LONG";
break;
case QUAD:
- fprintf (config.map_file, "QUAD ");
- print_dot += QUAD_SIZE;
+ size = QUAD_SIZE;
+ name = "QUAD";
break;
}
- exp_print_tree (data->exp);
+ minfo ("0x%V %W %s 0x%v", addr, size, name, data->value);
+
+ if (data->exp->type.node_class != etree_value)
+ {
+ print_space ();
+ exp_print_tree (data->exp);
+ }
+
+ print_nl ();
+
+ print_dot = addr + size;
+}
+
+/* Print an address statement. These are generated by options like
+ -Ttext. */
- fprintf (config.map_file, "\n");
+static void
+print_address_statement (address)
+ lang_address_statement_type *address;
+{
+ minfo ("Address of section %s set to ", address->section_name);
+ exp_print_tree (address->address);
+ print_nl ();
}
/* Print a reloc statement. */
@@ -1457,44 +1554,60 @@ static void
print_reloc_statement (reloc)
lang_reloc_statement_type *reloc;
{
- print_section ("");
- print_space ();
- print_section ("");
- print_space ();
+ int i;
+ bfd_vma addr;
+ bfd_size_type size;
-/* ASSERT(print_dot == data->output_vma);*/
+ for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++)
+ print_space ();
- print_address (reloc->output_vma + reloc->output_section->vma);
- print_space ();
- print_address (reloc->addend_value);
- print_space ();
+ addr = reloc->output_vma;
+ if (reloc->output_section != NULL)
+ addr += reloc->output_section->vma;
+
+ size = bfd_get_reloc_size (reloc->howto);
- fprintf (config.map_file, "RELOC %s ", reloc->howto->name);
+ minfo ("0x%V %W RELOC %s ", addr, size, reloc->howto->name);
- print_dot += bfd_get_reloc_size (reloc->howto);
+ if (reloc->name != NULL)
+ minfo ("%s+", reloc->name);
+ else
+ minfo ("%s+", reloc->section->name);
exp_print_tree (reloc->addend_exp);
- fprintf (config.map_file, "\n");
+ print_nl ();
+
+ print_dot = addr + size;
}
static void
print_padding_statement (s)
- lang_padding_statement_type * s;
+ lang_padding_statement_type *s;
{
- print_section ("");
- print_space ();
- print_section ("*fill*");
- print_space ();
- print_address (s->output_offset + s->output_section->vma);
- print_space ();
- print_size (s->size);
- print_space ();
- print_fill (s->fill);
- print_nl ();
+ int len;
+ bfd_vma addr;
+
+ minfo (" *fill*");
+
+ len = sizeof " *fill*" - 1;
+ while (len < SECTION_NAME_MAP_LENGTH)
+ {
+ print_space ();
+ ++len;
+ }
+
+ addr = s->output_offset;
+ if (s->output_section != NULL)
+ addr += s->output_section->vma;
+ minfo ("0x%V %W", addr, s->size);
- print_dot = s->output_offset + s->output_section->vma + s->size;
+ if (s->fill != 0)
+ minfo (" 0x%x", s->fill);
+ print_nl ();
+
+ print_dot = addr + s->size;
}
static void
@@ -1502,26 +1615,21 @@ print_wild_statement (w, os)
lang_wild_statement_type * w;
lang_output_section_statement_type * os;
{
- fprintf (config.map_file, " from ");
- if (w->filename != (char *) NULL)
- {
- fprintf (config.map_file, "%s", w->filename);
- }
+ print_space ();
+
+ if (w->filename != NULL)
+ minfo ("%s", w->filename);
else
- {
- fprintf (config.map_file, "*");
- }
- if (w->section_name != (char *) NULL)
- {
- fprintf (config.map_file, "(%s)", w->section_name);
- }
+ minfo ("*");
+
+ if (w->section_name != NULL)
+ minfo ("(%s)", w->section_name);
else
- {
- fprintf (config.map_file, "(*)");
- }
+ minfo ("(*)");
+
print_nl ();
- print_statement (w->children.head, os);
+ print_statement_list (w->children.head, os);
}
/* Print a group statement. */
@@ -1532,87 +1640,129 @@ print_group (s, os)
lang_output_section_statement_type *os;
{
fprintf (config.map_file, "START GROUP\n");
- print_statement (s->children.head, os);
+ print_statement_list (s->children.head, os);
fprintf (config.map_file, "END GROUP\n");
}
+/* Print the list of statements in S.
+ This can be called for any statement type. */
+
+static void
+print_statement_list (s, os)
+ lang_statement_union_type *s;
+ lang_output_section_statement_type *os;
+{
+ while (s != NULL)
+ {
+ print_statement (s, os);
+ s = s->next;
+ }
+}
+
+/* Print the first statement in statement list S.
+ This can be called for any statement type. */
+
static void
print_statement (s, os)
- lang_statement_union_type * s;
- lang_output_section_statement_type * os;
+ lang_statement_union_type *s;
+ lang_output_section_statement_type *os;
{
- while (s)
+ switch (s->header.type)
{
- switch (s->header.type)
+ default:
+ fprintf (config.map_file, "Fail with %d\n", s->header.type);
+ FAIL ();
+ break;
+ case lang_constructors_statement_enum:
+ if (constructor_list.head != NULL)
{
- case lang_constructors_statement_enum:
- fprintf (config.map_file, "constructors:\n");
- print_statement (constructor_list.head, os);
- break;
- case lang_wild_statement_enum:
- print_wild_statement (&s->wild_statement, os);
- break;
- default:
- fprintf (config.map_file, "Fail with %d\n", s->header.type);
- FAIL ();
- break;
- case lang_address_statement_enum:
- fprintf (config.map_file, "address\n");
- break;
- case lang_object_symbols_statement_enum:
- fprintf (config.map_file, "object symbols\n");
- break;
- case lang_fill_statement_enum:
- print_fill_statement (&s->fill_statement);
- break;
- case lang_data_statement_enum:
- print_data_statement (&s->data_statement);
- break;
- case lang_reloc_statement_enum:
- print_reloc_statement (&s->reloc_statement);
- break;
- case lang_input_section_enum:
- print_input_section (&s->input_section);
- break;
- case lang_padding_statement_enum:
- print_padding_statement (&s->padding_statement);
- break;
- case lang_output_section_statement_enum:
- print_output_section_statement (&s->output_section_statement);
- break;
- case lang_assignment_statement_enum:
- print_assignment (&s->assignment_statement,
- os);
- break;
- case lang_target_statement_enum:
- fprintf (config.map_file, "TARGET(%s)\n", s->target_statement.target);
- break;
- case lang_output_statement_enum:
- fprintf (config.map_file, "OUTPUT(%s %s)\n",
- s->output_statement.name,
- output_target ? output_target : "");
- break;
- case lang_input_statement_enum:
- print_input_statement (&s->input_statement);
- break;
- case lang_group_statement_enum:
- print_group (&s->group_statement, os);
- break;
- case lang_afile_asection_pair_statement_enum:
- FAIL ();
- break;
+ minfo (" CONSTRUCTORS\n");
+ print_statement_list (constructor_list.head, os);
}
- s = s->next;
+ break;
+ case lang_wild_statement_enum:
+ print_wild_statement (&s->wild_statement, os);
+ break;
+ case lang_address_statement_enum:
+ print_address_statement (&s->address_statement);
+ break;
+ case lang_object_symbols_statement_enum:
+ minfo (" CREATE_OBJECT_SYMBOLS\n");
+ break;
+ case lang_fill_statement_enum:
+ print_fill_statement (&s->fill_statement);
+ break;
+ case lang_data_statement_enum:
+ print_data_statement (&s->data_statement);
+ break;
+ case lang_reloc_statement_enum:
+ print_reloc_statement (&s->reloc_statement);
+ break;
+ case lang_input_section_enum:
+ print_input_section (&s->input_section);
+ break;
+ case lang_padding_statement_enum:
+ print_padding_statement (&s->padding_statement);
+ break;
+ case lang_output_section_statement_enum:
+ print_output_section_statement (&s->output_section_statement);
+ break;
+ case lang_assignment_statement_enum:
+ print_assignment (&s->assignment_statement, os);
+ break;
+ case lang_target_statement_enum:
+ fprintf (config.map_file, "TARGET(%s)\n", s->target_statement.target);
+ break;
+ case lang_output_statement_enum:
+ minfo ("OUTPUT(%s", s->output_statement.name);
+ if (output_target != NULL)
+ minfo (" %s", output_target);
+ minfo (")\n");
+ break;
+ case lang_input_statement_enum:
+ print_input_statement (&s->input_statement);
+ break;
+ case lang_group_statement_enum:
+ print_group (&s->group_statement, os);
+ break;
+ case lang_afile_asection_pair_statement_enum:
+ FAIL ();
+ break;
}
}
-
static void
print_statements ()
{
- print_statement (statement_list.head,
- abs_output_section);
+ print_statement_list (statement_list.head, abs_output_section);
+}
+
+/* Print the first N statements in statement list S to STDERR.
+ If N == 0, nothing is printed.
+ If N < 0, the entire list is printed.
+ Intended to be called from GDB. */
+void
+dprint_statement (s, n)
+ lang_statement_union_type * s;
+ int n;
+{
+ FILE *map_save = config.map_file;
+
+ config.map_file = stderr;
+
+ if (n < 0)
+ print_statement_list (s, abs_output_section);
+ else
+ {
+ while (s && --n >= 0)
+ {
+ print_statement (s, abs_output_section);
+ s = s->next;
+ }
+ }
+
+ config.map_file = map_save;
}
static bfd_vma
@@ -1825,9 +1975,9 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
{
os->region->current = dot;
/* Make sure this isn't silly. */
- if ((os->region->current < os->region->origin)
- || (os->region->current
- > os->region->origin + os->region->length))
+ if (os->region->current < os->region->origin
+ || (os->region->current - os->region->origin
+ > os->region->length))
{
if (os->addr_tree != (etree_type *) NULL)
{
@@ -1931,7 +2081,10 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
i = (*prev)->input_section.section;
if (! relax)
- i->_cooked_size = i->_raw_size;
+ {
+ if (i->_cooked_size == 0)
+ i->_cooked_size = i->_raw_size;
+ }
else
{
boolean again;
@@ -2007,6 +2160,8 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
s->padding_statement.output_offset =
dot - output_section_statement->bfd_section->vma;
dot += s->padding_statement.size;
+ output_section_statement->bfd_section->_raw_size +=
+ s->padding_statement.size;
break;
case lang_group_statement_enum:
@@ -2189,6 +2344,9 @@ lang_set_startof ()
{
asection *s;
+ if (link_info.relocateable)
+ return;
+
for (s = output_bfd->sections; s != NULL; s = s->next)
{
const char *secname;
@@ -2376,9 +2534,51 @@ lang_one_common (h, info)
section->flags |= SEC_ALLOC;
if (config.map_file != NULL)
- fprintf (config.map_file, "Allocating common %s: %lx at %lx %s\n",
- h->root.string, (unsigned long) size,
- (unsigned long) h->u.def.value, section->owner->filename);
+ {
+ static boolean header_printed;
+ int len;
+ char *name;
+ char buf[50];
+
+ if (! header_printed)
+ {
+ minfo ("\nAllocating common symbols\n");
+ minfo ("Common symbol size file\n\n");
+ header_printed = true;
+ }
+
+ name = demangle (h->root.string);
+ minfo ("%s", name);
+ len = strlen (name);
+ free (name);
+
+ if (len >= 19)
+ {
+ print_nl ();
+ len = 0;
+ }
+ while (len < 20)
+ {
+ print_space ();
+ ++len;
+ }
+
+ minfo ("0x");
+ if (size <= 0xffffffff)
+ sprintf (buf, "%lx", (unsigned long) size);
+ else
+ sprintf_vma (buf, size);
+ minfo ("%s", buf);
+ len = strlen (buf);
+
+ while (len < 16)
+ {
+ print_space ();
+ ++len;
+ }
+
+ minfo ("%B\n", section->owner);
+ }
return true;
}
@@ -2575,6 +2775,18 @@ ldlang_add_file (entry)
*pp = entry->the_bfd;
entry->the_bfd->usrdata = (PTR) entry;
bfd_set_gp_size (entry->the_bfd, g_switch_value);
+
+ /* Look through the sections and check for any which should not be
+ included in the link. We need to do this now, so that we can
+ notice when the backend linker tries to report multiple
+ definition errors for symbols which are in sections we aren't
+ going to link. FIXME: It might be better to entirely ignore
+ symbols which are defined in sections which are going to be
+ discarded. This would require modifying the backend linker for
+ each backend which might set the SEC_LINK_ONCE flag. If we do
+ this, we should probably handle SEC_EXCLUDE in the same way. */
+
+ bfd_map_over_sections (entry->the_bfd, section_already_linked, (PTR) NULL);
}
void
@@ -2725,6 +2937,10 @@ lang_process ()
ldemul_before_allocation ();
+ /* We must record the program headers before we try to fix the
+ section positions, since they will affect SIZEOF_HEADERS. */
+ lang_record_phdrs ();
+
/* Now run around and relax if we can */
if (command_line.relax)
{
@@ -3115,3 +3331,151 @@ lang_leave_group ()
{
stat_ptr = &statement_list;
}
+
+/* Add a new program header. This is called for each entry in a PHDRS
+ command in a linker script. */
+
+void
+lang_new_phdr (name, type, filehdr, phdrs, at, flags)
+ const char *name;
+ etree_type *type;
+ boolean filehdr;
+ boolean phdrs;
+ etree_type *at;
+ etree_type *flags;
+{
+ struct lang_phdr *n, **pp;
+
+ n = (struct lang_phdr *) stat_alloc (sizeof (struct lang_phdr));
+ n->next = NULL;
+ n->name = name;
+ n->type = exp_get_value_int (type, 0, "program header type",
+ lang_final_phase_enum);
+ n->filehdr = filehdr;
+ n->phdrs = phdrs;
+ n->at = at;
+ n->flags = flags;
+
+ for (pp = &lang_phdr_list; *pp != NULL; pp = &(*pp)->next)
+ ;
+ *pp = n;
+}
+
+/* Record that a section should be placed in a phdr. */
+
+void
+lang_section_in_phdr (name)
+ const char *name;
+{
+ struct lang_output_section_phdr_list *n;
+
+ n = ((struct lang_output_section_phdr_list *)
+ stat_alloc (sizeof (struct lang_output_section_phdr_list)));
+ n->name = name;
+ n->used = false;
+ n->next = current_section->phdrs;
+ current_section->phdrs = n;
+}
+
+/* Record the program header information in the output BFD. FIXME: We
+ should not be calling an ELF specific function here. */
+
+static void
+lang_record_phdrs ()
+{
+ unsigned int alc;
+ asection **secs;
+ struct lang_output_section_phdr_list *last;
+ struct lang_phdr *l;
+ lang_statement_union_type *u;
+
+ alc = 10;
+ secs = xmalloc (alc * sizeof (asection *));
+ last = NULL;
+ for (l = lang_phdr_list; l != NULL; l = l->next)
+ {
+ unsigned int c;
+ flagword flags;
+ bfd_vma at;
+
+ c = 0;
+ for (u = lang_output_section_statement.head;
+ u != NULL;
+ u = u->output_section_statement.next)
+ {
+ lang_output_section_statement_type *os;
+ struct lang_output_section_phdr_list *pl;
+
+ os = &u->output_section_statement;
+
+ pl = os->phdrs;
+ if (pl != NULL)
+ last = pl;
+ else
+ {
+ if (! os->loadable
+ || os->bfd_section == NULL
+ || (os->bfd_section->flags & SEC_ALLOC) == 0)
+ continue;
+ pl = last;
+ }
+
+ if (os->bfd_section == NULL)
+ continue;
+
+ for (; pl != NULL; pl = pl->next)
+ {
+ if (strcmp (pl->name, l->name) == 0)
+ {
+ if (c >= alc)
+ {
+ alc *= 2;
+ secs = xrealloc (secs, alc * sizeof (asection *));
+ }
+ secs[c] = os->bfd_section;
+ ++c;
+ pl->used = true;
+ }
+ }
+ }
+
+ if (l->flags == NULL)
+ flags = 0;
+ else
+ flags = exp_get_vma (l->flags, 0, "phdr flags",
+ lang_final_phase_enum);
+
+ if (l->at == NULL)
+ at = 0;
+ else
+ at = exp_get_vma (l->at, 0, "phdr load address",
+ lang_final_phase_enum);
+
+ if (! bfd_record_phdr (output_bfd, l->type,
+ l->flags == NULL ? false : true,
+ flags,
+ l->at == NULL ? false : true,
+ at, l->filehdr, l->phdrs, c, secs))
+ einfo ("%F%P: bfd_record_phdr failed: %E\n");
+ }
+
+ free (secs);
+
+ /* Make sure all the phdr assignments succeeded. */
+ for (u = lang_output_section_statement.head;
+ u != NULL;
+ u = u->output_section_statement.next)
+ {
+ struct lang_output_section_phdr_list *pl;
+
+ if (u->output_section_statement.bfd_section == NULL)
+ continue;
+
+ for (pl = u->output_section_statement.phdrs;
+ pl != NULL;
+ pl = pl->next)
+ if (! pl->used && strcmp (pl->name, "NONE") != 0)
+ einfo ("%X%P: section `%s' assigned to non-existent phdr `%s'\n",
+ u->output_section_statement.name, pl->name);
+ }
+}
diff --git a/gnu/usr.bin/binutils/ld/ldlang.h b/gnu/usr.bin/binutils/ld/ldlang.h
index 9feeef3984e..1d1e3d28153 100644
--- a/gnu/usr.bin/binutils/ld/ldlang.h
+++ b/gnu/usr.bin/binutils/ld/ldlang.h
@@ -1,5 +1,5 @@
/* ldlang.h - linker command language support
- Copyright 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+ Copyright 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -97,6 +97,16 @@ typedef struct lang_output_statement_struct
} lang_output_statement_type;
+/* This structure holds a list of program headers describing segments
+ in which this section should be placed. */
+
+struct lang_output_section_phdr_list
+{
+ struct lang_output_section_phdr_list *next;
+ const char *name;
+ boolean used;
+};
+
typedef struct lang_output_section_statement_struct
{
lang_statement_header_type header;
@@ -118,7 +128,9 @@ typedef struct lang_output_section_statement_struct
int subsection_alignment; /* alignment of components */
int section_alignment; /* alignment of start of section */
- union etree_union *load_base;
+ union etree_union *load_base;
+
+ struct lang_output_section_phdr_list *phdrs;
} lang_output_section_statement_type;
@@ -223,6 +235,9 @@ typedef struct lang_input_statement_struct
/* Whether to search for this entry as a dynamic archive. */
boolean dynamic;
+ /* Whether to include the entire contents of an archive. */
+ boolean whole_archive;
+
boolean loaded;
/* unsigned int globals_in_this_file;*/
@@ -306,6 +321,20 @@ typedef union lang_statement_union
lang_group_statement_type group_statement;
} lang_statement_union_type;
+/* This structure holds information about a program header, from the
+ PHDRS command in the linker script. */
+
+struct lang_phdr
+{
+ struct lang_phdr *next;
+ const char *name;
+ unsigned long type;
+ boolean filehdr;
+ boolean phdrs;
+ etree_type *at;
+ etree_type *flags;
+};
+
extern lang_output_section_statement_type *abs_output_section;
extern boolean lang_has_input_file;
extern etree_type *base;
@@ -398,5 +427,9 @@ extern void wild_doit
PARAMS ((lang_statement_list_type *ptr, asection *section,
lang_output_section_statement_type *output,
lang_input_statement_type *file));
+extern void lang_new_phdr
+ PARAMS ((const char *, etree_type *, boolean, boolean, etree_type *,
+ etree_type *));
+extern void lang_section_in_phdr PARAMS ((const char *));
#endif
diff --git a/gnu/usr.bin/binutils/ld/ldlex.l b/gnu/usr.bin/binutils/ld/ldlex.l
index c1107c04853..5eb1dcedbb9 100644
--- a/gnu/usr.bin/binutils/ld/ldlex.l
+++ b/gnu/usr.bin/binutils/ld/ldlex.l
@@ -265,6 +265,7 @@ NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
<BOTH,SCRIPT>"l" { RTOKEN( LENGTH);}
<BOTH,SCRIPT>"len" { RTOKEN( LENGTH);}
<BOTH,SCRIPT>"INCLUDE" { RTOKEN(INCLUDE);}
+<BOTH,SCRIPT>"PHDRS" { RTOKEN (PHDRS); }
<EXPRESSION,BOTH,SCRIPT>"AT" { RTOKEN(AT);}
<EXPRESSION,BOTH,SCRIPT>"PROVIDE" { RTOKEN(PROVIDE); }
<MRI>"#".*\n?\r? { ++ lineno; }
diff --git a/gnu/usr.bin/binutils/ld/ldmain.c b/gnu/usr.bin/binutils/ld/ldmain.c
index 0ae8d4f009a..673879fe42a 100644
--- a/gnu/usr.bin/binutils/ld/ldmain.c
+++ b/gnu/usr.bin/binutils/ld/ldmain.c
@@ -115,8 +115,8 @@ static boolean reloc_dangerous PARAMS ((struct bfd_link_info *, const char *,
static boolean unattached_reloc PARAMS ((struct bfd_link_info *,
const char *, bfd *, asection *,
bfd_vma));
-static boolean notice_ysym PARAMS ((struct bfd_link_info *, const char *,
- bfd *, asection *, bfd_vma));
+static boolean notice PARAMS ((struct bfd_link_info *, const char *,
+ bfd *, asection *, bfd_vma));
static struct bfd_link_callbacks link_callbacks =
{
@@ -130,7 +130,7 @@ static struct bfd_link_callbacks link_callbacks =
reloc_overflow,
reloc_dangerous,
unattached_reloc,
- notice_ysym
+ notice
};
struct bfd_link_info link_info;
@@ -162,12 +162,13 @@ main (argc, argv)
bfd_init ();
+ bfd_set_error_program_name (program_name);
+
xatexit (remove_output);
/* Initialize the data about options. */
trace_files = trace_file_tries = version_printed = false;
whole_archive = false;
- config.traditional_format = false;
config.build_constructors = true;
config.dynamic_link = false;
command_line.force_common_definition = false;
@@ -179,6 +180,7 @@ main (argc, argv)
link_info.shared = false;
link_info.symbolic = false;
link_info.static_link = false;
+ link_info.traditional_format = false;
link_info.strip = strip_none;
link_info.discard = discard_none;
link_info.lprefix_len = 1;
@@ -188,8 +190,9 @@ main (argc, argv)
link_info.create_object_symbols_section = NULL;
link_info.hash = NULL;
link_info.keep_hash = NULL;
+ link_info.notice_all = false;
link_info.notice_hash = NULL;
-
+ link_info.wrap_hash = NULL;
ldfile_add_arch ("");
@@ -316,6 +319,11 @@ main (argc, argv)
ldwrite ();
+ if (config.map_file != NULL)
+ lang_map ();
+ if (link_info.notice_all)
+ output_cref (config.map_file != NULL ? config.map_file : stdout);
+
/* Even if we're producing relocateable output, some non-fatal errors should
be reported in the exit status. (What non-fatal errors, if any, do we
want to ignore for relocateable output?) */
@@ -328,16 +336,57 @@ main (argc, argv)
output_filename);
}
- if (output_bfd->iostream)
- fclose ((FILE *) (output_bfd->iostream));
+ /* The file will be removed by remove_output. */
- unlink (output_filename);
xexit (1);
}
else
{
if (! bfd_close (output_bfd))
einfo ("%F%B: final close failed: %E\n", output_bfd);
+
+ /* If the --force-exe-suffix is enabled, and we're making an
+ executable file and it doesn't end in .exe, copy it to one which does. */
+
+ if (! link_info.relocateable && command_line.force_exe_suffix)
+ {
+ int len = strlen (output_filename);
+ if (len < 4
+ || (strcasecmp (output_filename + len - 4, ".exe") != 0
+ && strcasecmp (output_filename + len - 4, ".dll") != 0))
+ {
+ FILE *src;
+ FILE *dst;
+ const int bsize = 4096;
+ char *buf = xmalloc (bsize);
+ int l;
+ char *dst_name = xmalloc (len + 5);
+ strcpy (dst_name, output_filename);
+ strcat (dst_name, ".exe");
+ src = fopen (output_filename, FOPEN_RB);
+ dst = fopen (dst_name, FOPEN_WB);
+
+ if (!src)
+ einfo ("%X%P: unable to open for source of copy `%s'\n", output_filename);
+ if (!dst)
+ einfo ("%X%P: unable to open for destination of copy `%s'\n", dst_name);
+ while ((l = fread (buf, 1, bsize, src)) > 0)
+ {
+ int done = fwrite (buf, 1, l, dst);
+ if (done != l)
+ {
+ einfo ("%P: Error writing file `%s'\n", dst_name);
+ }
+ }
+ fclose (src);
+ if (!fclose (dst))
+ {
+ einfo ("%P: Error closing file `%s'\n", dst_name);
+ }
+ free (dst_name);
+ free (buf);
+ }
+ }
}
END_PROGRESS (program_name);
@@ -515,6 +564,25 @@ add_ysym (name)
einfo ("%P%F: bfd_hash_lookup failed: %E\n");
}
+/* Record a symbol to be wrapped, from the --wrap option. */
+
+void
+add_wrap (name)
+ const char *name;
+{
+ if (link_info.wrap_hash == NULL)
+ {
+ link_info.wrap_hash = ((struct bfd_hash_table *)
+ xmalloc (sizeof (struct bfd_hash_table)));
+ if (! bfd_hash_table_init_n (link_info.wrap_hash,
+ bfd_hash_newfunc,
+ 61))
+ einfo ("%P%F: bfd_hash_table_init failed: %E\n");
+ }
+ if (bfd_hash_lookup (link_info.wrap_hash, name, true, true) == NULL)
+ einfo ("%P%F: bfd_hash_lookup failed: %E\n");
+}
+
/* Handle the -retain-symbols-file option. */
void
@@ -616,7 +684,82 @@ add_archive_element (info, abfd, name)
ldlang_add_file (input);
if (config.map_file != (FILE *) NULL)
- minfo ("%s needed due to %T\n", abfd->filename, name);
+ {
+ static boolean header_printed;
+ struct bfd_link_hash_entry *h;
+ bfd *from;
+ int len;
+
+ h = bfd_link_hash_lookup (link_info.hash, name, false, false, true);
+
+ if (h == NULL)
+ from = NULL;
+ else
+ {
+ switch (h->type)
+ {
+ default:
+ from = NULL;
+ break;
+
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ from = h->u.def.section->owner;
+ break;
+
+ case bfd_link_hash_undefined:
+ case bfd_link_hash_undefweak:
+ from = h->u.undef.abfd;
+ break;
+
+ case bfd_link_hash_common:
+ from = h->u.c.p->section->owner;
+ break;
+ }
+ }
+
+ if (! header_printed)
+ {
+ char buf[100];
+
+ sprintf (buf, "%-29s %s\n\n", "Archive member included",
+ "because of file (symbol)");
+ minfo ("%s", buf);
+ header_printed = true;
+ }
+
+ if (bfd_my_archive (abfd) == NULL)
+ {
+ minfo ("%s", bfd_get_filename (abfd));
+ len = strlen (bfd_get_filename (abfd));
+ }
+ else
+ {
+ minfo ("%s(%s)", bfd_get_filename (bfd_my_archive (abfd)),
+ bfd_get_filename (abfd));
+ len = (strlen (bfd_get_filename (bfd_my_archive (abfd)))
+ + strlen (bfd_get_filename (abfd))
+ + 2);
+ }
+
+ if (len >= 29)
+ {
+ print_nl ();
+ len = 0;
+ }
+ while (len < 30)
+ {
+ print_space ();
+ ++len;
+ }
+
+ if (from != NULL)
+ minfo ("%B ", from);
+ if (h != NULL)
+ minfo ("(%T)\n", h->root.string);
+ else
+ minfo ("(%s)\n", name);
+ }
if (trace_files || trace_file_tries)
info_msg ("%I\n", input);
@@ -639,6 +782,17 @@ multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval)
asection *nsec;
bfd_vma nval;
{
+ /* If either section has the output_section field set to
+ bfd_abs_section_ptr, it means that the section is being
+ discarded, and this is not really a multiple definition at all.
+ FIXME: It would be cleaner to somehow ignore symbols defined in
+ sections which are being discarded. */
+ if ((osec->output_section != NULL
+ && bfd_is_abs_section (osec->output_section))
+ || (nsec->output_section != NULL
+ && bfd_is_abs_section (nsec->output_section)))
+ return true;
+
einfo ("%X%C: multiple definition of `%T'\n",
nbfd, nsec, nval, name);
if (obfd != (bfd *) NULL)
@@ -775,7 +929,9 @@ constructor_callback (info, constructor, name, abfd, section, value)
/* Ensure that BFD_RELOC_CTOR exists now, so that we can give a
useful error message. */
- if (bfd_reloc_type_lookup (output_bfd, BFD_RELOC_CTOR) == NULL)
+ if (bfd_reloc_type_lookup (output_bfd, BFD_RELOC_CTOR) == NULL
+ && (link_info.relocateable
+ || bfd_reloc_type_lookup (abfd, BFD_RELOC_CTOR) == NULL))
einfo ("%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n");
s = set_name;
@@ -786,10 +942,6 @@ constructor_callback (info, constructor, name, abfd, section, value)
else
strcpy (s, "__DTOR_LIST__");
- if (config.map_file != (FILE *) NULL)
- fprintf (config.map_file,
- "Adding %s to constructor/destructor set %s\n", name, set_name);
-
h = bfd_link_hash_lookup (info->hash, set_name, true, true, true);
if (h == (struct bfd_link_hash_entry *) NULL)
einfo ("%P%F: bfd_link_hash_lookup failed: %E\n");
@@ -829,6 +981,12 @@ warning_callback (info, warning, symbol, abfd, section, address)
asection *section;
bfd_vma address;
{
+ /* This is a hack to support warn_multiple_gp. FIXME: This should
+ have a cleaner interface, but what? */
+ if (! config.warn_multiple_gp
+ && strcmp (warning, "using multiple gp values") == 0)
+ return true;
+
if (section != NULL)
einfo ("%C: %s\n", abfd, section, address, warning);
else if (abfd == NULL)
@@ -1065,20 +1223,27 @@ unattached_reloc (info, name, abfd, section, address)
return true;
}
-/* This is called when a symbol in notice_hash is found. Symbols are
- put in notice_hash using the -y option. */
+/* This is called if link_info.notice_all is set, or when a symbol in
+ link_info.notice_hash is found. Symbols are put in notice_hash
+ using the -y option. */
-/*ARGSUSED*/
static boolean
-notice_ysym (info, name, abfd, section, value)
+notice (info, name, abfd, section, value)
struct bfd_link_info *info;
const char *name;
bfd *abfd;
asection *section;
bfd_vma value;
{
- einfo ("%B: %s %s\n", abfd,
- bfd_is_und_section (section) ? "reference to" : "definition of",
- name);
+ if (! info->notice_all
+ || (info->notice_hash != NULL
+ && bfd_hash_lookup (info->notice_hash, name, false, false) != NULL))
+ einfo ("%B: %s %s\n", abfd,
+ bfd_is_und_section (section) ? "reference to" : "definition of",
+ name);
+
+ if (info->notice_all)
+ add_cref (name, abfd, section, value);
+
return true;
}
diff --git a/gnu/usr.bin/binutils/ld/ldmain.h b/gnu/usr.bin/binutils/ld/ldmain.h
index 93ce3a25869..5c5f38b8493 100644
--- a/gnu/usr.bin/binutils/ld/ldmain.h
+++ b/gnu/usr.bin/binutils/ld/ldmain.h
@@ -32,6 +32,7 @@ extern const char *output_filename;
extern struct bfd_link_info link_info;
extern void add_ysym PARAMS ((const char *));
+extern void add_wrap PARAMS ((const char *));
extern void add_keepsyms_file PARAMS ((const char *filename));
#endif
diff --git a/gnu/usr.bin/binutils/ld/ldmisc.c b/gnu/usr.bin/binutils/ld/ldmisc.c
index f4ded2765db..9116f35a94e 100644
--- a/gnu/usr.bin/binutils/ld/ldmisc.c
+++ b/gnu/usr.bin/binutils/ld/ldmisc.c
@@ -1,6 +1,5 @@
/* ldmisc.c
- Copyright (C) 1991, 92, 93, 94 Free Software Foundation, Inc.
-
+ Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
This file is part of GLD, the Gnu Linker.
@@ -21,17 +20,15 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307
#include "bfd.h"
#include "sysdep.h"
-#include <demangle.h>
-/* this collection of routines wants to use the Unix style varargs
- use special abbreviated portion of varargs.h */
-#ifdef WINDOWS_NT
-/* Since macro __STDC__ is defined, the compiler will raise and error if
- VARARGS.H from mstools\h is included. Since we only need a portion of
- this header file, it has been incorporated into local header file
- xvarargs.h */
-#include "xvarargs.h"
+#include "libiberty.h"
+#include "demangle.h"
+
+#ifdef ANSI_PROTOTYPES
+#include <stdarg.h>
+#define USE_STDARG 1
#else
#include <varargs.h>
+#define USE_STDARG 0
#endif
#include "ld.h"
@@ -43,12 +40,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307
#include "ldmain.h"
#include "ldfile.h"
-
-/* VARARGS*/
-static void finfo ();
-static const char *demangle PARAMS ((const char *string,
- int remove_underscore));
-
/*
%% literal %
%F error is fatal
@@ -61,303 +52,341 @@ static const char *demangle PARAMS ((const char *string,
%X no object output, fail return
%V hex bfd_vma
%v hex bfd_vma, no leading zeros
+ %W hex bfd_vma with 0x with no leading zeros taking up 8 spaces
%C clever filename:linenumber with function
%D like %C, but no function name
+ %G like %D, but only function name
%R info about a relent
%s arbitrary string, like printf
%d integer, like printf
%u integer, like printf
*/
-static const char *
-demangle (string, remove_underscore)
+char *
+demangle (string)
const char *string;
- int remove_underscore;
{
- const char *res;
+ char *res;
- if (remove_underscore
- && output_bfd != NULL
+ if (output_bfd != NULL
&& bfd_get_symbol_leading_char (output_bfd) == string[0])
++string;
/* This is a hack for better error reporting on XCOFF. */
- if (remove_underscore && string[0] == '.')
+ if (string[0] == '.')
++string;
- /* Note that there's a memory leak here, we keep buying memory for
- demangled names, and never free. But if you have so many errors
- that you run out of VM with the error messages, then there's
- something up. */
res = cplus_demangle (string, DMGL_ANSI | DMGL_PARAMS);
- return res ? res : string;
+ return res ? res : xstrdup (string);
}
static void
-vfinfo(fp, fmt, arg)
+vfinfo (fp, fmt, arg)
FILE *fp;
- char *fmt;
+ const char *fmt;
va_list arg;
{
boolean fatal = false;
- while (*fmt)
- {
- while (*fmt != '%' && *fmt != '\0')
+ while (*fmt != '\0')
{
- putc(*fmt, fp);
- fmt++;
- }
-
- if (*fmt == '%')
- {
- fmt ++;
- switch (*fmt++)
- {
- default:
- fprintf(fp,"%%%c", fmt[-1]);
- break;
-
- case '%':
- /* literal % */
- putc('%', fp);
- break;
-
- case 'X':
- /* no object output, fail return */
- config.make_executable = false;
- break;
-
- case 'V':
- /* hex bfd_vma */
- {
- bfd_vma value = va_arg(arg, bfd_vma);
- fprintf_vma(fp, value);
- }
- break;
-
- case 'v':
- /* hex bfd_vma, no leading zeros */
+ while (*fmt != '%' && *fmt != '\0')
{
- char buf[100];
- char *p = buf;
- bfd_vma value = va_arg (arg, bfd_vma);
- sprintf_vma (p, value);
- while (*p == '0')
- p++;
- if (!*p)
- p--;
- fputs (p, fp);
+ putc (*fmt, fp);
+ fmt++;
}
- break;
- case 'T':
- /* Symbol name. */
+ if (*fmt == '%')
{
- const char *name = va_arg (arg, const char *);
+ fmt ++;
+ switch (*fmt++)
+ {
+ default:
+ fprintf (fp,"%%%c", fmt[-1]);
+ break;
+
+ case '%':
+ /* literal % */
+ putc ('%', fp);
+ break;
+
+ case 'X':
+ /* no object output, fail return */
+ config.make_executable = false;
+ break;
+
+ case 'V':
+ /* hex bfd_vma */
+ {
+ bfd_vma value = va_arg (arg, bfd_vma);
+ fprintf_vma (fp, value);
+ }
+ break;
+
+ case 'v':
+ /* hex bfd_vma, no leading zeros */
+ {
+ char buf[100];
+ char *p = buf;
+ bfd_vma value = va_arg (arg, bfd_vma);
+ sprintf_vma (p, value);
+ while (*p == '0')
+ p++;
+ if (!*p)
+ p--;
+ fputs (p, fp);
+ }
+ break;
+
+ case 'W':
+ /* hex bfd_vma with 0x with no leading zeroes taking up
+ 8 spaces. */
+ {
+ char buf[100];
+ bfd_vma value;
+ char *p;
+ int len;
+
+ value = va_arg (arg, bfd_vma);
+ sprintf_vma (buf, value);
+ for (p = buf; *p == '0'; ++p)
+ ;
+ len = strlen (p);
+ while (len < 8)
+ {
+ putc (' ', fp);
+ ++len;
+ }
+ fprintf (fp, "0x%s", p);
+ }
+ break;
+
+ case 'T':
+ /* Symbol name. */
+ {
+ const char *name = va_arg (arg, const char *);
+
+ if (name == (const char *) NULL)
+ fprintf (fp, "no symbol");
+ else
+ {
+ char *demangled;
+
+ demangled = demangle (name);
+ fprintf (fp, "%s", demangled);
+ free (demangled);
+ }
+ }
+ break;
+
+ case 'B':
+ /* filename from a bfd */
+ {
+ bfd *abfd = va_arg (arg, bfd *);
+ if (abfd->my_archive)
+ fprintf (fp, "%s(%s)", abfd->my_archive->filename,
+ abfd->filename);
+ else
+ fprintf (fp, "%s", abfd->filename);
+ }
+ break;
+
+ case 'F':
+ /* error is fatal */
+ fatal = true;
+ break;
+
+ case 'P':
+ /* print program name */
+ fprintf (fp, "%s", program_name);
+ break;
+
+ case 'E':
+ /* current bfd error or errno */
+ fprintf (fp, bfd_errmsg (bfd_get_error ()));
+ break;
+
+ case 'I':
+ /* filename from a lang_input_statement_type */
+ {
+ lang_input_statement_type *i;
+
+ i = va_arg (arg, lang_input_statement_type *);
+ if (bfd_my_archive (i->the_bfd) != NULL)
+ fprintf (fp, "(%s)",
+ bfd_get_filename (bfd_my_archive (i->the_bfd)));
+ fprintf (fp, "%s", i->local_sym_name);
+ if (bfd_my_archive (i->the_bfd) == NULL
+ && strcmp (i->local_sym_name, i->filename) != 0)
+ fprintf (fp, " (%s)", i->filename);
+ }
+ break;
+
+ case 'S':
+ /* print script file and linenumber */
+ if (parsing_defsym)
+ fprintf (fp, "--defsym %s", lex_string);
+ else if (ldfile_input_filename != NULL)
+ fprintf (fp, "%s:%u", ldfile_input_filename, lineno);
+ else
+ fprintf (fp, "built in linker script:%u", lineno);
+ break;
- if (name != (const char *) NULL)
- fprintf (fp, "%s", demangle (name, 1));
- else
- fprintf (fp, "no symbol");
- }
- break;
-
- case 'B':
- /* filename from a bfd */
- {
- bfd *abfd = va_arg(arg, bfd *);
- if (abfd->my_archive) {
- fprintf(fp,"%s(%s)", abfd->my_archive->filename,
- abfd->filename);
- }
- else {
- fprintf(fp,"%s", abfd->filename);
- }
- }
- break;
-
- case 'F':
- /* error is fatal */
- fatal = true;
- break;
-
- case 'P':
- /* print program name */
- fprintf(fp,"%s", program_name);
- break;
-
- case 'E':
- /* current bfd error or errno */
- fprintf(fp, bfd_errmsg(bfd_get_error ()));
- break;
-
- case 'I':
- /* filename from a lang_input_statement_type */
- {
- lang_input_statement_type *i =
- va_arg(arg,lang_input_statement_type *);
-
- if (i->the_bfd->my_archive)
- fprintf(fp, "(%s)", i->the_bfd->my_archive->filename);
- fprintf(fp,"%s", i->local_sym_name);
- }
- break;
-
- case 'S':
- /* print script file and linenumber */
- if (parsing_defsym)
- fprintf (fp, "--defsym %s", lex_string);
- else if (ldfile_input_filename != NULL)
- fprintf (fp, "%s:%u", ldfile_input_filename, lineno);
- else
- fprintf (fp, "built in linker script:%u", lineno);
- break;
-
- case 'R':
- /* Print all that's interesting about a relent */
- {
- arelent *relent = va_arg(arg, arelent *);
+ case 'R':
+ /* Print all that's interesting about a relent */
+ {
+ arelent *relent = va_arg (arg, arelent *);
- finfo (fp, "%s+0x%v (type %s)",
- (*(relent->sym_ptr_ptr))->name,
- relent->addend,
- relent->howto->name);
- }
- break;
+ finfo (fp, "%s+0x%v (type %s)",
+ (*(relent->sym_ptr_ptr))->name,
+ relent->addend,
+ relent->howto->name);
+ }
+ break;
- case 'C':
- case 'D':
- /* Clever filename:linenumber with function name if possible,
- or section name as a last resort. The arguments are a BFD,
- a section, and an offset. */
- {
- static bfd *last_bfd;
- static char *last_file = NULL;
- static char *last_function = NULL;
- bfd *abfd;
- asection *section;
- bfd_vma offset;
- lang_input_statement_type *entry;
- asymbol **asymbols;
- const char *filename;
- const char *functionname;
- unsigned int linenumber;
- boolean discard_last;
-
- abfd = va_arg (arg, bfd *);
- section = va_arg (arg, asection *);
- offset = va_arg (arg, bfd_vma);
-
- entry = (lang_input_statement_type *) abfd->usrdata;
- if (entry != (lang_input_statement_type *) NULL
- && entry->asymbols != (asymbol **) NULL)
- asymbols = entry->asymbols;
- else
- {
- long symsize;
- long symbol_count;
-
- symsize = bfd_get_symtab_upper_bound (abfd);
- if (symsize < 0)
- einfo ("%B%F: could not read symbols\n", abfd);
- asymbols = (asymbol **) xmalloc (symsize);
- symbol_count = bfd_canonicalize_symtab (abfd, asymbols);
- if (symbol_count < 0)
- einfo ("%B%F: could not read symbols\n", abfd);
- if (entry != (lang_input_statement_type *) NULL)
- {
- entry->asymbols = asymbols;
- entry->symbol_count = symbol_count;
- }
- }
+ case 'C':
+ case 'D':
+ case 'G':
+ /* Clever filename:linenumber with function name if possible,
+ or section name as a last resort. The arguments are a BFD,
+ a section, and an offset. */
+ {
+ static bfd *last_bfd;
+ static char *last_file = NULL;
+ static char *last_function = NULL;
+ bfd *abfd;
+ asection *section;
+ bfd_vma offset;
+ lang_input_statement_type *entry;
+ asymbol **asymbols;
+ const char *filename;
+ const char *functionname;
+ unsigned int linenumber;
+ boolean discard_last;
+
+ abfd = va_arg (arg, bfd *);
+ section = va_arg (arg, asection *);
+ offset = va_arg (arg, bfd_vma);
+
+ entry = (lang_input_statement_type *) abfd->usrdata;
+ if (entry != (lang_input_statement_type *) NULL
+ && entry->asymbols != (asymbol **) NULL)
+ asymbols = entry->asymbols;
+ else
+ {
+ long symsize;
+ long symbol_count;
+
+ symsize = bfd_get_symtab_upper_bound (abfd);
+ if (symsize < 0)
+ einfo ("%B%F: could not read symbols\n", abfd);
+ asymbols = (asymbol **) xmalloc (symsize);
+ symbol_count = bfd_canonicalize_symtab (abfd, asymbols);
+ if (symbol_count < 0)
+ einfo ("%B%F: could not read symbols\n", abfd);
+ if (entry != (lang_input_statement_type *) NULL)
+ {
+ entry->asymbols = asymbols;
+ entry->symbol_count = symbol_count;
+ }
+ }
+
+ discard_last = true;
+ if (bfd_find_nearest_line (abfd, section, asymbols, offset,
+ &filename, &functionname,
+ &linenumber))
+ {
+ if (functionname != NULL && fmt[-1] == 'G')
+ {
+ finfo (fp, "%B:", abfd);
+ if (filename != NULL
+ && strcmp (filename, bfd_get_filename (abfd)) != 0)
+ fprintf (fp, "%s:", filename);
+ finfo (fp, "%T", functionname);
+ }
+ else if (functionname != NULL && fmt[-1] == 'C')
+ {
+ if (filename == (char *) NULL)
+ filename = abfd->filename;
+
+ if (last_bfd == NULL
+ || last_file == NULL
+ || last_function == NULL
+ || last_bfd != abfd
+ || strcmp (last_file, filename) != 0
+ || strcmp (last_function, functionname) != 0)
+ {
+ /* We use abfd->filename in this initial line,
+ in case filename is a .h file or something
+ similarly unhelpful. */
+ finfo (fp, "%B: In function `%T':\n",
+ abfd, functionname);
+
+ last_bfd = abfd;
+ if (last_file != NULL)
+ free (last_file);
+ last_file = buystring (filename);
+ if (last_function != NULL)
+ free (last_function);
+ last_function = buystring (functionname);
+ }
+ discard_last = false;
+ if (linenumber != 0)
+ fprintf (fp, "%s:%u", filename, linenumber);
+ else
+ finfo (fp, "%s(%s+0x%v)", filename, section->name,
+ offset);
+ }
+ else if (filename == NULL
+ || strcmp (filename, abfd->filename) == 0)
+ {
+ finfo (fp, "%B(%s+0x%v)", abfd, section->name, offset);
+ if (linenumber != 0)
+ finfo (fp, ":%u", linenumber);
+ }
+ else if (linenumber != 0)
+ finfo (fp, "%B:%s:%u", abfd, filename, linenumber);
+ else
+ finfo (fp, "%B(%s+0x%v):%s", abfd, section->name, offset,
+ filename);
+ }
+ else
+ finfo (fp, "%B(%s+0x%v)", abfd, section->name, offset);
- discard_last = true;
- if (bfd_find_nearest_line (abfd, section, asymbols, offset,
- &filename, &functionname, &linenumber))
- {
- if (functionname != NULL && fmt[-1] == 'C')
- {
- if (filename == (char *) NULL)
- filename = abfd->filename;
-
- if (last_bfd == NULL
- || last_file == NULL
- || last_function == NULL
- || last_bfd != abfd
- || strcmp (last_file, filename) != 0
- || strcmp (last_function, functionname) != 0)
- {
- /* We use abfd->filename in this initial line,
- in case filename is a .h file or something
- similarly unhelpful. */
- finfo (fp, "%B: In function `%s':\n",
- abfd, demangle (functionname, 1));
-
- last_bfd = abfd;
- if (last_file != NULL)
+ if (discard_last)
+ {
+ last_bfd = NULL;
+ if (last_file != NULL)
+ {
free (last_file);
- last_file = buystring (filename);
- if (last_function != NULL)
+ last_file = NULL;
+ }
+ if (last_function != NULL)
+ {
free (last_function);
- last_function = buystring (functionname);
- }
- discard_last = false;
- if (linenumber != 0)
- fprintf (fp, "%s:%u", filename, linenumber);
- else
- finfo (fp, "%s(%s+0x%v)", filename, section->name, offset);
- }
- else if (filename == NULL
- || strcmp (filename, abfd->filename) == 0)
- {
- finfo (fp, "%B(%s+0x%v)", abfd, section->name, offset);
- if (linenumber != 0)
- finfo (fp, "%u", linenumber);
- }
- else if (linenumber != 0)
- finfo (fp, "%B:%s:%u", abfd, filename, linenumber);
- else
- finfo (fp, "%B(%s+0x%v):%s", abfd, section->name, offset,
- filename);
- }
- else
- finfo (fp, "%B(%s+0x%v)", abfd, section->name, offset);
-
- if (discard_last)
- {
- last_bfd = NULL;
- if (last_file != NULL)
- {
- free (last_file);
- last_file = NULL;
- }
- if (last_function != NULL)
- {
- free (last_function);
- last_function = NULL;
- }
+ last_function = NULL;
+ }
+ }
+ }
+ break;
+
+ case 's':
+ /* arbitrary string, like printf */
+ fprintf (fp, "%s", va_arg (arg, char *));
+ break;
+
+ case 'd':
+ /* integer, like printf */
+ fprintf (fp, "%d", va_arg (arg, int));
+ break;
+
+ case 'u':
+ /* unsigned integer, like printf */
+ fprintf (fp, "%u", va_arg (arg, unsigned int));
+ break;
}
}
- break;
-
- case 's':
- /* arbitrary string, like printf */
- fprintf(fp,"%s", va_arg(arg, char *));
- break;
-
- case 'd':
- /* integer, like printf */
- fprintf(fp,"%d", va_arg(arg, int));
- break;
-
- case 'u':
- /* unsigned integer, like printf */
- fprintf(fp,"%u", va_arg(arg, unsigned int));
- break;
- }
}
- }
if (fatal == true)
xexit(1);
@@ -365,39 +394,63 @@ vfinfo(fp, fmt, arg)
/* Format info message and print on stdout. */
-/* (You would think this should be called just "info", but then you would
- hosed by LynxOS, which defines that name in its libc.) */
+/* (You would think this should be called just "info", but then you
+ would hosed by LynxOS, which defines that name in its libc.) */
-void info_msg(va_alist)
+void
+#if USE_STDARG
+info_msg (const char *fmt, ...)
+#else
+info_msg (va_alist)
va_dcl
+#endif
{
- char *fmt;
va_list arg;
- va_start(arg);
- fmt = va_arg(arg, char *);
- vfinfo(stdout, fmt, arg);
- va_end(arg);
+
+#if ! USE_STDARG
+ const char *fmt;
+
+ va_start (arg);
+ fmt = va_arg (arg, const char *);
+#else
+ va_start (arg, fmt);
+#endif
+
+ vfinfo (stdout, fmt, arg);
+ va_end (arg);
}
/* ('e' for error.) Format info message and print on stderr. */
-void einfo(va_alist)
+void
+#if USE_STDARG
+einfo (const char *fmt, ...)
+#else
+einfo (va_alist)
va_dcl
+#endif
{
- char *fmt;
va_list arg;
- va_start(arg);
- fmt = va_arg(arg, char *);
- vfinfo(stderr, fmt, arg);
- va_end(arg);
+
+#if ! USE_STDARG
+ const char *fmt;
+
+ va_start (arg);
+ fmt = va_arg (arg, const char *);
+#else
+ va_start (arg, fmt);
+#endif
+
+ vfinfo (stderr, fmt, arg);
+ va_end (arg);
}
void
-info_assert(file, line)
- char *file;
+info_assert (file, line)
+ const char *file;
unsigned int line;
{
- einfo("%F%P: internal error %s %d\n", file,line);
+ einfo ("%F%P: internal error %s %d\n", file, line);
}
char *
@@ -410,54 +463,65 @@ buystring (x)
return r;
}
-
/* ('m' for map) Format info message and print on map. */
-void minfo(va_alist)
+void
+#if USE_STDARG
+minfo (const char *fmt, ...)
+#else
+minfo (va_alist)
va_dcl
+#endif
{
- char *fmt;
va_list arg;
- va_start(arg);
- fmt = va_arg(arg, char *);
- vfinfo(config.map_file, fmt, arg);
- va_end(arg);
-}
+#if ! USE_STDARG
+ const char *fmt;
+ va_start (arg);
+ fmt = va_arg (arg, const char *);
+#else
+ va_start (arg, fmt);
+#endif
-static void
+ vfinfo (config.map_file, fmt, arg);
+ va_end (arg);
+}
+
+void
+#if USE_STDARG
+finfo (FILE *file, const char *fmt, ...)
+#else
finfo (va_alist)
va_dcl
+#endif
{
- char *fmt;
- FILE *file;
va_list arg;
+
+#if ! USE_STDARG
+ FILE *file;
+ const char *fmt;
+
va_start (arg);
file = va_arg (arg, FILE *);
- fmt = va_arg (arg, char *);
+ fmt = va_arg (arg, const char *);
+#else
+ va_start (arg, fmt);
+#endif
+
vfinfo (file, fmt, arg);
va_end (arg);
}
-
-
-
-/*----------------------------------------------------------------------
- Functions to print the link map
- */
+
+/* Functions to print the link map. */
void
print_space ()
{
- fprintf(config.map_file, " ");
+ fprintf (config.map_file, " ");
}
+
void
print_nl ()
{
- fprintf(config.map_file, "\n");
-}
-void
-print_address (value)
- bfd_vma value;
-{
- fprintf_vma(config.map_file, value);
+ fprintf (config.map_file, "\n");
}
diff --git a/gnu/usr.bin/binutils/ld/ldmisc.h b/gnu/usr.bin/binutils/ld/ldmisc.h
index 25d472644fd..f0073a7d7e3 100644
--- a/gnu/usr.bin/binutils/ld/ldmisc.h
+++ b/gnu/usr.bin/binutils/ld/ldmisc.h
@@ -1,5 +1,5 @@
/* ldmisc.h -
- Copyright (C) 1991, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -20,13 +20,23 @@
#ifndef LDMISC_H
#define LDMISC_H
+#ifdef ANSI_PROTOTYPES
+extern void einfo PARAMS ((const char *, ...));
+extern void minfo PARAMS ((const char *, ...));
+extern void info_msg PARAMS ((const char *, ...));
+extern void finfo PARAMS ((FILE *, const char *, ...));
+#else
/* VARARGS*/
extern void einfo ();
/* VARARGS*/
extern void minfo ();
/* VARARGS*/
extern void info_msg ();
-extern void info_assert PARAMS ((char *, unsigned int));
+/*VARARGS*/
+extern void finfo ();
+#endif
+
+extern void info_assert PARAMS ((const char *, unsigned int));
extern void yyerror PARAMS ((const char *));
extern PTR xmalloc PARAMS ((size_t));
extern PTR xrealloc PARAMS ((PTR, size_t));
@@ -41,6 +51,6 @@ do { info_assert(__FILE__,__LINE__); } while (0)
extern void print_space PARAMS ((void));
extern void print_nl PARAMS ((void));
-extern void print_address PARAMS ((bfd_vma value));
+extern char *demangle PARAMS ((const char *));
#endif
diff --git a/gnu/usr.bin/binutils/ld/ldver.c b/gnu/usr.bin/binutils/ld/ldver.c
index c8ec676fdf0..920e08bbe96 100644
--- a/gnu/usr.bin/binutils/ld/ldver.c
+++ b/gnu/usr.bin/binutils/ld/ldver.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
+/* ldver.c -- Print linker version.
+ Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -29,60 +30,17 @@ void
ldversion (noisy)
int noisy;
{
- fprintf(stdout,"ld version 2.6 (with BFD %s)\n", BFD_VERSION);
+ fprintf (stdout,"ld version cygnus-2.6 (with BFD %s)\n", BFD_VERSION);
if (noisy)
- {
- ld_emulation_xfer_type **ptr = ld_emulations;
-
- printf(" Supported emulations:\n");
- while (*ptr)
{
- printf(" %s \n", (*ptr)->emulation_name);
- ptr++;
+ ld_emulation_xfer_type **ptr = ld_emulations;
+
+ printf (" Supported emulations:\n");
+ while (*ptr)
+ {
+ printf (" %s\n", (*ptr)->emulation_name);
+ ptr++;
+ }
}
- }
-}
-
-void
-help ()
-{
- extern bfd_target *bfd_target_vector[];
- int t;
-
- printf ("\
-Usage: %s [-o output] objfile...\n\
-Options:\n\
- [-A architecture] [-b input-format]\n\
- [-Bstatic] [-Bdynamic] [-Bsymbolic] [-base-file file]\n\
- [-c MRI-commandfile] [-d | -dc | -dp]\n\
- [-defsym symbol=expression] [-dynamic-linker filename]\n",
- program_name);
- puts ("\
- [-EB | -EL] [-e entry] [-embeddded-relocs] [-export-dynamic]\n\
- [-F] [-Fformat] [-format input-format] [-g] [-G size]\n\
- [-heap reserve[,commit]] [-help] [-i]\n\
- [-l archive] [-L searchdir] [-M] [-Map mapfile]\n\
- [-m emulation] [-N | -n] [-no-keep-memory] [-noinhibit-exec]\n\
- [-oformat output-format] [-R filename] [-relax]");
- puts ("\
- [-retain-symbols-file file] [-rpath path] [-shared] [-soname name]\n\
- [-r | -Ur] [-S] [-s] [-sort-common] [-stack reserve[,commit]]\n\
- [-split-by-reloc count] [-split-by-file]\n\
- [-stats] [-subsystem type] [-T commandfile]\n\
- [-Ttext textorg] [-Tdata dataorg] [-Tbss bssorg] [-t]");
- puts ("\
- [-traditional-format] [-u symbol] [-V] [-v] [-verbose]\n\
- [-version] [-warn-common] [-warn-constructors] [-warn-once]\n\
- [-whole-archive] [-X] [-x] [-y symbol]\n\
- [-( archives -)] [--start-group archives --end-group]");
-
- printf ("%s: supported targets:", program_name);
- for (t = 0; bfd_target_vector[t] != NULL; t++)
- printf (" %s", bfd_target_vector[t]->name);
- printf ("\n");
-
- printf ("%s: supported emulations: ", program_name);
- ldemul_list_emulations (stdout);
- printf ("\n");
}
diff --git a/gnu/usr.bin/binutils/ld/ldver.h b/gnu/usr.bin/binutils/ld/ldver.h
index e95496e20f2..514da3204c0 100644
--- a/gnu/usr.bin/binutils/ld/ldver.h
+++ b/gnu/usr.bin/binutils/ld/ldver.h
@@ -1,7 +1,7 @@
-/* ldver.h -
- Copyright 1991, 1992 Free Software Foundation, Inc.
+/* ldver.h -- Header file for ldver.c.
+ Copyright (C) 1991, 92, 93, 95, 1996 Free Software Foundation, Inc.
- This file is part of GLD, the Gnu Linker.
+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
@@ -18,4 +18,3 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
void ldversion PARAMS ((int));
-void help PARAMS ((void));
diff --git a/gnu/usr.bin/binutils/ld/ldwrite.c b/gnu/usr.bin/binutils/ld/ldwrite.c
index 0bb86691644..7c8e81cbc2e 100644
--- a/gnu/usr.bin/binutils/ld/ldwrite.c
+++ b/gnu/usr.bin/binutils/ld/ldwrite.c
@@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
+#include "libiberty.h"
#include "ld.h"
#include "ldexp.h"
@@ -31,11 +32,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ldmain.h"
static void build_link_order PARAMS ((lang_statement_union_type *));
-static void print_symbol_table PARAMS ((void));
-static void print_file_stuff PARAMS ((lang_input_statement_type *));
-static boolean print_symbol PARAMS ((struct bfd_link_hash_entry *, PTR));
-
-extern char *strdup();
/* Build link_order structures for the BFD linker. */
@@ -64,6 +60,58 @@ build_link_order (statement)
value = statement->data_statement.value;
+ /* If the endianness of the output BFD is not known, then we
+ base the endianness of the data on the first input file.
+ By convention, the bfd_put routines for an unknown
+ endianness are big endian, so we must swap here if the
+ input file is little endian. */
+ if (! bfd_big_endian (output_bfd)
+ && ! bfd_little_endian (output_bfd))
+ {
+ boolean swap;
+
+ swap = false;
+ if (command_line.endian == ENDIAN_LITTLE)
+ swap = true;
+ else if (command_line.endian == ENDIAN_UNSET)
+ {
+ LANG_FOR_EACH_INPUT_STATEMENT (s)
+ {
+ if (s->the_bfd != NULL)
+ {
+ if (bfd_little_endian (s->the_bfd))
+ swap = true;
+ break;
+ }
+ }
+ }
+
+ if (swap)
+ {
+ bfd_byte buffer[8];
+
+ switch (statement->data_statement.type)
+ {
+ case QUAD:
+ bfd_putl64 (value, buffer);
+ value = bfd_getb64 (buffer);
+ break;
+ case LONG:
+ bfd_putl32 (value, buffer);
+ value = bfd_getb32 (buffer);
+ break;
+ case SHORT:
+ bfd_putl16 (value, buffer);
+ value = bfd_getb16 (buffer);
+ break;
+ case BYTE:
+ break;
+ default:
+ abort ();
+ }
+ }
+ }
+
ASSERT (output_section->owner == output_bfd);
switch (statement->data_statement.type)
{
@@ -232,7 +280,7 @@ clone_section (abfd, s, count)
}
while (bfd_get_section_by_name (abfd, sname));
- n = bfd_make_section_anyway (abfd, strdup (sname));
+ n = bfd_make_section_anyway (abfd, xstrdup (sname));
/* Create a symbol of the same name */
@@ -438,151 +486,4 @@ ldwrite ()
else
xexit(1);
}
-
- if (config.map_file)
- {
- print_symbol_table ();
- lang_map ();
- }
-}
-
-/* Print the symbol table. */
-
-static void
-print_symbol_table ()
-{
- fprintf (config.map_file, "**FILES**\n\n");
- lang_for_each_file (print_file_stuff);
-
- fprintf (config.map_file, "**GLOBAL SYMBOLS**\n\n");
- fprintf (config.map_file, "offset section offset symbol\n");
- bfd_link_hash_traverse (link_info.hash, print_symbol, (PTR) NULL);
-}
-
-/* Print information about a file. */
-
-static void
-print_file_stuff (f)
- lang_input_statement_type *f;
-{
- fprintf (config.map_file, " %s\n", f->filename);
- if (f->just_syms_flag)
- {
- fprintf (config.map_file, " symbols only\n");
- }
- else
- {
- asection *s;
- if (true)
- {
- for (s = f->the_bfd->sections;
- s != (asection *) NULL;
- s = s->next)
- {
-#ifdef WINDOWS_NT
- /* Don't include any information that goes into the '.junk'
- section. This includes the code view .debug$ data and
- stuff from .drectve sections */
- if (strcmp (s->name, ".drectve") == 0 ||
- strncmp (s->name, ".debug$", 7) == 0)
- continue;
-#endif
- print_address (s->output_offset);
- if (s->reloc_done)
- {
- fprintf (config.map_file, " %08x 2**%2ud %s\n",
- (unsigned) bfd_get_section_size_after_reloc (s),
- s->alignment_power, s->name);
- }
-
- else
- {
- fprintf (config.map_file, " %08x 2**%2ud %s\n",
- (unsigned) bfd_get_section_size_before_reloc (s),
- s->alignment_power, s->name);
- }
- }
- }
- else
- {
- for (s = f->the_bfd->sections;
- s != (asection *) NULL;
- s = s->next)
- {
- fprintf (config.map_file, "%s ", s->name);
- print_address (s->output_offset);
- fprintf (config.map_file, "(%x)",
- (unsigned) bfd_get_section_size_after_reloc (s));
- }
- fprintf (config.map_file, "hex \n");
- }
- }
- print_nl ();
-}
-
-/* Print a symbol. */
-
-/*ARGSUSED*/
-static boolean
-print_symbol (p, ignore)
- struct bfd_link_hash_entry *p;
- PTR ignore;
-{
- while (p->type == bfd_link_hash_indirect
- || p->type == bfd_link_hash_warning)
- p = p->u.i.link;
-
- switch (p->type)
- {
- case bfd_link_hash_new:
- abort ();
-
- case bfd_link_hash_undefined:
- fprintf (config.map_file, "undefined ");
- fprintf (config.map_file, "%s ", p->root.string);
- print_nl ();
- break;
-
- case bfd_link_hash_undefweak:
- fprintf (config.map_file, "weak ");
- fprintf (config.map_file, "%s ", p->root.string);
- print_nl ();
- break;
-
- case bfd_link_hash_defined:
- case bfd_link_hash_defweak:
- {
- asection *defsec = p->u.def.section;
-
- print_address (p->u.def.value);
- if (defsec)
- {
- fprintf (config.map_file, " %-10s",
- bfd_section_name (output_bfd, defsec));
- print_space ();
- print_address (p->u.def.value + defsec->vma);
- }
- else
- {
- fprintf (config.map_file, " .......");
- }
- fprintf (config.map_file, " %s", p->root.string);
- if (p->type == bfd_link_hash_defweak)
- fprintf (config.map_file, " [weak]");
- }
- print_nl ();
- break;
-
- case bfd_link_hash_common:
- fprintf (config.map_file, "common ");
- print_address (p->u.c.size);
- fprintf (config.map_file, " %s ", p->root.string);
- print_nl ();
- break;
-
- default:
- abort ();
- }
-
- return true;
}
diff --git a/gnu/usr.bin/binutils/ld/lexsup.c b/gnu/usr.bin/binutils/ld/lexsup.c
index 06f8e19c597..33dd94debd5 100644
--- a/gnu/usr.bin/binutils/ld/lexsup.c
+++ b/gnu/usr.bin/binutils/ld/lexsup.c
@@ -1,5 +1,5 @@
/* Parse options for the GNU linker.
- Copyright (C) 1991, 92, 93, 94, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -46,32 +46,18 @@ unsigned long strtoul ();
static void set_default_dirlist PARAMS ((char *dirlist_ptr));
static void set_section_start PARAMS ((char *sect, char *valstr));
+static void help PARAMS ((void));
/* Non-zero if we are processing a --defsym from the command line. */
int parsing_defsym = 0;
-void
-parse_args (argc, argv)
- int argc;
- char **argv;
-{
- int i;
- int ingroup = 0;
- char *default_dirlist = NULL;
-
- /* Starting the short option string with '-' is for programs that
- expect options and other ARGV-elements in any order and that care about
- the ordering of the two. We describe each non-option ARGV-element
- as if it were the argument of an option with character code 1. */
-
- const char *shortopts =
- "-a:A:b:c:de:F::G:gh:iL:l:Mm:NnO:o:R:rSsT:tu:VvXxY:y:z:()";
-
- /* 150 isn't special; it's just an arbitrary non-ASCII char value. */
+/* Codes used for the long options with no short synonyms. 150 isn't
+ special; it's just an arbitrary non-ASCII char value. */
#define OPTION_ASSERT 150
#define OPTION_CALL_SHARED (OPTION_ASSERT + 1)
-#define OPTION_DEFSYM (OPTION_CALL_SHARED + 1)
+#define OPTION_CREF (OPTION_CALL_SHARED + 1)
+#define OPTION_DEFSYM (OPTION_CREF + 1)
#define OPTION_DYNAMIC_LINKER (OPTION_DEFSYM + 1)
#define OPTION_EB (OPTION_DYNAMIC_LINKER + 1)
#define OPTION_EL (OPTION_EB + 1)
@@ -83,7 +69,8 @@ parse_args (argc, argv)
#define OPTION_NO_KEEP_MEMORY (OPTION_MAP + 1)
#define OPTION_NOINHIBIT_EXEC (OPTION_NO_KEEP_MEMORY + 1)
#define OPTION_NON_SHARED (OPTION_NOINHIBIT_EXEC + 1)
-#define OPTION_OFORMAT (OPTION_NON_SHARED + 1)
+#define OPTION_NO_WHOLE_ARCHIVE (OPTION_NON_SHARED + 1)
+#define OPTION_OFORMAT (OPTION_NO_WHOLE_ARCHIVE + 1)
#define OPTION_RELAX (OPTION_OFORMAT + 1)
#define OPTION_RETAIN_SYMBOLS_FILE (OPTION_RELAX + 1)
#define OPTION_RPATH (OPTION_RETAIN_SYMBOLS_FILE + 1)
@@ -102,69 +89,267 @@ parse_args (argc, argv)
#define OPTION_VERSION (OPTION_VERBOSE + 1)
#define OPTION_WARN_COMMON (OPTION_VERSION + 1)
#define OPTION_WARN_CONSTRUCTORS (OPTION_WARN_COMMON + 1)
-#define OPTION_WARN_ONCE (OPTION_WARN_CONSTRUCTORS + 1)
+#define OPTION_WARN_MULTIPLE_GP (OPTION_WARN_CONSTRUCTORS + 1)
+#define OPTION_WARN_ONCE (OPTION_WARN_MULTIPLE_GP + 1)
#define OPTION_SPLIT_BY_RELOC (OPTION_WARN_ONCE + 1)
#define OPTION_SPLIT_BY_FILE (OPTION_SPLIT_BY_RELOC + 1)
#define OPTION_WHOLE_ARCHIVE (OPTION_SPLIT_BY_FILE + 1)
+#define OPTION_WRAP (OPTION_WHOLE_ARCHIVE + 1)
+#define OPTION_FORCE_EXE_SUFFIX (OPTION_WRAP + 1)
+
+/* The long options. This structure is used for both the option
+ parsing and the help text. */
+
+struct ld_option
+{
+ /* The long option information. */
+ struct option opt;
+ /* The short option with the same meaning ('\0' if none). */
+ char shortopt;
+ /* The name of the argument (NULL if none). */
+ const char *arg;
+ /* The documentation string. If this is NULL, this is a synonym for
+ the previous option. */
+ const char *doc;
+ enum
+ {
+ /* Use one dash before long option name. */
+ ONE_DASH,
+ /* Use two dashes before long option name. */
+ TWO_DASHES,
+ /* Don't mention this option in --help output. */
+ NO_HELP
+ } control;
+};
+
+static const struct ld_option ld_options[] =
+{
+ { {NULL, required_argument, NULL, '\0'},
+ 'a', "KEYWORD", "Shared library control for HP/UX compatibility",
+ ONE_DASH },
+ { {"architecture", required_argument, NULL, 'A'},
+ 'A', "ARCH", "Set architecture" , TWO_DASHES },
+ { {"format", required_argument, NULL, 'b'},
+ 'b', "TARGET", "Specify target for following input files", TWO_DASHES },
+ { {"mri-script", required_argument, NULL, 'c'},
+ 'c', "FILE", "Read MRI format linker script", TWO_DASHES },
+ { {"dc", no_argument, NULL, 'd'},
+ 'd', NULL, "Force common symbols to be defined", ONE_DASH },
+ { {"dp", no_argument, NULL, 'd'},
+ '\0', NULL, NULL, ONE_DASH },
+ { {"entry", required_argument, NULL, 'e'},
+ 'e', "ADDRESS", "Set start address", TWO_DASHES },
+ { {"export-dynamic", no_argument, NULL, OPTION_EXPORT_DYNAMIC},
+ 'E', NULL, "Export all dynamic symbols", TWO_DASHES },
+ { {NULL, optional_argument, NULL, '\0'},
+ 'F', "[FORMAT]", "Ignored", ONE_DASH },
+ { {NULL, no_argument, NULL, '\0'},
+ 'g', NULL, "Ignored", ONE_DASH },
+ { {"gpsize", required_argument, NULL, 'G'},
+ 'G', "SIZE", "Small data size (if no size, same as --shared)",
+ TWO_DASHES },
+ { {"soname", required_argument, NULL, OPTION_SONAME},
+ 'h', "FILENAME", "Set internal name of shared library", ONE_DASH },
+ { {"library", required_argument, NULL, 'l'},
+ 'l', "LIBNAME", "Search for library LIBNAME", TWO_DASHES },
+ { {"library-path", required_argument, NULL, 'L'},
+ 'L', "DIRECTORY", "Add DIRECTORY to library search path", TWO_DASHES },
+ { {NULL, required_argument, NULL, '\0'},
+ 'm', "EMULATION", "Set emulation", ONE_DASH },
+ { {"print-map", no_argument, NULL, 'M'},
+ 'M', NULL, "Print map file on standard output", TWO_DASHES },
+ { {"nmagic", no_argument, NULL, 'n'},
+ 'n', NULL, "Do not page align data", TWO_DASHES },
+ { {"omagic", no_argument, NULL, 'N'},
+ 'N', NULL, "Do not page align data, do not make text readonly",
+ TWO_DASHES },
+ { {"output", required_argument, NULL, 'o'},
+ 'o', "FILE", "Set output file name", TWO_DASHES },
+ { {NULL, required_argument, NULL, '\0'},
+ 'O', NULL, "Ignored", ONE_DASH },
+ { {"relocateable", no_argument, NULL, 'r'},
+ 'r', NULL, "Generate relocateable output", TWO_DASHES },
+ { {NULL, no_argument, NULL, '\0'},
+ 'i', NULL, NULL, ONE_DASH },
+ { {"just-symbols", required_argument, NULL, 'R'},
+ 'R', "FILE", "Just link symbols (if directory, same as --rpath)",
+ TWO_DASHES },
+ { {"strip-all", no_argument, NULL, 's'},
+ 's', NULL, "Strip all symbols", TWO_DASHES },
+ { {"strip-debug", no_argument, NULL, 'S'},
+ 'S', NULL, "Strip debugging symbols", TWO_DASHES },
+ { {"trace", no_argument, NULL, 't'},
+ 't', NULL, "Trace file opens", TWO_DASHES },
+ { {"script", required_argument, NULL, 'T'},
+ 'T', "FILE", "Read linker script", TWO_DASHES },
+ { {"undefined", required_argument, NULL, 'u'},
+ 'u', "SYMBOL", "Start with undefined reference to SYMBOL", TWO_DASHES },
+ { {"version", no_argument, NULL, OPTION_VERSION},
+ 'v', NULL, "Print version information", TWO_DASHES },
+ { {NULL, no_argument, NULL, '\0'},
+ 'V', NULL, "Print version and emulation information", ONE_DASH },
+ { {"discard-all", no_argument, NULL, 'x'},
+ 'x', NULL, "Discard all local symbols", TWO_DASHES },
+ { {"discard-locals", no_argument, NULL, 'X'},
+ 'X', NULL, "Discard temporary local symbols", TWO_DASHES },
+ { {"trace-symbol", required_argument, NULL, 'y'},
+ 'y', "SYMBOL", "Trace mentions of SYMBOL", TWO_DASHES },
+ { {NULL, required_argument, NULL, '\0'},
+ 'Y', "PATH", "Default search path for Solaris compatibility", ONE_DASH },
+ { {NULL, required_argument, NULL, '\0'},
+ 'z', "KEYWORD", "Ignored for Solaris compatibility", ONE_DASH },
+ { {"start-group", no_argument, NULL, '('},
+ '(', NULL, "Start a group", TWO_DASHES },
+ { {"end-group", no_argument, NULL, ')'},
+ ')', NULL, "End a group", TWO_DASHES },
+ { {"assert", required_argument, NULL, OPTION_ASSERT},
+ '\0', "KEYWORD", "Ignored for SunOS compatibility", ONE_DASH },
+ { {"Bdynamic", no_argument, NULL, OPTION_CALL_SHARED},
+ '\0', NULL, "Link against shared libraries", ONE_DASH },
+ { {"dy", no_argument, NULL, OPTION_CALL_SHARED},
+ '\0', NULL, NULL, ONE_DASH },
+ { {"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
+ '\0', NULL, NULL, ONE_DASH },
+ { {"Bstatic", no_argument, NULL, OPTION_NON_SHARED},
+ '\0', NULL, "Do not link against shared libraries", ONE_DASH },
+ { {"dn", no_argument, NULL, OPTION_NON_SHARED},
+ '\0', NULL, NULL, ONE_DASH },
+ { {"non_shared", no_argument, NULL, OPTION_NON_SHARED},
+ '\0', NULL, NULL, ONE_DASH },
+ { {"static", no_argument, NULL, OPTION_NON_SHARED},
+ '\0', NULL, NULL, ONE_DASH },
+ { {"Bsymbolic", no_argument, NULL, OPTION_SYMBOLIC},
+ '\0', NULL, "Bind global references locally", ONE_DASH },
+ { {"cref", no_argument, NULL, OPTION_CREF},
+ '\0', NULL, "Output cross reference table", TWO_DASHES },
+ { {"defsym", required_argument, NULL, OPTION_DEFSYM},
+ '\0', "SYMBOL=EXPRESSION", "Define a symbol", TWO_DASHES },
+ { {"dynamic-linker", required_argument, NULL, OPTION_DYNAMIC_LINKER},
+ '\0', "PROGRAM", "Set the dynamic linker to use", TWO_DASHES },
+ { {"EB", no_argument, NULL, OPTION_EB},
+ '\0', NULL, "Link big-endian objects", ONE_DASH },
+ { {"EL", no_argument, NULL, OPTION_EL},
+ '\0', NULL, "Link little-endian objects", ONE_DASH },
+ { {"embedded-relocs", no_argument, NULL, OPTION_EMBEDDED_RELOCS},
+ '\0', NULL, "Generate embedded relocs", TWO_DASHES},
+ { {"force-exe-suffix", no_argument, NULL, OPTION_FORCE_EXE_SUFFIX},
+ '\0', NULL, "Force generation of file with .exe suffix", TWO_DASHES},
+ { {"help", no_argument, NULL, OPTION_HELP},
+ '\0', NULL, "Print option help", TWO_DASHES },
+ { {"Map", required_argument, NULL, OPTION_MAP},
+ '\0', "FILE", "Write a map file", ONE_DASH },
+ { {"no-keep-memory", no_argument, NULL, OPTION_NO_KEEP_MEMORY},
+ '\0', NULL, "Use less memory and more disk I/O", TWO_DASHES },
+ { {"no-whole-archive", no_argument, NULL, OPTION_NO_WHOLE_ARCHIVE},
+ '\0', NULL, "Turn off --whole-archive", TWO_DASHES },
+ { {"noinhibit-exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
+ '\0', NULL, "Create an output file even if errors occur", TWO_DASHES },
+ { {"noinhibit_exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
+ '\0', NULL, NULL, NO_HELP },
+ { {"oformat", required_argument, NULL, OPTION_OFORMAT},
+ '\0', "TARGET", "Specify target of output file", TWO_DASHES },
+ { {"qmagic", no_argument, NULL, OPTION_IGNORE},
+ '\0', NULL, "Ignored for Linux compatibility", ONE_DASH },
+ { {"Qy", no_argument, NULL, OPTION_IGNORE},
+ '\0', NULL, "Ignored for SVR4 compatibility", ONE_DASH },
+ { {"relax", no_argument, NULL, OPTION_RELAX},
+ '\0', NULL, "Relax branches on certain targets", TWO_DASHES },
+ { {"retain-symbols-file", required_argument, NULL,
+ OPTION_RETAIN_SYMBOLS_FILE},
+ '\0', "FILE", "Keep only symbols listed in FILE", TWO_DASHES },
+ { {"rpath", required_argument, NULL, OPTION_RPATH},
+ '\0', "PATH", "Set runtime shared library search path", ONE_DASH },
+ { {"rpath-link", required_argument, NULL, OPTION_RPATH_LINK},
+ '\0', "PATH", "Set line time shared library search path", ONE_DASH },
+ { {"shared", no_argument, NULL, OPTION_SHARED},
+ '\0', NULL, "Create a shared library", ONE_DASH },
+ { {"Bshareable", no_argument, NULL, OPTION_SHARED }, /* FreeBSD. */
+ '\0', NULL, NULL, ONE_DASH },
+ { {"sort-common", no_argument, NULL, OPTION_SORT_COMMON},
+ '\0', NULL, "Sort common symbols by size", TWO_DASHES },
+ { {"sort_common", no_argument, NULL, OPTION_SORT_COMMON},
+ '\0', NULL, NULL, NO_HELP },
+ { {"split-by-file", no_argument, NULL, OPTION_SPLIT_BY_FILE},
+ '\0', NULL, "Split output sections for each file", TWO_DASHES },
+ { {"split-by-reloc", required_argument, NULL, OPTION_SPLIT_BY_RELOC},
+ '\0', "COUNT", "Split output sections every COUNT relocs", TWO_DASHES },
+ { {"stats", no_argument, NULL, OPTION_STATS},
+ '\0', NULL, "Print memory usage statistics", TWO_DASHES },
+ { {"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT},
+ '\0', NULL, "Use same format as native linker", TWO_DASHES },
+ { {"Tbss", required_argument, NULL, OPTION_TBSS},
+ '\0', "ADDRESS", "Set address of .bss section", ONE_DASH },
+ { {"Tdata", required_argument, NULL, OPTION_TDATA},
+ '\0', "ADDRESS", "Set address of .data section", ONE_DASH },
+ { {"Ttext", required_argument, NULL, OPTION_TTEXT},
+ '\0', "ADDRESS", "Set address of .text section", ONE_DASH },
+ { {"Ur", no_argument, NULL, OPTION_UR},
+ '\0', NULL, "Build global constructor/destructor tables", ONE_DASH },
+ { {"verbose", no_argument, NULL, OPTION_VERBOSE},
+ '\0', NULL, "Output lots of information during link", TWO_DASHES },
+ { {"dll-verbose", no_argument, NULL, OPTION_VERSION}, /* Linux. */
+ '\0', NULL, NULL, NO_HELP },
+ { {"warn-common", no_argument, NULL, OPTION_WARN_COMMON},
+ '\0', NULL, "Warn about duplicate common symbols", TWO_DASHES },
+ { {"warn-constructors", no_argument, NULL, OPTION_WARN_CONSTRUCTORS},
+ '\0', NULL, "Warn if global constructors/destructors are seen",
+ TWO_DASHES },
+ { {"warn-multiple-gp", no_argument, NULL, OPTION_WARN_MULTIPLE_GP},
+ '\0', NULL, "Warn if the multiple GP values are used", TWO_DASHES },
+ { {"warn-once", no_argument, NULL, OPTION_WARN_ONCE},
+ '\0', NULL, "Warn only once per undefined symbol", TWO_DASHES },
+ { {"whole-archive", no_argument, NULL, OPTION_WHOLE_ARCHIVE},
+ '\0', NULL, "Include all objects from following archives", TWO_DASHES },
+ { {"wrap", required_argument, NULL, OPTION_WRAP},
+ '\0', "SYMBOL", "Use wrapper functions for SYMBOL", TWO_DASHES }
+};
+
+#define OPTION_COUNT (sizeof ld_options / sizeof ld_options[0])
+void
+parse_args (argc, argv)
+ int argc;
+ char **argv;
+{
+ int i, is, il;
+ int ingroup = 0;
+ char *default_dirlist = NULL;
+ char shortopts[OPTION_COUNT * 3 + 2];
+ struct option longopts[OPTION_COUNT + 1];
- static struct option longopts[] = {
- /* Sorted alphabeticaly, except for the PE options grouped at the end. */
- {"assert", required_argument, NULL, OPTION_ASSERT},
- {"Bdynamic", no_argument, NULL, OPTION_CALL_SHARED},
- {"Bstatic", no_argument, NULL, OPTION_NON_SHARED},
- {"Bsymbolic", no_argument, NULL, OPTION_SYMBOLIC},
- {"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
- {"dc", no_argument, NULL, 'd'},
- {"defsym", required_argument, NULL, OPTION_DEFSYM},
- {"dll-verbose", no_argument, NULL, OPTION_VERSION}, /* Linux. */
- {"dn", no_argument, NULL, OPTION_NON_SHARED},
- {"dp", no_argument, NULL, 'd'},
- {"dy", no_argument, NULL, OPTION_CALL_SHARED},
- {"dynamic-linker", required_argument, NULL, OPTION_DYNAMIC_LINKER},
- {"EB", no_argument, NULL, OPTION_EB},
- {"EL", no_argument, NULL, OPTION_EL},
- {"embedded-relocs", no_argument, NULL, OPTION_EMBEDDED_RELOCS},
- {"end-group", no_argument, NULL, ')'},
- {"export-dynamic", no_argument, NULL, OPTION_EXPORT_DYNAMIC},
- {"format", required_argument, NULL, 'b'},
- {"help", no_argument, NULL, OPTION_HELP},
- {"Map", required_argument, NULL, OPTION_MAP},
- {"no-keep-memory", no_argument, NULL, OPTION_NO_KEEP_MEMORY},
- {"noinhibit-exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
- {"noinhibit_exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
- {"non_shared", no_argument, NULL, OPTION_NON_SHARED},
- {"oformat", required_argument, NULL, OPTION_OFORMAT},
- {"Qy", no_argument, NULL, OPTION_IGNORE},
- {"qmagic", no_argument, NULL, OPTION_IGNORE}, /* Linux compatibility. */
- {"relax", no_argument, NULL, OPTION_RELAX},
- {"retain-symbols-file", required_argument, NULL, OPTION_RETAIN_SYMBOLS_FILE},
- {"rpath", required_argument, NULL, OPTION_RPATH},
- {"rpath-link", required_argument, NULL, OPTION_RPATH_LINK},
- {"shared", no_argument, NULL, OPTION_SHARED},
- {"soname", required_argument, NULL, OPTION_SONAME},
- {"sort-common", no_argument, NULL, OPTION_SORT_COMMON},
- {"sort_common", no_argument, NULL, OPTION_SORT_COMMON},
- {"start-group", no_argument, NULL, '('},
- {"stats", no_argument, NULL, OPTION_STATS},
- {"static", no_argument, NULL, OPTION_NON_SHARED},
- {"Tbss", required_argument, NULL, OPTION_TBSS},
- {"Tdata", required_argument, NULL, OPTION_TDATA},
- {"Ttext", required_argument, NULL, OPTION_TTEXT},
- {"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT},
- {"Ur", no_argument, NULL, OPTION_UR},
- {"verbose", no_argument, NULL, OPTION_VERBOSE},
- {"version", no_argument, NULL, OPTION_VERSION},
- {"warn-common", no_argument, NULL, OPTION_WARN_COMMON},
- {"warn-constructors", no_argument, NULL, OPTION_WARN_CONSTRUCTORS},
- {"warn-once", no_argument, NULL, OPTION_WARN_ONCE},
- {"split-by-reloc", required_argument, NULL, OPTION_SPLIT_BY_RELOC},
- {"split-by-file", no_argument, NULL, OPTION_SPLIT_BY_FILE},
- {"whole-archive", no_argument, NULL, OPTION_WHOLE_ARCHIVE},
-
-
- {NULL, no_argument, NULL, 0}
- };
+ /* Starting the short option string with '-' is for programs that
+ expect options and other ARGV-elements in any order and that care about
+ the ordering of the two. We describe each non-option ARGV-element
+ as if it were the argument of an option with character code 1. */
+ shortopts[0] = '-';
+ is = 1;
+ il = 0;
+ for (i = 0; i < OPTION_COUNT; i++)
+ {
+ if (ld_options[i].shortopt != '\0')
+ {
+ shortopts[is] = ld_options[i].shortopt;
+ ++is;
+ if (ld_options[i].opt.has_arg == required_argument
+ || ld_options[i].opt.has_arg == optional_argument)
+ {
+ shortopts[is] = ':';
+ ++is;
+ if (ld_options[i].opt.has_arg == optional_argument)
+ {
+ shortopts[is] = ':';
+ ++is;
+ }
+ }
+ }
+ if (ld_options[i].opt.name != NULL)
+ {
+ longopts[il] = ld_options[i].opt;
+ ++il;
+ }
+ }
+ shortopts[is] = '\0';
+ longopts[il].name = NULL;
/* The -G option is ambiguous on different platforms. Sometimes it
specifies the largest data size to put into the small data
@@ -250,6 +435,9 @@ parse_args (argc, argv)
case OPTION_NON_SHARED:
config.dynamic_link = false;
break;
+ case OPTION_CREF:
+ link_info.notice_all = true;
+ break;
case 'd':
command_line.force_common_definition = true;
break;
@@ -275,6 +463,7 @@ parse_args (argc, argv)
command_line.embedded_relocs = true;
break;
case OPTION_EXPORT_DYNAMIC:
+ case 'E': /* HP/UX compatibility. */
command_line.export_dynamic = true;
break;
case 'e':
@@ -283,6 +472,9 @@ parse_args (argc, argv)
case 'F':
/* Ignore. */
break;
+ case OPTION_FORCE_EXE_SUFFIX:
+ command_line.force_exe_suffix = true;
+ break;
case 'G':
{
char *end;
@@ -317,9 +509,11 @@ parse_args (argc, argv)
case 'N':
config.text_read_only = false;
config.magic_demand_paged = false;
+ config.dynamic_link = false;
break;
case 'n':
config.magic_demand_paged = false;
+ config.dynamic_link = false;
break;
case OPTION_NO_KEEP_MEMORY:
link_info.keep_memory = false;
@@ -327,6 +521,9 @@ parse_args (argc, argv)
case OPTION_NOINHIBIT_EXEC:
force_make_executable = true;
break;
+ case OPTION_NO_WHOLE_ARCHIVE:
+ whole_archive = false;
+ break;
case 'O':
/* FIXME "-O<non-digits> <value>" used to set the address of
section <non-digits>. Was this for compatibility with
@@ -445,7 +642,7 @@ parse_args (argc, argv)
set_section_start (".text", optarg);
break;
case OPTION_TRADITIONAL_FORMAT:
- config.traditional_format = true;
+ link_info.traditional_format = true;
break;
case OPTION_UR:
link_info.relocateable = true;
@@ -480,12 +677,18 @@ parse_args (argc, argv)
case OPTION_WARN_CONSTRUCTORS:
config.warn_constructors = true;
break;
+ case OPTION_WARN_MULTIPLE_GP:
+ config.warn_multiple_gp = true;
+ break;
case OPTION_WARN_ONCE:
config.warn_once = true;
break;
case OPTION_WHOLE_ARCHIVE:
whole_archive = true;
break;
+ case OPTION_WRAP:
+ add_wrap (optarg);
+ break;
case 'X':
link_info.discard = discard_l;
break;
@@ -579,3 +782,100 @@ set_section_start (sect, valstr)
lang_section_start (sect, exp_intop (val));
}
+/* Print help messages for the options. */
+
+static void
+help ()
+{
+ int i;
+ const char **targets, **pp;
+
+ printf ("Usage: %s [options] file...\n", program_name);
+
+ printf ("Options:\n");
+ for (i = 0; i < OPTION_COUNT; i++)
+ {
+ if (ld_options[i].doc != NULL)
+ {
+ boolean comma;
+ int len;
+ int j;
+
+ printf (" ");
+
+ comma = false;
+ len = 2;
+
+ j = i;
+ do
+ {
+ if (ld_options[j].shortopt != '\0'
+ && ld_options[j].control != NO_HELP)
+ {
+ printf ("%s-%c", comma ? ", " : "", ld_options[j].shortopt);
+ len += (comma ? 2 : 0) + 2;
+ if (ld_options[j].arg != NULL)
+ {
+ if (ld_options[j].opt.has_arg != optional_argument)
+ {
+ printf (" ");
+ ++len;
+ }
+ printf ("%s", ld_options[j].arg);
+ len += strlen (ld_options[j].arg);
+ }
+ comma = true;
+ }
+ ++j;
+ }
+ while (j < OPTION_COUNT && ld_options[j].doc == NULL);
+
+ j = i;
+ do
+ {
+ if (ld_options[j].opt.name != NULL
+ && ld_options[j].control != NO_HELP)
+ {
+ printf ("%s-%s%s",
+ comma ? ", " : "",
+ ld_options[j].control == TWO_DASHES ? "-" : "",
+ ld_options[j].opt.name);
+ len += ((comma ? 2 : 0)
+ + 1
+ + (ld_options[j].control == TWO_DASHES ? 1 : 0)
+ + strlen (ld_options[j].opt.name));
+ if (ld_options[j].arg != NULL)
+ {
+ printf (" %s", ld_options[j].arg);
+ len += 1 + strlen (ld_options[j].arg);
+ }
+ comma = true;
+ }
+ ++j;
+ }
+ while (j < OPTION_COUNT && ld_options[j].doc == NULL);
+
+ if (len >= 30)
+ {
+ printf ("\n");
+ len = 0;
+ }
+
+ for (; len < 30; len++)
+ putchar (' ');
+
+ printf ("%s\n", ld_options[i].doc);
+ }
+ }
+
+ printf ("%s: supported targets:", program_name);
+ targets = bfd_target_list ();
+ for (pp = targets; *pp != NULL; pp++)
+ printf (" %s", *pp);
+ free (targets);
+ printf ("\n");
+
+ printf ("%s: supported emulations: ", program_name);
+ ldemul_list_emulations (stdout);
+ printf ("\n");
+}
diff --git a/gnu/usr.bin/binutils/ld/mac-ld.r b/gnu/usr.bin/binutils/ld/mac-ld.r
index 8500a8057f2..b316fc5f193 100644
--- a/gnu/usr.bin/binutils/ld/mac-ld.r
+++ b/gnu/usr.bin/binutils/ld/mac-ld.r
@@ -1,3 +1,29 @@
+/* Resources for GNU LD. */
+
+#include "SysTypes.r"
+
+/* Version resources. */
+
+resource 'vers' (1) {
+ 0,
+ 0,
+ 0,
+ 0,
+ verUs,
+ VERSION_STRING,
+ VERSION_STRING " (C) 1986-95 FSF, Inc."
+};
+
+resource 'vers' (2, purgeable) {
+ 0,
+ 0,
+ 0,
+ 0,
+ verUs,
+ VERSION_STRING,
+ "GLD " VERSION_STRING " for MPW"
+};
+
#ifdef WANT_CFRG
#include "CodeFragmentTypes.r"
@@ -9,7 +35,7 @@ resource 'cfrg' (0) {
kNoVersionNum, kNoVersionNum,
0, 0,
kIsApp, kOnDiskFlat, kZeroOffset, kWholeFork,
- "ld"
+ PROG_NAME
}
};
diff --git a/gnu/usr.bin/binutils/ld/mpw-config.in b/gnu/usr.bin/binutils/ld/mpw-config.in
index 45fc41f3d99..ff45f969354 100644
--- a/gnu/usr.bin/binutils/ld/mpw-config.in
+++ b/gnu/usr.bin/binutils/ld/mpw-config.in
@@ -4,18 +4,22 @@ If "{target_canonical}" =~ /m68k-apple-macos/
Set emulname m68kcoff
forward-include "{srcdir}"mpw-em68kcoff.c em68kcoff.c
Set emulation_ofiles "{o}"em68kcoff.c.o
+
Else If "{target_canonical}" =~ /powerpc-apple-macos/
Set emulname ppcmacos
- forward-include "{srcdir}"mpw-eppcmacos.c eppcmacos.c
+ forward-include "{srcdir}"mpw-eppcmac.c eppcmacos.c
Set emulation_ofiles "{o}"eppcmacos.c.o
+
Else If "{target_canonical}" =~ /i386-unknown-go32/
Set emulname i386go32
forward-include "{srcdir}"mpw-ei386go32.c ei386go32.c
Set emulation_ofiles "{o}"ei386go32.c.o
-Else If "{target_canonical}" =~ /mips-idt-ecoff/
+
+Else If "{target_canonical}" =~ /mips-\Option-x-\Option-x/
Set emulname mipsidt
forward-include "{srcdir}"mpw-emipsidt.c emipsidt.c
Set emulation_ofiles "{o}"emipsidt.c.o
+
Else If "{target_canonical}" =~ /sh-hitachi-hms/
Set emulname sh
forward-include "{srcdir}"mpw-esh.c esh.c
diff --git a/gnu/usr.bin/binutils/ld/mpw-eppcmac.c b/gnu/usr.bin/binutils/ld/mpw-eppcmac.c
new file mode 100644
index 00000000000..185f3d7c01a
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/mpw-eppcmac.c
@@ -0,0 +1,1224 @@
+/* This file is is generated by a shell script. DO NOT EDIT! */
+
+/* AIX emulation code for ppcmacos
+ Copyright (C) 1991, 1993, 1995 Free Software Foundation, Inc.
+ Written by Steve Chamberlain <sac@cygnus.com>
+ AIX support by Ian Lance Taylor <ian@cygnus.com>
+
+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. */
+
+#define TARGET_IS_ppcmacos
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libiberty.h"
+#include "getopt.h"
+#include "bfdlink.h"
+
+#include <ctype.h>
+
+#include "ld.h"
+#include "ldmain.h"
+#include "ldemul.h"
+#include "ldfile.h"
+#include "ldmisc.h"
+#include "ldexp.h"
+#include "ldlang.h"
+#include "ldctor.h"
+#include "ldgram.h"
+
+static void gldppcmacos_before_parse PARAMS ((void));
+static int gldppcmacos_parse_args PARAMS ((int, char **));
+static void gldppcmacos_after_open PARAMS ((void));
+static void gldppcmacos_before_allocation PARAMS ((void));
+static void gldppcmacos_read_file PARAMS ((const char *, boolean));
+static void gldppcmacos_free PARAMS ((PTR));
+static void gldppcmacos_find_relocs
+ PARAMS ((lang_statement_union_type *));
+static void gldppcmacos_find_exp_assignment PARAMS ((etree_type *));
+static char *gldppcmacos_get_script PARAMS ((int *isfile));
+
+/* The file alignment required for each section. */
+static unsigned long file_align;
+
+/* The maximum size the stack is permitted to grow. This is stored in
+ the a.out header. */
+static unsigned long maxstack;
+
+/* The maximum data size. This is stored in the a.out header. */
+static unsigned long maxdata;
+
+/* Whether to perform garbage collection. */
+static int gc = 1;
+
+/* The module type to use. */
+static unsigned short modtype = ('1' << 8) | 'L';
+
+/* Whether the .text section must be read-only (i.e., no relocs
+ permitted). */
+static int textro;
+
+/* Whether to implement Unix like linker semantics. */
+static int unix_ld;
+
+/* Structure used to hold import file list. */
+
+struct filelist
+{
+ struct filelist *next;
+ const char *name;
+};
+
+/* List of import files. */
+static struct filelist *import_files;
+
+/* List of export symbols read from the export files. */
+
+struct export_symbol_list
+{
+ struct export_symbol_list *next;
+ const char *name;
+ boolean syscall;
+};
+
+static struct export_symbol_list *export_symbols;
+
+/* This routine is called before anything else is done. */
+
+static void
+gldppcmacos_before_parse()
+{
+#ifndef TARGET_ /* I.e., if not generic. */
+ ldfile_output_architecture = bfd_arch_powerpc;
+#endif /* not TARGET_ */
+}
+
+/* Handle AIX specific options. */
+
+static int
+gldppcmacos_parse_args (argc, argv)
+ int argc;
+ char **argv;
+{
+ int prevoptind = optind;
+ int prevopterr = opterr;
+ int indx;
+ int longind;
+ int optc;
+ long val;
+ char *end;
+
+#define OPTION_IGNORE (300)
+#define OPTION_AUTOIMP (OPTION_IGNORE + 1)
+#define OPTION_ERNOTOK (OPTION_AUTOIMP + 1)
+#define OPTION_EROK (OPTION_ERNOTOK + 1)
+#define OPTION_EXPORT (OPTION_EROK + 1)
+#define OPTION_IMPORT (OPTION_EXPORT + 1)
+#define OPTION_LOADMAP (OPTION_IMPORT + 1)
+#define OPTION_MAXDATA (OPTION_LOADMAP + 1)
+#define OPTION_MAXSTACK (OPTION_MAXDATA + 1)
+#define OPTION_MODTYPE (OPTION_MAXSTACK + 1)
+#define OPTION_NOAUTOIMP (OPTION_MODTYPE + 1)
+#define OPTION_NOSTRCMPCT (OPTION_NOAUTOIMP + 1)
+#define OPTION_PD (OPTION_NOSTRCMPCT + 1)
+#define OPTION_PT (OPTION_PD + 1)
+#define OPTION_STRCMPCT (OPTION_PT + 1)
+#define OPTION_UNIX (OPTION_STRCMPCT + 1)
+
+ static struct option longopts[] = {
+ {"basis", no_argument, NULL, OPTION_IGNORE},
+ {"bautoimp", no_argument, NULL, OPTION_AUTOIMP},
+ {"bcomprld", no_argument, NULL, OPTION_IGNORE},
+ {"bcrld", no_argument, NULL, OPTION_IGNORE},
+ {"bcror31", no_argument, NULL, OPTION_IGNORE},
+ {"bD", required_argument, NULL, OPTION_MAXDATA},
+ {"bE", required_argument, NULL, OPTION_EXPORT},
+ {"bernotok", no_argument, NULL, OPTION_ERNOTOK},
+ {"berok", no_argument, NULL, OPTION_EROK},
+ {"berrmsg", no_argument, NULL, OPTION_IGNORE},
+ {"bexport", required_argument, NULL, OPTION_EXPORT},
+ {"bf", no_argument, NULL, OPTION_ERNOTOK},
+ {"bgc", no_argument, &gc, 1},
+ {"bh", required_argument, NULL, OPTION_IGNORE},
+ {"bhalt", required_argument, NULL, OPTION_IGNORE},
+ {"bI", required_argument, NULL, OPTION_IMPORT},
+ {"bimport", required_argument, NULL, OPTION_IMPORT},
+ {"bl", required_argument, NULL, OPTION_LOADMAP},
+ {"bloadmap", required_argument, NULL, OPTION_LOADMAP},
+ {"bmaxdata", required_argument, NULL, OPTION_MAXDATA},
+ {"bmaxstack", required_argument, NULL, OPTION_MAXSTACK},
+ {"bM", required_argument, NULL, OPTION_MODTYPE},
+ {"bmodtype", required_argument, NULL, OPTION_MODTYPE},
+ {"bnoautoimp", no_argument, NULL, OPTION_NOAUTOIMP},
+ {"bnodelcsect", no_argument, NULL, OPTION_IGNORE},
+ {"bnoentry", no_argument, NULL, OPTION_IGNORE},
+ {"bnogc", no_argument, &gc, 0},
+ {"bnso", no_argument, NULL, OPTION_NOAUTOIMP},
+ {"bnostrcmpct", no_argument, NULL, OPTION_NOSTRCMPCT},
+ {"bnotextro", no_argument, &textro, 0},
+ {"bnro", no_argument, &textro, 0},
+ {"bpD", required_argument, NULL, OPTION_PD},
+ {"bpT", required_argument, NULL, OPTION_PT},
+ {"bro", no_argument, &textro, 1},
+ {"bS", required_argument, NULL, OPTION_MAXSTACK},
+ {"bso", no_argument, NULL, OPTION_AUTOIMP},
+ {"bstrcmpct", no_argument, NULL, OPTION_STRCMPCT},
+ {"btextro", no_argument, &textro, 1},
+ {"static", no_argument, NULL, OPTION_NOAUTOIMP},
+ {"unix", no_argument, NULL, OPTION_UNIX},
+ {NULL, no_argument, NULL, 0}
+ };
+
+ /* Options supported by the AIX linker which we do not support: -f,
+ -S, -v, -Z, -bbindcmds, -bbinder, -bbindopts, -bcalls, -bcaps,
+ -bcror15, -bdebugopt, -bdbg, -bdelcsect, -bex?, -bfilelist, -bfl,
+ -bgcbypass, -bglink, -binsert, -bi, -bloadmap, -bl, -bmap, -bnl,
+ -bnobind, -bnocomprld, -bnocrld, -bnoerrmsg, -bnoglink,
+ -bnoloadmap, -bnl, -bnoobjreorder, -bnoquiet, -bnoreorder,
+ -bnotypchk, -bnox, -bquiet, -bR, -brename, -breorder, -btypchk,
+ -bx, -bX, -bxref. */
+
+ /* If the current option starts with -b, change the first : to an =.
+ The AIX linker uses : to separate the option from the argument;
+ changing it to = lets us treat it as a getopt option. */
+ indx = optind;
+ if (indx == 0)
+ indx = 1;
+ if (indx < argc && strncmp (argv[indx], "-b", 2) == 0)
+ {
+ char *s;
+
+ for (s = argv[indx]; *s != '\0'; s++)
+ {
+ if (*s == ':')
+ {
+ *s = '=';
+ break;
+ }
+ }
+ }
+
+ opterr = 0;
+ optc = getopt_long_only (argc, argv, "-D:H:KT:z", longopts, &longind);
+ opterr = prevopterr;
+
+ switch (optc)
+ {
+ default:
+ optind = prevoptind;
+ return 0;
+
+ case 0:
+ /* Long option which just sets a flag. */
+ break;
+
+ case 'D':
+ val = strtol (optarg, &end, 0);
+ if (*end != '\0')
+ einfo ("%P: warning: ignoring invalid -D number %s\n", optarg);
+ else if (val != -1)
+ lang_section_start (".data", exp_intop (val));
+ break;
+
+ case 'H':
+ val = strtoul (optarg, &end, 0);
+ if (*end != '\0'
+ || (val & (val - 1)) != 0)
+ einfo ("%P: warning: ignoring invalid -H number %s\n", optarg);
+ else
+ file_align = val;
+ break;
+
+ case 'K':
+ case 'z':
+ /* FIXME: This should use the page size for the target system. */
+ file_align = 4096;
+ break;
+
+ case 'T':
+ /* On AIX this is the same as GNU ld -Ttext. When we see -T
+ number, we assume the AIX option is intended. Otherwise, we
+ assume the usual GNU ld -T option is intended. We can't just
+ ignore the AIX option, because gcc passes it to the linker. */
+ val = strtoul (optarg, &end, 0);
+ if (*end != '\0')
+ {
+ optind = prevoptind;
+ return 0;
+ }
+ lang_section_start (".text", exp_intop (val));
+ break;
+
+ case OPTION_IGNORE:
+ break;
+
+ case OPTION_AUTOIMP:
+ link_info.static_link = false;
+ break;
+
+ case OPTION_ERNOTOK:
+ force_make_executable = false;
+ break;
+
+ case OPTION_EROK:
+ force_make_executable = true;
+ break;
+
+ case OPTION_EXPORT:
+ gldppcmacos_read_file (optarg, false);
+ break;
+
+ case OPTION_IMPORT:
+ {
+ struct filelist *n;
+ struct filelist **flpp;
+
+ n = (struct filelist *) xmalloc (sizeof (struct filelist));
+ n->next = NULL;
+ n->name = optarg;
+ flpp = &import_files;
+ while (*flpp != NULL)
+ flpp = &(*flpp)->next;
+ *flpp = n;
+ }
+ break;
+
+ case OPTION_LOADMAP:
+ config.map_filename = optarg;
+ break;
+
+ case OPTION_MAXDATA:
+ val = strtoul (optarg, &end, 0);
+ if (*end != '\0')
+ einfo ("%P: warning: ignoring invalid -bmaxdata number %s\n",
+ optarg);
+ else
+ maxdata = val;
+ break;
+
+ case OPTION_MAXSTACK:
+ val = strtoul (optarg, &end, 0);
+ if (*end != '\0')
+ einfo ("%P: warning: ignoring invalid -bmaxstack number %s\n",
+ optarg);
+ else
+ maxstack = val;
+ break;
+
+ case OPTION_MODTYPE:
+ if (*optarg == 'S')
+ {
+ link_info.shared = true;
+ ++optarg;
+ }
+ if (*optarg == '\0' || optarg[1] == '\0')
+ einfo ("%P: warning: ignoring invalid module type %s\n", optarg);
+ else
+ modtype = (*optarg << 8) | optarg[1];
+ break;
+
+ case OPTION_NOAUTOIMP:
+ link_info.static_link = true;
+ break;
+
+ case OPTION_NOSTRCMPCT:
+ link_info.traditional_format = true;
+ break;
+
+ case OPTION_PD:
+ /* This sets the page that the .data section is supposed to
+ start on. The offset within the page should still be the
+ offset within the file, so we need to build an appropriate
+ expression. */
+ val = strtoul (optarg, &end, 0);
+ if (*end != '\0')
+ einfo ("%P: warning: ignoring invalid -pD number %s\n", optarg);
+ else
+ {
+ etree_type *t;
+
+ t = exp_binop ('+',
+ exp_intop (val),
+ exp_binop ('&',
+ exp_nameop (NAME, "."),
+ exp_intop (0xfff)));
+ t = exp_binop ('&',
+ exp_binop ('+', t, exp_intop (7)),
+ exp_intop (~ (bfd_vma) 7));
+ lang_section_start (".data", t);
+ }
+ break;
+
+ case OPTION_PT:
+ /* This set the page that the .text section is supposed to start
+ on. The offset within the page should still be the offset
+ within the file. */
+ val = strtoul (optarg, &end, 0);
+ if (*end != '\0')
+ einfo ("%P: warning: ignoring invalid -pT number %s\n", optarg);
+ else
+ {
+ etree_type *t;
+
+ t = exp_binop ('+',
+ exp_intop (val),
+ exp_nameop (SIZEOF_HEADERS, NULL));
+ t = exp_binop ('&',
+ exp_binop ('+', t, exp_intop (7)),
+ exp_intop (~ (bfd_vma) 7));
+ lang_section_start (".text", t);
+ }
+ break;
+
+ case OPTION_STRCMPCT:
+ link_info.traditional_format = false;
+ break;
+
+ case OPTION_UNIX:
+ unix_ld = true;
+ break;
+ }
+
+ return 1;
+}
+
+/* This is called when an input file can not be recognized as a BFD
+ object or an archive. If the file starts with #!, we must treat it
+ as an import file. This is for AIX compatibility. */
+
+static boolean
+gldppcmacos_unrecognized_file (entry)
+ lang_input_statement_type *entry;
+{
+ FILE *e;
+ boolean ret;
+
+ e = fopen (entry->filename, FOPEN_RT);
+ if (e == NULL)
+ return false;
+
+ ret = false;
+
+ if (getc (e) == '#' && getc (e) == '!')
+ {
+ struct filelist *n;
+ struct filelist **flpp;
+
+ n = (struct filelist *) xmalloc (sizeof (struct filelist));
+ n->next = NULL;
+ n->name = entry->filename;
+ flpp = &import_files;
+ while (*flpp != NULL)
+ flpp = &(*flpp)->next;
+ *flpp = n;
+
+ ret = true;
+ entry->loaded = true;
+ }
+
+ fclose (e);
+
+ return ret;
+}
+
+/* This is called after the input files have been opened. */
+
+static void
+gldppcmacos_after_open ()
+{
+ boolean r;
+ struct set_info *p;
+
+ /* Call ldctor_build_sets, after pretending that this is a
+ relocateable link. We do this because AIX requires relocation
+ entries for all references to symbols, even in a final
+ executable. Of course, we only want to do this if we are
+ producing an XCOFF output file. */
+ r = link_info.relocateable;
+ if (strstr (bfd_get_target (output_bfd), "xcoff") != NULL)
+ link_info.relocateable = true;
+ ldctor_build_sets ();
+ link_info.relocateable = r;
+
+ /* For each set, record the size, so that the XCOFF backend can
+ output the correct csect length. */
+ for (p = sets; p != (struct set_info *) NULL; p = p->next)
+ {
+ bfd_size_type size;
+
+ /* If the symbol is defined, we may have been invoked from
+ collect, and the sets may already have been built, so we do
+ not do anything. */
+ if (p->h->type == bfd_link_hash_defined
+ || p->h->type == bfd_link_hash_defweak)
+ continue;
+
+ if (p->reloc != BFD_RELOC_CTOR)
+ {
+ /* Handle this if we need to. */
+ abort ();
+ }
+
+ size = (p->count + 2) * 4;
+ if (! bfd_xcoff_link_record_set (output_bfd, &link_info, p->h, size))
+ einfo ("%F%P: bfd_xcoff_link_record_set failed: %E\n");
+ }
+}
+
+/* This is called after the sections have been attached to output
+ sections, but before any sizes or addresses have been set. */
+
+static void
+gldppcmacos_before_allocation ()
+{
+ struct filelist *fl;
+ struct export_symbol_list *el;
+ char *libpath;
+ asection *special_sections[6];
+ int i;
+
+ /* Handle the import and export files, if any. */
+ for (fl = import_files; fl != NULL; fl = fl->next)
+ gldppcmacos_read_file (fl->name, true);
+ for (el = export_symbols; el != NULL; el = el->next)
+ {
+ struct bfd_link_hash_entry *h;
+
+ h = bfd_link_hash_lookup (link_info.hash, el->name, false, false, false);
+ if (h == NULL)
+ einfo ("%P%F: bfd_link_hash_lookup of export symbol failed: %E\n");
+ if (! bfd_xcoff_export_symbol (output_bfd, &link_info, h, el->syscall))
+ einfo ("%P%F: bfd_xcoff_export_symbol failed: %E\n");
+ }
+
+ /* Track down all relocations called for by the linker script (these
+ are typically constructor/destructor entries created by
+ CONSTRUCTORS) and let the backend know it will need to create
+ .loader relocs for them. */
+ lang_for_each_statement (gldppcmacos_find_relocs);
+
+ /* We need to build LIBPATH from the -L arguments. If any -rpath
+ arguments were used, though, we use -rpath instead, as a GNU
+ extension. */
+ if (command_line.rpath != NULL)
+ libpath = command_line.rpath;
+ else if (search_head == NULL)
+ libpath = (char *) "";
+ else
+ {
+ size_t len;
+ search_dirs_type *search;
+
+ len = strlen (search_head->name);
+ libpath = xmalloc (len + 1);
+ strcpy (libpath, search_head->name);
+ for (search = search_head->next; search != NULL; search = search->next)
+ {
+ size_t nlen;
+
+ nlen = strlen (search->name);
+ libpath = xrealloc (libpath, len + nlen + 2);
+ libpath[len] = ':';
+ strcpy (libpath + len + 1, search->name);
+ len += nlen + 1;
+ }
+ }
+
+ /* Let the XCOFF backend set up the .loader section. */
+ if (! bfd_xcoff_size_dynamic_sections (output_bfd, &link_info, libpath,
+ entry_symbol, file_align,
+ maxstack, maxdata,
+ gc && ! unix_ld ? true : false,
+ modtype,
+ textro ? true : false,
+ unix_ld,
+ special_sections))
+ einfo ("%P%F: failed to set dynamic section sizes: %E\n");
+
+ /* Look through the special sections, and put them in the right
+ place in the link ordering. This is especially magic. */
+ for (i = 0; i < 6; i++)
+ {
+ asection *sec;
+ lang_output_section_statement_type *os;
+ lang_statement_union_type **pls;
+ lang_input_section_type *is;
+ const char *oname;
+ boolean start;
+
+ sec = special_sections[i];
+ if (sec == NULL)
+ continue;
+
+ /* Remove this section from the list of the output section.
+ This assumes we know what the script looks like. */
+ is = NULL;
+ os = lang_output_section_find (sec->output_section->name);
+ if (os == NULL)
+ einfo ("%P%F: can't find output section %s\n",
+ sec->output_section->name);
+ for (pls = &os->children.head; *pls != NULL; pls = &(*pls)->next)
+ {
+ if ((*pls)->header.type == lang_input_section_enum
+ && (*pls)->input_section.section == sec)
+ {
+ is = (lang_input_section_type *) *pls;
+ *pls = (*pls)->next;
+ break;
+ }
+ if ((*pls)->header.type == lang_wild_statement_enum)
+ {
+ lang_statement_union_type **pwls;
+
+ for (pwls = &(*pls)->wild_statement.children.head;
+ *pwls != NULL;
+ pwls = &(*pwls)->next)
+ {
+ if ((*pwls)->header.type == lang_input_section_enum
+ && (*pwls)->input_section.section == sec)
+ {
+ is = (lang_input_section_type *) *pwls;
+ *pwls = (*pwls)->next;
+ break;
+ }
+ }
+ if (is != NULL)
+ break;
+ }
+ }
+
+ if (is == NULL)
+ einfo ("%P%F: can't find %s in output section\n",
+ bfd_get_section_name (sec->owner, sec));
+
+ /* Now figure out where the section should go. */
+ switch (i)
+ {
+ default: /* to avoid warnings */
+ case 0:
+ /* _text */
+ oname = ".text";
+ start = true;
+ break;
+ case 1:
+ /* _etext */
+ oname = ".text";
+ start = false;
+ break;
+ case 2:
+ /* _data */
+ oname = ".data";
+ start = true;
+ break;
+ case 3:
+ /* _edata */
+ oname = ".data";
+ start = false;
+ break;
+ case 4:
+ case 5:
+ /* _end and end */
+ oname = ".bss";
+ start = false;
+ break;
+ }
+
+ os = lang_output_section_find (oname);
+
+ if (start)
+ {
+ is->header.next = os->children.head;
+ os->children.head = (lang_statement_union_type *) is;
+ }
+ else
+ {
+ is->header.next = NULL;
+ lang_statement_append (&os->children,
+ (lang_statement_union_type *) is,
+ &is->header.next);
+ }
+ }
+}
+
+/* Read an import or export file. For an import file, this is called
+ by the before_allocation emulation routine. For an export file,
+ this is called by the parse_args emulation routine. */
+
+static void
+gldppcmacos_read_file (filename, import)
+ const char *filename;
+ boolean import;
+{
+ struct obstack *o;
+ FILE *f;
+ int lineno;
+ int c;
+ boolean keep;
+ const char *imppath;
+ const char *impfile;
+ const char *impmember;
+
+ o = (struct obstack *) xmalloc (sizeof (struct obstack));
+ obstack_specify_allocation (o, 0, 0, xmalloc, gldppcmacos_free);
+
+ f = fopen (filename, FOPEN_RT);
+ if (f == NULL)
+ {
+ bfd_set_error (bfd_error_system_call);
+ einfo ("%F%s: %E\n", filename);
+ }
+
+ keep = false;
+
+ imppath = NULL;
+ impfile = NULL;
+ impmember = NULL;
+
+ lineno = 0;
+ while ((c = getc (f)) != EOF)
+ {
+ char *s;
+ char *symname;
+ boolean syscall;
+ bfd_vma address;
+ struct bfd_link_hash_entry *h;
+
+ if (c != '\n')
+ {
+ obstack_1grow (o, c);
+ continue;
+ }
+
+ obstack_1grow (o, '\0');
+ ++lineno;
+
+ s = (char *) obstack_base (o);
+ while (isspace ((unsigned char) *s))
+ ++s;
+ if (*s == '\0'
+ || *s == '*'
+ || (*s == '#' && s[1] == ' ')
+ || (! import && *s == '#' && s[1] == '!'))
+ {
+ obstack_free (o, obstack_base (o));
+ continue;
+ }
+
+ if (*s == '#' && s[1] == '!')
+ {
+ s += 2;
+ while (isspace ((unsigned char) *s))
+ ++s;
+ if (*s == '\0')
+ {
+ imppath = NULL;
+ impfile = NULL;
+ impmember = NULL;
+ obstack_free (o, obstack_base (o));
+ }
+ else if (*s == '(')
+ einfo ("%F%s%d: #! ([member]) is not supported in import files",
+ filename, lineno);
+ else
+ {
+ char cs;
+ char *file;
+
+ (void) obstack_finish (o);
+ keep = true;
+ imppath = s;
+ impfile = NULL;
+ while (! isspace ((unsigned char) *s) && *s != '(' && *s != '\0')
+ {
+ if (*s == '/')
+ file = s + 1;
+ ++s;
+ }
+ if (file != NULL)
+ {
+ file[-1] = '\0';
+ impfile = file;
+ if (imppath == file - 1)
+ imppath = "/";
+ }
+ else
+ {
+ impfile = imppath;
+ imppath = "";
+ }
+ cs = *s;
+ *s = '\0';
+ while (isspace ((unsigned char) cs))
+ {
+ ++s;
+ cs = *s;
+ }
+ if (cs != '(')
+ {
+ impmember = "";
+ if (cs != '\0')
+ einfo ("%s:%d: warning: syntax error in import file\n",
+ filename, lineno);
+ }
+ else
+ {
+ ++s;
+ impmember = s;
+ while (*s != ')' && *s != '\0')
+ ++s;
+ if (*s == ')')
+ *s = '\0';
+ else
+ einfo ("%s:%d: warning: syntax error in import file\n",
+ filename, lineno);
+ }
+ }
+
+ continue;
+ }
+
+ /* This is a symbol to be imported or exported. */
+ symname = s;
+ syscall = false;
+ address = (bfd_vma) -1;
+
+ while (! isspace ((unsigned char) *s) && *s != '\0')
+ ++s;
+ if (*s != '\0')
+ {
+ char *se;
+
+ *s++ = '\0';
+
+ while (isspace ((unsigned char) *s))
+ ++s;
+
+ se = s;
+ while (! isspace ((unsigned char) *se) && *se != '\0')
+ ++se;
+ if (*se != '\0')
+ {
+ *se++ = '\0';
+ while (isspace ((unsigned char) *se))
+ ++se;
+ if (*se != '\0')
+ einfo ("%s%d: warning: syntax error in import/export file\n",
+ filename, lineno);
+ }
+
+ if (strcasecmp (s, "svc") == 0
+ || strcasecmp (s, "syscall") == 0)
+ syscall = true;
+ else
+ {
+ char *end;
+
+ address = strtoul (s, &end, 0);
+ if (*end != '\0')
+ einfo ("%s:%d: warning: syntax error in import/export file\n",
+ filename, lineno);
+ }
+ }
+
+ if (! import)
+ {
+ struct export_symbol_list *n;
+
+ ldlang_add_undef (symname);
+ n = ((struct export_symbol_list *)
+ xmalloc (sizeof (struct export_symbol_list)));
+ n->next = export_symbols;
+ n->name = buystring (symname);
+ n->syscall = syscall;
+ export_symbols = n;
+ }
+ else
+ {
+ h = bfd_link_hash_lookup (link_info.hash, symname, false, false,
+ true);
+ if (h == NULL || h->type == bfd_link_hash_new)
+ {
+ /* We can just ignore attempts to import an unreferenced
+ symbol. */
+ }
+ else
+ {
+ if (! bfd_xcoff_import_symbol (output_bfd, &link_info, h,
+ address, imppath, impfile,
+ impmember))
+ einfo ("%X%s:%d: failed to import symbol %s: %E\n",
+ filename, lineno, symname);
+ }
+ }
+
+ obstack_free (o, obstack_base (o));
+ }
+
+ if (obstack_object_size (o) > 0)
+ {
+ einfo ("%s:%d: warning: ignoring unterminated last line\n",
+ filename, lineno);
+ obstack_free (o, obstack_base (o));
+ }
+
+ if (! keep)
+ {
+ obstack_free (o, NULL);
+ free (o);
+ }
+}
+
+/* This routine saves us from worrying about declaring free. */
+
+static void
+gldppcmacos_free (p)
+ PTR p;
+{
+ free (p);
+}
+
+/* This is called by the before_allocation routine via
+ lang_for_each_statement. It looks for relocations and assignments
+ to symbols. */
+
+static void
+gldppcmacos_find_relocs (s)
+ lang_statement_union_type *s;
+{
+ if (s->header.type == lang_reloc_statement_enum)
+ {
+ lang_reloc_statement_type *rs;
+
+ rs = &s->reloc_statement;
+ if (rs->name == NULL)
+ einfo ("%F%P: only relocations against symbols are permitted\n");
+ if (! bfd_xcoff_link_count_reloc (output_bfd, &link_info, rs->name))
+ einfo ("%F%P: bfd_xcoff_link_count_reloc failed: %E\n");
+ }
+
+ if (s->header.type == lang_assignment_statement_enum)
+ gldppcmacos_find_exp_assignment (s->assignment_statement.exp);
+}
+
+/* Look through an expression for an assignment statement. */
+
+static void
+gldppcmacos_find_exp_assignment (exp)
+ etree_type *exp;
+{
+ struct bfd_link_hash_entry *h;
+
+ switch (exp->type.node_class)
+ {
+ case etree_provide:
+ h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst,
+ false, false, false);
+ if (h == NULL)
+ break;
+ /* Fall through. */
+ case etree_assign:
+ if (strcmp (exp->assign.dst, ".") != 0)
+ {
+ if (! bfd_xcoff_record_link_assignment (output_bfd, &link_info,
+ exp->assign.dst))
+ einfo ("%P%F: failed to record assignment to %s: %E\n",
+ exp->assign.dst);
+ }
+ gldppcmacos_find_exp_assignment (exp->assign.src);
+ break;
+
+ case etree_binary:
+ gldppcmacos_find_exp_assignment (exp->binary.lhs);
+ gldppcmacos_find_exp_assignment (exp->binary.rhs);
+ break;
+
+ case etree_trinary:
+ gldppcmacos_find_exp_assignment (exp->trinary.cond);
+ gldppcmacos_find_exp_assignment (exp->trinary.lhs);
+ gldppcmacos_find_exp_assignment (exp->trinary.rhs);
+ break;
+
+ case etree_unary:
+ gldppcmacos_find_exp_assignment (exp->unary.child);
+ break;
+
+ default:
+ break;
+ }
+}
+
+static char *
+gldppcmacos_get_script(isfile)
+ int *isfile;
+{
+ *isfile = 0;
+
+ if (link_info.relocateable == true && config.build_constructors == true)
+ return
+"OUTPUT_FORMAT(\"xcoff-powermac\")\n\
+OUTPUT_ARCH(powerpc)\n\
+ENTRY(__start)\n\
+SECTIONS\n\
+{\n\
+ .pad 0 : { *(.pad) }\n\
+ .text 0 : {\n\
+ *(.text)\n\
+ *(.pr)\n\
+ *(.ro)\n\
+ *(.db)\n\
+ *(.gl)\n\
+ *(.xo)\n\
+ *(.ti)\n\
+ *(.tb)\n\
+ }\n\
+ .data 0 : {\n\
+ *(.data)\n\
+ *(.rw)\n\
+ *(.sv)\n\
+ *(.ua)\n\
+ . = ALIGN(4);\n\
+ CONSTRUCTORS\n\
+ *(.ds)\n\
+ *(.tc0)\n\
+ *(.tc)\n\
+ *(.td)\n\
+ }\n\
+ .bss : {\n\
+ *(.bss)\n\
+ *(.bs)\n\
+ *(.uc)\n\
+ *(COMMON)\n\
+ }\n\
+ .loader 0 : {\n\
+ *(.loader)\n\
+ }\n\
+ .debug 0 : {\n\
+ *(.debug)\n\
+ }\n\
+}\n\n"
+ ; else if (link_info.relocateable == true) return
+"OUTPUT_FORMAT(\"xcoff-powermac\")\n\
+OUTPUT_ARCH(powerpc)\n\
+ENTRY(__start)\n\
+SECTIONS\n\
+{\n\
+ .pad 0 : { *(.pad) }\n\
+ .text 0 : {\n\
+ *(.text)\n\
+ *(.pr)\n\
+ *(.ro)\n\
+ *(.db)\n\
+ *(.gl)\n\
+ *(.xo)\n\
+ *(.ti)\n\
+ *(.tb)\n\
+ }\n\
+ .data 0 : {\n\
+ *(.data)\n\
+ *(.rw)\n\
+ *(.sv)\n\
+ *(.ua)\n\
+ . = ALIGN(4);\n\
+ *(.ds)\n\
+ *(.tc0)\n\
+ *(.tc)\n\
+ *(.td)\n\
+ }\n\
+ .bss : {\n\
+ *(.bss)\n\
+ *(.bs)\n\
+ *(.uc)\n\
+ *(COMMON)\n\
+ }\n\
+ .loader 0 : {\n\
+ *(.loader)\n\
+ }\n\
+ .debug 0 : {\n\
+ *(.debug)\n\
+ }\n\
+}\n\n"
+ ; else if (!config.text_read_only) return
+"OUTPUT_FORMAT(\"xcoff-powermac\")\n\
+OUTPUT_ARCH(powerpc)\n\
+ SEARCH_DIR(/usr/local/powerpc-apple-macos/lib);\n\
+ENTRY(__start)\n\
+SECTIONS\n\
+{\n\
+ .pad 0 : { *(.pad) }\n\
+ .text : {\n\
+ PROVIDE (_text = .);\n\
+ *(.text)\n\
+ *(.pr)\n\
+ *(.ro)\n\
+ *(.db)\n\
+ *(.gl)\n\
+ *(.xo)\n\
+ *(.ti)\n\
+ *(.tb)\n\
+ PROVIDE (_etext = .);\n\
+ }\n\
+ .data 0 : {\n\
+ PROVIDE (_data = .);\n\
+ *(.data)\n\
+ *(.rw)\n\
+ *(.sv)\n\
+ *(.ua)\n\
+ . = ALIGN(4);\n\
+ CONSTRUCTORS\n\
+ *(.ds)\n\
+ *(.tc0)\n\
+ *(.tc)\n\
+ *(.td)\n\
+ PROVIDE (_edata = .);\n\
+ }\n\
+ .bss : {\n\
+ *(.bss)\n\
+ *(.bs)\n\
+ *(.uc)\n\
+ *(COMMON)\n\
+ PROVIDE (_end = .);\n\
+ PROVIDE (end = .);\n\
+ }\n\
+ .loader 0 : {\n\
+ *(.loader)\n\
+ }\n\
+ .debug 0 : {\n\
+ *(.debug)\n\
+ }\n\
+}\n\n"
+ ; else if (!config.magic_demand_paged) return
+"OUTPUT_FORMAT(\"xcoff-powermac\")\n\
+OUTPUT_ARCH(powerpc)\n\
+ SEARCH_DIR(/usr/local/powerpc-apple-macos/lib);\n\
+ENTRY(__start)\n\
+SECTIONS\n\
+{\n\
+ .pad 0 : { *(.pad) }\n\
+ .text : {\n\
+ PROVIDE (_text = .);\n\
+ *(.text)\n\
+ *(.pr)\n\
+ *(.ro)\n\
+ *(.db)\n\
+ *(.gl)\n\
+ *(.xo)\n\
+ *(.ti)\n\
+ *(.tb)\n\
+ PROVIDE (_etext = .);\n\
+ }\n\
+ .data 0 : {\n\
+ PROVIDE (_data = .);\n\
+ *(.data)\n\
+ *(.rw)\n\
+ *(.sv)\n\
+ *(.ua)\n\
+ . = ALIGN(4);\n\
+ CONSTRUCTORS\n\
+ *(.ds)\n\
+ *(.tc0)\n\
+ *(.tc)\n\
+ *(.td)\n\
+ PROVIDE (_edata = .);\n\
+ }\n\
+ .bss : {\n\
+ *(.bss)\n\
+ *(.bs)\n\
+ *(.uc)\n\
+ *(COMMON)\n\
+ PROVIDE (_end = .);\n\
+ PROVIDE (end = .);\n\
+ }\n\
+ .loader 0 : {\n\
+ *(.loader)\n\
+ }\n\
+ .debug 0 : {\n\
+ *(.debug)\n\
+ }\n\
+}\n\n"
+ ; else return
+"OUTPUT_FORMAT(\"xcoff-powermac\")\n\
+OUTPUT_ARCH(powerpc)\n\
+ SEARCH_DIR(/usr/local/powerpc-apple-macos/lib);\n\
+ENTRY(__start)\n\
+SECTIONS\n\
+{\n\
+ .pad 0 : { *(.pad) }\n\
+ .text : {\n\
+ PROVIDE (_text = .);\n\
+ *(.text)\n\
+ *(.pr)\n\
+ *(.ro)\n\
+ *(.db)\n\
+ *(.gl)\n\
+ *(.xo)\n\
+ *(.ti)\n\
+ *(.tb)\n\
+ PROVIDE (_etext = .);\n\
+ }\n\
+ .data 0 : {\n\
+ PROVIDE (_data = .);\n\
+ *(.data)\n\
+ *(.rw)\n\
+ *(.sv)\n\
+ *(.ua)\n\
+ . = ALIGN(4);\n\
+ CONSTRUCTORS\n\
+ *(.ds)\n\
+ *(.tc0)\n\
+ *(.tc)\n\
+ *(.td)\n\
+ PROVIDE (_edata = .);\n\
+ }\n\
+ .bss : {\n\
+ *(.bss)\n\
+ *(.bs)\n\
+ *(.uc)\n\
+ *(COMMON)\n\
+ PROVIDE (_end = .);\n\
+ PROVIDE (end = .);\n\
+ }\n\
+ .loader 0 : {\n\
+ *(.loader)\n\
+ }\n\
+ .debug 0 : {\n\
+ *(.debug)\n\
+ }\n\
+}\n\n"
+; }
+
+struct ld_emulation_xfer_struct ld_ppcmacos_emulation =
+{
+ gldppcmacos_before_parse,
+ syslib_default,
+ hll_default,
+ after_parse_default,
+ gldppcmacos_after_open,
+ after_allocation_default,
+ set_output_arch_default,
+ ldemul_default_target,
+ gldppcmacos_before_allocation,
+ gldppcmacos_get_script,
+ "ppcmacos",
+ "xcoff-powermac",
+ 0, /* finish */
+ 0, /* create_output_section_statements */
+ 0, /* open_dynamic_archive */
+ 0, /* place_orphan */
+ 0, /* set_symbols */
+ gldppcmacos_parse_args,
+ gldppcmacos_unrecognized_file
+};
diff --git a/gnu/usr.bin/binutils/ld/mpw-make.sed b/gnu/usr.bin/binutils/ld/mpw-make.sed
index f672da09870..3d82a646ba9 100644
--- a/gnu/usr.bin/binutils/ld/mpw-make.sed
+++ b/gnu/usr.bin/binutils/ld/mpw-make.sed
@@ -54,15 +54,42 @@
/ldemul-list.h/s/"{s}"ldemul-list\.h/"{o}"ldemul-list.h/g
/ldemul-list.h/s/^ldemul-list\.h/"{o}"ldemul-list.h/
+# Edit pathnames to emulation files.
/"{s}"e.*\.c/s/"{s}"e\([-_a-z0-9]*\)\.c/"{o}"e\1.c/g
/^e.*\.c/s/^e\([-_a-z0-9]*\)\.c/"{o}"e\1.c/
+# We can't run genscripts, so don't try.
+/{GENSCRIPTS}/s/{GENSCRIPTS}/null-command/
+
+# Comment out the TDIRS bits.
+/^TDIRS@/s/^/#/
+
+# Point at the BFD library directly.
+/@BFDLIB@/s/@BFDLIB@/::bfd:libbfd.o/
+
+# Don't need this.
+/@HLDFLAGS@/s/@HLDFLAGS@//
+
#/sed.*free/,/> "{o}"ldlex.c.new/c\
# \ Catenate "{o}"lex.yy.c >"{o}"ldlex.c.new
# The resource file is called mac-ld.r.
/{LD_PROG}.r/s/{LD_PROG}\.r/mac-ld.r/
+/^install \\Option-f /,/^$/c\
+install \\Option-f all install-only\
+\
+install-only \\Option-f\
+ If "`Exists "{prefix}"`" == ""\
+ Echo "{prefix}" does not exist, cannot install anything\
+ Exit 1\
+ End If\
+ If "`Exists "{bindir}"`" == ""\
+ NewFolder "{bindir}"\
+ End If\
+ Duplicate -y :ld.new "{bindir}"ld\
+
+
# Remove dependency rebuilding crud.
/^.dep /,/# .PHONY /d
diff --git a/gnu/usr.bin/binutils/ld/mri.c b/gnu/usr.bin/binutils/ld/mri.c
index 1dbb287e82c..7273e015dd7 100644
--- a/gnu/usr.bin/binutils/ld/mri.c
+++ b/gnu/usr.bin/binutils/ld/mri.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -62,7 +62,6 @@ static void mri_add_to_list PARAMS ((struct section_name_struct **list,
const char *name, etree_type *vma,
const char *zalias, etree_type *align,
etree_type *subalign));
-static void mri_draw_tree PARAMS ((void));
static struct section_name_struct **
lookup (name, list)
@@ -135,11 +134,13 @@ mri_base (exp)
static int done_tree = 0;
-static void
+void
mri_draw_tree ()
{
if (done_tree) return;
+ /* We don't bother with memory regions. */
+#if 0
/* Create the regions */
{
lang_memory_region_type *r;
@@ -149,7 +150,7 @@ mri_draw_tree ()
r->length = (bfd_size_type) exp_get_vma(0, (bfd_vma) ~((bfd_size_type)0),
"length", lang_first_phase_enum);
}
-
+#endif
/* Now build the statements for the ldlang machine */
@@ -264,7 +265,7 @@ mri_draw_tree ()
}
}
- lang_leave_output_section_statement(0, "long");
+ lang_leave_output_section_statement(0, "*default*");
p = p->next;
}
}
@@ -277,8 +278,6 @@ void
mri_load (name)
CONST char *name;
{
- mri_draw_tree();
-
base = 0;
lang_add_input_file(name,
lang_input_file_is_file_enum, (char *)NULL);
diff --git a/gnu/usr.bin/binutils/ld/mri.h b/gnu/usr.bin/binutils/ld/mri.h
index 66f67a5017a..dc3f0f3a190 100644
--- a/gnu/usr.bin/binutils/ld/mri.h
+++ b/gnu/usr.bin/binutils/ld/mri.h
@@ -1,5 +1,5 @@
/* mri.h -- header file for MRI scripting functions
- Copyright 1993 Free Software Foundation, Inc.
+ Copyright 1993, 95, 1996 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -34,5 +34,6 @@ extern void mri_public PARAMS ((const char *name, etree_type *exp));
extern void mri_align PARAMS ((const char *name, etree_type *exp));
extern void mri_alignmod PARAMS ((const char *name, etree_type *exp));
extern void mri_truncate PARAMS ((unsigned int exp));
+extern void mri_draw_tree PARAMS ((void));
#endif
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/alpha.sc b/gnu/usr.bin/binutils/ld/scripttempl/alpha.sc
index 3b0c921a45c..44a10c469cd 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/alpha.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/alpha.sc
@@ -33,6 +33,9 @@ SECTIONS
.rdata : {
*(.rdata)
}
+ .rconst : {
+ *(.rconst)
+ }
.pdata : {
${RELOCATING+ _fpdata = .;}
*(.pdata)
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/aout.sc b/gnu/usr.bin/binutils/ld/scripttempl/aout.sc
index 1898badf252..a5b7c188ffb 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/aout.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/aout.sc
@@ -6,6 +6,7 @@ ${RELOCATING+${LIB_SEARCH_DIRS}}
${STACKZERO+${RELOCATING+${STACKZERO}}}
${SHLIB_PATH+${RELOCATING+${SHLIB_PATH}}}
${RELOCATING+${EXECUTABLE_SYMBOLS}}
+${RELOCATING+PROVIDE (__stack = 0);}
SECTIONS
{
${RELOCATING+. = ${TEXT_START_ADDR};}
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/elf.sc b/gnu/usr.bin/binutils/ld/scripttempl/elf.sc
index ea7c4c3ba93..91915c96512 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/elf.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/elf.sc
@@ -23,13 +23,14 @@
test -z "$ENTRY" && ENTRY=_start
test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
test "$LD_FLAG" = "N" && DATA_ADDR=.
INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }"
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}")
-OUTPUT_ARCH(${ARCH})
+OUTPUT_ARCH(${OUTPUT_ARCH})
ENTRY(${ENTRY})
${RELOCATING+${LIB_SEARCH_DIRS}}
@@ -86,22 +87,8 @@ SECTIONS
${RELOCATING+${OTHER_READONLY_SECTIONS}}
/* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. It would
- be more correct to do this:
- ${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE})
- + ((ALIGN(8) + ${MAXPAGESIZE} - ALIGN(${MAXPAGESIZE}))
- & (${MAXPAGESIZE} - 1)};}
- The current expression does not correctly handle the case of a
- text segment ending precisely at the end of a page; it causes the
- data segment to skip a page. The above expression does not have
- this problem, but it will currently (2/95) cause BFD to allocate
- a single segment, combining both text and data, for this case.
- This will prevent the text segment from being shared among
- multiple executions of the program; I think that is more
- important than losing a page of the virtual address space (note
- that no actual memory is lost; the page which is skipped can not
- be referenced). */
- ${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};}
+ the same address within the page on the next page up. */
+ ${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (ALIGN(8) & (${MAXPAGESIZE} - 1))};}
.data ${RELOCATING-0} :
{
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/elfmips.sc b/gnu/usr.bin/binutils/ld/scripttempl/elfmips.sc
new file mode 100644
index 00000000000..aed49a3354c
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/scripttempl/elfmips.sc
@@ -0,0 +1,175 @@
+#
+# Unusual variables checked by this code:
+# NOP - two byte opcode for no-op (defaults to 0)
+# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
+# OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
+# (e.g., .PARISC.milli)
+# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
+# (e.g., .PARISC.global)
+# OTHER_SECTIONS - at the end
+# EXECUTABLE_SYMBOLS - symbols that must be defined for an
+# executable (e.g., _DYNAMIC_LINK)
+# TEXT_START_SYMBOLS - symbols that appear at the start of the
+# .text section.
+# DATA_START_SYMBOLS - symbols that appear at the start of the
+# .data section.
+# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
+# .bss section besides __bss_start.
+# EMBEDDED - whether this is for an embedded system.
+#
+# When adding sections, do note that the names of some sections are used
+# when specifying the start address of the next.
+#
+
+# We use a start address of __start for Irix 5, _start for other
+# targets. This is for compatibility with Irix 5, and with old MIPS
+# ELF toolchains.
+if [ -z "$ENTRY" ]; then
+ case "${target}" in
+ mips*-*-irix5*) ENTRY=__start ;;
+ *) ENTRY=_start ;;
+ esac
+fi
+
+# if this is for an embedded system, don't add SIZEOF_HEADERS.
+if [ -z "$EMBEDDED" ]; then
+ test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS"
+else
+ test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}"
+fi
+
+test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+test "$LD_FLAG" = "N" && DATA_ADDR=.
+INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
+ "${LITTLE_OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+ENTRY(${ENTRY})
+
+${RELOCATING+${LIB_SEARCH_DIRS}}
+${RELOCATING+/* Do we need any of these for elf?
+ __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
+${RELOCATING+${EXECUTABLE_SYMBOLS}}
+${RELOCATING- /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */}
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ ${CREATE_SHLIB-${RELOCATING+. = ${TEXT_BASE_ADDRESS};}}
+ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR} + SIZEOF_HEADERS;}}
+ ${CREATE_SHLIB-${INTERP}}
+ .reginfo ${RELOCATING-0} : { *(.reginfo) }
+ .dynamic ${RELOCATING-0} : { *(.dynamic) }
+ .dynstr ${RELOCATING-0} : { *(.dynstr) }
+ .dynsym ${RELOCATING-0} : { *(.dynsym) }
+ .hash ${RELOCATING-0} : { *(.hash) }
+ .rel.text ${RELOCATING-0} : { *(.rel.text) }
+ .rela.text ${RELOCATING-0} : { *(.rela.text) }
+ .rel.data ${RELOCATING-0} : { *(.rel.data) }
+ .rela.data ${RELOCATING-0} : { *(.rela.data) }
+ .rel.rodata ${RELOCATING-0} : { *(.rel.rodata) }
+ .rela.rodata ${RELOCATING-0} : { *(.rela.rodata) }
+ .rel.got ${RELOCATING-0} : { *(.rel.got) }
+ .rela.got ${RELOCATING-0} : { *(.rela.got) }
+ .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
+ .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
+ .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
+ .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
+ .rel.init ${RELOCATING-0} : { *(.rel.init) }
+ .rela.init ${RELOCATING-0} : { *(.rela.init) }
+ .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
+ .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
+ .rel.bss ${RELOCATING-0} : { *(.rel.bss) }
+ .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
+ .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
+ .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
+ .rodata ${RELOCATING-0} : { *(.rodata) }
+ .rodata1 ${RELOCATING-0} : { *(.rodata1) }
+ .init ${RELOCATING-0} : { *(.init) } =${NOP-0}
+ .text ${RELOCATING-0} :
+ {
+ ${CREATE_SHLIB-${RELOCATING+${TEXT_START_SYMBOLS}}}
+ *(.text)
+ *(.stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =${NOP-0}
+ ${CREATE_SHLIB-${RELOCATING+_etext = .;}}
+ ${CREATE_SHLIB-${RELOCATING+PROVIDE (etext = .);}}
+ .fini ${RELOCATING-0} : { *(.fini) } =${NOP-0}
+
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. It would
+ be more correct to do this:
+ ${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE})
+ + ((ALIGN(8) + ${MAXPAGESIZE} - ALIGN(${MAXPAGESIZE}))
+ & (${MAXPAGESIZE} - 1)};}
+ The current expression does not correctly handle the case of a
+ text segment ending precisely at the end of a page; it causes the
+ data segment to skip a page. The above expression does not have
+ this problem, but it will currently (2/95) cause BFD to allocate
+ a single segment, combining both text and data, for this case.
+ This will prevent the text segment from being shared among
+ multiple executions of the program; I think that is more
+ important than losing a page of the virtual address space (note
+ that no actual memory is lost; the page which is skipped can not
+ be referenced). */
+ ${CREATE_SHLIB-${RELOCATING+. += ${DATA_ADDR} - ${TEXT_START_ADDR};}}
+ ${CREATE_SHLIB+${RELOCATING+. += 0x10000;}}
+ .data ${RELOCATING-0} :
+ {
+ ${CREATE_SHLIB-${RELOCATING+${DATA_START_SYMBOLS}}}
+ *(.data)
+ ${CONSTRUCTING+CONSTRUCTORS}
+ }
+ .data1 ${RELOCATING-0} : { *(.data1) }
+ .ctors ${RELOCATING-0} : { *(.ctors) }
+ .dtors ${RELOCATING-0} : { *(.dtors) }
+ ${RELOCATING+${OTHER_GOT_SYMBOLS}}
+ .got ${RELOCATING-0} :
+ {
+ *(.got.plt) *(.got)
+ }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata ${RELOCATING-0} : { *(.sdata) }
+ ${RELOCATING+${OTHER_READWRITE_SECTIONS}}
+ ${CREATE_SHLIB-${RELOCATING+_edata = .;}}
+ ${CREATE_SHLIB-${RELOCATING+PROVIDE (edata = .);}}
+ ${CREATE_SHLIB-${RELOCATING+__bss_start = .;}}
+ ${CREATE_SHLIB-${RELOCATING+${OTHER_BSS_SYMBOLS}}}
+ .sbss ${RELOCATING-0} : { *(.sbss) *(.scommon) }
+ .bss ${RELOCATING-0} :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ }
+ ${CREATE_SHLIB-${RELOCATING+_end = . ;}}
+ ${CREATE_SHLIB-${RELOCATING+PROVIDE (end = .);}}
+
+ /* These are needed for ELF backends which have not yet been
+ converted to the new style linker. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+
+ /* DWARF debug sections.
+ Symbols in the .debug DWARF section are relative to the beginning of the
+ section so we begin .debug at 0. It's not clear yet what needs to happen
+ for the others. */
+ .debug 0 : { *(.debug) }
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ .line 0 : { *(.line) }
+
+ /* These must appear regardless of ${RELOCATING}. */
+ ${OTHER_SECTIONS}
+}
+EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/elfppc.sc b/gnu/usr.bin/binutils/ld/scripttempl/elfppc.sc
index 13704659303..a2cb2ed178a 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/elfppc.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/elfppc.sc
@@ -2,9 +2,9 @@
# Unusual variables checked by this code:
# NOP - two byte opcode for no-op (defaults to 0)
# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
-# OTHER_READONLY_SECTIONS - other than .text .init .ctors .rodata ...
+# OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
# (e.g., .PARISC.milli)
-# OTHER_READWRITE_SECTIONS - other than .data .bss .sdata ...
+# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
# (e.g., .PARISC.global)
# OTHER_SECTIONS - at the end
# EXECUTABLE_SYMBOLS - symbols that must be defined for an
@@ -24,8 +24,10 @@ test -z "$ENTRY" && ENTRY=_start
test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test "$LD_FLAG" = "N" && DATA_ADDR=.
-INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
-PLT=".plt ${RELOCATING-0} : { *(.plt) }"
+SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2) }"
+SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2) }"
+INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
+PLT=".plt ${RELOCATING-0} : { *(.plt) }"
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}")
@@ -40,40 +42,33 @@ ${RELOCATING- /* For some reason, the Solaris linker makes bad executables
if gld -r is used and the intermediate file has sections starting
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
bug. But for now assigning the zero vmas works. */}
+
+${RELOCATING+PROVIDE (__stack = 0);}
SECTIONS
{
/* Read-only sections, merged into text segment: */
${CREATE_SHLIB-${RELOCATING+. = ${TEXT_START_ADDR} + SIZEOF_HEADERS;}}
${CREATE_SHLIB+${RELOCATING+. = SIZEOF_HEADERS;}}
${CREATE_SHLIB-${INTERP}}
- .hash ${RELOCATING-0} : { *(.hash) }
- .dynsym ${RELOCATING-0} : { *(.dynsym) }
- .dynstr ${RELOCATING-0} : { *(.dynstr) }
- .rel.text ${RELOCATING-0} : { *(.rel.text) }
- .rela.text ${RELOCATING-0} : { *(.rela.text) }
- .rel.data ${RELOCATING-0} : { *(.rel.data) }
- .rela.data ${RELOCATING-0} : { *(.rela.data) }
- .rel.rodata ${RELOCATING-0} : { *(.rel.rodata) }
- .rela.rodata ${RELOCATING-0} : { *(.rela.rodata) }
- .rel.got ${RELOCATING-0} : { *(.rel.got) }
- .rela.got ${RELOCATING-0} : { *(.rela.got) }
- .rel.got1 ${RELOCATING-0} : { *(.rel.got1) }
- .rela.got1 ${RELOCATING-0} : { *(.rela.got1) }
- .rel.got2 ${RELOCATING-0} : { *(.rel.got2) }
- .rela.got2 ${RELOCATING-0} : { *(.rela.got2) }
- .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
- .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
- .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
- .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
- .rel.init ${RELOCATING-0} : { *(.rel.init) }
- .rela.init ${RELOCATING-0} : { *(.rela.init) }
- .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
- .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
- .rel.bss ${RELOCATING-0} : { *(.rel.bss) }
- .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
- .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
- .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
- .init ${RELOCATING-0} : { *(.init) } =${NOP-0}
+ .hash ${RELOCATING-0} : { *(.hash) }
+ .dynsym ${RELOCATING-0} : { *(.dynsym) }
+ .dynstr ${RELOCATING-0} : { *(.dynstr) }
+ .rela.text ${RELOCATING-0} : { *(.rela.text) }
+ .rela.data ${RELOCATING-0} : { *(.rela.data) }
+ .rela.rodata ${RELOCATING-0} : { *(.rela.rodata) }
+ .rela.got ${RELOCATING-0} : { *(.rela.got) }
+ .rela.got1 ${RELOCATING-0} : { *(.rela.got1) }
+ .rela.got2 ${RELOCATING-0} : { *(.rela.got2) }
+ .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
+ .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
+ .rela.init ${RELOCATING-0} : { *(.rela.init) }
+ .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
+ .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
+ .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
+ .rela.sdata ${RELOCATING-0} : { *(.rela.sdata2) }
+ .rela.sbss ${RELOCATING-0} : { *(.rela.sbss2) }
+ .rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2) }
+ .rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2) }
${DATA_PLT-${PLT}}
.text ${RELOCATING-0} :
{
@@ -82,15 +77,32 @@ SECTIONS
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} =${NOP-0}
+ .init ${RELOCATING-0} : { *(.init) } =${NOP-0}
+ .fini ${RELOCATING-0} : { *(.fini) } =${NOP-0}
+ .rodata ${RELOCATING-0} : { *(.rodata) }
+ .rodata1 ${RELOCATING-0} : { *(.rodata1) }
${RELOCATING+_etext = .;}
${RELOCATING+PROVIDE (etext = .);}
- .fini ${RELOCATING-0} : { *(.fini) } =${NOP-0}
- .rodata ${RELOCATING-0} : { *(.rodata) }
- .rodata1 ${RELOCATING-0} : { *(.rodata1) }
+ ${CREATE_SHLIB-${SDATA2}}
+ ${CREATE_SHLIB-${SBSS2}}
${RELOCATING+${OTHER_READONLY_SECTIONS}}
- /* Read-write section, merged into data segment: */
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. It would
+ be more correct to do this:
+ ${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (ALIGN(8) & (${MAXPAGESIZE} - 1))};}
+ The current expression does not correctly handle the case of a
+ text segment ending precisely at the end of a page; it causes the
+ data segment to skip a page. The above expression does not have
+ this problem, but it will currently (2/95) cause BFD to allocate
+ a single segment, combining both text and data, for this case.
+ This will prevent the text segment from being shared among
+ multiple executions of the program; I think that is more
+ important than losing a page of the virtual address space (note
+ that no actual memory is lost; the page which is skipped can not
+ be referenced). */
${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};}
+
.data ${RELOCATING-0} :
{
${RELOCATING+${DATA_START_SYMBOLS}}
@@ -100,54 +112,55 @@ SECTIONS
.data1 ${RELOCATING-0} : { *(.data1) }
${RELOCATING+${OTHER_READWRITE_SECTIONS}}
- ${RELOCATING+_GOT1_START_ = .;}
- .got1 ${RELOCATING-0} : { *(.got1) }
- ${RELOCATING+_GOT1_END_ = .;}
-
- .dynamic ${RELOCATING-0} : { *(.dynamic) }
+ .got1 ${RELOCATING-0} : { *(.got1) }
+ .dynamic ${RELOCATING-0} : { *(.dynamic) }
/* Put .ctors and .dtors next to the .got2 section, so that the pointers
- get relocated with -mrelocatable. Also put in the .fixup pointers. */
+ get relocated with -mrelocatable. Also put in the .fixup pointers.
+ The current compiler no longer needs this, but keep it around for 2.7.2 */
- ${RELOCATING+_GOT2_START_ = .;}
- .got2 ${RELOCATING-0} : { *(.got2) }
+ ${RELOCATING+PROVIDE (_GOT2_START_ = .);}
+ .got2 ${RELOCATING-0} : { *(.got2) }
- ${RELOCATING+__CTOR_LIST__ = .;}
- .ctors ${RELOCATING-0} : { *(.ctors) }
- ${RELOCATING+__CTOR_END__ = .;}
+ ${RELOCATING+PROVIDE (__CTOR_LIST__ = .);}
+ .ctors ${RELOCATING-0} : { *(.ctors) }
+ ${RELOCATING+PROVIDE (__CTOR_END__ = .);}
- ${RELOCATING+__DTOR_LIST__ = .;}
- .dtors ${RELOCATING-0} : { *(.dtors) }
- ${RELOCATING+__DTOR_END__ = .;}
+ ${RELOCATING+PROVIDE (__DTOR_LIST__ = .);}
+ .dtors ${RELOCATING-0} : { *(.dtors) }
+ ${RELOCATING+PROVIDE (__DTOR_END__ = .);}
- ${RELOCATING+_FIXUP_START_ = .;}
- .fixup ${RELOCATING-0} : { *(.fixup) }
- ${RELOCATING+_FIXUP_END_ = .;}
- ${RELOCATING+_GOT2_END_ = .;}
+ ${RELOCATING+PROVIDE (_FIXUP_START_ = .);}
+ .fixup ${RELOCATING-0} : { *(.fixup) }
+ ${RELOCATING+PROVIDE (_FIXUP_END_ = .);}
+ ${RELOCATING+PROVIDE (_GOT2_END_ = .);}
+
+ ${RELOCATING+PROVIDE (_GOT_START_ = .);}
+ ${RELOCATING+PROVIDE (_GLOBAL_OFFSET_TABLE_ = .);}
+ .got ${RELOCATING-0} : { *(.got) }
+ .got.plt ${RELOCATING-0} : { *(.got.plt) }
+ ${CREATE_SHLIB+${SDATA2}}
+ ${CREATE_SHLIB+${SBSS2}}
+ ${RELOCATING+PROVIDE (_GOT_END_ = .);}
- ${RELOCATING+_GOT_START_ = .;}
- ${RELOCATING+_GLOBAL_OFFSET_TABLE_ = . + 32768;}
- ${RELOCATING+_SDA_BASE_ = . + 32768;}
- .got ${RELOCATING-0} : { *(.got.plt) *(.got) }
${DATA_PLT+${PLT}}
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
- .sdata ${RELOCATING-0} : { *(.sdata) }
+ .sdata ${RELOCATING-0} : { *(.sdata) }
${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);}
.sbss ${RELOCATING-0} :
{
- ${RELOCATING+__sbss_start = .;}
+ ${RELOCATING+PROVIDE (__sbss_start = .);}
*(.sbss)
*(.scommon)
- ${RELOCATING+__sbss_end = .;}
+ ${RELOCATING+PROVIDE (__sbss_end = .);}
}
- ${RELOCATING+_GOT_END_ = .;}
.bss ${RELOCATING-0} :
{
${RELOCATING+${OTHER_BSS_SYMBOLS}}
- ${RELOCATING+__bss_start = .;}
+ ${RELOCATING+PROVIDE (__bss_start = .);}
*(.dynbss)
*(.bss)
*(COMMON)
@@ -160,6 +173,17 @@ SECTIONS
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
+ /* DWARF debug sections.
+ Symbols in the .debug DWARF section are relative to the beginning of the
+ section so we begin .debug at 0. It's not clear yet what needs to happen
+ for the others. */
+ .debug 0 : { *(.debug) }
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ .line 0 : { *(.line) }
+
/* These must appear regardless of ${RELOCATING}. */
${OTHER_SECTIONS}
}
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/h8300.sc b/gnu/usr.bin/binutils/ld/scripttempl/h8300.sc
index ca90af7f144..f2f876e2835 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/h8300.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/h8300.sc
@@ -1,59 +1,69 @@
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
+ENTRY("_start")
-MEMORY {
- rom : o = 0x0000, l = 0x7fe0
- duart : o = 0x7fe0, l = 16
- ram : o = 0x8000, l = 28k
- topram : o = 0x8000+28k, l = 1k
- hmsram : o = 0xfb80, l = 512
- }
+MEMORY
+{
+ /* 0xc4 is a magic entry. We should have the linker just
+ skip over it one day... */
+ vectors : o = 0x0000, l = 0xc4
+ magicvectors : o = 0xc4, l = 0x3c
+ ram : o = 0x0100, l = 0xfdfc
+ /* The stack starts at the top of main ram. */
+ topram : o = 0xfefc, l = 0x4
+ /* At the very to of the address space is the 8-bit area. */
+ eight : o = 0xff00, l = 0x100
+}
SECTIONS
{
-.text :
- {
- *(.text)
- *(.strings)
- ${RELOCATING+ _etext = . ; }
+.vectors : {
+ /* Use something like this to place a specific function's address
+ into the vector table.
+
+ SHORT(ABSOLUTE(_foobar)) */
+
+ *(.vectors)
+ } ${RELOCATING+ > vectors}
+
+.text : {
+ *(.rodata)
+ *(.text)
+ *(.strings)
+ ${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > ram}
-.tors : {
+.tors : {
___ctors = . ;
*(.ctors)
___ctors_end = . ;
___dtors = . ;
*(.dtors)
___dtors_end = . ;
-} ${RELOCATING+ > ram}
-.data :
- {
+ } ${RELOCATING+ > ram}
+.data : {
*(.data)
+ *(.tiny)
${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > ram}
-.bss :
- {
+.bss : {
${RELOCATING+ _bss_start = . ;}
*(.bss)
*(COMMON)
${RELOCATING+ _end = . ; }
} ${RELOCATING+ >ram}
-.stack :
- {
+.stack : {
${RELOCATING+ _stack = . ; }
*(.stack)
} ${RELOCATING+ > topram}
- .stab 0 ${RELOCATING+(NOLOAD)} :
- {
- [ .stab ]
- }
- .stabstr 0 ${RELOCATING+(NOLOAD)} :
- {
- [ .stabstr ]
- }
+.eight : {
+ *(.eight)
+ } ${RELOCATING+ > eight}
+.stab 0 ${RELOCATING+(NOLOAD)} : {
+ [ .stab ]
+ }
+.stabstr 0 ${RELOCATING+(NOLOAD)} : {
+ [ .stabstr ]
+ }
}
EOF
-
-
-
-
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/h8300h.sc b/gnu/usr.bin/binutils/ld/scripttempl/h8300h.sc
index 3ecdce083bd..d433d682761 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/h8300h.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/h8300h.sc
@@ -1,51 +1,76 @@
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(h8300h)
+ENTRY("_start")
-MEMORY {
- rom : o = 0x0000, l = 0x7fe0
- duart : o = 0x7fe0, l = 16
- ram : o = 0x8000, l = 28k
- topram : o = 0x8000+28k, l = 1k
- hmsram : o = 0xfb80, l = 512
- }
+/* The memory size is 256KB to coincide with the simulator.
+ Don't change either without considering the other. */
+
+MEMORY
+{
+ /* 0xc4 is a magic entry. We should have the linker just
+ skip over it one day... */
+ vectors : o = 0x0000, l = 0xc4
+ magicvectors : o = 0xc4, l = 0x3c
+ /* We still only use 256k as the main ram size. */
+ ram : o = 0x0100, l = 0x3fefc
+ /* The stack starts at the top of main ram. */
+ topram : o = 0x3fffc, l = 0x4
+ /* This holds variables in the "tiny" sections. */
+ tiny : o = 0xff8000, l = 7f00
+ /* At the very top of the address space is the 8-bit area. */
+ eight : o = 0xffff00, l = 0x100
+}
SECTIONS
{
-.text :
- {
- *(.text)
- *(.strings)
- ${RELOCATING+ _etext = . ; }
+.vectors : {
+ /* Use something like this to place a specific function's address
+ into the vector table.
+
+ LONG(ABSOLUTE(_foobar)) */
+
+ *(.vectors)
+ } ${RELOCATING+ > vectors}
+.text : {
+ *(.rodata)
+ *(.text)
+ *(.strings)
+ ${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > ram}
-.tors : {
+.tors : {
___ctors = . ;
*(.ctors)
___ctors_end = . ;
___dtors = . ;
*(.dtors)
___dtors_end = . ;
-} ${RELOCATING+ > ram}
-.data :
- {
+ } ${RELOCATING+ > ram}
+.data : {
*(.data)
${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > ram}
-.bss :
- {
+.bss : {
${RELOCATING+ _bss_start = . ;}
*(.bss)
*(COMMON)
${RELOCATING+ _end = . ; }
} ${RELOCATING+ >ram}
-.stack :
- {
+.stack : {
${RELOCATING+ _stack = . ; }
*(.stack)
} ${RELOCATING+ > topram}
+.tiny : {
+ *(.tiny)
+ } ${RELOCATING+ > tiny}
+.eight : {
+ *(.eight)
+ } ${RELOCATING+ > eight}
+.stab 0 ${RELOCATING+(NOLOAD)} : {
+ [ .stab ]
+ }
+.stabstr 0 ${RELOCATING+(NOLOAD)} : {
+ [ .stabstr ]
+ }
}
EOF
-
-
-
-
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/i386msdos.sc b/gnu/usr.bin/binutils/ld/scripttempl/i386msdos.sc
index 783f2d9f913..4d312e7ff92 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/i386msdos.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/i386msdos.sc
@@ -14,12 +14,10 @@ SECTIONS
${RELOCATING+etext = .;}
${RELOCATING+_etext = .;}
${RELOCATING+__etext = .;}
- ${PAD_TEXT+${RELOCATING+. = ${DATA_ALIGNMENT};}}
}
- ${RELOCATING+. = ${DATA_ALIGNMENT};}
- .rodata ${RELOCATING-0} : { *(.rodata) }
.data :
{
+ *(.rodata)
*(.data)
${CONSTRUCTING+CONSTRUCTORS}
${RELOCATING+edata = .;}
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/m68kaux.sc b/gnu/usr.bin/binutils/ld/scripttempl/m68kaux.sc
new file mode 100644
index 00000000000..404280e1272
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/scripttempl/m68kaux.sc
@@ -0,0 +1,46 @@
+# Linker script for A/UX.
+test -z "$ENTRY" && ENTRY=_start
+INIT='.init : { *(.init) }'
+FINI='.fini : { *(.fini) }'
+CTORS='.ctors : { *(.ctors) }'
+DTORS='.dtors : { *(.dtors) }'
+
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+${LIB_SEARCH_DIRS}
+
+ENTRY(${ENTRY})
+
+SECTIONS
+{
+ .text ${RELOCATING+ $TEXT_START_ADDR} : {
+ ${RELOCATING+ *(.init)}
+ ${RELOCATING+ *(.fini)}
+ *(.text)
+ ${RELOCATING+ . = ALIGN(4);}
+ ${RELOCATING+ *(.ctors)}
+ ${RELOCATING+ *(.dtors)}
+ ${RELOCATING+ etext = .;}
+ ${RELOCATING+ _etext = .;}
+ } =0x4E714E71
+ .data ${RELOCATING+ $DATA_ALIGNMENT} : {
+ *(.data)
+ ${RELOCATING+ edata = .;}
+ ${RELOCATING+ _edata = .;}
+ }
+ .bss : {
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ end = .;}
+ ${RELOCATING+ _end = .;}
+ }
+ ${RELOCATING- ${INIT}}
+ ${RELOCATING- ${FINI}}
+ ${RELOCATING- ${CTORS}}
+ ${RELOCATING- ${DTORS}}
+
+ .comment 0 ${RELOCATING+(NOLOAD)} : { [ .comment ] [ .ident ] }
+ .stab 0 ${RELOCATING+(NOLOAD)} : { [ .stab ] }
+ .stabstr 0 ${RELOCATING+(NOLOAD)} : { [ .stabstr ] }
+}
+EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/m68kcoff.sc b/gnu/usr.bin/binutils/ld/scripttempl/m68kcoff.sc
index fa9379d81f5..9c2f5561b50 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/m68kcoff.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/m68kcoff.sc
@@ -1,19 +1,10 @@
-# This is totally made up, from the a29k stuff. If you know better,
-# tell us about it.
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
${LIB_SEARCH_DIRS}
-
-MEMORY {
- text : ORIGIN = 0x1000000, LENGTH = 0x1000000
- talias : ORIGIN = 0x2000000, LENGTH = 0x1000000
- data : ORIGIN = 0x3000000, LENGTH = 0x1000000
- mstack : ORIGIN = 0x4000000, LENGTH = 0x1000000
- rstack : ORIGIN = 0x5000000, LENGTH = 0x1000000
-}
+PROVIDE (__stack = 0);
SECTIONS
{
- .text : {
+ .text 0x1000000 : {
*(.text)
${RELOCATING+ etext = .;}
${CONSTRUCTING+ __CTOR_LIST__ = .;}
@@ -26,27 +17,18 @@ SECTIONS
${CONSTRUCTING+ *(.dtors)}
${CONSTRUCTING+ LONG(0)}
${CONSTRUCTING+ __DTOR_END__ = .;}
- *(.lit)
- *(.shdata)
- } ${RELOCATING+ > text}
- .shbss SIZEOF(.text) + ADDR(.text) : {
- *(.shbss)
- }
- .talias : { } ${RELOCATING+ > talias}
- .data : {
+ }
+ .data : {
*(.data)
${RELOCATING+ edata = .};
- } ${RELOCATING+ > data}
- .bss SIZEOF(.data) + ADDR(.data) :
- {
+ }
+ .bss : {
${RELOCATING+ __bss_start = .};
- *(.bss)
- *(COMMON)
+ *(.bss)
+ *(COMMON)
${RELOCATING+ end = ALIGN(0x8)};
${RELOCATING+ _end = ALIGN(0x8)};
- } ${RELOCATING+ > data}
- .mstack : { } ${RELOCATING+ > mstack}
- .rstack : { } ${RELOCATING+ > rstack}
+ }
.stab 0 ${RELOCATING+(NOLOAD)} :
{
[ .stab ]
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/mips.sc b/gnu/usr.bin/binutils/ld/scripttempl/mips.sc
index 41e824d9a57..d60aeedfeeb 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/mips.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/mips.sc
@@ -3,7 +3,12 @@
# These variables may be overridden by the emulation file. The
# defaults are appropriate for a DECstation running Ultrix.
test -z "$ENTRY" && ENTRY=__start
-test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000 + SIZEOF_HEADERS"
+
+if [ -z "$EMBEDDED" ]; then
+ test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000 + SIZEOF_HEADERS"
+else
+ test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000"
+fi
if test "x$LD_FLAG" = "xn" -o "x$LD_FLAG" = "xN"; then
DATA_ADDR=.
else
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/pe.sc b/gnu/usr.bin/binutils/ld/scripttempl/pe.sc
index 608cd2d8a43..ee3e0c19d05 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/pe.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/pe.sc
@@ -1,8 +1,5 @@
# Linker script for PE.
-# These are substituted in as variables in order to get '}' in a shell
-# conditional expansion.
-INIT='.init : { *(.init) }'
-FINI='.fini : { *(.fini) }'
+
cat <<EOF
OUTPUT_FORMAT(${OUTPUT_FORMAT})
${LIB_SEARCH_DIRS}
@@ -11,95 +8,89 @@ ENTRY(_mainCRTStartup)
SECTIONS
{
-
.text ${RELOCATING+ __image_base__ + __section_alignment__ } :
- {
- ${RELOCATING+ *(.init);}
- *(.text)
- ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
- LONG (-1); *(.ctors); *(.ctor); LONG (0); }
- ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
- LONG (-1); *(.dtors); *(.dtor); LONG (0); }
- ${RELOCATING+ *(.fini);}
- ${RELOCATING+ etext = .};
- }
+ {
+ ${RELOCATING+ *(.init)}
+ *(.text)
+ ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
+ LONG (-1); *(.ctors); *(.ctor); LONG (0); }
+ ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
+ LONG (-1); *(.dtors); *(.dtor); LONG (0); }
+ ${RELOCATING+ *(.fini)}
+ /* ??? Why is .gcc_exc here? */
+ ${RELOCATING+ *(.gcc_exc)}
+ ${RELOCATING+ etext = .;}
+ /* Grouped section support currently must be explicitly provided for
+ in the linker script. */
+ *(.text\$)
+ }
.bss BLOCK(__section_alignment__) :
- {
- __bss_start__ = . ;
- *(.bss) ;
- *(COMMON);
- __bss_end__ = . ;
- ${RELOCATING+ end = .};
- }
+ {
+ __bss_start__ = . ;
+ *(.bss)
+ *(COMMON)
+ __bss_end__ = . ;
+ }
.data BLOCK(__section_alignment__) :
- {
- __data_start__ = . ;
- *(.data);
- *(.data2);
- __data_end__ = . ;
- }
+ {
+ __data_start__ = . ;
+ *(.data)
+ *(.data2)
+ __data_end__ = . ;
+ /* Grouped section support currently must be explicitly provided for
+ in the linker script. */
+ *(.data\$)
+ }
.rdata BLOCK(__section_alignment__) :
- {
+ {
*(.rdata)
- ;
+ /* Grouped section support currently must be explicitly provided for
+ in the linker script. */
+ *(.rdata\$)
}
-
-
- .edata BLOCK(__section_alignment__) : {
- *(.edata) ;
+ .edata BLOCK(__section_alignment__) :
+ {
+ *(.edata)
}
- .junk BLOCK(__section_alignment__) : {
+ /DISCARD/ BLOCK(__section_alignment__) :
+ {
*(.debug\$S)
*(.debug\$T)
*(.debug\$F)
*(.drectve)
- ;
}
.idata BLOCK(__section_alignment__) :
- {
+ {
+ /* This cannot currently be handled with grouped sections.
+ See pe.em:sort_sections. */
*(.idata\$2)
*(.idata\$3)
*(.idata\$4)
*(.idata\$5)
*(.idata\$6)
*(.idata\$7)
- ;
}
.CRT BLOCK(__section_alignment__) :
{
- *(.CRT\$XCA)
- *(.CRT\$XCC)
- *(.CRT\$XCZ)
- *(.CRT\$XIA)
- *(.CRT\$XIC)
- *(.CRT\$XIZ)
- *(.CRT\$XLA)
- *(.CRT\$XLZ)
- *(.CRT\$XPA)
- *(.CRT\$XPX)
- *(.CRT\$XPZ)
- *(.CRT\$XTA)
- *(.CRT\$XTZ)
- ;
+ /* Grouped sections are used to handle .CRT\$foo. */
+ *(.CRT\$)
}
.rsrc BLOCK(__section_alignment__) :
{
- *(.rsrc\$01)
- *(.rsrc\$02)
- ;
+ /* Grouped sections are used to handle .rsrc\$0[12]. */
+ *(.rsrc\$)
}
- .junk BLOCK(__section_alignment__) :
- {
- *(.debug\$S)
- *(.debug\$T)
- *(.debug\$F)
- *(.drectve)
- ;
+
+ .endjunk BLOCK(__section_alignment__) :
+ {
+ /* end is deprecated, don't use it */
+ ${RELOCATING+ end = .;}
+ ${RELOCATING+ __end__ = .;}
}
.stab BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
@@ -112,13 +103,9 @@ SECTIONS
[ .stabstr ]
}
-
.reloc BLOCK(__section_alignment__) :
{
*(.reloc)
- ;
}
-
-
}
EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/ppcpe.sc b/gnu/usr.bin/binutils/ld/scripttempl/ppcpe.sc
index bfeca163eaa..12bd9d8cc51 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/ppcpe.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/ppcpe.sc
@@ -68,6 +68,10 @@ SECTIONS
*(.CRT\$XTZ);
*(.rdata);
*(.xdata);
+ }
+
+ .edata BLOCK(__section_alignment__) :
+ {
*(.edata);
}
@@ -129,6 +133,7 @@ SECTIONS
*(.idata\$3);
__idata4_magic__ = .;
*(.idata\$4);
+ . = ALIGN(4);
.toc = . + 32768;
*(.private.toc);
__idata5_magic__ = .;
@@ -148,17 +153,6 @@ SECTIONS
;
}
- /* We don't do anything useful with codeview debugger support or the
- directive section (yet). Hopefully, we junk them correctly.
- */
- .junk BLOCK(__section_alignment__) :
- {
- *(.debug\$S)
- *(.debug\$T)
- *(.debug\$F)
- *(.drectve)
- ;
- }
/* Resources */
.rsrc BLOCK(__section_alignment__) :
@@ -168,6 +162,16 @@ SECTIONS
;
}
+ .stab BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
+ }
+
+ .stabstr BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
+ }
+
/* The .reloc section is currently generated by the dlltool from Steve
Chamberlain in a second pass of linking. Section address and extent
are placed in the DataDirectory.
@@ -178,14 +182,16 @@ SECTIONS
;
}
- .stab BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
+ /* We don't do anything useful with codeview debugger support or the
+ directive section (yet). Hopefully, we junk them correctly.
+ */
+ /DISCARD/ BLOCK(__section_alignment__) :
{
- [ .stab ]
- }
-
- .stabstr BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
- {
- [ .stabstr ]
- }
+ *(.debug\$S)
+ *(.debug\$T)
+ *(.debug\$F)
+ *(.drectve)
+ ;
+ }
}
EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/psos.sc b/gnu/usr.bin/binutils/ld/scripttempl/psos.sc
new file mode 100644
index 00000000000..ab8c6c7e3c8
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/scripttempl/psos.sc
@@ -0,0 +1,61 @@
+cat <<EOF
+OUTPUT_FORMAT(${OUTPUT_FORMAT})
+OUTPUT_ARCH(${ARCH})
+${RELOCATING+${LIB_SEARCH_DIRS}}
+
+SECTIONS
+{
+ .text ${RELOCATING:-0} ${RELOCATING+${TEXT_START_ADDR}} : {
+ ${RELOCATING+ start = DEFINED(_START) ? _START : DEFINED(_start) ? _start : .;}
+ ${RELOCATING+ PROVIDE(__text = .);}
+ *(.text);
+ *(code);
+ *(const);
+ *(strings);
+ *(pSOS);
+ *(pROBE);
+ *(pNA);
+ *(pHILE);
+ *(pREPC);
+ *(pRPC);
+ ${CONSTRUCTING+ ___CTOR_LIST__ = .;}
+ ${CONSTRUCTING+ LONG((___CTOR_END__ - ___CTOR_LIST__) / 4 - 2)}
+ ${CONSTRUCTING+ *(.ctors)}
+ ${CONSTRUCTING+ LONG(0);}
+ ${CONSTRUCTING+ ___CTOR_END__ = .;}
+ ${CONSTRUCTING+ ___DTOR_LIST__ = .;}
+ ${CONSTRUCTING+ LONG((___DTOR_END__ - ___DTOR_LIST__) / 4 - 2);}
+ ${CONSTRUCTING+ *(.dtors);}
+ ${CONSTRUCTING+ LONG(0);}
+ ${CONSTRUCTING+ ___DTOR_END__ = .;}
+ ${RELOCATING+ PROVIDE(__etext = .);}
+ ${RELOCATING+ PROVIDE(_etext = .);}
+ }
+ .data ${RELOCATING:-0} : ${RELOCATING+ AT(ADDR(.text) + SIZEOF(.text))} {
+ ${RELOCATING+ PROVIDE(__data = .);}
+ *(.data);
+ *(vars);
+ ${RELOCATING+ PROVIDE(__edata = .);}
+ ${RELOCATING+ PROVIDE(_edata = .);}
+ }
+ .bss ${RELOCATING:-0} :
+ {
+ ${RELOCATING+ PROVIDE(__bss = .);}
+ *(.bss);
+ *(zerovars);
+ *(COMMON);
+ ${RELOCATING+ PROVIDE(__ebss = .);}
+ ${RELOCATING+ PROVIDE(__end = .);}
+ ${RELOCATING+ PROVIDE(_end = .);}
+ ${RELOCATING+ PROVIDE(_FreeMemStart = .);}
+ }
+ .stab 0 ${RELOCATING+(NOLOAD)} :
+ {
+ *(.stab);
+ }
+ .stabstr 0 ${RELOCATING+(NOLOAD)} :
+ {
+ *(.stabstr);
+ }
+}
+EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/sh.sc b/gnu/usr.bin/binutils/ld/scripttempl/sh.sc
index 45bd83b431e..036dd216db2 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/sh.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/sh.sc
@@ -1,3 +1,13 @@
+TORS=".tors :
+ {
+ ___ctors = . ;
+ *(.ctors)
+ ___ctors_end = . ;
+ ___dtors = . ;
+ *(.dtors)
+ ___dtors_end = . ;
+ } > ram"
+
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
@@ -15,15 +25,7 @@ SECTIONS
*(.strings)
${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > ram}
- .tors :
- {
- ___ctors = . ;
- *(.ctors)
- ___ctors_end = . ;
- ___dtors = . ;
- *(.dtors)
- ___dtors_end = . ;
- } ${RELOCATING+ > ram}
+ ${CONSTRUCTING+${TORS}}
.data :
{
*(.data)
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ChangeLog b/gnu/usr.bin/binutils/ld/testsuite/ChangeLog
index 38369ce4ef8..4f573a3f23a 100644
--- a/gnu/usr.bin/binutils/ld/testsuite/ChangeLog
+++ b/gnu/usr.bin/binutils/ld/testsuite/ChangeLog
@@ -1,3 +1,86 @@
+Wed May 1 16:45:13 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-sh/sh.exp: Use -O when compiling with -mrelax.
+
+Mon Apr 29 10:33:10 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * ld-shared/shared.exp: Run the shared library tests on
+ Linux/m68k.
+
+Fri Apr 5 16:20:55 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-shared/shared.exp: Run the shared library tests on Linux.
+
+Mon Feb 26 12:45:26 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-shared/shared.exp: Don't use -fpic on MIPS targets.
+
+Wed Jan 31 15:09:57 1996 Jeffrey A Law (law@cygnus.com)
+
+ * ld-srec/srec.exp: Add xfails for hppa*-*-*elf*.
+ * ld-undefined/undefined.exp: Likewise.
+
+Fri Jan 26 18:43:03 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-undefined/undefined.exp: ELF targets should now pass the
+ undefined line test.
+
+Thu Jan 25 15:36:13 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-empic/empic.exp: Update for change to MIPS disassembler.
+
+Mon Jan 15 15:05:53 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-bootstrap/bootstrap.exp: Expect failure for mips*-*-irix5*
+ when doing the --static test.
+ * ld-shared/shared.exp: Run tests on mips*-*-irix5*.
+
+Fri Dec 29 12:33:09 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-bootstrap/bootstrap.exp: On AIX, don't pass the -bI option
+ when creating ld-partial.o.
+
+Tue Dec 26 17:37:23 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-srec/srec.exp: If powerpc*-*-eabi*, use --defsym to define
+ __eabi.
+
+Tue Dec 19 18:01:01 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-srec/srec.exp: Add setup_xfails for XCOFF targets.
+
+Fri Dec 15 16:36:17 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-srec/srec.exp: On a29k targets, use --defsym to define
+ V_SPILL and V_FILL.
+ * ld-srec/sr1.c (V_SPILL, V_FILL): Remove definitions.
+ * ld-srec/sr3.cc: Likewise.
+
+ * ld-srec/srec.exp: Remove i960 COFF setup_xfail.
+
+Sat Dec 2 01:20:31 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-srec/srec.exp: Don't use [] in setup_xfail expressions.
+
+Fri Dec 1 13:18:18 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-srec/srec.exp: Add setup_xfails for MIPS ELF targets.
+
+Wed Nov 29 13:01:10 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-srec/srec.exp: Add setup_xfail for i960 COFF targets.
+
+Mon Nov 27 14:36:11 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-srec/srec.exp: Add setup_xfail calls for i[345]86-*-aout*.
+
+ * ld-srec/sr1.c (V_SPILL, V_FILL): Define.
+ * ld-srec/sr3.cc: Likewise.
+
+Tue Nov 21 16:05:53 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld-empic/empic.exp: Update for changes in objdump output.
+
Wed Nov 15 17:42:48 1995 Ian Lance Taylor <ian@cygnus.com>
* ld-srec/srec.exp: New tests.
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-bootstrap/bootstrap.exp b/gnu/usr.bin/binutils/ld/testsuite/ld-bootstrap/bootstrap.exp
index d79891df4cd..00331e3ae6a 100644
--- a/gnu/usr.bin/binutils/ld/testsuite/ld-bootstrap/bootstrap.exp
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-bootstrap/bootstrap.exp
@@ -1,5 +1,5 @@
# Expect script for LD Bootstrap Tests
-# Copyright (C) 1993,1994,1995 Free Software Foundation
+# Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation
#
# 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
@@ -38,13 +38,6 @@ foreach flags {"" "--static" "--traditional-format" "--no-keep-memory"} {
set testname "bootstrap"
}
- # On AIX, you need to specify an import list when using --static.
- if [istarget "*-*-aix*"] {
- if {"$flags" == "--static"} {
- set flags "--static -bI:/lib/syscalls.exp"
- }
- }
-
# This test can only be run if we have the ld build directory,
# since we need the object files.
if {$ld != "$objdir/ld.new"} {
@@ -57,6 +50,21 @@ foreach flags {"" "--static" "--traditional-format" "--no-keep-memory"} {
continue
}
+ # On AIX, you need to specify an import list when using --static.
+ # You only want the import list when creating the final
+ # executable.
+ if [istarget "*-*-aix*"] {
+ if {"$flags" == "--static"} {
+ set flags "--static -bI:/lib/syscalls.exp"
+ }
+ }
+
+ # On Irix 5, linking with --static only works if all the files are
+ # compiled using -non_shared.
+ if {"$flags" == "--static"} {
+ setup_xfail "mips*-*-irix5*"
+ }
+
if ![ld_link $ld tmpdir/ld1 "$flags tmpdir/ld-partial.o $BFDLIB $LIBIBERTY"] {
fail $testname
continue
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-empic/empic.exp b/gnu/usr.bin/binutils/ld/testsuite/ld-empic/empic.exp
index 937f01aac8f..97cb72ff59b 100644
--- a/gnu/usr.bin/binutils/ld/testsuite/ld-empic/empic.exp
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-empic/empic.exp
@@ -99,6 +99,7 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r
# This is a straight function call. All function calls in
# this example are to either foo or bar.
if "0x$dest != $nm_output(foo) && 0x$dest != $nm_output(bar)" {
+ send_log "fail 1\n"
send_log "$line\n"
fail $testname
return
@@ -109,6 +110,7 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r
# Otherwise, it should be lui, and the next instruction
# should be an addiu, followed by an addu to $31.
if { [gets $file l] == -1 } {
+ send_log "fail 2\n"
send_log "$line\n"
fail $testname
return
@@ -118,7 +120,8 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r
if [string match "*sll*" $l] {
continue
}
- if ![regexp "lui (\[\$a-z0-9\]+),(\[0-9\]+)" $l whole reg upper] {
+ if ![regexp "lui (\[\$a-z0-9\]+),(\[0-9a-fA-Fx\]+)" $l whole reg upper] {
+ send_log "fail 3\n"
send_log "$line\n"
send_log "$l\n"
fail $testname
@@ -126,12 +129,14 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r
}
if { [gets $file l] == -1 } {
+ send_log "fail 4\n"
send_log "$line\n"
fail $testname
return
}
verbose "$l"
if ![regexp "addiu \\$reg,\\$reg,(\[-0-9\]+)" $l whole lower] {
+ send_log "fail 5\n"
send_log "$line\n"
send_log "$l\n"
send_log "addiu \\$reg,\\$reg,(\[-0-9\]+)\n"
@@ -140,12 +145,14 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r
}
if { [gets $file l] == -1 } {
+ send_log "fail 6\n"
send_log "$line\n"
fail $testname
return
}
verbose "$l"
if ![regexp "addu \\$reg,\\$reg,\\\$ra" $l] {
+ send_log "fail 7\n"
send_log "$line\n"
send_log "$l\n"
fail $testname
@@ -157,26 +164,34 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r
# function, and the next line can be anything.
if { [gets $file l] == -1 } {
+ send_log "fail 8\n"
send_log "$line\n"
fail $testname
return
}
-
+ verbose "$l"
if [string match "*jalr*" $l] {
set dest [expr 0x$addr + 8 + ($upper << 16) + $lower]
if { $dest != $nm_output(foo) && $dest != $nm_output(bar) } {
+ send_log "fail 9\n"
send_log "$line\n"
fail $testname
return
}
} else {
set dest [expr ($upper << 16) + $lower]
- if ![regexp "<\[a-z\]+\\+(\[0-9a-fA-F\]+)>" $label whole offset] {
+ if ![regexp "<(\[.a-z\]+)\\+(\[0-9a-fA-F\]+)>" $label whole base offset] {
+ send_log "fail 10\n"
send_log "$line\n"
fail $testname
return
}
- if "0x$offset + 8 != - $dest" {
+ set offset 0x$offset
+ if { $base == ".foo" } {
+ set offset [expr $offset - ($nm_output(foo) - 0x30)]
+ }
+ if { $offset + 8 != - $dest } {
+ send_log "fail 11\n"
send_log "$line\n"
fail $testname
return
@@ -188,6 +203,7 @@ if ![ld_simple_link $ld tmpdir/relax "--relax -T $srcdir$subdir/relax.t tmpdir/r
close $file
if {$balcnt < 10} {
+ send_log "fail 12\n"
fail $testname
} else {
verbose "$balcnt bal instructions"
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-sh/sh.exp b/gnu/usr.bin/binutils/ld/testsuite/ld-sh/sh.exp
index 3bd2a654e7a..36e12cc1c0a 100644
--- a/gnu/usr.bin/binutils/ld/testsuite/ld-sh/sh.exp
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-sh/sh.exp
@@ -103,7 +103,7 @@ if { [which $CC] == 0 } {
}
if {![ld_assemble $as "-relax $srcdir$subdir/start.s" tmpdir/start.o] \
- || ![ld_compile $CC "-mrelax $srcdir$subdir/sh2.c" tmpdir/sh2.o]} {
+ || ![ld_compile $CC "-O -mrelax $srcdir$subdir/sh2.c" tmpdir/sh2.o]} {
unresolved $testlink
unresolved $testjsr
unresolved $testrun
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-shared/shared.exp b/gnu/usr.bin/binutils/ld/testsuite/ld-shared/shared.exp
index 3ad71385919..f6578998c20 100644
--- a/gnu/usr.bin/binutils/ld/testsuite/ld-shared/shared.exp
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-shared/shared.exp
@@ -1,5 +1,5 @@
# Expect script for ld-shared tests
-# Copyright (C) 1994,1995 Free Software Foundation
+# Copyright (C) 1994, 1995, 1996 Free Software Foundation
#
# 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
@@ -36,6 +36,11 @@ if { ![istarget i386-*-sysv4*] \
&& ![istarget i386-*-elf*] \
&& ![istarget i486-*-elf*] \
&& ![istarget i586-*-elf*] \
+ && ![istarget i386-*-linux*] \
+ && ![istarget i486-*-linux*] \
+ && ![istarget i586-*-linux*] \
+ && ![istarget m68k-*-linux*] \
+ && ![istarget mips*-*-irix5*] \
&& ![istarget sparc*-*-elf] \
&& ![istarget sparc*-*-solaris2*] \
&& ![istarget sparc*-*-sunos4*] \
@@ -44,6 +49,16 @@ if { ![istarget i386-*-sysv4*] \
return
}
+if { [istarget i386-*-linuxaout*] \
+ || [istarget i486-*-linuxaout*] \
+ || [istarget i586-*-linuxaout*] \
+ || [istarget i386-*-linuxoldld*] \
+ || [istarget i486-*-linuxoldld*] \
+ || [istarget i586-*-linuxoldld*] \
+ || [istarget m68k-*-linuxaout*] } {
+ return
+}
+
set tmpdir tmpdir
set SHCFLAG ""
@@ -136,23 +151,26 @@ proc shared_test { progname testname main sh1 sh2 dat } {
pass "$testname"
}
-# Unfortunately, the gcc argument is -fpic and the cc argument is
-# -KPIC. We have to try both.
-
-set picflag "-fpic"
-send_log "$CC $picflag\n"
-verbose "$CC $picflag"
-catch "exec $CC $picflag" exec_output
-send_log "$exec_output\n"
-verbose "--" "$exec_output"
-if { [string match "*illegal option*" $exec_output] \
- || [string match "*option ignored*" $exec_output] \
- || [string match "*unrecognized option*" $exec_output] \
- || [string match "*passed to ld*" $exec_output] } {
- if [istarget *-*-sunos4*] {
- set picflag "-pic"
- } else {
- set picflag "-KPIC"
+if [istarget mips*-*-*] {
+ set picflag ""
+} else {
+ # Unfortunately, the gcc argument is -fpic and the cc argument is
+ # -KPIC. We have to try both.
+ set picflag "-fpic"
+ send_log "$CC $picflag\n"
+ verbose "$CC $picflag"
+ catch "exec $CC $picflag" exec_output
+ send_log "$exec_output\n"
+ verbose "--" "$exec_output"
+ if { [string match "*illegal option*" $exec_output] \
+ || [string match "*option ignored*" $exec_output] \
+ || [string match "*unrecognized option*" $exec_output] \
+ || [string match "*passed to ld*" $exec_output] } {
+ if [istarget *-*-sunos4*] {
+ set picflag "-pic"
+ } else {
+ set picflag "-KPIC"
+ }
}
}
verbose "Using $picflag to compile PIC code"
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-srec/srec.exp b/gnu/usr.bin/binutils/ld/testsuite/ld-srec/srec.exp
index 5dfbc0c29ad..f5246f096ef 100644
--- a/gnu/usr.bin/binutils/ld/testsuite/ld-srec/srec.exp
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-srec/srec.exp
@@ -210,19 +210,32 @@ proc run_srec_test { test objs } {
global sizeof_headers
global host_triplet
+ set flags ""
+
# If the linker script uses SIZEOF_HEADERS, use a -Ttext argument
# to force both the normal link and the S-record link to be put in
# the same place. We don't always use -Ttext because it interacts
# poorly with a.out.
if { $sizeof_headers } {
- set targ "-Ttext 0x1000"
- } else {
- set targ ""
+ set flags "$flags -Ttext 0x1000"
+ }
+
+ # The a29k compiled code calls V_SPILL and V_FILL. Since we don't
+ # need to run this code, but we don't have definitions for those
+ # functions, we just define them out.
+ if [istarget a29k*-*-*] {
+ set flags "$flags --defsym V_SPILL=0 --defsym V_FILL=0"
+ }
+
+ # PowerPC EABI code calls __eabi.
+ if [istarget powerpc*-*-eabi*] {
+ set flags "$flags --defsym __eabi=0"
}
- if { ![ld_simple_link $ld tmpdir/sr1 "$targ $objs"] \
- || ![ld_simple_link $ld tmpdir/sr2.sr "$targ -oformat srec $objs"] } {
+ if { ![ld_simple_link $ld tmpdir/sr1 "$flags $objs"] \
+ || ![ld_simple_link $ld tmpdir/sr2.sr "$flags -oformat srec $objs"] } {
+ setup_xfail "hppa*-*-*elf*"
fail $test
return
}
@@ -274,6 +287,19 @@ if { ![ld_compile $CC $srcdir/$subdir/sr1.c tmpdir/sr1.o] \
return
}
+# The i386-aout target is confused: the linker does not put the
+# sections where objdump finds them. I don't know which is wrong.
+setup_xfail "i*86-*-aout*"
+
+# These tests fail on the MIPS ELF target because the GP value in the
+# .reginfo section is not updated when the S-record version is written
+# out.
+setup_xfail "mips*-*-elf*" "mips*-*-irix5*" "mips*-*-irix6*"
+
+# The S-record linker doesn't do the magic TOC handling that XCOFF
+# linkers do.
+setup_xfail "*-*-aix*" "*-*-xcoff*"
+
run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o"
# Now try linking a C++ program with global constructors and
@@ -290,4 +316,9 @@ if ![ld_compile "$CXX $CXXFLAGS -fgnu-linker" $srcdir/$subdir/sr3.cc tmpdir/sr3.
return
}
+# See above.
+setup_xfail "i*86-*-aout*"
+setup_xfail "mips*-*-elf*" "mips*-*-irix5*" "mips*-*-irix6*"
+setup_xfail "*-*-aix*" "*-*-xcoff*"
+
run_srec_test $test2 "tmpdir/sr3.o"
diff --git a/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/undefined.exp b/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/undefined.exp
index 2e426dd2ed1..208d679f6c1 100644
--- a/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/undefined.exp
+++ b/gnu/usr.bin/binutils/ld/testsuite/ld-undefined/undefined.exp
@@ -63,16 +63,12 @@ checkund $mu $testund
# a COFF file.
setup_xfail "arm*-*-pe*"
+# Just doesn't work for PA ELF. No clue why.
+setup_xfail "hppa*-*-*elf*"
+
set mf "tmpdir/undefined.o: In function `function':"
checkund $mf $testfn
-# ELF targets currently can not get line number information (except
-# for MIPS ELF).
-setup_xfail "*-*-elf*" "*-*-sysv4*" "*-*-unixware*" "*-*-solaris*" "*-*-gnu*"
-setup_xfail "hppa*-*-lites*" "m88*-harris-cxux*" "m88*-*-dgux*"
-setup_xfail "powerpc*-*-eabi*" "*-stratus-*" "*-cbm-*" "*-ncr-*"
-clear_xfail "mips*-*-elf*" "mips*-*-sysv4*" "mips*-*-gnu*"
-
# COFF SH gets this test wrong--it reports line 10, because although
# the jump is at line 9, the function address, and the reloc, is
# stored at the end of the function.
@@ -82,5 +78,8 @@ setup_xfail "sh-*-*"
# a COFF file.
setup_xfail "arm*-*-pe*"
+# Just doesn't work for PA ELF. No clue why.
+setup_xfail "hppa*-*-*elf*"
+
set ml "undefined.c:9: undefined reference to `this_function_is_not_defined'"
checkund $ml $testline
diff --git a/gnu/usr.bin/binutils/move-if-change b/gnu/usr.bin/binutils/move-if-change
index ee9e355e3e6..565825f35bc 100644
--- a/gnu/usr.bin/binutils/move-if-change
+++ b/gnu/usr.bin/binutils/move-if-change
@@ -1,4 +1,21 @@
#!/bin/sh
+
+# Copyright (C) 1996 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
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
if
test -r $2
then