summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'binutils-2.25/bfd')
-rw-r--r--binutils-2.25/bfd/ChangeLog4594
-rw-r--r--binutils-2.25/bfd/ChangeLog-02032
-rw-r--r--binutils-2.25/bfd/ChangeLog-20133239
-rw-r--r--binutils-2.25/bfd/ChangeLog-94952
-rw-r--r--binutils-2.25/bfd/ChangeLog-96972
-rw-r--r--binutils-2.25/bfd/ChangeLog-98992
-rw-r--r--binutils-2.25/bfd/MAINTAINERS2
-rw-r--r--binutils-2.25/bfd/Makefile.am39
-rw-r--r--binutils-2.25/bfd/Makefile.in50
-rw-r--r--binutils-2.25/bfd/PORTING6
-rw-r--r--binutils-2.25/bfd/README2
-rw-r--r--binutils-2.25/bfd/TODO2
-rw-r--r--binutils-2.25/bfd/acinclude.m42
-rw-r--r--binutils-2.25/bfd/aix386-core.c6
-rw-r--r--binutils-2.25/bfd/aix5ppc-core.c3
-rw-r--r--binutils-2.25/bfd/aout-adobe.c18
-rw-r--r--binutils-2.25/bfd/aout-arm.c19
-rw-r--r--binutils-2.25/bfd/aout-cris.c3
-rw-r--r--binutils-2.25/bfd/aout-ns32k.c5
-rw-r--r--binutils-2.25/bfd/aout-sparcle.c4
-rw-r--r--binutils-2.25/bfd/aout-target.h10
-rw-r--r--binutils-2.25/bfd/aout-tic30.c10
-rw-r--r--binutils-2.25/bfd/aout0.c5
-rw-r--r--binutils-2.25/bfd/aout32.c3
-rw-r--r--binutils-2.25/bfd/aout64.c3
-rw-r--r--binutils-2.25/bfd/aoutf1.h4
-rw-r--r--binutils-2.25/bfd/aoutx.h55
-rw-r--r--binutils-2.25/bfd/archive.c17
-rw-r--r--binutils-2.25/bfd/archive64.c2
-rw-r--r--binutils-2.25/bfd/archures.c36
-rw-r--r--binutils-2.25/bfd/armnetbsd.c5
-rw-r--r--binutils-2.25/bfd/bfd-in.h49
-rw-r--r--binutils-2.25/bfd/bfd-in2.h530
-rw-r--r--binutils-2.25/bfd/bfd.c146
-rw-r--r--binutils-2.25/bfd/bfd.m42
-rw-r--r--binutils-2.25/bfd/bfdio.c2
-rw-r--r--binutils-2.25/bfd/bfdwin.c3
-rw-r--r--binutils-2.25/bfd/binary.c5
-rw-r--r--binutils-2.25/bfd/bout.c16
-rw-r--r--binutils-2.25/bfd/cache.c9
-rw-r--r--binutils-2.25/bfd/cf-i386lynx.c5
-rw-r--r--binutils-2.25/bfd/cf-sparclynx.c4
-rw-r--r--binutils-2.25/bfd/cisco-core.c14
-rw-r--r--binutils-2.25/bfd/coff-alpha.c8
-rw-r--r--binutils-2.25/bfd/coff-apollo.c5
-rw-r--r--binutils-2.25/bfd/coff-arm.c8
-rw-r--r--binutils-2.25/bfd/coff-aux.c67
-rw-r--r--binutils-2.25/bfd/coff-go32.c5
-rw-r--r--binutils-2.25/bfd/coff-h8300.c6
-rw-r--r--binutils-2.25/bfd/coff-h8500.c5
-rw-r--r--binutils-2.25/bfd/coff-i386.c26
-rw-r--r--binutils-2.25/bfd/coff-i860.c5
-rw-r--r--binutils-2.25/bfd/coff-i960.c12
-rw-r--r--binutils-2.25/bfd/coff-ia64.c3
-rw-r--r--binutils-2.25/bfd/coff-m68k.c8
-rw-r--r--binutils-2.25/bfd/coff-m88k.c5
-rw-r--r--binutils-2.25/bfd/coff-mcore.c3
-rw-r--r--binutils-2.25/bfd/coff-mips.c18
-rw-r--r--binutils-2.25/bfd/coff-or32.c629
-rw-r--r--binutils-2.25/bfd/coff-ppc.c25
-rw-r--r--binutils-2.25/bfd/coff-rs6000.c326
-rw-r--r--binutils-2.25/bfd/coff-sh.c19
-rw-r--r--binutils-2.25/bfd/coff-sparc.c5
-rw-r--r--binutils-2.25/bfd/coff-stgo32.c5
-rw-r--r--binutils-2.25/bfd/coff-svm68k.c4
-rw-r--r--binutils-2.25/bfd/coff-tic30.c3
-rw-r--r--binutils-2.25/bfd/coff-tic4x.c15
-rw-r--r--binutils-2.25/bfd/coff-tic54x.c3
-rw-r--r--binutils-2.25/bfd/coff-tic80.c5
-rw-r--r--binutils-2.25/bfd/coff-u68k.c4
-rw-r--r--binutils-2.25/bfd/coff-w65.c5
-rw-r--r--binutils-2.25/bfd/coff-we32k.c5
-rw-r--r--binutils-2.25/bfd/coff-x86_64.c19
-rw-r--r--binutils-2.25/bfd/coff-z80.c4
-rw-r--r--binutils-2.25/bfd/coff-z8k.c5
-rw-r--r--binutils-2.25/bfd/coff64-rs6000.c19
-rw-r--r--binutils-2.25/bfd/coffcode.h468
-rw-r--r--binutils-2.25/bfd/coffgen.c213
-rw-r--r--binutils-2.25/bfd/cofflink.c133
-rw-r--r--binutils-2.25/bfd/coffswap.h4
-rw-r--r--binutils-2.25/bfd/compress.c13
-rw-r--r--binutils-2.25/bfd/config.bfd1190
-rw-r--r--binutils-2.25/bfd/config.in9
-rwxr-xr-xbinutils-2.25/bfd/configure848
-rw-r--r--binutils-2.25/bfd/configure.ac (renamed from binutils-2.25/bfd/configure.in)700
-rw-r--r--binutils-2.25/bfd/configure.com6
-rw-r--r--binutils-2.25/bfd/configure.host4
-rw-r--r--binutils-2.25/bfd/corefile.c3
-rw-r--r--binutils-2.25/bfd/cpu-aarch64.c2
-rw-r--r--binutils-2.25/bfd/cpu-alpha.c3
-rw-r--r--binutils-2.25/bfd/cpu-arc.c3
-rw-r--r--binutils-2.25/bfd/cpu-arm.c3
-rw-r--r--binutils-2.25/bfd/cpu-avr.c46
-rw-r--r--binutils-2.25/bfd/cpu-bfin.c2
-rw-r--r--binutils-2.25/bfd/cpu-cr16.c2
-rw-r--r--binutils-2.25/bfd/cpu-cr16c.c2
-rw-r--r--binutils-2.25/bfd/cpu-cris.c3
-rw-r--r--binutils-2.25/bfd/cpu-crx.c2
-rw-r--r--binutils-2.25/bfd/cpu-d10v.c3
-rw-r--r--binutils-2.25/bfd/cpu-d30v.c2
-rw-r--r--binutils-2.25/bfd/cpu-dlx.c2
-rw-r--r--binutils-2.25/bfd/cpu-epiphany.c2
-rw-r--r--binutils-2.25/bfd/cpu-fr30.c2
-rw-r--r--binutils-2.25/bfd/cpu-frv.c2
-rw-r--r--binutils-2.25/bfd/cpu-h8300.c3
-rw-r--r--binutils-2.25/bfd/cpu-h8500.c3
-rw-r--r--binutils-2.25/bfd/cpu-hppa.c3
-rw-r--r--binutils-2.25/bfd/cpu-i370.c3
-rw-r--r--binutils-2.25/bfd/cpu-i386.c4
-rw-r--r--binutils-2.25/bfd/cpu-i860.c3
-rw-r--r--binutils-2.25/bfd/cpu-i960.c3
-rw-r--r--binutils-2.25/bfd/cpu-ia64-opc.c3
-rw-r--r--binutils-2.25/bfd/cpu-ia64.c2
-rw-r--r--binutils-2.25/bfd/cpu-ip2k.c2
-rw-r--r--binutils-2.25/bfd/cpu-iq2000.c2
-rw-r--r--binutils-2.25/bfd/cpu-k1om.c3
-rw-r--r--binutils-2.25/bfd/cpu-l1om.c3
-rw-r--r--binutils-2.25/bfd/cpu-lm32.c2
-rw-r--r--binutils-2.25/bfd/cpu-m10200.c2
-rw-r--r--binutils-2.25/bfd/cpu-m10300.c3
-rw-r--r--binutils-2.25/bfd/cpu-m32c.c2
-rw-r--r--binutils-2.25/bfd/cpu-m32r.c3
-rw-r--r--binutils-2.25/bfd/cpu-m68hc11.c2
-rw-r--r--binutils-2.25/bfd/cpu-m68hc12.c2
-rw-r--r--binutils-2.25/bfd/cpu-m68k.c3
-rw-r--r--binutils-2.25/bfd/cpu-m88k.c3
-rw-r--r--binutils-2.25/bfd/cpu-m9s12x.c2
-rw-r--r--binutils-2.25/bfd/cpu-m9s12xg.c2
-rw-r--r--binutils-2.25/bfd/cpu-mcore.c2
-rw-r--r--binutils-2.25/bfd/cpu-mep.c2
-rw-r--r--binutils-2.25/bfd/cpu-metag.c2
-rw-r--r--binutils-2.25/bfd/cpu-microblaze.c2
-rw-r--r--binutils-2.25/bfd/cpu-mips.c16
-rw-r--r--binutils-2.25/bfd/cpu-mmix.c2
-rw-r--r--binutils-2.25/bfd/cpu-moxie.c2
-rw-r--r--binutils-2.25/bfd/cpu-msp430.c2
-rw-r--r--binutils-2.25/bfd/cpu-mt.c2
-rw-r--r--binutils-2.25/bfd/cpu-nds32.c45
-rw-r--r--binutils-2.25/bfd/cpu-nios2.c2
-rw-r--r--binutils-2.25/bfd/cpu-ns32k.c3
-rw-r--r--binutils-2.25/bfd/cpu-openrisc.c44
-rw-r--r--binutils-2.25/bfd/cpu-or1k.c59
-rw-r--r--binutils-2.25/bfd/cpu-pdp11.c2
-rw-r--r--binutils-2.25/bfd/cpu-pj.c3
-rw-r--r--binutils-2.25/bfd/cpu-plugin.c3
-rw-r--r--binutils-2.25/bfd/cpu-powerpc.c3
-rw-r--r--binutils-2.25/bfd/cpu-rl78.c2
-rw-r--r--binutils-2.25/bfd/cpu-rs6000.c3
-rw-r--r--binutils-2.25/bfd/cpu-rx.c2
-rw-r--r--binutils-2.25/bfd/cpu-s390.c2
-rw-r--r--binutils-2.25/bfd/cpu-score.c2
-rw-r--r--binutils-2.25/bfd/cpu-sh.c3
-rw-r--r--binutils-2.25/bfd/cpu-sparc.c3
-rw-r--r--binutils-2.25/bfd/cpu-spu.c2
-rw-r--r--binutils-2.25/bfd/cpu-tic30.c2
-rw-r--r--binutils-2.25/bfd/cpu-tic4x.c3
-rw-r--r--binutils-2.25/bfd/cpu-tic54x.c2
-rw-r--r--binutils-2.25/bfd/cpu-tic6x.c3
-rw-r--r--binutils-2.25/bfd/cpu-tic80.c2
-rw-r--r--binutils-2.25/bfd/cpu-tilegx.c2
-rw-r--r--binutils-2.25/bfd/cpu-tilepro.c2
-rw-r--r--binutils-2.25/bfd/cpu-v850.c2
-rw-r--r--binutils-2.25/bfd/cpu-v850_rh850.c2
-rw-r--r--binutils-2.25/bfd/cpu-vax.c3
-rw-r--r--binutils-2.25/bfd/cpu-w65.c3
-rw-r--r--binutils-2.25/bfd/cpu-we32k.c2
-rw-r--r--binutils-2.25/bfd/cpu-xc16x.c2
-rw-r--r--binutils-2.25/bfd/cpu-xgate.c2
-rw-r--r--binutils-2.25/bfd/cpu-xstormy16.c2
-rw-r--r--binutils-2.25/bfd/cpu-xtensa.c2
-rw-r--r--binutils-2.25/bfd/cpu-z80.c2
-rw-r--r--binutils-2.25/bfd/cpu-z8k.c3
-rw-r--r--binutils-2.25/bfd/demo64.c5
-rw-r--r--binutils-2.25/bfd/development.sh19
-rw-r--r--binutils-2.25/bfd/doc/ChangeLog39
-rw-r--r--binutils-2.25/bfd/doc/Makefile.am165
-rw-r--r--binutils-2.25/bfd/doc/Makefile.in167
-rw-r--r--binutils-2.25/bfd/doc/bfd.texinfo6
-rw-r--r--binutils-2.25/bfd/doc/bfdint.texi12
-rw-r--r--binutils-2.25/bfd/doc/bfdsumm.texi3
-rw-r--r--binutils-2.25/bfd/doc/chew.c40
-rw-r--r--binutils-2.25/bfd/doc/makefile.vms2
-rw-r--r--binutils-2.25/bfd/dwarf1.c5
-rw-r--r--binutils-2.25/bfd/dwarf2.c609
-rw-r--r--binutils-2.25/bfd/ecoff.c177
-rw-r--r--binutils-2.25/bfd/ecofflink.c3
-rw-r--r--binutils-2.25/bfd/ecoffswap.h3
-rw-r--r--binutils-2.25/bfd/elf-attrs.c18
-rw-r--r--binutils-2.25/bfd/elf-bfd.h67
-rw-r--r--binutils-2.25/bfd/elf-eh-frame.c171
-rw-r--r--binutils-2.25/bfd/elf-hppa.h4
-rw-r--r--binutils-2.25/bfd/elf-ifunc.c3
-rw-r--r--binutils-2.25/bfd/elf-linux-psinfo.h2
-rw-r--r--binutils-2.25/bfd/elf-m10200.c10
-rw-r--r--binutils-2.25/bfd/elf-m10300.c69
-rw-r--r--binutils-2.25/bfd/elf-nacl.c34
-rw-r--r--binutils-2.25/bfd/elf-nacl.h2
-rw-r--r--binutils-2.25/bfd/elf-s390-common.c9
-rw-r--r--binutils-2.25/bfd/elf-strtab.c3
-rw-r--r--binutils-2.25/bfd/elf-vxworks.c2
-rw-r--r--binutils-2.25/bfd/elf-vxworks.h2
-rw-r--r--binutils-2.25/bfd/elf.c448
-rw-r--r--binutils-2.25/bfd/elf32-am33lin.c5
-rw-r--r--binutils-2.25/bfd/elf32-arc.c7
-rw-r--r--binutils-2.25/bfd/elf32-arm.c737
-rw-r--r--binutils-2.25/bfd/elf32-avr.c323
-rw-r--r--binutils-2.25/bfd/elf32-avr.h2
-rw-r--r--binutils-2.25/bfd/elf32-bfin.c61
-rw-r--r--binutils-2.25/bfd/elf32-cr16.c8
-rw-r--r--binutils-2.25/bfd/elf32-cr16c.c9
-rw-r--r--binutils-2.25/bfd/elf32-cris.c11
-rw-r--r--binutils-2.25/bfd/elf32-crx.c9
-rw-r--r--binutils-2.25/bfd/elf32-d10v.c9
-rw-r--r--binutils-2.25/bfd/elf32-d30v.c5
-rw-r--r--binutils-2.25/bfd/elf32-dlx.c5
-rw-r--r--binutils-2.25/bfd/elf32-epiphany.c8
-rw-r--r--binutils-2.25/bfd/elf32-fr30.c10
-rw-r--r--binutils-2.25/bfd/elf32-frv.c57
-rw-r--r--binutils-2.25/bfd/elf32-gen.c7
-rw-r--r--binutils-2.25/bfd/elf32-h8300.c8
-rw-r--r--binutils-2.25/bfd/elf32-hppa.c57
-rw-r--r--binutils-2.25/bfd/elf32-hppa.h3
-rw-r--r--binutils-2.25/bfd/elf32-i370.c12
-rw-r--r--binutils-2.25/bfd/elf32-i386.c134
-rw-r--r--binutils-2.25/bfd/elf32-i860.c12
-rw-r--r--binutils-2.25/bfd/elf32-i960.c5
-rw-r--r--binutils-2.25/bfd/elf32-ip2k.c9
-rw-r--r--binutils-2.25/bfd/elf32-iq2000.c31
-rw-r--r--binutils-2.25/bfd/elf32-lm32.c40
-rw-r--r--binutils-2.25/bfd/elf32-m32c.c16
-rw-r--r--binutils-2.25/bfd/elf32-m32r.c18
-rw-r--r--binutils-2.25/bfd/elf32-m68hc11.c7
-rw-r--r--binutils-2.25/bfd/elf32-m68hc12.c7
-rw-r--r--binutils-2.25/bfd/elf32-m68hc1x.c50
-rw-r--r--binutils-2.25/bfd/elf32-m68hc1x.h4
-rw-r--r--binutils-2.25/bfd/elf32-m68k.c70
-rw-r--r--binutils-2.25/bfd/elf32-m88k.c4
-rw-r--r--binutils-2.25/bfd/elf32-mcore.c11
-rw-r--r--binutils-2.25/bfd/elf32-mep.c28
-rw-r--r--binutils-2.25/bfd/elf32-metag.c50
-rw-r--r--binutils-2.25/bfd/elf32-metag.h2
-rw-r--r--binutils-2.25/bfd/elf32-microblaze.c11
-rw-r--r--binutils-2.25/bfd/elf32-mips.c142
-rw-r--r--binutils-2.25/bfd/elf32-moxie.c13
-rw-r--r--binutils-2.25/bfd/elf32-msp430.c36
-rw-r--r--binutils-2.25/bfd/elf32-mt.c29
-rw-r--r--binutils-2.25/bfd/elf32-nds32.c15722
-rw-r--r--binutils-2.25/bfd/elf32-nds32.h155
-rw-r--r--binutils-2.25/bfd/elf32-nios2.c1353
-rw-r--r--binutils-2.25/bfd/elf32-nios2.h (renamed from binutils-2.25/bfd/cpu-or32.c)42
-rw-r--r--binutils-2.25/bfd/elf32-openrisc.c570
-rw-r--r--binutils-2.25/bfd/elf32-or1k.c2853
-rw-r--r--binutils-2.25/bfd/elf32-or32.c514
-rw-r--r--binutils-2.25/bfd/elf32-pj.c7
-rw-r--r--binutils-2.25/bfd/elf32-ppc.c1848
-rw-r--r--binutils-2.25/bfd/elf32-ppc.h30
-rw-r--r--binutils-2.25/bfd/elf32-rl78.c41
-rw-r--r--binutils-2.25/bfd/elf32-rx.c415
-rw-r--r--binutils-2.25/bfd/elf32-rx.h21
-rw-r--r--binutils-2.25/bfd/elf32-s390.c20
-rw-r--r--binutils-2.25/bfd/elf32-score.c15
-rw-r--r--binutils-2.25/bfd/elf32-score.h2
-rw-r--r--binutils-2.25/bfd/elf32-score7.c10
-rw-r--r--binutils-2.25/bfd/elf32-sh-relocs.h2
-rw-r--r--binutils-2.25/bfd/elf32-sh-symbian.c5
-rw-r--r--binutils-2.25/bfd/elf32-sh.c80
-rw-r--r--binutils-2.25/bfd/elf32-sh64-com.c3
-rw-r--r--binutils-2.25/bfd/elf32-sh64.c18
-rw-r--r--binutils-2.25/bfd/elf32-sh64.h2
-rw-r--r--binutils-2.25/bfd/elf32-sparc.c22
-rw-r--r--binutils-2.25/bfd/elf32-spu.c70
-rw-r--r--binutils-2.25/bfd/elf32-spu.h2
-rw-r--r--binutils-2.25/bfd/elf32-tic6x.c38
-rw-r--r--binutils-2.25/bfd/elf32-tic6x.h3
-rw-r--r--binutils-2.25/bfd/elf32-tilegx.c6
-rw-r--r--binutils-2.25/bfd/elf32-tilegx.h2
-rw-r--r--binutils-2.25/bfd/elf32-tilepro.c11
-rw-r--r--binutils-2.25/bfd/elf32-tilepro.h2
-rw-r--r--binutils-2.25/bfd/elf32-v850.c10
-rw-r--r--binutils-2.25/bfd/elf32-vax.c12
-rw-r--r--binutils-2.25/bfd/elf32-xc16x.c8
-rw-r--r--binutils-2.25/bfd/elf32-xgate.c23
-rw-r--r--binutils-2.25/bfd/elf32-xgate.h3
-rw-r--r--binutils-2.25/bfd/elf32-xstormy16.c13
-rw-r--r--binutils-2.25/bfd/elf32-xtensa.c104
-rw-r--r--binutils-2.25/bfd/elf32.c3
-rw-r--r--binutils-2.25/bfd/elf64-alpha.c273
-rw-r--r--binutils-2.25/bfd/elf64-gen.c7
-rw-r--r--binutils-2.25/bfd/elf64-hppa.c17
-rw-r--r--binutils-2.25/bfd/elf64-hppa.h2
-rw-r--r--binutils-2.25/bfd/elf64-ia64-vms.c88
-rw-r--r--binutils-2.25/bfd/elf64-mips.c234
-rw-r--r--binutils-2.25/bfd/elf64-mmix.c13
-rw-r--r--binutils-2.25/bfd/elf64-ppc.c2469
-rw-r--r--binutils-2.25/bfd/elf64-ppc.h57
-rw-r--r--binutils-2.25/bfd/elf64-s390.c20
-rw-r--r--binutils-2.25/bfd/elf64-sh64.c19
-rw-r--r--binutils-2.25/bfd/elf64-sparc.c21
-rw-r--r--binutils-2.25/bfd/elf64-tilegx.c6
-rw-r--r--binutils-2.25/bfd/elf64-tilegx.h2
-rw-r--r--binutils-2.25/bfd/elf64-x86-64.c700
-rw-r--r--binutils-2.25/bfd/elf64.c2
-rw-r--r--binutils-2.25/bfd/elfcode.h160
-rw-r--r--binutils-2.25/bfd/elfcore.h3
-rw-r--r--binutils-2.25/bfd/elflink.c453
-rw-r--r--binutils-2.25/bfd/elfn32-mips.c233
-rw-r--r--binutils-2.25/bfd/elfnn-aarch64.c874
-rw-r--r--binutils-2.25/bfd/elfnn-ia64.c95
-rw-r--r--binutils-2.25/bfd/elfxx-aarch64.c92
-rw-r--r--binutils-2.25/bfd/elfxx-aarch64.h13
-rw-r--r--binutils-2.25/bfd/elfxx-ia64.c3
-rw-r--r--binutils-2.25/bfd/elfxx-ia64.h3
-rw-r--r--binutils-2.25/bfd/elfxx-mips.c1284
-rw-r--r--binutils-2.25/bfd/elfxx-mips.h11
-rw-r--r--binutils-2.25/bfd/elfxx-sparc.c51
-rw-r--r--binutils-2.25/bfd/elfxx-sparc.h5
-rw-r--r--binutils-2.25/bfd/elfxx-target.h21
-rw-r--r--binutils-2.25/bfd/elfxx-tilegx.c9
-rw-r--r--binutils-2.25/bfd/elfxx-tilegx.h2
-rw-r--r--binutils-2.25/bfd/epoc-pe-arm.c6
-rw-r--r--binutils-2.25/bfd/epoc-pei-arm.c6
-rw-r--r--binutils-2.25/bfd/format.c3
-rw-r--r--binutils-2.25/bfd/freebsd.h3
-rw-r--r--binutils-2.25/bfd/gen-aout.c2
-rw-r--r--binutils-2.25/bfd/genlink.h2
-rw-r--r--binutils-2.25/bfd/hash.c4
-rw-r--r--binutils-2.25/bfd/host-aout.c3
-rw-r--r--binutils-2.25/bfd/hosts/alphalinux.h2
-rw-r--r--binutils-2.25/bfd/hosts/alphavms.h3
-rw-r--r--binutils-2.25/bfd/hosts/decstation.h2
-rw-r--r--binutils-2.25/bfd/hosts/delta68.h2
-rw-r--r--binutils-2.25/bfd/hosts/dpx2.h2
-rw-r--r--binutils-2.25/bfd/hosts/hp300bsd.h2
-rw-r--r--binutils-2.25/bfd/hosts/i386bsd.h2
-rw-r--r--binutils-2.25/bfd/hosts/i386linux.h2
-rw-r--r--binutils-2.25/bfd/hosts/i386mach3.h2
-rw-r--r--binutils-2.25/bfd/hosts/i386sco.h2
-rw-r--r--binutils-2.25/bfd/hosts/i860mach3.h2
-rw-r--r--binutils-2.25/bfd/hosts/m68kaux.h2
-rw-r--r--binutils-2.25/bfd/hosts/m68klinux.h2
-rw-r--r--binutils-2.25/bfd/hosts/m88kmach3.h2
-rw-r--r--binutils-2.25/bfd/hosts/mipsbsd.h2
-rw-r--r--binutils-2.25/bfd/hosts/mipsmach3.h2
-rw-r--r--binutils-2.25/bfd/hosts/news-mips.h2
-rw-r--r--binutils-2.25/bfd/hosts/news.h2
-rw-r--r--binutils-2.25/bfd/hosts/pc532mach.h2
-rw-r--r--binutils-2.25/bfd/hosts/riscos.h2
-rw-r--r--binutils-2.25/bfd/hosts/symmetry.h2
-rw-r--r--binutils-2.25/bfd/hosts/tahoe.h2
-rw-r--r--binutils-2.25/bfd/hosts/vaxbsd.h2
-rw-r--r--binutils-2.25/bfd/hosts/vaxlinux.h2
-rw-r--r--binutils-2.25/bfd/hosts/vaxult.h2
-rw-r--r--binutils-2.25/bfd/hosts/vaxult2.h2
-rw-r--r--binutils-2.25/bfd/hosts/x86-64linux.h3
-rw-r--r--binutils-2.25/bfd/hp300bsd.c5
-rw-r--r--binutils-2.25/bfd/hp300hpux.c15
-rw-r--r--binutils-2.25/bfd/hppabsd-core.c5
-rw-r--r--binutils-2.25/bfd/hpux-core.c5
-rw-r--r--binutils-2.25/bfd/i386aout.c5
-rw-r--r--binutils-2.25/bfd/i386bsd.c5
-rw-r--r--binutils-2.25/bfd/i386dynix.c5
-rw-r--r--binutils-2.25/bfd/i386freebsd.c5
-rw-r--r--binutils-2.25/bfd/i386linux.c6
-rw-r--r--binutils-2.25/bfd/i386lynx.c5
-rw-r--r--binutils-2.25/bfd/i386mach3.c5
-rw-r--r--binutils-2.25/bfd/i386msdos.c8
-rw-r--r--binutils-2.25/bfd/i386netbsd.c5
-rw-r--r--binutils-2.25/bfd/i386os9k.c7
-rw-r--r--binutils-2.25/bfd/ieee.c38
-rw-r--r--binutils-2.25/bfd/ihex.c7
-rw-r--r--binutils-2.25/bfd/init.c3
-rw-r--r--binutils-2.25/bfd/irix-core.c5
-rw-r--r--binutils-2.25/bfd/libaout.h8
-rw-r--r--binutils-2.25/bfd/libbfd-in.h47
-rw-r--r--binutils-2.25/bfd/libbfd.c34
-rw-r--r--binutils-2.25/bfd/libbfd.h212
-rw-r--r--binutils-2.25/bfd/libcoff-in.h32
-rw-r--r--binutils-2.25/bfd/libcoff.h50
-rw-r--r--binutils-2.25/bfd/libecoff.h10
-rw-r--r--binutils-2.25/bfd/libhppa.h3
-rw-r--r--binutils-2.25/bfd/libieee.h3
-rw-r--r--binutils-2.25/bfd/libnlm.h3
-rw-r--r--binutils-2.25/bfd/liboasys.h3
-rw-r--r--binutils-2.25/bfd/libpei.h15
-rw-r--r--binutils-2.25/bfd/libxcoff.h2
-rw-r--r--binutils-2.25/bfd/linker.c604
-rw-r--r--binutils-2.25/bfd/lynx-core.c3
-rw-r--r--binutils-2.25/bfd/m68k4knetbsd.c5
-rw-r--r--binutils-2.25/bfd/m68klinux.c6
-rw-r--r--binutils-2.25/bfd/m68knetbsd.c5
-rw-r--r--binutils-2.25/bfd/m88kmach3.c5
-rw-r--r--binutils-2.25/bfd/m88kopenbsd.c4
-rw-r--r--binutils-2.25/bfd/mach-o-i386.c9
-rw-r--r--binutils-2.25/bfd/mach-o-target.c11
-rw-r--r--binutils-2.25/bfd/mach-o-x86-64.c12
-rw-r--r--binutils-2.25/bfd/mach-o.c1961
-rw-r--r--binutils-2.25/bfd/mach-o.h74
-rw-r--r--binutils-2.25/bfd/makefile.vms8
-rwxr-xr-xbinutils-2.25/bfd/mep-relocs.pl2
-rw-r--r--binutils-2.25/bfd/merge.c3
-rw-r--r--binutils-2.25/bfd/mipsbsd.c13
-rw-r--r--binutils-2.25/bfd/mmo.c74
-rw-r--r--binutils-2.25/bfd/netbsd-core.c6
-rw-r--r--binutils-2.25/bfd/netbsd.h3
-rw-r--r--binutils-2.25/bfd/newsos3.c5
-rw-r--r--binutils-2.25/bfd/nlm-target.h5
-rw-r--r--binutils-2.25/bfd/nlm.c3
-rw-r--r--binutils-2.25/bfd/nlm32-alpha.c5
-rw-r--r--binutils-2.25/bfd/nlm32-i386.c5
-rw-r--r--binutils-2.25/bfd/nlm32-ppc.c5
-rw-r--r--binutils-2.25/bfd/nlm32-sparc.c5
-rw-r--r--binutils-2.25/bfd/nlm32.c2
-rw-r--r--binutils-2.25/bfd/nlm64.c2
-rw-r--r--binutils-2.25/bfd/nlmcode.h3
-rw-r--r--binutils-2.25/bfd/nlmswap.h2
-rw-r--r--binutils-2.25/bfd/ns32k.h2
-rw-r--r--binutils-2.25/bfd/ns32knetbsd.c7
-rw-r--r--binutils-2.25/bfd/oasys.c31
-rw-r--r--binutils-2.25/bfd/opncls.c107
-rw-r--r--binutils-2.25/bfd/osf-core.c5
-rw-r--r--binutils-2.25/bfd/pc532-mach.c9
-rw-r--r--binutils-2.25/bfd/pdp11.c20
-rw-r--r--binutils-2.25/bfd/pe-arm-wince.c6
-rw-r--r--binutils-2.25/bfd/pe-arm.c7
-rw-r--r--binutils-2.25/bfd/pe-i386.c5
-rw-r--r--binutils-2.25/bfd/pe-mcore.c6
-rw-r--r--binutils-2.25/bfd/pe-mips.c15
-rw-r--r--binutils-2.25/bfd/pe-ppc.c7
-rw-r--r--binutils-2.25/bfd/pe-sh.c4
-rw-r--r--binutils-2.25/bfd/pe-x86_64.c58
-rw-r--r--binutils-2.25/bfd/peXXigen.c2108
-rw-r--r--binutils-2.25/bfd/pef-traceback.h3
-rw-r--r--binutils-2.25/bfd/pef.c9
-rw-r--r--binutils-2.25/bfd/pef.h3
-rw-r--r--binutils-2.25/bfd/pei-arm-wince.c6
-rw-r--r--binutils-2.25/bfd/pei-arm.c7
-rw-r--r--binutils-2.25/bfd/pei-i386.c5
-rw-r--r--binutils-2.25/bfd/pei-ia64.c5
-rw-r--r--binutils-2.25/bfd/pei-mcore.c7
-rw-r--r--binutils-2.25/bfd/pei-mips.c5
-rw-r--r--binutils-2.25/bfd/pei-ppc.c7
-rw-r--r--binutils-2.25/bfd/pei-sh.c5
-rw-r--r--binutils-2.25/bfd/pei-x86_64.c573
-rw-r--r--binutils-2.25/bfd/peicode.h36
-rw-r--r--binutils-2.25/bfd/plugin.c111
-rw-r--r--binutils-2.25/bfd/plugin.h2
-rw-r--r--binutils-2.25/bfd/po/Make-in2
-rw-r--r--binutils-2.25/bfd/po/SRC-POTFILES.in9
-rw-r--r--binutils-2.25/bfd/po/bfd.pot3425
-rw-r--r--binutils-2.25/bfd/po/fi.po3625
-rw-r--r--binutils-2.25/bfd/ppcboot.c7
-rw-r--r--binutils-2.25/bfd/ptrace-core.c5
-rw-r--r--binutils-2.25/bfd/reloc.c440
-rw-r--r--binutils-2.25/bfd/reloc16.c4
-rw-r--r--binutils-2.25/bfd/riscix.c13
-rw-r--r--binutils-2.25/bfd/rs6000-core.c8
-rw-r--r--binutils-2.25/bfd/sco5-core.c6
-rw-r--r--binutils-2.25/bfd/section.c32
-rw-r--r--binutils-2.25/bfd/simple.c86
-rw-r--r--binutils-2.25/bfd/som.c18
-rw-r--r--binutils-2.25/bfd/som.h3
-rw-r--r--binutils-2.25/bfd/sparclinux.c6
-rw-r--r--binutils-2.25/bfd/sparclynx.c5
-rw-r--r--binutils-2.25/bfd/sparcnetbsd.c5
-rw-r--r--binutils-2.25/bfd/srec.c25
-rw-r--r--binutils-2.25/bfd/stab-syms.c3
-rw-r--r--binutils-2.25/bfd/stabs.c5
-rw-r--r--binutils-2.25/bfd/sunos.c8
-rw-r--r--binutils-2.25/bfd/syms.c4
-rw-r--r--binutils-2.25/bfd/sysdep.h7
-rw-r--r--binutils-2.25/bfd/targets.c1426
-rw-r--r--binutils-2.25/bfd/tekhex.c117
-rw-r--r--binutils-2.25/bfd/ticoff.h121
-rw-r--r--binutils-2.25/bfd/trad-core.c6
-rw-r--r--binutils-2.25/bfd/vax1knetbsd.c4
-rw-r--r--binutils-2.25/bfd/vaxbsd.c4
-rw-r--r--binutils-2.25/bfd/vaxnetbsd.c5
-rw-r--r--binutils-2.25/bfd/verilog.c4
-rw-r--r--binutils-2.25/bfd/versados.c7
-rw-r--r--binutils-2.25/bfd/version.h2
-rw-r--r--binutils-2.25/bfd/version.m41
-rw-r--r--binutils-2.25/bfd/vms-alpha.c61
-rw-r--r--binutils-2.25/bfd/vms-lib.c7
-rw-r--r--binutils-2.25/bfd/vms-misc.c3
-rw-r--r--binutils-2.25/bfd/vms.h3
-rw-r--r--binutils-2.25/bfd/warning.m411
-rw-r--r--binutils-2.25/bfd/xcofflink.c61
-rw-r--r--binutils-2.25/bfd/xsym.c5
-rw-r--r--binutils-2.25/bfd/xsym.h3
-rw-r--r--binutils-2.25/bfd/xtensa-isa.c2
-rw-r--r--binutils-2.25/bfd/xtensa-modules.c2
491 files changed, 48691 insertions, 17287 deletions
diff --git a/binutils-2.25/bfd/ChangeLog b/binutils-2.25/bfd/ChangeLog
index 89774001..f5ee80c4 100644
--- a/binutils-2.25/bfd/ChangeLog
+++ b/binutils-2.25/bfd/ChangeLog
@@ -1,2645 +1,2663 @@
-2013-10-18 Hans-Peter Nilsson <hp@axis.com>
+2014-11-18 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ * elf64-x86-64.c (elf_x86_64_check_relocs): Enable MPX PLT only
+ for -z bndplt.
+
+2014-11-17 Nick Clifton <nickc@redhat.com>
+
+ Apply trunk patches:
+
+ 2014-11-14 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17597
+ * opncls.c (bfd_get_debug_link_info): Avoid reading off the end of
+ the section.
+ (bfd_get_alt_debug_link_info): Likewise.
+
+ 2014-11-14 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17512
+ * ieee.c (ieee_archive_p) Skip processing if no bytes are read at
+ all.
+ (ieee_object_p): Likewise.
+
+ 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ * coffcode.h (coff_slurp_line_table): Add cast to unsigned int.
+
+ 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ * coffcode.h (coff_pointerize_aux_hook): Fix a typo.
+
+ 2014-11-13 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17512
+ * coffcode.h (coff_ptr_struct): Add is_sym field.
+ (coff_new_section_hook): Set the is_sym field.
+ (coff_pointerize_aux_hook): Check the is_sym field.
+ (coff_print_aux): Likewise.
+ (coff_compute_section_file_positions): Likewise.
+ (coff_write_object_contents): Likewise.
+ (coff_slurp_line_table): Likewise.
+ (coff_slurp_symbol_table): Likewise.
+ (CALC_ADDEND): Likewise.
+ * coffgen.c (coff_renumber_symbols): Likewise.
+ (coff_mangle_symbols): Likewise.
+ (coff_fix_symbol_name): Likewise.
+ (coff_write_symbol): Likewise.
+ (coff_write_alien_symbol): Likewise.
+ (coff_write_native_symbol): Likewise.
+ (coff_write_symbols): Likewise.
+ (coff_write_linenumbers): Likewise.
+ (coff_pointerize_aux): Likewise.
+ (coff_get_normalized_symtab): Likewise.
+ (coff_get_symbol_info): Likewise.
+ (bfd_coff_get_syment): Likewise.
+ (bfd_coff_get_auxent): Likewise.
+ (coff_print_symbol): Likewise.
+ (coff_find_nearest_line_with_names): Likewise.
+ (bfd_coff_set_symbol_class): Likewise.
+ (coff_make_empty_symbol): Set the is_sym field.
+ (coff_bfd_make_debug_symbol): Likewise.
+ * peicode.h (pe_ILF_make_a_symbol): Likewise.
+ * libcoff.h: Regenerate.
+ * libcoff-in.h: Regenerate.
+
+ 2014-11-12 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17512
+ * coffcode.h (coff_slurp_line_table): Set the line number of
+ corrupt entries to -1.
+ (coff_slurp_symbol_table): Alway initialise the value of the
+ symbol.
+ * coffgen.c (coff_print_symbol): Check that the combined pointer
+ is valid.
+ (coff_print_symbol): Do not print negative line numbers.
+ * peXXigen.c (pe_print_idata): Add range checking displaying
+ member names.
+
+ 2014-11-12 Alan Modra <amodra@gmail.com>
+
+ PR binutils/17512
+ * coffcode.h (coff_slurp_line_table): Drop line number info
+ not preceded by a valid function entry. Revert last change.
+
+ 2014-11-11 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17512
+ * coffcode.h (coff_slurp_line_table): Initialise the parts of the
+ line number cache that would not be initialised by the copy from
+ the new line number table.
+ (coff_classify_symbol): Allow for _bfd_coff_internal_syment_name
+ returning NULL.
+ * coffgen.c (coff_get_normalized_symbols): Get the external
+ symbols before allocating space for the internal symbols, in case
+ the get fails.
+ * elf.c (_bfd_elf_slurp_version_tables): Only allocate a verref
+ array if one is needed. Likewise with the verdef array.
+ * peXXigen.c (_bfd_XXi_swap_sym_in): Replace abort()'s with error
+ messages.
+ (_bfd_XXi_swap_aux_in): Make sure that all fields of the aux
+ structure are initialised.
+ (pe_print_edata): Avoid reading off the end of the data buffer.
+
+ 2014-11-11 Alan Modra <amodra@gmail.com>
+
+ PR binutils/17512
+ * coffcode.h (coff_slurp_line_table): Use updated lineno_count
+ when building func_table.
+
+ 2014-11-11 Alan Modra <amodra@gmail.com>
+
+ PR binutils/17512
+ * coffcode.h (coff_slurp_line_table): Don't bfd_zalloc, just
+ memset the particular bits we need. Update src after hitting loop
+ "continue". Don't count lineno omitted due to invalid symbols in
+ nbr_func, and update lineno_count. Init entire terminating
+ lineno. Don't both allocating terminator in n_lineno_cache.
+ Redirect sym->lineno pointer to where n_lineno_cache will be
+ copied, and free n_lineno_cache.
+ * pe-mips.c (NUM_HOWTOS): Typo fix.
+
+ 2014-11-10 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17521
+ * coff-i386.c (NUM_HOWTOS): New define.
+ (RTYPE2HOWTO): Use it.
+ (coff_i386_rtype_to_howto): Likewise.
+ (coff_i386_reloc_name_lookup): Likewise.
+ (CALC_ADDEND): Check that reloc r_type field is valid.
+ * coff-x86_64.c (NUM_HOWTOS): New define.
+ (RTYPE2HOWTO): Use it.
+ (coff_amd64_rtype_to_howto): Likewise.
+ (coff_amd64_reloc_name_lookup): Likewise.
+ (CALC_ADDEND): Check that reloc r_type field is valid.
+ * coffcode.h (coff_slurp_line_table): Check for symbol table
+ indexing underflow.
+ (coff_slurp_symbol_table): Use zalloc to ensure that all table
+ entries are initialised.
+ * coffgen.c (_bfd_coff_read_string_table): Initialise unused bits
+ in the string table. Also ensure that the table is 0 terminated.
+ (coff_get_normalized_symtab): Check for symbol table indexing
+ underflow.
+ * opncls.c (bfd_alloc): Catch the case where a small negative size
+ can result in only 1 byte being allocated.
+ (bfd_alloc2): Use bfd_alloc.
+ * pe-mips.c (NUM_HOWTOS): New define.
+ (coff_mips_reloc_name_lookup): Use it.
+ (CALC_ADDEND): Check that reloc r_type field is valid.
+ * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Initialise unused entries
+ in the DataDirectory.
+ (pe_print_idata): Avoid reading beyond the end of the data block
+ wen printing strings.
+ (pe_print_edata): Likewise.
+ Check for table indexing underflow.
+ * peicode.h (pe_mkobject): Initialise the pe_opthdr field.
+ (pe_bfd_object_p): Allocate and initialize enough space to hold a
+ PEAOUTHDR, even if the opt_hdr field specified less.
+
+ 2014-11-08 Alan Modra <amodra@gmail.com>
+
+ * peXXigen.c (pe_print_idata): Revert last patch, cast lhs instead.
+
+ 2014-11-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * peXXigen.c (pe_print_idata): Cast to unsigned long in range
+ checks.
+
+ 2014-11-07 Alan Modra <amodra@gmail.com>
+
+ * tekhex.c (tekhex_set_arch_mach): Ignore unknown arch errors.
+
+ 2014-11-07 Alan Modra <amodra@gmail.com>
+
+ * tekhex.c (CHUNK_SPAN): Define.
+ (struct data_struct <chunk_init>): Use one byte per span, update
+ all code accessing this field.
+ (find_chunk): Add create param, don't create new entry unless set.
+ (insert_byte): Don't save zeros.
+ (first_phase): Set section SEC_CODE or SEC_DATA flag depending
+ on symbol type. Create an alternate section if both types of
+ symbol are given. Attach type '2' and '6' symbols to absolute
+ section.
+ (move_section_contents): Fix caching of chunk. Don't create chunk
+ when reading, or for writing zeros.
+ (tekhex_set_section_contents): Don't create initial chunks.
+ (tekhex_write_object_contents): Use CHUNK_SPAN.
+
+ 2014-11-07 Alan Modra <amodra@gmail.com>
+
+ * aoutx.h (aout_get_external_symbols): Tidy allocation of symbol buffer.
+
+ 2014-11-07 Alan Modra <amodra@gmail.com>
+
+ * archive.c (_bfd_slurp_extended_name_table): Revert bfd_get_size check.
+ * coffcode.h (coff_set_alignment_hook): Likewise.
+ (coff_slurp_line_table): Likewise.
+ * coffgen.c (coff_get_normalized_symtab): Likewise.
+ (_bfd_coff_get_external_symbols): Likewise.
+ * elf.c (bfd_elf_get_str_section): Likewise.
+ * tekhex.c (first_phase): Likewise.
+
+ 2014-11-06 Nick Clifton <nickc@redhat.com>
+
+ * aoutx.h (slurp_symbol_table): Revert previous delta.
+ (slurp_reloc_table): Likewise.
+ * compress.c (bfd_get_full_section_contents): Remove file size
+ test.
+ * coffgen.c (coff_get_normalized_symtab): Allow zero-sized symtabs
+ and do not complain about linker generated files.
+
+ 2014-11-04 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17512
+ * coffcode.h (handle_COMDAT): Replace abort with BFD_ASSERT.
+ Replace another abort with an error message.
+ (coff_slurp_line_table): Add more range checking.
+ * peXXigen.c (pe_print_debugdata): Add range checking.
+
+ 2014-11-05 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17512
+ * coffcode.h (coff_set_alignment_hook): Warn if the file lies
+ about the number of relocations it contains.
+ (coff_sort_func_alent): Return 0 if the pointers are NULL.
+ (coff_slurp_line_table): Add more range checks. Do not free new
+ tables created when sorting line numbers.
+ * peXXigen.c (pe_print_idata): Add range checks.
+ (pe_print_edata): Likewise.
+ (rsrc_print_resource_entries): Likewise. Avoid printing control
+ characters. Terminate priniting if corruption is detected.
+ (rsrc_print_resource_directory): Terminate printing if an unknown
+ directory type is encountered.
+ (pe_print_debugdata): Fix off-by-one error.
+ (rsrc_count_entries): Add range checking.
+ (rsrc_parse_entry): Likewise.
+
+ 2014-11-04 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17512
+ * compress.c (bfd_get_full_section_contents): Improve test for
+ linker created objects.
+
+ PR binutils/17533
+ * archive.c (_bfd_slurp_extended_name_table): Handle archives with
+ corrupt extended name tables.
+
+ 2014-11-03 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17512
+ * aoutx.h (slurp_symbol_table): Check that computed table size is
+ not bigger than the file from which is it being read.
+ (slurp_reloc_table): Likewise.
+ * coffcode.h (coff_slurp_line_table): Remove unneeded local
+ 'warned'. Do not try to print the details of a symbol with an
+ invalid index.
+ * coffgen.c (make_a_sectiobn_from_file): Check computed string
+ index against length of string table.
+ (bfd_coff_internal_syment_name): Check read in string offset
+ against length of string table.
+ (build_debug_section): Return a pointer to the section used.
+ (_bfd_coff_read_string_table): Store the length of the string
+ table in the coff_tdata structure.
+ (bfd_coff_free_symbols): Set the length of the string table to
+ zero when it is freed.
+ (coff_get_normalized_symtab): Check offsets against string table
+ or data table lengths as appropriate.
+ * cofflink.c (_bfd_coff_link_input_bfd): Check offset against
+ length of string table.
+ * compress.c (bfd_get_full_section_contents): Check computed size
+ against the size of the file.
+ * libcoff-in.h (obj_coff_strings_len): Define.
+ (struct coff_tdata): Add strings_len field.
+ * libcoff.h: Regenerate.
+ * peXXigen.c (pe_print_debugdata): Do not attempt to print the
+ data if the debug section is too small.
+ * xcofflink.c (xcoff_link_input_bfd): Check offset against
+ length of string table.
+
+ 2014-10-31 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17512
+ * coffgen.c (_bfd_coff_get_external_symbols): Do not try to load a
+ symbol table bigger than the file.
+ * elf.c (bfd_elf_get_str_section): Do not try to load a string
+ table bigger than the file.
+ * tekhex.c (first_phase): Check that the section range is sane.
+
+2014-11-11 Alan Modra <amodra@gmail.com>
+
+ * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Adjust section
+ size check to account for possible zero terminator.
+
+2014-11-10 Matthew Fortune <matthew.fortune@imgtec.com>
+
+ Apply trunk patch:
+ * elfxx-mips.c (update_mips_abiflags_isa): Add E_MIPS_ARCH_32R6
+ and E_MIPS_ARCH_64R6 support.
+
+2014-11-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ Apply trunk patch:
+ 2014-11-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/17482
+ * elf64-x86-64.c (elf_x86_64_relocate_section): Update comments
+ for IE->LE transition.
+
+2014-11-04 Tristan Gingold <gingold@adacore.com>
+
+ * development.sh: Set development to false.
+
+2014-11-03 Nick Clifton <nickc@redhat.com>
+
+ * po/fi.po: Updated Finnish translation.
+
+2014-10-31 Nick Clifton <nickc@redhat.com>
+
+ Apply trunk patch:
+
+ 2014-10-30 Nick Clifton <nickc@redhat.com>
+ PR binutils/17512
+ * ihex.c (ihex_scan): Fix typo in invocation of ihex_bad_byte.
+ * coffgen.c (coff_get_normalized_symtab): Prevent buffer overrun.
+
+2014-10-30 Nick Clifton <nickc@redhat.com>
+
+ Appy trunk patch:
+
+ 2014-10-29 Nick Clifton <nickc@redhat.com>
+ * elf.c (bfd_section_from_shdr): Fix heap use after free memory
+ leak.
+
+2014-10-28 Matthew Fortune <matthew.fortune@imgtec.com>
+
+ Apply trunk patches:
- * elf32-cris.c (cris_elf_check_relocs): Don't assume
- a registered dynobj means that a .got has been created.
+ 2014-10-22 Matthew Fortune <matthew.fortune@imgtec.com>
+ * elfxx-mips.c (print_mips_ases): Print unknown ASEs.
+ (print_mips_isa_ext): Print the value of an unknown extension.
+
+2014-10-28 Nick Clifton <nickc@redhat.com>
+
+ Apply trunk patches:
+
+ 2014-10-28 Nick Clifton <nickc@redhat.com>
+ PR binutils/17512
+ * elf.c (bfd_section_from_shdr): Allocate and free the recursion
+ detection table on a per-bfd basis.
+ * peXXigen.c (pe_print_edata): Handle binaries with a truncated
+ export table.
+
+ 2014-10-28 Andreas Schwab <schwab@suse.de>
+ Nick Clifton <nickc@redhat.com>
+ PR binutils/17510
+ * srec.c (srec_bad_byte): Increase size of buf to allow for
+ negative values.
+ (srec_scan): Use an unsigned char buffer to hold header bytes.
-2013-10-17 Alan Modra <amodra@gmail.com>
+ 2014-10-27 Nick Clifton <nickc@redhat.com>
+ PR binutils/17512
+ * elf.c (bfd_section_from_shdr): Detect and warn about ELF
+ binaries with a group of sections linked by the string table
+ indicies.
+ * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Handle corrupt binaries
+ with an invalid value for NumberOfRvaAndSizes.
+ (pe_print_edata): Detect out of range rvas and entry counts for
+ the Export Address table, Name Pointer table and Ordinal table.
- PR 16056
- * elf.c (copy_elf_program_header): Only consider SEC_ALLOC sections
- when finding lowest_section.
+ PR binutils/17510
+ * elf.c (setup_group): Improve handling of corrupt group
+ sections.
-2013-10-14 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
+2014-10-28 Alan Modra <amodra@gmail.com>
+
+ Apply trunk patches:
+
+ 2014-10-21 Alan Modra <amodra@gmail.com>
+ * elf64-ppc.c (ppc64_elf_tls_optimize): Ignore relocs against toc
+ entries that aren't a multiple of 8 rather than failing assertion.
+
+ 2014-10-21 Alan Modra <amodra@gmail.com>
+ * elf64-ppc.c (ppc64_elf_size_stubs): Add gcc-4.9 libgomp functions
+ to thread_starter.
+
+ 2014-10-18 Alan Modra <amodra@gmail.com>
+ * elf64-ppc.c (ppc64_elf_add_symbol_hook): If function code
+ section for function symbols defined in .opd is discarded, let
+ the symbol appear to be undefined.
+ (opd_entry_value): Ensure the result section is that for the
+ function code section in the same object as the OPD entry.
+
+ 2014-10-16 Alan Modra <amodra@gmail.com>
+ PR 17492
+ * elf32-arm.c (elf32_arm_add_symbol_hook): Only set has_gnu_symbols
+ on ELF output bfd.
+ * elf32-i386.c (elf_i386_add_symbol_hook): Likewise.
+ * elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise.
+ * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
+ * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
+ * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
+ * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
+ * elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise.
+ * elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise.
+ * elf-s390-common.c (elf_s390_add_symbol_hook): Likewise. Handle
+ STB_GNU_UNIQUE too.
+
+ 2014-10-16 Alan Modra <amodra@gmail.com>
+ * elf64-ppc.c (ppc64_elf_before_check_relocs): Do .opd processing
+ even when output is not ppc64 ELF. Remove redundant tests on
+ type of input bfd.
+
+ 2014-10-15 Alan Modra <amodra@gmail.com>
+ PR 17481
+ * aoutx.h (NAME (aout, find_nearest_line)): Add "discriminator_ptr"
+ param, group "section" and "offset" params. Zero discriminator.
+ * bfd.c (bfd_find_nearest_line): Implement with new
+ _bfd_find_nearest_line.
+ (bfd_find_nearest_line_discriminator): Likewise.
+ * coff-i386.c (_bfd_generic_find_nearest_line_discriminator): Don't
+ define.
+ * coff-rs6000.c (xcoff_find_nearest_line,
+ xcoff_find_nearest_line_discriminator): Delete.
+ (_bfd_xcoff_find_nearest_line): Don't define.
+ (_bfd_xcoff_find_nearest_line): Define as coff_find_nearest_line.
+ * coff-x86_64.c (_bfd_generic_find_nearest_line_discriminator): Don't
+ define.
+ * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Adjust.
+ * coffgen.c (coff_find_nearest_line_with_names): Reorder params,
+ adjust _bfd_dwarf2_find_nearest_line call.
+ (coff_find_nearest_line): Add "discriminator_ptr" param, reorder
+ others. Set discriminator. Adjust call.
+ (coff_find_nearest_line_discriminator): Delete.
+ * dwarf1.c (_bfd_dwarf1_find_nearest_line): Reorder params.
+ * dwarf2.c (find_line): Rename to..
+ (_bfd_dwarf2_find_nearest_line): ..this, reordering params.
+ Simplify setting of do_line. Delete old function.
+ (_bfd_dwarf2_find_line): Delete.
+ * ecoff.c (_bfd_ecoff_find_nearest_line): Reorder params, add
+ discriminator_ptr and set it.
+ * elf-bfd.h (_bfd_elf_find_nearest_line): Update prototype.
+ (_bfd_elf_find_nearest_line_discriminator): Delete.
+ (_bfd_elf_find_line_discriminator): Delete.
+ (_bfd_generic_find_nearest_line_discriminator): Don't define.
+ * elf.c (elf_find_function): Reorder params.
+ (_bfd_elf_find_nearest_line): Reorder params, add discriminator_ptr.
+ Adjust calls.
+ (_bfd_elf_find_nearest_line_discriminator): Delete.
+ (_bfd_elf_find_line): Adjust call.
+ * elf32-arm.c (arm_elf_find_function): Reorder params.
+ (elf32_arm_find_nearest_line): Reorder params, add discriminator_ptr.
+ Adjust calls.
+ * elf64-alpha.c (elf64_alpha_find_nearest_line): Similarly.
+ * elfnn-aarch64.c (aarch64_elf_find_function): Reorder params.
+ (elfNN_aarch64_find_nearest_line): Reorder params, add
+ discriminator_ptr. Adjust calls.
+ * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Similarly.
+ * elfxx-mips.h (_bfd_mips_elf_find_nearest_line): Update prototype.
+ * libaout.h (NAME (aout, find_nearest_line)): Update prototype.
+ * libbfd-in.h (_bfd_nosymbols_find_nearest_line): Update.
+ (_bfd_dwarf1_find_nearest_line): Likewise.
+ (_bfd_dwarf2_find_nearest_line): Likewise.
+ (_bfd_dwarf2_find_line): Delete.
+ (_bfd_generic_find_nearest_line_discriminator): Delete.
+ * libbfd.c (_bfd_generic_find_nearest_line_discriminator): Delete.
+ * libcoff-in.h (coff_find_nearest_line): Update prototype.
+ (coff_find_nearest_line_discriminator): Delete.
+ (coff_find_nearest_line_with_names): Update prototype.
+ * libecoff.h (_bfd_ecoff_find_nearest_line): Update prototype.
+ * mach-o.c (bfd_mach_o_find_nearest_line): Reorder params, add
+ discriminator_ptr. Adjust calls.
+ * mach-o.h (bfd_mach_o_find_nearest_line): Update prototype.
+ * pdp11.c (NAME (aout, find_nearest_line)): Reorder params, add
+ discriminator_ptr and set.
+ * som.c (som_find_nearest_line): Similarly.
+ * targets.c (BFD_JUMP_TABLE_SYMBOLS): Delete entry for
+ _bfd_find_nearest_line_discriminator.
+ (struct bfd_target <_bfd_find_nearest_line>): Adjust prototype.
+ (struct bfd_target <_bfd_find_nearest_line_discriminator>): Delete.
+ * vms-alpha.c (_bfd_vms_find_nearest_dst_line): Rename to..
+ (_bfd_vms_find_nearest_line): ..this. Reorder params, add
+ "discriminator" and set.
+ (_bfd_vms_find_nearest_line_discriminator): Delete.
+ (_bfd_generic_find_nearest_line_discriminator): Don't define.
+ (alpha_vms_find_nearest_line): Update define.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+ * libcoff.h: Regenerate.
+
+ 2014-10-15 Alan Modra <amodra@gmail.com>
+ * targets.c (BFD_JUMP_TABLE_SYMBOLS): Use NAME##_find_line.
+ * aout-adobe.c (aout_32_find_line): Define.
+ (aout_32_bfd_make_debug_symbol, aout_32_bfd_reloc_type_lookup,
+ aout_32_bfd_reloc_name_lookup): Define using _bfd_nosymbols define.
+ * aout-target.h (MY_find_line): Define.
+ * aout-tic30.c (MY_find_line): Define.
+ * binary.c (binary_find_line): Define.
+ * bout.c (aout_32_find_line): Define.
+ * coff-rs6000.c (_bfd_xcoff_find_line): Define.
+ * coff64-rs6000.c (rs6000_xcoff64_vec): Use coff_find_line.
+ (rs6000_xcoff64_aix_vec): Likewise.
+ * elf-bfd.h (_bfd_generic_find_line): Don't define.
+ * elfxx-target.h (bfd_elfNN_find_line): Define.
+ * i386msdos.c (msdos_find_line): Define.
+ * i386os9k.c (aout_32_find_line): Define.
+ * ieee.c (ieee_find_nearest_line, ieee_find_inliner_info): Delete func.
+ (ieee_find_nearest_line, ieee_find_line,
+ ieee_find_inliner_info): Define.
+ * ihex.c (ihex_find_line): Define.
+ * libbfd-in.h (_bfd_nosymbols_find_line): Define.
+ (_bfd_generic_find_line): Don't define.
+ * libbfd.c (_bfd_generic_find_line): Delete.
+ * libcoff-in.h (coff_find_line): Define.
+ * libecoff.h (_bfd_ecoff_find_line): Define.
+ * mach-o.h (bfd_mach_o_find_line): Define.
+ * mmo.c (mmo_find_line): Define.
+ * nlm-target.h (nlm_find_line): Define.
+ * oasys.c (oasys_find_nearest_line, oasys_find_inliner_info): Delete.
+ (oasys_find_nearest_line, oasys_find_line,
+ oasys_find_inliner_info): Define.
+ * pef.c (bfd_pef_find_line): Define.
+ * plugin.c (bfd_plugin_find_line): Define.
+ * ppcboot.c (ppcboot_find_line): Define.
+ * som.c (som_find_line): Define.
+ * srec.c (srec_find_line): Define.
+ * tekhex.c (tekhex_find_line): Define.
+ * versados.c (versados_find_line): Define.
+ * vms-alpha.c (alpha_vms_find_line): Define.
+ * xsym.c (bfd_sym_find_line): Define.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+ * libcoff.h: Regenerate.
+
+2014-10-24 Tejas Belagod <tejas.belagod@arm.com>
+
+ * bfd-in.h (bfd_elf64_aarch64_set_options): Add a parameter.
+ * bfd-in2.h (bfd_elf64_aarch64_set_options): Likewise.
+ * elfnn-aarch64.c (aarch64_erratum_835769_stub): New.
+ (elf_aarch64_stub_type): Add new type
+ aarch64_stub_erratum_835769_veneer.
+ (elf_aarch64_stub_hash_entry): New fields for erratum 835769.
+ (aarch64_erratum_835769_fix): New data struct to record erratum
+ 835769.
+ (elf_aarch64_link_hash_table: Global flags for 835769.
+ (aarch64_build_one_stub): Add case for 835769.
+ (aarch64_size_one_stub): Likewise.
+ (aarch64_mem_op_p, aarch64_mlxl_p,
+ aarch64_erratum_sequence,erratum_835769_scan):
+ New. Decode and scan functions for erratum 835769.
+ (elf_aarch64_create_or_find_stub_sec): New.
+ (elfNN_aarch64_size_stubs): Look for erratum 835769 and record
+ them.
+ (bfd_elfNN_aarch64_set_options: Set global flag for 835769.
+ (erratum_835769_branch_to_stub_data,
+ make_branch_to_erratum_835769_stub):New. Connect up all the
+ erratum stubs to occurances by branches.
+ (elfNN_aarch64_write_section): New hook.
+ (aarch64_map_one_stub): Output erratum stub symbol.
+ (elfNN_aarch64_size_dynamic_sections): Init mapping symbol
+ information for erratum 835769.
+ (elf_backend_write_section): Define.
+
+2014-10-14 Tristan Gingold <gingold@adacore.com>
+
+ * version.m4: Bump version to 2.24.90
+ * configure: Regenerate.
- * elfxx-mips.c (mips_elf_obj_tdata): Add abi_msa_bfd.
- (mips_elf_merge_obj_attributes): Set abi_msa_bfd to the first object
- file that has a Tag_GNU_MIPS_ABI_MSA attribute.
- Merge Tag_GNU_MIPS_ABI_MSA attributes.
+2014-10-14 Alan Modra <amodra@gmail.com>
-2013-10-14 Nick Clifton <nickc@redhat.com>
+ PR 17453
+ * libbfd.c (COERCE16, COERCE32, COERCE64): Use unsigned types.
+ (EIGHT_GAZILLION): Delete.
- * gen-aout.c (main): Fix formatting. Close file.
+2014-10-13 Alan Modra <amodra@gmail.com>
-2013-10-13 Richard Sandiford <rdsandiford@googlemail.com>
+ PR 17467
+ * elf-eh-frame.c (ENSURE_NO_RELOCS): Don't stop at first NONE reloc.
+ (_bfd_elf_parse_eh_frame): When relocatable output, don't set
+ flags enabling conversion of CIEs and FDEs to use relative encoding.
+ (find_merged_cie): Similarly.
+ (_bfd_elf_write_section_eh_frame): Don't edit FDEs when
+ relocatable, except for CIE pointer.
+ * elflink.c (bfd_elf_reloc_symbol_deleted_p): Return true for
+ relocs against symbols in dropped comdat group sections.
+ (bfd_elf_discard_info): Do some eh_frame optimisation when
+ relocatable.
- * elfxx-mips.c (mips_use_local_got_p): New function.
- (mips_elf_count_got_symbols, mips_elf_calculate_relocation): Use it.
- (_bfd_mips_elf_check_relocs): Set pointer_equality_needed for
- GOT and absolute references.
+2014-10-09 Jose E. Marchesi <jose.marchesi@oracle.com>
-2013-10-09 Roland McGrath <mcgrathr@google.com>
+ * elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): Handle
+ the hwcaps2 object attribute.
- * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Cast switch
- expression to int to silence over-eager compiler warnings.
+2014-10-04 Alan Modra <amodra@gmail.com>
- * xcofflink.c (_bfd_xcoff_bfd_final_link): Don't touch EREL in
- loop that doesn't use (or initialize) it.
+ PR 17447
+ * elf-bfd.h (struct eh_cie_fde): Comment re NULL u.fde.cie_inf.
+ * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Mark zero address
+ range FDEs for discarding.
+ (vma_compare): Sort on range after address.
+ (_bfd_elf_gc_mark_fdes): Test for NULL u.fde.cie_inf.
+ (_bfd_elf_discard_section_eh_frame): Likewise. Write "FDE" in
+ error message rather than "fde".
+ (_bfd_elf_write_section_eh_frame_hdr): Write "PC" and "FDE" in
+ error message.
- * elfxx-tilegx.c (tilegx32_plt_tail_entry, tilegx32_plt_tail_entry):
- Move second const qualifier so it applies to the pointer.
+2014-09-29 H.J. Lu <hongjiu.lu@intel.com>
-2013-10-09 Nick Clifton <nickc@redhat.com>
+ PR ld/17440
+ * elf32-i386.c (elf_i386_fbsd_post_process_headers): Fix build
+ for OLD_FREEBSD_ABI_LABEL.
- PR binutils/16022
- * elf32-rx.c (rx_dump_symtab): Add missing break statements.
+2014-09-24 Markus Trippelsdorf <markus@trippelsdorf.de>
-2013-10-09 Tom Tromey <tromey@redhat.com>
+ PR 17422
+ * plugin.c (try_claim): New function. Moved from
+ bfd_plugin_object_p.
+ (try_load_plugin): Pass through bfd. Add test.
+ (load_plugin): Pass through bfd.
+ (bfd_plugin_object_p): Move logic to try_claim.
- * opncls.c (get_alt_debug_link_info_shim): Update type of 'len'.
+2014-09-23 Sterling Augustine <augustine.sterling@gmail.com>
-2013-10-09 Nick Clifton <nickc@redhat.com>
+ * elf32-xtensa.c (is_resolvable_asm_expansion): for cross-section
+ call relaxation use furthermost addresses where call source and
+ destination can be to check whether it's in the range of a direct
+ call.
- PR ld/16021
- * elf32-rl78.c (rl78_dump_symtab): Delete.
- (rl78_get_reloc): Delete.
+2014-09-22 Alan Modra <amodra@gmail.com>
-2013-10-09 Tom Tromey <tromey@redhat.com>
+ * elf-eh-frame.c (_bfd_elf_write_section_eh_frame_hdr): Don't return
+ false for overflow or overlapping FDEs. Give more detail in
+ error messages.
- * bfd-in2.h: Rebuild.
- * opncls.c (bfd_get_alt_debug_link_info): Change type of
- buildid_len to bfd_size_type.
+2014-09-22 Andrew Bennett <andrew.bennett@imgtec.com>
-2013-10-09 Sergio Durigan Junior <sergiodj@redhat.com>
+ * elfxx-mips.c (mips_elf_calculate_relocation): Don't sign extend
+ the addend if relocations are RELA.
- PR binutils/15993
- * elf32-m32c.c (dump_symtab): Add missing "break;" statement on each
- "case". Reindent "switch" statements.
+2014-09-22 Kuan-Lin Chen <kuanlinchentw@gmail.com>
-2013-10-08 Tom Tromey <tromey@redhat.com>
+ * elf32-nds32.c (nds32_elf_ex9_build_hash_table,
+ nds32_elf_ex9_relocation_check): Synchronize the argument type.
- * bfd-in2.h: Rebuild.
- * opncls.c (bfd_get_alt_debug_link_info): Add buildid_len
- parameter. Change type of buildid_out. Update.
- (get_alt_debug_link_info_shim): New function.
- (bfd_follow_gnu_debuglink): Use it.
+2014-09-19 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
-2013-10-08 Andreas Schwab <schwab@suse.de>
+ * elf32-s390.c: Don't replace R_390_TLS_LE32 with R_390_TLS_TPOFF
+ for PIE.
+ * elf64-s390.c: Don't replace R_390_TLS_LE64 with R_390_TLS_TPOFF
+ for PIE.
- * elf32-m68k.c (elf_m68k_size_dynamic_sections): Add DT_DEBUG also
- for PIE executables.
+2014-09-18 Jan Kratochvil <jan.kratochvil@redhat.com>
-2013-10-04 Jan-Benedict Glaw <jbglaw@lug-owl.de>
+ PR gdb/17407
+ * elfcode.h (bfd_from_remote_memory): Use SIZE for HIGH_OFFSET.
- * configure: Regenerate.
+2014-09-16 Terry Guo <terry.guo@arm.com>
-2013-10-03 Will Newton <will.newton@linaro.org>
+ * elf32-arm.c (elf32_arm_merge_eabi_attributes): Return false if
+ failed to merge.
- * configure: Regenerate.
- * configure.in: Build elf-ifunc.o for AArch64.
- * elfnn-aarch64.c: Include objalloc.h.
- (elfNN_aarch64_local_htab_hash): New function.
- (elfNN_aarch64_local_htab_eq): New function.
- (elfNN_aarch64_get_local_sym_hash): New function.
- (elfNN_aarch64_link_hash_table_create): Initialize local STT_GNU_IFUNC
- symbol hash.
- (elfNN_aarch64_hash_table_free): Free local STT_GNU_IFUNC symbol hash.
- (elfNN_aarch64_final_link_relocate): Add sym argument. Add support
- for handling STT_GNU_IFUNC symbols.
- (elfNN_aarch64_gc_sweep_hook): Add support for garbage collecting
- references to STT_GNU_IFUNC symbols.
- (elfNN_aarch64_adjust_dynamic_symbol): Add support for handling
- STT_GNU_IFUNC symbols.
- (elfNN_aarch64_check_relocs): Add support for handling STT_GNU_IFUNC
- symbols. Ensure we don't increase plt.refcount from -1 to 0.
- (elfNN_aarch64_post_process_headers): Call _bfd_elf_set_osabi.
- (elfNN_aarch64_is_function_type): Remove function.
- (elfNN_aarch64_allocate_dynrelocs): Handle STT_GNU_IFUNC symbols.
- (elfNN_aarch64_allocate_ifunc_dynrelocs): New function.
- (elfNN_aarch64_allocate_local_dynrelocs): New function.
- (elfNN_aarch64_allocate_local_ifunc_dynrelocs): New function.
- (elfNN_aarch64_size_dynamic_sections): Call
- elfNN_aarch64_allocate_local_dynrelocs.
- (elfNN_aarch64_create_small_pltn_entry): Add info argument.
- Add support for creating .iplt entries for STT_GNU_IFUNC symbols.
- (elfNN_aarch64_finish_dynamic_symbol): Add support for handling
- STT_GNU_IFUNC symbols and .iplt.
- (elfNN_aarch64_finish_local_dynamic_symbol): New function.
- (elfNN_aarch64_finish_dynamic_sections): Call
- elfNN_aarch64_finish_local_dynamic_symbol.
-
-2013-09-30 Nick Clifton <nickc@redhat.com>
-
- * cpu-msp430.c: Use printable names that match the values
- displayed by readelf.
-
-2013-08-25 Andrew Pinski <apinski@cavium.com>
-
- * elfnn-aarch64.c (TCB_SIZE): Base on the ARCH_SIZE rather than a
- fixed size of 16.
-
-2013-09-24 Gregory Fong <gregory.0xf0@gmail.com>
-
- * elfxx-mips.c (mips_elf_create_got_section): Hide
- _GLOBAL_OFFSET_TABLE_.
-
-2013-09-24 Alan Modra <amodra@gmail.com>
-
- * elf32-mips.c (ELF_OSABI): Undef for vxworks.
-
-2013-09-24 Alan Modra <amodra@gmail.com>
-
- * syms.c (_bfd_stab_section_find_nearest_line): Ignore partial
- stabs at end of .stab. Tidy variable usage. Don't drop the need
- for a NULL function name stab if If N_FUN stab is ignored.
- Ensure index entry count loop matches write loop.
-
-2013-09-20 Alan Modra <amodra@gmail.com>
+2014-09-16 Kuan-Lin Chen <kuanlinchentw@gmail.com>
- * configure: Regenerate.
+ * bfd-in2.h: Regenerate.
+ * elf32-nds32.c (nds32_elf_mkobject): Hook bfd_elf32_mkobject.
+ (nds32_elf_relax_section): Code refactoring.
+ (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2,
+ nds32_elf_relax_longcall3, nds32_elf_relax_longcall4,
+ nds32_elf_relax_longcall5, nds32_elf_relax_longcall6): Relax call
+ pattern. The first three is moved from nds32_elf_relax_section,
+ and the last three is new function.
+ (nds32_elf_relax_longjump1, nds32_elf_relax_longjump2,
+ nds32_elf_relax_longjump3, nds32_elf_relax_longjump4,
+ nds32_elf_relax_longjump5, nds32_elf_relax_longjump6,
+ nds32_elf_relax_longjump7): Relax condition branch pattern. The first
+ three is moved from nds32_elf_relax_section, and the last four
+ is new function.
+ (nds32_elf_relax_loadstore, nds32_elf_relax_lo12): Relax load-store
+ pattern and address setting pattern.
+ (nds32_elf_relax_piclo12, nds32_elf_relax_ptr,
+ nds32_elf_relax_pltgot_suff, nds32_elf_relax_got_suff,
+ nds32_elf_relax_gotoff_suff): Relax pic pattern.
+ (nds32_elf_relax_letlslo12, nds32_elf_relax_letlsadd,
+ nds32_elf_relax_letlsls): Relax TLS pattern.
+ (nds32_relax_adjust_label): Adjust alignment and nop.
+ (nds32_elf_pick_relax): Choose relaxation optimization.
+ (nds32_elf_get_relocated_section_contents): New hook.
+ (nds32_elf_order_insn_times, nds32_elf_ex9_build_itable): Release ex9
+ table 234th entry.
+ * elf32-nds32.h: Declare.
+ * libbfd.h: Regenerate.
+ * reloc.c: Add nds32 new relocations.
+
+2014-09-15 Chen Gang <gang.chen.5i5j@gmail.com>
+
+ * dwarf2.c (find_abstract_instance_name): Use 'form' instead of
+ 'name' for the typo issue, which related with commit
+ 60d77146a249ae9b51d7ce98930cdbedb2cfa352.
+
+2014-09-15 Andrew Bennett <andrew.bennett@imgtec.com>
+ Matthew Fortune <matthew.fortune@imgtec.com>
+
+ * aoutx.h (NAME (aout, machine_type)): Add mips32r6 and mips64r6.
+ * archures.c (bfd_architecture): Likewise.
+ * bfd-in2.h (bfd_architecture): Likewise.
+ (bfd_reloc_code_real): Add relocs BFD_RELOC_MIPS_21_PCREL_S2,
+ BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3 and
+ BFD_RELOC_MIPS_19_PCREL_S2.
+ * cpu-mips.c (arch_info_struct): Add mips32r6 and mips64r6.
+ * elf32-mips.c: Define relocs R_MIPS_PC21_S2, R_MIPS_PC26_S2
+ R_MIPS_PC18_S3, R_MIPS_PC19_S2, R_MIPS_PCHI16 and R_MIPS_PCLO16.
+ (mips_reloc_map): Add entries for BFD_RELOC_MIPS_21_PCREL_S2,
+ BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3,
+ BFD_RELOC_MIPS_19_PCREL_S2, BFD_RELOC_HI16_S_PCREL and
+ BFD_RELOC_LO16_PCREL.
+ * elf64-mips.c: Define REL, and RELA relocations R_MIPS_PC21_S2,
+ R_MIPS_PC26_S2, R_MIPS_PC18_S3, R_MIPS_PC19_S2, R_MIPS_PCHI16
+ and R_MIPS_PCLO16.
+ (mips_reloc_map): Add entries for BFD_RELOC_MIPS_21_PCREL_S2,
+ BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3,
+ BFD_RELOC_MIPS_19_PCREL_S2, BFD_RELOC_HI16_S_PCREL and
+ BFD_RELOC_LO16_PCREL.
+ * elfn32-mips.c: Likewise.
+ * elfxx-mips.c (MIPSR6_P): New define.
+ (mipsr6_exec_plt_entry): New array.
+ (hi16_reloc_p): Add support for R_MIPS_PCHI16.
+ (lo16_reloc_p): Add support for R_MIPS_PCLO16.
+ (aligned_pcrel_reloc_p): New function.
+ (mips_elf_relocation_needs_la25_stub): Add support for relocs:
+ R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
+ (mips_elf_calculate_relocation): Add support for relocs:
+ R_MIPS_PC21_S2, R_MIPS_PC26_S2, R_MIPS_PC18_S3, R_MIPS_PC19_S2,
+ R_MIPS_PCHI16 and R_MIPS_PCLO16.
+ (_bfd_elf_mips_mach): Add support for mips32r6 and mips64r6.
+ (mips_elf_add_lo16_rel_addend): Add support for R_MIPS_PCHI16.
+ (_bfd_mips_elf_check_relocs): Add support for relocs:
+ R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
+ (_bfd_mips_elf_relocate_section): Add a check for unaligned
+ pc relative relocs.
+ (_bfd_mips_elf_finish_dynamic_symbol): Add support for MIPS r6
+ plt entry.
+ (mips_set_isa_flags): Add support for mips32r6 and mips64r6.
+ (_bfd_mips_elf_print_private_bfd_data): Likewise.
+ (mips_32bit_flags_p): Add support for mips32r6.
+ * libbfd.h (bfd_reloc_code_real_names): Add entries for
+ BFD_RELOC_MIPS_21_PCREL_S2, BFD_RELOC_MIPS_26_PCREL_S2,
+ BFD_RELOC_MIPS_18_PCREL_S3 and BFD_RELOC_MIPS_19_PCREL_S2.
+ * reloc.c: Document relocs BFD_RELOC_MIPS_21_PCREL_S2,
+ BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3 and
+ BFD_RELOC_MIPS_19_PCREL_S2.
+ * config.bfd: Add mips*-img-elf* target triple.
-2013-09-18 Tristan Gingold <gingold@adacore.com>
+2014-09-12 Andrew Bennett <andrew.bennett@imgtec.com>
- * configure.in: Bump version to 2.24.51
- * configure: Regenerate.
+ * config.bfd: Add mips*-img-elf* target triple.
-2013-09-17 Doug Gilmore <Doug.Gilmore@imgtec.com>
+2014-09-12 Alan Modra <amodra@gmail.com>
- * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): Handle
- EF_MIPS_FP64.
+ * elf-bfd.h (struct eh_frame_array_ent): Add "range".
+ * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Stash address
+ range of FDEs to hdr_info->array.
+ (_bfd_elf_write_section_eh_frame_hdr): Report overflow in
+ .eh_frame_hdr entries, and overlapping FDEs.
-2013-08-31 John David Anglin <dave.anglin@bell.net>
+2014-09-10 Alan Modra <amodra@gmail.com>
- * elf64-hppa.c (elf_hppa_final_link_relocate): Add missing '%' to
- format string.
+ * elf.c (assign_file_positions_except_relocs): Move section header
+ placement to..
+ (_bfd_elf_assign_file_positions_for_relocs): ..here. Make static.
+ * elf-bfd.h (_bfd_elf_assign_file_positions_for_relocs): Delete.
+ * elflink.c (bfd_elf_final_link): Don't call above function.
-2013-08-29 Jakub Jelinek <jakub@redhat.com>
+2014-08-30 Alan Modra <amodra@gmail.com>
- * elf64-x86-64.c (elf_x86_64_check_tls_transition): Allow
- 64-bit -mcmodel=large -fpic TLS GD and LD sequences.
- (elf_x86_64_relocate_section): Handle -mcmodel=large -fpic
- TLS GD and LD sequences in GD->LE, GD->IE and LD->LE transitions.
+ * elf32-ppc.c (ppc_elf_relax_section): Fix off by one error.
-2013-08-27 Alan Modra <amodra@gmail.com>
+2014-08-29 Alan Modra <amodra@gmail.com>
- * elf-bfd.h (struct elf_backend_data): Remove as_needed_cleanup.
- Add notice_as_needed.
- * elf64-ppc.c (elf_backend_as_needed_cleanup): Don't define.
- (elf_backend_notice_as_needed): Define.
- (ppc64_elf_as_needed_cleanup): Rename and adjust..
- (ppc64_elf_notice_as_needed): ..to this.
- * elflink.c (_bfd_elf_notice_as_needed): New function, extracted..
- (elf_link_add_object_symbols): ..from here.
- * elfxx-target.h (elf_backend_as_needed_cleanup): Don't define.
- (elf_backend_notice_as_needed): Define..
- (elfNN_bed): ..and use here.
+ * elf64-ppc.c (ppc64_elf_relocate_section): Report a different
+ error for calls via a toc adjusting stub without a nop.
-2013-08-26 Roland McGrath <mcgrathr@google.com>
+2014-08-29 Alan Modra <amodra@gmail.com>
- * archures.c (bfd_mach_i386_nacl, bfd_mach_i386_i386_nacl): New macros.
- (bfd_mach_x86_64_nacl, bfd_mach_x64_32_nacl): New macros.
- * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): New function.
- (bfd_i386_nacl_arch): New variable.
- (bfd_x86_64_nacl_arch, bfd_x64_32_nacl_arch): New variables.
- (bfd_x64_32_arch_intel_syntax): Link them into the list.
- * bfd-in2.h: Regenerate.
+ * vms-alpha.c (alpha_vma_object_p): Don't return file_truncated
+ error. Remove redundant bfd_set_error.
-2013-08-26 Roland McGrath <mcgrathr@google.com>
+2014-08-29 Alan Modra <amodra@gmail.com>
- * elf-nacl.c (nacl_modify_segment_map): Fix logic reordering the
- elf_segment_map list. If an executable segment is page-aligned
- but does not end with a full page, then append a fake section into
- the segment map entry that pads out the page.
- (nacl_final_write_processing): New function. Write the code fill
- laid out in nacl_modify_segment_map.
- * elf-nacl.h: Declare it.
- * elf32-arm.c (elf32_arm_nacl_final_write_processing): New function.
- (elf_backend_final_write_processing): Define it for NaCl backend.
- * elf32-i386.c (elf_backend_final_write_processing): Likewise.
- * elf64-x86-64.c (elf_backend_final_write_processing): Likewise.
+ * srec.c (srec_scan): Revert last change. Report an error for
+ S-records with less than the miniumum byte count.
- * elf-nacl.c (segment_eligible_for_headers): Rename MAXPAGESIZE
- parameter to MINPAGESIZE.
- (nacl_modify_segment_map): Use minpagesize instead of maxpagesize.
+2014-08-28 H.J. Lu <hongjiu.lu@intel.com>
- * elf32-arm.c (ELF_MINPAGESIZE, ELF_COMMONPAGESIZE): #undef for NaCl.
+ * srec.c (srec_scan): Return error for 0 size.
-2013-08-24 Maciej W. Rozycki <macro@linux-mips.org>
+2014-08-27 H.J. Lu <hongjiu.lu@intel.com>
- * elf32-tilepro.c (tilepro_elf_finish_dynamic_sections): Don't
- set GOT's entry size if there is no ELF section data.
- * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
- * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_sections):
- Likewise.
+ PR ld/17306
+ * elf32-i386.c (elf_i386_convert_mov_to_lea): Use bfd_is_abs_section
+ to check discarded input section.
+ * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
-2013-08-23 H.J. Lu <hongjiu.lu@intel.com>
+2014-08-27 H.J. Lu <hongjiu.lu@intel.com>
- * elf64-x86-64.c (get_elf_x86_64_arch_data): New.
- (get_elf_x86_64_backend_data): Use it.
- (elf_x86_64_size_dynamic_sections): Likewise.
+ PR ld/17313
+ * elflink.c (elf_link_add_object_symbols): Don't attach dynamic
+ sections to input from ld --just-symbols.
-2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
+2014-08-26 DJ Delorie <dj@redhat.com>
- PR binutils/15834
- * bfdio.c: Fix typos.
- * elf32-spu.c: Likewise.
- * elfnn-aarch64.c: Likewise.
+ * elf32-rl78.c (rl78_elf_relax_section): Disambiguate test for
+ relaxation type.
-2013-08-21 Tristan Gingold <gingold@adacore.com>
+2014-08-26 Jiong Wang <jiong.wang@arm.com>
- * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Also count
- .ovrflo sections.
- * coffcode.h (coff_compute_section_file_positions): Force
- match between file offset and vma offset.
+ * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Initialize non_got_ref
+ properly for MOVW_G0/1/2_NC and MOVW_G3. Reject them when linking
+ shared library.
+ (elfNN_aarch64_gc_sweep_hook): Add check on these relocs.
-2013-08-21 Alan Modra <amodra@gmail.com>
+2014-08-26 Nick Clifton <nickc@redhat.com>
- * elflink.c (_bfd_elf_merge_symbol): Set *poldbfd, *poldweak,
- and *poldalignment before exiting when !relocs_compatible.
+ * config.bfd: Fix typo in or1knd selection.
-2013-08-21 Alan Modra <amodra@gmail.com>
+2014-08-22 Kai Tietz <ktietz@redhat.com>
- * elflink.c (_bfd_elf_define_linkage_sym): Don't set STV_INTERNAL
- symbols to STV_HIDDEN.
+ PR binutils/11822
+ * coffcode.h (coff_compute_section_file_positions): Keep
+ FileAlignment valid as set.
-2013-08-14 John Tytgat <john@bass-software.com>
+2014-08-22 Alan Modra <amodra@gmail.com>
- PR ld/15787
- * elf32-arm.c (elf32_arm_final_link_relocate): Use origin of output
- segment containing the relocating symbol instead of assuming 0 for
- sb group relocations.
+ * elf-eh-frame.c (struct cie): Delete "output_sec" field.
+ (cie_eq, cie_compute_hash): Use output_section from cie_inf instead.
-2013-08-09 Nick Clifton <nickc@redhat.com>
+2014-08-22 Alan Modra <amodra@gmail.com>
- * elf32-rl78.c (rl78_elf_merge_private_bfd_data): Complain if G10
- flag bits do not match.
- (rl78_elf_print_private_bfd_data): Describe G10 flag.
+ * elf-bfd.h (struct eh_frame_hdr_info): Delete merge_cies and
+ parsed_eh_frames.
+ (_bfd_elf_begin_eh_frame_parsing): Delete.
+ (_bfd_elf_end_eh_frame_parsing): Delete.
+ * elf-eh-frame.c (_bfd_elf_begin_eh_frame_parsing): Delete.
+ (_bfd_elf_end_eh_frame_parsing): Delete.
+ (_bfd_elf_parse_eh_frame): Don't test parsed_eh_frame. Test
+ !info->relocatable in place of merge_cies.
+ * elflink.c (bfd_elf_gc_sections, bfd_elf_discard_info): Adjust.
+ * elf64-ppc.c (glink_eh_frame_cie): Pad to multiple of 8.
+ (ppc64_elf_size_stubs): Likewise pad stub FDE.
+ (ppc64_elf_build_stubs): Move code setting glink .eh_frame to..
+ (ppc64_elf_size_stubs): ..here and..
+ (ppc64_elf_finish_dynamic_sections): ..here.
-2013-08-05 John Tytgat <john@bass-software.com>
+2014-08-21 Maciej W. Rozycki <macro@codesourcery.com>
- * po/BLD-POTFILES.in: Regenerate.
- * po/SRC-POTFILES.in: Likewise.
+ * elf64-ppc.h (ppc64_elf_set_toc): Fix indentation.
-2013-07-31 John Tytgat <john@bass-software.com>
+2014-08-21 Tony Wang <tony.wang@arm.com>
- PR ld/15787
- * elf32-arm.c (elf32_arm_final_link_relocate): Base SB on the
- output section VMA.
+ * elf32-arm.c (elf32_arm_final_link_relocate): Implement
+ the veneer routine for R_ARM_THM_JUMP19.
+ (arm_type_of_stub): Add conditional clause for R_ARM_THM_JUMP19
+ (elf32_arm_size_stub): Ditto.
-2013-07-28 Maciej W. Rozycki <macro@linux-mips.org>
+2014-08-20 Roland McGrath <mcgrathr@google.com>
- * elf64-hppa.c (elf64_hppa_finish_dynamic_sections)
- <DT_HP_LOAD_MAP>: Return unsuccessfully if there's no `.data'
- section.
+ PR ld/17277
+ * elf32-arm.c (elf32_arm_check_relocs): Increment P->pc_count for
+ all reloc types with pc_relative set in the howto, not just for
+ R_ARM_REL32 and R_ARM_REL32_NOI.
+ (allocate_dynrelocs_for_symbol): Update comment.
+ (elf32_arm_gc_sweep_hook): For all reloc types with pc_relative
+ set in the howto, set call_reloc_p and may_need_local_target_p but
+ not may_become_dynamic_p; not only for R_ARM_REL32 and R_ARM_REL32_NOI.
+ (elf32_arm_check_relocs): Likewise.
-2013-07-27 Andrew Pinski <apinski@cavium.com>
+2014-08-20 Will Newton <will.newton@linaro.org>
- * elfnn-aarch64.c (elfNN_aarch64_check_relocs):
- Use the correct alignment for
- _bfd_elf_make_dynamic_reloc_section for ILP32.
+ * config.bfd: Default armeb-*-eabi* to big endian.
-2013-07-27 Andrew Pinski <apinski@cavium.com>
+2014-08-19 Alan Modra <amodra@gmail.com>
- * elfnn-aarch64.c (elfNN_aarch64_howto_from_bfd_reloc): Handle
- BFD_RELOC_AARCH64_NONE explicitly.
+ * configure: Regenerate.
-2013-07-27 Maciej W. Rozycki <macro@linux-mips.org>
+2014-08-18 Alan Modra <amodra@gmail.com>
- * elf32-vax.c (elf_vax_finish_dynamic_sections): Don't set GOT's
- entry size if there is no ELF section data.
+ * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't attempt to
+ use dynrelocs for ifunc.
+ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Similarly.
-2013-07-27 Maciej W. Rozycki <macro@linux-mips.org>
+2014-08-18 Alan Modra <amodra@gmail.com>
- * elf32-vax.c (elf_vax_check_relocs) <R_VAX_GOT32, R_VAX_PLT32>:
- Don't check symbol visibility here. Remove a check already
- asserted for.
- (elf_vax_instantiate_got_entries): Use SYMBOL_REFERENCES_LOCAL
- instead of individual checks.
- (elf_vax_relocate_section) <R_VAX_GOT32, R_VAX_PLT32>: Only
- check the offset to decide if produce a GOT or PLT entry.
- Remove redundant assertions. Remove code to produce GOT entries
- for local symbols. Remove a duplicate comment and add a comment
- on GOT relocations.
- (elf_vax_finish_dynamic_symbol): Remove code to produce RELATIVE
- dynamic relocs.
+ PR 17287
+ * elflink.c (on_needed_list): Only consider libraries that have
+ been loaded.
-2013-07-27 Maciej W. Rozycki <macro@linux-mips.org>
+2014-08-18 Alan Modra <amodra@gmail.com>
- * elf32-vax.c (elf_vax_always_size_sections): Correct a comment
- typo.
+ * elflink.c (bfd_elf_discard_info): Return int error status.
+ * stabs.c (_bfd_discard_section_stabs): Comment typo fix.
+ * bfd-in.h (bfd_elf_discard_info): Updata prototype.
+ * bfd-in2.h: Regenerate.
-2013-07-27 Maciej W. Rozycki <macro@linux-mips.org>
+2014-08-14 Alan Modra <amodra@gmail.com>
- * elf32-vax.c (elf_vax_discard_got_entries): New function.
- (elf_vax_always_size_sections): Likewise.
- (elf_vax_size_dynamic_sections): Remove code moved to
- elf_vax_always_size_sections. Make comment on
- elf_vax_instantiate_got_entries match reality.
- (elf_vax_instantiate_got_entries): Assert that rather than check
- if dynobj is null. Don't check for dynamic_sections_created.
- Make function description match reality.
- (elf_backend_always_size_sections): New macro.
+ * peXXigen.c (pe_print_reloc): Protect against access past end
+ of .reloc section.
-2013-07-25 Alan Modra <amodra@gmail.com>
+2014-08-14 Alan Modra <amodra@gmail.com>
- * elf64-ppc.c (struct ppc64_elf_obj_tdata): Replace opd_relocs
- with a union.
- (opd_entry_value): Cache .opd section contents.
- (ppc64_elf_relocate_section): Adjust.
+ PR 16563
+ * elflink.c (bfd_elf_discard_info): Process .eh_frame and .stab
+ in the order they are mapped to output sections.
-2013-07-25 Alan Modra <amodra@gmail.com>
+2014-08-14 Alan Modra <amodra@gmail.com>
- PR ld/15762
- PR ld/12761
- * elflink.c (elf_link_add_object_symbols): Correct test in
- last patch. Remove unnecessary code.
+ * configure.ac: Delete redundant plugin related checks.
+ * configure: Regenerate.
-2013-07-24 Tristan Gingold <gingold@adacore.com>
+2014-08-13 Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
- * coff-rs6000.c (xcoff_howto_table): Fix masks and pc_relative for
- R_RBR. Add numbers in comments.
- (_bfd_xcoff_reloc_type_lookup): Handle BFD_RELOC_PPC_B16.
- * coff64-rs6000.c: Likewise.
+ * elf32-or1k.c (or1k_elf_relocate_section, or1k_elf_check_relocs,
+ allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL
+ and SYMBOLIC_BIND.
-2013-07-20 Alan Modra <amodra@gmail.com>
+2014-08-12 Alan Modra <amodra@gmail.com>
- PR ld/15762
- PR ld/12761
- * elflink.c (elf_link_add_object_symbols): Don't clobber
- .gnu.warning.symbol sections when shared.
+ * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Only call "notice"
+ here when not calling the generic add_symbol function. Formatting.
+ Correct handling of indirect symbols. Update notice call.
+ * elflink.c (_bfd_elf_notice_as_needed): Update notice call.
+ * linker.c (_bfd_generic_link_add_one_symbol): Create indirect
+ symbols early. Update notice call. Add comments regarding weak
+ symbols vs. indirect.
-2013-07-19 Nick Clifton <nickc@redhat.com>
+2014-08-12 Alan Modra <amodra@gmail.com>
- * elf32-rx.c (rx_elf_relocate_section): Fix typo: move
- saw_subtract from R_RX_OPdiv to R_RX_OPneg.
+ PR ld/16746
+ * linker.c (_bfd_generic_link_add_one_symbol <WARN>): Handle
+ !lto_plugin_active.
-2013-07-18 Travis Snoozy <quandary@remstate.com>
+2014-08-07 Chen Gang <gang.chen.5i5j@gmail.com>
- PR ld/15721
- * elf32-msp430.c (R_MSP430_10_PCREL): Use 10-bit source and
- destination masks.
- * R_MSP430_2X_PCREL: Likewise.
- * R_MSP430X_10_PCREL: Likewise.
- * R_MSP430X_2X_PCREL: Likewise.
+ * coff-ppc.c (coff_ppc_relocate_section): Ensure local symbols are
+ zero terminated.
-2013-07-18 Terry Guo <terry.guo@arm.com>
+2014-08-07 H.J. Lu <hongjiu.lu@intel.com>
+ Alan Modra <amodra@gmail.com>
- * elf32-arm.c (arm_type_of_stub): Don't use ST_BRANCH_TO_ARM for
- thumb only targets.
- (elf32_arm_final_link_relocate): Likewise.
+ PR ld/16746
+ * linker.c (_bfd_generic_link_add_one_symbol): Don't issue a
+ warning for references in LTO IR to warning symbols.
-2013-07-18 Bill Neubauer <wcn@google.com>
+2014-08-07 Alan Modra <amodra@gmail.com>
- * mach-o.c (mach_o_section_name_xlat dw): Add entry for
- .debug_gdb_scripts
+ * linker.c (WARN, CWARN): Collapse these states to WARN.
+ (_bfd_generic_link_add_one_symbol): Use old CWARN case for
+ new WARN.
-2013-07-18 Roland McGrath <mcgrathr@google.com>
+2014-08-05 Doug Evans <dje@google.com>
- * elf32-arm.c (elf32_arm_stub_long_branch_arm_nacl): New variable.
- (elf32_arm_stub_long_branch_arm_nacl_pic): New variable.
- (arm_build_one_stub): Increase MAXRELOCS to 3.
- (arm_type_of_stub): Use them if GLOBALS->nacl_p.
- (struct elf32_arm_link_hash_table): Give add_stub_section member's
- pointee type a third argument.
- (elf32_arm_create_or_find_stub_sec): Update caller.
- (elf32_arm_size_stubs): Update argument type.
- * bfd-in.h (elf32_arm_size_stubs): Update decl.
* bfd-in2.h: Regenerate.
+ * libcoff.h: Regenerate.
+
+2014-08-05 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * elfxx-mips.c (_bfd_mips_elf_discard_info): Set section's
+ rawsize if changing size.
+
+2014-08-05 Alan Modra <amodra@gmail.com>
+
+ PR ld/17226
+ * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Typo fix.
+
+2014-08-05 Alan Modra <amodra@gmail.com>
+
+ * linker.c (generic_link_check_archive_element): Move handling
+ of command link -u symbols with a common symbol def to the
+ code handling non-common symbols so that archive element symbols
+ are loaded. Use generic_link_add_object_symbols.
+
+2014-08-05 Alan Modra <amodra@gmail.com>
+
+ PR 13557
+ * linker.c (struct archive_list, struct archive_hash_entry,
+ struct archive_hash_table, archive_hash_newfunc,
+ archive_hash_table_init, archive_hash_lookup, archive_hash_allocate,
+ archive_hash_table_free): Delete.
+ (_bfd_generic_link_add_archive_symbols): Add h and name params to
+ checkfn. Rewrite using a straight-forward scan over archive map.
+ (generic_link_check_archive_element_no_collect,
+ generic_link_check_archive_element_collect,
+ generic_link_check_archive_element): Add h and name params.
+ * aoutx.h (aout_link_check_archive_element): Likewise.
+ * pdp11.c (aout_link_check_archive_element): Likewise.
+ * xcofflink.c (xcoff_link_check_archive_element): Likewise.
+ * cofflink.c (coff_link_check_archive_element): Likewise. Don't
+ scan symbols, simply add archive element whenever h is undefined.
+ (coff_link_check_ar_symbols): Delete.
+ * ecoff.c (read_ext_syms_and_strs): Delete.
+ (reread_ext_syms_and_strs): Delete.
+ (ecoff_link_check_archive_element): Add h and name param. Don't
+ scan symbols, simply add based on h. Use ecoff_link_add_object_symbols.
+ * elflink.c (elf_link_is_defined_archive_symbol): Don't test
+ archive_pass.
+ (elf_link_add_archive_symbols): Delete "defined" array, merge
+ functionality into "included". Make "included" a char array. Don't
+ set or test archive_pass.
+ * libbfd-in.h (_bfd_generic_link_add_archive_symbols): Update.
* libbfd.h: Regenerate.
-2013-07-15 Maciej W. Rozycki <macro@codesourcery.com>
-
- * elfxx-mips.c (mips_elf_merge_obj_attributes): Replace hardcoded
- magic numbers with enum values.
+2014-08-01 Takashi Yoshii <yoshii.takashi@renesas.com>
-2013-07-12 Roland McGrath <mcgrathr@google.com>
+ PR 10373
+ * elf32-sh.c (sh_elf_relax_section): Add jmp to bra relaxing.
- * reloc.c: Add BFD_RELOC_390_PC12DBL, BFD_RELOC_390_PLT12DBL,
- BFD_RELOC_390_PC24DBL, BFD_RELOC_390_PLT24DBL (should have
- been added here with 2013-07-05 elf32-s390.c change).
- * bfd-in2.h: Regenerate (no-op).
- * libbfd.h: Regenerate (no-op).
+2014-07-29 Matthew Fortune <matthew.fortune@imgtec.com>
-2013-07-12 Maciej W. Rozycki <macro@codesourcery.com>
+ * elfxx-mips.c (ABI_O32_P, MIPS_ELF_ABIFLAGS_SECTION_NAME_P): New macro.
+ (mips_elf_obj_tdata): Add abiflags and abiflags_valid fields.
+ (bfd_mips_elf_swap_abiflags_v0_in): New function.
+ (bfd_mips_elf_swap_abiflags_v0_out): Likewise.
+ (_bfd_mips_elf_section_from_shdr): Handle SHT_MIPS_ABIFLAGS.
+ (_bfd_mips_elf_fake_sections): Likewise.
+ (_bfd_mips_elf_always_size_sections): Handle .MIPS.abiflags.
+ (_bfd_mips_elf_additional_program_headers): Account for new
+ PT_MIPS_ABIFLAGS program header.
+ (_bfd_mips_elf_modify_segment_map): Create PT_MIPS_ABIFLAGS segment and
+ associate with .MIPS.abiflags.
+ (_bfd_mips_elf_gc_mark_extra_sections): New function.
+ (bfd_mips_isa_ext, update_mips_abiflags_isa): New static function.
+ (infer_mips_abiflags): Likewise.
+ (_bfd_mips_elf_final_link): Handle .MIPS.abiflags.
+ (mips_32bit_flags_p): Moved higher.
+ (mips_elf_merge_obj_attributes, _bfd_mips_fp_abi_string): Error
+ checking for FP ABIs.
+ (_bfd_mips_elf_merge_private_bfd_data): Restructure and add abiflags
+ checks. Check EF_MIPS_FP64 flag consistency.
+ (print_mips_ases, print_mips_isa_ext): New static function.
+ (print_mips_fp_abi_value, get_mips_reg_size): Likewise.
+ (_bfd_mips_elf_print_private_bfd_data): Display abiflags data.
+ (_bfd_mips_post_process_headers): Set EI_ABIVERSION = 3 for
+ Val_GNU_MIPS_ABI_FP_64 or Val_GNU_MIPS_ABI_FP_64A.
+ * elfxx-mips.h (_bfd_mips_elf_gc_mark_extra_sections): New prototype.
+ * elf32-mips.c (elf_backend_gc_mark_extra_sections): Implement.
+ * elfn32-mips.c (elf_backend_gc_mark_extra_sections): Implement.
+ * elf64-mips.c (elf_backend_gc_mark_extra_sections): Implement.
- * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Handle
- EF_MIPS_NAN2008.
- (_bfd_mips_elf_print_private_bfd_data): Likewise.
+2014-07-28 Alan Modra <amodra@gmail.com>
-2013-07-09 Tristan Gingold <gingold@adacore.com>
+ PR 13227
+ * archive.c (_bfd_compute_and_write_armap): Warn on adding
+ __gnu_lto_slim to armap.
+ * linker.c (_bfd_generic_link_add_one_symbol): Warn on adding
+ __gnu_lto_slim to linker hash table.
- * vms-alpha.c (struct vms_private_data_struct): Remove
- flag_hash_long_names and flag_show_after_trunc.
- (hash_string): Remove.
- (_bfd_vms_length_hash_symbol): Remove.
- (alpha_vms_write_exec): Remove call to _bfd_vms_length_hash_symbol.
- (_bfd_vms_write_egsd): Likewise. Rewrite condition.
- (_bfd_vms_write_ehdr): Remove code that set removed flags.
- (_bfd_vms_write_etir): Remove call to _bfd_vms_length_hash_symbol.
- (vms_bfd_is_local_label_name): Remove trace call.
+2014-07-27 Anthony Green <green@moxielogic.org>
-2013-07-09 Tristan Gingold <gingold@adacore.com>
+ * config.bfd: Add moxie-*-moxiebox*.
- * hosts/alphavms.h: Include config.h and ansidecl.h, remove useless
- macros.
- * configure.com: Adjust to match changes in configure.
- * makefile.vms (OBJS): Update list.
+2014-07-21 Joel Sherrill <joel.sherrill@oarcorp.com>
-2013-07-05 Tristan Gingold <gingold@adacore.com>
+ Add or reactivate or1k-*-rtems*
+ * config.bfd (or1k-*-rtems*): Reactivate.
- * coffcode.h (coff_write_object_contents): Use ".ovrflo" name for
- overflow sections.
+2014-07-16 H.J. Lu <hongjiu.lu@intel.com>
-2013-07-05 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+ * elf32-i386.c (elf_i386_plt_sym_val): Match PLT entry only for
+ ELFOSABI_GNU input.
+ * elf64-x86-64.c (elf_x86_64_plt_sym_val): Likewise.
+ (elf_x86_64_plt_sym_val_offset_plt_bnd): Likewise.
- * elf32-s390.c: Add new relocation definitions R_390_PC12DBL,
- R_390_PLT12DBL, R_390_PC24DBL, and R_390_PLT24DBL.
- (elf_s390_reloc_type_lookup, elf_s390_check_relocs)
- (elf_s390_gc_sweep_hook, elf_s390_relocate_section): Support new
- relocations.
- * elf64-s390.c: See elf32-s390.c
- * bfd-in2.h: Add new relocs to enum bfd_reloc_code_real.
- * libbfd.h: Add new reloc strings.
+2014-07-16 H.J. Lu <hongjiu.lu@intel.com>
-2013-07-03 Marcus Shawcroft <marcus.shawcroft@arm.com>
+ PR binutils/17154
+ * elf32-i386.c (elf_i386_plt_sym_val): Only match R_*_JUMP_SLOT
+ and R_*_IRELATIVE relocation offset with PLT entry.
+ * elf64-x86-64.c (elf_x86_64_plt_sym_val): Likewise.
+ (elf_x86_64_plt_sym_val_offset_plt_bnd): New.
+ (elf_x86_64_get_synthetic_symtab): Use it.
- * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Reorder case
- values.
- (elfNN_aarch64_relocate_section): Likewise.
- (elfNN_aarch64_gc_sweep_hook): Likewise.
- (elfNN_aarch64_check_relocs): Likewise.
+2014-07-15 H.J. Lu <hongjiu.lu@intel.com>
-2013-07-03 Alan Modra <amodra@gmail.com>
+ PR ld/17057
+ * elf32-i386.c (elf_i386_compute_jump_table_size): Replace
+ next_tls_desc_index with elf.srelplt->reloc_count.
- * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't hide .TOC.
- when relocatable. Don't change root.type or type here.
- (ppc64_elf_set_toc): Set type of .TOC. to STT_OBJECT.
+2014-07-15 Alan Modra <amodra@gmail.com>
-2013-07-03 Alan Modra <amodra@gmail.com>
+ * cache.c (cache_bread_1): Don't return -1 when fread returns
+ a positive value.
- * elf64-ppc.c (struct ppc_stub_hash_entry): Delete "addend".
- (ppc64_elf_size_stubs): Don't set "addend".
- (ppc64_elf_relocate_section): Don't allow calls via
- toc-adjusting stubs without a following nop even in an
- executable, except for self-calls and both libc_start_main
- and .libc_start_main.
+2014-07-15 Alan Modra <amodra@gmail.com>
-2013-07-03 Alan Modra <amodra@gmail.com>
+ * elflink.c (elf_merge_st_other): Update comments. Simplify
+ visibility handling. Make isym const. Move code modifying
+ isym->st_other for --exclude-libs to..
+ (elf_link_add_object_symbols): ..here.
- * elf64-ppc.c (ppc64_elf_func_desc_adjust): Hide ".TOC.".
+2014-07-11 Maks Naumov <maksqwe1@ukr.net>
-2013-07-02 Tristan Gingold <gingold@adacore.com>
+ PR 17141
+ * elf.c (_bfd_elf_strtab_add): Check strtab name for failure.
- * coff-rs6000.c (xcoff_find_nearest_line_discriminator): Add missing
- line.
+2014-07-08 Nick Clifton <nickc@redhat.com>
-2013-07-02 Tristan Gingold <gingold@adacore.com>
+ PR ld/17110
+ * elf32-sh.c (sh_elf_osec_to_segment): Do not look for output
+ segments in input bfds.
- * vms-alpha.c (_bfd_generic_find_nearest_line_discriminator): Define.
- (_bfd_vms_find_nearest_line_discriminator): New function.
-
-2013-07-02 Tristan Gingold <gingold@adacore.com>
-
- * coff-rs6000.c (xcoff_create_csect_from_smclas): Handle more smclas.
-
-2013-07-02 Tristan Gingold <gingold@adacore.com>
-
- * coff-rs6000.c (xcoff_find_nearest_line_discriminator): New function.
- (rs6000coff_vec): Reference it.
-
-2013-07-02 Marcus Shawcroft <marcus.shawcroft@arm.com>
-
- * elfnn-aarch64.c (aarch64_elf_create_got_section): New.
- (elfNN_aarch64_check_relocs): Use aarch64_elf_create_got_section.
- (elfNN_aarch64_create_dynamic_sections): Do not define
- _GLOBAL_OFFSET_TABLE_; call aarch64_elf_create_got_section.
-
-2013-07-02 Marcus Shawcroft <marcus.shawcroft@arm.com>
-
- * ld-aarch64/emit-relocs-309-low.d: Adjust .text address.
- * ld-aarch64/emit-relocs-309-up.d: Adjust .got address.
- * ld-aarch64/emit-relocs-312.d: Adjust offsets into .got.
- * ld-aarch64/tls-relax-all.d: Likewise.
- * ld-aarch64/gc-got-relocs.d: Adjust expected .got content.
- * ld-aarch64/gc-tls-relocs.d: Likewise.
- * ld-aarch64/tls-relax-gd-ie.d: Likewise.
- * ld-aarch64/tls-relax-gdesc-ie-2.d: Likewise.
- * ld-aarch64/tls-relax-gdesc-ie.d: Likewise.
-
-2013-07-02 Alan Modra <amodra@gmail.com>
-
- * elf64-ppc.c (ppc64_elf_relocate_section): Set "relocation" for
- .TOC. after relocatable check.
-
-2013-07-01 Alan Modra <amodra@gmail.com>
-
- * elf64-ppc.h (ppc64_elf_toc): Delete.
- (ppc64_elf_set_toc): Declare.
- * elf64-ppc.c (ppc64_elf_toc_reloc): Replace call to ppc64_elf_toc
- with call the ppc64_elf_set_toc.
- (ppc64_elf_toc_ha_reloc, ppc64_elf_toc64_reloc): Likewise.
- (ppc64_elf_start_multitoc_partition): Likewise.
- (struct ppc_link_hash_table): Delete dot_toc_dot. Replace all uses
- with elf.hgot.
- (ppc64_elf_process_dot_syms): Don't make a fake function descriptor
- for ".TOC.".
- (ppc64_elf_check_relocs): Mark sections with a reference to .TOC.
- as needing a toc pointer.
- (ppc64_elf_size_stubs): Don't set dot_toc_dot here.
- (ppc64_elf_set_toc): Rename from ppc64_elf_toc. Add info param.
- Set elf.hgot value.
-
-2013-06-28 H.J. Lu <hongjiu.lu@intel.com>
-
- PR ld/15685
- * elf64-x86-64.c (elf_x86_64_relocate_section): Handle
- R_X86_64_DTPOFF64.
-
-2013-06-28 Nick Clifton <nickc@redhat.com>
-
- PR ld/15302
- * elf32-arm.c (allocate_dynrelocs_for_symbol): Revert previous patch.
-
-2013-06-27 Marcus Shawcroft <marcus.shawcroft@arm.com>
-
- * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Reserve one slot
- in sgot.
- (elfNN_aarch64_finish_dynamic_sections): Place the &_DYNAMIC reference
- in sgot[0] rather than sgotplt[0].
-
-2013-06-26 Yufeng Zhang <yufeng.zhang@arm.com>
-
- * Makefile.am (elf32-aarch64.c): Add a #line cpp directive at the
- beginning of the generated file.
- (elf64-aarch64.c): Likewise.
- * Makefile.in: Re-generated.
-
-2013-06-26 Yufeng Zhang <yufeng.zhang@arm.com>
-
- * Makefile.am (BFD64_BACKENDS): Add elfxx-aarch64.c.
- (BFD64_BACKENDS_CFILES): Add elfxx-aarch64.lo.
- * Makefile.in: Re-generated.
- * configure.in (bfd_elf64_bigaarch64_vec): Add elfxx-aarch64.lo.
- (bfd_elf64_littleaarch64_vec): Likewise.
- (bfd_elf32_bigaarch64_vec): Likewise.
- (bfd_elf32_littleaarch64_vec): Likewise.
- * configure: Re-generated.
- * elfxx-aarch64.c: New file; split from elf64-aarch64.c.
- * elfxx-aarch64.h: New file.
- * elfnn-aarch64.c: Include "elfxx-aarch64.h"; move the following
- stuff to elfxx-aarch64.c.
- (bfd_elf_aarch64_put_addend): Removed.
- (PG_OFFSET, PG): Likewise.
- (elfNN_aarch64_small_plt0_entry): Support ELF32.
- (elfNN_aarch64_tlsdesc_small_plt_entry): Likewise.
- (elf64_aarch64_grok_prstatus): Removed.
- (elf_backend_grok_prstatus): Removed.
- (insn32): Likewise.
- (aarch64_unsigned_overflow): Likewise.
- (aarch64_signed_overflow): Likewise.
- (aarch64_resolve_relocation): Likewise.
- (MASK): Likewise.
- (decode_branch_ofs_26): Likewise.
- (decode_cond_branch_ofs_19): Likewise.
- (decode_ld_lit_ofs_19): Likewise.
- (decode_tst_branch_ofs_14): Likewise.
- (decode_movw_imm): Likewise.
- (decode_adr_imm): Likewise.
- (decode_add_imm): Likewise.
- (reencode_branch_ofs_26): Likewise.
- (reencode_cond_branch_ofs_19): Likewise.
- (reencode_ld_lit_ofs_19): Likewise.
- (reencode_tst_branch_ofs_14): Likewise.
- (reencode_movw_imm): Likewise.
- (reencode_adr_imm): Likewise.
- (reencode_ldst_pos_imm): Likewise.
- (reencode_add_imm): Likewise.
- (reencode_movzn_to_movz): Likewise.
- (reencode_movzn_to_movn): Likewise.
- (aarch64_relocate): Update to call the new function names in
- elfxx-aarch64.c.
- (aarch64_calculate_got_entry_vma): Likewise.
- (elfNN_aarch64_final_link_relocate): Likewise.
- (elf64_aarch64_update_plt_entry): Likewise; change the type of the
- parameter 'r_type' to bfd_reloc_code_real_type; rename to ...
- (elf_aarch64_update_plt_entry): ... this.
- (elfNN_aarch64_create_small_pltn_entry): Update.
- (elfNN_aarch64_init_small_plt0_entry): Remove plt_got_base; add
- bfd_vma plt_got_2nd_ent; update to call elf_aarch64_update_plt_entry.
- (elfNN_aarch64_finish_dynamic_sections): Add plt_entry; update to
- call elf_aarch64_update_plt_entry.
-
-2013-06-26 Yufeng Zhang <yufeng.zhang@arm.com>
-
- * bfd-in2.h: Re-generated.
- * elfnn-aarch64.c (HOWTO64, HOWTO32): New define.
- (IS_AARCH64_TLS_RELOC): Change to be based on the
- bfd reloc enumerators.
- (IS_AARCH64_TLSDESC_RELOC): Likewise.
- (PG, PG_OFFSET): Cast literal to bfd_vma.
- (elf64_aarch64_howto_table): Removed.
- (elf64_aarch64_howto_dynrelocs): Removed.
- (elf64_aarch64_tls_howto_table): Removed.
- (elf64_aarch64_tlsdesc_howto_table): Removed.
- (elfNN_aarch64_howto_table): New table to host all howto entires..
- (R_AARCH64_*): Replaced by AARCH64_R (*) and AARCH64_R_STR (*).
- (elfNN_aarch64_bfd_reloc_from_howto): New function.
- (elfNN_aarch64_bfd_reloc_from_type): Ditto.
- (struct elf_aarch64_reloc_map): New.
- (elf_aarch64_reloc_map): New table.
- (elfNN_aarch64_howto_from_bfd_reloc): New function.
- (elfNN_aarch64_howto_from_type): Update to look up the new table
- elfNN_aarch64_howto_table.
- (struct elf64_aarch64_reloc_map): Remove.
- (elf64_aarch64_reloc_map): Remove.
- (elfNN_aarch64_reloc_type_lookup): Change to call
- elfNN_aarch64_howto_from_bfd_reloc.
- (elfNN_aarch64_reloc_name_lookup): Change to look up the new table
- elfNN_aarch64_howto_table.
- (aarch64_resolve_relocation): Refactor to switch on the bfd
- reloc enumerators.
- (bfd_elf_aarch64_put_addend): Likewise.
- (elfNN_aarch64_final_link_relocate): Likewise.
- (aarch64_tls_transition_without_check): Likewise.
- (aarch64_reloc_got_type): Likewise.
- (aarch64_can_relax_tls): Likewise.
- (aarch64_tls_transition): Likewise.
- (elfNN_aarch64_tls_relax): Likewise.
- (elfNN_aarch64_final_link_relocate): Likewise.
- (elfNN_aarch64_relocate_section): Likewise.
- (elfNN_aarch64_gc_sweep_hook): Likewise.
- (elfNN_aarch64_check_relocs): Likewise.
- (aarch64_tls_transition): Change to return a bfd reloc enumerator.
- * libbfd.h: Re-generated.
- * reloc.c: Re-order the AArch64 bfd reloc enumerators.
- (BFD_RELOC_AARCH64_RELOC_START)
- (BFD_RELOC_AARCH64_RELOC_END)
- (BFD_RELOC_AARCH64_LD_GOT_LO12_NC)
- (BFD_RELOC_AARCH64_LD32_GOT_LO12_NC)
- (BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC)
- (BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC)
- (BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC)
- (BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC)
- (BFD_RELOC_AARCH64_IRELATIVE): New relocs.
-
-2013-06-26 Yufeng Zhang <yufeng.zhang@arm.com>
-
- * Makefile.am (BFD64_BACKENDS): Add elf32-aarch64.lo.
- (BUILD_CFILES): Add elf32-aarch64.c.
- (elf32-aarch64.c): New rule for generating from elfnn-aarch64.c.
- * Makefile.in: Re-generated.
- * archures.c (bfd_mach_aarch64_ilp32): New define.
- * bfd-in.h (bfd_elf32_aarch64_init_maps): New declaration.
- (bfd_elf32_aarch64_set_options): Ditto.
- (elf32_aarch64_setup_section_lists): Ditto.
- (elf32_aarch64_next_input_section): Ditto.
- (elf32_aarch64_size_stubs): Ditto.
- (elf32_aarch64_build_stubs): Ditto.
- * bfd-in2.h: Re-generated.
- * config.bfd (aarch64-*-elf): Add bfd_elf32_littleaarch64_vec
- and bfd_elf32_bigaarch64_vec.
- (aarch64-*-linux*): Likewise.
- (aarch64_be-*-elf): Likewise.
- (aarch64_be-*-linux*): Likewise.
- * configure.in (bfd_elf32_bigaarch64_vec)
- (bfd_elf32_littleaarch64_vec): New.
- * configure: Re-generated.
- * cpu-aarch64.c (compatible): Don't allow mixing ilp32 objects with
- lp64 ones.
- (bfd_aarch64_arch_ilp32): New.
- (bfd_aarch64_arch): Link to bfd_aarch64_arch_ilp32.
- * elfnn-aarch64.c (ARCH_SIZE): New define.
- (AARCH64_R, AARCH64_R_STR, LOG_FILE_ALIGN): New defines.
- (GOT_ENTRY_SIZE): Re-define as (ARCH_SIZE / 8).
- (elf64_aarch64_*): Rename to elfNN_aarch64_*.
- (ELF64_R_*): Rename to ELFNN_R_*.
- Plus other paramaterization.
- * targets.c (bfd_elf32_bigaarch64_vec, bfd_elf32_littleaarch64_vec):
- New declarations.
- (_bfd_target_vector): Add bfd_elf32_bigaarch64_vec and
- bfd_elf32_littleaarch64_vec.
-
-2013-06-26 Yufeng Zhang <yufeng.zhang@arm.com>
-
- * Makefile.am (BFD64_BACKENDS_CFILES): Remove elf64-aarch64.c.
- (BUILD_CFILES): Add elf64-aarch64.c.
- (elf64-aarch64.c): New rule for generating from elfnn-aarch64.c.
- * Makefile.in: Re-generated.
- * elf64-aarch64.c: Rename to ...
- * elfnn-aarch64.c: ... this.
-
-2013-06-25 Maciej W. Rozycki <macro@codesourcery.com>
- Paul Brook <paul@codesourcery.com>
-
- * elfxx-mips.h (_bfd_mips_elf_insn32): New prototype.
- * elfxx-mips.c (mips_elf_link_hash_table): Add insn32 member.
- (STUB_MOVE32_MICROMIPS, STUB_JALR32_MICROMIPS): New macros.
- (MICROMIPS_INSN32_FUNCTION_STUB_NORMAL_SIZE): Likewise.
- (MICROMIPS_INSN32_FUNCTION_STUB_BIG_SIZE): Likewise.
- (micromips_insn32_o32_exec_plt0_entry): New variable.
- (micromips_insn32_o32_exec_plt_entry): Likewise.
- (_bfd_mips_elf_adjust_dynamic_symbol): Handle insn32 mode.
- (mips_elf_estimate_stub_size): Likewise.
- (_bfd_mips_elf_size_dynamic_sections): Likewise.
- (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
- (mips_finish_exec_plt): Likewise.
- (_bfd_mips_elf_relax_section): Likewise.
- (_bfd_mips_elf_insn32): New function.
- (_bfd_mips_elf_get_synthetic_symtab): Handle insn32 PLT.
-
-2013-06-24 Maciej W. Rozycki <macro@codesourcery.com>
-
- * elfxx-mips.h (_bfd_mips_elf_get_synthetic_symtab): New
- prototype.
- * elf32-mips.c (elf_backend_plt_sym_val): Remove macro.
- (bfd_elf32_get_synthetic_symtab): New macro.
- * elfxx-mips.c (plt_entry): New structure.
- (mips_elf_link_hash_entry): Add use_plt_entry member.
- (mips_elf_link_hash_table): Rename plt_entry_size member to
- plt_mips_entry_size. Add plt_comp_entry_size, plt_mips_offset,
- plt_comp_offset, plt_got_index entries and plt_header_is_comp
- members.
- (STUB_LW_MICROMIPS, STUB_MOVE_MICROMIPS): New macros.
- (STUB_LUI_MICROMIPS, STUB_JALR_MICROMIPS): Likewise.
- (STUB_ORI_MICROMIPS, STUB_LI16U_MICROMIPS): Likewise.
- (STUB_LI16S_MICROMIPS): Likewise.
- (MICROMIPS_FUNCTION_STUB_NORMAL_SIZE): Likewise.
- (MICROMIPS_FUNCTION_STUB_BIG_SIZE): Likewise.
- (micromips_o32_exec_plt0_entry): New variable.
- (mips16_o32_exec_plt_entry): Likewise.
- (micromips_o32_exec_plt_entry): Likewise.
- (mips_elf_link_hash_newfunc): Initialize use_plt_entry.
- (mips_elf_output_extsym): Update to use gotplt_union's plist
- member rather than offset.
- (mips_elf_gotplt_index): Likewise. Remove the VxWorks
- restriction. Use MIPS_ELF_GOT_SIZE to calculate GOT address.
- (mips_elf_count_got_symbols): Update to use gotplt_union's plist
- member rather than offset.
- (mips_elf_calculate_relocation): Handle MIPS16/microMIPS PLT
- entries.
- (_bfd_mips_elf_create_dynamic_sections): Don't set PLT sizes
- here.
- (mips_elf_make_plt_record): New function.
- (_bfd_mips_elf_check_relocs): Update comment. Record occurences
- of JAL relocations that might need a PLT entry.
- (_bfd_mips_elf_adjust_dynamic_symbol): Update to use
- gotplt_union's plist member rather than offset. Set individual
- PLT entry sizes here. Handle MIPS16/microMIPS PLT entries.
- Don't set the symbol's value in the symbol table for PLT
- references here. Don't set the PLT or PLT GOT section sizes
- here.
- (mips_elf_estimate_stub_size): Handle microMIPS stubs.
- (mips_elf_allocate_lazy_stub): Likewise.
- (mips_elf_lay_out_lazy_stubs): Likewise. Define a _MIPS_STUBS_
- magic symbol.
- (mips_elf_set_plt_sym_value): New function.
- (_bfd_mips_elf_size_dynamic_sections): Set PLT header size and
- PLT and PLT GOT section sizes here. Set the symbol values in
- the symbol table for PLT references here. Handle microMIPS
- annotation of the _PROCEDURE_LINKAGE_TABLE_ magic symbol.
- (_bfd_mips_elf_finish_dynamic_symbol): Update to use
- gotplt_union's plist member rather than offset. Handle
- MIPS16/microMIPS PLT entries. Handle microMIPS stubs.
- (_bfd_mips_vxworks_finish_dynamic_symbol): Update to use
- gotplt_union's plist member rather than offset. Use
- MIPS_ELF_GOT_SIZE to calculate GOT address.
- (mips_finish_exec_plt): Handle microMIPS PLT. Return status.
- (_bfd_mips_elf_finish_dynamic_sections): Handle result from
- mips_finish_exec_plt.
- (_bfd_mips_elf_link_hash_table_create): Update to use
- gotplt_union's plist member rather than offset.
- (_bfd_mips_elf_get_synthetic_symtab): New function.
-
-2013-06-24 Wawa <caojinyu@msn.com>
-
- PR 15657
- * hash.c (_bfd_stringtab_add): Copy the string if COPY is true.
-
-2013-06-23 Richard Sandiford <rdsandiford@googlemail.com>
-
- * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Move MIPS ELF
- files to...
- (BFD64_BACKENDS, BFD64_BACKENDS_CFILES): ...here.
- * Makefile.in: Regenerate.
- * config.bfd: Enclose all MIPS ELF targets in #ifdef BFD64.
- Set want64 to true for them at the end.
- * targets.c (_bfd_target_vector): Protect MIPS ELF targets with
- #ifdef BFD64.
-
-2013-06-22 Sandra Loosemore <sandra@codesourcery.com>
-
- * elf32-nios2.c (nios2_elf32_finish_dynamic_sections): Don't
- set sh_entsize for PLT section.
-
-2013-06-20 Yufeng Zhang <yufeng.zhang@arm.com>
-
- * bfd-in.h (bfd_elf64_aarch64_set_options): Add 'extern'.
- * bfd-in2.h: Re-generated.
- * elf64-aarch64.c (RELOC_SECTION): Removed.
- (SWAP_RELOC_IN, SWAP_RELOC_OUT): Ditto.
- (AARCH64_ELF_OS_ABI_VERSION): Ditto.
- (elf64_aarch64_link_hash_traverse): Ditto.
- (elf64_aarch64_size_stubs): Change 'Aarch64' to 'AArch64' in the
- comment.
-
-2013-06-19 Will Newton <will.newton@linaro.org>
-
- * configure: Regenerated.
- * configure.in: Remove aarch64 dependency on elf-ifunc.c.
- * elf64-aarch64.c: Remove objalloc.h include.
- (elf64_aarch64_howto_dynrelocs): Remove R_AARCH64_IRELATIVE howto.
- (struct elf64_aarch64_link_hash_table): Remove ifunc related
- members. (elf_aarch64_local_htab_hash): Remove function.
- (elf_aarch64_local_htab_eq): Remove function.
- (elf_aarch64_get_local_sym_hash): Remove function.
- (elf64_aarch64_link_hash_table_create): Remove local hash
- table initialization.
- (elf64_aarch64_final_link_relocate): Remove sym argument and
- handling of ifunc symbols.
- (elf64_aarch64_relocate_section): Don't pass sym argument to
- elf64_aarch64_final_link_relocate.
- (elf64_aarch64_gc_sweep_hook): Remove handling of ifunc symbols.
- (elf64_aarch64_adjust_dynamic_symbol): Likewise.
- (elf64_aarch64_check_relocs): Likewise.
- (elf64_aarch64_post_process_headers): Remove call to
- _bfd_elf_set_osabi.
- (elf64_aarch64_is_function_type): New function.
- (elf64_aarch64_allocate_dynrelocs): Remove handling of ifunc
- symbols. (elf_aarch64_allocate_local_dynrelocs): Remove function.
- (elf64_aarch64_size_dynamic_sections): Remove call to
- elf_aarch64_allocate_local_dynrelocs.
- (elf64_aarch64_create_small_pltn_entry): Remove info argument.
- Remove creation of R_AARCH64_IRELATIVE dynamic relocs.
- (elf64_aarch64_finish_dynamic_symbol): Remove handling of ifunc
- symbols. (elf_aarch64_finish_local_dynamic_symbol): Remove
- function. (elf64_aarch64_finish_dynamic_sections): Remove call to
- elf_aarch64_finish_local_dynamic_symbol.
- (elf64_aarch64_add_symbol_hook): Remove function.
-
-2013-06-14 Yufeng Zhang <yufeng.zhang@arm.com>
-
- * elf64-aarch64.c (elf64_aarch64_final_link_relocate): Call
- aarch64_resolve_relocation and bfd_elf_aarch64_put_addend to
- handle the relocations of R_AARCH64_JUMP26, R_AARCH64_CALL26,
- R_AARCH64_LD64_GOT_LO12_NC, R_AARCH64_ADR_GOT_PAGE and
- R_AARCH64_GOT_LD_PREL19.
-
-2013-06-13 Terry Guo <terry.guo@arm.com>
-
- PR ld/15302
- * elf32-arm.c (allocate_dynrelocs_for_symbol): Transform
- ST_BRANCH_TO_ARM into ST_BRANCH_TO_THUMB if the target only
- supports thumb instructions.
-
-2013-06-11 DJ Delorie <dj@redhat.com>
-
- * elf32-rl78.c (rl78_elf_relocate_section): Fix OPsub math.
-
-2013-06-11 Will Newton <will.newton@linaro.org>
-
- * elf64-aarch64.c (elf_aarch64_get_local_sym_hash): Use
- ELF64_R_SYM instead of ELF32_R_SYM.
-
-2013-06-11 Nick Clifton <nickc@redhat.com>
-
- * elf32-rl78.c (rl78_elf_finish_dynamic_sections): Onlly run
- checks if the dynamic sections have been created and relaxation
- has not been performed.
-
-2013-06-07 Will Newton <will.newton@linaro.org>
+2014-07-08 Will Newton <will.newton@linaro.org>
- * configure: Regenerate.
- * configure.in: Build elf-ifunc.o for AArch64.
- * elf64-aarch64.c: Include objalloc.h.
- (elf64_aarch64_howto_dynrelocs): Add R_AARCH64_IRELATIVE howto.
- (struct elf64_aarch64_link_hash_table): Add members for handling
- R_AARCH64_IRELATIVE relocations.
- (elf_aarch64_local_htab_hash): New function.
- (elf_aarch64_local_htab_eq): New function.
- (elf_aarch64_get_local_sym_hash): New function.
- (elf64_aarch64_link_hash_table_create): Initialize local STT_GNU_IFUNC
- symbol hash.
- (elf64_aarch64_hash_table_free): Free local STT_GNU_IFUNC symbol hash.
- (elf64_aarch64_final_link_relocate): Add sym argument. Add support
- for handling STT_GNU_IFUNC symbols.
- (elf64_aarch64_gc_sweep_hook): Add support for garbage collecting
- references to STT_GNU_IFUNC symbols.
- (elf64_aarch64_adjust_dynamic_symbol): Add support for handling
- STT_GNU_IFUNC symbols.
- (elf64_aarch64_check_relocs): Add support for handling STT_GNU_IFUNC
- symbols. Ensure we don't increase plt.refcount from -1 to 0.
- (elf64_aarch64_post_process_headers): Call _bfd_elf_set_osabi.
- (elf64_aarch64_is_function_type): Remove function.
- (elf64_aarch64_allocate_dynrelocs): Call
- _bfd_elf_allocate_ifunc_dyn_relocs for STT_GNU_IFUNC symbols.
- (elf_aarch64_allocate_local_dynrelocs): New function.
- (elf64_aarch64_size_dynamic_sections): Call
- elf_aarch64_allocate_local_dynrelocs. Initialize next_irelative_index.
- (elf64_aarch64_create_small_pltn_entry): Add info argument.
- Add support for creating .iplt entries for STT_GNU_IFUNC symbols.
- (elf64_aarch64_finish_dynamic_symbol): Add support for handling
- STT_GNU_IFUNC symbols and .iplt.
- (elf_aarch64_finish_local_dynamic_symbol): New function.
- (elf64_aarch64_finish_dynamic_sections): Call
- elf_aarch64_finish_local_dynamic_symbol.
- (elf64_aarch64_add_symbol_hook): New function.
-
-2013-06-03 Alan Modra <amodra@gmail.com>
-
- * syms.c (_bfd_stab_section_find_nearest_line): Add last_str
- var. Use it with last_stab.
-
-2013-05-30 Paul Brook <paul@codesourcery.com>
+ * elf32-arm.c (ELF_MAXPAGESIZE): Increase the default
+ value to 64kB and remove custom setting for NaCl.
- * bfd-in2.h: Regenerate.
- * elf32-mips.c (elf_mips_eh_howto): New.
- (bfd_elf32_bfd_reloc_type_lookup ): Support BFD_RELOC_MIPS_EH.
- (bfd_elf32_bfd_reloc_name_lookup): Likewise.
- (mips_elf32_rtype_to_howto): Support R_MIPS_EH.
- * elf64-mips.c (elf_mips_eh_howto): New.
- (bfd_elf64_bfd_reloc_type_lookup): Support BFD_RELOC_MIPS_EH.
- (bfd_elf64_bfd_reloc_name_lookup): Likewise.
- (mips_elf64_rtype_to_howto): Support R_MIPS_EH.
- * libbfd.h: Regenerate.
- * reloc.c (BFD_RELOC_MIPS_EH): New.
-
-2013-05-29 Nick Clifton <nickc@redhat.com>
-
- * dwarf2.c (struct dwarf2_debug): Add fields for handling
- alternate debug info source.
- (dwarf_debug_sections): Add entries for alternate .debug_str and
- .debug_info sections.
- (dwarf_debug_section_enum): Likewise.
- (read_alt_indirect_string): New function. Handles a
- DW_FORM_GNU_strp_alt attribute.
- (read_alt_indirect_ref): New function. Handles a
- DW_FORM_GNU_ref_alt attribute.
- (read_attribute_value): Process DW_FORM_GNU_ref_alt and
- DW_FORM_GNU_strp_alt.
- (find_abstract_instance_name): Handle DW_FORM_GNU_ref_alt
- attributes.
- (_bfd_dwarf2_cleanup_debug_info): Free alternate debug info
- sources.
- * opncls.c (GNU_DEBUGALTLINK): Define.
- (bfd_get_alt_debug_link_info): New function.
- (separate_alt_debug_file_exists): New function.
- (find_separate_debug_file): Add parameters for fetch and check
- functions.
- (bfd_follow_gnu_debugaltlink): New function.
+2014-07-08 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (_bfd_elf_copy_link_hash_symbol_type): Copy st_other
+ bits from source to dest.
+ * linker.c (_bfd_generic_copy_link_hash_symbol_type): Update comment.
+ * targets.c (struct bfd_target <_bfd_copy_link_hash_symbol_type>):
+ Likewise.
* bfd-in2.h: Regenerate.
-2013-05-28 Yufeng Zhang <yufeng.zhang@arm.com>
+2014-07-08 Jiong Wang <jiong.wang@arm.com>
- * reloc.c (BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE): Rename to ...
- (BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21): ... this.
- (BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19): Rename to ...
- (BFD_RELOC_AARCH64_TLSDESC_LD_PREL19): ... this.
+ * elfnn-aarch64.c (elf_backend_rela_normal): Set to 1.
+ (elfNN_aarch64_relocate_section): Remove duplicated addend adjustment
+ when info->relocatable be true.
+
+2014-07-07 Barney Stratford <barney_stratford@fastmail.fm>
+
+ * elf32-avr.c: Handle R_AVR_PORT5 and R_AVR_PORT6.
+ * reloc.c: Add BFD_RELOC_AVR_PORT5 and BFD_RELOC_AVR_PORT6.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
- * elf64-aarch64.c (IS_AARCH64_TLSDESC_RELOC): Update to use
- the correct names.
- (elf64_aarch64_tlsdesc_howto_table): Likewise.
- (elf64_aarch64_reloc_map): Likewise.
- (aarch64_resolve_relocation): Likewise.
- (bfd_elf_aarch64_put_addend): Likewise.
- (aarch64_tls_transition_without_check): Likewise.
- (aarch64_reloc_got_type): Likewise.
- (elf64_aarch64_final_link_relocate): Likewise.
- (elf64_aarch64_tls_relax): Likewise.
- (elf64_aarch64_relocate_section): Likewise.
- (elf64_aarch64_gc_sweep_hook): Likewise.
- (elf64_aarch64_check_relocs): Likewise.
-2013-05-26 Mark Wielaard <mjw@redhat.com>
+2014-07-04 Alan Modra <amodra@gmail.com>
- * cache.c (BFD_CACHE_MAX_OPEN): Remove define.
- (max_open_files): New static int initialized to zero.
- (bfd_cache_max_open): New static function to set and return
- max_open_files.
- (bfd_cache_init): Use bfd_cache_max_open.
- (bfd_open_file): Likewise.
- * configure.in (AC_CHECK_HEADERS): Add sys/resource.h.
- (AC_CHECK_FUNCS): Add getrlimit.
- * configure: Regenerated.
- * config.in: Likewise.
- * sysdep.h: Check and include sys/resource.h for getrlimit.
+ * Makefile.am: Update "configure.in" comments.
+ * PORTING: Likewise.
+ * aoutx.h: Likewise.
+ * configure.host: Likewise.
+ * doc/bfdint.texi: Likewise.
+ * targets.c: Likewise.
+ * warning.m4: Likewise.
+ * Makefile.in: Regenerate.
-2013-05-23 Alan Modra <amodra@gmail.com>
+2014-07-04 Alan Modra <amodra@gmail.com>
- * format.c (bfd_check_format_matches): Don't match a target in
- targ_selvecs if some other target is a better match. If
- targets implement match priority, fall back to the first of
- the best matches.
+ * configure.ac: Rename from configure.in.
+ * Makefile.in: Regenerate.
+ * config.in: Regenerate.
+ * doc/Makefile.in: Regenerate.
-2013-05-22 Eric Herman <eric@freesa.org>
+2014-07-04 Alan Modra <amodra@gmail.com>
- PR binutils/15462
- * elfxx-mips.c (_bfd_mips_elf_relocate_section): Warning fix.
+ * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove configure.in.
+ * Makefile.in: Regenerate.
-2013-05-22 Ralf Dreesen <gamma@dreesen.net>
+2014-07-04 Alan Modra <amodra@gmail.com>
- PR binutils/15474
- * srec.c (srec_set_section_contents): Properly convert size
- and offset to address when octets_per_byte is not unity.
+ * version.m4: New file.
+ * configure.in: Include version.m4.
+ (AC_INIT): Update.
+ * Makefile.am (RELEASE): Delete.
+ (bfdver.h): Depend on development.sh, use instead of RELEASE.
+ * Makefile.in: Regenerate.
+ * doc/Makefile.in: Regenerate.
-2013-05-20 Maciej W. Rozycki <macro@linux-mips.org>
+2014-07-02 Alan Modra <amodra@gmail.com>
- * elf32-vax.c (elf_vax_instantiate_got_entries): Only set the
- refcount member of the gotplt_union when resetting the reference
- count. Adjust comment.
+ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Clear
+ pointer_equality_needed when !readonly_dynrelocs.
+ * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
-2013-05-20 Will Newton <will.newton@linaro.org>
+2014-07-02 Alan Modra <amodra@gmail.com>
- * elf64-aarch64.c (elf64_aarch64_link_hash_entry): Remove
- relocs_copied member.
- (elf64_aarch64_link_hash_newfunc): Remove initialization of
- relocs_copied member.
- (elf64_aarch64_copy_indirect_symbol): Remove code to copy
- relocs_copied member.
+ * elf32-ppc.c (ppc_elf_check_relocs): Set DF_STATIC_TLS for PIEs too.
+ * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
-2013-05-19 Maciej W. Rozycki <macro@linux-mips.org>
+2014-07-01 Alan Modra <amodra@gmail.com>
- * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Convert K&R
- function definition.
+ * bfd.c (struct bfd): Reorganise for better packing. Delete
+ "ifd" field. Make "format", "direction" and "flags" bitfields.
+ (HAS_LOAD_PAGE): Delete, renumber following flags.
+ * bfd-in2.h: Regenerate.
+ * coff-tic4x.c: Remove HAS_LOAD_PAGE from extra flags in target vecs.
+
+2014-07-01 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc_stub_type): Add ppc_stub_global_entry.
+ (struct ppc_link_hash_table): Increase size of stub_count array.
+ (build_global_entry_stubs): Emit symbol on global entry stub.
+ (ppc64_elf_build_stubs): NULL check htab->brlt. Add global entry
+ stub stats.
+
+2014-07-01 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (abiversion, set_abiversion): Move earlier.
+ (ppc64_elf_branch_reloc): Adjust addend for ELFv2 local offset.
+ (ppc64_elf_set_toc): Set ".TOC." symbol value when using
+ generic linker.
+ (ppc64_elf_relocate_section): Disable ELFv2 function entry
+ optimisation when --traditional-format.
+
+2014-07-01 Barney Stratford <barney_stratford@fastmail.fm>
+ Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
+ Pitchumani Sivanupandi <pitchumani.s@atmel.com>
+ Soundararajan <Sounderarajan.D@atmel.com>
+
+ * archures.c: Add avrtiny architecture for avr target.
+ * cpu-avr.c (arch_info_struct): Add avrtiny arch info.
+ * elf32-avr.c (elf_avr_howto_table): New relocation R_AVR_LDS_STS_16
+ added for 16 bit LDS/STS instruction of avrtiny arch.
+ (avr_reloc_map): Reloc R_AVR_LDS_STS_16 is mapped to
+ BFD_RELOC_AVR_LDS_STS_16.
+ (bfd_elf_avr_final_write_processing): Select machine number
+ avrtiny arch.
+ (elf32_avr_object_p): Set machine number for avrtiny arch.
+ * reloc.c: Add documentation for BFD_RELOC_AVR_LDS_STS_16 reloc.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
-2013-05-16 Cary Coutant <ccoutant@google.com>
+2014-06-26 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/16949
+ * dwarf2.c (is_str_attr): New function.
+ (find_abstract_instance_name): Use it to determine when an
+ attribute has a string value.
+
+2014-06-24 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Arrange to keep
+ .sdata/.sdata2 when _SDA_BASE_/_SDA2_BASE_ should be output
+ for --emit-relocs.
+
+2014-06-21 Philippe De Muyter <phdm@macqel.be>
+
+ * targets.c (_bfd_target_vector): Add missing #ifdef BFD64 for
+ a number of targets.
+
+2014-06-20 Kyle McMartin <kyle@redhat.com>
+
+ * elf32-arm.c (elf32_arm_check_relocs): Set DF_STATIC_TLS when
+ emitting initial-exec relocs when not linking an executable.
+
+2014-06-16 Will Newton <will.newton@linaro.org>
+
+ * elf32-arm.c (elf32_arm_allocate_plt_entry): Increment
+ htab->next_tls_desc_index in the non-IPLT case.
+ Calculate GOT offset correctly for the non-IPLT case.
+ (allocate_dynrelocs_for_symbol): Don't increment
+ htab->next_tls_desc_index here.
+
+2014-06-16 Alan Modra <amodra@gmail.com>
+
+ * elf32-vax.c (elf_vax_size_dynamic_sections): Clear linker
+ created sections.
+
+2014-06-13 Omair Javaid <omair.javaid@linaro.org>
+
+ * elfxx-aarch64.c (stdarg.h): Include.
+ (string.h): Include.
+ (_bfd_aarch64_elf_grok_prstatus): Updated.
+ (_bfd_aarch64_elf_grok_psinfo): New function.
+ (_bfd_aarch64_elf_write_core_note): New function.
+ * elfxx-aarch64.h (elf_backend_grok_psinfo): Define.
+ (elf_backend_write_core_note): Define.
+
+2014-06-13 Alan Modra <amodra@gmail.com>
+
+ * archive.c: Include bfdlink.h.
+ (_bfd_archive_close_and_cleanup): Call linker hash_table_free.
+ * bfd.c (struct bfd): Add is_linker_output field.
+ * elf-bfd.h (_bfd_elf_link_hash_table_free): Update prototype.
+ * linker.c (_bfd_link_hash_table_init): Set up hash_table_free,
+ link.hash and is_linker_output.
+ (_bfd_generic_link_hash_table_free): Replace bfd_link_hash_table*
+ param with bfd*. Assert is_linker_output and link.hash, and
+ clear them before exit.
+ * elf-m10300.c (elf32_mn10300_link_hash_table_free): Replace
+ bfd_link_hash_table* param with bfd*. Hack is_linker_output
+ and link.hash so we can free two linker hash tables.
+ (elf32_mn10300_link_hash_table_create): Create static_hash_table
+ first. Clean up on errors. Set hash_table_free pointer.
+ * elf32-arm.c (elf32_arm_link_hash_table_free): Replace
+ bfd_link_hash_table* param with bfd*.
+ (elf32_arm_link_hash_table_create): Clean up on errors. Set
+ hash_table_free pointer.
+ * elf32-avr.c, * elf32-hppa.c, * elf32-i386.c, * elf32-m68hc1x.c,
+ * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c, * elf32-xgate.c,
+ * elf64-ia64-vms.c, * elf64-ppc.c, * elf64-x86-64.c, * elflink.c,
+ * elfnn-aarch64.c, * elfnn-ia64.c, * elfxx-sparc.c,
+ * xcofflink.c: Similarly.
+ * simple.c (bfd_simple_get_relocated_section_contents): Save and
+ clear link.next before creating linker hash table. Clean up on
+ errors, and restore link.next on exit.
+ * elf32-m68hc1x.h (m68hc11_elf_bfd_link_hash_table_free): Delete.
+ * elf32-xgate.h (xgate_elf_bfd_link_hash_table_free): Delete.
+ * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table_free): Delete.
+ * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Delete.
+ * hash.c (bfd_hash_table_init_n): Free table on error.
+ * libbfd-in.h (_bfd_generic_link_hash_table_free): Update proto.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+ * libcoff.h: Regenerate.
+
+2014-06-13 Alan Modra <amodra@gmail.com>
+
+ PR 17047
+ * targets.c (BFD_JUMP_TABLE): Delete NAME##_bfd_link_hash_table_free.
+ (struct bfd_target <_bfd_link_hash_table_free>): Delete.
+ * bfd.c (bfd_link_hash_table_free): Don't define.
+ * aout-adobe.c, * aout-target.h, * aout-tic30.c, * binary.c, * bout.c,
+ * coff64-rs6000.c, * coffcode.h, * elf-m10300.c, * elf32-arm.c,
+ * elf32-avr.c, * elf32-hppa.c, * elf32-i386.c, * elf32-m68hc11.c,
+ * elf32-m68hc12.c, * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c,
+ * elf32-sparc.c, * elf32-xgate.c, * elf64-ia64-vms.c, * elf64-ppc.c,
+ * elf64-sparc.c, * elf64-x86-64.c, * elfnn-aarch64.c, * elfnn-ia64.c,
+ * elfxx-target.h, * i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c,
+ * libbfd-in.h, * libecoff.h, * mach-o-target.c, * mmo.c,
+ * nlm-target.h, * oasys.c, * pef.c, * plugin.c, * ppcboot.c, * som.c,
+ * srec.c, * tekhex.c, * verilog.c, * versados.c, * vms-alpha.c,
+ * xsym.c: Don't define various link_hash_table_free defines, and
+ remove from bfd_target vars. Temporarily reference some of the
+ target link_hash_table_free functions to avoid warnings.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
- * ecoff.c (ecoff_link_check_archive_element): Add initializers for
- external_ext_size and esize.
+2014-06-13 Alan Modra <amodra@gmail.com>
+
+ * elf-m10300.c, * elf32-arm.c, * elf32-avr.c, * elf32-hppa.c,
+ * elf32-i386.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-metag.c,
+ * elf32-nios2.c, * elf64-ia64-vms.c, * elf64-ppc.c, * elf64-x86-64.c,
+ * elfnn-aarch64.c, * elfnn-ia64.c, * elfxx-sparc.c, * xcofflink.c:
+ Move link_hash_table_free functions before their corresponding
+ link_hash_table_create functions.
+
+2014-06-13 Alan Modra <amodra@gmail.com>
+
+ * bfd.c (struct bfd): Replace link_next with a union.
+ * aoutx.h, * bfd.c, * coff-ppc.c, * coff-rs6000.c, * cofflink.c,
+ * ecoff.c, * elf-m10300.c, * elf32-arm.c, * elf32-avr.c,
+ * elf32-hppa.c, * elf32-i386.c, * elf32-lm32.c, * elf32-m32c.c,
+ * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-metag.c,
+ * elf32-microblaze.c, * elf32-nds32.c, * elf32-nios2.c,
+ * elf32-or1k.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-s390.c,
+ * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c,
+ * elf32-tic6x.c, * elf32-tilepro.c, * elf32-xstormy16.c,
+ * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c,
+ * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-x86-64.c,
+ * elflink.c, * elfnn-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c,
+ * elfxx-tilegx.c, * linker.c, * pdp11.c, * peXXigen.c, * simple.c,
+ * sunos.c, * vms-alpha.c, * xcofflink.c: Update for above.
+ * bfd-in2.h: Regenerate.
-2013-05-16 Tristan Gingold <gingold@adacore.com>
+2014-06-11 Alan Modra <amodra@gmail.com>
- * coff-rs6000.c (_bfd_xcoff_reloc_type_lookup): Handle BFD_RELOC_16.
- * coff64-rs6000.c (xcoff64_reloc_type_lookup): Likewise.
+ * linker.c (unwrap_hash_lookup): Add missing parens.
-2013-05-15 Andreas Schwab <schwab@suse.de>
+2014-06-11 Kai Tietz <ktietz@redhat.com>
- * elf64-aarch64.c (elf_backend_default_execstack): Define to 0.
+ * libcoff-in.h (coff_tdata): Make relocbase member unsigned.
+ * libcoff.h: Regenerated.
-2013-05-10 Joel Brobecker <brobecker@adacore.com>
+2014-06-10 Alan Modra <amodra@gmail.com>
- * coffcode.h (styp_to_sec_flags) [RS6000COFF_C]: Add handling
- of STYP_EXCEPT, STYP_LOADER and STYP_TYPCHK sections.
+ PR ld/16910
+ * linker.c (unwrap_hash_lookup): New function.
+ * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Call unwrap_hash_lookup.
+ * elf32-i370.c (i370_elf_relocate_section): Likewise.
+ * elf32-m32c.c (m32c_elf_relocate_section): Likewise.
+ * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
+ * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
+ * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
+ * elf32-spu.c (spu_elf_relocate_section): Likewise.
+ * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
-2013-05-09 Joel Brobecker <brobecker@adacore.com>
+2014-06-07 Alan Modra <amodra@gmail.com>
- * bfd.c (_bfd_default_error_handler): Replace use of putc
- by fputc. Add comment explaining why.
+ * elf32-ppc.c (ppc_elf_relocate_section): Treat field of cmpli
+ insn as a bitfield; Use complain_overflow_bitfield.
+ * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
-2013-05-09 Alan Modra <amodra@gmail.com>
+2014-06-05 Joel Brobecker <brobecker@adacore.com>
- * elflink.c (elf_link_add_object_symbols): Don't omit reading
- of symbols when hashes already exist.
+ * development.sh: New file.
+ * warning.m4 (AM_BINUTILS_WARNINGS): Source bfd/development.sh.
+ Make -Werror the default with GCC only if DEVELOPMENT is true.
+ * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add
+ $(srcdir)/development.sh.
+ * Makefile.in, configure: Regenerate.
-2013-05-07 Will Newton <will.newton@linaro.org>
+2014-06-04 Will Newton <will.newton@linaro.org>
- * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Add a
- plt_header_size argument for ports where it differs from
- plt_entry_size.
- * elf-bfd.h: Likewise.
- * elf32-i386.c: Pass plt_header_size to
- _bfd_elf_allocate_ifunc_dyn_relocs.
- * elf64-x86-64.c: Likewise.
+ * elfnn-aarch64.c (tpoff_base): Make test of tls_sec
+ being non-NULL into an assert.
+ (elfNN_aarch64_tls_relax): Remove unused code.
-2013-05-07 Will Newton <will.newton@linaro.org>
+2014-06-03 DJ Delorie <dj@redhat.com>
- * elf-ifunc.c (_bfd_elf_create_ifunc_dyn_reloc): Remove unused
- function.
- * elf-bfd.h: Likewise.
+ * elf32-rx.c (rx_table_map): Use BFD_VMA_FMT for portability.
-2013-05-06 Paul Brook <paul@codesourcery.com>
+2014-06-03 Nick Clifton <nickc@redhat.com>
- * elf64-mips.c (elf_mips_gnu_pcrel32): New.
- (bfd_elf64_bfd_reloc_type_lookup, bfd_elf64_bfd_reloc_name_lookup,
- mips_elf64_rtype_to_howto): Handle R_MIPS_PC32.
- * elfn32-mips.c (elf_mips_gnu_pcrel32): New.
- (bfd_elfn32_bfd_reloc_type_lookup, bfd_elfn32_bfd_reloc_name_lookup,
- mips_elfn32_rtype_to_howto): Handle R_MIPS_PC32.
+ PR ld/16807
+ * peXXigen.c (rsrc_process_section): Page align the new contents
+ befgore writing out.
-2013-05-06 Alan Modra <amodra@gmail.com>
+2014-06-03 Alan Modra <amodra@gmail.com>
- * elf64-ppc.c (opd_entry_value): Handle case where symbol
- hashes are not available.
+ * elf64-ppc.c (ADDIS_R12_R2): Define.
+ (build_plt_stub): Support fusion on ELFv2 stub.
+ (ppc_build_one_stub): Likewise for plt branch stubs.
-2013-05-06 Alan Modra <amodra@gmail.com>
+2014-05-28 Alan Modra <amodra@gmail.com>
- * elflink.c (elf_link_add_object_symbols): Don't save symbol
- hashes around loading as-needed library. Zero them on allocation,
- and restore to initial all-zero state if library not needed.
- Arrange to reuse hashes if we load library again later.
+ * elf32-rx.c (rx_table_map): Delete set but not used variables.
-2013-05-04 Richard Sandiford <rdsandiford@googlemail.com>
+2014-05-28 Tristan Gingold <gingold@adacore.com>
- * elf32-mips.c (elf_mips_copy_howto, elf_mips_jump_slot_howto):
- Use _bfd_mips_elf_generic_reloc instead of bfd_elf_generic_reloc.
- * elfn32-mips.c: Likewise.
- * elf64-mips.c: Likewise.
-
-2013-05-02 Nick Clifton <nickc@redhat.com>
-
- * archures.c: Add some more MSP430 machine numbers.
- * config.bfd (msp430): Define targ_selvecs.
- * configure.in: Add bfd_elf32_msp430_ti_vec.
- * cpu-msp430.c: Add some more MSP430 machine numbers.
- * elf32-msp430.c Add support for MSP430X relocations.
- Add support for TI compiler generated relocations.
- Add support for sym_diff relocations.
- Add support for relaxing out of range short branches into long
- branches.
- Add support for MSP430 attribute section.
- * reloc.c: Add MSP430X relocations.
- * targets.c: Add bfd_elf32_msp430_ti_vec.
- * bfd-in2.h: Regenerate.
- * configure: Regenerate.
- * libbfd.h: Regenerate.
-
-2013-05-01 Maciej W. Rozycki <macro@codesourcery.com>
+ * dwarf2.c (lookup_address_in_function_table): Add best_fit_len
+ to keep the length of the best fit range.
+ (lookup_symbol_in_function_table, info_hash_lookup_funcinfo):
+ Likewise.
- * config.bfd: Replace alpha*-*-linuxecoff* pattern with
- alpha*-*-linux*ecoff*.
+2014-05-27 DJ Delorie <dj@redhat.com>
-2013-04-30 Olaf Flebbe <o.flebbe@science-computing.de>
+ * elf32-rx.c (get_symbol_value_maybe): New.
+ (rx_elf_relocate_section): If we find a reloc against
+ $tableentry$default$<name>, redirect it to the appropriate
+ $tableentry$<n>$.
+ (RX_Table_Info): New.
+ (rx_table_find): New. Check all tables and SEC_KEEP all sections
+ with table parts in them.
+ (rx_check_directives): New.
+ (rx_table_map_2): New.
+ (rx_table_map): New.
+ (rx_additional_link_map_text): New. Called to dump tables to the
+ map file.
+ * elf32-rx.h: New.
- PR binutils/15417
- * elflink.c (elf_link_add_object_symbols): Initialise 'idx' to
- zero.
+2014-05-20 DJ Delorie <dj@redhat.com>
-2013-04-30 Alan Modra <amodra@gmail.com>
+ * elf32-msp430.c (msp430_elf_relax_adjust_locals): Avoid overflow.
- * elflink.c (bfd_elf_record_link_assignment): Dont make
- STV_INTERNAL symbols STV_HIDDEN.
+2014-05-20 Alan Modra <amodra@gmail.com>
-2013-04-29 Nick Clifton <nickc@redhat.com>
+ PR 16952
+ * elf32-ppc.c (ppc_elf_create_linker_section): Move earlier.
+ Remove redundant setting of htab->elf.dynobj. Don't align.
+ Define .sdata symbols using _bfd_elf_define_linkage_sym.
+ (ppc_elf_create_glink): Call ppc_elf_create_linker_section.
+ (create_sdata_sym): Delete.
+ (elf_allocate_pointer_linker_section): Rename from
+ elf_create_pointer_linker_section. Align section.
+ (ppc_elf_check_relocs): Don't call ppc_elf_creat_linker_section
+ directly here, or create_sdata_sym. Set ref_regular on _SDA_BASE_
+ and _SDA2_BASE_.
+ (ppc_elf_size_dynamic_sections): Remove ATTRIBUTE_UNUSED on param.
+ Remove unnecessary tests on _SDA_BASE_ sym.
+ (maybe_strip_sdasym, ppc_elf_maybe_strip_sdata_syms): New functions.
+ (ppc_elf_relocate_section): Tighten SDA reloc symbol section checks.
+ * elf32-ppc.h (ppc_elf_set_sdata_syms): Delete.
+ (ppc_elf_maybe_strip_sdata_syms): Declare.
- * elflink.c (_bfd_elf_gc_mark_extra_sections): Remove mark from
- fragmented .debug_line sections associated with unmarked code
- sections.
+2014-05-16 Ryan Mansfield <rmansfield@qnx.com>
-2013-04-29 Will Newton <will.newton@linaro.org>
+ * config.bfd: Move QNX target_cflags from arm-*-netbsd* to arm-*-nto*.
- * elf32-arm.c (elf32_arm_populate_plt_entry): Call
- elf32_arm_add_dynreloc when emitting R_ARM_IRELATIVE relocs.
+2014-05-16 Jon Turney <jon.turney@dronecode.org.uk>
-2013-04-29 Will Newton <will.newton@linaro.org>
+ * peXXigen.c (pe_print_debugdata): Don't interpret debug directory
+ in a section with no contents.
+ (is_vma_in_section, find_section_by_vma): New functions.
+ (_bfd_XX_bfd_copy_private_bfd_data_common): Recalculate file
+ offsets in the debug directory.
+ (_bfd_XXi_slurp_codeview_record, _bfd_XXi_write_codeview_record):
+ Byte-swap GUID from little-endian to big-endian order for
+ consistent and conventional display.
- * elf64-aarch64.c (elf64_aarch64_check_relocs): Move relocation
- error check up and add error message.
+2014-05-16 Kaushik Phata <Kaushik.Phatak@kpit.com>
-2013-04-26 Will Newton <will.newton@linaro.org>
+ * elf32-rl78.c (rl78_elf_merge_private_bfd_data): Complain if
+ 64-bit doubles objects mix with 32-bit doubles objects.
+ (rl78_elf_print_private_bfd_data): Describe 64-bit doubles flag.
- * elf64-aarch64.c (elf64_aarch64_check_relocs): Remove dead code.
+2014-05-08 Hans-Peter Nilsson <hp@bitrange.com>
-2013-04-25 Alan Modra <amodra@gmail.com>
+ * mmo.c: Update URLs in documentation comments.
- * config.bfd: Add powerpc64le-linux.
+2014-05-02 Volodymyr Arbatov <arbatov@cadence.com>
+ David Weatherford <weath@cadence.com>
+ Max Filippov <jcmvbkbc@gmail.com>
-2013-04-24 H.J. Lu <hongjiu.lu@intel.com>
+ * elf32-xtensa.c (relax_section): treat R_XTENSA_DIFF* relocations as
+ signed.
- * config.bfd (targ_selvecs): Add bfd_elf32_x86_64_vec for
- x86_64-*-elf*.
+2014-05-07 Andreas Tobler <andreast@fgznet.ch>
-2013-04-24 Roland McGrath <mcgrathr@google.com>
+ * config.bfd: Add proper arm config for *-*-freebsd*.
- * elf32-arm.c (elf32_arm_allocate_plt_entry): If HTAB->nacl_p,
- allocate space for PLT header even if IS_IPLT_ENTRY.
- (arm_nacl_put_plt0): New function, broken out of ...
- (elf32_arm_finish_dynamic_sections): ... here. Call it.
- If HTAB->nacl_p, set up the PLT header in .iplt too.
- (elf32_arm_output_arch_local_syms): If HTAB->nacl_p, write
- a mapping symbol for the start of .iplt too.
+2014-05-07 Andrew Bennett <andrew.bennett@imgtec.com>
-2013-04-19 Luca Pizzamiglio <luca.pizzamiglio@gmail.com>
+ * aoutx.h (NAME (aout, machine_type)): Add mips32r3, mips64r3,
+ mips32r5 and mips64r5.
+ * archures.c (bfd_architecture): Likewise.
+ * bfd-in2.h (bfd_architecture): Likewise.
+ * cpu-mips.c (arch_info_struct): Likewise.
+ * elfxx-mips.c (mips_set_isa_flags): Likewise.
- * ecoff.c (_bfd_ecoff_sizeof_headers): Cast the return value of
- BFD_ALIGN to int.
- * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Remove unused
- variables.
- * elf32-v850.c (v850_elf_relax_section): Redefine the type of 'i'
- to bfd_vma.
- * vms-alpha.c (evax_bfd_print_etir): Initialize sec_len.
+2014-05-06 Richard Sandiford <rdsandiford@googlemail.com>
-2013-04-22 Alan Modra <amodra@gmail.com>
+ * elfxx-mips.h (elfxx-mips.h): Declare.
+ * elfxx-mips.c (mips_elf_merge_obj_attributes): Use it to report
+ Tag_GNU_MIPS_ABI_FP mismatches.
+ (_bfd_mips_fp_abi_string): New function.
- PR ld/15382
- * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Don't multiply
- sh_size or reloc_count adjustment by count.
+2014-05-02 Alan Modra <amodra@gmail.com>
-2013-04-22 Alan Modra <amodra@gmail.com>
+ * targets.c: Sort bfd_target vectors somewhat alphabetically.
+ * configure.in: Likewise.
+ * configure: Regenerate.
- * elf64-ppc.c (ppc64_elf_check_relocs): Don't call
- create_linkage_sections here..
- (ppc64_elf_init_stub_bfd): ..do so here. Return status.
- (create_linkage_sections): Move earlier in file.
- (ppc64_elf_setup_section_lists): Remove now useless htab->brlt test.
- * elf64-ppc.h (ppc64_elf_init_stub_bfd): Update proto.
+2014-05-02 Alan Modra <amodra@gmail.com>
+
+ * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-ns32k.c,
+ * aout-sparcle.c, * aout0.c, * aoutx.h, * armnetbsd.c, * bout.c,
+ * cf-i386lynx.c, * cf-sparclynx.c, * cisco-core.c, * coff-alpha.c,
+ * coff-apollo.c, * coff-arm.c, * coff-aux.c, * coff-go32.c,
+ * coff-h8300.c, * coff-h8500.c, * coff-i386.c, * coff-i860.c,
+ * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mips.c,
+ * coff-rs6000.c, * coff-sh.c, * coff-sparc.c, * coff-stgo32.c,
+ * coff-svm68k.c, * coff-tic80.c, * coff-u68k.c, * coff-w65.c,
+ * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
+ * coff64-rs6000.c, * config.bfd, * configure.com, * configure.in,
+ * demo64.c, * elf-m10200.c, * elf-m10300.c, * elf32-am33lin.c,
+ * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c,
+ * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c,
+ * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
+ * elf32-fr30.c, * elf32-frv.c, * elf32-gen.c, * elf32-h8300.c,
+ * elf32-hppa.c, * elf32-i370.c, * elf32-i386.c, * elf32-i860.c,
+ * elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c,
+ * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c,
+ * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c,
+ * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c,
+ * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c,
+ * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c,
+ * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-sh-symbian.c,
+ * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c,
+ * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilepro.c, * elf32-v850.c,
+ * elf32-vax.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xstormy16.c,
+ * elf32-xtensa.c, * elf64-alpha.c, * elf64-gen.c, * elf64-hppa.c,
+ * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c,
+ * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c,
+ * elf64-x86-64.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
+ * epoc-pe-arm.c, * epoc-pei-arm.c, * hp300bsd.c, * hp300hpux.c,
+ * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386bsd.c,
+ * i386dynix.c, * i386freebsd.c, * i386linux.c, * i386lynx.c,
+ * i386mach3.c, * i386msdos.c, * i386netbsd.c, * i386os9k.c,
+ * irix-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c,
+ * m88kmach3.c, * m88kopenbsd.c, * mach-o-i386.c, * mach-o-x86-64.c,
+ * makefile.vms, * mipsbsd.c, * mmo.c, * netbsd-core.c, * newsos3.c,
+ * nlm32-alpha.c, * nlm32-i386.c, * nlm32-ppc.c, * nlm32-sparc.c,
+ * ns32knetbsd.c, * osf-core.c, * pc532-mach.c, * pe-arm-wince.c,
+ * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-ppc.c,
+ * pe-sh.c, * pe-x86_64.c, * pei-arm-wince.c, * pei-arm.c,
+ * pei-i386.c, * pei-ia64.c, * pei-mcore.c, * pei-mips.c, * pei-ppc.c,
+ * pei-sh.c, * pei-x86_64.c, * ppcboot.c, * ptrace-core.c, * riscix.c,
+ * sco5-core.c, * som.c, * sparclinux.c, * sparclynx.c,
+ * sparcnetbsd.c, * sunos.c, * targets.c, * trad-core.c,
+ * vax1knetbsd.c, * vaxbsd.c, * vaxnetbsd.c, * versados.c,
+ * vms-alpha.c, * vms-lib.c: Rename bfd targets to
+ <cpu>_<format>_<other>_<endian>_vec. Adjust associated MY macros
+ on aout targets.
+ * configure: Regenerate.
-2013-04-19 Nick Clifton <nickc@redhat.com>
+2014-05-01 Hans-Peter Nilsson <hp@bitrange.com>
- PR binutils/15356
- * compress.c (decompress_contents): Always call inflateEnd, even
- when another inflation operation fails.
+ * mmo.c (mmo File layout documentation): Add note about low bits
+ of address.
+ (mmo_write_chunk): When handling data remainder, assert that
+ previous remaining data is flushed.
+ (mmo_write_loc_chunk): Only look for trailing and leading zeros
+ when dealing with an aligned VMA and for aligned lengths. Don't skip
+ the last 32-bit-word of zeros.
+ (mmo_write_loc_chunk): Emit an error if the VMA is not aligned.
+ (mmo_scan) <case LOP_QUOTE>: Move re-alignment of vma before
+ emitting data, not after updating it.
+ <case LOP_LOC>: Call mmo_decide_section with aligned vma.
-2013-04-17 H.J. Lu <hongjiu.lu@intel.com>
+2014-04-30 Nick Clifton <nickc@redhat.com>
- * elf-ifunc.c: Update copyright year.
+ * compress.c (bfd_is_section_compressed): When checking the
+ .debug_str section, also check the fifth byte in the section is
+ not part of a string.
-2013-04-17 Luca Pizzamiglio <luca.pizzamiglio@gmail.com>
+2014-04-30 Alan Modra <amodra@gmail.com>
- * coffcode.h: Added a cast to void when a bfd_set_section_*()
- macro's return value is ignored.
- * elf32-hppa.c: Likewise.
- * elf32-tic6x.c: Likewise.
- * mach-o.c: Likewise.
- * mmo.c: Likewise.
- * opncls.c: Likewise.
- * peicode.h: Likewise.
- * elf32-m32r.c: Check return value of bfd_set_section_*().
- * elfnn-ia64.c: Likewise.
- * elfxx-mips.c: Likewise.
- * vms-alpha.c: Likewise.
+ * elf-eh-frame.c (struct cie.personality): Replace val with sym.
+ (find_merged_cie): Identify personality functions by (bfd_id,index)
+ pair when a local sym is used.
-2013-04-15 H.J. Lu <hongjiu.lu@intel.com>
+2014-04-29 Christian Svensson <blue@cmd.nu>
- PR ld/15371
- * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Check
- regular reference without non-GOT reference when building
- shared library.
+ * elf32-or1k.c: Fix a bug where non-TLS relocations would be forced
+ into .rela.got if it contained TLS relocations as well.
-2013-04-15 Alan Modra <amodra@gmail.com>
+2014-04-28 Nick Clifton <nickc@redhat.com>
- * archive.c (_bfd_archive_close_and_cleanup): Clear parent
- cache slot for archives.
+ PR ld/16821
+ * peXXigen.c (_bfd_XXi_swap_sym_out): Rework fix to avoid compile
+ time warning.
-2013-04-14 Hans-Peter Nilsson <hp@bitrange.com>
+2014-04-26 Alan Modra <amodra@gmail.com>
- * mmo.c (mmo_write_chunk): Break out abfd->tdata.mmo_data to new
- local variable mmop.
+ * po/SRC-POTFILES.in: Regenerate.
+ * configure: Regenerate.
-2013-04-09 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
+2014-04-25 Nick Clifton <nickc@redhat.com>
+
+ PR ld/16821
+ * peXXigen.c (_bfd_XXi_swap_sym_out): Another fix for building on
+ a 342-bit host. This time for older versions of gcc.
+
+2014-04-24 Nick Clifton <nickc@redhat.com>
+
+ * peXXigen.c (rsrc_print_section): Fix compile time warning for
+ 32-bit hosts.
+
+2014-04-24 Alan Modra <amodra@gmail.com>
+
+ PR 16867
+ * dwarf2.c: Formatting.
+ (struct dwarf2_debug): Make adjusted_section_count signed.
+ (unset_sections): Make i signed.
+ (set_debug_vma): New function.
+ (place_sections): Handle separate debug object file. Set VMA
+ on debug sections, even if they have an output section. Also
+ set VMA on zero size sections, and non-load but alloc sections.
+ Set adjusted_section_count to -1 when no section adjustment.
+ Malloc adjusted_sections. Don't double last_vma. Transfer
+ alloc section VMAs to separate debug file.
+ (_bfd_dwarf2_cleanup_debug_info): Free adjusted_sections.
+ (_bfd_dwarf2_slurp_debug_info): Add do_place parameter. Drop
+ test on symbols being the same before using old stash. Read
+ and use separate debug file symbols. Call place_sections.
+ (find_line): Don't call place_sections here.
+ * libbfd-in.h (_bfd_dwarf2_slurp_debug_info): Update proto.
+ * libbfd.h: Regenerate.
+ * mach-o.c (bfd_mach_o_find_nearest_line): Adjust
+ _bfd_dwarf2_slurp_debug_info call.
+ * simple.c (simple_save_output_info): Clarify comment.
+
+2014-04-24 Nick Clifton <nickc@redhat.com>
+
+ PR ld/16807
+ * peXXigen.c (struct rsrc_regions): New structure.
+ (rsrc_print_resource_directory): Use new structure. Include
+ offset of directory in listing.
+ (rsrc_print_resource_entry): Likewise.
+ (rsrc_print_section): Likewise.
+ (rsrc_count_entries): Do not increment sizeof_strings or
+ sizeof_leaves.
+ (rsrc_count_directory): Do not increment sizeof_tables.
+ (rsrc_compute_region_sizes): New function.
+ (rsrc_write_leaf): Maintain 8-byte alignment for resource data.
+ (rsrc_process_section): Compute size of regions after merging
+ entries.
- PR ld/12494
- * bfd/elf32-avr.c: Consider all sections to determine if linker
- relaxation can safely delete a ret after a call/jmp
+2014-04-23 Alan Modra <amodra@gmail.com>
-2013-04-09 Mingjie Xing <mingjie.xing@gmail.com>
+ PR ld/16787
+ * dwarf2.c (struct dwarf2_debug): Add sec_vma field.
+ (place_sections): Do not modify VMA of sections when called from
+ linker after sections have been placed in output sections. Short
+ circuit single section case.
+ (save_section_vma, section_vma_same): New functions.
+ (_bfd_dwarf2_slurp_debug_info): Throw away stash if section VMAs
+ change.
+ * reloc.c (bfd_perform_relocation): Do not modify reloc addend
+ when non-relocatable.
- * bfd.c (typedef bfd, Error reporting, Miscellaneous): Add
- INODEs.
+2014-04-22 Nick Clifton <nickc@redhat.com>
-2013-04-08 Tom Tromey <tromey@redhat.com>
+ PR ld/16821
+ * peXXigen.c (_bfd_XXi_swap_sym_out): Fix for 32-bit hosts.
- * som.c (bfd_section_from_som_symbol): No longer static.
- * som.h (bfd_section_from_som_symbol): Declare.
+2014-04-22 Christian Svensson <blue@cmd.nu>
-2013-04-06 Alan Modra <amodra@gmail.com>
+ * Makefile.am: Remove openrisc and or32 support. Add support for or1k.
+ * archures.c: Likewise.
+ * coffcode.h: Likewise.
+ * config.bfd: Likewise.
+ * configure.in: Likewise.
+ * reloc.c: Likewise.
+ * targets.c: Likewise.
+ * cpu-or1k.c: New file.
+ * elf32-or1k.c: New file.
+ * coff-or32.c: Delete.
+ * cpu-openrisc.c: Delete.
+ * cpu-or32.c: Delete.
+ * elf32-openrisc.c: Delete.
+ * elf32-or32.c: Delete.
+ * Makefile.in: Regenerate.
+ * bfd-in2.h: Regenerate.
+ * configure: Regenerate.
+ * libbfd.h: Regenerate.
- * elf32-ppc.c (ppc_elf_check_relocs): Use SYMBOLIC_BIND.
- * elf64-ppc.c (ppc64_elf_check_relocs, dec_dynrel_count): Likewise.
+2014-04-22 Yuanhui Zhang <asmwarrior@gmail.com>
+
+ PR ld/16821
+ * peXXigen.c (abs_finder): Fix for 32-bit host builds.
+
+2014-04-22 Will Newton <will.newton@linaro.org>
+
+ * elfnn-aarch64.c (elfNN_aarch64_section_flags): Remove
+ function. (elf_backend_section_flags): Remove define.
+
+2014-04-21 Richard Henderson <rth@redhat.com>
+
+ * elf64-alpha.c (elf64_alpha_size_got_sections): New may_merge
+ parameter; honor it and disable got merging when false.
+ (elf64_alpha_relax_got_load): Do not relax to GPREL relocs during
+ the first pass of relaxation.
+ (elf64_alpha_relax_with_lituse): Likewise. Move relaxed relocs to
+ the end of the LITERAL+LITUSE chain.
+ (elf64_alpha_relax_section): Only process LITERAL relocs during the
+ second pass of relaxation.
+
+ * configure.ac (use_secureplt): Enable by default.
+ * configure: Rebuild.
+
+2014-04-18 Tristan Gingold <gingold@adacore.com>
+
+ * mach-o.h (bfd_mach_o_dyld_info_command): Add rebase_content,
+ bind_content, weak_bind_content, lazy_bind_content,
+ export_content.
+ (bfd_mach_o_load_command): Add comments, add next field.
+ (mach_o_data_struct): Replace commands field by first_command
+ and last_command.
+ * mach-o.c (bfd_mach_o_append_command): New function.
+ (bfd_mach_o_bfd_copy_private_symbol_data): Add blank lines.
+ (bfd_mach_o_bfd_copy_private_section_data): Check flavour,
+ copy fields.
+ (bfd_mach_o_bfd_copy_private_header_data): Copy load commands.
+ (bfd_mach_o_pad4, bfd_mach_o_pad_command): New functions.
+ (bfd_mach_o_write_thread): Use macro instead of literal.
+ (bfd_mach_o_write_dylinker, bfd_mach_o_write_dylib)
+ (bfd_mach_o_write_main, bfd_mach_o_write_dyld_info): New
+ functions.
+ (bfd_mach_o_write_symtab_content): New function (extracted
+ from bfd_mach_o_write_symtab).
+ (bfd_mach_o_write_symtab): Split.
+ (bfd_mach_o_count_indirect_symbols): Move
+ (bfd_mach_o_build_dysymtab): Remove layout code.
+ (bfd_mach_o_write_contents): Rewritten to build commands in order.
+ (bfd_mach_o_count_sections_for_seg): Remove.
+ (bfd_mach_o_build_obj_seg_command): New function (extracted from
+ bfd_mach_o_build_seg_command).
+ (bfd_mach_o_build_exec_seg_command): New function.
+ (bfd_mach_o_build_dysymtab_command): Remove.
+ (bfd_mach_o_layout_commands): New function.
+ (bfd_mach_o_init_segment): New function.
+ (bfd_mach_o_build_commands): Major rework to handle non-object
+ files.
+ (bfd_mach_o_alloc_and_read, bfd_mach_o_read_dyld_content): New
+ function.
+ (bfd_mach_o_read_dyld_info): Clear content fields.
+ (bfd_mach_o_read_segment): Adjust call.
+ (bfd_mach_o_flatten_sections): Adjust as now load commands are
+ chained.
+ (bfd_mach_o_scan_start_address, bfd_mach_o_scan)
+ (bfd_mach_o_mkobject_init, bfd_mach_o_get_base_address)
+ (bfd_mach_o_lookup_command, bfd_mach_o_core_fetch_environment):
+ Likewise.
-2013-04-05 Nick Clifton <nickc@redhat.com>
+2014-04-18 Tristan Gingold <gingold@adacore.com>
+
+ * mach-o-target.c (bfd_mach_o_bfd_copy_private_header_data):
+ Define instead of bfd_mach_o_bfd_copy_private_bfd_data.
+ * mach-o.c (bfd_mach_o_bfd_copy_private_bfd_data): Rename.
+ * mach-o.h (bfd_mach_o_bfd_copy_private_bfd_data): Likewise.
+
+2014-04-18 Tristan Gingold <gingold@adacore.com>
+
+ * mach-o.h (bfd_mach_o_dylinker_command)
+ (bfd_mach_o_dylib_command, bfd_mach_o_fvmlib_command): Remove
+ name_len field.
+ * mach-o.c (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib)
+ (bfd_mach_o_read_fvmlib): Adjust after name_len removal.
+
+2014-04-18 Tristan Gingold <gingold@adacore.com>
+
+ * mach-o.h (bfd_mach_o_backend_data): Add page_size field.
+ * mach-o-target.c: Check TARGET_PAGESIZE is defined.
+ (TARGET_NAME_BACKEND): Add TARGET_PAGESIZE.
+ * mach-o.c (TARGET_PAGESIZE): Define and undefined for
+ each targets declared.
+ * mach-o-x86-64.c (TARGET_PAGESIZE): Define.
+ * mach-o-i386.c (TARGET_PAGESIZE): Define.
+
+2014-04-18 Tristan Gingold <gingold@adacore.com>
+
+ * mach-o.c (bfd_mach_o_write_thread)
+ (bfd_mach_o_write_section_32, bfd_mach_o_write_section_64)
+ (bfd_mach_o_write_segment_32, bfd_mach_o_write_segment_64)
+ (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib)
+ (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_prebind_cksum)
+ (bfd_mach_o_read_twolevel_hints, bfd_mach_o_read_fvmlib)
+ (bfd_mach_o_read_thread, bfd_mach_o_read_dysymtab)
+ (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid)
+ (bfd_mach_o_read_linkedit, bfd_mach_o_read_str)
+ (bfd_mach_o_read_dyld_info, bfd_mach_o_read_segment)
+ (bfd_mach_o_read_segment_32, bfd_mach_o_read_segment_64)
+ (bfd_mach_o_read_command): Now return a boolean status.
+ Adjust return statements.
+ (bfd_mach_o_write_contents, bfd_mach_o_scan): Adjust tests.
+ (bfd_mach_o_core_file_failing_command): Remove useless initialization.
+
+2014-04-17 Kwok Cheung Yeung <kcy@codesourcery.com>
+
+ * elfxx-mips.c (struct mips_got_info): Delete assigned_gotno
+ field. Add assigned_low_gotno and assigned_high_gotno fields.
+ (mips_elf_create_local_got_entry): Update out-of-space condition.
+ Set index of new GOT entry to assigned_low_gotno if required by
+ the current relocation, else set it to assigned_high_gotno.
+ (mips_elf_set_global_gotidx): Replace uses of assigned_gotno
+ with assigned_low_gotno.
+ (mips_elf_multi_got): Initialize assigned_low_gotno and
+ assigned_high_gotno in secondary GOTs. Use assigned_low_gotno
+ in place of assigned_gotno when handling global GOT entries.
+ (mips_elf_lay_out_got): Initialize assigned_low_gotno and
+ assigned_high_gotno.
+ (_bfd_mips_elf_finish_dynamic_sections): Account for a possible
+ gap in the middle of local GOT space.
+
+2014-04-17 Alan Modra <amodra@gmail.com>
+
+ PR 16846
+ * elflink.c (_bfd_elf_merge_symbol): Ignore TLS mismatch when
+ current bfd is a plugin. Don't always set type_change_ok
+ when old bfd is a plugin.
+
+2014-04-16 Tristan Gingold <gingold@adacore.com>
+
+ * mach-o-x86-64.c (bfd_mach_o_x86_64_mkobject): Adjust cpusubtype
+ flag.
+
+2014-04-16 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Fill 476 fixup area
+ with "ba 0" rather than zeros.
+
+2014-04-15 Marcus Shawcroft <marcus.shawcroft@arm.com>
+
+ * (elfNN_aarch64_tls_relax): Fix instruction mask.
+
+2014-04-14 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (BA): Define
+ (ppc_elf_link_hash_table_create): Correct default_params.
+ (write_glink_stub): Pad small plt call stub with "ba 0" rather
+ than "nop" for ppc476_workaround.
+ (ppc_elf_finish_dynamic_sections): Likewise for branch table
+ and __glink_PLTresolve. Ensure plt call stub at end of page
+ doesn't allow fall-thru prefetch.
+
+2014-04-11 Nick Clifton <nickc@redhat.com>
+
+ PR ld/16821
+ * peXXigen.c (abs_finder): New function.
+ (_bfd_XXi_swap_sym_out): For absolute symbols with values larger
+ than 1^32 try to convert them into section relative values
+ instead.
+
+2014-04-11 Nick Clifton <nickc@redhat.com>
- * elflink.c (elf_link_add_object_symbols): Revert accidental commit.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
-2013-04-04 Alan Modra <amodra@gmail.com>
+2014-04-10 Cesar Philippidis <cesar@codesourcery.com>
- * bfd.c (bfd_error_type, bfd_errmsgs): Add bfd_error_missing_dso.
- * bfd-in2.h: Regenerate.
- * elflink.c (elf_link_add_object_symbols): Use new error.
-
-2013-04-03 Nick Clifton <nickc@redhat.com>
-
- * elf32-v850.c (v850_elf_is_target_special_symbol): New function.
- (bfd_elf32_bfd_is_target_special_symbol): Define.
-
-2013-04-03 Venkataramanan Kumar <venkataramanan.kumar@linaro.org>
-
- * elf64-aarch64.c (elf64_aarch64_gc_sweep_hook): Use
- elf64_aarch64_locals to get local GOT reference counts.
-
-2013-04-02 DJ Delorie <dj@redhat.com>
-
- * elf32-rl78.c (GET_RELOC): Assert that there are relocs to get.
- (rl78_elf_relax_section): Only fetch the next reloc if there is
- one expected.
-
-2013-03-30 Alan Modra <amodra@gmail.com>
-
- PR ld/15323
- * elf-m10300.c (mn10300_elf_check_relocs): Set non_ir_ref for
- global symbols referenced by relocs.
- * elf32-arm.c (elf32_arm_check_relocs): Likewise.
- * elf32-bfin.c (bfin_check_relocs): Likewise.
- * elf32-cr16.c (cr16_elf_check_relocs): Likewise.
- * elf32-cris.c (cris_elf_check_relocs): Likewise.
- * elf32-d10v.c (elf32_d10v_check_relocs): Likewise.
- * elf32-dlx.c (elf32_dlx_check_relocs): Likewise.
- * elf32-fr30.c (fr30_elf_check_relocs): Likewise.
- * elf32-frv.c (elf32_frv_check_relocs): Likewise.
- * elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
- * elf32-i370.c (i370_elf_check_relocs): Likewise.
- * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise.
- * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
- * elf32-m32c.c (m32c_elf_check_relocs): Likewise.
- * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
- * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise.
- * elf32-m68k.c (elf_m68k_check_relocs): Likewise.
- * elf32-mcore.c (mcore_elf_check_relocs): Likewise.
- * elf32-metag.c (elf_metag_check_relocs): Likewise.
- * elf32-microblaze.c (microblaze_elf_check_relocs): Likewise.
- * elf32-moxie.c (moxie_elf_check_relocs): Likewise.
- * elf32-msp430.c (elf32_msp430_check_relocs): Likewise.
- * elf32-mt.c (mt_elf_check_relocs): Likewise.
- * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
- * elf32-openrisc.c (openrisc_elf_check_relocs): Likewise.
- * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
- * elf32-rl78.c (rl78_elf_check_relocs): Likewise.
- * elf32-s390.c (elf_s390_check_relocs): Likewise.
- * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
- * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
- * elf32-sh.c (sh_elf_check_relocs): Likewise.
- * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
- * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
- * elf32-v850.c (v850_elf_check_relocs): Likewise.
- * elf32-vax.c (elf_vax_check_relocs): Likewise.
- * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise.
- * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
- * elf64-aarch64.c (elf64_aarch64_check_relocs): Likewise.
- * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
- * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
- * elf64-ia64-vms.c (elf64_ia64_check_relocs): Likewise.
- * elf64-mmix.c (mmix_elf_check_relocs): Likewise.
- * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
- * elf64-s390.c (elf_s390_check_relocs): Likewise.
- * elf64-sh64.c (sh_elf64_check_relocs): Likewise.
- * elfnn-ia64.c (elfNN_ia64_check_relocs): Likewise.
- * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
- * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
- * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise. Don't
- test indirect/warning links for NULL.
-
-2013-03-29 H.J. Lu <hongjiu.lu@intel.com>
-
- PR ld/15323
- * elf32-i386.c (elf_i386_check_relocs): Set non_ir_ref if a
- symbol is referenced by a non-shared object.
- * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
-
-2013-03-28 Joe Seymour <jseymour@codesourcery.com>
-
- * elf32-sh.c (sh_elf_relocate_section): Suppress warnings for
- R_SH_REL32 relocations against undefined weak symbols.
-
-2013-03-28 Alan Modra <amodra@gmail.com>
-
- * elf64-ppc.c (struct ppc_dyn_relocs): New.
- (ppc64_elf_check_relocs): Separate dynrel counts for local syms
- into ifunc and non-ifunc.
- (dec_dynrel_count): Pass in sym rather than sym_sec. Handle
- separate ifunc/non-ifunc dynrel counts.
- (allocate_got): Always use reliplt for ifunc.
- (allocate_dynrelocs): Likewise.
- (ppc64_elf_size_dynamic_sections): Likewise.
- (ppc64_elf_layout_multitoc): Likewise.
- (ppc64_elf_relocate_section): Likewise.
+ * elf32-nios2.c (nios2_elf32_build_stubs): Ignore dynobjs
+ when building function stubs.
-2013-03-28 Alan Modra <amodra@gmail.com>
-
- * elf32-ppc.c (struct ppc_dyn_relocs): New.
- (ppc_elf_check_relocs): Separate dynrel counts for local syms
- into ifunc and non-ifunc.
- (allocate_dynrelocs): Always put ifunc relocs into reliplt.
- (ppc_elf_size_dynamic_sections): Likewise.
- (ppc_elf_relocate_section): Likewise.
-
-2013-03-28 Alan Modra <amodra@gmail.com>
-
- * elf-bfd.h (enum elf_reloc_type_class): Add reloc_class_ifunc.
- (struct elf_backend_data <elf_backed_reloc_type_class>): Add
- bfd_link_info* and asection* params.
- (_bfd_elf_reloc_type_class): Likewise.
- * elf.c (_bfd_elf_reloc_type_class): Likewise.
- * elflink.c (elf_link_sort_cmp2): Sort first on reloc class.
- (elf_link_sort_relocs): Update elf_backed_reloc_type_class call.
- * elf32-ppc.c (ppc_elf_reloc_type_class): Return reloc_class_ifunc
- for any reliplt reloc. Don't return reloc_class_plt for
- R_PPC_REL24 and R_PPC_ADDR24.
- * elf64-ppc.c (allocate_got): Formatting.
- (ppc64_elf_reloc_type_class): Return reloc_class_ifunc for any
- reliplt reloc.
- * elf-m10300.c, * elf32-arm.c, * elf32-bfin.c, * elf32-cr16.c,
- * elf32-cris.c, * elf32-hppa.c, * elf32-i386.c, * elf32-lm32.c,
- * elf32-m32r.c, * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c,
- * elf32-s390.c, * elf32-sh.c, * elf32-sparc.c, * elf32-tilepro.c,
- * elf32-vax.c, * elf32-xtensa.c, * elf64-aarch64.c, * elf64-alpha.c,
- * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-s390.c, * elf64-sparc.c,
- * elf64-x86-64.c, * elfnn-ia64.c, * elfxx-tilegx.c, * elfxx-tilegx.h:
- Add extra params to the various reloc_type_class functions.
+2014-04-10 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
-2013-03-27 Alan Modra <amodra@gmail.com>
+ * elf32-avr.c: Add DIFF relocations for AVR.
+ (avr_final_link_relocate): Handle the DIFF relocs.
+ (bfd_elf_avr_diff_reloc): New.
+ (elf32_avr_is_diff_reloc): New.
+ (elf32_avr_adjust_diff_reloc_value): Reduce difference value.
+ (elf32_avr_relax_delete_bytes): Recompute difference after deleting
+ bytes.
- * elf32-ppc.c (ppc_elf_check_relocs): Set PLT_IFUNC in local got
- masks for all local ifunc syms.
- (allocate_dynrelocs): Don't use htab->relgot for ifunc.
- (ppc_elf_size_dynamic_sections): Likewise.
- (ppc_elf_relocate_section): Likewise.
+ * reloc.c: Add BFD_RELOC_AVR_DIFF8/16/32 relocations
-2013-03-27 Will Newton <will.newton@linaro.org>
+2014-04-09 Alan Modra <amodra@gmail.com>
- * elf32-arm.c (elf32_arm_final_link_relocate): Avoid emitting a
- dynamic reloc for symbols with dynindx == -1.
- (allocate_dynrelocs_for_symbol): Avoid allocating space for a
- dynamic reloc for symbols with dynindx == -1.
+ * libcoff.h: Regenerate.
-2013-03-27 Will Newton <will.newton@linaro.org>
+2014-04-09 Alan Modra <amodra@gmail.com>
- * elf32-arm.c (elf32_arm_final_link_relocate): Avoid emitting a
- dynamic reloc for non-default visibility undefined weaks.
- (allocate_dynrelocs_for_symbol): Avoid allocating space for a
- dynamic reloc for non-default visibility undefined weaks.
+ * elf32-ppc.c (ppc_elf_relocate_section): Remove bctr from list
+ of safe ppc476 insns at end of page. Also remove non-branch insns.
+ Expand comments.
-2013-03-26 Alan Modra <amodra@gmail.com>
+2014-04-08 Jon Turney <jon.turney@dronecode.org.uk>
- * elflink.c (_bfd_elf_add_default_symbol): Preserve section
- over _bfd_elf_merge_symbol calls.
+ * peXXigen.c (pe_print_debugdata): New function: Displays the
+ contents of the debug directory and decodes codeview entries.
+ (_bfd_XXi_swap_debugdir_in, _bfd_XXi_swap_debugdir_out)
+ (_bfd_XXi_slurp_codeview_record, _bfd_XXi_write_codeview_record):
+ Add functions for reading and writing debugdir and codeview
+ records.
+ * libpei.h (_bfd_XXi_swap_debugdir_in, _bfd_XXi_swap_debugdir_out)
+ (_bfd_XXi_write_codeview_record): Add prototypes and macros.
+ * libcoff-in.h (pe_tdata): Add build-id data.
+ * libcoff.h: Regenerate.
+ * coffcode.h (coff_write_object_contents): Run build_id
+ after_write_object_contents hook.
-2013-03-26 Alan Modra <amodra@gmail.com>
+2014-04-05 Alan Modra <amodra@gmail.com>
- * elflink.c (elf_link_add_object_symbols): Add assertion for
- common override alignment check code. Formatting.
+ * elflink.c (_bfd_elf_add_default_symbol): Pass poldbfd when
+ merging non-default sym.
-2013-03-25 Alan Modra <amodra@gmail.com>
+2014-04-04 Tristan Gingold <gingold@adacore.com>
- * elflink.c (_bfd_elf_merge_symbol): Set old_alignment for
- usual common symbols as well as for dynamic. Add poldbfd param.
- Save old bfd. Adjust callers.
- (_bfd_elf_add_default_symbol): Add poldbfd param. Pass "section"
- and "value" by value, not pointer. Adjust caller.
- (elf_link_add_object_symbols): Combine undef_bfd and old_bfd vars.
- Delete code to set same. Use old_bfd and old_alignment from
- _bfd_elf_merge_symbol instead. Add default symbol before
- alignment and size checks. Wrap overlong lines.
+ * mach-o.c (bfd_mach_o_header_p): Reject 64 bit target when not
+ configured for.
-2013-03-25 Alan Modra <amodra@gmail.com>
+2014-04-04 Tristan Gingold <gingold@adacore.com>
- * elflink.c (_bfd_elf_add_default_symbol): Delete "override" param.
- (elf_link_add_object_symbols): Don't call _bfd_elf_add_default_symbol
- when override is true.
+ * mach-o.c (bfd_mach_o_convert_section_name_to_mach_o): Fix
+ thinko on names length.
-2013-03-25 Alan Modra <amodra@gmail.com>
+2014-04-04 Tristan Gingold <gingold@adacore.com>
- * elflink.c (_bfd_elf_merge_symbol): Use local var holding value
- of *sym_hash.
+ * mach-o-i386.c (bfd_mach_o_i386_swap_reloc_out): Use target index
+ of output_section.
+ * mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Ditto.
-2013-03-25 Alan Modra <amodra@gmail.com>
+2014-04-04 Tristan Gingold <gingold@adacore.com>
- * elflink.c (_bfd_elf_merge_symbol): Don't discard TLS symbols here.
- Wrap long lines.
- (elf_link_add_object_symbols): Discard TLS symbols for --just-syms
- early in symbol loop.
+ * bfd.c (bfd_get_arch_size): Default is taken from arch.
-2013-03-25 Alan Modra <amodra@gmail.com>
+2014-04-03 Jon Turney <jon.turney@dronecode.org.uk>
- * elf-bfd.h (struct elf_backend_data <merge_symbol>): Update proto.
- (_bfd_elf_init_reloc_shdr): Delete.
- * elf.c (_bfd_elf_init_reloc_shdr): Make static.
- * elf64-x86-64.c (elf_x86_64_merge_symbol): Trim parameters to
- just what is needed.
- * elflink.c (_bfd_elf_merge_symbol): Update bed->merge_symbol call.
-
-2013-03-23 Alan Modra <amodra@gmail.com>
-
- * elf-bfd.h (_bfd_elf_merge_symbol): Delete declaration.
- * elflink.c (_bfd_elf_merge_symbol): Make static.
- * elf32-sh-symbian.c (sh_symbian_relocate_section): Don't call
- _bfd_elf_merge_symbol, call _bfd_generic_link_add_one_symbol.
-
-2013-03-23 Alan Modra <amodra@gmail.com>
-
- PR ld/15270
- * elflink.c (elf_link_add_object_symbols): Don't set def_regular
- or ref_regular for BFD_PLUGIN owned syms, or have them affect
- def_dynamic/ref_dynamic.
- (_bfd_elf_fix_symbol_flags): Don't set def_regular for BFD_PLUGIN
- owned syms.
+ * peXXigen.c (pe_print_edata): Verify edt.name lies inside
+ section before dereferencing.
+ (pe_print_idata, pe_print_edata, pe_print_reloc)
+ (rsrc_print_section): Don't bother interpreting the contents
+ of sections which have no contents.
-2013-03-22 David S. Miller <davem@davemloft.net>
+2014-04-03 Maria Guseva <m.guseva@samsung.com>
- * elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): Set type of
- hwcaps attribute.
+ PR ld/16803
+ * elf.c (_bfd_elf_set_section_contents): Use correct type to hold
+ file position.
-2013-03-22 Achille Fouilleul <achille.fouilleul+binutils@gadz.org>
+2014-04-03 Tristan Gingold <gingold@adacore.com>
- PR ld/14902
- * elf32-h8300.c (elf32_h8_relax_delete_bytes): Fix off by one
- errors adjusting relocs and symbols.
+ * mach-o.c (bfd_mach_o_mangle_symbols): Use index from
+ output_section.
+ (bfd_mach_o_build_seg_command): Add comment. Realign segment.
+ Fix style.
+ (bfd_mach_o_build_commands, bfd_mach_o_read_thread): Fix style.
-2013-03-21 Michael Schewe <michael.schewe@gmx.net>
+2014-04-03 Alan Modra <amodra@gmail.com>
- * elf32-h8300 (h8_relax_section): Add new relaxation of mov
- @(disp:32,ERx) to mov @(disp:16,ERx).
- (R_H8_DISP32A16): New reloc.
- Comments added and corrected.
- * reloc.c (BFD_RELOC_H8_DISP32A16): New reloc.
+ * elf-bfd.h (struct elf_backend_data
+ <elf_backend_bfd_from_remote_memory>): Replace "size_t size"
+ with "bfd_size_type size".
+ (_bfd_elf32_bfd_from_remote_memory): Likewise.
+ (_bfd_elf64_bfd_from_remote_memory): Likewise.
+ * elf.c (bfd_elf_bfd_from_remote_memory): Likewise.
+ * elfcode.h (bfd_from_remote_memory): Likewise.
+ * bfd-in.h (bfd_elf_bfd_from_remote_memory): Likewise.
* bfd-in2.h: Regenerate.
- * libbfd.h: Regenerate.
-
-2013-03-21 Kai Tietz <ktietz@redhat.com>
- * coffgen.c (coff_real_object_p): Make global.
- * peicode.h (coff_real_object_p): Add prototype.
- (FILHDR): Defined for COFF_IMAGE_WITH_PE as
- external_PEI_IMAGE_hdr structure.
- (coff_swap_filehdr_in): Handle variable header-size.
- * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Just handle amount
- of directory-entiries as specified in pe-header.
+2014-04-02 Tristan Gingold <gingold@adacore.com>
+
+ * mach-o.h (bfd_mach_o_twolevel_hints_command)
+ (bfd_mach_o_prebind_cksum_command): New types.
+ (bfd_mach_o_prebound_dylib_command): Rewrite.
+ (bfd_mach_o_load_command): Add prebind_cksum and twolevel_hints
+ fields.
+ * mach-o.c (bfd_mach_o_read_prebound_dylib): Read and decode the
+ command.
+ (bfd_mach_o_read_prebind_cksum): New function.
+ (bfd_mach_o_read_twolevel_hints): Ditto.
+ (bfd_mach_o_read_command): Handle prebind cksum and twolevel hints
+ commands.
+
+2014-04-02 Alan Modra <amodra@gmail.com>
+
+ * elfcode.h (bfd_from_remote_memory): Add "size" parameter.
+ Consolidate code handling possible section headers past end of
+ segment. Don't use p_align for page size guess, instead use
+ minpagesize. Take note of ld.so clearing section headers when
+ p_memsz > p_filesz. Handle file header specifying no section
+ headers. Handle zero p_align throughout. Default loadbase to
+ zero. Add comments. Rename contents_size to high_offset, and
+ make it a bfd_vma. Delete unnecessary bfd_set_error calls.
+ * bfd-in.h (bfd_elf_bfd_from_remote_memory): Update prototpe.
+ * elf-bfd.h (struct elf_backend_data <elf_backend_from_remote_memory>):
+ Likewise.
+ (_bfd_elf32_bfd_from_remote_memory): Likewise.
+ (_bfd_elf64_bfd_from_remote_memory): Likewise.
+ * elf.c (bfd_elf_bfd_from_remote_memory): Adjust.
+ * bfd-in2.h: Regnerate.
-2013-03-21 Nick Clifton <nickc@redhat.com>
+2014-04-01 Tristan Gingold <gingold@adacore.com>
- PR sim/15286
- * elf32-arm.c (bfd_arm_get_mach_from_attributes): Identify XScale,
- iWMMXt and iWMMXt2 processors from attributes.
+ * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Avoid to crash
+ when num == 0.
-2013-03-20 Alan Modra <amodra@gmail.com>
+2014-03-27 Yury Gribov <y.gribov@samsung.com>
+ Pavel Fedin <p.fedin@samsung.com>
- * elflink.c (_bfd_elf_make_dynamic_reloc_section): Override
- sh_type according to is_rela.
+ * elf32-arm.c: Add support for limited pretty-printing of PLT
+ entries on eabi and nacl targets.
+ (elf32_arm_get_synthetic_symtab): Add new callback.
+ (elf32_arm_nacl_plt_sym_val): Likewise.
+ (elf32_arm_plt0_size): Add helper function.
+ (elf32_arm_plt_size): Likewise.
-2013-03-18 Alan Modra <amodra@gmail.com>
+2014-03-27 Tristan Gingold <gingold@adacore.com>
- PR ld/12549
- * elflink.c (elf_link_add_object_symbols): Exclude weak refs when
- considering whether an --as-needed library is needed.
+ * mach-o.c (bfd_mach_o_read_dylinker): Remove assert.
+ (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_DYLD_ENVIRONMENT.
-2013-03-14 Tom Tromey <tromey@redhat.com>
+2014-03-27 Tristan Gingold <gingold@adacore.com>
- * opncls.c (bfd_get_debug_link_info): Rename from
- get_debug_link_info. Export. Update comment.
- (find_separate_debug_file): Update.
- * bfd-in2.h: Rebuild.
+ * mach-o.h (bfd_mach_o_get_base_address): New prototype.
+ * mach-o.c (bfd_mach_o_write_symtab)
+ (bfd_mach_o_write_contents)
+ (bfd_mach_o_set_section_flags_from_bfd)
+ (bfd_mach_o_build_seg_command): Fix indentation.
+ (bfd_mach_o_get_base_address): New function.
-2013-03-08 Venkataramanan Kumar <venkataramanan.kumar@linaro.org>
+2014-03-26 Nick Clifton <nickc@redhat.com>
- * elf64-aarch64.c (elf_backend_can_gc_sections): Enable gc-section
- support.
- (elf64_aarch64_gc_sweep_hook): Handle GOT, TLS and PLT related
- relocs.
+ * cofflink.c (_bfd_coff_generic_relocate_section): Skip
+ relocations in discarded sections.
-2013-03-08 Andreas Arnez <arnez@linux.vnet.ibm.com>
+2014-03-26 Tristan Gingold <gingold@adacore.com>
- * elf-bfd.h (elfcore_write_s390_tdb): Add prototype.
- * elf.c (elfcore_write_s390_tdb): New function.
- (elfcore_write_register_note): Call it.
- (elfcore_grok_s390_tdb): New function.
- (elfcore_grok_note): Call it.
+ * mach-o.c (bfd_mach_o_convert_architecture): Add
+ BFD_MACH_O_CPU_TYPE_ARM64.
-2013-03-08 Maciej W. Rozycki <macro@codesourcery.com>
+2014-03-26 Alan Modra <amodra@gmail.com>
- * elfxx-mips.c (mips_elf_allocate_lazy_stub): Correct data type.
+ * elf64-ppc.c (ppc64_elf_check_relocs): Account for possibly
+ needed plt entries when taking the address of functions for
+ abiversion == 0 (ie. unknown) as well as abiversion == 2.
+ Move opd setup and abiversion checks to..
+ (ppc64_elf_before_check_relocs): ..here. Renamed from
+ ppc64_elf_process_dot_syms. Set output abiversion from input and
+ input abiversion from output, if either is not set.
+ (ppc64_elf_merge_private_bfd_data): Don't merge flags here.
+ (elf_backend_check_directives): Update.
-2013-03-05 Corinna Vinschen <vinschen@redhat.com>
+2014-03-25 Will Newton <will.newton@linaro.org>
- * config.bfd: Add x86_64-*-cygwin to list of supported targets.
+ * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_sections):
+ Set value of DT_PLTRELSZ and DT_RELASZ based on the size
+ of input sections rather than output sections.
-2013-03-04 Alan Modra <amodra@gmail.com>
+2014-03-20 Will Newton <will.newton@linaro.org>
- * elf32-ppc.c (ppc_elf_relocate_section <R_PPC_PLTREL24>): Adjust
- non-zero addends when relocatable, rather than addends >= 32768.
- Always zero "addend" before applying relocation.
+ PR ld/16715
+ * elf32-arm.c (elf32_arm_check_relocs): Set
+ pointer_equality_needed for absolute references within
+ executable links.
+ (elf32_arm_finish_dynamic_symbol): Set st_value to zero
+ unless pointer_equality_needed is set.
-2013-03-04 Nick Clifton <nickc@redhat.com>
+2014-03-19 Nick Clifton <nickc@redhat.com>
- * archive64.c (bfd_elf64_archive_write_armap): Fix calculation of
- file pointer offsets for thin archives.
+ * peXXigen.c (rsrc_process_section): Add code to scan input
+ sections and record their lengths. Use these lengths to find the
+ start of each merged .rsrc section.
-2013-02-28 Nathan Sidwell <nathan@codesourcery.com>
+2014-03-17 Tristan Gingold <gingold@adacore.com>
- * elf32-arm.c (elf32_arm_size_dynamic_sections): Don't call
- elf32_arm_allocate_dynrelocs for source reloc for non-dynamic link.
+ * mach-o.c (bfd_mach_o_read_dylib): Handle lazy load dylib.
+ (bfd_mach_o_read_command): Ditto.
-2013-02-27 DJ Delorie <dj@redhat.com>
+2014-03-14 Meador Inge <meadori@codesourcery.com>
- * reloc.c (BFD_RELOC_RL78_CODE): Add.
- * libbfd.h: Regenerate.
- * bfd-in2.h: Regenerate.
- * elf32-rl78.c (rl78_elf_relocate_section): Handle weak code
- references in compuated relocs.
-
-2013-02-26 Anthony Green <green@moxielogic.com>
-
- * config.bfd: Extend moxie-rtems target triplet name support.
-
-2013-02-21 H.J. Lu <hongjiu.lu@intel.com>
-
- PR ld/15167
- * elf64-ia64-vms.c (elf64_vms_link_add_object_symbols): Set
- unique_global only for definition.
- * elflink.c (_bfd_elf_merge_symbol): Don't set unique_global
- here.
- (elf_link_add_object_symbols): Set unique_global only
- for definition.
-
-2013-02-21 Alan Modra <amodra@gmail.com>
-
- * elf-bfd.h (struct elf_build_id): Extracted from..
- (struct elf_build_id_info): ..here. Delete.
- (struct output_elf_obj_tdata): New, extracted from..
- (struct elf_obj_tdata): ..here. Reorganize for better packing.
- Add "o" field.
- (elf_program_header_size): Reference tdata->o.
- (elf_seg_map, elf_next_file_pos, elf_eh_frame_hdr, elf_linker,
- elf_stack_flags, elf_shstrtab, elf_strtab_sec, elf_shstrtab_sec,
- elf_section_syms, elf_num_section_syms, elf_flags_init): Likewise.
- * elf.c (bfd_elf_allocate_object): Allocate output_elf_obj_tdata
- when opening bfd in any mode that might write.
- (_bfd_elf_write_object_contents): Use build_id field in
- output_elf_obj_tdata.
- (_bfd_elf_close_and_cleanup): Tweak elf_shstrtab test.
- (elfobj_grok_gnu_build_id): Adjust for elf_tdata changes.
-
-2013-02-21 Alan Modra <amodra@gmail.com>
-
- * elf-bfd.h (struct core_elf_obj_tdata): New.
- (struct elf_obj_tdata): Delete core_signal, core_pid, core_lwpid,
- core_program, and core_command. Add "core".
- * elf.c (bfd_elf_mkcorefile): Allocate "core" struct.
- Update all refs to tdata core fields.
- * elf32-am33lin.c, * elf32-arm.c, * elf32-cris.c, * elf32-frv.c,
- * elf32-hppa.c, * elf32-i386.c, * elf32-m68k.c, * elf32-mips.c,
- * elf32-nios2.c, * elf32-ppc.c, * elf32-s390.c, * elf32-score.c,
- * elf32-score7.c, * elf32-sh.c, * elf32-sparc.c, * elf32-tilegx.c,
- * elf32-tilepro.c, * elf32-xtensa.c, * elf64-aarch64.c,
- * elf64-hppa.c, * elf64-mips.c, * elf64-ppc.c, * elf64-tilegx.c,
- * elf64-x86-64.c, * elfcore.h, * elfn32-mips.c: Update all refs
- to tdata core fields.
-
-2013-02-21 Alan Modra <amodra@gmail.com>
-
- * elf-bfd.h (struct elf_obj_tdata): Rename segment_map to seg_map.
- Delete num_locals and num_globals.
- (elf_num_locals, elf_num_globals): Don't define.
- (elf_seg_map, elf_next_file_pos, elf_eh_frame_hdr, elf_linker,
- elf_stack_flags, elf_strtab_sec, elf_shstrtab_sec): Define.
- * bfd.c, * elf-eh-frame.c, * elf-nacl.c, * elf-vxworks.c, * elf.c,
- * elf32-arm.c, * elf32-lm32.c, * elf32-ppc.c, * elf32-rx.c,
- * elf32-spu.c, * elf64-hppa.c, * elfcode.h, * elflink.c,
- * elfnn-ia64.c, * elfxx-mips.c: Use newly defined elf_obj_tdata
- accessor macros.
- * elf.c (elf_map_symbols): Add pnum_locals param. Return
- number of locals syms via new param.
- (swap_out_syms): Adjust to suit elf_map_symbols change.
-
-2013-02-19 Maciej W. Rozycki <macro@codesourcery.com>
-
- * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Also clear
- STO_MICROMIPS annotation.
-
-2013-02-19 Alan Modra <amodra@gmail.com>
-
- * configure.in: Bump version to 2.23.52.
- * elf-bfd.h (struct elf_build_id_info): New.
- (struct elf_obj_tdata): Delete after_write_object_contents,
- after_write_object_contents_info and build_id_size. Make build_id
- a pointer to struct elf_build_id_info.
- * elf.c (_bfd_elf_write_object_contents): Style. Update
- after_write_ibject_contents invocation.
- (elfobj_grok_gnu_build_id): Update for new build_id struct. Don't
- allow zero size notes.
+ * configure.in: Add strnlen to AC_CHECK_DECLS.
+ * config.in: Regenerate.
+ * configure: Regenerate.
+ * sysdep.h (strnlen): Add prototype.
+
+2014-03-14 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Correct overflow
+ handling for VLE_SDA21 relocs.
+
+2014-03-13 Tristan Gingold <gingold@adacore.com>
+
+ * peicode.h (pe_ILF_object_p): Adjust, as the version number
+ has been read.
+ (pe_bfd_object_p): Also read version number to detect ILF.
+ * pe-x86_64.c (COFF_WITH_PE_BIGOBJ): Define.
+ (x86_64pe_bigobj_vec): Define
+ * coffcode.h (bfd_coff_backend_data): Add _bfd_coff_max_nscns field.
+ (bfd_coff_max_nscns): New macro.
+ (coff_compute_section_file_positions): Use unsigned int for
+ target_index. Compare with bfd_coff_max_nscns.
+ (bfd_coff_std_swap_table, ticoff0_swap_table, ticoff1_swap_table):
+ Set a value for _bfd_coff_max_nscns.
+ (header_bigobj_classid): New constant.
+ (coff_bigobj_swap_filehdr_in, coff_bigobj_swap_filehdr_out)
+ (coff_bigobj_swap_sym_in, coff_bigobj_swap_sym_out)
+ (coff_bigobj_swap_aux_in, coff_bigobj_swap_aux_out): New
+ functions.
+ (bigobj_swap_table): New table.
+ * libcoff.h: Regenerate.
+ * coff-sh.c (bfd_coff_small_swap_table): Likewise.
+ * coff-alpha.c (alpha_ecoff_backend_data): Add value for
+ _bfd_coff_max_nscns.
+ * coff-mips.c (mips_ecoff_backend_data): Likewise.
+ * coff-rs6000.c (bfd_xcoff_backend_data)
+ (bfd_pmac_xcoff_backend_data): Likewise.
+ * coff64-rs6000.c (bfd_xcoff_backend_data)
+ (bfd_xcoff_aix5_backend_data): Likewise.
+ * targets.c (x86_64pe_bigobj_vec): Declare.
+ * configure.in (x86_64pe_bigobj_vec): New vector.
* configure: Regenerate.
+ * config.bfd: Add bigobj object format for Windows targets.
-2013-02-18 Maciej W. Rozycki <macro@codesourcery.com>
-
- * elf64-mips.c (micromips_elf64_howto_table_rel): Add
- R_MICROMIPS_SCN_DISP and R_MICROMIPS_JALR.
- (micromips_elf64_howto_table_rela): Likewise.
- (micromips_reloc_map): Add BFD_RELOC_MICROMIPS_JALR.
- * elfn32-mips.c (elf_micromips_howto_table_rel): Add
- R_MICROMIPS_SCN_DISP and R_MICROMIPS_JALR.
- (elf_micromips_howto_table_rela): Likewise.
- (micromips_reloc_map): Add BFD_RELOC_MICROMIPS_JALR.
-
-2013-02-18 Paul Brook <paul@codesourcery.com>
-
- * elfxx-mips.c (MICROMIPS_P): New macro.
- (_bfd_mips_elf_symbol_processing): Use it.
-
-2013-02-18 Maciej W. Rozycki <macro@codesourcery.com>
-
- * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Clarify
- comment on _PROCEDURE_LINKAGE_TABLE_ creation.
-
-2013-02-18 Alan Modra <amodra@gmail.com>
-
- PR ld/12549
- * elf-bfd.h (_bfd_elf_strtab_clear_refs): Delete.
- (_bfd_elf_strtab_clear_all_refs): Declare.
- (_bfd_elf_strtab_resize): Declare.
- * elf-strtab.c (_bfd_elf_strtab_clear_refs): Delete.
- (_bfd_elf_strtab_clear_all_refs): New function.
- (_bfd_elf_strtab_resize): Likewise.
- * elflink.c (elf_link_add_object_symbols): Use _bfd_elf_strtab_resize.
-
-2013-02-18 Alan Modra <amodra@gmail.com>
-
- * elf-bfd.h (struct elf_obj_tdata): Move find_line_info, local_stubs,
- local_call_stubs, elf_data_symbol, elf_text_symbol, elf_data_section,
- and elf_text_section to..
- * elfxx-mips.c (struct mips_elf_obj_tdata): ..here. Update all refs.
- * elf64-alpha.c (struct mips_elf_find_line): Rename to..
- (struct alpha_elf_find_line): ..this.
- (struct alpha_elf_obj_tdata): Add find_line_info, update refs.
-
-2013-02-16 H.J. Lu <hongjiu.lu@intel.com>
-
- PR ld/15146
- * elflink.c (elf_link_add_object_symbols): Don't add DT_NEEDED
- for references from the dummy bfd.
-
-2013-02-16 H.J. Lu <hongjiu.lu@intel.com>
-
- PR ld/15149
- * elflink.c (elf_link_add_object_symbols): Also track weak
- references.
-
-2013-02-15 H.J. Lu <hongjiu.lu@intel.com>
-
- PR binutils/15151
- * archive.c (_bfd_find_nested_archive): Don't allow a nested
- archive pointing to itself.
- (_bfd_get_elt_at_filepos): Revert the last 2 changes.
-
-2013-02-15 Nick Clifton <nickc@redhat.com>
-
- PR binutils/15140
- * archive.c (_bfd_get_elt_at_filepos): Prevent an infinite loop
- accessing a corrupt nested archive.
-
-2013-02-13 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_got_page_ref): New structure.
- (mips_got_page_entry): Use a section rather than a (bfd, symndx)
- pair to represent the anchor point.
- (mips_got_info): Add a got_page_refs field.
- (mips_elf_link_hash_table): Add a sym_cache field.
- (mips_got_page_ref_hash, mips_got_page_ref_eq): New functions.
- (mips_got_page_entry_hash, mips_got_page_entry_eq): Update for
- new anchor representation.
- (mips_elf_create_got_info): Create got_page_refs rather than
- got_page_entries.
- (mips_elf_record_got_page_ref): New function.
- (mips_elf_pages_for_range): Move further down file.
- (mips_elf_record_got_page_entry): Likewise. Take a got as argument.
- Use a section rather than a (bfd, symndx) pair to represent the
- anchor point.
- (mips_elf_resolve_got_page_ref): New function.
- (mips_elf_resolve_final_got_entries): Use it to populate
- got_page_entries.
- (_bfd_mips_elf_check_relocs): Call mips_elf_record_got_page_ref
- rather than mips_elf_record_got_page_entry. Only nullify h
- afterwards.
- (mips_elf_lay_out_got): Call mips_elf_resolve_final_got_entries
- earlier.
-
-2013-02-12 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_elf_lay_out_got): Count VxWorks GOT relocs
- in g->relocs.
-
-2013-02-12 Alan Modra <amodra@gmail.com>
-
- * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Provide
- suitable definition when using generic linker hash table.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_elf_count_got_entries): Delete.
- (mips_elf_check_recreate_got, mips_elf_recreate_got): Take a
- mips_elf_traverse_got_arg. Count GOT entries.
- (mips_elf_resolve_final_got_entries): Take the bfd_link_info
- as argument. Update after above changes.
- (mips_elf_merge_got, mips_elf_lay_out_got): Don't call
- mips_elf_count_got_entries. Update the calls to
- mips_elf_resolve_final_got_entries.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_got_tls_type): New enum.
- (mips_got_entry): Add tls_initialized.
- (mips_elf_got_entry_hash, mips_elf_got_entry_eq, mips_tls_got_relocs)
- (mips_elf_count_got_entry, mips_elf_initialize_tls_index): Remove
- GOT_TLS_TYPE masks.
- (mips_elf_reloc_tls_type, mips_tls_got_entries)
- (mips_elf_record_global_got_symbol, mips_elf_initialize_tls_index)
- (_bfd_mips_elf_finish_dynamic_symbol): Use GOT_TLS_NONE rather
- than GOT_NORMAL.
- (mips_elf_initialize_tls_slots): Replace got_offset and tls_type_p
- arguments with a GOT entry. Remove GOT_TLS_TYPE masks. Use
- tls_initialized rather than GOT_TLS_DONE.
- (mips_tls_got_index): Delete.
- (mips_elf_local_got_index, mips_elf_global_got_index): Use
- mips_elf_initialize_tls_slots rather than mips_tls_got_index.
- (mips_elf_record_got_entry): Initialize tls_initialized.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_got_entry): Remove tls_ldm_offset.
- (mips_elf_link_hash_entry): Remove tls_ie_type, tls_gd_type,
- tls_ie_got_offset and tls_gd_got_offset.
- (mips_elf_link_hash_newfunc): Remove initialization.
- (mips_elf_create_got_info): Likewise.
- (mips_elf_count_local_got_entries, mips_elf_count_global_tls_entries)
- (mips_tls_single_got_index): Delete.
- (mips_elf_local_got_index): Always use the GOT entry to track
- GOT indices.
- (mips_elf_global_got_index): Likewise.
- (mips_elf_create_local_got_entry): Assert that TLS entries have
- already been allocated.
- (mips_elf_record_global_got_symbol): Don't initialize
- tls_ie_type or tls_gd_type.
- (mips_elf_count_got_symbols): Only count reloc-only GOT entries here.
- (mips_elf_initialize_tls_index): Allocate a GOT index for every TLS
- entry.
- (mips_elf_lay_out_got): Use mips_elf_count_got_entries to count
- the GOT entries.
- (_bfd_mips_elf_finish_dynamic_symbol): Assert that TLS GOT offsets
- have been allocated.
- (_bfd_mips_elf_copy_indirect_symbol): Remove handling of
- tls_ie_type and tls_gd_type.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_elf_create_local_got_entry): Tidy. Avoid
- aliasing violation. Check for htab allocation failures.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_elf_primary_global_got_index): New function,
- split out from...
- (mips_elf_global_got_index): ...here. Reorder arguments so that
- the output bfd and info come first.
- (mips_elf_calculate_relocation): Update the call to
- mips_elf_global_got_index accordingly.
- (_bfd_mips_elf_finish_dynamic_symbol): Use
- mips_elf_primary_global_got_index rather than
- mips_elf_global_got_index.
- (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_got_entry): Update comments.
- (mips_elf_multi_got_entry_eq): Rename to...
- (mips_elf_got_entry_eq): ...this, deleting the old definition.
- (mips_elf_create_got_info): Remove master_got_p argument.
- Always use mips_elf_got_entry_eq.
- (mips_elf_bfd_got, mips_elf_multi_got, mips_elf_create_got_section):
- Update calls accordingly.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_got_info): Remove bfd2got.
- (mips_elf_bfd2got_hash): Delete.
- (mips_elf_got_per_bfd_arg): Remove bfd2got.
- (mips_elf_replace_bfd_got, mips_elf_count_got_entries): New functions.
- (mips_elf_global_got_index, mips_elf_create_local_got_entry): Use
- g->next to test for the multigot case. Use mips_elf_bfd_got rather
- than mips_elf_got_for_ibfd.
- (mips_elf_bfd2got_entry_hash, mips_elf_bfd2got_entry_eq)
- (mips_elf_got_for_ibfd, mips_elf_get_got_for_bfd): Delete.
- (mips_elf_make_got_per_bfd): Replace with...
- (mips_elf_add_got_entry): ...this new function.
- (mips_elf_make_got_pages_per_bfd): Replace with...
- (mips_elf_add_got_page_entry): ...this new function.
- (mips_elf_merge_got_with): Replace bfd2got argument with separate
- bfd and GOT arguments. Use mips_elf_add_got_entry and
- mips_elf_add_got_page_entry instead of mips_elf_make_got_per_bfd
- and mips_elf_make_got_pages_per_bfd. Use mips_elf_replace_bfd_got
- to set the BFD's GOT and free the old table.
- (mips_elf_merge_got): Replace bfd2got argument with separate
- bfd and GOT arguments. Apply mips_elf_resolve_final_got_entries.
- Use mips_elf_count_got_entries to count the number of entries in
- each GOT. Update the calls to mips_elf_merge_got_with.
- (mips_elf_adjust_gp): Use g->next to test for the multigot case.
- Use mips_elf_bfd_got rather than mips_elf_got_for_ibfd.
- (mips_elf_multi_got): Don't create the bfd2got hash table.
- Replace hash table traversal with a walk over the input bfds,
- updating the call to mips_elf_merge_got. Use mips_elf_replace_bfd_got
- to set the output bfd's GOT.
- (mips_elf_lay_out_got): Rename "sub" to "ibfd". Record that all
- bfds use the master GOT in the single-GOT case.
- (_bfd_mips_elf_finish_dynamic_sections): Use mips_elf_bfd_got
- rather than mips_elf_got_for_ibfd.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_elf_obj_tdata): Add a got field.
- (mips_elf_bfd_got, mips_elf_record_got_entry): New functions.
- (mips_elf_record_global_got_symbol): Update the hash entry before
- adding the mips_got_entry. Use mips_elf_record_got_entry to do
- the latter.
- (mips_elf_record_local_got_symbol): Use mips_elf_record_got_entry.
- (mips_elf_record_got_page_entry): Record the entry in both the
- master and bfd GOTs.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_elf_recreate_got): Don't change the entry;
- create another one if necessary.
- (mips_elf_set_gotidx): New function.
- (mips_elf_set_global_gotidx): Use it.
- (mips_elf_initialize_tls_index): Likewise. Take a
- mips_elf_traverse_got_arg as argument.
- (mips_elf_lay_out_got): Update use of mips_elf_initialize_tls_index.
- (mips_elf_multi_got): Likewise. Cope with error returns from
- mips_elf_set_global_gotidx.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_got_info): Add relocs field.
- (mips_elf_set_global_got_offset_arg, mips_elf_count_tls_arg): Replace
- with...
- (mips_elf_traverse_got_arg): ...this new structure.
- (mips_elf_count_local_tls_relocs): Delete.
- (mips_elf_count_global_tls_relocs): Likewise.
- (mips_elf_count_got_entry): New function.
- (mips_elf_count_local_got_entries): Likewise.
- (mips_elf_count_global_tls_entries): Take a mips_elf_traverse_got_arg
- rather than a mips_elf_count_tls_arg. Count both relocs and entries.
- (mips_elf_record_local_got_symbol): Don't count got entries here.
- (mips_elf_make_got_per_bfd): Use mips_elf_count_got_entry.
- (mips_elf_set_global_got_offset): Split into...
- (mips_elf_set_global_got_area, mips_elf_set_global_gotidx): ...these
- new functions. Take a mips_elf_traverse_got_arg rather than a
- mips_elf_set_global_got_offset_arg. Don't count TLS relocs here.
- Use g->relocs to record the number of relocs needed for global GOT
- entries.
- (mips_elf_multi_got): Use mips_elf_traverse_got_arg rather than
- mips_elf_set_global_got_offset_arg. Use the relocs field to count
- relocations. Update for above function split.
- (mips_elf_lay_out_got): Use mips_elf_count_local_got_entries
- to count both the number of GOT entries and the number of TLS
- relocs required by local entries. Likewise
- mips_elf_count_global_tls_entries and global entries.
- Remove uses of mips_elf_count_local_tls_relocs and
- mips_elf_count_global_tls_relocs.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_got_entry): Update comment above tls_type entry
- to say that each structure represents only one type of TLS reference.
- (GOT_TLS_TYPE): New define.
- (mips_elf_link_hash_entry): Temporarily split tls_type and
- tls_got_offset into two variables each.
- (mips_elf_link_hash_newfunc): Update accordingly.
- (mips_elf_got_entry_eq, mips_elf_got_entry_hash)
- (mips_elf_multi_got_entry_eq): Require the tls_type to be the same.
- (mips_elf_reloc_tls_type, mips_tls_got_entries): New functions.
- (mips_tls_got_relocs): Use a switch statement.
- (mips_elf_count_global_tls_entries): Handle the new hash entry fields.
- (mips_elf_initialize_tls_slots): Use a switch statement. Avoid
- local "offset" variable.
- (mips_tls_got_index): Remove r_type argument and assert. Remove
- code that handled entries with two TLS types; always use the
- original got_index instead.
- (mips_tls_single_got_index): New function.
- (mips_elf_local_got_index): Use entry->tls_type to check for
- TLS entries. Use mips_tls_single_got_index. Update call to
- mips_tls_got_index.
- (mips_elf_global_got_index): Use mips_elf_reloc_tls_type.
- Use p->tls_type to check for TLS entries. Update call to
- mips_tls_got_index. Use mips_tls_single_got_index.
- (mips_elf_create_local_got_entry): Use mips_elf_reloc_tls_type.
- Use entry.tls_type to check for TLS entries.
- (mips_elf_record_global_got_symbol): Replace tls_flag argument
- with r_type argument. Use mips_elf_reloc_tls_type.
- Set up the new hash entry fields.
- (mips_elf_record_local_got_symbol): Replace tls_flag argument
- with r_type argument. Use mips_elf_reloc_tls_type and
- mips_tls_got_entries. Remove code that handled entries
- with multiple TLS types.
- (mips_elf_make_got_per_bfd): Use mips_tls_got_entries.
- (mips_elf_initialize_tls_index): Handle new hash entry fields.
- Use equality rather than masks when checking for specific TLS types.
- Use mips_tls_got_entries. Remove code that handled entries
- with multiple TLS types.
- (mips_elf_calculate_relocation): Use TLS_RELOC_P instead of
- testing the hash table entry.
- (_bfd_mips_elf_check_relocs): Update calls to
- mips_elf_record_global_got_symbol and mips_elf_record_local_got_symbol.
- (_bfd_mips_elf_finish_dynamic_symbol): Don't check h->type.
- (_bfd_mips_elf_copy_indirect_symbol): Handle new hash entry fields.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_elf_multi_got_entry_hash): Rename to...
- (mips_elf_got_entry_hash): ...this, deleting the old version.
- (mips_elf_create_got_info): Use mips_elf_got_entry_hash for
- both types of GOT.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_elf_create_got_info): New function.
- (mips_elf_get_got_for_bfd, mips_elf_multi_got): Use it.
- (mips_elf_create_got_section): Likewise.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_elf_record_local_got_symbol): Always set
- gotidx to -1.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_elf_multi_got): Simplify size calculation.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_got_info): Move global_gotsym to...
- (mips_elf_link_hash_table): ...here. Update rest of file accordingly.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_elf_count_global_tls_entries)
- (mips_elf_count_global_tls_relocs): Don't count indirect or
- warning symbols.
- (mips_elf_multi_got, mips_elf_lay_out_got): Assert that the right
- number of TLS entries were allocated.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_elf_sort_hash_table_f): Remove asserts.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_elf_merge_got_with): Only use arg->global_count
- if there are TLS relocations.
-
-2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- * elfxx-mips.c (mips_elf_recreate_got): Remove free.
- (mips_elf_resolve_final_got_entries): Remove bogus comment.
-
-2013-02-11 Alan Modra <amodra@gmail.com>
-
- * elfcode.h (elf_checksum_contents): Free contents.
- * elf-bfd.h (_bfd_elf_link_hash_table_free): Declare.
- * elflink.c (_bfd_elf_link_hash_table_free): New function.
- (elf_final_link_free): New function, extracted from..
- (bfd_elf_final_link): ..here. Always call
- _bfd_elf_write_section_eh_frame_hdr.
- * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Default to
- _bfd_elf_link_hash_table_free.
- * libbfd-in.h (_bfd_merge_sections_free): Declare.
- * libbfd.h: Regenerate.
- * merge.c (_bfd_merge_sections_free): New function.
- * elf-eh-frame.c (_bfd_elf_write_section_eh_frame_hdr): Free
- hdr_info->array.
- * elf-m10300.c (elf32_mn10300_link_hash_table_free): Call
- _bfd_elf_link_hash_table_free.
- * elf32-arm.c (elf32_arm_link_hash_table_free): Likewise.
- * elf32-avr.c (elf32_avr_link_hash_table_free): Likewise.
- * elf32-hppa.c (elf32_hppa_link_hash_table_free): Likewise.
- * elf32-i386.c (elf_i386_link_hash_table_free): Likewise.
- * elf32-m68hc1x.c (m68hc11_elf_hash_table_free): Likewise.
- * elf32-m68k.c (elf_m68k_link_hash_table_free): Likewise.
- * elf32-metag.c (elf_metag_link_hash_table_free): Likewise.
- * elf32-xgate.c (xgate_elf_bfd_link_hash_table_free): Likewise.
- * elf64-aarch64.c (elf64_aarch64_link_hash_table_free): Likewise.
- * elf64-ia64-vms.c (elf64_ia64_hash_table_free): Likewise.
- * elf64-ppc.c (ppc64_elf_link_hash_table_free): Likewise.
- * elf64-x86-64.c (elf_x86_64_link_hash_table_free): Likewise.
- * elfnn-ia64.c (elfNN_ia64_hash_table_free): Likewise.
- * elf32-cr16.c (elf32_cr16_link_hash_table_free): Delete.
- (bfd_elf32_bfd_link_hash_table_free): Don't define.
- * elf32-tic6x.c (elf32_tic6x_link_hash_table_free): Delete.
- (bfd_elf32_bfd_link_hash_table_free): Dont' define.
-
-2013-02-10 Alan Modra <amodra@gmail.com>
-
- * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_zmalloc.
- * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise.
- * m68klinux.c (linux_link_hash_table_create): Likewise.
- * sparclinux.c (linux_link_hash_table_create): Likewise.
- * sunos.c (sunos_link_hash_table_create): Likewise.
- * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise.
- * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise.
- * elf32-arm.c (elf32_arm_link_hash_table_create): Likewise.
- * elf32-avr.c (elf32_avr_link_hash_table_create): Likewise.
- * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
- * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
- * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise.
- * elf32-i386.c (elf_i386_link_hash_table_create): Likewise.
- * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
- * elf32-m32r.c (m32r_elf_link_hash_table_create): Likewise.
- * elf32-m68hc1x.c (m68hc11_elf_hash_table_create): Likewise.
- * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
- * elf32-metag.c (elf_metag_link_hash_table_create): Likewise.
- * elf32-nios2.c (nios2_elf32_link_hash_table_create): Likewise.
- * elf32-s390.c (elf_s390_link_hash_table_create): Likewise.
- * elf32-score.c (elf32_score_link_hash_table_create): Likewise.
- * elf32-spu.c (spu_elf_link_hash_table_create): Likewise.
- * elf32-tic6x.c (elf32_tic6x_link_hash_table_create): Likewise.
- * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
- * elf32-xgate.c (xgate_elf_bfd_link_hash_table_create): Likewise.
- * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Likewise.
- * elf64-aarch64.c (elf64_aarch64_link_hash_table_create): Likewise.
- * elf64-s390.c (elf_s390_link_hash_table_create): Likewise.
- * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise.
- * elf64-x86-64.c (elf_x86_64_link_hash_table_create): Likewise.
- * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
- * elflink.c (_bfd_elf_link_hash_table_create): Likewise.
- (_bfd_elf_link_hash_table_init): Assume zero fill table on entry.
-
-2013-02-10 Alan Modra <amodra@gmail.com>
-
- * i386linux.c (linux_link_hash_table_create): Allocate table
- with bfd_zmalloc, not bfd_alloc.
- * pdp11.c (link_hash_table_create): Allocate table with
- bfd_malloc, not bfd_alloc.
- * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create): Allocate table
- with bfd_zmalloc, not bfd_zalloc.
- (bfin_link_hash_table_create): Likewise.
- * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
- * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
-
-2013-02-10 Alan Modra <amodra@gmail.com>
-
- PR ld/15113
- * elf32-sh.c (sh_elf_link_hash_table_create): Use bfd_zmalloc.
-
-2013-02-08 Markos Chandras <markos.chandras@imgtec.com>
-
- * elf32-metag.c: Use bfd_get_linker_section to get SEC_LINKER_CREATED
- sections.
- (elf_metag_adjust_dynamic_symbol): Don't error on zero size dynbss
- symbol.
+2014-03-12 Nick Clifton <nickc@redhat.com>
-2013-02-08 Yufeng Zhang <yufeng.zhang@arm.com>
-
- * elf64-aarch64.c (elf64_aarch64_grok_prstatus): Change 'size' from
- 288 to 272.
-
-2013-02-08 Alan Modra <amodra@gmail.com>
-
- PR binutils/15106
- * elf-bfd.h (struct elf_obj_tdata): Add elf_find_function_cache.
- * elf.c (elf_find_function): Revert last change. Use new
- tdata field rather than static vars for cache.
-
-2013-02-07 H.J. Lu <hongjiu.lu@intel.com>
-
- PR ld/15107
- * elflink.c (elf_link_output_extsym): Set STB_GNU_UNIQUE only if
- symbol is defined in regular object.
-
-2013-02-07 Roberto Agostino Vitillo <ra.vitillo@gmail.com>
-
- PR binutils/15106
- * elf.c (elf_find_function): Don't cache if symbols change.
-
-2013-02-07 Alan Modra <amodra@gmail.com>
-
- PR binutils/14873
- * elf-attrs.c (_bfd_elf_copy_obj_attributes): Don't attempt to
- copy attributes from or to non-ELF.
-
-2013-02-06 H.J. Lu <hongjiu.lu@intel.com>
-
- * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't clear pc_count
- for non-zero TLS symbol.
- (elf_i386_relocate_section): Don't resolve size relocation against
- non-zero TLS symbol.
- * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Don't clear
- pc_count for non-zero TLS symbol.
- (elf_x86_64_relocate_section): Don't resolve size relocation
- against non-zero TLS symbol.
-
-2013-02-06 Sandra Loosemore <sandra@codesourcery.com>
- Andrew Jenner <andrew@codesourcery.com>
-
- Based on patches from Altera Corporation.
-
- * Makefile.am (ALL_MACHINES): Add cpu-nios2.lo.
- (ALL_MACHINES_CFILES): Add cpu-nios2.c.
- (BFD_BACKENDS): Add elf32-nios2.lo.
- (BFD32_BACKENDS_CFILES): Add elf32-nios2.c.
- * Makefile.in: Regenerated.
- * configure.in: Add entries for bfd_elf32_bignios2_vec and
- bfd_elf32_littlenios2_vec.
- * configure: Regenerated.
- * config.bfd: Add cases for nios2.
- * archures.c (enum bfd_architecture): Add bfd_arch_nios2.
- (bfd_mach_nios2): Define.
- (bfd_nios2_arch): Declare.
- (bfd_archures_list): Add bfd_nios2_arch.
- * targets.c (bfd_elf32_bignios2_vec): Declare.
- (bfd_elf32_littlenios2_vec): Declare.
- (_bfd_target_vector): Add entries for bfd_elf32_bignios2_vec and
- bfd_elf32_littlenios2_vec.
- * elf-bfd.h (enum elf_target_id): Add NIOS2_ELF_DATA.
- * reloc.c (enum bfd_reloc_code_real): Add Nios II relocations.
- * bfd-in2.h: Regenerated.
- * libbfd.h: Regenerated.
- * cpu-nios2.c: New file.
- * elf32-nios2.c: New file.
+ PR ld/16671
+ * elf32-arm.c (elf32_arm_add_symbol_hook): Check for ARM format
+ before testing for vxworks.
-2013-02-06 Alan Modra <amodra@gmail.com>
+2014-03-12 Alan Modra <amodra@gmail.com>
- * elf32-arm.c (elf32_arm_final_link_relocate): Only test for
- stubs in stub_bfd.
+ * Makefile.in: Regenerate.
-2013-02-06 Alan Modra <amodra@gmail.com>
+2014-03-12 Alan Modra <amodra@gmail.com>
- * Makefile.am (SOURCE_HFILES): Add `elf-linux-psinfo.h'.
- * Makefile.in: Regenerate.
+ PR 16690
+ * elf.c (copy_elf_program_header): Ignore first section lma if
+ non-alloc.
-2013-02-04 Sergio Durigan Junior <sergiodj@redhat.com>
- Pedro Alves <palves@redhat.com>
+2014-03-11 Alan Modra <amodra@gmail.com>
- * Makefile.in (SOURCE_HFILES): Add `elf-linux-psinfo.h'.
- * elf-bfd.h (elf_internal_linux_prpsinfo): New structure
- declaration.
- (elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64)
- (elfcore_write_ppc32_linux_prpsinfo32): New declarations.
- * elf-linux-psinfo.h: New file.
- * elf.c: Include elf-linux-psinfo.h.
- (elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64):
- New functions.
- * elf32-ppc.c: Include `elf-linux-psinfo.h'.
- (elf_external_ppc_linux_prpsinfo32): New structure declaration.
- (PPC_LINUX_PRPSINFO32_SWAP_FIELDS): New macro.
- (elfcore_write_ppc_linux_prpsinfo32): New function.
+ PR 16686
+ * coff-rs6000.c: Include stdint.h.
+ * coff64-rs6000.c: Likewise.
-2013-02-04 Tristan Gingold <gingold@adacore.com>
+2014-03-10 Tristan Gingold <gingold@adacore.com>
- * mach-o.c (bfd_mach_o_scan_start_address): Do not fail if no
- start address.
+ * ticoff.h: Removed.
-2013-02-04 Alan Modra <amodra@gmail.com>
+2014-03-08 Alan Modra <amodra@gmail.com>
- * Makefile.am (BFD64_BACKENDS): Remove elf-nacl.lo.
- (BFD64_BACKENDS_CFILES): Remove elf-nacl.c.
- * Makefile.in: Regenerate.
- * po/SRC-POTFILES.in: Regenerate.
+ * elf32-ppc.c (ppc_elf_howto_raw): Correct overflow check for
+ many relocations. Correct bitsize and rightshift too for a number
+ of VLE relocs. Describe R_PPC_VLE_SDA21 and R_PPC_VLE_SDA21_LO.
+ Correct dst_mask on R_PPC_VLE_SDA21_LO.
+ (ppc_elf_vle_split16): Tidy, delete unnecessary prototype.
+ (ppc_elf_relocate_section): Modify overflow test for 16-bit
+ fields in instructions to signed/unsigned according to whether
+ the field takes a signed or unsigned value. Tidy vle split16 code.
+ Correct R_PPC_VLE_SDA21 and R_PPC_VLE_SDA21_LO handling.
-2013-02-04 Alan Modra <amodra@gmail.com>
+2014-03-08 Alan Modra <amodra@gmail.com>
- * coff-tic54x.c (SWAP_OUT_RELOC_EXTRA): Delete.
- * coff-tic80.c (SWAP_OUT_RELOC_EXTRA): Delete.
+ * elf64-ppc.c (ppc64_elf_howto_raw): Use complain_overflow_signed
+ for R_PPC64_ADDR14, R_PPC64_ADDR14_BRTAKEN, R_PPC64_ADDR14_BRNTAKEN,
+ R_PPC64_SECTOFF, R_PPC64_ADDR16_DS, R_PPC64_SECTOFF_DS,
+ R_PPC64_REL16 entries. Use complain_overflow_dont for R_PPC64_TOC.
+ (ppc64_elf_relocate_section): Modify overflow test for 16-bit
+ fields in instructions to signed/unsigned according to whether
+ the field takes a signed or unsigned value.
-2013-02-01 Alan Modra <amodra@gmail.com>
+2014-03-07 Pedro Alves <palves@redhat.com>
- * elf64-ppc.c (dec_dynrel_count): Don't error when elf_gc_sweep_symbol
- clears def_regular.
+ PR gdb/16696
+ * rs6000-core.c (rs6000coff_core_p): Cast pointers to bfd_vma
+ through ptr_to_uint instead of through long.
-2013-01-31 Tristan Gingold <gingold@adacore.com>
+2014-03-06 Nick Clifton <nickc@redhat.com>
- * mach-o.c (bfd_mach_o_scan): Call bfd_mach_o_flatten_sections
- earlier. Fix status checking of bfd_mach_o_scan_start_address.
- (bfd_mach_o_scan_start_address): Handle LC_MAIN.
+ PR 16664
+ * elf-attrs.c (_bfd_elf_parse_attributes): Add checks for corrupt
+ attribute section names.
-2013-01-31 Alan Modra <amodra@gmail.com>
- David S. Miller <davem@davemloft.net>
+2014-03-05 Alan Modra <amodra@gmail.com>
- PR ld/15056
- * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Handle implicit
- references to __tls_get_addr.
- * elf32-tilpro.c (tilepro_elf_gc_mark_hook): Likewise. Correct
- vtinherit and vtentry reloc handling too.
- * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): As for tilepro.
+ Update copyright years.
-2013-01-31 Alan Modra <amodra@gmail.com>
+2014-03-05 Alan Modra <amodra@gmail.com>
- * elf64-ppc.c (ppc_stub_name): Trim off trailing "+0".
+ * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_ADDR64_LOCAL entry.
+ (ppc64_elf_reloc_type_lookup): Support R_PPC64_ADDR64_LOCAL.
+ (ppc64_elf_check_relocs): Likewise.
+ (ppc64_elf_relocate_section): Likewise.
+ * Add BFD_RELOC_PPC64_ADDR64_LOCAL.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
-2013-01-31 Alan Modra <amodra@gmail.com>
+2014-03-04 Heiher <r@hev.cc>
- * elf64-ppc.c (build_plt_stub): Correct plt stub branch to glink.
+ * elfxx-mips.c (mips_set_isa_flags): Use E_MIPS_ARCH_64R2 for
+ Loongson-3A.
+ (mips_mach_extensions): Make bfd_mach_mips_loongson_3a an
+ extension of bfd_mach_mipsisa64r2.
-2013-01-28 Alan Modra <amodra@gmail.com>
+2014-03-04 Nick Clifton <nickc@redhat.com>
- * elf64-ppc.c: Use %T to print symbols names and remove redundant
- "relocation" in error messages throughout file.
- (ppc64_elf_relocate_section): Remove sibling call error message,
- replace with "call lacks nop". Specially report errors for
- branches to function entry points via OPD lookup and branches
- to stubs. Remove NULL symbol handling now done by %T.
+ PR ld/16017
+ * elf32-arm.c (elf32_thumb2_plt0_entry): New array.
+ (elf32_thumb2_plt_entry): New array.
+ (elf32_arm_create_dynamic_sections): Set PLT entry sizes when
+ using thumb2 based PLT.
+ (elf32_arm_populate_plt_entry): Handle generating Thumb2 based PLT
+ entries.
+ (elf32_arm_final_link_relocate): Do not bias jumps to Thumb based
+ PLT entries.
+ (elf32_arm_finish_dynamic_sections): Handle creation of Thumb2
+ based PLT 0-entry.
+ (elf32_arm_output_plt_map_1): Handle creation of local symbols for
+ Thumb2 based PLT 0-entry.
+ (elf32_arm_output_arch_local_syms): Handle creation of local
+ symbols for Thumb2 based PLT entries.
-2013-01-28 Alan Modra <amodra@gmail.com>
+2014-02-28 Alan Modra <amodra@gmail.com>
- * archive.c (bfd_generic_archive_p): Return target and keep
- ardata on partial matches.
- * format.c (bfd_check_format_matches): Adjust for above
- change. Remove bfd_error_file_ambiguously_recognized dead
- code.
+ PR ld/16643
+ * elflink.c (elf_gc_sweep): Call gc_sweep_hook for exactly
+ the same conditions we called check_relocs.
-2013-01-26 Alan Modra <amodra@gmail.com>
+2014-02-27 Yuri Gribov <y.gribov@samsung.com>
- * bfd.c (struct bfd_preserve, bfd_preserve_save, bfd_preserve_restore,
- bfd_preserve_finish): Move to..
- * format.c: ..here, splitting out..
- (bfd_reinit): ..this. New function.
- (bfd_check_format_matches): Use bfd_preserve_save/restore to
- keep bfd state for a match.
- * elfcode.h (elf_object_p): Don't use bfd_preserve_save/restore.
- * elfcore.h (elf_core_file_p): Likewise.
- * mach-o.c (bfd_mach_o_header_p): Likewise.
- * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
- * xsym.c (bfd_sym_object_p): Likewise.
- * mmo.c (mmo_scan): Clear abfd->symcount.
- * opncls.c (_bfd_new_bfd): Use a smaller section hash table.
- * section.c (bfd_section_list_clear): Clear section_htab.count.
+ * bfd-in.h: Add export of bfd_elf32_arm_use_long_plt.
* bfd-in2.h: Regenerate.
+ * elf32-arm.c (elf32_arm_plt_entry_long): New array.
+ (elf32_arm_link_hash_table_create): Set plt_entry_size to 16 if
+ using long PLT entries.
+ (bfd_elf32_arm_use_long_plt): New function.
+ (elf32_arm_populate_plt_entry): Add support for long PLT entries.
+
+2014-02-27 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (ppc_elf_link_hash_table_create): Provide default
+ params for targets that don't use ppc32elf.em.
+
+2014-02-20 Chung-Lin Tang <cltang@codesourcery.com>
+
+ * elf32-nios2.c (nios2_elf32_relocate_section): Fix calculation
+ of GOTOFF relocations.
+
+2014-02-19 Igor Zamyatin <igor.zamyatin@intel.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf64-x86-64.c (elf_x86_64_bnd_plt0_entry): New.
+ (elf_x86_64_legacy_plt_entry): Likewise.
+ (elf_x86_64_bnd_plt_entry): Likewise.
+ (elf_x86_64_legacy_plt2_entry): Likewise.
+ (elf_x86_64_bnd_plt2_entry): Likewise.
+ (elf_x86_64_bnd_arch_bed): Likewise.
+ (elf_x86_64_link_hash_entry): Add has_bnd_reloc and plt_bnd.
+ (elf_x86_64_link_hash_table): Add plt_bnd.
+ (elf_x86_64_link_hash_newfunc): Initialize has_bnd_reloc and
+ plt_bnd.
+ (elf_x86_64_copy_indirect_symbol): Also copy has_bnd_reloc.
+ (elf_x86_64_check_relocs): Create the second PLT for Intel MPX
+ in 64-bit mode.
+ (elf_x86_64_allocate_dynrelocs): Handle the second PLT for IFUNC
+ symbols. Resolve call to the second PLT if it is created.
+ (elf_x86_64_size_dynamic_sections): Keep the second PLT section.
+ (elf_x86_64_relocate_section): Resolve PLT references to the
+ second PLT if it is created.
+ (elf_x86_64_finish_dynamic_symbol): Use BND PLT0 and fill the
+ second PLT entry for BND relocation.
+ (elf_x86_64_finish_dynamic_sections): Use MPX backend data if
+ the second PLT is created.
+ (elf_x86_64_get_synthetic_symtab): New.
+ (bfd_elf64_get_synthetic_symtab): Likewise. Undefine for NaCl.
+
+2014-02-19 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.h (struct ppc64_elf_params): Add save_restore_funcs.
+ * elf64-ppc.c (ppc64_elf_func_desc_adjust): Use it to control
+ provision of out-of-line register save/restore routines.
+
+2014-02-18 Jack Carter <jack.carter@imgtec.com>
+
+ * elfxx-mips.c(_bfd_mips_elf_modify_segment_map): Deleted hard coding of
+ PT_DYNAMIC segment flags.
+
+2014-02-17 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ PR binutils/16595
+ * simple.c (struct saved_offsets): New.
+ (simple_save_output_info): Use it for ptr.
+ (simple_restore_output_info): Use it for ptr. Check section_count.
+ (bfd_simple_get_relocated_section_contents): Use it for saved_offsets.
+
+2014-02-17 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.h (struct ppc64_elf_params): Define.
+ (ppc64_elf_init_stub_bfd, ppc64_elf_edit_opd, ppc64_elf_tls_setup,
+ ppc64_elf_setup_section_lists, ppc64_elf_size_stubs,
+ ppc64_elf_build_stubs): Update prototype.
+ * elf64-ppp.c (struct ppc_link_hash_table): Add params, delete other
+ fields now in params. Adjust code throughout file.
+ (ppc64_elf_init_stub_bfd): Delete "abfd" parameter, add "params".
+ Save params pointer in htab.
+ (ppc64_elf_edit_opd, ppc64_elf_tls_setup,
+ ppc64_elf_setup_section_lists, ppc64_elf_size_stubs,
+ ppc64_elf_build_stubs): Remove parameters now in "params".
+
+2014-02-17 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Move relocs on insns
+ patched for ppc476 workaround. Reapply branch taken/not taken
+ relocs.
+
+2014-02-12 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (ppc_elf_relax_section): Don't build long-branch
+ stubs for calls to __tls_get_addr that we know will later be
+ optimised away.
+
+2014-02-12 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (ppc_elf_relax_section): Enable ppc476 workaround
+ for ld -r, when code sections are sufficiently aligned.
+ * elf32-ppc.h (struct ppc_elf_params): Delete pagesize. Add
+ pagesize_p2.
+
+2014-02-12 Alan Modra <amodra@gmail.com>
+
+ PR gold/15530
+ * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
+ --export-dynamic and --dynamic-list marking of symbols.
+ * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Reorder
+ cheap tests first.
+
+2014-02-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gold/16530
+ * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Mark symbol in
+ executables if it matches dynamic_list.
+
+2014-02-10 Alan Modra <amodra@gmail.com>
+
+ * po/SRC-POTFILES.in: Regenerate.
+ * po/bfd.pot: Regenerate.
+
+2014-02-09 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (struct elf_backend_data): Add caches_rawsize.
+ * elfxx-target.h (elf_backend_caches_rawsize): Define.
+ (elfNN_bed): Init new field.
+ * elflink.c (elf_link_input_bfd): Handle caches_rawsize.
+ * elf32-ppc.c (shared_stub_entry): Zero addi offset.
+ (ppc_elf_relax_section): Don't reallocate section here, write
+ stubs, or write out relocs for ld -r here..
+ (ppc_elf_relocate_section): ..instead write stubs here, and use
+ existing code to write out relocs for ld -r. Fix offset
+ adjustment on reloc for little-endian.
+ (elf_backend_caches_rawsize): Define.
-2013-01-25 Michael Schewe <michael.schewe@gmx.net>
+2014-02-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
- * elf32-h8300.c (elf32_h8_relax_section): When checking for a
- second reloc, make sure that the reloc potentially exists first.
+ PR build/16550
+ * cache.c (bfd_cache_max_open): Cast RLIM_INFINITY to rlim_t.
-2013-01-24 Nick Clifton <nickc@redhat.com>
+2014-02-04 Jan Kratochvil <jan.kratochvil@redhat.com>
- * archures.c: Add bfd_mach_v850e3v5.
+ * coff-rs6000.c (xcoff_write_archive_contents_big): Free OFFSETS in
+ return paths. Three times.
+ * elf64-ppc.c (ppc64_elf_link_hash_table_create): Free HTAB in all
+ return paths.
+ (ppc64_elf_tls_optimize): Free TOC_REF in return path.
+ (ppc64_elf_edit_toc): Free USED in return path.
+
+2014-02-03 Sandra Loosemore <sandra@codesourcery.com>
+
+ * reloc.c (BFD_RELOC_NIOS2_GOT_LO, BFD_RELOC_NIOS2_GOT_HA): New.
+ (BFD_RELOC_NIOS2_CALL_LO, BFD_RELOC_NIOS2_CALL_HA): New.
+ * libbfd.h: Regenerated.
+ * bfd-in2.h: Regenerated.
+ * elf32-nios2.c (elf_nios2_howto_table_rel): Add new relocations.
+ (nios2_reloc_map): Likewise.
+ (GOT_USED, CALL_USED): Renamed from GOT16_USED and CALL16_USED.
+ Fixed all references.
+ (nios2_elf32_relocate_section): Add new relocations.
+ (nios2_elf32_check_relocs): Likewise.
+ (nios2_elf32_gc_sweep_hook): Likewise.
+
+2014-02-03 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (struct ppc_elf_link_hash_table): Add params.
+ Delete emit_stub_syms, no_tls_get_addr_opt. Update all uses.
+ (ppc_elf_link_params): New function.
+ (ppc_elf_create_glink): Align .glink to 64 bytes for ppc476
+ workaround.
+ (ppc_elf_select_plt_layout): Remove plt_style and emit_stub_syms
+ parameters. Use htab->params instead.
+ (ppc_elf_tls_setup): Remove no_tls_get_addr_opt parameter.
+ (ppc_elf_size_dynamic_sections): Align __glink_PLTresolve to
+ 64 bytes for ppc476 workaround.
+ (struct ppc_elf_relax_info): New.
+ (ppc_elf_relax_section): Exclude linker created sections and
+ those too small to hold one instruction. Don't add another
+ branch around trampolines on later relax passes. Don't
+ generate trampolines for undefined symbols when !relocatable,
+ nor for plugin symbols. Allocate space for ppc476 workaround
+ patch area. Free fixups on error return path.
+ (ppc_elf_relocate_section): Handle ppc476 workaround patching.
+ * elf32-ppc.h (struct ppc_elf_params): New.
+ (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Update prototype.
+ (ppc_elf_link_params): Declare.
+ * section.c (SEC_INFO_TYPE_TARGET): Define.
* bfd-in2.h: Regenerate.
- * cpu-v850.c: Add entries for v850e2v5 and v850e3v5.
- * cpu-v850_rh850.c: Likewise.
- * elf32-v850.c: Add support for v850e3v5 architecture.
-2013-01-23 Markos Chandras <markos.chandras@imgtec.com>
+2014-02-02 Sandra Loosemore <sandra@codesourcery.com>
+
+ * elf32-nios2.c (struct elf32_nios2_link_hash_table): Add
+ h_gp_got field.
+ (nios2_elf32_relocate_section): Use got_base to adjust
+ GOT-pointer-relative relocations relative to _gp_got.
+ (create_got_section): Create _gp_got symbol.
+ (nios2_elf32_finish_dynamic_symbol): Make _gp_got absolute.
+ (nios2_elf32_size_dynamic_sections): Set _gp_got offset.
+
+2014-01-30 Sandra Loosemore <sandra@codesourcery.com>
+
+ * bfd-in2.h: Update from reloc.c.
+ * elf32-nios2.c: Include elf32-nios2.h.
+ (elf_nios2_howto_table_rel): Add entry for R_NIOS2_CALL26_NOAT.
+ (nios2_reloc_map): Likewise.
+ (enum elf32_nios2_stub_type): Declare.
+ (struct elf32_nios2_stub_hash_entry): Declare.
+ (nios2_stub_hash_entry, nios2_stub_hash_lookup): New macros.
+ (struct elf32_nios2_link_hash_entry): Add hsh_cache field.
+ (struct elf32_nios2_link_hash_table): Add new fields bstab,
+ stub_bfd, add_stub_section, layout_sections_again, stub_group,
+ bfd_count, top_index, input_list, all_local_syms.
+ (nios2_call26_stub_entry): New.
+ (nios2_elf32_install_imm16): Move up in file.
+ (nios2_elf32_install_data): Move up in file.
+ (hiadj): Move up in file.
+ (stub_hash_newfunc): New.
+ (link_hash_newfunc): Initialize hsh_cache field.
+ (STUB_SUFFIX): New.
+ (nios2_stub_name): New.
+ (nios2_get_stub_entry): New.
+ (nios2_add_stub): New.
+ (nios2_elf32_setup_section_lists): New.
+ (nios2_elf32_next_input_section): New.
+ (CALL26_SEGMENT): New.
+ (MAX_STUB_SECTION_SIZE): New.
+ (group_sections): New.
+ (nios2_type_of_stub): New.
+ (nios2_build_one_stub): New.
+ (nios2_size_one_stub): New.
+ (get_local_syms): New.
+ (nios2_elf32_size_stubs): New.
+ (nios2_elf32_build_stubs): New.
+ (nios2_elf32_do_call26_relocate): Correct CALL26 overflow test.
+ (nios2_elf32_relocate_section): Handle R_NIOS2_CALL26_NOAT. Add
+ trampolines for R_NIOS2_CALL26 stubs.
+ (nios2_elf32_check_relocs): Handle R_NIOS2_CALL26_NOAT.
+ (nios2_elf32_gc_sweep_hook): Likewise.
+ (nios2_elf32_link_hash_table_create): Initialize the stub hash table.
+ (nios2_elf32_link_hash_table_free): New.
+ (bfd_elf32_bfd_link_hash_table_free): Define.
+ * elf32-nios2.h: New file.
+ * libbfd.h: Update from reloc.c.
+ * reloc.c (BFD_RELOC_NIOS2_CALL26_NOAT): New.
+
+2014-01-29 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/16318
+ * elf32-metag.c (elf_metag_post_process_headers): Call
+ _bfd_elf_post_process_headers.
+ * elf32-sh64.c (sh64_elf_copy_private_data): Call
+ _bfd_elf_copy_private_data.
+ * elf64-sh64.c (sh_elf64_copy_private_data_internal): Likewise.
+
+2014-01-29 Nick Clifton <nickc@redhat.com>
+
+ * bfd-in.h (bfd_set_section_vma): Delete.
+ (bfd_set_section_alignment): Delete.
+ (bfd_set_section_userdata): Delete.
+ (bfd_set_cacheable): Delete.
+ * bfd.c (bfd_set_cacheable): New static inline function.
+ * section.c (bfd_set_section_userdata): Likewise.
+ (bfd_set_section_vma): Likewise.
+ (bfd_set_section_alignment): Likewise.
+ * bfd-in2.h: Regenerate.
- * elf32-metag.c: Error on HIADDR16/LOADDR16 in shared link.
+2014-01-28 Nick Clifton <nickc@redhat.com>
-2013-01-23 Leif Ekblad <leif@rdos.net>
+ * dwarf2.c (find_abstract_instance_name): For DW_FORM_ref_addr
+ attributes select the CU containing the abbreviation, which may not
+ be the current CU.
- * config.bfd (x86_64-*-rdos*): Remove targ_selvecs.
+2014-01-24 Alan Modra <amodra@gmail.com>
-2013-01-18 H.J. Lu <hongjiu.lu@intel.com>
+ * elf64-ppc.c (ppc_build_one_stub): Correct reloc count passed
+ to get_relocs for ELFv2.
- * elf32-i386.c (elf_i386_allocate_dynrelocs): Clear pc_count for
- non-zero TLS symbol.
- (elf_i386_relocate_section): Resolve size relocation against
- non-zero TLS symbol.
- * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Clear pc_count
- for non-zero TLS symbol.
- (elf_x86_64_relocate_section): Resolve size relocation against
- non-zero TLS symbol.
+2014-01-23 H.J. Lu <hongjiu.lu@intel.com>
-2013-01-18 Mike Frysinger <vapier@gentoo.org>
+ PR ld/16498
+ * elf.c (_bfd_elf_map_sections_to_segments): Issue a linker error
+ if TLS sections are not adjacent.
- * elflink.c (bfd_elf_size_dynamic_sections): Only add DT_RPATH
- when new_dtags is false. Only add DT_RUNPATH when new_dtags is
- true.
+2014-01-22 Alan Modra <amodra@gmail.com>
-2013-01-17 H.J. Lu <hongjiu.lu@intel.com>
+ * elflink.c (elf_link_add_object_symbols): Call minfo for --as-needed.
- * elf32-i386.c (elf_i386_check_relocs): Count size relocation as
- PC-relative relocation.
- * elf64-x86-64.c (elf_x86_64_check_relocs): Count size relocation
- as PC-relative relocation.
+2014-01-22 Alan Modra <amodra@gmail.com>
-2013-01-16 H.J. Lu <hongjiu.lu@intel.com>
+ * elf64-ppc.c (STK_LINKER): Comment typo fix.
- * elf32-i386.c (elf_i386_check_relocs): Update R_386_SIZE32
- check.
- (elf_i386_relocate_section): Don't check TLS for R_386_SIZE32.
+2014-01-21 H.J. Lu <hongjiu.lu@intel.com>
- * elf64-x86-64.c (elf_x86_64_check_relocs): Update R_X86_64_SIZE32
- and R_X86_64_SIZE64 check.
- (elf_x86_64_relocate_section): Don't check TLS for R_X86_64_SIZE32
- nor R_X86_64_SIZE64.
+ PR ld/16467
+ * elflink.c (_bfd_elf_merge_symbol): When types of the existing
+ regular default symbol definition and the versioned dynamic
+ symbol definition mismatch, skip the default symbol definition
+ if one of them is IFUNC.
-2013-01-16 H.J. Lu <hongjiu.lu@intel.com>
+2014-01-21 H.J. Lu <hongjiu.lu@intel.com>
- * bfd-in2.h: Regenerated.
- * libbfd.h: Likewise.
+ PR ld/2404
+ * elflink.c (_bfd_elf_merge_symbol): Don't check info->shared,
+ info->export_dynamic nor h->ref_dynamic for type mismatch when
+ adding the default version.
- * elf32-i386.c (elf_howto_table): Fill R_386_SIZE32 entry.
- (elf_i386_reloc_type_lookup): Support BFD_RELOC_SIZE32.
- (elf_i386_check_relocs): Handle R_386_SIZE32.
- (elf_i386_gc_sweep_hook): Likewise.
- (elf_i386_relocate_section): Likewise.
+2014-01-16 Alan Modra <amodra@gmail.com>
- * elf64-x86-64.c (x86_64_elf_howto_table): Fill R_X86_64_SIZE32
- and R_X86_64_SIZE64 entries.
- (x86_64_reloc_map): Add BFD_RELOC_SIZE32 and BFD_RELOC_SIZE64,
- (elf_x86_64_rtype_to_howto): Handle R_X86_64_SIZE32 for x32.
- (elf_x86_64_reloc_name_lookup): Likewise.
- (elf_x86_64_check_relocs): Handle R_X86_64_SIZE32 and
- R_X86_64_SIZE64.
- (elf_x86_64_gc_sweep_hook): Likewise.
- (elf_x86_64_relocate_section): Likewise.
+ * elfxx-mips.c (mips_elf_record_got_page_entry): Pass in a
+ mips_elf_traverse_got_arg* rather than mips_got_info*.
+ Adjust caller. Alloc on output_bfd rather than symbol section
+ owner.
- * reloc.c (bfd_reloc_code_type): Add BFD_RELOC_SIZE32 and
- BFD_RELOC_SIZE64.
+2014-01-15 H.J. Lu <hongjiu.lu@intel.com>
-2013-01-15 H.J. Lu <hongjiu.lu@intel.com>
+ * elf32-i386.c (elf_i386_allocate_dynrelocs): Revert the last
+ change.
+ * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
- * elf64-x86-64.c (R_X86_64_standard): Replace R_X86_64_IRELATIVE
- with R_X86_64_RELATIVE64.
+2014-01-14 H.J. Lu <hongjiu.lu@intel.com>
-2013-01-15 Nick Clifton <nickc@redhat.com>
+ PR ld/16428
+ * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't discard relocs
+ against __ehdr_start.
+ * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
- * elf32-msp430.c: Fix spelling typo.
+2014-01-14 H.J. Lu <hongjiu.lu@intel.com>
-2013-01-15 Alan Modra <amodra@gmail.com>
+ * elf32-i386.c (elf_i386_allocate_dynrelocs): Revert the last
+ change.
+ * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
- * elf64-ppc.c (ppc64_elf_size_stubs): Default shared libs to
- plt-thread-safe.
+2014-01-14 H.J. Lu <hongjiu.lu@intel.com>
-2013-01-14 Alan Modra <amodra@gmail.com>
+ PR ld/16428
+ * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't update reloc
+ count if there are any non pc-relative relocs.
+ * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
- PR binutils/14813
- * bfdio.c (struct bfd_iovec <bclose>): Revert 2012-11-06.
- (memory_bclose): Likewise. Return 0 on success.
- * cache.c (cache_bclose): Likewise.
- * opncls.c (opncls_bclose, bfd_close): Likewise.
- * vms-lib.c (vms_lib_bclose): Likewise.
- * libbfd.h: Regenerate.
+2014-01-14 Michael Hudson-Doyle <michael.hudson@linaro.org>
+ Kugan Vivekanandarajah <kugan.vivekanandarajah@linaro.org>
-2013-01-13 Alan Modra <amodra@gmail.com>
+ * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use correct
+ offset while calculating relocation address.
+ (elfNN_aarch64_create_small_pltn_entry): Likewise.
+ (elfNN_aarch64_init_small_plt0_entry): Likewise.
- * elf-bfd.h (struct elf_link_hash_entry): Delete dynamic_weak.
- Add ref_dynamic_nonweak.
- * elflink.c (_bfd_elf_mark_dynamic_def_weak): Delete.
- (_bfd_elf_merge_symbol): Don't call above function. Move
- setting of ref_dynamic_nonweak and dynamic_def earlier. Don't
- clear dynamic_def.
- (elf_link_add_object_symbols): Delete redundant "override" test.
- Don't set dynamic_def here.
- (elf_link_output_extsym): Update.
+2014-01-13 Ma Jiang <ma.jiang@zte.com.cn>
-2013-01-12 H.J. Lu <hongjiu.lu@intel.com>
+ PR ld/16202
+ * elf32-arm.c (elf32_arm_final_link_relocate): Refetch addends for
+ R_ARM_ABS8 and R_ARM_ABS16.
- * elf32-i386.c (elf_i386_check_relocs): Set bfd errror for
- normal and TLS symbol access.
- * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
+2014-01-13 Alan Modra <amodra@gmail.com>
-2013-01-12 Alan Modra <amodra@gmail.com>
+ * elf32-ppc.c (ppc_elf_check_relocs): For @local call to ifunc,
+ error when shared and force a plt call otherwise.
+ (ppc_elf_size_dynamic_sections): Don't emit DT_PPC_GOT unless
+ plt_type == PLT_NEW.
+ (ppc_elf_relocate_section): Add missing test to resolve ifuncs to
+ the appropriate call stub.
- * elf-bfd.h (_bfd_elf_strtab_refcount): Declare.
- * elf-strtab.c (_bfd_elf_strtab_refcount): New function.
- * elflink.c (elf_add_dt_needed_tag): Use _bfd_elf_strtab_refcount.
+2014-01-10 Alan Modra <amodra@gmail.com>
-2013-01-12 Alan Modra <amodra@gmail.com>
+ PR ld/14207
+ PR ld/16322
+ PR binutils/16323
+ * elf.c (assign_file_positions_for_load_sections): Revert last change.
+ (assign_file_positions_for_non_load_sections): When setting up
+ PT_GNU_RELRO header, don't require a corresponding PT_LOAD
+ header that completely covers the relro region.
- PR ld/12549
- * elf-bfd.h (_bfd_elf_strtab_clear_refs): Declare.
- (_bfd_elf_strtab_clear_all_refs): Define.
- * elf-strtab.c (_bfd_elf_strtab_clear_refs): New function.
- (_bfd_elf_strtab_clear_all_refs): Delete.
- * elflink.c (elf_link_add_object_symbols): Clear out added
- strtab refs. Correct handling of warning common symbols.
+2014-01-09 Tristan Gingold <gingold@adacore.com>
-2013-01-10 H.J. Lu <hongjiu.lu@intel.com>
+ * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): use jump
+ table macros and add macros to initializa the structure.
- * aout0.c: Remove trailing white spaces.
- * archive.c: Likewise.
- * archures.c: Likewise.
- * bfd-in.h: Likewise.
- * bfd-in2.h: Likewise.
- * coff-alpha.c: Likewise.
- * coff-i860.c: Likewise.
- * coff-mips.c: Likewise.
- * coff-ppc.c: Likewise.
- * coff-tic80.c: Likewise.
- * coff-x86_64.c: Likewise.
- * coff-z80.c: Likewise.
- * coffcode.h: Likewise.
- * coffgen.c: Likewise.
- * cofflink.c: Likewise.
- * compress.c: Likewise.
- * corefile.c: Likewise.
- * cpu-arm.c: Likewise.
- * cpu-avr.c: Likewise.
- * cpu-bfin.c: Likewise.
- * cpu-cr16.c: Likewise.
- * cpu-cr16c.c: Likewise.
- * cpu-crx.c: Likewise.
- * cpu-h8300.c: Likewise.
- * cpu-i386.c: Likewise.
- * cpu-lm32.c: Likewise.
- * cpu-m68k.c: Likewise.
- * cpu-moxie.c: Likewise.
- * cpu-msp430.c: Likewise.
- * cpu-sh.c: Likewise.
- * cpu-xc16x.c: Likewise.
- * dwarf2.c: Likewise.
- * ecofflink.c: Likewise.
- * ecoffswap.h: Likewise.
- * elf-ifunc.c: Likewise.
- * elf-m10300.c: Likewise.
- * elf-vxworks.c: Likewise.
- * elf32-avr.c: Likewise.
- * elf32-avr.h: Likewise.
- * elf32-cr16.c: Likewise.
- * elf32-cr16c.c: Likewise.
- * elf32-cris.c: Likewise.
- * elf32-crx.c: Likewise.
- * elf32-frv.c: Likewise.
- * elf32-hppa.c: Likewise.
- * elf32-i860.c: Likewise.
- * elf32-ip2k.c: Likewise.
- * elf32-iq2000.c: Likewise.
- * elf32-m32c.c: Likewise.
- * elf32-m68hc1x.c: Likewise.
- * elf32-msp430.c: Likewise.
- * elf32-mt.c: Likewise.
- * elf32-ppc.c: Likewise.
- * elf32-rl78.c: Likewise.
- * elf32-s390.c: Likewise.
- * elf32-score.h: Likewise.
- * elf32-sh-symbian.c: Likewise.
- * elf32-sh.c: Likewise.
- * elf32-spu.c: Likewise.
- * elf32-tic6x.c: Likewise.
- * elf32-v850.c: Likewise.
- * elf32-xc16x.c: Likewise.
- * elf32-xtensa.c: Likewise.
- * elf64-alpha.c: Likewise.
- * elf64-hppa.c: Likewise.
- * elf64-ppc.c: Likewise.
- * elf64-s390.c: Likewise.
- * elfcore.h: Likewise.
- * elflink.c: Likewise.
- * elfxx-mips.c: Likewise.
- * elfxx-sparc.c: Likewise.
- * elfxx-tilegx.c: Likewise.
- * ieee.c: Likewise.
- * libcoff.h: Likewise.
- * libpei.h: Likewise.
- * libxcoff.h: Likewise.
- * linker.c: Likewise.
- * mach-o-i386.c: Likewise.
- * mach-o-target.c: Likewise.
- * mach-o.c: Likewise.
- * mach-o.h: Likewise.
- * mmo.c: Likewise.
- * opncls.c: Likewise.
- * pdp11.c: Likewise.
- * pe-x86_64.c: Likewise.
- * peXXigen.c: Likewise.
- * pef-traceback.h: Likewise.
- * pei-x86_64.c: Likewise.
- * peicode.h: Likewise.
- * plugin.c: Likewise.
- * reloc.c: Likewise.
- * riscix.c: Likewise.
- * section.c: Likewise.
- * som.c: Likewise.
- * syms.c: Likewise.
- * tekhex.c: Likewise.
- * ticoff.h: Likewise.
- * vaxbsd.c: Likewise.
- * xcofflink.c: Likewise.
- * xtensa-isa.c: Likewise.
-
-2013-01-10 Will Newton <will.newton@imgtec.com>
-
- * Makefile.am: Add Meta.
- * Makefile.in: Regenerate.
- * archures.c (bfd_mach_metag): New.
- * bfd-in2.h: Regenerate.
- * config.bfd: Add Meta.
- * configure: Regenerate.
- * configure.in: Add Meta.
- * cpu-metag.c: New file.
- * elf-bfd.h: Add Meta.
- * elf32-metag.c: New file.
- * elf32-metag.h: New file.
- * libbfd.h: Regenerate.
- * reloc.c: Add Meta relocations.
- * targets.c: Add Meta.
-
-2013-01-08 Yufeng Zhang <yufeng.zhang@arm.com>
-
- * elf-bfd.h (elfcore_write_aarch_tls): Add prototype.
- (elfcore_write_aarch_hw_break): Likewise.
- (elfcore_write_aarch_hw_watch): Likewise.
- * elf.c (elfcore_grok_aarch_tls): New function.
- (elfcore_grok_aarch_hw_break): Likewise.
- (elfcore_grok_aarch_hw_watch): Likewise.
- (elfcore_grok_note): Call the new functions to handle the
- corresponding notes.
- (elfcore_write_aarch_tls): New function.
- (elfcore_write_aarch_hw_break): Likewise.
- (elfcore_write_aarch_hw_watch): Likewise.
- (elfcore_write_register_note): Call the new functions to handle the
- corresponding pseudo sections.
-
-2013-01-07 Tom Tromey <tromey@redhat.com>
-
- * section.c (_bfd_std_section): Rename from std_section.
- (bfd_com_section_ptr, bfd_und_section_ptr, bfd_abs_section_ptr)
- (STD_SECTION): Update.
- * bfd-in2.h: Rebuild.
-
-2013-01-04 Juergen Urban <JuergenUrban@gmx.de>
-
- * archures.c (bfd_mach_mips5900): Define.
- * bfd-in2.h: Regenerate.
- * config.bfd: Add mips64-ps2-elf and mips-ps2-elf targets.
- * cpu-mips.c: Add support for MIPS r5900.
- * elfxx-mips.c: Add support for MIPS r5900 (extension of r4000).
+2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
-2013-01-03 Nickolai Zeldovich <nickolai@csail.mit.edu>
- Nick Clifton <nickc@redhat.com>
+ PR ld/14207
+ PR ld/16322
+ PR binutils/16323
+ * elf.c (_bfd_elf_map_sections_to_segments): Don't check section
+ size for PT_GNU_RELRO segment.
+ (assign_file_positions_for_load_sections): If PT_LOAD segment
+ doesn't fit PT_GNU_RELRO segment, adjust its p_filesz and p_memsz.
- * elflink.c (get_value): Prevent the use of an undefined shift
- operation. Add sanity checks.
+2014-01-07 Tom Tromey <tromey@redhat.com>
-2013-01-02 Kaushik Phatak <kaushik.phatak@kpitcummins.com>
+ * elf32-xtensa.c (vsprint_msg): Don't use old VA_* compatibility
+ wrappers.
- * config.bfd (cr16*-*-uclinux*): New target support.
+2014-01-03 Nick Clifton <nickc@redhat.com>
+ PR binutils/16199
+ * elf.c (vma_page_aligned_bias): Handle a maxpagesize value of
+ zero.
-For older changes see ChangeLog-2012
+2014-01-02 Yuanhui Zhang <asmwarrior@gmail.com>
+
+ PR binutils/14289
+ * pef.c (bfd_pef_xlib_read_header): Increase buffer size to 80.
+
+2014-01-02 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/11983
+ * archive.c (_bfd_get_elt_at_filepos): Store a copy of the
+ filename in the bfd's filename field.
+ * elfcode.h (bfd_from_remote_memory): Likewise.
+ * ieee.c (ieee_object_p): Likewise.
+ * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
+ * oasys.c (oasys_openr_next_archived_file): Likewise.
+ * vms-lib.c (_bfd_vms_lib_get_module): Likewise.
+ * opncls.c (bfd_fopen): Likewise.
+ (bfd_openstreamr): Likewise.
+ (bfd_openr_iovec): Likewise.
+ (bfd_openw): Likewise.
+ (bfd_create): Likewise.
+ (_bfd_delete_bfd): Free filename.
+
+For older changes see ChangeLog-2013
-Copyright (C) 2013 Free Software Foundation, Inc.
+Copyright (C) 2014 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
diff --git a/binutils-2.25/bfd/ChangeLog-0203 b/binutils-2.25/bfd/ChangeLog-0203
index 20b0e306..dc987954 100644
--- a/binutils-2.25/bfd/ChangeLog-0203
+++ b/binutils-2.25/bfd/ChangeLog-0203
@@ -11397,7 +11397,7 @@
For older changes see ChangeLog-0001
-Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+Copyright (C) 2002-2003 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
diff --git a/binutils-2.25/bfd/ChangeLog-2013 b/binutils-2.25/bfd/ChangeLog-2013
new file mode 100644
index 00000000..01cdac4b
--- /dev/null
+++ b/binutils-2.25/bfd/ChangeLog-2013
@@ -0,0 +1,3239 @@
+2013-12-30 Ilya Tocar <ilya.tocar@intel.com>
+
+ * peXXigen.c (rsrc_process_section): Use ptrdiff_t as the type for
+ pointer arithmetic.
+
+2013-12-20 Alan Modra <amodra@gmail.com>
+
+ * elf-eh-frame.c (cie_eq): Return false when initial_insn_length
+ is too large.
+ (cie_compute_hash): Don't exceed bounds of initial_instructions.
+ (_bfd_elf_parse_eh_frame): Always set initial_insn_length, and
+ save as much of insns to initial_instructions[] as will fit.
+
+2013-12-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/16317
+ * elf.c (assign_section_numbers): Set the SHF_INFO_LINK bit for
+ SHT_REL/SHT_RELA sections when setting the sh_info field.
+
+2013-12-19 Pierre Muller <muller@sourceware.org>
+
+ * peXXigen.c (rsrc_cmp): Fix unused variable warning.
+
+2013-12-19 Pierre Muller <muller@sourceware.org>
+
+ * peXXigen.c (u16_mbtouc): Avoid unused function warning by excluding
+ if __CYGWIN__ or __MINGW32__ macro is defined.
+ (rsrc_cmp): Fix Windows host version and version without wchar header.
+ [__CYGWIN__, __MINGW32__]: Introduce rsrccmp macro.
+ Fix coding standard issues.
+
+2013-12-19 Andreas Schwab <schwab@suse.de>
+
+ * elf32-m68k.c (elf_m68k_add_symbol_hook): New function.
+ (elf_backend_add_symbol_hook): Define.
+
+2013-12-18 Nick Clifton <nickc@redhat.com>
+
+ * peXXigen.c (rsrc_print_section): Use ptrdiff_t as the type for
+ pointer arithmetic.
+
+2013-12-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-arm.c (elf32_arm_post_process_headers): Call
+ _bfd_elf_post_process_headers.
+
+2013-12-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-spu.c (spu_elf_post_process_headers): Call
+ _bfd_elf_post_process_headers.
+ * elfxx-mips.c (_bfd_mips_post_process_headers): Likewise.
+
+2013-12-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf-bfd.h (_bfd_elf_set_osabi): Renamed to ...
+ (_bfd_elf_post_process_headers): This.
+ * elf.c (_bfd_elf_compute_section_file_positions): Always
+ call elf_backend_post_process_headers.
+ (_bfd_elf_set_osabi): Renamed to ...
+ (_bfd_elf_post_process_headers): This.
+ * elf32-hppa.c (elf_backend_post_process_headers): Removed.
+ * elf32-i370.c (elf_backend_post_process_headers): Likewise.
+ * elf32-msp430.c (elf_backend_post_process_headers): Likewise.
+ * elf32-ppc.c (elf_backend_post_process_headers): Likewise.
+ * elf32-sparc.c (elf_backend_post_process_headers): Likewise.
+ * elf64-hppa.c (elf_backend_post_process_headers): Likewise.
+ * elf64-ppc.c (elf_backend_post_process_headers): Likewise.
+ * elf64-sparc.c (elf_backend_post_process_headers): Likewise.
+ * elf64-x86-64.c (elf_backend_post_process_headers): Likewise.
+ * (elf_backend_post_process_headers): Likewise.
+ * (elf_backend_post_process_headers): Likewise.
+ * elf32-i386.c (elf_backend_post_process_headers): Don't
+ define as _bfd_elf_set_osabi.
+ (elf_i386_fbsd_post_process_headers): Updated.
+ * elf32-mips.c (elf_fbsd_post_process_headers): Removed.
+ (elf_backend_post_process_headers): Likewise.
+ * elf32-tic6x.c (elf32_tic6x_set_osabi): Removed.
+ (elf_backend_post_process_headers): Likewise.
+ * elf64-mips.c (elf_fbsd_post_process_headers): Removed.
+ (elf_backend_post_process_headers): Likewise.
+ * elfn32-mips.c (elf_fbsd_post_process_headers): Removed.
+ (elf_backend_post_process_headers): Likewise.
+ * elfnn-aarch64.c (elfNN_aarch64_post_process_headers): Updated.
+ * elfxx-target.h (elf_backend_post_process_headers): Default
+ to _bfd_elf_post_process_headers.
+
+2013-12-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/16318
+ * elf32-arm.c (elf32_arm_copy_private_bfd_data): Call
+ _bfd_elf_copy_private_bfd_data.
+ * elf32-bfin.c (bfin_elf_copy_private_bfd_data): Removed.
+ (elf32_bfinfdpic_copy_private_bfd_data): Likewise.
+ (bfd_elf32_bfd_copy_private_bfd_data): Don't define.
+ * elf32-frv.c (frv_elf_copy_private_bfd_data): Removed.
+ (elf32_frvfdpic_copy_private_bfd_data): Likewise.
+ (bfd_elf32_bfd_copy_private_bfd_data): Don't define.
+ * elf32-iq2000.c (iq2000_elf_copy_private_bfd_data): Removed.
+ (bfd_elf32_bfd_copy_private_bfd_data): Don't define.
+ * elf32-lm32.c (lm32_elf_copy_private_bfd_data): Removed.
+ (lm32_elf_fdpic_copy_private_bfd_data): Call
+ _bfd_elf_copy_private_bfd_data.
+ * elf32-mep.c (mep_elf_copy_private_bfd_data): Removed.
+ (bfd_elf32_bfd_copy_private_bfd_data): Don't define.
+ * elf32-msp430.c (elf32_msp430_copy_private_bfd_data): Removed.
+ (bfd_elf32_bfd_copy_private_bfd_data): Don't define.
+ * elf32-mt.c (mt_elf_copy_private_bfd_data): Removed.
+ (bfd_elf32_bfd_copy_private_bfd_data): Don't define.
+ * elf32-sh.c (sh_elf_set_private_flags): Removed.
+ (sh_elf_copy_private_data): Call _bfd_elf_copy_private_bfd_data
+ and sh_elf_set_mach_from_flags.
+ * elfnn-aarch64.c (elfNN_aarch64_copy_private_bfd_data): Removed.
+ (bfd_elfNN_bfd_copy_private_bfd_data): Don't define.
+
+2013-12-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * peXXigen.c (rsrc_process_section): Rename index to indx.
+
+2013-12-17 Nick Clifton <nickc@redhat.com>
+
+ * peXXigen.c: Include wchar.h if available.
+ Include safe-ctype.h.
+ (HighBitSet, SetHighBit, WithoutHighBit): New macros.
+ (pe_print_resource_entries): Rename to
+ rsrc_print_resource_entries. Handle names that are not RVAs.
+ (pe_print_resource_directory): Rename to
+ rsrc_print_resource_directory.
+ (pe_print_rsrc): Rename to rsrc_print_section. Corrupt
+ computation of RVA bias.
+ (rsrc_count_entries): New function.
+ (rsrc_count_directory): New function.
+ (rsrc_parse_entry): New function.
+ (rsrc_parse_entries): New function.
+ (rsrc_parse_directory): New function.
+ (rsrc_write_string): New function.
+ (rsrc_compute_rva): New function.
+ (rsrc_write_leaf): New function.
+ (rsrc_write_entry): New function.
+ (rsrc_write_directory): New function.
+ (u16_mbtouc): New function.
+ (rsrc_cmp): New function.
+ (rsrc_print_name): New function.
+ (rsrc_resource_name): New function.
+ (rsrc_merge_string_entries): New function.
+ (rsrc_sort_entries): New function.
+ (rsrc_attach_chain): New function.
+ (rsrc_merge): New function.
+ (rsrc_process_section): New function - merges the contents of a
+ .rsrc section.
+ (_bfd_XXi_final_link_postscript): Call rsrc_process_section.
+ (rsrc_print_section): Fix mingw64 size issue.
+
+ * configure.in (AC_CHECK_HEADERS): Add wchar.h
+ * config.in: Regenerate.
+ * configure: Regenerate.
+
+2013-12-16 Andreas Schwab <schwab@suse.de>
+
+ * elf64-ppc.c (ppc64_elf_relocate_section): Add newline to error
+ message.
+
+2013-12-14 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (_bfd_elf_merge_symbol): If merging a new weak
+ symbol that will be skipped, we don't have a new definition.
+
+2013-12-13 Kuan-Lin Chen <kuanlinchentw@gmail.com>
+ Wei-Cheng Wang <cole945@gmail.com>
+
+ * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Add nds32
+ files.
+ * Makefile.in: Regenerate.
+ * archures.c (bfd_nds32_arch): Add nds32 target.
+ * bfd-in2.h: Regenerate.
+ * config.bfd (nds32*le-*-linux): Add bfd_elf32_nds32lelin_vec
+ and bfd_elf32_nds32belin_vec.
+ (nds32*be-*-linux*): Likewise.
+ (nds32*le-*-*): Add bfd_elf32_nds32le_vec and bfd_elf32_nds32be_vec.
+ (nds32*be-*-*): Likewise.
+ * configure.in (bfd_elf32_nds32be_vec): Add elf32-nds32.lo.
+ (bfd_elf32_nds32le_vec): Likewise.
+ (bfd_elf32_nds32belin_vec): Likewise.
+ (bfd_elf32_nds32lelin_vec): Likewise.
+ * configure: Regenerate.
+ * cpu-nds32.c: New file for nds32.
+ * elf-bfd.h: Add NDS32_ELF_DATA.
+ * elf32-nds32.c: New file for nds32.
+ * elf32-nds32.h: New file for nds32.
+ * libbfd.h: Regenerate.
+ * reloc.c: Add relocations for nds32.
+ * targets.c (bfd_elf32_nds32be_vec): New declaration for nds32.
+ (bfd_elf32_nds32le_vec): Likewise.
+ (bfd_elf32_nds32belin_vec): Likewise.
+ (bfd_elf32_nds32lelin_vec): Likewise.
+
+2013-12-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/16318
+ * elf.c (_bfd_elf_copy_private_bfd_data): Remove BFD_ASSERT.
+ Set e_flags only if elf_flags_init is FALSE. Copy EI_OSABI
+ field.
+
+2013-12-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-sh.c (bfd_elf32_bfd_set_private_bfd_flags): Removed.
+
+2013-12-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf.c (assign_file_positions_except_relocs): Set e_type in ELF
+ header to ET_EXEC for -pie -Ttext-segment=.
+
+2013-12-08 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (_bfd_elf_add_default_symbol): Set dynamic_def
+ and ref_dynamic_nonweak when chaining together indirect
+ symbols.
+
+2013-12-06 Tristan Gingold <gingold@adacore.com>
+
+ * pei-x86_64.c (pex64_xdata_print_uwd_codes): Add argument rf.
+ Display epilog opcode.
+ (pex64_dump_xdata): Add argument rf; make addr a local variable.
+ Adjust call to pex64_xdata_print_uwd_codes.
+ (pex64_bfd_print_pdata): Display code range, adjust call to
+
+2013-12-05 Tristan Gingold <gingold@adacore.com>
+
+ * mach-o.c (bfd_mach_o_mkobject_init): Use bfd_zalloc.
+
+2013-12-03 Nick Clifton <nickc@redhat.com>
+
+ * peXXigen.c (pe_print_resource_entries): New function: Displays
+ an entry in a .rsrc section.
+ (pe_print_resource_directory): New function: Displays a directory
+ in a .rsrc section.
+ (pe_print_rsrc): New function: Displays the contents of .rsrc
+ section.
+ (_bfd_XX_print_private_bfd_data_common): Call pe_print_rsrc.
+
+2013-12-03 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc_build_one_stub <ppc_stub_plt_branch_r2off>):
+ Don't omit saving of r2 for ELFv2. Don't addi 2,2,0.
+ (ppc_size_one_stub <ppc_stub_plt_branch_r2off>): Adjust to suit.
+
+2013-12-03 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_link_just_syms): Remove .got check.
+ Handle ELFv2.
+
+2013-11-26 Will Newton <will.newton@linaro.org>
+
+ * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol):
+ Handle STT_GNU_IFUNC symbols correctly in static links.
+
+2013-11-26 Will Newton <will.newton@linaro.org>
+
+ * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Ensure
+ PLT_INDEX is calculated using correct header size.
+
+2013-11-22 Cory Fields <cory@coryfields.com>
+
+ * libcoff-in.h: Add insert_timestamp flag to the pe_data struct.
+ * libcoff.h: Regenerate.
+ * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Only use a real
+ timestamp if --insert-timestamp was used.
+
+2013-11-19 Roland McGrath <mcgrathr@google.com>
+
+ * elf-nacl.c (nacl_modify_segment_map): Calculate SIZEOF_HEADERS
+ when not doing linking (i.e. INFO is a null pointer).
+
+2013-11-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf64-x86-64.c (elf_x86_64_section_from_shdr): Re-indent.
+
+2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf64-x86-64.c (x86_64_elf_howto_table): Add R_X86_64_PC32_BND
+ and R_X86_64_PLT32_BND.
+ (R_X86_64_standard): Replace R_X86_64_RELATIVE64 with
+ R_X86_64_PLT32_BND.
+ (IS_X86_64_PCREL_TYPE): Add R_X86_64_PLT32_BND.
+ (x86_64_reloc_map): Add BFD_RELOC_X86_64_PC32_BND and
+ BFD_RELOC_X86_64_PLT32_BND.
+ (elf_x86_64_check_relocs): Handle R_X86_64_PC32_BND and
+ R_X86_64_PLT32_BND.
+ (elf_x86_64_gc_sweep_hook): Likewise.
+ (elf_x86_64_relocate_section): Likewise.
+ * reloc.c (bfd_reloc_code_real): Add BFD_RELOC_X86_64_PC32_BND
+ and BFD_RELOC_X86_64_PLT32_BND.
+ * bfd-in2.h: Regenerated.
+ * libbfd.h: Likewise.
+
+2013-11-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_allocate_dynrelocs): Make room for
+ PLT0 directly.
+ * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
+
+2013-11-14 Nick Clifton <nickc@redhat.com>
+
+ PR ld/16017
+ * elf32-arm.c (elf32_arm_populate_plt_entry): Return a boolean
+ value, TRUE for success, FALSE for failure.
+ Fail if attempting to create a PLT entry for a thumb only target.
+ (elf32_arm_final_link_relocate): Check result of calling
+ elf32_arm_populate_plt_entry.
+ (elf32_arm_finish_dynamic_symbol): Likewise.
+
+2013-11-14 Guy Martin <gmsoft@tuxicoman.be>
+
+ PR ld/16082
+ * elf32-hppa.c (elf32_hppa_hide_symbol): Remove old version
+ information when forcing a symbol to be local.
+
+2013-11-13 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * elfnn-aarch64.c (elfNN_aarch64_howto_table): Use
+ R_AARCH64_TLS_DTPMOD64 instead of R_AARCH64_TLS_DTPMOD;
+ likewise for R_AARCH64_TLS_DTPREL and R_AARCH64_TLS_TPREL.
+
+2013-11-12 Matthew Leach <Matthew.Leach@arm.comm>
+
+ * elfxx-aarch64.c (_bfd_aarch64_elf_grok_prstatus): Fix hard-coded
+ size of struct elf_prstatus.
+
+2013-11-11 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (allocate_dynrelocs): Revert 2013-11-04 change.
+
+2013-11-11 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * elf64-ppc.c (ppc64_elf_edit_toc): Use SYMBOL_REFERENCES_LOCAL
+ here, not SYMBOL_CALLS_LOCAL.
+ (ppc64_elf_relocate_section): Likewise.
+ (size_global_entry_stubs): Set undefined symbols on their global
+ entry stubs here..
+ (build_global_entry_stubs): ..rather than here.
+ (ppc64_elf_build_stubs): Don't reset glink->size before calling
+ build_global_entry_stubs.
+
+2013-11-07 Roland McGrath <mcgrathr@google.com>
+
+ * archures.c (bfd_mach_i386_nacl): Fix definition so it doesn't
+ collide with bfd_mach_l1om.
+ * bfd-in2.h: Regenerate.
+
+ * elf32-i386.c (elf32_i386_nacl_elf_object_p): New function.
+ (elf_backend_object_p): Use that in elf32-i386-nacl definition.
+ * elf64-x86-64.c (elf64_x86_64_nacl_elf_object_p): New function.
+ (elf_backend_object_p): Use that in elf64-x86-64-nacl definition.
+ (elf32_x86_64_nacl_elf_object_p): New function.
+ (elf_backend_object_p): Use that in elf32-x86-64-nacl definition.
+
+2013-11-05 DJ Delorie <dj@redhat.com>
+
+ * elf32-rl78.c (elf32_rl78_relax_delete_bytes): Make sure relocs
+ are loaded before trying to use them.
+
+2013-11-05 H.J. Lu <hongjiu.lu@intel.com>
+ Bernhard Rosenkränzer <bernhard.rosenkranzer@linaro.org>
+
+ PR ld/4409
+ * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add an argument for
+ error ignored.
+ * elf-m10200.c (mn10200_elf_relocate_section): Updated.
+ * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
+ * elf32-arm.c (elf32_arm_relocate_section): Likewise.
+ * elf32-avr.c (elf32_avr_relocate_section): Likewise.
+ * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
+ (bfin_relocate_section): Likewise.
+ * elf32-cr16.c (elf32_cr16_relocate_section): Likewise.
+ * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
+ * elf32-cris.c (cris_elf_relocate_section): Likewise.
+ * elf32-crx.c (elf32_crx_relocate_section): Likewise.
+ * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
+ * elf32-epiphany.c (epiphany_elf_relocate_section): Likewise.
+ * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
+ * elf32-frv.c (elf32_frv_relocate_section): Likewise.
+ * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
+ * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
+ * elf32-i386.c (elf_i386_relocate_section): Likewise.
+ * elf32-i860.c (elf32_i860_relocate_section): Likewise.
+ * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
+ * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
+ * elf32-lm32.c (lm32_elf_relocate_section): Likewise.
+ * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-metag.c (elf_metag_relocate_section): Likewise.
+ * elf32-microblaze.c (microblaze_elf_relocate_section): Likewise.
+ * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
+ * elf32-mep.c (mep_elf_relocate_section): Likewise.
+ * elf32-moxie.c (moxie_elf_relocate_section): Likewise.
+ * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
+ * elf32-mt.c (mt_elf_relocate_section): Likewise.
+ * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
+ * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+ * elf32-rl78.c (rl78_elf_relocate_section): Likewise.
+ * elf32-rx.c (rx_elf_relocate_section): Likewise.
+ * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
+ * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
+ * elf32-s390.c (elf_s390_relocate_section): Likewise.
+ * elf32-v850.c (v850_elf_relocate_section): Likewise.
+ * elf32-vax.c (elf_vax_relocate_section): Likewise.
+ * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
+ * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
+ * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
+ * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+ * elf64-ia64-vms.c (elf64_ia64_relocate_section): Likewise.
+ * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
+ * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
+ * elf64-s390.c (elf_s390_relocate_section): Likewise.
+ * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
+ * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
+ * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
+ * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
+
+ * elfnn-ia64.c (elfNN_ia64_relocate_section): Skip if error
+ from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored.
+
+2013-11-05 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_func_desc_adjust): Make .TOC. defined and
+ hidden.
+ (ppc64_elf_set_toc): Adjust.
+
+2013-11-05 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (struct ppc_link_hash_table): Remove got, plt, relplt,
+ iplt, reliplt. Update all references to use elf.sgot, elf.splt,
+ elf.srelplt, elf.iplt and elf.irelplt.
+
+2013-11-03 Sandra Loosemore <sandra@codesourcery.com>
+
+ * elf32-niso2.c (nios2_elf32_do_hi16_relocate): Remove incorrect
+ ATTRIBUTE_UNUSED from parameter.
+ (nios2_elf_do_lo16_relocate): Likewise.
+ (nios2_elf32_do_hiadj16_relocate): Likewise.
+ (nios2_elf32_do_pcrel_lo16_relocate): Likewise.
+ (nios2_elf32_do_pcrel_hiadj16_relocate): Likewise.
+ (nios2_elf32_do_pcrel16_relocate): Likewise.
+ (nios2_elf32_do_call26_relocate): Likewise.
+ (nios2_elf32_do_gprel_relocate): Likewise.
+ (nios2_elf32_do_ujmp_relocate): Likewise.
+ (nios2_elf32_do_cjmp_relocate): Likewise.
+ (nios2_elf32_do_callr_relocate): Likewise.
+ (nios2_elf32_gc_mark_hook): Likewise.
+
+2013-11-04 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_relocate_section): Edit global entry
+ prologue to non-PIC in non-PIC executables.
+
+2013-11-04 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Copy
+ pointer_equality_needed flag.
+ (ppc64_elf_check_relocs): For ELFv2 arrange to emit plt
+ entries for references to functions in shared libraries on
+ non-call relocs.
+ (readonly_dynrelocs): Split into function of the same name and..
+ (maybe_set_textrel): ..this new function. Update call.
+ (ppc64_elf_adjust_dynamic_symbol): Don't emit dynrelocs for
+ ELFv2 in most cases if we have a plt entry. Use new
+ readonly_relocs.
+ (allocate_dynrelocs): For ELFv2, don't allocate dynreloc space
+ for ifunc in static executables.
+ (size_global_entry_stubs): New function.
+ (ppc64_elf_size_dynamic_sections): Call size_global_entry_stubs.
+ Save end of glink branch table.
+ (ppc64_elf_hash_symbol): New function.
+ (build_global_entry_stubs): New function.
+ (ppc64_elf_build_stubs): Call build_global_entry_stubs. Adjust
+ glink sizing.
+ (ppc64_elf_relocate_section): Tidy plt16/32/64 reloc code.
+ (ppc64_elf_finish_dynamic_symbol): For ELFv2, adjust symbols
+ defined on plt code.
+
+2013-11-02 Alan Modra <amodra@gmail.com>
+
+ * opncls.c (_bfd_new_bfd): Don't init vars already zeroed.
+
+2013-11-02 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_next_input_section): Always set toc_off
+ to value for object file.
+
+2013-11-01 Roland McGrath <mcgrathr@google.com>
+
+ * elf-nacl.c (segment_eligible_for_headers): Drop requirement that
+ some section have SEC_HAS_CONTENTS set. It's not set for
+ .note.gnu.build-id, and a segment of only read-only SHT_NOBITS
+ sections is implausible and not really supportable anyway.
+
+2013-10-30 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Use new DT_PPC_OPT
+ tag to specify tls optimisation.
+ * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Likewise.
+ (ppc64_elf_finish_dynamic_sections): Specify whether multiple
+ toc pointers are used via DT_PPC64_OPT.
+
+2013-10-30 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (STK_LR, STK_TOC, STK_LINKER): Define.
+ (savegpr0_tail, restgpr0_tail, savefpr0_tail, restfpr0_tail)
+ build_plt_stub, build_tls_get_addr_stub, ppc_build_one_stub,
+ ppc64_elf_relocate_section): Use new defines.
+
+2013-10-30 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (PLT_ENTRY_SIZE, PLT_INITIAL_ENTRY_SIZE): Add htab
+ parameter and adjust for ELFv2. Update all uses.
+ (PLT_CALL_STUB_SIZE): Delete.
+ (ppc64_elf_get_synthetic_symtab): Support new glink layout.
+ (allocate_dynrelocs): Likewise.
+ (plt_stub_size, build_plt_stub): Adjust for ELFv2.
+ (get_r2off): Return 0 for ELFv2 -R.
+ (ppc_build_one_stub, ppc_size_one_stub): Adjust for ELFv2.
+ (ppc64_elf_size_stubs): Likewise.
+ (ppc64_elf_build_stubs): Add new ELFv2 glink.
+
+2013-10-30 Alan Modra <amodra@gmail.com>
+ Ulrich Weigand <uweigand@de.ibm.com>
+
+ * elf64-ppc.c (struct ppc_stub_hash_entry): Add "other".
+ (stub_hash_newfunc): Init new ppc_stub_hash_entry field, and one
+ we forgot, "plt_ent".
+ (ppc64_elf_add_symbol_hook): Check ELFv1 objects don't have
+ st_other bits only valid in ELFv2.
+ (ppc64_elf_merge_symbol_attribute): New function.
+ (ppc_type_of_stub): Add local_off param to test branch range.
+ (ppc_build_one_stub): Adjust destinations for ELFv2 locals.
+ (ppc_size_one_stub, toc_adjusting_stub_needed): Similarly.
+ (ppc64_elf_size_stubs): Pass local_off to ppc_type_of_stub.
+ Set "other" field.
+ (ppc64_elf_relocate_section): Adjust destination for ELFv2 local
+ calls.
+
+2013-10-30 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (abiversion, set_abiversion): New functions.
+ (ppc64_elf_get_synthetic_symtab): Handle ELFv2 objects without .opd.
+ (struct ppc_link_hash_table): Add opd_abi.
+ (ppc64_elf_check_relocs): Check no .opd with ELFv2.
+ (ppc64_elf_merge_private_bfd_data): New function.
+ (ppc64_elf_print_private_bfd_data): New function.
+ (ppc64_elf_tls_setup): Set htab->opd_abi.
+ (ppc64_elf_size_dynamic_sections): Don't emit OPD related dynamic
+ tags for ELFv2.
+ (ppc_build_one_stub): Use R_PPC64_IRELATIVE for ELFv2 ifunc.
+ (ppc64_elf_finish_dynamic_symbol): Likewise
+
+2013-10-30 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (build_plt_stub): Switch stubs to use r11 as base
+ reg and r12 as destination.
+ (ppc_build_one_stub): Likewise.
+ (ppc64_elf_build_stubs): Likewise for glink.
+
+2013-10-30 Alan Modra <amodra@gmail.com>
+
+ * reloc.c (BFD_RELOC_PPC64_ADDR16_HIGH, BFD_RELOC_PPC64_ADDR16_HIGHA,
+ BFD_RELOC_PPC64_TPREL16_HIGH, BFD_RELOC_PPC64_TPREL16_HIGHA,
+ BFD_RELOC_PPC64_DTPREL16_HIGH, BFD_RELOC_PPC64_DTPREL16_HIGHA): New.
+ * elf64-ppc.c (ppc64_elf_howto_raw): Add entries for new relocs.
+ Make all _HA and _HI relocs report signed overflow.
+ (ppc64_elf_reloc_type_lookup): Handle new relocs.
+ (must_be_dyn_reloc, ppc64_elf_check_relocs): Likewise.
+ (dec_dynrel_count, ppc64_elf_relocate_section): Likewise.
+ (ppc64_elf_relocate_section): Don't apply 0x8000 adjust to
+ R_PPC64_TPREL16_HIGHER, R_PPC64_TPREL16_HIGHEST,
+ R_PPC64_DTPREL16_HIGHER, and R_PPC64_DTPREL16_HIGHEST.
+ * libbfd.h: Regenerate.
+ * bfd-in2.h: Regenerate.
+
+2013-10-29 Roland McGrath <mcgrathr@google.com>
+
+ * elf64-x86-64.c (elf_x86_64_nacl_plt0_entry): Correct 9-byte nop
+ sequence to match what the assembler generates.
+
+2013-10-29 Jan Beulich <jbeulich@suse.com>
+
+ * elflink.c (struct elf_outext_info): Add field file_sym_done.
+ (bfd_elf_final_link): Initialize new field. Move fake STT_FILE
+ symbol emission from here ...
+ (elf_link_output_extsym): ... to here.
+
+2013-10-24 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/15994
+ * dwarf2.c (lookup_address_in_line_info_table): Change return type
+ to be the range of addresses covered by the table.
+ (comp_unit_find_nearest_line): Likewise.
+ (find_line): Search all CUs. Select the one that matches and
+ covers the smallest address range.
+
+2013-10-18 Hans-Peter Nilsson <hp@axis.com>
+
+ * elf32-cris.c (cris_elf_check_relocs): Don't assume
+ a registered dynobj means that a .got has been created.
+
+2013-10-17 Alan Modra <amodra@gmail.com>
+
+ PR 16056
+ * elf.c (copy_elf_program_header): Only consider SEC_ALLOC sections
+ when finding lowest_section.
+
+2013-10-14 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
+
+ * elfxx-mips.c (mips_elf_obj_tdata): Add abi_msa_bfd.
+ (mips_elf_merge_obj_attributes): Set abi_msa_bfd to the first object
+ file that has a Tag_GNU_MIPS_ABI_MSA attribute.
+ Merge Tag_GNU_MIPS_ABI_MSA attributes.
+
+2013-10-14 Nick Clifton <nickc@redhat.com>
+
+ * gen-aout.c (main): Fix formatting. Close file.
+
+2013-10-13 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_use_local_got_p): New function.
+ (mips_elf_count_got_symbols, mips_elf_calculate_relocation): Use it.
+ (_bfd_mips_elf_check_relocs): Set pointer_equality_needed for
+ GOT and absolute references.
+
+2013-10-09 Roland McGrath <mcgrathr@google.com>
+
+ * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Cast switch
+ expression to int to silence over-eager compiler warnings.
+
+ * xcofflink.c (_bfd_xcoff_bfd_final_link): Don't touch EREL in
+ loop that doesn't use (or initialize) it.
+
+ * elfxx-tilegx.c (tilegx32_plt_tail_entry, tilegx32_plt_tail_entry):
+ Move second const qualifier so it applies to the pointer.
+
+2013-10-09 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/16022
+ * elf32-rx.c (rx_dump_symtab): Add missing break statements.
+
+2013-10-09 Tom Tromey <tromey@redhat.com>
+
+ * opncls.c (get_alt_debug_link_info_shim): Update type of 'len'.
+
+2013-10-09 Nick Clifton <nickc@redhat.com>
+
+ PR ld/16021
+ * elf32-rl78.c (rl78_dump_symtab): Delete.
+ (rl78_get_reloc): Delete.
+
+2013-10-09 Tom Tromey <tromey@redhat.com>
+
+ * bfd-in2.h: Rebuild.
+ * opncls.c (bfd_get_alt_debug_link_info): Change type of
+ buildid_len to bfd_size_type.
+
+2013-10-09 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ PR binutils/15993
+ * elf32-m32c.c (dump_symtab): Add missing "break;" statement on each
+ "case". Reindent "switch" statements.
+
+2013-10-08 Tom Tromey <tromey@redhat.com>
+
+ * bfd-in2.h: Rebuild.
+ * opncls.c (bfd_get_alt_debug_link_info): Add buildid_len
+ parameter. Change type of buildid_out. Update.
+ (get_alt_debug_link_info_shim): New function.
+ (bfd_follow_gnu_debuglink): Use it.
+
+2013-10-08 Andreas Schwab <schwab@suse.de>
+
+ * elf32-m68k.c (elf_m68k_size_dynamic_sections): Add DT_DEBUG also
+ for PIE executables.
+
+2013-10-04 Jan-Benedict Glaw <jbglaw@lug-owl.de>
+
+ * configure: Regenerate.
+
+2013-10-03 Will Newton <will.newton@linaro.org>
+
+ * configure: Regenerate.
+ * configure.in: Build elf-ifunc.o for AArch64.
+ * elfnn-aarch64.c: Include objalloc.h.
+ (elfNN_aarch64_local_htab_hash): New function.
+ (elfNN_aarch64_local_htab_eq): New function.
+ (elfNN_aarch64_get_local_sym_hash): New function.
+ (elfNN_aarch64_link_hash_table_create): Initialize local STT_GNU_IFUNC
+ symbol hash.
+ (elfNN_aarch64_hash_table_free): Free local STT_GNU_IFUNC symbol hash.
+ (elfNN_aarch64_final_link_relocate): Add sym argument. Add support
+ for handling STT_GNU_IFUNC symbols.
+ (elfNN_aarch64_gc_sweep_hook): Add support for garbage collecting
+ references to STT_GNU_IFUNC symbols.
+ (elfNN_aarch64_adjust_dynamic_symbol): Add support for handling
+ STT_GNU_IFUNC symbols.
+ (elfNN_aarch64_check_relocs): Add support for handling STT_GNU_IFUNC
+ symbols. Ensure we don't increase plt.refcount from -1 to 0.
+ (elfNN_aarch64_post_process_headers): Call _bfd_elf_set_osabi.
+ (elfNN_aarch64_is_function_type): Remove function.
+ (elfNN_aarch64_allocate_dynrelocs): Handle STT_GNU_IFUNC symbols.
+ (elfNN_aarch64_allocate_ifunc_dynrelocs): New function.
+ (elfNN_aarch64_allocate_local_dynrelocs): New function.
+ (elfNN_aarch64_allocate_local_ifunc_dynrelocs): New function.
+ (elfNN_aarch64_size_dynamic_sections): Call
+ elfNN_aarch64_allocate_local_dynrelocs.
+ (elfNN_aarch64_create_small_pltn_entry): Add info argument.
+ Add support for creating .iplt entries for STT_GNU_IFUNC symbols.
+ (elfNN_aarch64_finish_dynamic_symbol): Add support for handling
+ STT_GNU_IFUNC symbols and .iplt.
+ (elfNN_aarch64_finish_local_dynamic_symbol): New function.
+ (elfNN_aarch64_finish_dynamic_sections): Call
+ elfNN_aarch64_finish_local_dynamic_symbol.
+
+2013-09-30 Nick Clifton <nickc@redhat.com>
+
+ * cpu-msp430.c: Use printable names that match the values
+ displayed by readelf.
+
+2013-08-25 Andrew Pinski <apinski@cavium.com>
+
+ * elfnn-aarch64.c (TCB_SIZE): Base on the ARCH_SIZE rather than a
+ fixed size of 16.
+
+2013-09-24 Gregory Fong <gregory.0xf0@gmail.com>
+
+ * elfxx-mips.c (mips_elf_create_got_section): Hide
+ _GLOBAL_OFFSET_TABLE_.
+
+2013-09-24 Alan Modra <amodra@gmail.com>
+
+ * elf32-mips.c (ELF_OSABI): Undef for vxworks.
+
+2013-09-24 Alan Modra <amodra@gmail.com>
+
+ * syms.c (_bfd_stab_section_find_nearest_line): Ignore partial
+ stabs at end of .stab. Tidy variable usage. Don't drop the need
+ for a NULL function name stab if If N_FUN stab is ignored.
+ Ensure index entry count loop matches write loop.
+
+2013-09-20 Alan Modra <amodra@gmail.com>
+
+ * configure: Regenerate.
+
+2013-09-18 Tristan Gingold <gingold@adacore.com>
+
+ * configure.in: Bump version to 2.24.51
+ * configure: Regenerate.
+
+2013-09-17 Doug Gilmore <Doug.Gilmore@imgtec.com>
+
+ * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): Handle
+ EF_MIPS_FP64.
+
+2013-08-31 John David Anglin <dave.anglin@bell.net>
+
+ * elf64-hppa.c (elf_hppa_final_link_relocate): Add missing '%' to
+ format string.
+
+2013-08-29 Jakub Jelinek <jakub@redhat.com>
+
+ * elf64-x86-64.c (elf_x86_64_check_tls_transition): Allow
+ 64-bit -mcmodel=large -fpic TLS GD and LD sequences.
+ (elf_x86_64_relocate_section): Handle -mcmodel=large -fpic
+ TLS GD and LD sequences in GD->LE, GD->IE and LD->LE transitions.
+
+2013-08-27 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (struct elf_backend_data): Remove as_needed_cleanup.
+ Add notice_as_needed.
+ * elf64-ppc.c (elf_backend_as_needed_cleanup): Don't define.
+ (elf_backend_notice_as_needed): Define.
+ (ppc64_elf_as_needed_cleanup): Rename and adjust..
+ (ppc64_elf_notice_as_needed): ..to this.
+ * elflink.c (_bfd_elf_notice_as_needed): New function, extracted..
+ (elf_link_add_object_symbols): ..from here.
+ * elfxx-target.h (elf_backend_as_needed_cleanup): Don't define.
+ (elf_backend_notice_as_needed): Define..
+ (elfNN_bed): ..and use here.
+
+2013-08-26 Roland McGrath <mcgrathr@google.com>
+
+ * archures.c (bfd_mach_i386_nacl, bfd_mach_i386_i386_nacl): New macros.
+ (bfd_mach_x86_64_nacl, bfd_mach_x64_32_nacl): New macros.
+ * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): New function.
+ (bfd_i386_nacl_arch): New variable.
+ (bfd_x86_64_nacl_arch, bfd_x64_32_nacl_arch): New variables.
+ (bfd_x64_32_arch_intel_syntax): Link them into the list.
+ * bfd-in2.h: Regenerate.
+
+2013-08-26 Roland McGrath <mcgrathr@google.com>
+
+ * elf-nacl.c (nacl_modify_segment_map): Fix logic reordering the
+ elf_segment_map list. If an executable segment is page-aligned
+ but does not end with a full page, then append a fake section into
+ the segment map entry that pads out the page.
+ (nacl_final_write_processing): New function. Write the code fill
+ laid out in nacl_modify_segment_map.
+ * elf-nacl.h: Declare it.
+ * elf32-arm.c (elf32_arm_nacl_final_write_processing): New function.
+ (elf_backend_final_write_processing): Define it for NaCl backend.
+ * elf32-i386.c (elf_backend_final_write_processing): Likewise.
+ * elf64-x86-64.c (elf_backend_final_write_processing): Likewise.
+
+ * elf-nacl.c (segment_eligible_for_headers): Rename MAXPAGESIZE
+ parameter to MINPAGESIZE.
+ (nacl_modify_segment_map): Use minpagesize instead of maxpagesize.
+
+ * elf32-arm.c (ELF_MINPAGESIZE, ELF_COMMONPAGESIZE): #undef for NaCl.
+
+2013-08-24 Maciej W. Rozycki <macro@linux-mips.org>
+
+ * elf32-tilepro.c (tilepro_elf_finish_dynamic_sections): Don't
+ set GOT's entry size if there is no ELF section data.
+ * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
+ * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_sections):
+ Likewise.
+
+2013-08-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf64-x86-64.c (get_elf_x86_64_arch_data): New.
+ (get_elf_x86_64_backend_data): Use it.
+ (elf_x86_64_size_dynamic_sections): Likewise.
+
+2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
+
+ PR binutils/15834
+ * bfdio.c: Fix typos.
+ * elf32-spu.c: Likewise.
+ * elfnn-aarch64.c: Likewise.
+
+2013-08-21 Tristan Gingold <gingold@adacore.com>
+
+ * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Also count
+ .ovrflo sections.
+ * coffcode.h (coff_compute_section_file_positions): Force
+ match between file offset and vma offset.
+
+2013-08-21 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (_bfd_elf_merge_symbol): Set *poldbfd, *poldweak,
+ and *poldalignment before exiting when !relocs_compatible.
+
+2013-08-21 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (_bfd_elf_define_linkage_sym): Don't set STV_INTERNAL
+ symbols to STV_HIDDEN.
+
+2013-08-14 John Tytgat <john@bass-software.com>
+
+ PR ld/15787
+ * elf32-arm.c (elf32_arm_final_link_relocate): Use origin of output
+ segment containing the relocating symbol instead of assuming 0 for
+ sb group relocations.
+
+2013-08-09 Nick Clifton <nickc@redhat.com>
+
+ * elf32-rl78.c (rl78_elf_merge_private_bfd_data): Complain if G10
+ flag bits do not match.
+ (rl78_elf_print_private_bfd_data): Describe G10 flag.
+
+2013-08-05 John Tytgat <john@bass-software.com>
+
+ * po/BLD-POTFILES.in: Regenerate.
+ * po/SRC-POTFILES.in: Likewise.
+
+2013-07-31 John Tytgat <john@bass-software.com>
+
+ PR ld/15787
+ * elf32-arm.c (elf32_arm_final_link_relocate): Base SB on the
+ output section VMA.
+
+2013-07-28 Maciej W. Rozycki <macro@linux-mips.org>
+
+ * elf64-hppa.c (elf64_hppa_finish_dynamic_sections)
+ <DT_HP_LOAD_MAP>: Return unsuccessfully if there's no `.data'
+ section.
+
+2013-07-27 Andrew Pinski <apinski@cavium.com>
+
+ * elfnn-aarch64.c (elfNN_aarch64_check_relocs):
+ Use the correct alignment for
+ _bfd_elf_make_dynamic_reloc_section for ILP32.
+
+2013-07-27 Andrew Pinski <apinski@cavium.com>
+
+ * elfnn-aarch64.c (elfNN_aarch64_howto_from_bfd_reloc): Handle
+ BFD_RELOC_AARCH64_NONE explicitly.
+
+2013-07-27 Maciej W. Rozycki <macro@linux-mips.org>
+
+ * elf32-vax.c (elf_vax_finish_dynamic_sections): Don't set GOT's
+ entry size if there is no ELF section data.
+
+2013-07-27 Maciej W. Rozycki <macro@linux-mips.org>
+
+ * elf32-vax.c (elf_vax_check_relocs) <R_VAX_GOT32, R_VAX_PLT32>:
+ Don't check symbol visibility here. Remove a check already
+ asserted for.
+ (elf_vax_instantiate_got_entries): Use SYMBOL_REFERENCES_LOCAL
+ instead of individual checks.
+ (elf_vax_relocate_section) <R_VAX_GOT32, R_VAX_PLT32>: Only
+ check the offset to decide if produce a GOT or PLT entry.
+ Remove redundant assertions. Remove code to produce GOT entries
+ for local symbols. Remove a duplicate comment and add a comment
+ on GOT relocations.
+ (elf_vax_finish_dynamic_symbol): Remove code to produce RELATIVE
+ dynamic relocs.
+
+2013-07-27 Maciej W. Rozycki <macro@linux-mips.org>
+
+ * elf32-vax.c (elf_vax_always_size_sections): Correct a comment
+ typo.
+
+2013-07-27 Maciej W. Rozycki <macro@linux-mips.org>
+
+ * elf32-vax.c (elf_vax_discard_got_entries): New function.
+ (elf_vax_always_size_sections): Likewise.
+ (elf_vax_size_dynamic_sections): Remove code moved to
+ elf_vax_always_size_sections. Make comment on
+ elf_vax_instantiate_got_entries match reality.
+ (elf_vax_instantiate_got_entries): Assert that rather than check
+ if dynobj is null. Don't check for dynamic_sections_created.
+ Make function description match reality.
+ (elf_backend_always_size_sections): New macro.
+
+2013-07-25 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (struct ppc64_elf_obj_tdata): Replace opd_relocs
+ with a union.
+ (opd_entry_value): Cache .opd section contents.
+ (ppc64_elf_relocate_section): Adjust.
+
+2013-07-25 Alan Modra <amodra@gmail.com>
+
+ PR ld/15762
+ PR ld/12761
+ * elflink.c (elf_link_add_object_symbols): Correct test in
+ last patch. Remove unnecessary code.
+
+2013-07-24 Tristan Gingold <gingold@adacore.com>
+
+ * coff-rs6000.c (xcoff_howto_table): Fix masks and pc_relative for
+ R_RBR. Add numbers in comments.
+ (_bfd_xcoff_reloc_type_lookup): Handle BFD_RELOC_PPC_B16.
+ * coff64-rs6000.c: Likewise.
+
+2013-07-20 Alan Modra <amodra@gmail.com>
+
+ PR ld/15762
+ PR ld/12761
+ * elflink.c (elf_link_add_object_symbols): Don't clobber
+ .gnu.warning.symbol sections when shared.
+
+2013-07-19 Nick Clifton <nickc@redhat.com>
+
+ * elf32-rx.c (rx_elf_relocate_section): Fix typo: move
+ saw_subtract from R_RX_OPdiv to R_RX_OPneg.
+
+2013-07-18 Travis Snoozy <quandary@remstate.com>
+
+ PR ld/15721
+ * elf32-msp430.c (R_MSP430_10_PCREL): Use 10-bit source and
+ destination masks.
+ * R_MSP430_2X_PCREL: Likewise.
+ * R_MSP430X_10_PCREL: Likewise.
+ * R_MSP430X_2X_PCREL: Likewise.
+
+2013-07-18 Terry Guo <terry.guo@arm.com>
+
+ * elf32-arm.c (arm_type_of_stub): Don't use ST_BRANCH_TO_ARM for
+ thumb only targets.
+ (elf32_arm_final_link_relocate): Likewise.
+
+2013-07-18 Bill Neubauer <wcn@google.com>
+
+ * mach-o.c (mach_o_section_name_xlat dw): Add entry for
+ .debug_gdb_scripts
+
+2013-07-18 Roland McGrath <mcgrathr@google.com>
+
+ * elf32-arm.c (elf32_arm_stub_long_branch_arm_nacl): New variable.
+ (elf32_arm_stub_long_branch_arm_nacl_pic): New variable.
+ (arm_build_one_stub): Increase MAXRELOCS to 3.
+ (arm_type_of_stub): Use them if GLOBALS->nacl_p.
+ (struct elf32_arm_link_hash_table): Give add_stub_section member's
+ pointee type a third argument.
+ (elf32_arm_create_or_find_stub_sec): Update caller.
+ (elf32_arm_size_stubs): Update argument type.
+ * bfd-in.h (elf32_arm_size_stubs): Update decl.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+
+2013-07-15 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * elfxx-mips.c (mips_elf_merge_obj_attributes): Replace hardcoded
+ magic numbers with enum values.
+
+2013-07-12 Roland McGrath <mcgrathr@google.com>
+
+ * reloc.c: Add BFD_RELOC_390_PC12DBL, BFD_RELOC_390_PLT12DBL,
+ BFD_RELOC_390_PC24DBL, BFD_RELOC_390_PLT24DBL (should have
+ been added here with 2013-07-05 elf32-s390.c change).
+ * bfd-in2.h: Regenerate (no-op).
+ * libbfd.h: Regenerate (no-op).
+
+2013-07-12 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Handle
+ EF_MIPS_NAN2008.
+ (_bfd_mips_elf_print_private_bfd_data): Likewise.
+
+2013-07-09 Tristan Gingold <gingold@adacore.com>
+
+ * vms-alpha.c (struct vms_private_data_struct): Remove
+ flag_hash_long_names and flag_show_after_trunc.
+ (hash_string): Remove.
+ (_bfd_vms_length_hash_symbol): Remove.
+ (alpha_vms_write_exec): Remove call to _bfd_vms_length_hash_symbol.
+ (_bfd_vms_write_egsd): Likewise. Rewrite condition.
+ (_bfd_vms_write_ehdr): Remove code that set removed flags.
+ (_bfd_vms_write_etir): Remove call to _bfd_vms_length_hash_symbol.
+ (vms_bfd_is_local_label_name): Remove trace call.
+
+2013-07-09 Tristan Gingold <gingold@adacore.com>
+
+ * hosts/alphavms.h: Include config.h and ansidecl.h, remove useless
+ macros.
+ * configure.com: Adjust to match changes in configure.
+ * makefile.vms (OBJS): Update list.
+
+2013-07-05 Tristan Gingold <gingold@adacore.com>
+
+ * coffcode.h (coff_write_object_contents): Use ".ovrflo" name for
+ overflow sections.
+
+2013-07-05 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * elf32-s390.c: Add new relocation definitions R_390_PC12DBL,
+ R_390_PLT12DBL, R_390_PC24DBL, and R_390_PLT24DBL.
+ (elf_s390_reloc_type_lookup, elf_s390_check_relocs)
+ (elf_s390_gc_sweep_hook, elf_s390_relocate_section): Support new
+ relocations.
+ * elf64-s390.c: See elf32-s390.c
+ * bfd-in2.h: Add new relocs to enum bfd_reloc_code_real.
+ * libbfd.h: Add new reloc strings.
+
+2013-07-03 Marcus Shawcroft <marcus.shawcroft@arm.com>
+
+ * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Reorder case
+ values.
+ (elfNN_aarch64_relocate_section): Likewise.
+ (elfNN_aarch64_gc_sweep_hook): Likewise.
+ (elfNN_aarch64_check_relocs): Likewise.
+
+2013-07-03 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't hide .TOC.
+ when relocatable. Don't change root.type or type here.
+ (ppc64_elf_set_toc): Set type of .TOC. to STT_OBJECT.
+
+2013-07-03 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (struct ppc_stub_hash_entry): Delete "addend".
+ (ppc64_elf_size_stubs): Don't set "addend".
+ (ppc64_elf_relocate_section): Don't allow calls via
+ toc-adjusting stubs without a following nop even in an
+ executable, except for self-calls and both libc_start_main
+ and .libc_start_main.
+
+2013-07-03 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_func_desc_adjust): Hide ".TOC.".
+
+2013-07-02 Tristan Gingold <gingold@adacore.com>
+
+ * coff-rs6000.c (xcoff_find_nearest_line_discriminator): Add missing
+ line.
+
+2013-07-02 Tristan Gingold <gingold@adacore.com>
+
+ * vms-alpha.c (_bfd_generic_find_nearest_line_discriminator): Define.
+ (_bfd_vms_find_nearest_line_discriminator): New function.
+
+2013-07-02 Tristan Gingold <gingold@adacore.com>
+
+ * coff-rs6000.c (xcoff_create_csect_from_smclas): Handle more smclas.
+
+2013-07-02 Tristan Gingold <gingold@adacore.com>
+
+ * coff-rs6000.c (xcoff_find_nearest_line_discriminator): New function.
+ (rs6000coff_vec): Reference it.
+
+2013-07-02 Marcus Shawcroft <marcus.shawcroft@arm.com>
+
+ * elfnn-aarch64.c (aarch64_elf_create_got_section): New.
+ (elfNN_aarch64_check_relocs): Use aarch64_elf_create_got_section.
+ (elfNN_aarch64_create_dynamic_sections): Do not define
+ _GLOBAL_OFFSET_TABLE_; call aarch64_elf_create_got_section.
+
+2013-07-02 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_relocate_section): Set "relocation" for
+ .TOC. after relocatable check.
+
+2013-07-01 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.h (ppc64_elf_toc): Delete.
+ (ppc64_elf_set_toc): Declare.
+ * elf64-ppc.c (ppc64_elf_toc_reloc): Replace call to ppc64_elf_toc
+ with call the ppc64_elf_set_toc.
+ (ppc64_elf_toc_ha_reloc, ppc64_elf_toc64_reloc): Likewise.
+ (ppc64_elf_start_multitoc_partition): Likewise.
+ (struct ppc_link_hash_table): Delete dot_toc_dot. Replace all uses
+ with elf.hgot.
+ (ppc64_elf_process_dot_syms): Don't make a fake function descriptor
+ for ".TOC.".
+ (ppc64_elf_check_relocs): Mark sections with a reference to .TOC.
+ as needing a toc pointer.
+ (ppc64_elf_size_stubs): Don't set dot_toc_dot here.
+ (ppc64_elf_set_toc): Rename from ppc64_elf_toc. Add info param.
+ Set elf.hgot value.
+
+2013-06-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/15685
+ * elf64-x86-64.c (elf_x86_64_relocate_section): Handle
+ R_X86_64_DTPOFF64.
+
+2013-06-28 Nick Clifton <nickc@redhat.com>
+
+ PR ld/15302
+ * elf32-arm.c (allocate_dynrelocs_for_symbol): Revert previous patch.
+
+2013-06-27 Marcus Shawcroft <marcus.shawcroft@arm.com>
+
+ * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Reserve one slot
+ in sgot.
+ (elfNN_aarch64_finish_dynamic_sections): Place the &_DYNAMIC reference
+ in sgot[0] rather than sgotplt[0].
+
+2013-06-26 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * Makefile.am (elf32-aarch64.c): Add a #line cpp directive at the
+ beginning of the generated file.
+ (elf64-aarch64.c): Likewise.
+ * Makefile.in: Re-generated.
+
+2013-06-26 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * Makefile.am (BFD64_BACKENDS): Add elfxx-aarch64.c.
+ (BFD64_BACKENDS_CFILES): Add elfxx-aarch64.lo.
+ * Makefile.in: Re-generated.
+ * configure.in (bfd_elf64_bigaarch64_vec): Add elfxx-aarch64.lo.
+ (bfd_elf64_littleaarch64_vec): Likewise.
+ (bfd_elf32_bigaarch64_vec): Likewise.
+ (bfd_elf32_littleaarch64_vec): Likewise.
+ * configure: Re-generated.
+ * elfxx-aarch64.c: New file; split from elf64-aarch64.c.
+ * elfxx-aarch64.h: New file.
+ * elfnn-aarch64.c: Include "elfxx-aarch64.h"; move the following
+ stuff to elfxx-aarch64.c.
+ (bfd_elf_aarch64_put_addend): Removed.
+ (PG_OFFSET, PG): Likewise.
+ (elfNN_aarch64_small_plt0_entry): Support ELF32.
+ (elfNN_aarch64_tlsdesc_small_plt_entry): Likewise.
+ (elf64_aarch64_grok_prstatus): Removed.
+ (elf_backend_grok_prstatus): Removed.
+ (insn32): Likewise.
+ (aarch64_unsigned_overflow): Likewise.
+ (aarch64_signed_overflow): Likewise.
+ (aarch64_resolve_relocation): Likewise.
+ (MASK): Likewise.
+ (decode_branch_ofs_26): Likewise.
+ (decode_cond_branch_ofs_19): Likewise.
+ (decode_ld_lit_ofs_19): Likewise.
+ (decode_tst_branch_ofs_14): Likewise.
+ (decode_movw_imm): Likewise.
+ (decode_adr_imm): Likewise.
+ (decode_add_imm): Likewise.
+ (reencode_branch_ofs_26): Likewise.
+ (reencode_cond_branch_ofs_19): Likewise.
+ (reencode_ld_lit_ofs_19): Likewise.
+ (reencode_tst_branch_ofs_14): Likewise.
+ (reencode_movw_imm): Likewise.
+ (reencode_adr_imm): Likewise.
+ (reencode_ldst_pos_imm): Likewise.
+ (reencode_add_imm): Likewise.
+ (reencode_movzn_to_movz): Likewise.
+ (reencode_movzn_to_movn): Likewise.
+ (aarch64_relocate): Update to call the new function names in
+ elfxx-aarch64.c.
+ (aarch64_calculate_got_entry_vma): Likewise.
+ (elfNN_aarch64_final_link_relocate): Likewise.
+ (elf64_aarch64_update_plt_entry): Likewise; change the type of the
+ parameter 'r_type' to bfd_reloc_code_real_type; rename to ...
+ (elf_aarch64_update_plt_entry): ... this.
+ (elfNN_aarch64_create_small_pltn_entry): Update.
+ (elfNN_aarch64_init_small_plt0_entry): Remove plt_got_base; add
+ bfd_vma plt_got_2nd_ent; update to call elf_aarch64_update_plt_entry.
+ (elfNN_aarch64_finish_dynamic_sections): Add plt_entry; update to
+ call elf_aarch64_update_plt_entry.
+
+2013-06-26 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * bfd-in2.h: Re-generated.
+ * elfnn-aarch64.c (HOWTO64, HOWTO32): New define.
+ (IS_AARCH64_TLS_RELOC): Change to be based on the
+ bfd reloc enumerators.
+ (IS_AARCH64_TLSDESC_RELOC): Likewise.
+ (PG, PG_OFFSET): Cast literal to bfd_vma.
+ (elf64_aarch64_howto_table): Removed.
+ (elf64_aarch64_howto_dynrelocs): Removed.
+ (elf64_aarch64_tls_howto_table): Removed.
+ (elf64_aarch64_tlsdesc_howto_table): Removed.
+ (elfNN_aarch64_howto_table): New table to host all howto entires..
+ (R_AARCH64_*): Replaced by AARCH64_R (*) and AARCH64_R_STR (*).
+ (elfNN_aarch64_bfd_reloc_from_howto): New function.
+ (elfNN_aarch64_bfd_reloc_from_type): Ditto.
+ (struct elf_aarch64_reloc_map): New.
+ (elf_aarch64_reloc_map): New table.
+ (elfNN_aarch64_howto_from_bfd_reloc): New function.
+ (elfNN_aarch64_howto_from_type): Update to look up the new table
+ elfNN_aarch64_howto_table.
+ (struct elf64_aarch64_reloc_map): Remove.
+ (elf64_aarch64_reloc_map): Remove.
+ (elfNN_aarch64_reloc_type_lookup): Change to call
+ elfNN_aarch64_howto_from_bfd_reloc.
+ (elfNN_aarch64_reloc_name_lookup): Change to look up the new table
+ elfNN_aarch64_howto_table.
+ (aarch64_resolve_relocation): Refactor to switch on the bfd
+ reloc enumerators.
+ (bfd_elf_aarch64_put_addend): Likewise.
+ (elfNN_aarch64_final_link_relocate): Likewise.
+ (aarch64_tls_transition_without_check): Likewise.
+ (aarch64_reloc_got_type): Likewise.
+ (aarch64_can_relax_tls): Likewise.
+ (aarch64_tls_transition): Likewise.
+ (elfNN_aarch64_tls_relax): Likewise.
+ (elfNN_aarch64_final_link_relocate): Likewise.
+ (elfNN_aarch64_relocate_section): Likewise.
+ (elfNN_aarch64_gc_sweep_hook): Likewise.
+ (elfNN_aarch64_check_relocs): Likewise.
+ (aarch64_tls_transition): Change to return a bfd reloc enumerator.
+ * libbfd.h: Re-generated.
+ * reloc.c: Re-order the AArch64 bfd reloc enumerators.
+ (BFD_RELOC_AARCH64_RELOC_START)
+ (BFD_RELOC_AARCH64_RELOC_END)
+ (BFD_RELOC_AARCH64_LD_GOT_LO12_NC)
+ (BFD_RELOC_AARCH64_LD32_GOT_LO12_NC)
+ (BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC)
+ (BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC)
+ (BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC)
+ (BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC)
+ (BFD_RELOC_AARCH64_IRELATIVE): New relocs.
+
+2013-06-26 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * Makefile.am (BFD64_BACKENDS): Add elf32-aarch64.lo.
+ (BUILD_CFILES): Add elf32-aarch64.c.
+ (elf32-aarch64.c): New rule for generating from elfnn-aarch64.c.
+ * Makefile.in: Re-generated.
+ * archures.c (bfd_mach_aarch64_ilp32): New define.
+ * bfd-in.h (bfd_elf32_aarch64_init_maps): New declaration.
+ (bfd_elf32_aarch64_set_options): Ditto.
+ (elf32_aarch64_setup_section_lists): Ditto.
+ (elf32_aarch64_next_input_section): Ditto.
+ (elf32_aarch64_size_stubs): Ditto.
+ (elf32_aarch64_build_stubs): Ditto.
+ * bfd-in2.h: Re-generated.
+ * config.bfd (aarch64-*-elf): Add bfd_elf32_littleaarch64_vec
+ and bfd_elf32_bigaarch64_vec.
+ (aarch64-*-linux*): Likewise.
+ (aarch64_be-*-elf): Likewise.
+ (aarch64_be-*-linux*): Likewise.
+ * configure.in (bfd_elf32_bigaarch64_vec)
+ (bfd_elf32_littleaarch64_vec): New.
+ * configure: Re-generated.
+ * cpu-aarch64.c (compatible): Don't allow mixing ilp32 objects with
+ lp64 ones.
+ (bfd_aarch64_arch_ilp32): New.
+ (bfd_aarch64_arch): Link to bfd_aarch64_arch_ilp32.
+ * elfnn-aarch64.c (ARCH_SIZE): New define.
+ (AARCH64_R, AARCH64_R_STR, LOG_FILE_ALIGN): New defines.
+ (GOT_ENTRY_SIZE): Re-define as (ARCH_SIZE / 8).
+ (elf64_aarch64_*): Rename to elfNN_aarch64_*.
+ (ELF64_R_*): Rename to ELFNN_R_*.
+ Plus other paramaterization.
+ * targets.c (bfd_elf32_bigaarch64_vec, bfd_elf32_littleaarch64_vec):
+ New declarations.
+ (_bfd_target_vector): Add bfd_elf32_bigaarch64_vec and
+ bfd_elf32_littleaarch64_vec.
+
+2013-06-26 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * Makefile.am (BFD64_BACKENDS_CFILES): Remove elf64-aarch64.c.
+ (BUILD_CFILES): Add elf64-aarch64.c.
+ (elf64-aarch64.c): New rule for generating from elfnn-aarch64.c.
+ * Makefile.in: Re-generated.
+ * elf64-aarch64.c: Rename to ...
+ * elfnn-aarch64.c: ... this.
+
+2013-06-25 Maciej W. Rozycki <macro@codesourcery.com>
+ Paul Brook <paul@codesourcery.com>
+
+ * elfxx-mips.h (_bfd_mips_elf_insn32): New prototype.
+ * elfxx-mips.c (mips_elf_link_hash_table): Add insn32 member.
+ (STUB_MOVE32_MICROMIPS, STUB_JALR32_MICROMIPS): New macros.
+ (MICROMIPS_INSN32_FUNCTION_STUB_NORMAL_SIZE): Likewise.
+ (MICROMIPS_INSN32_FUNCTION_STUB_BIG_SIZE): Likewise.
+ (micromips_insn32_o32_exec_plt0_entry): New variable.
+ (micromips_insn32_o32_exec_plt_entry): Likewise.
+ (_bfd_mips_elf_adjust_dynamic_symbol): Handle insn32 mode.
+ (mips_elf_estimate_stub_size): Likewise.
+ (_bfd_mips_elf_size_dynamic_sections): Likewise.
+ (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
+ (mips_finish_exec_plt): Likewise.
+ (_bfd_mips_elf_relax_section): Likewise.
+ (_bfd_mips_elf_insn32): New function.
+ (_bfd_mips_elf_get_synthetic_symtab): Handle insn32 PLT.
+
+2013-06-24 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * elfxx-mips.h (_bfd_mips_elf_get_synthetic_symtab): New
+ prototype.
+ * elf32-mips.c (elf_backend_plt_sym_val): Remove macro.
+ (bfd_elf32_get_synthetic_symtab): New macro.
+ * elfxx-mips.c (plt_entry): New structure.
+ (mips_elf_link_hash_entry): Add use_plt_entry member.
+ (mips_elf_link_hash_table): Rename plt_entry_size member to
+ plt_mips_entry_size. Add plt_comp_entry_size, plt_mips_offset,
+ plt_comp_offset, plt_got_index entries and plt_header_is_comp
+ members.
+ (STUB_LW_MICROMIPS, STUB_MOVE_MICROMIPS): New macros.
+ (STUB_LUI_MICROMIPS, STUB_JALR_MICROMIPS): Likewise.
+ (STUB_ORI_MICROMIPS, STUB_LI16U_MICROMIPS): Likewise.
+ (STUB_LI16S_MICROMIPS): Likewise.
+ (MICROMIPS_FUNCTION_STUB_NORMAL_SIZE): Likewise.
+ (MICROMIPS_FUNCTION_STUB_BIG_SIZE): Likewise.
+ (micromips_o32_exec_plt0_entry): New variable.
+ (mips16_o32_exec_plt_entry): Likewise.
+ (micromips_o32_exec_plt_entry): Likewise.
+ (mips_elf_link_hash_newfunc): Initialize use_plt_entry.
+ (mips_elf_output_extsym): Update to use gotplt_union's plist
+ member rather than offset.
+ (mips_elf_gotplt_index): Likewise. Remove the VxWorks
+ restriction. Use MIPS_ELF_GOT_SIZE to calculate GOT address.
+ (mips_elf_count_got_symbols): Update to use gotplt_union's plist
+ member rather than offset.
+ (mips_elf_calculate_relocation): Handle MIPS16/microMIPS PLT
+ entries.
+ (_bfd_mips_elf_create_dynamic_sections): Don't set PLT sizes
+ here.
+ (mips_elf_make_plt_record): New function.
+ (_bfd_mips_elf_check_relocs): Update comment. Record occurences
+ of JAL relocations that might need a PLT entry.
+ (_bfd_mips_elf_adjust_dynamic_symbol): Update to use
+ gotplt_union's plist member rather than offset. Set individual
+ PLT entry sizes here. Handle MIPS16/microMIPS PLT entries.
+ Don't set the symbol's value in the symbol table for PLT
+ references here. Don't set the PLT or PLT GOT section sizes
+ here.
+ (mips_elf_estimate_stub_size): Handle microMIPS stubs.
+ (mips_elf_allocate_lazy_stub): Likewise.
+ (mips_elf_lay_out_lazy_stubs): Likewise. Define a _MIPS_STUBS_
+ magic symbol.
+ (mips_elf_set_plt_sym_value): New function.
+ (_bfd_mips_elf_size_dynamic_sections): Set PLT header size and
+ PLT and PLT GOT section sizes here. Set the symbol values in
+ the symbol table for PLT references here. Handle microMIPS
+ annotation of the _PROCEDURE_LINKAGE_TABLE_ magic symbol.
+ (_bfd_mips_elf_finish_dynamic_symbol): Update to use
+ gotplt_union's plist member rather than offset. Handle
+ MIPS16/microMIPS PLT entries. Handle microMIPS stubs.
+ (_bfd_mips_vxworks_finish_dynamic_symbol): Update to use
+ gotplt_union's plist member rather than offset. Use
+ MIPS_ELF_GOT_SIZE to calculate GOT address.
+ (mips_finish_exec_plt): Handle microMIPS PLT. Return status.
+ (_bfd_mips_elf_finish_dynamic_sections): Handle result from
+ mips_finish_exec_plt.
+ (_bfd_mips_elf_link_hash_table_create): Update to use
+ gotplt_union's plist member rather than offset.
+ (_bfd_mips_elf_get_synthetic_symtab): New function.
+
+2013-06-24 Wawa <caojinyu@msn.com>
+
+ PR 15657
+ * hash.c (_bfd_stringtab_add): Copy the string if COPY is true.
+
+2013-06-23 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Move MIPS ELF
+ files to...
+ (BFD64_BACKENDS, BFD64_BACKENDS_CFILES): ...here.
+ * Makefile.in: Regenerate.
+ * config.bfd: Enclose all MIPS ELF targets in #ifdef BFD64.
+ Set want64 to true for them at the end.
+ * targets.c (_bfd_target_vector): Protect MIPS ELF targets with
+ #ifdef BFD64.
+
+2013-06-22 Sandra Loosemore <sandra@codesourcery.com>
+
+ * elf32-nios2.c (nios2_elf32_finish_dynamic_sections): Don't
+ set sh_entsize for PLT section.
+
+2013-06-20 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * bfd-in.h (bfd_elf64_aarch64_set_options): Add 'extern'.
+ * bfd-in2.h: Re-generated.
+ * elf64-aarch64.c (RELOC_SECTION): Removed.
+ (SWAP_RELOC_IN, SWAP_RELOC_OUT): Ditto.
+ (AARCH64_ELF_OS_ABI_VERSION): Ditto.
+ (elf64_aarch64_link_hash_traverse): Ditto.
+ (elf64_aarch64_size_stubs): Change 'Aarch64' to 'AArch64' in the
+ comment.
+
+2013-06-19 Will Newton <will.newton@linaro.org>
+
+ * configure: Regenerated.
+ * configure.in: Remove aarch64 dependency on elf-ifunc.c.
+ * elf64-aarch64.c: Remove objalloc.h include.
+ (elf64_aarch64_howto_dynrelocs): Remove R_AARCH64_IRELATIVE howto.
+ (struct elf64_aarch64_link_hash_table): Remove ifunc related
+ members. (elf_aarch64_local_htab_hash): Remove function.
+ (elf_aarch64_local_htab_eq): Remove function.
+ (elf_aarch64_get_local_sym_hash): Remove function.
+ (elf64_aarch64_link_hash_table_create): Remove local hash
+ table initialization.
+ (elf64_aarch64_final_link_relocate): Remove sym argument and
+ handling of ifunc symbols.
+ (elf64_aarch64_relocate_section): Don't pass sym argument to
+ elf64_aarch64_final_link_relocate.
+ (elf64_aarch64_gc_sweep_hook): Remove handling of ifunc symbols.
+ (elf64_aarch64_adjust_dynamic_symbol): Likewise.
+ (elf64_aarch64_check_relocs): Likewise.
+ (elf64_aarch64_post_process_headers): Remove call to
+ _bfd_elf_set_osabi.
+ (elf64_aarch64_is_function_type): New function.
+ (elf64_aarch64_allocate_dynrelocs): Remove handling of ifunc
+ symbols. (elf_aarch64_allocate_local_dynrelocs): Remove function.
+ (elf64_aarch64_size_dynamic_sections): Remove call to
+ elf_aarch64_allocate_local_dynrelocs.
+ (elf64_aarch64_create_small_pltn_entry): Remove info argument.
+ Remove creation of R_AARCH64_IRELATIVE dynamic relocs.
+ (elf64_aarch64_finish_dynamic_symbol): Remove handling of ifunc
+ symbols. (elf_aarch64_finish_local_dynamic_symbol): Remove
+ function. (elf64_aarch64_finish_dynamic_sections): Remove call to
+ elf_aarch64_finish_local_dynamic_symbol.
+ (elf64_aarch64_add_symbol_hook): Remove function.
+
+2013-06-14 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * elf64-aarch64.c (elf64_aarch64_final_link_relocate): Call
+ aarch64_resolve_relocation and bfd_elf_aarch64_put_addend to
+ handle the relocations of R_AARCH64_JUMP26, R_AARCH64_CALL26,
+ R_AARCH64_LD64_GOT_LO12_NC, R_AARCH64_ADR_GOT_PAGE and
+ R_AARCH64_GOT_LD_PREL19.
+
+2013-06-13 Terry Guo <terry.guo@arm.com>
+
+ PR ld/15302
+ * elf32-arm.c (allocate_dynrelocs_for_symbol): Transform
+ ST_BRANCH_TO_ARM into ST_BRANCH_TO_THUMB if the target only
+ supports thumb instructions.
+
+2013-06-11 DJ Delorie <dj@redhat.com>
+
+ * elf32-rl78.c (rl78_elf_relocate_section): Fix OPsub math.
+
+2013-06-11 Will Newton <will.newton@linaro.org>
+
+ * elf64-aarch64.c (elf_aarch64_get_local_sym_hash): Use
+ ELF64_R_SYM instead of ELF32_R_SYM.
+
+2013-06-11 Nick Clifton <nickc@redhat.com>
+
+ * elf32-rl78.c (rl78_elf_finish_dynamic_sections): Onlly run
+ checks if the dynamic sections have been created and relaxation
+ has not been performed.
+
+2013-06-07 Will Newton <will.newton@linaro.org>
+
+ * configure: Regenerate.
+ * configure.in: Build elf-ifunc.o for AArch64.
+ * elf64-aarch64.c: Include objalloc.h.
+ (elf64_aarch64_howto_dynrelocs): Add R_AARCH64_IRELATIVE howto.
+ (struct elf64_aarch64_link_hash_table): Add members for handling
+ R_AARCH64_IRELATIVE relocations.
+ (elf_aarch64_local_htab_hash): New function.
+ (elf_aarch64_local_htab_eq): New function.
+ (elf_aarch64_get_local_sym_hash): New function.
+ (elf64_aarch64_link_hash_table_create): Initialize local STT_GNU_IFUNC
+ symbol hash.
+ (elf64_aarch64_hash_table_free): Free local STT_GNU_IFUNC symbol hash.
+ (elf64_aarch64_final_link_relocate): Add sym argument. Add support
+ for handling STT_GNU_IFUNC symbols.
+ (elf64_aarch64_gc_sweep_hook): Add support for garbage collecting
+ references to STT_GNU_IFUNC symbols.
+ (elf64_aarch64_adjust_dynamic_symbol): Add support for handling
+ STT_GNU_IFUNC symbols.
+ (elf64_aarch64_check_relocs): Add support for handling STT_GNU_IFUNC
+ symbols. Ensure we don't increase plt.refcount from -1 to 0.
+ (elf64_aarch64_post_process_headers): Call _bfd_elf_set_osabi.
+ (elf64_aarch64_is_function_type): Remove function.
+ (elf64_aarch64_allocate_dynrelocs): Call
+ _bfd_elf_allocate_ifunc_dyn_relocs for STT_GNU_IFUNC symbols.
+ (elf_aarch64_allocate_local_dynrelocs): New function.
+ (elf64_aarch64_size_dynamic_sections): Call
+ elf_aarch64_allocate_local_dynrelocs. Initialize next_irelative_index.
+ (elf64_aarch64_create_small_pltn_entry): Add info argument.
+ Add support for creating .iplt entries for STT_GNU_IFUNC symbols.
+ (elf64_aarch64_finish_dynamic_symbol): Add support for handling
+ STT_GNU_IFUNC symbols and .iplt.
+ (elf_aarch64_finish_local_dynamic_symbol): New function.
+ (elf64_aarch64_finish_dynamic_sections): Call
+ elf_aarch64_finish_local_dynamic_symbol.
+ (elf64_aarch64_add_symbol_hook): New function.
+
+2013-06-03 Alan Modra <amodra@gmail.com>
+
+ * syms.c (_bfd_stab_section_find_nearest_line): Add last_str
+ var. Use it with last_stab.
+
+2013-05-30 Paul Brook <paul@codesourcery.com>
+
+ * bfd-in2.h: Regenerate.
+ * elf32-mips.c (elf_mips_eh_howto): New.
+ (bfd_elf32_bfd_reloc_type_lookup ): Support BFD_RELOC_MIPS_EH.
+ (bfd_elf32_bfd_reloc_name_lookup): Likewise.
+ (mips_elf32_rtype_to_howto): Support R_MIPS_EH.
+ * elf64-mips.c (elf_mips_eh_howto): New.
+ (bfd_elf64_bfd_reloc_type_lookup): Support BFD_RELOC_MIPS_EH.
+ (bfd_elf64_bfd_reloc_name_lookup): Likewise.
+ (mips_elf64_rtype_to_howto): Support R_MIPS_EH.
+ * libbfd.h: Regenerate.
+ * reloc.c (BFD_RELOC_MIPS_EH): New.
+
+2013-05-29 Nick Clifton <nickc@redhat.com>
+
+ * dwarf2.c (struct dwarf2_debug): Add fields for handling
+ alternate debug info source.
+ (dwarf_debug_sections): Add entries for alternate .debug_str and
+ .debug_info sections.
+ (dwarf_debug_section_enum): Likewise.
+ (read_alt_indirect_string): New function. Handles a
+ DW_FORM_GNU_strp_alt attribute.
+ (read_alt_indirect_ref): New function. Handles a
+ DW_FORM_GNU_ref_alt attribute.
+ (read_attribute_value): Process DW_FORM_GNU_ref_alt and
+ DW_FORM_GNU_strp_alt.
+ (find_abstract_instance_name): Handle DW_FORM_GNU_ref_alt
+ attributes.
+ (_bfd_dwarf2_cleanup_debug_info): Free alternate debug info
+ sources.
+ * opncls.c (GNU_DEBUGALTLINK): Define.
+ (bfd_get_alt_debug_link_info): New function.
+ (separate_alt_debug_file_exists): New function.
+ (find_separate_debug_file): Add parameters for fetch and check
+ functions.
+ (bfd_follow_gnu_debugaltlink): New function.
+ * bfd-in2.h: Regenerate.
+
+2013-05-28 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * reloc.c (BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE): Rename to ...
+ (BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21): ... this.
+ (BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19): Rename to ...
+ (BFD_RELOC_AARCH64_TLSDESC_LD_PREL19): ... this.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+ * elf64-aarch64.c (IS_AARCH64_TLSDESC_RELOC): Update to use
+ the correct names.
+ (elf64_aarch64_tlsdesc_howto_table): Likewise.
+ (elf64_aarch64_reloc_map): Likewise.
+ (aarch64_resolve_relocation): Likewise.
+ (bfd_elf_aarch64_put_addend): Likewise.
+ (aarch64_tls_transition_without_check): Likewise.
+ (aarch64_reloc_got_type): Likewise.
+ (elf64_aarch64_final_link_relocate): Likewise.
+ (elf64_aarch64_tls_relax): Likewise.
+ (elf64_aarch64_relocate_section): Likewise.
+ (elf64_aarch64_gc_sweep_hook): Likewise.
+ (elf64_aarch64_check_relocs): Likewise.
+
+2013-05-26 Mark Wielaard <mjw@redhat.com>
+
+ * cache.c (BFD_CACHE_MAX_OPEN): Remove define.
+ (max_open_files): New static int initialized to zero.
+ (bfd_cache_max_open): New static function to set and return
+ max_open_files.
+ (bfd_cache_init): Use bfd_cache_max_open.
+ (bfd_open_file): Likewise.
+ * configure.in (AC_CHECK_HEADERS): Add sys/resource.h.
+ (AC_CHECK_FUNCS): Add getrlimit.
+ * configure: Regenerated.
+ * config.in: Likewise.
+ * sysdep.h: Check and include sys/resource.h for getrlimit.
+
+2013-05-23 Alan Modra <amodra@gmail.com>
+
+ * format.c (bfd_check_format_matches): Don't match a target in
+ targ_selvecs if some other target is a better match. If
+ targets implement match priority, fall back to the first of
+ the best matches.
+
+2013-05-22 Eric Herman <eric@freesa.org>
+
+ PR binutils/15462
+ * elfxx-mips.c (_bfd_mips_elf_relocate_section): Warning fix.
+
+2013-05-22 Ralf Dreesen <gamma@dreesen.net>
+
+ PR binutils/15474
+ * srec.c (srec_set_section_contents): Properly convert size
+ and offset to address when octets_per_byte is not unity.
+
+2013-05-20 Maciej W. Rozycki <macro@linux-mips.org>
+
+ * elf32-vax.c (elf_vax_instantiate_got_entries): Only set the
+ refcount member of the gotplt_union when resetting the reference
+ count. Adjust comment.
+
+2013-05-20 Will Newton <will.newton@linaro.org>
+
+ * elf64-aarch64.c (elf64_aarch64_link_hash_entry): Remove
+ relocs_copied member.
+ (elf64_aarch64_link_hash_newfunc): Remove initialization of
+ relocs_copied member.
+ (elf64_aarch64_copy_indirect_symbol): Remove code to copy
+ relocs_copied member.
+
+2013-05-19 Maciej W. Rozycki <macro@linux-mips.org>
+
+ * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Convert K&R
+ function definition.
+
+2013-05-16 Cary Coutant <ccoutant@google.com>
+
+ * ecoff.c (ecoff_link_check_archive_element): Add initializers for
+ external_ext_size and esize.
+
+2013-05-16 Tristan Gingold <gingold@adacore.com>
+
+ * coff-rs6000.c (_bfd_xcoff_reloc_type_lookup): Handle BFD_RELOC_16.
+ * coff64-rs6000.c (xcoff64_reloc_type_lookup): Likewise.
+
+2013-05-15 Andreas Schwab <schwab@suse.de>
+
+ * elf64-aarch64.c (elf_backend_default_execstack): Define to 0.
+
+2013-05-10 Joel Brobecker <brobecker@adacore.com>
+
+ * coffcode.h (styp_to_sec_flags) [RS6000COFF_C]: Add handling
+ of STYP_EXCEPT, STYP_LOADER and STYP_TYPCHK sections.
+
+2013-05-09 Joel Brobecker <brobecker@adacore.com>
+
+ * bfd.c (_bfd_default_error_handler): Replace use of putc
+ by fputc. Add comment explaining why.
+
+2013-05-09 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (elf_link_add_object_symbols): Don't omit reading
+ of symbols when hashes already exist.
+
+2013-05-07 Will Newton <will.newton@linaro.org>
+
+ * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Add a
+ plt_header_size argument for ports where it differs from
+ plt_entry_size.
+ * elf-bfd.h: Likewise.
+ * elf32-i386.c: Pass plt_header_size to
+ _bfd_elf_allocate_ifunc_dyn_relocs.
+ * elf64-x86-64.c: Likewise.
+
+2013-05-07 Will Newton <will.newton@linaro.org>
+
+ * elf-ifunc.c (_bfd_elf_create_ifunc_dyn_reloc): Remove unused
+ function.
+ * elf-bfd.h: Likewise.
+
+2013-05-06 Paul Brook <paul@codesourcery.com>
+
+ * elf64-mips.c (elf_mips_gnu_pcrel32): New.
+ (bfd_elf64_bfd_reloc_type_lookup, bfd_elf64_bfd_reloc_name_lookup,
+ mips_elf64_rtype_to_howto): Handle R_MIPS_PC32.
+ * elfn32-mips.c (elf_mips_gnu_pcrel32): New.
+ (bfd_elfn32_bfd_reloc_type_lookup, bfd_elfn32_bfd_reloc_name_lookup,
+ mips_elfn32_rtype_to_howto): Handle R_MIPS_PC32.
+
+2013-05-06 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (opd_entry_value): Handle case where symbol
+ hashes are not available.
+
+2013-05-06 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (elf_link_add_object_symbols): Don't save symbol
+ hashes around loading as-needed library. Zero them on allocation,
+ and restore to initial all-zero state if library not needed.
+ Arrange to reuse hashes if we load library again later.
+
+2013-05-04 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elf32-mips.c (elf_mips_copy_howto, elf_mips_jump_slot_howto):
+ Use _bfd_mips_elf_generic_reloc instead of bfd_elf_generic_reloc.
+ * elfn32-mips.c: Likewise.
+ * elf64-mips.c: Likewise.
+
+2013-05-02 Nick Clifton <nickc@redhat.com>
+
+ * archures.c: Add some more MSP430 machine numbers.
+ * config.bfd (msp430): Define targ_selvecs.
+ * configure.in: Add bfd_elf32_msp430_ti_vec.
+ * cpu-msp430.c: Add some more MSP430 machine numbers.
+ * elf32-msp430.c Add support for MSP430X relocations.
+ Add support for TI compiler generated relocations.
+ Add support for sym_diff relocations.
+ Add support for relaxing out of range short branches into long
+ branches.
+ Add support for MSP430 attribute section.
+ * reloc.c: Add MSP430X relocations.
+ * targets.c: Add bfd_elf32_msp430_ti_vec.
+ * bfd-in2.h: Regenerate.
+ * configure: Regenerate.
+ * libbfd.h: Regenerate.
+
+2013-05-01 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * config.bfd: Replace alpha*-*-linuxecoff* pattern with
+ alpha*-*-linux*ecoff*.
+
+2013-04-30 Olaf Flebbe <o.flebbe@science-computing.de>
+
+ PR binutils/15417
+ * elflink.c (elf_link_add_object_symbols): Initialise 'idx' to
+ zero.
+
+2013-04-30 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (bfd_elf_record_link_assignment): Dont make
+ STV_INTERNAL symbols STV_HIDDEN.
+
+2013-04-29 Nick Clifton <nickc@redhat.com>
+
+ * elflink.c (_bfd_elf_gc_mark_extra_sections): Remove mark from
+ fragmented .debug_line sections associated with unmarked code
+ sections.
+
+2013-04-29 Will Newton <will.newton@linaro.org>
+
+ * elf32-arm.c (elf32_arm_populate_plt_entry): Call
+ elf32_arm_add_dynreloc when emitting R_ARM_IRELATIVE relocs.
+
+2013-04-29 Will Newton <will.newton@linaro.org>
+
+ * elf64-aarch64.c (elf64_aarch64_check_relocs): Move relocation
+ error check up and add error message.
+
+2013-04-26 Will Newton <will.newton@linaro.org>
+
+ * elf64-aarch64.c (elf64_aarch64_check_relocs): Remove dead code.
+
+2013-04-25 Alan Modra <amodra@gmail.com>
+
+ * config.bfd: Add powerpc64le-linux.
+
+2013-04-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config.bfd (targ_selvecs): Add bfd_elf32_x86_64_vec for
+ x86_64-*-elf*.
+
+2013-04-24 Roland McGrath <mcgrathr@google.com>
+
+ * elf32-arm.c (elf32_arm_allocate_plt_entry): If HTAB->nacl_p,
+ allocate space for PLT header even if IS_IPLT_ENTRY.
+ (arm_nacl_put_plt0): New function, broken out of ...
+ (elf32_arm_finish_dynamic_sections): ... here. Call it.
+ If HTAB->nacl_p, set up the PLT header in .iplt too.
+ (elf32_arm_output_arch_local_syms): If HTAB->nacl_p, write
+ a mapping symbol for the start of .iplt too.
+
+2013-04-19 Luca Pizzamiglio <luca.pizzamiglio@gmail.com>
+
+ * ecoff.c (_bfd_ecoff_sizeof_headers): Cast the return value of
+ BFD_ALIGN to int.
+ * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Remove unused
+ variables.
+ * elf32-v850.c (v850_elf_relax_section): Redefine the type of 'i'
+ to bfd_vma.
+ * vms-alpha.c (evax_bfd_print_etir): Initialize sec_len.
+
+2013-04-22 Alan Modra <amodra@gmail.com>
+
+ PR ld/15382
+ * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Don't multiply
+ sh_size or reloc_count adjustment by count.
+
+2013-04-22 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_check_relocs): Don't call
+ create_linkage_sections here..
+ (ppc64_elf_init_stub_bfd): ..do so here. Return status.
+ (create_linkage_sections): Move earlier in file.
+ (ppc64_elf_setup_section_lists): Remove now useless htab->brlt test.
+ * elf64-ppc.h (ppc64_elf_init_stub_bfd): Update proto.
+
+2013-04-19 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/15356
+ * compress.c (decompress_contents): Always call inflateEnd, even
+ when another inflation operation fails.
+
+2013-04-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf-ifunc.c: Update copyright year.
+
+2013-04-17 Luca Pizzamiglio <luca.pizzamiglio@gmail.com>
+
+ * coffcode.h: Added a cast to void when a bfd_set_section_*()
+ macro's return value is ignored.
+ * elf32-hppa.c: Likewise.
+ * elf32-tic6x.c: Likewise.
+ * mach-o.c: Likewise.
+ * mmo.c: Likewise.
+ * opncls.c: Likewise.
+ * peicode.h: Likewise.
+ * elf32-m32r.c: Check return value of bfd_set_section_*().
+ * elfnn-ia64.c: Likewise.
+ * elfxx-mips.c: Likewise.
+ * vms-alpha.c: Likewise.
+
+2013-04-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/15371
+ * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Check
+ regular reference without non-GOT reference when building
+ shared library.
+
+2013-04-15 Alan Modra <amodra@gmail.com>
+
+ * archive.c (_bfd_archive_close_and_cleanup): Clear parent
+ cache slot for archives.
+
+2013-04-14 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * mmo.c (mmo_write_chunk): Break out abfd->tdata.mmo_data to new
+ local variable mmop.
+
+2013-04-09 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
+
+ PR ld/12494
+ * elf32-avr.c: Consider all sections to determine if linker
+ relaxation can safely delete a ret after a call/jmp
+
+2013-04-09 Mingjie Xing <mingjie.xing@gmail.com>
+
+ * bfd.c (typedef bfd, Error reporting, Miscellaneous): Add
+ INODEs.
+
+2013-04-08 Tom Tromey <tromey@redhat.com>
+
+ * som.c (bfd_section_from_som_symbol): No longer static.
+ * som.h (bfd_section_from_som_symbol): Declare.
+
+2013-04-06 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (ppc_elf_check_relocs): Use SYMBOLIC_BIND.
+ * elf64-ppc.c (ppc64_elf_check_relocs, dec_dynrel_count): Likewise.
+
+2013-04-05 Nick Clifton <nickc@redhat.com>
+
+ * elflink.c (elf_link_add_object_symbols): Revert accidental commit.
+
+2013-04-04 Alan Modra <amodra@gmail.com>
+
+ * bfd.c (bfd_error_type, bfd_errmsgs): Add bfd_error_missing_dso.
+ * bfd-in2.h: Regenerate.
+ * elflink.c (elf_link_add_object_symbols): Use new error.
+
+2013-04-03 Nick Clifton <nickc@redhat.com>
+
+ * elf32-v850.c (v850_elf_is_target_special_symbol): New function.
+ (bfd_elf32_bfd_is_target_special_symbol): Define.
+
+2013-04-03 Venkataramanan Kumar <venkataramanan.kumar@linaro.org>
+
+ * elf64-aarch64.c (elf64_aarch64_gc_sweep_hook): Use
+ elf64_aarch64_locals to get local GOT reference counts.
+
+2013-04-02 DJ Delorie <dj@redhat.com>
+
+ * elf32-rl78.c (GET_RELOC): Assert that there are relocs to get.
+ (rl78_elf_relax_section): Only fetch the next reloc if there is
+ one expected.
+
+2013-03-30 Alan Modra <amodra@gmail.com>
+
+ PR ld/15323
+ * elf-m10300.c (mn10300_elf_check_relocs): Set non_ir_ref for
+ global symbols referenced by relocs.
+ * elf32-arm.c (elf32_arm_check_relocs): Likewise.
+ * elf32-bfin.c (bfin_check_relocs): Likewise.
+ * elf32-cr16.c (cr16_elf_check_relocs): Likewise.
+ * elf32-cris.c (cris_elf_check_relocs): Likewise.
+ * elf32-d10v.c (elf32_d10v_check_relocs): Likewise.
+ * elf32-dlx.c (elf32_dlx_check_relocs): Likewise.
+ * elf32-fr30.c (fr30_elf_check_relocs): Likewise.
+ * elf32-frv.c (elf32_frv_check_relocs): Likewise.
+ * elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
+ * elf32-i370.c (i370_elf_check_relocs): Likewise.
+ * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise.
+ * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
+ * elf32-m32c.c (m32c_elf_check_relocs): Likewise.
+ * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
+ * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise.
+ * elf32-m68k.c (elf_m68k_check_relocs): Likewise.
+ * elf32-mcore.c (mcore_elf_check_relocs): Likewise.
+ * elf32-metag.c (elf_metag_check_relocs): Likewise.
+ * elf32-microblaze.c (microblaze_elf_check_relocs): Likewise.
+ * elf32-moxie.c (moxie_elf_check_relocs): Likewise.
+ * elf32-msp430.c (elf32_msp430_check_relocs): Likewise.
+ * elf32-mt.c (mt_elf_check_relocs): Likewise.
+ * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
+ * elf32-openrisc.c (openrisc_elf_check_relocs): Likewise.
+ * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
+ * elf32-rl78.c (rl78_elf_check_relocs): Likewise.
+ * elf32-s390.c (elf_s390_check_relocs): Likewise.
+ * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
+ * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
+ * elf32-sh.c (sh_elf_check_relocs): Likewise.
+ * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
+ * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
+ * elf32-v850.c (v850_elf_check_relocs): Likewise.
+ * elf32-vax.c (elf_vax_check_relocs): Likewise.
+ * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise.
+ * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
+ * elf64-aarch64.c (elf64_aarch64_check_relocs): Likewise.
+ * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
+ * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
+ * elf64-ia64-vms.c (elf64_ia64_check_relocs): Likewise.
+ * elf64-mmix.c (mmix_elf_check_relocs): Likewise.
+ * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
+ * elf64-s390.c (elf_s390_check_relocs): Likewise.
+ * elf64-sh64.c (sh_elf64_check_relocs): Likewise.
+ * elfnn-ia64.c (elfNN_ia64_check_relocs): Likewise.
+ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
+ * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
+ * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise. Don't
+ test indirect/warning links for NULL.
+
+2013-03-29 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/15323
+ * elf32-i386.c (elf_i386_check_relocs): Set non_ir_ref if a
+ symbol is referenced by a non-shared object.
+ * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
+
+2013-03-28 Joe Seymour <jseymour@codesourcery.com>
+
+ * elf32-sh.c (sh_elf_relocate_section): Suppress warnings for
+ R_SH_REL32 relocations against undefined weak symbols.
+
+2013-03-28 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (struct ppc_dyn_relocs): New.
+ (ppc64_elf_check_relocs): Separate dynrel counts for local syms
+ into ifunc and non-ifunc.
+ (dec_dynrel_count): Pass in sym rather than sym_sec. Handle
+ separate ifunc/non-ifunc dynrel counts.
+ (allocate_got): Always use reliplt for ifunc.
+ (allocate_dynrelocs): Likewise.
+ (ppc64_elf_size_dynamic_sections): Likewise.
+ (ppc64_elf_layout_multitoc): Likewise.
+ (ppc64_elf_relocate_section): Likewise.
+
+2013-03-28 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (struct ppc_dyn_relocs): New.
+ (ppc_elf_check_relocs): Separate dynrel counts for local syms
+ into ifunc and non-ifunc.
+ (allocate_dynrelocs): Always put ifunc relocs into reliplt.
+ (ppc_elf_size_dynamic_sections): Likewise.
+ (ppc_elf_relocate_section): Likewise.
+
+2013-03-28 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (enum elf_reloc_type_class): Add reloc_class_ifunc.
+ (struct elf_backend_data <elf_backed_reloc_type_class>): Add
+ bfd_link_info* and asection* params.
+ (_bfd_elf_reloc_type_class): Likewise.
+ * elf.c (_bfd_elf_reloc_type_class): Likewise.
+ * elflink.c (elf_link_sort_cmp2): Sort first on reloc class.
+ (elf_link_sort_relocs): Update elf_backed_reloc_type_class call.
+ * elf32-ppc.c (ppc_elf_reloc_type_class): Return reloc_class_ifunc
+ for any reliplt reloc. Don't return reloc_class_plt for
+ R_PPC_REL24 and R_PPC_ADDR24.
+ * elf64-ppc.c (allocate_got): Formatting.
+ (ppc64_elf_reloc_type_class): Return reloc_class_ifunc for any
+ reliplt reloc.
+ * elf-m10300.c, * elf32-arm.c, * elf32-bfin.c, * elf32-cr16.c,
+ * elf32-cris.c, * elf32-hppa.c, * elf32-i386.c, * elf32-lm32.c,
+ * elf32-m32r.c, * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c,
+ * elf32-s390.c, * elf32-sh.c, * elf32-sparc.c, * elf32-tilepro.c,
+ * elf32-vax.c, * elf32-xtensa.c, * elf64-aarch64.c, * elf64-alpha.c,
+ * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-s390.c, * elf64-sparc.c,
+ * elf64-x86-64.c, * elfnn-ia64.c, * elfxx-tilegx.c, * elfxx-tilegx.h:
+ Add extra params to the various reloc_type_class functions.
+
+2013-03-27 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (ppc_elf_check_relocs): Set PLT_IFUNC in local got
+ masks for all local ifunc syms.
+ (allocate_dynrelocs): Don't use htab->relgot for ifunc.
+ (ppc_elf_size_dynamic_sections): Likewise.
+ (ppc_elf_relocate_section): Likewise.
+
+2013-03-27 Will Newton <will.newton@linaro.org>
+
+ * elf32-arm.c (elf32_arm_final_link_relocate): Avoid emitting a
+ dynamic reloc for symbols with dynindx == -1.
+ (allocate_dynrelocs_for_symbol): Avoid allocating space for a
+ dynamic reloc for symbols with dynindx == -1.
+
+2013-03-27 Will Newton <will.newton@linaro.org>
+
+ * elf32-arm.c (elf32_arm_final_link_relocate): Avoid emitting a
+ dynamic reloc for non-default visibility undefined weaks.
+ (allocate_dynrelocs_for_symbol): Avoid allocating space for a
+ dynamic reloc for non-default visibility undefined weaks.
+
+2013-03-26 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (_bfd_elf_add_default_symbol): Preserve section
+ over _bfd_elf_merge_symbol calls.
+
+2013-03-26 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (elf_link_add_object_symbols): Add assertion for
+ common override alignment check code. Formatting.
+
+2013-03-25 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (_bfd_elf_merge_symbol): Set old_alignment for
+ usual common symbols as well as for dynamic. Add poldbfd param.
+ Save old bfd. Adjust callers.
+ (_bfd_elf_add_default_symbol): Add poldbfd param. Pass "section"
+ and "value" by value, not pointer. Adjust caller.
+ (elf_link_add_object_symbols): Combine undef_bfd and old_bfd vars.
+ Delete code to set same. Use old_bfd and old_alignment from
+ _bfd_elf_merge_symbol instead. Add default symbol before
+ alignment and size checks. Wrap overlong lines.
+
+2013-03-25 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (_bfd_elf_add_default_symbol): Delete "override" param.
+ (elf_link_add_object_symbols): Don't call _bfd_elf_add_default_symbol
+ when override is true.
+
+2013-03-25 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (_bfd_elf_merge_symbol): Use local var holding value
+ of *sym_hash.
+
+2013-03-25 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (_bfd_elf_merge_symbol): Don't discard TLS symbols here.
+ Wrap long lines.
+ (elf_link_add_object_symbols): Discard TLS symbols for --just-syms
+ early in symbol loop.
+
+2013-03-25 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (struct elf_backend_data <merge_symbol>): Update proto.
+ (_bfd_elf_init_reloc_shdr): Delete.
+ * elf.c (_bfd_elf_init_reloc_shdr): Make static.
+ * elf64-x86-64.c (elf_x86_64_merge_symbol): Trim parameters to
+ just what is needed.
+ * elflink.c (_bfd_elf_merge_symbol): Update bed->merge_symbol call.
+
+2013-03-23 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (_bfd_elf_merge_symbol): Delete declaration.
+ * elflink.c (_bfd_elf_merge_symbol): Make static.
+ * elf32-sh-symbian.c (sh_symbian_relocate_section): Don't call
+ _bfd_elf_merge_symbol, call _bfd_generic_link_add_one_symbol.
+
+2013-03-23 Alan Modra <amodra@gmail.com>
+
+ PR ld/15270
+ * elflink.c (elf_link_add_object_symbols): Don't set def_regular
+ or ref_regular for BFD_PLUGIN owned syms, or have them affect
+ def_dynamic/ref_dynamic.
+ (_bfd_elf_fix_symbol_flags): Don't set def_regular for BFD_PLUGIN
+ owned syms.
+
+2013-03-22 David S. Miller <davem@davemloft.net>
+
+ * elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): Set type of
+ hwcaps attribute.
+
+2013-03-22 Achille Fouilleul <achille.fouilleul+binutils@gadz.org>
+
+ PR ld/14902
+ * elf32-h8300.c (elf32_h8_relax_delete_bytes): Fix off by one
+ errors adjusting relocs and symbols.
+
+2013-03-21 Michael Schewe <michael.schewe@gmx.net>
+
+ * elf32-h8300 (h8_relax_section): Add new relaxation of mov
+ @(disp:32,ERx) to mov @(disp:16,ERx).
+ (R_H8_DISP32A16): New reloc.
+ Comments added and corrected.
+ * reloc.c (BFD_RELOC_H8_DISP32A16): New reloc.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+
+2013-03-21 Kai Tietz <ktietz@redhat.com>
+
+ * coffgen.c (coff_real_object_p): Make global.
+ * peicode.h (coff_real_object_p): Add prototype.
+ (FILHDR): Defined for COFF_IMAGE_WITH_PE as
+ external_PEI_IMAGE_hdr structure.
+ (coff_swap_filehdr_in): Handle variable header-size.
+ * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Just handle amount
+ of directory-entiries as specified in pe-header.
+
+2013-03-21 Nick Clifton <nickc@redhat.com>
+
+ PR sim/15286
+ * elf32-arm.c (bfd_arm_get_mach_from_attributes): Identify XScale,
+ iWMMXt and iWMMXt2 processors from attributes.
+
+2013-03-20 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (_bfd_elf_make_dynamic_reloc_section): Override
+ sh_type according to is_rela.
+
+2013-03-18 Alan Modra <amodra@gmail.com>
+
+ PR ld/12549
+ * elflink.c (elf_link_add_object_symbols): Exclude weak refs when
+ considering whether an --as-needed library is needed.
+
+2013-03-14 Tom Tromey <tromey@redhat.com>
+
+ * opncls.c (bfd_get_debug_link_info): Rename from
+ get_debug_link_info. Export. Update comment.
+ (find_separate_debug_file): Update.
+ * bfd-in2.h: Rebuild.
+
+2013-03-08 Venkataramanan Kumar <venkataramanan.kumar@linaro.org>
+
+ * elf64-aarch64.c (elf_backend_can_gc_sections): Enable gc-section
+ support.
+ (elf64_aarch64_gc_sweep_hook): Handle GOT, TLS and PLT related
+ relocs.
+
+2013-03-08 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
+ * elf-bfd.h (elfcore_write_s390_tdb): Add prototype.
+ * elf.c (elfcore_write_s390_tdb): New function.
+ (elfcore_write_register_note): Call it.
+ (elfcore_grok_s390_tdb): New function.
+ (elfcore_grok_note): Call it.
+
+2013-03-08 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * elfxx-mips.c (mips_elf_allocate_lazy_stub): Correct data type.
+
+2013-03-05 Corinna Vinschen <vinschen@redhat.com>
+
+ * config.bfd: Add x86_64-*-cygwin to list of supported targets.
+
+2013-03-04 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (ppc_elf_relocate_section <R_PPC_PLTREL24>): Adjust
+ non-zero addends when relocatable, rather than addends >= 32768.
+ Always zero "addend" before applying relocation.
+
+2013-03-04 Nick Clifton <nickc@redhat.com>
+
+ * archive64.c (bfd_elf64_archive_write_armap): Fix calculation of
+ file pointer offsets for thin archives.
+
+2013-02-28 Nathan Sidwell <nathan@codesourcery.com>
+
+ * elf32-arm.c (elf32_arm_size_dynamic_sections): Don't call
+ elf32_arm_allocate_dynrelocs for source reloc for non-dynamic link.
+
+2013-02-27 DJ Delorie <dj@redhat.com>
+
+ * reloc.c (BFD_RELOC_RL78_CODE): Add.
+ * libbfd.h: Regenerate.
+ * bfd-in2.h: Regenerate.
+ * elf32-rl78.c (rl78_elf_relocate_section): Handle weak code
+ references in compuated relocs.
+
+2013-02-26 Anthony Green <green@moxielogic.com>
+
+ * config.bfd: Extend moxie-rtems target triplet name support.
+
+2013-02-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/15167
+ * elf64-ia64-vms.c (elf64_vms_link_add_object_symbols): Set
+ unique_global only for definition.
+ * elflink.c (_bfd_elf_merge_symbol): Don't set unique_global
+ here.
+ (elf_link_add_object_symbols): Set unique_global only
+ for definition.
+
+2013-02-21 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (struct elf_build_id): Extracted from..
+ (struct elf_build_id_info): ..here. Delete.
+ (struct output_elf_obj_tdata): New, extracted from..
+ (struct elf_obj_tdata): ..here. Reorganize for better packing.
+ Add "o" field.
+ (elf_program_header_size): Reference tdata->o.
+ (elf_seg_map, elf_next_file_pos, elf_eh_frame_hdr, elf_linker,
+ elf_stack_flags, elf_shstrtab, elf_strtab_sec, elf_shstrtab_sec,
+ elf_section_syms, elf_num_section_syms, elf_flags_init): Likewise.
+ * elf.c (bfd_elf_allocate_object): Allocate output_elf_obj_tdata
+ when opening bfd in any mode that might write.
+ (_bfd_elf_write_object_contents): Use build_id field in
+ output_elf_obj_tdata.
+ (_bfd_elf_close_and_cleanup): Tweak elf_shstrtab test.
+ (elfobj_grok_gnu_build_id): Adjust for elf_tdata changes.
+
+2013-02-21 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (struct core_elf_obj_tdata): New.
+ (struct elf_obj_tdata): Delete core_signal, core_pid, core_lwpid,
+ core_program, and core_command. Add "core".
+ * elf.c (bfd_elf_mkcorefile): Allocate "core" struct.
+ Update all refs to tdata core fields.
+ * elf32-am33lin.c, * elf32-arm.c, * elf32-cris.c, * elf32-frv.c,
+ * elf32-hppa.c, * elf32-i386.c, * elf32-m68k.c, * elf32-mips.c,
+ * elf32-nios2.c, * elf32-ppc.c, * elf32-s390.c, * elf32-score.c,
+ * elf32-score7.c, * elf32-sh.c, * elf32-sparc.c, * elf32-tilegx.c,
+ * elf32-tilepro.c, * elf32-xtensa.c, * elf64-aarch64.c,
+ * elf64-hppa.c, * elf64-mips.c, * elf64-ppc.c, * elf64-tilegx.c,
+ * elf64-x86-64.c, * elfcore.h, * elfn32-mips.c: Update all refs
+ to tdata core fields.
+
+2013-02-21 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (struct elf_obj_tdata): Rename segment_map to seg_map.
+ Delete num_locals and num_globals.
+ (elf_num_locals, elf_num_globals): Don't define.
+ (elf_seg_map, elf_next_file_pos, elf_eh_frame_hdr, elf_linker,
+ elf_stack_flags, elf_strtab_sec, elf_shstrtab_sec): Define.
+ * bfd.c, * elf-eh-frame.c, * elf-nacl.c, * elf-vxworks.c, * elf.c,
+ * elf32-arm.c, * elf32-lm32.c, * elf32-ppc.c, * elf32-rx.c,
+ * elf32-spu.c, * elf64-hppa.c, * elfcode.h, * elflink.c,
+ * elfnn-ia64.c, * elfxx-mips.c: Use newly defined elf_obj_tdata
+ accessor macros.
+ * elf.c (elf_map_symbols): Add pnum_locals param. Return
+ number of locals syms via new param.
+ (swap_out_syms): Adjust to suit elf_map_symbols change.
+
+2013-02-19 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Also clear
+ STO_MICROMIPS annotation.
+
+2013-02-19 Alan Modra <amodra@gmail.com>
+
+ * configure.in: Bump version to 2.23.52.
+ * elf-bfd.h (struct elf_build_id_info): New.
+ (struct elf_obj_tdata): Delete after_write_object_contents,
+ after_write_object_contents_info and build_id_size. Make build_id
+ a pointer to struct elf_build_id_info.
+ * elf.c (_bfd_elf_write_object_contents): Style. Update
+ after_write_ibject_contents invocation.
+ (elfobj_grok_gnu_build_id): Update for new build_id struct. Don't
+ allow zero size notes.
+ * configure: Regenerate.
+
+2013-02-18 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * elf64-mips.c (micromips_elf64_howto_table_rel): Add
+ R_MICROMIPS_SCN_DISP and R_MICROMIPS_JALR.
+ (micromips_elf64_howto_table_rela): Likewise.
+ (micromips_reloc_map): Add BFD_RELOC_MICROMIPS_JALR.
+ * elfn32-mips.c (elf_micromips_howto_table_rel): Add
+ R_MICROMIPS_SCN_DISP and R_MICROMIPS_JALR.
+ (elf_micromips_howto_table_rela): Likewise.
+ (micromips_reloc_map): Add BFD_RELOC_MICROMIPS_JALR.
+
+2013-02-18 Paul Brook <paul@codesourcery.com>
+
+ * elfxx-mips.c (MICROMIPS_P): New macro.
+ (_bfd_mips_elf_symbol_processing): Use it.
+
+2013-02-18 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Clarify
+ comment on _PROCEDURE_LINKAGE_TABLE_ creation.
+
+2013-02-18 Alan Modra <amodra@gmail.com>
+
+ PR ld/12549
+ * elf-bfd.h (_bfd_elf_strtab_clear_refs): Delete.
+ (_bfd_elf_strtab_clear_all_refs): Declare.
+ (_bfd_elf_strtab_resize): Declare.
+ * elf-strtab.c (_bfd_elf_strtab_clear_refs): Delete.
+ (_bfd_elf_strtab_clear_all_refs): New function.
+ (_bfd_elf_strtab_resize): Likewise.
+ * elflink.c (elf_link_add_object_symbols): Use _bfd_elf_strtab_resize.
+
+2013-02-18 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (struct elf_obj_tdata): Move find_line_info, local_stubs,
+ local_call_stubs, elf_data_symbol, elf_text_symbol, elf_data_section,
+ and elf_text_section to..
+ * elfxx-mips.c (struct mips_elf_obj_tdata): ..here. Update all refs.
+ * elf64-alpha.c (struct mips_elf_find_line): Rename to..
+ (struct alpha_elf_find_line): ..this.
+ (struct alpha_elf_obj_tdata): Add find_line_info, update refs.
+
+2013-02-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/15146
+ * elflink.c (elf_link_add_object_symbols): Don't add DT_NEEDED
+ for references from the dummy bfd.
+
+2013-02-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/15149
+ * elflink.c (elf_link_add_object_symbols): Also track weak
+ references.
+
+2013-02-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/15151
+ * archive.c (_bfd_find_nested_archive): Don't allow a nested
+ archive pointing to itself.
+ (_bfd_get_elt_at_filepos): Revert the last 2 changes.
+
+2013-02-15 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/15140
+ * archive.c (_bfd_get_elt_at_filepos): Prevent an infinite loop
+ accessing a corrupt nested archive.
+
+2013-02-13 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_got_page_ref): New structure.
+ (mips_got_page_entry): Use a section rather than a (bfd, symndx)
+ pair to represent the anchor point.
+ (mips_got_info): Add a got_page_refs field.
+ (mips_elf_link_hash_table): Add a sym_cache field.
+ (mips_got_page_ref_hash, mips_got_page_ref_eq): New functions.
+ (mips_got_page_entry_hash, mips_got_page_entry_eq): Update for
+ new anchor representation.
+ (mips_elf_create_got_info): Create got_page_refs rather than
+ got_page_entries.
+ (mips_elf_record_got_page_ref): New function.
+ (mips_elf_pages_for_range): Move further down file.
+ (mips_elf_record_got_page_entry): Likewise. Take a got as argument.
+ Use a section rather than a (bfd, symndx) pair to represent the
+ anchor point.
+ (mips_elf_resolve_got_page_ref): New function.
+ (mips_elf_resolve_final_got_entries): Use it to populate
+ got_page_entries.
+ (_bfd_mips_elf_check_relocs): Call mips_elf_record_got_page_ref
+ rather than mips_elf_record_got_page_entry. Only nullify h
+ afterwards.
+ (mips_elf_lay_out_got): Call mips_elf_resolve_final_got_entries
+ earlier.
+
+2013-02-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_lay_out_got): Count VxWorks GOT relocs
+ in g->relocs.
+
+2013-02-12 Alan Modra <amodra@gmail.com>
+
+ * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Provide
+ suitable definition when using generic linker hash table.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_count_got_entries): Delete.
+ (mips_elf_check_recreate_got, mips_elf_recreate_got): Take a
+ mips_elf_traverse_got_arg. Count GOT entries.
+ (mips_elf_resolve_final_got_entries): Take the bfd_link_info
+ as argument. Update after above changes.
+ (mips_elf_merge_got, mips_elf_lay_out_got): Don't call
+ mips_elf_count_got_entries. Update the calls to
+ mips_elf_resolve_final_got_entries.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_got_tls_type): New enum.
+ (mips_got_entry): Add tls_initialized.
+ (mips_elf_got_entry_hash, mips_elf_got_entry_eq, mips_tls_got_relocs)
+ (mips_elf_count_got_entry, mips_elf_initialize_tls_index): Remove
+ GOT_TLS_TYPE masks.
+ (mips_elf_reloc_tls_type, mips_tls_got_entries)
+ (mips_elf_record_global_got_symbol, mips_elf_initialize_tls_index)
+ (_bfd_mips_elf_finish_dynamic_symbol): Use GOT_TLS_NONE rather
+ than GOT_NORMAL.
+ (mips_elf_initialize_tls_slots): Replace got_offset and tls_type_p
+ arguments with a GOT entry. Remove GOT_TLS_TYPE masks. Use
+ tls_initialized rather than GOT_TLS_DONE.
+ (mips_tls_got_index): Delete.
+ (mips_elf_local_got_index, mips_elf_global_got_index): Use
+ mips_elf_initialize_tls_slots rather than mips_tls_got_index.
+ (mips_elf_record_got_entry): Initialize tls_initialized.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_got_entry): Remove tls_ldm_offset.
+ (mips_elf_link_hash_entry): Remove tls_ie_type, tls_gd_type,
+ tls_ie_got_offset and tls_gd_got_offset.
+ (mips_elf_link_hash_newfunc): Remove initialization.
+ (mips_elf_create_got_info): Likewise.
+ (mips_elf_count_local_got_entries, mips_elf_count_global_tls_entries)
+ (mips_tls_single_got_index): Delete.
+ (mips_elf_local_got_index): Always use the GOT entry to track
+ GOT indices.
+ (mips_elf_global_got_index): Likewise.
+ (mips_elf_create_local_got_entry): Assert that TLS entries have
+ already been allocated.
+ (mips_elf_record_global_got_symbol): Don't initialize
+ tls_ie_type or tls_gd_type.
+ (mips_elf_count_got_symbols): Only count reloc-only GOT entries here.
+ (mips_elf_initialize_tls_index): Allocate a GOT index for every TLS
+ entry.
+ (mips_elf_lay_out_got): Use mips_elf_count_got_entries to count
+ the GOT entries.
+ (_bfd_mips_elf_finish_dynamic_symbol): Assert that TLS GOT offsets
+ have been allocated.
+ (_bfd_mips_elf_copy_indirect_symbol): Remove handling of
+ tls_ie_type and tls_gd_type.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_create_local_got_entry): Tidy. Avoid
+ aliasing violation. Check for htab allocation failures.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_primary_global_got_index): New function,
+ split out from...
+ (mips_elf_global_got_index): ...here. Reorder arguments so that
+ the output bfd and info come first.
+ (mips_elf_calculate_relocation): Update the call to
+ mips_elf_global_got_index accordingly.
+ (_bfd_mips_elf_finish_dynamic_symbol): Use
+ mips_elf_primary_global_got_index rather than
+ mips_elf_global_got_index.
+ (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_got_entry): Update comments.
+ (mips_elf_multi_got_entry_eq): Rename to...
+ (mips_elf_got_entry_eq): ...this, deleting the old definition.
+ (mips_elf_create_got_info): Remove master_got_p argument.
+ Always use mips_elf_got_entry_eq.
+ (mips_elf_bfd_got, mips_elf_multi_got, mips_elf_create_got_section):
+ Update calls accordingly.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_got_info): Remove bfd2got.
+ (mips_elf_bfd2got_hash): Delete.
+ (mips_elf_got_per_bfd_arg): Remove bfd2got.
+ (mips_elf_replace_bfd_got, mips_elf_count_got_entries): New functions.
+ (mips_elf_global_got_index, mips_elf_create_local_got_entry): Use
+ g->next to test for the multigot case. Use mips_elf_bfd_got rather
+ than mips_elf_got_for_ibfd.
+ (mips_elf_bfd2got_entry_hash, mips_elf_bfd2got_entry_eq)
+ (mips_elf_got_for_ibfd, mips_elf_get_got_for_bfd): Delete.
+ (mips_elf_make_got_per_bfd): Replace with...
+ (mips_elf_add_got_entry): ...this new function.
+ (mips_elf_make_got_pages_per_bfd): Replace with...
+ (mips_elf_add_got_page_entry): ...this new function.
+ (mips_elf_merge_got_with): Replace bfd2got argument with separate
+ bfd and GOT arguments. Use mips_elf_add_got_entry and
+ mips_elf_add_got_page_entry instead of mips_elf_make_got_per_bfd
+ and mips_elf_make_got_pages_per_bfd. Use mips_elf_replace_bfd_got
+ to set the BFD's GOT and free the old table.
+ (mips_elf_merge_got): Replace bfd2got argument with separate
+ bfd and GOT arguments. Apply mips_elf_resolve_final_got_entries.
+ Use mips_elf_count_got_entries to count the number of entries in
+ each GOT. Update the calls to mips_elf_merge_got_with.
+ (mips_elf_adjust_gp): Use g->next to test for the multigot case.
+ Use mips_elf_bfd_got rather than mips_elf_got_for_ibfd.
+ (mips_elf_multi_got): Don't create the bfd2got hash table.
+ Replace hash table traversal with a walk over the input bfds,
+ updating the call to mips_elf_merge_got. Use mips_elf_replace_bfd_got
+ to set the output bfd's GOT.
+ (mips_elf_lay_out_got): Rename "sub" to "ibfd". Record that all
+ bfds use the master GOT in the single-GOT case.
+ (_bfd_mips_elf_finish_dynamic_sections): Use mips_elf_bfd_got
+ rather than mips_elf_got_for_ibfd.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_obj_tdata): Add a got field.
+ (mips_elf_bfd_got, mips_elf_record_got_entry): New functions.
+ (mips_elf_record_global_got_symbol): Update the hash entry before
+ adding the mips_got_entry. Use mips_elf_record_got_entry to do
+ the latter.
+ (mips_elf_record_local_got_symbol): Use mips_elf_record_got_entry.
+ (mips_elf_record_got_page_entry): Record the entry in both the
+ master and bfd GOTs.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_recreate_got): Don't change the entry;
+ create another one if necessary.
+ (mips_elf_set_gotidx): New function.
+ (mips_elf_set_global_gotidx): Use it.
+ (mips_elf_initialize_tls_index): Likewise. Take a
+ mips_elf_traverse_got_arg as argument.
+ (mips_elf_lay_out_got): Update use of mips_elf_initialize_tls_index.
+ (mips_elf_multi_got): Likewise. Cope with error returns from
+ mips_elf_set_global_gotidx.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_got_info): Add relocs field.
+ (mips_elf_set_global_got_offset_arg, mips_elf_count_tls_arg): Replace
+ with...
+ (mips_elf_traverse_got_arg): ...this new structure.
+ (mips_elf_count_local_tls_relocs): Delete.
+ (mips_elf_count_global_tls_relocs): Likewise.
+ (mips_elf_count_got_entry): New function.
+ (mips_elf_count_local_got_entries): Likewise.
+ (mips_elf_count_global_tls_entries): Take a mips_elf_traverse_got_arg
+ rather than a mips_elf_count_tls_arg. Count both relocs and entries.
+ (mips_elf_record_local_got_symbol): Don't count got entries here.
+ (mips_elf_make_got_per_bfd): Use mips_elf_count_got_entry.
+ (mips_elf_set_global_got_offset): Split into...
+ (mips_elf_set_global_got_area, mips_elf_set_global_gotidx): ...these
+ new functions. Take a mips_elf_traverse_got_arg rather than a
+ mips_elf_set_global_got_offset_arg. Don't count TLS relocs here.
+ Use g->relocs to record the number of relocs needed for global GOT
+ entries.
+ (mips_elf_multi_got): Use mips_elf_traverse_got_arg rather than
+ mips_elf_set_global_got_offset_arg. Use the relocs field to count
+ relocations. Update for above function split.
+ (mips_elf_lay_out_got): Use mips_elf_count_local_got_entries
+ to count both the number of GOT entries and the number of TLS
+ relocs required by local entries. Likewise
+ mips_elf_count_global_tls_entries and global entries.
+ Remove uses of mips_elf_count_local_tls_relocs and
+ mips_elf_count_global_tls_relocs.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_got_entry): Update comment above tls_type entry
+ to say that each structure represents only one type of TLS reference.
+ (GOT_TLS_TYPE): New define.
+ (mips_elf_link_hash_entry): Temporarily split tls_type and
+ tls_got_offset into two variables each.
+ (mips_elf_link_hash_newfunc): Update accordingly.
+ (mips_elf_got_entry_eq, mips_elf_got_entry_hash)
+ (mips_elf_multi_got_entry_eq): Require the tls_type to be the same.
+ (mips_elf_reloc_tls_type, mips_tls_got_entries): New functions.
+ (mips_tls_got_relocs): Use a switch statement.
+ (mips_elf_count_global_tls_entries): Handle the new hash entry fields.
+ (mips_elf_initialize_tls_slots): Use a switch statement. Avoid
+ local "offset" variable.
+ (mips_tls_got_index): Remove r_type argument and assert. Remove
+ code that handled entries with two TLS types; always use the
+ original got_index instead.
+ (mips_tls_single_got_index): New function.
+ (mips_elf_local_got_index): Use entry->tls_type to check for
+ TLS entries. Use mips_tls_single_got_index. Update call to
+ mips_tls_got_index.
+ (mips_elf_global_got_index): Use mips_elf_reloc_tls_type.
+ Use p->tls_type to check for TLS entries. Update call to
+ mips_tls_got_index. Use mips_tls_single_got_index.
+ (mips_elf_create_local_got_entry): Use mips_elf_reloc_tls_type.
+ Use entry.tls_type to check for TLS entries.
+ (mips_elf_record_global_got_symbol): Replace tls_flag argument
+ with r_type argument. Use mips_elf_reloc_tls_type.
+ Set up the new hash entry fields.
+ (mips_elf_record_local_got_symbol): Replace tls_flag argument
+ with r_type argument. Use mips_elf_reloc_tls_type and
+ mips_tls_got_entries. Remove code that handled entries
+ with multiple TLS types.
+ (mips_elf_make_got_per_bfd): Use mips_tls_got_entries.
+ (mips_elf_initialize_tls_index): Handle new hash entry fields.
+ Use equality rather than masks when checking for specific TLS types.
+ Use mips_tls_got_entries. Remove code that handled entries
+ with multiple TLS types.
+ (mips_elf_calculate_relocation): Use TLS_RELOC_P instead of
+ testing the hash table entry.
+ (_bfd_mips_elf_check_relocs): Update calls to
+ mips_elf_record_global_got_symbol and mips_elf_record_local_got_symbol.
+ (_bfd_mips_elf_finish_dynamic_symbol): Don't check h->type.
+ (_bfd_mips_elf_copy_indirect_symbol): Handle new hash entry fields.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_multi_got_entry_hash): Rename to...
+ (mips_elf_got_entry_hash): ...this, deleting the old version.
+ (mips_elf_create_got_info): Use mips_elf_got_entry_hash for
+ both types of GOT.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_create_got_info): New function.
+ (mips_elf_get_got_for_bfd, mips_elf_multi_got): Use it.
+ (mips_elf_create_got_section): Likewise.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_record_local_got_symbol): Always set
+ gotidx to -1.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_multi_got): Simplify size calculation.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_got_info): Move global_gotsym to...
+ (mips_elf_link_hash_table): ...here. Update rest of file accordingly.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_count_global_tls_entries)
+ (mips_elf_count_global_tls_relocs): Don't count indirect or
+ warning symbols.
+ (mips_elf_multi_got, mips_elf_lay_out_got): Assert that the right
+ number of TLS entries were allocated.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_sort_hash_table_f): Remove asserts.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_merge_got_with): Only use arg->global_count
+ if there are TLS relocations.
+
+2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elfxx-mips.c (mips_elf_recreate_got): Remove free.
+ (mips_elf_resolve_final_got_entries): Remove bogus comment.
+
+2013-02-11 Alan Modra <amodra@gmail.com>
+
+ * elfcode.h (elf_checksum_contents): Free contents.
+ * elf-bfd.h (_bfd_elf_link_hash_table_free): Declare.
+ * elflink.c (_bfd_elf_link_hash_table_free): New function.
+ (elf_final_link_free): New function, extracted from..
+ (bfd_elf_final_link): ..here. Always call
+ _bfd_elf_write_section_eh_frame_hdr.
+ * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Default to
+ _bfd_elf_link_hash_table_free.
+ * libbfd-in.h (_bfd_merge_sections_free): Declare.
+ * libbfd.h: Regenerate.
+ * merge.c (_bfd_merge_sections_free): New function.
+ * elf-eh-frame.c (_bfd_elf_write_section_eh_frame_hdr): Free
+ hdr_info->array.
+ * elf-m10300.c (elf32_mn10300_link_hash_table_free): Call
+ _bfd_elf_link_hash_table_free.
+ * elf32-arm.c (elf32_arm_link_hash_table_free): Likewise.
+ * elf32-avr.c (elf32_avr_link_hash_table_free): Likewise.
+ * elf32-hppa.c (elf32_hppa_link_hash_table_free): Likewise.
+ * elf32-i386.c (elf_i386_link_hash_table_free): Likewise.
+ * elf32-m68hc1x.c (m68hc11_elf_hash_table_free): Likewise.
+ * elf32-m68k.c (elf_m68k_link_hash_table_free): Likewise.
+ * elf32-metag.c (elf_metag_link_hash_table_free): Likewise.
+ * elf32-xgate.c (xgate_elf_bfd_link_hash_table_free): Likewise.
+ * elf64-aarch64.c (elf64_aarch64_link_hash_table_free): Likewise.
+ * elf64-ia64-vms.c (elf64_ia64_hash_table_free): Likewise.
+ * elf64-ppc.c (ppc64_elf_link_hash_table_free): Likewise.
+ * elf64-x86-64.c (elf_x86_64_link_hash_table_free): Likewise.
+ * elfnn-ia64.c (elfNN_ia64_hash_table_free): Likewise.
+ * elf32-cr16.c (elf32_cr16_link_hash_table_free): Delete.
+ (bfd_elf32_bfd_link_hash_table_free): Don't define.
+ * elf32-tic6x.c (elf32_tic6x_link_hash_table_free): Delete.
+ (bfd_elf32_bfd_link_hash_table_free): Dont' define.
+
+2013-02-10 Alan Modra <amodra@gmail.com>
+
+ * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_zmalloc.
+ * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise.
+ * m68klinux.c (linux_link_hash_table_create): Likewise.
+ * sparclinux.c (linux_link_hash_table_create): Likewise.
+ * sunos.c (sunos_link_hash_table_create): Likewise.
+ * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise.
+ * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise.
+ * elf32-arm.c (elf32_arm_link_hash_table_create): Likewise.
+ * elf32-avr.c (elf32_avr_link_hash_table_create): Likewise.
+ * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
+ * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
+ * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise.
+ * elf32-i386.c (elf_i386_link_hash_table_create): Likewise.
+ * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
+ * elf32-m32r.c (m32r_elf_link_hash_table_create): Likewise.
+ * elf32-m68hc1x.c (m68hc11_elf_hash_table_create): Likewise.
+ * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
+ * elf32-metag.c (elf_metag_link_hash_table_create): Likewise.
+ * elf32-nios2.c (nios2_elf32_link_hash_table_create): Likewise.
+ * elf32-s390.c (elf_s390_link_hash_table_create): Likewise.
+ * elf32-score.c (elf32_score_link_hash_table_create): Likewise.
+ * elf32-spu.c (spu_elf_link_hash_table_create): Likewise.
+ * elf32-tic6x.c (elf32_tic6x_link_hash_table_create): Likewise.
+ * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
+ * elf32-xgate.c (xgate_elf_bfd_link_hash_table_create): Likewise.
+ * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Likewise.
+ * elf64-aarch64.c (elf64_aarch64_link_hash_table_create): Likewise.
+ * elf64-s390.c (elf_s390_link_hash_table_create): Likewise.
+ * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise.
+ * elf64-x86-64.c (elf_x86_64_link_hash_table_create): Likewise.
+ * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
+ * elflink.c (_bfd_elf_link_hash_table_create): Likewise.
+ (_bfd_elf_link_hash_table_init): Assume zero fill table on entry.
+
+2013-02-10 Alan Modra <amodra@gmail.com>
+
+ * i386linux.c (linux_link_hash_table_create): Allocate table
+ with bfd_zmalloc, not bfd_alloc.
+ * pdp11.c (link_hash_table_create): Allocate table with
+ bfd_malloc, not bfd_alloc.
+ * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create): Allocate table
+ with bfd_zmalloc, not bfd_zalloc.
+ (bfin_link_hash_table_create): Likewise.
+ * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
+ * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
+
+2013-02-10 Alan Modra <amodra@gmail.com>
+
+ PR ld/15113
+ * elf32-sh.c (sh_elf_link_hash_table_create): Use bfd_zmalloc.
+
+2013-02-08 Markos Chandras <markos.chandras@imgtec.com>
+
+ * elf32-metag.c: Use bfd_get_linker_section to get SEC_LINKER_CREATED
+ sections.
+ (elf_metag_adjust_dynamic_symbol): Don't error on zero size dynbss
+ symbol.
+
+2013-02-08 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * elf64-aarch64.c (elf64_aarch64_grok_prstatus): Change 'size' from
+ 288 to 272.
+
+2013-02-08 Alan Modra <amodra@gmail.com>
+
+ PR binutils/15106
+ * elf-bfd.h (struct elf_obj_tdata): Add elf_find_function_cache.
+ * elf.c (elf_find_function): Revert last change. Use new
+ tdata field rather than static vars for cache.
+
+2013-02-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/15107
+ * elflink.c (elf_link_output_extsym): Set STB_GNU_UNIQUE only if
+ symbol is defined in regular object.
+
+2013-02-07 Roberto Agostino Vitillo <ra.vitillo@gmail.com>
+
+ PR binutils/15106
+ * elf.c (elf_find_function): Don't cache if symbols change.
+
+2013-02-07 Alan Modra <amodra@gmail.com>
+
+ PR binutils/14873
+ * elf-attrs.c (_bfd_elf_copy_obj_attributes): Don't attempt to
+ copy attributes from or to non-ELF.
+
+2013-02-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't clear pc_count
+ for non-zero TLS symbol.
+ (elf_i386_relocate_section): Don't resolve size relocation against
+ non-zero TLS symbol.
+ * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Don't clear
+ pc_count for non-zero TLS symbol.
+ (elf_x86_64_relocate_section): Don't resolve size relocation
+ against non-zero TLS symbol.
+
+2013-02-06 Sandra Loosemore <sandra@codesourcery.com>
+ Andrew Jenner <andrew@codesourcery.com>
+
+ Based on patches from Altera Corporation.
+
+ * Makefile.am (ALL_MACHINES): Add cpu-nios2.lo.
+ (ALL_MACHINES_CFILES): Add cpu-nios2.c.
+ (BFD_BACKENDS): Add elf32-nios2.lo.
+ (BFD32_BACKENDS_CFILES): Add elf32-nios2.c.
+ * Makefile.in: Regenerated.
+ * configure.in: Add entries for bfd_elf32_bignios2_vec and
+ bfd_elf32_littlenios2_vec.
+ * configure: Regenerated.
+ * config.bfd: Add cases for nios2.
+ * archures.c (enum bfd_architecture): Add bfd_arch_nios2.
+ (bfd_mach_nios2): Define.
+ (bfd_nios2_arch): Declare.
+ (bfd_archures_list): Add bfd_nios2_arch.
+ * targets.c (bfd_elf32_bignios2_vec): Declare.
+ (bfd_elf32_littlenios2_vec): Declare.
+ (_bfd_target_vector): Add entries for bfd_elf32_bignios2_vec and
+ bfd_elf32_littlenios2_vec.
+ * elf-bfd.h (enum elf_target_id): Add NIOS2_ELF_DATA.
+ * reloc.c (enum bfd_reloc_code_real): Add Nios II relocations.
+ * bfd-in2.h: Regenerated.
+ * libbfd.h: Regenerated.
+ * cpu-nios2.c: New file.
+ * elf32-nios2.c: New file.
+
+2013-02-06 Alan Modra <amodra@gmail.com>
+
+ * elf32-arm.c (elf32_arm_final_link_relocate): Only test for
+ stubs in stub_bfd.
+
+2013-02-06 Alan Modra <amodra@gmail.com>
+
+ * Makefile.am (SOURCE_HFILES): Add `elf-linux-psinfo.h'.
+ * Makefile.in: Regenerate.
+
+2013-02-04 Sergio Durigan Junior <sergiodj@redhat.com>
+ Pedro Alves <palves@redhat.com>
+
+ * Makefile.in (SOURCE_HFILES): Add `elf-linux-psinfo.h'.
+ * elf-bfd.h (elf_internal_linux_prpsinfo): New structure
+ declaration.
+ (elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64)
+ (elfcore_write_ppc32_linux_prpsinfo32): New declarations.
+ * elf-linux-psinfo.h: New file.
+ * elf.c: Include elf-linux-psinfo.h.
+ (elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64):
+ New functions.
+ * elf32-ppc.c: Include `elf-linux-psinfo.h'.
+ (elf_external_ppc_linux_prpsinfo32): New structure declaration.
+ (PPC_LINUX_PRPSINFO32_SWAP_FIELDS): New macro.
+ (elfcore_write_ppc_linux_prpsinfo32): New function.
+
+2013-02-04 Tristan Gingold <gingold@adacore.com>
+
+ * mach-o.c (bfd_mach_o_scan_start_address): Do not fail if no
+ start address.
+
+2013-02-04 Alan Modra <amodra@gmail.com>
+
+ * Makefile.am (BFD64_BACKENDS): Remove elf-nacl.lo.
+ (BFD64_BACKENDS_CFILES): Remove elf-nacl.c.
+ * Makefile.in: Regenerate.
+ * po/SRC-POTFILES.in: Regenerate.
+
+2013-02-04 Alan Modra <amodra@gmail.com>
+
+ * coff-tic54x.c (SWAP_OUT_RELOC_EXTRA): Delete.
+ * coff-tic80.c (SWAP_OUT_RELOC_EXTRA): Delete.
+
+2013-02-01 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (dec_dynrel_count): Don't error when elf_gc_sweep_symbol
+ clears def_regular.
+
+2013-01-31 Tristan Gingold <gingold@adacore.com>
+
+ * mach-o.c (bfd_mach_o_scan): Call bfd_mach_o_flatten_sections
+ earlier. Fix status checking of bfd_mach_o_scan_start_address.
+ (bfd_mach_o_scan_start_address): Handle LC_MAIN.
+
+2013-01-31 Alan Modra <amodra@gmail.com>
+ David S. Miller <davem@davemloft.net>
+
+ PR ld/15056
+ * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Handle implicit
+ references to __tls_get_addr.
+ * elf32-tilpro.c (tilepro_elf_gc_mark_hook): Likewise. Correct
+ vtinherit and vtentry reloc handling too.
+ * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): As for tilepro.
+
+2013-01-31 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc_stub_name): Trim off trailing "+0".
+
+2013-01-31 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (build_plt_stub): Correct plt stub branch to glink.
+
+2013-01-28 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c: Use %T to print symbols names and remove redundant
+ "relocation" in error messages throughout file.
+ (ppc64_elf_relocate_section): Remove sibling call error message,
+ replace with "call lacks nop". Specially report errors for
+ branches to function entry points via OPD lookup and branches
+ to stubs. Remove NULL symbol handling now done by %T.
+
+2013-01-28 Alan Modra <amodra@gmail.com>
+
+ * archive.c (bfd_generic_archive_p): Return target and keep
+ ardata on partial matches.
+ * format.c (bfd_check_format_matches): Adjust for above
+ change. Remove bfd_error_file_ambiguously_recognized dead
+ code.
+
+2013-01-26 Alan Modra <amodra@gmail.com>
+
+ * bfd.c (struct bfd_preserve, bfd_preserve_save, bfd_preserve_restore,
+ bfd_preserve_finish): Move to..
+ * format.c: ..here, splitting out..
+ (bfd_reinit): ..this. New function.
+ (bfd_check_format_matches): Use bfd_preserve_save/restore to
+ keep bfd state for a match.
+ * elfcode.h (elf_object_p): Don't use bfd_preserve_save/restore.
+ * elfcore.h (elf_core_file_p): Likewise.
+ * mach-o.c (bfd_mach_o_header_p): Likewise.
+ * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
+ * xsym.c (bfd_sym_object_p): Likewise.
+ * mmo.c (mmo_scan): Clear abfd->symcount.
+ * opncls.c (_bfd_new_bfd): Use a smaller section hash table.
+ * section.c (bfd_section_list_clear): Clear section_htab.count.
+ * bfd-in2.h: Regenerate.
+
+2013-01-25 Michael Schewe <michael.schewe@gmx.net>
+
+ * elf32-h8300.c (elf32_h8_relax_section): When checking for a
+ second reloc, make sure that the reloc potentially exists first.
+
+2013-01-24 Nick Clifton <nickc@redhat.com>
+
+ * archures.c: Add bfd_mach_v850e3v5.
+ * bfd-in2.h: Regenerate.
+ * cpu-v850.c: Add entries for v850e2v5 and v850e3v5.
+ * cpu-v850_rh850.c: Likewise.
+ * elf32-v850.c: Add support for v850e3v5 architecture.
+
+2013-01-23 Markos Chandras <markos.chandras@imgtec.com>
+
+ * elf32-metag.c: Error on HIADDR16/LOADDR16 in shared link.
+
+2013-01-23 Leif Ekblad <leif@rdos.net>
+
+ * config.bfd (x86_64-*-rdos*): Remove targ_selvecs.
+
+2013-01-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_allocate_dynrelocs): Clear pc_count for
+ non-zero TLS symbol.
+ (elf_i386_relocate_section): Resolve size relocation against
+ non-zero TLS symbol.
+ * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Clear pc_count
+ for non-zero TLS symbol.
+ (elf_x86_64_relocate_section): Resolve size relocation against
+ non-zero TLS symbol.
+
+2013-01-18 Mike Frysinger <vapier@gentoo.org>
+
+ * elflink.c (bfd_elf_size_dynamic_sections): Only add DT_RPATH
+ when new_dtags is false. Only add DT_RUNPATH when new_dtags is
+ true.
+
+2013-01-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_check_relocs): Count size relocation as
+ PC-relative relocation.
+ * elf64-x86-64.c (elf_x86_64_check_relocs): Count size relocation
+ as PC-relative relocation.
+
+2013-01-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_check_relocs): Update R_386_SIZE32
+ check.
+ (elf_i386_relocate_section): Don't check TLS for R_386_SIZE32.
+
+ * elf64-x86-64.c (elf_x86_64_check_relocs): Update R_X86_64_SIZE32
+ and R_X86_64_SIZE64 check.
+ (elf_x86_64_relocate_section): Don't check TLS for R_X86_64_SIZE32
+ nor R_X86_64_SIZE64.
+
+2013-01-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * bfd-in2.h: Regenerated.
+ * libbfd.h: Likewise.
+
+ * elf32-i386.c (elf_howto_table): Fill R_386_SIZE32 entry.
+ (elf_i386_reloc_type_lookup): Support BFD_RELOC_SIZE32.
+ (elf_i386_check_relocs): Handle R_386_SIZE32.
+ (elf_i386_gc_sweep_hook): Likewise.
+ (elf_i386_relocate_section): Likewise.
+
+ * elf64-x86-64.c (x86_64_elf_howto_table): Fill R_X86_64_SIZE32
+ and R_X86_64_SIZE64 entries.
+ (x86_64_reloc_map): Add BFD_RELOC_SIZE32 and BFD_RELOC_SIZE64,
+ (elf_x86_64_rtype_to_howto): Handle R_X86_64_SIZE32 for x32.
+ (elf_x86_64_reloc_name_lookup): Likewise.
+ (elf_x86_64_check_relocs): Handle R_X86_64_SIZE32 and
+ R_X86_64_SIZE64.
+ (elf_x86_64_gc_sweep_hook): Likewise.
+ (elf_x86_64_relocate_section): Likewise.
+
+ * reloc.c (bfd_reloc_code_type): Add BFD_RELOC_SIZE32 and
+ BFD_RELOC_SIZE64.
+
+2013-01-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf64-x86-64.c (R_X86_64_standard): Replace R_X86_64_IRELATIVE
+ with R_X86_64_RELATIVE64.
+
+2013-01-15 Nick Clifton <nickc@redhat.com>
+
+ * elf32-msp430.c: Fix spelling typo.
+
+2013-01-15 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_size_stubs): Default shared libs to
+ plt-thread-safe.
+
+2013-01-14 Alan Modra <amodra@gmail.com>
+
+ PR binutils/14813
+ * bfdio.c (struct bfd_iovec <bclose>): Revert 2012-11-06.
+ (memory_bclose): Likewise. Return 0 on success.
+ * cache.c (cache_bclose): Likewise.
+ * opncls.c (opncls_bclose, bfd_close): Likewise.
+ * vms-lib.c (vms_lib_bclose): Likewise.
+ * libbfd.h: Regenerate.
+
+2013-01-13 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (struct elf_link_hash_entry): Delete dynamic_weak.
+ Add ref_dynamic_nonweak.
+ * elflink.c (_bfd_elf_mark_dynamic_def_weak): Delete.
+ (_bfd_elf_merge_symbol): Don't call above function. Move
+ setting of ref_dynamic_nonweak and dynamic_def earlier. Don't
+ clear dynamic_def.
+ (elf_link_add_object_symbols): Delete redundant "override" test.
+ Don't set dynamic_def here.
+ (elf_link_output_extsym): Update.
+
+2013-01-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_check_relocs): Set bfd errror for
+ normal and TLS symbol access.
+ * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
+
+2013-01-12 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (_bfd_elf_strtab_refcount): Declare.
+ * elf-strtab.c (_bfd_elf_strtab_refcount): New function.
+ * elflink.c (elf_add_dt_needed_tag): Use _bfd_elf_strtab_refcount.
+
+2013-01-12 Alan Modra <amodra@gmail.com>
+
+ PR ld/12549
+ * elf-bfd.h (_bfd_elf_strtab_clear_refs): Declare.
+ (_bfd_elf_strtab_clear_all_refs): Define.
+ * elf-strtab.c (_bfd_elf_strtab_clear_refs): New function.
+ (_bfd_elf_strtab_clear_all_refs): Delete.
+ * elflink.c (elf_link_add_object_symbols): Clear out added
+ strtab refs. Correct handling of warning common symbols.
+
+2013-01-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ * aout0.c: Remove trailing white spaces.
+ * archive.c: Likewise.
+ * archures.c: Likewise.
+ * bfd-in.h: Likewise.
+ * bfd-in2.h: Likewise.
+ * coff-alpha.c: Likewise.
+ * coff-i860.c: Likewise.
+ * coff-mips.c: Likewise.
+ * coff-ppc.c: Likewise.
+ * coff-tic80.c: Likewise.
+ * coff-x86_64.c: Likewise.
+ * coff-z80.c: Likewise.
+ * coffcode.h: Likewise.
+ * coffgen.c: Likewise.
+ * cofflink.c: Likewise.
+ * compress.c: Likewise.
+ * corefile.c: Likewise.
+ * cpu-arm.c: Likewise.
+ * cpu-avr.c: Likewise.
+ * cpu-bfin.c: Likewise.
+ * cpu-cr16.c: Likewise.
+ * cpu-cr16c.c: Likewise.
+ * cpu-crx.c: Likewise.
+ * cpu-h8300.c: Likewise.
+ * cpu-i386.c: Likewise.
+ * cpu-lm32.c: Likewise.
+ * cpu-m68k.c: Likewise.
+ * cpu-moxie.c: Likewise.
+ * cpu-msp430.c: Likewise.
+ * cpu-sh.c: Likewise.
+ * cpu-xc16x.c: Likewise.
+ * dwarf2.c: Likewise.
+ * ecofflink.c: Likewise.
+ * ecoffswap.h: Likewise.
+ * elf-ifunc.c: Likewise.
+ * elf-m10300.c: Likewise.
+ * elf-vxworks.c: Likewise.
+ * elf32-avr.c: Likewise.
+ * elf32-avr.h: Likewise.
+ * elf32-cr16.c: Likewise.
+ * elf32-cr16c.c: Likewise.
+ * elf32-cris.c: Likewise.
+ * elf32-crx.c: Likewise.
+ * elf32-frv.c: Likewise.
+ * elf32-hppa.c: Likewise.
+ * elf32-i860.c: Likewise.
+ * elf32-ip2k.c: Likewise.
+ * elf32-iq2000.c: Likewise.
+ * elf32-m32c.c: Likewise.
+ * elf32-m68hc1x.c: Likewise.
+ * elf32-msp430.c: Likewise.
+ * elf32-mt.c: Likewise.
+ * elf32-ppc.c: Likewise.
+ * elf32-rl78.c: Likewise.
+ * elf32-s390.c: Likewise.
+ * elf32-score.h: Likewise.
+ * elf32-sh-symbian.c: Likewise.
+ * elf32-sh.c: Likewise.
+ * elf32-spu.c: Likewise.
+ * elf32-tic6x.c: Likewise.
+ * elf32-v850.c: Likewise.
+ * elf32-xc16x.c: Likewise.
+ * elf32-xtensa.c: Likewise.
+ * elf64-alpha.c: Likewise.
+ * elf64-hppa.c: Likewise.
+ * elf64-ppc.c: Likewise.
+ * elf64-s390.c: Likewise.
+ * elfcore.h: Likewise.
+ * elflink.c: Likewise.
+ * elfxx-mips.c: Likewise.
+ * elfxx-sparc.c: Likewise.
+ * elfxx-tilegx.c: Likewise.
+ * ieee.c: Likewise.
+ * libcoff.h: Likewise.
+ * libpei.h: Likewise.
+ * libxcoff.h: Likewise.
+ * linker.c: Likewise.
+ * mach-o-i386.c: Likewise.
+ * mach-o-target.c: Likewise.
+ * mach-o.c: Likewise.
+ * mach-o.h: Likewise.
+ * mmo.c: Likewise.
+ * opncls.c: Likewise.
+ * pdp11.c: Likewise.
+ * pe-x86_64.c: Likewise.
+ * peXXigen.c: Likewise.
+ * pef-traceback.h: Likewise.
+ * pei-x86_64.c: Likewise.
+ * peicode.h: Likewise.
+ * plugin.c: Likewise.
+ * reloc.c: Likewise.
+ * riscix.c: Likewise.
+ * section.c: Likewise.
+ * som.c: Likewise.
+ * syms.c: Likewise.
+ * tekhex.c: Likewise.
+ * ticoff.h: Likewise.
+ * vaxbsd.c: Likewise.
+ * xcofflink.c: Likewise.
+ * xtensa-isa.c: Likewise.
+
+2013-01-10 Will Newton <will.newton@imgtec.com>
+
+ * Makefile.am: Add Meta.
+ * Makefile.in: Regenerate.
+ * archures.c (bfd_mach_metag): New.
+ * bfd-in2.h: Regenerate.
+ * config.bfd: Add Meta.
+ * configure: Regenerate.
+ * configure.in: Add Meta.
+ * cpu-metag.c: New file.
+ * elf-bfd.h: Add Meta.
+ * elf32-metag.c: New file.
+ * elf32-metag.h: New file.
+ * libbfd.h: Regenerate.
+ * reloc.c: Add Meta relocations.
+ * targets.c: Add Meta.
+
+2013-01-08 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * elf-bfd.h (elfcore_write_aarch_tls): Add prototype.
+ (elfcore_write_aarch_hw_break): Likewise.
+ (elfcore_write_aarch_hw_watch): Likewise.
+ * elf.c (elfcore_grok_aarch_tls): New function.
+ (elfcore_grok_aarch_hw_break): Likewise.
+ (elfcore_grok_aarch_hw_watch): Likewise.
+ (elfcore_grok_note): Call the new functions to handle the
+ corresponding notes.
+ (elfcore_write_aarch_tls): New function.
+ (elfcore_write_aarch_hw_break): Likewise.
+ (elfcore_write_aarch_hw_watch): Likewise.
+ (elfcore_write_register_note): Call the new functions to handle the
+ corresponding pseudo sections.
+
+2013-01-07 Tom Tromey <tromey@redhat.com>
+
+ * section.c (_bfd_std_section): Rename from std_section.
+ (bfd_com_section_ptr, bfd_und_section_ptr, bfd_abs_section_ptr)
+ (STD_SECTION): Update.
+ * bfd-in2.h: Rebuild.
+
+2013-01-04 Juergen Urban <JuergenUrban@gmx.de>
+
+ * archures.c (bfd_mach_mips5900): Define.
+ * bfd-in2.h: Regenerate.
+ * config.bfd: Add mips64-ps2-elf and mips-ps2-elf targets.
+ * cpu-mips.c: Add support for MIPS r5900.
+ * elfxx-mips.c: Add support for MIPS r5900 (extension of r4000).
+
+2013-01-03 Nickolai Zeldovich <nickolai@csail.mit.edu>
+ Nick Clifton <nickc@redhat.com>
+
+ * elflink.c (get_value): Prevent the use of an undefined shift
+ operation. Add sanity checks.
+
+2013-01-02 Kaushik Phatak <kaushik.phatak@kpitcummins.com>
+
+ * config.bfd (cr16*-*-uclinux*): New target support.
+
+For older changes see ChangeLog-2012
+
+Copyright (C) 2013 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/binutils-2.25/bfd/ChangeLog-9495 b/binutils-2.25/bfd/ChangeLog-9495
index 1af501c1..beee5319 100644
--- a/binutils-2.25/bfd/ChangeLog-9495
+++ b/binutils-2.25/bfd/ChangeLog-9495
@@ -10035,7 +10035,7 @@ Sat Jan 1 10:18:54 1994 David J. Mackenzie (djm@thepub.cygnus.com)
For older changes see ChangeLog-9193
-Copyright (C) 1994, 1995 Free Software Foundation, Inc.
+Copyright (C) 1994-1995 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
diff --git a/binutils-2.25/bfd/ChangeLog-9697 b/binutils-2.25/bfd/ChangeLog-9697
index add810b1..8132840f 100644
--- a/binutils-2.25/bfd/ChangeLog-9697
+++ b/binutils-2.25/bfd/ChangeLog-9697
@@ -6721,7 +6721,7 @@ Tue Jan 2 13:10:25 1996 Ian Lance Taylor <ian@cygnus.com>
For older changes see ChangeLog-9495
-Copyright (C) 1996,1997 Free Software Foundation, Inc.
+Copyright (C) 1996-1997 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
diff --git a/binutils-2.25/bfd/ChangeLog-9899 b/binutils-2.25/bfd/ChangeLog-9899
index fdc2d892..b1d516c3 100644
--- a/binutils-2.25/bfd/ChangeLog-9899
+++ b/binutils-2.25/bfd/ChangeLog-9899
@@ -5591,7 +5591,7 @@ Wed Jan 14 16:03:11 1998 Richard Henderson <rth@cygnus.com>
For older changes see ChangeLog-9697
-Copyright (C) 1998,1999 Free Software Foundation, Inc.
+Copyright (C) 1998-1999 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
diff --git a/binutils-2.25/bfd/MAINTAINERS b/binutils-2.25/bfd/MAINTAINERS
index e7d8ff83..9ee4884b 100644
--- a/binutils-2.25/bfd/MAINTAINERS
+++ b/binutils-2.25/bfd/MAINTAINERS
@@ -1,6 +1,6 @@
See ../binutils/MAINTAINERS
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2012-2014 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
diff --git a/binutils-2.25/bfd/Makefile.am b/binutils-2.25/bfd/Makefile.am
index 6f0e4772..6f64f062 100644
--- a/binutils-2.25/bfd/Makefile.am
+++ b/binutils-2.25/bfd/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to generate Makefile.in
#
-# Copyright 2012 Free Software Foundation
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,9 +20,6 @@
AUTOMAKE_OPTIONS = 1.11 no-dist foreign
ACLOCAL_AMFLAGS = -I . -I .. -I ../config
-# Uncomment the following line when doing a release.
-# RELEASE=y
-
INCDIR = $(srcdir)/../include
CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
@@ -136,10 +133,10 @@ ALL_MACHINES = \
cpu-moxie.lo \
cpu-msp430.lo \
cpu-mt.lo \
+ cpu-nds32.lo \
cpu-nios2.lo \
cpu-ns32k.lo \
- cpu-openrisc.lo \
- cpu-or32.lo \
+ cpu-or1k.lo \
cpu-pdp11.lo \
cpu-pj.lo \
cpu-plugin.lo \
@@ -220,10 +217,10 @@ ALL_MACHINES_CFILES = \
cpu-moxie.c \
cpu-msp430.c \
cpu-mt.c \
+ cpu-nds32.c \
cpu-ns32k.c \
cpu-nios2.c \
- cpu-openrisc.c \
- cpu-or32.c \
+ cpu-or1k.c \
cpu-pdp11.c \
cpu-pj.c \
cpu-plugin.c \
@@ -282,7 +279,6 @@ BFD32_BACKENDS = \
coff-m68k.lo \
coff-m88k.lo \
coff-mips.lo \
- coff-or32.lo \
coff-rs6000.lo \
coff-sh.lo \
coff-sparc.lo \
@@ -349,9 +345,9 @@ BFD32_BACKENDS = \
elf32-moxie.lo \
elf32-msp430.lo \
elf32-mt.lo \
+ elf32-nds32.lo \
elf32-nios2.lo \
- elf32-openrisc.lo \
- elf32-or32.lo \
+ elf32-or1k.lo \
elf32-pj.lo \
elf32-ppc.lo \
elf32-rl78.lo \
@@ -470,7 +466,6 @@ BFD32_BACKENDS_CFILES = \
coff-m68k.c \
coff-m88k.c \
coff-mips.c \
- coff-or32.c \
coff-rs6000.c \
coff-sh.c \
coff-sparc.c \
@@ -537,9 +532,9 @@ BFD32_BACKENDS_CFILES = \
elf32-moxie.c \
elf32-msp430.c \
elf32-mt.c \
+ elf32-nds32.c \
elf32-nios2.c \
- elf32-openrisc.c \
- elf32-or32.c \
+ elf32-or1k.c \
elf32-pj.c \
elf32-ppc.c \
elf32-rl78.c \
@@ -737,15 +732,14 @@ OPTIONAL_BACKENDS_CFILES = \
sco5-core.c \
trad-core.c
-# We want to rerun configure if configure.in, config.bfd or
-# configure.host change. configure.in is needed since the version
-# number in Makefile comes from configure.in.
+# Reconfigure if config.bfd or configure.host changes.
+# development.sh is used to determine -Werror default.
CONFIG_STATUS_DEPENDENCIES = \
- $(srcdir)/configure.in \
$(srcdir)/config.bfd \
- $(srcdir)/configure.host
+ $(srcdir)/configure.host \
+ $(srcdir)/development.sh
-# These are defined by configure.in:
+# These are defined by configure:
WORDSIZE = @wordsize@
ALL_BACKENDS = @all_backends@
BFD_BACKENDS = @bfd_backends@
@@ -1028,14 +1022,15 @@ CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion
-bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in
+bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
@echo "creating $@"
@bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
bfd_version_string="\"$(VERSION)\"" ;\
bfd_soversion="$(VERSION)" ;\
bfd_version_package="\"$(PKGVERSION)\"" ;\
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
- if test "x$(RELEASE)" = x ; then \
+ . $(srcdir)/development.sh ;\
+ if test "$$development" = true ; then \
bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\
bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\
bfd_soversion="$(VERSION).$${bfd_version_date}" ;\
diff --git a/binutils-2.25/bfd/Makefile.in b/binutils-2.25/bfd/Makefile.in
index 8a38a765..2c385d57 100644
--- a/binutils-2.25/bfd/Makefile.in
+++ b/binutils-2.25/bfd/Makefile.in
@@ -16,7 +16,7 @@
@SET_MAKE@
#
-# Copyright 2012 Free Software Foundation
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -80,7 +80,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
$(top_srcdir)/bfd.m4 $(top_srcdir)/warning.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/zlib.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/version.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -337,9 +337,6 @@ top_srcdir = @top_srcdir@
wordsize = @wordsize@
AUTOMAKE_OPTIONS = 1.11 no-dist foreign
ACLOCAL_AMFLAGS = -I . -I .. -I ../config
-
-# Uncomment the following line when doing a release.
-# RELEASE=y
INCDIR = $(srcdir)/../include
CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
SUBDIRS = doc po
@@ -437,10 +434,10 @@ ALL_MACHINES = \
cpu-moxie.lo \
cpu-msp430.lo \
cpu-mt.lo \
+ cpu-nds32.lo \
cpu-nios2.lo \
cpu-ns32k.lo \
- cpu-openrisc.lo \
- cpu-or32.lo \
+ cpu-or1k.lo \
cpu-pdp11.lo \
cpu-pj.lo \
cpu-plugin.lo \
@@ -521,10 +518,10 @@ ALL_MACHINES_CFILES = \
cpu-moxie.c \
cpu-msp430.c \
cpu-mt.c \
+ cpu-nds32.c \
cpu-ns32k.c \
cpu-nios2.c \
- cpu-openrisc.c \
- cpu-or32.c \
+ cpu-or1k.c \
cpu-pdp11.c \
cpu-pj.c \
cpu-plugin.c \
@@ -584,7 +581,6 @@ BFD32_BACKENDS = \
coff-m68k.lo \
coff-m88k.lo \
coff-mips.lo \
- coff-or32.lo \
coff-rs6000.lo \
coff-sh.lo \
coff-sparc.lo \
@@ -651,9 +647,9 @@ BFD32_BACKENDS = \
elf32-moxie.lo \
elf32-msp430.lo \
elf32-mt.lo \
+ elf32-nds32.lo \
elf32-nios2.lo \
- elf32-openrisc.lo \
- elf32-or32.lo \
+ elf32-or1k.lo \
elf32-pj.lo \
elf32-ppc.lo \
elf32-rl78.lo \
@@ -772,7 +768,6 @@ BFD32_BACKENDS_CFILES = \
coff-m68k.c \
coff-m88k.c \
coff-mips.c \
- coff-or32.c \
coff-rs6000.c \
coff-sh.c \
coff-sparc.c \
@@ -839,9 +834,9 @@ BFD32_BACKENDS_CFILES = \
elf32-moxie.c \
elf32-msp430.c \
elf32-mt.c \
+ elf32-nds32.c \
elf32-nios2.c \
- elf32-openrisc.c \
- elf32-or32.c \
+ elf32-or1k.c \
elf32-pj.c \
elf32-ppc.c \
elf32-rl78.c \
@@ -1041,16 +1036,15 @@ OPTIONAL_BACKENDS_CFILES = \
trad-core.c
-# We want to rerun configure if configure.in, config.bfd or
-# configure.host change. configure.in is needed since the version
-# number in Makefile comes from configure.in.
+# Reconfigure if config.bfd or configure.host changes.
+# development.sh is used to determine -Werror default.
CONFIG_STATUS_DEPENDENCIES = \
- $(srcdir)/configure.in \
$(srcdir)/config.bfd \
- $(srcdir)/configure.host
+ $(srcdir)/configure.host \
+ $(srcdir)/development.sh
-# These are defined by configure.in:
+# These are defined by configure:
WORDSIZE = @wordsize@
ALL_BACKENDS = @all_backends@
BFD_BACKENDS = @bfd_backends@
@@ -1283,7 +1277,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-m68k.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-m88k.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-mips.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-or32.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-rs6000.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-sh.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-sparc.Plo@am__quote@
@@ -1352,10 +1345,10 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-moxie.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-msp430.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-mt.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-nds32.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-nios2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-ns32k.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-openrisc.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-or32.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-or1k.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-pdp11.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-pj.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-plugin.Plo@am__quote@
@@ -1442,9 +1435,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-moxie.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-msp430.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-mt.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-nds32.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-nios2.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-openrisc.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-or32.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-or1k.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-pj.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-ppc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-rl78.Plo@am__quote@
@@ -2089,14 +2082,15 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES)
$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
touch stmp-lcoff-h
-bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in
+bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
@echo "creating $@"
@bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
bfd_version_string="\"$(VERSION)\"" ;\
bfd_soversion="$(VERSION)" ;\
bfd_version_package="\"$(PKGVERSION)\"" ;\
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
- if test "x$(RELEASE)" = x ; then \
+ . $(srcdir)/development.sh ;\
+ if test "$$development" = true ; then \
bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\
bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\
bfd_soversion="$(VERSION).$${bfd_version_date}" ;\
diff --git a/binutils-2.25/bfd/PORTING b/binutils-2.25/bfd/PORTING
index b8205255..f4786b31 100644
--- a/binutils-2.25/bfd/PORTING
+++ b/binutils-2.25/bfd/PORTING
@@ -19,7 +19,7 @@ You need to create <target>.c and config/<target>.mt,
and add a case for it to a case statements in bfd/configure.host and
bfd/config.bfd, which associates each canonical host type with a BFD
host type (used as the base of the makefile fragment names), and to the
-table in bfd/configure.in which associates each target vector with
+table in bfd/configure.ac which associates each target vector with
the .o files it uses.
config/<target>.mt is a Makefile fragment.
@@ -29,7 +29,7 @@ SELECT_ARCHITECTURES=bfd_<cpu>_arch
See the list of cpu types in archures.c, or "ls cpu-*.c".
If your architecture is new, you need to add it to the tables
-in bfd/archures.c, opcodes/configure.in, and binutils/objdump.c.
+in bfd/archures.c, opcodes/configure.ac, and binutils/objdump.c.
For more information about .mt and .mh files, see config/README.
@@ -82,7 +82,7 @@ TARGETNAME
The name of the target, for run-time lookups.
Usually "a.out-<target>"
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2012-2014 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
diff --git a/binutils-2.25/bfd/README b/binutils-2.25/bfd/README
index 5ecfd298..09fc6c7e 100644
--- a/binutils-2.25/bfd/README
+++ b/binutils-2.25/bfd/README
@@ -48,7 +48,7 @@ gcc manual.
Bug reports without patches will be remembered, but they may never get
fixed until somebody volunteers to fix them.
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2012-2014 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
diff --git a/binutils-2.25/bfd/TODO b/binutils-2.25/bfd/TODO
index 012d6248..076588ac 100644
--- a/binutils-2.25/bfd/TODO
+++ b/binutils-2.25/bfd/TODO
@@ -20,7 +20,7 @@ Things that still need to be done: -*- Text -*-
o - upgrade the reloc handling as per Steve's suggestion.
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2012-2014 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
diff --git a/binutils-2.25/bfd/acinclude.m4 b/binutils-2.25/bfd/acinclude.m4
index 3518592a..31a4bf96 100644
--- a/binutils-2.25/bfd/acinclude.m4
+++ b/binutils-2.25/bfd/acinclude.m4
@@ -1,5 +1,5 @@
dnl
-dnl Copyright 2012 Free Software Foundation
+dnl Copyright (C) 2012-2014 Free Software Foundation, Inc.
dnl
dnl This file is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
diff --git a/binutils-2.25/bfd/aix386-core.c b/binutils-2.25/bfd/aix386-core.c
index 947ab803..d3e2080f 100644
--- a/binutils-2.25/bfd/aix386-core.c
+++ b/binutils-2.25/bfd/aix386-core.c
@@ -1,9 +1,7 @@
/* BFD back-end for AIX on PS/2 core files.
This was based on trad-core.c, which was written by John Gilmore of
Cygnus Support.
- Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1996, 1998, 1999, 2000,
- 2001, 2002, 2004, 2005, 2006, 2007, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1988-2014 Free Software Foundation, Inc.
Written by Minh Tran-Le <TRANLE@INTELLICORP.COM>.
Converted to back end form by Ian Lance Taylor <ian@cygnus.com>.
@@ -226,7 +224,7 @@ swap_abort (void)
#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
-const bfd_target aix386_core_vec =
+const bfd_target core_aix386_vec =
{
"aix386-core",
bfd_target_unknown_flavour,
diff --git a/binutils-2.25/bfd/aix5ppc-core.c b/binutils-2.25/bfd/aix5ppc-core.c
index 7b0695aa..82593ffa 100644
--- a/binutils-2.25/bfd/aix5ppc-core.c
+++ b/binutils-2.25/bfd/aix5ppc-core.c
@@ -1,6 +1,5 @@
/* IBM RS/6000 "XCOFF" back-end for BFD.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
Written by Tom Rix
Contributed by Red Hat Inc.
diff --git a/binutils-2.25/bfd/aout-adobe.c b/binutils-2.25/bfd/aout-adobe.c
index c8331d8c..cfdcc645 100644
--- a/binutils-2.25/bfd/aout-adobe.c
+++ b/binutils-2.25/bfd/aout-adobe.c
@@ -1,7 +1,5 @@
/* BFD back-end for a.out.adobe binaries.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support. Based on bout.c.
This file is part of BFD, the Binary File Descriptor library.
@@ -28,7 +26,7 @@
#include "libaout.h" /* BFD a.out internal data structures. */
/* Forward decl. */
-extern const bfd_target a_out_adobe_vec;
+extern const bfd_target aout_adobe_vec;
/* Swaps the information in an executable header taken from a raw byte
stream memory image, into the internal exec_header structure. */
@@ -218,7 +216,7 @@ aout_adobe_object_p (bfd *abfd)
if (N_BADMAG (anexec))
{
targ = getenv ("GNUTARGET");
- if (targ && !strcmp (targ, a_out_adobe_vec.name))
+ if (targ && !strcmp (targ, aout_adobe_vec.name))
/* Just continue anyway, if specifically set to this format. */
;
else
@@ -448,9 +446,10 @@ aout_adobe_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED,
/* Build the transfer vector for Adobe A.Out files. */
-#define aout_32_bfd_make_debug_symbol ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr)
-#define aout_32_bfd_reloc_type_lookup ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr)
-#define aout_32_bfd_reloc_name_lookup ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr)
+#define aout_32_find_line _bfd_nosymbols_find_line
+#define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define aout_32_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
+#define aout_32_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
#define aout_32_close_and_cleanup aout_32_bfd_free_cached_info
#define aout_32_set_arch_mach aout_adobe_set_arch_mach
#define aout_32_set_section_contents aout_adobe_set_section_contents
@@ -466,7 +465,6 @@ aout_adobe_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED,
#define aout_32_section_already_linked _bfd_generic_section_already_linked
#define aout_32_bfd_define_common_symbol bfd_generic_define_common_symbol
#define aout_32_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define aout_32_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define aout_32_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define aout_32_bfd_link_just_syms _bfd_generic_link_just_syms
#define aout_32_bfd_copy_link_hash_symbol_type \
@@ -474,7 +472,7 @@ aout_adobe_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED,
#define aout_32_bfd_final_link _bfd_generic_final_link
#define aout_32_bfd_link_split_section _bfd_generic_link_split_section
-const bfd_target a_out_adobe_vec =
+const bfd_target aout_adobe_vec =
{
"a.out.adobe", /* Name. */
bfd_target_aout_flavour,
diff --git a/binutils-2.25/bfd/aout-arm.c b/binutils-2.25/bfd/aout-arm.c
index 9eb94888..5f336ff5 100644
--- a/binutils-2.25/bfd/aout-arm.c
+++ b/binutils-2.25/bfd/aout-arm.c
@@ -1,6 +1,5 @@
/* BFD back-end for raw ARM a.out binaries.
- Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005,
- 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
This file is part of BFD, the Binary File Descriptor library.
@@ -43,14 +42,14 @@
#define SEGMENT_SIZE TARGET_PAGE_SIZE
#define DEFAULT_ARCH bfd_arch_arm
-#define MY(OP) CONCAT2 (aoutarm_,OP)
+#define MY(OP) CONCAT2 (arm_aout_,OP)
#define N_BADMAG(x) ((((x).a_info & ~007200) != ZMAGIC) && \
(((x).a_info & ~006000) != OMAGIC) && \
((x).a_info != NMAGIC))
#define N_MAGIC(x) ((x).a_info & ~07200)
-#define MY_bfd_reloc_type_lookup aoutarm_bfd_reloc_type_lookup
-#define MY_bfd_reloc_name_lookup aoutarm_bfd_reloc_name_lookup
+#define MY_bfd_reloc_type_lookup arm_aout_bfd_reloc_type_lookup
+#define MY_bfd_reloc_name_lookup arm_aout_bfd_reloc_name_lookup
#include "libaout.h"
#include "aout/aout64.h"
@@ -462,9 +461,9 @@ MY_swap_std_reloc_out (bfd *abfd,
#include "aout-target.h"
-extern const bfd_target aout_arm_big_vec;
+extern const bfd_target arm_aout_be_vec;
-const bfd_target aout_arm_little_vec =
+const bfd_target arm_aout_le_vec =
{
"a.out-arm-little", /* Name. */
bfd_target_aout_flavour,
@@ -501,12 +500,12 @@ const bfd_target aout_arm_little_vec =
BFD_JUMP_TABLE_LINK (MY),
BFD_JUMP_TABLE_DYNAMIC (MY),
- & aout_arm_big_vec,
+ & arm_aout_be_vec,
(void *) MY_backend_data,
};
-const bfd_target aout_arm_big_vec =
+const bfd_target arm_aout_be_vec =
{
"a.out-arm-big", /* Name. */
bfd_target_aout_flavour,
@@ -543,7 +542,7 @@ const bfd_target aout_arm_big_vec =
BFD_JUMP_TABLE_LINK (MY),
BFD_JUMP_TABLE_DYNAMIC (MY),
- & aout_arm_little_vec,
+ & arm_aout_le_vec,
(void *) MY_backend_data,
};
diff --git a/binutils-2.25/bfd/aout-cris.c b/binutils-2.25/bfd/aout-cris.c
index 3e3d21ad..01b7bcf0 100644
--- a/binutils-2.25/bfd/aout-cris.c
+++ b/binutils-2.25/bfd/aout-cris.c
@@ -1,6 +1,5 @@
/* BFD backend for CRIS a.out binaries.
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
Contributed by Axis Communications AB.
Written by Hans-Peter Nilsson.
diff --git a/binutils-2.25/bfd/aout-ns32k.c b/binutils-2.25/bfd/aout-ns32k.c
index 75886bca..b436b212 100644
--- a/binutils-2.25/bfd/aout-ns32k.c
+++ b/binutils-2.25/bfd/aout-ns32k.c
@@ -1,6 +1,5 @@
/* BFD back-end for ns32k a.out-ish binaries.
- Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
- 2002, 2003, 2005, 2006, 2007, 2010, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Contributed by Ian Dall (idall@eleceng.adelaide.edu.au).
This file is part of BFD, the Binary File Descriptor library.
@@ -28,7 +27,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MYNS(OP) CONCAT2 (ns32kaout_,OP)
+#define MYNS(OP) CONCAT2 (ns32k_aout_,OP)
reloc_howto_type * MYNS (bfd_reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
reloc_howto_type * MYNS (bfd_reloc_name_lookup) (bfd *, const char *);
diff --git a/binutils-2.25/bfd/aout-sparcle.c b/binutils-2.25/bfd/aout-sparcle.c
index e0504233..0d75a28c 100644
--- a/binutils-2.25/bfd/aout-sparcle.c
+++ b/binutils-2.25/bfd/aout-sparcle.c
@@ -1,5 +1,5 @@
/* BFD backend for sparc little-endian aout binaries.
- Copyright 1996, 2001, 2005, 2007, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -23,7 +23,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (sparcle_aout_,OP)
+#define MY(OP) CONCAT2 (sparc_aout_le_,OP)
#include "sysdep.h"
#include "bfd.h"
diff --git a/binutils-2.25/bfd/aout-target.h b/binutils-2.25/bfd/aout-target.h
index 1ffef871..3bca8b55 100644
--- a/binutils-2.25/bfd/aout-target.h
+++ b/binutils-2.25/bfd/aout-target.h
@@ -1,7 +1,5 @@
/* Define a target vector and some small routines for a variant of a.out.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -470,6 +468,9 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
#ifndef MY_find_nearest_line
#define MY_find_nearest_line NAME (aout, find_nearest_line)
#endif
+#ifndef MY_find_line
+#define MY_find_line _bfd_nosymbols_find_line
+#endif
#ifndef MY_find_inliner_info
#define MY_find_inliner_info _bfd_nosymbols_find_inliner_info
#endif
@@ -523,9 +524,6 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
#ifndef MY_bfd_link_hash_table_create
#define MY_bfd_link_hash_table_create NAME (aout, link_hash_table_create)
#endif
-#ifndef MY_bfd_link_hash_table_free
-#define MY_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
-#endif
#ifndef MY_bfd_link_add_symbols
#define MY_bfd_link_add_symbols NAME (aout, link_add_symbols)
#endif
diff --git a/binutils-2.25/bfd/aout-tic30.c b/binutils-2.25/bfd/aout-tic30.c
index d8ce9be3..e74464d5 100644
--- a/binutils-2.25/bfd/aout-tic30.c
+++ b/binutils-2.25/bfd/aout-tic30.c
@@ -1,7 +1,5 @@
/* BFD back-end for TMS320C30 a.out binaries.
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009,
- 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
This file is part of BFD, the Binary File Descriptor library.
@@ -928,6 +926,9 @@ tic30_aout_set_arch_mach (bfd *abfd,
#ifndef MY_find_nearest_line
#define MY_find_nearest_line NAME (aout, find_nearest_line)
#endif
+#ifndef MY_find_line
+#define MY_find_line _bfd_nosymbols_find_line
+#endif
#ifndef MY_find_inliner_info
#define MY_find_inliner_info _bfd_nosymbols_find_inliner_info
#endif
@@ -981,9 +982,6 @@ tic30_aout_set_arch_mach (bfd *abfd,
#ifndef MY_bfd_link_hash_table_create
#define MY_bfd_link_hash_table_create NAME (aout, link_hash_table_create)
#endif
-#ifndef MY_bfd_link_hash_table_free
-#define MY_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
-#endif
#ifndef MY_bfd_link_add_symbols
#define MY_bfd_link_add_symbols NAME (aout, link_add_symbols)
#endif
diff --git a/binutils-2.25/bfd/aout0.c b/binutils-2.25/bfd/aout0.c
index be73fa03..a0370e39 100644
--- a/binutils-2.25/bfd/aout0.c
+++ b/binutils-2.25/bfd/aout0.c
@@ -1,6 +1,5 @@
/* BFD backend for SunOS style a.out with flags set to 0
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2001, 2005, 2007, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -25,7 +24,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (aout0_big_,OP)
+#define MY(OP) CONCAT2 (aout0_be_,OP)
#include "sysdep.h"
#include "bfd.h"
diff --git a/binutils-2.25/bfd/aout32.c b/binutils-2.25/bfd/aout32.c
index 3ad1bd51..a6f6df3e 100644
--- a/binutils-2.25/bfd/aout32.c
+++ b/binutils-2.25/bfd/aout32.c
@@ -1,6 +1,5 @@
/* BFD back-end for 32-bit a.out files.
- Copyright 1990, 1991, 1992, 1993, 1994, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/aout64.c b/binutils-2.25/bfd/aout64.c
index 20687061..6474a76e 100644
--- a/binutils-2.25/bfd/aout64.c
+++ b/binutils-2.25/bfd/aout64.c
@@ -1,6 +1,5 @@
/* BFD back-end for 64-bit a.out files.
- Copyright 1990, 1991, 1992, 1994, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/aoutf1.h b/binutils-2.25/bfd/aoutf1.h
index 993a6370..63c16d97 100644
--- a/binutils-2.25/bfd/aoutf1.h
+++ b/binutils-2.25/bfd/aoutf1.h
@@ -1,7 +1,5 @@
/* A.out "format 1" file handling code for BFD.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/aoutx.h b/binutils-2.25/bfd/aoutx.h
index 1e0ad38f..9385a985 100644
--- a/binutils-2.25/bfd/aoutx.h
+++ b/binutils-2.25/bfd/aoutx.h
@@ -1,7 +1,5 @@
/* BFD semi-generic back-end for a.out binaries.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -68,12 +66,12 @@ DESCRIPTION
from @file{sunos.c}:
| #define TARGET_NAME "a.out-sunos-big"
-| #define VECNAME sunos_big_vec
+| #define VECNAME sparc_aout_sunos_be_vec
| #include "aoutf1.h"
requires all the names from @file{aout32.c}, and produces the jump vector
-| sunos_big_vec
+| sparc_aout_sunos_be_vec
The file @file{host-aout.c} is a special case. It is for a large set
of hosts that use ``more or less standard'' a.out files, and
@@ -103,7 +101,7 @@ DESCRIPTION
| TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec
| TDEPFILES= host-aout.o trad-core.o
- in the @file{config/@var{XXX}.mt} file, and modify @file{configure.in}
+ in the @file{config/@var{XXX}.mt} file, and modify @file{configure.ac}
to use the
@file{@var{XXX}.mt} file (by setting "<<bfd_target=XXX>>") when your
configuration is selected. */
@@ -793,9 +791,15 @@ NAME (aout, machine_type) (enum bfd_architecture arch,
case bfd_mach_mips16:
case bfd_mach_mipsisa32:
case bfd_mach_mipsisa32r2:
+ case bfd_mach_mipsisa32r3:
+ case bfd_mach_mipsisa32r5:
+ case bfd_mach_mipsisa32r6:
case bfd_mach_mips5:
case bfd_mach_mipsisa64:
case bfd_mach_mipsisa64r2:
+ case bfd_mach_mipsisa64r3:
+ case bfd_mach_mipsisa64r5:
+ case bfd_mach_mipsisa64r6:
case bfd_mach_mips_sb1:
case bfd_mach_mips_xlr:
/* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc. */
@@ -1296,14 +1300,14 @@ aout_get_external_symbols (bfd *abfd)
{
bfd_size_type count;
struct external_nlist *syms;
+ bfd_size_type amt = exec_hdr (abfd)->a_syms;
- count = exec_hdr (abfd)->a_syms / EXTERNAL_NLIST_SIZE;
+ count = amt / EXTERNAL_NLIST_SIZE;
if (count == 0)
return TRUE; /* Nothing to do. */
#ifdef USE_MMAP
- if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd),
- exec_hdr (abfd)->a_syms,
+ if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd), amt,
&obj_aout_sym_window (abfd), TRUE))
return FALSE;
syms = (struct external_nlist *) obj_aout_sym_window (abfd).data;
@@ -1311,20 +1315,16 @@ aout_get_external_symbols (bfd *abfd)
/* We allocate using malloc to make the values easy to free
later on. If we put them on the objalloc it might not be
possible to free them. */
- syms = (struct external_nlist *) bfd_malloc (count * EXTERNAL_NLIST_SIZE);
+ syms = (struct external_nlist *) bfd_malloc (amt);
if (syms == NULL)
return FALSE;
- {
- bfd_size_type amt;
- amt = exec_hdr (abfd)->a_syms;
- if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
- || bfd_bread (syms, amt, abfd) != amt)
- {
- free (syms);
- return FALSE;
- }
- }
+ if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
+ || bfd_bread (syms, amt, abfd) != amt)
+ {
+ free (syms);
+ return FALSE;
+ }
#endif
obj_aout_external_syms (abfd) = syms;
@@ -2636,12 +2636,13 @@ NAME (aout, minisymbol_to_symbol) (bfd *abfd,
bfd_boolean
NAME (aout, find_nearest_line) (bfd *abfd,
- asection *section,
asymbol **symbols,
+ asection *section,
bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr,
- unsigned int *line_ptr)
+ unsigned int *line_ptr,
+ unsigned int *disriminator_ptr)
{
/* Run down the file looking for the filename, function and linenumber. */
asymbol **p;
@@ -2659,6 +2660,8 @@ NAME (aout, find_nearest_line) (bfd *abfd,
*filename_ptr = abfd->filename;
*functionname_ptr = 0;
*line_ptr = 0;
+ if (disriminator_ptr)
+ *disriminator_ptr = 0;
if (symbols != NULL)
{
@@ -3402,6 +3405,8 @@ aout_link_check_ar_symbols (bfd *abfd,
static bfd_boolean
aout_link_check_archive_element (bfd *abfd,
struct bfd_link_info *info,
+ struct bfd_link_hash_entry *h ATTRIBUTE_UNUSED,
+ const char *name ATTRIBUTE_UNUSED,
bfd_boolean *pneeded)
{
bfd *oldbfd;
@@ -5307,7 +5312,7 @@ aout_link_input_bfd (struct aout_final_link_info *flaginfo, bfd *input_bfd)
/* Do the final link step. This is called on the output BFD. The
INFO structure should point to a list of BFDs linked through the
- link_next field which can be used to find each BFD which takes part
+ link.next field which can be used to find each BFD which takes part
in the output. Also, each section in ABFD should point to a list
of bfd_link_order structures which list all the input sections for
the output section. */
@@ -5354,7 +5359,7 @@ NAME (aout, final_link) (bfd *abfd,
max_contents_size = 0;
max_relocs_size = 0;
max_sym_count = 0;
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
bfd_size_type sz;
@@ -5493,7 +5498,7 @@ NAME (aout, final_link) (bfd *abfd,
We use the output_has_begun field of the input BFDs to see
whether we have already handled it. */
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
sub->output_has_begun = FALSE;
/* Mark all sections which are to be included in the link. This
diff --git a/binutils-2.25/bfd/archive.c b/binutils-2.25/bfd/archive.c
index 32b07a71..df37996d 100644
--- a/binutils-2.25/bfd/archive.c
+++ b/binutils-2.25/bfd/archive.c
@@ -1,5 +1,5 @@
/* BFD back-end for archive files (libraries).
- Copyright 1990-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault.
This file is part of BFD, the Binary File Descriptor library.
@@ -140,6 +140,7 @@ SUBSECTION
#include "safe-ctype.h"
#include "hashtab.h"
#include "filenames.h"
+#include "bfdlink.h"
#ifndef errno
extern int errno;
@@ -705,7 +706,7 @@ _bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos)
else
{
n_nfd->origin = n_nfd->proxy_origin;
- n_nfd->filename = filename;
+ n_nfd->filename = xstrdup (filename);
}
n_nfd->arelt_data = new_areldata;
@@ -1299,6 +1300,8 @@ _bfd_slurp_extended_name_table (bfd *abfd)
{
byebye:
free (namedata);
+ bfd_ardata (abfd)->extended_names = NULL;
+ bfd_ardata (abfd)->extended_names_size = 0;
return FALSE;
}
@@ -1315,11 +1318,12 @@ _bfd_slurp_extended_name_table (bfd *abfd)
text, the entries in the list are newline-padded, not null
padded. In SVR4-style archives, the names also have a
trailing '/'. DOS/NT created archive often have \ in them
- We'll fix all problems here.. */
+ We'll fix all problems here. */
{
char *ext_names = bfd_ardata (abfd)->extended_names;
char *temp = ext_names;
char *limit = temp + namedata->parsed_size;
+
for (; temp < limit; ++temp)
{
if (*temp == ARFMAG[1])
@@ -2356,6 +2360,10 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength)
map = new_map;
}
+ if (strcmp (syms[src_count]->name, "__gnu_lto_slim") == 0)
+ (*_bfd_error_handler)
+ (_("%s: plugin needed to handle lto object"),
+ bfd_get_filename (current));
namelen = strlen (syms[src_count]->name);
amt = sizeof (char *);
map[orl_count].name = (char **) bfd_alloc (arch, amt);
@@ -2751,5 +2759,8 @@ _bfd_archive_close_and_cleanup (bfd *abfd)
}
}
}
+ if (abfd->is_linker_output)
+ (*abfd->link.hash->hash_table_free) (abfd);
+
return TRUE;
}
diff --git a/binutils-2.25/bfd/archive64.c b/binutils-2.25/bfd/archive64.c
index be64e0d3..6b87ec52 100644
--- a/binutils-2.25/bfd/archive64.c
+++ b/binutils-2.25/bfd/archive64.c
@@ -1,5 +1,5 @@
/* Support for 64-bit ELF archives.
- Copyright 1996-2013 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Ian Lance Taylor, Cygnus Support
Linker support added by Mark Mitchell, CodeSourcery, LLC.
<mark@codesourcery.com>
diff --git a/binutils-2.25/bfd/archures.c b/binutils-2.25/bfd/archures.c
index 53962bfa..c9fd6c81 100644
--- a/binutils-2.25/bfd/archures.c
+++ b/binutils-2.25/bfd/archures.c
@@ -1,5 +1,5 @@
/* BFD library support routines for architectures.
- Copyright 1990-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Hacked by John Gilmore and Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -121,7 +121,9 @@ DESCRIPTION
.#define bfd_mach_i960_jx 7
.#define bfd_mach_i960_hx 8
.
-. bfd_arch_or32, {* OpenRISC 32 *}
+. bfd_arch_or1k, {* OpenRISC 1000 *}
+.#define bfd_mach_or1k 1
+.#define bfd_mach_or1knd 2
.
. bfd_arch_sparc, {* SPARC *}
.#define bfd_mach_sparc 1
@@ -180,8 +182,14 @@ DESCRIPTION
.#define bfd_mach_mips_xlr 887682 {* decimal 'XLR' *}
.#define bfd_mach_mipsisa32 32
.#define bfd_mach_mipsisa32r2 33
+.#define bfd_mach_mipsisa32r3 34
+.#define bfd_mach_mipsisa32r5 36
+.#define bfd_mach_mipsisa32r6 37
.#define bfd_mach_mipsisa64 64
.#define bfd_mach_mipsisa64r2 65
+.#define bfd_mach_mipsisa64r3 66
+.#define bfd_mach_mipsisa64r5 68
+.#define bfd_mach_mipsisa64r6 69
.#define bfd_mach_mips_micromips 96
. bfd_arch_i386, {* Intel 386 *}
.#define bfd_mach_i386_intel_syntax (1 << 0)
@@ -189,19 +197,19 @@ DESCRIPTION
.#define bfd_mach_i386_i386 (1 << 2)
.#define bfd_mach_x86_64 (1 << 3)
.#define bfd_mach_x64_32 (1 << 4)
-.#define bfd_mach_i386_nacl (1 << 5)
.#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
.#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
.#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
-.#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
-.#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
-.#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
. bfd_arch_l1om, {* Intel L1OM *}
.#define bfd_mach_l1om (1 << 5)
.#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
. bfd_arch_k1om, {* Intel K1OM *}
.#define bfd_mach_k1om (1 << 6)
.#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
+.#define bfd_mach_i386_nacl (1 << 7)
+.#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
+.#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
+.#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
. bfd_arch_we32k, {* AT&T WE32xxx *}
. bfd_arch_tahoe, {* CCI/Harris Tahoe *}
. bfd_arch_i860, {* Intel 860 *}
@@ -316,6 +324,12 @@ DESCRIPTION
.#define bfd_mach_arm_ep9312 11
.#define bfd_mach_arm_iWMMXt 12
.#define bfd_mach_arm_iWMMXt2 13
+. bfd_arch_nds32, {* Andes NDS32 *}
+.#define bfd_mach_n1 1
+.#define bfd_mach_n1h 2
+.#define bfd_mach_n1h_v2 3
+.#define bfd_mach_n1h_v3 4
+.#define bfd_mach_n1h_v3m 5
. bfd_arch_ns32k, {* National Semiconductors ns32000 *}
. bfd_arch_w65, {* WDC 65816 *}
. bfd_arch_tic30, {* Texas Instruments TMS320C30 *}
@@ -398,6 +412,7 @@ DESCRIPTION
.#define bfd_mach_avr5 5
.#define bfd_mach_avr51 51
.#define bfd_mach_avr6 6
+.#define bfd_mach_avrtiny 100
.#define bfd_mach_avrxmega1 101
.#define bfd_mach_avrxmega2 102
.#define bfd_mach_avrxmega3 103
@@ -427,7 +442,6 @@ DESCRIPTION
. bfd_arch_score, {* Sunplus score *}
.#define bfd_mach_score3 3
.#define bfd_mach_score7 7
-. bfd_arch_openrisc, {* OpenRISC *}
. bfd_arch_mmix, {* Donald Knuth's educational processor. *}
. bfd_arch_xstormy16,
.#define bfd_mach_xstormy16 1
@@ -574,10 +588,10 @@ extern const bfd_arch_info_type bfd_mn10300_arch;
extern const bfd_arch_info_type bfd_moxie_arch;
extern const bfd_arch_info_type bfd_msp430_arch;
extern const bfd_arch_info_type bfd_mt_arch;
+extern const bfd_arch_info_type bfd_nds32_arch;
extern const bfd_arch_info_type bfd_nios2_arch;
extern const bfd_arch_info_type bfd_ns32k_arch;
-extern const bfd_arch_info_type bfd_openrisc_arch;
-extern const bfd_arch_info_type bfd_or32_arch;
+extern const bfd_arch_info_type bfd_or1k_arch;
extern const bfd_arch_info_type bfd_pdp11_arch;
extern const bfd_arch_info_type bfd_pj_arch;
extern const bfd_arch_info_type bfd_plugin_arch;
@@ -663,10 +677,10 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
&bfd_moxie_arch,
&bfd_msp430_arch,
&bfd_mt_arch,
+ &bfd_nds32_arch,
&bfd_nios2_arch,
&bfd_ns32k_arch,
- &bfd_openrisc_arch,
- &bfd_or32_arch,
+ &bfd_or1k_arch,
&bfd_pdp11_arch,
&bfd_powerpc_arch,
&bfd_rs6000_arch,
diff --git a/binutils-2.25/bfd/armnetbsd.c b/binutils-2.25/bfd/armnetbsd.c
index b51332e9..05b76359 100644
--- a/binutils-2.25/bfd/armnetbsd.c
+++ b/binutils-2.25/bfd/armnetbsd.c
@@ -1,6 +1,5 @@
/* BFD back-end for NetBSD/ARM a.out-ish binaries.
- Copyright 1999, 2000, 2001, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -32,7 +31,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (armnetbsd_, OP)
+#define MY(OP) CONCAT2 (arm_aout_nbsd_, OP)
/* This needs to start with a.out so GDB knows it is an a.out variant. */
#define TARGETNAME "a.out-arm-netbsd"
diff --git a/binutils-2.25/bfd/bfd-in.h b/binutils-2.25/bfd/bfd-in.h
index 3afd71b9..1f80a76b 100644
--- a/binutils-2.25/bfd/bfd-in.h
+++ b/binutils-2.25/bfd/bfd-in.h
@@ -1,6 +1,6 @@
/* Main header file for the bfd library -- portable access to object files.
- Copyright 1990-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Contributed by Cygnus Support.
@@ -292,9 +292,6 @@ typedef struct bfd_section *sec_ptr;
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
/* Find the address one past the end of SEC. */
#define bfd_get_section_limit(bfd, sec) \
(((bfd)->direction != write_direction && (sec)->rawsize != 0 \
@@ -517,8 +514,6 @@ extern void warn_deprecated (const char *, const char *, int, const char *);
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
-
extern bfd_boolean bfd_cache_close
(bfd *abfd);
/* NB: This declaration should match the autogenerated one in libbfd.h. */
@@ -663,7 +658,7 @@ extern int bfd_elf_get_dyn_lib_class
(bfd *);
extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
(bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_elf_discard_info
+extern int bfd_elf_discard_info
(bfd *, struct bfd_link_info *);
extern unsigned int _bfd_elf_default_action_discarded
(struct bfd_section *);
@@ -685,19 +680,21 @@ extern int bfd_get_elf_phdrs
(bfd *abfd, void *phdrs);
/* Create a new BFD as if by bfd_openr. Rather than opening a file,
- reconstruct an ELF file by reading the segments out of remote memory
- based on the ELF file header at EHDR_VMA and the ELF program headers it
- points to. If not null, *LOADBASEP is filled in with the difference
- between the VMAs from which the segments were read, and the VMAs the
- file headers (and hence BFD's idea of each section's VMA) put them at.
-
- The function TARGET_READ_MEMORY is called to copy LEN bytes from the
- remote memory at target address VMA into the local buffer at MYADDR; it
- should return zero on success or an `errno' code on failure. TEMPL must
- be a BFD for an ELF target with the word size and byte order found in
- the remote memory. */
+ reconstruct an ELF file by reading the segments out of remote
+ memory based on the ELF file header at EHDR_VMA and the ELF program
+ headers it points to. If non-zero, SIZE is the known extent of the
+ object. If not null, *LOADBASEP is filled in with the difference
+ between the VMAs from which the segments were read, and the VMAs
+ the file headers (and hence BFD's idea of each section's VMA) put
+ them at.
+
+ The function TARGET_READ_MEMORY is called to copy LEN bytes from
+ the remote memory at target address VMA into the local buffer at
+ MYADDR; it should return zero on success or an `errno' code on
+ failure. TEMPL must be a BFD for a target with the word size and
+ byte order found in the remote memory. */
extern bfd *bfd_elf_bfd_from_remote_memory
- (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
+ (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
bfd_size_type len));
@@ -882,15 +879,19 @@ extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
(bfd *, struct bfd_link_info *);
-/* ELF ARM mapping symbol support */
+/* ELF ARM mapping symbol support. */
#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
+
extern bfd_boolean bfd_is_arm_special_symbol_name
- (const char * name, int type);
+ (const char *, int);
+
+extern void bfd_elf32_arm_set_byteswap_code
+ (struct bfd_link_info *, int);
-extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int);
+extern void bfd_elf32_arm_use_long_plt (void);
/* ARM Note section processing. */
extern bfd_boolean bfd_arm_merge_machines
@@ -936,10 +937,10 @@ extern void bfd_elf32_aarch64_init_maps
(bfd *);
extern void bfd_elf64_aarch64_set_options
- (bfd *, struct bfd_link_info *, int, int, int);
+ (bfd *, struct bfd_link_info *, int, int, int, int);
extern void bfd_elf32_aarch64_set_options
- (bfd *, struct bfd_link_info *, int, int, int);
+ (bfd *, struct bfd_link_info *, int, int, int, int);
/* ELF AArch64 mapping symbol support. */
#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0)
diff --git a/binutils-2.25/bfd/bfd-in2.h b/binutils-2.25/bfd/bfd-in2.h
index 810e1729..c7a2bb52 100644
--- a/binutils-2.25/bfd/bfd-in2.h
+++ b/binutils-2.25/bfd/bfd-in2.h
@@ -7,7 +7,7 @@
/* Main header file for the bfd library -- portable access to object files.
- Copyright 1990-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Contributed by Cygnus Support.
@@ -299,9 +299,6 @@ typedef struct bfd_section *sec_ptr;
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
/* Find the address one past the end of SEC. */
#define bfd_get_section_limit(bfd, sec) \
(((bfd)->direction != write_direction && (sec)->rawsize != 0 \
@@ -524,8 +521,6 @@ extern void warn_deprecated (const char *, const char *, int, const char *);
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
-
extern bfd_boolean bfd_cache_close
(bfd *abfd);
/* NB: This declaration should match the autogenerated one in libbfd.h. */
@@ -670,7 +665,7 @@ extern int bfd_elf_get_dyn_lib_class
(bfd *);
extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
(bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_elf_discard_info
+extern int bfd_elf_discard_info
(bfd *, struct bfd_link_info *);
extern unsigned int _bfd_elf_default_action_discarded
(struct bfd_section *);
@@ -692,19 +687,21 @@ extern int bfd_get_elf_phdrs
(bfd *abfd, void *phdrs);
/* Create a new BFD as if by bfd_openr. Rather than opening a file,
- reconstruct an ELF file by reading the segments out of remote memory
- based on the ELF file header at EHDR_VMA and the ELF program headers it
- points to. If not null, *LOADBASEP is filled in with the difference
- between the VMAs from which the segments were read, and the VMAs the
- file headers (and hence BFD's idea of each section's VMA) put them at.
-
- The function TARGET_READ_MEMORY is called to copy LEN bytes from the
- remote memory at target address VMA into the local buffer at MYADDR; it
- should return zero on success or an `errno' code on failure. TEMPL must
- be a BFD for an ELF target with the word size and byte order found in
- the remote memory. */
+ reconstruct an ELF file by reading the segments out of remote
+ memory based on the ELF file header at EHDR_VMA and the ELF program
+ headers it points to. If non-zero, SIZE is the known extent of the
+ object. If not null, *LOADBASEP is filled in with the difference
+ between the VMAs from which the segments were read, and the VMAs
+ the file headers (and hence BFD's idea of each section's VMA) put
+ them at.
+
+ The function TARGET_READ_MEMORY is called to copy LEN bytes from
+ the remote memory at target address VMA into the local buffer at
+ MYADDR; it should return zero on success or an `errno' code on
+ failure. TEMPL must be a BFD for a target with the word size and
+ byte order found in the remote memory. */
extern bfd *bfd_elf_bfd_from_remote_memory
- (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
+ (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
bfd_size_type len));
@@ -889,15 +886,19 @@ extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
(bfd *, struct bfd_link_info *);
-/* ELF ARM mapping symbol support */
+/* ELF ARM mapping symbol support. */
#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
+
extern bfd_boolean bfd_is_arm_special_symbol_name
- (const char * name, int type);
+ (const char *, int);
-extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int);
+extern void bfd_elf32_arm_set_byteswap_code
+ (struct bfd_link_info *, int);
+
+extern void bfd_elf32_arm_use_long_plt (void);
/* ARM Note section processing. */
extern bfd_boolean bfd_arm_merge_machines
@@ -943,10 +944,10 @@ extern void bfd_elf32_aarch64_init_maps
(bfd *);
extern void bfd_elf64_aarch64_set_options
- (bfd *, struct bfd_link_info *, int, int, int);
+ (bfd *, struct bfd_link_info *, int, int, int, int);
extern void bfd_elf32_aarch64_set_options
- (bfd *, struct bfd_link_info *, int, int, int);
+ (bfd *, struct bfd_link_info *, int, int, int, int);
/* ELF AArch64 mapping symbol support. */
#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0)
@@ -1021,6 +1022,7 @@ extern struct coff_comdat_info * bfd_coff_get_comdat_section
void bfd_init (void);
/* Extracted from opncls.c. */
+/* Set to N to open the next N BFDs using an alternate id space. */
extern unsigned int bfd_use_reserved_id;
bfd *bfd_fopen (const char *filename, const char *target,
const char *mode, int fd);
@@ -1029,7 +1031,7 @@ bfd *bfd_openr (const char *filename, const char *target);
bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
-bfd *bfd_openstreamr (const char *, const char *, void *);
+bfd *bfd_openstreamr (const char * filename, const char * target, void * stream);
bfd *bfd_openr_iovec (const char *filename, const char *target,
void *(*open_func) (struct bfd *nbfd,
@@ -1205,6 +1207,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
/* Extracted from bfdwin.c. */
/* Extracted from section.c. */
+
typedef struct bfd_section
{
/* The name of the section; the name isn't a copy, the pointer is
@@ -1442,6 +1445,7 @@ typedef struct bfd_section
#define SEC_INFO_TYPE_MERGE 2
#define SEC_INFO_TYPE_EH_FRAME 3
#define SEC_INFO_TYPE_JUST_SYMS 4
+#define SEC_INFO_TYPE_TARGET 5
/* Nonzero if this section uses RELA relocations, rather than REL. */
unsigned int use_rela_p:1;
@@ -1596,6 +1600,32 @@ struct relax_table {
int size;
};
+/* Note: the following are provided as inline functions rather than macros
+ because not all callers use the return value. A macro implementation
+ would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
+ compilers will complain about comma expressions that have no effect. */
+static inline bfd_boolean
+bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val)
+{
+ ptr->userdata = val;
+ return TRUE;
+}
+
+static inline bfd_boolean
+bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
+{
+ ptr->vma = ptr->lma = val;
+ ptr->user_set_vma = TRUE;
+ return TRUE;
+}
+
+static inline bfd_boolean
+bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val)
+{
+ ptr->alignment_power = val;
+ return TRUE;
+}
+
/* These sections are global, and are managed by BFD. The application
and target back end are not permitted to change the values in
these sections. */
@@ -1878,7 +1908,9 @@ enum bfd_architecture
#define bfd_mach_i960_jx 7
#define bfd_mach_i960_hx 8
- bfd_arch_or32, /* OpenRISC 32 */
+ bfd_arch_or1k, /* OpenRISC 1000 */
+#define bfd_mach_or1k 1
+#define bfd_mach_or1knd 2
bfd_arch_sparc, /* SPARC */
#define bfd_mach_sparc 1
@@ -1937,8 +1969,14 @@ enum bfd_architecture
#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */
#define bfd_mach_mipsisa32 32
#define bfd_mach_mipsisa32r2 33
+#define bfd_mach_mipsisa32r3 34
+#define bfd_mach_mipsisa32r5 36
+#define bfd_mach_mipsisa32r6 37
#define bfd_mach_mipsisa64 64
#define bfd_mach_mipsisa64r2 65
+#define bfd_mach_mipsisa64r3 66
+#define bfd_mach_mipsisa64r5 68
+#define bfd_mach_mipsisa64r6 69
#define bfd_mach_mips_micromips 96
bfd_arch_i386, /* Intel 386 */
#define bfd_mach_i386_intel_syntax (1 << 0)
@@ -1946,19 +1984,19 @@ enum bfd_architecture
#define bfd_mach_i386_i386 (1 << 2)
#define bfd_mach_x86_64 (1 << 3)
#define bfd_mach_x64_32 (1 << 4)
-#define bfd_mach_i386_nacl (1 << 5)
#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
-#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
-#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
-#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
bfd_arch_l1om, /* Intel L1OM */
#define bfd_mach_l1om (1 << 5)
#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
bfd_arch_k1om, /* Intel K1OM */
#define bfd_mach_k1om (1 << 6)
#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
+#define bfd_mach_i386_nacl (1 << 7)
+#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
+#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
+#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
bfd_arch_we32k, /* AT&T WE32xxx */
bfd_arch_tahoe, /* CCI/Harris Tahoe */
bfd_arch_i860, /* Intel 860 */
@@ -2073,6 +2111,12 @@ enum bfd_architecture
#define bfd_mach_arm_ep9312 11
#define bfd_mach_arm_iWMMXt 12
#define bfd_mach_arm_iWMMXt2 13
+ bfd_arch_nds32, /* Andes NDS32 */
+#define bfd_mach_n1 1
+#define bfd_mach_n1h 2
+#define bfd_mach_n1h_v2 3
+#define bfd_mach_n1h_v3 4
+#define bfd_mach_n1h_v3m 5
bfd_arch_ns32k, /* National Semiconductors ns32000 */
bfd_arch_w65, /* WDC 65816 */
bfd_arch_tic30, /* Texas Instruments TMS320C30 */
@@ -2155,6 +2199,7 @@ enum bfd_architecture
#define bfd_mach_avr5 5
#define bfd_mach_avr51 51
#define bfd_mach_avr6 6
+#define bfd_mach_avrtiny 100
#define bfd_mach_avrxmega1 101
#define bfd_mach_avrxmega2 102
#define bfd_mach_avrxmega3 103
@@ -2184,7 +2229,6 @@ enum bfd_architecture
bfd_arch_score, /* Sunplus score */
#define bfd_mach_score3 3
#define bfd_mach_score7 7
- bfd_arch_openrisc, /* OpenRISC */
bfd_arch_mmix, /* Donald Knuth's educational processor. */
bfd_arch_xstormy16,
#define bfd_mach_xstormy16 1
@@ -2304,6 +2348,7 @@ unsigned int bfd_arch_mach_octets_per_byte
(enum bfd_architecture arch, unsigned long machine);
/* Extracted from reloc.c. */
+
typedef enum bfd_reloc_status
{
/* No errors detected. */
@@ -2353,6 +2398,7 @@ typedef struct reloc_cache_entry
}
arelent;
+
enum complain_overflow
{
/* Do not complain on overflow. */
@@ -2371,6 +2417,7 @@ enum complain_overflow
unsigned number. */
complain_overflow_unsigned
};
+struct bfd_symbol; /* Forward declaration. */
struct reloc_howto_struct
{
@@ -2898,6 +2945,12 @@ to compensate for the borrow when the low bits are added. */
BFD_RELOC_MICROMIPS_10_PCREL_S1,
BFD_RELOC_MICROMIPS_16_PCREL_S1,
+/* MIPS PC-relative relocations. */
+ BFD_RELOC_MIPS_21_PCREL_S2,
+ BFD_RELOC_MIPS_26_PCREL_S2,
+ BFD_RELOC_MIPS_18_PCREL_S3,
+ BFD_RELOC_MIPS_19_PCREL_S2,
+
/* microMIPS versions of generic BFD relocs. */
BFD_RELOC_MICROMIPS_GPREL16,
BFD_RELOC_MICROMIPS_HI16,
@@ -3125,6 +3178,8 @@ instruction. */
BFD_RELOC_X86_64_TLSDESC_CALL,
BFD_RELOC_X86_64_TLSDESC,
BFD_RELOC_X86_64_IRELATIVE,
+ BFD_RELOC_X86_64_PC32_BND,
+ BFD_RELOC_X86_64_PLT32_BND,
/* ns32k relocations */
BFD_RELOC_NS32K_IMM_8,
@@ -3223,6 +3278,9 @@ instruction. */
BFD_RELOC_PPC64_TOC16_LO_DS,
BFD_RELOC_PPC64_PLTGOT16_DS,
BFD_RELOC_PPC64_PLTGOT16_LO_DS,
+ BFD_RELOC_PPC64_ADDR16_HIGH,
+ BFD_RELOC_PPC64_ADDR16_HIGHA,
+ BFD_RELOC_PPC64_ADDR64_LOCAL,
/* PowerPC and PowerPC64 thread-local storage relocations. */
BFD_RELOC_PPC_TLS,
@@ -3267,6 +3325,10 @@ instruction. */
BFD_RELOC_PPC64_DTPREL16_HIGHERA,
BFD_RELOC_PPC64_DTPREL16_HIGHEST,
BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
+ BFD_RELOC_PPC64_TPREL16_HIGH,
+ BFD_RELOC_PPC64_TPREL16_HIGHA,
+ BFD_RELOC_PPC64_DTPREL16_HIGH,
+ BFD_RELOC_PPC64_DTPREL16_HIGHA,
/* IBM 370/390 relocations */
BFD_RELOC_I370_D12,
@@ -3788,6 +3850,205 @@ add3, load, and store instructions. */
BFD_RELOC_M32R_GOTPC_HI_SLO,
BFD_RELOC_M32R_GOTPC_LO,
+/* NDS32 relocs.
+This is a 20 bit absolute address. */
+ BFD_RELOC_NDS32_20,
+
+/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
+ BFD_RELOC_NDS32_9_PCREL,
+
+/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */
+ BFD_RELOC_NDS32_WORD_9_PCREL,
+
+/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */
+ BFD_RELOC_NDS32_15_PCREL,
+
+/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */
+ BFD_RELOC_NDS32_17_PCREL,
+
+/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */
+ BFD_RELOC_NDS32_25_PCREL,
+
+/* This is a 20-bit reloc containing the high 20 bits of an address
+used with the lower 12 bits */
+ BFD_RELOC_NDS32_HI20,
+
+/* This is a 12-bit reloc containing the lower 12 bits of an address
+then shift right by 3. This is used with ldi,sdi... */
+ BFD_RELOC_NDS32_LO12S3,
+
+/* This is a 12-bit reloc containing the lower 12 bits of an address
+then shift left by 2. This is used with lwi,swi... */
+ BFD_RELOC_NDS32_LO12S2,
+
+/* This is a 12-bit reloc containing the lower 12 bits of an address
+then shift left by 1. This is used with lhi,shi... */
+ BFD_RELOC_NDS32_LO12S1,
+
+/* This is a 12-bit reloc containing the lower 12 bits of an address
+then shift left by 0. This is used with lbisbi... */
+ BFD_RELOC_NDS32_LO12S0,
+
+/* This is a 12-bit reloc containing the lower 12 bits of an address
+then shift left by 0. This is only used with branch relaxations */
+ BFD_RELOC_NDS32_LO12S0_ORI,
+
+/* This is a 15-bit reloc containing the small data area 18-bit signed offset
+and shift left by 3 for use in ldi, sdi... */
+ BFD_RELOC_NDS32_SDA15S3,
+
+/* This is a 15-bit reloc containing the small data area 17-bit signed offset
+and shift left by 2 for use in lwi, swi... */
+ BFD_RELOC_NDS32_SDA15S2,
+
+/* This is a 15-bit reloc containing the small data area 16-bit signed offset
+and shift left by 1 for use in lhi, shi... */
+ BFD_RELOC_NDS32_SDA15S1,
+
+/* This is a 15-bit reloc containing the small data area 15-bit signed offset
+and shift left by 0 for use in lbi, sbi... */
+ BFD_RELOC_NDS32_SDA15S0,
+
+/* This is a 16-bit reloc containing the small data area 16-bit signed offset
+and shift left by 3 */
+ BFD_RELOC_NDS32_SDA16S3,
+
+/* This is a 17-bit reloc containing the small data area 17-bit signed offset
+and shift left by 2 for use in lwi.gp, swi.gp... */
+ BFD_RELOC_NDS32_SDA17S2,
+
+/* This is a 18-bit reloc containing the small data area 18-bit signed offset
+and shift left by 1 for use in lhi.gp, shi.gp... */
+ BFD_RELOC_NDS32_SDA18S1,
+
+/* This is a 19-bit reloc containing the small data area 19-bit signed offset
+and shift left by 0 for use in lbi.gp, sbi.gp... */
+ BFD_RELOC_NDS32_SDA19S0,
+
+/* for PIC */
+ BFD_RELOC_NDS32_GOT20,
+ BFD_RELOC_NDS32_9_PLTREL,
+ BFD_RELOC_NDS32_25_PLTREL,
+ BFD_RELOC_NDS32_COPY,
+ BFD_RELOC_NDS32_GLOB_DAT,
+ BFD_RELOC_NDS32_JMP_SLOT,
+ BFD_RELOC_NDS32_RELATIVE,
+ BFD_RELOC_NDS32_GOTOFF,
+ BFD_RELOC_NDS32_GOTOFF_HI20,
+ BFD_RELOC_NDS32_GOTOFF_LO12,
+ BFD_RELOC_NDS32_GOTPC20,
+ BFD_RELOC_NDS32_GOT_HI20,
+ BFD_RELOC_NDS32_GOT_LO12,
+ BFD_RELOC_NDS32_GOTPC_HI20,
+ BFD_RELOC_NDS32_GOTPC_LO12,
+
+/* for relax */
+ BFD_RELOC_NDS32_INSN16,
+ BFD_RELOC_NDS32_LABEL,
+ BFD_RELOC_NDS32_LONGCALL1,
+ BFD_RELOC_NDS32_LONGCALL2,
+ BFD_RELOC_NDS32_LONGCALL3,
+ BFD_RELOC_NDS32_LONGJUMP1,
+ BFD_RELOC_NDS32_LONGJUMP2,
+ BFD_RELOC_NDS32_LONGJUMP3,
+ BFD_RELOC_NDS32_LOADSTORE,
+ BFD_RELOC_NDS32_9_FIXED,
+ BFD_RELOC_NDS32_15_FIXED,
+ BFD_RELOC_NDS32_17_FIXED,
+ BFD_RELOC_NDS32_25_FIXED,
+ BFD_RELOC_NDS32_LONGCALL4,
+ BFD_RELOC_NDS32_LONGCALL5,
+ BFD_RELOC_NDS32_LONGCALL6,
+ BFD_RELOC_NDS32_LONGJUMP4,
+ BFD_RELOC_NDS32_LONGJUMP5,
+ BFD_RELOC_NDS32_LONGJUMP6,
+ BFD_RELOC_NDS32_LONGJUMP7,
+
+/* for PIC */
+ BFD_RELOC_NDS32_PLTREL_HI20,
+ BFD_RELOC_NDS32_PLTREL_LO12,
+ BFD_RELOC_NDS32_PLT_GOTREL_HI20,
+ BFD_RELOC_NDS32_PLT_GOTREL_LO12,
+
+/* for floating point */
+ BFD_RELOC_NDS32_SDA12S2_DP,
+ BFD_RELOC_NDS32_SDA12S2_SP,
+ BFD_RELOC_NDS32_LO12S2_DP,
+ BFD_RELOC_NDS32_LO12S2_SP,
+
+/* for dwarf2 debug_line. */
+ BFD_RELOC_NDS32_DWARF2_OP1,
+ BFD_RELOC_NDS32_DWARF2_OP2,
+ BFD_RELOC_NDS32_DWARF2_LEB,
+
+/* for eliminate 16-bit instructions */
+ BFD_RELOC_NDS32_UPDATE_TA,
+
+/* for PIC object relaxation */
+ BFD_RELOC_NDS32_PLT_GOTREL_LO20,
+ BFD_RELOC_NDS32_PLT_GOTREL_LO15,
+ BFD_RELOC_NDS32_PLT_GOTREL_LO19,
+ BFD_RELOC_NDS32_GOT_LO15,
+ BFD_RELOC_NDS32_GOT_LO19,
+ BFD_RELOC_NDS32_GOTOFF_LO15,
+ BFD_RELOC_NDS32_GOTOFF_LO19,
+ BFD_RELOC_NDS32_GOT15S2,
+ BFD_RELOC_NDS32_GOT17S2,
+
+/* NDS32 relocs.
+This is a 5 bit absolute address. */
+ BFD_RELOC_NDS32_5,
+
+/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */
+ BFD_RELOC_NDS32_10_UPCREL,
+
+/* If fp were omitted, fp can used as another gp. */
+ BFD_RELOC_NDS32_SDA_FP7U2_RELA,
+
+/* relaxation relative relocation types */
+ BFD_RELOC_NDS32_RELAX_ENTRY,
+ BFD_RELOC_NDS32_GOT_SUFF,
+ BFD_RELOC_NDS32_GOTOFF_SUFF,
+ BFD_RELOC_NDS32_PLT_GOT_SUFF,
+ BFD_RELOC_NDS32_MULCALL_SUFF,
+ BFD_RELOC_NDS32_PTR,
+ BFD_RELOC_NDS32_PTR_COUNT,
+ BFD_RELOC_NDS32_PTR_RESOLVED,
+ BFD_RELOC_NDS32_PLTBLOCK,
+ BFD_RELOC_NDS32_RELAX_REGION_BEGIN,
+ BFD_RELOC_NDS32_RELAX_REGION_END,
+ BFD_RELOC_NDS32_MINUEND,
+ BFD_RELOC_NDS32_SUBTRAHEND,
+ BFD_RELOC_NDS32_DIFF8,
+ BFD_RELOC_NDS32_DIFF16,
+ BFD_RELOC_NDS32_DIFF32,
+ BFD_RELOC_NDS32_DIFF_ULEB128,
+ BFD_RELOC_NDS32_EMPTY,
+
+/* This is a 25 bit absolute address. */
+ BFD_RELOC_NDS32_25_ABS,
+
+/* For ex9 and ifc using. */
+ BFD_RELOC_NDS32_DATA,
+ BFD_RELOC_NDS32_TRAN,
+ BFD_RELOC_NDS32_17IFC_PCREL,
+ BFD_RELOC_NDS32_10IFCU_PCREL,
+
+/* For TLS. */
+ BFD_RELOC_NDS32_TPOFF,
+ BFD_RELOC_NDS32_TLS_LE_HI20,
+ BFD_RELOC_NDS32_TLS_LE_LO12,
+ BFD_RELOC_NDS32_TLS_LE_ADD,
+ BFD_RELOC_NDS32_TLS_LE_LS,
+ BFD_RELOC_NDS32_GOTTPOFF,
+ BFD_RELOC_NDS32_TLS_IE_HI20,
+ BFD_RELOC_NDS32_TLS_IE_LO12S2,
+ BFD_RELOC_NDS32_TLS_TPOFF,
+ BFD_RELOC_NDS32_TLS_LE_20,
+ BFD_RELOC_NDS32_TLS_LE_15S0,
+ BFD_RELOC_NDS32_TLS_LE_15S1,
+ BFD_RELOC_NDS32_TLS_LE_15S2,
+
/* This is a 9-bit reloc */
BFD_RELOC_V850_9_PCREL,
@@ -4245,6 +4506,28 @@ in .byte hi8(symbol) */
in .byte hlo8(symbol) */
BFD_RELOC_AVR_8_HLO,
+/* AVR relocations to mark the difference of two local symbols.
+These are only needed to support linker relaxation and can be ignored
+when not relaxing. The field is set to the value of the difference
+assuming no relaxation. The relocation encodes the position of the
+second symbol so the linker can determine whether to adjust the field
+value. */
+ BFD_RELOC_AVR_DIFF8,
+ BFD_RELOC_AVR_DIFF16,
+ BFD_RELOC_AVR_DIFF32,
+
+/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
+lds and sts instructions supported only tiny core. */
+ BFD_RELOC_AVR_LDS_STS_16,
+
+/* This is a 6 bit reloc for the AVR that stores an I/O register
+number for the IN and OUT instructions */
+ BFD_RELOC_AVR_PORT6,
+
+/* This is a 5 bit reloc for the AVR that stores an I/O register
+number for the SBIC, SBIS, SBI and CBI instructions */
+ BFD_RELOC_AVR_PORT5,
+
/* Renesas RL78 Relocations. */
BFD_RELOC_RL78_NEG8,
BFD_RELOC_RL78_NEG16,
@@ -4908,9 +5191,31 @@ a matching LO8XG part. */
BFD_RELOC_860_HIGOT,
BFD_RELOC_860_HIGOTOFF,
-/* OpenRISC Relocations. */
- BFD_RELOC_OPENRISC_ABS_26,
- BFD_RELOC_OPENRISC_REL_26,
+/* OpenRISC 1000 Relocations. */
+ BFD_RELOC_OR1K_REL_26,
+ BFD_RELOC_OR1K_GOTPC_HI16,
+ BFD_RELOC_OR1K_GOTPC_LO16,
+ BFD_RELOC_OR1K_GOT16,
+ BFD_RELOC_OR1K_PLT26,
+ BFD_RELOC_OR1K_GOTOFF_HI16,
+ BFD_RELOC_OR1K_GOTOFF_LO16,
+ BFD_RELOC_OR1K_COPY,
+ BFD_RELOC_OR1K_GLOB_DAT,
+ BFD_RELOC_OR1K_JMP_SLOT,
+ BFD_RELOC_OR1K_RELATIVE,
+ BFD_RELOC_OR1K_TLS_GD_HI16,
+ BFD_RELOC_OR1K_TLS_GD_LO16,
+ BFD_RELOC_OR1K_TLS_LDM_HI16,
+ BFD_RELOC_OR1K_TLS_LDM_LO16,
+ BFD_RELOC_OR1K_TLS_LDO_HI16,
+ BFD_RELOC_OR1K_TLS_LDO_LO16,
+ BFD_RELOC_OR1K_TLS_IE_HI16,
+ BFD_RELOC_OR1K_TLS_IE_LO16,
+ BFD_RELOC_OR1K_TLS_LE_HI16,
+ BFD_RELOC_OR1K_TLS_LE_LO16,
+ BFD_RELOC_OR1K_TLS_TPOFF,
+ BFD_RELOC_OR1K_TLS_DTPOFF,
+ BFD_RELOC_OR1K_TLS_DTPMOD,
/* H8 elf Relocations. */
BFD_RELOC_H8_DIR16A8,
@@ -5018,6 +5323,11 @@ a matching LO8XG part. */
BFD_RELOC_NIOS2_JUMP_SLOT,
BFD_RELOC_NIOS2_RELATIVE,
BFD_RELOC_NIOS2_GOTOFF,
+ BFD_RELOC_NIOS2_CALL26_NOAT,
+ BFD_RELOC_NIOS2_GOT_LO,
+ BFD_RELOC_NIOS2_GOT_HA,
+ BFD_RELOC_NIOS2_CALL_LO,
+ BFD_RELOC_NIOS2_CALL_HA,
/* IQ2000 Relocations. */
BFD_RELOC_IQ2000_OFFSET_16,
@@ -5757,6 +6067,7 @@ assembler and not (currently) written to any object files. */
/* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */
BFD_RELOC_EPIPHANY_IMM8,
BFD_RELOC_UNUSED };
+
typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
reloc_howto_type *bfd_reloc_type_lookup
(bfd *abfd, bfd_reloc_code_real_type code);
@@ -5954,6 +6265,7 @@ bfd_boolean bfd_copy_private_symbol_data
(ibfd, isymbol, obfd, osymbol))
/* Extracted from bfd.c. */
+
enum bfd_direction
{
no_direction = 0,
@@ -5964,9 +6276,6 @@ enum bfd_direction
struct bfd
{
- /* A unique identifier of the BFD */
- unsigned int id;
-
/* The filename the application opened the BFD with. */
const char *filename;
@@ -5989,17 +6298,17 @@ struct bfd
/* File modified time, if mtime_set is TRUE. */
long mtime;
- /* Reserved for an unimplemented file locking extension. */
- int ifd;
+ /* A unique identifier of the BFD */
+ unsigned int id;
/* The format which belongs to the BFD. (object, core, etc.) */
- bfd_format format;
+ ENUM_BITFIELD (bfd_format) format : 3;
/* The direction with which the BFD was opened. */
- enum bfd_direction direction;
+ ENUM_BITFIELD (bfd_direction) direction : 2;
/* Format_specific flags. */
- flagword flags;
+ flagword flags : 17;
/* Values that may appear in the flags field of a BFD. These also
appear in the object_flags field of the bfd_target structure, where
@@ -6058,26 +6367,23 @@ struct bfd
struct. */
#define BFD_IN_MEMORY 0x800
- /* The sections in this BFD specify a memory page. */
-#define HAS_LOAD_PAGE 0x1000
-
/* This BFD has been created by the linker and doesn't correspond
to any input file. */
-#define BFD_LINKER_CREATED 0x2000
+#define BFD_LINKER_CREATED 0x1000
/* This may be set before writing out a BFD to request that it
be written using values for UIDs, GIDs, timestamps, etc. that
will be consistent from run to run. */
-#define BFD_DETERMINISTIC_OUTPUT 0x4000
+#define BFD_DETERMINISTIC_OUTPUT 0x2000
/* Compress sections in this BFD. */
-#define BFD_COMPRESS 0x8000
+#define BFD_COMPRESS 0x4000
/* Decompress sections in this BFD. */
-#define BFD_DECOMPRESS 0x10000
+#define BFD_DECOMPRESS 0x8000
/* BFD is a dummy, for plugins. */
-#define BFD_PLUGIN 0x20000
+#define BFD_PLUGIN 0x10000
/* Flags bits to be saved in bfd_preserve_save. */
#define BFD_FLAGS_SAVED \
@@ -6088,6 +6394,42 @@ struct bfd
(BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
| BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT)
+ /* Is the file descriptor being cached? That is, can it be closed as
+ needed, and re-opened when accessed later? */
+ unsigned int cacheable : 1;
+
+ /* Marks whether there was a default target specified when the
+ BFD was opened. This is used to select which matching algorithm
+ to use to choose the back end. */
+ unsigned int target_defaulted : 1;
+
+ /* ... and here: (``once'' means at least once). */
+ unsigned int opened_once : 1;
+
+ /* Set if we have a locally maintained mtime value, rather than
+ getting it from the file each time. */
+ unsigned int mtime_set : 1;
+
+ /* Flag set if symbols from this BFD should not be exported. */
+ unsigned int no_export : 1;
+
+ /* Remember when output has begun, to stop strange things
+ from happening. */
+ unsigned int output_has_begun : 1;
+
+ /* Have archive map. */
+ unsigned int has_armap : 1;
+
+ /* Set if this is a thin archive. */
+ unsigned int is_thin_archive : 1;
+
+ /* Set if only required symbols should be added in the link hash table for
+ this object. Used by VMS linkers. */
+ unsigned int selective_search : 1;
+
+ /* Set if this is the linker output BFD. */
+ unsigned int is_linker_output : 1;
+
/* Currently my_archive is tested before adding origin to
anything. I believe that this can become always an add of
origin, with origin set to 0 for non archive files. */
@@ -6112,17 +6454,21 @@ struct bfd
/* The number of sections. */
unsigned int section_count;
+ /* A field used by _bfd_generic_link_add_archive_symbols. This will
+ be used only for archive elements. */
+ int archive_pass;
+
/* Stuff only useful for object files:
The start address. */
bfd_vma start_address;
- /* Used for input and output. */
- unsigned int symcount;
-
/* Symbol table for output BFD (with symcount entries).
Also used by the linker to cache input BFD symbols. */
struct bfd_symbol **outsymbols;
+ /* Used for input and output. */
+ unsigned int symcount;
+
/* Used for slurped dynamic symbol tables. */
unsigned int dynsymcount;
@@ -6137,12 +6483,12 @@ struct bfd
struct bfd *nested_archives; /* List of nested archive in a flattened
thin archive. */
- /* A chain of BFD structures involved in a link. */
- struct bfd *link_next;
-
- /* A field used by _bfd_generic_link_add_archive_symbols. This will
- be used only for archive elements. */
- int archive_pass;
+ union {
+ /* For input BFDs, a chain of BFDs involved in a link. */
+ struct bfd *next;
+ /* For output BFD, the linker hash table. */
+ struct bfd_link_hash_table *hash;
+ } link;
/* Used by the back end to hold private data. */
union
@@ -6194,40 +6540,16 @@ struct bfd
struct objalloc *, but we use void * to avoid requiring the inclusion
of objalloc.h. */
void *memory;
+};
- /* Is the file descriptor being cached? That is, can it be closed as
- needed, and re-opened when accessed later? */
- unsigned int cacheable : 1;
-
- /* Marks whether there was a default target specified when the
- BFD was opened. This is used to select which matching algorithm
- to use to choose the back end. */
- unsigned int target_defaulted : 1;
-
- /* ... and here: (``once'' means at least once). */
- unsigned int opened_once : 1;
-
- /* Set if we have a locally maintained mtime value, rather than
- getting it from the file each time. */
- unsigned int mtime_set : 1;
-
- /* Flag set if symbols from this BFD should not be exported. */
- unsigned int no_export : 1;
-
- /* Remember when output has begun, to stop strange things
- from happening. */
- unsigned int output_has_begun : 1;
-
- /* Have archive map. */
- unsigned int has_armap : 1;
-
- /* Set if this is a thin archive. */
- unsigned int is_thin_archive : 1;
+/* See note beside bfd_set_section_userdata. */
+static inline bfd_boolean
+bfd_set_cacheable (bfd * abfd, bfd_boolean val)
+{
+ abfd->cacheable = val;
+ return TRUE;
+}
- /* Set if only required symbols should be added in the link hash table for
- this object. Used by VMS linkers. */
- unsigned int selective_search : 1;
-};
typedef enum bfd_error
{
@@ -6264,6 +6586,7 @@ const char *bfd_errmsg (bfd_error_type error_tag);
void bfd_perror (const char *message);
+
typedef void (*bfd_error_handler_type) (const char *, ...);
bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
@@ -6272,6 +6595,7 @@ void bfd_set_error_program_name (const char *);
bfd_error_handler_type bfd_get_error_handler (void);
+
typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
const char *bfd_version,
const char *bfd_file,
@@ -6327,12 +6651,12 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
BFD_SEND (abfd, _bfd_find_nearest_line, \
- (abfd, sec, syms, off, file, func, line))
+ (abfd, syms, sec, off, file, func, line, NULL))
#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
line, disc) \
- BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \
- (abfd, sec, syms, off, file, func, line, disc))
+ BFD_SEND (abfd, _bfd_find_nearest_line, \
+ (abfd, syms, sec, off, file, func, line, disc))
#define bfd_find_line(abfd, syms, sym, file, line) \
BFD_SEND (abfd, _bfd_find_line, \
@@ -6381,9 +6705,6 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
#define bfd_link_hash_table_create(abfd) \
BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
-#define bfd_link_hash_table_free(abfd, hash) \
- BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
-
#define bfd_link_add_symbols(abfd, info) \
BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
@@ -6697,8 +7018,7 @@ typedef struct bfd_target
NAME##_bfd_is_target_special_symbol, \
NAME##_get_lineno, \
NAME##_find_nearest_line, \
- _bfd_generic_find_nearest_line_discriminator, \
- _bfd_generic_find_line, \
+ NAME##_find_line, \
NAME##_find_inliner_info, \
NAME##_bfd_make_debug_symbol, \
NAME##_read_minisymbols, \
@@ -6719,10 +7039,7 @@ typedef struct bfd_target
bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
bfd_boolean (*_bfd_find_nearest_line)
- (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
- const char **, const char **, unsigned int *);
- bfd_boolean (*_bfd_find_nearest_line_discriminator)
- (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
+ (bfd *, struct bfd_symbol **, struct bfd_section *, bfd_vma,
const char **, const char **, unsigned int *, unsigned int *);
bfd_boolean (*_bfd_find_line)
(bfd *, struct bfd_symbol **, struct bfd_symbol *,
@@ -6776,7 +7093,6 @@ typedef struct bfd_target
NAME##_bfd_get_relocated_section_contents, \
NAME##_bfd_relax_section, \
NAME##_bfd_link_hash_table_create, \
- NAME##_bfd_link_hash_table_free, \
NAME##_bfd_link_add_symbols, \
NAME##_bfd_link_just_syms, \
NAME##_bfd_copy_link_hash_symbol_type, \
@@ -6803,16 +7119,14 @@ typedef struct bfd_target
struct bfd_link_hash_table *
(*_bfd_link_hash_table_create) (bfd *);
- /* Release the memory associated with the linker hash table. */
- void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
-
/* Add symbols from this object file into the hash table. */
bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
/* Indicate that we are only retrieving symbol values from this section. */
void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
- /* Copy the symbol type of a linker hash table entry. */
+ /* Copy the symbol type and other attributes for a linker script
+ assignment of one symbol to another. */
#define bfd_copy_link_hash_symbol_type(b, t, f) \
BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
void (*_bfd_copy_link_hash_symbol_type)
diff --git a/binutils-2.25/bfd/bfd.c b/binutils-2.25/bfd/bfd.c
index 8d0580c2..2d9397b5 100644
--- a/binutils-2.25/bfd/bfd.c
+++ b/binutils-2.25/bfd/bfd.c
@@ -1,5 +1,5 @@
/* Generic BFD library interface and support routines.
- Copyright 1990-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -46,9 +46,6 @@ CODE_FRAGMENT
.
.struct bfd
.{
-. {* A unique identifier of the BFD *}
-. unsigned int id;
-.
. {* The filename the application opened the BFD with. *}
. const char *filename;
.
@@ -71,17 +68,17 @@ CODE_FRAGMENT
. {* File modified time, if mtime_set is TRUE. *}
. long mtime;
.
-. {* Reserved for an unimplemented file locking extension. *}
-. int ifd;
+. {* A unique identifier of the BFD *}
+. unsigned int id;
.
. {* The format which belongs to the BFD. (object, core, etc.) *}
-. bfd_format format;
+. ENUM_BITFIELD (bfd_format) format : 3;
.
. {* The direction with which the BFD was opened. *}
-. enum bfd_direction direction;
+. ENUM_BITFIELD (bfd_direction) direction : 2;
.
. {* Format_specific flags. *}
-. flagword flags;
+. flagword flags : 17;
.
. {* Values that may appear in the flags field of a BFD. These also
. appear in the object_flags field of the bfd_target structure, where
@@ -140,26 +137,23 @@ CODE_FRAGMENT
. struct. *}
.#define BFD_IN_MEMORY 0x800
.
-. {* The sections in this BFD specify a memory page. *}
-.#define HAS_LOAD_PAGE 0x1000
-.
. {* This BFD has been created by the linker and doesn't correspond
. to any input file. *}
-.#define BFD_LINKER_CREATED 0x2000
+.#define BFD_LINKER_CREATED 0x1000
.
. {* This may be set before writing out a BFD to request that it
. be written using values for UIDs, GIDs, timestamps, etc. that
. will be consistent from run to run. *}
-.#define BFD_DETERMINISTIC_OUTPUT 0x4000
+.#define BFD_DETERMINISTIC_OUTPUT 0x2000
.
. {* Compress sections in this BFD. *}
-.#define BFD_COMPRESS 0x8000
+.#define BFD_COMPRESS 0x4000
.
. {* Decompress sections in this BFD. *}
-.#define BFD_DECOMPRESS 0x10000
+.#define BFD_DECOMPRESS 0x8000
.
. {* BFD is a dummy, for plugins. *}
-.#define BFD_PLUGIN 0x20000
+.#define BFD_PLUGIN 0x10000
.
. {* Flags bits to be saved in bfd_preserve_save. *}
.#define BFD_FLAGS_SAVED \
@@ -170,6 +164,42 @@ CODE_FRAGMENT
. (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
. | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT)
.
+. {* Is the file descriptor being cached? That is, can it be closed as
+. needed, and re-opened when accessed later? *}
+. unsigned int cacheable : 1;
+.
+. {* Marks whether there was a default target specified when the
+. BFD was opened. This is used to select which matching algorithm
+. to use to choose the back end. *}
+. unsigned int target_defaulted : 1;
+.
+. {* ... and here: (``once'' means at least once). *}
+. unsigned int opened_once : 1;
+.
+. {* Set if we have a locally maintained mtime value, rather than
+. getting it from the file each time. *}
+. unsigned int mtime_set : 1;
+.
+. {* Flag set if symbols from this BFD should not be exported. *}
+. unsigned int no_export : 1;
+.
+. {* Remember when output has begun, to stop strange things
+. from happening. *}
+. unsigned int output_has_begun : 1;
+.
+. {* Have archive map. *}
+. unsigned int has_armap : 1;
+.
+. {* Set if this is a thin archive. *}
+. unsigned int is_thin_archive : 1;
+.
+. {* Set if only required symbols should be added in the link hash table for
+. this object. Used by VMS linkers. *}
+. unsigned int selective_search : 1;
+.
+. {* Set if this is the linker output BFD. *}
+. unsigned int is_linker_output : 1;
+.
. {* Currently my_archive is tested before adding origin to
. anything. I believe that this can become always an add of
. origin, with origin set to 0 for non archive files. *}
@@ -194,17 +224,21 @@ CODE_FRAGMENT
. {* The number of sections. *}
. unsigned int section_count;
.
+. {* A field used by _bfd_generic_link_add_archive_symbols. This will
+. be used only for archive elements. *}
+. int archive_pass;
+.
. {* Stuff only useful for object files:
. The start address. *}
. bfd_vma start_address;
.
-. {* Used for input and output. *}
-. unsigned int symcount;
-.
. {* Symbol table for output BFD (with symcount entries).
. Also used by the linker to cache input BFD symbols. *}
. struct bfd_symbol **outsymbols;
.
+. {* Used for input and output. *}
+. unsigned int symcount;
+.
. {* Used for slurped dynamic symbol tables. *}
. unsigned int dynsymcount;
.
@@ -219,12 +253,12 @@ CODE_FRAGMENT
. struct bfd *nested_archives; {* List of nested archive in a flattened
. thin archive. *}
.
-. {* A chain of BFD structures involved in a link. *}
-. struct bfd *link_next;
-.
-. {* A field used by _bfd_generic_link_add_archive_symbols. This will
-. be used only for archive elements. *}
-. int archive_pass;
+. union {
+. {* For input BFDs, a chain of BFDs involved in a link. *}
+. struct bfd *next;
+. {* For output BFD, the linker hash table. *}
+. struct bfd_link_hash_table *hash;
+. } link;
.
. {* Used by the back end to hold private data. *}
. union
@@ -276,41 +310,16 @@ CODE_FRAGMENT
. struct objalloc *, but we use void * to avoid requiring the inclusion
. of objalloc.h. *}
. void *memory;
-.
-. {* Is the file descriptor being cached? That is, can it be closed as
-. needed, and re-opened when accessed later? *}
-. unsigned int cacheable : 1;
-.
-. {* Marks whether there was a default target specified when the
-. BFD was opened. This is used to select which matching algorithm
-. to use to choose the back end. *}
-. unsigned int target_defaulted : 1;
-.
-. {* ... and here: (``once'' means at least once). *}
-. unsigned int opened_once : 1;
-.
-. {* Set if we have a locally maintained mtime value, rather than
-. getting it from the file each time. *}
-. unsigned int mtime_set : 1;
-.
-. {* Flag set if symbols from this BFD should not be exported. *}
-. unsigned int no_export : 1;
-.
-. {* Remember when output has begun, to stop strange things
-. from happening. *}
-. unsigned int output_has_begun : 1;
-.
-. {* Have archive map. *}
-. unsigned int has_armap : 1;
-.
-. {* Set if this is a thin archive. *}
-. unsigned int is_thin_archive : 1;
-.
-. {* Set if only required symbols should be added in the link hash table for
-. this object. Used by VMS linkers. *}
-. unsigned int selective_search : 1;
.};
.
+.{* See note beside bfd_set_section_userdata. *}
+.static inline bfd_boolean
+.bfd_set_cacheable (bfd * abfd, bfd_boolean val)
+.{
+. abfd->cacheable = val;
+. return TRUE;
+.}
+.
*/
#include "sysdep.h"
@@ -1065,9 +1074,11 @@ SYNOPSIS
int bfd_get_arch_size (bfd *abfd);
DESCRIPTION
- Returns the architecture address size, in bits, as determined
- by the object file's format. For ELF, this information is
- included in the header.
+ Returns the normalized architecture address size, in bits, as
+ determined by the object file's format. By normalized, we mean
+ either 32 or 64. For ELF, this information is included in the
+ header. Use bfd_arch_bits_per_address for number of bits in
+ the architecture address.
RETURNS
Returns the arch size in bits if known, <<-1>> otherwise.
@@ -1079,7 +1090,7 @@ bfd_get_arch_size (bfd *abfd)
if (abfd->xvec->flavour == bfd_target_elf_flavour)
return get_elf_backend_data (abfd)->s->arch_size;
- return -1;
+ return bfd_arch_bits_per_address (abfd) > 32 ? 64 : 32;
}
/*
@@ -1433,12 +1444,12 @@ DESCRIPTION
.
.#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
. BFD_SEND (abfd, _bfd_find_nearest_line, \
-. (abfd, sec, syms, off, file, func, line))
+. (abfd, syms, sec, off, file, func, line, NULL))
.
.#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
. line, disc) \
-. BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \
-. (abfd, sec, syms, off, file, func, line, disc))
+. BFD_SEND (abfd, _bfd_find_nearest_line, \
+. (abfd, syms, sec, off, file, func, line, disc))
.
.#define bfd_find_line(abfd, syms, sym, file, line) \
. BFD_SEND (abfd, _bfd_find_line, \
@@ -1487,9 +1498,6 @@ DESCRIPTION
.#define bfd_link_hash_table_create(abfd) \
. BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
.
-.#define bfd_link_hash_table_free(abfd, hash) \
-. BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
-.
.#define bfd_link_add_symbols(abfd, info) \
. BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
.
diff --git a/binutils-2.25/bfd/bfd.m4 b/binutils-2.25/bfd/bfd.m4
index 7f86aabf..6b711e24 100644
--- a/binutils-2.25/bfd/bfd.m4
+++ b/binutils-2.25/bfd/bfd.m4
@@ -1,6 +1,6 @@
dnl This file was derived from acinclude.m4.
dnl
-dnl Copyright 2012 Free Software Foundation
+dnl Copyright (C) 2012-2014 Free Software Foundation, Inc.
dnl
dnl This file is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
diff --git a/binutils-2.25/bfd/bfdio.c b/binutils-2.25/bfd/bfdio.c
index 363402e9..14619f58 100644
--- a/binutils-2.25/bfd/bfdio.c
+++ b/binutils-2.25/bfd/bfdio.c
@@ -1,6 +1,6 @@
/* Low-level I/O routines for BFDs.
- Copyright 1990-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
diff --git a/binutils-2.25/bfd/bfdwin.c b/binutils-2.25/bfd/bfdwin.c
index 4103e9c2..2af868aa 100644
--- a/binutils-2.25/bfd/bfdwin.c
+++ b/binutils-2.25/bfd/bfdwin.c
@@ -1,6 +1,5 @@
/* Support for memory-mapped windows into a BFD.
- Copyright 1995, 1996, 2001, 2002, 2003, 2005, 2007, 2008, 2009, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/binary.c b/binutils-2.25/bfd/binary.c
index 700c862f..d35e859f 100644
--- a/binutils-2.25/bfd/binary.c
+++ b/binutils-2.25/bfd/binary.c
@@ -1,6 +1,5 @@
/* BFD back-end for binary objects.
- Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>
This file is part of BFD, the Binary File Descriptor library.
@@ -205,6 +204,7 @@ binary_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED,
#define binary_bfd_is_local_label_name bfd_generic_is_local_label_name
#define binary_get_lineno _bfd_nosymbols_get_lineno
#define binary_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define binary_find_line _bfd_nosymbols_find_line
#define binary_find_inliner_info _bfd_nosymbols_find_inliner_info
#define binary_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define binary_read_minisymbols _bfd_generic_read_minisymbols
@@ -306,7 +306,6 @@ binary_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
#define binary_section_already_linked _bfd_generic_section_already_linked
#define binary_bfd_define_common_symbol bfd_generic_define_common_symbol
#define binary_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define binary_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define binary_bfd_link_just_syms _bfd_generic_link_just_syms
#define binary_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
diff --git a/binutils-2.25/bfd/bout.c b/binutils-2.25/bfd/bout.c
index cfd4abb0..a27df583 100644
--- a/binutils-2.25/bfd/bout.c
+++ b/binutils-2.25/bfd/bout.c
@@ -1,7 +1,5 @@
/* BFD back-end for Intel 960 b.out binaries.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -1376,10 +1374,10 @@ b_out_bfd_get_relocated_section_contents (bfd *output_bfd,
/* Build the transfer vectors for Big and Little-Endian B.OUT files. */
+#define aout_32_find_line _bfd_nosymbols_find_line
#define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define aout_32_close_and_cleanup aout_32_bfd_free_cached_info
#define b_out_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define b_out_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define b_out_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define b_out_bfd_link_just_syms _bfd_generic_link_just_syms
#define b_out_bfd_copy_link_hash_symbol_type \
@@ -1395,9 +1393,9 @@ b_out_bfd_get_relocated_section_contents (bfd *output_bfd,
#define b_out_bfd_define_common_symbol bfd_generic_define_common_symbol
#define aout_32_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
-extern const bfd_target b_out_vec_little_host;
+extern const bfd_target bout_le_vec;
-const bfd_target b_out_vec_big_host =
+const bfd_target bout_be_vec =
{
"b.out.big", /* Name. */
bfd_target_aout_flavour,
@@ -1434,12 +1432,12 @@ const bfd_target b_out_vec_big_host =
BFD_JUMP_TABLE_LINK (b_out),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- & b_out_vec_little_host,
+ & bout_le_vec,
NULL
};
-const bfd_target b_out_vec_little_host =
+const bfd_target bout_le_vec =
{
"b.out.little", /* Name. */
bfd_target_aout_flavour,
@@ -1477,7 +1475,7 @@ const bfd_target b_out_vec_little_host =
BFD_JUMP_TABLE_LINK (b_out),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- & b_out_vec_big_host,
+ & bout_be_vec,
NULL
};
diff --git a/binutils-2.25/bfd/cache.c b/binutils-2.25/bfd/cache.c
index 4d46936b..ffda0045 100644
--- a/binutils-2.25/bfd/cache.c
+++ b/binutils-2.25/bfd/cache.c
@@ -1,7 +1,6 @@
/* BFD library -- caching of file descriptors.
- Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
@@ -82,7 +81,7 @@ bfd_cache_max_open (void)
#ifdef HAVE_GETRLIMIT
struct rlimit rlim;
if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
- && rlim.rlim_cur != RLIM_INFINITY)
+ && rlim.rlim_cur != (rlim_t) RLIM_INFINITY)
max = rlim.rlim_cur / 8;
else
#endif /* HAVE_GETRLIMIT */
@@ -311,7 +310,7 @@ cache_bread_1 (struct bfd *abfd, void *buf, file_ptr nbytes)
if (nread == (file_ptr)-1)
{
bfd_set_error (bfd_error_system_call);
- return -1;
+ return nread;
}
#else
nread = fread (buf, 1, nbytes, f);
@@ -321,7 +320,7 @@ cache_bread_1 (struct bfd *abfd, void *buf, file_ptr nbytes)
if (nread < nbytes && ferror (f))
{
bfd_set_error (bfd_error_system_call);
- return -1;
+ return nread;
}
#endif
if (nread < nbytes)
diff --git a/binutils-2.25/bfd/cf-i386lynx.c b/binutils-2.25/bfd/cf-i386lynx.c
index 5fc26894..480c2757 100644
--- a/binutils-2.25/bfd/cf-i386lynx.c
+++ b/binutils-2.25/bfd/cf-i386lynx.c
@@ -1,6 +1,5 @@
/* BFD back-end for Intel 386 COFF LynxOS files.
- Copyright 1993, 1994, 1995, 2005, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -23,7 +22,7 @@
#include "sysdep.h"
#include "bfd.h"
-#define TARGET_SYM i386lynx_coff_vec
+#define TARGET_SYM i386_coff_lynx_vec
#define TARGET_NAME "coff-i386-lynx"
#define LYNXOS
diff --git a/binutils-2.25/bfd/cf-sparclynx.c b/binutils-2.25/bfd/cf-sparclynx.c
index a9791601..2be00484 100644
--- a/binutils-2.25/bfd/cf-sparclynx.c
+++ b/binutils-2.25/bfd/cf-sparclynx.c
@@ -1,5 +1,5 @@
/* BFD back-end for Sparc COFF LynxOS files.
- Copyright 1993, 1994, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -19,7 +19,7 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
-#define TARGET_SYM sparclynx_coff_vec
+#define TARGET_SYM sparc_coff_lynx_vec
#define TARGET_NAME "coff-sparc-lynx"
#define LYNXOS
diff --git a/binutils-2.25/bfd/cisco-core.c b/binutils-2.25/bfd/cisco-core.c
index 5d0454c4..36845a28 100644
--- a/binutils-2.25/bfd/cisco-core.c
+++ b/binutils-2.25/bfd/cisco-core.c
@@ -1,7 +1,5 @@
/* BFD back-end for CISCO crash dumps.
- Copyright 1994, 1997, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007,
- 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -315,9 +313,9 @@ cisco_core_file_failing_signal (bfd *abfd ATTRIBUTE_UNUSED)
return abfd->tdata.cisco_core_data->sig;
}
-extern const bfd_target cisco_core_little_vec;
+extern const bfd_target core_cisco_le_vec;
-const bfd_target cisco_core_big_vec =
+const bfd_target core_cisco_be_vec =
{
"cisco-ios-core-big",
bfd_target_unknown_flavour,
@@ -363,12 +361,12 @@ const bfd_target cisco_core_big_vec =
BFD_JUMP_TABLE_LINK (_bfd_nolink),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- & cisco_core_little_vec,
+ & core_cisco_le_vec,
NULL /* backend_data */
};
-const bfd_target cisco_core_little_vec =
+const bfd_target core_cisco_le_vec =
{
"cisco-ios-core-little",
bfd_target_unknown_flavour,
@@ -414,7 +412,7 @@ const bfd_target cisco_core_little_vec =
BFD_JUMP_TABLE_LINK (_bfd_nolink),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- &cisco_core_big_vec,
+ &core_cisco_be_vec,
NULL /* backend_data */
};
diff --git a/binutils-2.25/bfd/coff-alpha.c b/binutils-2.25/bfd/coff-alpha.c
index 028e7039..0e78088a 100644
--- a/binutils-2.25/bfd/coff-alpha.c
+++ b/binutils-2.25/bfd/coff-alpha.c
@@ -1,7 +1,5 @@
/* BFD back-end for ALPHA Extended-Coff files.
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Modified from coff-mips.c by Steve Chamberlain <sac@cygnus.com> and
Ian Lance Taylor <ian@cygnus.com>.
@@ -2243,7 +2241,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out,
alpha_ecoff_swap_scnhdr_out,
FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE,
- ECOFF_NO_LONG_SECTION_NAMES, 4, FALSE, 2,
+ ECOFF_NO_LONG_SECTION_NAMES, 4, FALSE, 2, 32768,
alpha_ecoff_swap_filehdr_in, alpha_ecoff_swap_aouthdr_in,
alpha_ecoff_swap_scnhdr_in, NULL,
alpha_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
@@ -2348,7 +2346,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
_bfd_coff_section_already_linked
#define _bfd_ecoff_bfd_define_common_symbol bfd_generic_define_common_symbol
-const bfd_target ecoffalpha_little_vec =
+const bfd_target alpha_ecoff_le_vec =
{
"ecoff-littlealpha", /* name */
bfd_target_ecoff_flavour,
diff --git a/binutils-2.25/bfd/coff-apollo.c b/binutils-2.25/bfd/coff-apollo.c
index 46cf5ea8..2c755986 100644
--- a/binutils-2.25/bfd/coff-apollo.c
+++ b/binutils-2.25/bfd/coff-apollo.c
@@ -1,6 +1,5 @@
/* BFD back-end for Apollo 68000 COFF binaries.
- Copyright 1990, 1991, 1992, 1993, 1994, 1999, 2000, 2001, 2002, 2003,
- 2005, 2007, 2008, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
By Troy Rollo (troy@cbme.unsw.edu.au)
Based on m68k standard COFF version Written by Cygnus Support.
@@ -107,7 +106,7 @@ apollo_howto2rtype (reloc_howto_type *internal)
#include "coffcode.h"
#ifndef TARGET_SYM
-#define TARGET_SYM apollocoff_vec
+#define TARGET_SYM m68k_coff_apollo_vec
#endif
#ifndef TARGET_NAME
diff --git a/binutils-2.25/bfd/coff-arm.c b/binutils-2.25/bfd/coff-arm.c
index efcf522a..d47b77e3 100644
--- a/binutils-2.25/bfd/coff-arm.c
+++ b/binutils-2.25/bfd/coff-arm.c
@@ -1,7 +1,5 @@
/* BFD back-end for ARM COFF files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -2530,13 +2528,13 @@ coff_arm_final_link_postscript (bfd * abfd ATTRIBUTE_UNUSED,
#include "coffcode.h"
#ifndef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM armcoff_little_vec
+#define TARGET_LITTLE_SYM arm_coff_le_vec
#endif
#ifndef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "coff-arm-little"
#endif
#ifndef TARGET_BIG_SYM
-#define TARGET_BIG_SYM armcoff_big_vec
+#define TARGET_BIG_SYM arm_coff_be_vec
#endif
#ifndef TARGET_BIG_NAME
#define TARGET_BIG_NAME "coff-arm-big"
diff --git a/binutils-2.25/bfd/coff-aux.c b/binutils-2.25/bfd/coff-aux.c
index 852f5851..d95b98bc 100644
--- a/binutils-2.25/bfd/coff-aux.c
+++ b/binutils-2.25/bfd/coff-aux.c
@@ -1,6 +1,5 @@
/* BFD back-end for Apple M68K COFF A/UX 3.x files.
- Copyright 1996, 1997, 2000, 2002, 2005, 2007, 2008, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Written by Richard Henderson <rth@tamu.edu>.
This file is part of BFD, the Binary File Descriptor library.
@@ -20,7 +19,7 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
-#define TARGET_SYM m68kaux_coff_vec
+#define TARGET_SYM m68k_coff_aux_vec
#define TARGET_NAME "coff-m68k-aux"
#ifndef TARG_AUX
@@ -74,20 +73,17 @@ coff_m68k_aux_link_add_one_symbol (struct bfd_link_info *info,
bfd_boolean collect,
struct bfd_link_hash_entry **hashp)
{
- struct bfd_link_hash_entry *h;
+ struct bfd_link_hash_entry *h, *inh, *t;
- if ((flags & (BSF_WARNING | BSF_CONSTRUCTOR | BSF_WEAK)) == 0 &&
- !bfd_is_und_section (section) &&
- !bfd_is_com_section (section))
+ if ((flags & (BSF_WARNING | BSF_CONSTRUCTOR | BSF_WEAK)) == 0
+ && !bfd_is_und_section (section)
+ && !bfd_is_com_section (section))
{
/* The new symbol is a definition or an indirect definition */
/* This bit copied from linker.c */
if (hashp != NULL && *hashp != NULL)
- {
- h = *hashp;
- BFD_ASSERT (strcmp (h->root.string, name) == 0);
- }
+ h = *hashp;
else
{
h = bfd_link_hash_lookup (info->hash, name, TRUE, copy, FALSE);
@@ -99,37 +95,46 @@ coff_m68k_aux_link_add_one_symbol (struct bfd_link_info *info,
}
}
- if (info->notice_hash != (struct bfd_hash_table *) NULL
- && (bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE)
- != (struct bfd_hash_entry *) NULL))
- {
- if (! (*info->callbacks->notice) (info, h, abfd, section, value,
- flags, string))
- return FALSE;
- }
-
if (hashp != (struct bfd_link_hash_entry **) NULL)
*hashp = h;
/* end duplication from linker.c */
- if (h->type == bfd_link_hash_defined
- || h->type == bfd_link_hash_indirect)
+ t = h;
+ inh = NULL;
+ if (h->type == bfd_link_hash_indirect)
{
- asection *msec;
+ inh = h->u.i.link;
+ t = inh;
+ }
- if (h->type == bfd_link_hash_defined)
- msec = h->u.def.section;
- else
- msec = bfd_ind_section_ptr;
+ if (t->type == bfd_link_hash_defined)
+ {
+ asection *msec = t->u.def.section;
+ bfd_boolean special = FALSE;
if (bfd_is_abs_section (msec) && !bfd_is_abs_section (section))
{
- h->u.def.section = section;
- h->u.def.value = value;
- return TRUE;
+ t->u.def.section = section;
+ t->u.def.value = value;
+ special = TRUE;
}
else if (bfd_is_abs_section (section) && !bfd_is_abs_section (msec))
- return TRUE;
+ special = TRUE;
+
+ if (special)
+ {
+ if (info->notice_all
+ || (info->notice_hash != NULL
+ && bfd_hash_lookup (info->notice_hash, name,
+ FALSE, FALSE) != NULL))
+ {
+ if (!(*info->callbacks->notice) (info, h, inh,
+ abfd, section, value, flags))
+ return FALSE;
+ }
+
+ return TRUE;
+ }
}
}
diff --git a/binutils-2.25/bfd/coff-go32.c b/binutils-2.25/bfd/coff-go32.c
index 7c09b3a8..47972650 100644
--- a/binutils-2.25/bfd/coff-go32.c
+++ b/binutils-2.25/bfd/coff-go32.c
@@ -1,6 +1,5 @@
/* BFD back-end for Intel 386 COFF files (DJGPP variant).
- Copyright 1990, 1991, 1992, 1993, 1994, 1999, 2000, 2001, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by DJ Delorie.
This file is part of BFD, the Binary File Descriptor library.
@@ -20,7 +19,7 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
-#define TARGET_SYM go32coff_vec
+#define TARGET_SYM i386_coff_go32_vec
#define TARGET_NAME "coff-go32"
#define TARGET_UNDERSCORE '_'
#define COFF_LONG_SECTION_NAMES
diff --git a/binutils-2.25/bfd/coff-h8300.c b/binutils-2.25/bfd/coff-h8300.c
index 1e342750..5ec48c96 100644
--- a/binutils-2.25/bfd/coff-h8300.c
+++ b/binutils-2.25/bfd/coff-h8300.c
@@ -1,7 +1,5 @@
/* BFD back-end for Renesas H8/300 COFF binaries.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Steve Chamberlain, <sac@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@@ -1416,4 +1414,4 @@ h8300_bfd_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
bfd_coff_reloc16_get_relocated_section_contents
#define coff_bfd_relax_section bfd_coff_reloc16_relax_section
-CREATE_BIG_COFF_TARGET_VEC (h8300coff_vec, "coff-h8300", BFD_IS_RELAXABLE, 0, '_', NULL, COFF_SWAP_TABLE)
+CREATE_BIG_COFF_TARGET_VEC (h8300_coff_vec, "coff-h8300", BFD_IS_RELAXABLE, 0, '_', NULL, COFF_SWAP_TABLE)
diff --git a/binutils-2.25/bfd/coff-h8500.c b/binutils-2.25/bfd/coff-h8500.c
index 9b645999..574f9564 100644
--- a/binutils-2.25/bfd/coff-h8500.c
+++ b/binutils-2.25/bfd/coff-h8500.c
@@ -1,6 +1,5 @@
/* BFD back-end for Renesas H8/500 COFF binaries.
- Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2007, 2008, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
@@ -302,4 +301,4 @@ extra_case (bfd *in_abfd,
bfd_coff_reloc16_get_relocated_section_contents
#define coff_bfd_relax_section bfd_coff_reloc16_relax_section
-CREATE_BIG_COFF_TARGET_VEC (h8500coff_vec, "coff-h8500", 0, 0, '_', NULL, COFF_SWAP_TABLE)
+CREATE_BIG_COFF_TARGET_VEC (h8500_coff_vec, "coff-h8500", 0, 0, '_', NULL, COFF_SWAP_TABLE)
diff --git a/binutils-2.25/bfd/coff-i386.c b/binutils-2.25/bfd/coff-i386.c
index af92b40c..848d69b9 100644
--- a/binutils-2.25/bfd/coff-i386.c
+++ b/binutils-2.25/bfd/coff-i386.c
@@ -1,7 +1,5 @@
/* BFD back-end for Intel 386 COFF files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -342,16 +340,18 @@ static reloc_howto_type howto_table[] =
PCRELOFFSET) /* pcrel_offset */
};
+#define NUM_HOWTOS (sizeof (howto_table) / sizeof (howto_table[0]))
+
/* Turn a howto into a reloc nunmber */
#define SELECT_RELOC(x,howto) { x.r_type = howto->type; }
#define BADMAG(x) I386BADMAG(x)
#define I386 1 /* Customize coffcode.h */
-#define RTYPE2HOWTO(cache_ptr, dst) \
- ((cache_ptr)->howto = \
- ((dst)->r_type < sizeof (howto_table) / sizeof (howto_table[0]) \
- ? howto_table + (dst)->r_type \
+#define RTYPE2HOWTO(cache_ptr, dst) \
+ ((cache_ptr)->howto = \
+ ((dst)->r_type < NUM_HOWTOS \
+ ? howto_table + (dst)->r_type \
: NULL))
/* For 386 COFF a STYP_NOLOAD | STYP_BSS section is part of a shared
@@ -388,7 +388,8 @@ static reloc_howto_type howto_table[] =
cache_ptr->addend = - (ptr->section->vma + ptr->value); \
else \
cache_ptr->addend = 0; \
- if (ptr && howto_table[reloc.r_type].pc_relative) \
+ if (ptr && reloc.r_type < NUM_HOWTOS \
+ && howto_table[reloc.r_type].pc_relative) \
cache_ptr->addend += asect->vma; \
}
@@ -440,7 +441,7 @@ coff_i386_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
{
reloc_howto_type *howto;
- if (rel->r_type >= sizeof (howto_table) / sizeof (howto_table[0]))
+ if (rel->r_type >= NUM_HOWTOS)
{
bfd_set_error (bfd_error_bad_value);
return NULL;
@@ -576,7 +577,7 @@ coff_i386_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
{
unsigned int i;
- for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++)
+ for (i = 0; i < NUM_HOWTOS; i++)
if (howto_table[i].name != NULL
&& strcasecmp (howto_table[i].name, r_name) == 0)
return &howto_table[i];
@@ -607,14 +608,11 @@ coff_i386_is_local_label_name (bfd *abfd, const char *name)
#include "coffcode.h"
-#define _bfd_generic_find_nearest_line_discriminator \
- coff_find_nearest_line_discriminator
-
const bfd_target
#ifdef TARGET_SYM
TARGET_SYM =
#else
- i386coff_vec =
+ i386_coff_vec =
#endif
{
#ifdef TARGET_NAME
diff --git a/binutils-2.25/bfd/coff-i860.c b/binutils-2.25/bfd/coff-i860.c
index 79b4a7eb..341183f1 100644
--- a/binutils-2.25/bfd/coff-i860.c
+++ b/binutils-2.25/bfd/coff-i860.c
@@ -1,6 +1,5 @@
/* BFD back-end for Intel i860 COFF files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007, 2008, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Created mostly by substituting "860" for "386" in coff-i386.c
Harry Dolan <dolan@ssd.intel.com>, October 1995
@@ -657,7 +656,7 @@ const bfd_target
#ifdef TARGET_SYM
TARGET_SYM =
#else
- i860coff_vec =
+ i860_coff_vec =
#endif
{
#ifdef TARGET_NAME
diff --git a/binutils-2.25/bfd/coff-i960.c b/binutils-2.25/bfd/coff-i960.c
index 5205caf1..14482576 100644
--- a/binutils-2.25/bfd/coff-i960.c
+++ b/binutils-2.25/bfd/coff-i960.c
@@ -1,7 +1,5 @@
/* BFD back-end for Intel 960 COFF files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -610,11 +608,11 @@ coff_i960_adjust_symndx (bfd *obfd ATTRIBUTE_UNUSED,
#include "coffcode.h"
-extern const bfd_target icoff_big_vec;
+extern const bfd_target icoff_be_vec;
-CREATE_LITTLE_COFF_TARGET_VEC (icoff_little_vec, "coff-Intel-little", 0, 0, '_', & icoff_big_vec, COFF_SWAP_TABLE)
+CREATE_LITTLE_COFF_TARGET_VEC (icoff_le_vec, "coff-Intel-little", 0, 0, '_', & icoff_be_vec, COFF_SWAP_TABLE)
-const bfd_target icoff_big_vec =
+const bfd_target icoff_be_vec =
{
"coff-Intel-big", /* name */
bfd_target_coff_flavour,
@@ -655,7 +653,7 @@ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
BFD_JUMP_TABLE_LINK (coff),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- & icoff_little_vec,
+ & icoff_le_vec,
COFF_SWAP_TABLE
};
diff --git a/binutils-2.25/bfd/coff-ia64.c b/binutils-2.25/bfd/coff-ia64.c
index 3f172bd4..38a0a381 100644
--- a/binutils-2.25/bfd/coff-ia64.c
+++ b/binutils-2.25/bfd/coff-ia64.c
@@ -1,6 +1,5 @@
/* BFD back-end for HP/Intel IA-64 COFF files.
- Copyright 1999, 2000, 2001, 2002, 2005, 2007, 2008, 2009, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
Contributed by David Mosberger <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/coff-m68k.c b/binutils-2.25/bfd/coff-m68k.c
index 5287beb8..f7089a68 100644
--- a/binutils-2.25/bfd/coff-m68k.c
+++ b/binutils-2.25/bfd/coff-m68k.c
@@ -1,7 +1,5 @@
/* BFD back-end for Motorola 68000 COFF binaries.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999,
- 2000, 2001, 2002, 2003, 2005, 2007, 2008, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -32,7 +30,7 @@
variants. The following macros control its behaviour:
TARGET_SYM
- The C name of the BFD target vector. The default is m68kcoff_vec.
+ The C name of the BFD target vector. The default is m68k_coff_vec.
TARGET_NAME
The user visible target name. The default is "coff-m68k".
NAMES_HAVE_UNDERSCORE
@@ -530,7 +528,7 @@ bfd_m68k_coff_create_embedded_relocs (bfd *abfd,
#include "coffcode.h"
#ifndef TARGET_SYM
-#define TARGET_SYM m68kcoff_vec
+#define TARGET_SYM m68k_coff_vec
#endif
#ifndef TARGET_NAME
diff --git a/binutils-2.25/bfd/coff-m88k.c b/binutils-2.25/bfd/coff-m88k.c
index e51bd054..7d474f95 100644
--- a/binutils-2.25/bfd/coff-m88k.c
+++ b/binutils-2.25/bfd/coff-m88k.c
@@ -1,6 +1,5 @@
/* BFD back-end for Motorola 88000 COFF "Binary Compatibility Standard" files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2005, 2007, 2008, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -282,4 +281,4 @@ reloc_processing (arelent *relent,
#undef coff_write_armap
-CREATE_BIG_COFF_TARGET_VEC (m88kbcs_vec, "coff-m88kbcs", 0, 0, '_', NULL, COFF_SWAP_TABLE)
+CREATE_BIG_COFF_TARGET_VEC (m88k_coff_bcs_vec, "coff-m88kbcs", 0, 0, '_', NULL, COFF_SWAP_TABLE)
diff --git a/binutils-2.25/bfd/coff-mcore.c b/binutils-2.25/bfd/coff-mcore.c
index 9431e465..7dad44fd 100644
--- a/binutils-2.25/bfd/coff-mcore.c
+++ b/binutils-2.25/bfd/coff-mcore.c
@@ -1,6 +1,5 @@
/* BFD back-end for Motorola MCore COFF/PE
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/coff-mips.c b/binutils-2.25/bfd/coff-mips.c
index ec4d1a55..298671c1 100644
--- a/binutils-2.25/bfd/coff-mips.c
+++ b/binutils-2.25/bfd/coff-mips.c
@@ -1,7 +1,5 @@
/* BFD back-end for MIPS Extended-Coff files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Original version by Per Bothner.
Full support added by Ian Lance Taylor, ian@cygnus.com.
@@ -1256,7 +1254,7 @@ static const struct ecoff_backend_data mips_ecoff_backend_data =
mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out,
mips_ecoff_swap_scnhdr_out,
FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE,
- ECOFF_NO_LONG_SECTION_NAMES, 4, FALSE, 2,
+ ECOFF_NO_LONG_SECTION_NAMES, 4, FALSE, 2, 32768,
mips_ecoff_swap_filehdr_in, mips_ecoff_swap_aouthdr_in,
mips_ecoff_swap_scnhdr_in, NULL,
mips_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
@@ -1365,9 +1363,9 @@ static const struct ecoff_backend_data mips_ecoff_backend_data =
_bfd_coff_section_already_linked
#define _bfd_ecoff_bfd_define_common_symbol bfd_generic_define_common_symbol
-extern const bfd_target ecoff_big_vec;
+extern const bfd_target mips_ecoff_be_vec;
-const bfd_target ecoff_little_vec =
+const bfd_target mips_ecoff_le_vec =
{
"ecoff-littlemips", /* name */
bfd_target_ecoff_flavour,
@@ -1407,12 +1405,12 @@ const bfd_target ecoff_little_vec =
BFD_JUMP_TABLE_LINK (_bfd_ecoff),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- & ecoff_big_vec,
+ & mips_ecoff_be_vec,
& mips_ecoff_backend_data
};
-const bfd_target ecoff_big_vec =
+const bfd_target mips_ecoff_be_vec =
{
"ecoff-bigmips", /* name */
bfd_target_ecoff_flavour,
@@ -1451,12 +1449,12 @@ const bfd_target ecoff_big_vec =
BFD_JUMP_TABLE_LINK (_bfd_ecoff),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- & ecoff_little_vec,
+ & mips_ecoff_le_vec,
& mips_ecoff_backend_data
};
-const bfd_target ecoff_biglittle_vec =
+const bfd_target mips_ecoff_bele_vec =
{
"ecoff-biglittlemips", /* name */
bfd_target_ecoff_flavour,
diff --git a/binutils-2.25/bfd/coff-or32.c b/binutils-2.25/bfd/coff-or32.c
deleted file mode 100644
index 18835e13..00000000
--- a/binutils-2.25/bfd/coff-or32.c
+++ /dev/null
@@ -1,629 +0,0 @@
-/* BFD back-end for OpenRISC 1000 COFF binaries.
- Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012
- Free Software Foundation, Inc.
- Contributed by Ivan Guzvinec <ivang@opencores.org>
-
- This file is part of BFD, the Binary File Descriptor library.
-
- 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
-
-#define OR32 1
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "libbfd.h"
-#include "coff/or32.h"
-#include "coff/internal.h"
-#include "libcoff.h"
-
-static bfd_reloc_status_type or32_reloc
- (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
-
-#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
-
-#define INSERT_HWORD(WORD,HWORD) \
- (((WORD) & 0xffff0000) | ((HWORD)& 0x0000ffff))
-#define EXTRACT_HWORD(WORD) \
- ((WORD) & 0x0000ffff)
-#define SIGN_EXTEND_HWORD(HWORD) \
- ((HWORD) & 0x8000 ? (HWORD)|(~0xffffL) : (HWORD))
-
-#define INSERT_JUMPTARG(WORD,JT) \
- (((WORD) & 0xfc000000) | ((JT)& 0x03ffffff))
-#define EXTRACT_JUMPTARG(WORD) \
- ((WORD) & 0x03ffffff)
-#define SIGN_EXTEND_JUMPTARG(JT) \
- ((JT) & 0x04000000 ? (JT)|(~0x03ffffffL) : (JT))
-
-/* Provided the symbol, returns the value reffed. */
-
-static long
-get_symbol_value (asymbol *symbol)
-{
- long relocation = 0;
-
- if (bfd_is_com_section (symbol->section))
- relocation = 0;
- else
- relocation = symbol->value +
- symbol->section->output_section->vma +
- symbol->section->output_offset;
-
- return relocation;
-}
-
-/* This function is in charge of performing all the or32 relocations. */
-
-static bfd_reloc_status_type
-or32_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol_in,
- void * data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message)
-{
- /* The consth relocation comes in two parts, we have to remember
- the state between calls, in these variables. */
- static bfd_boolean part1_consth_active = FALSE;
- static unsigned long part1_consth_value;
-
- unsigned long insn;
- unsigned long sym_value;
- unsigned long unsigned_value;
- unsigned short r_type;
- long signed_value;
-
- unsigned long addr = reloc_entry->address ; /*+ input_section->vma*/
- bfd_byte *hit_data =addr + (bfd_byte *)(data);
-
- r_type = reloc_entry->howto->type;
-
- if (output_bfd)
- {
- /* Partial linking - do nothing. */
- reloc_entry->address += input_section->output_offset;
- return bfd_reloc_ok;
- }
-
- if (symbol_in != NULL
- && bfd_is_und_section (symbol_in->section))
- {
- /* Keep the state machine happy in case we're called again. */
- if (r_type == R_IHIHALF)
- {
- part1_consth_active = TRUE;
- part1_consth_value = 0;
- }
-
- return bfd_reloc_undefined;
- }
-
- if ((part1_consth_active) && (r_type != R_IHCONST))
- {
- part1_consth_active = FALSE;
- *error_message = (char *) "Missing IHCONST";
-
- return bfd_reloc_dangerous;
- }
-
- sym_value = get_symbol_value (symbol_in);
-
- switch (r_type)
- {
- case R_IREL:
- insn = bfd_get_32(abfd, hit_data);
-
- /* Take the value in the field and sign extend it. */
- signed_value = EXTRACT_JUMPTARG (insn);
- signed_value = SIGN_EXTEND_JUMPTARG (signed_value);
- signed_value <<= 2;
-
- /* See the note on the R_IREL reloc in coff_or32_relocate_section. */
- if (signed_value == - (long) reloc_entry->address)
- signed_value = 0;
-
- signed_value += sym_value + reloc_entry->addend;
- /* Relative jmp/call, so subtract from the value the
- address of the place we're coming from. */
- signed_value -= (reloc_entry->address
- + input_section->output_section->vma
- + input_section->output_offset);
- if (signed_value > 0x7ffffff || signed_value < -0x8000000)
- return bfd_reloc_overflow;
-
- signed_value >>= 2;
- insn = INSERT_JUMPTARG (insn, signed_value);
- bfd_put_32 (abfd, insn, hit_data);
- break;
-
- case R_ILOHALF:
- insn = bfd_get_32 (abfd, hit_data);
- unsigned_value = EXTRACT_HWORD (insn);
- unsigned_value += sym_value + reloc_entry->addend;
- insn = INSERT_HWORD (insn, unsigned_value);
- bfd_put_32 (abfd, insn, hit_data);
- break;
-
- case R_IHIHALF:
- insn = bfd_get_32 (abfd, hit_data);
-
- /* consth, part 1
- Just get the symbol value that is referenced. */
- part1_consth_active = TRUE;
- part1_consth_value = sym_value + reloc_entry->addend;
-
- /* Don't modify insn until R_IHCONST. */
- break;
-
- case R_IHCONST:
- insn = bfd_get_32 (abfd, hit_data);
-
- /* consth, part 2
- Now relocate the reference. */
- if (! part1_consth_active)
- {
- *error_message = (char *) "Missing IHIHALF";
- return bfd_reloc_dangerous;
- }
-
- /* sym_ptr_ptr = r_symndx, in coff_slurp_reloc_table() */
- unsigned_value = 0; /*EXTRACT_HWORD(insn) << 16;*/
- unsigned_value += reloc_entry->addend; /* r_symndx */
- unsigned_value += part1_consth_value;
- unsigned_value = unsigned_value >> 16;
- insn = INSERT_HWORD (insn, unsigned_value);
- part1_consth_active = FALSE;
- bfd_put_32 (abfd, insn, hit_data);
- break;
-
- case R_BYTE:
- insn = bfd_get_8 (abfd, hit_data);
- unsigned_value = insn + sym_value + reloc_entry->addend;
- if (unsigned_value & 0xffffff00)
- return bfd_reloc_overflow;
- bfd_put_8 (abfd, unsigned_value, hit_data);
- break;
-
- case R_HWORD:
- insn = bfd_get_16 (abfd, hit_data);
- unsigned_value = insn + sym_value + reloc_entry->addend;
- if (unsigned_value & 0xffff0000)
- return bfd_reloc_overflow;
- bfd_put_16 (abfd, insn, hit_data);
- break;
-
- case R_WORD:
- insn = bfd_get_32 (abfd, hit_data);
- insn += sym_value + reloc_entry->addend;
- bfd_put_32 (abfd, insn, hit_data);
- break;
-
- default:
- *error_message = _("Unrecognized reloc");
- return bfd_reloc_dangerous;
- }
-
- return bfd_reloc_ok;
-}
-
-/* type rightshift
- size
- bitsize
- pc-relative
- bitpos
- absolute
- complain_on_overflow
- special_function
- relocation name
- partial_inplace
- src_mask
-*/
-
-/* FIXME: I'm not real sure about this table. */
-static reloc_howto_type howto_table[] =
-{
- { R_ABS, 0, 3, 32, FALSE, 0, complain_overflow_bitfield, or32_reloc, "ABS", TRUE, 0xffffffff,0xffffffff, FALSE },
- EMPTY_HOWTO (1),
- EMPTY_HOWTO (2),
- EMPTY_HOWTO (3),
- EMPTY_HOWTO (4),
- EMPTY_HOWTO (5),
- EMPTY_HOWTO (6),
- EMPTY_HOWTO (7),
- EMPTY_HOWTO (8),
- EMPTY_HOWTO (9),
- EMPTY_HOWTO (10),
- EMPTY_HOWTO (11),
- EMPTY_HOWTO (12),
- EMPTY_HOWTO (13),
- EMPTY_HOWTO (14),
- EMPTY_HOWTO (15),
- EMPTY_HOWTO (16),
- EMPTY_HOWTO (17),
- EMPTY_HOWTO (18),
- EMPTY_HOWTO (19),
- EMPTY_HOWTO (20),
- EMPTY_HOWTO (21),
- EMPTY_HOWTO (22),
- EMPTY_HOWTO (23),
- { R_IREL, 0, 3, 32, TRUE, 0, complain_overflow_signed, or32_reloc, "IREL", TRUE, 0xffffffff,0xffffffff, FALSE },
- { R_IABS, 0, 3, 32, FALSE, 0, complain_overflow_bitfield, or32_reloc, "IABS", TRUE, 0xffffffff,0xffffffff, FALSE },
- { R_ILOHALF, 0, 3, 16, TRUE, 0, complain_overflow_signed, or32_reloc, "ILOHALF", TRUE, 0x0000ffff,0x0000ffff, FALSE },
- { R_IHIHALF, 0, 3, 16, TRUE, 16,complain_overflow_signed, or32_reloc, "IHIHALF", TRUE, 0xffff0000,0xffff0000, FALSE },
- { R_IHCONST, 0, 3, 16, TRUE, 0, complain_overflow_signed, or32_reloc, "IHCONST", TRUE, 0xffff0000,0xffff0000, FALSE },
- { R_BYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, or32_reloc, "BYTE", TRUE, 0x000000ff,0x000000ff, FALSE },
- { R_HWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, or32_reloc, "HWORD", TRUE, 0x0000ffff,0x0000ffff, FALSE },
- { R_WORD, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, or32_reloc, "WORD", TRUE, 0xffffffff,0xffffffff, FALSE },
-};
-
-#define BADMAG(x) OR32BADMAG (x)
-
-#define RELOC_PROCESSING(relent, reloc, symbols, abfd, section) \
- reloc_processing (relent, reloc, symbols, abfd, section)
-
-static void
-reloc_processing (arelent *relent,
- struct internal_reloc *reloc,
- asymbol **symbols,
- bfd *abfd,
- asection *section)
-{
- static bfd_vma ihihalf_vaddr = (bfd_vma) -1;
-
- relent->address = reloc->r_vaddr;
- relent->howto = howto_table + reloc->r_type;
-
- if (reloc->r_type == R_IHCONST)
- {
- /* The address of an R_IHCONST should always be the address of
- the immediately preceding R_IHIHALF. relocs generated by gas
- are correct, but relocs generated by High C are different (I
- can't figure out what the address means for High C). We can
- handle both gas and High C by ignoring the address here, and
- simply reusing the address saved for R_IHIHALF. */
- if (ihihalf_vaddr == (bfd_vma) -1)
- abort ();
-
- relent->address = ihihalf_vaddr;
- ihihalf_vaddr = (bfd_vma) -1;
- relent->addend = reloc->r_symndx;
- relent->sym_ptr_ptr= bfd_abs_section_ptr->symbol_ptr_ptr;
- }
- else
- {
- relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
- relent->addend = 0;
- relent->address-= section->vma;
-
- if (reloc->r_type == R_IHIHALF)
- ihihalf_vaddr = relent->address;
- else if (ihihalf_vaddr != (bfd_vma) -1)
- abort ();
- }
-}
-
-/* The reloc processing routine for the optimized COFF linker. */
-
-static bfd_boolean
-coff_or32_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info,
- bfd *input_bfd,
- asection *input_section,
- bfd_byte *contents,
- struct internal_reloc *relocs,
- struct internal_syment *syms,
- asection **sections)
-{
- struct internal_reloc *rel;
- struct internal_reloc *relend;
- bfd_boolean hihalf;
- bfd_vma hihalf_val;
-
- /* If we are performing a relocatable link, we don't need to do a
- thing. The caller will take care of adjusting the reloc
- addresses and symbol indices. */
- if (info->relocatable)
- return TRUE;
-
- hihalf = FALSE;
- hihalf_val = 0;
-
- rel = relocs;
- relend = rel + input_section->reloc_count;
-
- for (; rel < relend; rel++)
- {
- long symndx;
- bfd_byte *loc;
- struct coff_link_hash_entry *h;
- struct internal_syment *sym;
- asection *sec;
- bfd_vma val;
- bfd_boolean overflow;
- unsigned long insn;
- long signed_value;
- unsigned long unsigned_value;
- bfd_reloc_status_type rstat;
-
- symndx = rel->r_symndx;
- loc = contents + rel->r_vaddr - input_section->vma;
-
- if (symndx == -1 || rel->r_type == R_IHCONST)
- h = NULL;
- else
- h = obj_coff_sym_hashes (input_bfd)[symndx];
-
- sym = NULL;
- sec = NULL;
- val = 0;
-
- /* An R_IHCONST reloc does not have a symbol. Instead, the
- symbol index is an addend. R_IHCONST is always used in
- conjunction with R_IHHALF. */
- if (rel->r_type != R_IHCONST)
- {
- if (h == NULL)
- {
- if (symndx == -1)
- sec = bfd_abs_section_ptr;
- else
- {
- sym = syms + symndx;
- sec = sections[symndx];
- val = (sec->output_section->vma
- + sec->output_offset
- + sym->n_value
- - sec->vma);
- }
- }
- else
- {
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- val = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma, TRUE)))
- return FALSE;
- }
- }
-
- if (hihalf)
- {
- if (! ((*info->callbacks->reloc_dangerous)
- (info, "missing IHCONST reloc", input_bfd,
- input_section, rel->r_vaddr - input_section->vma)))
- return FALSE;
- hihalf = FALSE;
- }
- }
-
- overflow = FALSE;
-
- switch (rel->r_type)
- {
- default:
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
-
- case R_IREL:
- insn = bfd_get_32 (input_bfd, loc);
-
- /* Extract the addend. */
- signed_value = EXTRACT_JUMPTARG (insn);
- signed_value = SIGN_EXTEND_JUMPTARG (signed_value);
- signed_value <<= 2;
-
- /* Determine the destination of the jump. */
- signed_value += val;
-
- /* Make the destination PC relative. */
- signed_value -= (input_section->output_section->vma
- + input_section->output_offset
- + (rel->r_vaddr - input_section->vma));
- if (signed_value > 0x7ffffff || signed_value < - 0x8000000)
- {
- overflow = TRUE;
- signed_value = 0;
- }
-
- /* Put the adjusted value back into the instruction. */
- signed_value >>= 2;
- insn = INSERT_JUMPTARG(insn, signed_value);
-
- bfd_put_32 (input_bfd, (bfd_vma) insn, loc);
- break;
-
- case R_ILOHALF:
- insn = bfd_get_32 (input_bfd, loc);
- unsigned_value = EXTRACT_HWORD (insn);
- unsigned_value += val;
- insn = INSERT_HWORD (insn, unsigned_value);
- bfd_put_32 (input_bfd, insn, loc);
- break;
-
- case R_IHIHALF:
- /* Save the value for the R_IHCONST reloc. */
- hihalf = TRUE;
- hihalf_val = val;
- break;
-
- case R_IHCONST:
- if (! hihalf)
- {
- if (! ((*info->callbacks->reloc_dangerous)
- (info, "missing IHIHALF reloc", input_bfd,
- input_section, rel->r_vaddr - input_section->vma)))
- return FALSE;
- hihalf_val = 0;
- }
-
- insn = bfd_get_32 (input_bfd, loc);
- unsigned_value = rel->r_symndx + hihalf_val;
- unsigned_value >>= 16;
- insn = INSERT_HWORD (insn, unsigned_value);
- bfd_put_32 (input_bfd, (bfd_vma) insn, loc);
-
- hihalf = FALSE;
- break;
-
- case R_BYTE:
- case R_HWORD:
- case R_WORD:
- rstat = _bfd_relocate_contents (howto_table + rel->r_type,
- input_bfd, val, loc);
- if (rstat == bfd_reloc_overflow)
- overflow = TRUE;
- else if (rstat != bfd_reloc_ok)
- abort ();
- break;
- }
-
- if (overflow)
- {
- const char *name;
- char buf[SYMNMLEN + 1];
-
- if (symndx == -1)
- name = "*ABS*";
- else if (h != NULL)
- name = NULL;
- else if (sym == NULL)
- name = "*unknown*";
- else if (sym->_n._n_n._n_zeroes == 0
- && sym->_n._n_n._n_offset != 0)
- name = obj_coff_strings (input_bfd) + sym->_n._n_n._n_offset;
- else
- {
- strncpy (buf, sym->_n._n_name, SYMNMLEN);
- buf[SYMNMLEN] = '\0';
- name = buf;
- }
-
- if (! ((*info->callbacks->reloc_overflow)
- (info, (h ? &h->root : NULL), name,
- howto_table[rel->r_type].name, (bfd_vma) 0, input_bfd,
- input_section, rel->r_vaddr - input_section->vma)))
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-#define coff_relocate_section coff_or32_relocate_section
-
-/* We don't want to change the symndx of a R_IHCONST reloc, since it
- is actually an addend, not a symbol index at all. */
-
-static bfd_boolean
-coff_or32_adjust_symndx (bfd *obfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info ATTRIBUTE_UNUSED,
- bfd *ibfd ATTRIBUTE_UNUSED,
- asection *sec ATTRIBUTE_UNUSED,
- struct internal_reloc *irel,
- bfd_boolean *adjustedp)
-{
- if (irel->r_type == R_IHCONST)
- *adjustedp = TRUE;
- else
- *adjustedp = FALSE;
- return TRUE;
-}
-
-#define coff_adjust_symndx coff_or32_adjust_symndx
-
-#ifndef bfd_pe_print_pdata
-#define bfd_pe_print_pdata NULL
-#endif
-
-#include "coffcode.h"
-
-const bfd_target or32coff_big_vec =
-{
- "coff-or32-big", /* Name. */
- bfd_target_coff_flavour,
- BFD_ENDIAN_BIG, /* Data byte order is big. */
- BFD_ENDIAN_BIG, /* Header byte order is big. */
-
- (HAS_RELOC | EXEC_P | /* Object flags. */
- HAS_LINENO | HAS_DEBUG |
- HAS_SYMS | HAS_LOCALS | WP_TEXT),
-
- (SEC_HAS_CONTENTS | SEC_ALLOC | /* Section flags. */
- SEC_LOAD | SEC_RELOC |
- SEC_READONLY ),
- '_', /* Leading underscore. */
- '/', /* ar_pad_char. */
- 15, /* ar_max_namelen. */
- 0, /* match priority. */
-
- /* Data. */
- bfd_getb64, bfd_getb_signed_64, bfd_putb64,
- bfd_getb32, bfd_getb_signed_32, bfd_putb32,
- bfd_getb16, bfd_getb_signed_16, bfd_putb16,
-
- /* Headers. */
- bfd_getb64, bfd_getb_signed_64, bfd_putb64,
- bfd_getb32, bfd_getb_signed_32, bfd_putb32,
- bfd_getb16, bfd_getb_signed_16, bfd_putb16,
-
- {
- _bfd_dummy_target,
- coff_object_p,
- bfd_generic_archive_p,
- _bfd_dummy_target
- },
- {
- bfd_false,
- coff_mkobject,
- _bfd_generic_mkarchive,
- bfd_false
- },
- {
- bfd_false,
- coff_write_object_contents,
- _bfd_write_archive_contents,
- bfd_false
- },
-
- BFD_JUMP_TABLE_GENERIC (coff),
- BFD_JUMP_TABLE_COPY (coff),
- BFD_JUMP_TABLE_CORE (_bfd_nocore),
- BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
- BFD_JUMP_TABLE_SYMBOLS (coff),
- BFD_JUMP_TABLE_RELOCS (coff),
- BFD_JUMP_TABLE_WRITE (coff),
- BFD_JUMP_TABLE_LINK (coff),
- BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
- /* Alternative_target. */
-#ifdef TARGET_LITTLE_SYM
- & TARGET_LITTLE_SYM,
-#else
- NULL,
-#endif
-
- COFF_SWAP_TABLE
-};
diff --git a/binutils-2.25/bfd/coff-ppc.c b/binutils-2.25/bfd/coff-ppc.c
index eb1aa81a..32d30120 100644
--- a/binutils-2.25/bfd/coff-ppc.c
+++ b/binutils-2.25/bfd/coff-ppc.c
@@ -1,7 +1,5 @@
/* BFD back-end for PowerPC Microsoft Portable Executable files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
- 2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Original version pieced together by Kim Knuttila (krk@cygnus.com)
@@ -1075,10 +1073,11 @@ coff_ppc_relocate_section (bfd *output_bfd,
{
/* It is a file local symbol. */
int *local_toc_table;
- const char *name;
+ char name[SYMNMLEN + 1];
sym = syms + symndx;
- name = sym->_n._n_name;
+ strncpy (name, sym->_n._n_name, SYMNMLEN);
+ name[SYMNMLEN] = '\0';
local_toc_table = obj_coff_local_toc_table(input_bfd);
our_toc_offset = local_toc_table[symndx];
@@ -1227,9 +1226,14 @@ coff_ppc_relocate_section (bfd *output_bfd,
case IMAGE_REL_PPC_ABSOLUTE:
{
const char *my_name;
+ char buf[SYMNMLEN + 1];
if (h == 0)
- my_name = (syms+symndx)->_n._n_name;
+ {
+ strncpy (buf, (syms+symndx)->_n._n_name, SYMNMLEN);
+ buf[SYMNMLEN] = '\0';
+ my_name = buf;
+ }
else
my_name = h->root.root.root.string;
@@ -1290,11 +1294,8 @@ coff_ppc_relocate_section (bfd *output_bfd,
}
if (h == 0)
- {
- /* It is a file local symbol. */
- sym = syms + symndx;
- name = sym->_n._n_name;
- }
+ /* It is a file local symbol. */
+ sym = syms + symndx;
else
{
char *target = 0;
@@ -2151,7 +2152,7 @@ ppc_bfd_coff_final_link (bfd *abfd, struct bfd_link_info *info)
the opportunity to clear the output_has_begun fields of all the
input BFD's. */
max_sym_count = 0;
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
bfd_size_type sz;
diff --git a/binutils-2.25/bfd/coff-rs6000.c b/binutils-2.25/bfd/coff-rs6000.c
index 0386e9a2..fea5f3bc 100644
--- a/binutils-2.25/bfd/coff-rs6000.c
+++ b/binutils-2.25/bfd/coff-rs6000.c
@@ -1,7 +1,5 @@
/* BFD back-end for IBM RS/6000 "XCOFF" files.
- Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Metin G. Ozisik, Mimi Phuong-Thao Vo, and John Gilmore.
Archive support from Damon A. Permezel.
Contributed by IBM Corporation and Cygnus Support.
@@ -77,10 +75,7 @@ void xcoff_rtype2howto (arelent *, struct internal_reloc *);
#define NO_COFF_SYMBOLS
#define RTYPE2HOWTO(cache_ptr, dst) xcoff_rtype2howto (cache_ptr, dst)
#define coff_mkobject _bfd_xcoff_mkobject
-#define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data
#define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name
-#define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup
-#define coff_bfd_reloc_name_lookup _bfd_xcoff_reloc_name_lookup
#ifdef AIX_CORE
extern const bfd_target * rs6000coff_core_p (bfd *abfd);
extern bfd_boolean rs6000coff_core_file_matches_executable_p
@@ -119,6 +114,7 @@ extern int rs6000coff_core_file_failing_signal (bfd *abfd);
#define bfd_pe_print_pdata NULL
#endif
+#include <stdint.h>
#include "coffcode.h"
/* The main body of code is in coffcode.h. */
@@ -434,39 +430,6 @@ static const struct dwarf_debug_section xcoff_debug_sections[] =
{ NULL, NULL }, /* .debug_weaknames */
{ NULL, NULL },
};
-
-static bfd_boolean
-xcoff_find_nearest_line (bfd *abfd,
- asection *section,
- asymbol **symbols,
- bfd_vma offset,
- const char **filename_ptr,
- const char **functionname_ptr,
- unsigned int *line_ptr)
-{
- return coff_find_nearest_line_with_names (abfd, xcoff_debug_sections,
- section, symbols, offset,
- filename_ptr, functionname_ptr,
- line_ptr);
-}
-
-static bfd_boolean
-xcoff_find_nearest_line_discriminator (bfd *abfd,
- asection *section,
- asymbol **symbols,
- bfd_vma offset,
- const char **filename_ptr,
- const char **functionname_ptr,
- unsigned int *line_ptr,
- unsigned int *discriminator)
-{
- *discriminator = 0;
- return coff_find_nearest_line_with_names (abfd, xcoff_debug_sections,
- section, symbols, offset,
- filename_ptr, functionname_ptr,
- line_ptr);
-}
-
void
_bfd_xcoff_swap_sym_in (bfd *abfd, void * ext1, void * in1)
@@ -2407,7 +2370,10 @@ xcoff_write_archive_contents_big (bfd *abfd)
PRINT20 (ahdrp->nextoff, iterator.next.offset);
if (!do_pad (abfd, iterator.current.leading_padding))
- return FALSE;
+ {
+ free (offsets);
+ return FALSE;
+ }
BFD_ASSERT (iterator.current.offset == bfd_tell (abfd));
namlen = iterator.current.padded_namlen;
@@ -2417,7 +2383,10 @@ xcoff_write_archive_contents_big (bfd *abfd)
|| bfd_seek (iterator.current.member, 0, SEEK_SET) != 0
|| !do_copy (abfd, iterator.current.member)
|| !do_pad (abfd, iterator.current.trailing_padding))
- return FALSE;
+ {
+ free (offsets);
+ return FALSE;
+ }
offsets[i] = iterator.current.offset;
prevoff = iterator.current.offset;
@@ -2462,7 +2431,10 @@ xcoff_write_archive_contents_big (bfd *abfd)
member_table_size += member_table_size & 1;
member_table = bfd_zmalloc (member_table_size);
if (member_table == NULL)
- return FALSE;
+ {
+ free (offsets);
+ return FALSE;
+ }
hdr = (struct xcoff_ar_hdr_big *) member_table;
@@ -2603,7 +2575,7 @@ _bfd_xcoff_sizeof_headers (bfd *abfd,
return -1;
/* Sum. */
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
for (s = sub->sections; s != NULL; s = s->next)
{
struct nbr_reloc_lineno *e = &n_rl[s->output_section->index];
@@ -3995,6 +3967,84 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = {
{ SSUBTYP_DWRNGES, ".dwrnges", TRUE }
};
+/* For generic entry points. */
+#define _bfd_xcoff_close_and_cleanup _bfd_archive_close_and_cleanup
+#define _bfd_xcoff_bfd_free_cached_info bfd_true
+#define _bfd_xcoff_new_section_hook coff_new_section_hook
+#define _bfd_xcoff_get_section_contents _bfd_generic_get_section_contents
+#define _bfd_xcoff_get_section_contents_in_window \
+ _bfd_generic_get_section_contents_in_window
+
+/* For copy private data entry points. */
+#define _bfd_xcoff_bfd_copy_private_bfd_data \
+ _bfd_xcoff_copy_private_bfd_data
+#define _bfd_xcoff_bfd_merge_private_bfd_data \
+ _bfd_generic_bfd_merge_private_bfd_data
+#define _bfd_xcoff_bfd_copy_private_section_data \
+ _bfd_generic_bfd_copy_private_section_data
+#define _bfd_xcoff_bfd_copy_private_symbol_data \
+ _bfd_generic_bfd_copy_private_symbol_data
+#define _bfd_xcoff_bfd_copy_private_header_data \
+ _bfd_generic_bfd_copy_private_header_data
+#define _bfd_xcoff_bfd_set_private_flags \
+ _bfd_generic_bfd_set_private_flags
+#define _bfd_xcoff_bfd_print_private_bfd_data \
+ _bfd_generic_bfd_print_private_bfd_data
+
+/* For archive entry points. */
+#define _bfd_xcoff_slurp_extended_name_table \
+ _bfd_noarchive_slurp_extended_name_table
+#define _bfd_xcoff_construct_extended_name_table \
+ _bfd_noarchive_construct_extended_name_table
+#define _bfd_xcoff_truncate_arname bfd_dont_truncate_arname
+#define _bfd_xcoff_write_ar_hdr _bfd_generic_write_ar_hdr
+#define _bfd_xcoff_get_elt_at_index _bfd_generic_get_elt_at_index
+#define _bfd_xcoff_generic_stat_arch_elt _bfd_xcoff_stat_arch_elt
+#define _bfd_xcoff_update_armap_timestamp bfd_true
+
+/* For symbols entry points. */
+#define _bfd_xcoff_get_symtab_upper_bound coff_get_symtab_upper_bound
+#define _bfd_xcoff_canonicalize_symtab coff_canonicalize_symtab
+#define _bfd_xcoff_make_empty_symbol coff_make_empty_symbol
+#define _bfd_xcoff_print_symbol coff_print_symbol
+#define _bfd_xcoff_get_symbol_info coff_get_symbol_info
+#define _bfd_xcoff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name
+#define _bfd_xcoff_bfd_is_target_special_symbol \
+ coff_bfd_is_target_special_symbol
+#define _bfd_xcoff_get_lineno coff_get_lineno
+#define _bfd_xcoff_find_nearest_line coff_find_nearest_line
+#define _bfd_xcoff_find_line coff_find_line
+#define _bfd_xcoff_find_inliner_info coff_find_inliner_info
+#define _bfd_xcoff_bfd_make_debug_symbol coff_bfd_make_debug_symbol
+#define _bfd_xcoff_read_minisymbols _bfd_generic_read_minisymbols
+#define _bfd_xcoff_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+
+/* For reloc entry points. */
+#define _bfd_xcoff_get_reloc_upper_bound coff_get_reloc_upper_bound
+#define _bfd_xcoff_canonicalize_reloc coff_canonicalize_reloc
+#define _bfd_xcoff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup
+#define _bfd_xcoff_bfd_reloc_name_lookup _bfd_xcoff_reloc_name_lookup
+
+/* For link entry points. */
+#define _bfd_xcoff_bfd_get_relocated_section_contents \
+ bfd_generic_get_relocated_section_contents
+#define _bfd_xcoff_bfd_relax_section bfd_generic_relax_section
+#define _bfd_xcoff_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
+#define _bfd_xcoff_bfd_link_just_syms _bfd_generic_link_just_syms
+#define _bfd_xcoff_bfd_copy_link_hash_symbol_type \
+ _bfd_generic_copy_link_hash_symbol_type
+#define _bfd_xcoff_bfd_link_split_section _bfd_generic_link_split_section
+#define _bfd_xcoff_bfd_gc_sections bfd_generic_gc_sections
+#define _bfd_xcoff_bfd_lookup_section_flags bfd_generic_lookup_section_flags
+#define _bfd_xcoff_bfd_merge_sections bfd_generic_merge_sections
+#define _bfd_xcoff_bfd_is_group_section bfd_generic_is_group_section
+#define _bfd_xcoff_bfd_discard_group bfd_generic_discard_group
+#define _bfd_xcoff_section_already_linked _bfd_generic_section_already_linked
+#define _bfd_xcoff_bfd_define_common_symbol _bfd_xcoff_define_common_symbol
+
+/* For dynamic symbols and relocs entry points. */
+#define _bfd_xcoff_get_synthetic_symtab _bfd_nodynamic_get_synthetic_symtab
+
static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
{
{ /* COFF backend, defined in libcoff.h. */
@@ -4021,6 +4071,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
3, /* _bfd_coff_default_section_alignment_power */
FALSE, /* _bfd_coff_force_symnames_in_strings */
2, /* _bfd_coff_debug_string_prefix_length */
+ 32768, /* _bfd_coff_max_nscns */
coff_swap_filehdr_in,
coff_swap_aouthdr_in,
coff_swap_scnhdr_in,
@@ -4092,7 +4143,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
};
/* The transfer vector that leads the outside world to all of the above. */
-const bfd_target rs6000coff_vec =
+const bfd_target rs6000_xcoff_vec =
{
"aixcoff-rs6000",
bfd_target_xcoff_flavour,
@@ -4151,91 +4202,15 @@ const bfd_target rs6000coff_vec =
bfd_false
},
- /* Generic */
- _bfd_archive_close_and_cleanup,
- bfd_true,
- coff_new_section_hook,
- _bfd_generic_get_section_contents,
- _bfd_generic_get_section_contents_in_window,
-
- /* Copy */
- _bfd_xcoff_copy_private_bfd_data,
- _bfd_generic_bfd_merge_private_bfd_data,
- _bfd_generic_init_private_section_data,
- _bfd_generic_bfd_copy_private_section_data,
- _bfd_generic_bfd_copy_private_symbol_data,
- _bfd_generic_bfd_copy_private_header_data,
- _bfd_generic_bfd_set_private_flags,
- _bfd_generic_bfd_print_private_bfd_data,
-
- /* Core */
+ BFD_JUMP_TABLE_GENERIC (_bfd_xcoff),
+ BFD_JUMP_TABLE_COPY (_bfd_xcoff),
BFD_JUMP_TABLE_CORE (coff),
-
- /* Archive */
- _bfd_xcoff_slurp_armap,
- _bfd_noarchive_slurp_extended_name_table,
- _bfd_noarchive_construct_extended_name_table,
- bfd_dont_truncate_arname,
- _bfd_xcoff_write_armap,
- _bfd_xcoff_read_ar_hdr,
- _bfd_generic_write_ar_hdr,
- _bfd_xcoff_openr_next_archived_file,
- _bfd_generic_get_elt_at_index,
- _bfd_xcoff_stat_arch_elt,
- bfd_true,
-
- /* Symbols */
- coff_get_symtab_upper_bound,
- coff_canonicalize_symtab,
- coff_make_empty_symbol,
- coff_print_symbol,
- coff_get_symbol_info,
- _bfd_xcoff_is_local_label_name,
- coff_bfd_is_target_special_symbol,
- coff_get_lineno,
- xcoff_find_nearest_line,
- xcoff_find_nearest_line_discriminator,
- _bfd_generic_find_line,
- coff_find_inliner_info,
- coff_bfd_make_debug_symbol,
- _bfd_generic_read_minisymbols,
- _bfd_generic_minisymbol_to_symbol,
-
- /* Reloc */
- coff_get_reloc_upper_bound,
- coff_canonicalize_reloc,
- _bfd_xcoff_reloc_type_lookup,
- _bfd_xcoff_reloc_name_lookup,
-
- /* Write */
- coff_set_arch_mach,
- coff_set_section_contents,
-
- /* Link */
- _bfd_xcoff_sizeof_headers,
- bfd_generic_get_relocated_section_contents,
- bfd_generic_relax_section,
- _bfd_xcoff_bfd_link_hash_table_create,
- _bfd_generic_link_hash_table_free,
- _bfd_xcoff_bfd_link_add_symbols,
- _bfd_generic_link_just_syms,
- _bfd_generic_copy_link_hash_symbol_type,
- _bfd_xcoff_bfd_final_link,
- _bfd_generic_link_split_section,
- bfd_generic_gc_sections,
- bfd_generic_lookup_section_flags,
- bfd_generic_merge_sections,
- bfd_generic_is_group_section,
- bfd_generic_discard_group,
- _bfd_generic_section_already_linked,
- _bfd_xcoff_define_common_symbol,
-
- /* Dynamic */
- _bfd_xcoff_get_dynamic_symtab_upper_bound,
- _bfd_xcoff_canonicalize_dynamic_symtab,
- _bfd_nodynamic_get_synthetic_symtab,
- _bfd_xcoff_get_dynamic_reloc_upper_bound,
- _bfd_xcoff_canonicalize_dynamic_reloc,
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_xcoff),
+ BFD_JUMP_TABLE_SYMBOLS (_bfd_xcoff),
+ BFD_JUMP_TABLE_RELOCS (_bfd_xcoff),
+ BFD_JUMP_TABLE_WRITE (coff),
+ BFD_JUMP_TABLE_LINK (_bfd_xcoff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_xcoff),
/* Opposite endian version, none exists */
NULL,
@@ -4277,6 +4252,7 @@ static const struct xcoff_backend_data_rec bfd_pmac_xcoff_backend_data =
3, /* _bfd_coff_default_section_alignment_power */
FALSE, /* _bfd_coff_force_symnames_in_strings */
2, /* _bfd_coff_debug_string_prefix_length */
+ 32768, /* _bfd_coff_max_nscns */
coff_swap_filehdr_in,
coff_swap_aouthdr_in,
coff_swap_scnhdr_in,
@@ -4348,7 +4324,7 @@ static const struct xcoff_backend_data_rec bfd_pmac_xcoff_backend_data =
};
/* The transfer vector that leads the outside world to all of the above. */
-const bfd_target pmac_xcoff_vec =
+const bfd_target powerpc_xcoff_vec =
{
"xcoff-powermac",
bfd_target_xcoff_flavour,
@@ -4407,91 +4383,15 @@ const bfd_target pmac_xcoff_vec =
bfd_false
},
- /* Generic */
- _bfd_archive_close_and_cleanup,
- bfd_true,
- coff_new_section_hook,
- _bfd_generic_get_section_contents,
- _bfd_generic_get_section_contents_in_window,
-
- /* Copy */
- _bfd_xcoff_copy_private_bfd_data,
- _bfd_generic_bfd_merge_private_bfd_data,
- _bfd_generic_init_private_section_data,
- _bfd_generic_bfd_copy_private_section_data,
- _bfd_generic_bfd_copy_private_symbol_data,
- _bfd_generic_bfd_copy_private_header_data,
- _bfd_generic_bfd_set_private_flags,
- _bfd_generic_bfd_print_private_bfd_data,
-
- /* Core */
+ BFD_JUMP_TABLE_GENERIC (_bfd_xcoff),
+ BFD_JUMP_TABLE_COPY (_bfd_xcoff),
BFD_JUMP_TABLE_CORE (coff),
-
- /* Archive */
- _bfd_xcoff_slurp_armap,
- _bfd_noarchive_slurp_extended_name_table,
- _bfd_noarchive_construct_extended_name_table,
- bfd_dont_truncate_arname,
- _bfd_xcoff_write_armap,
- _bfd_xcoff_read_ar_hdr,
- _bfd_generic_write_ar_hdr,
- _bfd_xcoff_openr_next_archived_file,
- _bfd_generic_get_elt_at_index,
- _bfd_xcoff_stat_arch_elt,
- bfd_true,
-
- /* Symbols */
- coff_get_symtab_upper_bound,
- coff_canonicalize_symtab,
- coff_make_empty_symbol,
- coff_print_symbol,
- coff_get_symbol_info,
- _bfd_xcoff_is_local_label_name,
- coff_bfd_is_target_special_symbol,
- coff_get_lineno,
- xcoff_find_nearest_line,
- _bfd_generic_find_nearest_line_discriminator,
- _bfd_generic_find_line,
- coff_find_inliner_info,
- coff_bfd_make_debug_symbol,
- _bfd_generic_read_minisymbols,
- _bfd_generic_minisymbol_to_symbol,
-
- /* Reloc */
- coff_get_reloc_upper_bound,
- coff_canonicalize_reloc,
- _bfd_xcoff_reloc_type_lookup,
- _bfd_xcoff_reloc_name_lookup,
-
- /* Write */
- coff_set_arch_mach,
- coff_set_section_contents,
-
- /* Link */
- _bfd_xcoff_sizeof_headers,
- bfd_generic_get_relocated_section_contents,
- bfd_generic_relax_section,
- _bfd_xcoff_bfd_link_hash_table_create,
- _bfd_generic_link_hash_table_free,
- _bfd_xcoff_bfd_link_add_symbols,
- _bfd_generic_link_just_syms,
- _bfd_generic_copy_link_hash_symbol_type,
- _bfd_xcoff_bfd_final_link,
- _bfd_generic_link_split_section,
- bfd_generic_gc_sections,
- bfd_generic_lookup_section_flags,
- bfd_generic_merge_sections,
- bfd_generic_is_group_section,
- bfd_generic_discard_group,
- _bfd_generic_section_already_linked,
- _bfd_xcoff_define_common_symbol,
-
- /* Dynamic */
- _bfd_xcoff_get_dynamic_symtab_upper_bound,
- _bfd_xcoff_canonicalize_dynamic_symtab,
- _bfd_nodynamic_get_synthetic_symtab,
- _bfd_xcoff_get_dynamic_reloc_upper_bound,
- _bfd_xcoff_canonicalize_dynamic_reloc,
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_xcoff),
+ BFD_JUMP_TABLE_SYMBOLS (_bfd_xcoff),
+ BFD_JUMP_TABLE_RELOCS (_bfd_xcoff),
+ BFD_JUMP_TABLE_WRITE (coff),
+ BFD_JUMP_TABLE_LINK (_bfd_xcoff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_xcoff),
/* Opposite endian version, none exists */
NULL,
diff --git a/binutils-2.25/bfd/coff-sh.c b/binutils-2.25/bfd/coff-sh.c
index f5e07a57..23e32ec6 100644
--- a/binutils-2.25/bfd/coff-sh.c
+++ b/binutils-2.25/bfd/coff-sh.c
@@ -1,7 +1,5 @@
/* BFD back-end for Renesas Super-H COFF binaries.
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
Relaxing code written by Ian Lance Taylor, <ian@cygnus.com>.
@@ -3000,13 +2998,13 @@ sh_coff_get_relocated_section_contents (bfd *output_bfd,
/* The target vectors. */
#ifndef TARGET_SHL_SYM
-CREATE_BIG_COFF_TARGET_VEC (shcoff_vec, "coff-sh", BFD_IS_RELAXABLE, 0, '_', NULL, COFF_SWAP_TABLE)
+CREATE_BIG_COFF_TARGET_VEC (sh_coff_vec, "coff-sh", BFD_IS_RELAXABLE, 0, '_', NULL, COFF_SWAP_TABLE)
#endif
#ifdef TARGET_SHL_SYM
#define TARGET_SYM TARGET_SHL_SYM
#else
-#define TARGET_SYM shlcoff_vec
+#define TARGET_SYM sh_coff_le_vec
#endif
#ifndef TARGET_SHL_NAME
@@ -3092,6 +3090,7 @@ static bfd_coff_backend_data bfd_coff_small_swap_table =
#else
2,
#endif
+ 32768,
coff_swap_filehdr_in, coff_swap_aouthdr_in, coff_swap_scnhdr_in,
coff_swap_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook,
coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
@@ -3113,9 +3112,9 @@ static bfd_coff_backend_data bfd_coff_small_swap_table =
#define coff_small_get_section_contents_in_window \
coff_get_section_contents_in_window
-extern const bfd_target shlcoff_small_vec;
+extern const bfd_target sh_coff_small_le_vec;
-const bfd_target shcoff_small_vec =
+const bfd_target sh_coff_small_vec =
{
"coff-sh-small", /* name */
bfd_target_coff_flavour,
@@ -3155,12 +3154,12 @@ const bfd_target shcoff_small_vec =
BFD_JUMP_TABLE_LINK (coff),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- & shlcoff_small_vec,
+ & sh_coff_small_le_vec,
& bfd_coff_small_swap_table
};
-const bfd_target shlcoff_small_vec =
+const bfd_target sh_coff_small_le_vec =
{
"coff-shl-small", /* name */
bfd_target_coff_flavour,
@@ -3200,7 +3199,7 @@ const bfd_target shlcoff_small_vec =
BFD_JUMP_TABLE_LINK (coff),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- & shcoff_small_vec,
+ & sh_coff_small_vec,
& bfd_coff_small_swap_table
};
diff --git a/binutils-2.25/bfd/coff-sparc.c b/binutils-2.25/bfd/coff-sparc.c
index d3802c03..031dcd08 100644
--- a/binutils-2.25/bfd/coff-sparc.c
+++ b/binutils-2.25/bfd/coff-sparc.c
@@ -1,6 +1,5 @@
/* BFD back-end for Sparc COFF files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
- 2002, 2003, 2005, 2007, 2008, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -199,7 +198,7 @@ rtype2howto (arelent *cache_ptr, struct internal_reloc *dst)
#include "coffcode.h"
#ifndef TARGET_SYM
-#define TARGET_SYM sparccoff_vec
+#define TARGET_SYM sparc_coff_vec
#endif
#ifndef TARGET_NAME
diff --git a/binutils-2.25/bfd/coff-stgo32.c b/binutils-2.25/bfd/coff-stgo32.c
index 882ddd2f..4dc90149 100644
--- a/binutils-2.25/bfd/coff-stgo32.c
+++ b/binutils-2.25/bfd/coff-stgo32.c
@@ -1,6 +1,5 @@
/* BFD back-end for Intel 386 COFF files (DJGPP variant with a stub).
- Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2005, 2006, 2007, 2009,
- 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1997-2014 Free Software Foundation, Inc.
Written by Robert Hoehne.
This file is part of BFD, the Binary File Descriptor library.
@@ -36,7 +35,7 @@
To be compatible with any existing executables I have fixed this
here and NOT in the DJGPP startup code. */
-#define TARGET_SYM go32stubbedcoff_vec
+#define TARGET_SYM i386_coff_go32stubbed_vec
#define TARGET_NAME "coff-go32-exe"
#define TARGET_UNDERSCORE '_'
#define COFF_GO32_EXE
diff --git a/binutils-2.25/bfd/coff-svm68k.c b/binutils-2.25/bfd/coff-svm68k.c
index dee4df4a..f759abbe 100644
--- a/binutils-2.25/bfd/coff-svm68k.c
+++ b/binutils-2.25/bfd/coff-svm68k.c
@@ -1,5 +1,5 @@
/* BFD back-end for Motorola sysv68
- Copyright 1997, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1997-2014 Free Software Foundation, Inc.
Written by Philippe De Muyter <phdm@info.ucl.ac.be>.
This file is part of BFD, the Binary File Descriptor library.
@@ -19,7 +19,7 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
-#define TARGET_SYM m68ksysvcoff_vec
+#define TARGET_SYM m68k_coff_sysv_vec
#define TARGET_NAME "coff-m68k-sysv"
#define STATIC_RELOCS
#define COFF_COMMON_ADDEND
diff --git a/binutils-2.25/bfd/coff-tic30.c b/binutils-2.25/bfd/coff-tic30.c
index de09b308..740c82c8 100644
--- a/binutils-2.25/bfd/coff-tic30.c
+++ b/binutils-2.25/bfd/coff-tic30.c
@@ -1,6 +1,5 @@
/* BFD back-end for TMS320C30 coff binaries.
- Copyright 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2008, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/coff-tic4x.c b/binutils-2.25/bfd/coff-tic4x.c
index c59894a0..1e7166f1 100644
--- a/binutils-2.25/bfd/coff-tic4x.c
+++ b/binutils-2.25/bfd/coff-tic4x.c
@@ -1,6 +1,5 @@
/* BFD back-end for TMS320C4X coff binaries.
- Copyright 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005, 2007,
- 2008, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz)
@@ -262,30 +261,30 @@ tic4x_reloc_processing (arelent *relent,
/* TI COFF v0, DOS tools (little-endian headers). */
CREATE_LITTLE_COFF_TARGET_VEC(tic4x_coff0_vec, "coff0-tic4x",
- HAS_LOAD_PAGE, SEC_CODE | SEC_READONLY, '_',
+ 0, SEC_CODE | SEC_READONLY, '_',
NULL, &ticoff0_swap_table);
/* TI COFF v0, SPARC tools (big-endian headers). */
CREATE_BIGHDR_COFF_TARGET_VEC(tic4x_coff0_beh_vec, "coff0-beh-tic4x",
- HAS_LOAD_PAGE, SEC_CODE | SEC_READONLY, '_',
+ 0, SEC_CODE | SEC_READONLY, '_',
&tic4x_coff0_vec, &ticoff0_swap_table);
/* TI COFF v1, DOS tools (little-endian headers). */
CREATE_LITTLE_COFF_TARGET_VEC(tic4x_coff1_vec, "coff1-tic4x",
- HAS_LOAD_PAGE, SEC_CODE | SEC_READONLY, '_',
+ 0, SEC_CODE | SEC_READONLY, '_',
&tic4x_coff0_beh_vec, &ticoff1_swap_table);
/* TI COFF v1, SPARC tools (big-endian headers). */
CREATE_BIGHDR_COFF_TARGET_VEC(tic4x_coff1_beh_vec, "coff1-beh-tic4x",
- HAS_LOAD_PAGE, SEC_CODE | SEC_READONLY, '_',
+ 0, SEC_CODE | SEC_READONLY, '_',
&tic4x_coff1_vec, &ticoff1_swap_table);
/* TI COFF v2, TI DOS tools output (little-endian headers). */
CREATE_LITTLE_COFF_TARGET_VEC(tic4x_coff2_vec, "coff2-tic4x",
- HAS_LOAD_PAGE, SEC_CODE | SEC_READONLY, '_',
+ 0, SEC_CODE | SEC_READONLY, '_',
&tic4x_coff1_beh_vec, COFF_SWAP_TABLE);
/* TI COFF v2, TI SPARC tools output (big-endian headers). */
CREATE_BIGHDR_COFF_TARGET_VEC(tic4x_coff2_beh_vec, "coff2-beh-tic4x",
- HAS_LOAD_PAGE, SEC_CODE | SEC_READONLY, '_',
+ 0, SEC_CODE | SEC_READONLY, '_',
&tic4x_coff2_vec, COFF_SWAP_TABLE);
diff --git a/binutils-2.25/bfd/coff-tic54x.c b/binutils-2.25/bfd/coff-tic54x.c
index 8efdc204..3027c9e8 100644
--- a/binutils-2.25/bfd/coff-tic54x.c
+++ b/binutils-2.25/bfd/coff-tic54x.c
@@ -1,6 +1,5 @@
/* BFD back-end for TMS320C54X coff binaries.
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
Contributed by Timothy Wall (twall@cygnus.com)
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/coff-tic80.c b/binutils-2.25/bfd/coff-tic80.c
index c8fa5c06..80bb05ef 100644
--- a/binutils-2.25/bfd/coff-tic80.c
+++ b/binutils-2.25/bfd/coff-tic80.c
@@ -1,6 +1,5 @@
/* BFD back-end for Texas Instruments TMS320C80 Multimedia Video Processor (MVP).
- Copyright 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008,
- 2012 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Written by Fred Fish (fnf@cygnus.com)
@@ -710,4 +709,4 @@ coff_tic80_relocate_section (bfd *output_bfd,
#include "coffcode.h"
-CREATE_LITTLE_COFF_TARGET_VEC (tic80coff_vec, "coff-tic80", D_PAGED, 0, '_', NULL, COFF_SWAP_TABLE)
+CREATE_LITTLE_COFF_TARGET_VEC (tic80_coff_vec, "coff-tic80", D_PAGED, 0, '_', NULL, COFF_SWAP_TABLE)
diff --git a/binutils-2.25/bfd/coff-u68k.c b/binutils-2.25/bfd/coff-u68k.c
index e061905e..260853ce 100644
--- a/binutils-2.25/bfd/coff-u68k.c
+++ b/binutils-2.25/bfd/coff-u68k.c
@@ -1,5 +1,5 @@
/* BFD back-end for Motorola 68000 COFF binaries having underscore with name.
- Copyright 1990, 1991, 1992, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -19,7 +19,7 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
-#define TARGET_SYM m68kcoffun_vec
+#define TARGET_SYM m68k_coff_un_vec
#define TARGET_NAME "coff-m68k-un"
#define NAMES_HAVE_UNDERSCORE
diff --git a/binutils-2.25/bfd/coff-w65.c b/binutils-2.25/bfd/coff-w65.c
index 71d946cb..f2087308 100644
--- a/binutils-2.25/bfd/coff-w65.c
+++ b/binutils-2.25/bfd/coff-w65.c
@@ -1,6 +1,5 @@
/* BFD back-end for WDC 65816 COFF binaries.
- Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
Written by Steve Chamberlain, <sac@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@@ -375,4 +374,4 @@ w65_reloc16_extra_cases (bfd *abfd,
bfd_coff_reloc16_get_relocated_section_contents
#define coff_bfd_relax_section bfd_coff_reloc16_relax_section
-CREATE_LITTLE_COFF_TARGET_VEC (w65_vec, "coff-w65", BFD_IS_RELAXABLE, 0, '_', NULL, COFF_SWAP_TABLE)
+CREATE_LITTLE_COFF_TARGET_VEC (w65_coff_vec, "coff-w65", BFD_IS_RELAXABLE, 0, '_', NULL, COFF_SWAP_TABLE)
diff --git a/binutils-2.25/bfd/coff-we32k.c b/binutils-2.25/bfd/coff-we32k.c
index 49845fc3..d5481b8f 100644
--- a/binutils-2.25/bfd/coff-we32k.c
+++ b/binutils-2.25/bfd/coff-we32k.c
@@ -1,6 +1,5 @@
/* BFD back-end for we32k COFF files.
- Copyright 1992, 1993, 1994, 1999, 2000, 2002, 2003, 2005, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
Contributed by Brendan Kehoe (brendan@cs.widener.edu).
This file is part of BFD, the Binary File Descriptor library.
@@ -71,4 +70,4 @@ static reloc_howto_type howto_table[] =
#define coff_write_armap bsd_write_armap
-CREATE_BIG_COFF_TARGET_VEC (we32kcoff_vec, "coff-we32k", 0, 0, 0, NULL, COFF_SWAP_TABLE)
+CREATE_BIG_COFF_TARGET_VEC (we32k_coff_vec, "coff-we32k", 0, 0, 0, NULL, COFF_SWAP_TABLE)
diff --git a/binutils-2.25/bfd/coff-x86_64.c b/binutils-2.25/bfd/coff-x86_64.c
index 946880e0..2a21bb8b 100644
--- a/binutils-2.25/bfd/coff-x86_64.c
+++ b/binutils-2.25/bfd/coff-x86_64.c
@@ -1,6 +1,5 @@
/* BFD back-end for AMD 64 COFF files.
- Copyright 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -449,6 +448,8 @@ static reloc_howto_type howto_table[] =
PCRELOFFSET) /* pcrel_offset */
};
+#define NUM_HOWTOS ARRAY_SIZE (howto_table)
+
/* Turn a howto into a reloc nunmber */
#define SELECT_RELOC(x,howto) { x.r_type = howto->type; }
@@ -457,7 +458,7 @@ static reloc_howto_type howto_table[] =
#define RTYPE2HOWTO(cache_ptr, dst) \
((cache_ptr)->howto = \
- ((dst)->r_type < ARRAY_SIZE (howto_table)) \
+ ((dst)->r_type < NUM_HOWTOS) \
? howto_table + (dst)->r_type \
: NULL)
@@ -497,7 +498,8 @@ static reloc_howto_type howto_table[] =
cache_ptr->addend = - (ptr->section->vma + ptr->value); \
else \
cache_ptr->addend = 0; \
- if (ptr && howto_table[reloc.r_type].pc_relative) \
+ if (ptr && reloc.r_type < NUM_HOWTOS \
+ && howto_table[reloc.r_type].pc_relative) \
cache_ptr->addend += asect->vma; \
}
@@ -547,7 +549,7 @@ coff_amd64_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
{
reloc_howto_type *howto;
- if (rel->r_type >= ARRAY_SIZE (howto_table))
+ if (rel->r_type >= NUM_HOWTOS)
{
bfd_set_error (bfd_error_bad_value);
return NULL;
@@ -690,7 +692,7 @@ coff_amd64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
{
unsigned int i;
- for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++)
+ for (i = 0; i < NUM_HOWTOS; i++)
if (howto_table[i].name != NULL
&& strcasecmp (howto_table[i].name, r_name) == 0)
return &howto_table[i];
@@ -731,14 +733,11 @@ coff_amd64_is_local_label_name (bfd *abfd, const char *name)
#define amd64coff_object_p coff_object_p
#endif
-#define _bfd_generic_find_nearest_line_discriminator \
- coff_find_nearest_line_discriminator
-
const bfd_target
#ifdef TARGET_SYM
TARGET_SYM =
#else
- x86_64coff_vec =
+ x86_64_coff_vec =
#endif
{
#ifdef TARGET_NAME
diff --git a/binutils-2.25/bfd/coff-z80.c b/binutils-2.25/bfd/coff-z80.c
index 6af3e190..7b62cdf1 100644
--- a/binutils-2.25/bfd/coff-z80.c
+++ b/binutils-2.25/bfd/coff-z80.c
@@ -1,5 +1,5 @@
/* BFD back-end for Zilog Z80 COFF binaries.
- Copyright 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2005-2014 Free Software Foundation, Inc.
Contributed by Arnold Metselaar <arnold_m@operamail.com>
This file is part of BFD, the Binary File Descriptor library.
@@ -283,7 +283,7 @@ extra_case (bfd *in_abfd,
#undef coff_bfd_relax_section
#define coff_bfd_relax_section bfd_coff_reloc16_relax_section
-CREATE_LITTLE_COFF_TARGET_VEC (z80coff_vec, "coff-z80", 0,
+CREATE_LITTLE_COFF_TARGET_VEC (z80_coff_vec, "coff-z80", 0,
SEC_CODE | SEC_DATA, '\0', NULL,
COFF_SWAP_TABLE)
diff --git a/binutils-2.25/bfd/coff-z8k.c b/binutils-2.25/bfd/coff-z8k.c
index 7e9dba50..c85713ff 100644
--- a/binutils-2.25/bfd/coff-z8k.c
+++ b/binutils-2.25/bfd/coff-z8k.c
@@ -1,6 +1,5 @@
/* BFD back-end for Zilog Z800n COFF binaries.
- Copyright 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
@@ -385,4 +384,4 @@ extra_case (bfd *in_abfd,
#undef coff_bfd_relax_section
#define coff_bfd_relax_section bfd_coff_reloc16_relax_section
-CREATE_BIG_COFF_TARGET_VEC (z8kcoff_vec, "coff-z8k", 0, 0, '_', NULL, COFF_SWAP_TABLE)
+CREATE_BIG_COFF_TARGET_VEC (z8k_coff_vec, "coff-z8k", 0, 0, '_', NULL, COFF_SWAP_TABLE)
diff --git a/binutils-2.25/bfd/coff64-rs6000.c b/binutils-2.25/bfd/coff64-rs6000.c
index 6c92e26a..5985d817 100644
--- a/binutils-2.25/bfd/coff64-rs6000.c
+++ b/binutils-2.25/bfd/coff64-rs6000.c
@@ -1,7 +1,5 @@
/* BFD back-end for IBM RS/6000 "XCOFF64" files.
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
Written Clinton Popetz.
Contributed by Cygnus Support.
@@ -279,6 +277,7 @@ extern int rs6000coff_core_file_failing_signal
#define bfd_pe_print_pdata NULL
#endif
+#include <stdint.h>
#include "coffcode.h"
/* For XCOFF64, the effective width of symndx changes depending on
@@ -2543,6 +2542,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
3, /* _bfd_coff_default_section_alignment_power */
TRUE, /* _bfd_coff_force_symnames_in_strings */
4, /* _bfd_coff_debug_string_prefix_length */
+ 32768, /* _bfd_coff_max_nscns */
coff_swap_filehdr_in,
coff_swap_aouthdr_in,
coff_swap_scnhdr_in,
@@ -2614,7 +2614,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
};
/* The transfer vector that leads the outside world to all of the above. */
-const bfd_target rs6000coff64_vec =
+const bfd_target rs6000_xcoff64_vec =
{
"aixcoff64-rs6000",
bfd_target_xcoff_flavour,
@@ -2716,8 +2716,7 @@ const bfd_target rs6000coff64_vec =
coff_bfd_is_target_special_symbol,
coff_get_lineno,
coff_find_nearest_line,
- _bfd_generic_find_nearest_line_discriminator,
- _bfd_generic_find_line,
+ coff_find_line,
coff_find_inliner_info,
coff_bfd_make_debug_symbol,
_bfd_generic_read_minisymbols,
@@ -2738,7 +2737,6 @@ const bfd_target rs6000coff64_vec =
bfd_generic_get_relocated_section_contents,
bfd_generic_relax_section,
_bfd_xcoff_bfd_link_hash_table_create,
- _bfd_generic_link_hash_table_free,
_bfd_xcoff_bfd_link_add_symbols,
_bfd_generic_link_just_syms,
_bfd_generic_copy_link_hash_symbol_type,
@@ -2802,6 +2800,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_aix5_backend_data =
3, /* _bfd_coff_default_section_alignment_power */
TRUE, /* _bfd_coff_force_symnames_in_strings */
4, /* _bfd_coff_debug_string_prefix_length */
+ 32768, /* _bfd_coff_max_nscns */
coff_swap_filehdr_in,
coff_swap_aouthdr_in,
coff_swap_scnhdr_in,
@@ -2872,7 +2871,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_aix5_backend_data =
};
/* The transfer vector that leads the outside world to all of the above. */
-const bfd_target aix5coff64_vec =
+const bfd_target rs6000_xcoff64_aix_vec =
{
"aix5coff64-rs6000",
bfd_target_xcoff_flavour,
@@ -2974,8 +2973,7 @@ const bfd_target aix5coff64_vec =
coff_bfd_is_target_special_symbol,
coff_get_lineno,
coff_find_nearest_line,
- _bfd_generic_find_nearest_line_discriminator,
- _bfd_generic_find_line,
+ coff_find_line,
coff_find_inliner_info,
coff_bfd_make_debug_symbol,
_bfd_generic_read_minisymbols,
@@ -2996,7 +2994,6 @@ const bfd_target aix5coff64_vec =
bfd_generic_get_relocated_section_contents,
bfd_generic_relax_section,
_bfd_xcoff_bfd_link_hash_table_create,
- _bfd_generic_link_hash_table_free,
_bfd_xcoff_bfd_link_add_symbols,
_bfd_generic_link_just_syms,
_bfd_generic_copy_link_hash_symbol_type,
diff --git a/binutils-2.25/bfd/coffcode.h b/binutils-2.25/bfd/coffcode.h
index 542b5b70..9990b169 100644
--- a/binutils-2.25/bfd/coffcode.h
+++ b/binutils-2.25/bfd/coffcode.h
@@ -1,5 +1,5 @@
/* Support for the generic parts of most COFF variants, for BFD.
- Copyright 1990-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -307,7 +307,7 @@ CODE_FRAGMENT
.typedef struct coff_ptr_struct
.{
. {* Remembers the offset from the first symbol in the file for
-. this symbol. Generated by coff_renumber_symbols. *}
+. this symbol. Generated by coff_renumber_symbols. *}
. unsigned int offset;
.
. {* Should the value of this symbol be renumbered. Used for
@@ -315,15 +315,15 @@ CODE_FRAGMENT
. unsigned int fix_value : 1;
.
. {* Should the tag field of this symbol be renumbered.
-. Created by coff_pointerize_aux. *}
+. Created by coff_pointerize_aux. *}
. unsigned int fix_tag : 1;
.
. {* Should the endidx field of this symbol be renumbered.
-. Created by coff_pointerize_aux. *}
+. Created by coff_pointerize_aux. *}
. unsigned int fix_end : 1;
.
. {* Should the x_csect.x_scnlen field be renumbered.
-. Created by coff_pointerize_aux. *}
+. Created by coff_pointerize_aux. *}
. unsigned int fix_scnlen : 1;
.
. {* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the
@@ -331,12 +331,15 @@ CODE_FRAGMENT
. unsigned int fix_line : 1;
.
. {* The container for the symbol structure as read and translated
-. from the file. *}
+. from the file. *}
. union
. {
. union internal_auxent auxent;
. struct internal_syment syment;
. } u;
+.
+. {* Selector for the union above. *}
+. bfd_boolean is_sym;
.} combined_entry_type;
.
.
@@ -928,12 +931,7 @@ handle_COMDAT (bfd * abfd,
bfd_coff_swap_sym_in (abfd, esym, & isym);
- if (sizeof (internal_s->s_name) > SYMNMLEN)
- {
- /* This case implies that the matching
- symbol name will be in the string table. */
- abort ();
- }
+ BFD_ASSERT (sizeof (internal_s->s_name) <= SYMNMLEN);
if (isym.n_scnum == section->target_index)
{
@@ -964,8 +962,12 @@ handle_COMDAT (bfd * abfd,
/* All 3 branches use this. */
symname = _bfd_coff_internal_syment_name (abfd, &isym, buf);
+ /* PR 17512 file: 078-11867-0.004 */
if (symname == NULL)
- abort ();
+ {
+ _bfd_error_handler (_("%B: unable to load COMDAT section name"), abfd);
+ break;
+ }
switch (seen_state)
{
@@ -1393,6 +1395,7 @@ Special entry points for gdb to swap in coff symbol table parts:
. unsigned int _bfd_coff_default_section_alignment_power;
. bfd_boolean _bfd_coff_force_symnames_in_strings;
. unsigned int _bfd_coff_debug_string_prefix_length;
+. unsigned int _bfd_coff_max_nscns;
.
. void (*_bfd_coff_swap_filehdr_in)
. (bfd *, void *, void *);
@@ -1530,6 +1533,9 @@ Special entry points for gdb to swap in coff symbol table parts:
. ((coff_backend_info (abfd)->_bfd_coff_set_long_section_names) (abfd, enable))
.#define bfd_coff_default_section_alignment_power(abfd) \
. (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power)
+.#define bfd_coff_max_nscns(abfd) \
+. (coff_backend_info (abfd)->_bfd_coff_max_nscns)
+.
.#define bfd_coff_swap_filehdr_in(abfd, i,o) \
. ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o))
.
@@ -1793,6 +1799,7 @@ coff_new_section_hook (bfd * abfd, asection * section)
in case this symbol winds up getting written out. The value 0
for n_numaux is already correct. */
+ native->is_sym = TRUE;
native->u.syment.n_type = T_NULL;
native->u.syment.n_sclass = sclass;
@@ -2092,12 +2099,6 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr)
machine = 0;
switch (internal_f->f_magic)
{
-#ifdef OR32_MAGIC_BIG
- case OR32_MAGIC_BIG:
- case OR32_MAGIC_LITTLE:
- arch = bfd_arch_or32;
- break;
-#endif
#ifdef PPCMAGIC
case PPCMAGIC:
arch = bfd_arch_powerpc;
@@ -2500,11 +2501,13 @@ coff_pointerize_aux_hook (bfd *abfd ATTRIBUTE_UNUSED,
unsigned int indaux,
combined_entry_type *aux)
{
+ BFD_ASSERT (symbol->is_sym);
int n_sclass = symbol->u.syment.n_sclass;
if (CSECT_SYM_P (n_sclass)
&& indaux + 1 == symbol->u.syment.n_numaux)
{
+ BFD_ASSERT (! aux->is_sym);
if (SMTYP_SMTYP (aux->u.auxent.x_csect.x_smtyp) == XTY_LD)
{
aux->u.auxent.x_csect.x_scnlen.p =
@@ -2537,6 +2540,7 @@ coff_pointerize_aux_hook (bfd *abfd ATTRIBUTE_UNUSED,
/* Return TRUE if we don't want to pointerize this aux entry, which
is the case for the lastfirst aux entry for a C_LEAFPROC symbol. */
return (indaux == 1
+ && symbol->is_sym
&& (symbol->u.syment.n_sclass == C_LEAFPROC
|| symbol->u.syment.n_sclass == C_LEAFSTAT
|| symbol->u.syment.n_sclass == C_LEAFEXT));
@@ -2559,6 +2563,8 @@ coff_print_aux (bfd *abfd ATTRIBUTE_UNUSED,
combined_entry_type *aux ATTRIBUTE_UNUSED,
unsigned int indaux ATTRIBUTE_UNUSED)
{
+ BFD_ASSERT (symbol->is_sym);
+ BFD_ASSERT (! aux->is_sym);
#ifdef RS6000COFF_C
if (CSECT_SYM_P (symbol->u.syment.n_sclass)
&& indaux + 1 == symbol->u.syment.n_numaux)
@@ -3064,15 +3070,6 @@ coff_set_flags (bfd * abfd,
return TRUE;
#endif
-#ifdef OR32_MAGIC_BIG
- case bfd_arch_or32:
- if (bfd_big_endian (abfd))
- * magicp = OR32_MAGIC_BIG;
- else
- * magicp = OR32_MAGIC_LITTLE;
- return TRUE;
-#endif
-
default: /* Unknown architecture. */
/* Fall through to "return FALSE" below, to avoid
"statement never reached" errors on the one below. */
@@ -3136,7 +3133,7 @@ coff_compute_section_file_positions (bfd * abfd)
asection *current;
file_ptr sofar = bfd_coff_filhsz (abfd);
bfd_boolean align_adjust;
- int target_index;
+ unsigned int target_index;
#ifdef ALIGN_SECTIONS_IN_FILE
asection *previous = NULL;
file_ptr old_sofar;
@@ -3145,7 +3142,8 @@ coff_compute_section_file_positions (bfd * abfd)
#ifdef COFF_IMAGE_WITH_PE
int page_size;
- if (coff_data (abfd)->link_info)
+ if (coff_data (abfd)->link_info
+ || (pe_data (abfd) && pe_data (abfd)->pe_opthdr.FileAlignment))
{
page_size = pe_data (abfd)->pe_opthdr.FileAlignment;
@@ -3179,6 +3177,7 @@ coff_compute_section_file_positions (bfd * abfd)
cf = coff_symbol_from (abfd, *symp);
if (cf != NULL
&& cf->native != NULL
+ && cf->native->is_sym
&& SYMNAME_IN_DEBUG (&cf->native->u.syment))
{
size_t len;
@@ -3304,7 +3303,7 @@ coff_compute_section_file_positions (bfd * abfd)
}
#endif /* ! COFF_IMAGE_WITH_PE */
- if (target_index >= 32768)
+ if (target_index >= bfd_coff_max_nscns (abfd))
{
bfd_set_error (bfd_error_file_too_big);
(*_bfd_error_handler)
@@ -3876,6 +3875,7 @@ coff_write_object_contents (bfd * abfd)
csym = coff_symbol_from (abfd, *psym);
if (csym == NULL
|| csym->native == NULL
+ || ! csym->native->is_sym
|| csym->native->u.syment.n_numaux < 1
|| csym->native->u.syment.n_sclass != C_STAT
|| csym->native->u.syment.n_type != T_NULL)
@@ -3898,6 +3898,7 @@ coff_write_object_contents (bfd * abfd)
x_associated field is not currently supported. */
aux = csym->native + 1;
+ BFD_ASSERT (! aux->is_sym);
switch (current->flags & SEC_LINK_DUPLICATES)
{
case SEC_LINK_DUPLICATES_DISCARD:
@@ -4043,8 +4044,6 @@ coff_write_object_contents (bfd * abfd)
internal_f.f_flags |= F_DYNLOAD;
#endif
- memset (&internal_a, 0, sizeof internal_a);
-
/* Set up architecture-dependent stuff. */
{
unsigned int magic = 0;
@@ -4154,11 +4153,6 @@ coff_write_object_contents (bfd * abfd)
internal_a.magic = MIPS_PE_MAGIC;
#endif
-#ifdef OR32
-#define __A_MAGIC_SET__
- internal_a.magic = NMAGIC; /* Assume separate i/d. */
-#endif
-
#ifndef __A_MAGIC_SET__
#include "Your aouthdr magic number is not being set!"
#else
@@ -4325,7 +4319,18 @@ coff_write_object_contents (bfd * abfd)
}
#endif
- /* Now write them. */
+#ifdef COFF_WITH_PE
+ {
+ /* After object contents are finalized so we can compute a reasonable hash,
+ but before header is written so we can update it to point to debug directory. */
+ struct pe_tdata *pe = pe_data (abfd);
+
+ if (pe->build_id.after_write_object_contents != NULL)
+ (*pe->build_id.after_write_object_contents) (abfd);
+ }
+#endif
+
+ /* Now write header. */
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
return FALSE;
@@ -4460,11 +4465,11 @@ buy_and_read (bfd *abfd, file_ptr where, bfd_size_type size)
void * area = bfd_alloc (abfd, size);
if (!area)
- return (NULL);
+ return NULL;
if (bfd_seek (abfd, where, SEEK_SET) != 0
|| bfd_bread (area, size, abfd) != size)
- return (NULL);
- return (area);
+ return NULL;
+ return area;
}
/*
@@ -4498,6 +4503,8 @@ coff_sort_func_alent (const void * arg1, const void * arg2)
const coff_symbol_type *s1 = (const coff_symbol_type *) (al1->u.sym);
const coff_symbol_type *s2 = (const coff_symbol_type *) (al2->u.sym);
+ if (s1 == NULL || s2 == NULL)
+ return 0;
if (s1->symbol.value < s2->symbol.value)
return -1;
else if (s1->symbol.value > s2->symbol.value)
@@ -4515,9 +4522,10 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
unsigned int counter;
alent *cache_ptr;
bfd_vma prev_offset = 0;
- int ordered = 1;
+ bfd_boolean ordered = TRUE;
unsigned int nbr_func;
LINENO *src;
+ bfd_boolean have_func;
BFD_ASSERT (asect->lineno == NULL);
@@ -4540,57 +4548,85 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
asect->lineno = lineno_cache;
src = native_lineno;
nbr_func = 0;
+ have_func = FALSE;
- for (counter = 0; counter < asect->lineno_count; counter++)
+ for (counter = 0; counter < asect->lineno_count; counter++, src++)
{
struct internal_lineno dst;
bfd_coff_swap_lineno_in (abfd, src, &dst);
cache_ptr->line_number = dst.l_lnno;
+ /* Appease memory checkers that get all excited about
+ uninitialised memory when copying alents if u.offset is
+ larger than u.sym. (64-bit BFD on 32-bit host.) */
+ memset (&cache_ptr->u, 0, sizeof (cache_ptr->u));
if (cache_ptr->line_number == 0)
{
- bfd_boolean warned;
- bfd_signed_vma symndx;
+ combined_entry_type * ent;
+ bfd_vma symndx;
coff_symbol_type *sym;
- nbr_func++;
- warned = FALSE;
+ have_func = FALSE;
symndx = dst.l_addr.l_symndx;
- if (symndx < 0
- || (bfd_vma) symndx >= obj_raw_syment_count (abfd))
+ if (symndx >= obj_raw_syment_count (abfd))
{
(*_bfd_error_handler)
- (_("%B: warning: illegal symbol index %ld in line numbers"),
- abfd, (long) symndx);
- symndx = 0;
- warned = TRUE;
+ (_("%B: warning: illegal symbol index 0x%lx in line number entry %d"),
+ abfd, (long) symndx, counter);
+ cache_ptr->line_number = -1;
+ continue;
}
+ ent = obj_raw_syments (abfd) + symndx;
/* FIXME: We should not be casting between ints and
pointers like this. */
- sym = ((coff_symbol_type *)
- ((symndx + obj_raw_syments (abfd))
- ->u.syment._n._n_n._n_zeroes));
+ if (! ent->is_sym)
+ {
+ (*_bfd_error_handler)
+ (_("%B: warning: illegal symbol index 0x%lx in line number entry %d"),
+ abfd, (long) symndx, counter);
+ cache_ptr->line_number = -1;
+ continue;
+ }
+ sym = (coff_symbol_type *) (ent->u.syment._n._n_n._n_zeroes);
+
+ /* PR 17512 file: 078-10659-0.004 */
+ if (sym < obj_symbols (abfd)
+ || sym >= obj_symbols (abfd) + bfd_get_symcount (abfd))
+ {
+ (*_bfd_error_handler)
+ (_("%B: warning: illegal symbol in line number entry %d"),
+ abfd, counter);
+ cache_ptr->line_number = -1;
+ continue;
+ }
+
+ have_func = TRUE;
+ nbr_func++;
cache_ptr->u.sym = (asymbol *) sym;
- if (sym->lineno != NULL && ! warned)
+ if (sym->lineno != NULL)
(*_bfd_error_handler)
(_("%B: warning: duplicate line number information for `%s'"),
abfd, bfd_asymbol_name (&sym->symbol));
sym->lineno = cache_ptr;
if (sym->symbol.value < prev_offset)
- ordered = 0;
+ ordered = FALSE;
prev_offset = sym->symbol.value;
}
+ else if (!have_func)
+ /* Drop line information that has no associated function.
+ PR 17521: file: 078-10659-0.004. */
+ continue;
else
- cache_ptr->u.offset = dst.l_addr.l_paddr
- - bfd_section_vma (abfd, asect);
-
+ cache_ptr->u.offset = (dst.l_addr.l_paddr
+ - bfd_section_vma (abfd, asect));
cache_ptr++;
- src++;
}
- cache_ptr->line_number = 0;
+
+ asect->lineno_count = cache_ptr - lineno_cache;
+ memset (cache_ptr, 0, sizeof (*cache_ptr));
bfd_release (abfd, native_lineno);
/* On some systems (eg AIX5.3) the lineno table may not be sorted. */
@@ -4607,15 +4643,17 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
alent **p = func_table;
unsigned int i;
- for (i = 0; i < counter; i++)
+ for (i = 0; i < asect->lineno_count; i++)
if (lineno_cache[i].line_number == 0)
*p++ = &lineno_cache[i];
+ BFD_ASSERT ((unsigned int) (p - func_table) == nbr_func);
+
/* Sort by functions. */
qsort (func_table, nbr_func, sizeof (alent *), coff_sort_func_alent);
/* Create the new sorted table. */
- amt = ((bfd_size_type) asect->lineno_count + 1) * sizeof (alent);
+ amt = (bfd_size_type) asect->lineno_count * sizeof (alent);
n_lineno_cache = (alent *) bfd_alloc (abfd, amt);
if (n_lineno_cache != NULL)
{
@@ -4626,18 +4664,18 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
coff_symbol_type *sym;
alent *old_ptr = func_table[i];
- /* Copy the function entry and update it. */
- *n_cache_ptr = *old_ptr;
- sym = (coff_symbol_type *)n_cache_ptr->u.sym;
- sym->lineno = n_cache_ptr;
- n_cache_ptr++;
- old_ptr++;
-
- /* Copy the line number entries. */
- while (old_ptr->line_number != 0)
+ /* Update the function entry. */
+ sym = (coff_symbol_type *) old_ptr->u.sym;
+ /* PR binutils/17512: Point the lineno to where
+ this entry will be after the memcpy below. */
+ sym->lineno = lineno_cache + (n_cache_ptr - n_lineno_cache);
+ /* Copy the function and line number entries. */
+ do
*n_cache_ptr++ = *old_ptr++;
+ while (old_ptr->line_number != 0);
}
- n_cache_ptr->line_number = 0;
+ BFD_ASSERT ((bfd_size_type) (n_cache_ptr - n_lineno_cache) == (amt / sizeof (alent)));
+
memcpy (lineno_cache, n_lineno_cache, amt);
}
bfd_release (abfd, func_table);
@@ -4676,7 +4714,7 @@ coff_slurp_symbol_table (bfd * abfd)
amt = obj_raw_syment_count (abfd);
amt *= sizeof (unsigned int);
- table_ptr = (unsigned int *) bfd_alloc (abfd, amt);
+ table_ptr = (unsigned int *) bfd_zalloc (abfd, amt);
if (table_ptr == NULL)
return FALSE;
@@ -4690,14 +4728,17 @@ coff_slurp_symbol_table (bfd * abfd)
{
combined_entry_type *src = native_symbols + this_index;
table_ptr[this_index] = number_of_symbols;
- dst->symbol.the_bfd = abfd;
+ dst->symbol.the_bfd = abfd;
+ BFD_ASSERT (src->is_sym);
dst->symbol.name = (char *) (src->u.syment._n._n_n._n_offset);
/* We use the native name field to point to the cached field. */
src->u.syment._n._n_n._n_zeroes = (bfd_hostptr_t) dst;
dst->symbol.section = coff_section_from_bfd_index (abfd,
src->u.syment.n_scnum);
dst->symbol.flags = 0;
+ /* PR 17512: file: 079-7098-0.001:0.1. */
+ dst->symbol.value = 0;
dst->done_lineno = FALSE;
switch (src->u.syment.n_sclass)
@@ -4984,9 +5025,9 @@ coff_slurp_symbol_table (bfd * abfd)
}
dst->native = src;
-
dst->symbol.udata.i = 0;
dst->lineno = NULL;
+
this_index += (src->u.syment.n_numaux) + 1;
dst++;
number_of_symbols++;
@@ -5069,13 +5110,13 @@ coff_classify_symbol (bfd *abfd,
if (syment->n_value == 0)
{
asection *sec;
- char buf[SYMNMLEN + 1];
-
- sec = coff_section_from_bfd_index (abfd, syment->n_scnum);
- if (sec != NULL
- && (strcmp (bfd_get_section_name (abfd, sec),
- _bfd_coff_internal_syment_name (abfd, syment, buf))
- == 0))
+ char * name;
+ char buf[SYMNMLEN + 1];
+
+ name = _bfd_coff_internal_syment_name (abfd, syment, buf)
+ sec = coff_section_from_bfd_index (abfd, syment->n_scnum);
+ if (sec != NULL && name != NULL
+ && (strcmp (bfd_get_section_name (abfd, sec), name) == 0))
return COFF_SYMBOL_PE_SECTION;
}
#endif
@@ -5146,6 +5187,7 @@ SUBSUBSECTION
else if (ptr) \
coffsym = coff_symbol_from (abfd, ptr); \
if (coffsym != NULL \
+ && coffsym->native->is_sym \
&& coffsym->native->u.syment.n_scnum == 0) \
cache_ptr->addend = 0; \
else if (ptr && bfd_asymbol_bfd (ptr) == abfd \
@@ -5360,10 +5402,6 @@ dummy_reloc16_extra_cases (bfd *abfd ATTRIBUTE_UNUSED,
}
#endif
-#ifndef coff_bfd_link_hash_table_free
-#define coff_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
-#endif
-
/* If coff_relocate_section is defined, we can use the optimized COFF
backend linker. Otherwise we must continue to use the old linker. */
@@ -5497,6 +5535,7 @@ static bfd_coff_backend_data bfd_coff_std_swap_table ATTRIBUTE_UNUSED =
#else
2,
#endif
+ 32768,
coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
coff_SWAP_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook,
coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
@@ -5537,6 +5576,7 @@ static bfd_coff_backend_data ticoff0_swap_table =
#else
2,
#endif
+ 32768,
coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
coff_SWAP_reloc_in, ticoff0_bad_format_hook, coff_set_arch_mach_hook,
coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
@@ -5578,6 +5618,7 @@ static bfd_coff_backend_data ticoff1_swap_table =
#else
2,
#endif
+ 32768,
coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
coff_SWAP_reloc_in, ticoff1_bad_format_hook, coff_set_arch_mach_hook,
coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
@@ -5591,6 +5632,253 @@ static bfd_coff_backend_data ticoff1_swap_table =
};
#endif
+#ifdef COFF_WITH_PE_BIGOBJ
+/* The UID for bigobj files. */
+
+static const char header_bigobj_classid[16] =
+{
+ 0xC7, 0xA1, 0xBA, 0xD1,
+ 0xEE, 0xBA,
+ 0xa9, 0x4b,
+ 0xAF, 0x20,
+ 0xFA, 0xF6, 0x6A, 0xA4, 0xDC, 0xB8
+};
+
+/* Swap routines. */
+
+static void
+coff_bigobj_swap_filehdr_in (bfd * abfd, void * src, void * dst)
+{
+ struct external_ANON_OBJECT_HEADER_BIGOBJ *filehdr_src =
+ (struct external_ANON_OBJECT_HEADER_BIGOBJ *) src;
+ struct internal_filehdr *filehdr_dst = (struct internal_filehdr *) dst;
+
+ filehdr_dst->f_magic = H_GET_16 (abfd, filehdr_src->Machine);
+ filehdr_dst->f_nscns = H_GET_32 (abfd, filehdr_src->NumberOfSections);
+ filehdr_dst->f_timdat = H_GET_32 (abfd, filehdr_src->TimeDateStamp);
+ filehdr_dst->f_symptr =
+ GET_FILEHDR_SYMPTR (abfd, filehdr_src->PointerToSymbolTable);
+ filehdr_dst->f_nsyms = H_GET_32 (abfd, filehdr_src->NumberOfSymbols);
+ filehdr_dst->f_opthdr = 0;
+ filehdr_dst->f_flags = 0;
+
+ /* Check other magic numbers. */
+ if (H_GET_16 (abfd, filehdr_src->Sig1) != IMAGE_FILE_MACHINE_UNKNOWN
+ || H_GET_16 (abfd, filehdr_src->Sig2) != 0xffff
+ || H_GET_16 (abfd, filehdr_src->Version) != 2
+ || memcmp (filehdr_src->ClassID, header_bigobj_classid, 16) != 0)
+ filehdr_dst->f_opthdr = 0xffff;
+
+ /* Note that CLR metadata are ignored. */
+}
+
+static unsigned int
+coff_bigobj_swap_filehdr_out (bfd *abfd, void * in, void * out)
+{
+ struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in;
+ struct external_ANON_OBJECT_HEADER_BIGOBJ *filehdr_out =
+ (struct external_ANON_OBJECT_HEADER_BIGOBJ *) out;
+
+ memset (filehdr_out, 0, sizeof (*filehdr_out));
+
+ H_PUT_16 (abfd, IMAGE_FILE_MACHINE_UNKNOWN, filehdr_out->Sig1);
+ H_PUT_16 (abfd, 0xffff, filehdr_out->Sig2);
+ H_PUT_16 (abfd, 2, filehdr_out->Version);
+ memcpy (filehdr_out->ClassID, header_bigobj_classid, 16);
+ H_PUT_16 (abfd, filehdr_in->f_magic, filehdr_out->Machine);
+ H_PUT_32 (abfd, filehdr_in->f_nscns, filehdr_out->NumberOfSections);
+ H_PUT_32 (abfd, filehdr_in->f_timdat, filehdr_out->TimeDateStamp);
+ PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr,
+ filehdr_out->PointerToSymbolTable);
+ H_PUT_32 (abfd, filehdr_in->f_nsyms, filehdr_out->NumberOfSymbols);
+
+ return bfd_coff_filhsz (abfd);
+}
+
+static void
+coff_bigobj_swap_sym_in (bfd * abfd, void * ext1, void * in1)
+{
+ SYMENT_BIGOBJ *ext = (SYMENT_BIGOBJ *) ext1;
+ struct internal_syment *in = (struct internal_syment *) in1;
+
+ if (ext->e.e_name[0] == 0)
+ {
+ in->_n._n_n._n_zeroes = 0;
+ in->_n._n_n._n_offset = H_GET_32 (abfd, ext->e.e.e_offset);
+ }
+ else
+ {
+#if SYMNMLEN != E_SYMNMLEN
+#error we need to cope with truncating or extending SYMNMLEN
+#else
+ memcpy (in->_n._n_name, ext->e.e_name, SYMNMLEN);
+#endif
+ }
+
+ in->n_value = H_GET_32 (abfd, ext->e_value);
+ in->n_scnum = H_GET_32 (abfd, ext->e_scnum);
+ in->n_type = H_GET_16 (abfd, ext->e_type);
+ in->n_sclass = H_GET_8 (abfd, ext->e_sclass);
+ in->n_numaux = H_GET_8 (abfd, ext->e_numaux);
+}
+
+static unsigned int
+coff_bigobj_swap_sym_out (bfd * abfd, void * inp, void * extp)
+{
+ struct internal_syment *in = (struct internal_syment *) inp;
+ SYMENT_BIGOBJ *ext = (SYMENT_BIGOBJ *) extp;
+
+ if (in->_n._n_name[0] == 0)
+ {
+ H_PUT_32 (abfd, 0, ext->e.e.e_zeroes);
+ H_PUT_32 (abfd, in->_n._n_n._n_offset, ext->e.e.e_offset);
+ }
+ else
+ {
+#if SYMNMLEN != E_SYMNMLEN
+#error we need to cope with truncating or extending SYMNMLEN
+#else
+ memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN);
+#endif
+ }
+
+ H_PUT_32 (abfd, in->n_value, ext->e_value);
+ H_PUT_32 (abfd, in->n_scnum, ext->e_scnum);
+
+ H_PUT_16 (abfd, in->n_type, ext->e_type);
+ H_PUT_8 (abfd, in->n_sclass, ext->e_sclass);
+ H_PUT_8 (abfd, in->n_numaux, ext->e_numaux);
+
+ return SYMESZ_BIGOBJ;
+}
+
+static void
+coff_bigobj_swap_aux_in (bfd *abfd,
+ void * ext1,
+ int type,
+ int in_class,
+ int indx,
+ int numaux,
+ void * in1)
+{
+ AUXENT_BIGOBJ *ext = (AUXENT_BIGOBJ *) ext1;
+ union internal_auxent *in = (union internal_auxent *) in1;
+
+ switch (in_class)
+ {
+ case C_FILE:
+ if (numaux > 1)
+ {
+ if (indx == 0)
+ memcpy (in->x_file.x_fname, ext->File.Name,
+ numaux * sizeof (AUXENT_BIGOBJ));
+ }
+ else
+ memcpy (in->x_file.x_fname, ext->File.Name, sizeof (ext->File.Name));
+ break;
+
+ case C_STAT:
+ case C_LEAFSTAT:
+ case C_HIDDEN:
+ if (type == T_NULL)
+ {
+ in->x_scn.x_scnlen = H_GET_32 (abfd, ext->Section.Length);
+ in->x_scn.x_nreloc =
+ H_GET_16 (abfd, ext->Section.NumberOfRelocations);
+ in->x_scn.x_nlinno =
+ H_GET_16 (abfd, ext->Section.NumberOfLinenumbers);
+ in->x_scn.x_checksum = H_GET_32 (abfd, ext->Section.Checksum);
+ in->x_scn.x_associated = H_GET_16 (abfd, ext->Section.Number)
+ | (H_GET_16 (abfd, ext->Section.HighNumber) << 16);
+ in->x_scn.x_comdat = H_GET_8 (abfd, ext->Section.Selection);
+ return;
+ }
+ break;
+
+ default:
+ in->x_sym.x_tagndx.l = H_GET_32 (abfd, ext->Sym.WeakDefaultSymIndex);
+ /* Characteristics is ignored. */
+ break;
+ }
+}
+
+static unsigned int
+coff_bigobj_swap_aux_out (bfd * abfd,
+ void * inp,
+ int type,
+ int in_class,
+ int indx ATTRIBUTE_UNUSED,
+ int numaux ATTRIBUTE_UNUSED,
+ void * extp)
+{
+ union internal_auxent * in = (union internal_auxent *) inp;
+ AUXENT_BIGOBJ *ext = (AUXENT_BIGOBJ *) extp;
+
+ memset (ext, 0, AUXESZ);
+
+ switch (in_class)
+ {
+ case C_FILE:
+ memcpy (ext->File.Name, in->x_file.x_fname, sizeof (ext->File.Name));
+
+ return AUXESZ;
+
+ case C_STAT:
+ case C_LEAFSTAT:
+ case C_HIDDEN:
+ if (type == T_NULL)
+ {
+ H_PUT_32 (abfd, in->x_scn.x_scnlen, ext->Section.Length);
+ H_PUT_16 (abfd, in->x_scn.x_nreloc,
+ ext->Section.NumberOfRelocations);
+ H_PUT_16 (abfd, in->x_scn.x_nlinno,
+ ext->Section.NumberOfLinenumbers);
+ H_PUT_32 (abfd, in->x_scn.x_checksum, ext->Section.Checksum);
+ H_PUT_16 (abfd, in->x_scn.x_associated & 0xffff,
+ ext->Section.Number);
+ H_PUT_16 (abfd, (in->x_scn.x_associated >> 16),
+ ext->Section.HighNumber);
+ H_PUT_8 (abfd, in->x_scn.x_comdat, ext->Section.Selection);
+ return AUXESZ;
+ }
+ break;
+ }
+
+ H_PUT_32 (abfd, in->x_sym.x_tagndx.l, ext->Sym.WeakDefaultSymIndex);
+ H_PUT_32 (abfd, 1, ext->Sym.WeakSearchType);
+
+ return AUXESZ;
+}
+
+static bfd_coff_backend_data bigobj_swap_table =
+{
+ coff_bigobj_swap_aux_in, coff_bigobj_swap_sym_in, coff_SWAP_lineno_in,
+ coff_bigobj_swap_aux_out, coff_bigobj_swap_sym_out,
+ coff_SWAP_lineno_out, coff_SWAP_reloc_out,
+ coff_bigobj_swap_filehdr_out, coff_SWAP_aouthdr_out,
+ coff_SWAP_scnhdr_out,
+ FILHSZ_BIGOBJ, AOUTSZ, SCNHSZ, SYMESZ_BIGOBJ, AUXESZ_BIGOBJ,
+ RELSZ, LINESZ, FILNMLEN_BIGOBJ,
+ TRUE,
+ COFF_DEFAULT_LONG_SECTION_NAMES,
+ COFF_DEFAULT_SECTION_ALIGNMENT_POWER,
+ FALSE,
+ 2,
+ 1U << 31,
+ coff_bigobj_swap_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
+ coff_SWAP_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook,
+ coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
+ coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook,
+ coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate,
+ coff_classify_symbol, coff_compute_section_file_positions,
+ coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
+ coff_adjust_symndx, coff_link_add_one_symbol,
+ coff_link_output_has_begun, coff_final_link_postscript,
+ bfd_pe_print_pdata /* huh */
+};
+
+#endif /* COFF_WITH_PE_BIGOBJ */
+
#ifndef coff_close_and_cleanup
#define coff_close_and_cleanup _bfd_generic_close_and_cleanup
#endif
diff --git a/binutils-2.25/bfd/coffgen.c b/binutils-2.25/bfd/coffgen.c
index 07a527d6..a22f67a6 100644
--- a/binutils-2.25/bfd/coffgen.c
+++ b/binutils-2.25/bfd/coffgen.c
@@ -1,7 +1,5 @@
/* Support for the generic parts of COFF, for BFD.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -86,9 +84,8 @@ make_a_section_from_file (bfd *abfd,
strings = _bfd_coff_read_string_table (abfd);
if (strings == NULL)
return FALSE;
- /* FIXME: For extra safety, we should make sure that
- strindex does not run us past the end, but right now we
- don't know the length of the string table. */
+ if ((bfd_size_type)(strindex + 2) >= obj_coff_strings_len (abfd))
+ return FALSE;
strings += strindex;
name = (char *) bfd_alloc (abfd,
(bfd_size_type) strlen (strings) + 1 + 1);
@@ -466,6 +463,8 @@ _bfd_coff_internal_syment_name (bfd *abfd,
if (strings == NULL)
return NULL;
}
+ if (sym->_n._n_n._n_offset >= obj_coff_strings_len (abfd))
+ return NULL;
return strings + sym->_n._n_n._n_offset;
}
}
@@ -762,12 +761,14 @@ coff_renumber_symbols (bfd *bfd_ptr, int *first_undef)
for (symbol_index = 0; symbol_index < symbol_count; symbol_index++)
{
coff_symbol_type *coff_symbol_ptr = coff_symbol_from (bfd_ptr, symbol_ptr_ptr[symbol_index]);
+
symbol_ptr_ptr[symbol_index]->udata.i = symbol_index;
if (coff_symbol_ptr && coff_symbol_ptr->native)
{
combined_entry_type *s = coff_symbol_ptr->native;
int i;
+ BFD_ASSERT (s->is_sym);
if (s->u.syment.n_sclass == C_FILE)
{
if (last_file != NULL)
@@ -812,6 +813,7 @@ coff_mangle_symbols (bfd *bfd_ptr)
int i;
combined_entry_type *s = coff_symbol_ptr->native;
+ BFD_ASSERT (s->is_sym);
if (s->fix_value)
{
/* FIXME: We should use a union here. */
@@ -835,6 +837,8 @@ coff_mangle_symbols (bfd *bfd_ptr)
for (i = 0; i < s->u.syment.n_numaux; i++)
{
combined_entry_type *a = s + i + 1;
+
+ BFD_ASSERT (! a->is_sym);
if (a->fix_tag)
{
a->u.auxent.x_sym.x_tagndx.l =
@@ -878,6 +882,7 @@ coff_fix_symbol_name (bfd *abfd,
}
name_length = strlen (name);
+ BFD_ASSERT (native->is_sym);
if (native->u.syment.n_sclass == C_FILE
&& native->u.syment.n_numaux > 0)
{
@@ -893,6 +898,7 @@ coff_fix_symbol_name (bfd *abfd,
else
strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN);
+ BFD_ASSERT (! (native + 1)->is_sym);
auxent = &(native + 1)->u.auxent;
filnmlen = bfd_coff_filnmlen (abfd);
@@ -995,6 +1001,8 @@ coff_write_symbol (bfd *abfd,
void * buf;
bfd_size_type symesz;
+ BFD_ASSERT (native->is_sym);
+
if (native->u.syment.n_sclass == C_FILE)
symbol->flags |= BSF_DEBUGGING;
@@ -1035,6 +1043,7 @@ coff_write_symbol (bfd *abfd,
return FALSE;
for (j = 0; j < native->u.syment.n_numaux; j++)
{
+ BFD_ASSERT (! (native + j + 1)->is_sym);
bfd_coff_swap_aux_out (abfd,
&((native + j + 1)->u.auxent),
type, n_sclass, (int) j,
@@ -1080,10 +1089,12 @@ coff_write_alien_symbol (bfd *abfd,
{
symbol->name = "";
if (isym != NULL)
- memset (isym, 0, sizeof(*isym));
+ memset (isym, 0, sizeof (*isym));
return TRUE;
}
native = dummy;
+ native->is_sym = TRUE;
+ native[1].is_sym = FALSE;
native->u.syment.n_type = T_NULL;
native->u.syment.n_flags = 0;
native->u.syment.n_numaux = 0;
@@ -1110,7 +1121,7 @@ coff_write_alien_symbol (bfd *abfd,
name to keep it from being put in the string table. */
symbol->name = "";
if (isym != NULL)
- memset (isym, 0, sizeof(*isym));
+ memset (isym, 0, sizeof (*isym));
return TRUE;
}
else
@@ -1169,6 +1180,7 @@ coff_write_native_symbol (bfd *abfd,
return TRUE;
}
+ BFD_ASSERT (native->is_sym);
/* If this symbol has an associated line number, we must store the
symbol index in the line number field. We also tag the auxent to
point to the right place in the lineno table. */
@@ -1278,8 +1290,9 @@ coff_write_symbols (bfd *abfd)
symbol which has no associated section and we do not have to
worry about this, all we need to know is that it is local. */
current_error_handler = bfd_set_error_handler (null_error_handler);
+ BFD_ASSERT (c_symbol->native->is_sym);
sym_class = bfd_coff_classify_symbol (abfd,
- &c_symbol->native->u.syment);
+ &c_symbol->native->u.syment);
(void) bfd_set_error_handler (current_error_handler);
n_sclass = &c_symbol->native->u.syment.n_sclass;
@@ -1370,6 +1383,9 @@ coff_write_symbols (bfd *abfd)
file name, nor does it go in the .debug section. */
maxlen = bfd_coff_force_symnames_in_strings (abfd) ? 0 : SYMNMLEN;
+ else if (! c_symbol->native->is_sym)
+ maxlen = bfd_coff_force_symnames_in_strings (abfd) ? 0 : SYMNMLEN;
+
else if (bfd_coff_symname_in_debug (abfd,
&c_symbol->native->u.syment))
/* This symbol name is in the XCOFF .debug section.
@@ -1460,6 +1476,7 @@ coff_write_linenumbers (bfd *abfd)
{
/* Found a linenumber entry, output. */
struct internal_lineno out;
+
memset ((void *) & out, 0, sizeof (out));
out.l_lnno = 0;
out.l_addr.l_symndx = l->u.offset;
@@ -1507,6 +1524,7 @@ coff_pointerize_aux (bfd *abfd,
unsigned int type = symbol->u.syment.n_type;
unsigned int n_sclass = symbol->u.syment.n_sclass;
+ BFD_ASSERT (symbol->is_sym);
if (coff_backend_info (abfd)->_bfd_coff_pointerize_aux_hook)
{
if ((*coff_backend_info (abfd)->_bfd_coff_pointerize_aux_hook)
@@ -1520,6 +1538,7 @@ coff_pointerize_aux (bfd *abfd,
if (n_sclass == C_FILE)
return;
+ BFD_ASSERT (! auxent->is_sym);
/* Otherwise patch up. */
#define N_TMASK coff_data (abfd)->local_n_tmask
#define N_BTSHFT coff_data (abfd)->local_n_btshft
@@ -1547,7 +1566,7 @@ coff_pointerize_aux (bfd *abfd,
we didn't want to go to the trouble until someone needed it. */
static char *
-build_debug_section (bfd *abfd)
+build_debug_section (bfd *abfd, asection ** sect_return)
{
char *debug_section;
file_ptr position;
@@ -1575,6 +1594,8 @@ build_debug_section (bfd *abfd)
|| bfd_bread (debug_section, sec_size, abfd) != sec_size
|| bfd_seek (abfd, position, SEEK_SET) != 0)
return NULL;
+
+ * sect_return = sect;
return debug_section;
}
@@ -1637,7 +1658,9 @@ _bfd_coff_get_external_symbols (bfd *abfd)
/* Read in the external strings. The strings are not loaded until
they are needed. This is because we have no simple way of
- detecting a missing string table in an archive. */
+ detecting a missing string table in an archive. If the strings
+ are loaded then the STRINGS and STRINGS_LEN fields in the
+ coff_tdata structure will be set. */
const char *
_bfd_coff_read_string_table (bfd *abfd)
@@ -1687,7 +1710,13 @@ _bfd_coff_read_string_table (bfd *abfd)
return NULL;
}
- strings = (char *) bfd_malloc (strsize);
+ strings = (char *) bfd_malloc (strsize + 1);
+ /* PR 17521 file: 079-54929-0.004.
+ A corrupt file could contain an index that points into the first
+ STRING_SIZE_SIZE bytes of the string table, so make sure that
+ they are zero. */
+ memset (strings, 0, STRING_SIZE_SIZE);
+
if (strings == NULL)
return NULL;
@@ -1699,7 +1728,9 @@ _bfd_coff_read_string_table (bfd *abfd)
}
obj_coff_strings (abfd) = strings;
-
+ obj_coff_strings_len (abfd) = strsize;
+ /* Terminate the string table, just in case. */
+ strings[strsize] = 0;
return strings;
}
@@ -1719,6 +1750,7 @@ _bfd_coff_free_symbols (bfd *abfd)
{
free (obj_coff_strings (abfd));
obj_coff_strings (abfd) = NULL;
+ obj_coff_strings_len (abfd) = 0;
}
return TRUE;
}
@@ -1739,21 +1771,22 @@ coff_get_normalized_symtab (bfd *abfd)
char *raw_src;
char *raw_end;
const char *string_table = NULL;
- char *debug_section = NULL;
+ asection * debug_sec = NULL;
+ char *debug_sec_data = NULL;
bfd_size_type size;
if (obj_raw_syments (abfd) != NULL)
return obj_raw_syments (abfd);
+ if (! _bfd_coff_get_external_symbols (abfd))
+ return NULL;
+
size = obj_raw_syment_count (abfd) * sizeof (combined_entry_type);
internal = (combined_entry_type *) bfd_zalloc (abfd, size);
if (internal == NULL && size != 0)
return NULL;
internal_end = internal + obj_raw_syment_count (abfd);
-
- if (! _bfd_coff_get_external_symbols (abfd))
- return NULL;
-
+
raw_src = (char *) obj_coff_external_syms (abfd);
/* Mark the end of the symbols. */
@@ -1768,23 +1801,29 @@ coff_get_normalized_symtab (bfd *abfd)
raw_src < raw_end;
raw_src += symesz, internal_ptr++)
{
-
unsigned int i;
+
bfd_coff_swap_sym_in (abfd, (void *) raw_src,
(void *) & internal_ptr->u.syment);
symbol_ptr = internal_ptr;
+ internal_ptr->is_sym = TRUE;
for (i = 0;
i < symbol_ptr->u.syment.n_numaux;
i++)
{
internal_ptr++;
+ /* PR 17512: Prevent buffer overrun. */
+ if (internal_ptr >= internal_end)
+ return NULL;
+
raw_src += symesz;
bfd_coff_swap_aux_in (abfd, (void *) raw_src,
symbol_ptr->u.syment.n_type,
symbol_ptr->u.syment.n_sclass,
(int) i, symbol_ptr->u.syment.n_numaux,
&(internal_ptr->u.auxent));
+ internal_ptr->is_sym = FALSE;
coff_pointerize_aux (abfd, internal, symbol_ptr, i,
internal_ptr);
}
@@ -1798,12 +1837,18 @@ coff_get_normalized_symtab (bfd *abfd)
for (internal_ptr = internal; internal_ptr < internal_end;
internal_ptr++)
{
+ BFD_ASSERT (internal_ptr->is_sym);
+
if (internal_ptr->u.syment.n_sclass == C_FILE
&& internal_ptr->u.syment.n_numaux > 0)
{
+ combined_entry_type * aux = internal_ptr + 1;
+
/* Make a file symbol point to the name in the auxent, since
the text ".file" is redundant. */
- if ((internal_ptr + 1)->u.auxent.x_file.x_n.x_zeroes == 0)
+ BFD_ASSERT (! aux->is_sym);
+
+ if (aux->u.auxent.x_file.x_n.x_zeroes == 0)
{
/* The filename is a long one, point into the string table. */
if (string_table == NULL)
@@ -1813,10 +1858,12 @@ coff_get_normalized_symtab (bfd *abfd)
return NULL;
}
- internal_ptr->u.syment._n._n_n._n_offset =
- ((bfd_hostptr_t)
- (string_table
- + (internal_ptr + 1)->u.auxent.x_file.x_n.x_offset));
+ if ((bfd_size_type)(aux->u.auxent.x_file.x_n.x_offset)
+ >= obj_coff_strings_len (abfd))
+ internal_ptr->u.syment._n._n_n._n_offset = (bfd_hostptr_t) _("<corrupt>");
+ else
+ internal_ptr->u.syment._n._n_n._n_offset =
+ (bfd_hostptr_t) (string_table + (aux->u.auxent.x_file.x_n.x_offset));
}
else
{
@@ -1826,15 +1873,15 @@ coff_get_normalized_symtab (bfd *abfd)
if (internal_ptr->u.syment.n_numaux > 1
&& coff_data (abfd)->pe)
internal_ptr->u.syment._n._n_n._n_offset =
- ((bfd_hostptr_t)
- copy_name (abfd,
- (internal_ptr + 1)->u.auxent.x_file.x_fname,
- internal_ptr->u.syment.n_numaux * symesz));
+ (bfd_hostptr_t)
+ copy_name (abfd,
+ aux->u.auxent.x_file.x_fname,
+ internal_ptr->u.syment.n_numaux * symesz);
else
internal_ptr->u.syment._n._n_n._n_offset =
((bfd_hostptr_t)
copy_name (abfd,
- (internal_ptr + 1)->u.auxent.x_file.x_fname,
+ aux->u.auxent.x_file.x_fname,
(size_t) bfd_coff_filnmlen (abfd)));
}
}
@@ -1871,18 +1918,33 @@ coff_get_normalized_symtab (bfd *abfd)
if (string_table == NULL)
return NULL;
}
- internal_ptr->u.syment._n._n_n._n_offset =
- ((bfd_hostptr_t)
- (string_table
- + internal_ptr->u.syment._n._n_n._n_offset));
+ if (internal_ptr->u.syment._n._n_n._n_offset >= obj_coff_strings_len (abfd)
+ || string_table + internal_ptr->u.syment._n._n_n._n_offset < string_table)
+ internal_ptr->u.syment._n._n_n._n_offset = (bfd_hostptr_t) _("<corrupt>");
+ else
+ internal_ptr->u.syment._n._n_n._n_offset =
+ ((bfd_hostptr_t)
+ (string_table
+ + internal_ptr->u.syment._n._n_n._n_offset));
}
else
{
/* Long name in debug section. Very similar. */
- if (debug_section == NULL)
- debug_section = build_debug_section (abfd);
- internal_ptr->u.syment._n._n_n._n_offset = (bfd_hostptr_t)
- (debug_section + internal_ptr->u.syment._n._n_n._n_offset);
+ if (debug_sec_data == NULL)
+ debug_sec_data = build_debug_section (abfd, & debug_sec);
+ if (debug_sec_data != NULL)
+ {
+ BFD_ASSERT (debug_sec != NULL);
+ /* PR binutils/17512: Catch out of range offsets into the debug data. */
+ if (internal_ptr->u.syment._n._n_n._n_offset > debug_sec->size
+ || debug_sec_data + internal_ptr->u.syment._n._n_n._n_offset < debug_sec_data)
+ internal_ptr->u.syment._n._n_n._n_offset = (bfd_hostptr_t) _("<corrupt>");
+ else
+ internal_ptr->u.syment._n._n_n._n_offset = (bfd_hostptr_t)
+ (debug_sec_data + internal_ptr->u.syment._n._n_n._n_offset);
+ }
+ else
+ internal_ptr->u.syment._n._n_n._n_offset = (bfd_hostptr_t) "";
}
}
internal_ptr += internal_ptr->u.syment.n_numaux;
@@ -1915,7 +1977,7 @@ coff_make_empty_symbol (bfd *abfd)
if (new_symbol == NULL)
return NULL;
new_symbol->symbol.section = 0;
- new_symbol->native = 0;
+ new_symbol->native = NULL;
new_symbol->lineno = NULL;
new_symbol->done_lineno = FALSE;
new_symbol->symbol.the_bfd = abfd;
@@ -1941,6 +2003,7 @@ coff_bfd_make_debug_symbol (bfd *abfd,
new_symbol->native = (combined_entry_type *) bfd_zalloc (abfd, amt);
if (!new_symbol->native)
return NULL;
+ new_symbol->native->is_sym = TRUE;
new_symbol->symbol.section = bfd_abs_section_ptr;
new_symbol->symbol.flags = BSF_DEBUGGING;
new_symbol->lineno = NULL;
@@ -1956,7 +2019,8 @@ coff_get_symbol_info (bfd *abfd, asymbol *symbol, symbol_info *ret)
bfd_symbol_info (symbol, ret);
if (coffsymbol (symbol)->native != NULL
- && coffsymbol (symbol)->native->fix_value)
+ && coffsymbol (symbol)->native->fix_value
+ && coffsymbol (symbol)->native->is_sym)
ret->value = coffsymbol (symbol)->native->u.syment.n_value -
(bfd_hostptr_t) obj_raw_syments (abfd);
}
@@ -1971,7 +2035,8 @@ bfd_coff_get_syment (bfd *abfd,
coff_symbol_type *csym;
csym = coff_symbol_from (abfd, symbol);
- if (csym == NULL || csym->native == NULL)
+ if (csym == NULL || csym->native == NULL
+ || ! csym->native->is_sym)
{
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
@@ -2003,6 +2068,7 @@ bfd_coff_get_auxent (bfd *abfd,
if (csym == NULL
|| csym->native == NULL
+ || ! csym->native->is_sym
|| indx >= csym->native->u.syment.n_numaux)
{
bfd_set_error (bfd_error_invalid_operation);
@@ -2011,6 +2077,7 @@ bfd_coff_get_auxent (bfd *abfd,
ent = csym->native + indx + 1;
+ BFD_ASSERT (! ent->is_sym);
*pauxent = ent->u.auxent;
if (ent->fix_tag)
@@ -2064,6 +2131,15 @@ coff_print_symbol (bfd *abfd,
fprintf (file, "[%3ld]", (long) (combined - root));
+ /* PR 17512: file: 079-33786-0.001:0.1. */
+ if (combined < obj_raw_syments (abfd)
+ || combined >= obj_raw_syments (abfd) + obj_raw_syment_count (abfd))
+ {
+ fprintf (file, _("<corrupt info> %s"), symbol->name);
+ break;
+ }
+
+ BFD_ASSERT (combined->is_sym);
if (! combined->fix_value)
val = (bfd_vma) combined->u.syment.n_value;
else
@@ -2083,6 +2159,7 @@ coff_print_symbol (bfd *abfd,
combined_entry_type *auxp = combined + aux + 1;
long tagndx;
+ BFD_ASSERT (! auxp->is_sym);
if (auxp->fix_tag)
tagndx = auxp->u.auxent.x_sym.x_tagndx.p - root;
else
@@ -2157,8 +2234,11 @@ coff_print_symbol (bfd *abfd,
l++;
while (l->line_number)
{
- fprintf (file, "\n%4d : ", l->line_number);
- bfd_fprintf_vma (abfd, file, l->u.offset + symbol->section->vma);
+ if (l->line_number > 0)
+ {
+ fprintf (file, "\n%4d : ", l->line_number);
+ bfd_fprintf_vma (abfd, file, l->u.offset + symbol->section->vma);
+ }
l++;
}
}
@@ -2193,13 +2273,13 @@ _bfd_coff_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED,
bfd_boolean
coff_find_nearest_line_with_names (bfd *abfd,
- const struct dwarf_debug_section *debug_sections,
- asection *section,
asymbol **symbols,
+ asection *section,
bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr,
- unsigned int *line_ptr)
+ unsigned int *line_ptr,
+ const struct dwarf_debug_section *debug_sections)
{
bfd_boolean found;
unsigned int i;
@@ -2224,10 +2304,9 @@ coff_find_nearest_line_with_names (bfd *abfd,
return TRUE;
/* Also try examining DWARF2 debugging information. */
- if (_bfd_dwarf2_find_nearest_line (abfd, debug_sections,
- section, symbols, offset,
+ if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset,
filename_ptr, functionname_ptr,
- line_ptr, NULL, 0,
+ line_ptr, NULL, debug_sections, 0,
&coff_data(abfd)->dwarf2_find_line_info))
return TRUE;
@@ -2250,6 +2329,7 @@ coff_find_nearest_line_with_names (bfd *abfd,
pend = p + cof->raw_syment_count;
while (p < pend)
{
+ BFD_ASSERT (p->is_sym);
if (p->u.syment.n_sclass == C_FILE)
break;
p += 1 + p->u.syment.n_numaux;
@@ -2273,6 +2353,7 @@ coff_find_nearest_line_with_names (bfd *abfd,
p2 < pend;
p2 += 1 + p2->u.syment.n_numaux)
{
+ BFD_ASSERT (p2->is_sym);
if (p2->u.syment.n_scnum > 0
&& (section
== coff_section_from_bfd_index (abfd,
@@ -2284,6 +2365,8 @@ coff_find_nearest_line_with_names (bfd *abfd,
break;
}
}
+ if (p2 >= pend)
+ break;
file_addr = (bfd_vma) p2->u.syment.n_value;
/* PR 11512: Include the section address of the function name symbol. */
@@ -2348,6 +2431,8 @@ coff_find_nearest_line_with_names (bfd *abfd,
if (coff->native)
{
combined_entry_type *s = coff->native;
+
+ BFD_ASSERT (s->is_sym);
s = s + 1 + s->u.syment.n_numaux;
/* In XCOFF a debugging symbol can follow the
@@ -2360,6 +2445,7 @@ coff_find_nearest_line_with_names (bfd *abfd,
{
/* The linenumber is stored in the auxent. */
union internal_auxent *a = &((s + 1)->u.auxent);
+
line_base = a->x_sym.x_misc.x_lnsz.x_lnno;
*line_ptr = line_base;
}
@@ -2409,38 +2495,22 @@ coff_find_nearest_line_with_names (bfd *abfd,
bfd_boolean
coff_find_nearest_line (bfd *abfd,
- asection *section,
asymbol **symbols,
+ asection *section,
bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr,
- unsigned int *line_ptr)
+ unsigned int *line_ptr,
+ unsigned int *discriminator_ptr)
{
- return coff_find_nearest_line_with_names (abfd, dwarf_debug_sections,
- section, symbols, offset,
+ if (discriminator_ptr)
+ *discriminator_ptr = 0;
+ return coff_find_nearest_line_with_names (abfd, symbols, section, offset,
filename_ptr, functionname_ptr,
- line_ptr);
+ line_ptr, dwarf_debug_sections);
}
bfd_boolean
-coff_find_nearest_line_discriminator (bfd *abfd,
- asection *section,
- asymbol **symbols,
- bfd_vma offset,
- const char **filename_ptr,
- const char **functionname_ptr,
- unsigned int *line_ptr,
- unsigned int *discriminator)
-{
- *discriminator = 0;
- return coff_find_nearest_line_with_names (abfd, dwarf_debug_sections,
- section, symbols, offset,
- filename_ptr, functionname_ptr,
- line_ptr);
-}
-
-
-bfd_boolean
coff_find_inliner_info (bfd *abfd,
const char **filename_ptr,
const char **functionname_ptr,
@@ -2497,6 +2567,7 @@ bfd_coff_set_symbol_class (bfd * abfd,
if (native == NULL)
return FALSE;
+ native->is_sym = TRUE;
native->u.syment.n_type = T_NULL;
native->u.syment.n_sclass = symbol_class;
diff --git a/binutils-2.25/bfd/cofflink.c b/binutils-2.25/bfd/cofflink.c
index 948b4cd0..2782795d 100644
--- a/binutils-2.25/bfd/cofflink.c
+++ b/binutils-2.25/bfd/cofflink.c
@@ -1,6 +1,5 @@
/* COFF specific linker code.
- Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -30,9 +29,11 @@
#include "libcoff.h"
#include "safe-ctype.h"
-static bfd_boolean coff_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info);
-static bfd_boolean coff_link_check_archive_element (bfd *abfd, struct bfd_link_info *info, bfd_boolean *pneeded);
-static bfd_boolean coff_link_add_symbols (bfd *abfd, struct bfd_link_info *info);
+static bfd_boolean coff_link_add_object_symbols (bfd *, struct bfd_link_info *);
+static bfd_boolean coff_link_check_archive_element
+ (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, const char *,
+ bfd_boolean *);
+static bfd_boolean coff_link_add_symbols (bfd *, struct bfd_link_info *);
/* Return TRUE if SYM is a weak, external symbol. */
#define IS_WEAK_EXTERNAL(abfd, sym) \
@@ -191,74 +192,6 @@ coff_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
return TRUE;
}
-/* Look through the symbols to see if this object file should be
- included in the link. */
-
-static bfd_boolean
-coff_link_check_ar_symbols (bfd *abfd,
- struct bfd_link_info *info,
- bfd_boolean *pneeded,
- bfd **subsbfd)
-{
- bfd_size_type symesz;
- bfd_byte *esym;
- bfd_byte *esym_end;
-
- *pneeded = FALSE;
-
- symesz = bfd_coff_symesz (abfd);
- esym = (bfd_byte *) obj_coff_external_syms (abfd);
- esym_end = esym + obj_raw_syment_count (abfd) * symesz;
- while (esym < esym_end)
- {
- struct internal_syment sym;
- enum coff_symbol_classification classification;
-
- bfd_coff_swap_sym_in (abfd, esym, &sym);
-
- classification = bfd_coff_classify_symbol (abfd, &sym);
- if (classification == COFF_SYMBOL_GLOBAL
- || classification == COFF_SYMBOL_COMMON)
- {
- const char *name;
- char buf[SYMNMLEN + 1];
- struct bfd_link_hash_entry *h;
-
- /* This symbol is externally visible, and is defined by this
- object file. */
- name = _bfd_coff_internal_syment_name (abfd, &sym, buf);
- if (name == NULL)
- return FALSE;
- h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE);
-
- /* Auto import. */
- if (!h
- && info->pei386_auto_import
- && CONST_STRNEQ (name, "__imp_"))
- h = bfd_link_hash_lookup (info->hash, name + 6, FALSE, FALSE, TRUE);
-
- /* We are only interested in symbols that are currently
- undefined. If a symbol is currently known to be common,
- COFF linkers do not bring in an object file which defines
- it. */
- if (h != (struct bfd_link_hash_entry *) NULL
- && h->type == bfd_link_hash_undefined)
- {
- if (!(*info->callbacks
- ->add_archive_element) (info, abfd, name, subsbfd))
- return FALSE;
- *pneeded = TRUE;
- return TRUE;
- }
- }
-
- esym += (sym.n_numaux + 1) * symesz;
- }
-
- /* We do not need this object file. */
- return TRUE;
-}
-
/* Check a single archive element to see if we need to include it in
the link. *PNEEDED is set according to whether this element is
needed in the link or not. This is called via
@@ -267,41 +200,23 @@ coff_link_check_ar_symbols (bfd *abfd,
static bfd_boolean
coff_link_check_archive_element (bfd *abfd,
struct bfd_link_info *info,
+ struct bfd_link_hash_entry *h,
+ const char *name,
bfd_boolean *pneeded)
{
- bfd *oldbfd;
- bfd_boolean needed;
+ *pneeded = FALSE;
- if (!_bfd_coff_get_external_symbols (abfd))
- return FALSE;
+ /* We are only interested in symbols that are currently undefined.
+ If a symbol is currently known to be common, COFF linkers do not
+ bring in an object file which defines it. */
+ if (h->type != bfd_link_hash_undefined)
+ return TRUE;
- oldbfd = abfd;
- if (!coff_link_check_ar_symbols (abfd, info, pneeded, &abfd))
+ if (!(*info->callbacks->add_archive_element) (info, abfd, name, &abfd))
return FALSE;
+ *pneeded = TRUE;
- needed = *pneeded;
- if (needed)
- {
- /* Potentially, the add_archive_element hook may have set a
- substitute BFD for us. */
- if (abfd != oldbfd)
- {
- if (!info->keep_memory
- && !_bfd_coff_free_symbols (oldbfd))
- return FALSE;
- if (!_bfd_coff_get_external_symbols (abfd))
- return FALSE;
- }
- if (!coff_link_add_symbols (abfd, info))
- return FALSE;
- }
-
- if (!info->keep_memory || !needed)
- {
- if (!_bfd_coff_free_symbols (abfd))
- return FALSE;
- }
- return TRUE;
+ return coff_link_add_object_symbols (abfd, info);
}
/* Add all the symbols from an object file to the hash table. */
@@ -861,7 +776,7 @@ _bfd_coff_final_link (bfd *abfd,
the opportunity to clear the output_has_begun fields of all the
input BFD's. */
max_sym_count = 0;
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
size_t sz;
@@ -946,7 +861,7 @@ _bfd_coff_final_link (bfd *abfd,
if (flaginfo.info->strip != strip_all && flaginfo.info->discard != discard_all)
{
/* Add local symbols from foreign inputs. */
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
unsigned int i;
@@ -2088,7 +2003,10 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *flaginfo, bfd *input_bfd)
if (strings == NULL)
return FALSE;
}
- filename = strings + auxp->x_file.x_n.x_offset;
+ if ((bfd_size_type) auxp->x_file.x_n.x_offset >= obj_coff_strings_len (input_bfd))
+ filename = _("<corrupt>");
+ else
+ filename = strings + auxp->x_file.x_n.x_offset;
indx = _bfd_stringtab_add (flaginfo->strtab, filename,
hash, copy);
if (indx == (bfd_size_type) -1)
@@ -3060,6 +2978,11 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd,
else
{
sec = sections[symndx];
+
+ /* If the output section has been discarded then ignore this reloc. */
+ if (sec->output_section->vma == 0)
+ continue;
+
val = (sec->output_section->vma
+ sec->output_offset
+ sym->n_value);
diff --git a/binutils-2.25/bfd/coffswap.h b/binutils-2.25/bfd/coffswap.h
index 674fdc77..c62be2eb 100644
--- a/binutils-2.25/bfd/coffswap.h
+++ b/binutils-2.25/bfd/coffswap.h
@@ -1,7 +1,5 @@
/* Generic COFF swapping routines, for BFD.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000,
- 2001, 2002, 2004, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/compress.c b/binutils-2.25/bfd/compress.c
index 46c2bcba..20eef952 100644
--- a/binutils-2.25/bfd/compress.c
+++ b/binutils-2.25/bfd/compress.c
@@ -1,6 +1,5 @@
/* Compressed section support (intended for debug sections).
- Copyright 2008, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2008-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -25,6 +24,7 @@
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
+#include "safe-ctype.h"
#ifdef HAVE_ZLIB_H
static bfd_boolean
@@ -304,6 +304,15 @@ bfd_is_section_compressed (bfd *abfd, sec_ptr sec)
compressed = (bfd_get_section_contents (abfd, sec, compressed_buffer, 0, 12)
&& CONST_STRNEQ ((char*) compressed_buffer, "ZLIB"));
+ /* Check for the pathalogical case of a debug string section that
+ contains the string ZLIB.... as the first entry. We assume that
+ no uncompressed .debug_str section would ever be big enough to
+ have the first byte of its (big-endian) size be non-zero. */
+ if (compressed
+ && strcmp (sec->name, ".debug_str") == 0
+ && ISPRINT (compressed_buffer[4]))
+ compressed = FALSE;
+
/* Restore compress_status. */
sec->compress_status = saved;
return compressed;
diff --git a/binutils-2.25/bfd/config.bfd b/binutils-2.25/bfd/config.bfd
index 5324d39a..7bcb92af 100644
--- a/binutils-2.25/bfd/config.bfd
+++ b/binutils-2.25/bfd/config.bfd
@@ -1,6 +1,6 @@
# config.bfd
#
-# Copyright 2012, 2013 Free Software Foundation
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -48,6 +48,11 @@ targ_underscore=no
# Catch obsolete configurations.
case $targ in
+ openrisc-*-* | or32-*-*)
+ echo "*** Configuration $targ is obsolete." >&2
+ echo "*** Use or1k-*-elf or or1k-*-linux as the target instead" >&2
+ exit 1
+ ;;
null)
if test "x$enable_obsolete" != xyes; then
echo "*** Configuration $targ is obsolete." >&2
@@ -59,24 +64,23 @@ case $targ in
esac
case $targ in
- m68*-apple-aux* | \
- m68*-apollo-* | \
- m68*-bull-sysv* | \
- m68*-*-rtemscoff* | \
- maxq-*-coff | \
- i960-*-rtems* | \
- or32-*-rtems* | \
- m68*-*-lynxos* | \
- sparc-*-lynxos* | \
- vax-*-vms* | \
- arm-*-oabi | \
+ *-go32-rtems* | \
a29k-* | \
+ arm-*-oabi | \
hppa*-*-rtems* | \
- *-go32-rtems* | \
+ i960-*-rtems* | \
i[3-7]86*-*-rtemscoff* | \
+ m68*-*-lynxos* | \
+ m68*-*-rtemscoff* | \
+ m68*-apollo-* | \
+ m68*-apple-aux* | \
+ m68*-bull-sysv* | \
+ maxq-*-coff | \
mips*el-*-rtems* | \
powerpcle-*-rtems* | \
sparc*-*-rtemsaout* | \
+ sparc-*-lynxos* | \
+ vax-*-vms* | \
null)
echo "*** Configuration $targ is obsolete." >&2
echo "*** Support has been REMOVED." >&2
@@ -109,8 +113,9 @@ m68*) targ_archs=bfd_m68k_arch ;;
m88*) targ_archs=bfd_m88k_arch ;;
microblaze*) targ_archs=bfd_microblaze_arch ;;
mips*) targ_archs=bfd_mips_arch ;;
+nds32*) targ_archs=bfd_nds32_arch ;;
nios2*) targ_archs=bfd_nios2_arch ;;
-or32*) targ_archs=bfd_or32_arch ;;
+or1k*|or1knd*) targ_archs=bfd_or1k_arch ;;
pdp11*) targ_archs=bfd_pdp11_arch ;;
pj*) targ_archs="bfd_pj_arch bfd_i386_arch";;
powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
@@ -163,28 +168,28 @@ case "${targ}" in
# START OF targmatch.h
#ifdef BFD64
aarch64-*-elf)
- targ_defvec=bfd_elf64_littleaarch64_vec
- targ_selvecs="bfd_elf64_bigaarch64_vec bfd_elf32_littleaarch64_vec bfd_elf32_bigaarch64_vec bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec"
+ targ_defvec=aarch64_elf64_le_vec
+ targ_selvecs="aarch64_elf64_be_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_le_vec arm_elf32_be_vec"
want64=true
;;
aarch64_be-*-elf)
- targ_defvec=bfd_elf64_bigaarch64_vec
- targ_selvecs="bfd_elf64_littleaarch64_vec bfd_elf32_littleaarch64_vec bfd_elf32_bigaarch64_vec bfd_elf32_bigarm_vec bfd_elf32_littlearm_vec"
+ targ_defvec=aarch64_elf64_be_vec
+ targ_selvecs="aarch64_elf64_le_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_be_vec arm_elf32_le_vec"
want64=true
;;
aarch64-*-linux*)
- targ_defvec=bfd_elf64_littleaarch64_vec
- targ_selvecs="bfd_elf64_bigaarch64_vec bfd_elf32_littleaarch64_vec bfd_elf32_bigaarch64_vec bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec"
+ targ_defvec=aarch64_elf64_le_vec
+ targ_selvecs="aarch64_elf64_be_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_le_vec arm_elf32_be_vec"
want64=true
;;
aarch64_be-*-linux*)
- targ_defvec=bfd_elf64_bigaarch64_vec
- targ_selvecs="bfd_elf64_littleaarch64_vec bfd_elf32_littleaarch64_vec bfd_elf32_bigaarch64_vec bfd_elf32_bigarm_vec bfd_elf32_littlearm_vec"
+ targ_defvec=aarch64_elf64_be_vec
+ targ_selvecs="aarch64_elf64_le_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_be_vec arm_elf32_le_vec"
want64=true
;;
alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
- targ_defvec=bfd_elf64_alpha_freebsd_vec
- targ_selvecs="bfd_elf64_alpha_vec ecoffalpha_little_vec"
+ targ_defvec=alpha_elf64_fbsd_vec
+ targ_selvecs="alpha_elf64_vec alpha_ecoff_le_vec"
want64=true
# FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
case "${targ}" in
@@ -193,170 +198,170 @@ case "${targ}" in
esac
;;
alpha*-*-netbsd* | alpha*-*-openbsd*)
- targ_defvec=bfd_elf64_alpha_vec
- targ_selvecs=ecoffalpha_little_vec
+ targ_defvec=alpha_elf64_vec
+ targ_selvecs=alpha_ecoff_le_vec
want64=true
;;
alpha*-*-netware*)
- targ_defvec=ecoffalpha_little_vec
- targ_selvecs=nlm32_alpha_vec
+ targ_defvec=alpha_ecoff_le_vec
+ targ_selvecs=alpha_nlm32_vec
want64=true
;;
alpha*-*-linux*ecoff*)
- targ_defvec=ecoffalpha_little_vec
- targ_selvecs=bfd_elf64_alpha_vec
+ targ_defvec=alpha_ecoff_le_vec
+ targ_selvecs=alpha_elf64_vec
want64=true
;;
alpha*-*-linux-* | alpha*-*-elf*)
- targ_defvec=bfd_elf64_alpha_vec
- targ_selvecs=ecoffalpha_little_vec
+ targ_defvec=alpha_elf64_vec
+ targ_selvecs=alpha_ecoff_le_vec
want64=true
;;
alpha*-*-*vms*)
- targ_defvec=vms_alpha_vec
- targ_selvecs=vms_lib_txt_vec
+ targ_defvec=alpha_vms_vec
+ targ_selvecs=alpha_vms_lib_txt_vec
want64=true
;;
alpha*-*-*)
- targ_defvec=ecoffalpha_little_vec
+ targ_defvec=alpha_ecoff_le_vec
want64=true
;;
ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
- targ_defvec=bfd_elf64_ia64_little_vec
- targ_selvecs="bfd_elf64_ia64_big_vec bfd_pei_ia64_vec"
+ targ_defvec=ia64_elf64_le_vec
+ targ_selvecs="ia64_elf64_be_vec ia64_pei_vec"
want64=true
;;
ia64*-*-hpux*)
- targ_defvec=bfd_elf32_ia64_hpux_big_vec
- targ_selvecs="bfd_elf64_ia64_hpux_big_vec"
+ targ_defvec=ia64_elf32_hpux_be_vec
+ targ_selvecs="ia64_elf64_hpux_be_vec"
want64=true
;;
ia64*-*-*vms*)
- targ_defvec=bfd_elf64_ia64_vms_vec
- targ_selvecs=vms_lib_txt_vec
+ targ_defvec=ia64_elf64_vms_vec
+ targ_selvecs=alpha_vms_lib_txt_vec
want64=true
;;
sparc64-*-freebsd* | sparc64-*-kfreebsd*-gnu)
- targ_defvec=bfd_elf64_sparc_freebsd_vec
- targ_selvecs="bfd_elf64_sparc_vec bfd_elf32_sparc_vec sunos_big_vec"
+ targ_defvec=sparc_elf64_fbsd_vec
+ targ_selvecs="sparc_elf64_vec sparc_elf32_vec sparc_aout_sunos_be_vec"
;;
sparc64-*-netbsd* | sparc64-*-openbsd*)
- targ_defvec=bfd_elf64_sparc_vec
- targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_defvec=sparc_elf64_vec
+ targ_selvecs="sparc_elf32_vec sparc_aout_sunos_be_vec"
want64=true
;;
#endif /* BFD64 */
am34-*-linux* | am33_2.0-*-linux*)
- targ_defvec=bfd_elf32_am33lin_vec
+ targ_defvec=am33_elf32_linux_vec
;;
arc-*-elf*)
- targ_defvec=bfd_elf32_littlearc_vec
- targ_selvecs=bfd_elf32_bigarc_vec
+ targ_defvec=arc_elf32_le_vec
+ targ_selvecs=arc_elf32_be_vec
;;
arm-*-nacl*)
- targ_defvec=bfd_elf32_littlearm_nacl_vec
- targ_selvecs="bfd_elf32_bigarm_nacl_vec bfd_elf32_i386_nacl_vec"
- targ64_selvecs="bfd_elf32_x86_64_nacl_vec bfd_elf64_x86_64_nacl_vec"
+ targ_defvec=arm_elf32_nacl_le_vec
+ targ_selvecs="arm_elf32_nacl_be_vec i386_elf32_nacl_vec"
+ targ64_selvecs="x86_64_elf32_nacl_vec x86_64_elf64_nacl_vec"
targ_archs="$targ_archs bfd_i386_arch"
;;
armeb-*-nacl*)
- targ_defvec=bfd_elf32_bigarm_nacl_vec
- targ_selvecs="bfd_elf32_littlearm_nacl_vec bfd_elf32_i386_nacl_vec"
- targ64_selvecs="bfd_elf32_x86_64_nacl_vec bfd_elf64_x86_64_nacl_vec"
+ targ_defvec=arm_elf32_nacl_be_vec
+ targ_selvecs="arm_elf32_nacl_le_vec i386_elf32_nacl_vec"
+ targ64_selvecs="x86_64_elf32_nacl_vec x86_64_elf64_nacl_vec"
targ_archs="$targ_archs bfd_i386_arch"
;;
armeb-*-netbsdelf*)
- targ_defvec=bfd_elf32_bigarm_vec
- targ_selvecs="bfd_elf32_littlearm_vec armnetbsd_vec"
+ targ_defvec=arm_elf32_be_vec
+ targ_selvecs="arm_elf32_le_vec arm_aout_nbsd_vec"
;;
arm-*-netbsdelf*)
- targ_defvec=bfd_elf32_littlearm_vec
- targ_selvecs="bfd_elf32_bigarm_vec armnetbsd_vec"
+ targ_defvec=arm_elf32_le_vec
+ targ_selvecs="arm_elf32_be_vec arm_aout_nbsd_vec"
;;
arm-*-netbsd* | arm-*-openbsd*)
- targ_defvec=armnetbsd_vec
- targ_selvecs="bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec"
+ targ_defvec=arm_aout_nbsd_vec
+ targ_selvecs="arm_elf32_le_vec arm_elf32_be_vec"
targ_underscore=yes
- targ_cflags=-D__QNXTARGET__
;;
arm-*-nto* | nto*arm*)
- targ_defvec=bfd_elf32_littlearm_vec
- targ_selvecs=bfd_elf32_bigarm_vec
+ targ_defvec=arm_elf32_le_vec
+ targ_selvecs=arm_elf32_be_vec
+ targ_cflags=-D__QNXTARGET__
;;
arm-*-riscix*)
- targ_defvec=riscix_vec
+ targ_defvec=arm_aout_riscix_vec
;;
arm-epoc-pe*)
- targ_defvec=arm_epoc_pe_little_vec
- targ_selvecs="arm_epoc_pe_little_vec arm_epoc_pe_big_vec arm_epoc_pei_little_vec arm_epoc_pei_big_vec"
+ targ_defvec=arm_pe_epoc_le_vec
+ targ_selvecs="arm_pe_epoc_le_vec arm_pe_epoc_be_vec arm_pei_epoc_le_vec arm_pei_epoc_be_vec"
targ_underscore=no
targ_cflags=-DARM_COFF_BUGFIX
;;
arm-wince-pe | arm-*-wince | arm*-*-mingw32ce* | arm*-*-cegcc*)
- targ_defvec=arm_wince_pe_little_vec
- targ_selvecs="arm_wince_pe_little_vec arm_wince_pe_big_vec arm_wince_pei_little_vec arm_wince_pei_big_vec"
+ targ_defvec=arm_pe_wince_le_vec
+ targ_selvecs="arm_pe_wince_le_vec arm_pe_wince_be_vec arm_pei_wince_le_vec arm_pei_wince_be_vec"
targ_underscore=no
targ_cflags="-DARM_WINCE -DARM_COFF_BUGFIX"
;;
arm-*-pe*)
- targ_defvec=armpe_little_vec
- targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec"
+ targ_defvec=arm_pe_le_vec
+ targ_selvecs="arm_pe_le_vec arm_pe_be_vec arm_pei_le_vec arm_pei_be_vec"
targ_underscore=yes
;;
arm-*-aout | armel-*-aout)
- targ_defvec=aout_arm_little_vec
- targ_selvecs=aout_arm_big_vec
+ targ_defvec=arm_aout_le_vec
+ targ_selvecs=arm_aout_be_vec
;;
armeb-*-aout)
- targ_defvec=aout_arm_big_vec
- targ_selvecs=aout_arm_little_vec
+ targ_defvec=arm_aout_be_vec
+ targ_selvecs=arm_aout_le_vec
;;
arm-*-coff)
- targ_defvec=armcoff_little_vec
- targ_selvecs=armcoff_big_vec
+ targ_defvec=arm_coff_le_vec
+ targ_selvecs=arm_coff_be_vec
targ_underscore=yes
;;
arm-*-rtems*)
- targ_defvec=bfd_elf32_littlearm_vec
- targ_selvecs=bfd_elf32_bigarm_vec
+ targ_defvec=arm_elf32_le_vec
+ targ_selvecs=arm_elf32_be_vec
;;
- armeb-*-elf | arm*b-*-linux-*)
- targ_defvec=bfd_elf32_bigarm_vec
- targ_selvecs=bfd_elf32_littlearm_vec
+ armeb-*-elf | arm*b-*-freebsd* | arm*b-*-linux-* | armeb-*-eabi*)
+ targ_defvec=arm_elf32_be_vec
+ targ_selvecs=arm_elf32_le_vec
;;
arm-*-kaos*)
- targ_defvec=bfd_elf32_littlearm_vec
- targ_selvecs=bfd_elf32_bigarm_vec
+ targ_defvec=arm_elf32_le_vec
+ targ_selvecs=arm_elf32_be_vec
;;
- arm-*-elf | arm-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \
+ arm-*-elf | arm*-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \
arm*-*-uclinux* | arm-*-kfreebsd*-gnu | \
arm*-*-eabi* )
- targ_defvec=bfd_elf32_littlearm_vec
- targ_selvecs=bfd_elf32_bigarm_vec
+ targ_defvec=arm_elf32_le_vec
+ targ_selvecs=arm_elf32_be_vec
;;
arm*-*-vxworks | arm*-*-windiss)
- targ_defvec=bfd_elf32_littlearm_vxworks_vec
- targ_selvecs=bfd_elf32_bigarm_vxworks_vec
+ targ_defvec=arm_elf32_vxworks_le_vec
+ targ_selvecs=arm_elf32_vxworks_be_vec
;;
arm*-*-symbianelf*)
- targ_defvec=bfd_elf32_littlearm_symbian_vec
- targ_selvecs=bfd_elf32_bigarm_symbian_vec
+ targ_defvec=arm_elf32_symbian_le_vec
+ targ_selvecs=arm_elf32_symbian_be_vec
;;
arm9e-*-elf)
- targ_defvec=bfd_elf32_littlearm_vec
- targ_selvecs=bfd_elf32_bigarm_vec
+ targ_defvec=arm_elf32_le_vec
+ targ_selvecs=arm_elf32_be_vec
;;
avr-*-*)
- targ_defvec=bfd_elf32_avr_vec
+ targ_defvec=avr_elf32_vec
;;
bfin-*-*)
- targ_defvec=bfd_elf32_bfin_vec
- targ_selvecs=bfd_elf32_bfinfdpic_vec
+ targ_defvec=bfin_elf32_vec
+ targ_selvecs=bfin_elf32_fdpic_vec
targ_underscore=yes
;;
@@ -380,211 +385,215 @@ case "${targ}" in
;;
cr16-*-elf* | cr16*-*-uclinux*)
- targ_defvec=bfd_elf32_cr16_vec
+ targ_defvec=cr16_elf32_vec
targ_underscore=yes
;;
cr16c-*-elf*)
- targ_defvec=bfd_elf32_cr16c_vec
+ targ_defvec=cr16c_elf32_vec
targ_underscore=yes
;;
cris-*-* | crisv32-*-*)
targ_defvec=cris_aout_vec
- targ_selvecs="bfd_elf32_us_cris_vec bfd_elf32_cris_vec ieee_vec"
- targ_underscore=yes # Note: not true for bfd_elf32_cris_vec.
+ targ_selvecs="cris_elf32_us_vec cris_elf32_vec ieee_vec"
+ targ_underscore=yes # Note: not true for cris_elf32_vec.
;;
crx-*-elf*)
- targ_defvec=bfd_elf32_crx_vec
+ targ_defvec=crx_elf32_vec
targ_underscore=yes
;;
d10v-*-*)
- targ_defvec=bfd_elf32_d10v_vec
+ targ_defvec=d10v_elf32_vec
;;
dlx-*-elf*)
- targ_defvec=bfd_elf32_dlx_big_vec
- targ_selvecs="bfd_elf32_dlx_big_vec"
+ targ_defvec=dlx_elf32_be_vec
+ targ_selvecs="dlx_elf32_be_vec"
;;
d30v-*-*)
- targ_defvec=bfd_elf32_d30v_vec
+ targ_defvec=d30v_elf32_vec
;;
epiphany-*-elf)
- targ_defvec=bfd_elf32_epiphany_vec
+ targ_defvec=epiphany_elf32_vec
;;
fido-*-elf* )
- targ_defvec=bfd_elf32_m68k_vec
- targ_selvecs="m68kcoff_vec ieee_vec"
+ targ_defvec=m68k_elf32_vec
+ targ_selvecs="m68k_coff_vec ieee_vec"
;;
fr30-*-elf)
- targ_defvec=bfd_elf32_fr30_vec
+ targ_defvec=fr30_elf32_vec
;;
frv-*-elf)
- targ_defvec=bfd_elf32_frv_vec
- targ_selvecs=bfd_elf32_frvfdpic_vec
+ targ_defvec=frv_elf32_vec
+ targ_selvecs=frv_elf32_fdpic_vec
;;
frv-*-*linux*)
- targ_defvec=bfd_elf32_frvfdpic_vec
- targ_selvecs=bfd_elf32_frv_vec
+ targ_defvec=frv_elf32_fdpic_vec
+ targ_selvecs=frv_elf32_vec
;;
moxie-*-elf | moxie-*-rtems* | moxie-*-uclinux)
- targ_defvec=bfd_elf32_bigmoxie_vec
- targ_selvecs=bfd_elf32_littlemoxie_vec
+ targ_defvec=moxie_elf32_be_vec
+ targ_selvecs=moxie_elf32_le_vec
+ ;;
+
+ moxie-*-moxiebox*)
+ targ_defvec=moxie_elf32_le_vec
;;
h8300*-*-rtemscoff*)
- targ_defvec=h8300coff_vec
+ targ_defvec=h8300_coff_vec
targ_underscore=yes
;;
h8300*-*-elf | h8300*-*-rtems*)
- targ_defvec=bfd_elf32_h8300_vec
+ targ_defvec=h8300_elf32_vec
targ_underscore=yes
;;
h8300*-*-*)
- targ_defvec=h8300coff_vec
+ targ_defvec=h8300_coff_vec
targ_underscore=yes
;;
h8500-*-*)
- targ_defvec=h8500coff_vec
+ targ_defvec=h8500_coff_vec
targ_underscore=yes
;;
#ifdef BFD64
hppa*64*-*-linux-*)
- targ_defvec=bfd_elf64_hppa_linux_vec
- targ_selvecs=bfd_elf64_hppa_vec
+ targ_defvec=hppa_elf64_linux_vec
+ targ_selvecs=hppa_elf64_vec
want64=true
;;
hppa*64*-*-hpux11*)
- targ_defvec=bfd_elf64_hppa_vec
- targ_selvecs=bfd_elf64_hppa_linux_vec
+ targ_defvec=hppa_elf64_vec
+ targ_selvecs=hppa_elf64_linux_vec
targ_cflags=-DHPUX_LARGE_AR_IDS
want64=true
;;
#endif
hppa*-*-linux-*)
- targ_defvec=bfd_elf32_hppa_linux_vec
- targ_selvecs=bfd_elf32_hppa_vec
+ targ_defvec=hppa_elf32_linux_vec
+ targ_selvecs=hppa_elf32_vec
;;
hppa*-*-netbsd*)
- targ_defvec=bfd_elf32_hppa_nbsd_vec
- targ_selvecs="bfd_elf32_hppa_vec bfd_elf32_hppa_linux_vec"
+ targ_defvec=hppa_elf32_nbsd_vec
+ targ_selvecs="hppa_elf32_vec hppa_elf32_linux_vec"
;;
hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-openbsd*)
- targ_defvec=bfd_elf32_hppa_vec
- targ_selvecs=bfd_elf32_hppa_linux_vec
+ targ_defvec=hppa_elf32_vec
+ targ_selvecs=hppa_elf32_linux_vec
;;
hppa*-*-bsd*)
- targ_defvec=som_vec
- targ_selvecs=bfd_elf32_hppa_vec
+ targ_defvec=hppa_som_vec
+ targ_selvecs=hppa_elf32_vec
;;
hppa*-*-hpux* | hppa*-*-hiux* | hppa*-*-mpeix*)
- targ_defvec=som_vec
+ targ_defvec=hppa_som_vec
;;
hppa*-*-osf*)
- targ_defvec=som_vec
- targ_selvecs=bfd_elf32_hppa_vec
+ targ_defvec=hppa_som_vec
+ targ_selvecs=hppa_elf32_vec
;;
i370-*-*)
- targ_defvec=bfd_elf32_i370_vec
- targ_selvecs="bfd_elf32_i370_vec"
+ targ_defvec=i370_elf32_vec
+ targ_selvecs="i370_elf32_vec"
;;
i[3-7]86-*-sco3.2v5*coff)
- targ_defvec=i386coff_vec
- targ_selvecs=bfd_elf32_i386_vec
+ targ_defvec=i386_coff_vec
+ targ_selvecs=i386_elf32_vec
;;
i[3-7]86-*-sysv4* | i[3-7]86-*-unixware* | \
i[3-7]86-*-elf | i[3-7]86-*-sco3.2v5* | \
i[3-7]86-*-dgux* | i[3-7]86-*-sysv5*)
- targ_defvec=bfd_elf32_i386_vec
- targ_selvecs=i386coff_vec
+ targ_defvec=i386_elf32_vec
+ targ_selvecs=i386_coff_vec
;;
i[3-7]86-*-solaris2*)
- targ_defvec=bfd_elf32_i386_sol2_vec
- targ_selvecs="i386coff_vec"
- targ64_selvecs="bfd_elf64_x86_64_sol2_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
+ targ_defvec=i386_elf32_sol2_vec
+ targ_selvecs="i386_coff_vec"
+ targ64_selvecs="x86_64_elf64_sol2_vec l1om_elf64_vec k1om_elf64_vec"
want64=true
;;
#ifdef BFD64
x86_64-*-solaris2*)
- targ_defvec=bfd_elf32_i386_sol2_vec
- targ_selvecs="bfd_elf64_x86_64_sol2_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec i386coff_vec"
+ targ_defvec=i386_elf32_sol2_vec
+ targ_selvecs="x86_64_elf64_sol2_vec l1om_elf64_vec k1om_elf64_vec i386_coff_vec"
want64=true
;;
#endif
i[3-7]86-*-kaos*)
- targ_defvec=bfd_elf32_i386_vec
- targ_selvecs=bfd_elf32_i386_vec
+ targ_defvec=i386_elf32_vec
+ targ_selvecs=i386_elf32_vec
;;
i[3-7]86-*-nto*)
- targ_defvec=bfd_elf32_i386_vec
- targ_selvecs=i386coff_vec
+ targ_defvec=i386_elf32_vec
+ targ_selvecs=i386_coff_vec
;;
i[3-7]86-*-aros*)
- targ_defvec=bfd_elf32_i386_vec
+ targ_defvec=i386_elf32_vec
;;
i[3-7]86-*-chorus*)
- targ_defvec=bfd_elf32_i386_vec
+ targ_defvec=i386_elf32_vec
;;
i[3-7]86-*-dicos*)
- targ_defvec=bfd_elf32_i386_vec
- targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
+ targ_defvec=i386_elf32_vec
+ targ64_selvecs="x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec"
;;
*-*-msdosdjgpp* | *-*-go32* )
- targ_defvec=go32coff_vec
- targ_selvecs="go32stubbedcoff_vec i386aout_vec"
+ targ_defvec=i386_coff_go32_vec
+ targ_selvecs="i386_coff_go32stubbed_vec i386_aout_vec"
;;
i[3-7]86-*-sysv* | i[3-7]86-*-isc* | i[3-7]86-*-sco* | i[3-7]86-*-coff | \
i[3-7]86-*-aix*)
- targ_defvec=i386coff_vec
+ targ_defvec=i386_coff_vec
;;
i[3-7]86-*-rtems*)
- targ_defvec=bfd_elf32_i386_vec
- targ_selvecs="i386coff_vec i386aout_vec"
+ targ_defvec=i386_elf32_vec
+ targ_selvecs="i386_coff_vec i386_aout_vec"
;;
i[3-7]86-*-darwin* | i[3-7]86-*-macos10* | i[3-7]86-*-rhapsody*)
- targ_defvec=mach_o_i386_vec
+ targ_defvec=i386_mach_o_vec
targ_selvecs="mach_o_le_vec mach_o_be_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
- targ64_selvecs=mach_o_x86_64_vec
+ targ64_selvecs=x86_64_mach_o_vec
targ_archs="$targ_archs bfd_powerpc_arch bfd_rs6000_arch"
;;
i[3-7]86-sequent-bsd*)
- targ_defvec=i386dynix_vec
+ targ_defvec=i386_aout_dynix_vec
targ_underscore=yes
;;
i[3-7]86-*-bsd*)
- targ_defvec=i386bsd_vec
+ targ_defvec=i386_aout_bsd_vec
targ_underscore=yes
;;
i[3-7]86-*-dragonfly*)
- targ_defvec=bfd_elf32_i386_vec
- targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
+ targ_defvec=i386_elf32_vec
+ targ64_selvecs="x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec"
;;
i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | \
i[3-7]86-*-freebsd[12])
- targ_defvec=i386freebsd_vec
- targ_selvecs=i386bsd_vec
+ targ_defvec=i386_aout_fbsd_vec
+ targ_selvecs=i386_aout_bsd_vec
targ_underscore=yes
;;
i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
- targ_defvec=bfd_elf32_i386_freebsd_vec
- targ_selvecs="bfd_elf32_i386_vec i386pei_vec i386coff_vec"
- targ64_selvecs="bfd_elf64_x86_64_freebsd_vec bfd_elf64_x86_64_vec x86_64pei_vec bfd_elf64_l1om_vec bfd_elf64_l1om_freebsd_vec bfd_elf64_k1om_vec bfd_elf64_k1om_freebsd_vec"
+ targ_defvec=i386_elf32_fbsd_vec
+ targ_selvecs="i386_elf32_vec i386_pei_vec i386_coff_vec"
+ targ64_selvecs="x86_64_elf64_fbsd_vec x86_64_elf64_vec x86_64_pei_vec l1om_elf64_vec l1om_elf64_fbsd_vec k1om_elf64_vec k1om_elf64_fbsd_vec"
# FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
case "${targ}" in
i[3-7]86-*-freebsd3* | i[3-7]86-*-freebsd4 | i[3-7]86-*-freebsd4.0*)
@@ -592,569 +601,584 @@ case "${targ}" in
esac
;;
i[3-7]86-*-netbsdelf* | i[3-7]86-*-netbsd*-gnu* | i[3-7]86-*-knetbsd*-gnu)
- targ_defvec=bfd_elf32_i386_vec
- targ_selvecs=i386netbsd_vec
- targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
+ targ_defvec=i386_elf32_vec
+ targ_selvecs=i386_aout_nbsd_vec
+ targ64_selvecs="x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec"
;;
i[3-7]86-*-netbsdpe*)
- targ_defvec=i386pe_vec
- targ_selvecs="i386pe_vec i386pei_vec bfd_elf32_i386_vec"
+ targ_defvec=i386_pe_vec
+ targ_selvecs="i386_pe_vec i386_pei_vec i386_elf32_vec"
;;
i[3-7]86-*-netbsdaout* | i[3-7]86-*-netbsd* | \
i[3-7]86-*-openbsd[0-2].* | i[3-7]86-*-openbsd3.[0-3])
- targ_defvec=i386netbsd_vec
- targ_selvecs="bfd_elf32_i386_vec i386bsd_vec"
+ targ_defvec=i386_aout_nbsd_vec
+ targ_selvecs="i386_elf32_vec i386_aout_bsd_vec"
targ_underscore=yes
;;
i[3-7]86-*-openbsd*)
- targ_defvec=bfd_elf32_i386_vec
- targ_selvecs=i386netbsd_vec
+ targ_defvec=i386_elf32_vec
+ targ_selvecs=i386_aout_nbsd_vec
;;
i[3-7]86-*-netware*)
- targ_defvec=bfd_elf32_i386_vec
- targ_selvecs="nlm32_i386_vec i386coff_vec i386aout_vec"
+ targ_defvec=i386_elf32_vec
+ targ_selvecs="i386_nlm32_vec i386_coff_vec i386_aout_vec"
;;
i[3-7]86-*-linux*aout*)
- targ_defvec=i386linux_vec
- targ_selvecs=bfd_elf32_i386_vec
+ targ_defvec=i386_aout_linux_vec
+ targ_selvecs=i386_elf32_vec
targ_underscore=yes
;;
i[3-7]86-*-linux-*)
- targ_defvec=bfd_elf32_i386_vec
- targ_selvecs="i386linux_vec i386pei_vec"
- targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf32_x86_64_vec x86_64pei_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
+ targ_defvec=i386_elf32_vec
+ targ_selvecs="i386_aout_linux_vec i386_pei_vec"
+ targ64_selvecs="x86_64_elf64_vec x86_64_elf32_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec"
;;
i[3-7]86-*-nacl*)
- targ_defvec=bfd_elf32_i386_nacl_vec
- targ_selvecs="bfd_elf32_bigarm_nacl_vec bfd_elf32_littlearm_nacl_vec"
- targ64_selvecs="bfd_elf64_x86_64_nacl_vec bfd_elf32_x86_64_nacl_vec"
+ targ_defvec=i386_elf32_nacl_vec
+ targ_selvecs="arm_elf32_nacl_be_vec arm_elf32_nacl_le_vec"
+ targ64_selvecs="x86_64_elf64_nacl_vec x86_64_elf32_nacl_vec"
targ_archs="$targ_archs bfd_arm_arch"
;;
#ifdef BFD64
x86_64-*-darwin*)
- targ_defvec=mach_o_x86_64_vec
- targ_selvecs="mach_o_i386_vec mach_o_le_vec mach_o_be_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
+ targ_defvec=x86_64_mach_o_vec
+ targ_selvecs="i386_mach_o_vec mach_o_le_vec mach_o_be_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
targ_archs="$targ_archs bfd_powerpc_arch bfd_rs6000_arch"
want64=true
;;
x86_64-*-dicos*)
- targ_defvec=bfd_elf64_x86_64_vec
- targ_selvecs="bfd_elf32_i386_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
+ targ_defvec=x86_64_elf64_vec
+ targ_selvecs="i386_elf32_vec l1om_elf64_vec k1om_elf64_vec"
want64=true
;;
x86_64-*-elf*)
- targ_defvec=bfd_elf64_x86_64_vec
- targ_selvecs="bfd_elf32_i386_vec bfd_elf32_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
+ targ_defvec=x86_64_elf64_vec
+ targ_selvecs="i386_elf32_vec x86_64_elf32_vec l1om_elf64_vec k1om_elf64_vec"
want64=true
;;
x86_64-*-dragonfly*)
- targ_defvec=bfd_elf64_x86_64_vec
- targ_selvecs="bfd_elf32_i386_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
+ targ_defvec=x86_64_elf64_vec
+ targ_selvecs="i386_elf32_vec l1om_elf64_vec k1om_elf64_vec"
want64=true
;;
x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
- targ_defvec=bfd_elf64_x86_64_freebsd_vec
- targ_selvecs="bfd_elf32_i386_freebsd_vec i386coff_vec i386pei_vec x86_64pei_vec bfd_elf32_i386_vec bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_l1om_freebsd_vec bfd_elf64_k1om_vec bfd_elf64_k1om_freebsd_vec"
+ targ_defvec=x86_64_elf64_fbsd_vec
+ targ_selvecs="i386_elf32_fbsd_vec i386_coff_vec i386_pei_vec x86_64_pei_vec i386_elf32_vec x86_64_elf64_vec l1om_elf64_vec l1om_elf64_fbsd_vec k1om_elf64_vec k1om_elf64_fbsd_vec"
want64=true
;;
x86_64-*-netbsd* | x86_64-*-openbsd*)
- targ_defvec=bfd_elf64_x86_64_vec
- targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec i386pei_vec x86_64pei_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
+ targ_defvec=x86_64_elf64_vec
+ targ_selvecs="i386_elf32_vec i386_aout_nbsd_vec i386_coff_vec i386_pei_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec"
want64=true
;;
x86_64-*-linux-*)
- targ_defvec=bfd_elf64_x86_64_vec
- targ_selvecs="bfd_elf32_i386_vec bfd_elf32_x86_64_vec i386linux_vec i386pei_vec x86_64pei_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
+ targ_defvec=x86_64_elf64_vec
+ targ_selvecs="i386_elf32_vec x86_64_elf32_vec i386_aout_linux_vec i386_pei_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec"
want64=true
;;
x86_64-*-nacl*)
- targ_defvec=bfd_elf32_x86_64_nacl_vec
- targ_selvecs="bfd_elf32_i386_nacl_vec bfd_elf64_x86_64_nacl_vec bfd_elf32_bigarm_nacl_vec bfd_elf32_littlearm_nacl_vec"
+ targ_defvec=x86_64_elf32_nacl_vec
+ targ_selvecs="i386_elf32_nacl_vec x86_64_elf64_nacl_vec arm_elf32_nacl_be_vec arm_elf32_nacl_le_vec"
targ_archs="$targ_archs bfd_arm_arch"
want64=true
;;
x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin)
- targ_defvec=x86_64pe_vec
- targ_selvecs="x86_64pe_vec x86_64pei_vec bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec i386pe_vec i386pei_vec bfd_elf32_i386_vec"
+ targ_defvec=x86_64_pe_vec
+ targ_selvecs="x86_64_pe_vec x86_64_pei_vec x86_64_pe_be_vec x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec i386_pe_vec i386_pei_vec i386_elf32_vec"
want64=true
targ_underscore=no
;;
x86_64-*-rdos*)
- targ_defvec=bfd_elf64_x86_64_vec
+ targ_defvec=x86_64_elf64_vec
want64=true
;;
#endif
i[3-7]86-*-lynxos*)
- targ_defvec=bfd_elf32_i386_vec
- targ_selvecs="i386lynx_coff_vec i386lynx_aout_vec"
+ targ_defvec=i386_elf32_vec
+ targ_selvecs="i386_coff_lynx_vec i386_aout_lynx_vec"
;;
i[3-7]86-*-gnu*)
- targ_defvec=bfd_elf32_i386_vec
+ targ_defvec=i386_elf32_vec
;;
i[3-7]86-*-mach* | i[3-7]86-*-osf1mk*)
- targ_defvec=i386mach3_vec
+ targ_defvec=i386_aout_mach3_vec
targ_cflags=-DSTAT_FOR_EXEC
targ_underscore=yes
;;
i[3-7]86-*-os9k)
- targ_defvec=i386os9k_vec
+ targ_defvec=i386_aout_os9k_vec
;;
i[3-7]86-*-msdos*)
- targ_defvec=i386aout_vec
- targ_selvecs=i386msdos_vec
+ targ_defvec=i386_aout_vec
+ targ_selvecs=i386_msdos_vec
;;
i[3-7]86-*-moss*)
- targ_defvec=bfd_elf32_i386_vec
- targ_selvecs="i386msdos_vec i386aout_vec"
+ targ_defvec=i386_elf32_vec
+ targ_selvecs="i386_msdos_vec i386_aout_vec"
;;
i[3-7]86-*-beospe*)
- targ_defvec=i386pe_vec
- targ_selvecs="i386pe_vec i386pei_vec"
+ targ_defvec=i386_pe_vec
+ targ_selvecs="i386_pe_vec i386_pei_vec"
;;
i[3-7]86-*-beoself* | i[3-7]86-*-beos*)
- targ_defvec=bfd_elf32_i386_vec
- targ_selvecs="i386pe_vec i386pei_vec"
+ targ_defvec=i386_elf32_vec
+ targ_selvecs="i386_pe_vec i386_pei_vec"
;;
i[3-7]86-*-interix*)
- targ_defvec=i386pei_vec
- targ_selvecs="i386pe_vec"
+ targ_defvec=i386_pei_vec
+ targ_selvecs="i386_pe_vec"
# FIXME: This should eventually be checked at runtime.
targ_cflags=-DSTRICT_PE_FORMAT
;;
i[3-7]86-*-rdos*)
- targ_defvec=bfd_elf32_i386_vec
- targ_selvecs=i386coff_vec
+ targ_defvec=i386_elf32_vec
+ targ_selvecs=i386_coff_vec
;;
i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe)
- targ_defvec=i386pe_vec
- targ_selvecs="i386pe_vec i386pei_vec bfd_elf32_i386_vec"
+ targ_defvec=i386_pe_vec
+ targ_selvecs="i386_pe_vec i386_pei_vec i386_elf32_vec"
targ_underscore=yes
;;
i[3-7]86-none-*)
- targ_defvec=i386coff_vec
+ targ_defvec=i386_coff_vec
;;
i[3-7]86-*-aout* | i[3-7]86*-*-vsta*)
- targ_defvec=i386aout_vec
+ targ_defvec=i386_aout_vec
;;
i[3-7]86-*-vxworks*)
- targ_defvec=bfd_elf32_i386_vxworks_vec
+ targ_defvec=i386_elf32_vxworks_vec
targ_underscore=yes
;;
i[3-7]86-*-chaos)
- targ_defvec=bfd_elf32_i386_vec
+ targ_defvec=i386_elf32_vec
targ_selfvecs=i386chaos_vec
;;
i860-*-mach3* | i860-*-osf1* | i860-*-coff*)
- targ_defvec=i860coff_vec
+ targ_defvec=i860_coff_vec
;;
i860-stardent-sysv4* | i860-stardent-elf*)
- targ_defvec=bfd_elf32_i860_little_vec
- targ_selvecs="bfd_elf32_i860_vec bfd_elf32_i860_little_vec"
+ targ_defvec=i860_elf32_le_vec
+ targ_selvecs="i860_elf32_vec i860_elf32_le_vec"
;;
i860-*-sysv4* | i860-*-elf*)
- targ_defvec=bfd_elf32_i860_vec
+ targ_defvec=i860_elf32_vec
;;
i960-*-vxworks4* | i960-*-vxworks5.0)
- targ_defvec=b_out_vec_little_host
- targ_selvecs="b_out_vec_big_host icoff_little_vec icoff_big_vec ieee_vec"
+ targ_defvec=bout_le_vec
+ targ_selvecs="bout_be_vec icoff_le_vec icoff_be_vec ieee_vec"
targ_underscore=yes
;;
i960-*-vxworks5.* | i960-*-coff* | i960-*-sysv*)
- targ_defvec=icoff_little_vec
- targ_selvecs="icoff_big_vec b_out_vec_little_host b_out_vec_big_host ieee_vec"
+ targ_defvec=icoff_le_vec
+ targ_selvecs="icoff_be_vec bout_le_vec bout_be_vec ieee_vec"
targ_underscore=yes
;;
i960-*-vxworks* | i960-*-aout* | i960-*-bout* | i960-*-nindy*)
- targ_defvec=b_out_vec_little_host
- targ_selvecs="b_out_vec_big_host icoff_little_vec icoff_big_vec ieee_vec"
+ targ_defvec=bout_le_vec
+ targ_selvecs="bout_be_vec icoff_le_vec icoff_be_vec ieee_vec"
targ_underscore=yes
;;
i960-*-elf*)
- targ_defvec=bfd_elf32_i960_vec
- targ_selvecs="icoff_little_vec icoff_big_vec"
+ targ_defvec=i960_elf32_vec
+ targ_selvecs="icoff_le_vec icoff_be_vec"
;;
ip2k-*-elf)
- targ_defvec=bfd_elf32_ip2k_vec
+ targ_defvec=ip2k_elf32_vec
;;
iq2000-*-elf)
- targ_defvec=bfd_elf32_iq2000_vec
+ targ_defvec=iq2000_elf32_vec
;;
lm32-*-elf | lm32-*-rtems*)
- targ_defvec=bfd_elf32_lm32_vec
- targ_selvecs=bfd_elf32_lm32fdpic_vec
+ targ_defvec=lm32_elf32_vec
+ targ_selvecs=lm32_elf32_fdpic_vec
;;
lm32-*-*linux*)
- targ_defvec=bfd_elf32_lm32fdpic_vec
- targ_selvecs=bfd_elf32_lm32_vec
+ targ_defvec=lm32_elf32_fdpic_vec
+ targ_selvecs=lm32_elf32_vec
;;
m32c-*-elf | m32c-*-rtems*)
- targ_defvec=bfd_elf32_m32c_vec
+ targ_defvec=m32c_elf32_vec
;;
m32r*le-*-linux*)
- targ_defvec=bfd_elf32_m32rlelin_vec
- targ_selvecs="bfd_elf32_m32rlin_vec bfd_elf32_m32rlelin_vec"
+ targ_defvec=m32r_elf32_linux_le_vec
+ targ_selvecs="m32r_elf32_linux_vec m32r_elf32_linux_le_vec"
;;
m32r*-*-linux*)
- targ_defvec=bfd_elf32_m32rlin_vec
- targ_selvecs="bfd_elf32_m32rlin_vec bfd_elf32_m32rlelin_vec"
+ targ_defvec=m32r_elf32_linux_vec
+ targ_selvecs="m32r_elf32_linux_vec m32r_elf32_linux_le_vec"
;;
m32r*le-*-*)
- targ_defvec=bfd_elf32_m32rle_vec
- targ_selvecs="bfd_elf32_m32r_vec bfd_elf32_m32rle_vec"
+ targ_defvec=m32r_elf32_le_vec
+ targ_selvecs="m32r_elf32_vec m32r_elf32_le_vec"
;;
m32r-*-*)
- targ_defvec=bfd_elf32_m32r_vec
+ targ_defvec=m32r_elf32_vec
;;
m68hc11-*-* | m6811-*-*)
- targ_defvec=bfd_elf32_m68hc11_vec
- targ_selvecs="bfd_elf32_m68hc11_vec bfd_elf32_m68hc12_vec"
+ targ_defvec=m68hc11_elf32_vec
+ targ_selvecs="m68hc11_elf32_vec m68hc12_elf32_vec"
;;
m68hc12-*-* | m6812-*-*)
- targ_defvec=bfd_elf32_m68hc12_vec
- targ_selvecs="bfd_elf32_m68hc11_vec bfd_elf32_m68hc12_vec"
+ targ_defvec=m68hc12_elf32_vec
+ targ_selvecs="m68hc11_elf32_vec m68hc12_elf32_vec"
;;
m68*-motorola-sysv*)
- targ_defvec=m68ksysvcoff_vec
+ targ_defvec=m68k_coff_sysv_vec
;;
m68*-hp-bsd*)
- targ_defvec=hp300bsd_vec
+ targ_defvec=m68k_aout_hp300bsd_vec
targ_underscore=yes
;;
m68*-*-aout*)
- targ_defvec=aout0_big_vec
- # We include cisco_core_big_vec here, rather than making a separate cisco
+ targ_defvec=aout0_be_vec
+ # We include core_cisco_be_vec here, rather than making a separate cisco
# configuration, so that cisco-core.c gets routinely tested at
# least for compilation.
- targ_selvecs="cisco_core_big_vec ieee_vec"
+ targ_selvecs="core_cisco_be_vec ieee_vec"
targ_underscore=yes
;;
m68*-*-elf* | m68*-*-sysv4* | m68*-*-uclinux*)
- targ_defvec=bfd_elf32_m68k_vec
- targ_selvecs="m68kcoff_vec ieee_vec"
+ targ_defvec=m68k_elf32_vec
+ targ_selvecs="m68k_coff_vec ieee_vec"
;;
m68*-*-rtems*)
- targ_defvec=bfd_elf32_m68k_vec
- targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec"
+ targ_defvec=m68k_elf32_vec
+ targ_selvecs="m68k_coff_vec m68k_versados_vec ieee_vec aout0_be_vec"
;;
m68*-*-coff* | m68*-*-sysv*)
- targ_defvec=m68kcoff_vec
- targ_selvecs="m68kcoff_vec versados_vec ieee_vec"
+ targ_defvec=m68k_coff_vec
+ targ_selvecs="m68k_coff_vec m68k_versados_vec ieee_vec"
;;
m68*-*-hpux*)
- targ_defvec=hp300hpux_vec
+ targ_defvec=m68k_aout_hp300hpux_vec
targ_underscore=yes
;;
m68*-*-linux*aout*)
- targ_defvec=m68klinux_vec
- targ_selvecs=bfd_elf32_m68k_vec
+ targ_defvec=m68k_aout_linux_vec
+ targ_selvecs=m68k_elf32_vec
targ_underscore=yes
;;
m68*-*-linux-*)
- targ_defvec=bfd_elf32_m68k_vec
- targ_selvecs=m68klinux_vec
+ targ_defvec=m68k_elf32_vec
+ targ_selvecs=m68k_aout_linux_vec
;;
m68*-*-gnu*)
- targ_defvec=bfd_elf32_m68k_vec
+ targ_defvec=m68k_elf32_vec
# targ_selvecs=m68kmach3_vec
# targ_cflags=-DSTAT_FOR_EXEC
;;
m68*-hp*-netbsd*)
- targ_defvec=m68k4knetbsd_vec
- targ_selvecs="m68knetbsd_vec hp300bsd_vec sunos_big_vec"
+ targ_defvec=m68k_aout_4knbsd_vec
+ targ_selvecs="m68k_aout_nbsd_vec m68k_aout_hp300bsd_vec sparc_aout_sunos_be_vec"
targ_underscore=yes
;;
m68*-*-netbsdelf*)
- targ_defvec=bfd_elf32_m68k_vec
- targ_selvecs="m68knetbsd_vec m68k4knetbsd_vec hp300bsd_vec sunos_big_vec"
+ targ_defvec=m68k_elf32_vec
+ targ_selvecs="m68k_aout_nbsd_vec m68k_aout_4knbsd_vec m68k_aout_hp300bsd_vec sparc_aout_sunos_be_vec"
;;
m68*-*-netbsdaout* | m68*-*-netbsd*)
- targ_defvec=m68knetbsd_vec
- targ_selvecs="m68k4knetbsd_vec bfd_elf32_m68k_vec hp300bsd_vec sunos_big_vec"
+ targ_defvec=m68k_aout_nbsd_vec
+ targ_selvecs="m68k_aout_4knbsd_vec m68k_elf32_vec m68k_aout_hp300bsd_vec sparc_aout_sunos_be_vec"
targ_underscore=yes
;;
m68*-*-openbsd*)
- targ_defvec=m68knetbsd_vec
- targ_selvecs="m68k4knetbsd_vec hp300bsd_vec sunos_big_vec"
+ targ_defvec=m68k_aout_nbsd_vec
+ targ_selvecs="m68k_aout_4knbsd_vec m68k_aout_hp300bsd_vec sparc_aout_sunos_be_vec"
targ_underscore=yes
;;
m68*-*-sunos* | m68*-*-os68k* | m68*-*-vxworks* | m68*-netx-* | \
m68*-*-bsd* | m68*-*-vsta*)
- targ_defvec=sunos_big_vec
+ targ_defvec=sparc_aout_sunos_be_vec
targ_underscore=yes
;;
m68*-ericsson-*)
- targ_defvec=sunos_big_vec
- targ_selvecs="m68kcoff_vec versados_vec tekhex_vec"
+ targ_defvec=sparc_aout_sunos_be_vec
+ targ_selvecs="m68k_coff_vec m68k_versados_vec tekhex_vec"
targ_underscore=yes
;;
m68*-cbm-*)
- targ_defvec=bfd_elf32_m68k_vec
- targ_selvecs=m68kcoff_vec
+ targ_defvec=m68k_elf32_vec
+ targ_selvecs=m68k_coff_vec
;;
m68*-*-psos*)
- targ_defvec=bfd_elf32_m68k_vec
+ targ_defvec=m68k_elf32_vec
targ_selvecs=ieee_vec
targ_underscore=yes
;;
m88*-harris-cxux* | m88*-*-dgux* | m88*-*-sysv4*)
- targ_defvec=bfd_elf32_m88k_vec
- targ_selvecs=m88kbcs_vec
+ targ_defvec=m88k_elf32_vec
+ targ_selvecs=m88k_coff_bcs_vec
;;
m88*-*-mach3*)
- targ_defvec=m88kmach3_vec
+ targ_defvec=m88k_aout_mach3_vec
targ_cflags=-DSTAT_FOR_EXEC
;;
m88*-*-openbsd*)
- targ_defvec=m88kopenbsd_vec
+ targ_defvec=m88k_aout_obsd_vec
targ_underscore=yes
;;
m88*-*-*)
- targ_defvec=m88kbcs_vec
+ targ_defvec=m88k_coff_bcs_vec
targ_underscore=yes
;;
mcore-*-elf)
- targ_defvec=bfd_elf32_mcore_big_vec
- targ_selvecs="bfd_elf32_mcore_big_vec bfd_elf32_mcore_little_vec"
+ targ_defvec=mcore_elf32_be_vec
+ targ_selvecs="mcore_elf32_be_vec mcore_elf32_le_vec"
;;
mcore-*-pe)
- targ_defvec=mcore_pe_big_vec
- targ_selvecs="mcore_pe_big_vec mcore_pe_little_vec mcore_pei_big_vec mcore_pei_little_vec"
+ targ_defvec=mcore_pe_be_vec
+ targ_selvecs="mcore_pe_be_vec mcore_pe_le_vec mcore_pei_be_vec mcore_pei_le_vec"
;;
mep-*-elf)
- targ_defvec=bfd_elf32_mep_vec
- targ_selvecs=bfd_elf32_mep_little_vec
+ targ_defvec=mep_elf32_vec
+ targ_selvecs=mep_elf32_le_vec
;;
metag-*-*)
- targ_defvec=bfd_elf32_metag_vec
+ targ_defvec=metag_elf32_vec
targ_underscore=yes
;;
microblazeel*-*)
- targ_defvec=bfd_elf32_microblazeel_vec
- targ_selvecs=bfd_elf32_microblaze_vec
+ targ_defvec=microblaze_elf32_le_vec
+ targ_selvecs=microblaze_elf32_vec
;;
microblaze*-*)
- targ_defvec=bfd_elf32_microblaze_vec
- targ_selvecs=bfd_elf32_microblazeel_vec
+ targ_defvec=microblaze_elf32_vec
+ targ_selvecs=microblaze_elf32_le_vec
;;
mips*-big-*)
- targ_defvec=ecoff_big_vec
- targ_selvecs=ecoff_little_vec
+ targ_defvec=mips_ecoff_be_vec
+ targ_selvecs=mips_ecoff_le_vec
;;
#ifdef BFD64
mips*el-*-netbsd*)
- targ_defvec=bfd_elf32_tradlittlemips_vec
- targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_little_vec ecoff_big_vec"
+ targ_defvec=mips_elf32_trad_le_vec
+ targ_selvecs="mips_elf32_trad_be_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
;;
mips*-*-netbsd*)
- targ_defvec=bfd_elf32_tradbigmips_vec
- targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec"
+ targ_defvec=mips_elf32_trad_be_vec
+ targ_selvecs="mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
;;
#endif
mips*-dec-* | mips*el-*-ecoff*)
- targ_defvec=ecoff_little_vec
- targ_selvecs=ecoff_big_vec
+ targ_defvec=mips_ecoff_le_vec
+ targ_selvecs=mips_ecoff_be_vec
;;
mips*-*-ecoff*)
- targ_defvec=ecoff_big_vec
- targ_selvecs=ecoff_little_vec
+ targ_defvec=mips_ecoff_be_vec
+ targ_selvecs=mips_ecoff_le_vec
;;
#ifdef BFD64
mips*-*-irix6*)
- targ_defvec=bfd_elf32_nbigmips_vec
- targ_selvecs="bfd_elf32_nlittlemips_vec bfd_elf32_bigmips_vec bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ targ_defvec=mips_elf32_n_be_vec
+ targ_selvecs="mips_elf32_n_le_vec mips_elf32_be_vec mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
;;
mips64*-ps2-elf*)
- targ_defvec=bfd_elf32_nlittlemips_vec
- targ_selvecs="bfd_elf32_nlittlemips_vec bfd_elf32_nbigmips_vec bfd_elf32_bigmips_vec bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ targ_defvec=mips_elf32_n_le_vec
+ targ_selvecs="mips_elf32_n_le_vec mips_elf32_n_be_vec mips_elf32_be_vec mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
;;
mips*-ps2-elf*)
- targ_defvec=bfd_elf32_littlemips_vec
- targ_selvecs="bfd_elf32_bigmips_vec bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ targ_defvec=mips_elf32_le_vec
+ targ_selvecs="mips_elf32_be_vec mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
;;
mips*-*-irix5*)
- targ_defvec=bfd_elf32_bigmips_vec
- targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
+ targ_defvec=mips_elf32_be_vec
+ targ_selvecs="mips_elf32_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
;;
#endif
mips*-sgi-* | mips*-*-bsd*)
- targ_defvec=ecoff_big_vec
- targ_selvecs=ecoff_little_vec
+ targ_defvec=mips_ecoff_be_vec
+ targ_selvecs=mips_ecoff_le_vec
;;
mips*-*-lnews*)
- targ_defvec=ecoff_biglittle_vec
- targ_selvecs="ecoff_little_vec ecoff_big_vec"
+ targ_defvec=mips_ecoff_bele_vec
+ targ_selvecs="mips_ecoff_le_vec mips_ecoff_be_vec"
;;
#ifdef BFD64
mips*-*-sysv4*)
- targ_defvec=bfd_elf32_tradbigmips_vec
- targ_selvecs="bfd_elf32_tradlittlemips_vec ecoff_big_vec ecoff_little_vec"
+ targ_defvec=mips_elf32_trad_be_vec
+ targ_selvecs="mips_elf32_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
;;
#endif
mips*-*-sysv* | mips*-*-riscos*)
- targ_defvec=ecoff_big_vec
- targ_selvecs=ecoff_little_vec
+ targ_defvec=mips_ecoff_be_vec
+ targ_selvecs=mips_ecoff_le_vec
;;
#ifdef BFD64
mips*el-*-vxworks*)
- targ_defvec=bfd_elf32_littlemips_vxworks_vec
- targ_selvecs="bfd_elf32_littlemips_vec bfd_elf32_bigmips_vxworks_vec bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ targ_defvec=mips_elf32_vxworks_le_vec
+ targ_selvecs="mips_elf32_le_vec mips_elf32_vxworks_be_vec mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec"
;;
mips*-*-vxworks*)
- targ_defvec=bfd_elf32_bigmips_vxworks_vec
- targ_selvecs="bfd_elf32_bigmips_vec bfd_elf32_littlemips_vxworks_vec bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ targ_defvec=mips_elf32_vxworks_be_vec
+ targ_selvecs="mips_elf32_be_vec mips_elf32_vxworks_le_vec mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec"
;;
mips*el-sde-elf*)
- targ_defvec=bfd_elf32_tradlittlemips_vec
- targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
+ targ_defvec=mips_elf32_trad_le_vec
+ targ_selvecs="mips_elf32_trad_be_vec mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
;;
- mips*-sde-elf* | mips*-mti-elf*)
- targ_defvec=bfd_elf32_tradbigmips_vec
- targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
+ mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
+ targ_defvec=mips_elf32_trad_be_vec
+ targ_selvecs="mips_elf32_trad_le_vec mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
;;
mips*el-*-elf* | mips*el-*-vxworks* | mips*-*-chorus*)
- targ_defvec=bfd_elf32_littlemips_vec
- targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ targ_defvec=mips_elf32_le_vec
+ targ_selvecs="mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec"
;;
mips*-*-elf* | mips*-*-rtems* | mips*-*-vxworks | mips*-*-windiss)
- targ_defvec=bfd_elf32_bigmips_vec
- targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ targ_defvec=mips_elf32_be_vec
+ targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
;;
mips*-*-none)
- targ_defvec=bfd_elf32_bigmips_vec
- targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ targ_defvec=mips_elf32_be_vec
+ targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
;;
mips64*-*-openbsd*)
- targ_defvec=bfd_elf64_tradbigmips_vec
- targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
+ targ_defvec=mips_elf64_trad_be_vec
+ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec"
;;
mips*el-*-openbsd*)
- targ_defvec=bfd_elf32_littlemips_vec
- targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec"
+ targ_defvec=mips_elf32_le_vec
+ targ_selvecs="mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
;;
mips*-*-openbsd*)
- targ_defvec=bfd_elf32_bigmips_vec
- targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec"
+ targ_defvec=mips_elf32_be_vec
+ targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
;;
mips64*el-*-linux*)
- targ_defvec=bfd_elf32_ntradlittlemips_vec
- targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec"
+ targ_defvec=mips_elf32_ntrad_le_vec
+ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
;;
mips64*-*-linux*)
- targ_defvec=bfd_elf32_ntradbigmips_vec
- targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
+ targ_defvec=mips_elf32_ntrad_be_vec
+ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
;;
mips*el-*-linux*)
- targ_defvec=bfd_elf32_tradlittlemips_vec
- targ_selvecs="bfd_elf32_tradbigmips_vec ecoff_little_vec ecoff_big_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec"
+ targ_defvec=mips_elf32_trad_le_vec
+ targ_selvecs="mips_elf32_trad_be_vec mips_ecoff_le_vec mips_ecoff_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_le_vec mips_elf32_ntrad_be_vec mips_elf64_trad_be_vec"
;;
mips*-*-linux*)
- targ_defvec=bfd_elf32_tradbigmips_vec
- targ_selvecs="bfd_elf32_tradlittlemips_vec ecoff_big_vec ecoff_little_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec"
+ targ_defvec=mips_elf32_trad_be_vec
+ targ_selvecs="mips_elf32_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec mips_elf32_ntrad_be_vec mips_elf64_trad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_le_vec"
;;
mips64*el-*-freebsd* | mips64*el-*-kfreebsd*-gnu)
# FreeBSD vectors
- targ_defvec=bfd_elf32_ntradlittlemips_freebsd_vec
- targ_selvecs="bfd_elf32_ntradbigmips_freebsd_vec bfd_elf32_tradlittlemips_freebsd_vec bfd_elf32_tradbigmips_freebsd_vec bfd_elf64_tradlittlemips_freebsd_vec bfd_elf64_tradbigmips_freebsd_vec"
+ targ_defvec=mips_elf32_ntradfbsd_le_vec
+ targ_selvecs="mips_elf32_ntradfbsd_be_vec mips_elf32_tradfbsd_le_vec mips_elf32_tradfbsd_be_vec mips_elf64_tradfbsd_le_vec mips_elf64_tradfbsd_be_vec"
# Generic vectors
- targ_selvecs="${targ_selvecs} bfd_elf32_ntradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec"
+ targ_selvecs="${targ_selvecs} mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
;;
mips64*-*-freebsd* | mips64*-*-kfreebsd*-gnu)
# FreeBSD vectors
- targ_defvec=bfd_elf32_ntradbigmips_freebsd_vec
- targ_selvecs="bfd_elf32_ntradlittlemips_freebsd_vec bfd_elf32_tradbigmips_freebsd_vec bfd_elf32_tradlittlemips_freebsd_vec bfd_elf64_tradbigmips_freebsd_vec bfd_elf64_tradlittlemips_freebsd_vec"
+ targ_defvec=mips_elf32_ntradfbsd_be_vec
+ targ_selvecs="mips_elf32_ntradfbsd_le_vec mips_elf32_tradfbsd_be_vec mips_elf32_tradfbsd_le_vec mips_elf64_tradfbsd_be_vec mips_elf64_tradfbsd_le_vec"
# Generic vectors
- targ_selvecs="${targ_selvecs} bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
+ targ_selvecs="${targ_selvecs} mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
;;
mips*el-*-freebsd* | mips*el-*-kfreebsd*-gnu)
# FreeBSD vectors
- targ_defvec=bfd_elf32_tradlittlemips_freebsd_vec
- targ_selvecs="bfd_elf32_tradbigmips_freebsd_vec bfd_elf32_ntradlittlemips_freebsd_vec bfd_elf64_tradlittlemips_freebsd_vec bfd_elf32_ntradbigmips_freebsd_vec bfd_elf64_tradbigmips_freebsd_vec"
+ targ_defvec=mips_elf32_tradfbsd_le_vec
+ targ_selvecs="mips_elf32_tradfbsd_be_vec mips_elf32_ntradfbsd_le_vec mips_elf64_tradfbsd_le_vec mips_elf32_ntradfbsd_be_vec mips_elf64_tradfbsd_be_vec"
# Generic vectors
- targ_selvecs="${targ_selvecs} bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec"
+ targ_selvecs="${targ_selvecs} mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_le_vec mips_elf32_ntrad_be_vec mips_elf64_trad_be_vec"
;;
mips*-*-freebsd* | mips*-*-kfreebsd*-gnu)
# FreeBSD vectors
- targ_defvec=bfd_elf32_tradbigmips_freebsd_vec
- targ_selvecs="bfd_elf32_tradlittlemips_freebsd_vec bfd_elf32_ntradbigmips_freebsd_vec bfd_elf64_tradbigmips_freebsd_vec bfd_elf32_ntradlittlemips_freebsd_vec bfd_elf64_tradlittlemips_freebsd_vec"
+ targ_defvec=mips_elf32_tradfbsd_be_vec
+ targ_selvecs="mips_elf32_tradfbsd_le_vec mips_elf32_ntradfbsd_be_vec mips_elf64_tradfbsd_be_vec mips_elf32_ntradfbsd_le_vec mips_elf64_tradfbsd_le_vec"
# Generic vectors
- targ_selvecs="${targ_selvecs} bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec"
+ targ_selvecs="${targ_selvecs} mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf32_ntrad_be_vec mips_elf64_trad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_le_vec"
;;
mmix-*-*)
- targ_defvec=bfd_elf64_mmix_vec
- targ_selvecs=bfd_mmo_vec
+ targ_defvec=mmix_elf64_vec
+ targ_selvecs=mmix_mmo_vec
want64=true
;;
#endif
mn10200-*-*)
- targ_defvec=bfd_elf32_mn10200_vec
+ targ_defvec=mn10200_elf32_vec
;;
mn10300-*-*)
- targ_defvec=bfd_elf32_mn10300_vec
+ targ_defvec=mn10300_elf32_vec
targ_underscore=yes
;;
mt-*-elf)
- targ_defvec=bfd_elf32_mt_vec
+ targ_defvec=mt_elf32_vec
;;
msp430-*-*)
- targ_defvec=bfd_elf32_msp430_vec
- targ_selvecs=bfd_elf32_msp430_ti_vec
+ targ_defvec=msp430_elf32_vec
+ targ_selvecs=msp430_elf32_ti_vec
+ ;;
+
+ nds32*le-*-linux*)
+ targ_defvec=nds32_elf32_linux_le_vec
+ targ_selvecs=nds32_elf32_linux_be_vec
+ ;;
+
+ nds32*be-*-linux*)
+ targ_defvec=nds32_elf32_linux_be_vec
+ targ_selvecs=nds32_elf32_linux_le_vec
+ ;;
+
+ nds32*le-*-*)
+ targ_defvec=nds32_elf32_le_vec
+ targ_selvecs=nds32_elf32_be_vec
+ ;;
+
+ nds32*be-*-*)
+ targ_defvec=nds32_elf32_be_vec
+ targ_selvecs=nds32_elf32_le_vec
;;
ns32k-pc532-mach* | ns32k-pc532-ux*)
- targ_defvec=pc532machaout_vec
+ targ_defvec=ns32k_aout_pc532mach_vec
targ_underscore=yes
;;
ns32k-*-netbsd* | ns32k-*-lites* | ns32k-*-openbsd*)
- targ_defvec=pc532netbsd_vec
+ targ_defvec=ns32k_aout_pc532nbsd_vec
targ_underscore=yes
;;
nios2eb-*-*)
- targ_defvec=bfd_elf32_bignios2_vec
- targ_selvecs=bfd_elf32_littlenios2_vec
+ targ_defvec=nios2_elf32_be_vec
+ targ_selvecs=nios2_elf32_le_vec
;;
nios2el-*-*)
- targ_defvec=bfd_elf32_littlenios2_vec
- targ_selvecs=bfd_elf32_bignios2_vec
+ targ_defvec=nios2_elf32_le_vec
+ targ_selvecs=nios2_elf32_be_vec
;;
nios2-*-*)
- targ_defvec=bfd_elf32_littlenios2_vec
- targ_selvecs=bfd_elf32_bignios2_vec
+ targ_defvec=nios2_elf32_le_vec
+ targ_selvecs=nios2_elf32_be_vec
;;
- openrisc-*-elf)
- targ_defvec=bfd_elf32_openrisc_vec
- ;;
-
- or32-*-coff)
- targ_defvec=or32coff_big_vec
- targ_underscore=yes
+ or1k-*-elf | or1k-*-linux* | or1k-*-rtems*)
+ targ_defvec=or1k_elf32_vec
;;
- or32-*-elf)
- targ_defvec=bfd_elf32_or32_big_vec
+ or1knd-*-elf | or1knd-*-linux* | or1knd-*-rtems*)
+ targ_defvec=or1k_elf32_vec
;;
pdp11-*-*)
@@ -1163,45 +1187,45 @@ case "${targ}" in
;;
pj-*-*)
- targ_defvec=bfd_elf32_pj_vec
- targ_selvecs="bfd_elf32_pj_vec bfd_elf32_pjl_vec"
+ targ_defvec=pj_elf32_vec
+ targ_selvecs="pj_elf32_vec pj_elf32_le_vec"
;;
pjl-*-*)
- targ_defvec=bfd_elf32_pjl_vec
- targ_selvecs="bfd_elf32_pjl_vec bfd_elf32_pj_vec bfd_elf32_i386_vec"
+ targ_defvec=pj_elf32_le_vec
+ targ_selvecs="pj_elf32_le_vec pj_elf32_vec i386_elf32_vec"
;;
powerpc-*-aix5.[01] | rs6000-*-aix5.[01])
- targ_defvec=rs6000coff_vec
- targ_selvecs="aix5coff64_vec"
+ targ_defvec=rs6000_xcoff_vec
+ targ_selvecs="rs6000_xcoff64_aix_vec"
want64=true
;;
#ifdef BFD64
powerpc64-*-aix5.[01] | rs6000-*-aix5.[01])
- targ_defvec=aix5coff64_vec
- targ_selvecs="rs6000coff_vec"
+ targ_defvec=rs6000_xcoff64_aix_vec
+ targ_selvecs="rs6000_xcoff_vec"
want64=true
;;
#endif
powerpc-*-aix[5-9]* | rs6000-*-aix[5-9]*)
targ_cflags=-DAIX_WEAK_SUPPORT
- targ_defvec=rs6000coff_vec
- targ_selvecs="aix5coff64_vec"
+ targ_defvec=rs6000_xcoff_vec
+ targ_selvecs="rs6000_xcoff64_aix_vec"
want64=true
;;
#ifdef BFD64
powerpc64-*-aix[5-9]* | rs6000-*-aix[5-9]*)
targ_cflags=-DAIX_WEAK_SUPPORT
- targ_defvec=aix5coff64_vec
- targ_selvecs="rs6000coff_vec"
+ targ_defvec=rs6000_xcoff64_aix_vec
+ targ_selvecs="rs6000_xcoff_vec"
want64=true
;;
#endif
powerpc-*-aix* | powerpc-*-beos* | rs6000-*-*)
- targ_defvec=rs6000coff_vec
- targ64_selvecs=rs6000coff64_vec
+ targ_defvec=rs6000_xcoff_vec
+ targ64_selvecs=rs6000_xcoff64_vec
case "${targ}" in
*-*-aix4.[3456789]* | *-*-aix[56789]*)
want64=true;;
@@ -1211,44 +1235,44 @@ case "${targ}" in
;;
#ifdef BFD64
powerpc64-*-aix*)
- targ_defvec=rs6000coff64_vec
- targ_selvecs=rs6000coff_vec
+ targ_defvec=rs6000_xcoff64_vec
+ targ_selvecs=rs6000_xcoff_vec
want64=true
;;
powerpc64-*-freebsd*)
- targ_defvec=bfd_elf64_powerpc_freebsd_vec
- targ_selvecs="bfd_elf64_powerpc_vec bfd_elf32_powerpc_vec bfd_elf32_powerpc_freebsd_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec aix5coff64_vec"
+ targ_defvec=powerpc_elf64_fbsd_vec
+ targ_selvecs="powerpc_elf64_vec powerpc_elf32_vec powerpc_elf32_fbsd_vec powerpc_elf32_le_vec rs6000_xcoff_vec rs6000_xcoff64_vec rs6000_xcoff64_aix_vec"
want64=true
;;
powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux* | \
powerpc64-*-*bsd*)
- targ_defvec=bfd_elf64_powerpc_vec
- targ_selvecs="bfd_elf64_powerpcle_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec aix5coff64_vec"
+ targ_defvec=powerpc_elf64_vec
+ targ_selvecs="powerpc_elf64_le_vec powerpc_elf32_vec powerpc_elf32_le_vec rs6000_xcoff_vec rs6000_xcoff64_vec rs6000_xcoff64_aix_vec"
want64=true
;;
powerpc64le-*-elf* | powerpcle-*-elf64* | powerpc64le-*-linux* | \
powerpc64le-*-*bsd*)
- targ_defvec=bfd_elf64_powerpcle_vec
- targ_selvecs="bfd_elf64_powerpc_vec bfd_elf32_powerpcle_vec bfd_elf32_powerpc_vec rs6000coff_vec rs6000coff64_vec aix5coff64_vec"
+ targ_defvec=powerpc_elf64_le_vec
+ targ_selvecs="powerpc_elf64_vec powerpc_elf32_le_vec powerpc_elf32_vec rs6000_xcoff_vec rs6000_xcoff64_vec rs6000_xcoff64_aix_vec"
want64=true
;;
#endif
powerpc-*-*freebsd*)
- targ_defvec=bfd_elf32_powerpc_freebsd_vec
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec ppcboot_vec"
- targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec bfd_elf64_powerpc_freebsd_vec"
+ targ_defvec=powerpc_elf32_fbsd_vec
+ targ_selvecs="rs6000_xcoff_vec powerpc_elf32_vec powerpc_elf32_le_vec powerpc_boot_vec"
+ targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec powerpc_elf64_fbsd_vec"
;;
powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
powerpc-*-solaris2* | powerpc-*-linux-* | powerpc-*-rtems* | \
powerpc-*-chorus*)
- targ_defvec=bfd_elf32_powerpc_vec
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
- targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+ targ_defvec=powerpc_elf32_vec
+ targ_selvecs="rs6000_xcoff_vec powerpc_elf32_le_vec powerpc_boot_vec"
+ targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec"
;;
powerpc-*-kaos*)
- targ_defvec=bfd_elf32_powerpc_vec
- targ_selvecs="bfd_elf32_powerpcle_vec ppcboot_vec"
- targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+ targ_defvec=powerpc_elf32_vec
+ targ_selvecs="powerpc_elf32_le_vec powerpc_boot_vec"
+ targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec"
;;
powerpc-*-darwin* | powerpc-*-macos10* | powerpc-*-rhapsody*)
targ_defvec=mach_o_be_vec
@@ -1256,415 +1280,415 @@ case "${targ}" in
targ_archs="$targ_archs bfd_i386_arch"
;;
powerpc-*-macos*)
- targ_defvec=pmac_xcoff_vec
+ targ_defvec=powerpc_xcoff_vec
;;
powerpc-*-lynxos*)
- targ_defvec=bfd_elf32_powerpc_vec
- targ_selvecs="rs6000coff_vec"
+ targ_defvec=powerpc_elf32_vec
+ targ_selvecs="rs6000_xcoff_vec"
targ_cflags=-DSMALL_ARCHIVE
;;
powerpc-*-netware*)
- targ_defvec=bfd_elf32_powerpc_vec
- targ_selvecs="nlm32_powerpc_vec rs6000coff_vec"
+ targ_defvec=powerpc_elf32_vec
+ targ_selvecs="powerpc_nlm32_vec rs6000_xcoff_vec"
;;
powerpc-*-nto*)
- targ_defvec=bfd_elf32_powerpc_vec
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+ targ_defvec=powerpc_elf32_vec
+ targ_selvecs="rs6000_xcoff_vec powerpc_elf32_le_vec powerpc_boot_vec"
;;
powerpc-*-vxworks* | powerpc-*-windiss*)
- targ_defvec=bfd_elf32_powerpc_vxworks_vec
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec ppcboot_vec"
- targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+ targ_defvec=powerpc_elf32_vxworks_vec
+ targ_selvecs="rs6000_xcoff_vec powerpc_elf32_vec powerpc_elf32_le_vec powerpc_boot_vec"
+ targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec"
;;
powerpcle-*-nto*)
- targ_defvec=bfd_elf32_powerpcle_vec
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ_defvec=powerpc_elf32_le_vec
+ targ_selvecs="rs6000_xcoff_vec powerpc_elf32_vec powerpc_boot_vec"
;;
powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
powerpcle-*-solaris2* | powerpcle-*-linux-* | powerpcle-*-vxworks*)
- targ_defvec=bfd_elf32_powerpcle_vec
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
- targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+ targ_defvec=powerpc_elf32_le_vec
+ targ_selvecs="rs6000_xcoff_vec powerpc_elf32_vec powerpc_boot_vec"
+ targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec"
;;
powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*)
- targ_defvec=bfd_powerpcle_pe_vec
- targ_selvecs="bfd_powerpcle_pei_vec bfd_powerpc_pei_vec bfd_powerpcle_pe_vec bfd_powerpc_pe_vec"
+ targ_defvec=powerpc_pe_le_vec
+ targ_selvecs="powerpc_pei_le_vec powerpc_pei_vec powerpc_pe_le_vec powerpc_pe_vec"
;;
rl78-*-elf)
- targ_defvec=bfd_elf32_rl78_vec
+ targ_defvec=rl78_elf32_vec
;;
rx-*-elf)
- targ_defvec=bfd_elf32_rx_le_vec
- targ_selvecs="bfd_elf32_rx_be_vec bfd_elf32_rx_le_vec bfd_elf32_rx_be_ns_vec"
+ targ_defvec=rx_elf32_le_vec
+ targ_selvecs="rx_elf32_be_vec rx_elf32_le_vec rx_elf32_be_ns_vec"
;;
s390-*-linux*)
- targ_defvec=bfd_elf32_s390_vec
- targ64_selvecs=bfd_elf64_s390_vec
+ targ_defvec=s390_elf32_vec
+ targ64_selvecs=s390_elf64_vec
want64=true
;;
#ifdef BFD64
s390x-*-linux*)
- targ_defvec=bfd_elf64_s390_vec
- targ_selvecs=bfd_elf32_s390_vec
+ targ_defvec=s390_elf64_vec
+ targ_selvecs=s390_elf32_vec
want64=true
;;
s390x-*-tpf*)
- targ_defvec=bfd_elf64_s390_vec
+ targ_defvec=s390_elf64_vec
want64=true
;;
score*-*-elf*)
- targ_defvec=bfd_elf32_bigscore_vec
- targ_selvecs=bfd_elf32_littlescore_vec
+ targ_defvec=score_elf32_be_vec
+ targ_selvecs=score_elf32_le_vec
;;
sh64l*-*-elf*)
- targ_defvec=bfd_elf32_sh64l_vec
- targ_selvecs="bfd_elf32_sh64_vec bfd_elf64_sh64l_vec bfd_elf64_sh64_vec bfd_elf32_shl_vec bfd_elf32_sh_vec"
+ targ_defvec=sh64_elf32_le_vec
+ targ_selvecs="sh64_elf32_vec sh64_elf64_le_vec sh64_elf64_vec sh_elf32_le_vec sh_elf32_vec"
targ_underscore=yes
want64=true
;;
sh64-*-elf*)
- targ_defvec=bfd_elf32_sh64_vec
- targ_selvecs="bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec bfd_elf32_sh_vec bfd_elf32_shl_vec"
+ targ_defvec=sh64_elf32_vec
+ targ_selvecs="sh64_elf32_le_vec sh64_elf64_vec sh64_elf64_le_vec sh_elf32_vec sh_elf32_le_vec"
targ_underscore=yes
want64=true
;;
sh64eb-*-linux*)
- targ_defvec=bfd_elf32_sh64blin_vec
- targ_selvecs="bfd_elf32_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf32_shblin_vec bfd_elf32_shlin_vec"
+ targ_defvec=sh64_elf32_linux_be_vec
+ targ_selvecs="sh64_elf32_linux_vec sh64_elf64_linux_be_vec sh64_elf64_linux_vec sh_elf32_linux_be_vec sh_elf32_linux_vec"
want64=true
;;
sh64-*-linux*)
- targ_defvec=bfd_elf32_sh64lin_vec
- targ_selvecs="bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf32_shlin_vec bfd_elf32_shblin_vec"
+ targ_defvec=sh64_elf32_linux_vec
+ targ_selvecs="sh64_elf32_linux_be_vec sh64_elf64_linux_vec sh64_elf64_linux_be_vec sh_elf32_linux_vec sh_elf32_linux_be_vec"
want64=true
;;
sh-*-linux*)
- targ_defvec=bfd_elf32_shblin_vec
- targ_selvecs="bfd_elf32_shlin_vec bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
+ targ_defvec=sh_elf32_linux_be_vec
+ targ_selvecs="sh_elf32_linux_vec sh64_elf32_linux_vec sh64_elf32_linux_be_vec sh64_elf64_linux_vec sh64_elf64_linux_be_vec"
want64=true
;;
#endif /* BFD64 */
sh*eb-*-linux*)
- targ_defvec=bfd_elf32_shblin_vec
- targ_selvecs=bfd_elf32_shlin_vec
+ targ_defvec=sh_elf32_linux_be_vec
+ targ_selvecs=sh_elf32_linux_vec
;;
sh*-*-linux*)
- targ_defvec=bfd_elf32_shlin_vec
- targ_selvecs=bfd_elf32_shblin_vec
+ targ_defvec=sh_elf32_linux_vec
+ targ_selvecs=sh_elf32_linux_be_vec
;;
sh-*-uclinux* | sh[12]-*-uclinux*)
- targ_defvec=bfd_elf32_sh_vec
- targ_selvecs="bfd_elf32_shl_vec bfd_elf32_shblin_vec bfd_elf32_shlin_vec bfd_elf32_shfd_vec bfd_elf32_shbfd_vec"
+ targ_defvec=sh_elf32_vec
+ targ_selvecs="sh_elf32_le_vec sh_elf32_linux_be_vec sh_elf32_linux_vec sh_elf32_fdpic_le_vec sh_elf32_fdpic_be_vec"
#ifdef BFD64
- targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec"
+ targ_selvecs="${targ_selvecs} sh64_elf32_linux_vec sh64_elf32_linux_be_vec sh64_elf64_linux_vec sh64_elf64_linux_be_vec"
#endif
;;
#ifdef BFD64
sh5le-*-netbsd*)
- targ_defvec=bfd_elf32_sh64lnbsd_vec
- targ_selvecs="bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec"
+ targ_defvec=sh64_elf32_nbsd_le_vec
+ targ_selvecs="sh64_elf32_nbsd_vec sh64_elf64_nbsd_le_vec sh64_elf64_nbsd_vec sh_elf32_nbsd_vec sh_elf32_nbsd_le_vec"
want64=true
;;
sh5-*-netbsd*)
- targ_defvec=bfd_elf32_sh64nbsd_vec
- targ_selvecs="bfd_elf32_sh64lnbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec"
+ targ_defvec=sh64_elf32_nbsd_vec
+ targ_selvecs="sh64_elf32_nbsd_le_vec sh64_elf64_nbsd_le_vec sh64_elf64_nbsd_vec sh_elf32_nbsd_vec sh_elf32_nbsd_le_vec"
want64=true
;;
sh64le-*-netbsd*)
- targ_defvec=bfd_elf64_sh64lnbsd_vec
- targ_selvecs="bfd_elf64_sh64nbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec"
+ targ_defvec=sh64_elf64_nbsd_le_vec
+ targ_selvecs="sh64_elf64_nbsd_vec sh64_elf32_nbsd_le_vec sh64_elf32_nbsd_vec sh_elf32_nbsd_vec sh_elf32_nbsd_le_vec"
want64=true
;;
sh64-*-netbsd*)
- targ_defvec=bfd_elf64_sh64nbsd_vec
- targ_selvecs="bfd_elf64_sh64lnbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec"
+ targ_defvec=sh64_elf64_nbsd_vec
+ targ_selvecs="sh64_elf64_nbsd_le_vec sh64_elf32_nbsd_le_vec sh64_elf32_nbsd_vec sh_elf32_nbsd_vec sh_elf32_nbsd_le_vec"
want64=true
;;
sh*l*-*-netbsdelf*)
- targ_defvec=bfd_elf32_shlnbsd_vec
- targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
+ targ_defvec=sh_elf32_nbsd_le_vec
+ targ_selvecs="sh_elf32_nbsd_vec sh_coff_vec sh_coff_le_vec sh64_elf32_nbsd_le_vec sh64_elf32_nbsd_vec sh64_elf64_nbsd_le_vec sh64_elf64_nbsd_vec"
want64=true
;;
sh-*-netbsdelf*)
- targ_defvec=bfd_elf32_shnbsd_vec
- targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
+ targ_defvec=sh_elf32_nbsd_vec
+ targ_selvecs="sh_elf32_nbsd_le_vec sh_coff_vec sh_coff_le_vec sh64_elf32_nbsd_le_vec sh64_elf32_nbsd_vec sh64_elf64_nbsd_le_vec sh64_elf64_nbsd_vec"
want64=true
;;
#endif
sh*-*-netbsdelf*)
- targ_defvec=bfd_elf32_shnbsd_vec
- targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec"
+ targ_defvec=sh_elf32_nbsd_vec
+ targ_selvecs="sh_elf32_nbsd_le_vec sh_coff_vec sh_coff_le_vec"
;;
sh*-*-symbianelf*)
- targ_defvec=bfd_elf32_shl_symbian_vec
- targ_selvecs="shlcoff_vec shlcoff_small_vec"
+ targ_defvec=sh_elf32_symbian_le_vec
+ targ_selvecs="sh_coff_le_vec sh_coff_small_le_vec"
targ_underscore=yes
;;
#ifdef BFD64
shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf* | shl*-*-kaos*)
- targ_defvec=bfd_elf32_shl_vec
- targ_selvecs="bfd_elf32_sh_vec shlcoff_vec shcoff_vec shlcoff_small_vec shcoff_small_vec bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec"
+ targ_defvec=sh_elf32_le_vec
+ targ_selvecs="sh_elf32_vec sh_coff_le_vec sh_coff_vec sh_coff_small_le_vec sh_coff_small_vec sh64_elf32_vec sh64_elf32_le_vec sh64_elf64_vec sh64_elf64_le_vec"
targ_underscore=yes
want64=true
;;
#endif
sh-*-rtemscoff*)
- targ_defvec=shcoff_vec
- targ_selvecs="shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
+ targ_defvec=sh_coff_vec
+ targ_selvecs="sh_coff_vec sh_coff_le_vec sh_coff_small_vec sh_coff_small_le_vec"
targ_underscore=yes
;;
#ifdef BFD64
sh-*-elf* | sh[1234]*-elf* | sh-*-rtems* | sh-*-kaos*)
- targ_defvec=bfd_elf32_sh_vec
- targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec"
+ targ_defvec=sh_elf32_vec
+ targ_selvecs="sh_elf32_le_vec sh_coff_vec sh_coff_le_vec sh_coff_small_vec sh_coff_small_le_vec sh64_elf32_vec sh64_elf32_le_vec sh64_elf64_vec sh64_elf64_le_vec"
targ_underscore=yes
want64=true
;;
#endif
sh-*-nto*)
- targ_defvec=bfd_elf32_sh_vec
- targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
+ targ_defvec=sh_elf32_vec
+ targ_selvecs="sh_elf32_le_vec sh_coff_vec sh_coff_le_vec sh_coff_small_vec sh_coff_small_le_vec"
targ_underscore=yes
;;
sh*-*-openbsd*)
- targ_defvec=bfd_elf32_shlnbsd_vec
- targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec"
+ targ_defvec=sh_elf32_nbsd_le_vec
+ targ_selvecs="sh_elf32_nbsd_vec sh_coff_vec sh_coff_le_vec"
;;
sh-*-pe)
- targ_defvec=shlpe_vec
- targ_selvecs="shlpe_vec shlpei_vec"
+ targ_defvec=sh_pe_le_vec
+ targ_selvecs="sh_pe_le_vec sh_pei_le_vec"
targ_underscore=yes
;;
sh-*-vxworks)
- targ_defvec=bfd_elf32_shvxworks_vec
- targ_selvecs="bfd_elf32_shlvxworks_vec"
+ targ_defvec=sh_elf32_vxworks_vec
+ targ_selvecs="sh_elf32_vxworks_le_vec"
# FIXME None of the following are actually used on this target, but
# they're necessary for coff-sh.c (which is unconditionally used) to be
# compiled correctly.
- targ_selvecs="$targ_selvecs shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
+ targ_selvecs="$targ_selvecs sh_coff_vec sh_coff_le_vec sh_coff_small_vec sh_coff_small_le_vec"
targ_underscore=yes
;;
sh-*-*)
- targ_defvec=shcoff_vec
- targ_selvecs="shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
+ targ_defvec=sh_coff_vec
+ targ_selvecs="sh_coff_vec sh_coff_le_vec sh_coff_small_vec sh_coff_small_le_vec"
targ_underscore=yes
;;
sparclet-*-aout*)
- targ_defvec=sunos_big_vec
- targ_selvecs=sparcle_aout_vec
+ targ_defvec=sparc_aout_sunos_be_vec
+ targ_selvecs=sparc_aout_le_vec
targ_underscore=yes
;;
sparc86x-*-aout*)
- targ_defvec=sunos_big_vec
+ targ_defvec=sparc_aout_sunos_be_vec
targ_underscore=yes
;;
sparclite-*-elf* | sparc86x-*-elf*)
- targ_defvec=bfd_elf32_sparc_vec
+ targ_defvec=sparc_elf32_vec
;;
sparc*-*-chorus*)
- targ_defvec=bfd_elf32_sparc_vec
+ targ_defvec=sparc_elf32_vec
;;
sparc-*-linux*aout*)
- targ_defvec=sparclinux_vec
- targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_defvec=sparc_aout_linux_vec
+ targ_selvecs="sparc_elf32_vec sparc_aout_sunos_be_vec"
targ_underscore=yes
;;
sparc-*-linux-* | sparcv*-*-linux-*)
- targ_defvec=bfd_elf32_sparc_vec
- targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ targ_defvec=sparc_elf32_vec
+ targ_selvecs="sparc_aout_linux_vec sparc_elf64_vec sparc_aout_sunos_be_vec"
;;
sparc-*-netbsdelf*)
- targ_defvec=bfd_elf32_sparc_vec
- targ_selvecs=sparcnetbsd_vec
+ targ_defvec=sparc_elf32_vec
+ targ_selvecs=sparc_aout_nbsd_vec
;;
sparc-*-netbsdaout* | sparc-*-netbsd*)
- targ_defvec=sparcnetbsd_vec
- targ_selvecs=bfd_elf32_sparc_vec
+ targ_defvec=sparc_aout_nbsd_vec
+ targ_selvecs=sparc_elf32_vec
targ_underscore=yes
;;
sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1])
- targ_defvec=sparcnetbsd_vec
+ targ_defvec=sparc_aout_nbsd_vec
targ_underscore=yes
;;
sparc-*-openbsd*)
- targ_defvec=bfd_elf32_sparc_vec
- targ_selvecs=sparcnetbsd_vec
+ targ_defvec=sparc_elf32_vec
+ targ_selvecs=sparc_aout_nbsd_vec
;;
sparc-*-elf*)
- targ_defvec=bfd_elf32_sparc_vec
- targ_selvecs=sunos_big_vec
+ targ_defvec=sparc_elf32_vec
+ targ_selvecs=sparc_aout_sunos_be_vec
;;
sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
- targ_defvec=bfd_elf32_sparc_sol2_vec
- targ_selvecs=sunos_big_vec
+ targ_defvec=sparc_elf32_sol2_vec
+ targ_selvecs=sparc_aout_sunos_be_vec
;;
#ifdef BFD64
sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*)
- targ_defvec=bfd_elf32_sparc_sol2_vec
- targ_selvecs="bfd_elf64_sparc_sol2_vec sunos_big_vec"
+ targ_defvec=sparc_elf32_sol2_vec
+ targ_selvecs="sparc_elf64_sol2_vec sparc_aout_sunos_be_vec"
want64=true
;;
#endif
sparc-*-sysv4*)
- targ_defvec=bfd_elf32_sparc_vec
+ targ_defvec=sparc_elf32_vec
;;
sparc-*-vxworks*)
- targ_defvec=bfd_elf32_sparc_vxworks_vec
- targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_defvec=sparc_elf32_vxworks_vec
+ targ_selvecs="sparc_elf32_vec sparc_aout_sunos_be_vec"
;;
sparc-*-netware*)
- targ_defvec=bfd_elf32_sparc_vec
- targ_selvecs="nlm32_sparc_vec sunos_big_vec"
+ targ_defvec=sparc_elf32_vec
+ targ_selvecs="sparc_nlm32_vec sparc_aout_sunos_be_vec"
;;
#ifdef BFD64
sparc64-*-aout*)
- targ_defvec=sunos_big_vec
+ targ_defvec=sparc_aout_sunos_be_vec
targ_underscore=yes
want64=true
;;
sparc64*-*-linux-*)
- targ_defvec=bfd_elf64_sparc_vec
- targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ targ_defvec=sparc_elf64_vec
+ targ_selvecs="sparc_elf32_vec sparc_aout_linux_vec sparc_aout_sunos_be_vec"
want64=true
;;
sparc64-*-elf* | sparc64-*-rtems* )
- targ_defvec=bfd_elf64_sparc_vec
- targ_selvecs=bfd_elf32_sparc_vec
+ targ_defvec=sparc_elf64_vec
+ targ_selvecs=sparc_elf32_vec
want64=true
;;
#endif /* BFD64 */
sparc*-*-coff*)
- targ_defvec=sparccoff_vec
+ targ_defvec=sparc_coff_vec
;;
sparc-*-rtems*)
- targ_defvec=bfd_elf32_sparc_vec
- targ_selvecs="sunos_big_vec sparccoff_vec"
+ targ_defvec=sparc_elf32_vec
+ targ_selvecs="sparc_aout_sunos_be_vec sparc_coff_vec"
;;
sparc*-*-*)
- targ_defvec=sunos_big_vec
+ targ_defvec=sparc_aout_sunos_be_vec
targ_underscore=yes
;;
spu-*-elf)
- targ_defvec=bfd_elf32_spu_vec
+ targ_defvec=spu_elf32_vec
want64=true
;;
-#if HAVE_host_aout_vec
+#if HAVE_aout_vec
tahoe-*-*)
- targ_defvec=host_aout_vec
+ targ_defvec=aout_vec
targ_underscore=yes
;;
#endif
tic6x-*-elf)
- targ_defvec=bfd_elf32_tic6x_elf_le_vec
- targ_selvecs="bfd_elf32_tic6x_elf_be_vec bfd_elf32_tic6x_le_vec bfd_elf32_tic6x_be_vec"
+ targ_defvec=tic6x_elf32_c6000_le_vec
+ targ_selvecs="tic6x_elf32_c6000_be_vec tic6x_elf32_le_vec tic6x_elf32_be_vec"
;;
tic6x-*-uclinux)
- targ_defvec=bfd_elf32_tic6x_linux_le_vec
- targ_selvecs="bfd_elf32_tic6x_linux_be_vec bfd_elf32_tic6x_le_vec bfd_elf32_tic6x_be_vec"
+ targ_defvec=tic6x_elf32_linux_le_vec
+ targ_selvecs="tic6x_elf32_linux_be_vec tic6x_elf32_le_vec tic6x_elf32_be_vec"
;;
tic80*-*-*)
- targ_defvec=tic80coff_vec
+ targ_defvec=tic80_coff_vec
targ_underscore=yes
;;
#ifdef BFD64
tilegx-*-*)
- targ_defvec=bfd_elf64_tilegx_le_vec
- targ_selvecs="bfd_elf64_tilegx_be_vec bfd_elf32_tilegx_be_vec bfd_elf32_tilegx_le_vec"
+ targ_defvec=tilegx_elf64_le_vec
+ targ_selvecs="tilegx_elf64_be_vec tilegx_elf32_be_vec tilegx_elf32_le_vec"
;;
tilegxbe-*-*)
- targ_defvec=bfd_elf64_tilegx_be_vec
- targ_selvecs="bfd_elf64_tilegx_le_vec bfd_elf32_tilegx_be_vec bfd_elf32_tilegx_le_vec"
+ targ_defvec=tilegx_elf64_be_vec
+ targ_selvecs="tilegx_elf64_le_vec tilegx_elf32_be_vec tilegx_elf32_le_vec"
;;
#endif
tilepro-*-*)
- targ_defvec=bfd_elf32_tilepro_vec
+ targ_defvec=tilepro_elf32_vec
;;
v850*-*-*)
- targ_defvec=bfd_elf32_v850_vec
- targ_selvecs="bfd_elf32_v850_rh850_vec"
+ targ_defvec=v850_elf32_vec
+ targ_selvecs="v800_elf32_vec"
;;
vax-*-netbsdelf*)
- targ_defvec=bfd_elf32_vax_vec
- targ_selvecs="vaxnetbsd_vec vax1knetbsd_vec"
+ targ_defvec=vax_elf32_vec
+ targ_selvecs="vax_aout_nbsd_vec vax_aout_1knbsd_vec"
;;
vax-*-netbsdaout* | vax-*-netbsd*)
- targ_defvec=vaxnetbsd_vec
- targ_selvecs="bfd_elf32_vax_vec vax1knetbsd_vec"
+ targ_defvec=vax_aout_nbsd_vec
+ targ_selvecs="vax_elf32_vec vax_aout_1knbsd_vec"
targ_underscore=yes
;;
vax-*-bsd* | vax-*-ultrix*)
- targ_defvec=vaxbsd_vec
+ targ_defvec=vax_aout_bsd_vec
targ_underscore=yes
;;
vax-*-openbsd*)
- targ_defvec=vaxnetbsd_vec
+ targ_defvec=vax_aout_nbsd_vec
targ_underscore=yes
;;
vax-*-linux-*)
- targ_defvec=bfd_elf32_vax_vec
+ targ_defvec=vax_elf32_vec
;;
we32k-*-*)
- targ_defvec=we32kcoff_vec
+ targ_defvec=we32k_coff_vec
;;
w65-*-*)
- targ_defvec=w65_vec
+ targ_defvec=w65_coff_vec
;;
xgate-*-*)
- targ_defvec=bfd_elf32_xgate_vec
- targ_selvecs="bfd_elf32_xgate_vec"
+ targ_defvec=xgate_elf32_vec
+ targ_selvecs="xgate_elf32_vec"
;;
xstormy16-*-elf)
- targ_defvec=bfd_elf32_xstormy16_vec
+ targ_defvec=xstormy16_elf32_vec
;;
xtensa*-*-*)
- targ_defvec=bfd_elf32_xtensa_le_vec
- targ_selvecs=bfd_elf32_xtensa_be_vec
+ targ_defvec=xtensa_elf32_le_vec
+ targ_selvecs=xtensa_elf32_be_vec
;;
xc16x-*-elf)
- targ_defvec=bfd_elf32_xc16x_vec
+ targ_defvec=xc16x_elf32_vec
;;
z80-*-*)
- targ_defvec=z80coff_vec
+ targ_defvec=z80_coff_vec
targ_underscore=no
;;
z8k*-*-*)
- targ_defvec=z8kcoff_vec
+ targ_defvec=z8k_coff_vec
targ_underscore=yes
;;
@@ -1673,17 +1697,17 @@ case "${targ}" in
;;
*-adobe-*)
- targ_defvec=a_out_adobe_vec
+ targ_defvec=aout_adobe_vec
targ_underscore=yes
;;
*-sony-*)
- targ_defvec=newsos3_vec
+ targ_defvec=m68k_aout_newsos3_vec
targ_underscore=yes
;;
*-tandem-*)
- targ_defvec=m68kcoff_vec
+ targ_defvec=m68k_coff_vec
targ_selvecs=ieee_vec
;;
# END OF targmatch.h
@@ -1696,7 +1720,7 @@ esac
# All MIPS ELF targets need a 64-bit bfd_vma.
case "${targ_defvec} ${targ_selvecs}" in
- *elf*mips*)
+ *mips_elf*)
want64=true
;;
esac
@@ -1712,24 +1736,24 @@ esac
# to be used on an arbitrary ELF file for anything other than
# relocation information.
case "${targ_defvec} ${targ_selvecs}" in
- *bfd_elf64* | *bfd_elf32_n*mips*)
- targ_selvecs="${targ_selvecs} bfd_elf64_little_generic_vec bfd_elf64_big_generic_vec bfd_elf32_little_generic_vec bfd_elf32_big_generic_vec"
+ *elf64* | *mips_elf32_n*)
+ targ_selvecs="${targ_selvecs} elf64_le_vec elf64_be_vec elf32_le_vec elf32_be_vec"
;;
- *bfd_elf32*)
- targ_selvecs="${targ_selvecs} bfd_elf32_little_generic_vec bfd_elf32_big_generic_vec"
+ *elf32*)
+ targ_selvecs="${targ_selvecs} elf32_le_vec elf32_be_vec"
;;
esac
# If we support Intel L1OM target, then add support for bfd_l1om_arch.
case "${targ_defvec} ${targ_selvecs}" in
- *bfd_elf64_l1om_vec*)
+ *l1om_elf64*)
targ_archs="$targ_archs bfd_l1om_arch"
;;
esac
# If we support Intel K1OM target, then add support for bfd_k1om_arch.
case "${targ_defvec} ${targ_selvecs}" in
- *bfd_elf64_k1om_vec*)
+ *k1om_elf64*)
targ_archs="$targ_archs bfd_k1om_arch"
;;
esac
diff --git a/binutils-2.25/bfd/config.in b/binutils-2.25/bfd/config.in
index 65fb0441..b911bf6e 100644
--- a/binutils-2.25/bfd/config.in
+++ b/binutils-2.25/bfd/config.in
@@ -1,4 +1,4 @@
-/* config.in. Generated from configure.in by autoheader. */
+/* config.in. Generated from configure.ac by autoheader. */
/* Check that config.h is #included before system headers
(this works only for glibc, but that should be enough). */
@@ -64,6 +64,10 @@
*/
#undef HAVE_DECL_STPCPY
+/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRNLEN
+
/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
*/
#undef HAVE_DECL_STRSTR
@@ -255,6 +259,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
/* Define if <sys/procfs.h> has win32_pstatus_t. */
#undef HAVE_WIN32_PSTATUS_T
diff --git a/binutils-2.25/bfd/configure b/binutils-2.25/bfd/configure
index bdda6dc6..482efe33 100755
--- a/binutils-2.25/bfd/configure
+++ b/binutils-2.25/bfd/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.64 for bfd 2.24.51.
+# Generated by GNU Autoconf 2.64 for bfd 2.24.90.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
@@ -556,8 +556,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='bfd'
PACKAGE_TARNAME='bfd'
-PACKAGE_VERSION='2.24.51'
-PACKAGE_STRING='bfd 2.24.51'
+PACKAGE_VERSION='2.24.90'
+PACKAGE_STRING='bfd 2.24.90'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1349,7 +1349,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures bfd 2.24.51 to adapt to many kinds of systems.
+\`configure' configures bfd 2.24.90 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1420,7 +1420,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of bfd 2.24.51:";;
+ short | recursive ) echo "Configuration of bfd 2.24.90:";;
esac
cat <<\_ACEOF
@@ -1435,7 +1435,7 @@ Optional Features:
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
- --enable-plugins Enable support for plugins (defaults no)
+ --enable-plugins Enable support for plugins
--disable-largefile omit support for large files
--enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)
--enable-targets alternative target configurations
@@ -1541,7 +1541,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-bfd configure 2.24.51
+bfd configure 2.24.90
generated by GNU Autoconf 2.64
Copyright (C) 2009 Free Software Foundation, Inc.
@@ -2183,7 +2183,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by bfd $as_me 2.24.51, which was
+It was created by bfd $as_me 2.24.90, which was
generated by GNU Autoconf 2.64. Invocation command line was
$ $0 $@
@@ -3991,7 +3991,7 @@ fi
# Define the identity of the package.
PACKAGE='bfd'
- VERSION='2.24.51'
+ VERSION='2.24.90'
cat >>confdefs.h <<_ACEOF
@@ -11776,17 +11776,106 @@ CC="$lt_save_CC"
# even in directories otherwise not depending on the $plugins option.
-# Check whether --enable-plugins was given.
+ maybe_plugins=no
+ for ac_header in dlfcn.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+ maybe_plugins=yes
+fi
+
+done
+
+ for ac_header in windows.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_windows_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINDOWS_H 1
+_ACEOF
+ maybe_plugins=yes
+fi
+
+done
+
+
+ # Check whether --enable-plugins was given.
if test "${enable_plugins+set}" = set; then :
enableval=$enable_plugins; case "${enableval}" in
- yes | "") plugins=yes ;;
- no) plugins=no ;;
- *) plugins=yes ;;
- esac
+ no) plugins=no ;;
+ *) plugins=yes
+ if test "$maybe_plugins" != "yes" ; then
+ as_fn_error "Building with plugin support requires a host that supports dlopen." "$LINENO" 5
+ fi ;;
+ esac
+else
+ plugins=$maybe_plugins
+
+fi
+
+ if test "$plugins" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
+$as_echo_n "checking for library containing dlopen... " >&6; }
+if test "${ac_cv_search_dlopen+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' dl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_dlopen=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if test "${ac_cv_search_dlopen+set}" = set; then :
+ break
+fi
+done
+if test "${ac_cv_search_dlopen+set}" = set; then :
+
else
- plugins=no
+ ac_cv_search_dlopen=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
+$as_echo "$ac_cv_search_dlopen" >&6; }
+ac_res=$ac_cv_search_dlopen
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
fi
+ fi
case "${host}" in
@@ -12012,10 +12101,6 @@ fi
if test "$plugins" = "yes"; then
- if test "$enable_dlopen" != "yes" ; then
- as_fn_error "
- Building BFD with plugin support requires a host that supports -ldl." "$LINENO" 5
- fi
enable_targets="$enable_targets plugin"
fi
@@ -12060,7 +12145,7 @@ if test "${enable_secureplt+set}" = set; then :
*) as_fn_error "bad value ${enableval} for secureplt option" "$LINENO" 5 ;;
esac
else
- use_secureplt=false
+ use_secureplt=true
fi
if test $use_secureplt = true; then
@@ -12158,6 +12243,9 @@ fi
+# Set the 'development' global.
+. $srcdir/../bfd/development.sh
+
GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -12192,8 +12280,8 @@ case "${host}" in
*) ;;
esac
-# Enable -Werror by default when using gcc
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+# Enable -Werror by default when using gcc. Turn it off for releases.
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" -a "$development" = true ; then
ERROR_ON_WARNING=yes
fi
@@ -12900,7 +12988,7 @@ $as_echo "$bfd_cv_build_exeext" >&6; }
fi
-for ac_header in alloca.h stddef.h string.h strings.h stdlib.h time.h unistd.h
+for ac_header in alloca.h stddef.h string.h strings.h stdlib.h time.h unistd.h wchar.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -13529,21 +13617,6 @@ fi
fi
-for ac_header in windows.h dlfcn.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
- if test "x$as_val" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether string.h and strings.h may both be included" >&5
$as_echo_n "checking whether string.h and strings.h may both be included... " >&6; }
if test "${gcc_cv_header_string+set}" = set; then :
@@ -13766,6 +13839,17 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_VSNPRINTF $ac_have_decl
_ACEOF
+ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strnlen" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNLEN $ac_have_decl
+_ACEOF
+
# Link in zlib if we can. This allows us to read compressed debug sections.
# This is used only by compress.c.
@@ -14013,7 +14097,7 @@ if test "${target}" = "${host}"; then
COREFILE=netbsd-core.lo
;;
rs6000-*-lynx*)
- COREFILE=lynx-core.lo
+ COREFILE=lynx-core.lo
;;
rs6000-*-aix[5-9].* | powerpc-*-aix[5-9].*)
COREFILE=rs6000-core.lo
@@ -14070,7 +14154,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
TRAD_HEADER='"hosts/tahoe.h"'
;;
vax-*-netbsd* | vax-*-openbsd*)
- COREFILE=netbsd-core.lo
+ COREFILE=netbsd-core.lo
;;
vax-*-ultrix2*)
COREFILE=trad-core.lo
@@ -15088,6 +15172,11 @@ if test "$enable_shared" = "yes"; then
SHARED_LDFLAGS="-no-undefined"
SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32"
;;
+
+ # Hack to build or1k-src on OSX
+ or1k*-*-darwin*)
+ SHARED_LIBADD="-L`pwd`/../libiberty/pic -L`pwd`/../intl -liberty -lintl"
+ ;;
esac
if test -n "$SHARED_LIBADD"; then
@@ -15196,350 +15285,347 @@ do
# This list is alphabetized to make it easy to compare
# with the two vector lists in targets.c. For the same reason,
# use one entry per line, even though this leads to long lines.
- a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
- aix5coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
- aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;;
- aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;;
- aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;;
- apollocoff_vec) tb="$tb coff-apollo.lo" ;;
- arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
- arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
- arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
- arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
- arm_wince_pe_big_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;;
- arm_wince_pe_little_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;;
- arm_wince_pei_big_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;;
- arm_wince_pei_little_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;;
- armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
- armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
- armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;;
- armpe_big_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
- armpe_little_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
- armpei_big_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
- armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
- b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;;
- b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;;
- bfd_pei_ia64_vec) tb="$tb pei-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
- bfd_elf32_am33lin_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
- bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;;
- bfd_elf32_bfin_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
- bfd_elf32_bfinfdpic_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
- bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
- bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
- bfd_elf32_bigarm_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_bigarm_nacl_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_bigarm_symbian_vec)
- tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_bigarm_vxworks_vec)
- tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
- bfd_elf32_bigmips_vxworks_vec)
- tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
- bfd_elf32_bigmoxie_vec) tb="$tb elf32-moxie.lo elf32.lo $elf" ;;
- bfd_elf32_bignios2_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;;
- bfd_elf32_cr16_vec) tb="$tb elf32-cr16.lo elf32.lo $elf" ;;
- bfd_elf32_cr16c_vec) tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
- bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
- bfd_elf32_crx_vec) tb="$tb elf32-crx.lo elf32.lo $elf" ;;
- bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
- bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
- bfd_elf32_dlx_big_vec) tb="$tb elf32-dlx.lo elf32.lo $elf" ;;
- bfd_elf32_epiphany_vec) tb="$tb elf32-epiphany.lo elf32.lo $elf" ;;
- bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
- bfd_elf32_frv_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;;
- bfd_elf32_frvfdpic_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;;
- bfd_elf32_h8300_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;;
- bfd_elf32_hppa_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
- bfd_elf32_hppa_nbsd_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
- bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
- bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
- bfd_elf32_i386_sol2_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_i386_nacl_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_i386_vxworks_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
- bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
- bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;;
- bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elfxx-ia64.lo elf32.lo $elf" ;;
- bfd_elf32_ia64_hpux_big_vec) tb="$tb elf32-ia64.lo elfxx-ia64.lo elf32.lo $elf";;
- bfd_elf32_ip2k_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;;
- bfd_elf32_iq2000_vec) tb="$tb elf32-iq2000.lo elf32.lo $elf" ;;
- bfd_elf32_lm32_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
- bfd_elf32_lm32fdpic_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
- bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
- bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
- bfd_elf32_littlearm_symbian_vec)
- tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_littlearm_vxworks_vec)
- tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_littlearm_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_littlearm_nacl_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
- bfd_elf32_littlemips_vxworks_vec)
- tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
- bfd_elf32_littlemoxie_vec) tb="$tb elf32-moxie.lo elf32.lo $elf" ;;
- bfd_elf32_littlenios2_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;;
- bfd_elf32_m32c_vec) tb="$tb elf32-m32c.lo elf32.lo $elf" ;;
- bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
- bfd_elf32_m32rle_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
- bfd_elf32_m32rlin_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
- bfd_elf32_m32rlelin_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
- bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
- bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
- bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
- bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
- bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
- bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
- bfd_elf32_mep_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;;
- bfd_elf32_mep_little_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;;
- bfd_elf32_metag_vec) tb="$tb elf32-metag.lo elf32.lo $elf" ;;
- bfd_elf32_microblazeel_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;;
- bfd_elf32_microblaze_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;;
- bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;;
- bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
- bfd_elf32_mt_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;;
- bfd_elf32_msp430_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
- bfd_elf32_msp430_ti_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
- bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf32_ntradbigmips_vec | bfd_elf32_ntradbigmips_freebsd_vec)
- tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf32_ntradlittlemips_vec | bfd_elf32_ntradlittlemips_freebsd_vec)
- tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf32_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;;
- bfd_elf32_or32_big_vec) tb="$tb elf32-or32.lo elf32.lo $elf" ;;
- bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";;
- bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";;
- bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_powerpc_freebsd_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_powerpc_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_rl78_vec) tb="$tb elf32-rl78.lo $elf" ;;
- bfd_elf32_rx_le_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;;
- bfd_elf32_rx_be_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;;
- bfd_elf32_rx_be_ns_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;;
- bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;;
- bfd_elf32_bigscore_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64;;
- bfd_elf32_littlescore_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64;;
+ aarch64_elf32_be_vec) tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;;
+ aarch64_elf32_le_vec) tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;;
+ aarch64_elf64_be_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
+ aarch64_elf64_le_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
+ alpha_ecoff_le_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"; target_size=64 ;;
+ alpha_elf64_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
+ alpha_elf64_fbsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
+ alpha_nlm32_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;;
+ alpha_vms_vec) tb="$tb vms-alpha.lo vms-misc.lo vms-lib.lo"; target_size=64 ;;
+ alpha_vms_lib_txt_vec) tb="$tb vms-lib.lo vms-misc.lo" ;;
+ am33_elf32_linux_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
+ aout0_be_vec) tb="$tb aout0.lo aout32.lo" ;;
+ aout64_vec) tb="$tb demo64.lo aout64.lo"; target_size=64 ;;
+ aout_vec) tb="$tb host-aout.lo aout32.lo" ;;
+ aout_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
+ arc_elf32_be_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
+ arc_elf32_le_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
+ arm_aout_be_vec) tb="$tb aout-arm.lo aout32.lo" ;;
+ arm_aout_le_vec) tb="$tb aout-arm.lo aout32.lo" ;;
+ arm_aout_nbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;;
+ arm_aout_riscix_vec) tb="$tb aout32.lo riscix.lo" ;;
+ arm_coff_be_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
+ arm_coff_le_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
+ arm_elf32_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_elf32_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_elf32_nacl_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_elf32_nacl_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_elf32_symbian_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_elf32_symbian_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_elf32_vxworks_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_elf32_vxworks_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_pe_be_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pe_le_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pe_epoc_be_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pe_epoc_le_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pe_wince_be_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pe_wince_le_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pei_be_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pei_le_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pei_epoc_be_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pei_epoc_le_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pei_wince_be_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pei_wince_le_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;;
+ avr_elf32_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;;
+ bfin_elf32_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
+ bfin_elf32_fdpic_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
+ bout_be_vec) tb="$tb bout.lo aout32.lo" ;;
+ bout_le_vec) tb="$tb bout.lo aout32.lo" ;;
+ cr16_elf32_vec) tb="$tb elf32-cr16.lo elf32.lo $elf" ;;
+ cr16c_elf32_vec) tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
+ cris_aout_vec) tb="$tb aout-cris.lo" ;;
+ cris_elf32_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
+ cris_elf32_us_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
+ crx_elf32_vec) tb="$tb elf32-crx.lo elf32.lo $elf" ;;
+ d10v_elf32_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
+ d30v_elf32_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
+ dlx_elf32_be_vec) tb="$tb elf32-dlx.lo elf32.lo $elf" ;;
+ elf32_be_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
+ elf32_le_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
+ elf64_be_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
+ elf64_le_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
+ epiphany_elf32_vec) tb="$tb elf32-epiphany.lo elf32.lo $elf" ;;
+ fr30_elf32_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
+ frv_elf32_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;;
+ frv_elf32_fdpic_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;;
+ h8300_coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;;
+ h8300_elf32_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;;
+ h8500_coff_vec) tb="$tb coff-h8500.lo reloc16.lo" ;;
+ hppa_elf32_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
+ hppa_elf32_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
+ hppa_elf32_nbsd_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
+ hppa_elf64_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
+ hppa_elf64_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
+ hppa_som_vec) tb="$tb som.lo" ;;
+ i370_elf32_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
+ i386_aout_vec) tb="$tb i386aout.lo aout32.lo" ;;
+ i386_aout_bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;;
+ i386_aout_dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;;
+ i386_aout_fbsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;;
+ i386_aout_linux_vec) tb="$tb i386linux.lo aout32.lo" ;;
+ i386_aout_lynx_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
+ i386_aout_mach3_vec) tb="$tb i386mach3.lo aout32.lo" ;;
+ i386_aout_nbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;;
+ i386_aout_os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;;
+ i386_coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;;
+ i386_coff_go32_vec) tb="$tb coff-go32.lo cofflink.lo" ;;
+ i386_coff_go32stubbed_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;;
+ i386_coff_lynx_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
+ i386_elf32_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
+ i386_elf32_fbsd_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
+ i386_elf32_nacl_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
+ i386_elf32_sol2_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
+ i386_elf32_vxworks_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
+ i386_mach_o_vec) tb="$tb mach-o-i386.lo" ;;
+ i386_msdos_vec) tb="$tb i386msdos.lo" ;;
+ i386_nlm32_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
+ i386_pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
+ i386_pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
+ i860_coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;;
+ i860_elf32_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
+ i860_elf32_le_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
+ i960_elf32_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;;
+ ia64_elf32_be_vec) tb="$tb elf32-ia64.lo elfxx-ia64.lo elf32.lo $elf" ;;
+ ia64_elf32_hpux_be_vec) tb="$tb elf32-ia64.lo elfxx-ia64.lo elf32.lo $elf" ;;
+ ia64_elf64_be_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
+ ia64_elf64_le_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
+ ia64_elf64_hpux_be_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
+ ia64_elf64_vms_vec) tb="$tb elf64-ia64-vms.lo elf64-ia64.lo elfxx-ia64.lo elf64.lo vms-lib.lo vms-misc.lo $elf"; target_size=64 ;;
+ ia64_pei_vec) tb="$tb pei-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
+ icoff_be_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
+ icoff_le_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
+ ieee_vec) tb="$tb ieee.lo" ;;
+ ip2k_elf32_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;;
+ iq2000_elf32_vec) tb="$tb elf32-iq2000.lo elf32.lo $elf" ;;
+ k1om_elf64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ k1om_elf64_fbsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ l1om_elf64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ l1om_elf64_fbsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ lm32_elf32_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
+ lm32_elf32_fdpic_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
+ m32c_elf32_vec) tb="$tb elf32-m32c.lo elf32.lo $elf" ;;
+ m32r_elf32_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
+ m32r_elf32_le_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
+ m32r_elf32_linux_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
+ m32r_elf32_linux_le_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
+ m68hc11_elf32_vec) tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
+ m68hc12_elf32_vec) tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
+ m68k_aout_4knbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;;
+ m68k_aout_hp300bsd_vec) tb="$tb hp300bsd.lo aout32.lo" ;;
+ m68k_aout_hp300hpux_vec) tb="$tb hp300hpux.lo aout32.lo" ;;
+ m68k_aout_linux_vec) tb="$tb m68klinux.lo aout32.lo" ;;
+ m68k_aout_nbsd_vec) tb="$tb m68knetbsd.lo aout32.lo" ;;
+ m68k_aout_newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;;
+ m68k_coff_vec) tb="$tb coff-m68k.lo cofflink.lo" ;;
+ m68k_coff_apollo_vec) tb="$tb coff-apollo.lo" ;;
+ m68k_coff_aux_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
+ m68k_coff_sysv_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;;
+ m68k_coff_un_vec) tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;;
+ m68k_elf32_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
+ m68k_versados_vec) tb="$tb versados.lo" ;;
+ m88k_aout_mach3_vec) tb="$tb m88kmach3.lo aout32.lo" ;;
+ m88k_aout_obsd_vec) tb="$tb m88kopenbsd.lo aout32.lo" ;;
+ m88k_coff_bcs_vec) tb="$tb coff-m88k.lo" ;;
+ m88k_elf32_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
+ mach_o_be_vec) tb="$tb mach-o.lo" ;;
+ mach_o_le_vec) tb="$tb mach-o.lo" ;;
+ mach_o_fat_vec) tb="$tb mach-o.lo" ;;
+ mcore_elf32_be_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
+ mcore_elf32_le_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
+ mcore_pe_be_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
+ mcore_pe_le_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
+ mcore_pei_be_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
+ mcore_pei_le_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
+ mep_elf32_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;;
+ mep_elf32_le_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;;
+ metag_elf32_vec) tb="$tb elf32-metag.lo elf32.lo $elf" ;;
+ microblaze_elf32_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;;
+ microblaze_elf32_le_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;;
+ mips_ecoff_be_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
+ mips_ecoff_le_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
+ mips_ecoff_bele_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
+ mips_elf32_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf32_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf32_n_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf32_n_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf32_ntrad_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf32_ntrad_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf32_ntradfbsd_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf32_ntradfbsd_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf32_trad_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf32_trad_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf32_tradfbsd_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf32_tradfbsd_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf32_vxworks_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf32_vxworks_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf64_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf64_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf64_trad_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf64_trad_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf64_tradfbsd_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf64_tradfbsd_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_pe_le_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;;
+ mips_pei_le_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;;
+ mmix_elf64_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
+ mmix_mmo_vec) tb="$tb mmo.lo" target_size=64 ;;
+ mn10200_elf32_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;;
+ mn10300_elf32_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
+ moxie_elf32_be_vec) tb="$tb elf32-moxie.lo elf32.lo $elf" ;;
+ moxie_elf32_le_vec) tb="$tb elf32-moxie.lo elf32.lo $elf" ;;
+ msp430_elf32_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
+ msp430_elf32_ti_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
+ mt_elf32_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;;
+ nds32_elf32_be_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;;
+ nds32_elf32_le_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;;
+ nds32_elf32_linux_be_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;;
+ nds32_elf32_linux_le_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;;
+ nios2_elf32_be_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;;
+ nios2_elf32_le_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;;
+ ns32k_aout_pc532mach_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
+ ns32k_aout_pc532nbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
+ or1k_elf32_vec) tb="$tb elf32-or1k.lo elf32.lo $elf" ;;
+ pdp11_aout_vec) tb="$tb pdp11.lo" ;;
+ pef_vec) tb="$tb pef.lo" ;;
+ pef_xlib_vec) tb="$tb pef.lo" ;;
+ pj_elf32_vec) tb="$tb elf32-pj.lo elf32.lo $elf" ;;
+ pj_elf32_le_vec) tb="$tb elf32-pj.lo elf32.lo $elf" ;;
+ plugin_vec) tb="$tb plugin.lo" ;;
+ powerpc_boot_vec) tb="$tb ppcboot.lo" ;;
+ powerpc_elf32_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ powerpc_elf32_le_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ powerpc_elf32_fbsd_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ powerpc_elf32_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ powerpc_elf64_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
+ powerpc_elf64_le_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
+ powerpc_elf64_fbsd_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
+ powerpc_nlm32_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
+ powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
+ powerpc_pe_le_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
+ powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
+ powerpc_pei_le_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
+ powerpc_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
+ rl78_elf32_vec) tb="$tb elf32-rl78.lo elf32.lo $elf" ;;
+ rs6000_xcoff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
+ rs6000_xcoff64_aix_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
+ rs6000_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
+ rx_elf32_be_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;;
+ rx_elf32_be_ns_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;;
+ rx_elf32_le_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;;
+ s390_elf32_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;;
+ s390_elf64_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
+ score_elf32_be_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64 ;;
+ score_elf32_le_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64 ;;
# FIXME: We include cofflink.lo not because it's needed for
- # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
+ # sh64_elf32[_le]_vec, but because we include sh_elf32[_le]_vec
# which needs it but does not list it. Should be fixed in right place.
- bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
- bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
- bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
- bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
- bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
- bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
- bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
- bfd_elf32_shbfd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_shfd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
- bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
- bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_shlvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
- bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_shvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
- bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_sparc_sol2_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_spu_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;;
- bfd_elf32_tic6x_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
- bfd_elf32_tic6x_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
- bfd_elf32_tic6x_linux_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
- bfd_elf32_tic6x_linux_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
- bfd_elf32_tic6x_elf_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
- bfd_elf32_tic6x_elf_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
- bfd_elf32_tilegx_be_vec) tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;;
- bfd_elf32_tilegx_le_vec) tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;;
- bfd_elf32_tilepro_vec) tb="$tb elf32-tilepro.lo elf32.lo $elf" ;;
- bfd_elf32_tradbigmips_vec | bfd_elf32_tradbigmips_freebsd_vec)
- tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
- bfd_elf32_tradlittlemips_vec | bfd_elf32_tradlittlemips_freebsd_vec)
- tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
- bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
- bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;;
- bfd_elf32_v850_rh850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;;
- bfd_elf32_vax_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;;
- bfd_elf32_xstormy16_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;;
- bfd_elf32_xc16x_vec) tb="$tb elf32-xc16x.lo elf32.lo $elf" ;;
- bfd_elf32_xgate_vec) tb="$tb elf32-xgate.lo elf32.lo $elf" ;;
- bfd_elf32_xtensa_le_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
- bfd_elf32_xtensa_be_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
- bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_bigaarch64_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf32_bigaarch64_vec) tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;;
- bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf64_hppa_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_ia64_vms_vec) tb="$tb elf64-ia64-vms.lo elf64-ia64.lo elfxx-ia64.lo elf64.lo vms-lib.lo vms-misc.lo $elf"; target_size=64 ;;
- bfd_elf64_littleaarch64_vec)tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf32_littleaarch64_vec)tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;;
- bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_powerpc_freebsd_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_sh64lin_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_sh64blin_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_sparc_freebsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_sparc_sol2_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_tilegx_be_vec) tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;;
- bfd_elf64_tilegx_le_vec) tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;;
- bfd_elf64_tradbigmips_vec | bfd_elf64_tradbigmips_freebsd_vec)
- tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf64_tradlittlemips_vec | bfd_elf64_tradlittlemips_freebsd_vec)
- tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf64_x86_64_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_x86_64_nacl_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_x86_64_sol2_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf32_x86_64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
- bfd_elf32_x86_64_nacl_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
- bfd_elf64_l1om_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_l1om_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_k1om_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_k1om_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;;
- bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
- bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
- bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
- bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
- cris_aout_vec) tb="$tb aout-cris.lo" ;;
- demo_64_vec) tb="$tb demo64.lo aout64.lo"; target_size=64 ;;
- ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
- ecoff_biglittle_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
- ecoff_little_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
- ecoffalpha_little_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"; target_size=64 ;;
- go32coff_vec) tb="$tb coff-go32.lo cofflink.lo" ;;
- go32stubbedcoff_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;;
- h8300coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;;
- h8500coff_vec) tb="$tb coff-h8500.lo reloc16.lo" ;;
- host_aout_vec) tb="$tb host-aout.lo aout32.lo" ;;
- hp300bsd_vec) tb="$tb hp300bsd.lo aout32.lo" ;;
- hp300hpux_vec) tb="$tb hp300hpux.lo aout32.lo" ;;
- i386aout_vec) tb="$tb i386aout.lo aout32.lo" ;;
- i386bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;;
- i386coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;;
- x86_64coff_vec) tb="$tb coff-x86_64.lo cofflink.lo"; target_size=64 ;;
- i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;;
- i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;;
- i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;;
- i386lynx_aout_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
- i386lynx_coff_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
- i386mach3_vec) tb="$tb i386mach3.lo aout32.lo" ;;
- i386msdos_vec) tb="$tb i386msdos.lo" ;;
- i386netbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;;
- i386os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;;
- i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
- i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
- x86_64pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
- x86_64pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
- i860coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;;
- icoff_big_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
- icoff_little_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
- ieee_vec) tb="$tb ieee.lo" ;;
- m68k4knetbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;;
- m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
- m68kcoff_vec) tb="$tb coff-m68k.lo cofflink.lo" ;;
- m68kcoffun_vec) tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;;
- m68klinux_vec) tb="$tb m68klinux.lo aout32.lo" ;;
- m68knetbsd_vec) tb="$tb m68knetbsd.lo aout32.lo" ;;
- m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;;
- m88kbcs_vec) tb="$tb coff-m88k.lo" ;;
- m88kmach3_vec) tb="$tb m88kmach3.lo aout32.lo" ;;
- m88kopenbsd_vec) tb="$tb m88kopenbsd.lo aout32.lo" ;;
- mach_o_be_vec) tb="$tb mach-o.lo" ;;
- mach_o_le_vec) tb="$tb mach-o.lo" ;;
- mach_o_fat_vec) tb="$tb mach-o.lo" ;;
- mach_o_i386_vec) tb="$tb mach-o-i386.lo" ;;
- mach_o_x86_64_vec) tb="$tb mach-o-x86-64.lo" ;;
- mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
- mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
- mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
- mcore_pei_little_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
- mipslpe_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;;
- mipslpei_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;;
- newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;;
- nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;;
- nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
- nlm32_powerpc_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
- nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
- or32coff_big_vec) tb="$tb coff-or32.lo cofflink.lo" ;;
- pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
- pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
- pef_vec) tb="$tb pef.lo" ;;
- pef_xlib_vec) tb="$tb pef.lo" ;;
- pdp11_aout_vec) tb="$tb pdp11.lo" ;;
- plugin_vec) tb="$tb plugin.lo" ;;
- pmac_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
- ppcboot_vec) tb="$tb ppcboot.lo" ;;
- riscix_vec) tb="$tb aout32.lo riscix.lo" ;;
- rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
- rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
- shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
- shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
- shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
- shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
- shlpe_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
- shlpei_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
- som_vec) tb="$tb som.lo" ;;
- sparccoff_vec) tb="$tb coff-sparc.lo" ;;
- sparcle_aout_vec) tb="$tb aout-sparcle.lo aout32.lo" ;;
- sparclinux_vec) tb="$tb sparclinux.lo aout32.lo" ;;
- sparclynx_aout_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
- sparclynx_coff_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;;
- sparcnetbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;;
- sunos_big_vec) tb="$tb sunos.lo aout32.lo" ;;
- sym_vec) tb="$tb xsym.lo" ;;
- tic30_aout_vec) tb="$tb aout-tic30.lo" ;;
- tic30_coff_vec) tb="$tb coff-tic30.lo" ;;
- tic4x_coff0_vec) tb="$tb coff-tic4x.lo" ;;
- tic4x_coff0_beh_vec) tb="$tb coff-tic4x.lo" ;;
- tic4x_coff1_vec) tb="$tb coff-tic4x.lo" ;;
- tic4x_coff1_beh_vec) tb="$tb coff-tic4x.lo" ;;
- tic4x_coff2_vec) tb="$tb coff-tic4x.lo" ;;
- tic4x_coff2_beh_vec) tb="$tb coff-tic4x.lo" ;;
- tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;;
- tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;;
- tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;;
- tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;;
- tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;;
- tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;;
- tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;;
- vaxnetbsd_vec) tb="$tb vaxnetbsd.lo aout32.lo" ;;
- vax1knetbsd_vec) tb="$tb vax1knetbsd.lo aout32.lo" ;;
- vaxbsd_vec) tb="$tb vaxbsd.lo aout32.lo" ;;
- versados_vec) tb="$tb versados.lo" ;;
- vms_alpha_vec) tb="$tb vms-alpha.lo vms-misc.lo vms-lib.lo"; target_size=64 ;;
- vms_lib_txt_vec) tb="$tb vms-lib.lo vms-misc.lo" ;;
- w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;;
- we32kcoff_vec) tb="$tb coff-we32k.lo" ;;
- z80coff_vec) tb="$tb coff-z80.lo reloc16.lo" ;;
- z8kcoff_vec) tb="$tb coff-z8k.lo reloc16.lo cofflink.lo" ;;
+ sh64_elf32_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+ sh64_elf32_le_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+ sh64_elf32_linux_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+ sh64_elf32_linux_be_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+ sh64_elf32_nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
+ sh64_elf32_nbsd_le_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
+ sh64_elf64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+ sh64_elf64_le_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+ sh64_elf64_linux_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+ sh64_elf64_linux_be_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+ sh64_elf64_nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+ sh64_elf64_nbsd_le_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+ sh_coff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ sh_coff_le_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ sh_coff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ sh_coff_small_le_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ sh_elf32_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
+ sh_elf32_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
+ sh_elf32_fdpic_be_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+ sh_elf32_fdpic_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+ sh_elf32_linux_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+ sh_elf32_linux_be_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+ sh_elf32_nbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+ sh_elf32_nbsd_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+ sh_elf32_symbian_le_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
+ sh_elf32_vxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
+ sh_elf32_vxworks_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
+ sh_pe_le_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
+ sh_pei_le_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
+ sparc_aout_le_vec) tb="$tb aout-sparcle.lo aout32.lo" ;;
+ sparc_aout_linux_vec) tb="$tb sparclinux.lo aout32.lo" ;;
+ sparc_aout_lynx_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
+ sparc_aout_nbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;;
+ sparc_aout_sunos_be_vec) tb="$tb sunos.lo aout32.lo" ;;
+ sparc_coff_vec) tb="$tb coff-sparc.lo" ;;
+ sparc_coff_lynx_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;;
+ sparc_elf32_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ sparc_elf32_sol2_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ sparc_elf32_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ sparc_elf64_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
+ sparc_elf64_fbsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
+ sparc_elf64_sol2_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
+ sparc_nlm32_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
+ spu_elf32_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;;
+ sym_vec) tb="$tb xsym.lo" ;;
+ tic30_aout_vec) tb="$tb aout-tic30.lo" ;;
+ tic30_coff_vec) tb="$tb coff-tic30.lo" ;;
+ tic4x_coff0_vec) tb="$tb coff-tic4x.lo" ;;
+ tic4x_coff0_beh_vec) tb="$tb coff-tic4x.lo" ;;
+ tic4x_coff1_vec) tb="$tb coff-tic4x.lo" ;;
+ tic4x_coff1_beh_vec) tb="$tb coff-tic4x.lo" ;;
+ tic4x_coff2_vec) tb="$tb coff-tic4x.lo" ;;
+ tic4x_coff2_beh_vec) tb="$tb coff-tic4x.lo" ;;
+ tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;;
+ tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;;
+ tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;;
+ tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;;
+ tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;;
+ tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;;
+ tic6x_elf32_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
+ tic6x_elf32_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
+ tic6x_elf32_c6000_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
+ tic6x_elf32_c6000_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
+ tic6x_elf32_linux_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
+ tic6x_elf32_linux_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
+ tic80_coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;;
+ tilegx_elf32_be_vec) tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;;
+ tilegx_elf32_le_vec) tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;;
+ tilegx_elf64_be_vec) tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;;
+ tilegx_elf64_le_vec) tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;;
+ tilepro_elf32_vec) tb="$tb elf32-tilepro.lo elf32.lo $elf" ;;
+ v800_elf32_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;;
+ v850_elf32_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;;
+ vax_aout_1knbsd_vec) tb="$tb vax1knetbsd.lo aout32.lo" ;;
+ vax_aout_bsd_vec) tb="$tb vaxbsd.lo aout32.lo" ;;
+ vax_aout_nbsd_vec) tb="$tb vaxnetbsd.lo aout32.lo" ;;
+ vax_elf32_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;;
+ w65_coff_vec) tb="$tb coff-w65.lo reloc16.lo" ;;
+ we32k_coff_vec) tb="$tb coff-we32k.lo" ;;
+ x86_64_coff_vec) tb="$tb coff-x86_64.lo cofflink.lo"; target_size=64 ;;
+ x86_64_elf32_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
+ x86_64_elf32_nacl_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
+ x86_64_elf64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ x86_64_elf64_fbsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ x86_64_elf64_nacl_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ x86_64_elf64_sol2_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ x86_64_mach_o_vec) tb="$tb mach-o-x86-64.lo" ;;
+ x86_64_pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
+ x86_64_pe_be_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
+ x86_64_pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
+ xc16x_elf32_vec) tb="$tb elf32-xc16x.lo elf32.lo $elf" ;;
+ xgate_elf32_vec) tb="$tb elf32-xgate.lo elf32.lo $elf" ;;
+ xstormy16_elf32_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;;
+ xtensa_elf32_be_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
+ xtensa_elf32_le_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
+ z80_coff_vec) tb="$tb coff-z80.lo reloc16.lo" ;;
+ z8k_coff_vec) tb="$tb coff-z8k.lo reloc16.lo cofflink.lo" ;;
# These appear out of order in targets.c
- srec_vec) tb="$tb srec.lo" ;;
- symbolsrec_vec) tb="$tb srec.lo" ;;
- tekhex_vec) tb="$tb tekhex.lo" ;;
- cisco_core_big_vec) tb="$tb cisco-core.lo" ;;
- cisco_core_little_vec) tb="$tb cisco-core.lo" ;;
+ srec_vec) tb="$tb srec.lo" ;;
+ symbolsrec_vec) tb="$tb srec.lo" ;;
+ tekhex_vec) tb="$tb tekhex.lo" ;;
+ core_cisco_be_vec) tb="$tb cisco-core.lo" ;;
+ core_cisco_le_vec) tb="$tb cisco-core.lo" ;;
- "") ;;
+ "") ;;
*) as_fn_error "*** unknown target vector $vec" "$LINENO" 5 ;;
esac
@@ -16481,7 +16567,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by bfd $as_me 2.24.51, which was
+This file was extended by bfd $as_me 2.24.90, which was
generated by GNU Autoconf 2.64. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16545,7 +16631,7 @@ Report bugs to the package provider."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-bfd config.status 2.24.51
+bfd config.status 2.24.90
configured by $0, generated by GNU Autoconf 2.64,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/binutils-2.25/bfd/configure.in b/binutils-2.25/bfd/configure.ac
index 748c2935..ba98e393 100644
--- a/binutils-2.25/bfd/configure.in
+++ b/binutils-2.25/bfd/configure.ac
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
dnl
-dnl Copyright 2012-2013 Free Software Foundation
+dnl Copyright (C) 2012-2014 Free Software Foundation, Inc.
dnl
dnl This file is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@@ -18,7 +18,8 @@ dnl <http://www.gnu.org/licenses/>.
dnl
AC_PREREQ(2.59)
-AC_INIT([bfd], [2.24.51])
+m4_include([version.m4])
+AC_INIT([bfd], BFD_VERSION)
AC_CONFIG_SRCDIR([libbfd.c])
AC_CANONICAL_TARGET
@@ -47,10 +48,6 @@ ACX_LARGEFILE
AM_CONDITIONAL(PLUGINS, test "$plugins" = "yes")
if test "$plugins" = "yes"; then
- if test "$enable_dlopen" != "yes" ; then
- AC_MSG_ERROR([
- Building BFD with plugin support requires a host that supports -ldl.])
- fi
enable_targets="$enable_targets plugin"
fi
@@ -85,7 +82,7 @@ AC_ARG_ENABLE(secureplt,
yes) use_secureplt=true ;;
no) use_secureplt=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for secureplt option) ;;
-esac],[use_secureplt=false])dnl
+esac],[use_secureplt=true])dnl
if test $use_secureplt = true; then
AC_DEFINE(USE_SECUREPLT, 1,
[Define if we should default to creating read-only plt entries])
@@ -210,14 +207,12 @@ AC_SUBST(BFD_HOSTPTR_T)
BFD_CC_FOR_BUILD
-AC_CHECK_HEADERS(alloca.h stddef.h string.h strings.h stdlib.h time.h unistd.h)
+AC_CHECK_HEADERS(alloca.h stddef.h string.h strings.h stdlib.h time.h unistd.h wchar.h)
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h sys/stat.h sys/resource.h)
GCC_HEADER_STDINT(bfd_stdint.h)
AC_HEADER_TIME
AC_HEADER_DIRENT
-AC_CHECK_HEADERS(windows.h dlfcn.h)
-
ACX_HEADER_STRING
AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid fileno)
AC_CHECK_FUNCS(strtoull getrlimit)
@@ -239,6 +234,7 @@ AC_CHECK_DECLS(stpcpy)
AC_CHECK_DECLS(strstr)
AC_CHECK_DECLS(snprintf)
AC_CHECK_DECLS(vsnprintf)
+AC_CHECK_DECLS(strnlen)
# Link in zlib if we can. This allows us to read compressed debug sections.
# This is used only by compress.c.
@@ -427,7 +423,7 @@ changequote([,])dnl
COREFILE=netbsd-core.lo
;;
rs6000-*-lynx*)
- COREFILE=lynx-core.lo
+ COREFILE=lynx-core.lo
;;
changequote(,)dnl
rs6000-*-aix[5-9].* | powerpc-*-aix[5-9].*)
@@ -468,7 +464,7 @@ changequote([,])dnl
TRAD_HEADER='"hosts/tahoe.h"'
;;
vax-*-netbsd* | vax-*-openbsd*)
- COREFILE=netbsd-core.lo
+ COREFILE=netbsd-core.lo
;;
vax-*-ultrix2*)
COREFILE=trad-core.lo
@@ -577,6 +573,11 @@ changequote([,])dnl
SHARED_LDFLAGS="-no-undefined"
SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32"
;;
+
+ # Hack to build or1k-src on OSX
+ or1k*-*-darwin*)
+ SHARED_LIBADD="-L`pwd`/../libiberty/pic -L`pwd`/../intl -liberty -lintl"
+ ;;
esac
if test -n "$SHARED_LIBADD"; then
@@ -685,350 +686,347 @@ do
# This list is alphabetized to make it easy to compare
# with the two vector lists in targets.c. For the same reason,
# use one entry per line, even though this leads to long lines.
- a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
- aix5coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
- aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;;
- aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;;
- aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;;
- apollocoff_vec) tb="$tb coff-apollo.lo" ;;
- arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
- arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
- arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
- arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
- arm_wince_pe_big_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;;
- arm_wince_pe_little_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;;
- arm_wince_pei_big_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;;
- arm_wince_pei_little_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;;
- armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
- armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
- armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;;
- armpe_big_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
- armpe_little_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
- armpei_big_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
- armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
- b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;;
- b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;;
- bfd_pei_ia64_vec) tb="$tb pei-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
- bfd_elf32_am33lin_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
- bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;;
- bfd_elf32_bfin_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
- bfd_elf32_bfinfdpic_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
- bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
- bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
- bfd_elf32_bigarm_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_bigarm_nacl_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_bigarm_symbian_vec)
- tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_bigarm_vxworks_vec)
- tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
- bfd_elf32_bigmips_vxworks_vec)
- tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
- bfd_elf32_bigmoxie_vec) tb="$tb elf32-moxie.lo elf32.lo $elf" ;;
- bfd_elf32_bignios2_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;;
- bfd_elf32_cr16_vec) tb="$tb elf32-cr16.lo elf32.lo $elf" ;;
- bfd_elf32_cr16c_vec) tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
- bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
- bfd_elf32_crx_vec) tb="$tb elf32-crx.lo elf32.lo $elf" ;;
- bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
- bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
- bfd_elf32_dlx_big_vec) tb="$tb elf32-dlx.lo elf32.lo $elf" ;;
- bfd_elf32_epiphany_vec) tb="$tb elf32-epiphany.lo elf32.lo $elf" ;;
- bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
- bfd_elf32_frv_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;;
- bfd_elf32_frvfdpic_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;;
- bfd_elf32_h8300_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;;
- bfd_elf32_hppa_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
- bfd_elf32_hppa_nbsd_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
- bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
- bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
- bfd_elf32_i386_sol2_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_i386_nacl_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_i386_vxworks_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
- bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
- bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;;
- bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elfxx-ia64.lo elf32.lo $elf" ;;
- bfd_elf32_ia64_hpux_big_vec) tb="$tb elf32-ia64.lo elfxx-ia64.lo elf32.lo $elf";;
- bfd_elf32_ip2k_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;;
- bfd_elf32_iq2000_vec) tb="$tb elf32-iq2000.lo elf32.lo $elf" ;;
- bfd_elf32_lm32_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
- bfd_elf32_lm32fdpic_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
- bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
- bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
- bfd_elf32_littlearm_symbian_vec)
- tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_littlearm_vxworks_vec)
- tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_littlearm_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_littlearm_nacl_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
- bfd_elf32_littlemips_vxworks_vec)
- tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
- bfd_elf32_littlemoxie_vec) tb="$tb elf32-moxie.lo elf32.lo $elf" ;;
- bfd_elf32_littlenios2_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;;
- bfd_elf32_m32c_vec) tb="$tb elf32-m32c.lo elf32.lo $elf" ;;
- bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
- bfd_elf32_m32rle_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
- bfd_elf32_m32rlin_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
- bfd_elf32_m32rlelin_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
- bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
- bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
- bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
- bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
- bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
- bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
- bfd_elf32_mep_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;;
- bfd_elf32_mep_little_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;;
- bfd_elf32_metag_vec) tb="$tb elf32-metag.lo elf32.lo $elf" ;;
- bfd_elf32_microblazeel_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;;
- bfd_elf32_microblaze_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;;
- bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;;
- bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
- bfd_elf32_mt_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;;
- bfd_elf32_msp430_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
- bfd_elf32_msp430_ti_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
- bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf32_ntradbigmips_vec | bfd_elf32_ntradbigmips_freebsd_vec)
- tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf32_ntradlittlemips_vec | bfd_elf32_ntradlittlemips_freebsd_vec)
- tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf32_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;;
- bfd_elf32_or32_big_vec) tb="$tb elf32-or32.lo elf32.lo $elf" ;;
- bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";;
- bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";;
- bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_powerpc_freebsd_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_powerpc_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_rl78_vec) tb="$tb elf32-rl78.lo $elf" ;;
- bfd_elf32_rx_le_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;;
- bfd_elf32_rx_be_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;;
- bfd_elf32_rx_be_ns_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;;
- bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;;
- bfd_elf32_bigscore_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64;;
- bfd_elf32_littlescore_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64;;
+ aarch64_elf32_be_vec) tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;;
+ aarch64_elf32_le_vec) tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;;
+ aarch64_elf64_be_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
+ aarch64_elf64_le_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
+ alpha_ecoff_le_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"; target_size=64 ;;
+ alpha_elf64_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
+ alpha_elf64_fbsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
+ alpha_nlm32_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;;
+ alpha_vms_vec) tb="$tb vms-alpha.lo vms-misc.lo vms-lib.lo"; target_size=64 ;;
+ alpha_vms_lib_txt_vec) tb="$tb vms-lib.lo vms-misc.lo" ;;
+ am33_elf32_linux_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
+ aout0_be_vec) tb="$tb aout0.lo aout32.lo" ;;
+ aout64_vec) tb="$tb demo64.lo aout64.lo"; target_size=64 ;;
+ aout_vec) tb="$tb host-aout.lo aout32.lo" ;;
+ aout_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
+ arc_elf32_be_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
+ arc_elf32_le_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
+ arm_aout_be_vec) tb="$tb aout-arm.lo aout32.lo" ;;
+ arm_aout_le_vec) tb="$tb aout-arm.lo aout32.lo" ;;
+ arm_aout_nbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;;
+ arm_aout_riscix_vec) tb="$tb aout32.lo riscix.lo" ;;
+ arm_coff_be_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
+ arm_coff_le_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
+ arm_elf32_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_elf32_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_elf32_nacl_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_elf32_nacl_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_elf32_symbian_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_elf32_symbian_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_elf32_vxworks_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_elf32_vxworks_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;;
+ arm_pe_be_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pe_le_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pe_epoc_be_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pe_epoc_le_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pe_wince_be_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pe_wince_le_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pei_be_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pei_le_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pei_epoc_be_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pei_epoc_le_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pei_wince_be_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;;
+ arm_pei_wince_le_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;;
+ avr_elf32_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;;
+ bfin_elf32_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
+ bfin_elf32_fdpic_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
+ bout_be_vec) tb="$tb bout.lo aout32.lo" ;;
+ bout_le_vec) tb="$tb bout.lo aout32.lo" ;;
+ cr16_elf32_vec) tb="$tb elf32-cr16.lo elf32.lo $elf" ;;
+ cr16c_elf32_vec) tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
+ cris_aout_vec) tb="$tb aout-cris.lo" ;;
+ cris_elf32_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
+ cris_elf32_us_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
+ crx_elf32_vec) tb="$tb elf32-crx.lo elf32.lo $elf" ;;
+ d10v_elf32_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
+ d30v_elf32_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
+ dlx_elf32_be_vec) tb="$tb elf32-dlx.lo elf32.lo $elf" ;;
+ elf32_be_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
+ elf32_le_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
+ elf64_be_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
+ elf64_le_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
+ epiphany_elf32_vec) tb="$tb elf32-epiphany.lo elf32.lo $elf" ;;
+ fr30_elf32_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
+ frv_elf32_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;;
+ frv_elf32_fdpic_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;;
+ h8300_coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;;
+ h8300_elf32_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;;
+ h8500_coff_vec) tb="$tb coff-h8500.lo reloc16.lo" ;;
+ hppa_elf32_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
+ hppa_elf32_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
+ hppa_elf32_nbsd_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
+ hppa_elf64_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
+ hppa_elf64_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
+ hppa_som_vec) tb="$tb som.lo" ;;
+ i370_elf32_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
+ i386_aout_vec) tb="$tb i386aout.lo aout32.lo" ;;
+ i386_aout_bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;;
+ i386_aout_dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;;
+ i386_aout_fbsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;;
+ i386_aout_linux_vec) tb="$tb i386linux.lo aout32.lo" ;;
+ i386_aout_lynx_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
+ i386_aout_mach3_vec) tb="$tb i386mach3.lo aout32.lo" ;;
+ i386_aout_nbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;;
+ i386_aout_os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;;
+ i386_coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;;
+ i386_coff_go32_vec) tb="$tb coff-go32.lo cofflink.lo" ;;
+ i386_coff_go32stubbed_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;;
+ i386_coff_lynx_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
+ i386_elf32_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
+ i386_elf32_fbsd_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
+ i386_elf32_nacl_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
+ i386_elf32_sol2_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
+ i386_elf32_vxworks_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
+ i386_mach_o_vec) tb="$tb mach-o-i386.lo" ;;
+ i386_msdos_vec) tb="$tb i386msdos.lo" ;;
+ i386_nlm32_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
+ i386_pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
+ i386_pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
+ i860_coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;;
+ i860_elf32_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
+ i860_elf32_le_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
+ i960_elf32_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;;
+ ia64_elf32_be_vec) tb="$tb elf32-ia64.lo elfxx-ia64.lo elf32.lo $elf" ;;
+ ia64_elf32_hpux_be_vec) tb="$tb elf32-ia64.lo elfxx-ia64.lo elf32.lo $elf" ;;
+ ia64_elf64_be_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
+ ia64_elf64_le_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
+ ia64_elf64_hpux_be_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
+ ia64_elf64_vms_vec) tb="$tb elf64-ia64-vms.lo elf64-ia64.lo elfxx-ia64.lo elf64.lo vms-lib.lo vms-misc.lo $elf"; target_size=64 ;;
+ ia64_pei_vec) tb="$tb pei-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
+ icoff_be_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
+ icoff_le_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
+ ieee_vec) tb="$tb ieee.lo" ;;
+ ip2k_elf32_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;;
+ iq2000_elf32_vec) tb="$tb elf32-iq2000.lo elf32.lo $elf" ;;
+ k1om_elf64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ k1om_elf64_fbsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ l1om_elf64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ l1om_elf64_fbsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ lm32_elf32_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
+ lm32_elf32_fdpic_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;;
+ m32c_elf32_vec) tb="$tb elf32-m32c.lo elf32.lo $elf" ;;
+ m32r_elf32_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
+ m32r_elf32_le_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
+ m32r_elf32_linux_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
+ m32r_elf32_linux_le_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
+ m68hc11_elf32_vec) tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
+ m68hc12_elf32_vec) tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;;
+ m68k_aout_4knbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;;
+ m68k_aout_hp300bsd_vec) tb="$tb hp300bsd.lo aout32.lo" ;;
+ m68k_aout_hp300hpux_vec) tb="$tb hp300hpux.lo aout32.lo" ;;
+ m68k_aout_linux_vec) tb="$tb m68klinux.lo aout32.lo" ;;
+ m68k_aout_nbsd_vec) tb="$tb m68knetbsd.lo aout32.lo" ;;
+ m68k_aout_newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;;
+ m68k_coff_vec) tb="$tb coff-m68k.lo cofflink.lo" ;;
+ m68k_coff_apollo_vec) tb="$tb coff-apollo.lo" ;;
+ m68k_coff_aux_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
+ m68k_coff_sysv_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;;
+ m68k_coff_un_vec) tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;;
+ m68k_elf32_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
+ m68k_versados_vec) tb="$tb versados.lo" ;;
+ m88k_aout_mach3_vec) tb="$tb m88kmach3.lo aout32.lo" ;;
+ m88k_aout_obsd_vec) tb="$tb m88kopenbsd.lo aout32.lo" ;;
+ m88k_coff_bcs_vec) tb="$tb coff-m88k.lo" ;;
+ m88k_elf32_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
+ mach_o_be_vec) tb="$tb mach-o.lo" ;;
+ mach_o_le_vec) tb="$tb mach-o.lo" ;;
+ mach_o_fat_vec) tb="$tb mach-o.lo" ;;
+ mcore_elf32_be_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
+ mcore_elf32_le_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
+ mcore_pe_be_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
+ mcore_pe_le_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
+ mcore_pei_be_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
+ mcore_pei_le_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
+ mep_elf32_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;;
+ mep_elf32_le_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;;
+ metag_elf32_vec) tb="$tb elf32-metag.lo elf32.lo $elf" ;;
+ microblaze_elf32_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;;
+ microblaze_elf32_le_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;;
+ mips_ecoff_be_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
+ mips_ecoff_le_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
+ mips_ecoff_bele_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
+ mips_elf32_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf32_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf32_n_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf32_n_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf32_ntrad_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf32_ntrad_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf32_ntradfbsd_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf32_ntradfbsd_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf32_trad_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf32_trad_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf32_tradfbsd_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf32_tradfbsd_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf32_vxworks_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf32_vxworks_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ mips_elf64_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf64_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf64_trad_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf64_trad_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf64_tradfbsd_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_elf64_tradfbsd_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ mips_pe_le_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;;
+ mips_pei_le_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;;
+ mmix_elf64_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
+ mmix_mmo_vec) tb="$tb mmo.lo" target_size=64 ;;
+ mn10200_elf32_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;;
+ mn10300_elf32_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
+ moxie_elf32_be_vec) tb="$tb elf32-moxie.lo elf32.lo $elf" ;;
+ moxie_elf32_le_vec) tb="$tb elf32-moxie.lo elf32.lo $elf" ;;
+ msp430_elf32_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
+ msp430_elf32_ti_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
+ mt_elf32_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;;
+ nds32_elf32_be_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;;
+ nds32_elf32_le_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;;
+ nds32_elf32_linux_be_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;;
+ nds32_elf32_linux_le_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;;
+ nios2_elf32_be_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;;
+ nios2_elf32_le_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;;
+ ns32k_aout_pc532mach_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
+ ns32k_aout_pc532nbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
+ or1k_elf32_vec) tb="$tb elf32-or1k.lo elf32.lo $elf" ;;
+ pdp11_aout_vec) tb="$tb pdp11.lo" ;;
+ pef_vec) tb="$tb pef.lo" ;;
+ pef_xlib_vec) tb="$tb pef.lo" ;;
+ pj_elf32_vec) tb="$tb elf32-pj.lo elf32.lo $elf" ;;
+ pj_elf32_le_vec) tb="$tb elf32-pj.lo elf32.lo $elf" ;;
+ plugin_vec) tb="$tb plugin.lo" ;;
+ powerpc_boot_vec) tb="$tb ppcboot.lo" ;;
+ powerpc_elf32_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ powerpc_elf32_le_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ powerpc_elf32_fbsd_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ powerpc_elf32_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ powerpc_elf64_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
+ powerpc_elf64_le_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
+ powerpc_elf64_fbsd_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
+ powerpc_nlm32_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
+ powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
+ powerpc_pe_le_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
+ powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
+ powerpc_pei_le_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
+ powerpc_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
+ rl78_elf32_vec) tb="$tb elf32-rl78.lo elf32.lo $elf" ;;
+ rs6000_xcoff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
+ rs6000_xcoff64_aix_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
+ rs6000_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
+ rx_elf32_be_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;;
+ rx_elf32_be_ns_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;;
+ rx_elf32_le_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;;
+ s390_elf32_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;;
+ s390_elf64_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
+ score_elf32_be_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64 ;;
+ score_elf32_le_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64 ;;
# FIXME: We include cofflink.lo not because it's needed for
- # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
+ # sh64_elf32[_le]_vec, but because we include sh_elf32[_le]_vec
# which needs it but does not list it. Should be fixed in right place.
- bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
- bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
- bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
- bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
- bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
- bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
- bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
- bfd_elf32_shbfd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_shfd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
- bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
- bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_shlvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
- bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_shvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
- bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_sparc_sol2_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
- bfd_elf32_spu_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;;
- bfd_elf32_tic6x_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
- bfd_elf32_tic6x_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
- bfd_elf32_tic6x_linux_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
- bfd_elf32_tic6x_linux_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
- bfd_elf32_tic6x_elf_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
- bfd_elf32_tic6x_elf_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
- bfd_elf32_tilegx_be_vec) tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;;
- bfd_elf32_tilegx_le_vec) tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;;
- bfd_elf32_tilepro_vec) tb="$tb elf32-tilepro.lo elf32.lo $elf" ;;
- bfd_elf32_tradbigmips_vec | bfd_elf32_tradbigmips_freebsd_vec)
- tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
- bfd_elf32_tradlittlemips_vec | bfd_elf32_tradlittlemips_freebsd_vec)
- tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
- bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
- bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;;
- bfd_elf32_v850_rh850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;;
- bfd_elf32_vax_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;;
- bfd_elf32_xstormy16_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;;
- bfd_elf32_xc16x_vec) tb="$tb elf32-xc16x.lo elf32.lo $elf" ;;
- bfd_elf32_xgate_vec) tb="$tb elf32-xgate.lo elf32.lo $elf" ;;
- bfd_elf32_xtensa_le_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
- bfd_elf32_xtensa_be_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
- bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_bigaarch64_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf32_bigaarch64_vec) tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;;
- bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf64_hppa_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_ia64_vms_vec) tb="$tb elf64-ia64-vms.lo elf64-ia64.lo elfxx-ia64.lo elf64.lo vms-lib.lo vms-misc.lo $elf"; target_size=64 ;;
- bfd_elf64_littleaarch64_vec)tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf32_littleaarch64_vec)tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;;
- bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_powerpc_freebsd_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_sh64lin_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_sh64blin_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_sparc_freebsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_sparc_sol2_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_tilegx_be_vec) tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;;
- bfd_elf64_tilegx_le_vec) tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;;
- bfd_elf64_tradbigmips_vec | bfd_elf64_tradbigmips_freebsd_vec)
- tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf64_tradlittlemips_vec | bfd_elf64_tradlittlemips_freebsd_vec)
- tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
- bfd_elf64_x86_64_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_x86_64_nacl_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_x86_64_sol2_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf32_x86_64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
- bfd_elf32_x86_64_nacl_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
- bfd_elf64_l1om_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_l1om_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_k1om_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_k1om_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
- bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;;
- bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
- bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
- bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
- bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
- cris_aout_vec) tb="$tb aout-cris.lo" ;;
- demo_64_vec) tb="$tb demo64.lo aout64.lo"; target_size=64 ;;
- ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
- ecoff_biglittle_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
- ecoff_little_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
- ecoffalpha_little_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"; target_size=64 ;;
- go32coff_vec) tb="$tb coff-go32.lo cofflink.lo" ;;
- go32stubbedcoff_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;;
- h8300coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;;
- h8500coff_vec) tb="$tb coff-h8500.lo reloc16.lo" ;;
- host_aout_vec) tb="$tb host-aout.lo aout32.lo" ;;
- hp300bsd_vec) tb="$tb hp300bsd.lo aout32.lo" ;;
- hp300hpux_vec) tb="$tb hp300hpux.lo aout32.lo" ;;
- i386aout_vec) tb="$tb i386aout.lo aout32.lo" ;;
- i386bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;;
- i386coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;;
- x86_64coff_vec) tb="$tb coff-x86_64.lo cofflink.lo"; target_size=64 ;;
- i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;;
- i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;;
- i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;;
- i386lynx_aout_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
- i386lynx_coff_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
- i386mach3_vec) tb="$tb i386mach3.lo aout32.lo" ;;
- i386msdos_vec) tb="$tb i386msdos.lo" ;;
- i386netbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;;
- i386os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;;
- i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
- i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
- x86_64pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
- x86_64pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
- i860coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;;
- icoff_big_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
- icoff_little_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
- ieee_vec) tb="$tb ieee.lo" ;;
- m68k4knetbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;;
- m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
- m68kcoff_vec) tb="$tb coff-m68k.lo cofflink.lo" ;;
- m68kcoffun_vec) tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;;
- m68klinux_vec) tb="$tb m68klinux.lo aout32.lo" ;;
- m68knetbsd_vec) tb="$tb m68knetbsd.lo aout32.lo" ;;
- m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;;
- m88kbcs_vec) tb="$tb coff-m88k.lo" ;;
- m88kmach3_vec) tb="$tb m88kmach3.lo aout32.lo" ;;
- m88kopenbsd_vec) tb="$tb m88kopenbsd.lo aout32.lo" ;;
- mach_o_be_vec) tb="$tb mach-o.lo" ;;
- mach_o_le_vec) tb="$tb mach-o.lo" ;;
- mach_o_fat_vec) tb="$tb mach-o.lo" ;;
- mach_o_i386_vec) tb="$tb mach-o-i386.lo" ;;
- mach_o_x86_64_vec) tb="$tb mach-o-x86-64.lo" ;;
- mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
- mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
- mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
- mcore_pei_little_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
- mipslpe_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;;
- mipslpei_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;;
- newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;;
- nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;;
- nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
- nlm32_powerpc_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
- nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
- or32coff_big_vec) tb="$tb coff-or32.lo cofflink.lo" ;;
- pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
- pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
- pef_vec) tb="$tb pef.lo" ;;
- pef_xlib_vec) tb="$tb pef.lo" ;;
- pdp11_aout_vec) tb="$tb pdp11.lo" ;;
- plugin_vec) tb="$tb plugin.lo" ;;
- pmac_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
- ppcboot_vec) tb="$tb ppcboot.lo" ;;
- riscix_vec) tb="$tb aout32.lo riscix.lo" ;;
- rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
- rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
- shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
- shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
- shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
- shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
- shlpe_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
- shlpei_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
- som_vec) tb="$tb som.lo" ;;
- sparccoff_vec) tb="$tb coff-sparc.lo" ;;
- sparcle_aout_vec) tb="$tb aout-sparcle.lo aout32.lo" ;;
- sparclinux_vec) tb="$tb sparclinux.lo aout32.lo" ;;
- sparclynx_aout_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
- sparclynx_coff_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;;
- sparcnetbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;;
- sunos_big_vec) tb="$tb sunos.lo aout32.lo" ;;
- sym_vec) tb="$tb xsym.lo" ;;
- tic30_aout_vec) tb="$tb aout-tic30.lo" ;;
- tic30_coff_vec) tb="$tb coff-tic30.lo" ;;
- tic4x_coff0_vec) tb="$tb coff-tic4x.lo" ;;
- tic4x_coff0_beh_vec) tb="$tb coff-tic4x.lo" ;;
- tic4x_coff1_vec) tb="$tb coff-tic4x.lo" ;;
- tic4x_coff1_beh_vec) tb="$tb coff-tic4x.lo" ;;
- tic4x_coff2_vec) tb="$tb coff-tic4x.lo" ;;
- tic4x_coff2_beh_vec) tb="$tb coff-tic4x.lo" ;;
- tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;;
- tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;;
- tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;;
- tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;;
- tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;;
- tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;;
- tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;;
- vaxnetbsd_vec) tb="$tb vaxnetbsd.lo aout32.lo" ;;
- vax1knetbsd_vec) tb="$tb vax1knetbsd.lo aout32.lo" ;;
- vaxbsd_vec) tb="$tb vaxbsd.lo aout32.lo" ;;
- versados_vec) tb="$tb versados.lo" ;;
- vms_alpha_vec) tb="$tb vms-alpha.lo vms-misc.lo vms-lib.lo"; target_size=64 ;;
- vms_lib_txt_vec) tb="$tb vms-lib.lo vms-misc.lo" ;;
- w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;;
- we32kcoff_vec) tb="$tb coff-we32k.lo" ;;
- z80coff_vec) tb="$tb coff-z80.lo reloc16.lo" ;;
- z8kcoff_vec) tb="$tb coff-z8k.lo reloc16.lo cofflink.lo" ;;
+ sh64_elf32_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+ sh64_elf32_le_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+ sh64_elf32_linux_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+ sh64_elf32_linux_be_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+ sh64_elf32_nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
+ sh64_elf32_nbsd_le_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;;
+ sh64_elf64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+ sh64_elf64_le_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+ sh64_elf64_linux_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+ sh64_elf64_linux_be_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+ sh64_elf64_nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+ sh64_elf64_nbsd_le_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+ sh_coff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ sh_coff_le_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ sh_coff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ sh_coff_small_le_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ sh_elf32_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
+ sh_elf32_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
+ sh_elf32_fdpic_be_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+ sh_elf32_fdpic_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+ sh_elf32_linux_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+ sh_elf32_linux_be_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+ sh_elf32_nbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+ sh_elf32_nbsd_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+ sh_elf32_symbian_le_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
+ sh_elf32_vxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
+ sh_elf32_vxworks_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
+ sh_pe_le_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
+ sh_pei_le_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
+ sparc_aout_le_vec) tb="$tb aout-sparcle.lo aout32.lo" ;;
+ sparc_aout_linux_vec) tb="$tb sparclinux.lo aout32.lo" ;;
+ sparc_aout_lynx_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
+ sparc_aout_nbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;;
+ sparc_aout_sunos_be_vec) tb="$tb sunos.lo aout32.lo" ;;
+ sparc_coff_vec) tb="$tb coff-sparc.lo" ;;
+ sparc_coff_lynx_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;;
+ sparc_elf32_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ sparc_elf32_sol2_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ sparc_elf32_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ sparc_elf64_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
+ sparc_elf64_fbsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
+ sparc_elf64_sol2_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
+ sparc_nlm32_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
+ spu_elf32_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;;
+ sym_vec) tb="$tb xsym.lo" ;;
+ tic30_aout_vec) tb="$tb aout-tic30.lo" ;;
+ tic30_coff_vec) tb="$tb coff-tic30.lo" ;;
+ tic4x_coff0_vec) tb="$tb coff-tic4x.lo" ;;
+ tic4x_coff0_beh_vec) tb="$tb coff-tic4x.lo" ;;
+ tic4x_coff1_vec) tb="$tb coff-tic4x.lo" ;;
+ tic4x_coff1_beh_vec) tb="$tb coff-tic4x.lo" ;;
+ tic4x_coff2_vec) tb="$tb coff-tic4x.lo" ;;
+ tic4x_coff2_beh_vec) tb="$tb coff-tic4x.lo" ;;
+ tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;;
+ tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;;
+ tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;;
+ tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;;
+ tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;;
+ tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;;
+ tic6x_elf32_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
+ tic6x_elf32_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
+ tic6x_elf32_c6000_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
+ tic6x_elf32_c6000_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
+ tic6x_elf32_linux_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
+ tic6x_elf32_linux_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
+ tic80_coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;;
+ tilegx_elf32_be_vec) tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;;
+ tilegx_elf32_le_vec) tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;;
+ tilegx_elf64_be_vec) tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;;
+ tilegx_elf64_le_vec) tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;;
+ tilepro_elf32_vec) tb="$tb elf32-tilepro.lo elf32.lo $elf" ;;
+ v800_elf32_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;;
+ v850_elf32_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;;
+ vax_aout_1knbsd_vec) tb="$tb vax1knetbsd.lo aout32.lo" ;;
+ vax_aout_bsd_vec) tb="$tb vaxbsd.lo aout32.lo" ;;
+ vax_aout_nbsd_vec) tb="$tb vaxnetbsd.lo aout32.lo" ;;
+ vax_elf32_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;;
+ w65_coff_vec) tb="$tb coff-w65.lo reloc16.lo" ;;
+ we32k_coff_vec) tb="$tb coff-we32k.lo" ;;
+ x86_64_coff_vec) tb="$tb coff-x86_64.lo cofflink.lo"; target_size=64 ;;
+ x86_64_elf32_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
+ x86_64_elf32_nacl_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
+ x86_64_elf64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ x86_64_elf64_fbsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ x86_64_elf64_nacl_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ x86_64_elf64_sol2_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;;
+ x86_64_mach_o_vec) tb="$tb mach-o-x86-64.lo" ;;
+ x86_64_pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
+ x86_64_pe_be_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
+ x86_64_pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;;
+ xc16x_elf32_vec) tb="$tb elf32-xc16x.lo elf32.lo $elf" ;;
+ xgate_elf32_vec) tb="$tb elf32-xgate.lo elf32.lo $elf" ;;
+ xstormy16_elf32_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;;
+ xtensa_elf32_be_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
+ xtensa_elf32_le_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
+ z80_coff_vec) tb="$tb coff-z80.lo reloc16.lo" ;;
+ z8k_coff_vec) tb="$tb coff-z8k.lo reloc16.lo cofflink.lo" ;;
# These appear out of order in targets.c
- srec_vec) tb="$tb srec.lo" ;;
- symbolsrec_vec) tb="$tb srec.lo" ;;
- tekhex_vec) tb="$tb tekhex.lo" ;;
- cisco_core_big_vec) tb="$tb cisco-core.lo" ;;
- cisco_core_little_vec) tb="$tb cisco-core.lo" ;;
+ srec_vec) tb="$tb srec.lo" ;;
+ symbolsrec_vec) tb="$tb srec.lo" ;;
+ tekhex_vec) tb="$tb tekhex.lo" ;;
+ core_cisco_be_vec) tb="$tb cisco-core.lo" ;;
+ core_cisco_le_vec) tb="$tb cisco-core.lo" ;;
- "") ;;
+ "") ;;
*) AC_MSG_ERROR(*** unknown target vector $vec) ;;
esac
diff --git a/binutils-2.25/bfd/configure.com b/binutils-2.25/bfd/configure.com
index e1c3242b..707ba497 100644
--- a/binutils-2.25/bfd/configure.com
+++ b/binutils-2.25/bfd/configure.com
@@ -7,7 +7,7 @@ $!
$! Written by Klaus K"ampf (kkaempf@rmi.de)
$! Rewritten by Tristan Gingold (gingold@adacore.com)
$!
-$! Copyright 2012 Free Software Foundation
+$! Copyright (C) 2012-2014 Free Software Foundation, Inc.
$!
$! This file is free software; you can redistribute it and/or modify
$! it under the terms of the GNU General Public License as published by
@@ -330,7 +330,7 @@ $ if ARCH.eqs."alpha"
$ then
$ create build.com
$DECK
-$ DEFS="""SELECT_VECS=&vms_alpha_vec"","+-
+$ DEFS="""SELECT_VECS=&alpha_vms_vec"","+-
"""SELECT_ARCHITECTURES=&bfd_alpha_arch"""
$ FILES="cpu-alpha,vms,vms-hdr,vms-gsd,vms-tir,vms-misc,"
$EOD
@@ -339,7 +339,7 @@ $ if ARCH.eqs."ia64"
$ then
$ create build.com
$DECK
-$ DEFS="""SELECT_VECS=&bfd_elf64_ia64_vms_vec"","+-
+$ DEFS="""SELECT_VECS=&ia64_elf64_vms_vec"","+-
"""SELECT_ARCHITECTURES=&bfd_ia64_arch"""
$ FILES="cpu-ia64,elf64-ia64,elf-strtab,corefile,stabs,merge,elf-eh-frame,"+-
"elflink,elf-attrs,dwarf1,elf64,"
diff --git a/binutils-2.25/bfd/configure.host b/binutils-2.25/bfd/configure.host
index 7868c24e..5942e575 100644
--- a/binutils-2.25/bfd/configure.host
+++ b/binutils-2.25/bfd/configure.host
@@ -1,5 +1,5 @@
#
-# Copyright 2012 Free Software Foundation
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
# Since the "bfd/hosts" directory is shared by the bfd, opcodes, and
# binutils directories (at least), the index to it is also shared.
-# This is that index. Each configure.in file should source this file
+# This is that index. Each configure.ac file should source this file
# in its per-host part.
# This sets the following shell variables:
diff --git a/binutils-2.25/bfd/corefile.c b/binutils-2.25/bfd/corefile.c
index 8d629384..1b87e86b 100644
--- a/binutils-2.25/bfd/corefile.c
+++ b/binutils-2.25/bfd/corefile.c
@@ -1,6 +1,5 @@
/* Core file generic interface routines for BFD.
- Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2003, 2005,
- 2007 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-aarch64.c b/binutils-2.25/bfd/cpu-aarch64.c
index 9ec18a06..616eb275 100644
--- a/binutils-2.25/bfd/cpu-aarch64.c
+++ b/binutils-2.25/bfd/cpu-aarch64.c
@@ -1,5 +1,5 @@
/* BFD support for AArch64.
- Copyright 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-alpha.c b/binutils-2.25/bfd/cpu-alpha.c
index 902eb8d1..da166613 100644
--- a/binutils-2.25/bfd/cpu-alpha.c
+++ b/binutils-2.25/bfd/cpu-alpha.c
@@ -1,6 +1,5 @@
/* BFD support for the Alpha architecture.
- Copyright 1992, 1993, 1998, 2000, 2002, 2003, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-arc.c b/binutils-2.25/bfd/cpu-arc.c
index 02b4d983..0636105b 100644
--- a/binutils-2.25/bfd/cpu-arc.c
+++ b/binutils-2.25/bfd/cpu-arc.c
@@ -1,6 +1,5 @@
/* BFD support for the ARC processor
- Copyright 1994, 1995, 1997, 2001, 2002, 2005, 2007, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
Contributed by Doug Evans (dje@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-arm.c b/binutils-2.25/bfd/cpu-arm.c
index 4f183364..149c2e5b 100644
--- a/binutils-2.25/bfd/cpu-arm.c
+++ b/binutils-2.25/bfd/cpu-arm.c
@@ -1,6 +1,5 @@
/* BFD support for the ARM processor
- Copyright 1994, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007,
- 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-avr.c b/binutils-2.25/bfd/cpu-avr.c
index 80835389..d3da25af 100644
--- a/binutils-2.25/bfd/cpu-avr.c
+++ b/binutils-2.25/bfd/cpu-avr.c
@@ -1,6 +1,5 @@
/* BFD library support routines for the AVR architecture.
- Copyright 1999, 2000, 2002, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
Contributed by Denis Chertykov <denisc@overta.ru>
This file is part of BFD, the Binary File Descriptor library.
@@ -68,7 +67,6 @@ compatible (const bfd_arch_info_type * a,
return a;
if (a->mach == bfd_mach_avr31 && b->mach == bfd_mach_avr3)
return b;
-
if (a->mach == bfd_mach_avr3 && b->mach == bfd_mach_avr35)
return a;
if (a->mach == bfd_mach_avr35 && b->mach == bfd_mach_avr3)
@@ -79,7 +77,6 @@ compatible (const bfd_arch_info_type * a,
if (a->mach == bfd_mach_avr51 && b->mach == bfd_mach_avr5)
return b;
-
return NULL;
}
@@ -136,25 +133,28 @@ static const bfd_arch_info_type arch_info_struct[] =
/* 3-Byte PC. */
N (22, bfd_mach_avr6, "avr:6", FALSE, & arch_info_struct[10]),
- /* Xmega 1 */
- N (24, bfd_mach_avrxmega1, "avr:101", FALSE, & arch_info_struct[11]),
-
- /* Xmega 2 */
- N (24, bfd_mach_avrxmega2, "avr:102", FALSE, & arch_info_struct[12]),
-
- /* Xmega 3 */
- N (24, bfd_mach_avrxmega3, "avr:103", FALSE, & arch_info_struct[13]),
-
- /* Xmega 4 */
- N (24, bfd_mach_avrxmega4, "avr:104", FALSE, & arch_info_struct[14]),
-
- /* Xmega 5 */
- N (24, bfd_mach_avrxmega5, "avr:105", FALSE, & arch_info_struct[15]),
-
- /* Xmega 6 */
- N (24, bfd_mach_avrxmega6, "avr:106", FALSE, & arch_info_struct[16]),
-
- /* Xmega 7 */
+ /* Tiny core (AVR Tiny). */
+ N (16, bfd_mach_avrtiny, "avr:100", FALSE, & arch_info_struct[11]),
+
+ /* Xmega 1. */
+ N (24, bfd_mach_avrxmega1, "avr:101", FALSE, & arch_info_struct[12]),
+
+ /* Xmega 2. */
+ N (24, bfd_mach_avrxmega2, "avr:102", FALSE, & arch_info_struct[13]),
+
+ /* Xmega 3. */
+ N (24, bfd_mach_avrxmega3, "avr:103", FALSE, & arch_info_struct[14]),
+
+ /* Xmega 4. */
+ N (24, bfd_mach_avrxmega4, "avr:104", FALSE, & arch_info_struct[15]),
+
+ /* Xmega 5. */
+ N (24, bfd_mach_avrxmega5, "avr:105", FALSE, & arch_info_struct[16]),
+
+ /* Xmega 6. */
+ N (24, bfd_mach_avrxmega6, "avr:106", FALSE, & arch_info_struct[17]),
+
+ /* Xmega 7. */
N (24, bfd_mach_avrxmega7, "avr:107", FALSE, NULL)
};
diff --git a/binutils-2.25/bfd/cpu-bfin.c b/binutils-2.25/bfd/cpu-bfin.c
index e2e7f89a..433904d6 100644
--- a/binutils-2.25/bfd/cpu-bfin.c
+++ b/binutils-2.25/bfd/cpu-bfin.c
@@ -1,6 +1,6 @@
/* BFD Support for the ADI Blackfin processor.
- Copyright 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2005-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-cr16.c b/binutils-2.25/bfd/cpu-cr16.c
index 3e54eaa4..2b1af76b 100644
--- a/binutils-2.25/bfd/cpu-cr16.c
+++ b/binutils-2.25/bfd/cpu-cr16.c
@@ -1,5 +1,5 @@
/* BFD support for the CR16 processor.
- Copyright 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007-2014 Free Software Foundation, Inc.
Written by M R Swami Reddy
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-cr16c.c b/binutils-2.25/bfd/cpu-cr16c.c
index 943edfdc..00d9b9c1 100644
--- a/binutils-2.25/bfd/cpu-cr16c.c
+++ b/binutils-2.25/bfd/cpu-cr16c.c
@@ -1,5 +1,5 @@
/* BFD support for the CR16C processor.
- Copyright 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-cris.c b/binutils-2.25/bfd/cpu-cris.c
index 045425d9..0a35d9ba 100644
--- a/binutils-2.25/bfd/cpu-cris.c
+++ b/binutils-2.25/bfd/cpu-cris.c
@@ -1,6 +1,5 @@
/* BFD support for the Axis CRIS architecture.
- Copyright 2000, 2002, 2004, 2005, 2007, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
Contributed by Axis Communications AB.
Written by Hans-Peter Nilsson.
diff --git a/binutils-2.25/bfd/cpu-crx.c b/binutils-2.25/bfd/cpu-crx.c
index 631c5fa5..f393cb73 100644
--- a/binutils-2.25/bfd/cpu-crx.c
+++ b/binutils-2.25/bfd/cpu-crx.c
@@ -1,5 +1,5 @@
/* BFD support for the CRX processor.
- Copyright 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-d10v.c b/binutils-2.25/bfd/cpu-d10v.c
index 7bc208e2..367b9996 100644
--- a/binutils-2.25/bfd/cpu-d10v.c
+++ b/binutils-2.25/bfd/cpu-d10v.c
@@ -1,6 +1,5 @@
/* BFD support for the D10V processor
- Copyright 1996, 1999, 2000, 2002, 2005, 2007, 2010
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Contributed by Martin Hunt (hunt@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-d30v.c b/binutils-2.25/bfd/cpu-d30v.c
index 69515eb6..11eae81e 100644
--- a/binutils-2.25/bfd/cpu-d30v.c
+++ b/binutils-2.25/bfd/cpu-d30v.c
@@ -1,5 +1,5 @@
/* BFD support for the Mitsubishi D30V processor
- Copyright 1997, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1997-2014 Free Software Foundation, Inc.
Contributed by Martin Hunt (hunt@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-dlx.c b/binutils-2.25/bfd/cpu-dlx.c
index 2c17849a..00e13362 100644
--- a/binutils-2.25/bfd/cpu-dlx.c
+++ b/binutils-2.25/bfd/cpu-dlx.c
@@ -1,5 +1,5 @@
/* BFD support for the DLX Microprocessor architecture.
- Copyright 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2002-2014 Free Software Foundation, Inc.
Hacked by Kuang Hwa Lin <kuang@sbcglobal.net>
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-epiphany.c b/binutils-2.25/bfd/cpu-epiphany.c
index 9cf723ed..26ffc03d 100644
--- a/binutils-2.25/bfd/cpu-epiphany.c
+++ b/binutils-2.25/bfd/cpu-epiphany.c
@@ -1,5 +1,5 @@
/* BFD support for the Adapteva EPIPHANY processor.
- Copyright 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
Contributed by Embecosm on behalf of Adapteva, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-fr30.c b/binutils-2.25/bfd/cpu-fr30.c
index dc2e5fa7..9af19a5f 100644
--- a/binutils-2.25/bfd/cpu-fr30.c
+++ b/binutils-2.25/bfd/cpu-fr30.c
@@ -1,5 +1,5 @@
/* BFD support for the FR30 processor.
- Copyright 1998, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-frv.c b/binutils-2.25/bfd/cpu-frv.c
index ac4d8988..fe611d76 100644
--- a/binutils-2.25/bfd/cpu-frv.c
+++ b/binutils-2.25/bfd/cpu-frv.c
@@ -1,5 +1,5 @@
/* BFD support for the FRV processor.
- Copyright 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-h8300.c b/binutils-2.25/bfd/cpu-h8300.c
index 5f338566..cd6e8ed0 100644
--- a/binutils-2.25/bfd/cpu-h8300.c
+++ b/binutils-2.25/bfd/cpu-h8300.c
@@ -1,6 +1,5 @@
/* BFD library support routines for the Renesas H8/300 architecture.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-h8500.c b/binutils-2.25/bfd/cpu-h8500.c
index 1312831d..d01984ab 100644
--- a/binutils-2.25/bfd/cpu-h8500.c
+++ b/binutils-2.25/bfd/cpu-h8500.c
@@ -1,6 +1,5 @@
/* BFD library support routines for the H8/500 architecture.
- Copyright 1993, 1995, 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-hppa.c b/binutils-2.25/bfd/cpu-hppa.c
index 885a11a8..8089a957 100644
--- a/binutils-2.25/bfd/cpu-hppa.c
+++ b/binutils-2.25/bfd/cpu-hppa.c
@@ -1,6 +1,5 @@
/* BFD support for the HP Precision Architecture architecture.
- Copyright 1992, 1995, 1998, 1999, 2000, 2002, 2003, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-i370.c b/binutils-2.25/bfd/cpu-i370.c
index 99daf88d..bb5bc2fd 100644
--- a/binutils-2.25/bfd/cpu-i370.c
+++ b/binutils-2.25/bfd/cpu-i370.c
@@ -1,6 +1,5 @@
/* BFD i370 CPU definition
- Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
Contributed by Ian Lance Taylor, Cygnus Support.
Hacked by Linas Vepstas <linas@linas.org> in 1998, 1999
diff --git a/binutils-2.25/bfd/cpu-i386.c b/binutils-2.25/bfd/cpu-i386.c
index 2a6bb97b..5e488529 100644
--- a/binutils-2.25/bfd/cpu-i386.c
+++ b/binutils-2.25/bfd/cpu-i386.c
@@ -1,7 +1,5 @@
/* BFD support for the Intel 386 architecture.
- Copyright 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2004, 2005,
- 2007, 2009, 2010, 2011, 2013
- Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-i860.c b/binutils-2.25/bfd/cpu-i860.c
index 77c5e840..71452bac 100644
--- a/binutils-2.25/bfd/cpu-i860.c
+++ b/binutils-2.25/bfd/cpu-i860.c
@@ -1,6 +1,5 @@
/* BFD support for the Intel 860 architecture.
- Copyright 1992, 1995, 2000, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
Created mostly by substituting "860" for "386" in cpu-i386.c
Harry Dolan <dolan@ssd.intel.com>, October 1995
diff --git a/binutils-2.25/bfd/cpu-i960.c b/binutils-2.25/bfd/cpu-i960.c
index 9c4a9749..bdcae8c5 100644
--- a/binutils-2.25/bfd/cpu-i960.c
+++ b/binutils-2.25/bfd/cpu-i960.c
@@ -1,6 +1,5 @@
/* BFD library support routines for the i960 architecture.
- Copyright 1990, 1991, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2005, 2006,
- 2007, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-ia64-opc.c b/binutils-2.25/bfd/cpu-ia64-opc.c
index dcc318e6..dd023fd8 100644
--- a/binutils-2.25/bfd/cpu-ia64-opc.c
+++ b/binutils-2.25/bfd/cpu-ia64-opc.c
@@ -1,5 +1,4 @@
-/* Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009
- Free Software Foundation, Inc.
+/* Copyright (C) 1998-2014 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-ia64.c b/binutils-2.25/bfd/cpu-ia64.c
index 4ea37c79..6017e454 100644
--- a/binutils-2.25/bfd/cpu-ia64.c
+++ b/binutils-2.25/bfd/cpu-ia64.c
@@ -1,5 +1,5 @@
/* BFD support for the ia64 architecture.
- Copyright 1998, 1999, 2000, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-ip2k.c b/binutils-2.25/bfd/cpu-ip2k.c
index d8eaf3c2..a9c12cb1 100644
--- a/binutils-2.25/bfd/cpu-ip2k.c
+++ b/binutils-2.25/bfd/cpu-ip2k.c
@@ -1,5 +1,5 @@
/* BFD support for the Scenix IP2xxx processor.
- Copyright 2000, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-iq2000.c b/binutils-2.25/bfd/cpu-iq2000.c
index 648380e6..82524f4a 100644
--- a/binutils-2.25/bfd/cpu-iq2000.c
+++ b/binutils-2.25/bfd/cpu-iq2000.c
@@ -1,5 +1,5 @@
/* BFD support for the Vitesse IQ2000 processor.
- Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-k1om.c b/binutils-2.25/bfd/cpu-k1om.c
index 54b6e58c..c946d145 100644
--- a/binutils-2.25/bfd/cpu-k1om.c
+++ b/binutils-2.25/bfd/cpu-k1om.c
@@ -1,6 +1,5 @@
/* BFD support for the Intel K1OM architecture.
- Copyright 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-l1om.c b/binutils-2.25/bfd/cpu-l1om.c
index 46ac3a00..3648959c 100644
--- a/binutils-2.25/bfd/cpu-l1om.c
+++ b/binutils-2.25/bfd/cpu-l1om.c
@@ -1,6 +1,5 @@
/* BFD support for the Intel L1OM architecture.
- Copyright 2009
- Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-lm32.c b/binutils-2.25/bfd/cpu-lm32.c
index d0fd93ac..e9359973 100644
--- a/binutils-2.25/bfd/cpu-lm32.c
+++ b/binutils-2.25/bfd/cpu-lm32.c
@@ -1,5 +1,5 @@
/* BFD support for the Lattice Mico32 architecture.
- Copyright 2008, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2008-2014 Free Software Foundation, Inc.
Contributed by Jon Beniston <jon@beniston.com>
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-m10200.c b/binutils-2.25/bfd/cpu-m10200.c
index f42a5ea2..003ff9cf 100644
--- a/binutils-2.25/bfd/cpu-m10200.c
+++ b/binutils-2.25/bfd/cpu-m10200.c
@@ -1,5 +1,5 @@
/* BFD support for the Matsushita 10200 processor
- Copyright 1996, 1997, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-m10300.c b/binutils-2.25/bfd/cpu-m10300.c
index 6fd8c67d..c7f68da7 100644
--- a/binutils-2.25/bfd/cpu-m10300.c
+++ b/binutils-2.25/bfd/cpu-m10300.c
@@ -1,6 +1,5 @@
/* BFD support for the Matsushita 10300 processor
- Copyright 1996, 1997, 1999, 2000, 2002, 2003, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-m32c.c b/binutils-2.25/bfd/cpu-m32c.c
index 9c269383..bb915dfe 100644
--- a/binutils-2.25/bfd/cpu-m32c.c
+++ b/binutils-2.25/bfd/cpu-m32c.c
@@ -1,5 +1,5 @@
/* BFD support for the M16C/M32C processors.
- Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-m32r.c b/binutils-2.25/bfd/cpu-m32r.c
index 8f373b43..24a10340 100644
--- a/binutils-2.25/bfd/cpu-m32r.c
+++ b/binutils-2.25/bfd/cpu-m32r.c
@@ -1,6 +1,5 @@
/* BFD support for the M32R processor.
- Copyright 1996, 1999, 2000, 2002, 2003, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-m68hc11.c b/binutils-2.25/bfd/cpu-m68hc11.c
index 7f3c0747..68af7f2c 100644
--- a/binutils-2.25/bfd/cpu-m68hc11.c
+++ b/binutils-2.25/bfd/cpu-m68hc11.c
@@ -1,5 +1,5 @@
/* BFD support for the Motorola 68HC11 processor
- Copyright 1999, 2000, 2001, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-m68hc12.c b/binutils-2.25/bfd/cpu-m68hc12.c
index 2dbf6272..4b6fe20b 100644
--- a/binutils-2.25/bfd/cpu-m68hc12.c
+++ b/binutils-2.25/bfd/cpu-m68hc12.c
@@ -1,5 +1,5 @@
/* BFD support for the Motorola 68HC12 processor
- Copyright 1999, 2000, 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-m68k.c b/binutils-2.25/bfd/cpu-m68k.c
index 4c7b8451..2810994a 100644
--- a/binutils-2.25/bfd/cpu-m68k.c
+++ b/binutils-2.25/bfd/cpu-m68k.c
@@ -1,6 +1,5 @@
/* BFD library support routines for architectures.
- Copyright 1990, 1991, 1992, 1993, 1994, 1997, 1998, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-m88k.c b/binutils-2.25/bfd/cpu-m88k.c
index d3459020..da4f03cd 100644
--- a/binutils-2.25/bfd/cpu-m88k.c
+++ b/binutils-2.25/bfd/cpu-m88k.c
@@ -1,6 +1,5 @@
/* bfd back-end for m88k support
- Copyright 1990, 1991, 1994, 2000, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-m9s12x.c b/binutils-2.25/bfd/cpu-m9s12x.c
index d224b835..83bbfa3b 100644
--- a/binutils-2.25/bfd/cpu-m9s12x.c
+++ b/binutils-2.25/bfd/cpu-m9s12x.c
@@ -1,5 +1,5 @@
/* BFD support for the Freescale 9S12X processor
- Copyright 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2008-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-m9s12xg.c b/binutils-2.25/bfd/cpu-m9s12xg.c
index 6958a13c..a5475682 100644
--- a/binutils-2.25/bfd/cpu-m9s12xg.c
+++ b/binutils-2.25/bfd/cpu-m9s12xg.c
@@ -1,5 +1,5 @@
/* BFD support for the Freescale 9S12-XGATE co-processor
- Copyright 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2008-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-mcore.c b/binutils-2.25/bfd/cpu-mcore.c
index 80b3290e..06a6e309 100644
--- a/binutils-2.25/bfd/cpu-mcore.c
+++ b/binutils-2.25/bfd/cpu-mcore.c
@@ -1,5 +1,5 @@
/* BFD library support routines for Motorola's MCore architecture
- Copyright 1993, 1999, 2000, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-mep.c b/binutils-2.25/bfd/cpu-mep.c
index 94cb0808..5c747925 100644
--- a/binutils-2.25/bfd/cpu-mep.c
+++ b/binutils-2.25/bfd/cpu-mep.c
@@ -1,5 +1,5 @@
/* BFD support for the Toshiba Media Engine Processor.
- Copyright (C) 2001, 2002, 2004, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-metag.c b/binutils-2.25/bfd/cpu-metag.c
index a8dbfaa9..a1aa92db 100644
--- a/binutils-2.25/bfd/cpu-metag.c
+++ b/binutils-2.25/bfd/cpu-metag.c
@@ -1,5 +1,5 @@
/* BFD support for the Imagination Technologies Meta processor.
- Copyright (C) 2013 Free Software Foundation, Inc.
+ Copyright (C) 2013-2014 Free Software Foundation, Inc.
Contributed by Imagination Technologies Ltd.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-microblaze.c b/binutils-2.25/bfd/cpu-microblaze.c
index 2cf6bc68..023aa6cb 100644
--- a/binutils-2.25/bfd/cpu-microblaze.c
+++ b/binutils-2.25/bfd/cpu-microblaze.c
@@ -1,6 +1,6 @@
/* BFD Xilinx MicroBlaze architecture definition
- Copyright 2009, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-mips.c b/binutils-2.25/bfd/cpu-mips.c
index 59a7c168..b617aaa7 100644
--- a/binutils-2.25/bfd/cpu-mips.c
+++ b/binutils-2.25/bfd/cpu-mips.c
@@ -1,7 +1,5 @@
/* bfd back-end for mips support
- Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
- 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2013
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -89,8 +87,14 @@ enum
I_mips5,
I_mipsisa32,
I_mipsisa32r2,
+ I_mipsisa32r3,
+ I_mipsisa32r5,
+ I_mipsisa32r6,
I_mipsisa64,
I_mipsisa64r2,
+ I_mipsisa64r3,
+ I_mipsisa64r5,
+ I_mipsisa64r6,
I_sb1,
I_loongson_2e,
I_loongson_2f,
@@ -133,8 +137,14 @@ static const bfd_arch_info_type arch_info_struct[] =
N (64, 64, bfd_mach_mips5, "mips:mips5", FALSE, NN(I_mips5)),
N (32, 32, bfd_mach_mipsisa32, "mips:isa32", FALSE, NN(I_mipsisa32)),
N (32, 32, bfd_mach_mipsisa32r2,"mips:isa32r2", FALSE, NN(I_mipsisa32r2)),
+ N (32, 32, bfd_mach_mipsisa32r3,"mips:isa32r3", FALSE, NN(I_mipsisa32r3)),
+ N (32, 32, bfd_mach_mipsisa32r5,"mips:isa32r5", FALSE, NN(I_mipsisa32r5)),
+ N (32, 32, bfd_mach_mipsisa32r6,"mips:isa32r6", FALSE, NN(I_mipsisa32r6)),
N (64, 64, bfd_mach_mipsisa64, "mips:isa64", FALSE, NN(I_mipsisa64)),
N (64, 64, bfd_mach_mipsisa64r2,"mips:isa64r2", FALSE, NN(I_mipsisa64r2)),
+ N (64, 64, bfd_mach_mipsisa64r3,"mips:isa64r3", FALSE, NN(I_mipsisa64r3)),
+ N (64, 64, bfd_mach_mipsisa64r5,"mips:isa64r5", FALSE, NN(I_mipsisa64r5)),
+ N (64, 64, bfd_mach_mipsisa64r6,"mips:isa64r6", FALSE, NN(I_mipsisa64r6)),
N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, NN(I_sb1)),
N (64, 64, bfd_mach_mips_loongson_2e, "mips:loongson_2e", FALSE, NN(I_loongson_2e)),
N (64, 64, bfd_mach_mips_loongson_2f, "mips:loongson_2f", FALSE, NN(I_loongson_2f)),
diff --git a/binutils-2.25/bfd/cpu-mmix.c b/binutils-2.25/bfd/cpu-mmix.c
index f706b496..0d8584c5 100644
--- a/binutils-2.25/bfd/cpu-mmix.c
+++ b/binutils-2.25/bfd/cpu-mmix.c
@@ -1,5 +1,5 @@
/* BFD library support routines for MMIX.
- Copyright 2001, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson (hp@bitrange.com)
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-moxie.c b/binutils-2.25/bfd/cpu-moxie.c
index 103a56ac..949dd2b0 100644
--- a/binutils-2.25/bfd/cpu-moxie.c
+++ b/binutils-2.25/bfd/cpu-moxie.c
@@ -1,5 +1,5 @@
/* BFD support for the moxie processor.
- Copyright 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
Written by Anthony Green
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-msp430.c b/binutils-2.25/bfd/cpu-msp430.c
index d15ba55b..275a0aba 100644
--- a/binutils-2.25/bfd/cpu-msp430.c
+++ b/binutils-2.25/bfd/cpu-msp430.c
@@ -1,5 +1,5 @@
/* BFD library support routines for the MSP architecture.
- Copyright (C) 2002-2013 Free Software Foundation, Inc.
+ Copyright (C) 2002-2014 Free Software Foundation, Inc.
Contributed by Dmitry Diky <diwil@mail.ru>
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-mt.c b/binutils-2.25/bfd/cpu-mt.c
index 0ec10c86..ea5fc5a8 100644
--- a/binutils-2.25/bfd/cpu-mt.c
+++ b/binutils-2.25/bfd/cpu-mt.c
@@ -1,5 +1,5 @@
/* BFD support for the Morpho Technologies MT processor.
- Copyright (C) 2001, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-nds32.c b/binutils-2.25/bfd/cpu-nds32.c
new file mode 100644
index 00000000..d40d56a8
--- /dev/null
+++ b/binutils-2.25/bfd/cpu-nds32.c
@@ -0,0 +1,45 @@
+/* BFD support for the NDS32 processor
+ Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ Contributed by Andes Technology Corporation.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ 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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+#include "sysdep.h"
+#include "bfd.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+
+#define N(number, print, default, next) \
+ {32, 32, 8, bfd_arch_nds32, number, "nds32", print, 4, default, \
+ bfd_default_compatible, bfd_default_scan, bfd_arch_default_fill, next }
+
+#define NEXT &arch_info_struct[0]
+#define NDS32V2_NEXT &arch_info_struct[1]
+#define NDS32V3_NEXT &arch_info_struct[2]
+#define NDS32V3M_NEXT &arch_info_struct[3]
+
+static const bfd_arch_info_type arch_info_struct[] =
+{
+ N (bfd_mach_n1h, "n1h", FALSE, NDS32V2_NEXT),
+ N (bfd_mach_n1h_v2, "n1h_v2", FALSE, NDS32V3_NEXT),
+ N (bfd_mach_n1h_v3, "n1h_v3", FALSE, NDS32V3M_NEXT),
+ N (bfd_mach_n1h_v3m, "n1h_v3m", FALSE, NULL),
+};
+
+const bfd_arch_info_type bfd_nds32_arch =
+ N (bfd_mach_n1, "n1h", TRUE, NEXT);
diff --git a/binutils-2.25/bfd/cpu-nios2.c b/binutils-2.25/bfd/cpu-nios2.c
index fa4c859d..95ae1d94 100644
--- a/binutils-2.25/bfd/cpu-nios2.c
+++ b/binutils-2.25/bfd/cpu-nios2.c
@@ -1,5 +1,5 @@
/* BFD support for the Altera Nios II processor.
- Copyright (C) 2012, 2013 Free Software Foundation, Inc.
+ Copyright (C) 2012-2014 Free Software Foundation, Inc.
Contributed by Nigel Gray (ngray@altera.com).
Contributed by Mentor Graphics, Inc.
diff --git a/binutils-2.25/bfd/cpu-ns32k.c b/binutils-2.25/bfd/cpu-ns32k.c
index 48a6bc69..55ee0303 100644
--- a/binutils-2.25/bfd/cpu-ns32k.c
+++ b/binutils-2.25/bfd/cpu-ns32k.c
@@ -1,6 +1,5 @@
/* BFD support for the ns32k architecture.
- Copyright 1990, 1991, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2007, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Almost totally rewritten by Ian Dall from initial work
by Andrew Cagney.
diff --git a/binutils-2.25/bfd/cpu-openrisc.c b/binutils-2.25/bfd/cpu-openrisc.c
deleted file mode 100644
index 8e3e8784..00000000
--- a/binutils-2.25/bfd/cpu-openrisc.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* BFD support for the OpenRISC architecture.
- Copyright 2001, 2002, 2005, 2007 Free Software Foundation, Inc.
- Contributed by Johan Rydberg, jrydberg@opencores.org
-
- This file is part of BFD, the Binary File Descriptor library.
-
- 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "libbfd.h"
-
-#define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \
- { \
- BITS_WORD, /* bits in a word */ \
- BITS_ADDR, /* bits in an address */ \
- 8, /* 8 bits in a byte */ \
- bfd_arch_openrisc, \
- NUMBER, \
- "openrisc", \
- PRINT, \
- 2, \
- DEFAULT, \
- bfd_default_compatible, \
- bfd_default_scan, \
- bfd_arch_default_fill, \
- NEXT, \
- }
-
-const bfd_arch_info_type bfd_openrisc_arch =
- N (32, 32, 0, "openrisc", TRUE, 0);
diff --git a/binutils-2.25/bfd/cpu-or1k.c b/binutils-2.25/bfd/cpu-or1k.c
new file mode 100644
index 00000000..7abf2cb2
--- /dev/null
+++ b/binutils-2.25/bfd/cpu-or1k.c
@@ -0,0 +1,59 @@
+/* BFD support for the OpenRISC 1000 architecture.
+ Copyright 2002-2014 Free Software Foundation, Inc.
+ Contributed for OR32 by Ivan Guzvinec <ivang@opencores.org>
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ 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 3 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, see <http://www.gnu.org/licenses/>. */
+
+#include "sysdep.h"
+#include "bfd.h"
+#include "libbfd.h"
+
+const bfd_arch_info_type bfd_or1k_arch;
+const bfd_arch_info_type bfd_or1knd_arch;
+
+const bfd_arch_info_type bfd_or1k_arch =
+ {
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
+ bfd_arch_or1k,
+ bfd_mach_or1k,
+ "or1k",
+ "or1k",
+ 4,
+ TRUE,
+ bfd_default_compatible,
+ bfd_default_scan,
+ bfd_arch_default_fill,
+ &bfd_or1knd_arch,
+ };
+
+const bfd_arch_info_type bfd_or1knd_arch =
+ {
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
+ bfd_arch_or1k,
+ bfd_mach_or1knd,
+ "or1knd",
+ "or1knd",
+ 4,
+ FALSE,
+ bfd_default_compatible,
+ bfd_default_scan,
+ bfd_arch_default_fill,
+ NULL,
+ };
diff --git a/binutils-2.25/bfd/cpu-pdp11.c b/binutils-2.25/bfd/cpu-pdp11.c
index 57c3068f..cf8e7e25 100644
--- a/binutils-2.25/bfd/cpu-pdp11.c
+++ b/binutils-2.25/bfd/cpu-pdp11.c
@@ -1,5 +1,5 @@
/* BFD back-end for PDP-11 support.
- Copyright 2001, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-pj.c b/binutils-2.25/bfd/cpu-pj.c
index 35762272..dfbe8c42 100644
--- a/binutils-2.25/bfd/cpu-pj.c
+++ b/binutils-2.25/bfd/cpu-pj.c
@@ -1,6 +1,5 @@
/* BFD library support routines for the Pico Java architecture.
- Copyright 1999, 2000, 2001, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Transmeta. sac@pobox.com
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-plugin.c b/binutils-2.25/bfd/cpu-plugin.c
index 6b25c589..76fd6878 100644
--- a/binutils-2.25/bfd/cpu-plugin.c
+++ b/binutils-2.25/bfd/cpu-plugin.c
@@ -1,6 +1,5 @@
/* BFD support for plugins.
- Copyright 2009
- Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-powerpc.c b/binutils-2.25/bfd/cpu-powerpc.c
index 3e9acf18..8d7bebc0 100644
--- a/binutils-2.25/bfd/cpu-powerpc.c
+++ b/binutils-2.25/bfd/cpu-powerpc.c
@@ -1,6 +1,5 @@
/* BFD PowerPC CPU definition
- Copyright 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2005, 2007, 2008,
- 2010, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
Contributed by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-rl78.c b/binutils-2.25/bfd/cpu-rl78.c
index 6fb72e6e..2b30626b 100644
--- a/binutils-2.25/bfd/cpu-rl78.c
+++ b/binutils-2.25/bfd/cpu-rl78.c
@@ -1,5 +1,5 @@
/* BFD support for the RL78 processor.
- Copyright (C) 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-rs6000.c b/binutils-2.25/bfd/cpu-rs6000.c
index ba1df36a..b8022c3d 100644
--- a/binutils-2.25/bfd/cpu-rs6000.c
+++ b/binutils-2.25/bfd/cpu-rs6000.c
@@ -1,6 +1,5 @@
/* BFD back-end for rs6000 support
- Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003, 2005, 2007, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Mimi Phuong-Thao Vo of IBM
and John Gilmore of Cygnus Support.
diff --git a/binutils-2.25/bfd/cpu-rx.c b/binutils-2.25/bfd/cpu-rx.c
index 31489ada..677c4901 100644
--- a/binutils-2.25/bfd/cpu-rx.c
+++ b/binutils-2.25/bfd/cpu-rx.c
@@ -1,5 +1,5 @@
/* BFD support for the RX processor.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2008-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-s390.c b/binutils-2.25/bfd/cpu-s390.c
index 1cd3af1a..badf39da 100644
--- a/binutils-2.25/bfd/cpu-s390.c
+++ b/binutils-2.25/bfd/cpu-s390.c
@@ -1,5 +1,5 @@
/* BFD support for the s390 processor.
- Copyright 2000, 2001, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
Contributed by Carl B. Pedersen and Martin Schwidefsky.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-score.c b/binutils-2.25/bfd/cpu-score.c
index 329c97c4..42db5b34 100644
--- a/binutils-2.25/bfd/cpu-score.c
+++ b/binutils-2.25/bfd/cpu-score.c
@@ -1,5 +1,5 @@
/* BFD support for the score processor
- Copyright 2006, 2007, 2008, 2009, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
Contributed by
Brain.lin (brain.lin@sunplusct.com)
Mei Ligang (ligang@sunnorth.com.cn)
diff --git a/binutils-2.25/bfd/cpu-sh.c b/binutils-2.25/bfd/cpu-sh.c
index 6ca78403..2a8b931c 100644
--- a/binutils-2.25/bfd/cpu-sh.c
+++ b/binutils-2.25/bfd/cpu-sh.c
@@ -1,6 +1,5 @@
/* BFD library support routines for the Renesas / SuperH SH architecture.
- Copyright 1993, 1994, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
- 2007 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-sparc.c b/binutils-2.25/bfd/cpu-sparc.c
index ccdd7d1d..f215c67a 100644
--- a/binutils-2.25/bfd/cpu-sparc.c
+++ b/binutils-2.25/bfd/cpu-sparc.c
@@ -1,6 +1,5 @@
/* BFD support for the SPARC architecture.
- Copyright 1992, 1995, 1996, 1998, 2000, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-spu.c b/binutils-2.25/bfd/cpu-spu.c
index b3dfc62b..3e0db39b 100644
--- a/binutils-2.25/bfd/cpu-spu.c
+++ b/binutils-2.25/bfd/cpu-spu.c
@@ -1,4 +1,4 @@
-/* Copyright 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-tic30.c b/binutils-2.25/bfd/cpu-tic30.c
index a9d291d8..f866b894 100644
--- a/binutils-2.25/bfd/cpu-tic30.c
+++ b/binutils-2.25/bfd/cpu-tic30.c
@@ -1,5 +1,5 @@
/* BFD support for the Texas Instruments TMS320C30 architecture.
- Copyright 1998, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-tic4x.c b/binutils-2.25/bfd/cpu-tic4x.c
index a90594c2..551afe8d 100644
--- a/binutils-2.25/bfd/cpu-tic4x.c
+++ b/binutils-2.25/bfd/cpu-tic4x.c
@@ -1,6 +1,5 @@
/* bfd back-end for TMS320C[34]x support
- Copyright 1996, 1997, 2002, 2003, 2005, 2007, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz)
diff --git a/binutils-2.25/bfd/cpu-tic54x.c b/binutils-2.25/bfd/cpu-tic54x.c
index 95d990e1..0e3b56d6 100644
--- a/binutils-2.25/bfd/cpu-tic54x.c
+++ b/binutils-2.25/bfd/cpu-tic54x.c
@@ -1,5 +1,5 @@
/* BFD support for the Texas Instruments TMS320C54X architecture.
- Copyright 1999, 2000, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-tic6x.c b/binutils-2.25/bfd/cpu-tic6x.c
index d5a9cb98..ed9581cc 100644
--- a/binutils-2.25/bfd/cpu-tic6x.c
+++ b/binutils-2.25/bfd/cpu-tic6x.c
@@ -1,6 +1,5 @@
/* BFD support for the TI C6X processor.
- Copyright 2010
- Free Software Foundation, Inc.
+ Copyright (C) 2010-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-tic80.c b/binutils-2.25/bfd/cpu-tic80.c
index c11233df..83995e0d 100644
--- a/binutils-2.25/bfd/cpu-tic80.c
+++ b/binutils-2.25/bfd/cpu-tic80.c
@@ -1,5 +1,5 @@
/* bfd back-end for TI TMS320C80 (MVP) support
- Copyright 1996, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus support (fnf@cygnus.com)
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-tilegx.c b/binutils-2.25/bfd/cpu-tilegx.c
index 11234eca..f5126f5c 100644
--- a/binutils-2.25/bfd/cpu-tilegx.c
+++ b/binutils-2.25/bfd/cpu-tilegx.c
@@ -1,5 +1,5 @@
/* BFD support for the TILE-Gx processor.
- Copyright 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-tilepro.c b/binutils-2.25/bfd/cpu-tilepro.c
index 4066fc19..6be1d7b4 100644
--- a/binutils-2.25/bfd/cpu-tilepro.c
+++ b/binutils-2.25/bfd/cpu-tilepro.c
@@ -1,5 +1,5 @@
/* BFD support for the TILEPro processor.
- Copyright 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-v850.c b/binutils-2.25/bfd/cpu-v850.c
index c2f52f11..60b65635 100644
--- a/binutils-2.25/bfd/cpu-v850.c
+++ b/binutils-2.25/bfd/cpu-v850.c
@@ -1,5 +1,5 @@
/* BFD support for the NEC V850 processor
- Copyright 1996-2013 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-v850_rh850.c b/binutils-2.25/bfd/cpu-v850_rh850.c
index 9402f23a..79628453 100644
--- a/binutils-2.25/bfd/cpu-v850_rh850.c
+++ b/binutils-2.25/bfd/cpu-v850_rh850.c
@@ -1,5 +1,5 @@
/* BFD support for the NEC V850 processor with the RH850 ABI.
- Copyright 2012-2013 Free Software Foundation, Inc.
+ Copyright (C) 2012-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-vax.c b/binutils-2.25/bfd/cpu-vax.c
index 9e2b19d4..225b3f4a 100644
--- a/binutils-2.25/bfd/cpu-vax.c
+++ b/binutils-2.25/bfd/cpu-vax.c
@@ -1,6 +1,5 @@
/* bfd back-end for vax support
- Copyright 1990, 1991, 1994, 2000, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-w65.c b/binutils-2.25/bfd/cpu-w65.c
index 8b0618ba..f3d0d521 100644
--- a/binutils-2.25/bfd/cpu-w65.c
+++ b/binutils-2.25/bfd/cpu-w65.c
@@ -1,6 +1,5 @@
/* BFD library support routines for the WDC 65816 architecture.
- Copyright 1995, 1999, 2000, 2001, 2002, 2005, 2007, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-we32k.c b/binutils-2.25/bfd/cpu-we32k.c
index 99a8ff00..5577ae8f 100644
--- a/binutils-2.25/bfd/cpu-we32k.c
+++ b/binutils-2.25/bfd/cpu-we32k.c
@@ -1,5 +1,5 @@
/* bfd back-end for we32k support
- Copyright 1992, 2000, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
Contributed by Brendan Kehoe (brendan@cs.widener.edu).
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-xc16x.c b/binutils-2.25/bfd/cpu-xc16x.c
index 3c74232d..cdcc4e85 100644
--- a/binutils-2.25/bfd/cpu-xc16x.c
+++ b/binutils-2.25/bfd/cpu-xc16x.c
@@ -1,5 +1,5 @@
/* BFD support for the Infineon XC16X Microcontroller.
- Copyright 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
Contributed by KPIT Cummins Infosystems
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-xgate.c b/binutils-2.25/bfd/cpu-xgate.c
index 11653fa5..f8bfdf9e 100644
--- a/binutils-2.25/bfd/cpu-xgate.c
+++ b/binutils-2.25/bfd/cpu-xgate.c
@@ -1,5 +1,5 @@
/* BFD support for the Freescale XGATE processor
- Copyright 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2010-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-xstormy16.c b/binutils-2.25/bfd/cpu-xstormy16.c
index 94de9892..2e2578b8 100644
--- a/binutils-2.25/bfd/cpu-xstormy16.c
+++ b/binutils-2.25/bfd/cpu-xstormy16.c
@@ -1,5 +1,5 @@
/* BFD support for the XSTORMY16 processor.
- Copyright 2001, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-xtensa.c b/binutils-2.25/bfd/cpu-xtensa.c
index 5c1008e9..5eb02e92 100644
--- a/binutils-2.25/bfd/cpu-xtensa.c
+++ b/binutils-2.25/bfd/cpu-xtensa.c
@@ -1,5 +1,5 @@
/* BFD support for the Xtensa processor.
- Copyright 2003, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-z80.c b/binutils-2.25/bfd/cpu-z80.c
index a46f71d9..d7bb6f2c 100644
--- a/binutils-2.25/bfd/cpu-z80.c
+++ b/binutils-2.25/bfd/cpu-z80.c
@@ -1,5 +1,5 @@
/* BFD library support routines for the Z80 architecture.
- Copyright 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2005-2014 Free Software Foundation, Inc.
Contributed by Arnold Metselaar <arnold_m@operamail.com>
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/cpu-z8k.c b/binutils-2.25/bfd/cpu-z8k.c
index fd342186..9c6547cf 100644
--- a/binutils-2.25/bfd/cpu-z8k.c
+++ b/binutils-2.25/bfd/cpu-z8k.c
@@ -1,6 +1,5 @@
/* BFD library support routines for the Z800n architecture.
- Copyright 1992, 1993, 1994, 2000, 2001, 2002, 2003, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/demo64.c b/binutils-2.25/bfd/demo64.c
index 36f44a63..83db63ed 100644
--- a/binutils-2.25/bfd/demo64.c
+++ b/binutils-2.25/bfd/demo64.c
@@ -1,6 +1,5 @@
/* BFD backend for demonstration 64-bit a.out binaries.
- Copyright 1990, 1991, 1992, 1993, 1994, 2001, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -25,7 +24,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (demo_64_,OP)
+#define MY(OP) CONCAT2 (aout64_,OP)
#define TARGETNAME "demo64"
#include "aoutf1.h"
diff --git a/binutils-2.25/bfd/development.sh b/binutils-2.25/bfd/development.sh
new file mode 100644
index 00000000..416ec8c8
--- /dev/null
+++ b/binutils-2.25/bfd/development.sh
@@ -0,0 +1,19 @@
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
+#
+# This file is part of GDB.
+#
+# 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 3 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, see <http://www.gnu.org/licenses/>.
+
+# Controls whether to enable development-mode features by default.
+development=false
diff --git a/binutils-2.25/bfd/doc/ChangeLog b/binutils-2.25/bfd/doc/ChangeLog
index 08c27808..e2987ed5 100644
--- a/binutils-2.25/bfd/doc/ChangeLog
+++ b/binutils-2.25/bfd/doc/ChangeLog
@@ -1,3 +1,40 @@
+2014-08-05 Doug Evans <dje@google.com>
+
+ * chew.c (skip_past_newline_1): New function.
+ (outputdots): Call it.
+ (skip_past_newline): Ditto.
+
+2014-08-05 Alan Modra <amodra@gmail.com>
+
+ * chew.c (print_stack_level, main): Cast result of pointer
+ difference to match format string.
+
+2014-04-09 Alan Modra <amodra@gmail.com>
+
+ * Makefile.am ($(MKDOC)): New rule, depend on chew.stamp. Move
+ old rule to..
+ (chew.stamp): ..here.
+ (DISTCLEANFILES): Move *.stamp..
+ (MOSTLYCLEANFILES): ..to here.
+ * Makefile.in: Regenerate.
+
+2014-04-09 Alan Modra <amodra@gmail.com>
+
+ * Makefile.am (MKDOC): Use $@ in command.
+ (aoutx.texi): New rule, depend on aoutx.stamp. Move old rule..
+ (aoutx.stamp): .. to here. Don't depend on chew.c, depend on MKDOC
+ and omit recursive MAKE. Use $< in command.
+ (archive.texi, archures.texi, bfdt.texi, cache.texi, coffcode.texi,
+ core.texi, elf.texi, elfcode.texi, mmo.texi, format.texi, libbfd.texi,
+ bfdio.texi, bfdwin.texi, opncls.texi, reloc.texi, section.texi,
+ syms.texi, targets.texi, init.texi, hash.texi, linker.texi): Similarly.
+ (DISTCLEANFILES): Remove *.stamp.
+ * Makefile.in: Regenerate.
+
+2014-03-12 Alan Modra <amodra@gmail.com>
+
+ * Makefile.in: Regenerate.
+
2013-10-14 Nick Clifton <nickc@redhat.com>
* chew.c (perform): Free next.
@@ -267,7 +304,7 @@
For older changes see ChangeLog-9103
-Copyright (C) 2004-2012 Free Software Foundation, Inc.
+Copyright (C) 2004-2014 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
diff --git a/binutils-2.25/bfd/doc/Makefile.am b/binutils-2.25/bfd/doc/Makefile.am
index 670d69ae..3f698593 100644
--- a/binutils-2.25/bfd/doc/Makefile.am
+++ b/binutils-2.25/bfd/doc/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to generate Makefile.in
#
-# Copyright 2012 Free Software Foundation
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -76,10 +76,13 @@ MKDOC = chew$(EXEEXT_FOR_BUILD)
AM_CPPFLAGS = -I.. -I$(srcdir)/.. -I$(srcdir)/../../include \
-I$(srcdir)/../../intl -I../../intl
-$(MKDOC): $(srcdir)/chew.c
+$(MKDOC): chew.stamp ; @true
+chew.stamp: $(srcdir)/chew.c
$(CC_FOR_BUILD) -o chw$$$$$(EXEEXT_FOR_BUILD) $(CFLAGS_FOR_BUILD) \
$(LDFLAGS_FOR_BUILD) $(H_CFLAGS) $(AM_CPPFLAGS) $(srcdir)/chew.c; \
- $(SHELL) $(srcdir)/../../move-if-change chw$$$$$(EXEEXT_FOR_BUILD) $(MKDOC)
+ $(SHELL) $(srcdir)/../../move-if-change \
+ chw$$$$$(EXEEXT_FOR_BUILD) $(MKDOC); \
+ touch $@
protos: libbfd.h libcoff.h bfd.h
@@ -91,117 +94,139 @@ protos: libbfd.h libcoff.h bfd.h
# program. If somebody tries to rebuild info, but none of the .texi files
# have changed, then nothing will be rebuilt.
-aoutx.texi: chew.c $(srcdir)/../aoutx.h $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../aoutx.h >aoutx.tmp
+aoutx.texi: aoutx.stamp ; @true
+aoutx.stamp: $(srcdir)/../aoutx.h $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >aoutx.tmp
$(SHELL) $(srcdir)/../../move-if-change aoutx.tmp aoutx.texi
+ touch $@
-archive.texi: chew.c $(srcdir)/../archive.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../archive.c >archive.tmp
+archive.texi: archive.stamp ; @true
+archive.stamp: $(srcdir)/../archive.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >archive.tmp
$(SHELL) $(srcdir)/../../move-if-change archive.tmp archive.texi
+ touch $@
-archures.texi: chew.c $(srcdir)/../archures.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../archures.c >archures.tmp
+archures.texi: archures.stamp ; @true
+archures.stamp: $(srcdir)/../archures.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >archures.tmp
$(SHELL) $(srcdir)/../../move-if-change archures.tmp archures.texi
+ touch $@
# We use bfdt.texi, rather than bfd.texi, to avoid conflicting with
# bfd.texinfo on an 8.3 filesystem.
-bfdt.texi: chew.c $(srcdir)/../bfd.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfd.c >bfd.tmp
+bfdt.texi: bfdt.stamp ; @true
+bfdt.stamp: $(srcdir)/../bfd.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfd.tmp
$(SHELL) $(srcdir)/../../move-if-change bfd.tmp bfdt.texi
+ touch $@
-cache.texi: chew.c $(srcdir)/../cache.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../cache.c >cache.tmp
+cache.texi: cache.stamp ; @true
+cache.stamp: $(srcdir)/../cache.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >cache.tmp
$(SHELL) $(srcdir)/../../move-if-change cache.tmp cache.texi
+ touch $@
-coffcode.texi: chew.c $(srcdir)/../coffcode.h $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../coffcode.h >coffcode.tmp
+coffcode.texi: coffcode.stamp ; @true
+coffcode.stamp: $(srcdir)/../coffcode.h $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >coffcode.tmp
$(SHELL) $(srcdir)/../../move-if-change coffcode.tmp coffcode.texi
+ touch $@
-core.texi: chew.c $(srcdir)/../corefile.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../corefile.c >core.tmp
+core.texi: core.stamp ; @true
+core.stamp: $(srcdir)/../corefile.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >core.tmp
$(SHELL) $(srcdir)/../../move-if-change core.tmp core.texi
+ touch $@
-elf.texi: chew.c $(srcdir)/../elf.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elf.c >elf.tmp
+elf.texi: elf.stamp ; @true
+elf.stamp: $(srcdir)/../elf.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >elf.tmp
$(SHELL) $(srcdir)/../../move-if-change elf.tmp elf.texi
+ touch $@
-elfcode.texi: chew.c $(srcdir)/../elfcode.h $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elfcode.h >elfcode.tmp
+elfcode.texi: elfcode.stamp ; @true
+elfcode.stamp: $(srcdir)/../elfcode.h $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >elfcode.tmp
$(SHELL) $(srcdir)/../../move-if-change elfcode.tmp elfcode.texi
+ touch $@
-mmo.texi: chew.c $(srcdir)/../mmo.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp
+mmo.texi: mmo.stamp ; @true
+mmo.stamp: $(srcdir)/../mmo.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >mmo.tmp
$(SHELL) $(srcdir)/../../move-if-change mmo.tmp mmo.texi
+ touch $@
-format.texi: chew.c $(srcdir)/../format.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp
+format.texi: format.stamp ; @true
+format.stamp: $(srcdir)/../format.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >format.tmp
$(SHELL) $(srcdir)/../../move-if-change format.tmp format.texi
+ touch $@
-libbfd.texi: chew.c $(srcdir)/../libbfd.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../libbfd.c >libbfd.tmp
+libbfd.texi: libbfd.stamp ; @true
+libbfd.stamp: $(srcdir)/../libbfd.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >libbfd.tmp
$(SHELL) $(srcdir)/../../move-if-change libbfd.tmp libbfd.texi
+ touch $@
-bfdio.texi: chew.c $(srcdir)/../bfdio.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdio.c >bfdio.tmp
+bfdio.texi: bfdio.stamp ; @true
+bfdio.stamp: $(srcdir)/../bfdio.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfdio.tmp
$(SHELL) $(srcdir)/../../move-if-change bfdio.tmp bfdio.texi
+ touch $@
-bfdwin.texi: chew.c $(srcdir)/../bfdwin.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdwin.c >bfdwin.tmp
+bfdwin.texi: bfdwin.stamp ; @true
+bfdwin.stamp: $(srcdir)/../bfdwin.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfdwin.tmp
$(SHELL) $(srcdir)/../../move-if-change bfdwin.tmp bfdwin.texi
+ touch $@
-opncls.texi: chew.c $(srcdir)/../opncls.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../opncls.c >opncls.tmp
+opncls.texi: opncls.stamp ; @true
+opncls.stamp: $(srcdir)/../opncls.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >opncls.tmp
$(SHELL) $(srcdir)/../../move-if-change opncls.tmp opncls.texi
+ touch $@
-reloc.texi: chew.c $(srcdir)/../reloc.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../reloc.c >reloc.tmp
+reloc.texi: reloc.stamp ; @true
+reloc.stamp: $(srcdir)/../reloc.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >reloc.tmp
$(SHELL) $(srcdir)/../../move-if-change reloc.tmp reloc.texi
+ touch $@
-section.texi: chew.c $(srcdir)/../section.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../section.c >section.tmp
+section.texi: section.stamp ; @true
+section.stamp: $(srcdir)/../section.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >section.tmp
$(SHELL) $(srcdir)/../../move-if-change section.tmp section.texi
+ touch $@
-syms.texi: chew.c $(srcdir)/../syms.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../syms.c >syms.tmp
+syms.texi: syms.stamp ; @true
+syms.stamp: $(srcdir)/../syms.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >syms.tmp
$(SHELL) $(srcdir)/../../move-if-change syms.tmp syms.texi
+ touch $@
-targets.texi: chew.c $(srcdir)/../targets.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../targets.c >targets.tmp
+targets.texi: targets.stamp ; @true
+targets.stamp: $(srcdir)/../targets.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >targets.tmp
$(SHELL) $(srcdir)/../../move-if-change targets.tmp targets.texi
+ touch $@
-init.texi: chew.c $(srcdir)/../init.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../init.c >init.tmp
+init.texi: init.stamp ; @true
+init.stamp: $(srcdir)/../init.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >init.tmp
$(SHELL) $(srcdir)/../../move-if-change init.tmp init.texi
+ touch $@
-hash.texi: chew.c $(srcdir)/../hash.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../hash.c >hash.tmp
+hash.texi: hash.stamp ; @true
+hash.stamp: $(srcdir)/../hash.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >hash.tmp
$(SHELL) $(srcdir)/../../move-if-change hash.tmp hash.texi
+ touch $@
-linker.texi: chew.c $(srcdir)/../linker.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../linker.c >linker.tmp
+linker.texi: linker.stamp ; @true
+linker.stamp: $(srcdir)/../linker.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >linker.tmp
$(SHELL) $(srcdir)/../../move-if-change linker.tmp linker.texi
+ touch $@
LIBBFD_H_DEP = \
$(srcdir)/../libbfd-in.h \
@@ -301,7 +326,7 @@ bfdver.texi: $(srcdir)/Makefile.in
noinst_TEXINFOS = bfdint.texi
-MOSTLYCLEANFILES = $(MKDOC) *.o
+MOSTLYCLEANFILES = $(MKDOC) *.o *.stamp
CLEANFILES = *.p *.ip
diff --git a/binutils-2.25/bfd/doc/Makefile.in b/binutils-2.25/bfd/doc/Makefile.in
index 5156ba72..65ad42db 100644
--- a/binutils-2.25/bfd/doc/Makefile.in
+++ b/binutils-2.25/bfd/doc/Makefile.in
@@ -16,7 +16,7 @@
@SET_MAKE@
#
-# Copyright 2012 Free Software Foundation
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -76,7 +76,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
$(top_srcdir)/bfd.m4 $(top_srcdir)/warning.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/zlib.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/version.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
@@ -390,7 +390,7 @@ BFD_H_DEP = \
$(MKDOC)
noinst_TEXINFOS = bfdint.texi
-MOSTLYCLEANFILES = $(MKDOC) *.o
+MOSTLYCLEANFILES = $(MKDOC) *.o *.stamp
CLEANFILES = *.p *.ip
DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log \
$(am__append_1)
@@ -775,10 +775,13 @@ uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
uninstall-info-am uninstall-pdf-am uninstall-ps-am
-$(MKDOC): $(srcdir)/chew.c
+$(MKDOC): chew.stamp ; @true
+chew.stamp: $(srcdir)/chew.c
$(CC_FOR_BUILD) -o chw$$$$$(EXEEXT_FOR_BUILD) $(CFLAGS_FOR_BUILD) \
$(LDFLAGS_FOR_BUILD) $(H_CFLAGS) $(AM_CPPFLAGS) $(srcdir)/chew.c; \
- $(SHELL) $(srcdir)/../../move-if-change chw$$$$$(EXEEXT_FOR_BUILD) $(MKDOC)
+ $(SHELL) $(srcdir)/../../move-if-change \
+ chw$$$$$(EXEEXT_FOR_BUILD) $(MKDOC); \
+ touch $@
protos: libbfd.h libcoff.h bfd.h
@@ -790,117 +793,139 @@ protos: libbfd.h libcoff.h bfd.h
# program. If somebody tries to rebuild info, but none of the .texi files
# have changed, then nothing will be rebuilt.
-aoutx.texi: chew.c $(srcdir)/../aoutx.h $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../aoutx.h >aoutx.tmp
+aoutx.texi: aoutx.stamp ; @true
+aoutx.stamp: $(srcdir)/../aoutx.h $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >aoutx.tmp
$(SHELL) $(srcdir)/../../move-if-change aoutx.tmp aoutx.texi
+ touch $@
-archive.texi: chew.c $(srcdir)/../archive.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../archive.c >archive.tmp
+archive.texi: archive.stamp ; @true
+archive.stamp: $(srcdir)/../archive.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >archive.tmp
$(SHELL) $(srcdir)/../../move-if-change archive.tmp archive.texi
+ touch $@
-archures.texi: chew.c $(srcdir)/../archures.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../archures.c >archures.tmp
+archures.texi: archures.stamp ; @true
+archures.stamp: $(srcdir)/../archures.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >archures.tmp
$(SHELL) $(srcdir)/../../move-if-change archures.tmp archures.texi
+ touch $@
# We use bfdt.texi, rather than bfd.texi, to avoid conflicting with
# bfd.texinfo on an 8.3 filesystem.
-bfdt.texi: chew.c $(srcdir)/../bfd.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfd.c >bfd.tmp
+bfdt.texi: bfdt.stamp ; @true
+bfdt.stamp: $(srcdir)/../bfd.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfd.tmp
$(SHELL) $(srcdir)/../../move-if-change bfd.tmp bfdt.texi
+ touch $@
-cache.texi: chew.c $(srcdir)/../cache.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../cache.c >cache.tmp
+cache.texi: cache.stamp ; @true
+cache.stamp: $(srcdir)/../cache.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >cache.tmp
$(SHELL) $(srcdir)/../../move-if-change cache.tmp cache.texi
+ touch $@
-coffcode.texi: chew.c $(srcdir)/../coffcode.h $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../coffcode.h >coffcode.tmp
+coffcode.texi: coffcode.stamp ; @true
+coffcode.stamp: $(srcdir)/../coffcode.h $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >coffcode.tmp
$(SHELL) $(srcdir)/../../move-if-change coffcode.tmp coffcode.texi
+ touch $@
-core.texi: chew.c $(srcdir)/../corefile.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../corefile.c >core.tmp
+core.texi: core.stamp ; @true
+core.stamp: $(srcdir)/../corefile.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >core.tmp
$(SHELL) $(srcdir)/../../move-if-change core.tmp core.texi
+ touch $@
-elf.texi: chew.c $(srcdir)/../elf.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elf.c >elf.tmp
+elf.texi: elf.stamp ; @true
+elf.stamp: $(srcdir)/../elf.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >elf.tmp
$(SHELL) $(srcdir)/../../move-if-change elf.tmp elf.texi
+ touch $@
-elfcode.texi: chew.c $(srcdir)/../elfcode.h $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elfcode.h >elfcode.tmp
+elfcode.texi: elfcode.stamp ; @true
+elfcode.stamp: $(srcdir)/../elfcode.h $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >elfcode.tmp
$(SHELL) $(srcdir)/../../move-if-change elfcode.tmp elfcode.texi
+ touch $@
-mmo.texi: chew.c $(srcdir)/../mmo.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp
+mmo.texi: mmo.stamp ; @true
+mmo.stamp: $(srcdir)/../mmo.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >mmo.tmp
$(SHELL) $(srcdir)/../../move-if-change mmo.tmp mmo.texi
+ touch $@
-format.texi: chew.c $(srcdir)/../format.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp
+format.texi: format.stamp ; @true
+format.stamp: $(srcdir)/../format.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >format.tmp
$(SHELL) $(srcdir)/../../move-if-change format.tmp format.texi
+ touch $@
-libbfd.texi: chew.c $(srcdir)/../libbfd.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../libbfd.c >libbfd.tmp
+libbfd.texi: libbfd.stamp ; @true
+libbfd.stamp: $(srcdir)/../libbfd.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >libbfd.tmp
$(SHELL) $(srcdir)/../../move-if-change libbfd.tmp libbfd.texi
+ touch $@
-bfdio.texi: chew.c $(srcdir)/../bfdio.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdio.c >bfdio.tmp
+bfdio.texi: bfdio.stamp ; @true
+bfdio.stamp: $(srcdir)/../bfdio.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfdio.tmp
$(SHELL) $(srcdir)/../../move-if-change bfdio.tmp bfdio.texi
+ touch $@
-bfdwin.texi: chew.c $(srcdir)/../bfdwin.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdwin.c >bfdwin.tmp
+bfdwin.texi: bfdwin.stamp ; @true
+bfdwin.stamp: $(srcdir)/../bfdwin.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfdwin.tmp
$(SHELL) $(srcdir)/../../move-if-change bfdwin.tmp bfdwin.texi
+ touch $@
-opncls.texi: chew.c $(srcdir)/../opncls.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../opncls.c >opncls.tmp
+opncls.texi: opncls.stamp ; @true
+opncls.stamp: $(srcdir)/../opncls.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >opncls.tmp
$(SHELL) $(srcdir)/../../move-if-change opncls.tmp opncls.texi
+ touch $@
-reloc.texi: chew.c $(srcdir)/../reloc.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../reloc.c >reloc.tmp
+reloc.texi: reloc.stamp ; @true
+reloc.stamp: $(srcdir)/../reloc.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >reloc.tmp
$(SHELL) $(srcdir)/../../move-if-change reloc.tmp reloc.texi
+ touch $@
-section.texi: chew.c $(srcdir)/../section.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../section.c >section.tmp
+section.texi: section.stamp ; @true
+section.stamp: $(srcdir)/../section.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >section.tmp
$(SHELL) $(srcdir)/../../move-if-change section.tmp section.texi
+ touch $@
-syms.texi: chew.c $(srcdir)/../syms.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../syms.c >syms.tmp
+syms.texi: syms.stamp ; @true
+syms.stamp: $(srcdir)/../syms.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >syms.tmp
$(SHELL) $(srcdir)/../../move-if-change syms.tmp syms.texi
+ touch $@
-targets.texi: chew.c $(srcdir)/../targets.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../targets.c >targets.tmp
+targets.texi: targets.stamp ; @true
+targets.stamp: $(srcdir)/../targets.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >targets.tmp
$(SHELL) $(srcdir)/../../move-if-change targets.tmp targets.texi
+ touch $@
-init.texi: chew.c $(srcdir)/../init.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../init.c >init.tmp
+init.texi: init.stamp ; @true
+init.stamp: $(srcdir)/../init.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >init.tmp
$(SHELL) $(srcdir)/../../move-if-change init.tmp init.texi
+ touch $@
-hash.texi: chew.c $(srcdir)/../hash.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../hash.c >hash.tmp
+hash.texi: hash.stamp ; @true
+hash.stamp: $(srcdir)/../hash.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >hash.tmp
$(SHELL) $(srcdir)/../../move-if-change hash.tmp hash.texi
+ touch $@
-linker.texi: chew.c $(srcdir)/../linker.c $(srcdir)/doc.str
- $(MAKE) $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../linker.c >linker.tmp
+linker.texi: linker.stamp ; @true
+linker.stamp: $(srcdir)/../linker.c $(srcdir)/doc.str $(MKDOC)
+ ./$(MKDOC) -f $(srcdir)/doc.str < $< >linker.tmp
$(SHELL) $(srcdir)/../../move-if-change linker.tmp linker.texi
+ touch $@
libbfd.h: $(LIBBFD_H_DEP)
echo "$(LIBBFD_H_DEP)" | sed -f $(srcdir)/header.sed > $@
diff --git a/binutils-2.25/bfd/doc/bfd.texinfo b/binutils-2.25/bfd/doc/bfd.texinfo
index ec709c1d..040b8d8f 100644
--- a/binutils-2.25/bfd/doc/bfd.texinfo
+++ b/binutils-2.25/bfd/doc/bfd.texinfo
@@ -1,6 +1,6 @@
\input texinfo.tex
@setfilename bfd.info
-@c Copyright 1988-2013 Free Software Foundation, Inc.
+@c Copyright (C) 1988-2014 Free Software Foundation, Inc.
@c
@synindex fn cp
@@ -14,7 +14,7 @@
@copying
This file documents the BFD library.
-Copyright @copyright{} 1991 - 2013 Free Software Foundation, Inc.
+Copyright @copyright{} 1991-2014 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -62,7 +62,7 @@ included in the section entitled ``GNU Free Documentation License''.
@end tex
@vskip 0pt plus 1filll
-Copyright @copyright{} 1991 - 2013 Free Software Foundation, Inc.
+Copyright @copyright{} 1991-2014 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
diff --git a/binutils-2.25/bfd/doc/bfdint.texi b/binutils-2.25/bfd/doc/bfdint.texi
index 1e03aeb8..5e335c8e 100644
--- a/binutils-2.25/bfd/doc/bfdint.texi
+++ b/binutils-2.25/bfd/doc/bfdint.texi
@@ -1,7 +1,5 @@
\input texinfo
-@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
-@c 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2009
-@c Free Software Foundation, Inc.
+@c Copyright (C) 1988-2014 Free Software Foundation, Inc.
@setfilename bfdint.info
@settitle BFD Internals
@@ -16,9 +14,7 @@
@copying
This file documents the internals of the BFD library.
-Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-1996, 1998, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2009
-Free Software Foundation, Inc.
+Copyright @copyright{} 1988-2014 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Permission is granted to copy, distribute and/or modify this document
@@ -945,7 +941,7 @@ BFD. Some files are automatically rebuilt at make time, but only if
you configure with the @samp{--enable-maintainer-mode} option. Some
files live in the object directory---the directory from which you run
configure---and some live in the source directory. All files that live
-in the source directory are checked into the CVS repository.
+in the source directory are checked into the git repository.
@table @file
@item bfd.h
@@ -1552,7 +1548,7 @@ following:
Define either @samp{TARGET_BIG_SYM} or @samp{TARGET_LITTLE_SYM}, or
both, to a unique C name to use for the target vector. This name should
appear in the list of target vectors in @file{targets.c}, and will also
-have to appear in @file{config.bfd} and @file{configure.in}. Define
+have to appear in @file{config.bfd} and @file{configure.ac}. Define
@samp{TARGET_BIG_SYM} for a big-endian processor,
@samp{TARGET_LITTLE_SYM} for a little-endian processor, and define both
for a bi-endian processor.
diff --git a/binutils-2.25/bfd/doc/bfdsumm.texi b/binutils-2.25/bfd/doc/bfdsumm.texi
index 0cd02521..1616be44 100644
--- a/binutils-2.25/bfd/doc/bfdsumm.texi
+++ b/binutils-2.25/bfd/doc/bfdsumm.texi
@@ -1,6 +1,5 @@
@c This summary of BFD is shared by the BFD and LD docs.
-@c Copyright 2012
-@c Free Software Foundation, Inc.
+@c Copyright (C) 2012-2014 Free Software Foundation, Inc.
When an object file is opened, BFD subroutines automatically determine
the format of the input object file. They then build a descriptor in
diff --git a/binutils-2.25/bfd/doc/chew.c b/binutils-2.25/bfd/doc/chew.c
index b019837b..9ad88aaa 100644
--- a/binutils-2.25/bfd/doc/chew.c
+++ b/binutils-2.25/bfd/doc/chew.c
@@ -1,7 +1,5 @@
/* chew
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001,
- 2002, 2003, 2005, 2007, 2009, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Contributed by steve chamberlain @cygnus
This file is part of BFD, the Binary File Descriptor library.
@@ -267,6 +265,19 @@ skip_white_and_stars (src, idx)
return idx;
}
+static unsigned int
+skip_past_newline_1 (ptr, idx)
+ string_type *ptr;
+ unsigned int idx;
+{
+ while (at (ptr, idx)
+ && at (ptr, idx) != '\n')
+ idx++;
+ if (at (ptr, idx) == '\n')
+ return idx + 1;
+ return idx;
+}
+
/***********************************************************************/
string_type stack[STACK];
@@ -476,8 +487,10 @@ remove_noncomments (src, dst)
static void
print_stack_level ()
{
- fprintf (stderr, "current string stack depth = %ld, ", tos - stack);
- fprintf (stderr, "current integer stack depth = %ld\n", isp - istack);
+ fprintf (stderr, "current string stack depth = %ld, ",
+ (long) (tos - stack));
+ fprintf (stderr, "current integer stack depth = %ld\n",
+ (long) (isp - istack));
pc++;
}
@@ -603,10 +616,12 @@ outputdots ()
while (at (tos, idx))
{
- if (at (tos, idx) == '\n' && at (tos, idx + 1) == '.')
+ /* Every iteration begins at the start of a line. */
+ if (at (tos, idx) == '.')
{
char c;
- idx += 2;
+
+ idx++;
while ((c = at (tos, idx)) && c != '\n')
{
@@ -626,11 +641,13 @@ outputdots ()
idx++;
}
}
+ if (c == '\n')
+ idx++;
catchar (&out, '\n');
}
else
{
- idx++;
+ idx = skip_past_newline_1 (tos, idx);
}
}
@@ -1095,10 +1112,7 @@ icatstr ()
static void
skip_past_newline ()
{
- while (at (ptr, idx)
- && at (ptr, idx) != '\n')
- idx++;
- idx++;
+ idx = skip_past_newline_1 (ptr, idx);
pc++;
}
@@ -1564,7 +1578,7 @@ main (ac, av)
if (tos != stack)
{
fprintf (stderr, "finishing with current stack level %ld\n",
- tos - stack);
+ (long) (tos - stack));
return 1;
}
return 0;
diff --git a/binutils-2.25/bfd/doc/makefile.vms b/binutils-2.25/bfd/doc/makefile.vms
index 267af6b6..26feca60 100644
--- a/binutils-2.25/bfd/doc/makefile.vms
+++ b/binutils-2.25/bfd/doc/makefile.vms
@@ -1,4 +1,4 @@
-# Copyright 2012 Free Software Foundation
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/binutils-2.25/bfd/dwarf1.c b/binutils-2.25/bfd/dwarf1.c
index 375f4cf1..6c292efa 100644
--- a/binutils-2.25/bfd/dwarf1.c
+++ b/binutils-2.25/bfd/dwarf1.c
@@ -1,6 +1,5 @@
/* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line).
- Copyright 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com).
@@ -450,8 +449,8 @@ dwarf1_unit_find_nearest_line (struct dwarf1_debug* stash,
bfd_boolean
_bfd_dwarf1_find_nearest_line (bfd *abfd,
- asection *section,
asymbol **symbols,
+ asection *section,
bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr,
diff --git a/binutils-2.25/bfd/dwarf2.c b/binutils-2.25/bfd/dwarf2.c
index c9349da3..8375da43 100644
--- a/binutils-2.25/bfd/dwarf2.c
+++ b/binutils-2.25/bfd/dwarf2.c
@@ -1,5 +1,5 @@
/* DWARF 2 support.
- Copyright 1994-2013 Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions
(gavin@cygnus.com).
@@ -156,8 +156,11 @@ struct dwarf2_debug
use. */
struct funcinfo *inliner_chain;
+ /* Section VMAs at the time the stash was built. */
+ bfd_vma *sec_vma;
+
/* Number of sections whose VMA we must adjust. */
- unsigned int adjusted_section_count;
+ int adjusted_section_count;
/* Array of sections with adjusted VMA. */
struct adjusted_section *adjusted_sections;
@@ -398,7 +401,7 @@ info_hash_table_newfunc (struct bfd_hash_entry *entry,
if (ret == NULL)
{
ret = (struct info_hash_entry *) bfd_hash_allocate (table,
- sizeof (* ret));
+ sizeof (* ret));
if (ret == NULL)
return NULL;
}
@@ -458,7 +461,7 @@ insert_info_hash_table (struct info_hash_table *hash_table,
return FALSE;
node = (struct info_list_node *) bfd_hash_allocate (&hash_table->base,
- sizeof (*node));
+ sizeof (*node));
if (!node)
return FALSE;
@@ -506,13 +509,13 @@ read_section (bfd * abfd,
if (! msec)
{
section_name = sec->compressed_name;
- if (section_name != NULL)
- msec = bfd_get_section_by_name (abfd, section_name);
+ if (section_name != NULL)
+ msec = bfd_get_section_by_name (abfd, section_name);
}
if (! msec)
{
(*_bfd_error_handler) (_("Dwarf Error: Can't find %s section."),
- sec->uncompressed_name);
+ sec->uncompressed_name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
@@ -631,7 +634,7 @@ read_indirect_string (struct comp_unit * unit,
*bytes_read_ptr = unit->offset_size;
if (! read_section (unit->abfd, &stash->debug_sections[debug_str],
- stash->syms, offset,
+ stash->syms, offset,
&stash->dwarf_str_buffer, &stash->dwarf_str_size))
return NULL;
@@ -642,7 +645,7 @@ read_indirect_string (struct comp_unit * unit,
}
/* Like read_indirect_string but uses a .debug_str located in
- an alternate filepointed to by the .gnu_debuglink section.
+ an alternate file pointed to by the .gnu_debugaltlink section.
Used to impement DW_FORM_GNU_strp_alt. */
static char *
@@ -812,7 +815,7 @@ read_abbrevs (bfd *abfd, bfd_uint64_t offset, struct dwarf2_debug *stash)
bfd_size_type amt;
if (! read_section (abfd, &stash->debug_sections[debug_abbrev],
- stash->syms, offset,
+ stash->syms, offset,
&stash->dwarf_abbrev_buffer, &stash->dwarf_abbrev_size))
return NULL;
@@ -908,6 +911,14 @@ read_abbrevs (bfd *abfd, bfd_uint64_t offset, struct dwarf2_debug *stash)
return abbrevs;
}
+/* Returns true if the form is one which has a string value. */
+
+static inline bfd_boolean
+is_str_attr (enum dwarf_form form)
+{
+ return form == DW_FORM_string || form == DW_FORM_strp || form == DW_FORM_GNU_strp_alt;
+}
+
/* Read an attribute value described by an attribute form. */
static bfd_byte *
@@ -1310,7 +1321,7 @@ add_line_info (struct line_info_table *table,
info->prev_line = table->lcl_head->prev_line;
table->lcl_head->prev_line = info;
if (address < seq->low_pc)
- seq->low_pc = address;
+ seq->low_pc = address;
}
return TRUE;
}
@@ -1501,21 +1512,21 @@ sort_line_sequences (struct line_info_table* table)
for (n = 1; n < table->num_sequences; n++)
{
if (sequences[n].low_pc < last_high_pc)
- {
+ {
if (sequences[n].last_line->address <= last_high_pc)
/* Skip nested entries. */
continue;
/* Trim overlapping entries. */
sequences[n].low_pc = last_high_pc;
- }
+ }
last_high_pc = sequences[n].last_line->address;
if (n > num_sequences)
- {
- /* Close up the gap. */
- sequences[num_sequences].low_pc = sequences[n].low_pc;
- sequences[num_sequences].last_line = sequences[n].last_line;
- }
+ {
+ /* Close up the gap. */
+ sequences[num_sequences].low_pc = sequences[n].low_pc;
+ sequences[num_sequences].last_line = sequences[n].last_line;
+ }
num_sequences++;
}
@@ -1541,7 +1552,7 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
bfd_size_type amt;
if (! read_section (abfd, &stash->debug_sections[debug_line],
- stash->syms, unit->line_offset,
+ stash->syms, unit->line_offset,
&stash->dwarf_line_buffer, &stash->dwarf_line_size))
return NULL;
@@ -1734,7 +1745,7 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
if (!add_line_info (table, address, op_index, filename,
line, column, discriminator, 0))
goto line_fail;
- discriminator = 0;
+ discriminator = 0;
if (address < low_pc)
low_pc = address;
if (address > high_pc)
@@ -1755,7 +1766,7 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
if (!add_line_info (table, address, op_index, filename, line,
column, discriminator, end_sequence))
goto line_fail;
- discriminator = 0;
+ discriminator = 0;
if (address < low_pc)
low_pc = address;
if (address > high_pc)
@@ -1796,7 +1807,7 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
break;
case DW_LNE_set_discriminator:
discriminator =
- read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
line_ptr += bytes_read;
break;
case DW_LNE_HP_source_file_correlation:
@@ -1816,7 +1827,7 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
if (!add_line_info (table, address, op_index,
filename, line, column, discriminator, 0))
goto line_fail;
- discriminator = 0;
+ discriminator = 0;
if (address < low_pc)
low_pc = address;
if (address > high_pc)
@@ -1909,11 +1920,13 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
return NULL;
}
-/* If ADDR is within TABLE set the output parameters and return TRUE,
- otherwise return FALSE. The output parameters, FILENAME_PTR and
- LINENUMBER_PTR, are pointers to the objects to be filled in. */
+/* If ADDR is within TABLE set the output parameters and return the
+ range of addresses covered by the entry used to fill them out.
+ Otherwise set * FILENAME_PTR to NULL and return 0.
+ The parameters FILENAME_PTR, LINENUMBER_PTR and DISCRIMINATOR_PTR
+ are pointers to the objects to be filled in. */
-static bfd_boolean
+static bfd_vma
lookup_address_in_line_info_table (struct line_info_table *table,
bfd_vma addr,
const char **filename_ptr,
@@ -1943,24 +1956,24 @@ lookup_address_in_line_info_table (struct line_info_table *table,
{
/* Note: seq->last_line should be a descendingly sorted list. */
for (each_line = seq->last_line;
- each_line;
- each_line = each_line->prev_line)
- if (addr >= each_line->address)
- break;
+ each_line;
+ each_line = each_line->prev_line)
+ if (addr >= each_line->address)
+ break;
if (each_line
- && !(each_line->end_sequence || each_line == seq->last_line))
- {
- *filename_ptr = each_line->filename;
- *linenumber_ptr = each_line->line;
- if (discriminator_ptr)
- *discriminator_ptr = each_line->discriminator;
- return TRUE;
- }
+ && !(each_line->end_sequence || each_line == seq->last_line))
+ {
+ *filename_ptr = each_line->filename;
+ *linenumber_ptr = each_line->line;
+ if (discriminator_ptr)
+ *discriminator_ptr = each_line->discriminator;
+ return seq->last_line->address - seq->low_pc;
+ }
}
*filename_ptr = NULL;
- return FALSE;
+ return 0;
}
/* Read in the .debug_ranges section for future reference. */
@@ -1970,16 +1983,16 @@ read_debug_ranges (struct comp_unit *unit)
{
struct dwarf2_debug *stash = unit->stash;
return read_section (unit->abfd, &stash->debug_sections[debug_ranges],
- stash->syms, 0,
+ stash->syms, 0,
&stash->dwarf_ranges_buffer, &stash->dwarf_ranges_size);
}
/* Function table functions. */
-/* If ADDR is within TABLE, set FUNCTIONNAME_PTR, and return TRUE.
- Note that we need to find the function that has the smallest
- range that contains ADDR, to handle inlined functions without
- depending upon them being ordered in TABLE by increasing range. */
+/* If ADDR is within UNIT's function tables, set FUNCTIONNAME_PTR, and return
+ TRUE. Note that we need to find the function that has the smallest range
+ that contains ADDR, to handle inlined functions without depending upon
+ them being ordered in TABLE by increasing range. */
static bfd_boolean
lookup_address_in_function_table (struct comp_unit *unit,
@@ -1989,6 +2002,7 @@ lookup_address_in_function_table (struct comp_unit *unit,
{
struct funcinfo* each_func;
struct funcinfo* best_fit = NULL;
+ bfd_vma best_fit_len = 0;
struct arange *arange;
for (each_func = unit->function_table;
@@ -2002,9 +2016,11 @@ lookup_address_in_function_table (struct comp_unit *unit,
if (addr >= arange->low && addr < arange->high)
{
if (!best_fit
- || (arange->high - arange->low
- < best_fit->arange.high - best_fit->arange.low))
- best_fit = each_func;
+ || arange->high - arange->low < best_fit_len)
+ {
+ best_fit = each_func;
+ best_fit_len = arange->high - arange->low;
+ }
}
}
}
@@ -2033,6 +2049,7 @@ lookup_symbol_in_function_table (struct comp_unit *unit,
{
struct funcinfo* each_func;
struct funcinfo* best_fit = NULL;
+ bfd_vma best_fit_len = 0;
struct arange *arange;
const char *name = bfd_asymbol_name (sym);
asection *sec = bfd_get_section (sym);
@@ -2051,9 +2068,11 @@ lookup_symbol_in_function_table (struct comp_unit *unit,
&& each_func->name
&& strcmp (name, each_func->name) == 0
&& (!best_fit
- || (arange->high - arange->low
- < best_fit->arange.high - best_fit->arange.low)))
- best_fit = each_func;
+ || arange->high - arange->low < best_fit_len))
+ {
+ best_fit = each_func;
+ best_fit_len = arange->high - arange->low;
+ }
}
}
@@ -2126,6 +2145,28 @@ find_abstract_instance_name (struct comp_unit *unit,
abort ();
info_ptr = unit->sec_info_ptr + die_ref;
+
+ /* Now find the CU containing this pointer. */
+ if (info_ptr >= unit->info_ptr_unit && info_ptr < unit->end_ptr)
+ ;
+ else
+ {
+ /* Check other CUs to see if they contain the abbrev. */
+ struct comp_unit * u;
+
+ for (u = unit->prev_unit; u != NULL; u = u->prev_unit)
+ if (info_ptr >= u->info_ptr_unit && info_ptr < u->end_ptr)
+ break;
+
+ if (u == NULL)
+ for (u = unit->next_unit; u != NULL; u = u->next_unit)
+ if (info_ptr >= u->info_ptr_unit && info_ptr < u->end_ptr)
+ break;
+
+ if (u)
+ unit = u;
+ /* else FIXME: What do we do now ? */
+ }
}
else if (attr_ptr->form == DW_FORM_GNU_ref_alt)
{
@@ -2137,6 +2178,8 @@ find_abstract_instance_name (struct comp_unit *unit,
bfd_set_error (bfd_error_bad_value);
return name;
}
+ /* FIXME: Do we need to locate the correct CU, in a similar
+ fashion to the code in the DW_FORM_ref_addr case above ? */
}
else
info_ptr = unit->info_ptr_unit + die_ref;
@@ -2166,7 +2209,7 @@ find_abstract_instance_name (struct comp_unit *unit,
case DW_AT_name:
/* Prefer DW_AT_MIPS_linkage_name or DW_AT_linkage_name
over DW_AT_name. */
- if (name == NULL)
+ if (name == NULL && is_str_attr (attr.form))
name = attr.u.str;
break;
case DW_AT_specification:
@@ -2174,7 +2217,10 @@ find_abstract_instance_name (struct comp_unit *unit,
break;
case DW_AT_linkage_name:
case DW_AT_MIPS_linkage_name:
- name = attr.u.str;
+ /* PR 16949: Corrupt debug info can place
+ non-string forms into these attributes. */
+ if (is_str_attr (attr.form))
+ name = attr.u.str;
break;
default:
break;
@@ -2346,13 +2392,16 @@ scan_unit_for_symbols (struct comp_unit *unit)
case DW_AT_name:
/* Prefer DW_AT_MIPS_linkage_name or DW_AT_linkage_name
over DW_AT_name. */
- if (func->name == NULL)
+ if (func->name == NULL && is_str_attr (attr.form))
func->name = attr.u.str;
break;
case DW_AT_linkage_name:
case DW_AT_MIPS_linkage_name:
- func->name = attr.u.str;
+ /* PR 16949: Corrupt debug info can place
+ non-string forms into these attributes. */
+ if (is_str_attr (attr.form))
+ func->name = attr.u.str;
break;
case DW_AT_low_pc:
@@ -2687,10 +2736,10 @@ comp_unit_contains_address (struct comp_unit *unit, bfd_vma addr)
FUNCTIONNAME_PTR, and LINENUMBER_PTR, are pointers to the objects
to be filled in.
- Return TRUE if UNIT contains ADDR, and no errors were encountered;
- FALSE otherwise. */
+ Returns the range of addresses covered by the entry that was used
+ to fill in *LINENUMBER_PTR or 0 if it was not filled in. */
-static bfd_boolean
+static bfd_vma
comp_unit_find_nearest_line (struct comp_unit *unit,
bfd_vma addr,
const char **filename_ptr,
@@ -2699,7 +2748,6 @@ comp_unit_find_nearest_line (struct comp_unit *unit,
unsigned int *discriminator_ptr,
struct dwarf2_debug *stash)
{
- bfd_boolean line_p;
bfd_boolean func_p;
struct funcinfo *function;
@@ -2735,11 +2783,11 @@ comp_unit_find_nearest_line (struct comp_unit *unit,
&function, functionname_ptr);
if (func_p && (function->tag == DW_TAG_inlined_subroutine))
stash->inliner_chain = function;
- line_p = lookup_address_in_line_info_table (unit->line_table, addr,
- filename_ptr,
- linenumber_ptr,
- discriminator_ptr);
- return line_p || func_p;
+
+ return lookup_address_in_line_info_table (unit->line_table, addr,
+ filename_ptr,
+ linenumber_ptr,
+ discriminator_ptr);
}
/* Check to see if line info is already decoded in a comp_unit.
@@ -2918,7 +2966,7 @@ comp_unit_hash_info (struct dwarf2_debug *stash,
static asection *
find_debug_info (bfd *abfd, const struct dwarf_debug_section *debug_sections,
- asection *after_sec)
+ asection *after_sec)
{
asection *msec;
const char *look;
@@ -2962,12 +3010,36 @@ find_debug_info (bfd *abfd, const struct dwarf_debug_section *debug_sections,
return NULL;
}
+/* Transfer VMAs from object file to separate debug file. */
+
+static void
+set_debug_vma (bfd *orig_bfd, bfd *debug_bfd)
+{
+ asection *s, *d;
+
+ for (s = orig_bfd->sections, d = debug_bfd->sections;
+ s != NULL && d != NULL;
+ s = s->next, d = d->next)
+ {
+ if ((d->flags & SEC_DEBUGGING) != 0)
+ break;
+ /* ??? Assumes 1-1 correspondence between sections in the
+ two files. */
+ if (strcmp (s->name, d->name) == 0)
+ {
+ d->output_section = s->output_section;
+ d->output_offset = s->output_offset;
+ d->vma = s->vma;
+ }
+ }
+}
+
/* Unset vmas for adjusted sections in STASH. */
static void
unset_sections (struct dwarf2_debug *stash)
{
- unsigned int i;
+ int i;
struct adjusted_section *p;
i = stash->adjusted_section_count;
@@ -2976,14 +3048,23 @@ unset_sections (struct dwarf2_debug *stash)
p->section->vma = 0;
}
-/* Set unique VMAs for loadable and DWARF sections in ABFD and save
- VMAs in STASH for unset_sections. */
+/* Set VMAs for allocated and .debug_info sections in ORIG_BFD, a
+ relocatable object file. VMAs are normally all zero in relocatable
+ object files, so if we want to distinguish locations in sections by
+ address we need to set VMAs so the sections do not overlap. We
+ also set VMA on .debug_info so that when we have multiple
+ .debug_info sections (or the linkonce variant) they also do not
+ overlap. The multiple .debug_info sections make up a single
+ logical section. ??? We should probably do the same for other
+ debug sections. */
static bfd_boolean
-place_sections (bfd *abfd, struct dwarf2_debug *stash)
+place_sections (bfd *orig_bfd, struct dwarf2_debug *stash)
{
+ bfd *abfd;
struct adjusted_section *p;
- unsigned int i;
+ int i;
+ const char *debug_info_name;
if (stash->adjusted_section_count != 0)
{
@@ -2991,103 +3072,109 @@ place_sections (bfd *abfd, struct dwarf2_debug *stash)
p = stash->adjusted_sections;
for (; i > 0; i--, p++)
p->section->vma = p->adj_vma;
+ return TRUE;
}
- else
+
+ debug_info_name = stash->debug_sections[debug_info].uncompressed_name;
+ i = 0;
+ abfd = orig_bfd;
+ while (1)
{
asection *sect;
- bfd_vma last_vma = 0, last_dwarf = 0;
- bfd_size_type amt;
- const char *debug_info_name;
- debug_info_name = stash->debug_sections[debug_info].uncompressed_name;
- i = 0;
for (sect = abfd->sections; sect != NULL; sect = sect->next)
{
- bfd_size_type sz;
int is_debug_info;
- if (sect->vma != 0)
+ if ((sect->output_section != NULL
+ && sect->output_section != sect
+ && (sect->flags & SEC_DEBUGGING) == 0)
+ || sect->vma != 0)
continue;
- /* We need to adjust the VMAs of any .debug_info sections.
- Skip compressed ones, since no relocations could target
- them - they should not appear in object files anyway. */
- if (strcmp (sect->name, debug_info_name) == 0)
- is_debug_info = 1;
- else if (CONST_STRNEQ (sect->name, GNU_LINKONCE_INFO))
- is_debug_info = 1;
- else
- is_debug_info = 0;
-
- if (!is_debug_info && (sect->flags & SEC_LOAD) == 0)
- continue;
+ is_debug_info = (strcmp (sect->name, debug_info_name) == 0
+ || CONST_STRNEQ (sect->name, GNU_LINKONCE_INFO));
- sz = sect->rawsize ? sect->rawsize : sect->size;
- if (sz == 0)
+ if (!((sect->flags & SEC_ALLOC) != 0 && abfd == orig_bfd)
+ && !is_debug_info)
continue;
i++;
}
+ if (abfd == stash->bfd_ptr)
+ break;
+ abfd = stash->bfd_ptr;
+ }
- amt = i * sizeof (struct adjusted_section);
- p = (struct adjusted_section *) bfd_alloc (abfd, amt);
- if (! p)
+ if (i <= 1)
+ stash->adjusted_section_count = -1;
+ else
+ {
+ bfd_vma last_vma = 0, last_dwarf = 0;
+ bfd_size_type amt = i * sizeof (struct adjusted_section);
+
+ p = (struct adjusted_section *) bfd_malloc (amt);
+ if (p == NULL)
return FALSE;
stash->adjusted_sections = p;
stash->adjusted_section_count = i;
- for (sect = abfd->sections; sect != NULL; sect = sect->next)
+ abfd = orig_bfd;
+ while (1)
{
- bfd_size_type sz;
- int is_debug_info;
+ asection *sect;
- if (sect->vma != 0)
- continue;
+ for (sect = abfd->sections; sect != NULL; sect = sect->next)
+ {
+ bfd_size_type sz;
+ int is_debug_info;
- /* We need to adjust the VMAs of any .debug_info sections.
- Skip compressed ones, since no relocations could target
- them - they should not appear in object files anyway. */
- if (strcmp (sect->name, debug_info_name) == 0)
- is_debug_info = 1;
- else if (CONST_STRNEQ (sect->name, GNU_LINKONCE_INFO))
- is_debug_info = 1;
- else
- is_debug_info = 0;
+ if ((sect->output_section != NULL
+ && sect->output_section != sect
+ && (sect->flags & SEC_DEBUGGING) == 0)
+ || sect->vma != 0)
+ continue;
- if (!is_debug_info && (sect->flags & SEC_LOAD) == 0)
- continue;
+ is_debug_info = (strcmp (sect->name, debug_info_name) == 0
+ || CONST_STRNEQ (sect->name, GNU_LINKONCE_INFO));
- sz = sect->rawsize ? sect->rawsize : sect->size;
- if (sz == 0)
- continue;
+ if (!((sect->flags & SEC_ALLOC) != 0 && abfd == orig_bfd)
+ && !is_debug_info)
+ continue;
- p->section = sect;
- if (is_debug_info)
- {
- BFD_ASSERT (sect->alignment_power == 0);
- sect->vma = last_dwarf;
- last_dwarf += sz;
- }
- else if (last_vma != 0)
- {
- /* Align the new address to the current section
- alignment. */
- last_vma = ((last_vma
- + ~((bfd_vma) -1 << sect->alignment_power))
- & ((bfd_vma) -1 << sect->alignment_power));
- sect->vma = last_vma;
- last_vma += sect->vma + sz;
- }
- else
- last_vma += sect->vma + sz;
+ sz = sect->rawsize ? sect->rawsize : sect->size;
- p->adj_vma = sect->vma;
+ if (is_debug_info)
+ {
+ BFD_ASSERT (sect->alignment_power == 0);
+ sect->vma = last_dwarf;
+ last_dwarf += sz;
+ }
+ else
+ {
+ /* Align the new address to the current section
+ alignment. */
+ last_vma = ((last_vma
+ + ~((bfd_vma) -1 << sect->alignment_power))
+ & ((bfd_vma) -1 << sect->alignment_power));
+ sect->vma = last_vma;
+ last_vma += sz;
+ }
- p++;
+ p->section = sect;
+ p->adj_vma = sect->vma;
+ p++;
+ }
+ if (abfd == stash->bfd_ptr)
+ break;
+ abfd = stash->bfd_ptr;
}
}
+ if (orig_bfd != stash->bfd_ptr)
+ set_debug_vma (orig_bfd, stash->bfd_ptr);
+
return TRUE;
}
@@ -3106,6 +3193,7 @@ info_hash_lookup_funcinfo (struct info_hash_table *hash_table,
{
struct funcinfo* each_func;
struct funcinfo* best_fit = NULL;
+ bfd_vma best_fit_len = 0;
struct info_list_node *node;
struct arange *arange;
const char *name = bfd_asymbol_name (sym);
@@ -3124,9 +3212,11 @@ info_hash_lookup_funcinfo (struct info_hash_table *hash_table,
&& addr >= arange->low
&& addr < arange->high
&& (!best_fit
- || (arange->high - arange->low
- < best_fit->arange.high - best_fit->arange.low)))
- best_fit = each_func;
+ || arange->high - arange->low < best_fit_len))
+ {
+ best_fit = each_func;
+ best_fit_len = arange->high - arange->low;
+ }
}
}
@@ -3316,6 +3406,56 @@ stash_find_line_fast (struct dwarf2_debug *stash,
filename_ptr, linenumber_ptr);
}
+/* Save current section VMAs. */
+
+static bfd_boolean
+save_section_vma (const bfd *abfd, struct dwarf2_debug *stash)
+{
+ asection *s;
+ unsigned int i;
+
+ if (abfd->section_count == 0)
+ return TRUE;
+ stash->sec_vma = bfd_malloc (sizeof (*stash->sec_vma) * abfd->section_count);
+ if (stash->sec_vma == NULL)
+ return FALSE;
+ for (i = 0, s = abfd->sections; i < abfd->section_count; i++, s = s->next)
+ {
+ if (s->output_section != NULL)
+ stash->sec_vma[i] = s->output_section->vma + s->output_offset;
+ else
+ stash->sec_vma[i] = s->vma;
+ }
+ return TRUE;
+}
+
+/* Compare current section VMAs against those at the time the stash
+ was created. If find_nearest_line is used in linker warnings or
+ errors early in the link process, the debug info stash will be
+ invalid for later calls. This is because we relocate debug info
+ sections, so the stashed section contents depend on symbol values,
+ which in turn depend on section VMAs. */
+
+static bfd_boolean
+section_vma_same (const bfd *abfd, const struct dwarf2_debug *stash)
+{
+ asection *s;
+ unsigned int i;
+
+ for (i = 0, s = abfd->sections; i < abfd->section_count; i++, s = s->next)
+ {
+ bfd_vma vma;
+
+ if (s->output_section != NULL)
+ vma = s->output_section->vma + s->output_offset;
+ else
+ vma = s->vma;
+ if (vma != stash->sec_vma[i])
+ return FALSE;
+ }
+ return TRUE;
+}
+
/* Read debug information from DEBUG_BFD when DEBUG_BFD is specified.
If DEBUG_BFD is not specified, we read debug information from ABFD
or its gnu_debuglink. The results will be stored in PINFO.
@@ -3323,9 +3463,10 @@ stash_find_line_fast (struct dwarf2_debug *stash,
bfd_boolean
_bfd_dwarf2_slurp_debug_info (bfd *abfd, bfd *debug_bfd,
- const struct dwarf_debug_section *debug_sections,
- asymbol **symbols,
- void **pinfo)
+ const struct dwarf_debug_section *debug_sections,
+ asymbol **symbols,
+ void **pinfo,
+ bfd_boolean do_place)
{
bfd_size_type amt = sizeof (struct dwarf2_debug);
bfd_size_type total_size;
@@ -3333,13 +3474,22 @@ _bfd_dwarf2_slurp_debug_info (bfd *abfd, bfd *debug_bfd,
struct dwarf2_debug *stash = (struct dwarf2_debug *) *pinfo;
if (stash != NULL)
- return TRUE;
-
- stash = (struct dwarf2_debug *) bfd_zalloc (abfd, amt);
- if (! stash)
- return FALSE;
+ {
+ if (section_vma_same (abfd, stash))
+ return TRUE;
+ _bfd_dwarf2_cleanup_debug_info (abfd, pinfo);
+ memset (stash, 0, amt);
+ }
+ else
+ {
+ stash = (struct dwarf2_debug *) bfd_zalloc (abfd, amt);
+ if (! stash)
+ return FALSE;
+ }
stash->debug_sections = debug_sections;
stash->syms = symbols;
+ if (!save_section_vma (abfd, stash))
+ return FALSE;
*pinfo = stash;
@@ -3361,7 +3511,8 @@ _bfd_dwarf2_slurp_debug_info (bfd *abfd, bfd *debug_bfd,
if ((debug_bfd = bfd_openr (debug_filename, NULL)) == NULL
|| ! bfd_check_format (debug_bfd, bfd_object)
|| (msec = find_debug_info (debug_bfd,
- debug_sections, NULL)) == NULL)
+ debug_sections, NULL)) == NULL
+ || !bfd_generic_link_read_symbols (debug_bfd))
{
if (debug_bfd)
bfd_close (debug_bfd);
@@ -3369,10 +3520,17 @@ _bfd_dwarf2_slurp_debug_info (bfd *abfd, bfd *debug_bfd,
free (debug_filename);
return FALSE;
}
+
+ symbols = bfd_get_outsymbols (debug_bfd);
+ stash->syms = symbols;
stash->close_on_cleanup = TRUE;
}
stash->bfd_ptr = debug_bfd;
+ if (do_place
+ && !place_sections (abfd, stash))
+ return FALSE;
+
/* There can be more than one DWARF2 info section in a BFD these
days. First handle the easy case when there's only one. If
there's more than one, try case two: none of the sections is
@@ -3444,19 +3602,19 @@ _bfd_dwarf2_slurp_debug_info (bfd *abfd, bfd *debug_bfd,
field and in the abbreviation offset, or zero to indicate that the
default value should be used. */
-static bfd_boolean
-find_line (bfd *abfd,
- const struct dwarf_debug_section *debug_sections,
- asection *section,
- bfd_vma offset,
- asymbol *symbol,
- asymbol **symbols,
- const char **filename_ptr,
- const char **functionname_ptr,
- unsigned int *linenumber_ptr,
- unsigned int *discriminator_ptr,
- unsigned int addr_size,
- void **pinfo)
+bfd_boolean
+_bfd_dwarf2_find_nearest_line (bfd *abfd,
+ asymbol **symbols,
+ asymbol *symbol,
+ asection *section,
+ bfd_vma offset,
+ const char **filename_ptr,
+ const char **functionname_ptr,
+ unsigned int *linenumber_ptr,
+ unsigned int *discriminator_ptr,
+ const struct dwarf_debug_section *debug_sections,
+ unsigned int addr_size,
+ void **pinfo)
{
/* Read each compilation unit from the section .debug_info, and check
to see if it contains the address we are searching for. If yes,
@@ -3470,7 +3628,7 @@ find_line (bfd *abfd,
/* What address are we looking for? */
bfd_vma addr;
struct comp_unit* each;
- bfd_vma found = FALSE;
+ bfd_boolean found = FALSE;
bfd_boolean do_line;
*filename_ptr = NULL;
@@ -3480,35 +3638,25 @@ find_line (bfd *abfd,
if (discriminator_ptr)
*discriminator_ptr = 0;
- if (! _bfd_dwarf2_slurp_debug_info (abfd, NULL,
- debug_sections, symbols, pinfo))
+ if (! _bfd_dwarf2_slurp_debug_info (abfd, NULL, debug_sections,
+ symbols, pinfo,
+ (abfd->flags & (EXEC_P | DYNAMIC)) == 0))
return FALSE;
stash = (struct dwarf2_debug *) *pinfo;
- /* In a relocatable file, 2 functions may have the same address.
- We change the section vma so that they won't overlap. */
- if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
- {
- if (! place_sections (abfd, stash))
- return FALSE;
- }
-
- do_line = (section == NULL
- && offset == 0
- && functionname_ptr == NULL
- && symbol != NULL);
+ do_line = symbol != NULL;
if (do_line)
{
- addr = symbol->value;
+ BFD_ASSERT (section == NULL && offset == 0 && functionname_ptr == NULL);
section = bfd_get_section (symbol);
+ addr = symbol->value;
}
- else if (section != NULL
- && functionname_ptr != NULL
- && symbol == NULL)
- addr = offset;
else
- abort ();
+ {
+ BFD_ASSERT (section != NULL && functionname_ptr != NULL);
+ addr = offset;
+ }
if (section->output_section)
addr += section->output_section->vma + section->output_offset;
@@ -3560,18 +3708,56 @@ find_line (bfd *abfd,
}
else
{
+ bfd_vma min_range = (bfd_vma) -1;
+ const char * local_filename = NULL;
+ const char * local_functionname = NULL;
+ unsigned int local_linenumber = 0;
+ unsigned int local_discriminator = 0;
+
for (each = stash->all_comp_units; each; each = each->next_unit)
{
+ bfd_vma range = (bfd_vma) -1;
+
found = ((each->arange.high == 0
|| comp_unit_contains_address (each, addr))
- && comp_unit_find_nearest_line (each, addr,
- filename_ptr,
- functionname_ptr,
- linenumber_ptr,
- discriminator_ptr,
- stash));
+ && (range = comp_unit_find_nearest_line (each, addr,
+ & local_filename,
+ & local_functionname,
+ & local_linenumber,
+ & local_discriminator,
+ stash)) != 0);
if (found)
- goto done;
+ {
+ /* PRs 15935 15994: Bogus debug information may have provided us
+ with an erroneous match. We attempt to counter this by
+ selecting the match that has the smallest address range
+ associated with it. (We are assuming that corrupt debug info
+ will tend to result in extra large address ranges rather than
+ extra small ranges).
+
+ This does mean that we scan through all of the CUs associated
+ with the bfd each time this function is called. But this does
+ have the benefit of producing consistent results every time the
+ function is called. */
+ if (range <= min_range)
+ {
+ if (filename_ptr && local_filename)
+ * filename_ptr = local_filename;
+ if (functionname_ptr && local_functionname)
+ * functionname_ptr = local_functionname;
+ if (discriminator_ptr && local_discriminator)
+ * discriminator_ptr = local_discriminator;
+ if (local_linenumber)
+ * linenumber_ptr = local_linenumber;
+ min_range = range;
+ }
+ }
+ }
+
+ if (* linenumber_ptr)
+ {
+ found = TRUE;
+ goto done;
}
}
@@ -3663,13 +3849,13 @@ find_line (bfd *abfd,
functionname_ptr,
linenumber_ptr,
discriminator_ptr,
- stash));
+ stash)) > 0;
if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr)
== stash->sec->size)
{
stash->sec = find_debug_info (stash->bfd_ptr, debug_sections,
- stash->sec);
+ stash->sec);
stash->sec_info_ptr = stash->info_ptr;
}
@@ -3685,45 +3871,6 @@ find_line (bfd *abfd,
return found;
}
-/* The DWARF2 version of find_nearest_line.
- Return TRUE if the line is found without error. */
-
-bfd_boolean
-_bfd_dwarf2_find_nearest_line (bfd *abfd,
- const struct dwarf_debug_section *debug_sections,
- asection *section,
- asymbol **symbols,
- bfd_vma offset,
- const char **filename_ptr,
- const char **functionname_ptr,
- unsigned int *linenumber_ptr,
- unsigned int *discriminator_ptr,
- unsigned int addr_size,
- void **pinfo)
-{
- return find_line (abfd, debug_sections, section, offset, NULL, symbols,
- filename_ptr, functionname_ptr, linenumber_ptr,
- discriminator_ptr, addr_size, pinfo);
-}
-
-/* The DWARF2 version of find_line.
- Return TRUE if the line is found without error. */
-
-bfd_boolean
-_bfd_dwarf2_find_line (bfd *abfd,
- asymbol **symbols,
- asymbol *symbol,
- const char **filename_ptr,
- unsigned int *linenumber_ptr,
- unsigned int *discriminator_ptr,
- unsigned int addr_size,
- void **pinfo)
-{
- return find_line (abfd, dwarf_debug_sections, NULL, 0, symbol, symbols,
- filename_ptr, NULL, linenumber_ptr, discriminator_ptr,
- addr_size, pinfo);
-}
-
bfd_boolean
_bfd_dwarf2_find_inliner_info (bfd *abfd ATTRIBUTE_UNUSED,
const char **filename_ptr,
@@ -3828,6 +3975,10 @@ _bfd_dwarf2_cleanup_debug_info (bfd *abfd, void **pinfo)
free (stash->alt_dwarf_str_buffer);
if (stash->alt_dwarf_info_buffer)
free (stash->alt_dwarf_info_buffer);
+ if (stash->sec_vma)
+ free (stash->sec_vma);
+ if (stash->adjusted_sections)
+ free (stash->adjusted_sections);
if (stash->alt_bfd_ptr)
bfd_close (stash->alt_bfd_ptr);
}
diff --git a/binutils-2.25/bfd/ecoff.c b/binutils-2.25/bfd/ecoff.c
index 7bfb333f..01f51e64 100644
--- a/binutils-2.25/bfd/ecoff.c
+++ b/binutils-2.25/bfd/ecoff.c
@@ -1,5 +1,5 @@
/* Generic ECOFF (Extended-COFF) routines.
- Copyright 1990-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Original version by Per Bothner.
Full support added by Ian Lance Taylor, ian@cygnus.com.
@@ -1704,12 +1704,13 @@ _bfd_ecoff_canonicalize_reloc (bfd *abfd,
bfd_boolean
_bfd_ecoff_find_nearest_line (bfd *abfd,
+ asymbol **symbols ATTRIBUTE_UNUSED,
asection *section,
- asymbol **ignore_symbols ATTRIBUTE_UNUSED,
bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr,
- unsigned int *retline_ptr)
+ unsigned int *retline_ptr,
+ unsigned int *discriminator_ptr)
{
const struct ecoff_debug_swap * const debug_swap
= &ecoff_backend (abfd)->debug_swap;
@@ -1730,8 +1731,10 @@ _bfd_ecoff_find_nearest_line (bfd *abfd,
if (ecoff_data (abfd)->find_line_info == NULL)
return FALSE;
}
- line_info = ecoff_data (abfd)->find_line_info;
+ if (discriminator_ptr)
+ *discriminator_ptr = 0;
+ line_info = ecoff_data (abfd)->find_line_info;
return _bfd_ecoff_locate_line (abfd, section, offset, debug_info,
debug_swap, line_info, filename_ptr,
functionname_ptr, retline_ptr);
@@ -3497,171 +3500,29 @@ ecoff_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
return FALSE;
}
-/* Factored out from ecoff_link_check_archive_element. */
-
-static bfd_boolean
-read_ext_syms_and_strs (HDRR **symhdr, bfd_size_type *external_ext_size,
- bfd_size_type *esize, void **external_ext, char **ssext, bfd *abfd,
- const struct ecoff_backend_data * const backend)
-{
- if (! ecoff_slurp_symbolic_header (abfd))
- return FALSE;
-
- /* If there are no symbols, we don't want it. */
- if (bfd_get_symcount (abfd) == 0)
- return TRUE;
-
- *symhdr = &ecoff_data (abfd)->debug_info.symbolic_header;
-
- *external_ext_size = backend->debug_swap.external_ext_size;
- *esize = (*symhdr)->iextMax * *external_ext_size;
- *external_ext = bfd_malloc (*esize);
- if (*external_ext == NULL && *esize != 0)
- return FALSE;
-
- if (bfd_seek (abfd, (file_ptr) (*symhdr)->cbExtOffset, SEEK_SET) != 0
- || bfd_bread (*external_ext, *esize, abfd) != *esize)
- return FALSE;
-
- *ssext = (char *) bfd_malloc ((bfd_size_type) (*symhdr)->issExtMax);
- if (*ssext == NULL && (*symhdr)->issExtMax != 0)
- return FALSE;
-
- if (bfd_seek (abfd, (file_ptr) (*symhdr)->cbSsExtOffset, SEEK_SET) != 0
- || (bfd_bread (*ssext, (bfd_size_type) (*symhdr)->issExtMax, abfd)
- != (bfd_size_type) (*symhdr)->issExtMax))
- return FALSE;
- return TRUE;
-}
-
-static bfd_boolean
-reread_ext_syms_and_strs (HDRR **symhdr, bfd_size_type *external_ext_size,
- bfd_size_type *esize, void **external_ext, char **ssext, bfd *abfd,
- const struct ecoff_backend_data * const backend)
-{
- if (*external_ext != NULL)
- free (*external_ext);
- *external_ext = NULL;
- if (*ssext != NULL)
- free (*ssext);
- *ssext = NULL;
- return read_ext_syms_and_strs (symhdr, external_ext_size, esize,
- external_ext, ssext, abfd, backend);
-}
-
/* This is called if we used _bfd_generic_link_add_archive_symbols
because we were not dealing with an ECOFF archive. */
static bfd_boolean
ecoff_link_check_archive_element (bfd *abfd,
struct bfd_link_info *info,
+ struct bfd_link_hash_entry *h,
+ const char *name,
bfd_boolean *pneeded)
{
- const struct ecoff_backend_data * const backend = ecoff_backend (abfd);
- void (* const swap_ext_in) (bfd *, void *, EXTR *)
- = backend->debug_swap.swap_ext_in;
- HDRR *symhdr;
- bfd_size_type external_ext_size = 0;
- void * external_ext = NULL;
- bfd_size_type esize = 0;
- char *ssext = NULL;
- char *ext_ptr;
- char *ext_end;
-
*pneeded = FALSE;
- /* Read in the external symbols and external strings. */
- if (!read_ext_syms_and_strs (&symhdr, &external_ext_size, &esize,
- &external_ext, &ssext, abfd, backend))
- goto error_return;
-
- /* If there are no symbols, we don't want it. */
- if (bfd_get_symcount (abfd) == 0)
- goto successful_return;
-
- /* Look through the external symbols to see if they define some
- symbol that is currently undefined. */
- ext_ptr = (char *) external_ext;
- ext_end = ext_ptr + esize;
- for (; ext_ptr < ext_end; ext_ptr += external_ext_size)
- {
- EXTR esym;
- bfd_boolean def;
- const char *name;
- bfd *oldbfd;
- struct bfd_link_hash_entry *h;
-
- (*swap_ext_in) (abfd, (void *) ext_ptr, &esym);
-
- /* See if this symbol defines something. */
- if (esym.asym.st != stGlobal
- && esym.asym.st != stLabel
- && esym.asym.st != stProc)
- continue;
-
- switch (esym.asym.sc)
- {
- case scText:
- case scData:
- case scBss:
- case scAbs:
- case scSData:
- case scSBss:
- case scRData:
- case scCommon:
- case scSCommon:
- case scInit:
- case scFini:
- case scRConst:
- def = TRUE;
- break;
- default:
- def = FALSE;
- break;
- }
-
- if (! def)
- continue;
-
- name = ssext + esym.asym.iss;
- h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE);
-
- /* Unlike the generic linker, we do not pull in elements because
- of common symbols. */
- if (h == NULL
- || h->type != bfd_link_hash_undefined)
- continue;
-
- /* Include this element. */
- oldbfd = abfd;
- if (!(*info->callbacks
- ->add_archive_element) (info, abfd, name, &abfd))
- goto error_return;
- /* Potentially, the add_archive_element hook may have set a
- substitute BFD for us. */
- if (abfd != oldbfd
- && !reread_ext_syms_and_strs (&symhdr, &external_ext_size, &esize,
- &external_ext, &ssext, abfd, backend))
- goto error_return;
- if (! ecoff_link_add_externals (abfd, info, external_ext, ssext))
- goto error_return;
+ /* Unlike the generic linker, we do not pull in elements because
+ of common symbols. */
+ if (h->type != bfd_link_hash_undefined)
+ return TRUE;
- *pneeded = TRUE;
- goto successful_return;
- }
+ /* Include this element. */
+ if (!(*info->callbacks->add_archive_element) (info, abfd, name, &abfd))
+ return FALSE;
+ *pneeded = TRUE;
- successful_return:
- if (external_ext != NULL)
- free (external_ext);
- if (ssext != NULL)
- free (ssext);
- return TRUE;
- error_return:
- if (external_ext != NULL)
- free (external_ext);
- if (ssext != NULL)
- free (ssext);
- return FALSE;
+ return ecoff_link_add_object_symbols (abfd, info);
}
/* Add the symbols from an archive file to the global hash table.
@@ -4447,7 +4308,7 @@ _bfd_ecoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
/* Accumulate the debugging symbols from each input BFD. */
for (input_bfd = info->input_bfds;
input_bfd != NULL;
- input_bfd = input_bfd->link_next)
+ input_bfd = input_bfd->link.next)
{
bfd_boolean ret;
diff --git a/binutils-2.25/bfd/ecofflink.c b/binutils-2.25/bfd/ecofflink.c
index e48fcc87..33cdffd5 100644
--- a/binutils-2.25/bfd/ecofflink.c
+++ b/binutils-2.25/bfd/ecofflink.c
@@ -1,6 +1,5 @@
/* Routines to link ECOFF debugging information.
- Copyright 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/ecoffswap.h b/binutils-2.25/bfd/ecoffswap.h
index 3306e6b6..e567fa93 100644
--- a/binutils-2.25/bfd/ecoffswap.h
+++ b/binutils-2.25/bfd/ecoffswap.h
@@ -1,6 +1,5 @@
/* Generic ECOFF swapping routines, for BFD.
- Copyright 1992, 1993, 1994, 1995, 1996, 2000, 2001, 2002, 2004, 2005,
- 2007 Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf-attrs.c b/binutils-2.25/bfd/elf-attrs.c
index 1a1c2c2a..cd0cbcaa 100644
--- a/binutils-2.25/bfd/elf-attrs.c
+++ b/binutils-2.25/bfd/elf-attrs.c
@@ -1,6 +1,5 @@
/* ELF attributes support (based on ARM EABI attributes).
- Copyright 2005, 2006, 2007, 2009, 2010, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2005-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -297,7 +296,7 @@ bfd_elf_add_obj_attr_int (bfd *abfd, int vendor, int tag, unsigned int i)
obj_attribute *attr;
attr = elf_new_obj_attr (abfd, vendor, tag);
- attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag) | ATTR_TYPE_FLAG_EXIST;
+ attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag);
attr->i = i;
}
@@ -320,7 +319,7 @@ bfd_elf_add_obj_attr_string (bfd *abfd, int vendor, int tag, const char *s)
obj_attribute *attr;
attr = elf_new_obj_attr (abfd, vendor, tag);
- attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag) | ATTR_TYPE_FLAG_EXIST;
+ attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag);
attr->s = _bfd_elf_attr_strdup (abfd, s);
}
@@ -332,7 +331,7 @@ bfd_elf_add_obj_attr_int_string (bfd *abfd, int vendor, int tag,
obj_attribute *attr;
attr = elf_new_obj_attr (abfd, vendor, tag);
- attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag) | ATTR_TYPE_FLAG_EXIST;
+ attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag);
attr->i = i;
attr->s = _bfd_elf_attr_strdup (abfd, s);
}
@@ -450,7 +449,7 @@ _bfd_elf_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr)
len = hdr->sh_size - 1;
while (len > 0)
{
- int namelen;
+ unsigned namelen;
bfd_vma section_len;
int vendor;
@@ -459,8 +458,11 @@ _bfd_elf_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr)
if (section_len > len)
section_len = len;
len -= section_len;
- namelen = strlen ((char *) p) + 1;
- section_len -= namelen + 4;
+ section_len -= 4;
+ namelen = strnlen ((char *) p, section_len) + 1;
+ if (namelen == 0 || namelen >= section_len)
+ break;
+ section_len -= namelen;
if (std_sec && strcmp ((char *) p, std_sec) == 0)
vendor = OBJ_ATTR_PROC;
else if (strcmp ((char *) p, "gnu") == 0)
diff --git a/binutils-2.25/bfd/elf-bfd.h b/binutils-2.25/bfd/elf-bfd.h
index 6af1624e..0c82278b 100644
--- a/binutils-2.25/bfd/elf-bfd.h
+++ b/binutils-2.25/bfd/elf-bfd.h
@@ -1,5 +1,5 @@
/* BFD back-end data structures for ELF files.
- Copyright 1992-2013 Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -280,7 +280,9 @@ struct eh_cie_fde
If REMOVED == 0, this is the CIE that we have chosen to use for
the output FDE. The CIE's REMOVED field is also 0, but the CIE
- might belong to a different .eh_frame input section from the FDE. */
+ might belong to a different .eh_frame input section from the FDE.
+
+ May be NULL to signify that the FDE should be discarded. */
struct eh_cie_fde *cie_inf;
struct eh_cie_fde *next_for_section;
} fde;
@@ -372,6 +374,7 @@ struct eh_frame_sec_info
struct eh_frame_array_ent
{
bfd_vma initial_loc;
+ bfd_size_type range;
bfd_vma fde;
};
@@ -383,10 +386,6 @@ struct eh_frame_hdr_info
asection *hdr_sec;
unsigned int fde_count, array_count;
struct eh_frame_array_ent *array;
- /* TRUE if we should try to merge CIEs between input sections. */
- bfd_boolean merge_cies;
- /* TRUE if all .eh_frames have been parsd. */
- bfd_boolean parsed_eh_frames;
/* TRUE if .eh_frame_hdr should contain the sorted search table.
We build it if we successfully read all .eh_frame input sections
and recognize them. */
@@ -419,7 +418,9 @@ enum elf_target_id
MICROBLAZE_ELF_DATA,
MIPS_ELF_DATA,
MN10300_ELF_DATA,
+ NDS32_ELF_DATA,
NIOS2_ELF_DATA,
+ OR1K_ELF_DATA,
PPC32_ELF_DATA,
PPC64_ELF_DATA,
S390_ELF_DATA,
@@ -1190,9 +1191,9 @@ struct elf_backend_data
/* This function implements `bfd_elf_bfd_from_remote_memory';
see elf.c, elfcode.h. */
bfd *(*elf_backend_bfd_from_remote_memory)
- (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
- int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
- bfd_size_type len));
+ (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
+ int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
+ bfd_size_type len));
/* This function is used by `_bfd_elf_get_synthetic_symtab';
see elf.c. */
@@ -1341,6 +1342,11 @@ struct elf_backend_data
other file in the link needs to have a .note.GNU-stack section
for a PT_GNU_STACK segment to be created. */
unsigned default_execstack : 1;
+
+ /* True if elf_section_data(sec)->this_hdr.contents is sec->rawsize
+ in length rather than sec->size in length, if sec->rawsize is
+ non-zero and smaller than sec->size. */
+ unsigned caches_rawsize : 1;
};
/* Information about reloc sections associated with a bfd_elf_section_data
@@ -1450,20 +1456,17 @@ struct bfd_elf_section_data
/* The value of an object attribute. The type indicates whether the attribute
holds and integer, a string, or both. It can also indicate that there can
- be no default (i.e. all values must be written to file, even zero), and whether
- it exists in bfd to begin with. */
+ be no default (i.e. all values must be written to file, even zero). */
typedef struct obj_attribute
{
#define ATTR_TYPE_FLAG_INT_VAL (1 << 0)
#define ATTR_TYPE_FLAG_STR_VAL (1 << 1)
#define ATTR_TYPE_FLAG_NO_DEFAULT (1 << 2)
-#define ATTR_TYPE_FLAG_EXIST (1 << 3)
#define ATTR_TYPE_HAS_INT_VAL(TYPE) ((TYPE) & ATTR_TYPE_FLAG_INT_VAL)
#define ATTR_TYPE_HAS_STR_VAL(TYPE) ((TYPE) & ATTR_TYPE_FLAG_STR_VAL)
#define ATTR_TYPE_HAS_NO_DEFAULT(TYPE) ((TYPE) & ATTR_TYPE_FLAG_NO_DEFAULT)
-#define ATTR_TYPE_EXIST(TYPE) ((TYPE) & ATTR_TYPE_FLAG_EXIST)
int type;
unsigned int i;
@@ -1812,7 +1815,7 @@ extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc
extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create
(bfd *);
extern void _bfd_elf_link_hash_table_free
- (struct bfd_link_hash_table *);
+ (bfd *);
extern void _bfd_elf_link_hash_copy_indirect
(struct bfd_link_info *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *);
@@ -1895,18 +1898,10 @@ extern alent *_bfd_elf_get_lineno
extern bfd_boolean _bfd_elf_set_arch_mach
(bfd *, enum bfd_architecture, unsigned long);
extern bfd_boolean _bfd_elf_find_nearest_line
- (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **,
- unsigned int *);
-extern bfd_boolean _bfd_elf_find_nearest_line_discriminator
- (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **,
- unsigned int *, unsigned int *);
+ (bfd *, asymbol **, asection *, bfd_vma,
+ const char **, const char **, unsigned int *, unsigned int *);
extern bfd_boolean _bfd_elf_find_line
(bfd *, asymbol **, asymbol *, const char **, unsigned int *);
-extern bfd_boolean _bfd_elf_find_line_discriminator
- (bfd *, asymbol **, asymbol *, const char **, unsigned int *, unsigned int *);
-#define _bfd_generic_find_line _bfd_elf_find_line
-#define _bfd_generic_find_nearest_line_discriminator \
- _bfd_elf_find_nearest_line_discriminator
extern bfd_boolean _bfd_elf_find_inliner_info
(bfd *, const char **, const char **, unsigned int *);
#define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols
@@ -1964,13 +1959,8 @@ extern bfd_boolean _bfd_elf_strtab_emit
extern void _bfd_elf_strtab_finalize
(struct elf_strtab_hash *);
-extern void _bfd_elf_begin_eh_frame_parsing
- (struct bfd_link_info *info);
extern void _bfd_elf_parse_eh_frame
(bfd *, struct bfd_link_info *, asection *, struct elf_reloc_cookie *);
-extern void _bfd_elf_end_eh_frame_parsing
- (struct bfd_link_info *info);
-
extern bfd_boolean _bfd_elf_discard_section_eh_frame
(bfd *, struct bfd_link_info *, asection *,
bfd_boolean (*) (bfd_vma, void *), struct elf_reloc_cookie *);
@@ -1993,8 +1983,6 @@ extern long _bfd_elf_link_lookup_local_dynindx
(struct bfd_link_info *, bfd *, long);
extern bfd_boolean _bfd_elf_compute_section_file_positions
(bfd *, struct bfd_link_info *);
-extern void _bfd_elf_assign_file_positions_for_relocs
- (bfd *);
extern file_ptr _bfd_elf_assign_file_position_for_section
(Elf_Internal_Shdr *, file_ptr, bfd_boolean);
@@ -2043,7 +2031,7 @@ extern bfd_reloc_status_type bfd_elf_perform_complex_relocation
extern bfd_boolean _bfd_elf_setup_sections
(bfd *);
-extern void _bfd_elf_set_osabi (bfd * , struct bfd_link_info *);
+extern void _bfd_elf_post_process_headers (bfd * , struct bfd_link_info *);
extern const bfd_target *bfd_elf32_object_p
(bfd *);
@@ -2331,10 +2319,10 @@ extern char *elfcore_write_ppc_linux_prpsinfo32
(bfd *, char *, int *, const struct elf_internal_linux_prpsinfo *);
extern bfd *_bfd_elf32_bfd_from_remote_memory
- (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
+ (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type));
extern bfd *_bfd_elf64_bfd_from_remote_memory
- (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
+ (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type));
extern bfd_vma bfd_elf_obj_attr_size (bfd *);
@@ -2417,7 +2405,7 @@ extern asection _bfd_elf_large_com_section;
#define RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel, \
r_symndx, symtab_hdr, sym_hashes, \
h, sec, relocation, \
- unresolved_reloc, warned) \
+ unresolved_reloc, warned, ignored) \
do \
{ \
/* It seems this can happen with erroneous or unsupported \
@@ -2427,11 +2415,17 @@ extern asection _bfd_elf_large_com_section;
\
h = sym_hashes[r_symndx - symtab_hdr->sh_info]; \
\
+ if (info->wrap_hash != NULL \
+ && (input_section->flags & SEC_DEBUGGING) != 0) \
+ h = ((struct elf_link_hash_entry *) \
+ unwrap_hash_lookup (info, input_bfd, &h->root)); \
+ \
while (h->root.type == bfd_link_hash_indirect \
|| h->root.type == bfd_link_hash_warning) \
h = (struct elf_link_hash_entry *) h->root.u.i.link; \
\
warned = FALSE; \
+ ignored = FALSE; \
unresolved_reloc = FALSE; \
relocation = 0; \
if (h->root.type == bfd_link_hash_defined \
@@ -2454,7 +2448,7 @@ extern asection _bfd_elf_large_com_section;
; \
else if (info->unresolved_syms_in_objects == RM_IGNORE \
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) \
- ; \
+ ignored = TRUE; \
else if (!info->relocatable) \
{ \
bfd_boolean err; \
@@ -2470,6 +2464,7 @@ extern asection _bfd_elf_large_com_section;
} \
(void) unresolved_reloc; \
(void) warned; \
+ (void) ignored; \
} \
while (0)
diff --git a/binutils-2.25/bfd/elf-eh-frame.c b/binutils-2.25/bfd/elf-eh-frame.c
index 832a9919..002932d1 100644
--- a/binutils-2.25/bfd/elf-eh-frame.c
+++ b/binutils-2.25/bfd/elf-eh-frame.c
@@ -1,6 +1,5 @@
/* .eh_frame section optimization.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
- 2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
Written by Jakub Jelinek <jakub@redhat.com>.
This file is part of BFD, the Binary File Descriptor library.
@@ -41,10 +40,12 @@ struct cie
bfd_vma augmentation_size;
union {
struct elf_link_hash_entry *h;
- bfd_vma val;
+ struct {
+ unsigned int bfd_id;
+ unsigned int index;
+ } sym;
unsigned int reloc_index;
} personality;
- asection *output_sec;
struct eh_cie_fde *cie_inf;
unsigned char per_encoding;
unsigned char lsda_encoding;
@@ -230,11 +231,13 @@ cie_eq (const void *e1, const void *e2)
&& c1->augmentation_size == c2->augmentation_size
&& memcmp (&c1->personality, &c2->personality,
sizeof (c1->personality)) == 0
- && c1->output_sec == c2->output_sec
+ && (c1->cie_inf->u.cie.u.sec->output_section
+ == c2->cie_inf->u.cie.u.sec->output_section)
&& c1->per_encoding == c2->per_encoding
&& c1->lsda_encoding == c2->lsda_encoding
&& c1->fde_encoding == c2->fde_encoding
&& c1->initial_insn_length == c2->initial_insn_length
+ && c1->initial_insn_length <= sizeof (c1->initial_instructions)
&& memcmp (c1->initial_instructions,
c2->initial_instructions,
c1->initial_insn_length) == 0)
@@ -254,6 +257,7 @@ static hashval_t
cie_compute_hash (struct cie *c)
{
hashval_t h = 0;
+ size_t len;
h = iterative_hash_object (c->length, h);
h = iterative_hash_object (c->version, h);
h = iterative_hash (c->augmentation, strlen (c->augmentation) + 1, h);
@@ -262,12 +266,15 @@ cie_compute_hash (struct cie *c)
h = iterative_hash_object (c->ra_column, h);
h = iterative_hash_object (c->augmentation_size, h);
h = iterative_hash_object (c->personality, h);
- h = iterative_hash_object (c->output_sec, h);
+ h = iterative_hash_object (c->cie_inf->u.cie.u.sec->output_section, h);
h = iterative_hash_object (c->per_encoding, h);
h = iterative_hash_object (c->lsda_encoding, h);
h = iterative_hash_object (c->fde_encoding, h);
h = iterative_hash_object (c->initial_insn_length, h);
- h = iterative_hash (c->initial_instructions, c->initial_insn_length, h);
+ len = c->initial_insn_length;
+ if (len > sizeof (c->initial_instructions))
+ len = sizeof (c->initial_instructions);
+ h = iterative_hash (c->initial_instructions, len, h);
c->hash = h;
return h;
}
@@ -445,18 +452,6 @@ make_pc_relative (unsigned char encoding, unsigned int ptr_size)
return encoding | DW_EH_PE_pcrel;
}
-/* Called before calling _bfd_elf_parse_eh_frame on every input bfd's
- .eh_frame section. */
-
-void
-_bfd_elf_begin_eh_frame_parsing (struct bfd_link_info *info)
-{
- struct eh_frame_hdr_info *hdr_info;
-
- hdr_info = &elf_hash_table (info)->eh_info;
- hdr_info->merge_cies = !info->relocatable;
-}
-
/* Try to parse .eh_frame section SEC, which belongs to ABFD. Store the
information in the section's sec_info field on success. COOKIE
describes the relocations in SEC. */
@@ -487,8 +482,6 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
htab = elf_hash_table (info);
hdr_info = &htab->eh_info;
- if (hdr_info->parsed_eh_frames)
- return;
if (sec->size == 0
|| sec->sec_info_type != SEC_INFO_TYPE_NONE)
@@ -563,10 +556,13 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
/* FIXME: octets_per_byte. */
#define ENSURE_NO_RELOCS(buf) \
- REQUIRE (!(cookie->rel < cookie->relend \
- && (cookie->rel->r_offset \
- < (bfd_size_type) ((buf) - ehbuf)) \
- && cookie->rel->r_info != 0))
+ while (cookie->rel < cookie->relend \
+ && (cookie->rel->r_offset \
+ < (bfd_size_type) ((buf) - ehbuf))) \
+ { \
+ REQUIRE (cookie->rel->r_info == 0); \
+ cookie->rel++; \
+ }
/* FIXME: octets_per_byte. */
#define SKIP_RELOCS(buf) \
@@ -632,7 +628,6 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
cie->cie_inf = this_inf;
cie->length = hdr_length;
- cie->output_sec = sec->output_section;
start = buf;
REQUIRE (read_byte (&buf, end, &cie->version));
@@ -734,6 +729,7 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
/* For shared libraries, try to get rid of as many RELATIVE relocs
as possible. */
if (info->shared
+ && !info->relocatable
&& (get_elf_backend_data (abfd)
->elf_backend_can_make_relative_eh_frame
(abfd, info, sec)))
@@ -762,19 +758,21 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
cie->fde_encoding = DW_EH_PE_absptr;
initial_insn_length = end - buf;
- if (initial_insn_length <= sizeof (cie->initial_instructions))
- {
- cie->initial_insn_length = initial_insn_length;
- memcpy (cie->initial_instructions, buf, initial_insn_length);
- }
+ cie->initial_insn_length = initial_insn_length;
+ memcpy (cie->initial_instructions, buf,
+ initial_insn_length <= sizeof (cie->initial_instructions)
+ ? initial_insn_length : sizeof (cie->initial_instructions));
insns = buf;
buf += initial_insn_length;
ENSURE_NO_RELOCS (buf);
- if (hdr_info->merge_cies)
- this_inf->u.cie.u.full_cie = cie;
- this_inf->u.cie.per_encoding_relative
- = (cie->per_encoding & 0x70) == DW_EH_PE_pcrel;
+ if (!info->relocatable)
+ {
+ /* Keep info for merging cies. */
+ this_inf->u.cie.u.full_cie = cie;
+ this_inf->u.cie.per_encoding_relative
+ = (cie->per_encoding & 0x70) == DW_EH_PE_pcrel;
+ }
}
else
{
@@ -816,6 +814,16 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
length = get_DW_EH_PE_width (cie->fde_encoding, ptr_size);
REQUIRE (skip_bytes (&buf, end, 2 * length));
+ SKIP_RELOCS (buf - length);
+ if (!GET_RELOC (buf - length)
+ && read_value (abfd, buf - length, length, FALSE) == 0)
+ {
+ (*info->callbacks->minfo)
+ (_("discarding zero address range FDE in %B(%A).\n"),
+ abfd, sec);
+ this_inf->u.fde.cie_inf = NULL;
+ }
+
/* Skip the augmentation size, if present. */
if (cie->augmentation[0] == 'z')
REQUIRE (read_uleb128 (&buf, end, &length));
@@ -905,8 +913,9 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
elf_section_data (sec)->sec_info = sec_info;
sec->sec_info_type = SEC_INFO_TYPE_EH_FRAME;
- if (hdr_info->merge_cies)
+ if (!info->relocatable)
{
+ /* Keep info for merging cies. */
sec_info->cies = local_cies;
local_cies = NULL;
}
@@ -927,17 +936,6 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
#undef REQUIRE
}
-/* Finish a pass over all .eh_frame sections. */
-
-void
-_bfd_elf_end_eh_frame_parsing (struct bfd_link_info *info)
-{
- struct eh_frame_hdr_info *hdr_info;
-
- hdr_info = &elf_hash_table (info)->eh_info;
- hdr_info->parsed_eh_frames = TRUE;
-}
-
/* Mark all relocations against CIE or FDE ENT, which occurs in
.eh_frame section SEC. COOKIE describes the relocations in SEC;
its "rel" field can be changed freely. */
@@ -977,7 +975,7 @@ _bfd_elf_gc_mark_fdes (struct bfd_link_info *info, asection *sec,
/* At this stage, all cie_inf fields point to local CIEs, so we
can use the same cookie to refer to them. */
cie = fde->u.fde.cie_inf;
- if (!cie->u.cie.gc_mark)
+ if (cie != NULL && !cie->u.cie.gc_mark)
{
cie->u.cie.gc_mark = 1;
if (!mark_entry (info, eh_frame, cie, gc_mark_hook, cookie))
@@ -1027,8 +1025,12 @@ find_merged_cie (bfd *abfd, struct bfd_link_info *info, asection *sec,
{
bfd_boolean per_binds_local;
- /* Work out the address of personality routine, either as an absolute
- value or as a symbol. */
+ /* Work out the address of personality routine, or at least
+ enough info that we could calculate the address had we made a
+ final section layout. The symbol on the reloc is enough,
+ either the hash for a global, or (bfd id, index) pair for a
+ local. The assumption here is that no one uses addends on
+ the reloc. */
rel = cookie->rels + cie->personality.reloc_index;
memset (&cie->personality, 0, sizeof (cie->personality));
#ifdef BFD64
@@ -1068,14 +1070,14 @@ find_merged_cie (bfd *abfd, struct bfd_link_info *info, asection *sec,
return cie_inf;
cie->local_personality = 1;
- cie->personality.val = (sym->st_value
- + sym_sec->output_offset
- + sym_sec->output_section->vma);
+ cie->personality.sym.bfd_id = abfd->id;
+ cie->personality.sym.index = r_symndx;
per_binds_local = TRUE;
}
if (per_binds_local
&& info->shared
+ && !info->relocatable
&& (cie->per_encoding & 0x70) == DW_EH_PE_absptr
&& (get_elf_backend_data (abfd)
->elf_backend_can_make_relative_eh_frame (abfd, info, sec)))
@@ -1086,7 +1088,6 @@ find_merged_cie (bfd *abfd, struct bfd_link_info *info, asection *sec,
}
/* See if we can merge this CIE with an earlier one. */
- cie->output_sec = sec->output_section;
cie_compute_hash (cie);
if (hdr_info->cies == NULL)
{
@@ -1153,7 +1154,7 @@ _bfd_elf_discard_section_eh_frame
/* There should only be one zero terminator, on the last input
file supplying .eh_frame (crtend.o). Remove any others. */
ent->removed = sec->map_head.s != NULL;
- else if (!ent->cie)
+ else if (!ent->cie && ent->u.fde.cie_inf != NULL)
{
bfd_boolean keep;
if ((sec->flags & SEC_LINKER_CREATED) != 0 && cookie->rels == NULL)
@@ -1186,7 +1187,7 @@ _bfd_elf_discard_section_eh_frame
since it is affected by runtime relocations. */
hdr_info->table = FALSE;
(*info->callbacks->einfo)
- (_("%P: fde encoding in %B(%A) prevents .eh_frame_hdr"
+ (_("%P: FDE encoding in %B(%A) prevents .eh_frame_hdr"
" table being created.\n"), abfd, sec);
}
ent->removed = 0;
@@ -1397,6 +1398,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
struct eh_frame_hdr_info *hdr_info;
unsigned int ptr_size;
struct eh_cie_fde *ent;
+ bfd_size_type sec_size;
if (sec->sec_info_type != SEC_INFO_TYPE_EH_FRAME)
/* FIXME: octets_per_byte. */
@@ -1583,6 +1585,8 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
value = ((ent->new_offset + sec->output_offset + 4)
- (cie->new_offset + cie->u.cie.u.sec->output_offset));
bfd_put_32 (abfd, value, buf);
+ if (info->relocatable)
+ continue;
buf += 4;
width = get_DW_EH_PE_width (ent->fde_encoding, ptr_size);
value = read_value (abfd, buf, width,
@@ -1648,6 +1652,8 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
if (sizeof (address) > 4 && ptr_size == 4)
address &= 0xffffffff;
hdr_info->array[hdr_info->array_count].initial_loc = address;
+ hdr_info->array[hdr_info->array_count].range
+ = read_value (abfd, buf + width, width, FALSE);
hdr_info->array[hdr_info->array_count++].fde
= (sec->output_section->vma
+ sec->output_offset
@@ -1718,7 +1724,11 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
the pointer size. _bfd_elf_discard_section_eh_frame should
have padded CIE/FDE records to multiple of pointer size with
size_of_output_cie_fde. */
- if ((sec->size % ptr_size) != 0)
+ sec_size = sec->size;
+ if (sec_info->count != 0
+ && sec_info->entry[sec_info->count - 1].size == 4)
+ sec_size -= 4;
+ if ((sec_size % ptr_size) != 0)
abort ();
/* FIXME: octets_per_byte. */
@@ -1739,6 +1749,10 @@ vma_compare (const void *a, const void *b)
return 1;
if (p->initial_loc < q->initial_loc)
return -1;
+ if (p->range > q->range)
+ return 1;
+ if (p->range < q->range)
+ return -1;
return 0;
}
@@ -1827,20 +1841,43 @@ _bfd_elf_write_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info)
sizeof (*hdr_info->array), vma_compare);
for (i = 0; i < hdr_info->fde_count; i++)
{
- bfd_put_32 (abfd,
- hdr_info->array[i].initial_loc
- - sec->output_section->vma,
- contents + EH_FRAME_HDR_SIZE + i * 8 + 4);
- bfd_put_32 (abfd,
- hdr_info->array[i].fde - sec->output_section->vma,
- contents + EH_FRAME_HDR_SIZE + i * 8 + 8);
+ bfd_vma val;
+
+ val = hdr_info->array[i].initial_loc - sec->output_section->vma;
+ val = ((val & 0xffffffff) ^ 0x80000000) - 0x80000000;
+ if (elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64
+ && (hdr_info->array[i].initial_loc
+ != sec->output_section->vma + val))
+ (*info->callbacks->einfo)
+ (_("%X%P: .eh_frame_hdr table[%u] PC overflow.\n"), i);
+ bfd_put_32 (abfd, val, contents + EH_FRAME_HDR_SIZE + i * 8 + 4);
+
+ val = hdr_info->array[i].fde - sec->output_section->vma;
+ val = ((val & 0xffffffff) ^ 0x80000000) - 0x80000000;
+ if (elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64
+ && (hdr_info->array[i].fde
+ != sec->output_section->vma + val))
+ (*info->callbacks->einfo)
+ (_("%X%P: .eh_frame_hdr table[%u] FDE overflow.\n"), i);
+ bfd_put_32 (abfd, val, contents + EH_FRAME_HDR_SIZE + i * 8 + 8);
+
+ if (i != 0
+ && (hdr_info->array[i].initial_loc
+ < (hdr_info->array[i - 1].initial_loc
+ + hdr_info->array[i - 1].range)))
+ (*info->callbacks->einfo)
+ (_("%X%P: .eh_frame_hdr table[%u] FDE at %V overlaps "
+ "table[%u] FDE at %V.\n"),
+ i - 1, hdr_info->array[i - 1].fde,
+ i, hdr_info->array[i].fde);
}
}
/* FIXME: octets_per_byte. */
- retval = bfd_set_section_contents (abfd, sec->output_section, contents,
- (file_ptr) sec->output_offset,
- sec->size);
+ if (!bfd_set_section_contents (abfd, sec->output_section, contents,
+ (file_ptr) sec->output_offset,
+ sec->size))
+ retval = FALSE;
free (contents);
}
if (hdr_info->array != NULL)
diff --git a/binutils-2.25/bfd/elf-hppa.h b/binutils-2.25/bfd/elf-hppa.h
index 3fa9dedb..5ee7de81 100644
--- a/binutils-2.25/bfd/elf-hppa.h
+++ b/binutils-2.25/bfd/elf-hppa.h
@@ -1,7 +1,5 @@
/* Common code for PA ELF implementations.
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf-ifunc.c b/binutils-2.25/bfd/elf-ifunc.c
index 8d48e66e..dd8992bf 100644
--- a/binutils-2.25/bfd/elf-ifunc.c
+++ b/binutils-2.25/bfd/elf-ifunc.c
@@ -1,6 +1,5 @@
/* ELF STT_GNU_IFUNC support.
- Copyright 2009-2013
- Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf-linux-psinfo.h b/binutils-2.25/bfd/elf-linux-psinfo.h
index c9652844..5760cc71 100644
--- a/binutils-2.25/bfd/elf-linux-psinfo.h
+++ b/binutils-2.25/bfd/elf-linux-psinfo.h
@@ -1,5 +1,5 @@
/* Definitions for PRPSINFO structures under ELF on GNU/Linux.
- Copyright 2013 Free Software Foundation, Inc.
+ Copyright (C) 2013-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf-m10200.c b/binutils-2.25/bfd/elf-m10200.c
index f427f97c..86872b77 100644
--- a/binutils-2.25/bfd/elf-m10200.c
+++ b/binutils-2.25/bfd/elf-m10200.c
@@ -1,7 +1,5 @@
/* Matsushita 10200 specific support for 32-bit ELF
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2007, 2010, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -373,12 +371,12 @@ mn10200_elf_relocate_section (bfd *output_bfd,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -1376,7 +1374,7 @@ mn10200_elf_get_relocated_section_contents (bfd *output_bfd,
return NULL;
}
-#define TARGET_LITTLE_SYM bfd_elf32_mn10200_vec
+#define TARGET_LITTLE_SYM mn10200_elf32_vec
#define TARGET_LITTLE_NAME "elf32-mn10200"
#define ELF_ARCH bfd_arch_mn10200
#define ELF_MACHINE_CODE EM_MN10200
diff --git a/binutils-2.25/bfd/elf-m10300.c b/binutils-2.25/bfd/elf-m10300.c
index c0a9309b..f29025d5 100644
--- a/binutils-2.25/bfd/elf-m10300.c
+++ b/binutils-2.25/bfd/elf-m10300.c
@@ -1,6 +1,5 @@
/* Matsushita 10300 specific support for 32-bit ELF
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -2011,7 +2010,7 @@ mn10300_elf_relocate_section (bfd *output_bfd,
bfd_reloc_status_type r;
int tls_r_type;
bfd_boolean unresolved_reloc = FALSE;
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
struct elf_link_hash_entry * hh;
relocation = 0;
@@ -2034,7 +2033,7 @@ mn10300_elf_relocate_section (bfd *output_bfd,
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
hh, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
h = elf_mn10300_hash_entry (hh);
@@ -2680,7 +2679,7 @@ mn10300_elf_relax_section (bfd *abfd,
/* Iterate over all the input bfds. */
for (input_bfd = link_info->input_bfds;
input_bfd != NULL;
- input_bfd = input_bfd->link_next)
+ input_bfd = input_bfd->link.next)
{
/* We're going to need all the symbols for each bfd. */
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
@@ -3023,7 +3022,7 @@ mn10300_elf_relax_section (bfd *abfd,
a "call" instruction. */
for (input_bfd = link_info->input_bfds;
input_bfd != NULL;
- input_bfd = input_bfd->link_next)
+ input_bfd = input_bfd->link.next)
{
/* We're going to need all the local symbols for each bfd. */
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
@@ -4599,6 +4598,21 @@ _bfd_mn10300_copy_indirect_symbol (struct bfd_link_info * info,
_bfd_elf_link_hash_copy_indirect (info, dir, ind);
}
+/* Destroy an mn10300 ELF linker hash table. */
+
+static void
+elf32_mn10300_link_hash_table_free (bfd *obfd)
+{
+ struct elf32_mn10300_link_hash_table *ret
+ = (struct elf32_mn10300_link_hash_table *) obfd->link.hash;
+
+ obfd->link.hash = &ret->static_hash_table->root.root;
+ _bfd_elf_link_hash_table_free (obfd);
+ obfd->is_linker_output = TRUE;
+ obfd->link.hash = &ret->root.root;
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
/* Create an mn10300 ELF linker hash table. */
static struct bfd_link_hash_table *
@@ -4611,17 +4625,6 @@ elf32_mn10300_link_hash_table_create (bfd *abfd)
if (ret == NULL)
return NULL;
- if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
- elf32_mn10300_link_hash_newfunc,
- sizeof (struct elf32_mn10300_link_hash_entry),
- MN10300_ELF_DATA))
- {
- free (ret);
- return NULL;
- }
-
- ret->tls_ldm_got.offset = -1;
-
amt = sizeof (struct elf_link_hash_table);
ret->static_hash_table = bfd_zmalloc (amt);
if (ret->static_hash_table == NULL)
@@ -4639,21 +4642,25 @@ elf32_mn10300_link_hash_table_create (bfd *abfd)
free (ret);
return NULL;
}
- return & ret->root.root;
-}
-/* Free an mn10300 ELF linker hash table. */
+ abfd->is_linker_output = FALSE;
+ abfd->link.hash = NULL;
+ if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
+ elf32_mn10300_link_hash_newfunc,
+ sizeof (struct elf32_mn10300_link_hash_entry),
+ MN10300_ELF_DATA))
+ {
+ abfd->is_linker_output = TRUE;
+ abfd->link.hash = &ret->static_hash_table->root.root;
+ _bfd_elf_link_hash_table_free (abfd);
+ free (ret);
+ return NULL;
+ }
+ ret->root.root.hash_table_free = elf32_mn10300_link_hash_table_free;
-static void
-elf32_mn10300_link_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct elf32_mn10300_link_hash_table *ret
- = (struct elf32_mn10300_link_hash_table *) hash;
+ ret->tls_ldm_got.offset = -1;
- _bfd_elf_link_hash_table_free
- ((struct bfd_link_hash_table *) ret->static_hash_table);
- _bfd_elf_link_hash_table_free
- ((struct bfd_link_hash_table *) ret);
+ return & ret->root.root;
}
static unsigned long
@@ -5561,7 +5568,7 @@ mn10300_elf_mkobject (bfd *abfd)
#define bfd_elf32_mkobject mn10300_elf_mkobject
#ifndef ELF_ARCH
-#define TARGET_LITTLE_SYM bfd_elf32_mn10300_vec
+#define TARGET_LITTLE_SYM mn10300_elf32_vec
#define TARGET_LITTLE_NAME "elf32-mn10300"
#define ELF_ARCH bfd_arch_mn10300
#define ELF_TARGET_ID MN10300_ELF_DATA
@@ -5582,8 +5589,6 @@ mn10300_elf_mkobject (bfd *abfd)
mn10300_elf_get_relocated_section_contents
#define bfd_elf32_bfd_link_hash_table_create \
elf32_mn10300_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free \
- elf32_mn10300_link_hash_table_free
#ifndef elf_symbol_leading_char
#define elf_symbol_leading_char '_'
diff --git a/binutils-2.25/bfd/elf-nacl.c b/binutils-2.25/bfd/elf-nacl.c
index 5ec11616..b6c9dc2e 100644
--- a/binutils-2.25/bfd/elf-nacl.c
+++ b/binutils-2.25/bfd/elf-nacl.c
@@ -1,5 +1,5 @@
/* Native Client support for ELF
- Copyright 2012, 2013 Free Software Foundation, Inc.
+ Copyright (C) 2012-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -44,14 +44,13 @@ segment_executable (struct elf_segment_map *seg)
}
/* Determine if this segment is eligible to receive the file and program
- headers. It must be read-only, non-executable, and have contents.
+ headers. It must be read-only and non-executable.
Its first section must start far enough past the page boundary to
allow space for the headers. */
static bfd_boolean
segment_eligible_for_headers (struct elf_segment_map *seg,
bfd_vma minpagesize, bfd_vma sizeof_headers)
{
- bfd_boolean any_contents = FALSE;
unsigned int i;
if (seg->count == 0 || seg->sections[0]->lma % minpagesize < sizeof_headers)
return FALSE;
@@ -59,10 +58,8 @@ segment_eligible_for_headers (struct elf_segment_map *seg,
{
if ((seg->sections[i]->flags & (SEC_CODE|SEC_READONLY)) != SEC_READONLY)
return FALSE;
- if (seg->sections[i]->flags & SEC_HAS_CONTENTS)
- any_contents = TRUE;
}
- return any_contents;
+ return TRUE;
}
@@ -72,18 +69,31 @@ segment_eligible_for_headers (struct elf_segment_map *seg,
bfd_boolean
nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
{
+ const struct elf_backend_data *const bed = get_elf_backend_data (abfd);
struct elf_segment_map **m = &elf_seg_map (abfd);
struct elf_segment_map **first_load = NULL;
struct elf_segment_map **last_load = NULL;
bfd_boolean moved_headers = FALSE;
- int sizeof_headers = info == NULL ? 0 : bfd_sizeof_headers (abfd, info);
- bfd_vma minpagesize = get_elf_backend_data (abfd)->minpagesize;
+ int sizeof_headers;
if (info != NULL && info->user_phdrs)
/* The linker script used PHDRS explicitly, so don't change what the
user asked for. */
return TRUE;
+ if (info != NULL)
+ /* We're doing linking, so evalute SIZEOF_HEADERS as in a linker script. */
+ sizeof_headers = bfd_sizeof_headers (abfd, info);
+ else
+ {
+ /* We're not doing linking, so this is objcopy or suchlike.
+ We just need to collect the size of the existing headers. */
+ struct elf_segment_map *seg;
+ sizeof_headers = bed->s->sizeof_ehdr;
+ for (seg = *m; seg != NULL; seg = seg->next)
+ sizeof_headers += bed->s->sizeof_phdr;
+ }
+
while (*m != NULL)
{
struct elf_segment_map *seg = *m;
@@ -94,11 +104,11 @@ nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
if (executable
&& seg->count > 0
- && seg->sections[0]->vma % minpagesize == 0)
+ && seg->sections[0]->vma % bed->minpagesize == 0)
{
asection *lastsec = seg->sections[seg->count - 1];
bfd_vma end = lastsec->vma + lastsec->size;
- if (end % minpagesize != 0)
+ if (end % bed->minpagesize != 0)
{
/* This is an executable segment that starts on a page
boundary but does not end on a page boundary. Fill
@@ -139,7 +149,7 @@ nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
in assign_file_positions_for_load_sections. */
sec->vma = end;
sec->lma = lastsec->lma + lastsec->size;
- sec->size = minpagesize - (end % minpagesize);
+ sec->size = bed->minpagesize - (end % bed->minpagesize);
sec->flags = (SEC_ALLOC | SEC_LOAD
| SEC_READONLY | SEC_CODE | SEC_LINKER_CREATED);
sec->used_by_bfd = secdata;
@@ -174,7 +184,7 @@ nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
/* Now that we've noted the first PT_LOAD, we're looking for
the first non-executable PT_LOAD with a nonempty p_filesz. */
else if (!moved_headers
- && segment_eligible_for_headers (seg, minpagesize,
+ && segment_eligible_for_headers (seg, bed->minpagesize,
sizeof_headers))
{
/* This is the one we were looking for!
diff --git a/binutils-2.25/bfd/elf-nacl.h b/binutils-2.25/bfd/elf-nacl.h
index 87719efe..ec3f4499 100644
--- a/binutils-2.25/bfd/elf-nacl.h
+++ b/binutils-2.25/bfd/elf-nacl.h
@@ -1,5 +1,5 @@
/* Native Client support for ELF
- Copyright 2012, 2013 Free Software Foundation, Inc.
+ Copyright (C) 2012-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf-s390-common.c b/binutils-2.25/bfd/elf-s390-common.c
index 691f7511..c74883cd 100644
--- a/binutils-2.25/bfd/elf-s390-common.c
+++ b/binutils-2.25/bfd/elf-s390-common.c
@@ -1,6 +1,5 @@
/* IBM S/390-specific support for ELF 32 and 64 bit functions
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
Contributed by Andreas Krebbel.
This file is part of BFD, the Binary File Descriptor library.
@@ -235,8 +234,10 @@ elf_s390_add_symbol_hook (bfd *abfd,
asection **secp ATTRIBUTE_UNUSED,
bfd_vma *valp ATTRIBUTE_UNUSED)
{
- if ((abfd->flags & DYNAMIC) == 0
- && ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
+ if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
+ || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)
+ && (abfd->flags & DYNAMIC) == 0
+ && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
return TRUE;
diff --git a/binutils-2.25/bfd/elf-strtab.c b/binutils-2.25/bfd/elf-strtab.c
index 61cedaed..c016c8bd 100644
--- a/binutils-2.25/bfd/elf-strtab.c
+++ b/binutils-2.25/bfd/elf-strtab.c
@@ -1,6 +1,5 @@
/* ELF strtab with GC and suffix merging support.
- Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
Written by Jakub Jelinek <jakub@redhat.com>.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf-vxworks.c b/binutils-2.25/bfd/elf-vxworks.c
index bb9dbbba..77dfd02b 100644
--- a/binutils-2.25/bfd/elf-vxworks.c
+++ b/binutils-2.25/bfd/elf-vxworks.c
@@ -1,5 +1,5 @@
/* VxWorks support for ELF
- Copyright 2005, 2006, 2007, 2009, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2005-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf-vxworks.h b/binutils-2.25/bfd/elf-vxworks.h
index 4a9ed1d8..fa57a27a 100644
--- a/binutils-2.25/bfd/elf-vxworks.h
+++ b/binutils-2.25/bfd/elf-vxworks.h
@@ -1,5 +1,5 @@
/* VxWorks support for ELF
- Copyright 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2005-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf.c b/binutils-2.25/bfd/elf.c
index 8df38ee3..8b207ad8 100644
--- a/binutils-2.25/bfd/elf.c
+++ b/binutils-2.25/bfd/elf.c
@@ -1,6 +1,6 @@
/* ELF executable support for BFD.
- Copyright 1993-2013 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -608,9 +608,10 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
if (shdr->contents == NULL)
{
_bfd_error_handler
- (_("%B: Corrupt size field in group section header: 0x%lx"), abfd, shdr->sh_size);
+ (_("%B: corrupt size field in group section header: 0x%lx"), abfd, shdr->sh_size);
bfd_set_error (bfd_error_bad_value);
- return FALSE;
+ -- num_group;
+ continue;
}
memset (shdr->contents, 0, amt);
@@ -618,7 +619,16 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0
|| (bfd_bread (shdr->contents, shdr->sh_size, abfd)
!= shdr->sh_size))
- return FALSE;
+ {
+ _bfd_error_handler
+ (_("%B: invalid size field in group section header: 0x%lx"), abfd, shdr->sh_size);
+ bfd_set_error (bfd_error_bad_value);
+ -- num_group;
+ /* PR 17510: If the group contents are even partially
+ corrupt, do not allow any of the contents to be used. */
+ memset (shdr->contents, 0, amt);
+ continue;
+ }
/* Translate raw contents, a flag word followed by an
array of elf section indices all in target byte order,
@@ -651,6 +661,21 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
}
}
}
+
+ /* PR 17510: Corrupt binaries might contain invalid groups. */
+ if (num_group != (unsigned) elf_tdata (abfd)->num_group)
+ {
+ elf_tdata (abfd)->num_group = num_group;
+
+ /* If all groups are invalid then fail. */
+ if (num_group == 0)
+ {
+ elf_tdata (abfd)->group_sect_ptr = NULL;
+ elf_tdata (abfd)->num_group = num_group = -1;
+ (*_bfd_error_handler) (_("%B: no valid group sections found"), abfd);
+ bfd_set_error (bfd_error_bad_value);
+ }
+ }
}
}
@@ -716,6 +741,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
{
(*_bfd_error_handler) (_("%B: no group info for section %A"),
abfd, newsect);
+ return FALSE;
}
return TRUE;
}
@@ -1117,13 +1143,17 @@ _bfd_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
return TRUE;
- BFD_ASSERT (!elf_flags_init (obfd)
- || (elf_elfheader (obfd)->e_flags
- == elf_elfheader (ibfd)->e_flags));
+ if (!elf_flags_init (obfd))
+ {
+ elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
+ elf_flags_init (obfd) = TRUE;
+ }
elf_gp (obfd) = elf_gp (ibfd);
- elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
- elf_flags_init (obfd) = TRUE;
+
+ /* Also copy the EI_OSABI field. */
+ elf_elfheader (obfd)->e_ident[EI_OSABI] =
+ elf_elfheader (ibfd)->e_ident[EI_OSABI];
/* Copy object attributes. */
_bfd_elf_copy_obj_attributes (ibfd, obfd);
@@ -1548,38 +1578,74 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
Elf_Internal_Ehdr *ehdr;
const struct elf_backend_data *bed;
const char *name;
+ bfd_boolean ret = TRUE;
+ static bfd_boolean * sections_being_created = NULL;
+ static bfd * sections_being_created_abfd = NULL;
+ static unsigned int nesting = 0;
if (shindex >= elf_numsections (abfd))
return FALSE;
+ if (++ nesting > 3)
+ {
+ /* PR17512: A corrupt ELF binary might contain a recursive group of
+ sections, each the string indicies pointing to the next in the
+ loop. Detect this here, by refusing to load a section that we are
+ already in the process of loading. We only trigger this test if
+ we have nested at least three sections deep as normal ELF binaries
+ can expect to recurse at least once.
+
+ FIXME: It would be better if this array was attached to the bfd,
+ rather than being held in a static pointer. */
+
+ if (sections_being_created_abfd != abfd)
+ sections_being_created = NULL;
+ if (sections_being_created == NULL)
+ {
+ /* FIXME: It would be more efficient to attach this array to the bfd somehow. */
+ sections_being_created = (bfd_boolean *)
+ bfd_zalloc (abfd, elf_numsections (abfd) * sizeof (bfd_boolean));
+ sections_being_created_abfd = abfd;
+ }
+ if (sections_being_created [shindex])
+ {
+ (*_bfd_error_handler)
+ (_("%B: warning: loop in section dependencies detected"), abfd);
+ return FALSE;
+ }
+ sections_being_created [shindex] = TRUE;
+ }
+
hdr = elf_elfsections (abfd)[shindex];
ehdr = elf_elfheader (abfd);
name = bfd_elf_string_from_elf_section (abfd, ehdr->e_shstrndx,
hdr->sh_name);
if (name == NULL)
- return FALSE;
+ goto fail;
bed = get_elf_backend_data (abfd);
switch (hdr->sh_type)
{
case SHT_NULL:
/* Inactive section. Throw it away. */
- return TRUE;
+ goto success;
- case SHT_PROGBITS: /* Normal section with contents. */
- case SHT_NOBITS: /* .bss section. */
- case SHT_HASH: /* .hash section. */
- case SHT_NOTE: /* .note section. */
+ case SHT_PROGBITS: /* Normal section with contents. */
+ case SHT_NOBITS: /* .bss section. */
+ case SHT_HASH: /* .hash section. */
+ case SHT_NOTE: /* .note section. */
case SHT_INIT_ARRAY: /* .init_array section. */
case SHT_FINI_ARRAY: /* .fini_array section. */
case SHT_PREINIT_ARRAY: /* .preinit_array section. */
case SHT_GNU_LIBLIST: /* .gnu.liblist section. */
case SHT_GNU_HASH: /* .gnu.hash section. */
- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ goto success;
case SHT_DYNAMIC: /* Dynamic linking information. */
if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex))
- return FALSE;
+ goto fail;
+
if (hdr->sh_link > elf_numsections (abfd))
{
/* PR 10478: Accept Solaris binaries with a sh_link
@@ -1593,11 +1659,11 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
break;
/* Otherwise fall through. */
default:
- return FALSE;
+ goto fail;
}
}
else if (elf_elfsections (abfd)[hdr->sh_link] == NULL)
- return FALSE;
+ goto fail;
else if (elf_elfsections (abfd)[hdr->sh_link]->sh_type != SHT_STRTAB)
{
Elf_Internal_Shdr *dynsymhdr;
@@ -1626,24 +1692,26 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
}
}
}
- break;
+ goto success;
- case SHT_SYMTAB: /* A symbol table */
+ case SHT_SYMTAB: /* A symbol table. */
if (elf_onesymtab (abfd) == shindex)
- return TRUE;
+ goto success;
if (hdr->sh_entsize != bed->s->sizeof_sym)
- return FALSE;
+ goto fail;
+
if (hdr->sh_info * hdr->sh_entsize > hdr->sh_size)
{
if (hdr->sh_size != 0)
- return FALSE;
+ goto fail;
/* Some assemblers erroneously set sh_info to one with a
zero sh_size. ld sees this as a global symbol count
of (unsigned) -1. Fix it here. */
hdr->sh_info = 0;
- return TRUE;
+ goto success;
}
+
BFD_ASSERT (elf_onesymtab (abfd) == 0);
elf_onesymtab (abfd) = shindex;
elf_tdata (abfd)->symtab_hdr = *hdr;
@@ -1660,7 +1728,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
&& (abfd->flags & DYNAMIC) != 0
&& ! _bfd_elf_make_section_from_shdr (abfd, hdr, name,
shindex))
- return FALSE;
+ goto fail;
/* Go looking for SHT_SYMTAB_SHNDX too, since if there is one we
can't read symbols without that section loaded as well. It
@@ -1686,26 +1754,29 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
break;
}
if (i != shindex)
- return bfd_section_from_shdr (abfd, i);
+ ret = bfd_section_from_shdr (abfd, i);
}
- return TRUE;
+ goto success;
- case SHT_DYNSYM: /* A dynamic symbol table */
+ case SHT_DYNSYM: /* A dynamic symbol table. */
if (elf_dynsymtab (abfd) == shindex)
- return TRUE;
+ goto success;
if (hdr->sh_entsize != bed->s->sizeof_sym)
- return FALSE;
+ goto fail;
+
if (hdr->sh_info * hdr->sh_entsize > hdr->sh_size)
{
if (hdr->sh_size != 0)
- return FALSE;
+ goto fail;
+
/* Some linkers erroneously set sh_info to one with a
zero sh_size. ld sees this as a global symbol count
of (unsigned) -1. Fix it here. */
hdr->sh_info = 0;
- return TRUE;
+ goto success;
}
+
BFD_ASSERT (elf_dynsymtab (abfd) == 0);
elf_dynsymtab (abfd) = shindex;
elf_tdata (abfd)->dynsymtab_hdr = *hdr;
@@ -1714,34 +1785,38 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
/* Besides being a symbol table, we also treat this as a regular
section, so that objcopy can handle it. */
- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ goto success;
- case SHT_SYMTAB_SHNDX: /* Symbol section indices when >64k sections */
+ case SHT_SYMTAB_SHNDX: /* Symbol section indices when >64k sections. */
if (elf_symtab_shndx (abfd) == shindex)
- return TRUE;
+ goto success;
BFD_ASSERT (elf_symtab_shndx (abfd) == 0);
elf_symtab_shndx (abfd) = shindex;
elf_tdata (abfd)->symtab_shndx_hdr = *hdr;
elf_elfsections (abfd)[shindex] = &elf_tdata (abfd)->symtab_shndx_hdr;
- return TRUE;
+ goto success;
- case SHT_STRTAB: /* A string table */
+ case SHT_STRTAB: /* A string table. */
if (hdr->bfd_section != NULL)
- return TRUE;
+ goto success;
+
if (ehdr->e_shstrndx == shindex)
{
elf_tdata (abfd)->shstrtab_hdr = *hdr;
elf_elfsections (abfd)[shindex] = &elf_tdata (abfd)->shstrtab_hdr;
- return TRUE;
+ goto success;
}
+
if (elf_elfsections (abfd)[elf_onesymtab (abfd)]->sh_link == shindex)
{
symtab_strtab:
elf_tdata (abfd)->strtab_hdr = *hdr;
elf_elfsections (abfd)[shindex] = &elf_tdata (abfd)->strtab_hdr;
- return TRUE;
+ goto success;
}
+
if (elf_elfsections (abfd)[elf_dynsymtab (abfd)]->sh_link == shindex)
{
dynsymtab_strtab:
@@ -1750,8 +1825,9 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
elf_elfsections (abfd)[shindex] = hdr;
/* We also treat this as a regular section, so that objcopy
can handle it. */
- return _bfd_elf_make_section_from_shdr (abfd, hdr, name,
- shindex);
+ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name,
+ shindex);
+ goto success;
}
/* If the string table isn't one of the above, then treat it as a
@@ -1769,9 +1845,9 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
{
/* Prevent endless recursion on broken objects. */
if (i == shindex)
- return FALSE;
+ goto fail;
if (! bfd_section_from_shdr (abfd, i))
- return FALSE;
+ goto fail;
if (elf_onesymtab (abfd) == i)
goto symtab_strtab;
if (elf_dynsymtab (abfd) == i)
@@ -1779,7 +1855,8 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
}
}
}
- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ goto success;
case SHT_REL:
case SHT_RELA:
@@ -1794,7 +1871,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
if (hdr->sh_entsize
!= (bfd_size_type) (hdr->sh_type == SHT_REL
? bed->s->sizeof_rel : bed->s->sizeof_rela))
- return FALSE;
+ goto fail;
/* Check for a bogus link to avoid crashing. */
if (hdr->sh_link >= num_sec)
@@ -1802,8 +1879,9 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
((*_bfd_error_handler)
(_("%B: invalid link %lu for reloc section %s (index %u)"),
abfd, hdr->sh_link, name, shindex));
- return _bfd_elf_make_section_from_shdr (abfd, hdr, name,
- shindex);
+ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name,
+ shindex);
+ goto success;
}
/* For some incomprehensible reason Oracle distributes
@@ -1844,7 +1922,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
if ((elf_elfsections (abfd)[hdr->sh_link]->sh_type == SHT_SYMTAB
|| elf_elfsections (abfd)[hdr->sh_link]->sh_type == SHT_DYNSYM)
&& ! bfd_section_from_shdr (abfd, hdr->sh_link))
- return FALSE;
+ goto fail;
/* If this reloc section does not use the main symbol table we
don't treat it as a reloc section. BFD can't adequately
@@ -1859,14 +1937,18 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
|| hdr->sh_info >= num_sec
|| elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_REL
|| elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_RELA)
- return _bfd_elf_make_section_from_shdr (abfd, hdr, name,
- shindex);
+ {
+ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name,
+ shindex);
+ goto success;
+ }
if (! bfd_section_from_shdr (abfd, hdr->sh_info))
- return FALSE;
+ goto fail;
+
target_sect = bfd_section_from_elf_index (abfd, hdr->sh_info);
if (target_sect == NULL)
- return FALSE;
+ goto fail;
esdt = elf_section_data (target_sect);
if (hdr->sh_type == SHT_RELA)
@@ -1878,7 +1960,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
amt = sizeof (*hdr2);
hdr2 = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt);
if (hdr2 == NULL)
- return FALSE;
+ goto fail;
*hdr2 = *hdr;
*p_hdr = hdr2;
elf_elfsections (abfd)[shindex] = hdr2;
@@ -1894,34 +1976,40 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
target_sect->use_rela_p = 1;
}
abfd->flags |= HAS_RELOC;
- return TRUE;
+ goto success;
}
case SHT_GNU_verdef:
elf_dynverdef (abfd) = shindex;
elf_tdata (abfd)->dynverdef_hdr = *hdr;
- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ goto success;
case SHT_GNU_versym:
if (hdr->sh_entsize != sizeof (Elf_External_Versym))
- return FALSE;
+ goto fail;
+
elf_dynversym (abfd) = shindex;
elf_tdata (abfd)->dynversym_hdr = *hdr;
- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ goto success;
case SHT_GNU_verneed:
elf_dynverref (abfd) = shindex;
elf_tdata (abfd)->dynverref_hdr = *hdr;
- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ goto success;
case SHT_SHLIB:
- return TRUE;
+ goto success;
case SHT_GROUP:
if (! IS_VALID_GROUP_SECTION_HEADER (hdr, GRP_ENTRY_SIZE))
- return FALSE;
+ goto fail;
+
if (!_bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex))
- return FALSE;
+ goto fail;
+
if (hdr->contents != NULL)
{
Elf_Internal_Group *idx = (Elf_Internal_Group *) hdr->contents;
@@ -1947,7 +2035,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
}
}
}
- break;
+ goto success;
default:
/* Possibly an attributes section. */
@@ -1955,14 +2043,14 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
|| hdr->sh_type == bed->obj_attrs_section_type)
{
if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex))
- return FALSE;
+ goto fail;
_bfd_elf_parse_attributes (abfd, hdr);
- return TRUE;
+ goto success;
}
/* Check for any processor-specific section types. */
if (bed->elf_backend_section_from_shdr (abfd, hdr, name, shindex))
- return TRUE;
+ goto success;
if (hdr->sh_type >= SHT_LOUSER && hdr->sh_type <= SHT_HIUSER)
{
@@ -1974,9 +2062,12 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
"specific section `%s' [0x%8x]"),
abfd, name, hdr->sh_type);
else
- /* Allow sections reserved for applications. */
- return _bfd_elf_make_section_from_shdr (abfd, hdr, name,
- shindex);
+ {
+ /* Allow sections reserved for applications. */
+ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name,
+ shindex);
+ goto success;
+ }
}
else if (hdr->sh_type >= SHT_LOPROC
&& hdr->sh_type <= SHT_HIPROC)
@@ -1997,8 +2088,11 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
"`%s' [0x%8x]"),
abfd, name, hdr->sh_type);
else
- /* Otherwise it should be processed. */
- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ {
+ /* Otherwise it should be processed. */
+ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ goto success;
+ }
}
else
/* FIXME: We should handle this section. */
@@ -2006,10 +2100,20 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
(_("%B: don't know how to handle section `%s' [0x%8x]"),
abfd, name, hdr->sh_type);
- return FALSE;
+ goto fail;
}
- return TRUE;
+ fail:
+ ret = FALSE;
+ success:
+ if (sections_being_created && sections_being_created_abfd == abfd)
+ sections_being_created [shindex] = FALSE;
+ if (-- nesting == 0)
+ {
+ sections_being_created = NULL;
+ sections_being_created_abfd = abfd;
+ }
+ return ret;
}
/* Return the local symbol specified by ABFD, R_SYMNDX. */
@@ -3071,11 +3175,13 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
{
d->rel.hdr->sh_link = elf_onesymtab (abfd);
d->rel.hdr->sh_info = d->this_idx;
+ d->rel.hdr->sh_flags |= SHF_INFO_LINK;
}
if (d->rela.idx != 0)
{
d->rela.hdr->sh_link = elf_onesymtab (abfd);
d->rela.hdr->sh_info = d->this_idx;
+ d->rela.hdr->sh_flags |= SHF_INFO_LINK;
}
/* We need to set up sh_link for SHF_LINK_ORDER. */
@@ -3162,7 +3268,10 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
name += 5;
s = bfd_get_section_by_name (abfd, name);
if (s != NULL)
- d->this_hdr.sh_info = elf_section_data (s)->this_idx;
+ {
+ d->this_hdr.sh_info = elf_section_data (s)->this_idx;
+ d->this_hdr.sh_flags |= SHF_INFO_LINK;
+ }
break;
case SHT_STRTAB:
@@ -3453,8 +3562,7 @@ _bfd_elf_compute_section_file_positions (bfd *abfd,
return FALSE;
/* Post process the headers if necessary. */
- if (bed->elf_backend_post_process_headers)
- (*bed->elf_backend_post_process_headers) (abfd, link_info);
+ (*bed->elf_backend_post_process_headers) (abfd, link_info);
fsargs.failed = FALSE;
fsargs.link_info = link_info;
@@ -4109,11 +4217,31 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
/* Mandated PF_R. */
m->p_flags = PF_R;
m->p_flags_valid = 1;
+ s = first_tls;
for (i = 0; i < (unsigned int) tls_count; ++i)
{
- BFD_ASSERT (first_tls->flags & SEC_THREAD_LOCAL);
- m->sections[i] = first_tls;
- first_tls = first_tls->next;
+ if ((s->flags & SEC_THREAD_LOCAL) == 0)
+ {
+ _bfd_error_handler
+ (_("%B: TLS sections are not adjacent:"), abfd);
+ s = first_tls;
+ i = 0;
+ while (i < (unsigned int) tls_count)
+ {
+ if ((s->flags & SEC_THREAD_LOCAL) != 0)
+ {
+ _bfd_error_handler (_(" TLS: %A"), s);
+ i++;
+ }
+ else
+ _bfd_error_handler (_(" non-TLS: %A"), s);
+ s = s->next;
+ }
+ bfd_set_error (bfd_error_bad_value);
+ goto error_return;
+ }
+ m->sections[i] = s;
+ s = s->next;
}
*pm = m;
@@ -4176,11 +4304,7 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
== (SEC_LOAD | SEC_HAS_CONTENTS))
break;
- if (i == (unsigned) -1)
- continue;
-
- if (m->sections[i]->vma + m->sections[i]->size
- >= info->relro_end)
+ if (i != (unsigned) -1)
break;
}
}
@@ -4305,6 +4429,9 @@ elf_sort_sections (const void *arg1, const void *arg2)
static file_ptr
vma_page_aligned_bias (bfd_vma vma, ufile_ptr off, bfd_vma maxpagesize)
{
+ /* PR binutils/16199: Handle an alignment of zero. */
+ if (maxpagesize == 0)
+ maxpagesize = 1;
return ((vma - off) % maxpagesize);
}
@@ -4781,6 +4908,7 @@ assign_file_positions_for_load_sections (bfd *abfd,
p->p_flags |= PF_W;
}
}
+
off -= off_adjust;
/* Check that all sections are in a PT_LOAD segment.
@@ -4982,14 +5110,11 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
{
if (lp->p_type == PT_LOAD
&& lp->p_vaddr < link_info->relro_end
- && lp->p_vaddr + lp->p_filesz >= link_info->relro_end
&& lm->count != 0
&& lm->sections[0]->vma >= link_info->relro_start)
break;
}
- /* PR ld/14207. If the RELRO segment doesn't fit in the
- LOAD segment, it should be removed. */
BFD_ASSERT (lm != NULL);
}
else
@@ -5099,7 +5224,6 @@ assign_file_positions_except_relocs (bfd *abfd,
{
struct elf_obj_tdata *tdata = elf_tdata (abfd);
Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd);
- file_ptr off;
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0
@@ -5109,6 +5233,7 @@ assign_file_positions_except_relocs (bfd *abfd,
unsigned int num_sec = elf_numsections (abfd);
Elf_Internal_Shdr **hdrpp;
unsigned int i;
+ file_ptr off;
/* Start after the ELF header. */
off = i_ehdrp->e_ehsize;
@@ -5132,6 +5257,8 @@ assign_file_positions_except_relocs (bfd *abfd,
else
off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE);
}
+
+ elf_next_file_pos (abfd) = off;
}
else
{
@@ -5152,22 +5279,34 @@ assign_file_positions_except_relocs (bfd *abfd,
return FALSE;
}
+ /* Set e_type in ELF header to ET_EXEC for -pie -Ttext-segment=. */
+ if (link_info != NULL
+ && link_info->executable
+ && link_info->shared)
+ {
+ unsigned int num_segments = elf_elfheader (abfd)->e_phnum;
+ Elf_Internal_Phdr *segment = elf_tdata (abfd)->phdr;
+ Elf_Internal_Phdr *end_segment = &segment[num_segments];
+
+ /* Find the lowest p_vaddr in PT_LOAD segments. */
+ bfd_vma p_vaddr = (bfd_vma) -1;
+ for (; segment < end_segment; segment++)
+ if (segment->p_type == PT_LOAD && p_vaddr > segment->p_vaddr)
+ p_vaddr = segment->p_vaddr;
+
+ /* Set e_type to ET_EXEC if the lowest p_vaddr in PT_LOAD
+ segments is non-zero. */
+ if (p_vaddr)
+ i_ehdrp->e_type = ET_EXEC;
+ }
+
/* Write out the program headers. */
alloc = elf_program_header_size (abfd) / bed->s->sizeof_phdr;
if (bfd_seek (abfd, (bfd_signed_vma) bed->s->sizeof_ehdr, SEEK_SET) != 0
|| bed->s->write_out_phdrs (abfd, tdata->phdr, alloc) != 0)
return FALSE;
-
- off = elf_next_file_pos (abfd);
}
- /* Place the section headers. */
- off = align_file_position (off, 1 << bed->s->log_file_align);
- i_ehdrp->e_shoff = off;
- off += i_ehdrp->e_shnum * i_ehdrp->e_shentsize;
-
- elf_next_file_pos (abfd) = off;
-
return TRUE;
}
@@ -5252,7 +5391,7 @@ prep_headers (bfd *abfd)
elf_tdata (abfd)->shstrtab_hdr.sh_name =
(unsigned int) _bfd_elf_strtab_add (shstrtab, ".shstrtab", FALSE);
if (elf_tdata (abfd)->symtab_hdr.sh_name == (unsigned int) -1
- || elf_tdata (abfd)->symtab_hdr.sh_name == (unsigned int) -1
+ || elf_tdata (abfd)->strtab_hdr.sh_name == (unsigned int) -1
|| elf_tdata (abfd)->shstrtab_hdr.sh_name == (unsigned int) -1)
return FALSE;
@@ -5260,14 +5399,16 @@ prep_headers (bfd *abfd)
}
/* Assign file positions for all the reloc sections which are not part
- of the loadable file image. */
+ of the loadable file image, and the file position of section headers. */
-void
+static void
_bfd_elf_assign_file_positions_for_relocs (bfd *abfd)
{
file_ptr off;
unsigned int i, num_sec;
Elf_Internal_Shdr **shdrpp;
+ Elf_Internal_Ehdr *i_ehdrp;
+ const struct elf_backend_data *bed;
off = elf_next_file_pos (abfd);
@@ -5282,6 +5423,12 @@ _bfd_elf_assign_file_positions_for_relocs (bfd *abfd)
off = _bfd_elf_assign_file_position_for_section (shdrp, off, TRUE);
}
+/* Place the section headers. */
+ i_ehdrp = elf_elfheader (abfd);
+ bed = get_elf_backend_data (abfd);
+ off = align_file_position (off, 1 << bed->s->log_file_align);
+ i_ehdrp->e_shoff = off;
+ off += i_ehdrp->e_shnum * i_ehdrp->e_shentsize;
elf_next_file_pos (abfd) = off;
}
@@ -6213,7 +6360,7 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd)
phdr_included = TRUE;
}
- lowest_section = first_section;
+ lowest_section = NULL;
if (section_count != 0)
{
unsigned int isec = 0;
@@ -6230,7 +6377,8 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd)
{
bfd_vma seg_off;
- if (section->lma < lowest_section->lma)
+ if (lowest_section == NULL
+ || section->lma < lowest_section->lma)
lowest_section = section;
/* Section lmas are set up from PT_LOAD header
@@ -7121,8 +7269,12 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bfd_boolean default_imported_symver)
hdr = &elf_tdata (abfd)->dynverref_hdr;
- elf_tdata (abfd)->verref = (Elf_Internal_Verneed *)
+ if (hdr->sh_info)
+ elf_tdata (abfd)->verref = (Elf_Internal_Verneed *)
bfd_zalloc2 (abfd, hdr->sh_info, sizeof (Elf_Internal_Verneed));
+ else
+ elf_tdata (abfd)->verref = NULL;
+
if (elf_tdata (abfd)->verref == NULL)
goto error_return;
@@ -7282,8 +7434,12 @@ error_return_verref:
else
freeidx = ++maxidx;
}
- elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *)
+ if (maxidx)
+ elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *)
bfd_zalloc2 (abfd, maxidx, sizeof (Elf_Internal_Verdef));
+ else
+ elf_tdata (abfd)->verdef = NULL;
+
if (elf_tdata (abfd)->verdef == NULL)
goto error_return;
@@ -7424,16 +7580,12 @@ asymbol *
_bfd_elf_make_empty_symbol (bfd *abfd)
{
elf_symbol_type *newsym;
- bfd_size_type amt = sizeof (elf_symbol_type);
- newsym = (elf_symbol_type *) bfd_zalloc (abfd, amt);
+ newsym = (elf_symbol_type *) bfd_zalloc (abfd, sizeof * newsym);
if (!newsym)
return NULL;
- else
- {
- newsym->symbol.the_bfd = abfd;
- return &newsym->symbol;
- }
+ newsym->symbol.the_bfd = abfd;
+ return &newsym->symbol;
}
void
@@ -7501,8 +7653,8 @@ _bfd_elf_set_arch_mach (bfd *abfd,
static bfd_boolean
elf_find_function (bfd *abfd,
- asection *section,
asymbol **symbols,
+ asection *section,
bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr)
@@ -7604,52 +7756,35 @@ elf_find_function (bfd *abfd,
bfd_boolean
_bfd_elf_find_nearest_line (bfd *abfd,
- asection *section,
asymbol **symbols,
+ asection *section,
bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr,
- unsigned int *line_ptr)
-{
- return _bfd_elf_find_nearest_line_discriminator (abfd, section, symbols,
- offset, filename_ptr,
- functionname_ptr,
- line_ptr,
- NULL);
-}
-
-bfd_boolean
-_bfd_elf_find_nearest_line_discriminator (bfd *abfd,
- asection *section,
- asymbol **symbols,
- bfd_vma offset,
- const char **filename_ptr,
- const char **functionname_ptr,
- unsigned int *line_ptr,
- unsigned int *discriminator_ptr)
+ unsigned int *line_ptr,
+ unsigned int *discriminator_ptr)
{
bfd_boolean found;
- if (_bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset,
+ if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset,
filename_ptr, functionname_ptr,
- line_ptr))
+ line_ptr, discriminator_ptr,
+ dwarf_debug_sections, 0,
+ &elf_tdata (abfd)->dwarf2_find_line_info))
{
if (!*functionname_ptr)
- elf_find_function (abfd, section, symbols, offset,
+ elf_find_function (abfd, symbols, section, offset,
*filename_ptr ? NULL : filename_ptr,
functionname_ptr);
return TRUE;
}
- if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections,
- section, symbols, offset,
- filename_ptr, functionname_ptr,
- line_ptr, discriminator_ptr, 0,
- &elf_tdata (abfd)->dwarf2_find_line_info))
+ if (_bfd_dwarf1_find_nearest_line (abfd, symbols, section, offset,
+ filename_ptr, functionname_ptr, line_ptr))
{
if (!*functionname_ptr)
- elf_find_function (abfd, section, symbols, offset,
+ elf_find_function (abfd, symbols, section, offset,
*filename_ptr ? NULL : filename_ptr,
functionname_ptr);
@@ -7667,7 +7802,7 @@ _bfd_elf_find_nearest_line_discriminator (bfd *abfd,
if (symbols == NULL)
return FALSE;
- if (! elf_find_function (abfd, section, symbols, offset,
+ if (! elf_find_function (abfd, symbols, section, offset,
filename_ptr, functionname_ptr))
return FALSE;
@@ -7681,20 +7816,10 @@ bfd_boolean
_bfd_elf_find_line (bfd *abfd, asymbol **symbols, asymbol *symbol,
const char **filename_ptr, unsigned int *line_ptr)
{
- return _bfd_elf_find_line_discriminator (abfd, symbols, symbol,
- filename_ptr, line_ptr,
- NULL);
-}
-
-bfd_boolean
-_bfd_elf_find_line_discriminator (bfd *abfd, asymbol **symbols, asymbol *symbol,
- const char **filename_ptr,
- unsigned int *line_ptr,
- unsigned int *discriminator_ptr)
-{
- return _bfd_dwarf2_find_line (abfd, symbols, symbol,
- filename_ptr, line_ptr, discriminator_ptr, 0,
- &elf_tdata (abfd)->dwarf2_find_line_info);
+ return _bfd_dwarf2_find_nearest_line (abfd, symbols, symbol, NULL, 0,
+ filename_ptr, NULL, line_ptr, NULL,
+ dwarf_debug_sections, 0,
+ &elf_tdata (abfd)->dwarf2_find_line_info);
}
/* After a call to bfd_find_nearest_line, successive calls to
@@ -7753,7 +7878,7 @@ _bfd_elf_set_section_contents (bfd *abfd,
bfd_size_type count)
{
Elf_Internal_Shdr *hdr;
- bfd_signed_vma pos;
+ file_ptr pos;
if (! abfd->output_has_begun
&& ! _bfd_elf_compute_section_file_positions (abfd, NULL))
@@ -9287,7 +9412,7 @@ elfcore_write_lwpstatus (bfd *abfd,
lwpstat.pr_lwpid = pid >> 16;
lwpstat.pr_cursig = cursig;
#if defined (HAVE_LWPSTATUS_T_PR_REG)
- memcpy (lwpstat.pr_reg, gregs, sizeof (lwpstat.pr_reg));
+ memcpy (&lwpstat.pr_reg, gregs, sizeof (lwpstat.pr_reg));
#elif defined (HAVE_LWPSTATUS_T_PR_CONTEXT)
#if !defined(gregs)
memcpy (lwpstat.pr_context.uc_mcontext.gregs,
@@ -9861,11 +9986,12 @@ bfd *
bfd_elf_bfd_from_remote_memory
(bfd *templ,
bfd_vma ehdr_vma,
+ bfd_size_type size,
bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type))
{
return (*get_elf_backend_data (templ)->elf_backend_bfd_from_remote_memory)
- (templ, ehdr_vma, loadbasep, target_read_memory);
+ (templ, ehdr_vma, size, loadbasep, target_read_memory);
}
long
@@ -9991,8 +10117,8 @@ asection _bfd_elf_large_com_section
SEC_IS_COMMON, NULL, "LARGE_COMMON", 0);
void
-_bfd_elf_set_osabi (bfd * abfd,
- struct bfd_link_info * link_info ATTRIBUTE_UNUSED)
+_bfd_elf_post_process_headers (bfd * abfd,
+ struct bfd_link_info * link_info ATTRIBUTE_UNUSED)
{
Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */
diff --git a/binutils-2.25/bfd/elf32-am33lin.c b/binutils-2.25/bfd/elf32-am33lin.c
index f23ef8ee..c28308d9 100644
--- a/binutils-2.25/bfd/elf32-am33lin.c
+++ b/binutils-2.25/bfd/elf32-am33lin.c
@@ -1,6 +1,5 @@
/* Matsushita AM33/2.0 support for 32-bit GNU/Linux ELF
- Copyright 2003, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 2003-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -26,7 +25,7 @@
#define elf_symbol_leading_char 0
-#define TARGET_LITTLE_SYM bfd_elf32_am33lin_vec
+#define TARGET_LITTLE_SYM am33_elf32_linux_vec
#define TARGET_LITTLE_NAME "elf32-am33lin"
#define ELF_ARCH bfd_arch_mn10300
#define ELF_MACHINE_CODE EM_MN10300
diff --git a/binutils-2.25/bfd/elf32-arc.c b/binutils-2.25/bfd/elf32-arc.c
index 3ef83f9f..e528e66b 100644
--- a/binutils-2.25/bfd/elf32-arc.c
+++ b/binutils-2.25/bfd/elf32-arc.c
@@ -1,6 +1,5 @@
/* ARC-specific support for 32-bit ELF
- Copyright 1994, 1995, 1997, 1999, 2001, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
Contributed by Doug Evans (dje@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
@@ -237,9 +236,9 @@ arc_elf_final_write_processing (bfd *abfd,
elf_elfheader (abfd)->e_flags |= val;
}
-#define TARGET_LITTLE_SYM bfd_elf32_littlearc_vec
+#define TARGET_LITTLE_SYM arc_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-littlearc"
-#define TARGET_BIG_SYM bfd_elf32_bigarc_vec
+#define TARGET_BIG_SYM arc_elf32_be_vec
#define TARGET_BIG_NAME "elf32-bigarc"
#define ELF_ARCH bfd_arch_arc
#define ELF_MACHINE_CODE EM_ARC
diff --git a/binutils-2.25/bfd/elf32-arm.c b/binutils-2.25/bfd/elf32-arm.c
index 9c31ddd7..996889d8 100644
--- a/binutils-2.25/bfd/elf32-arm.c
+++ b/binutils-2.25/bfd/elf32-arm.c
@@ -1,5 +1,5 @@
/* 32-bit ELF support for ARM
- Copyright 1998-2013 Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -2040,9 +2040,9 @@ elf32_arm_nabi_write_core_note (bfd *abfd, char *buf, int *bufsiz,
}
}
-#define TARGET_LITTLE_SYM bfd_elf32_littlearm_vec
+#define TARGET_LITTLE_SYM arm_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-littlearm"
-#define TARGET_BIG_SYM bfd_elf32_bigarm_vec
+#define TARGET_BIG_SYM arm_elf32_be_vec
#define TARGET_BIG_NAME "elf32-bigarm"
#define elf_backend_grok_prstatus elf32_arm_nabi_grok_prstatus
@@ -2125,7 +2125,7 @@ static const bfd_vma elf32_arm_plt_entry [] =
0x00000000, /* unused */
};
-#else
+#else /* not FOUR_WORD_PLT */
/* The first entry in a procedure linkage table looks like
this. It is set up so that any shared library function that is
@@ -2140,16 +2140,55 @@ static const bfd_vma elf32_arm_plt0_entry [] =
0x00000000, /* &GOT[0] - . */
};
-/* Subsequent entries in a procedure linkage table look like
- this. */
-static const bfd_vma elf32_arm_plt_entry [] =
+/* By default subsequent entries in a procedure linkage table look like
+ this. Offsets that don't fit into 28 bits will cause link error. */
+static const bfd_vma elf32_arm_plt_entry_short [] =
{
0xe28fc600, /* add ip, pc, #0xNN00000 */
0xe28cca00, /* add ip, ip, #0xNN000 */
0xe5bcf000, /* ldr pc, [ip, #0xNNN]! */
};
-#endif
+/* When explicitly asked, we'll use this "long" entry format
+ which can cope with arbitrary displacements. */
+static const bfd_vma elf32_arm_plt_entry_long [] =
+{
+ 0xe28fc200, /* add ip, pc, #0xN0000000 */
+ 0xe28cc600, /* add ip, ip, #0xNN00000 */
+ 0xe28cca00, /* add ip, ip, #0xNN000 */
+ 0xe5bcf000, /* ldr pc, [ip, #0xNNN]! */
+};
+
+static bfd_boolean elf32_arm_use_long_plt_entry = FALSE;
+
+#endif /* not FOUR_WORD_PLT */
+
+/* The first entry in a procedure linkage table looks like this.
+ It is set up so that any shared library function that is called before the
+ relocation has been set up calls the dynamic linker first. */
+static const bfd_vma elf32_thumb2_plt0_entry [] =
+{
+ /* NOTE: As this is a mixture of 16-bit and 32-bit instructions,
+ an instruction maybe encoded to one or two array elements. */
+ 0xf8dfb500, /* push {lr} */
+ 0x44fee008, /* ldr.w lr, [pc, #8] */
+ /* add lr, pc */
+ 0xff08f85e, /* ldr.w pc, [lr, #8]! */
+ 0x00000000, /* &GOT[0] - . */
+};
+
+/* Subsequent entries in a procedure linkage table for thumb only target
+ look like this. */
+static const bfd_vma elf32_thumb2_plt_entry [] =
+{
+ /* NOTE: As this is a mixture of 16-bit and 32-bit instructions,
+ an instruction maybe encoded to one or two array elements. */
+ 0x0c00f240, /* movw ip, #0xNNNN */
+ 0x0c00f2c0, /* movt ip, #0xNNNN */
+ 0xf8dc44fc, /* add ip, pc */
+ 0xbf00f000 /* ldr.w pc, [ip] */
+ /* nop */
+};
/* The format of the first entry in the procedure linkage table
for a VxWorks executable. */
@@ -2244,6 +2283,8 @@ static const bfd_vma elf32_arm_nacl_plt_entry [] =
#define THM_MAX_BWD_BRANCH_OFFSET (-(1 << 22) + 4)
#define THM2_MAX_FWD_BRANCH_OFFSET (((1 << 24) - 2) + 4)
#define THM2_MAX_BWD_BRANCH_OFFSET (-(1 << 24) + 4)
+#define THM2_MAX_FWD_COND_BRANCH_OFFSET (((1 << 20) -2) + 4)
+#define THM2_MAX_BWD_COND_BRANCH_OFFSET (-(1 << 20) + 4)
enum stub_insn_type
{
@@ -2530,7 +2571,7 @@ enum elf32_arm_stub_type
{
arm_stub_none,
DEF_STUBS
- /* Note the first a8_veneer type */
+ /* Note the first a8_veneer type. */
arm_stub_a8_veneer_lwm = arm_stub_a8_veneer_b_cond
};
#undef DEF_STUB
@@ -3317,6 +3358,37 @@ create_ifunc_sections (struct bfd_link_info *info)
return TRUE;
}
+/* Determine if we're dealing with a Thumb only architecture. */
+
+static bfd_boolean
+using_thumb_only (struct elf32_arm_link_hash_table *globals)
+{
+ int arch = bfd_elf_get_obj_attr_int (globals->obfd, OBJ_ATTR_PROC,
+ Tag_CPU_arch);
+ int profile;
+
+ if (arch == TAG_CPU_ARCH_V6_M || arch == TAG_CPU_ARCH_V6S_M)
+ return TRUE;
+
+ if (arch != TAG_CPU_ARCH_V7 && arch != TAG_CPU_ARCH_V7E_M)
+ return FALSE;
+
+ profile = bfd_elf_get_obj_attr_int (globals->obfd, OBJ_ATTR_PROC,
+ Tag_CPU_arch_profile);
+
+ return profile == 'M';
+}
+
+/* Determine if we're dealing with a Thumb-2 object. */
+
+static bfd_boolean
+using_thumb2 (struct elf32_arm_link_hash_table *globals)
+{
+ int arch = bfd_elf_get_obj_attr_int (globals->obfd, OBJ_ATTR_PROC,
+ Tag_CPU_arch);
+ return arch == TAG_CPU_ARCH_V6T2 || arch >= TAG_CPU_ARCH_V7;
+}
+
/* Create .plt, .rel(a).plt, .got, .got.plt, .rel(a).got, .dynbss, and
.rel(a).bss sections in DYNOBJ, and set up shortcuts to them in our
hash table. */
@@ -3360,6 +3432,22 @@ elf32_arm_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
= 4 * ARRAY_SIZE (elf32_arm_vxworks_exec_plt_entry);
}
}
+ else
+ {
+ /* PR ld/16017
+ Test for thumb only architectures. Note - we cannot just call
+ using_thumb_only() as the attributes in the output bfd have not been
+ initialised at this point, so instead we use the input bfd. */
+ bfd * saved_obfd = htab->obfd;
+
+ htab->obfd = dynobj;
+ if (using_thumb_only (htab))
+ {
+ htab->plt_header_size = 4 * ARRAY_SIZE (elf32_thumb2_plt0_entry);
+ htab->plt_entry_size = 4 * ARRAY_SIZE (elf32_thumb2_plt_entry);
+ }
+ htab->obfd = saved_obfd;
+ }
if (!htab->root.splt
|| !htab->root.srelplt
@@ -3437,6 +3525,18 @@ elf32_arm_copy_indirect_symbol (struct bfd_link_info *info,
_bfd_elf_link_hash_copy_indirect (info, dir, ind);
}
+/* Destroy an ARM elf linker hash table. */
+
+static void
+elf32_arm_link_hash_table_free (bfd *obfd)
+{
+ struct elf32_arm_link_hash_table *ret
+ = (struct elf32_arm_link_hash_table *) obfd->link.hash;
+
+ bfd_hash_table_free (&ret->stub_hash_table);
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
/* Create an ARM elf linker hash table. */
static struct bfd_link_hash_table *
@@ -3464,7 +3564,7 @@ elf32_arm_link_hash_table_create (bfd *abfd)
ret->plt_entry_size = 16;
#else
ret->plt_header_size = 20;
- ret->plt_entry_size = 12;
+ ret->plt_entry_size = elf32_arm_use_long_plt_entry ? 16 : 12;
#endif
ret->use_rel = 1;
ret->obfd = abfd;
@@ -3472,56 +3572,14 @@ elf32_arm_link_hash_table_create (bfd *abfd)
if (!bfd_hash_table_init (&ret->stub_hash_table, stub_hash_newfunc,
sizeof (struct elf32_arm_stub_hash_entry)))
{
- free (ret);
+ _bfd_elf_link_hash_table_free (abfd);
return NULL;
}
+ ret->root.root.hash_table_free = elf32_arm_link_hash_table_free;
return &ret->root.root;
}
-/* Free the derived linker hash table. */
-
-static void
-elf32_arm_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct elf32_arm_link_hash_table *ret
- = (struct elf32_arm_link_hash_table *) hash;
-
- bfd_hash_table_free (&ret->stub_hash_table);
- _bfd_elf_link_hash_table_free (hash);
-}
-
-/* Determine if we're dealing with a Thumb only architecture. */
-
-static bfd_boolean
-using_thumb_only (struct elf32_arm_link_hash_table *globals)
-{
- int arch = bfd_elf_get_obj_attr_int (globals->obfd, OBJ_ATTR_PROC,
- Tag_CPU_arch);
- int profile;
-
- if (arch == TAG_CPU_ARCH_V6_M || arch == TAG_CPU_ARCH_V6S_M)
- return TRUE;
-
- if (arch != TAG_CPU_ARCH_V7 && arch != TAG_CPU_ARCH_V7E_M)
- return FALSE;
-
- profile = bfd_elf_get_obj_attr_int (globals->obfd, OBJ_ATTR_PROC,
- Tag_CPU_arch_profile);
-
- return profile == 'M';
-}
-
-/* Determine if we're dealing with a Thumb-2 object. */
-
-static bfd_boolean
-using_thumb2 (struct elf32_arm_link_hash_table *globals)
-{
- int arch = bfd_elf_get_obj_attr_int (globals->obfd, OBJ_ATTR_PROC,
- Tag_CPU_arch);
- return arch == TAG_CPU_ARCH_V6T2 || arch >= TAG_CPU_ARCH_V7;
-}
-
/* Determine what kind of NOPs are available. */
static bfd_boolean
@@ -3611,7 +3669,8 @@ arm_type_of_stub (struct bfd_link_info *info,
/* ST_BRANCH_TO_ARM is nonsense to thumb-only targets when we
are considering a function call relocation. */
- if (thumb_only && (r_type == R_ARM_THM_CALL || r_type == R_ARM_THM_JUMP24)
+ if (thumb_only && (r_type == R_ARM_THM_CALL || r_type == R_ARM_THM_JUMP24
+ || r_type == R_ARM_THM_JUMP19)
&& branch_type == ST_BRANCH_TO_ARM)
branch_type = ST_BRANCH_TO_THUMB;
@@ -3655,7 +3714,7 @@ arm_type_of_stub (struct bfd_link_info *info,
branch_offset = (bfd_signed_vma)(destination - location);
if (r_type == R_ARM_THM_CALL || r_type == R_ARM_THM_JUMP24
- || r_type == R_ARM_THM_TLS_CALL)
+ || r_type == R_ARM_THM_TLS_CALL || r_type == R_ARM_THM_JUMP19)
{
/* Handle cases where:
- this call goes too far (different Thumb/Thumb2 max
@@ -3671,10 +3730,15 @@ arm_type_of_stub (struct bfd_link_info *info,
|| (thumb2
&& (branch_offset > THM2_MAX_FWD_BRANCH_OFFSET
|| (branch_offset < THM2_MAX_BWD_BRANCH_OFFSET)))
+ || (thumb2
+ && (branch_offset > THM2_MAX_FWD_COND_BRANCH_OFFSET
+ || (branch_offset < THM2_MAX_BWD_COND_BRANCH_OFFSET))
+ && (r_type == R_ARM_THM_JUMP19))
|| (branch_type == ST_BRANCH_TO_ARM
&& (((r_type == R_ARM_THM_CALL
|| r_type == R_ARM_THM_TLS_CALL) && !globals->use_blx)
- || (r_type == R_ARM_THM_JUMP24))
+ || (r_type == R_ARM_THM_JUMP24)
+ || (r_type == R_ARM_THM_JUMP19))
&& !use_plt))
{
if (branch_type == ST_BRANCH_TO_THUMB)
@@ -3728,7 +3792,7 @@ arm_type_of_stub (struct bfd_link_info *info,
(info->shared | globals->pic_veneer)
/* PIC stubs. */
? (r_type == R_ARM_THM_TLS_CALL
- /* TLS PIC stubs */
+ /* TLS PIC stubs. */
? (globals->use_blx ? arm_stub_long_branch_any_tls_pic
: arm_stub_long_branch_v4t_thumb_tls_pic)
: ((globals->use_blx && r_type == R_ARM_THM_CALL)
@@ -3805,7 +3869,7 @@ arm_type_of_stub (struct bfd_link_info *info,
(info->shared | globals->pic_veneer)
/* PIC stubs. */
? (r_type == R_ARM_TLS_CALL
- /* TLS PIC Stub */
+ /* TLS PIC Stub. */
? arm_stub_long_branch_any_tls_pic
: (globals->nacl_p
? arm_stub_long_branch_arm_nacl_pic
@@ -4381,7 +4445,7 @@ elf32_arm_setup_section_lists (bfd *output_bfd,
/* Count the number of input BFDs and find the top input section id. */
for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next)
+ input_bfd = input_bfd->link.next)
{
bfd_count += 1;
for (section = input_bfd->sections;
@@ -4990,7 +5054,7 @@ elf32_arm_size_stubs (bfd *output_bfd,
num_a8_fixes = 0;
for (input_bfd = info->input_bfds, bfd_indx = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next, bfd_indx++)
+ input_bfd = input_bfd->link.next, bfd_indx++)
{
Elf_Internal_Shdr *symtab_hdr;
asection *section;
@@ -5140,7 +5204,7 @@ elf32_arm_size_stubs (bfd *output_bfd,
if (!sym_sec)
/* This is an undefined symbol. It can never
- be resolved. */
+ be resolved. */
continue;
if (ELF_ST_TYPE (sym->st_info) != STT_SECTION)
@@ -5291,7 +5355,8 @@ elf32_arm_size_stubs (bfd *output_bfd,
/* For historical reasons, use the existing names for
ARM-to-Thumb and Thumb-to-ARM stubs. */
if ((r_type == (unsigned int) R_ARM_THM_CALL
- || r_type == (unsigned int) R_ARM_THM_JUMP24)
+ || r_type == (unsigned int) R_ARM_THM_JUMP24
+ || r_type == (unsigned int) R_ARM_THM_JUMP19)
&& branch_type == ST_BRANCH_TO_ARM)
sprintf (stub_entry->output_name,
THUMB2ARM_GLUE_ENTRY_NAME, sym_name);
@@ -6027,6 +6092,15 @@ arm_make_glue_section (bfd * abfd, const char * name)
return TRUE;
}
+/* Set size of .plt entries. This function is called from the
+ linker scripts in ld/emultempl/{armelf}.em. */
+
+void
+bfd_elf32_arm_use_long_plt (void)
+{
+ elf32_arm_use_long_plt_entry = TRUE;
+}
+
/* Add the glue sections to ABFD. This function is called from the
linker scripts in ld/emultempl/{armelf}.em. */
@@ -7457,6 +7531,8 @@ elf32_arm_allocate_plt_entry (struct bfd_link_info *info,
first entry. */
if (splt->size == 0)
splt->size += htab->plt_header_size;
+
+ htab->next_tls_desc_index++;
}
/* Allocate the PLT entry itself, including any leading Thumb stub. */
@@ -7469,7 +7545,10 @@ elf32_arm_allocate_plt_entry (struct bfd_link_info *info,
{
/* We also need to make an entry in the .got.plt section, which
will be placed in the .got section by the linker script. */
- arm_plt->got_offset = sgotplt->size - 8 * htab->num_tls_desc;
+ if (is_iplt_entry)
+ arm_plt->got_offset = sgotplt->size;
+ else
+ arm_plt->got_offset = sgotplt->size - 8 * htab->num_tls_desc;
sgotplt->size += 4;
}
}
@@ -7493,9 +7572,11 @@ arm_movt_immediate (bfd_vma value)
ROOT_PLT points to the offset of the PLT entry from the start of its
section (.iplt or .plt). ARM_PLT points to the symbol's ARM-specific
- bookkeeping information. */
+ bookkeeping information.
-static void
+ Returns FALSE if there was a problem. */
+
+static bfd_boolean
elf32_arm_populate_plt_entry (bfd *output_bfd, struct bfd_link_info *info,
union gotplt_union *root_plt,
struct arm_plt_info *arm_plt,
@@ -7685,6 +7766,46 @@ elf32_arm_populate_plt_entry (bfd *output_bfd, struct bfd_link_info *info,
| (tail_displacement & 0x00ffffff),
ptr + 12);
}
+ else if (using_thumb_only (htab))
+ {
+ /* PR ld/16017: Generate thumb only PLT entries. */
+ if (!using_thumb2 (htab))
+ {
+ /* FIXME: We ought to be able to generate thumb-1 PLT
+ instructions... */
+ _bfd_error_handler (_("%B: Warning: thumb-1 mode PLT generation not currently supported"),
+ output_bfd);
+ return FALSE;
+ }
+
+ /* Calculate the displacement between the PLT slot and the entry in
+ the GOT. The 12-byte offset accounts for the value produced by
+ adding to pc in the 3rd instruction of the PLT stub. */
+ got_displacement = got_address - (plt_address + 12);
+
+ /* As we are using 32 bit instructions we have to use 'put_arm_insn'
+ instead of 'put_thumb_insn'. */
+ put_arm_insn (htab, output_bfd,
+ elf32_thumb2_plt_entry[0]
+ | ((got_displacement & 0x000000ff) << 16)
+ | ((got_displacement & 0x00000700) << 20)
+ | ((got_displacement & 0x00000800) >> 1)
+ | ((got_displacement & 0x0000f000) >> 12),
+ ptr + 0);
+ put_arm_insn (htab, output_bfd,
+ elf32_thumb2_plt_entry[1]
+ | ((got_displacement & 0x00ff0000) )
+ | ((got_displacement & 0x07000000) << 4)
+ | ((got_displacement & 0x08000000) >> 17)
+ | ((got_displacement & 0xf0000000) >> 28),
+ ptr + 4);
+ put_arm_insn (htab, output_bfd,
+ elf32_thumb2_plt_entry[2],
+ ptr + 8);
+ put_arm_insn (htab, output_bfd,
+ elf32_thumb2_plt_entry[3],
+ ptr + 12);
+ }
else
{
/* Calculate the displacement between the PLT slot and the
@@ -7693,8 +7814,6 @@ elf32_arm_populate_plt_entry (bfd *output_bfd, struct bfd_link_info *info,
of the PLT stub. */
got_displacement = got_address - (plt_address + 8);
- BFD_ASSERT ((got_displacement & 0xf0000000) == 0);
-
if (elf32_arm_plt_needs_thumb_stub_p (info, arm_plt))
{
put_thumb_insn (htab, output_bfd,
@@ -7703,21 +7822,45 @@ elf32_arm_populate_plt_entry (bfd *output_bfd, struct bfd_link_info *info,
elf32_arm_plt_thumb_stub[1], ptr - 2);
}
- put_arm_insn (htab, output_bfd,
- elf32_arm_plt_entry[0]
- | ((got_displacement & 0x0ff00000) >> 20),
- ptr + 0);
- put_arm_insn (htab, output_bfd,
- elf32_arm_plt_entry[1]
- | ((got_displacement & 0x000ff000) >> 12),
- ptr+ 4);
- put_arm_insn (htab, output_bfd,
- elf32_arm_plt_entry[2]
- | (got_displacement & 0x00000fff),
- ptr + 8);
+ if (!elf32_arm_use_long_plt_entry)
+ {
+ BFD_ASSERT ((got_displacement & 0xf0000000) == 0);
+
+ put_arm_insn (htab, output_bfd,
+ elf32_arm_plt_entry_short[0]
+ | ((got_displacement & 0x0ff00000) >> 20),
+ ptr + 0);
+ put_arm_insn (htab, output_bfd,
+ elf32_arm_plt_entry_short[1]
+ | ((got_displacement & 0x000ff000) >> 12),
+ ptr+ 4);
+ put_arm_insn (htab, output_bfd,
+ elf32_arm_plt_entry_short[2]
+ | (got_displacement & 0x00000fff),
+ ptr + 8);
#ifdef FOUR_WORD_PLT
- bfd_put_32 (output_bfd, elf32_arm_plt_entry[3], ptr + 12);
+ bfd_put_32 (output_bfd, elf32_arm_plt_entry_short[3], ptr + 12);
#endif
+ }
+ else
+ {
+ put_arm_insn (htab, output_bfd,
+ elf32_arm_plt_entry_long[0]
+ | ((got_displacement & 0xf0000000) >> 28),
+ ptr + 0);
+ put_arm_insn (htab, output_bfd,
+ elf32_arm_plt_entry_long[1]
+ | ((got_displacement & 0x0ff00000) >> 20),
+ ptr + 4);
+ put_arm_insn (htab, output_bfd,
+ elf32_arm_plt_entry_long[2]
+ | ((got_displacement & 0x000ff000) >> 12),
+ ptr+ 8);
+ put_arm_insn (htab, output_bfd,
+ elf32_arm_plt_entry_long[3]
+ | (got_displacement & 0x00000fff),
+ ptr + 12);
+ }
}
/* Fill in the entry in the .rel(a).(i)plt section. */
@@ -7750,6 +7893,8 @@ elf32_arm_populate_plt_entry (bfd *output_bfd, struct bfd_link_info *info,
loc = srel->contents + plt_index * RELOC_SIZE (htab);
SWAP_RELOC_OUT (htab) (output_bfd, &rel, loc);
}
+
+ return TRUE;
}
/* Some relocations map to different relocations depending on the
@@ -7945,7 +8090,7 @@ elf32_arm_tls_relax (struct elf32_arm_link_hash_table *globals,
break;
case R_ARM_THM_TLS_CALL:
- /* GD->IE relaxation */
+ /* GD->IE relaxation. */
if (!is_local)
/* add r0,pc; ldr r0, [r0] */
insn = 0x44786800;
@@ -8165,9 +8310,11 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
plt_offset--;
else
{
- elf32_arm_populate_plt_entry (output_bfd, info, root_plt, arm_plt,
- -1, dynreloc_value);
- root_plt->offset |= 1;
+ if (elf32_arm_populate_plt_entry (output_bfd, info, root_plt, arm_plt,
+ -1, dynreloc_value))
+ root_plt->offset |= 1;
+ else
+ return bfd_reloc_notsupported;
}
/* Static relocations always resolve to the .iplt entry. */
@@ -8593,6 +8740,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
return bfd_reloc_ok;
case R_ARM_ABS8:
+ /* PR 16202: Refectch the addend using the correct size. */
+ if (globals->use_rel)
+ addend = bfd_get_8 (input_bfd, hit_data);
value += addend;
/* There is no way to tell whether the user intended to use a signed or
@@ -8605,6 +8755,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
return bfd_reloc_ok;
case R_ARM_ABS16:
+ /* PR 16202: Refectch the addend using the correct size. */
+ if (globals->use_rel)
+ addend = bfd_get_16 (input_bfd, hit_data);
value += addend;
/* See comment for R_ARM_ABS8. */
@@ -8896,7 +9049,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
+ splt->output_offset
+ plt_offset);
- if (globals->use_blx && r_type == R_ARM_THM_CALL)
+ if (globals->use_blx
+ && r_type == R_ARM_THM_CALL
+ && ! using_thumb_only (globals))
{
/* If the Thumb BLX instruction is available, convert
the BL to a BLX instruction to call the ARM-mode
@@ -8906,8 +9061,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
}
else
{
- /* Target the Thumb stub before the ARM PLT entry. */
- value -= PLT_THUMB_STUB_SIZE;
+ if (! using_thumb_only (globals))
+ /* Target the Thumb stub before the ARM PLT entry. */
+ value -= PLT_THUMB_STUB_SIZE;
branch_type = ST_BRANCH_TO_THUMB;
}
*unresolved_reloc_p = FALSE;
@@ -8978,6 +9134,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
bfd_signed_vma reloc_signed_max = 0xffffe;
bfd_signed_vma reloc_signed_min = -0x100000;
bfd_signed_vma signed_check;
+ enum elf32_arm_stub_type stub_type = arm_stub_none;
+ struct elf32_arm_stub_hash_entry *stub_entry;
+ struct elf32_arm_link_hash_entry *hash;
/* Need to refetch the addend, reconstruct the top three bits,
and squish the two 11 bit pieces together. */
@@ -9009,8 +9168,25 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
*unresolved_reloc_p = FALSE;
}
- /* ??? Should handle interworking? GCC might someday try to
- use this for tail calls. */
+ hash = (struct elf32_arm_link_hash_entry *)h;
+
+ stub_type = arm_type_of_stub (info, input_section, rel,
+ st_type, &branch_type,
+ hash, value, sym_sec,
+ input_bfd, sym_name);
+ if (stub_type != arm_stub_none)
+ {
+ stub_entry = elf32_arm_get_stub_entry (input_section,
+ sym_sec, h,
+ rel, globals,
+ stub_type);
+ if (stub_entry != NULL)
+ {
+ value = (stub_entry->stub_offset
+ + stub_entry->stub_sec->output_offset
+ + stub_entry->stub_sec->output_section->vma);
+ }
+ }
relocation = value + signed_addend;
relocation -= (input_section->output_section->vma
@@ -9602,7 +9778,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
else
{
lower_insn = 0xc000;
- /* Round up the offset to a word boundary */
+ /* Round up the offset to a word boundary. */
offset = (offset + 2) & ~2;
}
@@ -9621,7 +9797,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
/* These relocations needs special care, as besides the fact
they point somewhere in .gotplt, the addend must be
adjusted accordingly depending on the type of instruction
- we refer to */
+ we refer to. */
else if ((r_type == R_ARM_TLS_GOTDESC) && (tls_type & GOT_TLS_GDESC))
{
unsigned long data, insn;
@@ -10510,12 +10686,12 @@ elf32_arm_relocate_section (bfd * output_bfd,
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
sym_type = h->type;
}
@@ -10573,7 +10749,7 @@ elf32_arm_relocate_section (bfd * output_bfd,
done, i.e., the relaxation produced the final output we want,
and we won't let anybody mess with it. Also, we have to do
addend adjustments in case of a R_ARM_TLS_GOTDESC relocation
- both in relaxed and non-relaxed cases */
+ both in relaxed and non-relaxed cases. */
if ((elf32_arm_tls_transition (info, r_type, h) != (unsigned)r_type)
|| (IS_ARM_TLS_GNU_RELOC (r_type)
&& !((h ? elf32_arm_hash_entry (h)->tls_type :
@@ -10770,7 +10946,7 @@ elf32_arm_fix_exidx_coverage (asection **text_section_order,
/* Walk over all EXIDX sections, and create backlinks from the corrsponding
text sections. */
- for (inp = info->input_bfds; inp != NULL; inp = inp->link_next)
+ for (inp = info->input_bfds; inp != NULL; inp = inp->link.next)
{
asection *sec;
@@ -11142,14 +11318,7 @@ elf32_arm_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
elf_elfheader (obfd)->e_flags = in_flags;
elf_flags_init (obfd) = TRUE;
- /* Also copy the EI_OSABI field. */
- elf_elfheader (obfd)->e_ident[EI_OSABI] =
- elf_elfheader (ibfd)->e_ident[EI_OSABI];
-
- /* Copy object attributes. */
- _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
- return TRUE;
+ return _bfd_elf_copy_private_bfd_data (ibfd, obfd);
}
/* Values for Tag_ABI_PCS_R9_use. */
@@ -11597,7 +11766,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
{
case Tag_CPU_raw_name:
case Tag_CPU_name:
- /* These are merged after Tag_CPU_arch. */
+ /* These are merged after Tag_CPU_arch. */
break;
case Tag_ABI_optimization_goals:
@@ -11609,7 +11778,9 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
{
int secondary_compat = -1, secondary_compat_out = -1;
unsigned int saved_out_attr = out_attr[i].i;
- static const char *name_table[] = {
+ int arch_attr;
+ static const char *name_table[] =
+ {
/* These aren't real CPU names, but we can't guess
that from the architecture version alone. */
"Pre v4",
@@ -11631,10 +11802,17 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
/* Merge Tag_CPU_arch and Tag_also_compatible_with. */
secondary_compat = get_secondary_compatible_arch (ibfd);
secondary_compat_out = get_secondary_compatible_arch (obfd);
- out_attr[i].i = tag_cpu_arch_combine (ibfd, out_attr[i].i,
- &secondary_compat_out,
- in_attr[i].i,
- secondary_compat);
+ arch_attr = tag_cpu_arch_combine (ibfd, out_attr[i].i,
+ &secondary_compat_out,
+ in_attr[i].i,
+ secondary_compat);
+
+ /* Return with error if failed to merge. */
+ if (arch_attr == -1)
+ return FALSE;
+
+ out_attr[i].i = arch_attr;
+
set_secondary_compatible_arch (obfd, secondary_compat_out);
/* Merge Tag_CPU_name and Tag_CPU_raw_name. */
@@ -11751,7 +11929,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
else if (in_attr[i].i == 0
|| (in_attr[i].i == 'S'
&& (out_attr[i].i == 'A' || out_attr[i].i == 'R')))
- ; /* Do nothing. */
+ ; /* Do nothing. */
else
{
_bfd_error_handler
@@ -11804,9 +11982,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
nothing. */
else if (in_attr[i].i == 0)
{
- /* When linking against earlier version of object file, Tag_FP_arch may not
- even exist, while Tag_ABI_HardFP_use is non-zero. */
- BFD_ASSERT (!ATTR_TYPE_EXIST(in_attr[i].type) || in_attr[Tag_ABI_HardFP_use].i == 0);
+ BFD_ASSERT (in_attr[Tag_ABI_HardFP_use].i == 0);
break;
}
@@ -12362,7 +12538,7 @@ elf32_arm_gc_sweep_hook (bfd * abfd,
&& (sec->flags & SEC_ALLOC) != 0)
{
if (h == NULL
- && (r_type == R_ARM_REL32 || r_type == R_ARM_REL32_NOI))
+ && elf32_arm_howto_from_type (r_type)->pc_relative)
{
call_reloc_p = TRUE;
may_need_local_target_p = TRUE;
@@ -12573,6 +12749,9 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
default: tls_type = GOT_NORMAL; break;
}
+ if (!info->executable && (tls_type & GOT_TLS_IE))
+ info->flags |= DF_STATIC_TLS;
+
if (h != NULL)
{
h->got.refcount++;
@@ -12603,7 +12782,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* If the symbol is accessed in both IE and GDESC
method, we're able to relax. Turn off the GDESC flag,
without messing up with any other kind of tls types
- that may be involved */
+ that may be involved. */
if ((tls_type & GOT_TLS_IE) && (tls_type & GOT_TLS_GDESC))
tls_type &= ~GOT_TLS_GDESC;
@@ -12668,6 +12847,11 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* Fall through. */
case R_ARM_ABS32:
case R_ARM_ABS32_NOI:
+ if (h != NULL && info->executable)
+ {
+ h->pointer_equality_needed = 1;
+ }
+ /* Fall through. */
case R_ARM_REL32:
case R_ARM_REL32_NOI:
case R_ARM_MOVW_PREL_NC:
@@ -12680,7 +12864,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
&& (sec->flags & SEC_ALLOC) != 0)
{
if (h == NULL
- && (r_type == R_ARM_REL32 || r_type == R_ARM_REL32_NOI))
+ && elf32_arm_howto_from_type (r_type)->pc_relative)
{
/* In shared libraries and relocatable executables,
we treat local relative references as calls;
@@ -12826,7 +13010,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
p->pc_count = 0;
}
- if (r_type == R_ARM_REL32 || r_type == R_ARM_REL32_NOI)
+ if (elf32_arm_howto_from_type (r_type)->pc_relative)
p->pc_count += 1;
p->count += 1;
}
@@ -12854,7 +13038,7 @@ elf32_arm_gc_mark_extra_sections (struct bfd_link_info *info,
while (again)
{
again = FALSE;
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
asection *o;
@@ -12899,8 +13083,8 @@ elf32_arm_is_target_special_symbol (bfd * abfd ATTRIBUTE_UNUSED, asymbol * sym)
static bfd_boolean
arm_elf_find_function (bfd * abfd ATTRIBUTE_UNUSED,
- asection * section,
asymbol ** symbols,
+ asection * section,
bfd_vma offset,
const char ** filename_ptr,
const char ** functionname_ptr)
@@ -12961,31 +13145,33 @@ arm_elf_find_function (bfd * abfd ATTRIBUTE_UNUSED,
static bfd_boolean
elf32_arm_find_nearest_line (bfd * abfd,
- asection * section,
asymbol ** symbols,
+ asection * section,
bfd_vma offset,
const char ** filename_ptr,
const char ** functionname_ptr,
- unsigned int * line_ptr)
+ unsigned int * line_ptr,
+ unsigned int * discriminator_ptr)
{
bfd_boolean found = FALSE;
- /* We skip _bfd_dwarf1_find_nearest_line since no known ARM toolchain uses it. */
-
- if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections,
- section, symbols, offset,
+ if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset,
filename_ptr, functionname_ptr,
- line_ptr, NULL, 0,
+ line_ptr, discriminator_ptr,
+ dwarf_debug_sections, 0,
& elf_tdata (abfd)->dwarf2_find_line_info))
{
if (!*functionname_ptr)
- arm_elf_find_function (abfd, section, symbols, offset,
+ arm_elf_find_function (abfd, symbols, section, offset,
*filename_ptr ? NULL : filename_ptr,
functionname_ptr);
return TRUE;
}
+ /* Skip _bfd_dwarf1_find_nearest_line since no known ARM toolchain
+ uses DWARF1. */
+
if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset,
& found, filename_ptr,
functionname_ptr, line_ptr,
@@ -12998,7 +13184,7 @@ elf32_arm_find_nearest_line (bfd * abfd,
if (symbols == NULL)
return FALSE;
- if (! arm_elf_find_function (abfd, section, symbols, offset,
+ if (! arm_elf_find_function (abfd, symbols, section, offset,
filename_ptr, functionname_ptr))
return FALSE;
@@ -13222,8 +13408,6 @@ allocate_dynrelocs_for_symbol (struct elf_link_hash_entry *h, void * inf)
h->target_internal = ST_BRANCH_TO_ARM;
}
- htab->next_tls_desc_index++;
-
/* VxWorks executables have a second set of relocations for
each PLT entry. They go in a separate relocation section,
which is processed by the kernel loader. */
@@ -13407,12 +13591,12 @@ allocate_dynrelocs_for_symbol (struct elf_link_hash_entry *h, void * inf)
if (info->shared || htab->root.is_relocatable_executable)
{
- /* The only relocs that use pc_count are R_ARM_REL32 and
- R_ARM_REL32_NOI, which will appear on something like
- ".long foo - .". We want calls to protected symbols to resolve
- directly to the function rather than going via the plt. If people
- want function pointer comparisons to work as expected then they
- should avoid writing assembly like ".long foo - .". */
+ /* Relocs that use pc_count are PC-relative forms, which will appear
+ on something like ".long foo - ." or "movw REG, foo - .". We want
+ calls to protected symbols to resolve directly to the function
+ rather than going via the plt. If people want function pointer
+ comparisons to work as expected then they should avoid writing
+ assembly like ".long foo - .". */
if (SYMBOL_CALLS_LOCAL (info, h))
{
struct elf_dyn_relocs **pp;
@@ -13592,7 +13776,7 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -13769,7 +13953,7 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
elf_link_hash_traverse (& htab->root, allocate_dynrelocs_for_symbol, info);
/* Here we rummage through the found bfds to collect glue information. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
if (! is_arm_elf (ibfd))
continue;
@@ -14019,8 +14203,9 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd,
if (!eh->is_iplt)
{
BFD_ASSERT (h->dynindx != -1);
- elf32_arm_populate_plt_entry (output_bfd, info, &h->plt, &eh->plt,
- h->dynindx, 0);
+ if (! elf32_arm_populate_plt_entry (output_bfd, info, &h->plt, &eh->plt,
+ h->dynindx, 0))
+ return FALSE;
}
if (!h->def_regular)
@@ -14032,7 +14217,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd,
Otherwise, the PLT entry would provide a definition for
the symbol even if the symbol wasn't defined anywhere,
and so the symbol would never be NULL. */
- if (!h->ref_regular_nonweak)
+ if (!h->ref_regular_nonweak || !h->pointer_equality_needed)
sym->st_value = 0;
}
else if (eh->is_iplt && eh->plt.noncall_refcount != 0)
@@ -14370,6 +14555,20 @@ elf32_arm_finish_dynamic_sections (bfd * output_bfd, struct bfd_link_info * info
else if (htab->nacl_p)
arm_nacl_put_plt0 (htab, output_bfd, splt,
got_address + 8 - (plt_address + 16));
+ else if (using_thumb_only (htab))
+ {
+ got_displacement = got_address - (plt_address + 12);
+
+ plt0_entry = elf32_thumb2_plt0_entry;
+ put_arm_insn (htab, output_bfd, plt0_entry[0],
+ splt->contents + 0);
+ put_arm_insn (htab, output_bfd, plt0_entry[1],
+ splt->contents + 4);
+ put_arm_insn (htab, output_bfd, plt0_entry[2],
+ splt->contents + 8);
+
+ bfd_put_32 (output_bfd, got_displacement, splt->contents + 12);
+ }
else
{
got_displacement = got_address - (plt_address + 16);
@@ -14498,7 +14697,7 @@ elf32_arm_post_process_headers (bfd * abfd, struct bfd_link_info * link_info ATT
if (EF_ARM_EABI_VERSION (i_ehdrp->e_flags) == EF_ARM_EABI_UNKNOWN)
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_ARM;
else
- i_ehdrp->e_ident[EI_OSABI] = 0;
+ _bfd_elf_post_process_headers (abfd, link_info);
i_ehdrp->e_ident[EI_ABIVERSION] = ARM_ELF_ABI_VERSION;
if (link_info)
@@ -14708,6 +14907,11 @@ elf32_arm_output_plt_map_1 (output_arch_syminfo *osi,
if (!elf32_arm_output_map_sym (osi, ARM_MAP_ARM, addr))
return FALSE;
}
+ else if (using_thumb_only (htab))
+ {
+ if (!elf32_arm_output_map_sym (osi, ARM_MAP_THUMB, addr))
+ return FALSE;
+ }
else
{
bfd_boolean thumb_stub_p;
@@ -14915,7 +15119,7 @@ elf32_arm_output_arch_local_syms (bfd *output_bfd,
mapping symbols. */
for (input_bfd = info->input_bfds;
input_bfd != NULL;
- input_bfd = input_bfd->link_next)
+ input_bfd = input_bfd->link.next)
{
if ((input_bfd->flags & (BFD_LINKER_CREATED | HAS_SYMS)) == HAS_SYMS)
for (osi.sec = input_bfd->sections;
@@ -15039,6 +15243,15 @@ elf32_arm_output_arch_local_syms (bfd *output_bfd,
if (!elf32_arm_output_map_sym (&osi, ARM_MAP_ARM, 0))
return FALSE;
}
+ else if (using_thumb_only (htab))
+ {
+ if (!elf32_arm_output_map_sym (&osi, ARM_MAP_THUMB, 0))
+ return FALSE;
+ if (!elf32_arm_output_map_sym (&osi, ARM_MAP_DATA, 12))
+ return FALSE;
+ if (!elf32_arm_output_map_sym (&osi, ARM_MAP_THUMB, 16))
+ return FALSE;
+ }
else if (!htab->symbian_p)
{
if (!elf32_arm_output_map_sym (&osi, ARM_MAP_ARM, 0))
@@ -15064,7 +15277,7 @@ elf32_arm_output_arch_local_syms (bfd *output_bfd,
elf_link_hash_traverse (&htab->root, elf32_arm_output_plt_map, &osi);
for (input_bfd = info->input_bfds;
input_bfd != NULL;
- input_bfd = input_bfd->link_next)
+ input_bfd = input_bfd->link.next)
{
struct arm_local_iplt_info **local_iplt;
unsigned int i, num_syms;
@@ -15695,9 +15908,10 @@ elf32_arm_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
Elf_Internal_Sym *sym, const char **namep,
flagword *flagsp, asection **secp, bfd_vma *valp)
{
- if ((abfd->flags & DYNAMIC) == 0
- && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
- || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE))
+ if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
+ || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)
+ && (abfd->flags & DYNAMIC) == 0
+ && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
if (elf32_arm_hash_table (info) == NULL)
@@ -15742,13 +15956,192 @@ const struct elf_size_info elf32_arm_size_info =
bfd_elf32_swap_reloca_out
};
+/* Return size of plt0 entry starting at ADDR
+ or (bfd_vma) -1 if size can not be determined. */
+
+static bfd_vma
+elf32_arm_plt0_size (const bfd *abfd, const bfd_byte *addr)
+{
+ bfd_vma first_word;
+ bfd_vma plt0_size;
+
+ first_word = H_GET_32 (abfd, addr);
+
+ if (first_word == elf32_arm_plt0_entry[0])
+ plt0_size = 4 * ARRAY_SIZE (elf32_arm_plt0_entry);
+ else if (first_word == elf32_thumb2_plt0_entry[0])
+ plt0_size = 4 * ARRAY_SIZE (elf32_thumb2_plt0_entry);
+ else
+ /* We don't yet handle this PLT format. */
+ return (bfd_vma) -1;
+
+ return plt0_size;
+}
+
+/* Return size of plt entry starting at offset OFFSET
+ of plt section located at address START
+ or (bfd_vma) -1 if size can not be determined. */
+
+static bfd_vma
+elf32_arm_plt_size (const bfd *abfd, const bfd_byte *start, bfd_vma offset)
+{
+ bfd_vma first_insn;
+ bfd_vma plt_size = 0;
+ const bfd_byte *addr = start + offset;
+
+ /* PLT entry size if fixed on Thumb-only platforms. */
+ if (H_GET_32(abfd, start) == elf32_thumb2_plt0_entry[0])
+ return 4 * ARRAY_SIZE (elf32_thumb2_plt_entry);
+
+ /* Respect Thumb stub if necessary. */
+ if (H_GET_16(abfd, addr) == elf32_arm_plt_thumb_stub[0])
+ {
+ plt_size += 2 * ARRAY_SIZE(elf32_arm_plt_thumb_stub);
+ }
+
+ /* Strip immediate from first add. */
+ first_insn = H_GET_32(abfd, addr + plt_size) & 0xffffff00;
+
+#ifdef FOUR_WORD_PLT
+ if (first_insn == elf32_arm_plt_entry[0])
+ plt_size += 4 * ARRAY_SIZE (elf32_arm_plt_entry);
+#else
+ if (first_insn == elf32_arm_plt_entry_long[0])
+ plt_size += 4 * ARRAY_SIZE (elf32_arm_plt_entry_long);
+ else if (first_insn == elf32_arm_plt_entry_short[0])
+ plt_size += 4 * ARRAY_SIZE (elf32_arm_plt_entry_short);
+#endif
+ else
+ /* We don't yet handle this PLT format. */
+ return (bfd_vma) -1;
+
+ return plt_size;
+}
+
+/* Implementation is shamelessly borrowed from _bfd_elf_get_synthetic_symtab. */
+
+static long
+elf32_arm_get_synthetic_symtab (bfd *abfd,
+ long symcount ATTRIBUTE_UNUSED,
+ asymbol **syms ATTRIBUTE_UNUSED,
+ long dynsymcount,
+ asymbol **dynsyms,
+ asymbol **ret)
+{
+ asection *relplt;
+ asymbol *s;
+ arelent *p;
+ long count, i, n;
+ size_t size;
+ Elf_Internal_Shdr *hdr;
+ char *names;
+ asection *plt;
+ bfd_vma offset;
+ bfd_byte *data;
+
+ *ret = NULL;
+
+ if ((abfd->flags & (DYNAMIC | EXEC_P)) == 0)
+ return 0;
+
+ if (dynsymcount <= 0)
+ return 0;
+
+ relplt = bfd_get_section_by_name (abfd, ".rel.plt");
+ if (relplt == NULL)
+ return 0;
+
+ hdr = &elf_section_data (relplt)->this_hdr;
+ if (hdr->sh_link != elf_dynsymtab (abfd)
+ || (hdr->sh_type != SHT_REL && hdr->sh_type != SHT_RELA))
+ return 0;
+
+ plt = bfd_get_section_by_name (abfd, ".plt");
+ if (plt == NULL)
+ return 0;
+
+ if (!elf32_arm_size_info.slurp_reloc_table (abfd, relplt, dynsyms, TRUE))
+ return -1;
+
+ data = plt->contents;
+ if (data == NULL)
+ {
+ if (!bfd_get_full_section_contents(abfd, (asection *) plt, &data) || data == NULL)
+ return -1;
+ bfd_cache_section_contents((asection *) plt, data);
+ }
+
+ count = relplt->size / hdr->sh_entsize;
+ size = count * sizeof (asymbol);
+ p = relplt->relocation;
+ for (i = 0; i < count; i++, p += elf32_arm_size_info.int_rels_per_ext_rel)
+ {
+ size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt");
+ if (p->addend != 0)
+ size += sizeof ("+0x") - 1 + 8;
+ }
+
+ s = *ret = (asymbol *) bfd_malloc (size);
+ if (s == NULL)
+ return -1;
+
+ offset = elf32_arm_plt0_size (abfd, data);
+ if (offset == (bfd_vma) -1)
+ return -1;
+
+ names = (char *) (s + count);
+ p = relplt->relocation;
+ n = 0;
+ for (i = 0; i < count; i++, p += elf32_arm_size_info.int_rels_per_ext_rel)
+ {
+ size_t len;
+
+ bfd_vma plt_size = elf32_arm_plt_size (abfd, data, offset);
+ if (plt_size == (bfd_vma) -1)
+ break;
+
+ *s = **p->sym_ptr_ptr;
+ /* Undefined syms won't have BSF_LOCAL or BSF_GLOBAL set. Since
+ we are defining a symbol, ensure one of them is set. */
+ if ((s->flags & BSF_LOCAL) == 0)
+ s->flags |= BSF_GLOBAL;
+ s->flags |= BSF_SYNTHETIC;
+ s->section = plt;
+ s->value = offset;
+ s->name = names;
+ s->udata.p = NULL;
+ len = strlen ((*p->sym_ptr_ptr)->name);
+ memcpy (names, (*p->sym_ptr_ptr)->name, len);
+ names += len;
+ if (p->addend != 0)
+ {
+ char buf[30], *a;
+
+ memcpy (names, "+0x", sizeof ("+0x") - 1);
+ names += sizeof ("+0x") - 1;
+ bfd_sprintf_vma (abfd, buf, p->addend);
+ for (a = buf; *a == '0'; ++a)
+ ;
+ len = strlen (a);
+ memcpy (names, a, len);
+ names += len;
+ }
+ memcpy (names, "@plt", sizeof ("@plt"));
+ names += sizeof ("@plt");
+ ++s, ++n;
+ offset += plt_size;
+ }
+
+ return n;
+}
+
#define ELF_ARCH bfd_arch_arm
#define ELF_TARGET_ID ARM_ELF_DATA
#define ELF_MACHINE_CODE EM_ARM
#ifdef __QNXTARGET__
#define ELF_MAXPAGESIZE 0x1000
#else
-#define ELF_MAXPAGESIZE 0x8000
+#define ELF_MAXPAGESIZE 0x10000
#endif
#define ELF_MINPAGESIZE 0x1000
#define ELF_COMMONPAGESIZE 0x1000
@@ -15760,7 +16153,6 @@ const struct elf_size_info elf32_arm_size_info =
#define bfd_elf32_bfd_set_private_flags elf32_arm_set_private_flags
#define bfd_elf32_bfd_print_private_bfd_data elf32_arm_print_private_bfd_data
#define bfd_elf32_bfd_link_hash_table_create elf32_arm_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free elf32_arm_hash_table_free
#define bfd_elf32_bfd_reloc_type_lookup elf32_arm_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup elf32_arm_reloc_name_lookup
#define bfd_elf32_find_nearest_line elf32_arm_find_nearest_line
@@ -15768,6 +16160,7 @@ const struct elf_size_info elf32_arm_size_info =
#define bfd_elf32_new_section_hook elf32_arm_new_section_hook
#define bfd_elf32_bfd_is_target_special_symbol elf32_arm_is_target_special_symbol
#define bfd_elf32_bfd_final_link elf32_arm_final_link
+#define bfd_elf32_get_synthetic_symtab elf32_arm_get_synthetic_symtab
#define elf_backend_get_symbol_type elf32_arm_get_symbol_type
#define elf_backend_gc_mark_hook elf32_arm_gc_mark_hook
@@ -15819,31 +16212,16 @@ const struct elf_size_info elf32_arm_size_info =
#define elf_backend_obj_attrs_order elf32_arm_obj_attrs_order
#define elf_backend_obj_attrs_handle_unknown elf32_arm_obj_attrs_handle_unknown
-#undef elf_backend_plt_sym_val
-#define elf_backend_plt_sym_val elf32_arm_plt_sym_val
-
-/* Return address for Ith PLT stub in section PLT, for relocation REL
- or (bfd_vma) -1 if it should not be included. */
-
-static bfd_vma
-elf32_arm_plt_sym_val (bfd_vma i, const asection *plt,
- const arelent *rel ATTRIBUTE_UNUSED)
-{
- return plt->vma + 4 * (
- ARRAY_SIZE(elf32_arm_plt0_entry) +
- ARRAY_SIZE(elf32_arm_plt_entry) * i);
-}
-
#include "elf32-target.h"
/* Native Client targets. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_littlearm_nacl_vec
+#define TARGET_LITTLE_SYM arm_elf32_nacl_le_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-littlearm-nacl"
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_bigarm_nacl_vec
+#define TARGET_BIG_SYM arm_elf32_nacl_be_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-bigarm-nacl"
@@ -15887,23 +16265,32 @@ elf32_arm_nacl_final_write_processing (bfd *abfd, bfd_boolean linker)
nacl_final_write_processing (abfd, linker);
}
+static bfd_vma
+elf32_arm_nacl_plt_sym_val (bfd_vma i, const asection *plt,
+ const arelent *rel ATTRIBUTE_UNUSED)
+{
+ return plt->vma
+ + 4 * (ARRAY_SIZE (elf32_arm_nacl_plt0_entry) +
+ i * ARRAY_SIZE (elf32_arm_nacl_plt_entry));
+}
#undef elf32_bed
-#define elf32_bed elf32_arm_nacl_bed
+#define elf32_bed elf32_arm_nacl_bed
#undef bfd_elf32_bfd_link_hash_table_create
#define bfd_elf32_bfd_link_hash_table_create \
elf32_arm_nacl_link_hash_table_create
#undef elf_backend_plt_alignment
-#define elf_backend_plt_alignment 4
+#define elf_backend_plt_alignment 4
#undef elf_backend_modify_segment_map
#define elf_backend_modify_segment_map elf32_arm_nacl_modify_segment_map
#undef elf_backend_modify_program_headers
#define elf_backend_modify_program_headers nacl_modify_program_headers
#undef elf_backend_final_write_processing
#define elf_backend_final_write_processing elf32_arm_nacl_final_write_processing
+#undef bfd_elf32_get_synthetic_symtab
+#undef elf_backend_plt_sym_val
+#define elf_backend_plt_sym_val elf32_arm_nacl_plt_sym_val
-#undef ELF_MAXPAGESIZE
-#define ELF_MAXPAGESIZE 0x10000
#undef ELF_MINPAGESIZE
#undef ELF_COMMONPAGESIZE
@@ -15926,11 +16313,11 @@ elf32_arm_nacl_final_write_processing (bfd *abfd, bfd_boolean linker)
/* VxWorks Targets. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_littlearm_vxworks_vec
+#define TARGET_LITTLE_SYM arm_elf32_vxworks_le_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-littlearm-vxworks"
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_bigarm_vxworks_vec
+#define TARGET_BIG_SYM arm_elf32_vxworks_be_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-bigarm-vxworks"
@@ -16212,11 +16599,11 @@ elf32_arm_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
/* Symbian OS Targets. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_littlearm_symbian_vec
+#define TARGET_LITTLE_SYM arm_elf32_symbian_le_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-littlearm-symbian"
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_bigarm_symbian_vec
+#define TARGET_BIG_SYM arm_elf32_symbian_be_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-bigarm-symbian"
diff --git a/binutils-2.25/bfd/elf32-avr.c b/binutils-2.25/bfd/elf32-avr.c
index 43100cd2..54d67bf0 100644
--- a/binutils-2.25/bfd/elf32-avr.c
+++ b/binutils-2.25/bfd/elf32-avr.c
@@ -1,5 +1,5 @@
/* AVR-specific support for 32-bit ELF
- Copyright 1999-2013 Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
Contributed by Denis Chertykov <denisc@overta.ru>
This file is part of BFD, the Binary File Descriptor library.
@@ -32,6 +32,10 @@ static bfd_boolean debug_relax = FALSE;
/* Enable debugging printout at stdout with this variable. */
static bfd_boolean debug_stubs = FALSE;
+static bfd_reloc_status_type
+bfd_elf_avr_diff_reloc (bfd *, arelent *, asymbol *, void *,
+ asection *, bfd *, char **);
+
/* Hash table initialization and handling. Code is taken from the hppa port
and adapted to the needs of AVR. */
@@ -557,6 +561,86 @@ static reloc_howto_type elf_avr_howto_table[] =
0xffffff, /* src_mask */
0xffffff, /* dst_mask */
FALSE), /* pcrel_offset */
+ HOWTO (R_AVR_DIFF8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_avr_diff_reloc, /* special_function */
+ "R_AVR_DIFF8", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_AVR_DIFF16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_avr_diff_reloc,/* special_function */
+ "R_AVR_DIFF16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_AVR_DIFF32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_avr_diff_reloc,/* special_function */
+ "R_AVR_DIFF32", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ /* 7 bit immediate for LDS/STS in Tiny core. */
+ HOWTO (R_AVR_LDS_STS_16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 7, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_AVR_LDS_STS_16", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_AVR_PORT6, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 6, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_AVR_PORT6", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffff, /* src_mask */
+ 0xffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_AVR_PORT5, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 5, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_AVR_PORT5", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffff, /* src_mask */
+ 0xffffff, /* dst_mask */
+ FALSE) /* pcrel_offset */
};
/* Map BFD reloc types to AVR ELF reloc types. */
@@ -598,7 +682,13 @@ static const struct avr_reloc_map avr_reloc_map[] =
{ BFD_RELOC_8, R_AVR_8 },
{ BFD_RELOC_AVR_8_LO, R_AVR_8_LO8 },
{ BFD_RELOC_AVR_8_HI, R_AVR_8_HI8 },
- { BFD_RELOC_AVR_8_HLO, R_AVR_8_HLO8 }
+ { BFD_RELOC_AVR_8_HLO, R_AVR_8_HLO8 },
+ { BFD_RELOC_AVR_DIFF8, R_AVR_DIFF8 },
+ { BFD_RELOC_AVR_DIFF16, R_AVR_DIFF16 },
+ { BFD_RELOC_AVR_DIFF32, R_AVR_DIFF32 },
+ { BFD_RELOC_AVR_LDS_STS_16, R_AVR_LDS_STS_16},
+ { BFD_RELOC_AVR_PORT6, R_AVR_PORT6},
+ { BFD_RELOC_AVR_PORT5, R_AVR_PORT5}
};
/* Meant to be filled one day with the wrap around address for the
@@ -660,6 +750,24 @@ elf32_avr_link_hash_newfunc (struct bfd_hash_entry * entry,
return _bfd_elf_link_hash_newfunc (entry, table, string);
}
+/* Free the derived linker hash table. */
+
+static void
+elf32_avr_link_hash_table_free (bfd *obfd)
+{
+ struct elf32_avr_link_hash_table *htab
+ = (struct elf32_avr_link_hash_table *) obfd->link.hash;
+
+ /* Free the address mapping table. */
+ if (htab->amt_stub_offsets != NULL)
+ free (htab->amt_stub_offsets);
+ if (htab->amt_destination_addr != NULL)
+ free (htab->amt_destination_addr);
+
+ bfd_hash_table_free (&htab->bstab);
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
/* Create the derived linker hash table. The AVR ELF port uses the derived
hash table to keep information specific to the AVR ELF linker (without
using static variables). */
@@ -686,29 +794,15 @@ elf32_avr_link_hash_table_create (bfd *abfd)
/* Init the stub hash table too. */
if (!bfd_hash_table_init (&htab->bstab, stub_hash_newfunc,
sizeof (struct elf32_avr_stub_hash_entry)))
- return NULL;
+ {
+ _bfd_elf_link_hash_table_free (abfd);
+ return NULL;
+ }
+ htab->etab.root.hash_table_free = elf32_avr_link_hash_table_free;
return &htab->etab.root;
}
-/* Free the derived linker hash table. */
-
-static void
-elf32_avr_link_hash_table_free (struct bfd_link_hash_table *btab)
-{
- struct elf32_avr_link_hash_table *htab
- = (struct elf32_avr_link_hash_table *) btab;
-
- /* Free the address mapping table. */
- if (htab->amt_stub_offsets != NULL)
- free (htab->amt_stub_offsets);
- if (htab->amt_destination_addr != NULL)
- free (htab->amt_destination_addr);
-
- bfd_hash_table_free (&htab->bstab);
- _bfd_elf_link_hash_table_free (btab);
-}
-
/* Calculates the effective distance of a pc relative jump/call. */
static int
@@ -797,6 +891,22 @@ avr_get_stub_addr (bfd_vma srel,
return 0x020000;
}
+/* Perform a diff relocation. Nothing to do, as the difference value is already
+ written into the section's contents. */
+
+static bfd_reloc_status_type
+bfd_elf_avr_diff_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry ATTRIBUTE_UNUSED,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ char **error_message ATTRIBUTE_UNUSED)
+{
+ return bfd_reloc_ok;
+}
+
+
/* Perform a single relocation. By default we use the standard BFD
routines, but a few relocs, we have to do them ourselves. */
@@ -1149,6 +1259,44 @@ avr_final_link_relocate (reloc_howto_type * howto,
bfd_put_16 (input_bfd, (bfd_vma) srel &0x00ffff, contents);
break;
+ case R_AVR_DIFF8:
+ case R_AVR_DIFF16:
+ case R_AVR_DIFF32:
+ /* Nothing to do here, as contents already contains the diff value. */
+ r = bfd_reloc_ok;
+ break;
+
+ case R_AVR_LDS_STS_16:
+ contents += rel->r_offset;
+ srel = (bfd_signed_vma) relocation + rel->r_addend;
+ if ((srel & 0xFFFF) < 0x40 || (srel & 0xFFFF) > 0xbf)
+ return bfd_reloc_outofrange;
+ srel = srel & 0x7f;
+ x = bfd_get_16 (input_bfd, contents);
+ x |= (srel & 0x0f) | ((srel & 0x30) << 5) | ((srel & 0x40) << 2);
+ bfd_put_16 (input_bfd, x, contents);
+ break;
+
+ case R_AVR_PORT6:
+ contents += rel->r_offset;
+ srel = (bfd_signed_vma) relocation + rel->r_addend;
+ if ((srel & 0xffff) > 0x3f)
+ return bfd_reloc_outofrange;
+ x = bfd_get_16 (input_bfd, contents);
+ x = (x & 0xf9f0) | ((srel & 0x30) << 5) | (srel & 0x0f);
+ bfd_put_16 (input_bfd, x, contents);
+ break;
+
+ case R_AVR_PORT5:
+ contents += rel->r_offset;
+ srel = (bfd_signed_vma) relocation + rel->r_addend;
+ if ((srel & 0xffff) > 0x1f)
+ return bfd_reloc_outofrange;
+ x = bfd_get_16 (input_bfd, contents);
+ x = (x & 0xff07) | ((srel & 0x1f) << 3);
+ bfd_put_16 (input_bfd, x, contents);
+ break;
+
default:
r = _bfd_final_link_relocate (howto, input_bfd, input_section,
contents, rel->r_offset,
@@ -1214,12 +1362,12 @@ elf32_avr_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
name = h->root.root.string;
}
@@ -1361,6 +1509,10 @@ bfd_elf_avr_final_write_processing (bfd *abfd,
case bfd_mach_avrxmega7:
val = E_AVR_MACH_XMEGA7;
break;
+
+ case bfd_mach_avrtiny:
+ val = E_AVR_MACH_AVRTINY;
+ break;
}
elf_elfheader (abfd)->e_machine = EM_AVR;
@@ -1451,12 +1603,114 @@ elf32_avr_object_p (bfd *abfd)
case E_AVR_MACH_XMEGA7:
e_set = bfd_mach_avrxmega7;
break;
+
+ case E_AVR_MACH_AVRTINY:
+ e_set = bfd_mach_avrtiny;
+ break;
}
}
return bfd_default_set_arch_mach (abfd, bfd_arch_avr,
e_set);
}
+/* Returns whether the relocation type passed is a diff reloc. */
+
+static bfd_boolean
+elf32_avr_is_diff_reloc (Elf_Internal_Rela *irel)
+{
+ return (ELF32_R_TYPE (irel->r_info) == R_AVR_DIFF8
+ ||ELF32_R_TYPE (irel->r_info) == R_AVR_DIFF16
+ || ELF32_R_TYPE (irel->r_info) == R_AVR_DIFF32);
+}
+
+/* Reduce the diff value written in the section by count if the shrinked
+ insn address happens to fall between the two symbols for which this
+ diff reloc was emitted. */
+
+static void
+elf32_avr_adjust_diff_reloc_value (bfd *abfd,
+ struct bfd_section *isec,
+ Elf_Internal_Rela *irel,
+ bfd_vma symval,
+ bfd_vma shrinked_insn_address,
+ int count)
+{
+ unsigned char *reloc_contents = NULL;
+ unsigned char *isec_contents = elf_section_data (isec)->this_hdr.contents;
+ if (isec_contents == NULL)
+ {
+ if (! bfd_malloc_and_get_section (abfd, isec, &isec_contents))
+ return;
+
+ elf_section_data (isec)->this_hdr.contents = isec_contents;
+ }
+
+ reloc_contents = isec_contents + irel->r_offset;
+
+ /* Read value written in object file. */
+ bfd_vma x = 0;
+ switch (ELF32_R_TYPE (irel->r_info))
+ {
+ case R_AVR_DIFF8:
+ {
+ x = *reloc_contents;
+ break;
+ }
+ case R_AVR_DIFF16:
+ {
+ x = bfd_get_16 (abfd, reloc_contents);
+ break;
+ }
+ case R_AVR_DIFF32:
+ {
+ x = bfd_get_32 (abfd, reloc_contents);
+ break;
+ }
+ default:
+ {
+ BFD_FAIL();
+ }
+ }
+
+ /* For a diff reloc sym1 - sym2 the diff at assembly time (x) is written
+ into the object file at the reloc offset. sym2's logical value is
+ symval (<start_of_section>) + reloc addend. Compute the start and end
+ addresses and check if the shrinked insn falls between sym1 and sym2. */
+
+ bfd_vma end_address = symval + irel->r_addend;
+ bfd_vma start_address = end_address - x;
+
+ /* Reduce the diff value by count bytes and write it back into section
+ contents. */
+
+ if (shrinked_insn_address >= start_address
+ && shrinked_insn_address <= end_address)
+ {
+ switch (ELF32_R_TYPE (irel->r_info))
+ {
+ case R_AVR_DIFF8:
+ {
+ *reloc_contents = (x - count);
+ break;
+ }
+ case R_AVR_DIFF16:
+ {
+ bfd_put_16 (abfd, (x - count) & 0xFFFF, reloc_contents);
+ break;
+ }
+ case R_AVR_DIFF32:
+ {
+ bfd_put_32 (abfd, (x - count) & 0xFFFFFFFF, reloc_contents);
+ break;
+ }
+ default:
+ {
+ BFD_FAIL();
+ }
+ }
+
+ }
+}
/* Delete some bytes from a section while changing the size of an instruction.
The parameter "addr" denotes the section-relative offset pointing just
@@ -1595,6 +1849,14 @@ elf32_avr_relax_delete_bytes (bfd *abfd,
if (symval <= shrinked_insn_address
&& (symval + irel->r_addend) > shrinked_insn_address)
{
+ if (elf32_avr_is_diff_reloc (irel))
+ {
+ elf32_avr_adjust_diff_reloc_value (abfd, isec, irel,
+ symval,
+ shrinked_insn_address,
+ count);
+ }
+
irel->r_addend -= count;
if (debug_relax)
@@ -1765,8 +2027,8 @@ elf32_avr_relax_section (bfd *abfd,
bfd_vma symval;
if ( ELF32_R_TYPE (irel->r_info) != R_AVR_13_PCREL
- && ELF32_R_TYPE (irel->r_info) != R_AVR_7_PCREL
- && ELF32_R_TYPE (irel->r_info) != R_AVR_CALL)
+ && ELF32_R_TYPE (irel->r_info) != R_AVR_7_PCREL
+ && ELF32_R_TYPE (irel->r_info) != R_AVR_CALL)
continue;
/* Get the section contents if we haven't done so already. */
@@ -2193,7 +2455,7 @@ elf32_avr_relax_section (bfd *abfd,
{
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
-
+
rel = elf_section_data (isec)->relocs;
if (rel == NULL)
rel = _bfd_elf_link_read_relocs (abfd, isec, NULL, NULL, TRUE);
@@ -2642,7 +2904,7 @@ elf32_avr_setup_section_lists (bfd *output_bfd,
/* Count the number of input BFDs and find the top input section id. */
for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next)
+ input_bfd = input_bfd->link.next)
{
bfd_count += 1;
for (section = input_bfd->sections;
@@ -2716,7 +2978,7 @@ get_local_syms (bfd *input_bfd, struct bfd_link_info *info)
export stubs. */
for (bfd_indx = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next, bfd_indx++)
+ input_bfd = input_bfd->link.next, bfd_indx++)
{
Elf_Internal_Shdr *symtab_hdr;
@@ -2793,7 +3055,7 @@ elf32_avr_size_stubs (bfd *output_bfd,
bfd_hash_traverse (&htab->bstab, avr_mark_stub_not_to_be_necessary, htab);
for (input_bfd = info->input_bfds, bfd_indx = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next, bfd_indx++)
+ input_bfd = input_bfd->link.next, bfd_indx++)
{
Elf_Internal_Shdr *symtab_hdr;
asection *section;
@@ -3065,11 +3327,10 @@ elf32_avr_build_stubs (struct bfd_link_info *info)
#define ELF_MACHINE_ALT1 EM_AVR_OLD
#define ELF_MAXPAGESIZE 1
-#define TARGET_LITTLE_SYM bfd_elf32_avr_vec
+#define TARGET_LITTLE_SYM avr_elf32_vec
#define TARGET_LITTLE_NAME "elf32-avr"
#define bfd_elf32_bfd_link_hash_table_create elf32_avr_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free elf32_avr_link_hash_table_free
#define elf_info_to_howto avr_info_to_howto_rela
#define elf_info_to_howto_rel NULL
diff --git a/binutils-2.25/bfd/elf32-avr.h b/binutils-2.25/bfd/elf32-avr.h
index 5eeca862..8c338685 100644
--- a/binutils-2.25/bfd/elf32-avr.h
+++ b/binutils-2.25/bfd/elf32-avr.h
@@ -1,5 +1,5 @@
/* AVR-specific support for 32-bit ELF.
- Copyright 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
Written by Bjoern Haase <bjoern.m.haase@web.de>
diff --git a/binutils-2.25/bfd/elf32-bfin.c b/binutils-2.25/bfd/elf32-bfin.c
index d3d0f1c8..692875bf 100644
--- a/binutils-2.25/bfd/elf32-bfin.c
+++ b/binutils-2.25/bfd/elf32-bfin.c
@@ -1,6 +1,5 @@
/* ADI Blackfin BFD support for 32-bit ELF.
- Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2005-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -1444,12 +1443,12 @@ bfin_relocate_section (bfd * output_bfd,
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -1733,8 +1732,8 @@ bfin_gc_sweep_hook (bfd * abfd,
return TRUE;
}
-extern const bfd_target bfd_elf32_bfinfdpic_vec;
-#define IS_FDPIC(bfd) ((bfd)->xvec == &bfd_elf32_bfinfdpic_vec)
+extern const bfd_target bfin_elf32_fdpic_vec;
+#define IS_FDPIC(bfd) ((bfd)->xvec == &bfin_elf32_fdpic_vec)
/* An extension of the elf hash table data structure,
containing some additional Blackfin-specific data. */
@@ -2662,13 +2661,13 @@ bfinfdpic_relocate_section (bfd * output_bfd,
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
bfd_boolean unresolved_reloc;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
osec = sec;
}
@@ -4931,45 +4930,6 @@ elf32_bfin_set_private_flags (bfd * abfd, flagword flags)
return TRUE;
}
-/* Copy backend specific data from one object module to another. */
-
-static bfd_boolean
-bfin_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
-{
- if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
- || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
- return TRUE;
-
- BFD_ASSERT (!elf_flags_init (obfd)
- || elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags);
-
- elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
- elf_flags_init (obfd) = TRUE;
-
- /* Copy object attributes. */
- _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
- return TRUE;
-}
-
-static bfd_boolean
-elf32_bfinfdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
-{
- if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
- || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
- return TRUE;
-
- if (! bfin_elf_copy_private_bfd_data (ibfd, obfd))
- return FALSE;
-
- if (! elf_tdata (ibfd) || ! elf_tdata (ibfd)->phdr
- || ! elf_tdata (obfd) || ! elf_tdata (obfd)->phdr)
- return TRUE;
-
- return TRUE;
-}
-
-
/* Display the flags field. */
static bfd_boolean
elf32_bfin_print_private_bfd_data (bfd * abfd, void * ptr)
@@ -5664,7 +5624,7 @@ struct bfd_elf_special_section const elf32_bfin_special_sections[] =
};
-#define TARGET_LITTLE_SYM bfd_elf32_bfin_vec
+#define TARGET_LITTLE_SYM bfin_elf32_vec
#define TARGET_LITTLE_NAME "elf32-bfin"
#define ELF_ARCH bfd_arch_bfin
#define ELF_TARGET_ID BFIN_ELF_DATA
@@ -5726,7 +5686,7 @@ struct bfd_elf_special_section const elf32_bfin_special_sections[] =
#include "elf32-target.h"
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_bfinfdpic_vec
+#define TARGET_LITTLE_SYM bfin_elf32_fdpic_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-bfinfdpic"
#undef elf32_bed
@@ -5749,9 +5709,6 @@ struct bfd_elf_special_section const elf32_bfin_special_sections[] =
#undef elf_backend_always_size_sections
#define elf_backend_always_size_sections \
elf32_bfinfdpic_always_size_sections
-#undef bfd_elf32_bfd_copy_private_bfd_data
-#define bfd_elf32_bfd_copy_private_bfd_data \
- elf32_bfinfdpic_copy_private_bfd_data
#undef elf_backend_create_dynamic_sections
#define elf_backend_create_dynamic_sections \
diff --git a/binutils-2.25/bfd/elf32-cr16.c b/binutils-2.25/bfd/elf32-cr16.c
index 8ed5af1c..f16f1c62 100644
--- a/binutils-2.25/bfd/elf32-cr16.c
+++ b/binutils-2.25/bfd/elf32-cr16.c
@@ -1,5 +1,5 @@
/* BFD back-end for National Semiconductor's CR16 ELF
- Copyright 2007, 2008, 2009, 2010, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2007-2014 Free Software Foundation, Inc.
Written by M R Swami Reddy.
This file is part of BFD, the Binary File Descriptor library.
@@ -1425,12 +1425,12 @@ elf32_cr16_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -2935,7 +2935,7 @@ _bfd_cr16_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSE
}
/* Definitions for setting CR16 target vector. */
-#define TARGET_LITTLE_SYM bfd_elf32_cr16_vec
+#define TARGET_LITTLE_SYM cr16_elf32_vec
#define TARGET_LITTLE_NAME "elf32-cr16"
#define ELF_ARCH bfd_arch_cr16
#define ELF_MACHINE_CODE EM_CR16
diff --git a/binutils-2.25/bfd/elf32-cr16c.c b/binutils-2.25/bfd/elf32-cr16c.c
index 4231a429..cf4503c9 100644
--- a/binutils-2.25/bfd/elf32-cr16c.c
+++ b/binutils-2.25/bfd/elf32-cr16c.c
@@ -1,6 +1,5 @@
/* BFD back-end for National Semiconductor's CR16C ELF
- Copyright 2004, 2005, 2006, 2007, 2009, 2010, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2004-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -715,12 +714,12 @@ elf32_cr16c_relocate_section (bfd *output_bfd,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -940,7 +939,7 @@ elf32_cr16c_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED
}
/* Definitions for setting CR16C target vector. */
-#define TARGET_LITTLE_SYM bfd_elf32_cr16c_vec
+#define TARGET_LITTLE_SYM cr16c_elf32_vec
#define TARGET_LITTLE_NAME "elf32-cr16c"
#define ELF_ARCH bfd_arch_cr16c
#define ELF_MACHINE_CODE EM_CR
diff --git a/binutils-2.25/bfd/elf32-cris.c b/binutils-2.25/bfd/elf32-cris.c
index f35292ed..9b2b956c 100644
--- a/binutils-2.25/bfd/elf32-cris.c
+++ b/binutils-2.25/bfd/elf32-cris.c
@@ -1,6 +1,5 @@
/* CRIS-specific support for 32-bit ELF.
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
Contributed by Axis Communications AB.
Written by Hans-Peter Nilsson, based on elf32-fr30.c
PIC and shlib bits based primarily on elf32-m68k.c and elf32-i386.c.
@@ -1040,13 +1039,13 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
bfd_boolean unresolved_reloc;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
symname = h->root.root.string;
@@ -4335,7 +4334,7 @@ elf_cris_got_elt_size (bfd *abfd ATTRIBUTE_UNUSED,
#define ELF_MACHINE_CODE EM_CRIS
#define ELF_MAXPAGESIZE 0x2000
-#define TARGET_LITTLE_SYM bfd_elf32_cris_vec
+#define TARGET_LITTLE_SYM cris_elf32_vec
#define TARGET_LITTLE_NAME "elf32-cris"
#define elf_symbol_leading_char 0
@@ -4404,7 +4403,7 @@ elf_cris_got_elt_size (bfd *abfd ATTRIBUTE_UNUSED,
#undef TARGET_LITTLE_NAME
#undef elf_symbol_leading_char
-#define TARGET_LITTLE_SYM bfd_elf32_us_cris_vec
+#define TARGET_LITTLE_SYM cris_elf32_us_vec
#define TARGET_LITTLE_NAME "elf32-us-cris"
#define elf_symbol_leading_char '_'
#undef elf32_bed
diff --git a/binutils-2.25/bfd/elf32-crx.c b/binutils-2.25/bfd/elf32-crx.c
index 601f715c..f2925f55 100644
--- a/binutils-2.25/bfd/elf32-crx.c
+++ b/binutils-2.25/bfd/elf32-crx.c
@@ -1,6 +1,5 @@
/* BFD back-end for National Semiconductor's CRX ELF
- Copyright 2004, 2005, 2006, 2007, 2009, 2010, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2004-2014 Free Software Foundation, Inc.
Written by Tomer Levi, NSC, Israel.
This file is part of BFD, the Binary File Descriptor library.
@@ -865,12 +864,12 @@ elf32_crx_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -1309,7 +1308,7 @@ elf32_crx_relax_section (bfd *abfd, asection *sec,
}
/* Definitions for setting CRX target vector. */
-#define TARGET_LITTLE_SYM bfd_elf32_crx_vec
+#define TARGET_LITTLE_SYM crx_elf32_vec
#define TARGET_LITTLE_NAME "elf32-crx"
#define ELF_ARCH bfd_arch_crx
#define ELF_MACHINE_CODE EM_CRX
diff --git a/binutils-2.25/bfd/elf32-d10v.c b/binutils-2.25/bfd/elf32-d10v.c
index f75c16ae..f45e2db5 100644
--- a/binutils-2.25/bfd/elf32-d10v.c
+++ b/binutils-2.25/bfd/elf32-d10v.c
@@ -1,6 +1,5 @@
/* D10V-specific support for 32-bit ELF
- Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2010, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Contributed by Martin Hunt (hunt@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
@@ -459,12 +458,12 @@ elf32_d10v_relocate_section (bfd *output_bfd,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -542,7 +541,7 @@ elf32_d10v_relocate_section (bfd *output_bfd,
#define ELF_MACHINE_ALT1 EM_CYGNUS_D10V
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM bfd_elf32_d10v_vec
+#define TARGET_BIG_SYM d10v_elf32_vec
#define TARGET_BIG_NAME "elf32-d10v"
#define elf_info_to_howto 0
diff --git a/binutils-2.25/bfd/elf32-d30v.c b/binutils-2.25/bfd/elf32-d30v.c
index 9739416f..211a673a 100644
--- a/binutils-2.25/bfd/elf32-d30v.c
+++ b/binutils-2.25/bfd/elf32-d30v.c
@@ -1,6 +1,5 @@
/* D30V-specific support for 32-bit ELF
- Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1997-2014 Free Software Foundation, Inc.
Contributed by Martin Hunt (hunt@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
@@ -540,7 +539,7 @@ d30v_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
#define ELF_MACHINE_ALT1 EM_CYGNUS_D30V
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM bfd_elf32_d30v_vec
+#define TARGET_BIG_SYM d30v_elf32_vec
#define TARGET_BIG_NAME "elf32-d30v"
#define elf_info_to_howto d30v_info_to_howto_rela
diff --git a/binutils-2.25/bfd/elf32-dlx.c b/binutils-2.25/bfd/elf32-dlx.c
index 1379d3d7..91441aa8 100644
--- a/binutils-2.25/bfd/elf32-dlx.c
+++ b/binutils-2.25/bfd/elf32-dlx.c
@@ -1,6 +1,5 @@
/* DLX specific support for 32-bit ELF
- Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -572,7 +571,7 @@ elf32_dlx_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
return;
}
-#define TARGET_BIG_SYM bfd_elf32_dlx_big_vec
+#define TARGET_BIG_SYM dlx_elf32_be_vec
#define TARGET_BIG_NAME "elf32-dlx"
#define ELF_ARCH bfd_arch_dlx
#define ELF_MACHINE_CODE EM_DLX
diff --git a/binutils-2.25/bfd/elf32-epiphany.c b/binutils-2.25/bfd/elf32-epiphany.c
index b427ef33..8d95cc9d 100644
--- a/binutils-2.25/bfd/elf32-epiphany.c
+++ b/binutils-2.25/bfd/elf32-epiphany.c
@@ -1,6 +1,5 @@
/* Adapteva epiphany specific support for 32-bit ELF
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
Contributed by Embecosm on behalf of Adapteva, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -515,11 +514,12 @@ epiphany_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
{
bfd_boolean warned ATTRIBUTE_UNUSED;
bfd_boolean unresolved_reloc ATTRIBUTE_UNUSED;
+ bfd_boolean ignored ATTRIBUTE_UNUSED;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
name = h->root.root.string;
}
@@ -585,7 +585,7 @@ epiphany_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
}
/* We only have a little-endian target. */
-#define TARGET_LITTLE_SYM bfd_elf32_epiphany_vec
+#define TARGET_LITTLE_SYM epiphany_elf32_vec
#define TARGET_LITTLE_NAME "elf32-epiphany"
#define ELF_ARCH bfd_arch_epiphany
diff --git a/binutils-2.25/bfd/elf32-fr30.c b/binutils-2.25/bfd/elf32-fr30.c
index 3aed435d..022a0a9f 100644
--- a/binutils-2.25/bfd/elf32-fr30.c
+++ b/binutils-2.25/bfd/elf32-fr30.c
@@ -1,7 +1,5 @@
/* FR30-specific support for 32-bit ELF.
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2010, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -547,12 +545,12 @@ fr30_elf_relocate_section (bfd *output_bfd,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
name = h->root.root.string;
}
@@ -705,7 +703,7 @@ fr30_elf_check_relocs (bfd *abfd,
#define ELF_MACHINE_ALT1 EM_CYGNUS_FR30
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM bfd_elf32_fr30_vec
+#define TARGET_BIG_SYM fr30_elf32_vec
#define TARGET_BIG_NAME "elf32-fr30"
#define elf_info_to_howto_rel NULL
diff --git a/binutils-2.25/bfd/elf32-frv.c b/binutils-2.25/bfd/elf32-frv.c
index 788c2997..46f299b7 100644
--- a/binutils-2.25/bfd/elf32-frv.c
+++ b/binutils-2.25/bfd/elf32-frv.c
@@ -1,6 +1,5 @@
/* FRV-specific support for 32-bit ELF.
- Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -797,8 +796,8 @@ static reloc_howto_type elf32_frv_rel_tlsoff_howto =
-extern const bfd_target bfd_elf32_frvfdpic_vec;
-#define IS_FDPIC(bfd) ((bfd)->xvec == &bfd_elf32_frvfdpic_vec)
+extern const bfd_target frv_elf32_fdpic_vec;
+#define IS_FDPIC(bfd) ((bfd)->xvec == &frv_elf32_fdpic_vec)
/* An extension of the elf hash table data structure, containing some
additional FRV-specific data. */
@@ -2735,13 +2734,13 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
bfd_boolean unresolved_reloc;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
osec = sec;
name = h->root.root.string;
}
@@ -6313,27 +6312,6 @@ frv_elf_set_private_flags (bfd *abfd, flagword flags)
return TRUE;
}
-/* Copy backend specific data from one object module to another. */
-
-static bfd_boolean
-frv_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
-{
- if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
- || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
- return TRUE;
-
- BFD_ASSERT (!elf_flags_init (obfd)
- || elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags);
-
- elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
- elf_flags_init (obfd) = TRUE;
-
- /* Copy object attributes. */
- _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
- return TRUE;
-}
-
/* Return true if the architecture described by elf header flag
EXTENSION is an extension of the architecture described by BASE. */
@@ -6361,23 +6339,6 @@ frv_elf_arch_extension_p (flagword base, flagword extension)
return FALSE;
}
-static bfd_boolean
-elf32_frvfdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
-{
- if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
- || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
- return TRUE;
-
- if (! frv_elf_copy_private_bfd_data (ibfd, obfd))
- return FALSE;
-
- if (! elf_tdata (ibfd) || ! elf_tdata (ibfd)->phdr
- || ! elf_tdata (obfd) || ! elf_tdata (obfd)->phdr)
- return TRUE;
-
- return TRUE;
-}
-
/* Merge backend specific data from an object file to the output
object file when linking. */
@@ -6816,7 +6777,7 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
#define ELF_MACHINE_CODE EM_CYGNUS_FRV
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM bfd_elf32_frv_vec
+#define TARGET_BIG_SYM frv_elf32_vec
#define TARGET_BIG_NAME "elf32-frv"
#define elf_info_to_howto frv_info_to_howto_rela
@@ -6833,7 +6794,6 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
#define bfd_elf32_bfd_reloc_type_lookup frv_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup frv_reloc_name_lookup
#define bfd_elf32_bfd_set_private_flags frv_elf_set_private_flags
-#define bfd_elf32_bfd_copy_private_bfd_data frv_elf_copy_private_bfd_data
#define bfd_elf32_bfd_merge_private_bfd_data frv_elf_merge_private_bfd_data
#define bfd_elf32_bfd_print_private_bfd_data frv_elf_print_private_bfd_data
@@ -6856,7 +6816,7 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
#define ELF_MAXPAGESIZE 0x4000
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_frvfdpic_vec
+#define TARGET_BIG_SYM frv_elf32_fdpic_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-frvfdpic"
#undef elf32_bed
@@ -6871,9 +6831,6 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
#undef elf_backend_always_size_sections
#define elf_backend_always_size_sections \
elf32_frvfdpic_always_size_sections
-#undef bfd_elf32_bfd_copy_private_bfd_data
-#define bfd_elf32_bfd_copy_private_bfd_data \
- elf32_frvfdpic_copy_private_bfd_data
#undef elf_backend_create_dynamic_sections
#define elf_backend_create_dynamic_sections \
diff --git a/binutils-2.25/bfd/elf32-gen.c b/binutils-2.25/bfd/elf32-gen.c
index 32814290..412fefd1 100644
--- a/binutils-2.25/bfd/elf32-gen.c
+++ b/binutils-2.25/bfd/elf32-gen.c
@@ -1,6 +1,5 @@
/* Generic support for 32-bit ELF
- Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -87,9 +86,9 @@ elf32_generic_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
return bfd_elf_link_add_symbols (abfd, info);
}
-#define TARGET_LITTLE_SYM bfd_elf32_little_generic_vec
+#define TARGET_LITTLE_SYM elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-little"
-#define TARGET_BIG_SYM bfd_elf32_big_generic_vec
+#define TARGET_BIG_SYM elf32_be_vec
#define TARGET_BIG_NAME "elf32-big"
#define ELF_ARCH bfd_arch_unknown
#define ELF_MACHINE_CODE EM_NONE
diff --git a/binutils-2.25/bfd/elf32-h8300.c b/binutils-2.25/bfd/elf32-h8300.c
index 67bca3f5..e9eae944 100644
--- a/binutils-2.25/bfd/elf32-h8300.c
+++ b/binutils-2.25/bfd/elf32-h8300.c
@@ -1,5 +1,5 @@
/* BFD back-end for Renesas H8/300 ELF binaries.
- Copyright 1993-2013 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -468,12 +468,12 @@ elf32_h8_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -1705,7 +1705,7 @@ elf32_h8_get_relocated_section_contents (bfd *output_bfd,
}
-#define TARGET_BIG_SYM bfd_elf32_h8300_vec
+#define TARGET_BIG_SYM h8300_elf32_vec
#define TARGET_BIG_NAME "elf32-h8300"
#define ELF_ARCH bfd_arch_h8300
#define ELF_MACHINE_CODE EM_H8_300
diff --git a/binutils-2.25/bfd/elf32-hppa.c b/binutils-2.25/bfd/elf32-hppa.c
index dfffbcba..0588ebbf 100644
--- a/binutils-2.25/bfd/elf32-hppa.c
+++ b/binutils-2.25/bfd/elf32-hppa.c
@@ -1,5 +1,5 @@
/* BFD back-end for HP PA-RISC ELF files.
- Copyright 1990-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Original code by
Center for Software Science
@@ -407,6 +407,18 @@ hppa_link_hash_newfunc (struct bfd_hash_entry *entry,
return entry;
}
+/* Free the derived linker hash table. */
+
+static void
+elf32_hppa_link_hash_table_free (bfd *obfd)
+{
+ struct elf32_hppa_link_hash_table *htab
+ = (struct elf32_hppa_link_hash_table *) obfd->link.hash;
+
+ bfd_hash_table_free (&htab->bstab);
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
/* Create the derived linker hash table. The PA ELF port uses the derived
hash table to keep information specific to the PA ELF linker (without
using static variables). */
@@ -432,25 +444,17 @@ elf32_hppa_link_hash_table_create (bfd *abfd)
/* Init the stub hash table too. */
if (!bfd_hash_table_init (&htab->bstab, stub_hash_newfunc,
sizeof (struct elf32_hppa_stub_hash_entry)))
- return NULL;
+ {
+ _bfd_elf_link_hash_table_free (abfd);
+ return NULL;
+ }
+ htab->etab.root.hash_table_free = elf32_hppa_link_hash_table_free;
htab->text_segment_base = (bfd_vma) -1;
htab->data_segment_base = (bfd_vma) -1;
return &htab->etab.root;
}
-/* Free the derived linker hash table. */
-
-static void
-elf32_hppa_link_hash_table_free (struct bfd_link_hash_table *btab)
-{
- struct elf32_hppa_link_hash_table *htab
- = (struct elf32_hppa_link_hash_table *) btab;
-
- bfd_hash_table_free (&htab->bstab);
- _bfd_elf_link_hash_table_free (btab);
-}
-
/* Build a name for an entry in the stub hash table. */
static char *
@@ -1771,6 +1775,10 @@ elf32_hppa_hide_symbol (struct bfd_link_info *info,
_bfd_elf_strtab_delref (elf_hash_table (info)->dynstr,
eh->dynstr_index);
}
+
+ /* PR 16082: Remove version information from hidden symbol. */
+ eh->verinfo.verdef = NULL;
+ eh->verinfo.vertree = NULL;
}
/* STT_GNU_IFUNC symbol must go through PLT. */
@@ -2224,7 +2232,7 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Set up .got and .plt offsets for local syms, and space for local
dynamic relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -2499,7 +2507,7 @@ elf32_hppa_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info)
/* Count the number of input BFDs and find the top input section id. */
for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next)
+ input_bfd = input_bfd->link.next)
{
bfd_count += 1;
for (section = input_bfd->sections;
@@ -2690,7 +2698,7 @@ get_local_syms (bfd *output_bfd, bfd *input_bfd, struct bfd_link_info *info)
export stubs. */
for (bfd_indx = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next, bfd_indx++)
+ input_bfd = input_bfd->link.next, bfd_indx++)
{
Elf_Internal_Shdr *symtab_hdr;
@@ -2864,7 +2872,7 @@ elf32_hppa_size_stubs
for (input_bfd = info->input_bfds, bfd_indx = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next, bfd_indx++)
+ input_bfd = input_bfd->link.next, bfd_indx++)
{
Elf_Internal_Shdr *symtab_hdr;
asection *section;
@@ -3690,13 +3698,14 @@ elf32_hppa_relocate_section (bfd *output_bfd,
else
{
struct elf_link_hash_entry *eh;
- bfd_boolean unresolved_reloc;
+ bfd_boolean unresolved_reloc, ignored;
struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rela,
r_symndx, symtab_hdr, sym_hashes,
eh, sym_sec, relocation,
- unresolved_reloc, warned_undef);
+ unresolved_reloc, warned_undef,
+ ignored);
if (!info->relocatable
&& relocation == 0
@@ -4620,7 +4629,6 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
/* Stuff for the BFD linker. */
#define bfd_elf32_bfd_final_link elf32_hppa_final_link
#define bfd_elf32_bfd_link_hash_table_create elf32_hppa_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free elf32_hppa_link_hash_table_free
#define elf_backend_adjust_dynamic_symbol elf32_hppa_adjust_dynamic_symbol
#define elf_backend_copy_indirect_symbol elf32_hppa_copy_indirect_symbol
#define elf_backend_check_relocs elf32_hppa_check_relocs
@@ -4638,7 +4646,6 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
#define elf_backend_grok_psinfo elf32_hppa_grok_psinfo
#define elf_backend_object_p elf32_hppa_object_p
#define elf_backend_final_write_processing elf_hppa_final_write_processing
-#define elf_backend_post_process_headers _bfd_elf_set_osabi
#define elf_backend_get_symbol_type elf32_hppa_elf_get_symbol_type
#define elf_backend_reloc_type_class elf32_hppa_reloc_type_class
#define elf_backend_action_discarded elf_hppa_action_discarded
@@ -4652,7 +4659,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
#define elf_backend_got_header_size 8
#define elf_backend_rela_normal 1
-#define TARGET_BIG_SYM bfd_elf32_hppa_vec
+#define TARGET_BIG_SYM hppa_elf32_vec
#define TARGET_BIG_NAME "elf32-hppa"
#define ELF_ARCH bfd_arch_hppa
#define ELF_TARGET_ID HPPA32_ELF_DATA
@@ -4664,7 +4671,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
#include "elf32-target.h"
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_hppa_linux_vec
+#define TARGET_BIG_SYM hppa_elf32_linux_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-hppa-linux"
#undef ELF_OSABI
@@ -4675,7 +4682,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
#include "elf32-target.h"
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_hppa_nbsd_vec
+#define TARGET_BIG_SYM hppa_elf32_nbsd_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-hppa-netbsd"
#undef ELF_OSABI
diff --git a/binutils-2.25/bfd/elf32-hppa.h b/binutils-2.25/bfd/elf32-hppa.h
index 9b88229d..1b3c5efa 100644
--- a/binutils-2.25/bfd/elf32-hppa.h
+++ b/binutils-2.25/bfd/elf32-hppa.h
@@ -4,8 +4,7 @@
in the Stratus FTX/Golf Object File Format (SED-1762) dated
February 1994.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
- 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by:
diff --git a/binutils-2.25/bfd/elf32-i370.c b/binutils-2.25/bfd/elf32-i370.c
index 48e25f22..c9ed6e02 100644
--- a/binutils-2.25/bfd/elf32-i370.c
+++ b/binutils-2.25/bfd/elf32-i370.c
@@ -1,6 +1,5 @@
/* i370-specific support for 32-bit ELF
- Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
Hacked by Linas Vepstas for i370 linas@linas.org
@@ -1091,6 +1090,12 @@ i370_elf_relocate_section (bfd *output_bfd,
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+
+ if (info->wrap_hash != NULL
+ && (input_section->flags & SEC_DEBUGGING) != 0)
+ h = ((struct elf_link_hash_entry *)
+ unwrap_hash_lookup (info, input_bfd, &h->root));
+
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
@@ -1357,7 +1362,7 @@ i370_elf_relocate_section (bfd *output_bfd,
return ret;
}
-#define TARGET_BIG_SYM bfd_elf32_i370_vec
+#define TARGET_BIG_SYM i370_elf32_vec
#define TARGET_BIG_NAME "elf32-i370"
#define ELF_ARCH bfd_arch_i370
#define ELF_MACHINE_CODE EM_S370
@@ -1388,7 +1393,6 @@ i370_elf_relocate_section (bfd *output_bfd,
#define elf_backend_section_from_shdr i370_elf_section_from_shdr
#define elf_backend_adjust_dynamic_symbol i370_elf_adjust_dynamic_symbol
#define elf_backend_check_relocs i370_elf_check_relocs
-#define elf_backend_post_process_headers _bfd_elf_set_osabi
static int
i370_noop (void)
diff --git a/binutils-2.25/bfd/elf32-i386.c b/binutils-2.25/bfd/elf32-i386.c
index 560e05cc..ad8b5575 100644
--- a/binutils-2.25/bfd/elf32-i386.c
+++ b/binutils-2.25/bfd/elf32-i386.c
@@ -1,7 +1,5 @@
/* Intel 80386/80486-specific support for 32-bit ELF
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -828,7 +826,7 @@ struct elf_i386_link_hash_table
== I386_ELF_DATA ? ((struct elf_i386_link_hash_table *) ((p)->hash)) : NULL)
#define elf_i386_compute_jump_table_size(htab) \
- ((htab)->next_tls_desc_index * 4)
+ ((htab)->elf.srelplt->reloc_count * 4)
/* Create an entry in an i386 ELF linker hash table. */
@@ -929,6 +927,21 @@ elf_i386_get_local_sym_hash (struct elf_i386_link_hash_table *htab,
return &ret->elf;
}
+/* Destroy an i386 ELF linker hash table. */
+
+static void
+elf_i386_link_hash_table_free (bfd *obfd)
+{
+ struct elf_i386_link_hash_table *htab
+ = (struct elf_i386_link_hash_table *) obfd->link.hash;
+
+ if (htab->loc_hash_table)
+ htab_delete (htab->loc_hash_table);
+ if (htab->loc_hash_memory)
+ objalloc_free ((struct objalloc *) htab->loc_hash_memory);
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
/* Create an i386 ELF linker hash table. */
static struct bfd_link_hash_table *
@@ -957,28 +970,14 @@ elf_i386_link_hash_table_create (bfd *abfd)
ret->loc_hash_memory = objalloc_create ();
if (!ret->loc_hash_table || !ret->loc_hash_memory)
{
- free (ret);
+ elf_i386_link_hash_table_free (abfd);
return NULL;
}
+ ret->elf.root.hash_table_free = elf_i386_link_hash_table_free;
return &ret->elf.root;
}
-/* Destroy an i386 ELF linker hash table. */
-
-static void
-elf_i386_link_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct elf_i386_link_hash_table *htab
- = (struct elf_i386_link_hash_table *) hash;
-
- if (htab->loc_hash_table)
- htab_delete (htab->loc_hash_table);
- if (htab->loc_hash_memory)
- objalloc_free ((struct objalloc *) htab->loc_hash_memory);
- _bfd_elf_link_hash_table_free (hash);
-}
-
/* Create .plt, .rel.plt, .got, .got.plt, .rel.got, .dynbss, and
.rel.bss sections in DYNOBJ, and set up shortcuts to them in our
hash table. */
@@ -2219,7 +2218,7 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
/* If this is the first .plt entry, make room for the special
first entry. */
if (s->size == 0)
- s->size += plt_entry_size;
+ s->size = plt_entry_size;
h->plt.offset = s->size;
@@ -2534,7 +2533,7 @@ elf_i386_convert_mov_to_lea (bfd *abfd, asection *sec,
/* Nothing to do if there are no codes, no relocations or no output. */
if ((sec->flags & (SEC_CODE | SEC_RELOC)) != (SEC_CODE | SEC_RELOC)
|| sec->reloc_count == 0
- || discarded_section (sec))
+ || bfd_is_abs_section (sec->output_section))
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
@@ -2688,7 +2687,7 @@ elf_i386_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -3311,11 +3310,12 @@ elf_i386_relocate_section (bfd *output_bfd,
else
{
bfd_boolean warned ATTRIBUTE_UNUSED;
+ bfd_boolean ignored ATTRIBUTE_UNUSED;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
st_size = h->size;
}
@@ -4976,14 +4976,46 @@ elf_i386_finish_dynamic_sections (bfd *output_bfd,
return TRUE;
}
-/* Return address for Ith PLT stub in section PLT, for relocation REL
- or (bfd_vma) -1 if it should not be included. */
+/* Return address in section PLT for the Ith GOTPLT relocation, for
+ relocation REL or (bfd_vma) -1 if it should not be included. */
static bfd_vma
-elf_i386_plt_sym_val (bfd_vma i, const asection *plt,
- const arelent *rel ATTRIBUTE_UNUSED)
+elf_i386_plt_sym_val (bfd_vma i, const asection *plt, const arelent *rel)
{
- return plt->vma + (i + 1) * GET_PLT_ENTRY_SIZE (plt->owner);
+ bfd *abfd;
+ const struct elf_i386_backend_data *bed;
+ bfd_vma plt_offset;
+
+ /* Only match R_386_JUMP_SLOT and R_386_IRELATIVE. */
+ if (rel->howto->type != R_386_JUMP_SLOT
+ && rel->howto->type != R_386_IRELATIVE)
+ return (bfd_vma) -1;
+
+ abfd = plt->owner;
+ bed = get_elf_i386_backend_data (abfd);
+ plt_offset = bed->plt->plt_entry_size;
+
+ if (elf_elfheader (abfd)->e_ident[EI_OSABI] != ELFOSABI_GNU)
+ return plt->vma + (i + 1) * plt_offset;
+
+ while (plt_offset < plt->size)
+ {
+ bfd_vma reloc_offset;
+ bfd_byte reloc_offset_raw[4];
+
+ if (!bfd_get_section_contents (abfd, (asection *) plt,
+ reloc_offset_raw,
+ plt_offset + bed->plt->plt_reloc_offset,
+ sizeof (reloc_offset_raw)))
+ return (bfd_vma) -1;
+
+ reloc_offset = H_GET_32 (abfd, reloc_offset_raw);
+ if (reloc_offset == i * sizeof (Elf32_External_Rel))
+ return plt->vma + plt_offset;
+ plt_offset += bed->plt->plt_entry_size;
+ }
+
+ abort ();
}
/* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */
@@ -5004,22 +5036,23 @@ elf_i386_hash_symbol (struct elf_link_hash_entry *h)
static bfd_boolean
elf_i386_add_symbol_hook (bfd * abfd,
- struct bfd_link_info * info ATTRIBUTE_UNUSED,
+ struct bfd_link_info * info,
Elf_Internal_Sym * sym,
const char ** namep ATTRIBUTE_UNUSED,
flagword * flagsp ATTRIBUTE_UNUSED,
asection ** secp ATTRIBUTE_UNUSED,
bfd_vma * valp ATTRIBUTE_UNUSED)
{
- if ((abfd->flags & DYNAMIC) == 0
- && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
- || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE))
+ if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
+ || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)
+ && (abfd->flags & DYNAMIC) == 0
+ && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
return TRUE;
}
-#define TARGET_LITTLE_SYM bfd_elf32_i386_vec
+#define TARGET_LITTLE_SYM i386_elf32_vec
#define TARGET_LITTLE_NAME "elf32-i386"
#define ELF_ARCH bfd_arch_i386
#define ELF_TARGET_ID I386_ELF_DATA
@@ -5042,7 +5075,6 @@ elf_i386_add_symbol_hook (bfd * abfd,
#define bfd_elf32_bfd_is_local_label_name elf_i386_is_local_label_name
#define bfd_elf32_bfd_link_hash_table_create elf_i386_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free elf_i386_link_hash_table_free
#define bfd_elf32_bfd_reloc_type_lookup elf_i386_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup elf_i386_reloc_name_lookup
@@ -5067,15 +5099,13 @@ elf_i386_add_symbol_hook (bfd * abfd,
#define elf_backend_plt_sym_val elf_i386_plt_sym_val
#define elf_backend_hash_symbol elf_i386_hash_symbol
#define elf_backend_add_symbol_hook elf_i386_add_symbol_hook
-#undef elf_backend_post_process_headers
-#define elf_backend_post_process_headers _bfd_elf_set_osabi
#include "elf32-target.h"
/* FreeBSD support. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_i386_freebsd_vec
+#define TARGET_LITTLE_SYM i386_elf32_fbsd_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-i386-freebsd"
#undef ELF_OSABI
@@ -5088,11 +5118,14 @@ elf_i386_add_symbol_hook (bfd * abfd,
static void
elf_i386_fbsd_post_process_headers (bfd *abfd, struct bfd_link_info *info)
{
- _bfd_elf_set_osabi (abfd, info);
+ _bfd_elf_post_process_headers (abfd, info);
#ifdef OLD_FREEBSD_ABI_LABEL
- /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */
- memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
+ {
+ /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */
+ Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd);
+ memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
+ }
#endif
}
@@ -5108,7 +5141,7 @@ elf_i386_fbsd_post_process_headers (bfd *abfd, struct bfd_link_info *info)
/* Solaris 2. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_i386_sol2_vec
+#define TARGET_LITTLE_SYM i386_elf32_sol2_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-i386-sol2"
@@ -5136,7 +5169,7 @@ elf_i386_fbsd_post_process_headers (bfd *abfd, struct bfd_link_info *info)
/* Native Client support. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_i386_nacl_vec
+#define TARGET_LITTLE_SYM i386_elf32_nacl_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-i386-nacl"
#undef elf32_bed
@@ -5150,7 +5183,6 @@ elf_i386_fbsd_post_process_headers (bfd *abfd, struct bfd_link_info *info)
#undef elf_backend_want_plt_sym
#define elf_backend_want_plt_sym 0
#undef elf_backend_post_process_headers
-#define elf_backend_post_process_headers _bfd_elf_set_osabi
#undef elf_backend_static_tls_alignment
/* NaCl uses substantially different PLT entries for the same effects. */
@@ -5295,9 +5327,19 @@ static const struct elf_i386_backend_data elf_i386_nacl_arch_bed =
0, /* is_vxworks */
};
+static bfd_boolean
+elf32_i386_nacl_elf_object_p (bfd *abfd)
+{
+ /* Set the right machine number for a NaCl i386 ELF32 file. */
+ bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_i386_i386_nacl);
+ return TRUE;
+}
+
#undef elf_backend_arch_data
#define elf_backend_arch_data &elf_i386_nacl_arch_bed
+#undef elf_backend_object_p
+#define elf_backend_object_p elf32_i386_nacl_elf_object_p
#undef elf_backend_modify_segment_map
#define elf_backend_modify_segment_map nacl_modify_segment_map
#undef elf_backend_modify_program_headers
@@ -5308,6 +5350,7 @@ static const struct elf_i386_backend_data elf_i386_nacl_arch_bed =
#include "elf32-target.h"
/* Restore defaults. */
+#undef elf_backend_object_p
#undef elf_backend_modify_segment_map
#undef elf_backend_modify_program_headers
#undef elf_backend_final_write_processing
@@ -5315,7 +5358,7 @@ static const struct elf_i386_backend_data elf_i386_nacl_arch_bed =
/* VxWorks support. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_i386_vxworks_vec
+#define TARGET_LITTLE_SYM i386_elf32_vxworks_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-i386-vxworks"
#undef ELF_OSABI
@@ -5333,7 +5376,6 @@ static const struct elf_i386_backend_data elf_i386_vxworks_arch_bed =
#define elf_backend_arch_data &elf_i386_vxworks_arch_bed
#undef elf_backend_relocs_compatible
-#undef elf_backend_post_process_headers
#undef elf_backend_add_symbol_hook
#define elf_backend_add_symbol_hook \
elf_vxworks_add_symbol_hook
diff --git a/binutils-2.25/bfd/elf32-i860.c b/binutils-2.25/bfd/elf32-i860.c
index c7991bd8..de900c18 100644
--- a/binutils-2.25/bfd/elf32-i860.c
+++ b/binutils-2.25/bfd/elf32-i860.c
@@ -1,7 +1,5 @@
/* Intel i860 specific support for 32-bit ELF.
- Copyright 1993, 1995, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008,
- 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Full i860 support contributed by Jason Eckhardt <jle@cygnus.com>.
@@ -1121,12 +1119,12 @@ elf32_i860_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -1251,9 +1249,9 @@ elf32_i860_is_local_label_name (bfd *abfd, const char *name)
return _bfd_elf_is_local_label_name (abfd, name);
}
-#define TARGET_BIG_SYM bfd_elf32_i860_vec
+#define TARGET_BIG_SYM i860_elf32_vec
#define TARGET_BIG_NAME "elf32-i860"
-#define TARGET_LITTLE_SYM bfd_elf32_i860_little_vec
+#define TARGET_LITTLE_SYM i860_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-i860-little"
#define ELF_ARCH bfd_arch_i860
#define ELF_MACHINE_CODE EM_860
diff --git a/binutils-2.25/bfd/elf32-i960.c b/binutils-2.25/bfd/elf32-i960.c
index bb03897a..c6fbbb8c 100644
--- a/binutils-2.25/bfd/elf32-i960.c
+++ b/binutils-2.25/bfd/elf32-i960.c
@@ -1,6 +1,5 @@
/* Intel 960 specific support for 32-bit ELF
- Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -159,7 +158,7 @@ elf32_i960_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
return NULL;
}
-#define TARGET_LITTLE_SYM bfd_elf32_i960_vec
+#define TARGET_LITTLE_SYM i960_elf32_vec
#define TARGET_LITTLE_NAME "elf32-i960"
#define ELF_ARCH bfd_arch_i960
#define ELF_MACHINE_CODE EM_960
diff --git a/binutils-2.25/bfd/elf32-ip2k.c b/binutils-2.25/bfd/elf32-ip2k.c
index 3bbad147..79e1eccf 100644
--- a/binutils-2.25/bfd/elf32-ip2k.c
+++ b/binutils-2.25/bfd/elf32-ip2k.c
@@ -1,6 +1,5 @@
/* Ubicom IP2xxx specific support for 32-bit ELF
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -1425,13 +1424,13 @@ ip2k_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
bfd_boolean unresolved_reloc;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
name = h->root.root.string;
}
@@ -1496,7 +1495,7 @@ ip2k_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
return TRUE;
}
-#define TARGET_BIG_SYM bfd_elf32_ip2k_vec
+#define TARGET_BIG_SYM ip2k_elf32_vec
#define TARGET_BIG_NAME "elf32-ip2k"
#define ELF_ARCH bfd_arch_ip2k
diff --git a/binutils-2.25/bfd/elf32-iq2000.c b/binutils-2.25/bfd/elf32-iq2000.c
index 3a90a996..a6bf8d2e 100644
--- a/binutils-2.25/bfd/elf32-iq2000.c
+++ b/binutils-2.25/bfd/elf32-iq2000.c
@@ -1,6 +1,5 @@
/* IQ2000-specific support for 32-bit ELF.
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2003-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -627,12 +626,12 @@ iq2000_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
else
{
bfd_boolean unresolved_reloc;
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
name = h->root.root.string;
}
@@ -763,27 +762,6 @@ iq2000_elf_set_private_flags (bfd *abfd, flagword flags)
return TRUE;
}
-/* Copy backend specific data from one object module to another. */
-
-static bfd_boolean
-iq2000_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
-{
- if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
- || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
- return TRUE;
-
- BFD_ASSERT (!elf_flags_init (obfd)
- || elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags);
-
- elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
- elf_flags_init (obfd) = TRUE;
-
- /* Copy object attributes. */
- _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
- return TRUE;
-}
-
/* Merge backend specific data from an object
file to the output object file when linking. */
@@ -915,7 +893,7 @@ iq2000_elf_object_p (bfd *abfd)
#define ELF_MACHINE_CODE EM_IQ2000
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM bfd_elf32_iq2000_vec
+#define TARGET_BIG_SYM iq2000_elf32_vec
#define TARGET_BIG_NAME "elf32-iq2000"
#define elf_info_to_howto_rel NULL
@@ -931,7 +909,6 @@ iq2000_elf_object_p (bfd *abfd)
#define bfd_elf32_bfd_reloc_type_lookup iq2000_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup iq2000_reloc_name_lookup
#define bfd_elf32_bfd_set_private_flags iq2000_elf_set_private_flags
-#define bfd_elf32_bfd_copy_private_bfd_data iq2000_elf_copy_private_bfd_data
#define bfd_elf32_bfd_merge_private_bfd_data iq2000_elf_merge_private_bfd_data
#define bfd_elf32_bfd_print_private_bfd_data iq2000_elf_print_private_bfd_data
diff --git a/binutils-2.25/bfd/elf32-lm32.c b/binutils-2.25/bfd/elf32-lm32.c
index df6f3464..e694055a 100644
--- a/binutils-2.25/bfd/elf32-lm32.c
+++ b/binutils-2.25/bfd/elf32-lm32.c
@@ -1,5 +1,5 @@
/* Lattice Mico32-specific support for 32-bit ELF
- Copyright 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2008-2014 Free Software Foundation, Inc.
Contributed by Jon Beniston <jon@beniston.com>
This file is part of BFD, the Binary File Descriptor library.
@@ -43,9 +43,9 @@
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1"
-extern const bfd_target bfd_elf32_lm32fdpic_vec;
+extern const bfd_target lm32_elf32_fdpic_vec;
-#define IS_FDPIC(bfd) ((bfd)->xvec == &bfd_elf32_lm32fdpic_vec)
+#define IS_FDPIC(bfd) ((bfd)->xvec == &lm32_elf32_fdpic_vec)
static bfd_reloc_status_type lm32_elf_gprel_reloc
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
@@ -875,12 +875,12 @@ lm32_elf_relocate_section (bfd *output_bfd,
{
/* It's a global symbol. */
bfd_boolean unresolved_reloc;
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
name = h->root.root.string;
}
@@ -2146,7 +2146,7 @@ lm32_elf_size_dynamic_sections (bfd *output_bfd,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -2324,7 +2324,7 @@ lm32_elf_size_dynamic_sections (bfd *output_bfd,
int r32_count = 0;
int rgot_count = 0;
/* Look for deleted sections. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
for (s = ibfd->sections; s != NULL; s = s->next)
{
@@ -2627,26 +2627,6 @@ lm32_elf_always_size_sections (bfd *output_bfd, struct bfd_link_info *info)
}
static bfd_boolean
-lm32_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
-{
- if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
- || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
- return TRUE;
-
- BFD_ASSERT (!elf_flags_init (obfd)
- || elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags);
-
- elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
- elf_flags_init (obfd) = TRUE;
-
- /* Copy object attributes. */
- _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
- return TRUE;
-}
-
-
-static bfd_boolean
lm32_elf_fdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
{
unsigned i;
@@ -2655,7 +2635,7 @@ lm32_elf_fdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
return TRUE;
- if (! lm32_elf_copy_private_bfd_data (ibfd, obfd))
+ if (! _bfd_elf_copy_private_bfd_data (ibfd, obfd))
return FALSE;
if (! elf_tdata (ibfd) || ! elf_tdata (ibfd)->phdr
@@ -2694,7 +2674,7 @@ lm32_elf_fdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
#define ELF_MACHINE_CODE EM_LATTICEMICO32
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM bfd_elf32_lm32_vec
+#define TARGET_BIG_SYM lm32_elf32_vec
#define TARGET_BIG_NAME "elf32-lm32"
#define bfd_elf32_bfd_reloc_type_lookup lm32_reloc_type_lookup
@@ -2732,7 +2712,7 @@ lm32_elf_fdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_lm32fdpic_vec
+#define TARGET_BIG_SYM lm32_elf32_fdpic_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-lm32fdpic"
#undef elf32_bed
diff --git a/binutils-2.25/bfd/elf32-m32c.c b/binutils-2.25/bfd/elf32-m32c.c
index 8e77c5ec..3e2c8027 100644
--- a/binutils-2.25/bfd/elf32-m32c.c
+++ b/binutils-2.25/bfd/elf32-m32c.c
@@ -1,6 +1,5 @@
/* M16C/M32C specific support for 32-bit ELF.
- Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2005-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -409,6 +408,11 @@ m32c_elf_relocate_section
{
h = sym_hashes [r_symndx - symtab_hdr->sh_info];
+ if (info->wrap_hash != NULL
+ && (input_section->flags & SEC_DEBUGGING) != 0)
+ h = ((struct elf_link_hash_entry *)
+ unwrap_hash_lookup (info, input_bfd, &h->root));
+
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
@@ -1106,7 +1110,7 @@ m32c_elf_relax_plt_section (asection *splt,
/* Likewise for local symbols, though that's somewhat less convenient
as we have to walk the list of input bfds and swap in symbol data. */
- for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next)
{
bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd);
Elf_Internal_Shdr *symtab_hdr;
@@ -1180,7 +1184,7 @@ m32c_elf_relax_plt_section (asection *splt,
elf_link_hash_traverse (elf_hash_table (info),
m32c_relax_plt_realloc, &entry);
- for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next)
{
bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd);
unsigned int nlocals = elf_tdata (ibfd)->symtab_hdr.sh_info;
@@ -2044,10 +2048,10 @@ _bfd_m32c_elf_eh_frame_address_size (bfd *abfd, asection *sec ATTRIBUTE_UNUSED)
#define ELF_MAXPAGESIZE 0x100
#if 0
-#define TARGET_BIG_SYM bfd_elf32_m32c_vec
+#define TARGET_BIG_SYM m32c_elf32_vec
#define TARGET_BIG_NAME "elf32-m32c"
#else
-#define TARGET_LITTLE_SYM bfd_elf32_m32c_vec
+#define TARGET_LITTLE_SYM m32c_elf32_vec
#define TARGET_LITTLE_NAME "elf32-m32c"
#endif
diff --git a/binutils-2.25/bfd/elf32-m32r.c b/binutils-2.25/bfd/elf32-m32r.c
index 71e8fc78..8dba9f0a 100644
--- a/binutils-2.25/bfd/elf32-m32r.c
+++ b/binutils-2.25/bfd/elf32-m32r.c
@@ -1,5 +1,5 @@
/* M32R-specific support for 32-bit ELF.
- Copyright 1996-2013 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -2177,7 +2177,7 @@ m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -2490,6 +2490,12 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
relocation = 0;
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+
+ if (info->wrap_hash != NULL
+ && (input_section->flags & SEC_DEBUGGING) != 0)
+ h = ((struct elf_link_hash_entry *)
+ unwrap_hash_lookup (info, input_bfd, &h->root));
+
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
@@ -4004,9 +4010,9 @@ m32r_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
#define ELF_MACHINE_ALT1 EM_CYGNUS_M32R
#define ELF_MAXPAGESIZE 0x1 /* Explicitly requested by Mitsubishi. */
-#define TARGET_BIG_SYM bfd_elf32_m32r_vec
+#define TARGET_BIG_SYM m32r_elf32_vec
#define TARGET_BIG_NAME "elf32-m32r"
-#define TARGET_LITTLE_SYM bfd_elf32_m32rle_vec
+#define TARGET_LITTLE_SYM m32r_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-m32rle"
#define elf_info_to_howto m32r_info_to_howto
@@ -4062,11 +4068,11 @@ m32r_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
#define ELF_MAXPAGESIZE 0x1000
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_m32rlin_vec
+#define TARGET_BIG_SYM m32r_elf32_linux_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-m32r-linux"
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_m32rlelin_vec
+#define TARGET_LITTLE_SYM m32r_elf32_linux_le_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-m32rle-linux"
#undef elf32_bed
diff --git a/binutils-2.25/bfd/elf32-m68hc11.c b/binutils-2.25/bfd/elf32-m68hc11.c
index b28579e0..2101bdf8 100644
--- a/binutils-2.25/bfd/elf32-m68hc11.c
+++ b/binutils-2.25/bfd/elf32-m68hc11.c
@@ -1,6 +1,5 @@
/* Motorola 68HC11-specific support for 32-bit ELF
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
Contributed by Stephane Carrez (stcarrez@nerim.fr)
(Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com))
@@ -1289,7 +1288,7 @@ static const struct bfd_elf_special_section elf32_m68hc11_special_sections[] =
#define ELF_MACHINE_CODE EM_68HC11
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM bfd_elf32_m68hc11_vec
+#define TARGET_BIG_SYM m68hc11_elf32_vec
#define TARGET_BIG_NAME "elf32-m68hc11"
#define elf_info_to_howto 0
@@ -1306,8 +1305,6 @@ static const struct bfd_elf_special_section elf32_m68hc11_special_sections[] =
#define bfd_elf32_bfd_link_hash_table_create \
m68hc11_elf_bfd_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free \
- m68hc11_elf_bfd_link_hash_table_free
#define bfd_elf32_bfd_merge_private_bfd_data \
_bfd_m68hc11_elf_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags _bfd_m68hc11_elf_set_private_flags
diff --git a/binutils-2.25/bfd/elf32-m68hc12.c b/binutils-2.25/bfd/elf32-m68hc12.c
index 2b5a1b38..7f48b7eb 100644
--- a/binutils-2.25/bfd/elf32-m68hc12.c
+++ b/binutils-2.25/bfd/elf32-m68hc12.c
@@ -1,6 +1,5 @@
/* Motorola 68HC12-specific support for 32-bit ELF
- Copyright 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
Contributed by Stephane Carrez (stcarrez@nerim.fr)
(Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com))
@@ -639,7 +638,7 @@ static const struct bfd_elf_special_section elf32_m68hc12_special_sections[] =
#define ELF_MACHINE_CODE EM_68HC12
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM bfd_elf32_m68hc12_vec
+#define TARGET_BIG_SYM m68hc12_elf32_vec
#define TARGET_BIG_NAME "elf32-m68hc12"
#define elf_info_to_howto 0
@@ -656,8 +655,6 @@ static const struct bfd_elf_special_section elf32_m68hc12_special_sections[] =
#define bfd_elf32_bfd_link_hash_table_create \
m68hc12_elf_bfd_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free \
- m68hc11_elf_bfd_link_hash_table_free
#define bfd_elf32_bfd_merge_private_bfd_data \
_bfd_m68hc11_elf_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags _bfd_m68hc11_elf_set_private_flags
diff --git a/binutils-2.25/bfd/elf32-m68hc1x.c b/binutils-2.25/bfd/elf32-m68hc1x.c
index 427e3cd2..c3a99df8 100644
--- a/binutils-2.25/bfd/elf32-m68hc1x.c
+++ b/binutils-2.25/bfd/elf32-m68hc1x.c
@@ -1,6 +1,5 @@
/* Motorola 68HC11/HC12-specific support for 32-bit ELF
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
Contributed by Stephane Carrez (stcarrez@nerim.fr)
This file is part of BFD, the Binary File Descriptor library.
@@ -59,6 +58,19 @@ struct m68hc11_scan_param
};
+/* Destroy a 68HC11/68HC12 ELF linker hash table. */
+
+static void
+m68hc11_elf_bfd_link_hash_table_free (bfd *obfd)
+{
+ struct m68hc11_elf_link_hash_table *ret
+ = (struct m68hc11_elf_link_hash_table *) obfd->link.hash;
+
+ bfd_hash_table_free (ret->stub_hash_table);
+ free (ret->stub_hash_table);
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
/* Create a 68HC11/68HC12 ELF linker hash table. */
struct m68hc11_elf_link_hash_table*
@@ -85,29 +97,21 @@ m68hc11_elf_hash_table_create (bfd *abfd)
ret->stub_hash_table = (struct bfd_hash_table*) bfd_malloc (amt);
if (ret->stub_hash_table == NULL)
{
- free (ret);
+ _bfd_elf_link_hash_table_free (abfd);
return NULL;
}
if (!bfd_hash_table_init (ret->stub_hash_table, stub_hash_newfunc,
sizeof (struct elf32_m68hc11_stub_hash_entry)))
- return NULL;
+ {
+ free (ret->stub_hash_table);
+ _bfd_elf_link_hash_table_free (abfd);
+ return NULL;
+ }
+ ret->root.root.hash_table_free = m68hc11_elf_bfd_link_hash_table_free;
return ret;
}
-/* Free the derived linker hash table. */
-
-void
-m68hc11_elf_bfd_link_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct m68hc11_elf_link_hash_table *ret
- = (struct m68hc11_elf_link_hash_table *) hash;
-
- bfd_hash_table_free (ret->stub_hash_table);
- free (ret->stub_hash_table);
- _bfd_elf_link_hash_table_free (hash);
-}
-
/* Assorted hash table functions. */
/* Initialize an entry in the stub hash table. */
@@ -255,7 +259,7 @@ elf32_m68hc11_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info)
text_section = 0;
for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next)
+ input_bfd = input_bfd->link.next)
{
bfd_count += 1;
for (section = input_bfd->sections;
@@ -343,7 +347,7 @@ elf32_m68hc11_size_stubs (bfd *output_bfd, bfd *stub_bfd,
/* Count the number of input BFDs and find the top input section id. */
for (input_bfd = info->input_bfds, bfd_count = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next)
+ input_bfd = input_bfd->link.next)
bfd_count += 1;
/* We want to read in symbol extension records only once. To do this
@@ -357,7 +361,7 @@ elf32_m68hc11_size_stubs (bfd *output_bfd, bfd *stub_bfd,
/* Walk over all the input BFDs, swapping in local symbols. */
for (input_bfd = info->input_bfds, bfd_indx = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next, bfd_indx++)
+ input_bfd = input_bfd->link.next, bfd_indx++)
{
Elf_Internal_Shdr *symtab_hdr;
@@ -387,7 +391,7 @@ elf32_m68hc11_size_stubs (bfd *output_bfd, bfd *stub_bfd,
for (input_bfd = info->input_bfds, bfd_indx = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next, bfd_indx++)
+ input_bfd = input_bfd->link.next, bfd_indx++)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
@@ -979,12 +983,12 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation, unresolved_reloc,
- warned);
+ warned, ignored);
is_far = (h && (h->other & STO_M68HC12_FAR));
is_xgate_symbol = (h && (h->target_internal));
diff --git a/binutils-2.25/bfd/elf32-m68hc1x.h b/binutils-2.25/bfd/elf32-m68hc1x.h
index 34b788e7..89ccd7fd 100644
--- a/binutils-2.25/bfd/elf32-m68hc1x.h
+++ b/binutils-2.25/bfd/elf32-m68hc1x.h
@@ -1,6 +1,5 @@
/* Motorola 68HC11/68HC12-specific support for 32-bit ELF
- Copyright 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2003-2014 Free Software Foundation, Inc.
Contributed by Stephane Carrez (stcarrez@nerim.fr)
This file is part of BFD, the Binary File Descriptor library.
@@ -137,7 +136,6 @@ struct m68hc11_elf_link_hash_table
extern struct m68hc11_elf_link_hash_table* m68hc11_elf_hash_table_create
(bfd*);
-extern void m68hc11_elf_bfd_link_hash_table_free (struct bfd_link_hash_table*);
extern void m68hc11_elf_get_bank_parameters (struct bfd_link_info*);
diff --git a/binutils-2.25/bfd/elf32-m68k.c b/binutils-2.25/bfd/elf32-m68k.c
index f266d63a..0058da44 100644
--- a/binutils-2.25/bfd/elf32-m68k.c
+++ b/binutils-2.25/bfd/elf32-m68k.c
@@ -1,7 +1,5 @@
/* Motorola 68k series support for 32-bit ELF
- Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -942,6 +940,23 @@ elf_m68k_link_hash_newfunc (struct bfd_hash_entry *entry,
return ret;
}
+/* Destroy an m68k ELF linker hash table. */
+
+static void
+elf_m68k_link_hash_table_free (bfd *obfd)
+{
+ struct elf_m68k_link_hash_table *htab;
+
+ htab = (struct elf_m68k_link_hash_table *) obfd->link.hash;
+
+ if (htab->multi_got_.bfd2got != NULL)
+ {
+ htab_delete (htab->multi_got_.bfd2got);
+ htab->multi_got_.bfd2got = NULL;
+ }
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
/* Create an m68k ELF linker hash table. */
static struct bfd_link_hash_table *
@@ -962,29 +977,13 @@ elf_m68k_link_hash_table_create (bfd *abfd)
free (ret);
return NULL;
}
+ ret->root.root.hash_table_free = elf_m68k_link_hash_table_free;
ret->multi_got_.global_symndx = 1;
return &ret->root.root;
}
-/* Destruct local data. */
-
-static void
-elf_m68k_link_hash_table_free (struct bfd_link_hash_table *_htab)
-{
- struct elf_m68k_link_hash_table *htab;
-
- htab = (struct elf_m68k_link_hash_table *) _htab;
-
- if (htab->multi_got_.bfd2got != NULL)
- {
- htab_delete (htab->multi_got_.bfd2got);
- htab->multi_got_.bfd2got = NULL;
- }
- _bfd_elf_link_hash_table_free (_htab);
-}
-
/* Set the right machine number. */
static bfd_boolean
@@ -3669,12 +3668,12 @@ elf_m68k_relocate_section (bfd *output_bfd,
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -4831,7 +4830,28 @@ elf_m68k_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
return TRUE;
}
-#define TARGET_BIG_SYM bfd_elf32_m68k_vec
+/* Hook called by the linker routine which adds symbols from an object
+ file. */
+
+static bfd_boolean
+elf_m68k_add_symbol_hook (bfd *abfd,
+ struct bfd_link_info *info,
+ Elf_Internal_Sym *sym,
+ const char **namep ATTRIBUTE_UNUSED,
+ flagword *flagsp ATTRIBUTE_UNUSED,
+ asection **secp ATTRIBUTE_UNUSED,
+ bfd_vma *valp ATTRIBUTE_UNUSED)
+{
+ if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
+ || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)
+ && (abfd->flags & DYNAMIC) == 0
+ && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
+ elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
+
+ return TRUE;
+}
+
+#define TARGET_BIG_SYM m68k_elf32_vec
#define TARGET_BIG_NAME "elf32-m68k"
#define ELF_MACHINE_CODE EM_68K
#define ELF_MAXPAGESIZE 0x2000
@@ -4839,9 +4859,6 @@ elf_m68k_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
_bfd_elf_create_dynamic_sections
#define bfd_elf32_bfd_link_hash_table_create \
elf_m68k_link_hash_table_create
-/* ??? Should it be this macro or bfd_elfNN_bfd_link_hash_table_create? */
-#define bfd_elf32_bfd_link_hash_table_free \
- elf_m68k_link_hash_table_free
#define bfd_elf32_bfd_final_link bfd_elf_final_link
#define elf_backend_check_relocs elf_m68k_check_relocs
@@ -4872,6 +4889,7 @@ elf_m68k_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
#define elf_backend_object_p elf32_m68k_object_p
#define elf_backend_grok_prstatus elf_m68k_grok_prstatus
#define elf_backend_grok_psinfo elf_m68k_grok_psinfo
+#define elf_backend_add_symbol_hook elf_m68k_add_symbol_hook
#define elf_backend_can_gc_sections 1
#define elf_backend_can_refcount 1
diff --git a/binutils-2.25/bfd/elf32-m88k.c b/binutils-2.25/bfd/elf32-m88k.c
index d6c02ffd..487cc0cc 100644
--- a/binutils-2.25/bfd/elf32-m88k.c
+++ b/binutils-2.25/bfd/elf32-m88k.c
@@ -1,5 +1,5 @@
/* Motorola 88k-specific support for 32-bit ELF
- Copyright 1993, 1995, 1999, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -26,7 +26,7 @@
/* This does not include any relocations, but should be good enough
for GDB. */
-#define TARGET_BIG_SYM bfd_elf32_m88k_vec
+#define TARGET_BIG_SYM m88k_elf32_vec
#define TARGET_BIG_NAME "elf32-m88k"
#define ELF_ARCH bfd_arch_m88k
#define ELF_MACHINE_CODE EM_88K
diff --git a/binutils-2.25/bfd/elf32-mcore.c b/binutils-2.25/bfd/elf32-mcore.c
index 28ee2c49..903d3796 100644
--- a/binutils-2.25/bfd/elf32-mcore.c
+++ b/binutils-2.25/bfd/elf32-mcore.c
@@ -1,6 +1,5 @@
/* Motorola MCore specific support for 32-bit ELF
- Copyright 1994, 1995, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -458,12 +457,12 @@ mcore_elf_relocate_section (bfd * output_bfd,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -649,9 +648,9 @@ static const struct bfd_elf_special_section mcore_elf_special_sections[]=
{ NULL, 0, 0, 0, 0 }
};
-#define TARGET_BIG_SYM bfd_elf32_mcore_big_vec
+#define TARGET_BIG_SYM mcore_elf32_be_vec
#define TARGET_BIG_NAME "elf32-mcore-big"
-#define TARGET_LITTLE_SYM bfd_elf32_mcore_little_vec
+#define TARGET_LITTLE_SYM mcore_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-mcore-little"
#define ELF_ARCH bfd_arch_mcore
diff --git a/binutils-2.25/bfd/elf32-mep.c b/binutils-2.25/bfd/elf32-mep.c
index f356fd06..548359f4 100644
--- a/binutils-2.25/bfd/elf32-mep.c
+++ b/binutils-2.25/bfd/elf32-mep.c
@@ -1,6 +1,5 @@
/* MeP-specific support for 32-bit ELF.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -490,12 +489,12 @@ mep_elf_relocate_section
}
else
{
- bfd_boolean warned, unresolved_reloc;
+ bfd_boolean warned, unresolved_reloc, ignored;
RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
name = h->root.root.string;
}
@@ -580,22 +579,6 @@ mep_elf_set_private_flags (bfd * abfd,
return TRUE;
}
-static bfd_boolean
-mep_elf_copy_private_bfd_data (bfd * ibfd, bfd * obfd)
-{
- if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
- || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
- return TRUE;
-
- elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
- elf_flags_init (obfd) = TRUE;
-
- /* Copy object attributes. */
- _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
- return TRUE;
-}
-
/* Merge backend specific data from an object file to the output
object file when linking. */
@@ -762,10 +745,10 @@ mep_elf_fake_sections (bfd * abfd ATTRIBUTE_UNUSED,
#define ELF_MACHINE_CODE EM_CYGNUS_MEP
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM bfd_elf32_mep_vec
+#define TARGET_BIG_SYM mep_elf32_vec
#define TARGET_BIG_NAME "elf32-mep"
-#define TARGET_LITTLE_SYM bfd_elf32_mep_little_vec
+#define TARGET_LITTLE_SYM mep_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-mep-little"
#define elf_info_to_howto_rel NULL
@@ -778,7 +761,6 @@ mep_elf_fake_sections (bfd * abfd ATTRIBUTE_UNUSED,
#define bfd_elf32_bfd_reloc_type_lookup mep_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup mep_reloc_name_lookup
#define bfd_elf32_bfd_set_private_flags mep_elf_set_private_flags
-#define bfd_elf32_bfd_copy_private_bfd_data mep_elf_copy_private_bfd_data
#define bfd_elf32_bfd_merge_private_bfd_data mep_elf_merge_private_bfd_data
#define bfd_elf32_bfd_print_private_bfd_data mep_elf_print_private_bfd_data
diff --git a/binutils-2.25/bfd/elf32-metag.c b/binutils-2.25/bfd/elf32-metag.c
index 88518453..47ca5deb 100644
--- a/binutils-2.25/bfd/elf32-metag.c
+++ b/binutils-2.25/bfd/elf32-metag.c
@@ -1,5 +1,5 @@
/* Meta support for 32-bit ELF
- Copyright (C) 2013 Free Software Foundation, Inc.
+ Copyright (C) 2013-2014 Free Software Foundation, Inc.
Contributed by Imagination Technologies Ltd.
This file is part of BFD, the Binary File Descriptor library.
@@ -1017,6 +1017,18 @@ metag_link_hash_newfunc (struct bfd_hash_entry *entry,
return entry;
}
+/* Free the derived linker hash table. */
+
+static void
+elf_metag_link_hash_table_free (bfd *obfd)
+{
+ struct elf_metag_link_hash_table *htab
+ = (struct elf_metag_link_hash_table *) obfd->link.hash;
+
+ bfd_hash_table_free (&htab->bstab);
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
/* Create the derived linker hash table. The Meta ELF port uses the derived
hash table to keep information specific to the Meta ELF linker (without
using static variables). */
@@ -1043,23 +1055,15 @@ elf_metag_link_hash_table_create (bfd *abfd)
/* Init the stub hash table too. */
if (!bfd_hash_table_init (&htab->bstab, stub_hash_newfunc,
sizeof (struct elf_metag_stub_hash_entry)))
- return NULL;
+ {
+ _bfd_elf_link_hash_table_free (abfd);
+ return NULL;
+ }
+ htab->etab.root.hash_table_free = elf_metag_link_hash_table_free;
return &htab->etab.root;
}
-/* Free the derived linker hash table. */
-
-static void
-elf_metag_link_hash_table_free (struct bfd_link_hash_table *btab)
-{
- struct elf_metag_link_hash_table *htab
- = (struct elf_metag_link_hash_table *) btab;
-
- bfd_hash_table_free (&htab->bstab);
- _bfd_elf_link_hash_table_free (btab);
-}
-
/* Section name for stubs is the associated section name plus this
string. */
#define STUB_SUFFIX ".stub"
@@ -1536,12 +1540,12 @@ elf_metag_relocate_section (bfd *output_bfd,
else
{
struct elf_link_hash_entry *eh;
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, eh_syms,
eh, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
name = eh->root.root.string;
hh = (struct elf_metag_link_hash_entry *) eh;
@@ -2847,7 +2851,7 @@ elf_metag_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -3249,10 +3253,11 @@ elf_metag_finish_dynamic_symbol (bfd *output_bfd,
/* Set the Meta ELF ABI version. */
static void
-elf_metag_post_process_headers (bfd * abfd, struct bfd_link_info * link_info ATTRIBUTE_UNUSED)
+elf_metag_post_process_headers (bfd * abfd, struct bfd_link_info * link_info)
{
Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */
+ _bfd_elf_post_process_headers (abfd, link_info);
i_ehdrp = elf_elfheader (abfd);
i_ehdrp->e_ident[EI_ABIVERSION] = METAG_ELF_ABI_VERSION;
}
@@ -3724,7 +3729,7 @@ elf_metag_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info)
/* Count the number of input BFDs and find the top input section id. */
for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next)
+ input_bfd = input_bfd->link.next)
{
bfd_count += 1;
for (section = input_bfd->sections;
@@ -3906,7 +3911,7 @@ get_local_syms (bfd *output_bfd ATTRIBUTE_UNUSED, bfd *input_bfd,
/* Walk over all the input BFDs, swapping in local symbols. */
for (bfd_indx = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next, bfd_indx++)
+ input_bfd = input_bfd->link.next, bfd_indx++)
{
Elf_Internal_Shdr *symtab_hdr;
@@ -4003,7 +4008,7 @@ elf_metag_size_stubs(bfd *output_bfd, bfd *stub_bfd,
for (input_bfd = info->input_bfds, bfd_indx = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next, bfd_indx++)
+ input_bfd = input_bfd->link.next, bfd_indx++)
{
Elf_Internal_Shdr *symtab_hdr;
asection *section;
@@ -4283,7 +4288,7 @@ elf_metag_plt_sym_val (bfd_vma i, const asection *plt,
#define ELF_MAXPAGESIZE 0x4000
#define ELF_COMMONPAGESIZE 0x1000
-#define TARGET_LITTLE_SYM bfd_elf32_metag_vec
+#define TARGET_LITTLE_SYM metag_elf32_vec
#define TARGET_LITTLE_NAME "elf32-metag"
#define elf_symbol_leading_char '_'
@@ -4294,7 +4299,6 @@ elf_metag_plt_sym_val (bfd_vma i, const asection *plt,
#define bfd_elf32_bfd_is_local_label_name elf_metag_is_local_label_name
#define bfd_elf32_bfd_link_hash_table_create \
elf_metag_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free elf_metag_link_hash_table_free
#define elf_backend_relocate_section elf_metag_relocate_section
#define elf_backend_gc_mark_hook elf_metag_gc_mark_hook
#define elf_backend_gc_sweep_hook elf_metag_gc_sweep_hook
diff --git a/binutils-2.25/bfd/elf32-metag.h b/binutils-2.25/bfd/elf32-metag.h
index 46772e01..57f9e951 100644
--- a/binutils-2.25/bfd/elf32-metag.h
+++ b/binutils-2.25/bfd/elf32-metag.h
@@ -1,5 +1,5 @@
/* Meta support for 32-bit ELF
- Copyright (C) 2013 Free Software Foundation, Inc.
+ Copyright (C) 2013-2014 Free Software Foundation, Inc.
Contributed by Imagination Technologies Ltd.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf32-microblaze.c b/binutils-2.25/bfd/elf32-microblaze.c
index 4a5e80dd..a4cc6a3f 100644
--- a/binutils-2.25/bfd/elf32-microblaze.c
+++ b/binutils-2.25/bfd/elf32-microblaze.c
@@ -1,6 +1,6 @@
/* Xilinx MicroBlaze-specific support for 32-bit ELF
- Copyright 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -1023,11 +1023,12 @@ microblaze_elf_relocate_section (bfd *output_bfd,
{
/* External symbol. */
bfd_boolean warned ATTRIBUTE_UNUSED;
+ bfd_boolean ignored ATTRIBUTE_UNUSED;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
sym_name = h->root.root.string;
}
@@ -2972,7 +2973,7 @@ microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -3465,10 +3466,10 @@ microblaze_elf_add_symbol_hook (bfd *abfd,
return TRUE;
}
-#define TARGET_LITTLE_SYM bfd_elf32_microblazeel_vec
+#define TARGET_LITTLE_SYM microblaze_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-microblazeel"
-#define TARGET_BIG_SYM bfd_elf32_microblaze_vec
+#define TARGET_BIG_SYM microblaze_elf32_vec
#define TARGET_BIG_NAME "elf32-microblaze"
#define ELF_ARCH bfd_arch_microblaze
diff --git a/binutils-2.25/bfd/elf32-mips.c b/binutils-2.25/bfd/elf32-mips.c
index eec2ef7f..4cfef7a2 100644
--- a/binutils-2.25/bfd/elf32-mips.c
+++ b/binutils-2.25/bfd/elf32-mips.c
@@ -1,6 +1,5 @@
/* MIPS-specific support for 32-bit ELF
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Most of the information added by Ian Lance Taylor, Cygnus Support,
<ian@cygnus.com>.
@@ -83,8 +82,8 @@ static bfd_boolean elf32_mips_grok_psinfo
static irix_compat_t elf32_mips_irix_compat
(bfd *);
-extern const bfd_target bfd_elf32_bigmips_vec;
-extern const bfd_target bfd_elf32_littlemips_vec;
+extern const bfd_target mips_elf32_be_vec;
+extern const bfd_target mips_elf32_le_vec;
/* Nonzero if ABFD is using the N32 ABI. */
#define ABI_N32_P(abfd) \
@@ -717,6 +716,99 @@ static reloc_howto_type elf_mips_howto_table_rel[] =
0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
+
+ EMPTY_HOWTO (52),
+ EMPTY_HOWTO (53),
+ EMPTY_HOWTO (54),
+ EMPTY_HOWTO (55),
+ EMPTY_HOWTO (56),
+ EMPTY_HOWTO (57),
+ EMPTY_HOWTO (58),
+ EMPTY_HOWTO (59),
+
+ HOWTO (R_MIPS_PC21_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 21, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC21_S2", /* name */
+ TRUE, /* partial_inplace */
+ 0x001fffff, /* src_mask */
+ 0x001fffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC26_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC26_S2", /* name */
+ TRUE, /* partial_inplace */
+ 0x03ffffff, /* src_mask */
+ 0x03ffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC18_S3, /* type */
+ 3, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 18, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC18_S3", /* name */
+ TRUE, /* partial_inplace */
+ 0x0003ffff, /* src_mask */
+ 0x0003ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC19_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 19, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC19_S2", /* name */
+ TRUE, /* partial_inplace */
+ 0x0007ffff, /* src_mask */
+ 0x0007ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PCHI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PCHI16", /* name */
+ TRUE, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PCLO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PCLO16", /* name */
+ TRUE, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
};
/* The reloc used for BFD_RELOC_CTOR when doing a 64 bit link. This
@@ -1906,7 +1998,13 @@ static const struct elf_reloc_map mips_reloc_map[] =
{ BFD_RELOC_MIPS_TLS_TPREL32, R_MIPS_TLS_TPREL32 },
{ BFD_RELOC_MIPS_TLS_TPREL64, R_MIPS_TLS_TPREL64 },
{ BFD_RELOC_MIPS_TLS_TPREL_HI16, R_MIPS_TLS_TPREL_HI16 },
- { BFD_RELOC_MIPS_TLS_TPREL_LO16, R_MIPS_TLS_TPREL_LO16 }
+ { BFD_RELOC_MIPS_TLS_TPREL_LO16, R_MIPS_TLS_TPREL_LO16 },
+ { BFD_RELOC_MIPS_21_PCREL_S2, R_MIPS_PC21_S2 },
+ { BFD_RELOC_MIPS_26_PCREL_S2, R_MIPS_PC26_S2 },
+ { BFD_RELOC_MIPS_18_PCREL_S3, R_MIPS_PC18_S3 },
+ { BFD_RELOC_MIPS_19_PCREL_S2, R_MIPS_PC19_S2 },
+ { BFD_RELOC_HI16_S_PCREL, R_MIPS_PCHI16 },
+ { BFD_RELOC_LO16_PCREL, R_MIPS_PCLO16 }
};
static const struct elf_reloc_map mips16_reloc_map[] =
@@ -2260,8 +2358,8 @@ elf32_mips_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
static irix_compat_t
elf32_mips_irix_compat (bfd *abfd)
{
- if ((abfd->xvec == &bfd_elf32_bigmips_vec)
- || (abfd->xvec == &bfd_elf32_littlemips_vec))
+ if ((abfd->xvec == &mips_elf32_be_vec)
+ || (abfd->xvec == &mips_elf32_le_vec))
return ict_irix5;
else
return ict_none;
@@ -2316,6 +2414,8 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
#define elf_backend_collect TRUE
#define elf_backend_type_change_ok TRUE
#define elf_backend_can_gc_sections TRUE
+#define elf_backend_gc_mark_extra_sections \
+ _bfd_mips_elf_gc_mark_extra_sections
#define elf_info_to_howto mips_info_to_howto_rela
#define elf_info_to_howto_rel mips_info_to_howto_rel
#define elf_backend_sym_is_global mips_elf_sym_is_global
@@ -2396,9 +2496,9 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
#define bfd_elf32_mkobject _bfd_mips_elf_mkobject
/* Support for SGI-ish mips targets. */
-#define TARGET_LITTLE_SYM bfd_elf32_littlemips_vec
+#define TARGET_LITTLE_SYM mips_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-littlemips"
-#define TARGET_BIG_SYM bfd_elf32_bigmips_vec
+#define TARGET_BIG_SYM mips_elf32_be_vec
#define TARGET_BIG_NAME "elf32-bigmips"
/* The SVR4 MIPS ABI says that this should be 0x10000, but Irix 5 uses
@@ -2417,9 +2517,9 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
#undef ELF_MAXPAGESIZE
#undef ELF_COMMONPAGESIZE
-#define TARGET_LITTLE_SYM bfd_elf32_tradlittlemips_vec
+#define TARGET_LITTLE_SYM mips_elf32_trad_le_vec
#define TARGET_LITTLE_NAME "elf32-tradlittlemips"
-#define TARGET_BIG_SYM bfd_elf32_tradbigmips_vec
+#define TARGET_BIG_SYM mips_elf32_trad_be_vec
#define TARGET_BIG_NAME "elf32-tradbigmips"
/* The MIPS ABI says at Page 5-1:
@@ -2441,26 +2541,14 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
#undef TARGET_BIG_SYM
#undef TARGET_BIG_NAME
-#define TARGET_LITTLE_SYM bfd_elf32_tradlittlemips_freebsd_vec
+#define TARGET_LITTLE_SYM mips_elf32_tradfbsd_le_vec
#define TARGET_LITTLE_NAME "elf32-tradlittlemips-freebsd"
-#define TARGET_BIG_SYM bfd_elf32_tradbigmips_freebsd_vec
+#define TARGET_BIG_SYM mips_elf32_tradfbsd_be_vec
#define TARGET_BIG_NAME "elf32-tradbigmips-freebsd"
#undef ELF_OSABI
#define ELF_OSABI ELFOSABI_FREEBSD
-/* The kernel recognizes executables as valid only if they carry a
- "FreeBSD" label in the ELF header. So we put this label on all
- executables and (for simplicity) also all other object files. */
-
-static void
-elf_fbsd_post_process_headers (bfd *abfd, struct bfd_link_info *info)
-{
- _bfd_elf_set_osabi (abfd, info);
-}
-
-#undef elf_backend_post_process_headers
-#define elf_backend_post_process_headers elf_fbsd_post_process_headers
#undef elf32_bed
#define elf32_bed elf32_fbsd_tradbed
@@ -2482,9 +2570,9 @@ mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
#undef ELF_MAXPAGESIZE
#undef ELF_COMMONPAGESIZE
-#define TARGET_LITTLE_SYM bfd_elf32_littlemips_vxworks_vec
+#define TARGET_LITTLE_SYM mips_elf32_vxworks_le_vec
#define TARGET_LITTLE_NAME "elf32-littlemips-vxworks"
-#define TARGET_BIG_SYM bfd_elf32_bigmips_vxworks_vec
+#define TARGET_BIG_SYM mips_elf32_vxworks_be_vec
#define TARGET_BIG_NAME "elf32-bigmips-vxworks"
#undef ELF_OSABI
diff --git a/binutils-2.25/bfd/elf32-moxie.c b/binutils-2.25/bfd/elf32-moxie.c
index d0cbb0fa..1f685b9c 100644
--- a/binutils-2.25/bfd/elf32-moxie.c
+++ b/binutils-2.25/bfd/elf32-moxie.c
@@ -1,9 +1,8 @@
/* moxie-specific support for 32-bit ELF.
- Copyright 2009, 2010, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
Copied from elf32-fr30.c which is..
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -240,12 +239,12 @@ moxie_elf_relocate_section (bfd *output_bfd,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
name = h->root.root.string;
}
@@ -370,9 +369,9 @@ moxie_elf_check_relocs (bfd *abfd,
#define ELF_MACHINE_CODE EM_MOXIE
#define ELF_MAXPAGESIZE 0x1
-#define TARGET_BIG_SYM bfd_elf32_bigmoxie_vec
+#define TARGET_BIG_SYM moxie_elf32_be_vec
#define TARGET_BIG_NAME "elf32-bigmoxie"
-#define TARGET_LITTLE_SYM bfd_elf32_littlemoxie_vec
+#define TARGET_LITTLE_SYM moxie_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-littlemoxie"
#define elf_info_to_howto_rel NULL
diff --git a/binutils-2.25/bfd/elf32-msp430.c b/binutils-2.25/bfd/elf32-msp430.c
index 2f7a3dad..2f55c538 100644
--- a/binutils-2.25/bfd/elf32-msp430.c
+++ b/binutils-2.25/bfd/elf32-msp430.c
@@ -1,5 +1,5 @@
/* MSP430-specific support for 32-bit ELF
- Copyright (C) 2002-2013 Free Software Foundation, Inc.
+ Copyright (C) 2002-2014 Free Software Foundation, Inc.
Contributed by Dmitry Diky <diwil@mail.ru>
This file is part of BFD, the Binary File Descriptor library.
@@ -549,10 +549,10 @@ static const struct msp430_reloc_map msp430x_reloc_map[] =
static inline bfd_boolean
uses_msp430x_relocs (bfd * abfd)
{
- extern const bfd_target bfd_elf32_msp430_ti_vec;
+ extern const bfd_target msp430_elf32_ti_vec;
return bfd_get_mach (abfd) == bfd_mach_msp430x
- || abfd->xvec == & bfd_elf32_msp430_ti_vec;
+ || abfd->xvec == & msp430_elf32_ti_vec;
}
static reloc_howto_type *
@@ -1276,12 +1276,12 @@ elf32_msp430_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
name = h->root.root.string;
}
@@ -1582,14 +1582,15 @@ msp430_elf_relax_adjust_locals (bfd * abfd, asection * sec, bfd_vma addr,
irelend = irel + sec->reloc_count;
symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
isym = (Elf_Internal_Sym *) symtab_hdr->contents;
-
+
for (;irel < irelend; irel++)
{
- int sidx = ELF32_R_SYM(irel->r_info);
+ unsigned int sidx = ELF32_R_SYM(irel->r_info);
Elf_Internal_Sym *lsym = isym + sidx;
-
+
/* Adjust symbols referenced by .sec+0xXX */
- if (irel->r_addend > addr && irel->r_addend < toaddr
+ if (irel->r_addend > addr && irel->r_addend < toaddr
+ && sidx < symtab_hdr->sh_info
&& lsym->st_shndx == sec_shndx)
irel->r_addend -= count;
}
@@ -2392,17 +2393,6 @@ elf32_msp430_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
return elf32_msp430_merge_mspabi_attributes (ibfd, obfd);
}
-/* Copy backend specific data from one object module to another. */
-
-static bfd_boolean
-elf32_msp430_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
-{
- /* Copy object attributes. */
- _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
- return TRUE;
-}
-
static bfd_boolean
msp430_elf_is_target_special_symbol (bfd *abfd, asymbol *sym)
{
@@ -2439,7 +2429,6 @@ msp430_elf_is_target_special_symbol (bfd *abfd, asymbol *sym)
#define elf_backend_obj_attrs_handle_unknown elf32_msp430_obj_attrs_handle_unknown
#undef elf_backend_obj_attrs_arg_type
#define elf_backend_obj_attrs_arg_type elf32_msp430_obj_attrs_arg_type
-#define bfd_elf32_bfd_copy_private_bfd_data elf32_msp430_copy_private_bfd_data
#define bfd_elf32_bfd_merge_private_bfd_data elf32_msp430_merge_private_bfd_data
#define ELF_ARCH bfd_arch_msp430
@@ -2448,7 +2437,7 @@ msp430_elf_is_target_special_symbol (bfd *abfd, asymbol *sym)
#define ELF_MAXPAGESIZE 4
#define ELF_OSABI ELFOSABI_STANDALONE
-#define TARGET_LITTLE_SYM bfd_elf32_msp430_vec
+#define TARGET_LITTLE_SYM msp430_elf32_vec
#define TARGET_LITTLE_NAME "elf32-msp430"
#define elf_info_to_howto msp430_info_to_howto_rela
@@ -2458,7 +2447,6 @@ msp430_elf_is_target_special_symbol (bfd *abfd, asymbol *sym)
#define elf_backend_can_gc_sections 1
#define elf_backend_final_write_processing bfd_elf_msp430_final_write_processing
#define elf_backend_object_p elf32_msp430_object_p
-#define elf_backend_post_process_headers _bfd_elf_set_osabi
#define bfd_elf32_bfd_relax_section msp430_elf_relax_section
#define bfd_elf32_bfd_is_target_special_symbol msp430_elf_is_target_special_symbol
@@ -2469,7 +2457,7 @@ msp430_elf_is_target_special_symbol (bfd *abfd, asymbol *sym)
/* The TI compiler sets the OSABI field to ELFOSABI_NONE. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_msp430_ti_vec
+#define TARGET_LITTLE_SYM msp430_elf32_ti_vec
#undef elf32_bed
#define elf32_bed elf32_msp430_ti_bed
diff --git a/binutils-2.25/bfd/elf32-mt.c b/binutils-2.25/bfd/elf32-mt.c
index ea05c911..6df1521e 100644
--- a/binutils-2.25/bfd/elf32-mt.c
+++ b/binutils-2.25/bfd/elf32-mt.c
@@ -1,6 +1,5 @@
/* Morpho Technologies MT specific support for 32-bit ELF
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -344,12 +343,12 @@ mt_elf_relocate_section
else
{
bfd_boolean unresolved_reloc;
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
name = h->root.root.string;
}
@@ -497,25 +496,6 @@ mt_elf_set_private_flags (bfd * abfd,
return TRUE;
}
-static bfd_boolean
-mt_elf_copy_private_bfd_data (bfd * ibfd, bfd * obfd)
-{
- if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
- || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
- return TRUE;
-
- BFD_ASSERT (!elf_flags_init (obfd)
- || elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags);
-
- elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
- elf_flags_init (obfd) = TRUE;
-
- /* Copy object attributes. */
- _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
- return TRUE;
-}
-
/* Merge backend specific data from an object file to the output
object file when linking. */
@@ -593,7 +573,7 @@ mt_elf_print_private_bfd_data (bfd * abfd, void * ptr)
}
-#define TARGET_BIG_SYM bfd_elf32_mt_vec
+#define TARGET_BIG_SYM mt_elf32_vec
#define TARGET_BIG_NAME "elf32-mt"
#define ELF_ARCH bfd_arch_mt
@@ -615,7 +595,6 @@ mt_elf_print_private_bfd_data (bfd * abfd, void * ptr)
#define elf_backend_can_gc_sections 1
#define bfd_elf32_bfd_set_private_flags mt_elf_set_private_flags
-#define bfd_elf32_bfd_copy_private_bfd_data mt_elf_copy_private_bfd_data
#define bfd_elf32_bfd_merge_private_bfd_data mt_elf_merge_private_bfd_data
#define bfd_elf32_bfd_print_private_bfd_data mt_elf_print_private_bfd_data
diff --git a/binutils-2.25/bfd/elf32-nds32.c b/binutils-2.25/bfd/elf32-nds32.c
new file mode 100644
index 00000000..2b63024c
--- /dev/null
+++ b/binutils-2.25/bfd/elf32-nds32.c
@@ -0,0 +1,15722 @@
+/* NDS32-specific support for 32-bit ELF.
+ Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ Contributed by Andes Technology Corporation.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ 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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+
+#include "sysdep.h"
+#include "bfd.h"
+#include "bfd_stdint.h"
+#include "bfdlink.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "libiberty.h"
+#include "bfd_stdint.h"
+#include "elf/nds32.h"
+#include "opcode/nds32.h"
+#include "elf32-nds32.h"
+#include "opcode/cgen.h"
+#include "../opcodes/nds32-opc.h"
+
+/* Relocation HOWTO functions. */
+static bfd_reloc_status_type nds32_elf_ignore_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+static bfd_reloc_status_type nds32_elf_9_pcrel_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+static bfd_reloc_status_type nds32_elf_hi20_reloc
+ (bfd *, arelent *, asymbol *, void *,
+ asection *, bfd *, char **);
+static bfd_reloc_status_type nds32_elf_lo12_reloc
+ (bfd *, arelent *, asymbol *, void *,
+ asection *, bfd *, char **);
+static bfd_reloc_status_type nds32_elf_generic_reloc
+ (bfd *, arelent *, asymbol *, void *,
+ asection *, bfd *, char **);
+static bfd_reloc_status_type nds32_elf_sda15_reloc
+ (bfd *, arelent *, asymbol *, void *,
+ asection *, bfd *, char **);
+
+/* Helper functions for HOWTO. */
+static bfd_reloc_status_type nds32_elf_do_9_pcrel_reloc
+ (bfd *, reloc_howto_type *, asection *, bfd_byte *, bfd_vma,
+ asection *, bfd_vma, bfd_vma);
+static void nds32_elf_relocate_hi20
+ (bfd *, int, Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_byte *, bfd_vma);
+static reloc_howto_type *bfd_elf32_bfd_reloc_type_table_lookup
+ (enum elf_nds32_reloc_type);
+static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
+ (bfd *, bfd_reloc_code_real_type);
+
+/* Target hooks. */
+static void nds32_info_to_howto_rel
+ (bfd *, arelent *, Elf_Internal_Rela *dst);
+static void nds32_info_to_howto
+ (bfd *, arelent *, Elf_Internal_Rela *dst);
+static bfd_boolean nds32_elf_add_symbol_hook
+ (bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **,
+ flagword *, asection **, bfd_vma *);
+static bfd_boolean nds32_elf_relocate_section
+ (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+ Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
+static bfd_boolean nds32_elf_object_p (bfd *);
+static void nds32_elf_final_write_processing (bfd *, bfd_boolean);
+static bfd_boolean nds32_elf_set_private_flags (bfd *, flagword);
+static bfd_boolean nds32_elf_merge_private_bfd_data (bfd *, bfd *);
+static bfd_boolean nds32_elf_print_private_bfd_data (bfd *, void *);
+static bfd_boolean nds32_elf_gc_sweep_hook
+ (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
+static bfd_boolean nds32_elf_check_relocs
+ (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
+static asection *nds32_elf_gc_mark_hook
+ (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
+ struct elf_link_hash_entry *, Elf_Internal_Sym *);
+static bfd_boolean nds32_elf_adjust_dynamic_symbol
+ (struct bfd_link_info *, struct elf_link_hash_entry *);
+static bfd_boolean nds32_elf_size_dynamic_sections
+ (bfd *, struct bfd_link_info *);
+static bfd_boolean nds32_elf_create_dynamic_sections
+ (bfd *, struct bfd_link_info *);
+static bfd_boolean nds32_elf_finish_dynamic_sections
+ (bfd *, struct bfd_link_info *info);
+static bfd_boolean nds32_elf_finish_dynamic_symbol
+ (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
+ Elf_Internal_Sym *);
+static bfd_boolean nds32_elf_mkobject (bfd *);
+
+/* Nds32 helper functions. */
+static bfd_reloc_status_type nds32_elf_final_sda_base
+ (bfd *, struct bfd_link_info *, bfd_vma *, bfd_boolean);
+static bfd_boolean allocate_dynrelocs (struct elf_link_hash_entry *, void *);
+static bfd_boolean readonly_dynrelocs (struct elf_link_hash_entry *, void *);
+static Elf_Internal_Rela *find_relocs_at_address
+ (Elf_Internal_Rela *, Elf_Internal_Rela *,
+ Elf_Internal_Rela *, enum elf_nds32_reloc_type);
+static bfd_vma calculate_memory_address
+ (bfd *, Elf_Internal_Rela *, Elf_Internal_Sym *, Elf_Internal_Shdr *);
+static int nds32_get_section_contents (bfd *, asection *, bfd_byte **);
+static bfd_boolean nds32_elf_ex9_build_hash_table
+ (bfd *, asection *, struct bfd_link_info *);
+static bfd_boolean nds32_elf_ex9_itb_base (struct bfd_link_info *);
+static void nds32_elf_ex9_import_table (struct bfd_link_info *);
+static void nds32_elf_ex9_finish (struct bfd_link_info *);
+static void nds32_elf_ex9_reloc_jmp (struct bfd_link_info *);
+static void nds32_elf_get_insn_with_reg
+ (Elf_Internal_Rela *, uint32_t, uint32_t *);
+static int nds32_get_local_syms (bfd *, asection *ATTRIBUTE_UNUSED,
+ Elf_Internal_Sym **);
+static bfd_boolean nds32_elf_ex9_replace_instruction
+ (struct bfd_link_info *, bfd *, asection *);
+static bfd_boolean nds32_elf_ifc_calc (struct bfd_link_info *, bfd *,
+ asection *);
+static bfd_boolean nds32_elf_ifc_finish (struct bfd_link_info *);
+static bfd_boolean nds32_elf_ifc_replace (struct bfd_link_info *);
+static bfd_boolean nds32_elf_ifc_reloc (void);
+static bfd_boolean nds32_relax_fp_as_gp
+ (struct bfd_link_info *link_info, bfd *abfd, asection *sec,
+ Elf_Internal_Rela *internal_relocs, Elf_Internal_Rela *irelend,
+ Elf_Internal_Sym *isymbuf);
+static bfd_boolean nds32_fag_remove_unused_fpbase
+ (bfd *abfd, asection *sec, Elf_Internal_Rela *internal_relocs,
+ Elf_Internal_Rela *irelend);
+static bfd_byte *
+nds32_elf_get_relocated_section_contents (bfd *abfd,
+ struct bfd_link_info *link_info,
+ struct bfd_link_order *link_order,
+ bfd_byte *data,
+ bfd_boolean relocatable,
+ asymbol **symbols);
+
+enum
+{
+ MACH_V1 = bfd_mach_n1h,
+ MACH_V2 = bfd_mach_n1h_v2,
+ MACH_V3 = bfd_mach_n1h_v3,
+ MACH_V3M = bfd_mach_n1h_v3m
+};
+
+#define MIN(a, b) ((a) > (b) ? (b) : (a))
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+
+/* The name of the dynamic interpreter. This is put in the .interp
+ section. */
+#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
+
+/* The nop opcode we use. */
+#define NDS32_NOP32 0x40000009
+#define NDS32_NOP16 0x9200
+
+/* The size in bytes of an entry in the procedure linkage table. */
+#define PLT_ENTRY_SIZE 24
+#define PLT_HEADER_SIZE 24
+
+/* The first entry in a procedure linkage table are reserved,
+ and the initial contents are unimportant (we zero them out).
+ Subsequent entries look like this. */
+#define PLT0_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(.got+4) */
+#define PLT0_ENTRY_WORD1 0x58f78000 /* ori r15, r25, LO12(.got+4) */
+#define PLT0_ENTRY_WORD2 0x05178000 /* lwi r17, [r15+0] */
+#define PLT0_ENTRY_WORD3 0x04f78001 /* lwi r15, [r15+4] */
+#define PLT0_ENTRY_WORD4 0x4a003c00 /* jr r15 */
+
+/* $ta is change to $r15 (from $r25). */
+#define PLT0_PIC_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(got[1]@GOT) */
+#define PLT0_PIC_ENTRY_WORD1 0x58f78000 /* ori r15, r15, LO12(got[1]@GOT) */
+#define PLT0_PIC_ENTRY_WORD2 0x40f7f400 /* add r15, gp, r15 */
+#define PLT0_PIC_ENTRY_WORD3 0x05178000 /* lwi r17, [r15+0] */
+#define PLT0_PIC_ENTRY_WORD4 0x04f78001 /* lwi r15, [r15+4] */
+#define PLT0_PIC_ENTRY_WORD5 0x4a003c00 /* jr r15 */
+
+#define PLT_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(&got[n+3]) */
+#define PLT_ENTRY_WORD1 0x04f78000 /* lwi r15, r15, LO12(&got[n+3]) */
+#define PLT_ENTRY_WORD2 0x4a003c00 /* jr r15 */
+#define PLT_ENTRY_WORD3 0x45000000 /* movi r16, sizeof(RELA) * n */
+#define PLT_ENTRY_WORD4 0x48000000 /* j .plt0. */
+
+#define PLT_PIC_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(got[n+3]@GOT) */
+#define PLT_PIC_ENTRY_WORD1 0x58f78000 /* ori r15, r15, LO12(got[n+3]@GOT) */
+#define PLT_PIC_ENTRY_WORD2 0x38febc02 /* lw r15, [gp+r15] */
+#define PLT_PIC_ENTRY_WORD3 0x4a003c00 /* jr r15 */
+#define PLT_PIC_ENTRY_WORD4 0x45000000 /* movi r16, sizeof(RELA) * n */
+#define PLT_PIC_ENTRY_WORD5 0x48000000 /* j .plt0 */
+
+/* These are macros used to get the relocation accurate value. */
+#define ACCURATE_8BIT_S1 (0x100)
+#define ACCURATE_U9BIT_S1 (0x400)
+#define ACCURATE_12BIT_S1 (0x2000)
+#define ACCURATE_14BIT_S1 (0x4000)
+#define ACCURATE_19BIT (0x40000)
+
+/* These are macros used to get the relocation conservative value. */
+#define CONSERVATIVE_8BIT_S1 (0x100 - 4)
+#define CONSERVATIVE_14BIT_S1 (0x4000 - 4)
+#define CONSERVATIVE_16BIT_S1 (0x10000 - 4)
+#define CONSERVATIVE_24BIT_S1 (0x1000000 - 4)
+/* These must be more conservative because the address may be in
+ different segment. */
+#define CONSERVATIVE_15BIT (0x4000 - 0x1000)
+#define CONSERVATIVE_15BIT_S1 (0x8000 - 0x1000)
+#define CONSERVATIVE_15BIT_S2 (0x10000 - 0x1000)
+#define CONSERVATIVE_19BIT (0x40000 - 0x1000)
+#define CONSERVATIVE_20BIT (0x80000 - 0x1000)
+
+/* Size of small data/bss sections, used to calculate SDA_BASE. */
+static long got_size = 0;
+static int is_SDA_BASE_set = 0;
+static int is_ITB_BASE_set = 0;
+
+/* Convert ELF-VER in eflags to string for debugging purpose. */
+static const char *const nds32_elfver_strtab[] =
+{
+ "ELF-1.2",
+ "ELF-1.3",
+ "ELF-1.4",
+};
+
+/* The nds32 linker needs to keep track of the number of relocs that it
+ decides to copy in check_relocs for each symbol. This is so that
+ it can discard PC relative relocs if it doesn't need them when
+ linking with -Bsymbolic. We store the information in a field
+ extending the regular ELF linker hash table. */
+
+/* This structure keeps track of the number of PC relative relocs we
+ have copied for a given symbol. */
+
+struct elf_nds32_pcrel_relocs_copied
+{
+ /* Next section. */
+ struct elf_nds32_pcrel_relocs_copied *next;
+ /* A section in dynobj. */
+ asection *section;
+ /* Number of relocs copied in this section. */
+ bfd_size_type count;
+};
+
+/* The sh linker needs to keep track of the number of relocs that it
+ decides to copy as dynamic relocs in check_relocs for each symbol.
+ This is so that it can later discard them if they are found to be
+ unnecessary. We store the information in a field extending the
+ regular ELF linker hash table. */
+
+struct elf_nds32_dyn_relocs
+{
+ struct elf_nds32_dyn_relocs *next;
+
+ /* The input section of the reloc. */
+ asection *sec;
+
+ /* Total number of relocs copied for the input section. */
+ bfd_size_type count;
+
+ /* Number of pc-relative relocs copied for the input section. */
+ bfd_size_type pc_count;
+};
+
+/* Nds32 ELF linker hash entry. */
+
+struct elf_nds32_link_hash_entry
+{
+ struct elf_link_hash_entry root;
+
+ /* Track dynamic relocs copied for this symbol. */
+ struct elf_nds32_dyn_relocs *dyn_relocs;
+
+ /* For checking relocation type. */
+#define GOT_UNKNOWN 0
+#define GOT_NORMAL 1
+#define GOT_TLS_IE 2
+ unsigned int tls_type;
+};
+
+/* Get the nds32 ELF linker hash table from a link_info structure. */
+
+#define FP_BASE_NAME "_FP_BASE_"
+static int check_start_export_sym = 0;
+static size_t ex9_relax_size = 0; /* Save ex9 predicted reducing size. */
+
+/* The offset for executable tls relaxation. */
+#define TP_OFFSET 0x0
+
+struct elf_nds32_obj_tdata
+{
+ struct elf_obj_tdata root;
+
+ /* tls_type for each local got entry. */
+ char *local_got_tls_type;
+};
+
+#define elf_nds32_tdata(bfd) \
+ ((struct elf_nds32_obj_tdata *) (bfd)->tdata.any)
+
+#define elf32_nds32_local_got_tls_type(bfd) \
+ (elf_nds32_tdata (bfd)->local_got_tls_type)
+
+#define elf32_nds32_hash_entry(ent) ((struct elf_nds32_link_hash_entry *)(ent))
+
+static bfd_boolean
+nds32_elf_mkobject (bfd *abfd)
+{
+ return bfd_elf_allocate_object (abfd, sizeof (struct elf_nds32_obj_tdata),
+ NDS32_ELF_DATA);
+}
+
+/* Relocations used for relocation. */
+static reloc_howto_type nds32_elf_howto_table[] =
+{
+ /* This reloc does nothing. */
+ HOWTO (R_NDS32_NONE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_NONE", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* A 16 bit absolute relocation. */
+ HOWTO (R_NDS32_16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ nds32_elf_generic_reloc, /* special_function */
+ "R_NDS32_16", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* A 32 bit absolute relocation. */
+ HOWTO (R_NDS32_32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ nds32_elf_generic_reloc, /* special_function */
+ "R_NDS32_32", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* A 20 bit address. */
+ HOWTO (R_NDS32_20, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ nds32_elf_generic_reloc, /* special_function */
+ "R_NDS32_20", /* name */
+ FALSE, /* partial_inplace */
+ 0xfffff, /* src_mask */
+ 0xfffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* An PC Relative 9-bit relocation, shifted by 2.
+ This reloc is complicated because relocations are relative to pc & -4.
+ i.e. branches in the right insn slot use the address of the left insn
+ slot for pc. */
+ /* ??? It's not clear whether this should have partial_inplace set or not.
+ Branch relaxing in the assembler can store the addend in the insn,
+ and if bfd_install_relocation gets called the addend may get added
+ again. */
+ HOWTO (R_NDS32_9_PCREL, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ nds32_elf_9_pcrel_reloc, /* special_function */
+ "R_NDS32_9_PCREL", /* name */
+ FALSE, /* partial_inplace */
+ 0xff, /* src_mask */
+ 0xff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ /* A relative 15 bit relocation, right shifted by 1. */
+ HOWTO (R_NDS32_15_PCREL, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 14, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_15_PCREL", /* name */
+ FALSE, /* partial_inplace */
+ 0x3fff, /* src_mask */
+ 0x3fff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ /* A relative 17 bit relocation, right shifted by 1. */
+ HOWTO (R_NDS32_17_PCREL, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_17_PCREL", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ /* A relative 25 bit relocation, right shifted by 1. */
+ /* ??? It's not clear whether this should have partial_inplace set or not.
+ Branch relaxing in the assembler can store the addend in the insn,
+ and if bfd_install_relocation gets called the addend may get added
+ again. */
+ HOWTO (R_NDS32_25_PCREL, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 24, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_25_PCREL", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffff, /* src_mask */
+ 0xffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ /* High 20 bits of address when lower 12 is or'd in. */
+ HOWTO (R_NDS32_HI20, /* type */
+ 12, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_hi20_reloc, /* special_function */
+ "R_NDS32_HI20", /* name */
+ FALSE, /* partial_inplace */
+ 0x000fffff, /* src_mask */
+ 0x000fffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Lower 12 bits of address. */
+ HOWTO (R_NDS32_LO12S3, /* type */
+ 3, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 9, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_lo12_reloc, /* special_function */
+ "R_NDS32_LO12S3", /* name */
+ FALSE, /* partial_inplace */
+ 0x000001ff, /* src_mask */
+ 0x000001ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Lower 12 bits of address. */
+ HOWTO (R_NDS32_LO12S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 10, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_lo12_reloc, /* special_function */
+ "R_NDS32_LO12S2", /* name */
+ FALSE, /* partial_inplace */
+ 0x000003ff, /* src_mask */
+ 0x000003ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Lower 12 bits of address. */
+ HOWTO (R_NDS32_LO12S1, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 11, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_lo12_reloc, /* special_function */
+ "R_NDS32_LO12S1", /* name */
+ FALSE, /* partial_inplace */
+ 0x000007ff, /* src_mask */
+ 0x000007ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Lower 12 bits of address. */
+ HOWTO (R_NDS32_LO12S0, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 12, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_lo12_reloc, /* special_function */
+ "R_NDS32_LO12S0", /* name */
+ FALSE, /* partial_inplace */
+ 0x00000fff, /* src_mask */
+ 0x00000fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Small data area 15 bits offset. */
+ HOWTO (R_NDS32_SDA15S3, /* type */
+ 3, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ nds32_elf_sda15_reloc, /* special_function */
+ "R_NDS32_SDA15S3", /* name */
+ FALSE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Small data area 15 bits offset. */
+ HOWTO (R_NDS32_SDA15S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ nds32_elf_sda15_reloc, /* special_function */
+ "R_NDS32_SDA15S2", /* name */
+ FALSE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Small data area 15 bits offset. */
+ HOWTO (R_NDS32_SDA15S1, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ nds32_elf_sda15_reloc, /* special_function */
+ "R_NDS32_SDA15S1", /* name */
+ FALSE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Small data area 15 bits offset. */
+ HOWTO (R_NDS32_SDA15S0, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ nds32_elf_sda15_reloc, /* special_function */
+ "R_NDS32_SDA15S0", /* name */
+ FALSE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable hierarchy */
+ HOWTO (R_NDS32_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ NULL, /* special_function */
+ "R_NDS32_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable member usage */
+ HOWTO (R_NDS32_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_NDS32_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* A 16 bit absolute relocation. */
+ HOWTO (R_NDS32_16_RELA, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_16_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* A 32 bit absolute relocation. */
+ HOWTO (R_NDS32_32_RELA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_32_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* A 20 bit address. */
+ HOWTO (R_NDS32_20_RELA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_20_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0xfffff, /* src_mask */
+ 0xfffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_NDS32_9_PCREL_RELA, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_9_PCREL_RELA",/* name */
+ FALSE, /* partial_inplace */
+ 0xff, /* src_mask */
+ 0xff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ /* A relative 15 bit relocation, right shifted by 1. */
+ HOWTO (R_NDS32_15_PCREL_RELA, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 14, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_15_PCREL_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x3fff, /* src_mask */
+ 0x3fff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ /* A relative 17 bit relocation, right shifted by 1. */
+ HOWTO (R_NDS32_17_PCREL_RELA, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_17_PCREL_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ /* A relative 25 bit relocation, right shifted by 2. */
+ HOWTO (R_NDS32_25_PCREL_RELA, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 24, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_25_PCREL_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffff, /* src_mask */
+ 0xffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ /* High 20 bits of address when lower 16 is or'd in. */
+ HOWTO (R_NDS32_HI20_RELA, /* type */
+ 12, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_HI20_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x000fffff, /* src_mask */
+ 0x000fffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Lower 12 bits of address. */
+ HOWTO (R_NDS32_LO12S3_RELA, /* type */
+ 3, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 9, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_LO12S3_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x000001ff, /* src_mask */
+ 0x000001ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Lower 12 bits of address. */
+ HOWTO (R_NDS32_LO12S2_RELA, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 10, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_LO12S2_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x000003ff, /* src_mask */
+ 0x000003ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Lower 12 bits of address. */
+ HOWTO (R_NDS32_LO12S1_RELA, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 11, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_LO12S1_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x000007ff, /* src_mask */
+ 0x000007ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Lower 12 bits of address. */
+ HOWTO (R_NDS32_LO12S0_RELA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 12, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_LO12S0_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x00000fff, /* src_mask */
+ 0x00000fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Small data area 15 bits offset. */
+ HOWTO (R_NDS32_SDA15S3_RELA, /* type */
+ 3, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_SDA15S3_RELA",/* name */
+ FALSE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Small data area 15 bits offset. */
+ HOWTO (R_NDS32_SDA15S2_RELA, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_SDA15S2_RELA",/* name */
+ FALSE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_NDS32_SDA15S1_RELA, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_SDA15S1_RELA",/* name */
+ FALSE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_NDS32_SDA15S0_RELA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_SDA15S0_RELA",/* name */
+ FALSE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable hierarchy */
+ HOWTO (R_NDS32_RELA_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ NULL, /* special_function */
+ "R_NDS32_RELA_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable member usage */
+ HOWTO (R_NDS32_RELA_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_NDS32_RELA_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like R_NDS32_20, but referring to the GOT table entry for
+ the symbol. */
+ HOWTO (R_NDS32_GOT20, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOT20", /* name */
+ FALSE, /* partial_inplace */
+ 0xfffff, /* src_mask */
+ 0xfffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like R_NDS32_PCREL, but referring to the procedure linkage table
+ entry for the symbol. */
+ HOWTO (R_NDS32_25_PLTREL, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 24, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_25_PLTREL", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffff, /* src_mask */
+ 0xffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ /* This is used only by the dynamic linker. The symbol should exist
+ both in the object being run and in some shared library. The
+ dynamic linker copies the data addressed by the symbol from the
+ shared library into the object, because the object being
+ run has to have the data at some particular address. */
+ HOWTO (R_NDS32_COPY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_COPY", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like R_NDS32_20, but used when setting global offset table
+ entries. */
+ HOWTO (R_NDS32_GLOB_DAT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GLOB_DAT", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Marks a procedure linkage table entry for a symbol. */
+ HOWTO (R_NDS32_JMP_SLOT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_JMP_SLOT", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Used only by the dynamic linker. When the object is run, this
+ longword is set to the load address of the object, plus the
+ addend. */
+ HOWTO (R_NDS32_RELATIVE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_RELATIVE", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_NDS32_GOTOFF, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOTOFF", /* name */
+ FALSE, /* partial_inplace */
+ 0xfffff, /* src_mask */
+ 0xfffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* An PC Relative 20-bit relocation used when setting PIC offset
+ table register. */
+ HOWTO (R_NDS32_GOTPC20, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOTPC20", /* name */
+ FALSE, /* partial_inplace */
+ 0xfffff, /* src_mask */
+ 0xfffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ /* Like R_NDS32_HI20, but referring to the GOT table entry for
+ the symbol. */
+ HOWTO (R_NDS32_GOT_HI20, /* type */
+ 12, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOT_HI20", /* name */
+ FALSE, /* partial_inplace */
+ 0x000fffff, /* src_mask */
+ 0x000fffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_GOT_LO12, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 12, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOT_LO12", /* name */
+ FALSE, /* partial_inplace */
+ 0x00000fff, /* src_mask */
+ 0x00000fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* An PC Relative relocation used when setting PIC offset table register.
+ Like R_NDS32_HI20, but referring to the GOT table entry for
+ the symbol. */
+ HOWTO (R_NDS32_GOTPC_HI20, /* type */
+ 12, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOTPC_HI20", /* name */
+ FALSE, /* partial_inplace */
+ 0x000fffff, /* src_mask */
+ 0x000fffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+ HOWTO (R_NDS32_GOTPC_LO12, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 12, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOTPC_LO12", /* name */
+ FALSE, /* partial_inplace */
+ 0x00000fff, /* src_mask */
+ 0x00000fff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_NDS32_GOTOFF_HI20, /* type */
+ 12, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOTOFF_HI20", /* name */
+ FALSE, /* partial_inplace */
+ 0x000fffff, /* src_mask */
+ 0x000fffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_GOTOFF_LO12, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 12, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOTOFF_LO12", /* name */
+ FALSE, /* partial_inplace */
+ 0x00000fff, /* src_mask */
+ 0x00000fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Alignment hint for relaxable instruction. This is used with
+ R_NDS32_LABEL as a pair. Relax this instruction from 4 bytes to 2
+ in order to make next label aligned on word boundary. */
+ HOWTO (R_NDS32_INSN16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_INSN16", /* name */
+ FALSE, /* partial_inplace */
+ 0x00000fff, /* src_mask */
+ 0x00000fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Alignment hint for label. */
+ HOWTO (R_NDS32_LABEL, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_LABEL", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for unconditional call sequence */
+ HOWTO (R_NDS32_LONGCALL1, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_LONGCALL1", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for conditional call sequence. */
+ HOWTO (R_NDS32_LONGCALL2, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_LONGCALL2", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for conditional call sequence. */
+ HOWTO (R_NDS32_LONGCALL3, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_LONGCALL3", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for unconditional branch sequence. */
+ HOWTO (R_NDS32_LONGJUMP1, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_LONGJUMP1", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for conditional branch sequence. */
+ HOWTO (R_NDS32_LONGJUMP2, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_LONGJUMP2", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for conditional branch sequence. */
+ HOWTO (R_NDS32_LONGJUMP3, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_LONGJUMP3", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for load/store sequence. */
+ HOWTO (R_NDS32_LOADSTORE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_LOADSTORE", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for load/store sequence. */
+ HOWTO (R_NDS32_9_FIXED_RELA, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_9_FIXED_RELA",/* name */
+ FALSE, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for load/store sequence. */
+ HOWTO (R_NDS32_15_FIXED_RELA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_15_FIXED_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x00003fff, /* src_mask */
+ 0x00003fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for load/store sequence. */
+ HOWTO (R_NDS32_17_FIXED_RELA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_17_FIXED_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for load/store sequence. */
+ HOWTO (R_NDS32_25_FIXED_RELA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_25_FIXED_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x00ffffff, /* src_mask */
+ 0x00ffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* High 20 bits of PLT symbol offset relative to PC. */
+ HOWTO (R_NDS32_PLTREL_HI20, /* type */
+ 12, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_PLTREL_HI20", /* name */
+ FALSE, /* partial_inplace */
+ 0x000fffff, /* src_mask */
+ 0x000fffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Low 12 bits of PLT symbol offset relative to PC. */
+ HOWTO (R_NDS32_PLTREL_LO12, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 12, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_PLTREL_LO12", /* name */
+ FALSE, /* partial_inplace */
+ 0x00000fff, /* src_mask */
+ 0x00000fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* High 20 bits of PLT symbol offset relative to GOT (GP). */
+ HOWTO (R_NDS32_PLT_GOTREL_HI20, /* type */
+ 12, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_PLT_GOTREL_HI20", /* name */
+ FALSE, /* partial_inplace */
+ 0x000fffff, /* src_mask */
+ 0x000fffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Low 12 bits of PLT symbol offset relative to GOT (GP). */
+ HOWTO (R_NDS32_PLT_GOTREL_LO12, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 12, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_PLT_GOTREL_LO12", /* name */
+ FALSE, /* partial_inplace */
+ 0x00000fff, /* src_mask */
+ 0x00000fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Small data area 12 bits offset. */
+ HOWTO (R_NDS32_SDA12S2_DP_RELA, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 12, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_SDA12S2_DP_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x00000fff, /* src_mask */
+ 0x00000fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Small data area 12 bits offset. */
+ HOWTO (R_NDS32_SDA12S2_SP_RELA, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 12, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_SDA12S2_SP_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x00000fff, /* src_mask */
+ 0x00000fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ /* Lower 12 bits of address. */
+
+ HOWTO (R_NDS32_LO12S2_DP_RELA, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 10, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_LO12S2_DP_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x000003ff, /* src_mask */
+ 0x000003ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Lower 12 bits of address. */
+ HOWTO (R_NDS32_LO12S2_SP_RELA,/* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 10, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_LO12S2_SP_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x000003ff, /* src_mask */
+ 0x000003ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ /* Lower 12 bits of address. Special identity for or case. */
+ HOWTO (R_NDS32_LO12S0_ORI_RELA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 12, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_LO12S0_ORI_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x00000fff, /* src_mask */
+ 0x00000fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ /* Small data area 19 bits offset. */
+ HOWTO (R_NDS32_SDA16S3_RELA, /* type */
+ 3, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_SDA16S3_RELA",/* name */
+ FALSE, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Small data area 15 bits offset. */
+ HOWTO (R_NDS32_SDA17S2_RELA, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 17, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_SDA17S2_RELA",/* name */
+ FALSE, /* partial_inplace */
+ 0x0001ffff, /* src_mask */
+ 0x0001ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_NDS32_SDA18S1_RELA, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 18, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_SDA18S1_RELA",/* name */
+ FALSE, /* partial_inplace */
+ 0x0003ffff, /* src_mask */
+ 0x0003ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_NDS32_SDA19S0_RELA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 19, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_SDA19S0_RELA",/* name */
+ FALSE, /* partial_inplace */
+ 0x0007ffff, /* src_mask */
+ 0x0007ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_DWARF2_OP1_RELA, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_DWARF2_OP1_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0xff, /* src_mask */
+ 0xff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_DWARF2_OP2_RELA, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_DWARF2_OP2_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_DWARF2_LEB_RELA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_DWARF2_LEB_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_UPDATE_TA_RELA,/* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_UPDATE_TA_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ /* Like R_NDS32_PCREL, but referring to the procedure linkage table
+ entry for the symbol. */
+ HOWTO (R_NDS32_9_PLTREL, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_9_PLTREL", /* name */
+ FALSE, /* partial_inplace */
+ 0xff, /* src_mask */
+ 0xff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+ /* Low 20 bits of PLT symbol offset relative to GOT (GP). */
+ HOWTO (R_NDS32_PLT_GOTREL_LO20, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_PLT_GOTREL_LO20", /* name */
+ FALSE, /* partial_inplace */
+ 0x000fffff, /* src_mask */
+ 0x000fffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ /* low 15 bits of PLT symbol offset relative to GOT (GP) */
+ HOWTO (R_NDS32_PLT_GOTREL_LO15, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_PLT_GOTREL_LO15", /* name */
+ FALSE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ /* Low 19 bits of PLT symbol offset relative to GOT (GP). */
+ HOWTO (R_NDS32_PLT_GOTREL_LO19, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 19, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_PLT_GOTREL_LO19", /* name */
+ FALSE, /* partial_inplace */
+ 0x0007ffff, /* src_mask */
+ 0x0007ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_GOT_LO15, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOT_LO15", /* name */
+ FALSE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_GOT_LO19, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 19, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOT_LO19", /* name */
+ FALSE, /* partial_inplace */
+ 0x0007ffff, /* src_mask */
+ 0x0007ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_GOTOFF_LO15, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOTOFF_LO15", /* name */
+ FALSE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_GOTOFF_LO19, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 19, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOTOFF_LO19", /* name */
+ FALSE, /* partial_inplace */
+ 0x0007ffff, /* src_mask */
+ 0x0007ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ /* GOT 15 bits offset. */
+ HOWTO (R_NDS32_GOT15S2_RELA, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOT15S2_RELA",/* name */
+ FALSE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ /* GOT 17 bits offset. */
+ HOWTO (R_NDS32_GOT17S2_RELA, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 17, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_GOT17S2_RELA",/* name */
+ FALSE, /* partial_inplace */
+ 0x0001ffff, /* src_mask */
+ 0x0001ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ /* A 5 bit address. */
+ HOWTO (R_NDS32_5_RELA, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 5, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_5_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x1f, /* src_mask */
+ 0x1f, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_10_UPCREL_RELA,/* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 9, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_10_UPCREL_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x1ff, /* src_mask */
+ 0x1ff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+ HOWTO (R_NDS32_SDA_FP7U2_RELA,/* type */
+ 2, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 7, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_SDA_FP7U2_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x0000007f, /* src_mask */
+ 0x0000007f, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_WORD_9_PCREL_RELA, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_WORD_9_PCREL_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0xff, /* src_mask */
+ 0xff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+ HOWTO (R_NDS32_25_ABS_RELA, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 24, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_25_ABS_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffff, /* src_mask */
+ 0xffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* A relative 17 bit relocation for ifc, right shifted by 1. */
+ HOWTO (R_NDS32_17IFC_PCREL_RELA, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_17IFC_PCREL_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ /* A relative unsigned 10 bit relocation for ifc, right shifted by 1. */
+ HOWTO (R_NDS32_10IFCU_PCREL_RELA, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 9, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_10IFCU_PCREL_RELA", /* name */
+ FALSE, /* partial_inplace */
+ 0x1ff, /* src_mask */
+ 0x1ff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ /* Like R_NDS32_HI20, but referring to the TLS entry for the symbol. */
+ HOWTO (R_NDS32_TLS_LE_HI20, /* type */
+ 12, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_TLS_LE_HI20", /* name */
+ FALSE, /* partial_inplace */
+ 0x000fffff, /* src_mask */
+ 0x000fffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_TLS_LE_LO12, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 12, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_TLS_LE_LO12", /* name */
+ FALSE, /* partial_inplace */
+ 0x00000fff, /* src_mask */
+ 0x00000fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like R_NDS32_HI20, but referring to the TLS entry for the symbol. */
+ HOWTO (R_NDS32_TLS_IE_HI20, /* type */
+ 12, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_TLS_IE_HI20", /* name */
+ FALSE, /* partial_inplace */
+ 0x000fffff, /* src_mask */
+ 0x000fffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_TLS_IE_LO12S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 10, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_TLS_IE_LO12S2", /* name */
+ FALSE, /* partial_inplace */
+ 0x000003ff, /* src_mask */
+ 0x000003ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ /* Mark a TLS IE entry in GOT. */
+ HOWTO (R_NDS32_TLS_TPOFF, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_TLS_TPOFF", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ /* A 20 bit address. */
+ HOWTO (R_NDS32_TLS_LE_20, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_TLS_LE_20", /* name */
+ FALSE, /* partial_inplace */
+ 0xfffff, /* src_mask */
+ 0xfffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_TLS_LE_15S0, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_TLS_LE_15S0", /* name */
+ FALSE, /* partial_inplace */
+ 0x7fff, /* src_mask */
+ 0x7fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_TLS_LE_15S1, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_TLS_LE_15S1", /* name */
+ FALSE, /* partial_inplace */
+ 0x7fff, /* src_mask */
+ 0x7fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_TLS_LE_15S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 15, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_NDS32_TLS_LE_15S2", /* name */
+ FALSE, /* partial_inplace */
+ 0x7fff, /* src_mask */
+ 0x7fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for unconditional call sequence */
+ HOWTO (R_NDS32_LONGCALL4, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ nds32_elf_ignore_reloc, /* special_function */
+ "R_NDS32_LONGCALL4", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for conditional call sequence. */
+ HOWTO (R_NDS32_LONGCALL5, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ nds32_elf_ignore_reloc, /* special_function */
+ "R_NDS32_LONGCALL5", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for conditional call sequence. */
+ HOWTO (R_NDS32_LONGCALL6, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ nds32_elf_ignore_reloc, /* special_function */
+ "R_NDS32_LONGCALL6", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for unconditional branch sequence. */
+ HOWTO (R_NDS32_LONGJUMP4, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ nds32_elf_ignore_reloc, /* special_function */
+ "R_NDS32_LONGJUMP4", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for conditional branch sequence. */
+ HOWTO (R_NDS32_LONGJUMP5, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ nds32_elf_ignore_reloc, /* special_function */
+ "R_NDS32_LONGJUMP5", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for conditional branch sequence. */
+ HOWTO (R_NDS32_LONGJUMP6, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ nds32_elf_ignore_reloc, /* special_function */
+ "R_NDS32_LONGJUMP6", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Relax hint for conditional branch sequence. */
+ HOWTO (R_NDS32_LONGJUMP7, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ nds32_elf_ignore_reloc, /* special_function */
+ "R_NDS32_LONGJUMP7", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+};
+
+/* Relocations used for relaxation. */
+static reloc_howto_type nds32_elf_relax_howto_table[] =
+{
+ HOWTO (R_NDS32_RELAX_ENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_RELAX_ENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_GOT_SUFF, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_GOT_SUFF", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_GOTOFF_SUFF, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_GOTOFF_SUFF", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_PLT_GOT_SUFF, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_PLT_GOT_SUFF",/* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_MULCALL_SUFF, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_MULCALL_SUFF",/* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_PTR, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_PTR", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_PTR_COUNT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_PTR_COUNT", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_PTR_RESOLVED, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_PTR_RESOLVED",/* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_PLTBLOCK, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_PLTBLOCK", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_RELAX_REGION_BEGIN, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_RELAX_REGION_BEGIN", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_RELAX_REGION_END, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_RELAX_REGION_END", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_MINUEND, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_MINUEND", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_SUBTRAHEND, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_SUBTRAHEND", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_DIFF8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_DIFF8", /* name */
+ FALSE, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_DIFF16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_DIFF16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_DIFF32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_DIFF32", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_DIFF_ULEB128, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_DIFF_ULEB128",/* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_DATA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_DATA", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_TRAN, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ nds32_elf_ignore_reloc,/* special_function */
+ "R_NDS32_TRAN", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_TLS_LE_ADD, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ nds32_elf_ignore_reloc, /* special_function */
+ "R_NDS32_TLS_LE_ADD", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_TLS_LE_LS, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ nds32_elf_ignore_reloc, /* special_function */
+ "R_NDS32_TLS_LE_LS", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_NDS32_EMPTY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ nds32_elf_ignore_reloc, /* special_function */
+ "R_NDS32_EMPTY", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+};
+
+
+/* nds32_insertion_sort sorts an array with nmemb elements of size size.
+ This prototype is the same as qsort (). */
+
+void
+nds32_insertion_sort (void *base, size_t nmemb, size_t size,
+ int (*compar) (const void *lhs, const void *rhs))
+{
+ char *ptr = (char *) base;
+ int i, j;
+ char *tmp = alloca (size);
+
+ /* If i is less than j, i is inserted before j.
+
+ |---- j ----- i --------------|
+ \ / \ /
+ sorted unsorted
+ */
+
+ for (i = 1; i < (int) nmemb; i++)
+ {
+ for (j = (i - 1); j >= 0; j--)
+ if (compar (ptr + i * size, ptr + j * size) >= 0)
+ break;
+
+ j++;
+
+ if (i == j)
+ continue; /* i is in order. */
+
+ memcpy (tmp, ptr + i * size, size);
+ memmove (ptr + (j + 1) * size, ptr + j * size, (i - j) * size);
+ memcpy (ptr + j * size, tmp, size);
+ }
+}
+
+/* Sort relocation by r_offset.
+
+ We didn't use qsort () in stdlib, because quick-sort is not a stable sorting
+ algorithm. Relocations at the same r_offset must keep their order.
+ For example, RELAX_ENTRY must be the very first relocation entry.
+
+ Currently, this function implements insertion-sort.
+
+ FIXME: If we already sort them in assembler, why bother sort them
+ here again? */
+
+static int
+compar_reloc (const void *lhs, const void *rhs)
+{
+ const Elf_Internal_Rela *l = (const Elf_Internal_Rela *) lhs;
+ const Elf_Internal_Rela *r = (const Elf_Internal_Rela *) rhs;
+
+ if (l->r_offset > r->r_offset)
+ return 1;
+ else if (l->r_offset == r->r_offset)
+ return 0;
+ else
+ return -1;
+}
+
+/* Functions listed below are only used for old relocs.
+ * nds32_elf_9_pcrel_reloc
+ * nds32_elf_do_9_pcrel_reloc
+ * nds32_elf_hi20_reloc
+ * nds32_elf_relocate_hi20
+ * nds32_elf_lo12_reloc
+ * nds32_elf_sda15_reloc
+ * nds32_elf_generic_reloc
+ */
+
+/* Handle the R_NDS32_9_PCREL & R_NDS32_9_PCREL_RELA reloc. */
+
+static bfd_reloc_status_type
+nds32_elf_9_pcrel_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
+ void *data, asection *input_section, bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
+{
+ /* This part is from bfd_elf_generic_reloc. */
+ if (output_bfd != (bfd *) NULL
+ && (symbol->flags & BSF_SECTION_SYM) == 0
+ && (!reloc_entry->howto->partial_inplace || reloc_entry->addend == 0))
+ {
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
+ if (output_bfd != NULL)
+ {
+ /* FIXME: See bfd_perform_relocation. Is this right? */
+ return bfd_reloc_continue;
+ }
+
+ return nds32_elf_do_9_pcrel_reloc (abfd, reloc_entry->howto,
+ input_section,
+ data, reloc_entry->address,
+ symbol->section,
+ (symbol->value
+ + symbol->section->output_section->vma
+ + symbol->section->output_offset),
+ reloc_entry->addend);
+}
+
+/* Utility to actually perform an R_NDS32_9_PCREL reloc. */
+#define N_ONES(n) (((((bfd_vma) 1 << ((n) - 1)) - 1) << 1) | 1)
+
+static bfd_reloc_status_type
+nds32_elf_do_9_pcrel_reloc (bfd *abfd, reloc_howto_type *howto,
+ asection *input_section, bfd_byte *data,
+ bfd_vma offset,
+ asection *symbol_section ATTRIBUTE_UNUSED,
+ bfd_vma symbol_value, bfd_vma addend)
+{
+ bfd_signed_vma relocation;
+ unsigned short x;
+ bfd_reloc_status_type status;
+
+ /* Sanity check the address (offset in section). */
+ if (offset > bfd_get_section_limit (abfd, input_section))
+ return bfd_reloc_outofrange;
+
+ relocation = symbol_value + addend;
+ /* Make it pc relative. */
+ relocation -= (input_section->output_section->vma
+ + input_section->output_offset);
+ /* These jumps mask off the lower two bits of the current address
+ before doing pcrel calculations. */
+ relocation -= (offset & -(bfd_vma) 2);
+
+ if (relocation < -ACCURATE_8BIT_S1 || relocation >= ACCURATE_8BIT_S1)
+ status = bfd_reloc_overflow;
+ else
+ status = bfd_reloc_ok;
+
+ x = bfd_getb16 (data + offset);
+
+ relocation >>= howto->rightshift;
+ relocation <<= howto->bitpos;
+ x = (x & ~howto->dst_mask)
+ | (((x & howto->src_mask) + relocation) & howto->dst_mask);
+
+ bfd_putb16 ((bfd_vma) x, data + offset);
+
+ return status;
+}
+
+/* Handle the R_NDS32_HI20_[SU]LO relocs.
+ HI20_SLO is for the add3 and load/store with displacement instructions.
+ HI20 is for the or3 instruction.
+ For R_NDS32_HI20_SLO, the lower 16 bits are sign extended when added to
+ the high 16 bytes so if the lower 16 bits are negative (bit 15 == 1) then
+ we must add one to the high 16 bytes (which will get subtracted off when
+ the low 16 bits are added).
+ These relocs have to be done in combination with an R_NDS32_LO12 reloc
+ because there is a carry from the LO12 to the HI20. Here we just save
+ the information we need; we do the actual relocation when we see the LO12.
+ This code is copied from the elf32-mips.c. We also support an arbitrary
+ number of HI20 relocs to be associated with a single LO12 reloc. The
+ assembler sorts the relocs to ensure each HI20 immediately precedes its
+ LO12. However if there are multiple copies, the assembler may not find
+ the real LO12 so it picks the first one it finds. */
+
+struct nds32_hi20
+{
+ struct nds32_hi20 *next;
+ bfd_byte *addr;
+ bfd_vma addend;
+};
+
+static struct nds32_hi20 *nds32_hi20_list;
+
+static bfd_reloc_status_type
+nds32_elf_hi20_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry,
+ asymbol *symbol, void *data, asection *input_section,
+ bfd *output_bfd, char **error_message ATTRIBUTE_UNUSED)
+{
+ bfd_reloc_status_type ret;
+ bfd_vma relocation;
+ struct nds32_hi20 *n;
+
+ /* This part is from bfd_elf_generic_reloc.
+ If we're relocating, and this an external symbol, we don't want
+ to change anything. */
+ if (output_bfd != (bfd *) NULL
+ && (symbol->flags & BSF_SECTION_SYM) == 0 && reloc_entry->addend == 0)
+ {
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
+ /* Sanity check the address (offset in section). */
+ if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
+ return bfd_reloc_outofrange;
+
+ ret = bfd_reloc_ok;
+ if (bfd_is_und_section (symbol->section) && output_bfd == (bfd *) NULL)
+ ret = bfd_reloc_undefined;
+
+ if (bfd_is_com_section (symbol->section))
+ relocation = 0;
+ else
+ relocation = symbol->value;
+
+ relocation += symbol->section->output_section->vma;
+ relocation += symbol->section->output_offset;
+ relocation += reloc_entry->addend;
+
+ /* Save the information, and let LO12 do the actual relocation. */
+ n = (struct nds32_hi20 *) bfd_malloc ((bfd_size_type) sizeof *n);
+ if (n == NULL)
+ return bfd_reloc_outofrange;
+
+ n->addr = (bfd_byte *) data + reloc_entry->address;
+ n->addend = relocation;
+ n->next = nds32_hi20_list;
+ nds32_hi20_list = n;
+
+ if (output_bfd != (bfd *) NULL)
+ reloc_entry->address += input_section->output_offset;
+
+ return ret;
+}
+
+/* Handle an NDS32 ELF HI20 reloc. */
+
+static void
+nds32_elf_relocate_hi20 (bfd *input_bfd ATTRIBUTE_UNUSED,
+ int type ATTRIBUTE_UNUSED, Elf_Internal_Rela *relhi,
+ Elf_Internal_Rela *rello, bfd_byte *contents,
+ bfd_vma addend)
+{
+ unsigned long insn;
+ bfd_vma addlo;
+
+ insn = bfd_getb32 (contents + relhi->r_offset);
+
+ addlo = bfd_getb32 (contents + rello->r_offset);
+ addlo &= 0xfff;
+
+ addend += ((insn & 0xfffff) << 20) + addlo;
+
+ insn = (insn & 0xfff00000) | ((addend >> 12) & 0xfffff);
+ bfd_putb32 (insn, contents + relhi->r_offset);
+}
+
+/* Do an R_NDS32_LO12 relocation. This is a straightforward 12 bit
+ inplace relocation; this function exists in order to do the
+ R_NDS32_HI20_[SU]LO relocation described above. */
+
+static bfd_reloc_status_type
+nds32_elf_lo12_reloc (bfd *input_bfd, arelent *reloc_entry, asymbol *symbol,
+ void *data, asection *input_section, bfd *output_bfd,
+ char **error_message)
+{
+ /* This part is from bfd_elf_generic_reloc.
+ If we're relocating, and this an external symbol, we don't want
+ to change anything. */
+ if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0
+ && reloc_entry->addend == 0)
+ {
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
+ if (nds32_hi20_list != NULL)
+ {
+ struct nds32_hi20 *l;
+
+ l = nds32_hi20_list;
+ while (l != NULL)
+ {
+ unsigned long insn;
+ unsigned long val;
+ unsigned long vallo;
+ struct nds32_hi20 *next;
+
+ /* Do the HI20 relocation. Note that we actually don't need
+ to know anything about the LO12 itself, except where to
+ find the low 12 bits of the addend needed by the LO12. */
+ insn = bfd_getb32 (l->addr);
+ vallo = bfd_getb32 ((bfd_byte *) data + reloc_entry->address);
+ vallo &= 0xfff;
+ switch (reloc_entry->howto->type)
+ {
+ case R_NDS32_LO12S3:
+ vallo <<= 3;
+ break;
+
+ case R_NDS32_LO12S2:
+ vallo <<= 2;
+ break;
+
+ case R_NDS32_LO12S1:
+ vallo <<= 1;
+ break;
+
+ case R_NDS32_LO12S0:
+ vallo <<= 0;
+ break;
+ }
+
+ val = ((insn & 0xfffff) << 12) + vallo;
+ val += l->addend;
+
+ insn = (insn & ~(bfd_vma) 0xfffff) | ((val >> 12) & 0xfffff);
+ bfd_putb32 ((bfd_vma) insn, l->addr);
+
+ next = l->next;
+ free (l);
+ l = next;
+ }
+
+ nds32_hi20_list = NULL;
+ }
+
+ /* Now do the LO12 reloc in the usual way.
+ ??? It would be nice to call bfd_elf_generic_reloc here,
+ but we have partial_inplace set. bfd_elf_generic_reloc will
+ pass the handling back to bfd_install_relocation which will install
+ a section relative addend which is wrong. */
+ return nds32_elf_generic_reloc (input_bfd, reloc_entry, symbol, data,
+ input_section, output_bfd, error_message);
+}
+
+/* Do generic partial_inplace relocation.
+ This is a local replacement for bfd_elf_generic_reloc. */
+
+static bfd_reloc_status_type
+nds32_elf_generic_reloc (bfd *input_bfd, arelent *reloc_entry,
+ asymbol *symbol, void *data, asection *input_section,
+ bfd *output_bfd, char **error_message ATTRIBUTE_UNUSED)
+{
+ bfd_reloc_status_type ret;
+ bfd_vma relocation;
+ bfd_byte *inplace_address;
+
+ /* This part is from bfd_elf_generic_reloc.
+ If we're relocating, and this an external symbol, we don't want
+ to change anything. */
+ if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0
+ && reloc_entry->addend == 0)
+ {
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
+ /* Now do the reloc in the usual way.
+ ??? It would be nice to call bfd_elf_generic_reloc here,
+ but we have partial_inplace set. bfd_elf_generic_reloc will
+ pass the handling back to bfd_install_relocation which will install
+ a section relative addend which is wrong. */
+
+ /* Sanity check the address (offset in section). */
+ if (reloc_entry->address > bfd_get_section_limit (input_bfd, input_section))
+ return bfd_reloc_outofrange;
+
+ ret = bfd_reloc_ok;
+ if (bfd_is_und_section (symbol->section) && output_bfd == (bfd *) NULL)
+ ret = bfd_reloc_undefined;
+
+ if (bfd_is_com_section (symbol->section) || output_bfd != (bfd *) NULL)
+ relocation = 0;
+ else
+ relocation = symbol->value;
+
+ /* Only do this for a final link. */
+ if (output_bfd == (bfd *) NULL)
+ {
+ relocation += symbol->section->output_section->vma;
+ relocation += symbol->section->output_offset;
+ }
+
+ relocation += reloc_entry->addend;
+ switch (reloc_entry->howto->type)
+ {
+ case R_NDS32_LO12S3:
+ relocation >>= 3;
+ break;
+
+ case R_NDS32_LO12S2:
+ relocation >>= 2;
+ break;
+
+ case R_NDS32_LO12S1:
+ relocation >>= 1;
+ break;
+
+ case R_NDS32_LO12S0:
+ default:
+ relocation >>= 0;
+ break;
+ }
+
+ inplace_address = (bfd_byte *) data + reloc_entry->address;
+
+#define DOIT(x) \
+ x = ((x & ~reloc_entry->howto->dst_mask) | \
+ (((x & reloc_entry->howto->src_mask) + relocation) & \
+ reloc_entry->howto->dst_mask))
+
+ switch (reloc_entry->howto->size)
+ {
+ case 1:
+ {
+ short x = bfd_getb16 (inplace_address);
+
+ DOIT (x);
+ bfd_putb16 ((bfd_vma) x, inplace_address);
+ }
+ break;
+ case 2:
+ {
+ unsigned long x = bfd_getb32 (inplace_address);
+
+ DOIT (x);
+ bfd_putb32 ((bfd_vma) x, inplace_address);
+ }
+ break;
+ default:
+ BFD_ASSERT (0);
+ }
+
+ if (output_bfd != (bfd *) NULL)
+ reloc_entry->address += input_section->output_offset;
+
+ return ret;
+}
+
+/* Handle the R_NDS32_SDA15 reloc.
+ This reloc is used to compute the address of objects in the small data area
+ and to perform loads and stores from that area.
+ The lower 15 bits are sign extended and added to the register specified
+ in the instruction, which is assumed to point to _SDA_BASE_.
+
+ Since the lower 15 bits offset is left-shifted 0, 1 or 2 bits depending on
+ the access size, this must be taken care of. */
+
+static bfd_reloc_status_type
+nds32_elf_sda15_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry,
+ asymbol *symbol, void *data ATTRIBUTE_UNUSED,
+ asection *input_section, bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
+{
+ /* This part is from bfd_elf_generic_reloc. */
+ if (output_bfd != (bfd *) NULL
+ && (symbol->flags & BSF_SECTION_SYM) == 0
+ && (!reloc_entry->howto->partial_inplace || reloc_entry->addend == 0))
+ {
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
+ if (output_bfd != NULL)
+ {
+ /* FIXME: See bfd_perform_relocation. Is this right? */
+ return bfd_reloc_continue;
+ }
+
+ /* FIXME: not sure what to do here yet. But then again, the linker
+ may never call us. */
+ abort ();
+}
+
+/* nds32_elf_ignore_reloc is the special function for
+ relocation types which don't need to be relocated
+ like relaxation relocation types.
+ This function simply return bfd_reloc_ok when it is
+ invoked. */
+
+static bfd_reloc_status_type
+nds32_elf_ignore_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED, asection *input_section,
+ bfd *output_bfd, char **error_message ATTRIBUTE_UNUSED)
+{
+ if (output_bfd != NULL)
+ reloc_entry->address += input_section->output_offset;
+
+ return bfd_reloc_ok;
+}
+
+
+/* Map BFD reloc types to NDS32 ELF reloc types. */
+
+struct nds32_reloc_map_entry
+{
+ bfd_reloc_code_real_type bfd_reloc_val;
+ unsigned char elf_reloc_val;
+};
+
+static const struct nds32_reloc_map_entry nds32_reloc_map[] =
+{
+ {BFD_RELOC_NONE, R_NDS32_NONE},
+ {BFD_RELOC_16, R_NDS32_16_RELA},
+ {BFD_RELOC_32, R_NDS32_32_RELA},
+ {BFD_RELOC_NDS32_20, R_NDS32_20_RELA},
+ {BFD_RELOC_NDS32_5, R_NDS32_5_RELA},
+ {BFD_RELOC_NDS32_9_PCREL, R_NDS32_9_PCREL_RELA},
+ {BFD_RELOC_NDS32_WORD_9_PCREL, R_NDS32_WORD_9_PCREL_RELA},
+ {BFD_RELOC_NDS32_15_PCREL, R_NDS32_15_PCREL_RELA},
+ {BFD_RELOC_NDS32_17_PCREL, R_NDS32_17_PCREL_RELA},
+ {BFD_RELOC_NDS32_25_PCREL, R_NDS32_25_PCREL_RELA},
+ {BFD_RELOC_NDS32_10_UPCREL, R_NDS32_10_UPCREL_RELA},
+ {BFD_RELOC_NDS32_HI20, R_NDS32_HI20_RELA},
+ {BFD_RELOC_NDS32_LO12S3, R_NDS32_LO12S3_RELA},
+ {BFD_RELOC_NDS32_LO12S2, R_NDS32_LO12S2_RELA},
+ {BFD_RELOC_NDS32_LO12S1, R_NDS32_LO12S1_RELA},
+ {BFD_RELOC_NDS32_LO12S0, R_NDS32_LO12S0_RELA},
+ {BFD_RELOC_NDS32_LO12S0_ORI, R_NDS32_LO12S0_ORI_RELA},
+ {BFD_RELOC_NDS32_SDA15S3, R_NDS32_SDA15S3_RELA},
+ {BFD_RELOC_NDS32_SDA15S2, R_NDS32_SDA15S2_RELA},
+ {BFD_RELOC_NDS32_SDA15S1, R_NDS32_SDA15S1_RELA},
+ {BFD_RELOC_NDS32_SDA15S0, R_NDS32_SDA15S0_RELA},
+ {BFD_RELOC_VTABLE_INHERIT, R_NDS32_RELA_GNU_VTINHERIT},
+ {BFD_RELOC_VTABLE_ENTRY, R_NDS32_RELA_GNU_VTENTRY},
+
+ {BFD_RELOC_NDS32_GOT20, R_NDS32_GOT20},
+ {BFD_RELOC_NDS32_9_PLTREL, R_NDS32_9_PLTREL},
+ {BFD_RELOC_NDS32_25_PLTREL, R_NDS32_25_PLTREL},
+ {BFD_RELOC_NDS32_COPY, R_NDS32_COPY},
+ {BFD_RELOC_NDS32_GLOB_DAT, R_NDS32_GLOB_DAT},
+ {BFD_RELOC_NDS32_JMP_SLOT, R_NDS32_JMP_SLOT},
+ {BFD_RELOC_NDS32_RELATIVE, R_NDS32_RELATIVE},
+ {BFD_RELOC_NDS32_GOTOFF, R_NDS32_GOTOFF},
+ {BFD_RELOC_NDS32_GOTPC20, R_NDS32_GOTPC20},
+ {BFD_RELOC_NDS32_GOT_HI20, R_NDS32_GOT_HI20},
+ {BFD_RELOC_NDS32_GOT_LO12, R_NDS32_GOT_LO12},
+ {BFD_RELOC_NDS32_GOT_LO15, R_NDS32_GOT_LO15},
+ {BFD_RELOC_NDS32_GOT_LO19, R_NDS32_GOT_LO19},
+ {BFD_RELOC_NDS32_GOTPC_HI20, R_NDS32_GOTPC_HI20},
+ {BFD_RELOC_NDS32_GOTPC_LO12, R_NDS32_GOTPC_LO12},
+ {BFD_RELOC_NDS32_GOTOFF_HI20, R_NDS32_GOTOFF_HI20},
+ {BFD_RELOC_NDS32_GOTOFF_LO12, R_NDS32_GOTOFF_LO12},
+ {BFD_RELOC_NDS32_GOTOFF_LO15, R_NDS32_GOTOFF_LO15},
+ {BFD_RELOC_NDS32_GOTOFF_LO19, R_NDS32_GOTOFF_LO19},
+ {BFD_RELOC_NDS32_INSN16, R_NDS32_INSN16},
+ {BFD_RELOC_NDS32_LABEL, R_NDS32_LABEL},
+ {BFD_RELOC_NDS32_LONGCALL1, R_NDS32_LONGCALL1},
+ {BFD_RELOC_NDS32_LONGCALL2, R_NDS32_LONGCALL2},
+ {BFD_RELOC_NDS32_LONGCALL3, R_NDS32_LONGCALL3},
+ {BFD_RELOC_NDS32_LONGCALL4, R_NDS32_LONGCALL4},
+ {BFD_RELOC_NDS32_LONGCALL5, R_NDS32_LONGCALL5},
+ {BFD_RELOC_NDS32_LONGCALL6, R_NDS32_LONGCALL6},
+ {BFD_RELOC_NDS32_LONGJUMP1, R_NDS32_LONGJUMP1},
+ {BFD_RELOC_NDS32_LONGJUMP2, R_NDS32_LONGJUMP2},
+ {BFD_RELOC_NDS32_LONGJUMP3, R_NDS32_LONGJUMP3},
+ {BFD_RELOC_NDS32_LONGJUMP4, R_NDS32_LONGJUMP4},
+ {BFD_RELOC_NDS32_LONGJUMP5, R_NDS32_LONGJUMP5},
+ {BFD_RELOC_NDS32_LONGJUMP6, R_NDS32_LONGJUMP6},
+ {BFD_RELOC_NDS32_LONGJUMP7, R_NDS32_LONGJUMP7},
+ {BFD_RELOC_NDS32_LOADSTORE, R_NDS32_LOADSTORE},
+ {BFD_RELOC_NDS32_9_FIXED, R_NDS32_9_FIXED_RELA},
+ {BFD_RELOC_NDS32_15_FIXED, R_NDS32_15_FIXED_RELA},
+ {BFD_RELOC_NDS32_17_FIXED, R_NDS32_17_FIXED_RELA},
+ {BFD_RELOC_NDS32_25_FIXED, R_NDS32_25_FIXED_RELA},
+ {BFD_RELOC_NDS32_PLTREL_HI20, R_NDS32_PLTREL_HI20},
+ {BFD_RELOC_NDS32_PLTREL_LO12, R_NDS32_PLTREL_LO12},
+ {BFD_RELOC_NDS32_PLT_GOTREL_HI20, R_NDS32_PLT_GOTREL_HI20},
+ {BFD_RELOC_NDS32_PLT_GOTREL_LO12, R_NDS32_PLT_GOTREL_LO12},
+ {BFD_RELOC_NDS32_PLT_GOTREL_LO15, R_NDS32_PLT_GOTREL_LO15},
+ {BFD_RELOC_NDS32_PLT_GOTREL_LO19, R_NDS32_PLT_GOTREL_LO19},
+ {BFD_RELOC_NDS32_PLT_GOTREL_LO20, R_NDS32_PLT_GOTREL_LO20},
+ {BFD_RELOC_NDS32_SDA12S2_DP, R_NDS32_SDA12S2_DP_RELA},
+ {BFD_RELOC_NDS32_SDA12S2_SP, R_NDS32_SDA12S2_SP_RELA},
+ {BFD_RELOC_NDS32_LO12S2_DP, R_NDS32_LO12S2_DP_RELA},
+ {BFD_RELOC_NDS32_LO12S2_SP, R_NDS32_LO12S2_SP_RELA},
+ {BFD_RELOC_NDS32_SDA16S3, R_NDS32_SDA16S3_RELA},
+ {BFD_RELOC_NDS32_SDA17S2, R_NDS32_SDA17S2_RELA},
+ {BFD_RELOC_NDS32_SDA18S1, R_NDS32_SDA18S1_RELA},
+ {BFD_RELOC_NDS32_SDA19S0, R_NDS32_SDA19S0_RELA},
+ {BFD_RELOC_NDS32_SDA_FP7U2_RELA, R_NDS32_SDA_FP7U2_RELA},
+ {BFD_RELOC_NDS32_DWARF2_OP1, R_NDS32_DWARF2_OP1_RELA},
+ {BFD_RELOC_NDS32_DWARF2_OP2, R_NDS32_DWARF2_OP2_RELA},
+ {BFD_RELOC_NDS32_DWARF2_LEB, R_NDS32_DWARF2_LEB_RELA},
+ {BFD_RELOC_NDS32_UPDATE_TA, R_NDS32_UPDATE_TA_RELA},
+ {BFD_RELOC_NDS32_GOT_SUFF, R_NDS32_GOT_SUFF},
+ {BFD_RELOC_NDS32_GOTOFF_SUFF, R_NDS32_GOTOFF_SUFF},
+ {BFD_RELOC_NDS32_GOT15S2, R_NDS32_GOT15S2_RELA},
+ {BFD_RELOC_NDS32_GOT17S2, R_NDS32_GOT17S2_RELA},
+ {BFD_RELOC_NDS32_PTR, R_NDS32_PTR},
+ {BFD_RELOC_NDS32_PTR_COUNT, R_NDS32_PTR_COUNT},
+ {BFD_RELOC_NDS32_PLT_GOT_SUFF, R_NDS32_PLT_GOT_SUFF},
+ {BFD_RELOC_NDS32_PTR_RESOLVED, R_NDS32_PTR_RESOLVED},
+ {BFD_RELOC_NDS32_RELAX_ENTRY, R_NDS32_RELAX_ENTRY},
+ {BFD_RELOC_NDS32_MULCALL_SUFF, R_NDS32_MULCALL_SUFF},
+ {BFD_RELOC_NDS32_PLTBLOCK, R_NDS32_PLTBLOCK},
+ {BFD_RELOC_NDS32_RELAX_REGION_BEGIN, R_NDS32_RELAX_REGION_BEGIN},
+ {BFD_RELOC_NDS32_RELAX_REGION_END, R_NDS32_RELAX_REGION_END},
+ {BFD_RELOC_NDS32_MINUEND, R_NDS32_MINUEND},
+ {BFD_RELOC_NDS32_SUBTRAHEND, R_NDS32_SUBTRAHEND},
+ {BFD_RELOC_NDS32_EMPTY, R_NDS32_EMPTY},
+
+ {BFD_RELOC_NDS32_DIFF8, R_NDS32_DIFF8},
+ {BFD_RELOC_NDS32_DIFF16, R_NDS32_DIFF16},
+ {BFD_RELOC_NDS32_DIFF32, R_NDS32_DIFF32},
+ {BFD_RELOC_NDS32_DIFF_ULEB128, R_NDS32_DIFF_ULEB128},
+ {BFD_RELOC_NDS32_25_ABS, R_NDS32_25_ABS_RELA},
+ {BFD_RELOC_NDS32_DATA, R_NDS32_DATA},
+ {BFD_RELOC_NDS32_TRAN, R_NDS32_TRAN},
+ {BFD_RELOC_NDS32_17IFC_PCREL, R_NDS32_17IFC_PCREL_RELA},
+ {BFD_RELOC_NDS32_10IFCU_PCREL, R_NDS32_10IFCU_PCREL_RELA},
+ {BFD_RELOC_NDS32_TLS_LE_HI20, R_NDS32_TLS_LE_HI20},
+ {BFD_RELOC_NDS32_TLS_LE_LO12, R_NDS32_TLS_LE_LO12},
+ {BFD_RELOC_NDS32_TLS_LE_ADD, R_NDS32_TLS_LE_ADD},
+ {BFD_RELOC_NDS32_TLS_LE_LS, R_NDS32_TLS_LE_LS},
+ {BFD_RELOC_NDS32_TLS_IE_HI20, R_NDS32_TLS_IE_HI20},
+ {BFD_RELOC_NDS32_TLS_IE_LO12S2, R_NDS32_TLS_IE_LO12S2},
+ {BFD_RELOC_NDS32_TLS_TPOFF, R_NDS32_TLS_TPOFF},
+ {BFD_RELOC_NDS32_TLS_LE_20, R_NDS32_TLS_LE_20},
+ {BFD_RELOC_NDS32_TLS_LE_15S0, R_NDS32_TLS_LE_15S0},
+ {BFD_RELOC_NDS32_TLS_LE_15S1, R_NDS32_TLS_LE_15S1},
+ {BFD_RELOC_NDS32_TLS_LE_15S2, R_NDS32_TLS_LE_15S2},
+};
+
+/* Patch tag. */
+
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ const char *r_name)
+{
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE (nds32_elf_howto_table); i++)
+ if (nds32_elf_howto_table[i].name != NULL
+ && strcasecmp (nds32_elf_howto_table[i].name, r_name) == 0)
+ return &nds32_elf_howto_table[i];
+
+ for (i = 0; i < ARRAY_SIZE (nds32_elf_relax_howto_table); i++)
+ if (nds32_elf_relax_howto_table[i].name != NULL
+ && strcasecmp (nds32_elf_relax_howto_table[i].name, r_name) == 0)
+ return &nds32_elf_relax_howto_table[i];
+
+ return NULL;
+}
+
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_type_table_lookup (enum elf_nds32_reloc_type code)
+{
+ if (code < R_NDS32_RELAX_ENTRY)
+ {
+ BFD_ASSERT (code < ARRAY_SIZE (nds32_elf_howto_table));
+ return &nds32_elf_howto_table[code];
+ }
+ else
+ {
+ BFD_ASSERT ((size_t) (code - R_NDS32_RELAX_ENTRY)
+ < ARRAY_SIZE (nds32_elf_relax_howto_table));
+ return &nds32_elf_relax_howto_table[code - R_NDS32_RELAX_ENTRY];
+ }
+}
+
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
+{
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE (nds32_reloc_map); i++)
+ {
+ if (nds32_reloc_map[i].bfd_reloc_val == code)
+ return bfd_elf32_bfd_reloc_type_table_lookup
+ (nds32_reloc_map[i].elf_reloc_val);
+ }
+
+ return NULL;
+}
+
+/* Set the howto pointer for an NDS32 ELF reloc. */
+
+static void
+nds32_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
+ Elf_Internal_Rela *dst)
+{
+ enum elf_nds32_reloc_type r_type;
+
+ r_type = ELF32_R_TYPE (dst->r_info);
+ BFD_ASSERT (ELF32_R_TYPE (dst->r_info) <= R_NDS32_GNU_VTENTRY);
+ cache_ptr->howto = bfd_elf32_bfd_reloc_type_table_lookup (r_type);
+}
+
+static void
+nds32_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
+ Elf_Internal_Rela *dst)
+{
+ BFD_ASSERT ((ELF32_R_TYPE (dst->r_info) == R_NDS32_NONE)
+ || ((ELF32_R_TYPE (dst->r_info) > R_NDS32_GNU_VTENTRY)
+ && (ELF32_R_TYPE (dst->r_info) < R_NDS32_max)));
+ cache_ptr->howto = bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE (dst->r_info));
+}
+
+/* Support for core dump NOTE sections.
+ Reference to include/linux/elfcore.h in Linux. */
+
+static bfd_boolean
+nds32_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
+{
+ int offset;
+ size_t size;
+
+ switch (note->descsz)
+ {
+ case 0x114:
+ /* Linux/NDS32 32-bit, ABI1 */
+
+ /* pr_cursig */
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
+
+ /* pr_pid */
+ elf_tdata (abfd)->core->pid = bfd_get_32 (abfd, note->descdata + 24);
+
+ /* pr_reg */
+ offset = 72;
+ size = 200;
+ break;
+
+ case 0xfc:
+ /* Linux/NDS32 32-bit */
+
+ /* pr_cursig */
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
+
+ /* pr_pid */
+ elf_tdata (abfd)->core->pid = bfd_get_32 (abfd, note->descdata + 24);
+
+ /* pr_reg */
+ offset = 72;
+ size = 176;
+ break;
+
+ default:
+ return FALSE;
+ }
+
+ /* Make a ".reg" section. */
+ return _bfd_elfcore_make_pseudosection (abfd, ".reg",
+ size, note->descpos + offset);
+}
+
+static bfd_boolean
+nds32_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
+{
+ switch (note->descsz)
+ {
+ case 124:
+ /* Linux/NDS32 */
+
+ /* __kernel_uid_t, __kernel_gid_t are short on NDS32 platform. */
+ elf_tdata (abfd)->core->program =
+ _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
+ elf_tdata (abfd)->core->command =
+ _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
+
+ default:
+ return FALSE;
+ }
+
+ /* Note that for some reason, a spurious space is tacked
+ onto the end of the args in some (at least one anyway)
+ implementations, so strip it off if it exists. */
+ {
+ char *command = elf_tdata (abfd)->core->command;
+ int n = strlen (command);
+
+ if (0 < n && command[n - 1] == ' ')
+ command[n - 1] = '\0';
+ }
+
+ return TRUE;
+}
+
+/* Hook called by the linker routine which adds symbols from an object
+ file. We must handle the special NDS32 section numbers here.
+ We also keep watching for whether we need to create the sdata special
+ linker sections. */
+
+static bfd_boolean
+nds32_elf_add_symbol_hook (bfd *abfd,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ Elf_Internal_Sym *sym,
+ const char **namep ATTRIBUTE_UNUSED,
+ flagword *flagsp ATTRIBUTE_UNUSED,
+ asection **secp, bfd_vma *valp)
+{
+ switch (sym->st_shndx)
+ {
+ case SHN_COMMON:
+ /* Common symbols less than the GP size are automatically
+ treated as SHN_MIPS_SCOMMON symbols. */
+ if (sym->st_size > elf_gp_size (abfd)
+ || ELF_ST_TYPE (sym->st_info) == STT_TLS)
+ break;
+
+ /* st_value is the alignemnt constraint.
+ That might be its actual size if it is an array or structure. */
+ switch (sym->st_value)
+ {
+ case 1:
+ *secp = bfd_make_section_old_way (abfd, ".scommon_b");
+ break;
+ case 2:
+ *secp = bfd_make_section_old_way (abfd, ".scommon_h");
+ break;
+ case 4:
+ *secp = bfd_make_section_old_way (abfd, ".scommon_w");
+ break;
+ case 8:
+ *secp = bfd_make_section_old_way (abfd, ".scommon_d");
+ break;
+ default:
+ return TRUE;
+ }
+
+ (*secp)->flags |= SEC_IS_COMMON;
+ *valp = sym->st_size;
+ break;
+ }
+
+ return TRUE;
+}
+
+
+/* This function can figure out the best location for a base register to access
+ data relative to this base register
+ INPUT:
+ sda_d0: size of first DOUBLE WORD data section
+ sda_w0: size of first WORD data section
+ sda_h0: size of first HALF WORD data section
+ sda_b : size of BYTE data section
+ sda_hi: size of second HALF WORD data section
+ sda_w1: size of second WORD data section
+ sda_d1: size of second DOUBLE WORD data section
+ OUTPUT:
+ offset (always positive) from the beginning of sda_d0 if OK
+ a negative error value if fail
+ NOTE:
+ these 7 sections have to be located back to back if exist
+ a pass in 0 value for non-existing section */
+
+/* Due to the interpretation of simm15 field of load/store depending on
+ data accessing size, the organization of base register relative data shall
+ like the following figure
+ -------------------------------------------
+ | DOUBLE WORD sized data (range +/- 128K)
+ -------------------------------------------
+ | WORD sized data (range +/- 64K)
+ -------------------------------------------
+ | HALF WORD sized data (range +/- 32K)
+ -------------------------------------------
+ | BYTE sized data (range +/- 16K)
+ -------------------------------------------
+ | HALF WORD sized data (range +/- 32K)
+ -------------------------------------------
+ | WORD sized data (range +/- 64K)
+ -------------------------------------------
+ | DOUBLE WORD sized data (range +/- 128K)
+ -------------------------------------------
+ Its base register shall be set to access these data freely. */
+
+/* We have to figure out the SDA_BASE value, so that we can adjust the
+ symbol value correctly. We look up the symbol _SDA_BASE_ in the output
+ BFD. If we can't find it, we're stuck. We cache it in the ELF
+ target data. We don't need to adjust the symbol value for an
+ external symbol if we are producing relocatable output. */
+
+static asection *sda_rela_sec = NULL;
+
+#define SDA_SECTION_NUM 10
+
+static bfd_reloc_status_type
+nds32_elf_final_sda_base (bfd *output_bfd, struct bfd_link_info *info,
+ bfd_vma *psb, bfd_boolean add_symbol)
+{
+ int relax_fp_as_gp;
+ struct elf_nds32_link_hash_table *table;
+ struct bfd_link_hash_entry *h, *h2;
+ long unsigned int total = 0;
+
+ h = bfd_link_hash_lookup (info->hash, "_SDA_BASE_", FALSE, FALSE, TRUE);
+ if (!h || (h->type != bfd_link_hash_defined && h->type != bfd_link_hash_defweak))
+ {
+ asection *first = NULL, *final = NULL, *temp;
+ bfd_vma sda_base;
+ /* The first section must be 4-byte aligned to promise _SDA_BASE_ being
+ 4 byte-aligned. Therefore, it has to set the first section ".data"
+ 4 byte-aligned. */
+ static const char sec_name[SDA_SECTION_NUM][10] =
+ {
+ ".data", ".got", ".sdata_d", ".sdata_w", ".sdata_h", ".sdata_b",
+ ".sbss_b", ".sbss_h", ".sbss_w", ".sbss_d"
+ };
+ size_t i = 0;
+
+ if (output_bfd->sections == NULL)
+ {
+ *psb = elf_gp (output_bfd);
+ return bfd_reloc_ok;
+ }
+
+ /* Get the first and final section. */
+ while (i < sizeof (sec_name) / sizeof (sec_name [0]))
+ {
+ temp = bfd_get_section_by_name (output_bfd, sec_name[i]);
+ if (temp && !first && (temp->size != 0 || temp->rawsize != 0))
+ first = temp;
+ if (temp && (temp->size != 0 || temp->rawsize != 0))
+ final = temp;
+
+ /* Summarize the sections in order to check if joining .bss. */
+ if (temp && temp->size != 0)
+ total += temp->size;
+ else if (temp && temp->rawsize != 0)
+ total += temp->rawsize;
+
+ i++;
+ }
+
+ /* Check .bss size. */
+ temp = bfd_get_section_by_name (output_bfd, ".bss");
+ if (temp)
+ {
+ if (temp->size != 0)
+ total += temp->size;
+ else if (temp->rawsize != 0)
+ total += temp->rawsize;
+
+ if (total < 0x80000)
+ {
+ if (!first && (temp->size != 0 || temp->rawsize != 0))
+ first = temp;
+ if ((temp->size != 0 || temp->rawsize != 0))
+ final = temp;
+ }
+ }
+
+ if (first && final)
+ {
+ /* The middle of data region. */
+ sda_base = final->vma / 2 + final->rawsize / 2 + first->vma / 2;
+
+ /* Find the section sda_base located. */
+ i = 0;
+ while (i < sizeof (sec_name) / sizeof (sec_name [0]))
+ {
+ final = bfd_get_section_by_name (output_bfd, sec_name[i]);
+ if (final && (final->size != 0 || final->rawsize != 0)
+ && sda_base >= final->vma)
+ {
+ first = final;
+ i++;
+ }
+ else
+ break;
+ }
+ }
+ else
+ {
+ /* There is not any data section in output bfd, and set _SDA_BASE_ in
+ first output section. */
+ first = output_bfd->sections;
+ while (first && first->size == 0 && first->rawsize == 0)
+ first = first->next;
+ if (!first)
+ {
+ *psb = elf_gp (output_bfd);
+ return bfd_reloc_ok;
+ }
+ sda_base = first->vma + first->rawsize;
+ }
+
+ sda_base -= first->vma;
+ sda_base = sda_base & (~7);
+
+ if (!_bfd_generic_link_add_one_symbol
+ (info, output_bfd, "_SDA_BASE_", BSF_GLOBAL | BSF_WEAK, first,
+ (bfd_vma) sda_base, (const char *) NULL, FALSE,
+ get_elf_backend_data (output_bfd)->collect, &h))
+ return FALSE;
+
+ sda_rela_sec = first;
+
+ table = nds32_elf_hash_table (info);
+ relax_fp_as_gp = table->relax_fp_as_gp;
+ if (relax_fp_as_gp)
+ {
+ h2 = bfd_link_hash_lookup (info->hash, FP_BASE_NAME,
+ FALSE, FALSE, FALSE);
+ /* Define a weak FP_BASE_NAME here to prevent the undefined symbol.
+ And set FP equal to SDA_BASE to do relaxation for
+ la $fp, _FP_BASE_. */
+ if (!_bfd_generic_link_add_one_symbol
+ (info, output_bfd, FP_BASE_NAME, BSF_GLOBAL | BSF_WEAK,
+ first, (bfd_vma) sda_base, (const char *) NULL,
+ FALSE, get_elf_backend_data (output_bfd)->collect, &h2))
+ return FALSE;
+ }
+ }
+
+ if (add_symbol == TRUE)
+ {
+ if (h)
+ {
+ /* Now set gp. */
+ elf_gp (output_bfd) = (h->u.def.value
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
+ }
+ else
+ {
+ (*_bfd_error_handler) (_("error: Can't find symbol: _SDA_BASE_."));
+ return bfd_reloc_dangerous;
+ }
+ }
+
+ *psb = h->u.def.value + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset;
+ return bfd_reloc_ok;
+}
+
+
+/* Return size of a PLT entry. */
+#define elf_nds32_sizeof_plt(info) PLT_ENTRY_SIZE
+
+
+/* Create an entry in an nds32 ELF linker hash table. */
+
+static struct bfd_hash_entry *
+nds32_elf_link_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
+{
+ struct elf_nds32_link_hash_entry *ret;
+
+ ret = (struct elf_nds32_link_hash_entry *) entry;
+
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (ret == NULL)
+ ret = (struct elf_nds32_link_hash_entry *)
+ bfd_hash_allocate (table, sizeof (struct elf_nds32_link_hash_entry));
+
+ if (ret == NULL)
+ return (struct bfd_hash_entry *) ret;
+
+ /* Call the allocation method of the superclass. */
+ ret = (struct elf_nds32_link_hash_entry *)
+ _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, table, string);
+
+ if (ret != NULL)
+ {
+ struct elf_nds32_link_hash_entry *eh;
+
+ eh = (struct elf_nds32_link_hash_entry *) ret;
+ eh->dyn_relocs = NULL;
+ eh->tls_type = GOT_UNKNOWN;
+ }
+
+ return (struct bfd_hash_entry *) ret;
+}
+
+/* Create an nds32 ELF linker hash table. */
+
+static struct bfd_link_hash_table *
+nds32_elf_link_hash_table_create (bfd *abfd)
+{
+ struct elf_nds32_link_hash_table *ret;
+
+ bfd_size_type amt = sizeof (struct elf_nds32_link_hash_table);
+
+ ret = (struct elf_nds32_link_hash_table *) bfd_zmalloc (amt);
+ if (ret == NULL)
+ return NULL;
+
+ /* patch tag. */
+ if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
+ nds32_elf_link_hash_newfunc,
+ sizeof (struct elf_nds32_link_hash_entry),
+ NDS32_ELF_DATA))
+ {
+ free (ret);
+ return NULL;
+ }
+
+ ret->sgot = NULL;
+ ret->sgotplt = NULL;
+ ret->srelgot = NULL;
+ ret->splt = NULL;
+ ret->srelplt = NULL;
+ ret->sdynbss = NULL;
+ ret->srelbss = NULL;
+ ret->sym_ld_script = NULL;
+ ret->ex9_export_file = NULL;
+ ret->ex9_import_file = NULL;
+
+ return &ret->root.root;
+}
+
+/* Create .got, .gotplt, and .rela.got sections in DYNOBJ, and set up
+ shortcuts to them in our hash table. */
+
+static bfd_boolean
+create_got_section (bfd *dynobj, struct bfd_link_info *info)
+{
+ struct elf_nds32_link_hash_table *htab;
+
+ if (!_bfd_elf_create_got_section (dynobj, info))
+ return FALSE;
+
+ htab = nds32_elf_hash_table (info);
+ htab->sgot = bfd_get_section_by_name (dynobj, ".got");
+ htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
+ if (!htab->sgot || !htab->sgotplt)
+ abort ();
+
+ /* _bfd_elf_create_got_section will create it for us. */
+ htab->srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+ if (htab->srelgot == NULL
+ || !bfd_set_section_flags (dynobj, htab->srelgot,
+ (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY | SEC_LINKER_CREATED
+ | SEC_READONLY))
+ || !bfd_set_section_alignment (dynobj, htab->srelgot, 2))
+ return FALSE;
+
+ return TRUE;
+}
+
+/* Create dynamic sections when linking against a dynamic object. */
+
+static bfd_boolean
+nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
+{
+ struct elf_nds32_link_hash_table *htab;
+ flagword flags, pltflags;
+ register asection *s;
+ const struct elf_backend_data *bed;
+ int ptralign = 2; /* 32-bit */
+
+ bed = get_elf_backend_data (abfd);
+
+ htab = nds32_elf_hash_table (info);
+
+ /* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and
+ .rel[a].bss sections. */
+
+ flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED);
+
+ pltflags = flags;
+ pltflags |= SEC_CODE;
+ if (bed->plt_not_loaded)
+ pltflags &= ~(SEC_LOAD | SEC_HAS_CONTENTS);
+ if (bed->plt_readonly)
+ pltflags |= SEC_READONLY;
+
+ s = bfd_make_section (abfd, ".plt");
+ htab->splt = s;
+ if (s == NULL
+ || !bfd_set_section_flags (abfd, s, pltflags)
+ || !bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ return FALSE;
+
+ if (bed->want_plt_sym)
+ {
+ /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
+ .plt section. */
+ struct bfd_link_hash_entry *bh = NULL;
+ struct elf_link_hash_entry *h;
+
+ if (!(_bfd_generic_link_add_one_symbol
+ (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
+ (bfd_vma) 0, (const char *) NULL, FALSE,
+ get_elf_backend_data (abfd)->collect, &bh)))
+ return FALSE;
+
+ h = (struct elf_link_hash_entry *) bh;
+ h->def_regular = 1;
+ h->type = STT_OBJECT;
+
+ if (info->shared && !bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
+ s = bfd_make_section (abfd,
+ bed->default_use_rela_p ? ".rela.plt" : ".rel.plt");
+ htab->srelplt = s;
+ if (s == NULL
+ || !bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || !bfd_set_section_alignment (abfd, s, ptralign))
+ return FALSE;
+
+ if (htab->sgot == NULL && !create_got_section (abfd, info))
+ return FALSE;
+
+ {
+ const char *secname;
+ char *relname;
+ flagword secflags;
+ asection *sec;
+
+ for (sec = abfd->sections; sec; sec = sec->next)
+ {
+ secflags = bfd_get_section_flags (abfd, sec);
+ if ((secflags & (SEC_DATA | SEC_LINKER_CREATED))
+ || ((secflags & SEC_HAS_CONTENTS) != SEC_HAS_CONTENTS))
+ continue;
+ secname = bfd_get_section_name (abfd, sec);
+ relname = (char *) bfd_malloc ((bfd_size_type) strlen (secname) + 6);
+ strcpy (relname, ".rela");
+ strcat (relname, secname);
+ if (bfd_get_section_by_name (abfd, secname))
+ continue;
+ s = bfd_make_section (abfd, relname);
+ if (s == NULL
+ || !bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || !bfd_set_section_alignment (abfd, s, ptralign))
+ return FALSE;
+ }
+ }
+
+ if (bed->want_dynbss)
+ {
+ /* The .dynbss section is a place to put symbols which are defined
+ by dynamic objects, are referenced by regular objects, and are
+ not functions. We must allocate space for them in the process
+ image and use a R_*_COPY reloc to tell the dynamic linker to
+ initialize them at run time. The linker script puts the .dynbss
+ section into the .bss section of the final image. */
+ s = bfd_make_section (abfd, ".dynbss");
+ htab->sdynbss = s;
+ if (s == NULL
+ || !bfd_set_section_flags (abfd, s, SEC_ALLOC | SEC_LINKER_CREATED))
+ return FALSE;
+ /* The .rel[a].bss section holds copy relocs. This section is not
+ normally needed. We need to create it here, though, so that the
+ linker will map it to an output section. We can't just create it
+ only if we need it, because we will not know whether we need it
+ until we have seen all the input files, and the first time the
+ main linker code calls BFD after examining all the input files
+ (size_dynamic_sections) the input sections have already been
+ mapped to the output sections. If the section turns out not to
+ be needed, we can discard it later. We will never need this
+ section when generating a shared object, since they do not use
+ copy relocs. */
+ if (!info->shared)
+ {
+ s = bfd_make_section (abfd, (bed->default_use_rela_p
+ ? ".rela.bss" : ".rel.bss"));
+ htab->srelbss = s;
+ if (s == NULL
+ || !bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || !bfd_set_section_alignment (abfd, s, ptralign))
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+/* Copy the extra info we tack onto an elf_link_hash_entry. */
+static void
+nds32_elf_copy_indirect_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *dir,
+ struct elf_link_hash_entry *ind)
+{
+ struct elf_nds32_link_hash_entry *edir, *eind;
+
+ edir = (struct elf_nds32_link_hash_entry *) dir;
+ eind = (struct elf_nds32_link_hash_entry *) ind;
+
+ if (eind->dyn_relocs != NULL)
+ {
+ if (edir->dyn_relocs != NULL)
+ {
+ struct elf_nds32_dyn_relocs **pp;
+ struct elf_nds32_dyn_relocs *p;
+
+ if (ind->root.type == bfd_link_hash_indirect)
+ abort ();
+
+ /* Add reloc counts against the weak sym to the strong sym
+ list. Merge any entries against the same section. */
+ for (pp = &eind->dyn_relocs; (p = *pp) != NULL;)
+ {
+ struct elf_nds32_dyn_relocs *q;
+
+ for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ if (q->sec == p->sec)
+ {
+ q->pc_count += p->pc_count;
+ q->count += p->count;
+ *pp = p->next;
+ break;
+ }
+ if (q == NULL)
+ pp = &p->next;
+ }
+ *pp = edir->dyn_relocs;
+ }
+
+ edir->dyn_relocs = eind->dyn_relocs;
+ eind->dyn_relocs = NULL;
+ }
+
+ _bfd_elf_link_hash_copy_indirect (info, dir, ind);
+}
+
+
+/* Adjust a symbol defined by a dynamic object and referenced by a
+ regular object. The current definition is in some section of the
+ dynamic object, but we're not including those sections. We have to
+ change the definition to something the rest of the link can
+ understand. */
+
+static bfd_boolean
+nds32_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *h)
+{
+ struct elf_nds32_link_hash_table *htab;
+ struct elf_nds32_link_hash_entry *eh;
+ struct elf_nds32_dyn_relocs *p;
+ bfd *dynobj;
+ asection *s;
+ unsigned int power_of_two;
+
+ dynobj = elf_hash_table (info)->dynobj;
+
+ /* Make sure we know what is going on here. */
+ BFD_ASSERT (dynobj != NULL
+ && (h->needs_plt
+ || h->u.weakdef != NULL
+ || (h->def_dynamic && h->ref_regular && !h->def_regular)));
+
+
+ /* If this is a function, put it in the procedure linkage table. We
+ will fill in the contents of the procedure linkage table later,
+ when we know the address of the .got section. */
+ if (h->type == STT_FUNC || h->needs_plt)
+ {
+ if (!info->shared
+ && !h->def_dynamic
+ && !h->ref_dynamic
+ && h->root.type != bfd_link_hash_undefweak
+ && h->root.type != bfd_link_hash_undefined)
+ {
+ /* This case can occur if we saw a PLT reloc in an input
+ file, but the symbol was never referred to by a dynamic
+ object. In such a case, we don't actually need to build
+ a procedure linkage table, and we can just do a PCREL
+ reloc instead. */
+ h->plt.offset = (bfd_vma) - 1;
+ h->needs_plt = 0;
+ }
+
+ return TRUE;
+ }
+ else
+ h->plt.offset = (bfd_vma) - 1;
+
+ /* If this is a weak symbol, and there is a real definition, the
+ processor independent code will have arranged for us to see the
+ real definition first, and we can just use the same value. */
+ if (h->u.weakdef != NULL)
+ {
+ BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
+ || h->u.weakdef->root.type == bfd_link_hash_defweak);
+ h->root.u.def.section = h->u.weakdef->root.u.def.section;
+ h->root.u.def.value = h->u.weakdef->root.u.def.value;
+ return TRUE;
+ }
+
+ /* This is a reference to a symbol defined by a dynamic object which
+ is not a function. */
+
+ /* If we are creating a shared library, we must presume that the
+ only references to the symbol are via the global offset table.
+ For such cases we need not do anything here; the relocations will
+ be handled correctly by relocate_section. */
+ if (info->shared)
+ return TRUE;
+
+ /* If there are no references to this symbol that do not use the
+ GOT, we don't need to generate a copy reloc. */
+ if (!h->non_got_ref)
+ return TRUE;
+
+ /* If -z nocopyreloc was given, we won't generate them either. */
+ if (info->nocopyreloc)
+ {
+ h->non_got_ref = 0;
+ return TRUE;
+ }
+
+ eh = (struct elf_nds32_link_hash_entry *) h;
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ {
+ s = p->sec->output_section;
+ if (s != NULL && (s->flags & (SEC_READONLY | SEC_HAS_CONTENTS)) != 0)
+ break;
+ }
+
+ /* If we didn't find any dynamic relocs in sections which needs the
+ copy reloc, then we'll be keeping the dynamic relocs and avoiding
+ the copy reloc. */
+ if (p == NULL)
+ {
+ h->non_got_ref = 0;
+ return TRUE;
+ }
+
+ /* We must allocate the symbol in our .dynbss section, which will
+ become part of the .bss section of the executable. There will be
+ an entry for this symbol in the .dynsym section. The dynamic
+ object will contain position independent code, so all references
+ from the dynamic object to this symbol will go through the global
+ offset table. The dynamic linker will use the .dynsym entry to
+ determine the address it must put in the global offset table, so
+ both the dynamic object and the regular object will refer to the
+ same memory location for the variable. */
+
+ htab = nds32_elf_hash_table (info);
+ s = htab->sdynbss;
+ BFD_ASSERT (s != NULL);
+
+ /* We must generate a R_NDS32_COPY reloc to tell the dynamic linker
+ to copy the initial value out of the dynamic object and into the
+ runtime process image. We need to remember the offset into the
+ .rela.bss section we are going to use. */
+ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
+ {
+ asection *srel;
+
+ srel = htab->srelbss;
+ BFD_ASSERT (srel != NULL);
+ srel->size += sizeof (Elf32_External_Rela);
+ h->needs_copy = 1;
+ }
+
+ /* We need to figure out the alignment required for this symbol. I
+ have no idea how ELF linkers handle this. */
+ power_of_two = bfd_log2 (h->size);
+ if (power_of_two > 3)
+ power_of_two = 3;
+
+ /* Apply the required alignment. */
+ s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
+ if (power_of_two > bfd_get_section_alignment (dynobj, s))
+ {
+ if (!bfd_set_section_alignment (dynobj, s, power_of_two))
+ return FALSE;
+ }
+
+ /* Define the symbol as being at this point in the section. */
+ h->root.u.def.section = s;
+ h->root.u.def.value = s->size;
+
+ /* Increment the section size to make room for the symbol. */
+ s->size += h->size;
+
+ return TRUE;
+}
+
+/* Allocate space in .plt, .got and associated reloc sections for
+ dynamic relocs. */
+
+static bfd_boolean
+allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
+{
+ struct bfd_link_info *info;
+ struct elf_nds32_link_hash_table *htab;
+ struct elf_nds32_link_hash_entry *eh;
+ struct elf_nds32_dyn_relocs *p;
+
+ if (h->root.type == bfd_link_hash_indirect)
+ return TRUE;
+
+ if (h->root.type == bfd_link_hash_warning)
+ /* When warning symbols are created, they **replace** the "real"
+ entry in the hash table, thus we never get to see the real
+ symbol in a hash traversal. So look at it now. */
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ info = (struct bfd_link_info *) inf;
+ htab = nds32_elf_hash_table (info);
+
+ eh = (struct elf_nds32_link_hash_entry *) h;
+
+ if (htab->root.dynamic_sections_created && h->plt.refcount > 0)
+ {
+ /* Make sure this symbol is output as a dynamic symbol.
+ Undefined weak syms won't yet be marked as dynamic. */
+ if (h->dynindx == -1 && !h->forced_local)
+ {
+ if (!bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h))
+ {
+ asection *s = htab->splt;
+
+ /* If this is the first .plt entry, make room for the special
+ first entry. */
+ if (s->size == 0)
+ s->size += PLT_ENTRY_SIZE;
+
+ h->plt.offset = s->size;
+
+ /* If this symbol is not defined in a regular file, and we are
+ not generating a shared library, then set the symbol to this
+ location in the .plt. This is required to make function
+ pointers compare as equal between the normal executable and
+ the shared library. */
+ if (!info->shared && !h->def_regular)
+ {
+ h->root.u.def.section = s;
+ h->root.u.def.value = h->plt.offset;
+ }
+
+ /* Make room for this entry. */
+ s->size += PLT_ENTRY_SIZE;
+
+ /* We also need to make an entry in the .got.plt section, which
+ will be placed in the .got section by the linker script. */
+ htab->sgotplt->size += 4;
+
+ /* We also need to make an entry in the .rel.plt section. */
+ htab->srelplt->size += sizeof (Elf32_External_Rela);
+ }
+ else
+ {
+ h->plt.offset = (bfd_vma) - 1;
+ h->needs_plt = 0;
+ }
+ }
+ else
+ {
+ h->plt.offset = (bfd_vma) - 1;
+ h->needs_plt = 0;
+ }
+
+ if (h->got.refcount > 0)
+ {
+ asection *s;
+ bfd_boolean dyn;
+ int tls_type = elf32_nds32_hash_entry (h)->tls_type;
+
+ /* Make sure this symbol is output as a dynamic symbol.
+ Undefined weak syms won't yet be marked as dynamic. */
+ if (h->dynindx == -1 && !h->forced_local)
+ {
+ if (!bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
+ s = htab->sgot;
+ h->got.offset = s->size;
+
+ if (tls_type == GOT_UNKNOWN)
+ abort ();
+ else if (tls_type == GOT_NORMAL
+ || tls_type == GOT_TLS_IE)
+ /* Need a GOT slot. */
+ s->size += 4;
+
+ dyn = htab->root.dynamic_sections_created;
+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h))
+ htab->srelgot->size += sizeof (Elf32_External_Rela);
+ }
+ else
+ h->got.offset = (bfd_vma) - 1;
+
+ if (eh->dyn_relocs == NULL)
+ return TRUE;
+
+ /* In the shared -Bsymbolic case, discard space allocated for
+ dynamic pc-relative relocs against symbols which turn out to be
+ defined in regular objects. For the normal shared case, discard
+ space for pc-relative relocs that have become local due to symbol
+ visibility changes. */
+
+ if (info->shared)
+ {
+ if (h->def_regular && (h->forced_local || info->symbolic))
+ {
+ struct elf_nds32_dyn_relocs **pp;
+
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
+ {
+ p->count -= p->pc_count;
+ p->pc_count = 0;
+ if (p->count == 0)
+ *pp = p->next;
+ else
+ pp = &p->next;
+ }
+ }
+ }
+ else
+ {
+ /* For the non-shared case, discard space for relocs against
+ symbols which turn out to need copy relocs or are not dynamic. */
+
+ if (!h->non_got_ref
+ && ((h->def_dynamic
+ && !h->def_regular)
+ || (htab->root.dynamic_sections_created
+ && (h->root.type == bfd_link_hash_undefweak
+ || h->root.type == bfd_link_hash_undefined))))
+ {
+ /* Make sure this symbol is output as a dynamic symbol.
+ Undefined weak syms won't yet be marked as dynamic. */
+ if (h->dynindx == -1 && !h->forced_local)
+ {
+ if (!bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
+ /* If that succeeded, we know we'll be keeping all the
+ relocs. */
+ if (h->dynindx != -1)
+ goto keep;
+ }
+
+ eh->dyn_relocs = NULL;
+
+ keep:;
+ }
+
+ /* Finally, allocate space. */
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ {
+ asection *sreloc = elf_section_data (p->sec)->sreloc;
+ sreloc->size += p->count * sizeof (Elf32_External_Rela);
+ }
+
+ return TRUE;
+}
+
+/* Find any dynamic relocs that apply to read-only sections. */
+
+static bfd_boolean
+readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf)
+{
+ struct elf_nds32_link_hash_entry *eh;
+ struct elf_nds32_dyn_relocs *p;
+
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ eh = (struct elf_nds32_link_hash_entry *) h;
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ {
+ asection *s = p->sec->output_section;
+
+ if (s != NULL && (s->flags & SEC_READONLY) != 0)
+ {
+ struct bfd_link_info *info = (struct bfd_link_info *) inf;
+
+ info->flags |= DF_TEXTREL;
+
+ /* Not an error, just cut short the traversal. */
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+/* Set the sizes of the dynamic sections. */
+
+static bfd_boolean
+nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
+{
+ struct elf_nds32_link_hash_table *htab;
+ bfd *dynobj;
+ asection *s;
+ bfd_boolean relocs;
+ bfd *ibfd;
+
+ htab = nds32_elf_hash_table (info);
+ dynobj = htab->root.dynobj;
+ BFD_ASSERT (dynobj != NULL);
+
+ if (htab->root.dynamic_sections_created)
+ {
+ /* Set the contents of the .interp section to the interpreter. */
+ if (!info->shared)
+ {
+ s = bfd_get_section_by_name (dynobj, ".interp");
+ BFD_ASSERT (s != NULL);
+ s->size = sizeof ELF_DYNAMIC_INTERPRETER;
+ s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
+ }
+ }
+
+ /* Set up .got offsets for local syms, and space for local dynamic
+ relocs. */
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
+ {
+ bfd_signed_vma *local_got;
+ bfd_signed_vma *end_local_got;
+ bfd_size_type locsymcount;
+ Elf_Internal_Shdr *symtab_hdr;
+ asection *srel;
+
+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour)
+ continue;
+
+ for (s = ibfd->sections; s != NULL; s = s->next)
+ {
+ struct elf_nds32_dyn_relocs *p;
+
+ for (p = ((struct elf_nds32_dyn_relocs *)
+ elf_section_data (s)->local_dynrel);
+ p != NULL; p = p->next)
+ {
+ if (!bfd_is_abs_section (p->sec)
+ && bfd_is_abs_section (p->sec->output_section))
+ {
+ /* Input section has been discarded, either because
+ it is a copy of a linkonce section or due to
+ linker script /DISCARD/, so we'll be discarding
+ the relocs too. */
+ }
+ else if (p->count != 0)
+ {
+ srel = elf_section_data (p->sec)->sreloc;
+ srel->size += p->count * sizeof (Elf32_External_Rela);
+ if ((p->sec->output_section->flags & SEC_READONLY) != 0)
+ info->flags |= DF_TEXTREL;
+ }
+ }
+ }
+
+ local_got = elf_local_got_refcounts (ibfd);
+ if (!local_got)
+ continue;
+
+ symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+ locsymcount = symtab_hdr->sh_info;
+ end_local_got = local_got + locsymcount;
+ s = htab->sgot;
+ srel = htab->srelgot;
+ for (; local_got < end_local_got; ++local_got)
+ {
+ if (*local_got > 0)
+ {
+ *local_got = s->size;
+ s->size += 4;
+ if (info->shared)
+ srel->size += sizeof (Elf32_External_Rela);
+ }
+ else
+ *local_got = (bfd_vma) - 1;
+ }
+ }
+
+ /* Allocate global sym .plt and .got entries, and space for global
+ sym dynamic relocs. */
+ elf_link_hash_traverse (&htab->root, allocate_dynrelocs, (void *) info);
+
+ /* We now have determined the sizes of the various dynamic sections.
+ Allocate memory for them. */
+ relocs = FALSE;
+ for (s = dynobj->sections; s != NULL; s = s->next)
+ {
+ if ((s->flags & SEC_LINKER_CREATED) == 0)
+ continue;
+
+ if (s == htab->splt)
+ {
+ /* Strip this section if we don't need it; see the
+ comment below. */
+ }
+ else if (s == htab->sgot)
+ {
+ got_size += s->size;
+ }
+ else if (s == htab->sgotplt)
+ {
+ got_size += s->size;
+ }
+ else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
+ {
+ if (s->size != 0 && s != htab->srelplt)
+ relocs = TRUE;
+
+ /* We use the reloc_count field as a counter if we need
+ to copy relocs into the output file. */
+ s->reloc_count = 0;
+ }
+ else
+ {
+ /* It's not one of our sections, so don't allocate space. */
+ continue;
+ }
+
+ if (s->size == 0)
+ {
+ /* If we don't need this section, strip it from the
+ output file. This is mostly to handle .rela.bss and
+ .rela.plt. We must create both sections in
+ create_dynamic_sections, because they must be created
+ before the linker maps input sections to output
+ sections. The linker does that before
+ adjust_dynamic_symbol is called, and it is that
+ function which decides whether anything needs to go
+ into these sections. */
+ s->flags |= SEC_EXCLUDE;
+ continue;
+ }
+
+ /* Allocate memory for the section contents. We use bfd_zalloc
+ here in case unused entries are not reclaimed before the
+ section's contents are written out. This should not happen,
+ but this way if it does, we get a R_NDS32_NONE reloc instead
+ of garbage. */
+ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
+ if (s->contents == NULL)
+ return FALSE;
+ }
+
+
+ if (htab->root.dynamic_sections_created)
+ {
+ /* Add some entries to the .dynamic section. We fill in the
+ values later, in nds32_elf_finish_dynamic_sections, but we
+ must add the entries now so that we get the correct size for
+ the .dynamic section. The DT_DEBUG entry is filled in by the
+ dynamic linker and used by the debugger. */
+#define add_dynamic_entry(TAG, VAL) \
+ _bfd_elf_add_dynamic_entry (info, TAG, VAL)
+
+ if (!info->shared)
+ {
+ if (!add_dynamic_entry (DT_DEBUG, 0))
+ return FALSE;
+ }
+
+ if (htab->splt->size != 0)
+ {
+ if (!add_dynamic_entry (DT_PLTGOT, 0)
+ || !add_dynamic_entry (DT_PLTRELSZ, 0)
+ || !add_dynamic_entry (DT_PLTREL, DT_RELA)
+ || !add_dynamic_entry (DT_JMPREL, 0))
+ return FALSE;
+ }
+
+ if (relocs)
+ {
+ if (!add_dynamic_entry (DT_RELA, 0)
+ || !add_dynamic_entry (DT_RELASZ, 0)
+ || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela)))
+ return FALSE;
+
+ /* If any dynamic relocs apply to a read-only section,
+ then we need a DT_TEXTREL entry. */
+ if ((info->flags & DF_TEXTREL) == 0)
+ elf_link_hash_traverse (&htab->root, readonly_dynrelocs,
+ (void *) info);
+
+ if ((info->flags & DF_TEXTREL) != 0)
+ {
+ if (!add_dynamic_entry (DT_TEXTREL, 0))
+ return FALSE;
+ }
+ }
+ }
+#undef add_dynamic_entry
+
+ return TRUE;
+}
+
+static bfd_reloc_status_type
+nds32_relocate_contents (reloc_howto_type *howto, bfd *input_bfd,
+ bfd_vma relocation, bfd_byte *location)
+{
+ int size;
+ bfd_vma x = 0;
+ bfd_reloc_status_type flag;
+ unsigned int rightshift = howto->rightshift;
+ unsigned int bitpos = howto->bitpos;
+
+ /* If the size is negative, negate RELOCATION. This isn't very
+ general. */
+ if (howto->size < 0)
+ relocation = -relocation;
+
+ /* Get the value we are going to relocate. */
+ size = bfd_get_reloc_size (howto);
+ switch (size)
+ {
+ default:
+ case 0:
+ case 1:
+ case 8:
+ abort ();
+ break;
+ case 2:
+ x = bfd_getb16 (location);
+ break;
+ case 4:
+ x = bfd_getb32 (location);
+ break;
+ }
+
+ /* Check for overflow. FIXME: We may drop bits during the addition
+ which we don't check for. We must either check at every single
+ operation, which would be tedious, or we must do the computations
+ in a type larger than bfd_vma, which would be inefficient. */
+ flag = bfd_reloc_ok;
+ if (howto->complain_on_overflow != complain_overflow_dont)
+ {
+ bfd_vma addrmask, fieldmask, signmask, ss;
+ bfd_vma a, b, sum;
+
+ /* Get the values to be added together. For signed and unsigned
+ relocations, we assume that all values should be truncated to
+ the size of an address. For bitfields, all the bits matter.
+ See also bfd_check_overflow. */
+ fieldmask = N_ONES (howto->bitsize);
+ signmask = ~fieldmask;
+ addrmask = N_ONES (bfd_arch_bits_per_address (input_bfd)) | fieldmask;
+ a = (relocation & addrmask) >> rightshift;
+ b = (x & howto->src_mask & addrmask) >> bitpos;
+
+ switch (howto->complain_on_overflow)
+ {
+ case complain_overflow_signed:
+ /* If any sign bits are set, all sign bits must be set.
+ That is, A must be a valid negative address after
+ shifting. */
+ signmask = ~(fieldmask >> 1);
+ /* Fall through. */
+
+ case complain_overflow_bitfield:
+ /* Much like the signed check, but for a field one bit
+ wider. We allow a bitfield to represent numbers in the
+ range -2**n to 2**n-1, where n is the number of bits in the
+ field. Note that when bfd_vma is 32 bits, a 32-bit reloc
+ can't overflow, which is exactly what we want. */
+ ss = a & signmask;
+ if (ss != 0 && ss != ((addrmask >> rightshift) & signmask))
+ flag = bfd_reloc_overflow;
+
+ /* We only need this next bit of code if the sign bit of B
+ is below the sign bit of A. This would only happen if
+ SRC_MASK had fewer bits than BITSIZE. Note that if
+ SRC_MASK has more bits than BITSIZE, we can get into
+ trouble; we would need to verify that B is in range, as
+ we do for A above. */
+ ss = ((~howto->src_mask) >> 1) & howto->src_mask;
+ ss >>= bitpos;
+
+ /* Set all the bits above the sign bit. */
+ b = (b ^ ss) - ss;
+
+ /* Now we can do the addition. */
+ sum = a + b;
+
+ /* See if the result has the correct sign. Bits above the
+ sign bit are junk now; ignore them. If the sum is
+ positive, make sure we did not have all negative inputs;
+ if the sum is negative, make sure we did not have all
+ positive inputs. The test below looks only at the sign
+ bits, and it really just
+ SIGN (A) == SIGN (B) && SIGN (A) != SIGN (SUM)
+
+ We mask with addrmask here to explicitly allow an address
+ wrap-around. The Linux kernel relies on it, and it is
+ the only way to write assembler code which can run when
+ loaded at a location 0x80000000 away from the location at
+ which it is linked. */
+ if (((~(a ^ b)) & (a ^ sum)) & signmask & addrmask)
+ flag = bfd_reloc_overflow;
+
+ break;
+
+ case complain_overflow_unsigned:
+ /* Checking for an unsigned overflow is relatively easy:
+ trim the addresses and add, and trim the result as well.
+ Overflow is normally indicated when the result does not
+ fit in the field. However, we also need to consider the
+ case when, e.g., fieldmask is 0x7fffffff or smaller, an
+ input is 0x80000000, and bfd_vma is only 32 bits; then we
+ will get sum == 0, but there is an overflow, since the
+ inputs did not fit in the field. Instead of doing a
+ separate test, we can check for this by or-ing in the
+ operands when testing for the sum overflowing its final
+ field. */
+ sum = (a + b) & addrmask;
+ if ((a | b | sum) & signmask)
+ flag = bfd_reloc_overflow;
+ break;
+
+ default:
+ abort ();
+ }
+ }
+
+ /* Put RELOCATION in the right bits. */
+ relocation >>= (bfd_vma) rightshift;
+ relocation <<= (bfd_vma) bitpos;
+
+ /* Add RELOCATION to the right bits of X. */
+ /* FIXME : 090616
+ Because the relaxation may generate duplicate relocation at one address,
+ an addition to immediate in the instruction may cause the relocation added
+ several times.
+ This bug should be fixed in assembler, but a check is also needed here. */
+ if (howto->partial_inplace)
+ x = ((x & ~howto->dst_mask)
+ | (((x & howto->src_mask) + relocation) & howto->dst_mask));
+ else
+ x = ((x & ~howto->dst_mask) | ((relocation) & howto->dst_mask));
+
+
+ /* Put the relocated value back in the object file. */
+ switch (size)
+ {
+ default:
+ case 0:
+ case 1:
+ case 8:
+ abort ();
+ break;
+ case 2:
+ bfd_putb16 (x, location);
+ break;
+ case 4:
+ bfd_putb32 (x, location);
+ break;
+ }
+
+ return flag;
+}
+
+static bfd_reloc_status_type
+nds32_elf_final_link_relocate (reloc_howto_type *howto, bfd *input_bfd,
+ asection *input_section, bfd_byte *contents,
+ bfd_vma address, bfd_vma value, bfd_vma addend)
+{
+ bfd_vma relocation;
+
+ /* Sanity check the address. */
+ if (address > bfd_get_section_limit (input_bfd, input_section))
+ return bfd_reloc_outofrange;
+
+ /* This function assumes that we are dealing with a basic relocation
+ against a symbol. We want to compute the value of the symbol to
+ relocate to. This is just VALUE, the value of the symbol, plus
+ ADDEND, any addend associated with the reloc. */
+ relocation = value + addend;
+
+ /* If the relocation is PC relative, we want to set RELOCATION to
+ the distance between the symbol (currently in RELOCATION) and the
+ location we are relocating. Some targets (e.g., i386-aout)
+ arrange for the contents of the section to be the negative of the
+ offset of the location within the section; for such targets
+ pcrel_offset is FALSE. Other targets (e.g., m88kbcs or ELF)
+ simply leave the contents of the section as zero; for such
+ targets pcrel_offset is TRUE. If pcrel_offset is FALSE we do not
+ need to subtract out the offset of the location within the
+ section (which is just ADDRESS). */
+ if (howto->pc_relative)
+ {
+ relocation -= (input_section->output_section->vma
+ + input_section->output_offset);
+ if (howto->pcrel_offset)
+ relocation -= address;
+ }
+
+ return nds32_relocate_contents (howto, input_bfd, relocation,
+ contents + address);
+}
+
+static bfd_boolean
+nds32_elf_output_symbol_hook (struct bfd_link_info *info,
+ const char *name,
+ Elf_Internal_Sym *elfsym ATTRIBUTE_UNUSED,
+ asection *input_sec,
+ struct elf_link_hash_entry *h ATTRIBUTE_UNUSED)
+{
+ const char *source;
+ FILE *sym_ld_script = NULL;
+ struct elf_nds32_link_hash_table *table;
+
+ table = nds32_elf_hash_table (info);
+ sym_ld_script = table->sym_ld_script;
+ if (!sym_ld_script)
+ return TRUE;
+
+ if (!h || !name || *name == '\0')
+ return TRUE;
+
+ if (input_sec->flags & SEC_EXCLUDE)
+ return TRUE;
+
+ if (!check_start_export_sym)
+ {
+ fprintf (sym_ld_script, "SECTIONS\n{\n");
+ check_start_export_sym = 1;
+ }
+
+ if (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ {
+ if (!h->root.u.def.section->output_section)
+ return TRUE;
+
+ if (bfd_is_const_section (input_sec))
+ source = input_sec->name;
+ else
+ source = input_sec->owner->filename;
+
+ fprintf (sym_ld_script, "\t%s = 0x%08lx;\t /* %s */\n",
+ h->root.root.string,
+ (long) (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset), source);
+ }
+
+ return TRUE;
+}
+
+/* Relocate an NDS32/D ELF section.
+ There is some attempt to make this function usable for many architectures,
+ both for RELA and REL type relocs, if only to serve as a learning tool.
+
+ The RELOCATE_SECTION function is called by the new ELF backend linker
+ to handle the relocations for a section.
+
+ The relocs are always passed as Rela structures; if the section
+ actually uses Rel structures, the r_addend field will always be
+ zero.
+
+ This function is responsible for adjust the section contents as
+ necessary, and (if using Rela relocs and generating a
+ relocatable output file) adjusting the reloc addend as
+ necessary.
+
+ This function does not have to worry about setting the reloc
+ address or the reloc symbol index.
+
+ LOCAL_SYMS is a pointer to the swapped in local symbols.
+
+ LOCAL_SECTIONS is an array giving the section in the input file
+ corresponding to the st_shndx field of each local symbol.
+
+ The global hash table entry for the global symbols can be found
+ via elf_sym_hashes (input_bfd).
+
+ When generating relocatable output, this function must handle
+ STB_LOCAL/STT_SECTION symbols specially. The output symbol is
+ going to be the section symbol corresponding to the output
+ section, which means that the addend must be adjusted
+ accordingly. */
+
+static bfd_vma
+dtpoff_base (struct bfd_link_info *info)
+{
+ /* If tls_sec is NULL, we should have signalled an error already. */
+ if (elf_hash_table (info)->tls_sec == NULL)
+ return 0;
+ return elf_hash_table (info)->tls_sec->vma;
+}
+
+static bfd_boolean
+nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info * info,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
+ Elf_Internal_Rela * relocs,
+ Elf_Internal_Sym * local_syms,
+ asection ** local_sections)
+{
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ Elf_Internal_Rela *rel, *relend;
+ bfd_boolean ret = TRUE; /* Assume success. */
+ int align = 0;
+ bfd_reloc_status_type r;
+ const char *errmsg = NULL;
+ bfd_vma gp;
+ struct elf_nds32_link_hash_table *htab;
+ bfd *dynobj;
+ bfd_vma *local_got_offsets;
+ asection *sgot, *splt, *sreloc;
+ bfd_vma high_address;
+ struct elf_nds32_link_hash_table *table;
+ int eliminate_gc_relocs;
+ bfd_vma fpbase_addr;
+
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (input_bfd);
+ htab = nds32_elf_hash_table (info);
+ high_address = bfd_get_section_limit (input_bfd, input_section);
+
+ dynobj = htab->root.dynobj;
+ local_got_offsets = elf_local_got_offsets (input_bfd);
+
+ sgot = htab->sgot;
+ splt = htab->splt;
+ sreloc = NULL;
+
+ rel = relocs;
+ relend = relocs + input_section->reloc_count;
+
+ table = nds32_elf_hash_table (info);
+ eliminate_gc_relocs = table->eliminate_gc_relocs;
+ /* By this time, we can adjust the value of _SDA_BASE_. */
+ if ((!info->relocatable))
+ {
+ is_SDA_BASE_set = 1;
+ r = nds32_elf_final_sda_base (output_bfd, info, &gp, TRUE);
+ if (r != bfd_reloc_ok)
+ return FALSE;
+ }
+
+ if (table->target_optimize & NDS32_RELAX_JUMP_IFC_ON)
+ if (!nds32_elf_ifc_reloc ())
+ (*_bfd_error_handler) (_("error: IFC relocation error."));
+
+ /* Relocation for .ex9.itable. */
+ if (table->target_optimize & NDS32_RELAX_EX9_ON
+ || (table->ex9_import_file && table->update_ex9_table))
+ nds32_elf_ex9_reloc_jmp (info);
+
+ /* Use gp as fp to prevent truncated fit. Because in relaxation time
+ the fp value is set as gp, and it has be reverted for instruction
+ setting fp. */
+ fpbase_addr = elf_gp (output_bfd);
+
+ for (rel = relocs; rel < relend; rel++)
+ {
+ enum elf_nds32_reloc_type r_type;
+ reloc_howto_type *howto = NULL;
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h = NULL;
+ Elf_Internal_Sym *sym = NULL;
+ asection *sec;
+ bfd_vma relocation;
+
+ /* We can't modify r_addend here as elf_link_input_bfd has an assert to
+ ensure it's zero (we use REL relocs, not RELA). Therefore this
+ should be assigning zero to `addend', but for clarity we use
+ `r_addend'. */
+
+ bfd_vma addend = rel->r_addend;
+ bfd_vma offset = rel->r_offset;
+
+ r_type = ELF32_R_TYPE (rel->r_info);
+ if (r_type >= R_NDS32_max)
+ {
+ (*_bfd_error_handler) (_("%B: error: unknown relocation type %d."),
+ input_bfd, r_type);
+ bfd_set_error (bfd_error_bad_value);
+ ret = FALSE;
+ continue;
+ }
+
+ if (r_type == R_NDS32_GNU_VTENTRY
+ || r_type == R_NDS32_GNU_VTINHERIT
+ || r_type == R_NDS32_NONE
+ || r_type == R_NDS32_RELA_GNU_VTENTRY
+ || r_type == R_NDS32_RELA_GNU_VTINHERIT
+ || (r_type >= R_NDS32_INSN16 && r_type <= R_NDS32_25_FIXED_RELA)
+ || r_type == R_NDS32_DATA
+ || r_type == R_NDS32_TRAN
+ || (r_type >= R_NDS32_LONGCALL4 && r_type <= R_NDS32_LONGJUMP6))
+ continue;
+
+ /* If we enter the fp-as-gp region. Resolve the address of best fp-base. */
+ if (ELF32_R_TYPE (rel->r_info) == R_NDS32_RELAX_REGION_BEGIN
+ && (rel->r_addend & R_NDS32_RELAX_REGION_OMIT_FP_FLAG))
+ {
+ int dist;
+
+ /* Distance to relocation of best fp-base is encoded in R_SYM. */
+ dist = rel->r_addend >> 16;
+ fpbase_addr = calculate_memory_address (input_bfd, rel + dist,
+ local_syms, symtab_hdr);
+ }
+ else if (ELF32_R_TYPE (rel->r_info) == R_NDS32_RELAX_REGION_END
+ && (rel->r_addend & R_NDS32_RELAX_REGION_OMIT_FP_FLAG))
+ {
+ fpbase_addr = elf_gp (output_bfd);
+ }
+
+ if (((r_type >= R_NDS32_DWARF2_OP1_RELA
+ && r_type <= R_NDS32_DWARF2_LEB_RELA)
+ || r_type >= R_NDS32_RELAX_ENTRY) && !info->relocatable)
+ continue;
+
+ howto = bfd_elf32_bfd_reloc_type_table_lookup (r_type);
+ r_symndx = ELF32_R_SYM (rel->r_info);
+
+ /* This is a final link. */
+ sym = NULL;
+ sec = NULL;
+ h = NULL;
+
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ /* Local symbol. */
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+
+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ addend = rel->r_addend;
+ }
+ else
+ {
+ /* External symbol. */
+ bfd_boolean warned, ignored, unresolved_reloc;
+ int symndx = r_symndx - symtab_hdr->sh_info;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes, h, sec,
+ relocation, unresolved_reloc, warned,
+ ignored);
+
+ /* la $fp, _FP_BASE_ is per-function (region).
+ Handle it specially. */
+ switch ((int) r_type)
+ {
+ case R_NDS32_SDA19S0_RELA:
+ case R_NDS32_SDA15S0_RELA:
+ case R_NDS32_20_RELA:
+ if (strcmp (elf_sym_hashes (input_bfd)[symndx]->root.root.string,
+ FP_BASE_NAME) == 0)
+ {
+ relocation = fpbase_addr;
+ break;
+ }
+ }
+
+ }
+
+ if (info->relocatable)
+ {
+ /* This is a relocatable link. We don't have to change
+ anything, unless the reloc is against a section symbol,
+ in which case we have to adjust according to where the
+ section symbol winds up in the output section. */
+ if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ rel->r_addend += sec->output_offset + sym->st_value;
+
+ continue;
+ }
+
+ /* Sanity check the address. */
+ if (offset > high_address)
+ {
+ r = bfd_reloc_outofrange;
+ goto check_reloc;
+ }
+
+ if ((r_type >= R_NDS32_DWARF2_OP1_RELA
+ && r_type <= R_NDS32_DWARF2_LEB_RELA)
+ || r_type >= R_NDS32_RELAX_ENTRY)
+ continue;
+
+ switch ((int) r_type)
+ {
+ case R_NDS32_GOTOFF:
+ /* Relocation is relative to the start of the global offset
+ table (for ld24 rx, #uimm24), e.g. access at label+addend
+
+ ld24 rx. #label@GOTOFF + addend
+ sub rx, r12. */
+ case R_NDS32_GOTOFF_HI20:
+ case R_NDS32_GOTOFF_LO12:
+ case R_NDS32_GOTOFF_LO15:
+ case R_NDS32_GOTOFF_LO19:
+ BFD_ASSERT (sgot != NULL);
+
+ relocation -= elf_gp (output_bfd);
+ break;
+
+ case R_NDS32_9_PLTREL:
+ case R_NDS32_25_PLTREL:
+ /* Relocation is to the entry for this symbol in the
+ procedure linkage table. */
+
+ /* The native assembler will generate a 25_PLTREL reloc
+ for a local symbol if you assemble a call from one
+ section to another when using -K pic. */
+ if (h == NULL)
+ break;
+
+ if (h->forced_local)
+ break;
+
+ /* We didn't make a PLT entry for this symbol. This
+ happens when statically linking PIC code, or when
+ using -Bsymbolic. */
+ if (h->plt.offset == (bfd_vma) - 1)
+ break;
+
+ relocation = (splt->output_section->vma
+ + splt->output_offset + h->plt.offset);
+ break;
+
+ case R_NDS32_PLT_GOTREL_HI20:
+ case R_NDS32_PLT_GOTREL_LO12:
+ case R_NDS32_PLT_GOTREL_LO15:
+ case R_NDS32_PLT_GOTREL_LO19:
+ case R_NDS32_PLT_GOTREL_LO20:
+ if (h == NULL || h->forced_local || h->plt.offset == (bfd_vma) - 1)
+ {
+ /* We didn't make a PLT entry for this symbol. This
+ happens when statically linking PIC code, or when
+ using -Bsymbolic. */
+ relocation -= elf_gp (output_bfd);
+ break;
+ }
+
+ relocation = (splt->output_section->vma
+ + splt->output_offset + h->plt.offset);
+
+ relocation -= elf_gp (output_bfd);
+ break;
+
+ case R_NDS32_PLTREL_HI20:
+ case R_NDS32_PLTREL_LO12:
+
+ /* Relocation is to the entry for this symbol in the
+ procedure linkage table. */
+
+ /* The native assembler will generate a 25_PLTREL reloc
+ for a local symbol if you assemble a call from one
+ section to another when using -K pic. */
+ if (h == NULL)
+ break;
+
+ if (h->forced_local)
+ break;
+
+ if (h->plt.offset == (bfd_vma) - 1)
+ /* We didn't make a PLT entry for this symbol. This
+ happens when statically linking PIC code, or when
+ using -Bsymbolic. */
+ break;
+
+ if (splt == NULL)
+ break;
+
+ relocation = (splt->output_section->vma
+ + splt->output_offset
+ + h->plt.offset + 4)
+ - (input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset);
+
+ break;
+
+ case R_NDS32_GOTPC20:
+ /* .got(_GLOBAL_OFFSET_TABLE_) - pc relocation
+ ld24 rx,#_GLOBAL_OFFSET_TABLE_ */
+ relocation = elf_gp (output_bfd);
+ break;
+
+ case R_NDS32_GOTPC_HI20:
+ case R_NDS32_GOTPC_LO12:
+ {
+ /* .got(_GLOBAL_OFFSET_TABLE_) - pc relocation
+ bl .+4
+ seth rx,#high(_GLOBAL_OFFSET_TABLE_)
+ or3 rx,rx,#low(_GLOBAL_OFFSET_TABLE_ +4)
+ or
+ bl .+4
+ seth rx,#shigh(_GLOBAL_OFFSET_TABLE_)
+ add3 rx,rx,#low(_GLOBAL_OFFSET_TABLE_ +4)
+ */
+ relocation = elf_gp (output_bfd);
+ relocation -= (input_section->output_section->vma
+ + input_section->output_offset + rel->r_offset);
+ break;
+ }
+
+ case R_NDS32_GOT20:
+ /* Fall through. */
+ case R_NDS32_GOT_HI20:
+ case R_NDS32_GOT_LO12:
+ case R_NDS32_GOT_LO15:
+ case R_NDS32_GOT_LO19:
+ /* Relocation is to the entry for this symbol in the global
+ offset table. */
+ BFD_ASSERT (sgot != NULL);
+
+ if (h != NULL)
+ {
+ bfd_boolean dyn;
+ bfd_vma off;
+
+ off = h->got.offset;
+ BFD_ASSERT (off != (bfd_vma) - 1);
+ dyn = htab->root.dynamic_sections_created;
+ if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
+ || (info->shared
+ && (info->symbolic
+ || h->dynindx == -1
+ || h->forced_local) && h->def_regular))
+ {
+ /* This is actually a static link, or it is a
+ -Bsymbolic link and the symbol is defined
+ locally, or the symbol was forced to be local
+ because of a version file. We must initialize
+ this entry in the global offset table. Since the
+ offset must always be a multiple of 4, we use the
+ least significant bit to record whether we have
+ initialized it already.
+
+ When doing a dynamic link, we create a .rela.got
+ relocation entry to initialize the value. This
+ is done in the finish_dynamic_symbol routine. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ bfd_put_32 (output_bfd, relocation, sgot->contents + off);
+ h->got.offset |= 1;
+ }
+ }
+ relocation = sgot->output_section->vma + sgot->output_offset + off
+ - elf_gp (output_bfd);
+ }
+ else
+ {
+ bfd_vma off;
+ bfd_byte *loc;
+
+ BFD_ASSERT (local_got_offsets != NULL
+ && local_got_offsets[r_symndx] != (bfd_vma) - 1);
+
+ off = local_got_offsets[r_symndx];
+
+ /* The offset must always be a multiple of 4. We use
+ the least significant bit to record whether we have
+ already processed this entry. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ bfd_put_32 (output_bfd, relocation, sgot->contents + off);
+
+ if (info->shared)
+ {
+ asection *srelgot;
+ Elf_Internal_Rela outrel;
+
+ /* We need to generate a R_NDS32_RELATIVE reloc
+ for the dynamic linker. */
+ srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+ BFD_ASSERT (srelgot != NULL);
+
+ outrel.r_offset = (elf_gp (output_bfd)
+ + sgot->output_offset + off);
+ outrel.r_info = ELF32_R_INFO (0, R_NDS32_RELATIVE);
+ outrel.r_addend = relocation;
+ loc = srelgot->contents;
+ loc +=
+ srelgot->reloc_count * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ ++srelgot->reloc_count;
+ }
+ local_got_offsets[r_symndx] |= 1;
+ }
+ relocation = sgot->output_section->vma + sgot->output_offset + off
+ - elf_gp (output_bfd);
+ }
+
+ break;
+
+ case R_NDS32_16_RELA:
+ case R_NDS32_20_RELA:
+ case R_NDS32_5_RELA:
+ case R_NDS32_32_RELA:
+ case R_NDS32_9_PCREL_RELA:
+ case R_NDS32_WORD_9_PCREL_RELA:
+ case R_NDS32_10_UPCREL_RELA:
+ case R_NDS32_15_PCREL_RELA:
+ case R_NDS32_17_PCREL_RELA:
+ case R_NDS32_25_PCREL_RELA:
+ case R_NDS32_HI20_RELA:
+ case R_NDS32_LO12S3_RELA:
+ case R_NDS32_LO12S2_RELA:
+ case R_NDS32_LO12S2_DP_RELA:
+ case R_NDS32_LO12S2_SP_RELA:
+ case R_NDS32_LO12S1_RELA:
+ case R_NDS32_LO12S0_RELA:
+ case R_NDS32_LO12S0_ORI_RELA:
+ if (info->shared && r_symndx != 0
+ && (input_section->flags & SEC_ALLOC) != 0
+ && (eliminate_gc_relocs == 0
+ || (sec && (sec->flags & SEC_EXCLUDE) == 0))
+ && ((r_type != R_NDS32_9_PCREL_RELA
+ && r_type != R_NDS32_WORD_9_PCREL_RELA
+ && r_type != R_NDS32_10_UPCREL_RELA
+ && r_type != R_NDS32_15_PCREL_RELA
+ && r_type != R_NDS32_17_PCREL_RELA
+ && r_type != R_NDS32_25_PCREL_RELA
+ && !(r_type == R_NDS32_32_RELA
+ && strcmp (input_section->name, ".eh_frame") == 0))
+ || (h != NULL && h->dynindx != -1
+ && (!info->symbolic || !h->def_regular))))
+ {
+ Elf_Internal_Rela outrel;
+ bfd_boolean skip, relocate;
+ bfd_byte *loc;
+
+ /* When generating a shared object, these relocations
+ are copied into the output file to be resolved at run
+ time. */
+
+ if (sreloc == NULL)
+ {
+ const char *name;
+
+ name = bfd_elf_string_from_elf_section
+ (input_bfd, elf_elfheader (input_bfd)->e_shstrndx,
+ elf_section_data (input_section)->rela.hdr->sh_name);
+ if (name == NULL)
+ return FALSE;
+
+ BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+ && strcmp (bfd_get_section_name (input_bfd,
+ input_section),
+ name + 5) == 0);
+
+ sreloc = bfd_get_section_by_name (dynobj, name);
+ BFD_ASSERT (sreloc != NULL);
+ }
+
+ skip = FALSE;
+ relocate = FALSE;
+
+ outrel.r_offset = _bfd_elf_section_offset (output_bfd,
+ info,
+ input_section,
+ rel->r_offset);
+ if (outrel.r_offset == (bfd_vma) - 1)
+ skip = TRUE;
+ else if (outrel.r_offset == (bfd_vma) - 2)
+ skip = TRUE, relocate = TRUE;
+ outrel.r_offset += (input_section->output_section->vma
+ + input_section->output_offset);
+
+ if (skip)
+ memset (&outrel, 0, sizeof outrel);
+ else if (r_type == R_NDS32_17_PCREL_RELA
+ || r_type == R_NDS32_15_PCREL_RELA
+ || r_type == R_NDS32_25_PCREL_RELA)
+ {
+ BFD_ASSERT (h != NULL && h->dynindx != -1);
+ outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
+ outrel.r_addend = rel->r_addend;
+ }
+ else
+ {
+ /* h->dynindx may be -1 if this symbol was marked to
+ become local. */
+ if (h == NULL
+ || ((info->symbolic || h->dynindx == -1)
+ && h->def_regular))
+ {
+ relocate = TRUE;
+ outrel.r_info = ELF32_R_INFO (0, R_NDS32_RELATIVE);
+ outrel.r_addend = relocation + rel->r_addend;
+ }
+ else
+ {
+ BFD_ASSERT (h->dynindx != -1);
+ outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
+ outrel.r_addend = rel->r_addend;
+ }
+ }
+
+ loc = sreloc->contents;
+ loc += sreloc->reloc_count * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ ++sreloc->reloc_count;
+
+ /* If this reloc is against an external symbol, we do
+ not want to fiddle with the addend. Otherwise, we
+ need to include the symbol value so that it becomes
+ an addend for the dynamic reloc. */
+ if (!relocate)
+ continue;
+ }
+ break;
+
+ case R_NDS32_25_ABS_RELA:
+ if (info->shared)
+ {
+ (*_bfd_error_handler)
+ (_("%s: warning: cannot deal R_NDS32_25_ABS_RELA in shared "
+ "mode."), bfd_get_filename (input_bfd));
+ return FALSE;
+ }
+ break;
+
+ case R_NDS32_9_PCREL:
+ r = nds32_elf_do_9_pcrel_reloc (input_bfd, howto, input_section,
+ contents, offset,
+ sec, relocation, addend);
+ goto check_reloc;
+
+ case R_NDS32_HI20:
+ {
+ Elf_Internal_Rela *lorel;
+
+ /* We allow an arbitrary number of HI20 relocs before the
+ LO12 reloc. This permits gcc to emit the HI and LO relocs
+ itself. */
+ for (lorel = rel + 1;
+ (lorel < relend
+ && ELF32_R_TYPE (lorel->r_info) == R_NDS32_HI20); lorel++)
+ continue;
+ if (lorel < relend
+ && (ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S3
+ || ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S2
+ || ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S1
+ || ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S0))
+ {
+ nds32_elf_relocate_hi20 (input_bfd, r_type, rel, lorel,
+ contents, relocation + addend);
+ r = bfd_reloc_ok;
+ }
+ else
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, offset, relocation,
+ addend);
+ }
+
+ goto check_reloc;
+
+ case R_NDS32_GOT17S2_RELA:
+ case R_NDS32_GOT15S2_RELA:
+ {
+ bfd_vma off;
+
+ BFD_ASSERT (sgot != NULL);
+
+ if (h != NULL)
+ {
+ bfd_boolean dyn;
+
+ off = h->got.offset;
+ BFD_ASSERT (off != (bfd_vma) - 1);
+
+ dyn = htab->root.dynamic_sections_created;
+ if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL
+ (dyn, info->shared, h) || (info->shared
+ && (info->symbolic
+ || h->dynindx == -1
+ || h->forced_local)
+ && h->def_regular))
+ {
+ /* This is actually a static link, or it is a
+ -Bsymbolic link and the symbol is defined
+ locally, or the symbol was forced to be local
+ because of a version file. We must initialize
+ this entry in the global offset table. Since the
+ offset must always be a multiple of 4, we use the
+ least significant bit to record whether we have
+ initialized it already.
+
+ When doing a dynamic link, we create a .rela.got
+ relocation entry to initialize the value. This
+ is done in the finish_dynamic_symbol routine. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ bfd_put_32 (output_bfd, relocation,
+ sgot->contents + off);
+ h->got.offset |= 1;
+ }
+ }
+ }
+ else
+ {
+ bfd_byte *loc;
+
+ BFD_ASSERT (local_got_offsets != NULL
+ && local_got_offsets[r_symndx] != (bfd_vma) - 1);
+
+ off = local_got_offsets[r_symndx];
+
+ /* The offset must always be a multiple of 4. We use
+ the least significant bit to record whether we have
+ already processed this entry. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ bfd_put_32 (output_bfd, relocation, sgot->contents + off);
+
+ if (info->shared)
+ {
+ asection *srelgot;
+ Elf_Internal_Rela outrel;
+
+ /* We need to generate a R_NDS32_RELATIVE reloc
+ for the dynamic linker. */
+ srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+ BFD_ASSERT (srelgot != NULL);
+
+ outrel.r_offset = (elf_gp (output_bfd)
+ + sgot->output_offset + off);
+ outrel.r_info = ELF32_R_INFO (0, R_NDS32_RELATIVE);
+ outrel.r_addend = relocation;
+ loc = srelgot->contents;
+ loc +=
+ srelgot->reloc_count * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ ++srelgot->reloc_count;
+ }
+ local_got_offsets[r_symndx] |= 1;
+ }
+ }
+ relocation = sgot->output_section->vma + sgot->output_offset + off
+ - elf_gp (output_bfd);
+ }
+ if (relocation & align)
+ {
+ /* Incorrect alignment. */
+ (*_bfd_error_handler)
+ (_("%B: warning: unaligned access to GOT entry."), input_bfd);
+ ret = FALSE;
+ r = bfd_reloc_dangerous;
+ goto check_reloc;
+ }
+ break;
+
+ case R_NDS32_SDA16S3_RELA:
+ case R_NDS32_SDA15S3_RELA:
+ case R_NDS32_SDA15S3:
+ align = 0x7;
+ goto handle_sda;
+
+ case R_NDS32_SDA17S2_RELA:
+ case R_NDS32_SDA15S2_RELA:
+ case R_NDS32_SDA12S2_SP_RELA:
+ case R_NDS32_SDA12S2_DP_RELA:
+ case R_NDS32_SDA15S2:
+ case R_NDS32_SDA_FP7U2_RELA:
+ align = 0x3;
+ goto handle_sda;
+
+ case R_NDS32_SDA18S1_RELA:
+ case R_NDS32_SDA15S1_RELA:
+ case R_NDS32_SDA15S1:
+ align = 0x1;
+ goto handle_sda;
+
+ case R_NDS32_SDA19S0_RELA:
+ case R_NDS32_SDA15S0_RELA:
+ case R_NDS32_SDA15S0:
+ {
+ align = 0x0;
+handle_sda:
+ BFD_ASSERT (sec != NULL);
+
+ /* If the symbol is in the abs section, the out_bfd will be null.
+ This happens when the relocation has a symbol@GOTOFF. */
+ r = nds32_elf_final_sda_base (output_bfd, info, &gp, FALSE);
+ if (r != bfd_reloc_ok)
+ {
+ (*_bfd_error_handler)
+ (_("%B: warning: relocate SDA_BASE failed."), input_bfd);
+ ret = FALSE;
+ goto check_reloc;
+ }
+
+ /* At this point `relocation' contains the object's
+ address. */
+ if (r_type == R_NDS32_SDA_FP7U2_RELA)
+ {
+ relocation -= fpbase_addr;
+ }
+ else
+ relocation -= gp;
+ /* Now it contains the offset from _SDA_BASE_. */
+
+ /* Make sure alignment is correct. */
+
+ if (relocation & align)
+ {
+ /* Incorrect alignment. */
+ (*_bfd_error_handler)
+ (_("%B(%A): warning: unaligned small data access of type %d."),
+ input_bfd, input_section, r_type);
+ ret = FALSE;
+ goto check_reloc;
+ }
+ }
+
+ break;
+ case R_NDS32_17IFC_PCREL_RELA:
+ case R_NDS32_10IFCU_PCREL_RELA:
+ /* do nothing */
+ break;
+
+ case R_NDS32_TLS_LE_HI20:
+ case R_NDS32_TLS_LE_LO12:
+ case R_NDS32_TLS_LE_20:
+ case R_NDS32_TLS_LE_15S0:
+ case R_NDS32_TLS_LE_15S1:
+ case R_NDS32_TLS_LE_15S2:
+ if (elf_hash_table (info)->tls_sec != NULL)
+ relocation -= (elf_hash_table (info)->tls_sec->vma + TP_OFFSET);
+ break;
+ case R_NDS32_TLS_IE_HI20:
+ case R_NDS32_TLS_IE_LO12S2:
+ {
+ /* Relocation is to the entry for this symbol in the global
+ offset table. */
+ unsigned int tls_type;
+ asection *srelgot;
+ Elf_Internal_Rela outrel;
+ bfd_vma off;
+ bfd_byte *loc;
+ int indx = 0;
+
+ BFD_ASSERT (sgot != NULL);
+ if (h != NULL)
+ {
+ bfd_boolean dyn;
+
+ off = h->got.offset;
+ BFD_ASSERT (off != (bfd_vma) - 1);
+ dyn = htab->root.dynamic_sections_created;
+ tls_type = ((struct elf_nds32_link_hash_entry *) h)->tls_type;
+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
+ && (!info->shared
+ || !SYMBOL_REFERENCES_LOCAL (info, h)))
+ indx = h->dynindx;
+ }
+ else
+ {
+ /* Never happen currently. */
+ BFD_ASSERT (local_got_offsets != NULL
+ && local_got_offsets[r_symndx] != (bfd_vma) - 1);
+
+ off = local_got_offsets[r_symndx];
+
+ tls_type = elf32_nds32_local_got_tls_type (input_bfd)[r_symndx];
+ }
+ relocation = sgot->output_section->vma + sgot->output_offset + off;
+
+ if (r_type == R_NDS32_TLS_IE_LO12S2)
+ break;
+
+ /* The offset must always be a multiple of 4. We use
+ the least significant bit to record whether we have
+ already processed this entry. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ bfd_boolean need_relocs = FALSE;
+ srelgot = htab->srelgot;
+ if ((info->shared || indx != 0)
+ && (h == NULL
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
+ {
+ need_relocs = TRUE;
+ BFD_ASSERT (srelgot != NULL);
+ }
+ if (tls_type & GOT_TLS_IE)
+ {
+ if (need_relocs)
+ {
+ if (h->dynindx == 0)
+ outrel.r_addend = relocation - dtpoff_base (info);
+ else
+ outrel.r_addend = 0;
+ outrel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + off);
+ outrel.r_info =
+ ELF32_R_INFO (h->dynindx, R_NDS32_TLS_TPOFF);
+
+ loc = srelgot->contents;
+ loc +=
+ srelgot->reloc_count * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ ++srelgot->reloc_count;
+ }
+ else
+ bfd_put_32 (output_bfd, h->root.u.def.value - TP_OFFSET,
+ sgot->contents + off);
+ }
+ }
+ }
+ break;
+
+ /* DON'T fall through. */
+
+ default:
+ /* OLD_NDS32_RELOC. */
+
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, offset, relocation, addend);
+ goto check_reloc;
+ }
+
+ switch ((int) r_type)
+ {
+ case R_NDS32_20_RELA:
+ case R_NDS32_5_RELA:
+ case R_NDS32_9_PCREL_RELA:
+ case R_NDS32_WORD_9_PCREL_RELA:
+ case R_NDS32_10_UPCREL_RELA:
+ case R_NDS32_15_PCREL_RELA:
+ case R_NDS32_17_PCREL_RELA:
+ case R_NDS32_25_PCREL_RELA:
+ case R_NDS32_25_ABS_RELA:
+ case R_NDS32_HI20_RELA:
+ case R_NDS32_LO12S3_RELA:
+ case R_NDS32_LO12S2_RELA:
+ case R_NDS32_LO12S2_DP_RELA:
+ case R_NDS32_LO12S2_SP_RELA:
+ case R_NDS32_LO12S1_RELA:
+ case R_NDS32_LO12S0_RELA:
+ case R_NDS32_LO12S0_ORI_RELA:
+ case R_NDS32_SDA16S3_RELA:
+ case R_NDS32_SDA17S2_RELA:
+ case R_NDS32_SDA18S1_RELA:
+ case R_NDS32_SDA19S0_RELA:
+ case R_NDS32_SDA15S3_RELA:
+ case R_NDS32_SDA15S2_RELA:
+ case R_NDS32_SDA12S2_DP_RELA:
+ case R_NDS32_SDA12S2_SP_RELA:
+ case R_NDS32_SDA15S1_RELA:
+ case R_NDS32_SDA15S0_RELA:
+ case R_NDS32_SDA_FP7U2_RELA:
+ case R_NDS32_9_PLTREL:
+ case R_NDS32_25_PLTREL:
+ case R_NDS32_GOT20:
+ case R_NDS32_GOT_HI20:
+ case R_NDS32_GOT_LO12:
+ case R_NDS32_GOT_LO15:
+ case R_NDS32_GOT_LO19:
+ case R_NDS32_GOT15S2_RELA:
+ case R_NDS32_GOT17S2_RELA:
+ case R_NDS32_GOTPC20:
+ case R_NDS32_GOTPC_HI20:
+ case R_NDS32_GOTPC_LO12:
+ case R_NDS32_GOTOFF:
+ case R_NDS32_GOTOFF_HI20:
+ case R_NDS32_GOTOFF_LO12:
+ case R_NDS32_GOTOFF_LO15:
+ case R_NDS32_GOTOFF_LO19:
+ case R_NDS32_PLTREL_HI20:
+ case R_NDS32_PLTREL_LO12:
+ case R_NDS32_PLT_GOTREL_HI20:
+ case R_NDS32_PLT_GOTREL_LO12:
+ case R_NDS32_PLT_GOTREL_LO15:
+ case R_NDS32_PLT_GOTREL_LO19:
+ case R_NDS32_PLT_GOTREL_LO20:
+ case R_NDS32_17IFC_PCREL_RELA:
+ case R_NDS32_10IFCU_PCREL_RELA:
+ case R_NDS32_TLS_LE_HI20:
+ case R_NDS32_TLS_LE_LO12:
+ case R_NDS32_TLS_IE_HI20:
+ case R_NDS32_TLS_IE_LO12S2:
+ case R_NDS32_TLS_LE_20:
+ case R_NDS32_TLS_LE_15S0:
+ case R_NDS32_TLS_LE_15S1:
+ case R_NDS32_TLS_LE_15S2:
+ /* Instruction related relocs must handle endian properly. */
+ /* NOTE: PIC IS NOT HANDLE YET; DO IT LATER. */
+ r = nds32_elf_final_link_relocate (howto, input_bfd,
+ input_section, contents,
+ rel->r_offset, relocation,
+ rel->r_addend);
+ break;
+
+ default:
+ /* All other relocs can use default handler. */
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset,
+ relocation, rel->r_addend);
+ break;
+ }
+
+check_reloc:
+
+ if (r != bfd_reloc_ok)
+ {
+ /* FIXME: This should be generic enough to go in a utility. */
+ const char *name;
+
+ if (h != NULL)
+ name = h->root.root.string;
+ else
+ {
+ name = bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name);
+ if (name == NULL || *name == '\0')
+ name = bfd_section_name (input_bfd, sec);
+ }
+
+ if (errmsg != NULL)
+ goto common_error;
+
+ switch (r)
+ {
+ case bfd_reloc_overflow:
+ if (!((*info->callbacks->reloc_overflow)
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, offset)))
+ return FALSE;
+ break;
+
+ case bfd_reloc_undefined:
+ if (!((*info->callbacks->undefined_symbol)
+ (info, name, input_bfd, input_section, offset, TRUE)))
+ return FALSE;
+ break;
+
+ case bfd_reloc_outofrange:
+ errmsg = _("internal error: out of range error");
+ goto common_error;
+
+ case bfd_reloc_notsupported:
+ errmsg = _("internal error: unsupported relocation error");
+ goto common_error;
+
+ case bfd_reloc_dangerous:
+ errmsg = _("internal error: dangerous error");
+ goto common_error;
+
+ default:
+ errmsg = _("internal error: unknown error");
+ /* Fall through. */
+
+common_error:
+ if (!((*info->callbacks->warning)
+ (info, errmsg, name, input_bfd, input_section, offset)))
+ return FALSE;
+ break;
+ }
+ }
+ }
+
+ return ret;
+}
+
+/* Finish up dynamic symbol handling. We set the contents of various
+ dynamic sections here. */
+
+static bfd_boolean
+nds32_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info,
+ struct elf_link_hash_entry *h, Elf_Internal_Sym *sym)
+{
+ struct elf_nds32_link_hash_table *htab;
+ bfd_byte *loc;
+
+ htab = nds32_elf_hash_table (info);
+
+ if (h->plt.offset != (bfd_vma) - 1)
+ {
+ asection *splt;
+ asection *sgot;
+ asection *srela;
+
+ bfd_vma plt_index;
+ bfd_vma got_offset;
+ bfd_vma local_plt_offset;
+ Elf_Internal_Rela rela;
+
+ /* This symbol has an entry in the procedure linkage table. Set
+ it up. */
+
+ BFD_ASSERT (h->dynindx != -1);
+
+ splt = htab->splt;
+ sgot = htab->sgotplt;
+ srela = htab->srelplt;
+ BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL);
+
+ /* Get the index in the procedure linkage table which
+ corresponds to this symbol. This is the index of this symbol
+ in all the symbols for which we are making plt entries. The
+ first entry in the procedure linkage table is reserved. */
+ plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
+
+ /* Get the offset into the .got table of the entry that
+ corresponds to this function. Each .got entry is 4 bytes.
+ The first three are reserved. */
+ got_offset = (plt_index + 3) * 4;
+
+ /* Fill in the entry in the procedure linkage table. */
+ if (!info->shared)
+ {
+ unsigned long insn;
+
+ insn = PLT_ENTRY_WORD0 + (((sgot->output_section->vma
+ + sgot->output_offset + got_offset) >> 12)
+ & 0xfffff);
+ bfd_putb32 (insn, splt->contents + h->plt.offset);
+
+ insn = PLT_ENTRY_WORD1 + (((sgot->output_section->vma
+ + sgot->output_offset + got_offset) & 0x0fff)
+ >> 2);
+ bfd_putb32 (insn, splt->contents + h->plt.offset + 4);
+
+ insn = PLT_ENTRY_WORD2;
+ bfd_putb32 (insn, splt->contents + h->plt.offset + 8);
+
+ insn = PLT_ENTRY_WORD3 + (plt_index & 0x7ffff);
+ bfd_putb32 (insn, splt->contents + h->plt.offset + 12);
+
+ insn = PLT_ENTRY_WORD4
+ + (((unsigned int) ((-(h->plt.offset + 16)) >> 1)) & 0xffffff);
+ bfd_putb32 (insn, splt->contents + h->plt.offset + 16);
+ local_plt_offset = 12;
+ }
+ else
+ {
+ /* sda_base must be set at this time. */
+ unsigned long insn;
+ long offset;
+
+ /* FIXME, sda_base is 65536, it will damage opcode. */
+ /* insn = PLT_PIC_ENTRY_WORD0 + (((got_offset - sda_base) >> 2) & 0x7fff); */
+ offset = sgot->output_section->vma + sgot->output_offset + got_offset
+ - elf_gp (output_bfd);
+ insn = PLT_PIC_ENTRY_WORD0 + ((offset >> 12) & 0xfffff);
+ bfd_putb32 (insn, splt->contents + h->plt.offset);
+
+ insn = PLT_PIC_ENTRY_WORD1 + (offset & 0xfff);
+ bfd_putb32 (insn, splt->contents + h->plt.offset + 4);
+
+ insn = PLT_PIC_ENTRY_WORD2;
+ bfd_putb32 (insn, splt->contents + h->plt.offset + 8);
+
+ insn = PLT_PIC_ENTRY_WORD3;
+ bfd_putb32 (insn, splt->contents + h->plt.offset + 12);
+
+ insn = PLT_PIC_ENTRY_WORD4 + (plt_index & 0x7fffff);
+ bfd_putb32 (insn, splt->contents + h->plt.offset + 16);
+
+ insn = PLT_PIC_ENTRY_WORD5
+ + (((unsigned int) ((-(h->plt.offset + 20)) >> 1)) & 0xffffff);
+ bfd_putb32 (insn, splt->contents + h->plt.offset + 20);
+
+ local_plt_offset = 16;
+ }
+
+ /* Fill in the entry in the global offset table,
+ so it will fall through to the next instruction for the first time. */
+ bfd_put_32 (output_bfd,
+ (splt->output_section->vma + splt->output_offset
+ + h->plt.offset + local_plt_offset),
+ sgot->contents + got_offset);
+
+ /* Fill in the entry in the .rela.plt section. */
+ rela.r_offset = (sgot->output_section->vma
+ + sgot->output_offset + got_offset);
+ rela.r_info = ELF32_R_INFO (h->dynindx, R_NDS32_JMP_SLOT);
+ rela.r_addend = 0;
+ loc = srela->contents;
+ loc += plt_index * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+
+ if (!h->def_regular)
+ {
+ /* Mark the symbol as undefined, rather than as defined in
+ the .plt section. Leave the value alone. */
+ sym->st_shndx = SHN_UNDEF;
+ if (!h->ref_regular_nonweak)
+ sym->st_value = 0;
+ }
+ }
+
+ if (h->got.offset != (bfd_vma) - 1)
+ {
+ asection *sgot;
+ asection *srela;
+ Elf_Internal_Rela rela;
+
+ /* This symbol has an entry in the global offset table.
+ Set it up. */
+
+ sgot = htab->sgot;
+ srela = htab->srelgot;
+ BFD_ASSERT (sgot != NULL && srela != NULL);
+
+ rela.r_offset = (sgot->output_section->vma
+ + sgot->output_offset + (h->got.offset & ~1));
+
+ /* If this is a -Bsymbolic link, and the symbol is defined
+ locally, we just want to emit a RELATIVE reloc. Likewise if
+ the symbol was forced to be local because of a version file.
+ The entry in the global offset table will already have been
+ initialized in the relocate_section function. */
+ if (info->shared
+ && (info->symbolic
+ || h->dynindx == -1 || h->forced_local) && h->def_regular)
+ {
+ rela.r_info = ELF32_R_INFO (0, R_NDS32_RELATIVE);
+ rela.r_addend = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ }
+ else
+ {
+ BFD_ASSERT ((h->got.offset & 1) == 0);
+ bfd_put_32 (output_bfd, (bfd_vma) 0,
+ sgot->contents + h->got.offset);
+ rela.r_info = ELF32_R_INFO (h->dynindx, R_NDS32_GLOB_DAT);
+ rela.r_addend = 0;
+ }
+
+ loc = srela->contents;
+ loc += srela->reloc_count * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ ++srela->reloc_count;
+ }
+
+ if (h->needs_copy)
+ {
+ asection *s;
+ Elf_Internal_Rela rela;
+
+ /* This symbols needs a copy reloc. Set it up. */
+
+ BFD_ASSERT (h->dynindx != -1
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak));
+
+ s = bfd_get_section_by_name (h->root.u.def.section->owner, ".rela.bss");
+ BFD_ASSERT (s != NULL);
+
+ rela.r_offset = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ rela.r_info = ELF32_R_INFO (h->dynindx, R_NDS32_COPY);
+ rela.r_addend = 0;
+ loc = s->contents;
+ loc += s->reloc_count * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ ++s->reloc_count;
+ }
+
+ /* Mark some specially defined symbols as absolute. */
+ if (strcmp (h->root.root.string, "_DYNAMIC") == 0
+ || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+ sym->st_shndx = SHN_ABS;
+
+ return TRUE;
+}
+
+
+/* Finish up the dynamic sections. */
+
+static bfd_boolean
+nds32_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
+{
+ struct elf_nds32_link_hash_table *htab;
+ bfd *dynobj;
+ asection *sdyn;
+ asection *sgot;
+
+ htab = nds32_elf_hash_table (info);
+ dynobj = htab->root.dynobj;
+
+ sgot = htab->sgotplt;
+ sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+
+ if (htab->root.dynamic_sections_created)
+ {
+ asection *splt;
+ Elf32_External_Dyn *dyncon, *dynconend;
+
+ BFD_ASSERT (sgot != NULL && sdyn != NULL);
+
+ dyncon = (Elf32_External_Dyn *) sdyn->contents;
+ dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
+
+ for (; dyncon < dynconend; dyncon++)
+ {
+ Elf_Internal_Dyn dyn;
+ asection *s;
+
+ bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+
+ switch (dyn.d_tag)
+ {
+ default:
+ break;
+
+ case DT_PLTGOT:
+ /* name = ".got"; */
+ s = htab->sgot->output_section;
+ goto get_vma;
+ case DT_JMPREL:
+ s = htab->srelplt->output_section;
+ get_vma:
+ BFD_ASSERT (s != NULL);
+ dyn.d_un.d_ptr = s->vma;
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ case DT_PLTRELSZ:
+ s = htab->srelplt->output_section;
+ BFD_ASSERT (s != NULL);
+ dyn.d_un.d_val = s->size;
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ case DT_RELASZ:
+ /* My reading of the SVR4 ABI indicates that the
+ procedure linkage table relocs (DT_JMPREL) should be
+ included in the overall relocs (DT_RELA). This is
+ what Solaris does. However, UnixWare can not handle
+ that case. Therefore, we override the DT_RELASZ entry
+ here to make it not include the JMPREL relocs. Since
+ the linker script arranges for .rela.plt to follow all
+ other relocation sections, we don't have to worry
+ about changing the DT_RELA entry. */
+ if (htab->srelplt != NULL)
+ {
+ s = htab->srelplt->output_section;
+ dyn.d_un.d_val -= s->size;
+ }
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+ }
+ }
+
+ /* Fill in the first entry in the procedure linkage table. */
+ splt = htab->splt;
+ if (splt && splt->size > 0)
+ {
+ if (info->shared)
+ {
+ unsigned long insn;
+ long offset;
+
+ /* FIXME, sda_base is 65536, it will damage opcode. */
+ /* insn = PLT_PIC_ENTRY_WORD0 + (((got_offset - sda_base) >> 2) & 0x7fff); */
+ offset = sgot->output_section->vma + sgot->output_offset + 4
+ - elf_gp (output_bfd);
+ insn = PLT0_PIC_ENTRY_WORD0 | ((offset >> 12) & 0xfffff);
+ bfd_putb32 (insn, splt->contents);
+
+ /* insn = PLT0_PIC_ENTRY_WORD0 | (((8 - sda_base) >> 2) & 0x7fff) ; */
+ /* here has a typo? */
+ insn = PLT0_PIC_ENTRY_WORD1 | (offset & 0xfff);
+ bfd_putb32 (insn, splt->contents + 4);
+
+ insn = PLT0_PIC_ENTRY_WORD2;
+ bfd_putb32 (insn, splt->contents + 8);
+
+ insn = PLT0_PIC_ENTRY_WORD3;
+ bfd_putb32 (insn, splt->contents + 12);
+
+ insn = PLT0_PIC_ENTRY_WORD4;
+ bfd_putb32 (insn, splt->contents + 16);
+
+ insn = PLT0_PIC_ENTRY_WORD5;
+ bfd_putb32 (insn, splt->contents + 20);
+ }
+ else
+ {
+ unsigned long insn;
+ unsigned long addr;
+
+ /* addr = .got + 4 */
+ addr = sgot->output_section->vma + sgot->output_offset + 4;
+ insn = PLT0_ENTRY_WORD0 | ((addr >> 12) & 0xfffff);
+ bfd_putb32 (insn, splt->contents);
+
+ insn = PLT0_ENTRY_WORD1 | (addr & 0x0fff);
+ bfd_putb32 (insn, splt->contents + 4);
+
+ insn = PLT0_ENTRY_WORD2;
+ bfd_putb32 (insn, splt->contents + 8);
+
+ insn = PLT0_ENTRY_WORD3;
+ bfd_putb32 (insn, splt->contents + 12);
+
+ insn = PLT0_ENTRY_WORD4;
+ bfd_putb32 (insn, splt->contents + 16);
+ }
+
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize =
+ PLT_ENTRY_SIZE;
+ }
+ }
+
+ /* Fill in the first three entries in the global offset table. */
+ if (sgot && sgot->size > 0)
+ {
+ if (sdyn == NULL)
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
+ else
+ bfd_put_32 (output_bfd,
+ sdyn->output_section->vma + sdyn->output_offset,
+ sgot->contents);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 4);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 8);
+
+ elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
+ }
+
+ return TRUE;
+}
+
+
+/* Set the right machine number. */
+
+static bfd_boolean
+nds32_elf_object_p (bfd *abfd)
+{
+ static unsigned int cur_arch = 0;
+
+ if (E_N1_ARCH != (elf_elfheader (abfd)->e_flags & EF_NDS_ARCH))
+ {
+ /* E_N1_ARCH is a wild card, so it is set only when no others exist. */
+ cur_arch = (elf_elfheader (abfd)->e_flags & EF_NDS_ARCH);
+ }
+
+ switch (cur_arch)
+ {
+ default:
+ case E_N1_ARCH:
+ bfd_default_set_arch_mach (abfd, bfd_arch_nds32, bfd_mach_n1);
+ break;
+ case E_N1H_ARCH:
+ bfd_default_set_arch_mach (abfd, bfd_arch_nds32, bfd_mach_n1h);
+ break;
+ case E_NDS_ARCH_STAR_V2_0:
+ bfd_default_set_arch_mach (abfd, bfd_arch_nds32, bfd_mach_n1h_v2);
+ break;
+ case E_NDS_ARCH_STAR_V3_0:
+ bfd_default_set_arch_mach (abfd, bfd_arch_nds32, bfd_mach_n1h_v3);
+ break;
+ case E_NDS_ARCH_STAR_V3_M:
+ bfd_default_set_arch_mach (abfd, bfd_arch_nds32, bfd_mach_n1h_v3m);
+ break;
+ }
+
+ return TRUE;
+}
+
+/* Store the machine number in the flags field. */
+
+static void
+nds32_elf_final_write_processing (bfd *abfd,
+ bfd_boolean linker ATTRIBUTE_UNUSED)
+{
+ unsigned long val;
+ static unsigned int cur_mach = 0;
+
+ if (bfd_mach_n1 != bfd_get_mach (abfd))
+ {
+ cur_mach = bfd_get_mach (abfd);
+ }
+
+ switch (cur_mach)
+ {
+ case bfd_mach_n1:
+ /* Only happen when object is empty, since the case is abandon. */
+ val = E_N1_ARCH;
+ val |= E_NDS_ABI_AABI;
+ val |= E_NDS32_ELF_VER_1_4;
+ break;
+ case bfd_mach_n1h:
+ val = E_N1H_ARCH;
+ break;
+ case bfd_mach_n1h_v2:
+ val = E_NDS_ARCH_STAR_V2_0;
+ break;
+ case bfd_mach_n1h_v3:
+ val = E_NDS_ARCH_STAR_V3_0;
+ break;
+ case bfd_mach_n1h_v3m:
+ val = E_NDS_ARCH_STAR_V3_M;
+ break;
+ default:
+ val = 0;
+ break;
+ }
+
+ elf_elfheader (abfd)->e_flags &= ~EF_NDS_ARCH;
+ elf_elfheader (abfd)->e_flags |= val;
+}
+
+/* Function to keep NDS32 specific file flags. */
+
+static bfd_boolean
+nds32_elf_set_private_flags (bfd *abfd, flagword flags)
+{
+ BFD_ASSERT (!elf_flags_init (abfd)
+ || elf_elfheader (abfd)->e_flags == flags);
+
+ elf_elfheader (abfd)->e_flags = flags;
+ elf_flags_init (abfd) = TRUE;
+ return TRUE;
+}
+
+static unsigned int
+convert_e_flags (unsigned int e_flags, unsigned int arch)
+{
+ if ((e_flags & EF_NDS_ARCH) == E_NDS_ARCH_STAR_V0_9)
+ {
+ /* From 0.9 to 1.0. */
+ e_flags = (e_flags & (~EF_NDS_ARCH)) | E_NDS_ARCH_STAR_V1_0;
+
+ /* Invert E_NDS32_HAS_NO_MAC_INST. */
+ e_flags ^= E_NDS32_HAS_NO_MAC_INST;
+ if (arch == E_NDS_ARCH_STAR_V1_0)
+ {
+ /* Done. */
+ return e_flags;
+ }
+ }
+
+ /* From 1.0 to 2.0. */
+ e_flags = (e_flags & (~EF_NDS_ARCH)) | E_NDS_ARCH_STAR_V2_0;
+
+ /* Clear E_NDS32_HAS_MFUSR_PC_INST. */
+ e_flags &= ~E_NDS32_HAS_MFUSR_PC_INST;
+
+ /* Invert E_NDS32_HAS_NO_MAC_INST. */
+ e_flags ^= E_NDS32_HAS_NO_MAC_INST;
+ return e_flags;
+}
+
+static bfd_boolean
+nds32_check_vec_size (bfd *ibfd)
+{
+ static unsigned int nds32_vec_size = 0;
+
+ asection *sec_t = NULL;
+ bfd_byte *contents = NULL;
+
+ sec_t = bfd_get_section_by_name (ibfd, ".nds32_e_flags");
+
+ if (sec_t && sec_t->size >= 4)
+ {
+ /* Get vec_size in file. */
+ unsigned int flag_t;
+
+ nds32_get_section_contents (ibfd, sec_t, &contents);
+ flag_t = bfd_get_32 (ibfd, contents);
+
+ /* The value could only be 4 or 16. */
+
+ if (!nds32_vec_size)
+ /* Set if not set yet. */
+ nds32_vec_size = (flag_t & 0x3);
+ else if (nds32_vec_size != (flag_t & 0x3))
+ {
+ (*_bfd_error_handler) (_("%B: ISR vector size mismatch"
+ " with previous modules, previous %u-byte, current %u-byte"),
+ ibfd,
+ nds32_vec_size == 1 ? 4 : nds32_vec_size == 2 ? 16 : 0xffffffff,
+ (flag_t & 0x3) == 1 ? 4 : (flag_t & 0x3) == 2 ? 16 : 0xffffffff);
+ return FALSE;
+ }
+ else
+ /* Only keep the first vec_size section. */
+ sec_t->flags |= SEC_EXCLUDE;
+ }
+
+ return TRUE;
+}
+
+/* Merge backend specific data from an object file to the output
+ object file when linking. */
+
+static bfd_boolean
+nds32_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
+{
+ flagword out_flags;
+ flagword in_flags;
+ flagword out_16regs;
+ flagword in_no_mac;
+ flagword out_no_mac;
+ flagword in_16regs;
+ flagword out_version;
+ flagword in_version;
+ flagword out_fpu_config;
+ flagword in_fpu_config;
+
+ /* TODO: Revise to use object-attributes instead. */
+ if (!nds32_check_vec_size (ibfd))
+ return FALSE;
+
+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return TRUE;
+
+ if (bfd_little_endian (ibfd) != bfd_little_endian (obfd))
+ {
+ (*_bfd_error_handler)
+ (_("%B: warning: Endian mismatch with previous modules."), ibfd);
+
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
+ in_version = elf_elfheader (ibfd)->e_flags & EF_NDS32_ELF_VERSION;
+ if (in_version == E_NDS32_ELF_VER_1_2)
+ {
+ (*_bfd_error_handler)
+ (_("%B: warning: Older version of object file encountered, "
+ "Please recompile with current tool chain."), ibfd);
+ }
+
+ /* We may need to merge V1 and V2 arch object files to V2. */
+ if ((elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH)
+ != (elf_elfheader (obfd)->e_flags & EF_NDS_ARCH))
+ {
+ /* Need to convert version. */
+ if ((elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH)
+ == E_NDS_ARCH_STAR_RESERVED)
+ {
+ elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
+ }
+ else if ((elf_elfheader (obfd)->e_flags & EF_NDS_ARCH) == E_NDS_ARCH_STAR_V0_9
+ || (elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH)
+ > (elf_elfheader (obfd)->e_flags & EF_NDS_ARCH))
+ {
+ elf_elfheader (obfd)->e_flags =
+ convert_e_flags (elf_elfheader (obfd)->e_flags,
+ (elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH));
+ }
+ else
+ {
+ elf_elfheader (ibfd)->e_flags =
+ convert_e_flags (elf_elfheader (ibfd)->e_flags,
+ (elf_elfheader (obfd)->e_flags & EF_NDS_ARCH));
+ }
+ }
+
+ /* Extract some flags. */
+ in_flags = elf_elfheader (ibfd)->e_flags
+ & (~(E_NDS32_HAS_REDUCED_REGS | EF_NDS32_ELF_VERSION
+ | E_NDS32_HAS_NO_MAC_INST | E_NDS32_FPU_REG_CONF));
+
+ /* The following flags need special treatment. */
+ in_16regs = elf_elfheader (ibfd)->e_flags & E_NDS32_HAS_REDUCED_REGS;
+ in_no_mac = elf_elfheader (ibfd)->e_flags & E_NDS32_HAS_NO_MAC_INST;
+ in_fpu_config = elf_elfheader (ibfd)->e_flags & E_NDS32_FPU_REG_CONF;
+
+ /* Extract some flags. */
+ out_flags = elf_elfheader (obfd)->e_flags
+ & (~(E_NDS32_HAS_REDUCED_REGS | EF_NDS32_ELF_VERSION
+ | E_NDS32_HAS_NO_MAC_INST | E_NDS32_FPU_REG_CONF));
+
+ /* The following flags need special treatment. */
+ out_16regs = elf_elfheader (obfd)->e_flags & E_NDS32_HAS_REDUCED_REGS;
+ out_no_mac = elf_elfheader (obfd)->e_flags & E_NDS32_HAS_NO_MAC_INST;
+ out_fpu_config = elf_elfheader (obfd)->e_flags & E_NDS32_FPU_REG_CONF;
+ out_version = elf_elfheader (obfd)->e_flags & EF_NDS32_ELF_VERSION;
+ if (!elf_flags_init (obfd))
+ {
+ /* If the input is the default architecture then do not
+ bother setting the flags for the output architecture,
+ instead allow future merges to do this. If no future
+ merges ever set these flags then they will retain their
+ unitialised values, which surprise surprise, correspond
+ to the default values. */
+ if (bfd_get_arch_info (ibfd)->the_default)
+ return TRUE;
+
+ elf_flags_init (obfd) = TRUE;
+ elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
+
+ if (bfd_get_arch (obfd) == bfd_get_arch (ibfd)
+ && bfd_get_arch_info (obfd)->the_default)
+ {
+ return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd),
+ bfd_get_mach (ibfd));
+ }
+
+ return TRUE;
+ }
+
+ /* Check flag compatibility. */
+ if ((in_flags & EF_NDS_ABI) != (out_flags & EF_NDS_ABI))
+ {
+ (*_bfd_error_handler)
+ (_("%B: error: ABI mismatch with previous modules."), ibfd);
+
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
+ if ((in_flags & EF_NDS_ARCH) != (out_flags & EF_NDS_ARCH))
+ {
+ if (((in_flags & EF_NDS_ARCH) != E_N1_ARCH))
+ {
+ (*_bfd_error_handler)
+ (_("%B: error: Instruction set mismatch with previous modules."), ibfd);
+
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+ }
+
+ /* When linking with V1.2 and V1.3 objects together the output is V1.2.
+ and perf ext1 and DIV are mergerd to perf ext1. */
+ if (in_version == E_NDS32_ELF_VER_1_2 || out_version == E_NDS32_ELF_VER_1_2)
+ {
+ elf_elfheader (obfd)->e_flags =
+ (in_flags & (~(E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST)))
+ | (out_flags & (~(E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST)))
+ | (((in_flags & (E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST)))
+ ? E_NDS32_HAS_EXT_INST : 0)
+ | (((out_flags & (E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST)))
+ ? E_NDS32_HAS_EXT_INST : 0)
+ | (in_16regs & out_16regs) | (in_no_mac & out_no_mac)
+ | ((in_version > out_version) ? out_version : in_version);
+ }
+ else
+ {
+ if (in_version != out_version)
+ (*_bfd_error_handler) (_("%B: warning: Incompatible elf-versions %s and %s."),
+ ibfd, nds32_elfver_strtab[out_version],
+ nds32_elfver_strtab[in_version]);
+
+ elf_elfheader (obfd)->e_flags = in_flags | out_flags
+ | (in_16regs & out_16regs) | (in_no_mac & out_no_mac)
+ | (in_fpu_config > out_fpu_config ? in_fpu_config : out_fpu_config)
+ | (in_version > out_version ? out_version : in_version);
+ }
+
+ return TRUE;
+}
+
+/* Display the flags field. */
+
+static bfd_boolean
+nds32_elf_print_private_bfd_data (bfd *abfd, void *ptr)
+{
+ FILE *file = (FILE *) ptr;
+
+ BFD_ASSERT (abfd != NULL && ptr != NULL);
+
+ _bfd_elf_print_private_bfd_data (abfd, ptr);
+
+ fprintf (file, _("private flags = %lx"), elf_elfheader (abfd)->e_flags);
+
+ switch (elf_elfheader (abfd)->e_flags & EF_NDS_ARCH)
+ {
+ default:
+ case E_N1_ARCH:
+ fprintf (file, _(": n1 instructions"));
+ break;
+ case E_N1H_ARCH:
+ fprintf (file, _(": n1h instructions"));
+ break;
+ }
+
+ fputc ('\n', file);
+
+ return TRUE;
+}
+
+static unsigned int
+nds32_elf_action_discarded (asection *sec)
+{
+
+ if (strncmp
+ (".gcc_except_table", sec->name, sizeof (".gcc_except_table") - 1) == 0)
+ return 0;
+
+ return _bfd_elf_default_action_discarded (sec);
+}
+
+static asection *
+nds32_elf_gc_mark_hook (asection *sec, struct bfd_link_info *info,
+ Elf_Internal_Rela *rel, struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
+{
+ if (h != NULL)
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_NDS32_GNU_VTINHERIT:
+ case R_NDS32_GNU_VTENTRY:
+ case R_NDS32_RELA_GNU_VTINHERIT:
+ case R_NDS32_RELA_GNU_VTENTRY:
+ return NULL;
+ }
+
+ return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+}
+
+static bfd_boolean
+nds32_elf_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info, asection *sec,
+ const Elf_Internal_Rela *relocs)
+{
+ /* Update the got entry reference counts for the section being removed. */
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ bfd_signed_vma *local_got_refcounts;
+ const Elf_Internal_Rela *rel, *relend;
+
+ elf_section_data (sec)->local_dynrel = NULL;
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+ local_got_refcounts = elf_local_got_refcounts (abfd);
+
+ relend = relocs + sec->reloc_count;
+ for (rel = relocs; rel < relend; rel++)
+ {
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h = NULL;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ /* External symbol. */
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ }
+
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_NDS32_GOT_HI20:
+ case R_NDS32_GOT_LO12:
+ case R_NDS32_GOT_LO15:
+ case R_NDS32_GOT_LO19:
+ case R_NDS32_GOT17S2_RELA:
+ case R_NDS32_GOT15S2_RELA:
+ case R_NDS32_GOTOFF:
+ case R_NDS32_GOTOFF_HI20:
+ case R_NDS32_GOTOFF_LO12:
+ case R_NDS32_GOTOFF_LO15:
+ case R_NDS32_GOTOFF_LO19:
+ case R_NDS32_GOT20:
+ case R_NDS32_GOTPC_HI20:
+ case R_NDS32_GOTPC_LO12:
+ case R_NDS32_GOTPC20:
+ if (h != NULL)
+ {
+ if (h->got.refcount > 0)
+ h->got.refcount--;
+ }
+ else
+ {
+ if (local_got_refcounts && local_got_refcounts[r_symndx] > 0)
+ local_got_refcounts[r_symndx]--;
+ }
+ break;
+
+ case R_NDS32_16_RELA:
+ case R_NDS32_20_RELA:
+ case R_NDS32_5_RELA:
+ case R_NDS32_32_RELA:
+ case R_NDS32_HI20_RELA:
+ case R_NDS32_LO12S3_RELA:
+ case R_NDS32_LO12S2_RELA:
+ case R_NDS32_LO12S2_DP_RELA:
+ case R_NDS32_LO12S2_SP_RELA:
+ case R_NDS32_LO12S1_RELA:
+ case R_NDS32_LO12S0_RELA:
+ case R_NDS32_LO12S0_ORI_RELA:
+ case R_NDS32_SDA16S3_RELA:
+ case R_NDS32_SDA17S2_RELA:
+ case R_NDS32_SDA18S1_RELA:
+ case R_NDS32_SDA19S0_RELA:
+ case R_NDS32_SDA15S3_RELA:
+ case R_NDS32_SDA15S2_RELA:
+ case R_NDS32_SDA12S2_DP_RELA:
+ case R_NDS32_SDA12S2_SP_RELA:
+ case R_NDS32_SDA15S1_RELA:
+ case R_NDS32_SDA15S0_RELA:
+ case R_NDS32_SDA_FP7U2_RELA:
+ case R_NDS32_15_PCREL_RELA:
+ case R_NDS32_17_PCREL_RELA:
+ case R_NDS32_25_PCREL_RELA:
+ if (h != NULL)
+ {
+ struct elf_nds32_link_hash_entry *eh;
+ struct elf_nds32_dyn_relocs **pp;
+ struct elf_nds32_dyn_relocs *p;
+
+ if (!info->shared && h->plt.refcount > 0)
+ h->plt.refcount -= 1;
+
+ eh = (struct elf_nds32_link_hash_entry *) h;
+
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+ if (p->sec == sec)
+ {
+ if (ELF32_R_TYPE (rel->r_info) == R_NDS32_15_PCREL_RELA
+ || ELF32_R_TYPE (rel->r_info) == R_NDS32_17_PCREL_RELA
+ || ELF32_R_TYPE (rel->r_info) == R_NDS32_25_PCREL_RELA)
+ p->pc_count -= 1;
+ p->count -= 1;
+ if (p->count == 0)
+ *pp = p->next;
+ break;
+ }
+ }
+ break;
+
+ case R_NDS32_9_PLTREL:
+ case R_NDS32_25_PLTREL:
+ if (h != NULL)
+ {
+ if (h->plt.refcount > 0)
+ h->plt.refcount--;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return TRUE;
+}
+
+/* Look through the relocs for a section during the first phase.
+ Since we don't do .gots or .plts, we just need to consider the
+ virtual table relocs for gc. */
+
+static bfd_boolean
+nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
+ asection *sec, const Elf_Internal_Rela *relocs)
+{
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
+ const Elf_Internal_Rela *rel;
+ const Elf_Internal_Rela *rel_end;
+ struct elf_nds32_link_hash_table *htab;
+ bfd *dynobj;
+ asection *sreloc = NULL;
+
+ if (info->relocatable)
+ return TRUE;
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+ sym_hashes_end =
+ sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
+ if (!elf_bad_symtab (abfd))
+ sym_hashes_end -= symtab_hdr->sh_info;
+
+ htab = nds32_elf_hash_table (info);
+ dynobj = htab->root.dynobj;
+
+ rel_end = relocs + sec->reloc_count;
+ for (rel = relocs; rel < rel_end; rel++)
+ {
+ enum elf_nds32_reloc_type r_type;
+ struct elf_link_hash_entry *h;
+ unsigned long r_symndx;
+ int tls_type, old_tls_type;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ r_type = ELF32_R_TYPE (rel->r_info);
+ if (r_symndx < symtab_hdr->sh_info)
+ h = NULL;
+ else
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ }
+
+ /* Some relocs require a global offset table. We create
+ got section here, since these relocation need got section
+ and it is not created yet. */
+ if (htab->sgot == NULL)
+ {
+ switch (r_type)
+ {
+ case R_NDS32_GOT_HI20:
+ case R_NDS32_GOT_LO12:
+ case R_NDS32_GOT_LO15:
+ case R_NDS32_GOT_LO19:
+ case R_NDS32_GOT17S2_RELA:
+ case R_NDS32_GOT15S2_RELA:
+ case R_NDS32_GOTOFF:
+ case R_NDS32_GOTOFF_HI20:
+ case R_NDS32_GOTOFF_LO12:
+ case R_NDS32_GOTOFF_LO15:
+ case R_NDS32_GOTOFF_LO19:
+ case R_NDS32_GOTPC20:
+ case R_NDS32_GOTPC_HI20:
+ case R_NDS32_GOTPC_LO12:
+ case R_NDS32_GOT20:
+ case R_NDS32_TLS_IE_HI20:
+ case R_NDS32_TLS_IE_LO12S2:
+ if (dynobj == NULL)
+ htab->root.dynobj = dynobj = abfd;
+ if (!create_got_section (dynobj, info))
+ return FALSE;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ switch ((int) r_type)
+ {
+ case R_NDS32_GOT_HI20:
+ case R_NDS32_GOT_LO12:
+ case R_NDS32_GOT_LO15:
+ case R_NDS32_GOT_LO19:
+ case R_NDS32_GOT20:
+ case R_NDS32_TLS_IE_HI20:
+ case R_NDS32_TLS_IE_LO12S2:
+ switch (r_type)
+ {
+ case R_NDS32_TLS_IE_HI20:
+ case R_NDS32_TLS_IE_LO12S2:
+ tls_type = GOT_TLS_IE;
+ break;
+ default:
+ tls_type = GOT_NORMAL;
+ break;
+ }
+ if (h != NULL)
+ {
+ old_tls_type = elf32_nds32_hash_entry (h)->tls_type;
+ h->got.refcount += 1;
+ }
+ else
+ {
+ bfd_signed_vma *local_got_refcounts;
+
+ /* This is a global offset table entry for a local
+ symbol. */
+ local_got_refcounts = elf_local_got_refcounts (abfd);
+ if (local_got_refcounts == NULL)
+ {
+ bfd_size_type size;
+
+ size = symtab_hdr->sh_info;
+ size *= sizeof (bfd_signed_vma);
+ local_got_refcounts = (bfd_signed_vma *) bfd_zalloc (abfd, size);
+ if (local_got_refcounts == NULL)
+ return FALSE;
+ elf_local_got_refcounts (abfd) = local_got_refcounts;
+ }
+ local_got_refcounts[r_symndx] += 1;
+ old_tls_type = elf32_nds32_local_got_tls_type (abfd)[r_symndx];
+ }
+
+ /* We will already have issued an error message if there
+ is a TLS/non-TLS mismatch, based on the symbol
+ type. So just combine any TLS types needed. */
+ if (old_tls_type != GOT_UNKNOWN && old_tls_type != GOT_NORMAL
+ && tls_type != GOT_NORMAL)
+ tls_type |= old_tls_type;
+
+ if (old_tls_type != tls_type)
+ {
+ if (h != NULL)
+ elf32_nds32_hash_entry (h)->tls_type = tls_type;
+ else
+ elf32_nds32_local_got_tls_type (abfd)[r_symndx] = tls_type;
+ }
+ break;
+ case R_NDS32_9_PLTREL:
+ case R_NDS32_25_PLTREL:
+ case R_NDS32_PLTREL_HI20:
+ case R_NDS32_PLTREL_LO12:
+ case R_NDS32_PLT_GOTREL_HI20:
+ case R_NDS32_PLT_GOTREL_LO12:
+ case R_NDS32_PLT_GOTREL_LO15:
+ case R_NDS32_PLT_GOTREL_LO19:
+ case R_NDS32_PLT_GOTREL_LO20:
+
+ /* This symbol requires a procedure linkage table entry. We
+ actually build the entry in adjust_dynamic_symbol,
+ because this might be a case of linking PIC code without
+ linking in any dynamic objects, in which case we don't
+ need to generate a procedure linkage table after all. */
+
+ /* If this is a local symbol, we resolve it directly without
+ creating a procedure linkage table entry. */
+ if (h == NULL)
+ continue;
+
+ if (h->forced_local)
+ break;
+
+ elf32_nds32_hash_entry (h)->tls_type = GOT_NORMAL;
+ h->needs_plt = 1;
+ h->plt.refcount += 1;
+ break;
+
+ case R_NDS32_16_RELA:
+ case R_NDS32_20_RELA:
+ case R_NDS32_5_RELA:
+ case R_NDS32_32_RELA:
+ case R_NDS32_HI20_RELA:
+ case R_NDS32_LO12S3_RELA:
+ case R_NDS32_LO12S2_RELA:
+ case R_NDS32_LO12S2_DP_RELA:
+ case R_NDS32_LO12S2_SP_RELA:
+ case R_NDS32_LO12S1_RELA:
+ case R_NDS32_LO12S0_RELA:
+ case R_NDS32_LO12S0_ORI_RELA:
+ case R_NDS32_SDA16S3_RELA:
+ case R_NDS32_SDA17S2_RELA:
+ case R_NDS32_SDA18S1_RELA:
+ case R_NDS32_SDA19S0_RELA:
+ case R_NDS32_SDA15S3_RELA:
+ case R_NDS32_SDA15S2_RELA:
+ case R_NDS32_SDA12S2_DP_RELA:
+ case R_NDS32_SDA12S2_SP_RELA:
+ case R_NDS32_SDA15S1_RELA:
+ case R_NDS32_SDA15S0_RELA:
+ case R_NDS32_SDA_FP7U2_RELA:
+ case R_NDS32_15_PCREL_RELA:
+ case R_NDS32_17_PCREL_RELA:
+ case R_NDS32_25_PCREL_RELA:
+
+ if (h != NULL && !info->shared)
+ {
+ h->non_got_ref = 1;
+ h->plt.refcount += 1;
+ }
+
+ /* If we are creating a shared library, and this is a reloc against
+ a global symbol, or a non PC relative reloc against a local
+ symbol, then we need to copy the reloc into the shared library.
+ However, if we are linking with -Bsymbolic, we do not need to
+ copy a reloc against a global symbol which is defined in an
+ object we are including in the link (i.e., DEF_REGULAR is set).
+ At this point we have not seen all the input files, so it is
+ possible that DEF_REGULAR is not set now but will be set later
+ (it is never cleared). We account for that possibility below by
+ storing information in the dyn_relocs field of the hash table
+ entry. A similar situation occurs when creating shared libraries
+ and symbol visibility changes render the symbol local.
+
+ If on the other hand, we are creating an executable, we may need
+ to keep relocations for symbols satisfied by a dynamic library
+ if we manage to avoid copy relocs for the symbol. */
+ if ((info->shared
+ && (sec->flags & SEC_ALLOC) != 0
+ && ((r_type != R_NDS32_25_PCREL_RELA
+ && r_type != R_NDS32_15_PCREL_RELA
+ && r_type != R_NDS32_17_PCREL_RELA
+ && !(r_type == R_NDS32_32_RELA
+ && strcmp (sec->name, ".eh_frame") == 0))
+ || (h != NULL
+ && (!info->symbolic
+ || h->root.type == bfd_link_hash_defweak
+ || !h->def_regular))))
+ || (!info->shared
+ && (sec->flags & SEC_ALLOC) != 0
+ && h != NULL
+ && (h->root.type == bfd_link_hash_defweak
+ || !h->def_regular)))
+ {
+ struct elf_nds32_dyn_relocs *p;
+ struct elf_nds32_dyn_relocs **head;
+
+ if (dynobj == NULL)
+ htab->root.dynobj = dynobj = abfd;
+
+ /* When creating a shared object, we must copy these
+ relocs into the output file. We create a reloc
+ section in dynobj and make room for the reloc. */
+ if (sreloc == NULL)
+ {
+ const char *name;
+
+ name = bfd_elf_string_from_elf_section
+ (abfd, elf_elfheader (abfd)->e_shstrndx,
+ elf_section_data (sec)->rela.hdr->sh_name);
+ if (name == NULL)
+ return FALSE;
+
+ BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+ && strcmp (bfd_get_section_name (abfd, sec),
+ name + 5) == 0);
+
+ sreloc = bfd_get_section_by_name (dynobj, name);
+ if (sreloc == NULL)
+ {
+ flagword flags;
+
+ sreloc = bfd_make_section (dynobj, name);
+ flags = (SEC_HAS_CONTENTS | SEC_READONLY
+ | SEC_IN_MEMORY | SEC_LINKER_CREATED);
+ if ((sec->flags & SEC_ALLOC) != 0)
+ flags |= SEC_ALLOC | SEC_LOAD;
+ if (sreloc == NULL
+ || !bfd_set_section_flags (dynobj, sreloc, flags)
+ || !bfd_set_section_alignment (dynobj, sreloc, 2))
+ return FALSE;
+
+ elf_section_type (sreloc) = SHT_RELA;
+ }
+ elf_section_data (sec)->sreloc = sreloc;
+ }
+
+ /* If this is a global symbol, we count the number of
+ relocations we need for this symbol. */
+ if (h != NULL)
+ head = &((struct elf_nds32_link_hash_entry *) h)->dyn_relocs;
+ else
+ {
+ asection *s;
+
+ Elf_Internal_Sym *isym;
+ isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx);
+ if (isym == NULL)
+ return FALSE;
+
+ /* Track dynamic relocs needed for local syms too. */
+ s = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ if (s == NULL)
+ return FALSE;
+
+ head = ((struct elf_nds32_dyn_relocs **)
+ &elf_section_data (s)->local_dynrel);
+ }
+
+ p = *head;
+ if (p == NULL || p->sec != sec)
+ {
+ bfd_size_type amt = sizeof (*p);
+ p = (struct elf_nds32_dyn_relocs *) bfd_alloc (dynobj, amt);
+ if (p == NULL)
+ return FALSE;
+ p->next = *head;
+ *head = p;
+ p->sec = sec;
+ p->count = 0;
+ p->pc_count = 0;
+ }
+
+ p->count += 1;
+ if (ELF32_R_TYPE (rel->r_info) == R_NDS32_25_PCREL_RELA
+ || ELF32_R_TYPE (rel->r_info) == R_NDS32_15_PCREL_RELA
+ || ELF32_R_TYPE (rel->r_info) == R_NDS32_17_PCREL_RELA)
+ p->pc_count += 1;
+ }
+ break;
+
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_NDS32_RELA_GNU_VTINHERIT:
+ case R_NDS32_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_NDS32_GNU_VTENTRY:
+ if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+ case R_NDS32_RELA_GNU_VTENTRY:
+ if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
+ }
+ }
+
+ return TRUE;
+}
+
+/* Write VAL in uleb128 format to P, returning a pointer to the
+ following byte.
+ This code is copied from elf-attr.c. */
+
+static bfd_byte *
+write_uleb128 (bfd_byte *p, unsigned int val)
+{
+ bfd_byte c;
+ do
+ {
+ c = val & 0x7f;
+ val >>= 7;
+ if (val)
+ c |= 0x80;
+ *(p++) = c;
+ }
+ while (val);
+ return p;
+}
+
+static bfd_signed_vma
+calculate_offset (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Sym *isymbuf, Elf_Internal_Shdr *symtab_hdr,
+ int *pic_ext_target)
+{
+ bfd_signed_vma foff;
+ bfd_vma symval, addend;
+ asection *sym_sec;
+
+ /* Get the value of the symbol referred to by the reloc. */
+ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
+ {
+ Elf_Internal_Sym *isym;
+
+ /* A local symbol. */
+ isym = isymbuf + ELF32_R_SYM (irel->r_info);
+
+ if (isym->st_shndx == SHN_UNDEF)
+ sym_sec = bfd_und_section_ptr;
+ else if (isym->st_shndx == SHN_ABS)
+ sym_sec = bfd_abs_section_ptr;
+ else if (isym->st_shndx == SHN_COMMON)
+ sym_sec = bfd_com_section_ptr;
+ else
+ sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ symval = isym->st_value + sym_sec->output_section->vma
+ + sym_sec->output_offset;
+ }
+ else
+ {
+ unsigned long indx;
+ struct elf_link_hash_entry *h;
+ bfd *owner;
+
+ /* An external symbol. */
+ indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
+ h = elf_sym_hashes (abfd)[indx];
+ BFD_ASSERT (h != NULL);
+
+ if (h->root.type != bfd_link_hash_defined
+ && h->root.type != bfd_link_hash_defweak)
+ /* This appears to be a reference to an undefined
+ symbol. Just ignore it--it will be caught by the
+ regular reloc processing. */
+ return 0;
+ owner = h->root.u.def.section->owner;
+ if (owner && (elf_elfheader (owner)->e_flags & E_NDS32_HAS_PIC))
+ *pic_ext_target = 1;
+
+ if (h->root.u.def.section->flags & SEC_MERGE)
+ {
+ sym_sec = h->root.u.def.section;
+ symval = _bfd_merged_section_offset (abfd, &sym_sec,
+ elf_section_data (sym_sec)->sec_info,
+ h->root.u.def.value);
+ symval = symval + sym_sec->output_section->vma
+ + sym_sec->output_offset;
+ }
+ else
+ symval = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ }
+
+ addend = irel->r_addend;
+
+ foff = (symval + addend
+ - (irel->r_offset + sec->output_section->vma + sec->output_offset));
+ return foff;
+}
+
+static bfd_vma
+calculate_plt_memory_address (bfd *abfd, struct bfd_link_info *link_info,
+ Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Rela *irel,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ bfd_vma symval;
+
+ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
+ {
+ Elf_Internal_Sym *isym;
+ asection *sym_sec;
+ /* A local symbol. */
+ isym = isymbuf + ELF32_R_SYM (irel->r_info);
+
+ if (isym->st_shndx == SHN_UNDEF)
+ sym_sec = bfd_und_section_ptr;
+ else if (isym->st_shndx == SHN_ABS)
+ sym_sec = bfd_abs_section_ptr;
+ else if (isym->st_shndx == SHN_COMMON)
+ sym_sec = bfd_com_section_ptr;
+ else
+ sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ symval = isym->st_value + sym_sec->output_section->vma
+ + sym_sec->output_offset;
+ }
+ else
+ {
+ unsigned long indx;
+ struct elf_link_hash_entry *h;
+ struct elf_nds32_link_hash_table *htab;
+ asection *splt;
+
+ /* An external symbol. */
+ indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
+ h = elf_sym_hashes (abfd)[indx];
+ BFD_ASSERT (h != NULL);
+ htab = nds32_elf_hash_table (link_info);
+ splt = htab->splt;
+
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ if (h->plt.offset == (bfd_vma) - 1)
+ {
+ if (h->root.type != bfd_link_hash_defined
+ && h->root.type != bfd_link_hash_defweak)
+ /* This appears to be a reference to an undefined
+ * symbol. Just ignore it--it will be caught by the
+ * regular reloc processing. */
+ return 0;
+ symval = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ }
+ else
+ symval = splt->output_section->vma + h->plt.offset;
+ }
+
+ return symval;
+}
+
+static bfd_signed_vma
+calculate_plt_offset (bfd *abfd, asection *sec, struct bfd_link_info *link_info,
+ Elf_Internal_Sym *isymbuf, Elf_Internal_Rela *irel,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ bfd_vma foff;
+ if ((foff = calculate_plt_memory_address (abfd, link_info, isymbuf, irel,
+ symtab_hdr)) == 0)
+ return 0;
+ else
+ return foff - (irel->r_offset
+ + sec->output_section->vma + sec->output_offset);
+}
+
+/* Convert a 32-bit instruction to 16-bit one.
+ INSN is the input 32-bit instruction, INSN16 is the output 16-bit
+ instruction. If INSN_TYPE is not NULL, it the CGEN instruction
+ type of INSN16. Return 1 if successful. */
+
+static int
+nds32_convert_32_to_16_alu1 (bfd *abfd, uint32_t insn, uint16_t *pinsn16,
+ int *pinsn_type)
+{
+ uint16_t insn16 = 0;
+ int insn_type;
+ unsigned long mach = bfd_get_mach (abfd);
+
+ if (N32_SH5 (insn) != 0)
+ return 0;
+
+ switch (N32_SUB5 (insn))
+ {
+ case N32_ALU1_ADD_SLLI:
+ case N32_ALU1_ADD_SRLI:
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) && N32_IS_RB3 (insn))
+ {
+ insn16 = N16_TYPE333 (ADD333, N32_RT5 (insn), N32_RA5 (insn),
+ N32_RB5 (insn));
+ insn_type = NDS32_INSN_ADD333;
+ }
+ else if (N32_IS_RT4 (insn))
+ {
+ if (N32_RT5 (insn) == N32_RA5 (insn))
+ insn16 = N16_TYPE45 (ADD45, N32_RT54 (insn), N32_RB5 (insn));
+ else if (N32_RT5 (insn) == N32_RB5 (insn))
+ insn16 = N16_TYPE45 (ADD45, N32_RT54 (insn), N32_RA5 (insn));
+ insn_type = NDS32_INSN_ADD45;
+ }
+ break;
+
+ case N32_ALU1_SUB_SLLI:
+ case N32_ALU1_SUB_SRLI:
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) && N32_IS_RB3 (insn))
+ {
+ insn16 = N16_TYPE333 (SUB333, N32_RT5 (insn), N32_RA5 (insn),
+ N32_RB5 (insn));
+ insn_type = NDS32_INSN_SUB333;
+ }
+ else if (N32_IS_RT4 (insn) && N32_RT5 (insn) == N32_RA5 (insn))
+ {
+ insn16 = N16_TYPE45 (SUB45, N32_RT54 (insn), N32_RB5 (insn));
+ insn_type = NDS32_INSN_SUB45;
+ }
+ break;
+
+ case N32_ALU1_AND_SLLI:
+ case N32_ALU1_AND_SRLI:
+ /* and $rt, $rt, $rb -> and33 for v3, v3m. */
+ if (mach >= MACH_V3 && N32_IS_RT3 (insn) && N32_IS_RA3 (insn)
+ && N32_IS_RB3 (insn))
+ {
+ if (N32_RT5 (insn) == N32_RA5 (insn))
+ insn16 = N16_MISC33 (AND33, N32_RT5 (insn), N32_RB5 (insn));
+ else if (N32_RT5 (insn) == N32_RB5 (insn))
+ insn16 = N16_MISC33 (AND33, N32_RT5 (insn), N32_RA5 (insn));
+ if (insn16)
+ insn_type = NDS32_INSN_AND33;
+ }
+ break;
+
+ case N32_ALU1_XOR_SLLI:
+ case N32_ALU1_XOR_SRLI:
+ /* xor $rt, $rt, $rb -> xor33 for v3, v3m. */
+ if (mach >= MACH_V3 && N32_IS_RT3 (insn) && N32_IS_RA3 (insn)
+ && N32_IS_RB3 (insn))
+ {
+ if (N32_RT5 (insn) == N32_RA5 (insn))
+ insn16 = N16_MISC33 (XOR33, N32_RT5 (insn), N32_RB5 (insn));
+ else if (N32_RT5 (insn) == N32_RB5 (insn))
+ insn16 = N16_MISC33 (XOR33, N32_RT5 (insn), N32_RA5 (insn));
+ if (insn16)
+ insn_type = NDS32_INSN_XOR33;
+ }
+ break;
+
+ case N32_ALU1_OR_SLLI:
+ case N32_ALU1_OR_SRLI:
+ /* or $rt, $rt, $rb -> or33 for v3, v3m. */
+ if (mach >= MACH_V3 && N32_IS_RT3 (insn) && N32_IS_RA3 (insn)
+ && N32_IS_RB3 (insn))
+ {
+ if (N32_RT5 (insn) == N32_RA5 (insn))
+ insn16 = N16_MISC33 (OR33, N32_RT5 (insn), N32_RB5 (insn));
+ else if (N32_RT5 (insn) == N32_RB5 (insn))
+ insn16 = N16_MISC33 (OR33, N32_RT5 (insn), N32_RA5 (insn));
+ if (insn16)
+ insn_type = NDS32_INSN_OR33;
+ }
+ break;
+ case N32_ALU1_NOR:
+ /* nor $rt, $ra, $ra -> not33 for v3, v3m. */
+ if (mach >= MACH_V3 && N32_IS_RT3 (insn) && N32_IS_RB3 (insn)
+ && N32_RA5 (insn) == N32_RB5 (insn))
+ {
+ insn16 = N16_MISC33 (NOT33, N32_RT5 (insn), N32_RA5 (insn));
+ insn_type = NDS32_INSN_NOT33;
+ }
+ break;
+ case N32_ALU1_SRAI:
+ if (N32_IS_RT4 (insn) && N32_RT5 (insn) == N32_RA5 (insn))
+ {
+ insn16 = N16_TYPE45 (SRAI45, N32_RT54 (insn), N32_UB5 (insn));
+ insn_type = NDS32_INSN_SRAI45;
+ }
+ break;
+
+ case N32_ALU1_SRLI:
+ if (N32_IS_RT4 (insn) && N32_RT5 (insn) == N32_RA5 (insn))
+ {
+ insn16 = N16_TYPE45 (SRLI45, N32_RT54 (insn), N32_UB5 (insn));
+ insn_type = NDS32_INSN_SRLI45;
+ }
+ break;
+
+ case N32_ALU1_SLLI:
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) && N32_UB5 (insn) < 8)
+ {
+ insn16 = N16_TYPE333 (SLLI333, N32_RT5 (insn), N32_RA5 (insn),
+ N32_UB5 (insn));
+ insn_type = NDS32_INSN_SLLI333;
+ }
+ break;
+
+ case N32_ALU1_ZEH:
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn))
+ {
+ insn16 = N16_BFMI333 (ZEH33, N32_RT5 (insn), N32_RA5 (insn));
+ insn_type = NDS32_INSN_ZEH33;
+ }
+ break;
+
+ case N32_ALU1_SEB:
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn))
+ {
+ insn16 = N16_BFMI333 (SEB33, N32_RT5 (insn), N32_RA5 (insn));
+ insn_type = NDS32_INSN_SEB33;
+ }
+ break;
+
+ case N32_ALU1_SEH:
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn))
+ {
+ insn16 = N16_BFMI333 (SEH33, N32_RT5 (insn), N32_RA5 (insn));
+ insn_type = NDS32_INSN_SEH33;
+ }
+ break;
+
+ case N32_ALU1_SLT:
+ if (N32_RT5 (insn) == REG_R15 && N32_IS_RA4 (insn))
+ {
+ /* Implicit r15. */
+ insn16 = N16_TYPE45 (SLT45, N32_RA54 (insn), N32_RB5 (insn));
+ insn_type = NDS32_INSN_SLT45;
+ }
+ break;
+
+ case N32_ALU1_SLTS:
+ if (N32_RT5 (insn) == REG_R15 && N32_IS_RA4 (insn))
+ {
+ /* Implicit r15. */
+ insn16 = N16_TYPE45 (SLTS45, N32_RA54 (insn), N32_RB5 (insn));
+ insn_type = NDS32_INSN_SLTS45;
+ }
+ break;
+ }
+
+ if ((insn16 & 0x8000) == 0)
+ return 0;
+
+ if (pinsn16)
+ *pinsn16 = insn16;
+ if (pinsn_type)
+ *pinsn_type = insn_type;
+ return 1;
+}
+
+static int
+nds32_convert_32_to_16_alu2 (bfd *abfd, uint32_t insn, uint16_t *pinsn16,
+ int *pinsn_type)
+{
+ uint16_t insn16 = 0;
+ int insn_type;
+ unsigned long mach = bfd_get_mach (abfd);
+
+ /* TODO: bset, bclr, btgl, btst. */
+ if (__GF (insn, 6, 4) != 0)
+ return 0;
+
+ switch (N32_IMMU (insn, 6))
+ {
+ case N32_ALU2_MUL:
+ if (mach >= MACH_V3 && N32_IS_RT3 (insn) && N32_IS_RA3 (insn)
+ && N32_IS_RB3 (insn))
+ {
+ if (N32_RT5 (insn) == N32_RA5 (insn))
+ insn16 = N16_MISC33 (MUL33, N32_RT5 (insn), N32_RB5 (insn));
+ else if (N32_RT5 (insn) == N32_RB5 (insn))
+ insn16 = N16_MISC33 (MUL33, N32_RT5 (insn), N32_RA5 (insn));
+ if (insn16)
+ insn_type = NDS32_INSN_MUL33;
+ }
+ }
+
+ if ((insn16 & 0x8000) == 0)
+ return 0;
+
+ if (pinsn16)
+ *pinsn16 = insn16;
+ if (pinsn_type)
+ *pinsn_type = insn_type;
+ return 1;
+}
+
+int
+nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16,
+ int *pinsn_type)
+{
+ int op6;
+ uint16_t insn16 = 0;
+ int insn_type;
+ unsigned long mach = bfd_get_mach (abfd);
+
+ /* Decode 32-bit instruction. */
+ if (insn & 0x80000000)
+ {
+ /* Not 32-bit insn. */
+ return 0;
+ }
+
+ op6 = N32_OP6 (insn);
+
+ /* Convert it to 16-bit instruction. */
+ switch (op6)
+ {
+ case N32_OP6_MOVI:
+ if (IS_WITHIN_S (N32_IMM20S (insn), 5))
+ {
+ insn16 = N16_TYPE55 (MOVI55, N32_RT5 (insn), N32_IMM20S (insn));
+ insn_type = NDS32_INSN_MOVI55;
+ }
+ else if (mach >= MACH_V3 && N32_IMM20S (insn) >= 16
+ && N32_IMM20S (insn) < 48 && N32_IS_RT4 (insn))
+ {
+ insn16 = N16_TYPE45 (MOVPI45, N32_RT54 (insn),
+ N32_IMM20S (insn) - 16);
+ insn_type = NDS32_INSN_MOVPI45;
+ }
+ break;
+
+ case N32_OP6_ADDI:
+ if (N32_IMM15S (insn) == 0)
+ {
+ /* Do not convert `addi $sp, $sp, 0' to `mov55 $sp, $sp',
+ because `mov55 $sp, $sp' is ifret16 in V3 ISA. */
+ if (mach <= MACH_V2
+ || N32_RT5 (insn) != REG_SP || N32_RA5 (insn) != REG_SP)
+ {
+ insn16 = N16_TYPE55 (MOV55, N32_RT5 (insn), N32_RA5 (insn));
+ insn_type = NDS32_INSN_MOV55;
+ }
+ }
+ else if (N32_IMM15S (insn) > 0)
+ {
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) && N32_IMM15S (insn) < 8)
+ {
+ insn16 = N16_TYPE333 (ADDI333, N32_RT5 (insn), N32_RA5 (insn),
+ N32_IMM15S (insn));
+ insn_type = NDS32_INSN_ADDI333;
+ }
+ else if (N32_IS_RT4 (insn) && N32_RT5 (insn) == N32_RA5 (insn)
+ && N32_IMM15S (insn) < 32)
+ {
+ insn16 = N16_TYPE45 (ADDI45, N32_RT54 (insn), N32_IMM15S (insn));
+ insn_type = NDS32_INSN_ADDI45;
+ }
+ else if (mach >= MACH_V2 && N32_RT5 (insn) == REG_SP
+ && N32_RT5 (insn) == N32_RA5 (insn)
+ && N32_IMM15S (insn) < 512)
+ {
+ insn16 = N16_TYPE10 (ADDI10S, N32_IMM15S (insn));
+ insn_type = NDS32_INSN_ADDI10_SP;
+ }
+ else if (mach >= MACH_V3 && N32_IS_RT3 (insn)
+ && N32_RA5 (insn) == REG_SP && N32_IMM15S (insn) < 256
+ && (N32_IMM15S (insn) % 4 == 0))
+ {
+ insn16 = N16_TYPE36 (ADDRI36_SP, N32_RT5 (insn),
+ N32_IMM15S (insn) >> 2);
+ insn_type = NDS32_INSN_ADDRI36_SP;
+ }
+ }
+ else
+ {
+ /* Less than 0. */
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) && N32_IMM15S (insn) > -8)
+ {
+ insn16 = N16_TYPE333 (SUBI333, N32_RT5 (insn), N32_RA5 (insn),
+ 0 - N32_IMM15S (insn));
+ insn_type = NDS32_INSN_SUBI333;
+ }
+ else if (N32_IS_RT4 (insn) && N32_RT5 (insn) == N32_RA5 (insn)
+ && N32_IMM15S (insn) > -32)
+ {
+ insn16 = N16_TYPE45 (SUBI45, N32_RT54 (insn),
+ 0 - N32_IMM15S (insn));
+ insn_type = NDS32_INSN_SUBI45;
+ }
+ else if (mach >= MACH_V2 && N32_RT5 (insn) == REG_SP
+ && N32_RT5 (insn) == N32_RA5 (insn)
+ && N32_IMM15S (insn) >= -512)
+ {
+ insn16 = N16_TYPE10 (ADDI10S, N32_IMM15S (insn));
+ insn_type = NDS32_INSN_ADDI10_SP;
+ }
+ }
+ break;
+
+ case N32_OP6_ORI:
+ if (N32_IMM15S (insn) == 0)
+ {
+ /* Do not convert `ori $sp, $sp, 0' to `mov55 $sp, $sp',
+ because `mov55 $sp, $sp' is ifret16 in V3 ISA. */
+ if (mach <= MACH_V2
+ || N32_RT5 (insn) != REG_SP || N32_RA5 (insn) != REG_SP)
+ {
+ insn16 = N16_TYPE55 (MOV55, N32_RT5 (insn), N32_RA5 (insn));
+ insn_type = NDS32_INSN_MOV55;
+ }
+ }
+ break;
+
+ case N32_OP6_SUBRI:
+ if (mach >= MACH_V3 && N32_IS_RT3 (insn)
+ && N32_IS_RA3 (insn) && N32_IMM15S (insn) == 0)
+ {
+ insn16 = N16_MISC33 (NEG33, N32_RT5 (insn), N32_RA5 (insn));
+ insn_type = NDS32_INSN_NEG33;
+ }
+ break;
+
+ case N32_OP6_ANDI:
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn))
+ {
+ if (N32_IMM15U (insn) == 1)
+ {
+ insn16 = N16_BFMI333 (XLSB33, N32_RT5 (insn), N32_RA5 (insn));
+ insn_type = NDS32_INSN_XLSB33;
+ }
+ else if (N32_IMM15U (insn) == 0x7ff)
+ {
+ insn16 = N16_BFMI333 (X11B33, N32_RT5 (insn), N32_RA5 (insn));
+ insn_type = NDS32_INSN_X11B33;
+ }
+ else if (N32_IMM15U (insn) == 0xff)
+ {
+ insn16 = N16_BFMI333 (ZEB33, N32_RT5 (insn), N32_RA5 (insn));
+ insn_type = NDS32_INSN_ZEB33;
+ }
+ else if (mach >= MACH_V3 && N32_RT5 (insn) == N32_RA5 (insn)
+ && N32_IMM15U (insn) < 256)
+ {
+ int imm15u = N32_IMM15U (insn);
+
+ if (__builtin_popcount (imm15u) == 1)
+ {
+ /* BMSKI33 */
+ int imm3u = __builtin_ctz (imm15u);
+
+ insn16 = N16_BFMI333 (BMSKI33, N32_RT5 (insn), imm3u);
+ insn_type = NDS32_INSN_BMSKI33;
+ }
+ else if (imm15u != 0 && __builtin_popcount (imm15u + 1) == 1)
+ {
+ /* FEXTI33 */
+ int imm3u = __builtin_ctz (imm15u + 1) - 1;
+
+ insn16 = N16_BFMI333 (FEXTI33, N32_RT5 (insn), imm3u);
+ insn_type = NDS32_INSN_FEXTI33;
+ }
+ }
+ }
+ break;
+
+ case N32_OP6_SLTI:
+ if (N32_RT5 (insn) == REG_R15 && N32_IS_RA4 (insn)
+ && IS_WITHIN_U (N32_IMM15S (insn), 5))
+ {
+ insn16 = N16_TYPE45 (SLTI45, N32_RA54 (insn), N32_IMM15S (insn));
+ insn_type = NDS32_INSN_SLTI45;
+ }
+ break;
+
+ case N32_OP6_SLTSI:
+ if (N32_RT5 (insn) == REG_R15 && N32_IS_RA4 (insn)
+ && IS_WITHIN_U (N32_IMM15S (insn), 5))
+ {
+ insn16 = N16_TYPE45 (SLTSI45, N32_RA54 (insn), N32_IMM15S (insn));
+ insn_type = NDS32_INSN_SLTSI45;
+ }
+ break;
+
+ case N32_OP6_LWI:
+ if (N32_IS_RT4 (insn) && N32_IMM15S (insn) == 0)
+ {
+ insn16 = N16_TYPE45 (LWI450, N32_RT54 (insn), N32_RA5 (insn));
+ insn_type = NDS32_INSN_LWI450;
+ }
+ else if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn)
+ && IS_WITHIN_U (N32_IMM15S (insn), 3))
+ {
+ insn16 = N16_TYPE333 (LWI333, N32_RT5 (insn), N32_RA5 (insn),
+ N32_IMM15S (insn));
+ insn_type = NDS32_INSN_LWI333;
+ }
+ else if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_FP
+ && IS_WITHIN_U (N32_IMM15S (insn), 7))
+ {
+ insn16 = N16_TYPE37 (XWI37, N32_RT5 (insn), 0, N32_IMM15S (insn));
+ insn_type = NDS32_INSN_LWI37;
+ }
+ else if (mach >= MACH_V2 && N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_SP
+ && IS_WITHIN_U (N32_IMM15S (insn), 7))
+ {
+ insn16 = N16_TYPE37 (XWI37SP, N32_RT5 (insn), 0, N32_IMM15S (insn));
+ insn_type = NDS32_INSN_LWI37_SP;
+ }
+ else if (mach >= MACH_V2 && N32_IS_RT4 (insn) && N32_RA5 (insn) == REG_R8
+ && -32 <= N32_IMM15S (insn) && N32_IMM15S (insn) < 0)
+ {
+ insn16 = N16_TYPE45 (LWI45_FE, N32_RT54 (insn),
+ N32_IMM15S (insn) + 32);
+ insn_type = NDS32_INSN_LWI45_FE;
+ }
+ break;
+
+ case N32_OP6_SWI:
+ if (N32_IS_RT4 (insn) && N32_IMM15S (insn) == 0)
+ {
+ insn16 = N16_TYPE45 (SWI450, N32_RT54 (insn), N32_RA5 (insn));
+ insn_type = NDS32_INSN_SWI450;
+ }
+ else if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn)
+ && IS_WITHIN_U (N32_IMM15S (insn), 3))
+ {
+ insn16 = N16_TYPE333 (SWI333, N32_RT5 (insn), N32_RA5 (insn),
+ N32_IMM15S (insn));
+ insn_type = NDS32_INSN_SWI333;
+ }
+ else if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_FP
+ && IS_WITHIN_U (N32_IMM15S (insn), 7))
+ {
+ insn16 = N16_TYPE37 (XWI37, N32_RT5 (insn), 1, N32_IMM15S (insn));
+ insn_type = NDS32_INSN_SWI37;
+ }
+ else if (mach >= MACH_V2 && N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_SP
+ && IS_WITHIN_U (N32_IMM15S (insn), 7))
+ {
+ insn16 = N16_TYPE37 (XWI37SP, N32_RT5 (insn), 1, N32_IMM15S (insn));
+ insn_type = NDS32_INSN_SWI37_SP;
+ }
+ break;
+
+ case N32_OP6_LWI_BI:
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn)
+ && IS_WITHIN_U (N32_IMM15S (insn), 3))
+ {
+ insn16 = N16_TYPE333 (LWI333_BI, N32_RT5 (insn), N32_RA5 (insn),
+ N32_IMM15S (insn));
+ insn_type = NDS32_INSN_LWI333_BI;
+ }
+ break;
+
+ case N32_OP6_SWI_BI:
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn)
+ && IS_WITHIN_U (N32_IMM15S (insn), 3))
+ {
+ insn16 = N16_TYPE333 (SWI333_BI, N32_RT5 (insn), N32_RA5 (insn),
+ N32_IMM15S (insn));
+ insn_type = NDS32_INSN_SWI333_BI;
+ }
+ break;
+
+ case N32_OP6_LHI:
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn)
+ && IS_WITHIN_U (N32_IMM15S (insn), 3))
+ {
+ insn16 = N16_TYPE333 (LHI333, N32_RT5 (insn), N32_RA5 (insn),
+ N32_IMM15S (insn));
+ insn_type = NDS32_INSN_LHI333;
+ }
+ break;
+
+ case N32_OP6_SHI:
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn)
+ && IS_WITHIN_U (N32_IMM15S (insn), 3))
+ {
+ insn16 = N16_TYPE333 (SHI333, N32_RT5 (insn), N32_RA5 (insn),
+ N32_IMM15S (insn));
+ insn_type = NDS32_INSN_SHI333;
+ }
+ break;
+
+ case N32_OP6_LBI:
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn)
+ && IS_WITHIN_U (N32_IMM15S (insn), 3))
+ {
+ insn16 = N16_TYPE333 (LBI333, N32_RT5 (insn), N32_RA5 (insn),
+ N32_IMM15S (insn));
+ insn_type = NDS32_INSN_LBI333;
+ }
+ break;
+
+ case N32_OP6_SBI:
+ if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn)
+ && IS_WITHIN_U (N32_IMM15S (insn), 3))
+ {
+ insn16 = N16_TYPE333 (SBI333, N32_RT5 (insn), N32_RA5 (insn),
+ N32_IMM15S (insn));
+ insn_type = NDS32_INSN_SBI333;
+ }
+ break;
+
+ case N32_OP6_ALU1:
+ return nds32_convert_32_to_16_alu1 (abfd, insn, pinsn16, pinsn_type);
+
+ case N32_OP6_ALU2:
+ return nds32_convert_32_to_16_alu2 (abfd, insn, pinsn16, pinsn_type);
+
+ case N32_OP6_BR1:
+ if (!IS_WITHIN_S (N32_IMM14S (insn), 8))
+ goto done;
+
+ if ((insn & __BIT (14)) == 0)
+ {
+ /* N32_BR1_BEQ */
+ if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_R5
+ && N32_RT5 (insn) != REG_R5)
+ insn16 = N16_TYPE38 (BEQS38, N32_RT5 (insn), N32_IMM14S (insn));
+ else if (N32_IS_RA3 (insn) && N32_RT5 (insn) == REG_R5
+ && N32_RA5 (insn) != REG_R5)
+ insn16 = N16_TYPE38 (BEQS38, N32_RA5 (insn), N32_IMM14S (insn));
+ insn_type = NDS32_INSN_BEQS38;
+ break;
+ }
+ else
+ {
+ /* N32_BR1_BNE */
+ if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_R5
+ && N32_RT5 (insn) != REG_R5)
+ insn16 = N16_TYPE38 (BNES38, N32_RT5 (insn), N32_IMM14S (insn));
+ else if (N32_IS_RA3 (insn) && N32_RT5 (insn) == REG_R5
+ && N32_RA5 (insn) != REG_R5)
+ insn16 = N16_TYPE38 (BNES38, N32_RA5 (insn), N32_IMM14S (insn));
+ insn_type = NDS32_INSN_BNES38;
+ break;
+ }
+ break;
+
+ case N32_OP6_BR2:
+ switch (N32_BR2_SUB (insn))
+ {
+ case N32_BR2_BEQZ:
+ if (N32_IS_RT3 (insn) && IS_WITHIN_S (N32_IMM16S (insn), 8))
+ {
+ insn16 = N16_TYPE38 (BEQZ38, N32_RT5 (insn), N32_IMM16S (insn));
+ insn_type = NDS32_INSN_BEQZ38;
+ }
+ else if (N32_RT5 (insn) == REG_R15
+ && IS_WITHIN_S (N32_IMM16S (insn), 8))
+ {
+ insn16 = N16_TYPE8 (BEQZS8, N32_IMM16S (insn));
+ insn_type = NDS32_INSN_BEQZS8;
+ }
+ break;
+
+ case N32_BR2_BNEZ:
+ if (N32_IS_RT3 (insn) && IS_WITHIN_S (N32_IMM16S (insn), 8))
+ {
+ insn16 = N16_TYPE38 (BNEZ38, N32_RT5 (insn), N32_IMM16S (insn));
+ insn_type = NDS32_INSN_BNEZ38;
+ }
+ else if (N32_RT5 (insn) == REG_R15
+ && IS_WITHIN_S (N32_IMM16S (insn), 8))
+ {
+ insn16 = N16_TYPE8 (BNEZS8, N32_IMM16S (insn));
+ insn_type = NDS32_INSN_BNEZS8;
+ }
+ break;
+
+ case N32_BR2_IFCALL:
+ if (IS_WITHIN_U (N32_IMM16S (insn), 9))
+ {
+ insn16 = N16_TYPE9 (IFCALL9, N32_IMM16S (insn));
+ insn_type = NDS32_INSN_IFCALL9;
+ }
+ break;
+ }
+ break;
+
+ case N32_OP6_JI:
+ if ((insn & __BIT (24)) == 0)
+ {
+ /* N32_JI_J */
+ if (IS_WITHIN_S (N32_IMM24S (insn), 8))
+ {
+ insn16 = N16_TYPE8 (J8, N32_IMM24S (insn));
+ insn_type = NDS32_INSN_J8;
+ }
+ }
+ break;
+
+ case N32_OP6_JREG:
+ if (__GF (insn, 8, 2) != 0)
+ goto done;
+
+ switch (N32_IMMU (insn, 5))
+ {
+ case N32_JREG_JR:
+ if (N32_JREG_HINT (insn) == 0)
+ {
+ /* jr */
+ insn16 = N16_TYPE5 (JR5, N32_RB5 (insn));
+ insn_type = NDS32_INSN_JR5;
+ }
+ else if (N32_JREG_HINT (insn) == 1)
+ {
+ /* ret */
+ insn16 = N16_TYPE5 (RET5, N32_RB5 (insn));
+ insn_type = NDS32_INSN_RET5;
+ }
+ else if (N32_JREG_HINT (insn) == 3)
+ {
+ /* ifret = mov55 $sp, $sp */
+ insn16 = N16_TYPE55 (MOV55, REG_SP, REG_SP);
+ insn_type = NDS32_INSN_IFRET;
+ }
+ break;
+
+ case N32_JREG_JRAL:
+ /* It's convertible when return rt5 is $lp and address
+ translation is kept. */
+ if (N32_RT5 (insn) == REG_LP && N32_JREG_HINT (insn) == 0)
+ {
+ insn16 = N16_TYPE5 (JRAL5, N32_RB5 (insn));
+ insn_type = NDS32_INSN_JRAL5;
+ }
+ break;
+ }
+ break;
+
+ case N32_OP6_MISC:
+ if (N32_SUB5 (insn) == N32_MISC_BREAK && N32_SWID (insn) < 32)
+ {
+ /* For v3, swid above 31 are used for ex9.it. */
+ insn16 = N16_TYPE5 (BREAK16, N32_SWID (insn));
+ insn_type = NDS32_INSN_BREAK16;
+ }
+ break;
+
+ default:
+ /* This instruction has no 16-bit variant. */
+ goto done;
+ }
+
+done:
+ /* Bit-15 of insn16 should be set for a valid instruction. */
+ if ((insn16 & 0x8000) == 0)
+ return 0;
+
+ if (pinsn16)
+ *pinsn16 = insn16;
+ if (pinsn_type)
+ *pinsn_type = insn_type;
+ return 1;
+}
+
+static int
+special_convert_32_to_16 (unsigned long insn, uint16_t *pinsn16,
+ Elf_Internal_Rela *reloc)
+{
+ uint16_t insn16 = 0;
+
+ if ((reloc->r_addend & R_NDS32_INSN16_FP7U2_FLAG) == 0
+ || (ELF32_R_TYPE (reloc->r_info) != R_NDS32_INSN16))
+ return 0;
+
+ if (!N32_IS_RT3 (insn))
+ return 0;
+
+ switch (N32_OP6 (insn))
+ {
+ case N32_OP6_LWI:
+ if (N32_RA5 (insn) == REG_GP && IS_WITHIN_U (N32_IMM15S (insn), 7))
+ insn16 = N16_TYPE37 (XWI37, N32_RT5 (insn), 0, N32_IMM15S (insn));
+ break;
+ case N32_OP6_SWI:
+ if (N32_RA5 (insn) == REG_GP && IS_WITHIN_U (N32_IMM15S (insn), 7))
+ insn16 = N16_TYPE37 (XWI37, N32_RT5 (insn), 1, N32_IMM15S (insn));
+ break;
+ case N32_OP6_HWGP:
+ if (!IS_WITHIN_U (N32_IMM17S (insn), 7))
+ break;
+
+ if (__GF (insn, 17, 3) == 6)
+ insn16 = N16_TYPE37 (XWI37, N32_RT5 (insn), 0, N32_IMM17S (insn));
+ else if (__GF (insn, 17, 3) == 7)
+ insn16 = N16_TYPE37 (XWI37, N32_RT5 (insn), 1, N32_IMM17S (insn));
+ break;
+ }
+
+ if ((insn16 & 0x8000) == 0)
+ return 0;
+
+ *pinsn16 = insn16;
+ return 1;
+}
+
+/* Convert a 16-bit instruction to 32-bit one.
+ INSN16 it the input and PINSN it the point to output.
+ Return non-zero on successful. Otherwise 0 is returned. */
+
+int
+nds32_convert_16_to_32 (bfd *abfd, uint16_t insn16, uint32_t *pinsn)
+{
+ uint32_t insn = 0xffffffff;
+ unsigned long mach = bfd_get_mach (abfd);
+
+ /* NOTE: push25, pop25 and movd44 do not have 32-bit variants. */
+
+ switch (__GF (insn16, 9, 6))
+ {
+ case 0x4: /* add45 */
+ insn = N32_ALU1 (ADD, N16_RT4 (insn16), N16_RT4 (insn16),
+ N16_RA5 (insn16));
+ goto done;
+ case 0x5: /* sub45 */
+ insn = N32_ALU1 (SUB, N16_RT4 (insn16), N16_RT4 (insn16),
+ N16_RA5 (insn16));
+ goto done;
+ case 0x6: /* addi45 */
+ insn = N32_TYPE2 (ADDI, N16_RT4 (insn16), N16_RT4 (insn16),
+ N16_IMM5U (insn16));
+ goto done;
+ case 0x7: /* subi45 */
+ insn = N32_TYPE2 (ADDI, N16_RT4 (insn16), N16_RT4 (insn16),
+ -N16_IMM5U (insn16));
+ goto done;
+ case 0x8: /* srai45 */
+ insn = N32_ALU1 (SRAI, N16_RT4 (insn16), N16_RT4 (insn16),
+ N16_IMM5U (insn16));
+ goto done;
+ case 0x9: /* srli45 */
+ insn = N32_ALU1 (SRLI, N16_RT4 (insn16), N16_RT4 (insn16),
+ N16_IMM5U (insn16));
+ goto done;
+ case 0xa: /* slli333 */
+ insn = N32_ALU1 (SLLI, N16_RT3 (insn16), N16_RA3 (insn16),
+ N16_IMM3U (insn16));
+ goto done;
+ case 0xc: /* add333 */
+ insn = N32_ALU1 (ADD, N16_RT3 (insn16), N16_RA3 (insn16),
+ N16_RB3 (insn16));
+ goto done;
+ case 0xd: /* sub333 */
+ insn = N32_ALU1 (SUB, N16_RT3 (insn16), N16_RA3 (insn16),
+ N16_RB3 (insn16));
+ goto done;
+ case 0xe: /* addi333 */
+ insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), N16_RA3 (insn16),
+ N16_IMM3U (insn16));
+ goto done;
+ case 0xf: /* subi333 */
+ insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), N16_RA3 (insn16),
+ -N16_IMM3U (insn16));
+ goto done;
+ case 0x10: /* lwi333 */
+ insn = N32_TYPE2 (LWI, N16_RT3 (insn16), N16_RA3 (insn16),
+ N16_IMM3U (insn16));
+ goto done;
+ case 0x12: /* lhi333 */
+ insn = N32_TYPE2 (LHI, N16_RT3 (insn16), N16_RA3 (insn16),
+ N16_IMM3U (insn16));
+ goto done;
+ case 0x13: /* lbi333 */
+ insn = N32_TYPE2 (LBI, N16_RT3 (insn16), N16_RA3 (insn16),
+ N16_IMM3U (insn16));
+ goto done;
+ case 0x11: /* lwi333.bi */
+ insn = N32_TYPE2 (LWI_BI, N16_RT3 (insn16), N16_RA3 (insn16),
+ N16_IMM3U (insn16));
+ goto done;
+ case 0x14: /* swi333 */
+ insn = N32_TYPE2 (SWI, N16_RT3 (insn16), N16_RA3 (insn16),
+ N16_IMM3U (insn16));
+ goto done;
+ case 0x16: /* shi333 */
+ insn = N32_TYPE2 (SHI, N16_RT3 (insn16), N16_RA3 (insn16),
+ N16_IMM3U (insn16));
+ goto done;
+ case 0x17: /* sbi333 */
+ insn = N32_TYPE2 (SBI, N16_RT3 (insn16), N16_RA3 (insn16),
+ N16_IMM3U (insn16));
+ goto done;
+ case 0x15: /* swi333.bi */
+ insn = N32_TYPE2 (SWI_BI, N16_RT3 (insn16), N16_RA3 (insn16),
+ N16_IMM3U (insn16));
+ goto done;
+ case 0x18: /* addri36.sp */
+ insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), REG_SP,
+ N16_IMM6U (insn16) << 2);
+ goto done;
+ case 0x19: /* lwi45.fe */
+ insn = N32_TYPE2 (LWI, N16_RT4 (insn16), REG_R8,
+ (N16_IMM5U (insn16) - 32));
+ goto done;
+ case 0x1a: /* lwi450 */
+ insn = N32_TYPE2 (LWI, N16_RT4 (insn16), N16_RA5 (insn16), 0);
+ goto done;
+ case 0x1b: /* swi450 */
+ insn = N32_TYPE2 (SWI, N16_RT4 (insn16), N16_RA5 (insn16), 0);
+ goto done;
+
+ /* These are r15 implied instructions. */
+ case 0x30: /* slts45 */
+ insn = N32_ALU1 (SLTS, REG_TA, N16_RT4 (insn16), N16_RA5 (insn16));
+ goto done;
+ case 0x31: /* slt45 */
+ insn = N32_ALU1 (SLT, REG_TA, N16_RT4 (insn16), N16_RA5 (insn16));
+ goto done;
+ case 0x32: /* sltsi45 */
+ insn = N32_TYPE2 (SLTSI, REG_TA, N16_RT4 (insn16), N16_IMM5U (insn16));
+ goto done;
+ case 0x33: /* slti45 */
+ insn = N32_TYPE2 (SLTI, REG_TA, N16_RT4 (insn16), N16_IMM5U (insn16));
+ goto done;
+ case 0x34: /* beqzs8, bnezs8 */
+ if (insn16 & __BIT (8))
+ insn = N32_BR2 (BNEZ, REG_TA, N16_IMM8S (insn16));
+ else
+ insn = N32_BR2 (BEQZ, REG_TA, N16_IMM8S (insn16));
+ goto done;
+
+ case 0x35: /* break16, ex9.it */
+ /* Only consider range of v3 break16. */
+ insn = N32_TYPE0 (MISC, (N16_IMM5U (insn16) << 5) | N32_MISC_BREAK);
+ goto done;
+
+ case 0x3c: /* ifcall9 */
+ insn = N32_BR2 (IFCALL, 0, N16_IMM9U (insn16));
+ goto done;
+ case 0x3d: /* movpi45 */
+ insn = N32_TYPE1 (MOVI, N16_RT4 (insn16), N16_IMM5U (insn16) + 16);
+ goto done;
+
+ case 0x3f: /* MISC33 */
+ switch (insn16 & 0x7)
+ {
+ case 2: /* neg33 */
+ insn = N32_TYPE2 (SUBRI, N16_RT3 (insn16), N16_RA3 (insn16), 0);
+ break;
+ case 3: /* not33 */
+ insn = N32_ALU1 (NOR, N16_RT3 (insn16), N16_RA3 (insn16),
+ N16_RA3 (insn16));
+ break;
+ case 4: /* mul33 */
+ insn = N32_ALU2 (MUL, N16_RT3 (insn16), N16_RT3 (insn16),
+ N16_RA3 (insn16));
+ break;
+ case 5: /* xor33 */
+ insn = N32_ALU1 (XOR, N16_RT3 (insn16), N16_RT3 (insn16),
+ N16_RA3 (insn16));
+ break;
+ case 6: /* and33 */
+ insn = N32_ALU1 (AND, N16_RT3 (insn16), N16_RT3 (insn16),
+ N16_RA3 (insn16));
+ break;
+ case 7: /* or33 */
+ insn = N32_ALU1 (OR, N16_RT3 (insn16), N16_RT3 (insn16),
+ N16_RA3 (insn16));
+ break;
+ }
+ goto done;
+
+ case 0xb:
+ switch (insn16 & 0x7)
+ {
+ case 0: /* zeb33 */
+ insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RA3 (insn16), 0xff);
+ break;
+ case 1: /* zeh33 */
+ insn = N32_ALU1 (ZEH, N16_RT3 (insn16), N16_RA3 (insn16), 0);
+ break;
+ case 2: /* seb33 */
+ insn = N32_ALU1 (SEB, N16_RT3 (insn16), N16_RA3 (insn16), 0);
+ break;
+ case 3: /* seh33 */
+ insn = N32_ALU1 (SEH, N16_RT3 (insn16), N16_RA3 (insn16), 0);
+ break;
+ case 4: /* xlsb33 */
+ insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RA3 (insn16), 1);
+ break;
+ case 5: /* x11b33 */
+ insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RA3 (insn16), 0x7ff);
+ break;
+ case 6: /* bmski33 */
+ insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RT3 (insn16),
+ 1 << __GF (insn16, 3, 3));
+ break;
+ case 7: /* fexti33 */
+ insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RT3 (insn16),
+ (1 << (__GF (insn16, 3, 3) + 1)) - 1);
+ break;
+ }
+ goto done;
+ }
+
+ switch (__GF (insn16, 10, 5))
+ {
+ case 0x0: /* mov55 or ifret16 */
+ if (mach >= MACH_V3 && N16_RT5 (insn16) == REG_SP
+ && N16_RT5 (insn16) == N16_RA5 (insn16))
+ insn = N32_JREG (JR, 0, 0, 0, 3);
+ else
+ insn = N32_TYPE2 (ADDI, N16_RT5 (insn16), N16_RA5 (insn16), 0);
+ goto done;
+ case 0x1: /* movi55 */
+ insn = N32_TYPE1 (MOVI, N16_RT5 (insn16), N16_IMM5S (insn16));
+ goto done;
+ case 0x1b: /* addi10s (V2) */
+ insn = N32_TYPE2 (ADDI, REG_SP, REG_SP, N16_IMM10S (insn16));
+ goto done;
+ }
+
+ switch (__GF (insn16, 11, 4))
+ {
+ case 0x7: /* lwi37.fp/swi37.fp */
+ if (insn16 & __BIT (7)) /* swi37.fp */
+ insn = N32_TYPE2 (SWI, N16_RT38 (insn16), REG_FP, N16_IMM7U (insn16));
+ else /* lwi37.fp */
+ insn = N32_TYPE2 (LWI, N16_RT38 (insn16), REG_FP, N16_IMM7U (insn16));
+ goto done;
+ case 0x8: /* beqz38 */
+ insn = N32_BR2 (BEQZ, N16_RT38 (insn16), N16_IMM8S (insn16));
+ goto done;
+ case 0x9: /* bnez38 */
+ insn = N32_BR2 (BNEZ, N16_RT38 (insn16), N16_IMM8S (insn16));
+ goto done;
+ case 0xa: /* beqs38/j8, implied r5 */
+ if (N16_RT38 (insn16) == 5)
+ insn = N32_JI (J, N16_IMM8S (insn16));
+ else
+ insn = N32_BR1 (BEQ, N16_RT38 (insn16), REG_R5, N16_IMM8S (insn16));
+ goto done;
+ case 0xb: /* bnes38 and others */
+ if (N16_RT38 (insn16) == 5)
+ {
+ switch (__GF (insn16, 5, 3))
+ {
+ case 0: /* jr5 */
+ insn = N32_JREG (JR, 0, N16_RA5 (insn16), 0, 0);
+ break;
+ case 4: /* ret5 */
+ insn = N32_JREG (JR, 0, N16_RA5 (insn16), 0, 1);
+ break;
+ case 1: /* jral5 */
+ insn = N32_JREG (JRAL, REG_LP, N16_RA5 (insn16), 0, 0);
+ break;
+ case 2: /* ex9.it imm5 */
+ /* ex9.it had no 32-bit variantl. */
+ break;
+ case 5: /* add5.pc */
+ /* add5.pc had no 32-bit variantl. */
+ break;
+ }
+ }
+ else /* bnes38 */
+ insn = N32_BR1 (BNE, N16_RT38 (insn16), REG_R5, N16_IMM8S (insn16));
+ goto done;
+ case 0xe: /* lwi37/swi37 */
+ if (insn16 & (1 << 7)) /* swi37.sp */
+ insn = N32_TYPE2 (SWI, N16_RT38 (insn16), REG_SP, N16_IMM7U (insn16));
+ else /* lwi37.sp */
+ insn = N32_TYPE2 (LWI, N16_RT38 (insn16), REG_SP, N16_IMM7U (insn16));
+ goto done;
+ }
+
+done:
+ if (insn & 0x80000000)
+ return 0;
+
+ if (pinsn)
+ *pinsn = insn;
+ return 1;
+}
+
+static bfd_boolean
+is_sda_access_insn (unsigned long insn)
+{
+ switch (N32_OP6 (insn))
+ {
+ case N32_OP6_LWI:
+ case N32_OP6_LHI:
+ case N32_OP6_LHSI:
+ case N32_OP6_LBI:
+ case N32_OP6_LBSI:
+ case N32_OP6_SWI:
+ case N32_OP6_SHI:
+ case N32_OP6_SBI:
+ case N32_OP6_LWC:
+ case N32_OP6_LDC:
+ case N32_OP6_SWC:
+ case N32_OP6_SDC:
+ return TRUE;
+ default:
+ ;
+ }
+ return FALSE;
+}
+
+static unsigned long
+turn_insn_to_sda_access (uint32_t insn, bfd_signed_vma type, uint32_t *pinsn)
+{
+ uint32_t oinsn = 0;
+
+ switch (type)
+ {
+ case R_NDS32_GOT_LO12:
+ case R_NDS32_GOTOFF_LO12:
+ case R_NDS32_PLTREL_LO12:
+ case R_NDS32_PLT_GOTREL_LO12:
+ case R_NDS32_LO12S0_RELA:
+ switch (N32_OP6 (insn))
+ {
+ case N32_OP6_LBI:
+ /* lbi.gp */
+ oinsn = N32_TYPE1 (LBGP, N32_RT5 (insn), 0);
+ break;
+ case N32_OP6_LBSI:
+ /* lbsi.gp */
+ oinsn = N32_TYPE1 (LBGP, N32_RT5 (insn), __BIT (19));
+ break;
+ case N32_OP6_SBI:
+ /* sbi.gp */
+ oinsn = N32_TYPE1 (SBGP, N32_RT5 (insn), 0);
+ break;
+ case N32_OP6_ORI:
+ /* addi.gp */
+ oinsn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19));
+ break;
+ }
+ break;
+
+ case R_NDS32_LO12S1_RELA:
+ switch (N32_OP6 (insn))
+ {
+ case N32_OP6_LHI:
+ /* lhi.gp */
+ oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), 0);
+ break;
+ case N32_OP6_LHSI:
+ /* lhsi.gp */
+ oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (18));
+ break;
+ case N32_OP6_SHI:
+ /* shi.gp */
+ oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (19));
+ break;
+ }
+ break;
+
+ case R_NDS32_LO12S2_RELA:
+ switch (N32_OP6 (insn))
+ {
+ case N32_OP6_LWI:
+ /* lwi.gp */
+ oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (6, 17, 3));
+ break;
+ case N32_OP6_SWI:
+ /* swi.gp */
+ oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (7, 17, 3));
+ break;
+ }
+ break;
+
+ case R_NDS32_LO12S2_DP_RELA:
+ case R_NDS32_LO12S2_SP_RELA:
+ oinsn = (insn & 0x7ff07000) | (REG_GP << 15);
+ break;
+ }
+
+ if (oinsn)
+ *pinsn = oinsn;
+
+ return oinsn != 0;
+}
+
+/* Linker hasn't found the correct merge section for non-section symbol
+ in relax time, this work is left to the function elf_link_input_bfd().
+ So for non-section symbol, _bfd_merged_section_offset is also needed
+ to find the correct symbol address. */
+
+static bfd_vma
+nds32_elf_rela_local_sym (bfd *abfd, Elf_Internal_Sym *sym,
+ asection **psec, Elf_Internal_Rela *rel)
+{
+ asection *sec = *psec;
+ bfd_vma relocation;
+
+ relocation = (sec->output_section->vma
+ + sec->output_offset + sym->st_value);
+ if ((sec->flags & SEC_MERGE) && sec->sec_info_type == SEC_INFO_TYPE_MERGE)
+ {
+ if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ rel->r_addend =
+ _bfd_merged_section_offset (abfd, psec,
+ elf_section_data (sec)->sec_info,
+ sym->st_value + rel->r_addend);
+ else
+ rel->r_addend =
+ _bfd_merged_section_offset (abfd, psec,
+ elf_section_data (sec)->sec_info,
+ sym->st_value) + rel->r_addend;
+
+ if (sec != *psec)
+ {
+ /* If we have changed the section, and our original section is
+ marked with SEC_EXCLUDE, it means that the original
+ SEC_MERGE section has been completely subsumed in some
+ other SEC_MERGE section. In this case, we need to leave
+ some info around for --emit-relocs. */
+ if ((sec->flags & SEC_EXCLUDE) != 0)
+ sec->kept_section = *psec;
+ sec = *psec;
+ }
+ rel->r_addend -= relocation;
+ rel->r_addend += sec->output_section->vma + sec->output_offset;
+ }
+ return relocation;
+}
+
+static bfd_vma
+calculate_memory_address (bfd *abfd, Elf_Internal_Rela *irel,
+ Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ bfd_signed_vma foff;
+ bfd_vma symval, addend;
+ Elf_Internal_Rela irel_fn;
+ Elf_Internal_Sym *isym;
+ asection *sym_sec;
+
+ /* Get the value of the symbol referred to by the reloc. */
+ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
+ {
+ /* A local symbol. */
+ isym = isymbuf + ELF32_R_SYM (irel->r_info);
+
+ if (isym->st_shndx == SHN_UNDEF)
+ sym_sec = bfd_und_section_ptr;
+ else if (isym->st_shndx == SHN_ABS)
+ sym_sec = bfd_abs_section_ptr;
+ else if (isym->st_shndx == SHN_COMMON)
+ sym_sec = bfd_com_section_ptr;
+ else
+ sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ memcpy (&irel_fn, irel, sizeof (Elf_Internal_Rela));
+ symval = nds32_elf_rela_local_sym (abfd, isym, &sym_sec, &irel_fn);
+ addend = irel_fn.r_addend;
+ }
+ else
+ {
+ unsigned long indx;
+ struct elf_link_hash_entry *h;
+
+ /* An external symbol. */
+ indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
+ h = elf_sym_hashes (abfd)[indx];
+ BFD_ASSERT (h != NULL);
+
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ if (h->root.type != bfd_link_hash_defined
+ && h->root.type != bfd_link_hash_defweak)
+ /* This appears to be a reference to an undefined
+ symbol. Just ignore it--it will be caught by the
+ regular reloc processing. */
+ return 0;
+
+ if (h->root.u.def.section->flags & SEC_MERGE)
+ {
+ sym_sec = h->root.u.def.section;
+ symval = _bfd_merged_section_offset (abfd, &sym_sec, elf_section_data
+ (sym_sec)->sec_info, h->root.u.def.value);
+ symval = symval + sym_sec->output_section->vma
+ + sym_sec->output_offset;
+ }
+ else
+ symval = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ addend = irel->r_addend;
+ }
+
+ foff = symval + addend;
+
+ return foff;
+}
+
+static bfd_vma
+calculate_got_memory_address (bfd *abfd, struct bfd_link_info *link_info,
+ Elf_Internal_Rela *irel,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ int symndx;
+ bfd_vma *local_got_offsets;
+ /* Get the value of the symbol referred to by the reloc. */
+ struct elf_link_hash_entry *h;
+ struct elf_nds32_link_hash_table *htab = nds32_elf_hash_table (link_info);
+
+ /* An external symbol. */
+ symndx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
+ h = elf_sym_hashes (abfd)[symndx];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ if (symndx >= 0)
+ {
+ BFD_ASSERT (h != NULL);
+ return htab->sgot->output_section->vma + htab->sgot->output_offset
+ + h->got.offset;
+ }
+ else
+ {
+ local_got_offsets = elf_local_got_offsets (abfd);
+ BFD_ASSERT (local_got_offsets != NULL);
+ return htab->sgot->output_section->vma + htab->sgot->output_offset
+ + local_got_offsets[ELF32_R_SYM (irel->r_info)];
+ }
+
+ /* The _GLOBAL_OFFSET_TABLE_ may be undefweak(or should be?). */
+ /* The check of h->root.type is passed. */
+}
+
+static int
+is_16bit_NOP (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *sec, Elf_Internal_Rela *rel)
+{
+ bfd_byte *contents;
+ unsigned short insn16;
+
+ if (!(rel->r_addend & R_NDS32_INSN16_CONVERT_FLAG))
+ return FALSE;
+ contents = elf_section_data (sec)->this_hdr.contents;
+ insn16 = bfd_getb16 (contents + rel->r_offset);
+ if (insn16 == NDS32_NOP16)
+ return TRUE;
+ return FALSE;
+}
+
+/* It checks whether the instruction could be converted to
+ 16-bit form and returns the converted one.
+
+ `internal_relocs' is supposed to be sorted. */
+
+static int
+is_convert_32_to_16 (bfd *abfd, asection *sec,
+ Elf_Internal_Rela *reloc,
+ Elf_Internal_Rela *internal_relocs,
+ Elf_Internal_Rela *irelend,
+ uint16_t *insn16)
+{
+#define NORMAL_32_TO_16 (1 << 0)
+#define SPECIAL_32_TO_16 (1 << 1)
+ bfd_byte *contents = NULL;
+ bfd_signed_vma off;
+ bfd_vma mem_addr;
+ uint32_t insn = 0;
+ Elf_Internal_Rela *pc_rel;
+ int pic_ext_target = 0;
+ Elf_Internal_Shdr *symtab_hdr;
+ Elf_Internal_Sym *isymbuf = NULL;
+ int convert_type;
+ bfd_vma offset;
+
+ if (reloc->r_offset + 4 > sec->size)
+ return FALSE;
+
+ offset = reloc->r_offset;
+
+ if (!nds32_get_section_contents (abfd, sec, &contents))
+ return FALSE;
+ insn = bfd_getb32 (contents + offset);
+
+ if (nds32_convert_32_to_16 (abfd, insn, insn16, NULL))
+ convert_type = NORMAL_32_TO_16;
+ else if (special_convert_32_to_16 (insn, insn16, reloc))
+ convert_type = SPECIAL_32_TO_16;
+ else
+ return FALSE;
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ if (!nds32_get_local_syms (abfd, sec, &isymbuf))
+ return FALSE;
+
+ /* Find the first relocation of the same relocation-type,
+ so we iteratie them forward. */
+ pc_rel = reloc;
+ while ((pc_rel - 1) >= internal_relocs && pc_rel[-1].r_offset == offset)
+ pc_rel--;
+
+ for (; pc_rel < irelend && pc_rel->r_offset == offset; pc_rel++)
+ {
+ if (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_15_PCREL_RELA
+ || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_17_PCREL_RELA
+ || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_25_PCREL_RELA
+ || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_25_PLTREL)
+ {
+ off = calculate_offset (abfd, sec, pc_rel, isymbuf, symtab_hdr,
+ &pic_ext_target);
+ if (off >= ACCURATE_8BIT_S1 || off < -ACCURATE_8BIT_S1
+ || off == 0)
+ return FALSE;
+ break;
+ }
+ else if (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_20_RELA)
+ {
+ /* movi => movi55 */
+ mem_addr = calculate_memory_address (abfd, pc_rel, isymbuf,
+ symtab_hdr);
+ /* mem_addr is unsigned, but the value should
+ be between [-16, 15]. */
+ if ((mem_addr + 0x10) >> 5)
+ return FALSE;
+ break;
+ }
+ else if ((ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_TLS_LE_20)
+ || (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_TLS_LE_LO12))
+ {
+ /* It never happen movi to movi55 for R_NDS32_TLS_LE_20,
+ because it can be relaxed to addi for TLS_LE_ADD. */
+ return FALSE;
+ }
+ else if ((ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_SDA15S2_RELA
+ || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_SDA17S2_RELA)
+ && (reloc->r_addend & R_NDS32_INSN16_FP7U2_FLAG)
+ && convert_type == SPECIAL_32_TO_16)
+ {
+ /* fp-as-gp
+ We've selected a best fp-base for this access, so we can
+ always resolve it anyway. Do nothing. */
+ break;
+ }
+ else if ((ELF32_R_TYPE (pc_rel->r_info) > R_NDS32_NONE
+ && (ELF32_R_TYPE (pc_rel->r_info) < R_NDS32_RELA_GNU_VTINHERIT))
+ || ((ELF32_R_TYPE (pc_rel->r_info) > R_NDS32_RELA_GNU_VTENTRY)
+ && (ELF32_R_TYPE (pc_rel->r_info) < R_NDS32_INSN16))
+ || ((ELF32_R_TYPE (pc_rel->r_info) > R_NDS32_LOADSTORE)
+ && (ELF32_R_TYPE (pc_rel->r_info) < R_NDS32_DWARF2_OP1_RELA)))
+ {
+ /* Prevent unresolved addi instruction translate
+ to addi45 or addi333. */
+ return FALSE;
+ }
+ else if ((ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_17IFC_PCREL_RELA))
+ {
+ off = calculate_offset (abfd, sec, pc_rel, isymbuf, symtab_hdr,
+ &pic_ext_target);
+ if (off >= ACCURATE_U9BIT_S1 || off <= 0)
+ return FALSE;
+ break;
+ }
+ }
+
+ return TRUE;
+}
+
+static void
+nds32_elf_write_16 (bfd *abfd ATTRIBUTE_UNUSED, bfd_byte *contents,
+ Elf_Internal_Rela *reloc,
+ Elf_Internal_Rela *internal_relocs,
+ Elf_Internal_Rela *irelend,
+ unsigned short insn16)
+{
+ Elf_Internal_Rela *pc_rel;
+ bfd_vma offset;
+
+ offset = reloc->r_offset;
+ bfd_putb16 (insn16, contents + offset);
+ /* Find the first relocation of the same relocation-type,
+ so we iteratie them forward. */
+ pc_rel = reloc;
+ while ((pc_rel - 1) > internal_relocs && pc_rel[-1].r_offset == offset)
+ pc_rel--;
+
+ for (; pc_rel < irelend && pc_rel->r_offset == offset; pc_rel++)
+ {
+ if (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_15_PCREL_RELA
+ || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_17_PCREL_RELA
+ || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_25_PCREL_RELA)
+ {
+ pc_rel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (pc_rel->r_info), R_NDS32_9_PCREL_RELA);
+ }
+ else if (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_25_PLTREL)
+ pc_rel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (pc_rel->r_info), R_NDS32_9_PLTREL);
+ else if (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_20_RELA)
+ pc_rel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (pc_rel->r_info), R_NDS32_5_RELA);
+ else if (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_SDA15S2_RELA
+ || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_SDA17S2_RELA)
+ pc_rel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (pc_rel->r_info), R_NDS32_SDA_FP7U2_RELA);
+ else if ((ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_17IFC_PCREL_RELA))
+ pc_rel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (pc_rel->r_info), R_NDS32_10IFCU_PCREL_RELA);
+ }
+}
+
+/* Find a relocation of type specified by `reloc_type'
+ of the same r_offset with reloc.
+ If not found, return irelend.
+
+ Assuming relocations are sorted by r_offset,
+ we find the relocation from `reloc' backward untill relocs,
+ or find it from `reloc' forward untill irelend. */
+
+static Elf_Internal_Rela *
+find_relocs_at_address (Elf_Internal_Rela *reloc,
+ Elf_Internal_Rela *relocs,
+ Elf_Internal_Rela *irelend,
+ enum elf_nds32_reloc_type reloc_type)
+{
+ Elf_Internal_Rela *rel_t;
+
+ /* Find backward. */
+ for (rel_t = reloc;
+ rel_t >= relocs && rel_t->r_offset == reloc->r_offset;
+ rel_t--)
+ if (ELF32_R_TYPE (rel_t->r_info) == reloc_type)
+ return rel_t;
+
+ /* We didn't find it backward. Try find it forward. */
+ for (rel_t = reloc;
+ rel_t < irelend && rel_t->r_offset == reloc->r_offset;
+ rel_t++)
+ if (ELF32_R_TYPE (rel_t->r_info) == reloc_type)
+ return rel_t;
+
+ return irelend;
+}
+
+/* Find a relocation of specified type and offset.
+ `reloc' is just a refence point to find a relocation at specified offset.
+ If not found, return irelend.
+
+ Assuming relocations are sorted by r_offset,
+ we find the relocation from `reloc' backward untill relocs,
+ or find it from `reloc' forward untill irelend. */
+
+static Elf_Internal_Rela *
+find_relocs_at_address_addr (Elf_Internal_Rela *reloc,
+ Elf_Internal_Rela *relocs,
+ Elf_Internal_Rela *irelend,
+ unsigned char reloc_type,
+ bfd_vma offset_p)
+{
+ Elf_Internal_Rela *rel_t = NULL;
+
+ /* First, we try to find a relocation of offset `offset_p',
+ and then we use find_relocs_at_address to find specific type. */
+
+ if (reloc->r_offset > offset_p)
+ {
+ /* Find backward. */
+ for (rel_t = reloc;
+ rel_t >= relocs && rel_t->r_offset > offset_p; rel_t--)
+ /* Do nothing. */;
+ }
+ else if (reloc->r_offset < offset_p)
+ {
+ /* Find forward. */
+ for (rel_t = reloc;
+ rel_t < irelend && rel_t->r_offset < offset_p; rel_t++)
+ /* Do nothing. */;
+ }
+ else
+ rel_t = reloc;
+
+ /* Not found? */
+ if (rel_t < relocs || rel_t == irelend || rel_t->r_offset != offset_p)
+ return irelend;
+
+ return find_relocs_at_address (rel_t, relocs, irelend, reloc_type);
+}
+
+static bfd_boolean
+nds32_elf_check_dup_relocs (Elf_Internal_Rela *reloc,
+ Elf_Internal_Rela *internal_relocs,
+ Elf_Internal_Rela *irelend,
+ unsigned char reloc_type)
+{
+ Elf_Internal_Rela *rel_t;
+
+ for (rel_t = reloc;
+ rel_t >= internal_relocs && rel_t->r_offset == reloc->r_offset;
+ rel_t--)
+ if (ELF32_R_TYPE (rel_t->r_info) == reloc_type)
+ {
+ if (ELF32_R_SYM (rel_t->r_info) == ELF32_R_SYM (reloc->r_info)
+ && rel_t->r_addend == reloc->r_addend)
+ continue;
+ return TRUE;
+ }
+
+ for (rel_t = reloc; rel_t < irelend && rel_t->r_offset == reloc->r_offset;
+ rel_t++)
+ if (ELF32_R_TYPE (rel_t->r_info) == reloc_type)
+ {
+ if (ELF32_R_SYM (rel_t->r_info) == ELF32_R_SYM (reloc->r_info)
+ && rel_t->r_addend == reloc->r_addend)
+ continue;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+typedef struct nds32_elf_blank nds32_elf_blank_t;
+struct nds32_elf_blank
+{
+ /* Where the blank begins. */
+ bfd_vma offset;
+ /* The size of the blank. */
+ bfd_vma size;
+ /* The accumulative size before this blank. */
+ bfd_vma total_size;
+ nds32_elf_blank_t *next;
+ nds32_elf_blank_t *prev;
+};
+
+static nds32_elf_blank_t *blank_free_list = NULL;
+
+static nds32_elf_blank_t *
+create_nds32_elf_blank (bfd_vma offset_p, bfd_vma size_p)
+{
+ nds32_elf_blank_t *blank_t;
+
+ if (blank_free_list)
+ {
+ blank_t = blank_free_list;
+ blank_free_list = blank_free_list->next;
+ }
+ else
+ blank_t = bfd_malloc (sizeof (nds32_elf_blank_t));
+
+ if (blank_t == NULL)
+ return NULL;
+
+ blank_t->offset = offset_p;
+ blank_t->size = size_p;
+ blank_t->total_size = 0;
+ blank_t->next = NULL;
+ blank_t->prev = NULL;
+
+ return blank_t;
+}
+
+static void
+remove_nds32_elf_blank (nds32_elf_blank_t *blank_p)
+{
+ if (blank_free_list)
+ {
+ blank_free_list->prev = blank_p;
+ blank_p->next = blank_free_list;
+ }
+ else
+ blank_p->next = NULL;
+
+ blank_p->prev = NULL;
+ blank_free_list = blank_p;
+}
+
+static void
+clean_nds32_elf_blank (void)
+{
+ nds32_elf_blank_t *blank_t;
+
+ while (blank_free_list)
+ {
+ blank_t = blank_free_list;
+ blank_free_list = blank_free_list->next;
+ free (blank_t);
+ }
+}
+
+static nds32_elf_blank_t *
+search_nds32_elf_blank (nds32_elf_blank_t *blank_p, bfd_vma addr)
+{
+ nds32_elf_blank_t *blank_t;
+
+ if (!blank_p)
+ return NULL;
+ blank_t = blank_p;
+
+ while (blank_t && addr < blank_t->offset)
+ blank_t = blank_t->prev;
+ while (blank_t && blank_t->next && addr >= blank_t->next->offset)
+ blank_t = blank_t->next;
+
+ return blank_t;
+}
+
+static bfd_vma
+get_nds32_elf_blank_total (nds32_elf_blank_t **blank_p, bfd_vma addr,
+ int overwrite)
+{
+ nds32_elf_blank_t *blank_t;
+
+ blank_t = search_nds32_elf_blank (*blank_p, addr);
+ if (!blank_t)
+ return 0;
+
+ if (overwrite)
+ *blank_p = blank_t;
+
+ if (addr < blank_t->offset + blank_t->size)
+ return blank_t->total_size + (addr - blank_t->offset);
+ else
+ return blank_t->total_size + blank_t->size;
+}
+
+static bfd_boolean
+insert_nds32_elf_blank (nds32_elf_blank_t **blank_p, bfd_vma addr, bfd_vma len)
+{
+ nds32_elf_blank_t *blank_t, *blank_t2;
+
+ if (!*blank_p)
+ {
+ *blank_p = create_nds32_elf_blank (addr, len);
+ return *blank_p ? TRUE : FALSE;
+ }
+
+ blank_t = search_nds32_elf_blank (*blank_p, addr);
+
+ if (blank_t == NULL)
+ {
+ blank_t = create_nds32_elf_blank (addr, len);
+ if (!blank_t)
+ return FALSE;
+ while ((*blank_p)->prev != NULL)
+ *blank_p = (*blank_p)->prev;
+ blank_t->next = *blank_p;
+ (*blank_p)->prev = blank_t;
+ (*blank_p) = blank_t;
+ return TRUE;
+ }
+
+ if (addr < blank_t->offset + blank_t->size)
+ {
+ if (addr > blank_t->offset + blank_t->size)
+ blank_t->size = addr - blank_t->offset;
+ }
+ else
+ {
+ blank_t2 = create_nds32_elf_blank (addr, len);
+ if (!blank_t2)
+ return FALSE;
+ if (blank_t->next)
+ {
+ blank_t->next->prev = blank_t2;
+ blank_t2->next = blank_t->next;
+ }
+ blank_t2->prev = blank_t;
+ blank_t->next = blank_t2;
+ *blank_p = blank_t2;
+ }
+
+ return TRUE;
+}
+
+static bfd_boolean
+insert_nds32_elf_blank_recalc_total (nds32_elf_blank_t **blank_p, bfd_vma addr,
+ bfd_vma len)
+{
+ nds32_elf_blank_t *blank_t;
+
+ if (!insert_nds32_elf_blank (blank_p, addr, len))
+ return FALSE;
+
+ blank_t = *blank_p;
+
+ if (!blank_t->prev)
+ {
+ blank_t->total_size = 0;
+ blank_t = blank_t->next;
+ }
+
+ while (blank_t)
+ {
+ blank_t->total_size = blank_t->prev->total_size + blank_t->prev->size;
+ blank_t = blank_t->next;
+ }
+
+ return TRUE;
+}
+
+static void
+calc_nds32_blank_total (nds32_elf_blank_t *blank_p)
+{
+ nds32_elf_blank_t *blank_t;
+ bfd_vma total_size = 0;
+
+ if (!blank_p)
+ return;
+
+ blank_t = blank_p;
+ while (blank_t->prev)
+ blank_t = blank_t->prev;
+ while (blank_t)
+ {
+ blank_t->total_size = total_size;
+ total_size += blank_t->size;
+ blank_t = blank_t->next;
+ }
+}
+
+static bfd_boolean
+nds32_elf_relax_delete_blanks (bfd *abfd, asection *sec,
+ nds32_elf_blank_t *blank_p)
+{
+ Elf_Internal_Shdr *symtab_hdr; /* Symbol table header of this bfd. */
+ Elf_Internal_Sym *isym = NULL; /* Symbol table of this bfd. */
+ Elf_Internal_Sym *isymend; /* Symbol entry iterator. */
+ unsigned int sec_shndx; /* The section the be relaxed. */
+ bfd_byte *contents; /* Contents data of iterating section. */
+ Elf_Internal_Rela *internal_relocs;
+ Elf_Internal_Rela *irel;
+ Elf_Internal_Rela *irelend;
+ struct elf_link_hash_entry **sym_hashes;
+ struct elf_link_hash_entry **end_hashes;
+ unsigned int symcount;
+ asection *sect;
+ nds32_elf_blank_t *blank_t;
+ nds32_elf_blank_t *blank_t2;
+ nds32_elf_blank_t *blank_head;
+
+ blank_head = blank_t = blank_p;
+ while (blank_head->prev != NULL)
+ blank_head = blank_head->prev;
+ while (blank_t->next != NULL)
+ blank_t = blank_t->next;
+
+ if (blank_t->offset + blank_t->size <= sec->size)
+ {
+ blank_t->next = create_nds32_elf_blank (sec->size + 4, 0);
+ blank_t->next->prev = blank_t;
+ }
+ if (blank_head->offset > 0)
+ {
+ blank_head->prev = create_nds32_elf_blank (0, 0);
+ blank_head->prev->next = blank_head;
+ blank_head = blank_head->prev;
+ }
+
+ sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
+
+ /* The deletion must stop at the next ALIGN reloc for an alignment
+ power larger than the number of bytes we are deleting. */
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ if (!nds32_get_local_syms (abfd, sec, &isym))
+ return FALSE;
+
+ if (isym == NULL)
+ {
+ isym = bfd_elf_get_elf_syms (abfd, symtab_hdr,
+ symtab_hdr->sh_info, 0, NULL, NULL, NULL);
+ symtab_hdr->contents = (bfd_byte *) isym;
+ }
+
+ if (isym == NULL || symtab_hdr->sh_info == 0)
+ return FALSE;
+
+ blank_t = blank_head;
+ calc_nds32_blank_total (blank_head);
+
+ for (sect = abfd->sections; sect != NULL; sect = sect->next)
+ {
+ /* Adjust all the relocs. */
+
+ /* Relocations MUST be kept in memory, because relaxation adjust them. */
+ internal_relocs = _bfd_elf_link_read_relocs (abfd, sect, NULL, NULL,
+ TRUE /* keep_memory */);
+ irelend = internal_relocs + sect->reloc_count;
+
+ blank_t = blank_head;
+ blank_t2 = blank_head;
+
+ if (!(sect->flags & SEC_RELOC))
+ continue;
+
+ nds32_get_section_contents (abfd, sect, &contents);
+
+ for (irel = internal_relocs; irel < irelend; irel++)
+ {
+ bfd_vma raddr;
+
+ if (ELF32_R_TYPE (irel->r_info) >= R_NDS32_DIFF8
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_DIFF32
+ && isym[ELF32_R_SYM (irel->r_info)].st_shndx == sec_shndx)
+ {
+ unsigned long val = 0;
+ unsigned long mask;
+ long before, between;
+ long offset;
+
+ switch (ELF32_R_TYPE (irel->r_info))
+ {
+ case R_NDS32_DIFF8:
+ offset = bfd_get_8 (abfd, contents + irel->r_offset);
+ break;
+ case R_NDS32_DIFF16:
+ offset = bfd_get_16 (abfd, contents + irel->r_offset);
+ break;
+ case R_NDS32_DIFF32:
+ val = bfd_get_32 (abfd, contents + irel->r_offset);
+ /* Get the signed bit and mask for the high part. The
+ gcc will alarm when right shift 32-bit since the
+ type size of long may be 32-bit. */
+ mask = 0 - (val >> 31);
+ if (mask)
+ offset = (val | (mask - 0xffffffff));
+ else
+ offset = val;
+ break;
+ default:
+ BFD_ASSERT (0);
+ }
+
+ /* DIFF value
+ 0 |encoded in location|
+ |------------|-------------------|---------
+ sym+off(addend)
+ -- before ---| *****************
+ --------------------- between ---|
+
+ We only care how much data are relax between DIFF,
+ marked as ***. */
+
+ before = get_nds32_elf_blank_total (&blank_t, irel->r_addend, 0);
+ between = get_nds32_elf_blank_total (&blank_t,
+ irel->r_addend + offset, 0);
+ if (between == before)
+ goto done_adjust_diff;
+
+ switch (ELF32_R_TYPE (irel->r_info))
+ {
+ case R_NDS32_DIFF8:
+ bfd_put_8 (abfd, offset - (between - before),
+ contents + irel->r_offset);
+ break;
+ case R_NDS32_DIFF16:
+ bfd_put_16 (abfd, offset - (between - before),
+ contents + irel->r_offset);
+ break;
+ case R_NDS32_DIFF32:
+ bfd_put_32 (abfd, offset - (between - before),
+ contents + irel->r_offset);
+ break;
+ }
+ }
+ else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_DIFF_ULEB128
+ && isym[ELF32_R_SYM (irel->r_info)].st_shndx == sec_shndx)
+ {
+ bfd_vma val = 0;
+ unsigned int len = 0;
+ unsigned long before, between;
+ bfd_byte *endp, *p;
+
+ val = read_unsigned_leb128 (abfd, contents + irel->r_offset,
+ &len);
+
+ before = get_nds32_elf_blank_total (&blank_t, irel->r_addend, 0);
+ between = get_nds32_elf_blank_total (&blank_t,
+ irel->r_addend + val, 0);
+ if (between == before)
+ goto done_adjust_diff;
+
+ p = contents + irel->r_offset;
+ endp = p + len -1;
+ memset (p, 0x80, len);
+ *(endp) = 0;
+ p = write_uleb128 (p, val - (between - before)) - 1;
+ if (p < endp)
+ *p |= 0x80;
+ }
+done_adjust_diff:
+
+ if (sec == sect)
+ {
+ raddr = irel->r_offset;
+ irel->r_offset -= get_nds32_elf_blank_total (&blank_t2,
+ irel->r_offset, 1);
+
+ if (ELF32_R_TYPE (irel->r_info) == R_NDS32_NONE)
+ continue;
+ if (blank_t2 && blank_t2->next
+ && (blank_t2->offset > raddr
+ || blank_t2->next->offset <= raddr))
+ (*_bfd_error_handler)
+ (_("%B: %s\n"), abfd,
+ "Error: search_nds32_elf_blank reports wrong node");
+
+ /* Mark reloc in deleted portion as NONE.
+ For some relocs like R_NDS32_LABEL that doesn't modify the
+ content in the section. R_NDS32_LABEL doesn't belong to the
+ instruction in the section, so we should preserve it. */
+ if (raddr >= blank_t2->offset
+ && raddr < blank_t2->offset + blank_t2->size
+ && ELF32_R_TYPE (irel->r_info) != R_NDS32_LABEL
+ && ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_REGION_BEGIN
+ && ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_REGION_END
+ && ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_ENTRY
+ && ELF32_R_TYPE (irel->r_info) != R_NDS32_SUBTRAHEND
+ && ELF32_R_TYPE (irel->r_info) != R_NDS32_MINUEND)
+ {
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_NDS32_NONE);
+ continue;
+ }
+ }
+
+ if (ELF32_R_TYPE (irel->r_info) == R_NDS32_NONE
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY)
+ continue;
+
+ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info
+ && isym[ELF32_R_SYM (irel->r_info)].st_shndx == sec_shndx
+ && ELF_ST_TYPE (isym[ELF32_R_SYM (irel->r_info)].st_info) == STT_SECTION)
+ {
+ if (irel->r_addend <= sec->size)
+ irel->r_addend -=
+ get_nds32_elf_blank_total (&blank_t, irel->r_addend, 1);
+ }
+ }
+ }
+
+ /* Adjust the local symbols defined in this section. */
+ blank_t = blank_head;
+ for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
+ {
+ if (isym->st_shndx == sec_shndx)
+ {
+ if (isym->st_value <= sec->size)
+ {
+ bfd_vma ahead;
+ bfd_vma orig_addr = isym->st_value;
+
+ ahead = get_nds32_elf_blank_total (&blank_t, isym->st_value, 1);
+ isym->st_value -= ahead;
+
+ /* Adjust function size. */
+ if (ELF32_ST_TYPE (isym->st_info) == STT_FUNC
+ && isym->st_size > 0)
+ isym->st_size -=
+ get_nds32_elf_blank_total
+ (&blank_t, orig_addr + isym->st_size, 0) - ahead;
+ }
+ }
+ }
+
+ /* Now adjust the global symbols defined in this section. */
+ symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym)
+ - symtab_hdr->sh_info);
+ sym_hashes = elf_sym_hashes (abfd);
+ end_hashes = sym_hashes + symcount;
+ blank_t = blank_head;
+ for (; sym_hashes < end_hashes; sym_hashes++)
+ {
+ struct elf_link_hash_entry *sym_hash = *sym_hashes;
+
+ if ((sym_hash->root.type == bfd_link_hash_defined
+ || sym_hash->root.type == bfd_link_hash_defweak)
+ && sym_hash->root.u.def.section == sec)
+ {
+ if (sym_hash->root.u.def.value <= sec->size)
+ {
+ bfd_vma ahead;
+ bfd_vma orig_addr = sym_hash->root.u.def.value;
+
+ ahead = get_nds32_elf_blank_total (&blank_t, sym_hash->root.u.def.value, 1);
+ sym_hash->root.u.def.value -= ahead;
+
+ /* Adjust function size. */
+ if (sym_hash->type == STT_FUNC)
+ sym_hash->size -=
+ get_nds32_elf_blank_total
+ (&blank_t, orig_addr + sym_hash->size, 0) - ahead;
+
+ }
+ }
+ }
+
+ contents = elf_section_data (sec)->this_hdr.contents;
+ blank_t = blank_head;
+ while (blank_t->next)
+ {
+ /* Actually delete the bytes. */
+
+ /* If current blank is the last blank overlap with current section,
+ go to finish process. */
+ if (sec->size <= (blank_t->next->offset))
+ break;
+
+ memmove (contents + blank_t->offset - blank_t->total_size,
+ contents + blank_t->offset + blank_t->size,
+ blank_t->next->offset - (blank_t->offset + blank_t->size));
+
+ blank_t = blank_t->next;
+ }
+
+ if (sec->size > (blank_t->offset + blank_t->size))
+ {
+ /* There are remaining code between blank and section boundary.
+ Move the remaining code to appropriate location. */
+ memmove (contents + blank_t->offset - blank_t->total_size,
+ contents + blank_t->offset + blank_t->size,
+ sec->size - (blank_t->offset + blank_t->size));
+ sec->size -= blank_t->total_size + blank_t->size;
+ }
+ else
+ /* This blank is not entirely included in the section,
+ reduce the section size by only part of the blank size. */
+ sec->size -= blank_t->total_size + (sec->size - blank_t->offset);
+
+ while (blank_head)
+ {
+ blank_t = blank_head;
+ blank_head = blank_head->next;
+ remove_nds32_elf_blank (blank_t);
+ }
+
+ return TRUE;
+}
+
+/* Get the contents of a section. */
+
+static int
+nds32_get_section_contents (bfd *abfd, asection *sec, bfd_byte **contents_p)
+{
+ /* Get the section contents. */
+ if (elf_section_data (sec)->this_hdr.contents != NULL)
+ *contents_p = elf_section_data (sec)->this_hdr.contents;
+ else
+ {
+ if (!bfd_malloc_and_get_section (abfd, sec, contents_p))
+ return FALSE;
+ elf_section_data (sec)->this_hdr.contents = *contents_p;
+ }
+
+ return TRUE;
+}
+
+/* Get the contents of the internal symbol of abfd. */
+
+static int
+nds32_get_local_syms (bfd *abfd, asection *sec ATTRIBUTE_UNUSED,
+ Elf_Internal_Sym **isymbuf_p)
+{
+ Elf_Internal_Shdr *symtab_hdr;
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+
+ /* Read this BFD's local symbols if we haven't done so already. */
+ if (*isymbuf_p == NULL && symtab_hdr->sh_info != 0)
+ {
+ *isymbuf_p = (Elf_Internal_Sym *) symtab_hdr->contents;
+ if (*isymbuf_p == NULL)
+ {
+ *isymbuf_p = bfd_elf_get_elf_syms (abfd, symtab_hdr,
+ symtab_hdr->sh_info, 0,
+ NULL, NULL, NULL);
+ if (*isymbuf_p == NULL)
+ return FALSE;
+ }
+ }
+ symtab_hdr->contents = (bfd_byte *) (*isymbuf_p);
+
+ return TRUE;
+}
+
+/* Range of small data. */
+static bfd_vma sdata_range[2][2];
+static bfd_vma const sdata_init_range[2] =
+{ ACCURATE_12BIT_S1, ACCURATE_19BIT };
+
+static int
+nds32_elf_insn_size (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_byte *contents, bfd_vma addr)
+{
+ unsigned long insn = bfd_getb32 (contents + addr);
+
+ if (insn & 0x80000000)
+ return 2;
+
+ return 4;
+}
+
+/* Set the gp relax range. We have to measure the safe range
+ to do gp relaxation. */
+
+static void
+relax_range_measurement (bfd *abfd)
+{
+ asection *sec_f, *sec_b;
+ /* For upper bound. */
+ bfd_vma maxpgsz = get_elf_backend_data (abfd)->maxpagesize;
+ bfd_vma align;
+ static int decide_relax_range = 0;
+ int i;
+ int range_number = sizeof (sdata_init_range) / sizeof (sdata_init_range[0]);
+
+ if (decide_relax_range)
+ return;
+ decide_relax_range = 1;
+
+ if (sda_rela_sec == NULL)
+ {
+ /* Since there is no data sections, we assume the range is page size. */
+ for (i = 0; i < range_number; i++)
+ {
+ sdata_range[i][0] = sdata_init_range[i] - 0x1000;
+ sdata_range[i][1] = sdata_init_range[i] - 0x1000;
+ }
+ return;
+ }
+
+ /* Get the biggest alignment power after the gp located section. */
+ sec_f = sda_rela_sec->output_section;
+ sec_b = sec_f->next;
+ align = 0;
+ while (sec_b != NULL)
+ {
+ if ((unsigned)(1 << sec_b->alignment_power) > align)
+ align = (1 << sec_b->alignment_power);
+ sec_b = sec_b->next;
+ }
+
+ /* I guess we can not determine the section before
+ gp located section, so we assume the align is max page size. */
+ for (i = 0; i < range_number; i++)
+ {
+ sdata_range[i][1] = sdata_init_range[i] - align;
+ BFD_ASSERT (sdata_range[i][1] <= sdata_init_range[i]);
+ sdata_range[i][0] = sdata_init_range[i] - maxpgsz;
+ BFD_ASSERT (sdata_range[i][0] <= sdata_init_range[i]);
+ }
+}
+
+/* These are macros used to check flags encoded in r_addend.
+ They are only used by nds32_elf_relax_section (). */
+#define GET_SEQ_LEN(addend) ((addend) & 0x000000ff)
+#define IS_1ST_CONVERT(addend) ((addend) & 0x80000000)
+#define IS_OPTIMIZE(addend) ((addend) & 0x40000000)
+#define IS_16BIT_ON(addend) ((addend) & 0x20000000)
+
+/* Relax LONGCALL1 relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_longcall1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ /* There are 3 variations for LONGCALL1
+ case 4-4-2; 16-bit on, optimize off or optimize for space
+ sethi ta, hi20(symbol) ; LONGCALL1/HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jral5 ta ;
+
+ case 4-4-4; 16-bit off, optimize don't care
+ sethi ta, hi20(symbol) ; LONGCALL1/HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jral ta ;
+
+ case 4-4-4; 16-bit on, optimize for speed
+ sethi ta, hi20(symbol) ; LONGCALL1/HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jral ta ;
+ Check code for -mlong-calls output. */
+
+ /* Get the reloc for the address from which the register is
+ being loaded. This reloc will tell us which function is
+ actually being called. */
+
+ bfd_vma laddr;
+ int seq_len; /* Original length of instruction sequence. */
+ uint32_t insn;
+ Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *irelend;
+ int pic_ext_target = 0;
+ bfd_signed_vma foff;
+ uint16_t insn16;
+
+ irelend = internal_relocs + sec->reloc_count;
+ seq_len = GET_SEQ_LEN (irel->r_addend);
+ laddr = irel->r_offset;
+ *insn_len = seq_len;
+
+ hi_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_HI20_RELA, laddr);
+ lo_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_LO12S0_ORI_RELA,
+ laddr + 4);
+
+ if (hi_irelfn == irelend || lo_irelfn == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGCALL1 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ /* Get the value of the symbol referred to by the reloc. */
+ foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr,
+ &pic_ext_target);
+
+ /* This condition only happened when symbol is undefined. */
+ if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1
+ || foff >= CONSERVATIVE_24BIT_S1)
+ return FALSE;
+
+ /* Relax to: jal symbol; 25_PCREL */
+ /* For simplicity of coding, we are going to modify the section
+ contents, the section relocs, and the BFD symbol table. We
+ must tell the rest of the code not to free up this
+ information. It would be possible to instead create a table
+ of changes which have to be made, as is done in coff-mips.c;
+ that would be more work, but would require less memory when
+ the linker is run. */
+
+ /* Replace the long call with a jal. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info),
+ R_NDS32_25_PCREL_RELA);
+ irel->r_addend = hi_irelfn->r_addend;
+
+ /* We don't resolve this here but resolve it in relocate_section. */
+ insn = INSN_JAL;
+ bfd_putb32 (insn, contents + irel->r_offset);
+
+ hi_irelfn->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE);
+ lo_irelfn->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE);
+ *insn_len = 4;
+
+ if (seq_len & 0x2)
+ {
+ insn16 = NDS32_NOP16;
+ bfd_putb16 (insn16, contents + irel->r_offset + *insn_len);
+ lo_irelfn->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_INSN16);
+ lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG;
+ *insn_len += 2;
+ }
+ return TRUE;
+}
+
+#define CONVERT_CONDITION_CALL(insn) (((insn) & 0xffff0000) ^ 0x90000)
+/* Relax LONGCALL2 relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_longcall2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ /* bltz rt, .L1 ; LONGCALL2
+ jal symbol ; 25_PCREL
+ .L1: */
+
+ /* Get the reloc for the address from which the register is
+ being loaded. This reloc will tell us which function is
+ actually being called. */
+
+ bfd_vma laddr;
+ uint32_t insn;
+ Elf_Internal_Rela *i1_irelfn, *cond_irelfn, *irelend;
+ int pic_ext_target = 0;
+ bfd_signed_vma foff;
+
+ irelend = internal_relocs + sec->reloc_count;
+ laddr = irel->r_offset;
+ i1_irelfn =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_25_PCREL_RELA, laddr + 4);
+
+ if (i1_irelfn == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGCALL2 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ insn = bfd_getb32 (contents + laddr);
+
+ /* Get the value of the symbol referred to by the reloc. */
+ foff = calculate_offset (abfd, sec, i1_irelfn, isymbuf, symtab_hdr,
+ &pic_ext_target);
+
+ if (foff == 0 || foff < -CONSERVATIVE_16BIT_S1
+ || foff >= CONSERVATIVE_16BIT_S1)
+ return FALSE;
+
+ /* Relax to bgezal rt, label ; 17_PCREL
+ or bltzal rt, label ; 17_PCREL */
+
+ /* Convert to complimentary conditional call. */
+ insn = CONVERT_CONDITION_CALL (insn);
+
+ /* For simplicity of coding, we are going to modify the section
+ contents, the section relocs, and the BFD symbol table. We
+ must tell the rest of the code not to free up this
+ information. It would be possible to instead create a table
+ of changes which have to be made, as is done in coff-mips.c;
+ that would be more work, but would require less memory when
+ the linker is run. */
+
+ /* Clean unnessary relocations. */
+ i1_irelfn->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), R_NDS32_NONE);
+ cond_irelfn =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_17_PCREL_RELA, laddr);
+ if (cond_irelfn != irelend)
+ cond_irelfn->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (cond_irelfn->r_info), R_NDS32_NONE);
+
+ /* Replace the long call with a bgezal. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info),
+ R_NDS32_17_PCREL_RELA);
+ irel->r_addend = i1_irelfn->r_addend;
+
+ bfd_putb32 (insn, contents + irel->r_offset);
+
+ *insn_len = 4;
+ return TRUE;
+}
+
+/* Relax LONGCALL3 relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_longcall3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ /* There are 3 variations for LONGCALL3
+ case 4-4-4-2; 16-bit on, optimize off or optimize for space
+ bltz rt, $1 ; LONGCALL3
+ sethi ta, hi20(symbol) ; HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jral5 ta ;
+ $1
+
+ case 4-4-4-4; 16-bit off, optimize don't care
+ bltz rt, $1 ; LONGCALL3
+ sethi ta, hi20(symbol) ; HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jral ta ;
+ $1
+
+ case 4-4-4-4; 16-bit on, optimize for speed
+ bltz rt, $1 ; LONGCALL3
+ sethi ta, hi20(symbol) ; HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jral ta ;
+ $1 */
+
+ /* Get the reloc for the address from which the register is
+ being loaded. This reloc will tell us which function is
+ actually being called. */
+
+ bfd_vma laddr;
+ int seq_len; /* Original length of instruction sequence. */
+ uint32_t insn;
+ Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *cond_irelfn, *irelend;
+ int pic_ext_target = 0;
+ bfd_signed_vma foff;
+ uint16_t insn16;
+
+ irelend = internal_relocs + sec->reloc_count;
+ seq_len = GET_SEQ_LEN (irel->r_addend);
+ laddr = irel->r_offset;
+ *insn_len = seq_len;
+
+ hi_irelfn =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_HI20_RELA, laddr + 4);
+ lo_irelfn =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_LO12S0_ORI_RELA, laddr + 8);
+
+ if (hi_irelfn == irelend || lo_irelfn == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGCALL3 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ /* Get the value of the symbol referred to by the reloc. */
+ foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr,
+ &pic_ext_target);
+
+ if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1
+ || foff >= CONSERVATIVE_24BIT_S1)
+ return FALSE;
+
+ insn = bfd_getb32 (contents + laddr);
+ if (foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1)
+ {
+ /* Relax to bgezal rt, label ; 17_PCREL
+ or bltzal rt, label ; 17_PCREL */
+
+ /* Convert to complimentary conditional call. */
+ insn = CONVERT_CONDITION_CALL (insn);
+ bfd_putb32 (insn, contents + irel->r_offset);
+
+ *insn_len = 4;
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE);
+ hi_irelfn->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE);
+ lo_irelfn->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE);
+
+ cond_irelfn =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_17_PCREL_RELA, laddr);
+ if (cond_irelfn != irelend)
+ {
+ cond_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info),
+ R_NDS32_17_PCREL_RELA);
+ cond_irelfn->r_addend = hi_irelfn->r_addend;
+ }
+
+ if (seq_len & 0x2)
+ {
+ insn16 = NDS32_NOP16;
+ bfd_putb16 (insn16, contents + irel->r_offset + *insn_len);
+ hi_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info),
+ R_NDS32_INSN16);
+ hi_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG;
+ insn_len += 2;
+ }
+ }
+ else if (foff >= -CONSERVATIVE_24BIT_S1 && foff < CONSERVATIVE_24BIT_S1)
+ {
+ /* Relax to the following instruction sequence
+ bltz rt, $1 ; LONGCALL2
+ jal symbol ; 25_PCREL
+ $1 */
+ *insn_len = 8;
+ insn = INSN_JAL;
+ bfd_putb32 (insn, contents + hi_irelfn->r_offset);
+
+ hi_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info),
+ R_NDS32_25_PCREL_RELA);
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_LONGCALL2);
+
+ lo_irelfn->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE);
+
+ if (seq_len & 0x2)
+ {
+ insn16 = NDS32_NOP16;
+ bfd_putb16 (insn16, contents + irel->r_offset + *insn_len);
+ lo_irelfn->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_INSN16);
+ lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG;
+ insn_len += 2;
+ }
+ }
+ return TRUE;
+}
+
+/* Relax LONGJUMP1 relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_longjump1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ /* There are 3 variations for LONGJUMP1
+ case 4-4-2; 16-bit bit on, optimize off or optimize for space
+ sethi ta, hi20(symbol) ; LONGJUMP1/HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jr5 ta ;
+
+ case 4-4-4; 16-bit off, optimize don't care
+ sethi ta, hi20(symbol) ; LONGJUMP1/HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jr ta ;
+
+ case 4-4-4; 16-bit on, optimize for speed
+ sethi ta, hi20(symbol) ; LONGJUMP1/HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jr ta ; */
+
+ /* Get the reloc for the address from which the register is
+ being loaded. This reloc will tell us which function is
+ actually being called. */
+
+ bfd_vma laddr;
+ int seq_len; /* Original length of instruction sequence. */
+ int insn16_on; /* 16-bit on/off. */
+ uint32_t insn;
+ Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *irelend;
+ int pic_ext_target = 0;
+ bfd_signed_vma foff;
+ uint16_t insn16;
+ unsigned long reloc;
+
+ irelend = internal_relocs + sec->reloc_count;
+ seq_len = GET_SEQ_LEN (irel->r_addend);
+ laddr = irel->r_offset;
+ *insn_len = seq_len;
+ insn16_on = IS_16BIT_ON (irel->r_addend);
+
+ hi_irelfn =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_HI20_RELA, laddr);
+ lo_irelfn =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_LO12S0_ORI_RELA, laddr + 4);
+ if (hi_irelfn == irelend || lo_irelfn == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGJUMP1 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ /* Get the value of the symbol referred to by the reloc. */
+ foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr,
+ &pic_ext_target);
+
+ if (pic_ext_target || foff == 0 || foff >= CONSERVATIVE_24BIT_S1
+ || foff < -CONSERVATIVE_24BIT_S1)
+ return FALSE;
+
+ if (insn16_on && foff >= -ACCURATE_8BIT_S1
+ && foff < ACCURATE_8BIT_S1 && (seq_len & 0x2))
+ {
+ /* j8 label */
+ /* 16-bit on, but not optimized for speed. */
+ reloc = R_NDS32_9_PCREL_RELA;
+ insn16 = INSN_J8;
+ bfd_putb16 (insn16, contents + irel->r_offset);
+ *insn_len = 2;
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE);
+ }
+ else
+ {
+ /* j label */
+ reloc = R_NDS32_25_PCREL_RELA;
+ insn = INSN_J;
+ bfd_putb32 (insn, contents + irel->r_offset);
+ *insn_len = 4;
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_INSN16);
+ irel->r_addend = 0;
+ }
+
+ hi_irelfn->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), reloc);
+ lo_irelfn->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE);
+
+ if ((seq_len & 0x2) && ((*insn_len & 2) == 0))
+ {
+ insn16 = NDS32_NOP16;
+ bfd_putb16 (insn16, contents + irel->r_offset + *insn_len);
+ lo_irelfn->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info),
+ R_NDS32_INSN16);
+ lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG;
+ *insn_len += 2;
+ }
+ return TRUE;
+}
+
+/* Revert condition branch. This function does not check if the input
+ instruction is condition branch or not. */
+
+static void
+nds32_elf_convert_branch (uint16_t insn16, uint32_t insn,
+ uint16_t *re_insn16, uint32_t *re_insn)
+{
+ uint32_t comp_insn = 0;
+ uint16_t comp_insn16 = 0;
+
+ if (insn)
+ {
+ if (N32_OP6 (insn) == N32_OP6_BR1)
+ {
+ /* beqs label. */
+ comp_insn = (insn ^ 0x4000) & 0xffffc000;
+ if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_R5)
+ {
+ /* Insn can be contracted to 16-bit implied r5. */
+ comp_insn16 =
+ (comp_insn & 0x4000) ? INSN_BNES38 : INSN_BEQS38;
+ comp_insn16 |= (N32_RT5 (insn) & 0x7) << 8;
+ }
+ }
+ else if (N32_OP6 (insn) == N32_OP6_BR3)
+ {
+ /* bnec $ta, imm11, label. */
+ comp_insn = (insn ^ 0x80000) & 0xffffff00;
+ }
+ else
+ {
+ comp_insn = (insn ^ 0x10000) & 0xffffc000;
+ if (N32_BR2_SUB (insn) == N32_BR2_BEQZ
+ || N32_BR2_SUB (insn) == N32_BR2_BNEZ)
+ {
+ if (N32_IS_RT3 (insn))
+ {
+ /* Insn can be contracted to 16-bit. */
+ comp_insn16 =
+ (comp_insn & 0x10000) ? INSN_BNEZ38 : INSN_BEQZ38;
+ comp_insn16 |= (N32_RT5 (insn) & 0x7) << 8;
+ }
+ else if (N32_RT5 (insn) == REG_R15)
+ {
+ /* Insn can be contracted to 16-bit. */
+ comp_insn16 =
+ (comp_insn & 0x10000) ? INSN_BNES38 : INSN_BEQS38;
+ }
+ }
+ }
+ }
+ else
+ {
+ switch ((insn16 & 0xf000) >> 12)
+ {
+ case 0xc:
+ /* beqz38 or bnez38 */
+ comp_insn16 = (insn16 ^ 0x0800) & 0xff00;
+ comp_insn = (comp_insn16 & 0x0800) ? INSN_BNEZ : INSN_BEQZ;
+ comp_insn |= ((comp_insn16 & 0x0700) >> 8) << 20;
+ break;
+
+ case 0xd:
+ /* beqs38 or bnes38 */
+ comp_insn16 = (insn16 ^ 0x0800) & 0xff00;
+ comp_insn = (comp_insn16 & 0x0800) ? INSN_BNE : INSN_BEQ;
+ comp_insn |= (((comp_insn16 & 0x0700) >> 8) << 20)
+ | (REG_R5 << 15);
+ break;
+
+ case 0xe:
+ /* beqzS8 or bnezS8 */
+ comp_insn16 = (insn16 ^ 0x0100) & 0xff00;
+ comp_insn = (comp_insn16 & 0x0100) ? INSN_BNEZ : INSN_BEQZ;
+ comp_insn |= REG_R15 << 20;
+ break;
+
+ default:
+ break;
+ }
+ }
+ if (comp_insn && re_insn)
+ *re_insn = comp_insn;
+ if (comp_insn16 && re_insn16)
+ *re_insn16 = comp_insn16;
+}
+
+/* Relax LONGJUMP2 relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_longjump2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ /* There are 3 variations for LONGJUMP2
+ case 2-4; 1st insn convertible, 16-bit on,
+ optimize off or optimize for space
+ bnes38 rt, ra, $1 ; LONGJUMP2
+ j label ; 25_PCREL
+ $1:
+
+ case 4-4; 1st insn not convertible
+ bne rt, ra, $1 ; LONGJUMP2
+ j label ; 25_PCREL
+ $1:
+
+ case 4-4; 1st insn convertible, 16-bit on, optimize for speed
+ bne rt, ra, $1 ; LONGJUMP2
+ j label ; 25_PCREL
+ $1: */
+
+ /* Get the reloc for the address from which the register is
+ being loaded. This reloc will tell us which function is
+ actually being called. */
+
+ bfd_vma laddr;
+ int seq_len; /* Original length of instruction sequence. */
+ Elf_Internal_Rela *i2_irelfn, *cond_irelfn, *irelend;
+ int pic_ext_target = 0, first_size;
+ unsigned int i;
+ bfd_signed_vma foff;
+ uint32_t insn, re_insn = 0;
+ uint16_t insn16, re_insn16 = 0;
+ unsigned long reloc, cond_reloc;
+
+ enum elf_nds32_reloc_type checked_types[] =
+ { R_NDS32_15_PCREL_RELA, R_NDS32_9_PCREL_RELA };
+
+ irelend = internal_relocs + sec->reloc_count;
+ seq_len = GET_SEQ_LEN (irel->r_addend);
+ laddr = irel->r_offset;
+ *insn_len = seq_len;
+ first_size = (seq_len == 6) ? 2 : 4;
+
+ i2_irelfn =
+ find_relocs_at_address_addr (irel, internal_relocs,
+ irelend, R_NDS32_25_PCREL_RELA,
+ laddr + first_size);
+
+ for (i = 0; i < sizeof (checked_types) / sizeof(checked_types[0]); i++)
+ {
+ cond_irelfn =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ checked_types[i], laddr);
+ if (cond_irelfn != irelend)
+ break;
+ }
+
+ if (i2_irelfn == irelend || cond_irelfn == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGJUMP2 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ /* Get the value of the symbol referred to by the reloc. */
+ foff =
+ calculate_offset (abfd, sec, i2_irelfn, isymbuf, symtab_hdr,
+ &pic_ext_target);
+ if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_16BIT_S1
+ || foff >= CONSERVATIVE_16BIT_S1)
+ return FALSE;
+
+ /* Get the all corresponding instructions. */
+ if (first_size == 4)
+ {
+ insn = bfd_getb32 (contents + laddr);
+ nds32_elf_convert_branch (0, insn, &re_insn16, &re_insn);
+ }
+ else
+ {
+ insn16 = bfd_getb16 (contents + laddr);
+ nds32_elf_convert_branch (insn16, 0, &re_insn16, &re_insn);
+ }
+
+ if (re_insn16 && foff >= -(ACCURATE_8BIT_S1 - first_size)
+ && foff < ACCURATE_8BIT_S1 - first_size)
+ {
+ if (first_size == 4)
+ {
+ /* Don't convert it to 16-bit now, keep this as relaxable for
+ ``label reloc; INSN16''. */
+
+ /* Save comp_insn32 to buffer. */
+ bfd_putb32 (re_insn, contents + irel->r_offset);
+ *insn_len = 4;
+ reloc = (N32_OP6 (re_insn) == N32_OP6_BR1) ?
+ R_NDS32_15_PCREL_RELA : R_NDS32_17_PCREL_RELA;
+ cond_reloc = R_NDS32_INSN16;
+ }
+ else
+ {
+ bfd_putb16 (re_insn16, contents + irel->r_offset);
+ *insn_len = 2;
+ reloc = R_NDS32_9_PCREL_RELA;
+ cond_reloc = R_NDS32_NONE;
+ }
+ }
+ else if (N32_OP6 (re_insn) == N32_OP6_BR1
+ && (foff >= -(ACCURATE_14BIT_S1 - first_size)
+ && foff < ACCURATE_14BIT_S1 - first_size))
+ {
+ /* beqs label ; 15_PCREL */
+ bfd_putb32 (re_insn, contents + irel->r_offset);
+ *insn_len = 4;
+ reloc = R_NDS32_15_PCREL_RELA;
+ cond_reloc = R_NDS32_NONE;
+ }
+ else if (N32_OP6 (re_insn) == N32_OP6_BR2
+ && foff >= -CONSERVATIVE_16BIT_S1
+ && foff < CONSERVATIVE_16BIT_S1)
+ {
+ /* beqz label ; 17_PCREL */
+ bfd_putb32 (re_insn, contents + irel->r_offset);
+ *insn_len = 4;
+ reloc = R_NDS32_17_PCREL_RELA;
+ cond_reloc = R_NDS32_NONE;
+ }
+ else
+ return FALSE;
+
+ /* Set all relocations. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), reloc);
+ irel->r_addend = i2_irelfn->r_addend;
+
+ cond_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irelfn->r_info),
+ cond_reloc);
+ cond_irelfn->r_addend = 0;
+
+ if ((seq_len ^ *insn_len ) & 0x2)
+ {
+ insn16 = NDS32_NOP16;
+ bfd_putb16 (insn16, contents + irel->r_offset + 4);
+ i2_irelfn->r_offset = 4;
+ i2_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info),
+ R_NDS32_INSN16);
+ i2_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG;
+ *insn_len += 2;
+ }
+ else
+ i2_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info),
+ R_NDS32_NONE);
+ return TRUE;
+}
+
+/* Relax LONGJUMP3 relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_longjump3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ /* There are 5 variations for LONGJUMP3
+ case 1: 2-4-4-2; 1st insn convertible, 16-bit on,
+ optimize off or optimize for space
+ bnes38 rt, ra, $1 ; LONGJUMP3
+ sethi ta, hi20(symbol) ; HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jr5 ta ;
+ $1: ;
+
+ case 2: 2-4-4-2; 1st insn convertible, 16-bit on, optimize for speed
+ bnes38 rt, ra, $1 ; LONGJUMP3
+ sethi ta, hi20(symbol) ; HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jr5 ta ;
+ $1: ; LABEL
+
+ case 3: 4-4-4-2; 1st insn not convertible, 16-bit on,
+ optimize off or optimize for space
+ bne rt, ra, $1 ; LONGJUMP3
+ sethi ta, hi20(symbol) ; HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jr5 ta ;
+ $1: ;
+
+ case 4: 4-4-4-4; 1st insn don't care, 16-bit off, optimize don't care
+ 16-bit off if no INSN16
+ bne rt, ra, $1 ; LONGJUMP3
+ sethi ta, hi20(symbol) ; HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jr ta ;
+ $1: ;
+
+ case 5: 4-4-4-4; 1st insn not convertible, 16-bit on, optimize for speed
+ 16-bit off if no INSN16
+ bne rt, ra, $1 ; LONGJUMP3
+ sethi ta, hi20(symbol) ; HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jr ta ;
+ $1: ; LABEL */
+
+ /* Get the reloc for the address from which the register is
+ being loaded. This reloc will tell us which function is
+ actually being called. */
+ enum elf_nds32_reloc_type checked_types[] =
+ { R_NDS32_15_PCREL_RELA, R_NDS32_9_PCREL_RELA };
+
+ int reloc_off = 0, cond_removed = 0, convertible;
+ bfd_vma laddr;
+ int seq_len; /* Original length of instruction sequence. */
+ Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *cond_irelfn, *irelend;
+ int pic_ext_target = 0, first_size;
+ unsigned int i;
+ bfd_signed_vma foff;
+ uint32_t insn, re_insn = 0;
+ uint16_t insn16, re_insn16 = 0;
+ unsigned long reloc, cond_reloc;
+
+ irelend = internal_relocs + sec->reloc_count;
+ seq_len = GET_SEQ_LEN (irel->r_addend);
+ laddr = irel->r_offset;
+ *insn_len = seq_len;
+
+ convertible = IS_1ST_CONVERT (irel->r_addend);
+
+ if (convertible)
+ first_size = 2;
+ else
+ first_size = 4;
+
+ /* Get all needed relocations. */
+ hi_irelfn =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_HI20_RELA, laddr + first_size);
+ lo_irelfn =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_LO12S0_ORI_RELA,
+ laddr + first_size + 4);
+
+ for (i = 0; i < sizeof (checked_types) / sizeof (checked_types[0]); i++)
+ {
+ cond_irelfn =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ checked_types[i], laddr);
+ if (cond_irelfn != irelend)
+ break;
+ }
+
+ if (hi_irelfn == irelend || lo_irelfn == irelend || cond_irelfn == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGJUMP3 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ /* Get the value of the symbol referred to by the reloc. */
+ foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr,
+ &pic_ext_target);
+
+ if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1
+ || foff >= CONSERVATIVE_24BIT_S1)
+ return FALSE;
+
+ /* Get the all corresponding instructions. */
+ if (first_size == 4)
+ {
+ insn = bfd_getb32 (contents + laddr);
+ nds32_elf_convert_branch (0, insn, &re_insn16, &re_insn);
+ }
+ else
+ {
+ insn16 = bfd_getb16 (contents + laddr);
+ nds32_elf_convert_branch (insn16, 0, &re_insn16, &re_insn);
+ }
+
+ /* For simplicity of coding, we are going to modify the section
+ contents, the section relocs, and the BFD symbol table. We
+ must tell the rest of the code not to free up this
+ information. It would be possible to instead create a table
+ of changes which have to be made, as is done in coff-mips.c;
+ that would be more work, but would require less memory when
+ the linker is run. */
+
+ if (re_insn16 && foff >= -ACCURATE_8BIT_S1 - first_size
+ && foff < ACCURATE_8BIT_S1 - first_size)
+ {
+ if (!(seq_len & 0x2))
+ {
+ /* Don't convert it to 16-bit now, keep this as relaxable
+ for ``label reloc; INSN1a''6. */
+ /* Save comp_insn32 to buffer. */
+ bfd_putb32 (re_insn, contents + irel->r_offset);
+ *insn_len = 4;
+ reloc = (N32_OP6 (re_insn) == N32_OP6_BR1) ?
+ R_NDS32_15_PCREL_RELA : R_NDS32_17_PCREL_RELA;
+ cond_reloc = R_NDS32_INSN16;
+ }
+ else
+ {
+ /* Not optimize for speed; convert sequence to 16-bit. */
+ /* Save comp_insn16 to buffer. */
+ bfd_putb16 (re_insn16, contents + irel->r_offset);
+ *insn_len = 2;
+ reloc = R_NDS32_9_PCREL_RELA;
+ cond_reloc = R_NDS32_NONE;
+ }
+ cond_removed = 1;
+ }
+ else if (N32_OP6 (re_insn) == N32_OP6_BR1
+ && (foff >= -(ACCURATE_14BIT_S1 - first_size)
+ && foff < ACCURATE_14BIT_S1 - first_size))
+ {
+ /* beqs label ; 15_PCREL */
+ bfd_putb32 (re_insn, contents + irel->r_offset);
+ *insn_len = 4;
+ reloc = R_NDS32_15_PCREL_RELA;
+ cond_reloc = R_NDS32_NONE;
+ cond_removed = 1;
+ }
+ else if (N32_OP6 (re_insn) == N32_OP6_BR2
+ && foff >= -CONSERVATIVE_16BIT_S1
+ && foff < CONSERVATIVE_16BIT_S1)
+ {
+ /* beqz label ; 17_PCREL */
+ bfd_putb32 (re_insn, contents + irel->r_offset);
+ *insn_len = 4;
+ reloc = R_NDS32_17_PCREL_RELA;
+ cond_reloc = R_NDS32_NONE;
+ cond_removed = 1;
+ }
+ else if (foff >= -CONSERVATIVE_24BIT_S1 - reloc_off
+ && foff < CONSERVATIVE_24BIT_S1 - reloc_off)
+ {
+ /* Relax to one of the following 3 variations
+
+ case 2-4; 1st insn convertible, 16-bit on, optimize off or optimize
+ for space
+ bnes38 rt, $1 ; LONGJUMP2
+ j label ; 25_PCREL
+ $1
+
+ case 4-4; 1st insn not convertible, others don't care
+ bne rt, ra, $1 ; LONGJUMP2
+ j label ; 25_PCREL
+ $1
+
+ case 4-4; 1st insn convertible, 16-bit on, optimize for speed
+ bne rt, ra, $1 ; LONGJUMP2
+ j label ; 25_PCREL
+ $1 */
+
+ /* Offset for first instruction. */
+
+ /* Use j label as second instruction. */
+ *insn_len = 4 + first_size;
+ insn = INSN_J;
+ bfd_putb32 (insn, contents + hi_irelfn->r_offset);
+ reloc = R_NDS32_LONGJUMP2;
+ cond_reloc = R_NDS32_25_PLTREL;
+ }
+ else
+ return FALSE;
+
+ if (cond_removed == 1)
+ {
+ /* Set all relocations. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), reloc);
+ irel->r_addend = hi_irelfn->r_addend;
+
+ cond_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irelfn->r_info),
+ cond_reloc);
+ cond_irelfn->r_addend = 0;
+ hi_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info),
+ R_NDS32_NONE);
+ }
+ else
+ {
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc);
+ irel->r_addend = irel->r_addend;
+ hi_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info),
+ cond_reloc);
+ }
+
+ if ((seq_len ^ *insn_len ) & 0x2)
+ {
+ insn16 = NDS32_NOP16;
+ bfd_putb16 (insn16, contents + irel->r_offset + *insn_len);
+ lo_irelfn->r_offset = *insn_len;
+ lo_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info),
+ R_NDS32_INSN16);
+ lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG;
+ *insn_len += 2;
+ }
+ else
+ lo_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info),
+ R_NDS32_NONE);
+ return TRUE;
+}
+
+/* Relax LONGCALL4 relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_longcall4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ /* The pattern for LONGCALL4. Support for function cse.
+ sethi ta, hi20(symbol) ; LONGCALL4/HI20
+ ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR
+ jral ta ; PTR_RES/EMPTY/INSN16 */
+
+ bfd_vma laddr;
+ uint32_t insn;
+ Elf_Internal_Rela *hi_irel, *ptr_irel, *insn_irel, *em_irel, *call_irel;
+ Elf_Internal_Rela *irelend;
+ int pic_ext_target = 0;
+ bfd_signed_vma foff;
+
+ irelend = internal_relocs + sec->reloc_count;
+ laddr = irel->r_offset;
+
+ /* Get the reloc for the address from which the register is
+ being loaded. This reloc will tell us which function is
+ actually being called. */
+ hi_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_HI20_RELA, laddr);
+
+ if (hi_irel == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGCALL4 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ /* Get the value of the symbol referred to by the reloc. */
+ foff = calculate_offset (abfd, sec, hi_irel, isymbuf, symtab_hdr,
+ &pic_ext_target);
+
+ /* This condition only happened when symbol is undefined. */
+ if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1
+ || foff >= CONSERVATIVE_24BIT_S1)
+ return FALSE;
+
+ /* Relax to: jal symbol; 25_PCREL */
+ /* For simplicity of coding, we are going to modify the section
+ contents, the section relocs, and the BFD symbol table. We
+ must tell the rest of the code not to free up this
+ information. It would be possible to instead create a table
+ of changes which have to be made, as is done in coff-mips.c;
+ that would be more work, but would require less memory when
+ the linker is run. */
+
+ ptr_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_PTR_RESOLVED, irel->r_addend);
+ em_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_EMPTY, irel->r_addend);
+
+ if (ptr_irel == irelend || em_irel == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGCALL4 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+ /* Check these is enough space to insert jal in R_NDS32_EMPTY. */
+ insn = bfd_getb32 (contents + irel->r_addend);
+ if (insn & 0x80000000)
+ return FALSE;
+
+ /* Replace the long call with a jal. */
+ em_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info),
+ R_NDS32_25_PCREL_RELA);
+ ptr_irel->r_addend = 1;
+
+ /* We don't resolve this here but resolve it in relocate_section. */
+ insn = INSN_JAL;
+ bfd_putb32 (insn, contents + em_irel->r_offset);
+
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE);
+
+ /* If there is function cse, HI20 can not remove now. */
+ call_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_LONGCALL4, laddr);
+ if (call_irel == irelend)
+ {
+ *insn_len = 0;
+ hi_irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (hi_irel->r_info), R_NDS32_NONE);
+ }
+
+ insn_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_INSN16, irel->r_addend);
+ if (insn_irel != irelend)
+ insn_irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE);
+
+ return TRUE;
+}
+
+/* Relax LONGCALL5 relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_longcall5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ /* The pattern for LONGCALL5.
+ bltz rt, .L1 ; LONGCALL5/17_PCREL
+ jal symbol ; 25_PCREL
+ .L1: */
+
+ bfd_vma laddr;
+ uint32_t insn;
+ Elf_Internal_Rela *cond_irel, *irelend;
+ int pic_ext_target = 0;
+ bfd_signed_vma foff;
+
+ irelend = internal_relocs + sec->reloc_count;
+ laddr = irel->r_offset;
+ insn = bfd_getb32 (contents + laddr);
+
+ /* Get the reloc for the address from which the register is
+ being loaded. This reloc will tell us which function is
+ actually being called. */
+ cond_irel =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_25_PCREL_RELA, irel->r_addend);
+ if (cond_irel == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGCALL5 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ /* Get the value of the symbol referred to by the reloc. */
+ foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr,
+ &pic_ext_target);
+
+ if (foff == 0 || foff < -CONSERVATIVE_16BIT_S1
+ || foff >= CONSERVATIVE_16BIT_S1)
+ return FALSE;
+
+ /* Relax to bgezal rt, label ; 17_PCREL
+ or bltzal rt, label ; 17_PCREL */
+
+ /* Convert to complimentary conditional call. */
+ insn = CONVERT_CONDITION_CALL (insn);
+
+ /* For simplicity of coding, we are going to modify the section
+ contents, the section relocs, and the BFD symbol table. We
+ must tell the rest of the code not to free up this
+ information. It would be possible to instead create a table
+ of changes which have to be made, as is done in coff-mips.c;
+ that would be more work, but would require less memory when
+ the linker is run. */
+
+ /* Modify relocation and contents. */
+ cond_irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_17_PCREL_RELA);
+
+ /* Replace the long call with a bgezal. */
+ bfd_putb32 (insn, contents + cond_irel->r_offset);
+ *insn_len = 0;
+
+ /* Clean unnessary relocations. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE);
+
+ cond_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_17_PCREL_RELA, laddr);
+ cond_irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE);
+
+ return TRUE;
+}
+
+/* Relax LONGCALL6 relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_longcall6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ /* The pattern for LONGCALL6.
+ bltz rt, .L1 ; LONGCALL6/17_PCREL
+ sethi ta, hi20(symbol) ; HI20/PTR
+ ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR
+ jral ta ; PTR_RES/EMPTY/INSN16
+ .L1 */
+
+ bfd_vma laddr;
+ uint32_t insn;
+ Elf_Internal_Rela *em_irel, *cond_irel, *irelend;
+ int pic_ext_target = 0;
+ bfd_signed_vma foff;
+
+ irelend = internal_relocs + sec->reloc_count;
+ laddr = irel->r_offset;
+
+ /* Get the reloc for the address from which the register is
+ being loaded. This reloc will tell us which function is
+ actually being called. */
+ em_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_EMPTY, irel->r_addend);
+
+ if (em_irel == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGCALL6 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ /* Get the value of the symbol referred to by the reloc. */
+ foff = calculate_offset (abfd, sec, em_irel, isymbuf, symtab_hdr,
+ &pic_ext_target);
+
+ if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1
+ || foff >= CONSERVATIVE_24BIT_S1)
+ return FALSE;
+
+ /* Check these is enough space to insert jal in R_NDS32_EMPTY. */
+ insn = bfd_getb32 (contents + irel->r_addend);
+ if (insn & 0x80000000)
+ return FALSE;
+
+ insn = bfd_getb32 (contents + laddr);
+ if (foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1)
+ {
+ /* Relax to bgezal rt, label ; 17_PCREL
+ or bltzal rt, label ; 17_PCREL */
+
+ /* Convert to complimentary conditional call. */
+ *insn_len = 0;
+ insn = CONVERT_CONDITION_CALL (insn);
+ bfd_putb32 (insn, contents + em_irel->r_offset);
+
+ em_irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info), R_NDS32_17_PCREL_RELA);
+
+ /* Set resolved relocation. */
+ cond_irel =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_PTR_RESOLVED, irel->r_addend);
+ if (cond_irel == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGCALL6 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+ cond_irel->r_addend = 1;
+
+ /* Clear relocations. */
+
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE);
+
+ cond_irel =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_17_PCREL_RELA, laddr);
+ if (cond_irel != irelend)
+ cond_irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE);
+
+ cond_irel =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_INSN16, irel->r_addend);
+ if (cond_irel != irelend)
+ cond_irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE);
+
+ }
+ else if (foff >= -CONSERVATIVE_24BIT_S1 && foff < CONSERVATIVE_24BIT_S1)
+ {
+ /* Relax to the following instruction sequence
+ bltz rt, .L1 ; LONGCALL2/17_PCREL
+ jal symbol ; 25_PCREL/PTR_RES
+ .L1 */
+ *insn_len = 4;
+ /* Convert instruction. */
+ insn = INSN_JAL;
+ bfd_putb32 (insn, contents + em_irel->r_offset);
+
+ /* Convert relocations. */
+ em_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info),
+ R_NDS32_25_PCREL_RELA);
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_LONGCALL5);
+
+ /* Set resolved relocation. */
+ cond_irel =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_PTR_RESOLVED, irel->r_addend);
+ if (cond_irel == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGCALL6 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+ cond_irel->r_addend = 1;
+
+ cond_irel =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_INSN16, irel->r_addend);
+ if (cond_irel != irelend)
+ cond_irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE);
+ }
+ return TRUE;
+}
+
+/* Relax LONGJUMP4 relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_longjump4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ /* The pattern for LONGJUMP4.
+ sethi ta, hi20(symbol) ; LONGJUMP4/HI20
+ ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR
+ jr ta ; PTR_RES/INSN16/EMPTY */
+
+ bfd_vma laddr;
+ int seq_len; /* Original length of instruction sequence. */
+ uint32_t insn;
+ Elf_Internal_Rela *hi_irel, *ptr_irel, *em_irel, *call_irel, *irelend;
+ int pic_ext_target = 0;
+ bfd_signed_vma foff;
+
+ irelend = internal_relocs + sec->reloc_count;
+ seq_len = GET_SEQ_LEN (irel->r_addend);
+ laddr = irel->r_offset;
+ *insn_len = seq_len;
+
+ /* Get the reloc for the address from which the register is
+ being loaded. This reloc will tell us which function is
+ actually being called. */
+
+ hi_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_HI20_RELA, laddr);
+
+ if (hi_irel == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGJUMP4 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ /* Get the value of the symbol referred to by the reloc. */
+ foff = calculate_offset (abfd, sec, hi_irel, isymbuf, symtab_hdr,
+ &pic_ext_target);
+
+ if (pic_ext_target || foff == 0 || foff >= CONSERVATIVE_24BIT_S1
+ || foff < -CONSERVATIVE_24BIT_S1)
+ return FALSE;
+
+ /* Convert it to "j label", it may be converted to j8 in the final
+ pass of relaxation. Therefore, we do not consider this currently. */
+ ptr_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_PTR_RESOLVED, irel->r_addend);
+ em_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_EMPTY, irel->r_addend);
+
+ if (ptr_irel == irelend || em_irel == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGJUMP4 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ em_irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info), R_NDS32_25_PCREL_RELA);
+ ptr_irel->r_addend = 1;
+
+ /* Write instruction. */
+ insn = INSN_J;
+ bfd_putb32 (insn, contents + em_irel->r_offset);
+
+ /* Clear relocations. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE);
+
+ /* If there is function cse, HI20 can not remove now. */
+ call_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_LONGJUMP4, laddr);
+ if (call_irel == irelend)
+ {
+ *insn_len = 0;
+ hi_irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (hi_irel->r_info), R_NDS32_NONE);
+ }
+
+ return TRUE;
+}
+
+/* Relax LONGJUMP5 relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_longjump5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ int *seq_len, bfd_byte *contents,
+ Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ /* There are 2 variations for LONGJUMP5
+ case 2-4; 1st insn convertible, 16-bit on.
+ bnes38 rt, ra, .L1 ; LONGJUMP5/9_PCREL/INSN16
+ j label ; 25_PCREL/INSN16
+ $1:
+
+ case 4-4; 1st insn not convertible
+ bne rt, ra, .L1 ; LONGJUMP5/15_PCREL/INSN16
+ j label ; 25_PCREL/INSN16
+ .L1: */
+
+ bfd_vma laddr;
+ Elf_Internal_Rela *cond_irel, *irelend;
+ int pic_ext_target = 0;
+ unsigned int i;
+ bfd_signed_vma foff;
+ uint32_t insn, re_insn = 0;
+ uint16_t insn16, re_insn16 = 0;
+ unsigned long reloc;
+
+ enum elf_nds32_reloc_type checked_types[] =
+ { R_NDS32_17_PCREL_RELA, R_NDS32_15_PCREL_RELA,
+ R_NDS32_9_PCREL_RELA, R_NDS32_INSN16 };
+
+ irelend = internal_relocs + sec->reloc_count;
+ laddr = irel->r_offset;
+
+ /* Get the reloc for the address from which the register is
+ being loaded. This reloc will tell us which function is
+ actually being called. */
+
+ cond_irel =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_25_PCREL_RELA, irel->r_addend);
+ if (cond_irel == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGJUMP5 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ /* Get the value of the symbol referred to by the reloc. */
+ foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr,
+ &pic_ext_target);
+
+ if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_16BIT_S1
+ || foff >= CONSERVATIVE_16BIT_S1)
+ return FALSE;
+
+ /* Get the all corresponding instructions. */
+ insn = bfd_getb32 (contents + laddr);
+ /* Check instruction size. */
+ if (insn & 0x80000000)
+ {
+ *seq_len = 0;
+ insn16 = insn >> 16;
+ nds32_elf_convert_branch (insn16, 0, &re_insn16, &re_insn);
+ }
+ else
+ nds32_elf_convert_branch (0, insn, &re_insn16, &re_insn);
+
+ if (N32_OP6 (re_insn) == N32_OP6_BR1
+ && (foff >= -CONSERVATIVE_14BIT_S1 && foff < CONSERVATIVE_14BIT_S1))
+ {
+ /* beqs label ; 15_PCREL. */
+ bfd_putb32 (re_insn, contents + cond_irel->r_offset);
+ reloc = R_NDS32_15_PCREL_RELA;
+ }
+ else if (N32_OP6 (re_insn) == N32_OP6_BR2
+ && foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1)
+ {
+ /* beqz label ; 17_PCREL. */
+ bfd_putb32 (re_insn, contents + cond_irel->r_offset);
+ reloc = R_NDS32_17_PCREL_RELA;
+ }
+ else if ( N32_OP6 (re_insn) == N32_OP6_BR3
+ && foff >= -CONSERVATIVE_8BIT_S1 && foff < CONSERVATIVE_8BIT_S1)
+ {
+ /* beqc label ; 9_PCREL. */
+ bfd_putb32 (re_insn, contents + cond_irel->r_offset);
+ reloc = R_NDS32_WORD_9_PCREL_RELA;
+ }
+ else
+ return FALSE;
+
+ /* Set all relocations. */
+ cond_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), reloc);
+
+ /* Clean relocations. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE);
+ for (i = 0; i < sizeof (checked_types) / sizeof (checked_types[0]); i++)
+ {
+ cond_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ checked_types[i], laddr);
+ if (cond_irel != irelend)
+ {
+ if (*seq_len == 0
+ && (ELF32_R_TYPE (cond_irel->r_info) == R_NDS32_INSN16))
+ {
+ /* If the branch instruction is 2 byte, it cannot remove
+ directly. Only convert it to nop16 and remove it after
+ checking alignment issue. */
+ insn16 = NDS32_NOP16;
+ bfd_putb16 (insn16, contents + laddr);
+ cond_irel->r_addend = R_NDS32_INSN16_CONVERT_FLAG;
+ }
+ else
+ cond_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info),
+ R_NDS32_NONE);
+ }
+ }
+ *insn_len = 0;
+
+ return TRUE;
+}
+
+/* Relax LONGJUMP6 relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_longjump6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ int *seq_len, bfd_byte *contents,
+ Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ /* There are 5 variations for LONGJUMP6
+ case : 2-4-4-4; 1st insn convertible, 16-bit on.
+ bnes38 rt, ra, .L1 ; LONGJUMP6/15_PCREL/INSN16
+ sethi ta, hi20(symbol) ; HI20/PTR
+ ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR
+ jr ta ; PTR_RES/INSN16/EMPTY
+ .L1:
+
+ case : 4-4-4-4; 1st insn not convertible, 16-bit on.
+ bne rt, ra, .L1 ; LONGJUMP6/15_PCREL/INSN16
+ sethi ta, hi20(symbol) ; HI20/PTR
+ ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR
+ jr ta ; PTR_RES/INSN16/EMPTY
+ .L1: */
+
+ enum elf_nds32_reloc_type checked_types[] =
+ { R_NDS32_17_PCREL_RELA, R_NDS32_15_PCREL_RELA,
+ R_NDS32_9_PCREL_RELA, R_NDS32_INSN16 };
+
+ int reloc_off = 0, cond_removed = 0;
+ bfd_vma laddr;
+ Elf_Internal_Rela *cond_irel, *em_irel, *irelend, *insn_irel;
+ int pic_ext_target = 0;
+ unsigned int i;
+ bfd_signed_vma foff;
+ uint32_t insn, re_insn = 0;
+ uint16_t insn16, re_insn16 = 0;
+ unsigned long reloc;
+
+ irelend = internal_relocs + sec->reloc_count;
+ laddr = irel->r_offset;
+
+ /* Get the reloc for the address from which the register is
+ being loaded. This reloc will tell us which function is
+ actually being called. */
+ em_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_EMPTY, irel->r_addend);
+
+ if (em_irel == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGJUMP6 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ /* Get the value of the symbol referred to by the reloc. */
+ foff = calculate_offset (abfd, sec, em_irel, isymbuf, symtab_hdr,
+ &pic_ext_target);
+
+ if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1
+ || foff >= CONSERVATIVE_24BIT_S1)
+ return FALSE;
+
+ insn = bfd_getb32 (contents + laddr);
+ /* Check instruction size. */
+ if (insn & 0x80000000)
+ {
+ *seq_len = 0;
+ insn16 = insn >> 16;
+ nds32_elf_convert_branch (insn16, 0, &re_insn16, &re_insn);
+ }
+ else
+ nds32_elf_convert_branch (0, insn, &re_insn16, &re_insn);
+
+ /* For simplicity of coding, we are going to modify the section
+ contents, the section relocs, and the BFD symbol table. We
+ must tell the rest of the code not to free up this
+ information. It would be possible to instead create a table
+ of changes which have to be made, as is done in coff-mips.c;
+ that would be more work, but would require less memory when
+ the linker is run. */
+
+ if (N32_OP6 (re_insn) == N32_OP6_BR1
+ && (foff >= -CONSERVATIVE_14BIT_S1 && foff < CONSERVATIVE_14BIT_S1))
+ {
+ /* beqs label ; 15_PCREL */
+ bfd_putb32 (re_insn, contents + em_irel->r_offset);
+ reloc = R_NDS32_15_PCREL_RELA;
+ cond_removed = 1;
+ }
+ else if (N32_OP6 (re_insn) == N32_OP6_BR2
+ && foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1)
+ {
+ /* beqz label ; 17_PCREL */
+ bfd_putb32 (re_insn, contents + em_irel->r_offset);
+ reloc = R_NDS32_17_PCREL_RELA;
+ cond_removed = 1;
+ }
+ else if (foff >= -CONSERVATIVE_24BIT_S1 - reloc_off
+ && foff < CONSERVATIVE_24BIT_S1 - reloc_off)
+ {
+ /* Relax to one of the following 2 variations
+
+ case 2-4; 1st insn convertible, 16-bit on.
+ bnes38 rt, ra, .L1 ; LONGJUMP5/9_PCREL/INSN16
+ j label ; 25_PCREL/INSN16
+ $1:
+
+ case 4-4; 1st insn not convertible
+ bne rt, ra, .L1 ; LONGJUMP5/15_PCREL/INSN16
+ j label ; 25_PCREL/INSN16
+ .L1: */
+
+ /* Use j label as second instruction. */
+ insn = INSN_J;
+ reloc = R_NDS32_25_PCREL_RELA;
+ bfd_putb32 (insn, contents + em_irel->r_offset);
+ }
+ else
+ return FALSE;
+
+ /* Set all relocations. */
+ em_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info), reloc);
+
+ cond_irel =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_PTR_RESOLVED, em_irel->r_offset);
+ cond_irel->r_addend = 1;
+
+ /* Use INSN16 of first branch instruction to distinguish if keeping
+ INSN16 of final instruction or not. */
+ insn_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_INSN16, irel->r_offset);
+ if (insn_irel == irelend)
+ {
+ /* Clean the final INSN16. */
+ insn_irel =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_INSN16, em_irel->r_offset);
+ insn_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info),
+ R_NDS32_NONE);
+ }
+
+ if (cond_removed == 1)
+ {
+ *insn_len = 0;
+
+ /* Clear relocations. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE);
+
+ for (i = 0; i < sizeof (checked_types) / sizeof (checked_types[0]); i++)
+ {
+ cond_irel =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ checked_types[i], laddr);
+ if (cond_irel != irelend)
+ {
+ if (*seq_len == 0
+ && (ELF32_R_TYPE (cond_irel->r_info) == R_NDS32_INSN16))
+ {
+ /* If the branch instruction is 2 byte, it cannot remove
+ directly. Only convert it to nop16 and remove it after
+ checking alignment issue. */
+ insn16 = NDS32_NOP16;
+ bfd_putb16 (insn16, contents + laddr);
+ cond_irel->r_addend = R_NDS32_INSN16_CONVERT_FLAG;
+ }
+ else
+ cond_irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE);
+ }
+ }
+ }
+ else
+ {
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_NDS32_LONGJUMP5);
+ }
+
+ return TRUE;
+}
+
+/* Relax LONGJUMP7 relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_longjump7 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ int *seq_len, bfd_byte *contents,
+ Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ /* There are 2 variations for LONGJUMP5
+ case 2-4; 1st insn convertible, 16-bit on.
+ movi55 ta, imm11 ; LONGJUMP7/INSN16
+ beq rt, ta, label ; 15_PCREL
+
+ case 4-4; 1st insn not convertible
+ movi55 ta, imm11 ; LONGJUMP7/INSN16
+ beq rt, ta, label ; 15_PCREL */
+
+ bfd_vma laddr;
+ Elf_Internal_Rela *cond_irel, *irelend, *insn_irel;
+ int pic_ext_target = 0;
+ bfd_signed_vma foff;
+ uint32_t insn, re_insn = 0;
+ uint16_t insn16;
+ uint32_t imm11;
+
+ irelend = internal_relocs + sec->reloc_count;
+ laddr = irel->r_offset;
+
+ /* Get the reloc for the address from which the register is
+ being loaded. This reloc will tell us which function is
+ actually being called. */
+
+ cond_irel =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_15_PCREL_RELA, irel->r_addend);
+ if (cond_irel == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LONGJUMP7 points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ /* Get the value of the symbol referred to by the reloc. */
+ foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr,
+ &pic_ext_target);
+
+ if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_8BIT_S1
+ || foff >= CONSERVATIVE_8BIT_S1)
+ return FALSE;
+
+ /* Get the first instruction for its size. */
+ insn = bfd_getb32 (contents + laddr);
+ if (insn & 0x80000000)
+ {
+ *seq_len = 0;
+ /* Get the immediate from movi55. */
+ imm11 = N16_IMM5S (insn >> 16);
+ }
+ else
+ {
+ /* Get the immediate from movi. */
+ imm11 = N32_IMM20S (insn);
+ }
+
+ /* Get the branch instruction. */
+ insn = bfd_getb32 (contents + irel->r_addend);
+ /* Convert instruction to BR3. */
+ if ((insn >> 14) & 0x1)
+ re_insn = N32_BR3 (BNEC, N32_RT5 (insn), imm11, 0);
+ else
+ re_insn = N32_BR3 (BEQC, N32_RT5 (insn), imm11, 0);
+
+ bfd_putb32 (re_insn, contents + cond_irel->r_offset);
+
+ /* Set all relocations. */
+ cond_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info),
+ R_NDS32_WORD_9_PCREL_RELA);
+
+ /* Clean relocations. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE);
+ insn_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_INSN16, irel->r_offset);
+ if (insn_irel != irelend)
+ {
+ if (*seq_len == 0)
+ {
+ /* If the first insntruction is 16bit, convert it to nop16. */
+ insn16 = NDS32_NOP16;
+ bfd_putb16 (insn16, contents + laddr);
+ insn_irel->r_addend = R_NDS32_INSN16_CONVERT_FLAG;
+ }
+ else
+ cond_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info),
+ R_NDS32_NONE);
+ }
+ *insn_len = 0;
+
+ return TRUE;
+}
+
+#define GET_LOADSTORE_RANGE(addend) (((addend) >> 8) & 0x3f)
+
+/* Relax LOADSTORE relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_loadstore (struct bfd_link_info *link_info, bfd *abfd,
+ asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr, int load_store_relax)
+{
+ int eliminate_sethi = 0, range_type, i;
+ bfd_vma local_sda, laddr;
+ int seq_len; /* Original length of instruction sequence. */
+ uint32_t insn;
+ Elf_Internal_Rela *hi_irelfn = NULL, *irelend;
+ bfd_vma access_addr = 0;
+ bfd_vma range_l = 0, range_h = 0; /* Upper/lower bound. */
+ enum elf_nds32_reloc_type checked_types[] =
+ { R_NDS32_HI20_RELA, R_NDS32_GOT_HI20,
+ R_NDS32_GOTPC_HI20, R_NDS32_GOTOFF_HI20,
+ R_NDS32_PLTREL_HI20, R_NDS32_PLT_GOTREL_HI20,
+ R_NDS32_TLS_LE_HI20
+ };
+
+ irelend = internal_relocs + sec->reloc_count;
+ seq_len = GET_SEQ_LEN (irel->r_addend);
+ laddr = irel->r_offset;
+ *insn_len = seq_len;
+
+ /* Get the high part relocation. */
+ for (i = 0; (unsigned) i < sizeof (checked_types); i++)
+ {
+ hi_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ checked_types[i], laddr);
+ if (hi_irelfn != irelend)
+ break;
+ }
+
+ if (hi_irelfn == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_LOADSTORE points to unrecognized"
+ "reloc at 0x%lx.", abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ range_type = GET_LOADSTORE_RANGE (irel->r_addend);
+ nds32_elf_final_sda_base (sec->output_section->owner,
+ link_info, &local_sda, FALSE);
+
+ switch (ELF32_R_TYPE (hi_irelfn->r_info))
+ {
+ case R_NDS32_HI20_RELA:
+ insn = bfd_getb32 (contents + laddr);
+ access_addr =
+ calculate_memory_address (abfd, hi_irelfn, isymbuf, symtab_hdr);
+
+ if (range_type == NDS32_LOADSTORE_IMM)
+ {
+ struct elf_link_hash_entry *h = NULL;
+ int indx;
+
+ if (ELF32_R_SYM (hi_irelfn->r_info) >= symtab_hdr->sh_info)
+ {
+ indx = ELF32_R_SYM (hi_irelfn->r_info) - symtab_hdr->sh_info;
+ h = elf_sym_hashes (abfd)[indx];
+ }
+
+ if ((access_addr < CONSERVATIVE_20BIT)
+ && (!h || (h && strcmp (h->root.root.string, FP_BASE_NAME) != 0)))
+ {
+ eliminate_sethi = 1;
+ break;
+ }
+
+ /* This is avoid to relax symbol address which is fixed
+ relocations. Ex: _stack. */
+ if (h && bfd_is_abs_section (h->root.u.def.section))
+ return FALSE;
+ }
+
+ if (!load_store_relax)
+ return FALSE;
+
+ /* Case for set gp register. */
+ if (N32_RT5 (insn) == REG_GP)
+ break;
+
+ if (range_type == NDS32_LOADSTORE_FLOAT_S
+ || range_type == NDS32_LOADSTORE_FLOAT_S)
+ {
+ range_l = sdata_range[0][0];
+ range_h = sdata_range[0][1];
+ }
+ else
+ {
+ range_l = sdata_range[1][0];
+ range_h = sdata_range[1][1];
+ }
+ break;
+
+ case R_NDS32_GOT_HI20:
+ access_addr =
+ calculate_got_memory_address (abfd, link_info, hi_irelfn, symtab_hdr);
+
+ /* If this symbol is not in .got, the return value will be -1.
+ Since the gp value is set to SDA_BASE but not GLOBAL_OFFSET_TABLE,
+ a negative offset is allowed. */
+ if ((bfd_signed_vma) (access_addr - local_sda) < CONSERVATIVE_20BIT
+ && (bfd_signed_vma) (access_addr - local_sda) >= -CONSERVATIVE_20BIT)
+ eliminate_sethi = 1;
+ break;
+
+ case R_NDS32_PLT_GOTREL_HI20:
+ access_addr = calculate_plt_memory_address (abfd, link_info, isymbuf,
+ hi_irelfn, symtab_hdr);
+
+ if ((bfd_signed_vma) (access_addr - local_sda) < CONSERVATIVE_20BIT
+ && (bfd_signed_vma) (access_addr - local_sda) >= -CONSERVATIVE_20BIT)
+ eliminate_sethi = 1;
+ break;
+
+ case R_NDS32_GOTOFF_HI20:
+ access_addr =
+ calculate_memory_address (abfd, hi_irelfn, isymbuf, symtab_hdr);
+
+ if ((bfd_signed_vma) (access_addr - local_sda) < CONSERVATIVE_20BIT
+ && (bfd_signed_vma) (access_addr - local_sda) >= -CONSERVATIVE_20BIT)
+ eliminate_sethi = 1;
+ break;
+
+ case R_NDS32_GOTPC_HI20:
+ /* The access_addr must consider r_addend of hi_irel. */
+ access_addr = sec->output_section->vma + sec->output_offset
+ + irel->r_offset + hi_irelfn->r_addend;
+
+ if ((bfd_signed_vma) (local_sda - access_addr) < CONSERVATIVE_20BIT
+ && (bfd_signed_vma) (local_sda - access_addr) >= -CONSERVATIVE_20BIT)
+ eliminate_sethi = 1;
+ break;
+
+ case R_NDS32_TLS_LE_HI20:
+ access_addr =
+ calculate_memory_address (abfd, hi_irelfn, isymbuf, symtab_hdr);
+ BFD_ASSERT (elf_hash_table (link_info)->tls_sec != NULL);
+ access_addr -= (elf_hash_table (link_info)->tls_sec->vma + TP_OFFSET);
+ if ((range_type == NDS32_LOADSTORE_IMM)
+ && (bfd_signed_vma) (access_addr) < CONSERVATIVE_20BIT
+ && (bfd_signed_vma) (access_addr) >= -CONSERVATIVE_20BIT)
+ eliminate_sethi = 1;
+ break;
+
+ default:
+ return FALSE;
+ }
+
+ /* Delete sethi instruction. */
+ if (eliminate_sethi == 1
+ || (local_sda <= access_addr && (access_addr - local_sda) < range_h)
+ || (local_sda > access_addr && (local_sda - access_addr) <= range_l))
+ {
+ hi_irelfn->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE);
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE);
+ *insn_len = 0;
+ }
+ return TRUE;
+}
+
+/* Relax LO12 relocation for nds32_elf_relax_section. */
+
+static void
+nds32_elf_relax_lo12 (struct bfd_link_info *link_info, bfd *abfd,
+ asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, bfd_byte *contents,
+ Elf_Internal_Sym *isymbuf, Elf_Internal_Shdr *symtab_hdr)
+{
+ uint32_t insn;
+ bfd_vma local_sda, laddr;
+ unsigned long reloc;
+ bfd_vma access_addr;
+ bfd_vma range_l = 0, range_h = 0; /* Upper/lower bound. */
+ Elf_Internal_Rela *irelfn = NULL, *irelend;
+ struct elf_link_hash_entry *h = NULL;
+ int indx;
+
+ /* For SDA base relative relaxation. */
+ nds32_elf_final_sda_base (sec->output_section->owner, link_info,
+ &local_sda, FALSE);
+
+ irelend = internal_relocs + sec->reloc_count;
+ laddr = irel->r_offset;
+ insn = bfd_getb32 (contents + laddr);
+
+ if (!is_sda_access_insn (insn) && N32_OP6 (insn) != N32_OP6_ORI)
+ return;
+
+ access_addr = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr);
+
+ if (ELF32_R_SYM (irel->r_info) >= symtab_hdr->sh_info)
+ {
+ indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
+ h = elf_sym_hashes (abfd)[indx];
+ }
+
+ if (N32_OP6 (insn) == N32_OP6_ORI && access_addr < CONSERVATIVE_20BIT
+ && (!h || (h && strcmp (h->root.root.string, FP_BASE_NAME) != 0)))
+ {
+ reloc = R_NDS32_20_RELA;
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc);
+ insn = N32_TYPE1 (MOVI, N32_RT5 (insn), 0);
+ bfd_putb32 (insn, contents + laddr);
+ }
+ /* This is avoid to relax symbol address which is fixed
+ relocations. Ex: _stack. */
+ else if (N32_OP6 (insn) == N32_OP6_ORI
+ && h && bfd_is_abs_section (h->root.u.def.section))
+ return;
+ else
+ {
+ range_l = sdata_range[1][0];
+ range_h = sdata_range[1][1];
+ switch (ELF32_R_TYPE (irel->r_info))
+ {
+ case R_NDS32_LO12S0_RELA:
+ reloc = R_NDS32_SDA19S0_RELA;
+ break;
+ case R_NDS32_LO12S1_RELA:
+ reloc = R_NDS32_SDA18S1_RELA;
+ break;
+ case R_NDS32_LO12S2_RELA:
+ reloc = R_NDS32_SDA17S2_RELA;
+ break;
+ case R_NDS32_LO12S2_DP_RELA:
+ range_l = sdata_range[0][0];
+ range_h = sdata_range[0][1];
+ reloc = R_NDS32_SDA12S2_DP_RELA;
+ break;
+ case R_NDS32_LO12S2_SP_RELA:
+ range_l = sdata_range[0][0];
+ range_h = sdata_range[0][1];
+ reloc = R_NDS32_SDA12S2_SP_RELA;
+ break;
+ default:
+ return;
+ }
+
+ /* There are range_h and range_l because linker has to promise
+ all sections move cross one page together. */
+ if ((local_sda <= access_addr && (access_addr - local_sda) < range_h)
+ || (local_sda > access_addr && (local_sda - access_addr) <= range_l))
+ {
+ if (N32_OP6 (insn) == N32_OP6_ORI && N32_RT5 (insn) == REG_GP)
+ {
+ /* Maybe we should add R_NDS32_INSN16 reloc type here
+ or manually do some optimization. sethi can't be
+ eliminated when updating $gp so the relative ori
+ needs to be preserved. */
+ return;
+ }
+ if (!turn_insn_to_sda_access (insn, ELF32_R_TYPE (irel->r_info),
+ &insn))
+ return;
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc);
+ bfd_putb32 (insn, contents + laddr);
+
+ irelfn = find_relocs_at_address (irel, internal_relocs, irelend,
+ R_NDS32_INSN16);
+ /* SDA17 must keep INSN16 for converting fp_as_gp. */
+ if (irelfn != irelend && reloc != R_NDS32_SDA17S2_RELA)
+ irelfn->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irelfn->r_info), R_NDS32_NONE);
+
+ }
+ }
+ return;
+}
+
+/* Relax low part of PIC instruction pattern. */
+
+static void
+nds32_elf_relax_piclo12 (struct bfd_link_info *link_info, bfd *abfd,
+ asection *sec, Elf_Internal_Rela *irel,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ uint32_t insn;
+ bfd_vma local_sda, laddr;
+ bfd_signed_vma foff;
+ unsigned long reloc;
+
+ nds32_elf_final_sda_base (sec->output_section->owner, link_info,
+ &local_sda, FALSE);
+ laddr = irel->r_offset;
+ insn = bfd_getb32 (contents + laddr);
+
+ if (N32_OP6 (insn) != N32_OP6_ORI)
+ return;
+
+ if (ELF32_R_TYPE (irel->r_info) == R_NDS32_GOT_LO12)
+ {
+ foff = calculate_got_memory_address (abfd, link_info, irel,
+ symtab_hdr) - local_sda;
+ reloc = R_NDS32_GOT20;
+ }
+ else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_PLT_GOTREL_LO12)
+ {
+ foff = calculate_plt_memory_address (abfd, link_info, isymbuf, irel,
+ symtab_hdr) - local_sda;
+ reloc = R_NDS32_PLT_GOTREL_LO20;
+ }
+ else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTOFF_LO12)
+ {
+ foff = calculate_memory_address (abfd, irel, isymbuf,
+ symtab_hdr) - local_sda;
+ reloc = R_NDS32_GOTOFF;
+ }
+ else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTPC_LO12)
+ {
+ foff = local_sda - sec->output_section->vma + sec->output_offset
+ + irel->r_offset + irel->r_addend;
+ reloc = R_NDS32_GOTPC20;
+ }
+ else
+ return;
+
+ if ((foff < CONSERVATIVE_20BIT) && (foff >= -CONSERVATIVE_20BIT))
+ {
+ /* Turn into MOVI. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc);
+ insn = N32_TYPE1 (MOVI, N32_RT5 (insn), 0);
+ bfd_putb32 (insn, contents + laddr);
+ }
+}
+
+/* Relax low part of LE TLS instruction pattern. */
+
+static void
+nds32_elf_relax_letlslo12 (struct bfd_link_info *link_info, bfd *abfd,
+ Elf_Internal_Rela *irel,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr)
+{
+ uint32_t insn;
+ bfd_vma laddr;
+ bfd_signed_vma foff;
+ unsigned long reloc;
+
+ laddr = irel->r_offset;
+ foff = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr);
+ BFD_ASSERT (elf_hash_table (link_info)->tls_sec != NULL);
+ foff -= (elf_hash_table (link_info)->tls_sec->vma + TP_OFFSET);
+ insn = bfd_getb32 (contents + laddr);
+
+ if ( (bfd_signed_vma) (foff) < CONSERVATIVE_20BIT
+ && (bfd_signed_vma) (foff) >= -CONSERVATIVE_20BIT)
+ {
+ /* Pattern sethi-ori transform to movi. */
+ reloc = R_NDS32_TLS_LE_20;
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc);
+ insn = N32_TYPE1 (MOVI, N32_RT5 (insn), 0);
+ bfd_putb32 (insn, contents + laddr);
+ }
+}
+
+/* Relax LE TLS calculate address instruction pattern. */
+
+static void
+nds32_elf_relax_letlsadd (struct bfd_link_info *link_info, bfd *abfd,
+ asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again)
+{
+ /* Local TLS non-pic
+ sethi ta, hi20(symbol@tpoff) ; TLS_LE_HI20
+ ori ta, ta, lo12(symbol@tpoff) ; TLS_LE_LO12
+ add ra, ta, tp ; TLS_LE_ADD */
+
+ uint32_t insn;
+ bfd_vma laddr;
+ bfd_signed_vma foff;
+ Elf_Internal_Rela *i1_irelfn, *irelend;
+
+ irelend = internal_relocs + sec->reloc_count;
+ laddr = irel->r_offset;
+ insn = bfd_getb32 (contents + laddr);
+ i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend,
+ R_NDS32_PTR_RESOLVED);
+ foff = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr);
+ BFD_ASSERT (elf_hash_table (link_info)->tls_sec != NULL);
+ foff -= (elf_hash_table (link_info)->tls_sec->vma + TP_OFFSET);
+
+ /* The range is +/-16k. */
+ if ((bfd_signed_vma) (foff) < CONSERVATIVE_15BIT
+ && (bfd_signed_vma) (foff) >= -CONSERVATIVE_15BIT)
+ {
+ /* Transform add to addi. */
+ insn = N32_TYPE2 (ADDI, N32_RT5 (insn), N32_RB5 (insn), 0);
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_TLS_LE_15S0);
+
+ bfd_putb32 (insn, contents + laddr);
+ if (i1_irelfn != irelend)
+ {
+ i1_irelfn->r_addend |= 1;
+ *again = TRUE;
+ }
+ }
+}
+
+/* Relax LE TLS load store instruction pattern. */
+
+static void
+nds32_elf_relax_letlsls (struct bfd_link_info *link_info, bfd *abfd,
+ asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again)
+{
+
+ uint32_t insn;
+ bfd_vma laddr;
+ bfd_signed_vma foff;
+ Elf_Internal_Rela *i1_irelfn, *irelend;
+ int success = 0;
+
+ irelend = internal_relocs + sec->reloc_count;
+ laddr = irel->r_offset;
+ insn = bfd_getb32 (contents + laddr);
+ i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend,
+ R_NDS32_PTR_RESOLVED);
+ foff = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr);
+ BFD_ASSERT (elf_hash_table (link_info)->tls_sec != NULL);
+ foff -= (elf_hash_table (link_info)->tls_sec->vma + TP_OFFSET);
+
+ switch ((N32_OP6 (insn) << 8) | (insn & 0xff))
+ {
+ case (N32_OP6_MEM << 8) | N32_MEM_LB:
+ case (N32_OP6_MEM << 8) | N32_MEM_SB:
+ case (N32_OP6_MEM << 8) | N32_MEM_LBS:
+ /* The range is +/-16k. */
+ if ((bfd_signed_vma) (foff) < CONSERVATIVE_15BIT
+ && (bfd_signed_vma) (foff) >= -CONSERVATIVE_15BIT)
+ {
+ insn =
+ ((insn & 0xff) << 25) | (insn & 0x1f00000) | ((insn & 0x7c00) << 5);
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_TLS_LE_15S0);
+ success = 1;
+ break;
+ }
+ case (N32_OP6_MEM << 8) | N32_MEM_LH:
+ case (N32_OP6_MEM << 8) | N32_MEM_SH:
+ case (N32_OP6_MEM << 8) | N32_MEM_LHS:
+ /* The range is +/-32k. */
+ if ((bfd_signed_vma) (foff) < CONSERVATIVE_15BIT_S1
+ && (bfd_signed_vma) (foff) >= -CONSERVATIVE_15BIT_S1)
+ {
+ insn =
+ ((insn & 0xff) << 25) | (insn & 0x1f00000) | ((insn & 0x7c00) << 5);
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_TLS_LE_15S1);
+ success = 1;
+ break;
+ }
+ case (N32_OP6_MEM << 8) | N32_MEM_LW:
+ case (N32_OP6_MEM << 8) | N32_MEM_SW:
+ /* The range is +/-64k. */
+ if ((bfd_signed_vma) (foff) < CONSERVATIVE_15BIT_S2
+ && (bfd_signed_vma) (foff) >= -CONSERVATIVE_15BIT_S2)
+ {
+ insn =
+ ((insn & 0xff) << 25) | (insn & 0x1f00000) | ((insn & 0x7c00) << 5);
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_TLS_LE_15S2);
+ success = 1;
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (success)
+ {
+ bfd_putb32 (insn, contents + laddr);
+ if (i1_irelfn != irelend)
+ {
+ i1_irelfn->r_addend |= 1;
+ *again = TRUE;
+ }
+ }
+}
+
+/* Relax PTR relocation for nds32_elf_relax_section. */
+
+static bfd_boolean
+nds32_elf_relax_ptr (bfd *abfd, asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs, int *insn_len,
+ int *seq_len, bfd_byte *contents)
+{
+ Elf_Internal_Rela *ptr_irel, *irelend, *count_irel, *re_irel;
+
+ irelend = internal_relocs + sec->reloc_count;
+
+ re_irel =
+ find_relocs_at_address_addr (irel, internal_relocs, irelend,
+ R_NDS32_PTR_RESOLVED, irel->r_addend);
+
+ if (re_irel == irelend)
+ {
+ (*_bfd_error_handler)
+ ("%B: warning: R_NDS32_PTR points to unrecognized reloc at 0x%lx.",
+ abfd, (long) irel->r_offset);
+ return FALSE;
+ }
+
+ if (re_irel->r_addend != 1)
+ return FALSE;
+
+ /* Pointed target is relaxed and no longer needs this void *,
+ change the type to NONE. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE);
+
+ /* Find PTR_COUNT to decide remove it or not. If PTR_COUNT does
+ not exist, it means only count 1 and remove it directly. */
+ /* TODO: I hope we can obsolate R_NDS32_COUNT in the future. */
+ count_irel = find_relocs_at_address (irel, internal_relocs, irelend,
+ R_NDS32_PTR_COUNT);
+ ptr_irel = find_relocs_at_address (irel, internal_relocs, irelend,
+ R_NDS32_PTR);
+ if (count_irel != irelend)
+ {
+ if (--count_irel->r_addend > 0)
+ return FALSE;
+ }
+
+ if (ptr_irel != irelend)
+ return FALSE;
+
+ /* If the PTR_COUNT is already 0, remove current instruction. */
+ *seq_len = nds32_elf_insn_size (abfd, contents, irel->r_offset);
+ *insn_len = 0;
+ return TRUE;
+}
+
+/* Relax PLT_GOT_SUFF relocation for nds32_elf_relax_section. */
+
+static void
+nds32_elf_relax_pltgot_suff (struct bfd_link_info *link_info, bfd *abfd,
+ asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again)
+{
+ uint32_t insn;
+ bfd_signed_vma foff;
+ Elf_Internal_Rela *i1_irelfn, *irelend;
+ bfd_vma local_sda, laddr;
+
+ irelend = internal_relocs + sec->reloc_count;
+ laddr = irel->r_offset;
+ insn = bfd_getb32 (contents + laddr);
+
+ /* FIXME: It's a little trouble to turn JRAL5 to JAL since
+ we need additional space. It might be help if we could
+ borrow some space from instructions to be eliminated
+ such as sethi, ori, add. */
+ if (insn & 0x80000000)
+ return;
+
+ if (nds32_elf_check_dup_relocs
+ (irel, internal_relocs, irelend, R_NDS32_PLT_GOT_SUFF))
+ return;
+
+ i1_irelfn =
+ find_relocs_at_address (irel, internal_relocs, irelend,
+ R_NDS32_PTR_RESOLVED);
+
+ /* FIXIT 090606
+ The boundary should be reduced since the .plt section hasn't
+ been created and the address of specific entry is still unknown
+ Maybe the range between the function call and the begin of the
+ .text section can be used to decide if the .plt is in the range
+ of function call. */
+
+ if (N32_OP6 (insn) == N32_OP6_ALU1
+ && N32_SUB5 (insn) == N32_ALU1_ADD)
+ {
+ /* Get the value of the symbol referred to by the reloc. */
+ nds32_elf_final_sda_base (sec->output_section->owner, link_info,
+ &local_sda, FALSE);
+ foff = (bfd_signed_vma) (calculate_plt_memory_address
+ (abfd, link_info, isymbuf, irel,
+ symtab_hdr) - local_sda);
+ /* This condition only happened when symbol is undefined. */
+ if (foff == 0)
+ return;
+
+ if (foff < -CONSERVATIVE_19BIT || foff >= CONSERVATIVE_19BIT)
+ return;
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_NDS32_PLT_GOTREL_LO19);
+ /* addi.gp */
+ insn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19));
+ }
+ else if (N32_OP6 (insn) == N32_OP6_JREG
+ && N32_SUB5 (insn) == N32_JREG_JRAL)
+ {
+ /* Get the value of the symbol referred to by the reloc. */
+ foff =
+ calculate_plt_offset (abfd, sec, link_info, isymbuf, irel, symtab_hdr);
+ /* This condition only happened when symbol is undefined. */
+ if (foff == 0)
+ return;
+ if (foff < -CONSERVATIVE_24BIT_S1 || foff >= CONSERVATIVE_24BIT_S1)
+ return;
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_25_PLTREL);
+ insn = INSN_JAL;
+ }
+ else
+ return;
+
+ bfd_putb32 (insn, contents + laddr);
+ if (i1_irelfn != irelend)
+ {
+ i1_irelfn->r_addend |= 1;
+ *again = TRUE;
+ }
+}
+
+/* Relax GOT_SUFF relocation for nds32_elf_relax_section. */
+
+static void
+nds32_elf_relax_got_suff (struct bfd_link_info *link_info, bfd *abfd,
+ asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs,
+ bfd_byte *contents, Elf_Internal_Shdr *symtab_hdr,
+ bfd_boolean *again)
+{
+ uint32_t insn;
+ bfd_signed_vma foff;
+ Elf_Internal_Rela *i1_irelfn, *irelend;
+ bfd_vma local_sda, laddr;
+
+ irelend = internal_relocs + sec->reloc_count;
+ laddr = irel->r_offset;
+ insn = bfd_getb32 (contents + laddr);
+ if (insn & 0x80000000)
+ return;
+
+ if (nds32_elf_check_dup_relocs
+ (irel, internal_relocs, irelend, R_NDS32_GOT_SUFF))
+ return;
+
+ i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend,
+ R_NDS32_PTR_RESOLVED);
+
+ nds32_elf_final_sda_base (sec->output_section->owner, link_info,
+ &local_sda, FALSE);
+ foff = calculate_got_memory_address (abfd, link_info, irel,
+ symtab_hdr) - local_sda;
+
+ if (foff < CONSERVATIVE_19BIT && foff >= -CONSERVATIVE_19BIT)
+ {
+ /* Turn LW to LWI.GP. Change relocation type to R_NDS32_GOT_REL. */
+ insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (6, 17, 3));
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_GOT17S2_RELA);
+ bfd_putb32 (insn, contents + laddr);
+ if (i1_irelfn != irelend)
+ {
+ i1_irelfn->r_addend |= 1;
+ *again = TRUE;
+ }
+ }
+}
+
+/* Relax PLT_GOT_SUFF relocation for nds32_elf_relax_section. */
+
+static void
+nds32_elf_relax_gotoff_suff (struct bfd_link_info *link_info, bfd *abfd,
+ asection *sec, Elf_Internal_Rela *irel,
+ Elf_Internal_Rela *internal_relocs,
+ bfd_byte *contents, Elf_Internal_Sym *isymbuf,
+ Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again)
+{
+ int opc_insn_gotoff;
+ uint32_t insn;
+ bfd_signed_vma foff;
+ Elf_Internal_Rela *i1_irelfn, *i2_irelfn, *irelend;
+ bfd_vma local_sda, laddr;
+
+ irelend = internal_relocs + sec->reloc_count;
+ laddr = irel->r_offset;
+ insn = bfd_getb32 (contents + laddr);
+
+ if (insn & 0x80000000)
+ return;
+
+ if (nds32_elf_check_dup_relocs
+ (irel, internal_relocs, irelend, R_NDS32_GOTOFF_SUFF))
+ return;
+
+ i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend,
+ R_NDS32_PTR_RESOLVED);
+ nds32_elf_final_sda_base (sec->output_section->owner, link_info,
+ &local_sda, FALSE);
+ foff = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr);
+ foff = foff - local_sda;
+
+ if (foff >= CONSERVATIVE_19BIT || foff < -CONSERVATIVE_19BIT)
+ return;
+
+ /* Concatenate opcode and sub-opcode for switch case.
+ It may be MEM or ALU1. */
+ opc_insn_gotoff = (N32_OP6 (insn) << 8) | (insn & 0xff);
+ switch (opc_insn_gotoff)
+ {
+ case (N32_OP6_MEM << 8) | N32_MEM_LW:
+ /* 4-byte aligned. */
+ insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (6, 17, 3));
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA17S2_RELA);
+ break;
+ case (N32_OP6_MEM << 8) | N32_MEM_SW:
+ insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (7, 17, 3));
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA17S2_RELA);
+ break;
+ case (N32_OP6_MEM << 8) | N32_MEM_LH:
+ /* 2-byte aligned. */
+ insn = N32_TYPE1 (HWGP, N32_RT5 (insn), 0);
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA);
+ break;
+ case (N32_OP6_MEM << 8) | N32_MEM_LHS:
+ insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (18));
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA);
+ break;
+ case (N32_OP6_MEM << 8) | N32_MEM_SH:
+ insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (19));
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA);
+ break;
+ case (N32_OP6_MEM << 8) | N32_MEM_LB:
+ /* 1-byte aligned. */
+ insn = N32_TYPE1 (LBGP, N32_RT5 (insn), 0);
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA);
+ break;
+ case (N32_OP6_MEM << 8) | N32_MEM_LBS:
+ insn = N32_TYPE1 (LBGP, N32_RT5 (insn), __BIT (19));
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA);
+ break;
+ case (N32_OP6_MEM << 8) | N32_MEM_SB:
+ insn = N32_TYPE1 (SBGP, N32_RT5 (insn), 0);
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA);
+ break;
+ case (N32_OP6_ALU1 << 8) | N32_ALU1_ADD:
+ insn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19));
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA);
+ break;
+ default:
+ return;
+ }
+
+ bfd_putb32 (insn, contents + laddr);
+ if (i1_irelfn != irelend)
+ {
+ i1_irelfn->r_addend |= 1;
+ *again = TRUE;
+ }
+ if ((i2_irelfn = find_relocs_at_address (irel, internal_relocs, irelend,
+ R_NDS32_INSN16)) != irelend)
+ i2_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE);
+
+}
+
+static bfd_boolean
+nds32_relax_adjust_label (bfd *abfd, asection *sec,
+ Elf_Internal_Rela *internal_relocs,
+ bfd_byte *contents,
+ nds32_elf_blank_t **relax_blank_list,
+ int optimize, int opt_size)
+{
+ /* This code block is used to adjust 4-byte alignment by relax a pair
+ of instruction a time.
+
+ It recognizes three types of relocations.
+ 1. R_NDS32_LABEL - a aligment.
+ 2. R_NDS32_INSN16 - relax a 32-bit instruction to 16-bit.
+ 3. is_16bit_NOP () - remove a 16-bit instruction. */
+
+ /* TODO: It seems currently implementation only support 4-byte aligment.
+ We should handle any-aligment. */
+
+ Elf_Internal_Rela *insn_rel = NULL, *label_rel = NULL, *irel;
+ Elf_Internal_Rela *tmp_rel, *tmp2_rel = NULL;
+ Elf_Internal_Rela rel_temp;
+ Elf_Internal_Rela *irelend;
+ bfd_vma address;
+ uint16_t insn16;
+
+ /* Checking for branch relaxation relies on the relocations to
+ be sorted on 'r_offset'. This is not guaranteed so we must sort. */
+ nds32_insertion_sort (internal_relocs, sec->reloc_count,
+ sizeof (Elf_Internal_Rela), compar_reloc);
+
+ irelend = internal_relocs + sec->reloc_count;
+
+ /* Force R_NDS32_LABEL before R_NDS32_INSN16. */
+ /* FIXME: Can we generate the right order in assembler?
+ So we don't have to swapping them here. */
+
+ for (label_rel = internal_relocs, insn_rel = internal_relocs;
+ label_rel < irelend; label_rel++)
+ {
+ if (ELF32_R_TYPE (label_rel->r_info) != R_NDS32_LABEL)
+ continue;
+
+ /* Find the first reloc has the same offset with label_rel. */
+ while (insn_rel < irelend && insn_rel->r_offset < label_rel->r_offset)
+ insn_rel++;
+
+ for (;insn_rel < irelend && insn_rel->r_offset == label_rel->r_offset;
+ insn_rel++)
+ /* Check if there were R_NDS32_INSN16 and R_NDS32_LABEL at the same
+ address. */
+ if (ELF32_R_TYPE (insn_rel->r_info) == R_NDS32_INSN16)
+ break;
+
+ if (insn_rel < irelend && insn_rel->r_offset == label_rel->r_offset
+ && insn_rel < label_rel)
+ {
+ /* Swap the two reloc if the R_NDS32_INSN16 is
+ before R_NDS32_LABEL. */
+ memcpy (&rel_temp, insn_rel, sizeof (Elf_Internal_Rela));
+ memcpy (insn_rel, label_rel, sizeof (Elf_Internal_Rela));
+ memcpy (label_rel, &rel_temp, sizeof (Elf_Internal_Rela));
+ }
+ }
+
+ label_rel = NULL;
+ insn_rel = NULL;
+ /* If there were a sequence of R_NDS32_LABEL end up with .align 2
+ or higher, remove other R_NDS32_LABEL with lower alignment.
+ If an R_NDS32_INSN16 in between R_NDS32_LABELs must be converted,
+ then the R_NDS32_LABEL sequence is broke. */
+ for (tmp_rel = internal_relocs; tmp_rel < irelend; tmp_rel++)
+ {
+ if (ELF32_R_TYPE (tmp_rel->r_info) == R_NDS32_LABEL)
+ {
+ if (label_rel == NULL)
+ {
+ if (tmp_rel->r_addend < 2)
+ label_rel = tmp_rel;
+ continue;
+ }
+ else if (tmp_rel->r_addend > 1)
+ {
+ /* Remove all LABEL relocation from label_rel to tmp_rel
+ including relocations with same offset as tmp_rel. */
+ for (tmp2_rel = label_rel; tmp2_rel < tmp_rel
+ || tmp2_rel->r_offset == tmp_rel->r_offset; tmp2_rel++)
+ {
+ if (ELF32_R_TYPE (tmp2_rel->r_info) == R_NDS32_LABEL
+ && tmp2_rel->r_addend < 2)
+ tmp2_rel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (tmp2_rel->r_info),
+ R_NDS32_NONE);
+ }
+ label_rel = NULL;
+ }
+ }
+ else if (ELF32_R_TYPE (tmp_rel->r_info) == R_NDS32_INSN16 && label_rel)
+ {
+ /* A new INSN16 which can be converted, so clear label_rel. */
+ if (is_convert_32_to_16 (abfd, sec, tmp_rel, internal_relocs,
+ irelend, &insn16)
+ || is_16bit_NOP (abfd, sec, tmp_rel))
+ label_rel = NULL;
+ }
+ }
+
+ label_rel = NULL;
+ insn_rel = NULL;
+ /* Optimized for speed and nothing has not been relaxed.
+ It's time to align labels.
+ We may convert a 16-bit instruction right before a label to
+ 32-bit, in order to align the label if necessary
+ all reloc entries has been sorted by r_offset. */
+ for (irel = internal_relocs; irel < irelend; irel++)
+ {
+ if (ELF32_R_TYPE (irel->r_info) != R_NDS32_INSN16
+ && ELF32_R_TYPE (irel->r_info) != R_NDS32_LABEL)
+ continue;
+
+ if (ELF32_R_TYPE (irel->r_info) == R_NDS32_INSN16)
+ {
+ /* A new INSN16 found, resize the old one. */
+ if (is_convert_32_to_16
+ (abfd, sec, irel, internal_relocs, irelend, &insn16)
+ || is_16bit_NOP (abfd, sec, irel))
+ {
+ if (insn_rel)
+ {
+ /* Previous INSN16 reloc exists, reduce its
+ size to 16-bit. */
+ if (is_convert_32_to_16 (abfd, sec, insn_rel, internal_relocs,
+ irelend, &insn16))
+ {
+ nds32_elf_write_16 (abfd, contents, insn_rel,
+ internal_relocs, irelend, insn16);
+
+ if (!insert_nds32_elf_blank_recalc_total
+ (relax_blank_list, insn_rel->r_offset + 2, 2))
+ return FALSE;
+ }
+ else if (is_16bit_NOP (abfd, sec, insn_rel))
+ {
+ if (!insert_nds32_elf_blank_recalc_total
+ (relax_blank_list, insn_rel->r_offset, 2))
+ return FALSE;
+ }
+ insn_rel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (insn_rel->r_info), R_NDS32_NONE);
+ }
+ /* Save the new one for later use. */
+ insn_rel = irel;
+ }
+ else
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_NDS32_NONE);
+ }
+ else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL)
+ {
+ /* Search for label. */
+ int force_relax = 0;
+
+ /* Label on 16-bit instruction or optimization
+ needless, just reset this reloc. */
+ insn16 = bfd_getb16 (contents + irel->r_offset);
+ if ((irel->r_addend & 0x1f) < 2 && (!optimize || (insn16 & 0x8000)))
+ {
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE);
+ continue;
+ }
+
+ address =
+ irel->r_offset - get_nds32_elf_blank_total (relax_blank_list,
+ irel->r_offset, 1);
+
+ if (!insn_rel)
+ {
+ /* Check if there is case which can not be aligned. */
+ if (irel->r_addend == 2 && address & 0x2)
+ return FALSE;
+ continue;
+ }
+
+ /* Try to align this label. */
+
+ if ((irel->r_addend & 0x1f) < 2)
+ {
+ /* Check if there is a INSN16 at the same address.
+ Label_rel always seats before insn_rel after
+ our sort. */
+
+ /* Search for INSN16 at LABEL location. If INSN16 is at
+ same location and this LABEL alignment is lower than 2,
+ the INSN16 can be converted to 2-byte. */
+ for (tmp_rel = irel;
+ tmp_rel < irelend && tmp_rel->r_offset == irel->r_offset;
+ tmp_rel++)
+ {
+ if (ELF32_R_TYPE (tmp_rel->r_info) == R_NDS32_INSN16
+ && (is_convert_32_to_16
+ (abfd, sec, tmp_rel, internal_relocs,
+ irelend, &insn16)
+ || is_16bit_NOP (abfd, sec, tmp_rel)))
+ {
+ force_relax = 1;
+ break;
+ }
+ }
+ }
+
+ if (force_relax || irel->r_addend == 1 || address & 0x2)
+ {
+ /* Label not aligned. */
+ /* Previous reloc exists, reduce its size to 16-bit. */
+ if (is_convert_32_to_16 (abfd, sec, insn_rel,
+ internal_relocs, irelend, &insn16))
+ {
+ nds32_elf_write_16 (abfd, contents, insn_rel,
+ internal_relocs, irelend, insn16);
+
+ if (!insert_nds32_elf_blank_recalc_total
+ (relax_blank_list, insn_rel->r_offset + 2, 2))
+ return FALSE;
+ }
+ else if (is_16bit_NOP (abfd, sec, insn_rel))
+ {
+ if (!insert_nds32_elf_blank_recalc_total
+ (relax_blank_list, insn_rel->r_offset, 2))
+ return FALSE;
+ }
+
+ }
+ /* INSN16 reloc is used. */
+ insn_rel = NULL;
+ }
+ }
+
+ address =
+ sec->size - get_nds32_elf_blank_total (relax_blank_list, sec->size, 0);
+ if (insn_rel && (address & 0x2 || opt_size))
+ {
+ if (is_convert_32_to_16 (abfd, sec, insn_rel, internal_relocs,
+ irelend, &insn16))
+ {
+ nds32_elf_write_16 (abfd, contents, insn_rel, internal_relocs,
+ irelend, insn16);
+ if (!insert_nds32_elf_blank_recalc_total
+ (relax_blank_list, insn_rel->r_offset + 2, 2))
+ return FALSE;
+ insn_rel->r_info = ELF32_R_INFO (ELF32_R_SYM (insn_rel->r_info),
+ R_NDS32_NONE);
+ }
+ else if (is_16bit_NOP (abfd, sec, insn_rel))
+ {
+ if (!insert_nds32_elf_blank_recalc_total
+ (relax_blank_list, insn_rel->r_offset, 2))
+ return FALSE;
+ insn_rel->r_info = ELF32_R_INFO (ELF32_R_SYM (insn_rel->r_info),
+ R_NDS32_NONE);
+ }
+ }
+ insn_rel = NULL;
+ return TRUE;
+}
+
+/* Pick relaxation round. */
+
+static int
+nds32_elf_pick_relax (bfd_boolean init, asection *sec, bfd_boolean *again,
+ struct elf_nds32_link_hash_table *table,
+ struct bfd_link_info *link_info)
+{
+ static asection *final_sec;
+ static bfd_boolean set = FALSE;
+ static bfd_boolean first = TRUE;
+ int round_table[] = {
+ NDS32_RELAX_NORMAL_ROUND,
+ NDS32_RELAX_JUMP_IFC_ROUND,
+ NDS32_RELAX_EX9_BUILD_ROUND,
+ NDS32_RELAX_EX9_REPLACE_ROUND,
+ };
+ static int pass = 0;
+ static int relax_round;
+
+ if (first)
+ {
+ /* Run an empty run to get the final section. */
+ relax_round = NDS32_RELAX_EMPTY_ROUND;
+
+ /* It has to enter relax again because we can
+ not make sure what the final turn is. */
+ *again = TRUE;
+ first = FALSE;
+ }
+
+ if (!set && *again)
+ {
+ /* It is reentered when again is FALSE. */
+ final_sec = sec;
+ return relax_round;
+ }
+
+ /* The second round begins. */
+ set = TRUE;
+
+ relax_round = round_table[pass];
+
+ if (!init && final_sec == sec)
+ {
+ switch (relax_round)
+ {
+ case NDS32_RELAX_NORMAL_ROUND:
+ if (!*again)
+ {
+ /* Normal relaxation done. */
+ if (table->target_optimize & NDS32_RELAX_JUMP_IFC_ON)
+ {
+ pass++;
+ *again = TRUE;
+ }
+ else if (table->target_optimize & NDS32_RELAX_EX9_ON)
+ {
+ pass += 2; /* NDS32_RELAX_EX9_BUILD_ROUND */
+ *again = TRUE;
+ }
+ else if (table->ex9_import_file)
+ {
+ /* Import ex9 table. */
+ if (table->update_ex9_table)
+ pass += 2; /* NDS32_RELAX_EX9_BUILD_ROUND */
+ else
+ pass += 3; /* NDS32_RELAX_EX9_REPLACE_ROUND */
+ nds32_elf_ex9_import_table (link_info);
+ *again = TRUE;
+ }
+ }
+ break;
+ case NDS32_RELAX_JUMP_IFC_ROUND:
+ if (!nds32_elf_ifc_finish (link_info))
+ (*_bfd_error_handler) (_("error: Jump IFC Fail."));
+ if (table->target_optimize & NDS32_RELAX_EX9_ON)
+ {
+ pass++;
+ *again = TRUE;
+ }
+ break;
+ case NDS32_RELAX_EX9_BUILD_ROUND:
+ nds32_elf_ex9_finish (link_info);
+ pass++;
+ *again = TRUE;
+ break;
+ case NDS32_RELAX_EX9_REPLACE_ROUND:
+ if (table->target_optimize & NDS32_RELAX_JUMP_IFC_ON)
+ {
+ /* Do jump IFC optimization again. */
+ if (!nds32_elf_ifc_finish (link_info))
+ (*_bfd_error_handler) (_("error: Jump IFC Fail."));
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ return relax_round;
+}
+
+static bfd_boolean
+nds32_elf_relax_section (bfd *abfd, asection *sec,
+ struct bfd_link_info *link_info, bfd_boolean *again)
+{
+ nds32_elf_blank_t *relax_blank_list = NULL;
+ Elf_Internal_Shdr *symtab_hdr;
+ Elf_Internal_Rela *internal_relocs;
+ Elf_Internal_Rela *irel;
+ Elf_Internal_Rela *irelend;
+ Elf_Internal_Sym *isymbuf = NULL;
+ bfd_byte *contents = NULL;
+ bfd_boolean result = TRUE;
+ int optimize = 0;
+ int opt_size = 0;
+ uint32_t insn;
+ uint16_t insn16;
+
+ /* Target dependnet option. */
+ struct elf_nds32_link_hash_table *table;
+ int load_store_relax;
+ int relax_round;
+
+ relax_blank_list = NULL;
+
+ *again = FALSE;
+
+ /* Nothing to do for
+ * relocatable link or
+ * non-relocatable section or
+ * non-code section or
+ * empty content or
+ * no reloc entry. */
+ if (link_info->relocatable
+ || (sec->flags & SEC_RELOC) == 0
+ || (sec->flags & SEC_EXCLUDE) == 1
+ || (sec->flags & SEC_CODE) == 0
+ || sec->size == 0)
+ return TRUE;
+
+ /* 09.12.11 Workaround. */
+ /* We have to adjust align for R_NDS32_LABEL if needed.
+ The adjust approach only can fix 2-byte align once. */
+ if (sec->alignment_power > 2)
+ return TRUE;
+
+ /* The optimization type to do. */
+
+ table = nds32_elf_hash_table (link_info);
+ relax_round = nds32_elf_pick_relax (TRUE, sec, again, table, link_info);
+ switch (relax_round)
+ {
+ case NDS32_RELAX_JUMP_IFC_ROUND:
+ /* Here is the entrance of ifc jump relaxation. */
+ if (!nds32_elf_ifc_calc (link_info, abfd, sec))
+ return FALSE;
+ nds32_elf_pick_relax (FALSE, sec, again, table, link_info);
+ return TRUE;
+
+ case NDS32_RELAX_EX9_BUILD_ROUND:
+ /* Here is the entrance of ex9 relaxation. There are two pass of
+ ex9 relaxation. The one is to traverse all instructions and build
+ the hash table. The other one is to compare instructions and replace
+ it by ex9.it. */
+ if (!nds32_elf_ex9_build_hash_table (abfd, sec, link_info))
+ return FALSE;
+ nds32_elf_pick_relax (FALSE, sec, again, table, link_info);
+ return TRUE;
+
+ case NDS32_RELAX_EX9_REPLACE_ROUND:
+ if (!nds32_elf_ex9_replace_instruction (link_info, abfd, sec))
+ return FALSE;
+ return TRUE;
+
+ case NDS32_RELAX_EMPTY_ROUND:
+ nds32_elf_pick_relax (FALSE, sec, again, table, link_info);
+ return TRUE;
+
+ case NDS32_RELAX_NORMAL_ROUND:
+ default:
+ if (sec->reloc_count == 0)
+ return TRUE;
+ break;
+ }
+
+ /* The begining of general relaxation. */
+
+ if (is_SDA_BASE_set == 0)
+ {
+ bfd_vma gp;
+ is_SDA_BASE_set = 1;
+ nds32_elf_final_sda_base (sec->output_section->owner, link_info,
+ &gp, FALSE);
+ relax_range_measurement (abfd);
+ }
+
+ if (is_ITB_BASE_set == 0)
+ {
+ /* Set the _ITB_BASE_. */
+ if (!nds32_elf_ex9_itb_base (link_info))
+ {
+ (*_bfd_error_handler) (_("%B: error: Cannot set _ITB_BASE_"), abfd);
+ bfd_set_error (bfd_error_bad_value);
+ }
+ }
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ /* Relocations MUST be kept in memory, because relaxation adjust them. */
+ internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
+ TRUE /* keep_memory */);
+ if (internal_relocs == NULL)
+ goto error_return;
+
+ irelend = internal_relocs + sec->reloc_count;
+ irel = find_relocs_at_address (internal_relocs, internal_relocs,
+ irelend, R_NDS32_RELAX_ENTRY);
+
+ if (irel == irelend)
+ return TRUE;
+
+ if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY)
+ {
+ if (irel->r_addend & R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG)
+ return TRUE;
+
+ if (irel->r_addend & R_NDS32_RELAX_ENTRY_OPTIMIZE_FLAG)
+ optimize = 1;
+
+ if (irel->r_addend & R_NDS32_RELAX_ENTRY_OPTIMIZE_FOR_SPACE_FLAG)
+ opt_size = 1;
+ }
+
+ load_store_relax = table->load_store_relax;
+
+ /* Get symbol table and section content. */
+ if (!nds32_get_section_contents (abfd, sec, &contents)
+ || !nds32_get_local_syms (abfd, sec, &isymbuf))
+ goto error_return;
+
+ /* Do relax loop only when finalize is not done.
+ Take care of relaxable relocs except INSN16. */
+ for (irel = internal_relocs; irel < irelend; irel++)
+ {
+ int seq_len; /* Original length of instruction sequence. */
+ int insn_len = 0; /* Final length of instruction sequence. */
+ bfd_boolean removed;
+
+ insn = 0;
+ if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL
+ && (irel->r_addend & 0x1f) >= 2)
+ optimize = 1;
+
+ /* Relocation Types
+ R_NDS32_LONGCALL1 53
+ R_NDS32_LONGCALL2 54
+ R_NDS32_LONGCALL3 55
+ R_NDS32_LONGJUMP1 56
+ R_NDS32_LONGJUMP2 57
+ R_NDS32_LONGJUMP3 58
+ R_NDS32_LOADSTORE 59 */
+ if (ELF32_R_TYPE (irel->r_info) >= R_NDS32_LONGCALL1
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_LOADSTORE)
+ seq_len = GET_SEQ_LEN (irel->r_addend);
+
+ /* Relocation Types
+ R_NDS32_LONGCALL4 107
+ R_NDS32_LONGCALL5 108
+ R_NDS32_LONGCALL6 109
+ R_NDS32_LONGJUMP4 110
+ R_NDS32_LONGJUMP5 111
+ R_NDS32_LONGJUMP6 112
+ R_NDS32_LONGJUMP7 113 */
+ else if (ELF32_R_TYPE (irel->r_info) >= R_NDS32_LONGCALL4
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_LONGJUMP7)
+ seq_len = 4;
+
+ /* Relocation Types
+ R_NDS32_LO12S0_RELA 30
+ R_NDS32_LO12S1_RELA 29
+ R_NDS32_LO12S2_RELA 28
+ R_NDS32_LO12S2_SP_RELA 71
+ R_NDS32_LO12S2_DP_RELA 70
+ R_NDS32_GOT_LO12 46
+ R_NDS32_GOTOFF_LO12 50
+ R_NDS32_PLTREL_LO12 65
+ R_NDS32_PLT_GOTREL_LO12 67
+ R_NDS32_17IFC_PCREL_RELA 96
+ R_NDS32_GOT_SUFF 193
+ R_NDS32_GOTOFF_SUFF 194
+ R_NDS32_PLT_GOT_SUFF 195
+ R_NDS32_MULCALL_SUFF 196
+ R_NDS32_PTR 197 */
+ else if ((ELF32_R_TYPE (irel->r_info) <= R_NDS32_LO12S0_RELA
+ && ELF32_R_TYPE (irel->r_info) >= R_NDS32_LO12S2_RELA)
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_SP_RELA
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_DP_RELA
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_GOT_LO12
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTOFF_LO12
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTPC_LO12
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_PLTREL_LO12
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_PLT_GOTREL_LO12
+ || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_GOT_SUFF
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_PTR)
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_17IFC_PCREL_RELA
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_TLS_LE_LO12
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_TLS_LE_ADD
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_TLS_LE_LS)
+ seq_len = 0;
+ else
+ continue;
+
+ insn_len = seq_len;
+ removed = FALSE;
+
+ switch (ELF32_R_TYPE (irel->r_info))
+ {
+ case R_NDS32_LONGCALL1:
+ removed = nds32_elf_relax_longcall1 (abfd, sec, irel, internal_relocs,
+ &insn_len, contents, isymbuf,
+ symtab_hdr);
+ break;
+ case R_NDS32_LONGCALL2:
+ removed = nds32_elf_relax_longcall2 (abfd, sec, irel, internal_relocs,
+ &insn_len, contents, isymbuf,
+ symtab_hdr);
+ break;
+ case R_NDS32_LONGCALL3:
+ removed = nds32_elf_relax_longcall3 (abfd, sec, irel, internal_relocs,
+ &insn_len, contents, isymbuf,
+ symtab_hdr);
+ break;
+ case R_NDS32_LONGJUMP1:
+ removed = nds32_elf_relax_longjump1 (abfd, sec, irel, internal_relocs,
+ &insn_len, contents, isymbuf,
+ symtab_hdr);
+ break;
+ case R_NDS32_LONGJUMP2:
+ removed = nds32_elf_relax_longjump2 (abfd, sec, irel, internal_relocs,
+ &insn_len, contents, isymbuf,
+ symtab_hdr);
+ break;
+ case R_NDS32_LONGJUMP3:
+ removed = nds32_elf_relax_longjump3 (abfd, sec, irel, internal_relocs,
+ &insn_len, contents, isymbuf,
+ symtab_hdr);
+ break;
+ case R_NDS32_LONGCALL4:
+ removed = nds32_elf_relax_longcall4 (abfd, sec, irel, internal_relocs,
+ &insn_len, contents, isymbuf,
+ symtab_hdr);
+ break;
+ case R_NDS32_LONGCALL5:
+ removed = nds32_elf_relax_longcall5 (abfd, sec, irel, internal_relocs,
+ &insn_len, contents, isymbuf,
+ symtab_hdr);
+ break;
+ case R_NDS32_LONGCALL6:
+ removed = nds32_elf_relax_longcall6 (abfd, sec, irel, internal_relocs,
+ &insn_len, contents, isymbuf,
+ symtab_hdr);
+ break;
+ case R_NDS32_LONGJUMP4:
+ removed = nds32_elf_relax_longjump4 (abfd, sec, irel, internal_relocs,
+ &insn_len, contents, isymbuf,
+ symtab_hdr);
+ break;
+ case R_NDS32_LONGJUMP5:
+ removed = nds32_elf_relax_longjump5 (abfd, sec, irel, internal_relocs,
+ &insn_len, &seq_len, contents,
+ isymbuf, symtab_hdr);
+ break;
+ case R_NDS32_LONGJUMP6:
+ removed = nds32_elf_relax_longjump6 (abfd, sec, irel, internal_relocs,
+ &insn_len, &seq_len, contents,
+ isymbuf, symtab_hdr);
+ break;
+ case R_NDS32_LONGJUMP7:
+ removed = nds32_elf_relax_longjump7 (abfd, sec, irel, internal_relocs,
+ &insn_len, &seq_len, contents,
+ isymbuf, symtab_hdr);
+ break;
+ case R_NDS32_LOADSTORE:
+ removed = nds32_elf_relax_loadstore (link_info, abfd, sec, irel,
+ internal_relocs, &insn_len,
+ contents, isymbuf, symtab_hdr,
+ load_store_relax);
+ break;
+ case R_NDS32_LO12S0_RELA:
+ case R_NDS32_LO12S1_RELA:
+ case R_NDS32_LO12S2_DP_RELA:
+ case R_NDS32_LO12S2_SP_RELA:
+ case R_NDS32_LO12S2_RELA:
+ /* Relax for low part. */
+ nds32_elf_relax_lo12 (link_info, abfd, sec, irel, internal_relocs,
+ contents, isymbuf, symtab_hdr);
+
+ /* It is impossible to delete blank, so just continue. */
+ continue;
+ case R_NDS32_GOT_LO12:
+ case R_NDS32_GOTOFF_LO12:
+ case R_NDS32_PLTREL_LO12:
+ case R_NDS32_PLT_GOTREL_LO12:
+ case R_NDS32_GOTPC_LO12:
+ /* Relax for PIC gp-relative low part. */
+ nds32_elf_relax_piclo12 (link_info, abfd, sec, irel, contents,
+ isymbuf, symtab_hdr);
+
+ /* It is impossible to delete blank, so just continue. */
+ continue;
+ case R_NDS32_TLS_LE_LO12:
+ /* Relax for LE TLS low part. */
+ nds32_elf_relax_letlslo12 (link_info, abfd, irel, contents,
+ isymbuf, symtab_hdr);
+
+ /* It is impossible to delete blank, so just continue. */
+ continue;
+ case R_NDS32_TLS_LE_ADD:
+ nds32_elf_relax_letlsadd (link_info, abfd, sec, irel, internal_relocs,
+ contents, isymbuf, symtab_hdr, again);
+ /* It is impossible to delete blank, so just continue. */
+ continue;
+ case R_NDS32_TLS_LE_LS:
+ nds32_elf_relax_letlsls (link_info, abfd, sec, irel, internal_relocs,
+ contents, isymbuf, symtab_hdr, again);
+ continue;
+ case R_NDS32_PTR:
+ removed = nds32_elf_relax_ptr (abfd, sec, irel, internal_relocs,
+ &insn_len, &seq_len, contents);
+ break;
+ case R_NDS32_PLT_GOT_SUFF:
+ nds32_elf_relax_pltgot_suff (link_info, abfd, sec, irel,
+ internal_relocs, contents,
+ isymbuf, symtab_hdr, again);
+ /* It is impossible to delete blank, so just continue. */
+ continue;
+ case R_NDS32_GOT_SUFF:
+ nds32_elf_relax_got_suff (link_info, abfd, sec, irel,
+ internal_relocs, contents,
+ symtab_hdr, again);
+ /* It is impossible to delete blank, so just continue. */
+ continue;
+ case R_NDS32_GOTOFF_SUFF:
+ nds32_elf_relax_gotoff_suff (link_info, abfd, sec, irel,
+ internal_relocs, contents,
+ isymbuf, symtab_hdr, again);
+ /* It is impossible to delete blank, so just continue. */
+ continue;
+ default:
+ continue;
+
+ }
+ if (removed && seq_len - insn_len > 0)
+ {
+ if (!insert_nds32_elf_blank
+ (&relax_blank_list, irel->r_offset + insn_len,
+ seq_len - insn_len))
+ goto error_return;
+ *again = TRUE;
+ }
+ }
+
+ calc_nds32_blank_total (relax_blank_list);
+
+ if (table->relax_fp_as_gp)
+ {
+ if (!nds32_relax_fp_as_gp (link_info, abfd, sec, internal_relocs,
+ irelend, isymbuf))
+ goto error_return;
+
+ if (*again == FALSE)
+ {
+ if (!nds32_fag_remove_unused_fpbase (abfd, sec, internal_relocs,
+ irelend))
+ goto error_return;
+ }
+ }
+
+ nds32_elf_pick_relax (FALSE, sec, again, table, link_info);
+
+ if (*again == FALSE)
+ {
+ if (!nds32_relax_adjust_label (abfd, sec, internal_relocs, contents,
+ &relax_blank_list, optimize, opt_size))
+ goto error_return;
+ }
+
+ /* It doesn't matter optimize_for_space_no_align anymore.
+ If object file is assembled with flag '-Os',
+ the we don't adjust jump-destination on 4-byte boundary. */
+
+ if (relax_blank_list)
+ {
+ nds32_elf_relax_delete_blanks (abfd, sec, relax_blank_list);
+ relax_blank_list = NULL;
+ }
+
+ if (*again == FALSE)
+ {
+ /* Closing the section, so we don't relax it anymore. */
+ bfd_vma sec_size_align;
+ Elf_Internal_Rela *tmp_rel;
+
+ /* Pad to alignment boundary. Only handle current section alignment. */
+ sec_size_align = (sec->size + (~((-1) << sec->alignment_power)))
+ & ((-1) << sec->alignment_power);
+ if ((sec_size_align - sec->size) & 0x2)
+ {
+ insn16 = NDS32_NOP16;
+ bfd_putb16 (insn16, contents + sec->size);
+ sec->size += 2;
+ }
+
+ while (sec_size_align != sec->size)
+ {
+ insn = NDS32_NOP32;
+ bfd_putb32 (insn, contents + sec->size);
+ sec->size += 4;
+ }
+
+ tmp_rel = find_relocs_at_address (internal_relocs, internal_relocs,
+ irelend, R_NDS32_RELAX_ENTRY);
+ if (tmp_rel != irelend)
+ tmp_rel->r_addend |= R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG;
+
+ clean_nds32_elf_blank ();
+ }
+
+finish:
+ if (internal_relocs != NULL
+ && elf_section_data (sec)->relocs != internal_relocs)
+ free (internal_relocs);
+
+ if (contents != NULL
+ && elf_section_data (sec)->this_hdr.contents != contents)
+ free (contents);
+
+ if (isymbuf != NULL && symtab_hdr->contents != (bfd_byte *) isymbuf)
+ free (isymbuf);
+
+ return result;
+
+error_return:
+ result = FALSE;
+ goto finish;
+}
+
+static struct bfd_elf_special_section const nds32_elf_special_sections[] =
+{
+ {".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE},
+ {".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE},
+ {NULL, 0, 0, 0, 0}
+};
+
+static bfd_boolean
+nds32_elf_output_arch_syms (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info,
+ void *finfo ATTRIBUTE_UNUSED,
+ bfd_boolean (*func) (void *, const char *,
+ Elf_Internal_Sym *,
+ asection *,
+ struct elf_link_hash_entry *)
+ ATTRIBUTE_UNUSED)
+{
+ FILE *sym_ld_script = NULL;
+ struct elf_nds32_link_hash_table *table;
+
+ table = nds32_elf_hash_table (info);
+ sym_ld_script = table->sym_ld_script;
+
+ if (check_start_export_sym)
+ fprintf (sym_ld_script, "}\n");
+
+ return TRUE;
+}
+
+static enum elf_reloc_type_class
+nds32_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ const asection *rel_sec ATTRIBUTE_UNUSED,
+ const Elf_Internal_Rela *rela)
+{
+ switch ((int) ELF32_R_TYPE (rela->r_info))
+ {
+ case R_NDS32_RELATIVE:
+ return reloc_class_relative;
+ case R_NDS32_JMP_SLOT:
+ return reloc_class_plt;
+ case R_NDS32_COPY:
+ return reloc_class_copy;
+ default:
+ return reloc_class_normal;
+ }
+}
+
+/* Put target dependent option into info hash table. */
+void
+bfd_elf32_nds32_set_target_option (struct bfd_link_info *link_info,
+ int relax_fp_as_gp,
+ int eliminate_gc_relocs,
+ FILE * sym_ld_script, int load_store_relax,
+ int target_optimize, int relax_status,
+ int relax_round, FILE * ex9_export_file,
+ FILE * ex9_import_file,
+ int update_ex9_table, int ex9_limit,
+ bfd_boolean ex9_loop_aware,
+ bfd_boolean ifc_loop_aware)
+{
+ struct elf_nds32_link_hash_table *table;
+
+ table = nds32_elf_hash_table (link_info);
+ if (table == NULL)
+ return;
+
+ table->relax_fp_as_gp = relax_fp_as_gp;
+ table->eliminate_gc_relocs = eliminate_gc_relocs;
+ table->sym_ld_script = sym_ld_script;
+ table ->load_store_relax = load_store_relax;
+ table->target_optimize = target_optimize;
+ table->relax_status = relax_status;
+ table->relax_round = relax_round;
+ table->ex9_export_file = ex9_export_file;
+ table->ex9_import_file = ex9_import_file;
+ table->update_ex9_table = update_ex9_table;
+ table->ex9_limit = ex9_limit;
+ table->ex9_loop_aware = ex9_loop_aware;
+ table->ifc_loop_aware = ifc_loop_aware;
+}
+
+/* These functions and data-structures are used for fp-as-gp
+ optimization. */
+
+#define FAG_THRESHOLD 3 /* At least 3 gp-access. */
+/* lwi37.fp covers 508 bytes, but there may be 32-byte padding between
+ the read-only section and read-write section. */
+#define FAG_WINDOW (508 - 32)
+
+/* An nds32_fag represent a gp-relative access.
+ We find best fp-base by using a sliding window
+ to find a base address which can cover most gp-access. */
+struct nds32_fag
+{
+ struct nds32_fag *next; /* NULL-teminated linked list. */
+ bfd_vma addr; /* The address of this fag. */
+ Elf_Internal_Rela **relas; /* The relocations associated with this fag.
+ It is used for applying FP7U2_FLAG. */
+ int count; /* How many times this address is referred.
+ There should be exactly `count' relocations
+ in relas. */
+ int relas_capcity; /* The buffer size of relas.
+ We use an array instead of linked-list,
+ and realloc is used to adjust buffer size. */
+};
+
+static void
+nds32_fag_init (struct nds32_fag *head)
+{
+ memset (head, 0, sizeof (struct nds32_fag));
+}
+
+static void
+nds32_fag_verify (struct nds32_fag *head)
+{
+ struct nds32_fag *iter;
+ struct nds32_fag *prev;
+
+ prev = NULL;
+ iter = head->next;
+ while (iter)
+ {
+ if (prev && prev->addr >= iter->addr)
+ puts ("Bug in fp-as-gp insertion.");
+ prev = iter;
+ iter = iter->next;
+ }
+}
+
+/* Insert a fag in ascending order.
+ If a fag of the same address already exists,
+ they are chained by relas array. */
+
+static void
+nds32_fag_insert (struct nds32_fag *head, bfd_vma addr,
+ Elf_Internal_Rela * rel)
+{
+ struct nds32_fag *iter;
+ struct nds32_fag *new_fag;
+ const int INIT_RELAS_CAP = 4;
+
+ for (iter = head;
+ iter->next && iter->next->addr <= addr;
+ iter = iter->next)
+ /* Find somewhere to insert. */ ;
+
+ /* `iter' will be equal to `head' if the list is empty. */
+ if (iter != head && iter->addr == addr)
+ {
+ /* The address exists in the list.
+ Insert `rel' into relocation list, relas. */
+
+ /* Check whether relas is big enough. */
+ if (iter->count >= iter->relas_capcity)
+ {
+ iter->relas_capcity *= 2;
+ iter->relas = bfd_realloc
+ (iter->relas, iter->relas_capcity * sizeof (void *));
+ }
+ iter->relas[iter->count++] = rel;
+ return;
+ }
+
+ /* This is a new address. Create a fag node for it. */
+ new_fag = bfd_malloc (sizeof (struct nds32_fag));
+ memset (new_fag, 0, sizeof (*new_fag));
+ new_fag->addr = addr;
+ new_fag->count = 1;
+ new_fag->next = iter->next;
+ new_fag->relas_capcity = INIT_RELAS_CAP;
+ new_fag->relas = (Elf_Internal_Rela **)
+ bfd_malloc (new_fag->relas_capcity * sizeof (void *));
+ new_fag->relas[0] = rel;
+ iter->next = new_fag;
+
+ nds32_fag_verify (head);
+}
+
+static void
+nds32_fag_free_list (struct nds32_fag *head)
+{
+ struct nds32_fag *iter;
+
+ iter = head->next;
+ while (iter)
+ {
+ struct nds32_fag *tmp = iter;
+ iter = iter->next;
+ free (tmp->relas);
+ tmp->relas = NULL;
+ free (tmp);
+ }
+}
+
+/* Find the best fp-base address.
+ The relocation associated with that address is returned,
+ so we can track the symbol instead of a fixed address.
+
+ When relaxation, the address of an datum may change,
+ because a text section is shrinked, so the data section
+ moves forward. If the aligments of text and data section
+ are different, their distance may change too.
+ Therefore, tracking a fixed address is not appriate. */
+
+static int
+nds32_fag_find_base (struct nds32_fag *head, struct nds32_fag **bestpp)
+{
+ struct nds32_fag *base; /* First fag in the window. */
+ struct nds32_fag *last; /* First fag outside the window. */
+ int accu = 0; /* Usage accumulation. */
+ struct nds32_fag *best; /* Best fag. */
+ int baccu = 0; /* Best accumulation. */
+
+ /* Use first fag for initial, and find the last fag in the window.
+
+ In each iteration, we could simply subtract previous fag
+ and accumulate following fags which are inside the window,
+ untill we each the end. */
+
+ if (head->next == NULL)
+ {
+ *bestpp = NULL;
+ return 0;
+ }
+
+ /* Initialize base. */
+ base = head->next;
+ best = base;
+ for (last = base;
+ last && last->addr < base->addr + FAG_WINDOW;
+ last = last->next)
+ accu += last->count;
+
+ baccu = accu;
+
+ /* Record the best base in each iteration. */
+ while (base->next)
+ {
+ accu -= base->count;
+ base = base->next;
+ /* Account fags in window. */
+ for (/* Nothing. */;
+ last && last->addr < base->addr + FAG_WINDOW;
+ last = last->next)
+ accu += last->count;
+
+ /* A better fp-base? */
+ if (accu > baccu)
+ {
+ best = base;
+ baccu = accu;
+ }
+ }
+
+ if (bestpp)
+ *bestpp = best;
+ return baccu;
+}
+
+/* Apply R_NDS32_INSN16_FP7U2_FLAG on gp-relative accesses,
+ so we can convert it fo fp-relative access later.
+ `best_fag' is the best fp-base. Only those inside the window
+ of best_fag is applied the flag. */
+
+static bfd_boolean
+nds32_fag_mark_relax (struct bfd_link_info *link_info,
+ bfd *abfd, struct nds32_fag *best_fag,
+ Elf_Internal_Rela *internal_relocs,
+ Elf_Internal_Rela *irelend)
+{
+ struct nds32_fag *ifag;
+ bfd_vma best_fpbase, gp;
+ bfd *output_bfd;
+
+ output_bfd = abfd->sections->output_section->owner;
+ nds32_elf_final_sda_base (output_bfd, link_info, &gp, FALSE);
+ best_fpbase = best_fag->addr;
+
+ if (best_fpbase > gp + sdata_range[1][1]
+ || best_fpbase < gp - sdata_range[1][0])
+ return FALSE;
+
+ /* Mark these inside the window R_NDS32_INSN16_FP7U2_FLAG flag,
+ so we know they can be converted to lwi37.fp. */
+ for (ifag = best_fag;
+ ifag && ifag->addr < best_fpbase + FAG_WINDOW; ifag = ifag->next)
+ {
+ int i;
+
+ for (i = 0; i < ifag->count; i++)
+ {
+ Elf_Internal_Rela *insn16_rel;
+ Elf_Internal_Rela *fag_rel;
+
+ fag_rel = ifag->relas[i];
+
+ /* Only if this is within the WINDOWS, FP7U2_FLAG
+ is applied. */
+
+ insn16_rel = find_relocs_at_address
+ (fag_rel, internal_relocs, irelend, R_NDS32_INSN16);
+
+ if (insn16_rel != irelend)
+ insn16_rel->r_addend = R_NDS32_INSN16_FP7U2_FLAG;
+ }
+ }
+ return TRUE;
+}
+
+/* Reset INSN16 to clean fp as gp. */
+
+static void
+nds32_fag_unmark_relax (struct nds32_fag *fag,
+ Elf_Internal_Rela *internal_relocs,
+ Elf_Internal_Rela *irelend)
+{
+ struct nds32_fag *ifag;
+ int i;
+ Elf_Internal_Rela *insn16_rel;
+ Elf_Internal_Rela *fag_rel;
+
+ for (ifag = fag; ifag; ifag = ifag->next)
+ {
+ for (i = 0; i < ifag->count; i++)
+ {
+ fag_rel = ifag->relas[i];
+
+ /* Restore the INSN16 relocation. */
+ insn16_rel = find_relocs_at_address
+ (fag_rel, internal_relocs, irelend, R_NDS32_INSN16);
+
+ if (insn16_rel != irelend)
+ insn16_rel->r_addend &= ~R_NDS32_INSN16_FP7U2_FLAG;
+ }
+ }
+}
+
+/* This is the main function of fp-as-gp optimization.
+ It should be called by relax_section. */
+
+static bfd_boolean
+nds32_relax_fp_as_gp (struct bfd_link_info *link_info,
+ bfd *abfd, asection *sec,
+ Elf_Internal_Rela *internal_relocs,
+ Elf_Internal_Rela *irelend,
+ Elf_Internal_Sym *isymbuf)
+{
+ Elf_Internal_Rela *begin_rel = NULL;
+ Elf_Internal_Rela *irel;
+ struct nds32_fag fag_head;
+ Elf_Internal_Shdr *symtab_hdr;
+ bfd_byte *contents;
+ bfd_boolean ifc_inside = FALSE;
+
+ /* FIXME: Can we bfd_elf_link_read_relocs for the relocs? */
+
+ /* Per-function fp-base selection.
+ 1. Create a list for all the gp-relative access.
+ 2. Base on those gp-relative address,
+ find a fp-base which can cover most access.
+ 3. Use the fp-base for fp-as-gp relaxation.
+
+ NOTE: If fp-as-gp is not worth to do, (e.g., less than 3 times),
+ we should
+ 1. delete the `la $fp, _FP_BASE_' instruction and
+ 2. not convert lwi.gp to lwi37.fp.
+
+ To delete the _FP_BASE_ instruction, we simply apply
+ R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG flag in the r_addend to disable it.
+
+ To suppress the conversion, we simply NOT to apply
+ R_NDS32_INSN16_FP7U2_FLAG flag. */
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+
+ if (!nds32_get_section_contents (abfd, sec, &contents)
+ || !nds32_get_local_syms (abfd, sec, &isymbuf))
+ return FALSE;
+
+ /* Check whether it is worth for fp-as-gp optimization,
+ i.e., at least 3 gp-load.
+
+ Set R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG if we should NOT
+ apply this optimization. */
+
+ for (irel = internal_relocs; irel < irelend; irel++)
+ {
+ /* We recognize R_NDS32_RELAX_REGION_BEGIN/_END for the region.
+ One we enter the begin of the region, we track all the LW/ST
+ instructions, so when we leave the region, we try to find
+ the best fp-base address for those LW/ST instructions. */
+
+ if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_BEGIN
+ && (irel->r_addend & R_NDS32_RELAX_REGION_OMIT_FP_FLAG))
+ {
+ /* Begin of the region. */
+ if (begin_rel)
+ (*_bfd_error_handler) (_("%B: Nested OMIT_FP in %A."), abfd, sec);
+
+ begin_rel = irel;
+ nds32_fag_init (&fag_head);
+ ifc_inside = FALSE;
+ }
+ else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_END
+ && (irel->r_addend & R_NDS32_RELAX_REGION_OMIT_FP_FLAG))
+ {
+ int accu;
+ struct nds32_fag *best_fag, *tmp_fag;
+ int dist;
+
+ /* End of the region.
+ Check whether it is worth to do fp-as-gp. */
+
+ if (begin_rel == NULL)
+ {
+ (*_bfd_error_handler) (_("%B: Unmatched OMIT_FP in %A."), abfd, sec);
+ continue;
+ }
+
+ accu = nds32_fag_find_base (&fag_head, &best_fag);
+
+ /* Clean FP7U2_FLAG because they may set ever. */
+ tmp_fag = fag_head.next;
+ nds32_fag_unmark_relax (tmp_fag, internal_relocs, irelend);
+
+ /* Check if it is worth, and FP_BASE is near enough to SDA_BASE. */
+ if (accu < FAG_THRESHOLD
+ || !nds32_fag_mark_relax (link_info, abfd, best_fag,
+ internal_relocs, irelend))
+ {
+ /* Not worth to do fp-as-gp. */
+ begin_rel->r_addend |= R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG;
+ begin_rel->r_addend &= ~R_NDS32_RELAX_REGION_OMIT_FP_FLAG;
+ irel->r_addend |= R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG;
+ irel->r_addend &= ~R_NDS32_RELAX_REGION_OMIT_FP_FLAG;
+ nds32_fag_free_list (&fag_head);
+ begin_rel = NULL;
+ continue;
+ }
+
+ /* R_SYM of R_NDS32_RELAX_REGION_BEGIN is not used by assembler,
+ so we use it to record the distance to the reloction of best
+ fp-base. */
+ dist = best_fag->relas[0] - begin_rel;
+ BFD_ASSERT (dist > 0 && dist < 0xffffff);
+ /* Use high 16 bits of addend to record the _FP_BASE_ matched
+ relocation. And get the base value when relocating. */
+ begin_rel->r_addend &= (0x1 << 16) - 1;
+ begin_rel->r_addend |= dist << 16;
+
+ nds32_fag_free_list (&fag_head);
+ begin_rel = NULL;
+ }
+
+ if (begin_rel == NULL || ifc_inside)
+ /* Skip if we are not in the region of fp-as-gp. */
+ continue;
+
+ if (ELF32_R_TYPE (irel->r_info) == R_NDS32_SDA15S2_RELA
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_SDA17S2_RELA)
+ {
+ bfd_vma addr;
+ uint32_t insn;
+
+ /* A gp-relative access is found. Insert it to the fag-list. */
+
+ /* Rt is necessary an RT3, so it can be converted to lwi37.fp. */
+ insn = bfd_getb32 (contents + irel->r_offset);
+ if (!N32_IS_RT3 (insn))
+ continue;
+
+ addr = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr);
+ nds32_fag_insert (&fag_head, addr, irel);
+ }
+ else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_SDA_FP7U2_RELA)
+ {
+ begin_rel = NULL;
+ }
+ else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_17IFC_PCREL_RELA
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_10IFCU_PCREL_RELA)
+ {
+ /* Suppress fp as gp when encounter ifc. */
+ ifc_inside = TRUE;
+ }
+ }
+
+ return TRUE;
+}
+
+/* Remove unused `la $fp, _FD_BASE_' instruction. */
+
+static bfd_boolean
+nds32_fag_remove_unused_fpbase (bfd *abfd, asection *sec,
+ Elf_Internal_Rela *internal_relocs,
+ Elf_Internal_Rela *irelend)
+{
+ Elf_Internal_Rela *irel;
+ Elf_Internal_Shdr *symtab_hdr;
+ bfd_byte *contents = NULL;
+ nds32_elf_blank_t *relax_blank_list = NULL;
+ bfd_boolean result = TRUE;
+ bfd_boolean unused_region = FALSE;
+
+ /*
+ NOTE: Disable fp-as-gp if we encounter ifcall relocations.
+ * R_NDS32_17IFC_PCREL_RELA
+ * R_NDS32_10IFCU_PCREL_RELA
+
+ CASE??????????????
+ */
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ nds32_get_section_contents (abfd, sec, &contents);
+
+ for (irel = internal_relocs; irel < irelend; irel++)
+ {
+ /* To remove unused fp-base, we simply find the REGION_NOT_OMIT_FP
+ we marked to in previous pass.
+ DO NOT scan relocations again, since we've alreadly decided it
+ and set the flag. */
+ const char *syname;
+ int syndx;
+ uint32_t insn;
+
+ if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_BEGIN
+ && (irel->r_addend & R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG))
+ unused_region = TRUE;
+ else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_END
+ && (irel->r_addend & R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG))
+ unused_region = FALSE;
+
+ /* We're not in the region. */
+ if (!unused_region)
+ continue;
+
+ /* _FP_BASE_ must be a GLOBAL symbol. */
+ syndx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
+ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
+ continue;
+
+ /* The symbol name must be _FP_BASE_. */
+ syname = elf_sym_hashes (abfd)[syndx]->root.root.string;
+ if (strcmp (syname, FP_BASE_NAME) != 0)
+ continue;
+
+ if (ELF32_R_TYPE (irel->r_info) == R_NDS32_SDA19S0_RELA)
+ {
+ /* addi.gp $fp, -256 */
+ insn = bfd_getb32 (contents + irel->r_offset);
+ if (insn != INSN_ADDIGP_TO_FP)
+ continue;
+ }
+ else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_SDA15S0_RELA)
+ {
+ /* addi $fp, $gp, -256 */
+ insn = bfd_getb32 (contents + irel->r_offset);
+ if (insn != INSN_ADDI_GP_TO_FP)
+ continue;
+ }
+ else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_20_RELA)
+ {
+ /* movi $fp, FP_BASE */
+ insn = bfd_getb32 (contents + irel->r_offset);
+ if (insn != INSN_MOVI_TO_FP)
+ continue;
+ }
+ else
+ continue;
+
+ /* We got here because a FP_BASE instruction is found. */
+ if (!insert_nds32_elf_blank_recalc_total
+ (&relax_blank_list, irel->r_offset, 4))
+ goto error_return;
+ }
+
+finish:
+ if (relax_blank_list)
+ {
+ nds32_elf_relax_delete_blanks (abfd, sec, relax_blank_list);
+ relax_blank_list = NULL;
+ }
+ return result;
+
+error_return:
+ result = FALSE;
+ goto finish;
+}
+
+/* This is a version of bfd_generic_get_relocated_section_contents.
+ We need this variety because relaxation will modify the dwarf
+ infomation. When there is undefined symbol reference error mesage,
+ linker need to dump line number where the symbol be used. However
+ the address is be relaxed, it can not get the original dwarf contents.
+ The variety only modify function call for reading in the section. */
+
+static bfd_byte *
+nds32_elf_get_relocated_section_contents (bfd *abfd,
+ struct bfd_link_info *link_info,
+ struct bfd_link_order *link_order,
+ bfd_byte *data,
+ bfd_boolean relocatable,
+ asymbol **symbols)
+{
+ bfd *input_bfd = link_order->u.indirect.section->owner;
+ asection *input_section = link_order->u.indirect.section;
+ long reloc_size;
+ arelent **reloc_vector;
+ long reloc_count;
+
+ reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
+ if (reloc_size < 0)
+ return NULL;
+
+ /* Read in the section. */
+ if (!nds32_get_section_contents (input_bfd, input_section, &data))
+ return NULL;
+
+ if (reloc_size == 0)
+ return data;
+
+ reloc_vector = (arelent **) bfd_malloc (reloc_size);
+ if (reloc_vector == NULL)
+ return NULL;
+
+ reloc_count = bfd_canonicalize_reloc (input_bfd, input_section,
+ reloc_vector, symbols);
+ if (reloc_count < 0)
+ goto error_return;
+
+ if (reloc_count > 0)
+ {
+ arelent **parent;
+ for (parent = reloc_vector; *parent != NULL; parent++)
+ {
+ char *error_message = NULL;
+ asymbol *symbol;
+ bfd_reloc_status_type r;
+
+ symbol = *(*parent)->sym_ptr_ptr;
+ if (symbol->section && discarded_section (symbol->section))
+ {
+ bfd_byte *p;
+ static reloc_howto_type none_howto
+ = HOWTO (0, 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL,
+ "unused", FALSE, 0, 0, FALSE);
+
+ p = data + (*parent)->address * bfd_octets_per_byte (input_bfd);
+ _bfd_clear_contents ((*parent)->howto, input_bfd, input_section,
+ p);
+ (*parent)->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
+ (*parent)->addend = 0;
+ (*parent)->howto = &none_howto;
+ r = bfd_reloc_ok;
+ }
+ else
+ r = bfd_perform_relocation (input_bfd, *parent, data,
+ input_section,
+ relocatable ? abfd : NULL,
+ &error_message);
+
+ if (relocatable)
+ {
+ asection *os = input_section->output_section;
+
+ /* A partial link, so keep the relocs. */
+ os->orelocation[os->reloc_count] = *parent;
+ os->reloc_count++;
+ }
+
+ if (r != bfd_reloc_ok)
+ {
+ switch (r)
+ {
+ case bfd_reloc_undefined:
+ if (!((*link_info->callbacks->undefined_symbol)
+ (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
+ input_bfd, input_section, (*parent)->address, TRUE)))
+ goto error_return;
+ break;
+ case bfd_reloc_dangerous:
+ BFD_ASSERT (error_message != NULL);
+ if (!((*link_info->callbacks->reloc_dangerous)
+ (link_info, error_message, input_bfd, input_section,
+ (*parent)->address)))
+ goto error_return;
+ break;
+ case bfd_reloc_overflow:
+ if (!((*link_info->callbacks->reloc_overflow)
+ (link_info, NULL,
+ bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
+ (*parent)->howto->name, (*parent)->addend,
+ input_bfd, input_section, (*parent)->address)))
+ goto error_return;
+ break;
+ case bfd_reloc_outofrange:
+ /* PR ld/13730:
+ This error can result when processing some partially
+ complete binaries. Do not abort, but issue an error
+ message instead. */
+ link_info->callbacks->einfo
+ (_("%X%P: %B(%A): relocation \"%R\" goes out of range\n"),
+ abfd, input_section, * parent);
+ goto error_return;
+
+ default:
+ abort ();
+ break;
+ }
+ }
+ }
+ }
+
+ free (reloc_vector);
+ return data;
+
+error_return:
+ free (reloc_vector);
+ return NULL;
+}
+
+/* Link-time IFC relaxation.
+ In this optimization, we chains jump instructions
+ of the same destination with ifcall. */
+
+
+/* List to save jal and j relocation. */
+struct elf_nds32_ifc_symbol_entry
+{
+ asection *sec;
+ struct elf_link_hash_entry *h;
+ struct elf_nds32_ifc_irel_list *irel_head;
+ unsigned long insn;
+ int times;
+ int enable; /* Apply ifc. */
+ int ex9_enable; /* Apply ifc after ex9. */
+ struct elf_nds32_ifc_symbol_entry *next;
+};
+
+struct elf_nds32_ifc_irel_list
+{
+ Elf_Internal_Rela *irel;
+ asection *sec;
+ bfd_vma addr;
+ /* If this is set, then it is the last instruction for
+ ifc-chain, so it must be keep for the actual branching. */
+ int keep;
+ struct elf_nds32_ifc_irel_list *next;
+};
+
+static struct elf_nds32_ifc_symbol_entry *ifc_symbol_head = NULL;
+
+/* Insert symbol of jal and j for ifc. */
+
+static void
+nds32_elf_ifc_insert_symbol (asection *sec,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Rela *irel,
+ unsigned long insn)
+{
+ struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head;
+
+ /* Check there is target of existing entry the same as the new one. */
+ while (ptr != NULL)
+ {
+ if (((h == NULL && ptr->sec == sec
+ && ELF32_R_SYM (ptr->irel_head->irel->r_info) == ELF32_R_SYM (irel->r_info)
+ && ptr->irel_head->irel->r_addend == irel->r_addend)
+ || h != NULL)
+ && ptr->h == h
+ && ptr->insn == insn)
+ {
+ /* The same target exist, so insert into list. */
+ struct elf_nds32_ifc_irel_list *irel_list = ptr->irel_head;
+
+ while (irel_list->next != NULL)
+ irel_list = irel_list->next;
+ irel_list->next = bfd_malloc (sizeof (struct elf_nds32_ifc_irel_list));
+ irel_list = irel_list->next;
+ irel_list->irel = irel;
+ irel_list->keep = 1;
+
+ if (h == NULL)
+ irel_list->sec = NULL;
+ else
+ irel_list->sec = sec;
+ irel_list->next = NULL;
+ return;
+ }
+ if (ptr->next == NULL)
+ break;
+ ptr = ptr->next;
+ }
+
+ /* There is no same target entry, so build a new one. */
+ if (ifc_symbol_head == NULL)
+ {
+ ifc_symbol_head = bfd_malloc (sizeof (struct elf_nds32_ifc_symbol_entry));
+ ptr = ifc_symbol_head;
+ }
+ else
+ {
+ ptr->next = bfd_malloc (sizeof (struct elf_nds32_ifc_symbol_entry));
+ ptr = ptr->next;
+ }
+
+ ptr->h = h;
+ ptr->irel_head = bfd_malloc (sizeof (struct elf_nds32_ifc_irel_list));
+ ptr->irel_head->irel = irel;
+ ptr->insn = insn;
+ ptr->irel_head->keep = 1;
+
+ if (h == NULL)
+ {
+ /* Local symbols. */
+ ptr->sec = sec;
+ ptr->irel_head->sec = NULL;
+ }
+ else
+ {
+ /* Global symbol. */
+ ptr->sec = NULL;
+ ptr->irel_head->sec = sec;
+ }
+
+ ptr->irel_head->next = NULL;
+ ptr->times = 0;
+ ptr->enable = 0;
+ ptr->ex9_enable = 0;
+ ptr->next = NULL;
+}
+
+/* Gather all jal and j instructions. */
+
+static bfd_boolean
+nds32_elf_ifc_calc (struct bfd_link_info *info,
+ bfd *abfd, asection *sec)
+{
+ Elf_Internal_Rela *internal_relocs;
+ Elf_Internal_Rela *irelend;
+ Elf_Internal_Rela *irel;
+ Elf_Internal_Shdr *symtab_hdr;
+ bfd_byte *contents = NULL;
+ uint32_t insn, insn_with_reg;
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h;
+ struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd);
+ struct elf_nds32_link_hash_table *table;
+ bfd_boolean ifc_loop_aware;
+
+ internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
+ TRUE /* keep_memory */);
+ irelend = internal_relocs + sec->reloc_count;
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+
+ /* Check if the object enable ifc. */
+ irel = find_relocs_at_address (internal_relocs, internal_relocs, irelend,
+ R_NDS32_RELAX_ENTRY);
+
+ if (irel == NULL
+ || irel >= irelend
+ || ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_ENTRY
+ || (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY
+ && !(irel->r_addend & R_NDS32_RELAX_ENTRY_IFC_FLAG)))
+ return TRUE;
+
+ if (!nds32_get_section_contents (abfd, sec, &contents))
+ return FALSE;
+
+ table = nds32_elf_hash_table (info);
+ ifc_loop_aware = table->ifc_loop_aware;
+ while (irel != NULL && irel < irelend)
+ {
+ /* Traverse all relocation and gather all of them to build the list. */
+
+ if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_BEGIN)
+ {
+ if (ifc_loop_aware == 1
+ && (irel->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG) != 0)
+ {
+ /* Check the region if loop or not. If it is true and
+ ifc-loop-aware is true, ignore the region till region end. */
+ while (irel != NULL
+ && irel < irelend
+ && (ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_REGION_END
+ || (irel->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG) != 0))
+ irel++;
+ }
+ }
+
+ if (ELF32_R_TYPE (irel->r_info) == R_NDS32_25_PCREL_RELA)
+ {
+ insn = bfd_getb32 (contents + irel->r_offset);
+ nds32_elf_get_insn_with_reg (irel, insn, &insn_with_reg);
+ r_symndx = ELF32_R_SYM (irel->r_info);
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ /* Local symbol. */
+ nds32_elf_ifc_insert_symbol (sec, NULL, irel, insn_with_reg);
+ }
+ else
+ {
+ /* External symbol. */
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ nds32_elf_ifc_insert_symbol (sec, h, irel, insn_with_reg);
+ }
+ }
+ irel++;
+ }
+ return TRUE;
+}
+
+/* Determine whether j and jal should be substituted. */
+
+static void
+nds32_elf_ifc_filter (struct bfd_link_info *info)
+{
+ struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head;
+ struct elf_nds32_ifc_irel_list *irel_ptr = NULL;
+ struct elf_nds32_ifc_irel_list *irel_keeper = NULL;
+ struct elf_nds32_link_hash_table *table;
+ int target_optimize;
+ bfd_vma address;
+
+ table = nds32_elf_hash_table (info);
+ target_optimize = table->target_optimize;
+ while (ptr)
+ {
+ irel_ptr = ptr->irel_head;
+ if (ptr->h == NULL)
+ {
+ /* Local symbol. */
+ irel_keeper = irel_ptr;
+ while (irel_ptr && irel_ptr->next)
+ {
+ /* Check there is jump target can be used. */
+ if ((irel_ptr->next->irel->r_offset
+ - irel_keeper->irel->r_offset) > 1022)
+ irel_keeper = irel_ptr->next;
+ else
+ {
+ ptr->enable = 1;
+ irel_ptr->keep = 0;
+ }
+ irel_ptr = irel_ptr->next;
+ }
+ }
+ else
+ {
+ /* Global symbol. */
+ /* We have to get the absolute address and decide
+ whether to keep it or not. */
+ while (irel_ptr)
+ {
+ address = (irel_ptr->irel->r_offset
+ + irel_ptr->sec->output_section->vma
+ + irel_ptr->sec->output_offset);
+ irel_ptr->addr = address;
+ irel_ptr = irel_ptr->next;
+ }
+
+ irel_ptr = ptr->irel_head;
+ while (irel_ptr)
+ {
+ /* Sort by address. */
+ struct elf_nds32_ifc_irel_list *irel_dest = irel_ptr;
+ struct elf_nds32_ifc_irel_list *irel_temp = irel_ptr;
+ struct elf_nds32_ifc_irel_list *irel_ptr_prev = NULL;
+ struct elf_nds32_ifc_irel_list *irel_dest_prev = NULL;
+
+ /* Get the smallest one. */
+ while (irel_temp->next)
+ {
+ if (irel_temp->next->addr < irel_dest->addr)
+ {
+ irel_dest_prev = irel_temp;
+ irel_dest = irel_temp->next;
+ }
+ irel_temp = irel_temp->next;
+ }
+
+ if (irel_dest != irel_ptr)
+ {
+ if (irel_ptr_prev)
+ irel_ptr_prev->next = irel_dest;
+ if (irel_dest_prev)
+ irel_dest_prev->next = irel_ptr;
+ irel_temp = irel_ptr->next;
+ irel_ptr->next = irel_dest->next;
+ irel_dest->next = irel_temp;
+ }
+ irel_ptr_prev = irel_ptr;
+ irel_ptr = irel_ptr->next;
+ }
+
+ irel_ptr = ptr->irel_head;
+ irel_keeper = irel_ptr;
+ while (irel_ptr && irel_ptr->next)
+ {
+ if ((irel_ptr->next->addr - irel_keeper->addr) > 1022)
+ irel_keeper = irel_ptr->next;
+ else
+ {
+ ptr->enable = 1;
+ irel_ptr->keep = 0;
+ }
+ irel_ptr = irel_ptr->next;
+ }
+ }
+
+ /* Ex9 enable. Reserve it for ex9. */
+ if ((target_optimize & NDS32_RELAX_EX9_ON)
+ && ptr->irel_head != irel_keeper)
+ ptr->enable = 0;
+ ptr = ptr->next;
+ }
+}
+
+/* Determine whether j and jal should be substituted after ex9 done. */
+
+static void
+nds32_elf_ifc_filter_after_ex9 (void)
+{
+ struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head;
+ struct elf_nds32_ifc_irel_list *irel_ptr = NULL;
+
+ while (ptr)
+ {
+ if (ptr->enable == 0)
+ {
+ /* Check whether ifc is applied or not. */
+ irel_ptr = ptr->irel_head;
+ ptr->ex9_enable = 1;
+ while (irel_ptr)
+ {
+ if (ELF32_R_TYPE (irel_ptr->irel->r_info) == R_NDS32_TRAN)
+ {
+ /* Ex9 already. */
+ ptr->ex9_enable = 0;
+ break;
+ }
+ irel_ptr = irel_ptr->next;
+ }
+ }
+ ptr = ptr->next;
+ }
+}
+
+/* Wrapper to do ifc relaxation. */
+
+bfd_boolean
+nds32_elf_ifc_finish (struct bfd_link_info *info)
+{
+ int relax_status;
+ struct elf_nds32_link_hash_table *table;
+
+ table = nds32_elf_hash_table (info);
+ relax_status = table->relax_status;
+
+ if (!(relax_status & NDS32_RELAX_JUMP_IFC_DONE))
+ nds32_elf_ifc_filter (info);
+ else
+ nds32_elf_ifc_filter_after_ex9 ();
+
+ if (!nds32_elf_ifc_replace (info))
+ return FALSE;
+
+ if (table)
+ table->relax_status |= NDS32_RELAX_JUMP_IFC_DONE;
+ return TRUE;
+}
+
+/* Traverse the result of ifc filter and replace it with ifcall9. */
+
+static bfd_boolean
+nds32_elf_ifc_replace (struct bfd_link_info *info)
+{
+ struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head;
+ struct elf_nds32_ifc_irel_list *irel_ptr = NULL;
+ nds32_elf_blank_t *relax_blank_list = NULL;
+ bfd_byte *contents = NULL;
+ Elf_Internal_Rela *internal_relocs;
+ Elf_Internal_Rela *irel;
+ Elf_Internal_Rela *irelend;
+ unsigned short insn16 = INSN_IFCALL9;
+ struct elf_nds32_link_hash_table *table;
+ int relax_status;
+
+ table = nds32_elf_hash_table (info);
+ relax_status = table->relax_status;
+
+ while (ptr)
+ {
+ /* Traverse the ifc gather list, and replace the
+ filter entries by ifcall9. */
+ if ((!(relax_status & NDS32_RELAX_JUMP_IFC_DONE) && ptr->enable == 1)
+ || ((relax_status & NDS32_RELAX_JUMP_IFC_DONE)
+ && ptr->ex9_enable == 1))
+ {
+ irel_ptr = ptr->irel_head;
+ if (ptr->h == NULL)
+ {
+ /* Local symbol. */
+ internal_relocs = _bfd_elf_link_read_relocs
+ (ptr->sec->owner, ptr->sec, NULL, NULL, TRUE /* keep_memory */);
+ irelend = internal_relocs + ptr->sec->reloc_count;
+
+ if (!nds32_get_section_contents (ptr->sec->owner, ptr->sec,
+ &contents))
+ return FALSE;
+
+ while (irel_ptr)
+ {
+ if (irel_ptr->keep == 0 && irel_ptr->next)
+ {
+ /* The one can be replaced. We have to check whether
+ there is any alignment point in the region. */
+ irel = irel_ptr->irel;
+ while (((irel_ptr->next->keep == 0
+ && irel < irel_ptr->next->irel)
+ || (irel_ptr->next->keep == 1 && irel < irelend))
+ && !(ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL
+ && (irel->r_addend & 0x1f) == 2))
+ irel++;
+ if (irel >= irelend
+ || !(ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL
+ && (irel->r_addend & 0x1f) == 2
+ && ((irel->r_offset - get_nds32_elf_blank_total
+ (&relax_blank_list, irel->r_offset, 1))
+ & 0x02) == 0))
+ {
+ /* Replace by ifcall9. */
+ bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset);
+ if (!insert_nds32_elf_blank_recalc_total
+ (&relax_blank_list, irel_ptr->irel->r_offset + 2, 2))
+ return FALSE;
+ irel_ptr->irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info),
+ R_NDS32_10IFCU_PCREL_RELA);
+ }
+ }
+ irel_ptr = irel_ptr->next;
+ }
+
+ /* Delete the redundant code. */
+ if (relax_blank_list)
+ {
+ nds32_elf_relax_delete_blanks (ptr->sec->owner, ptr->sec,
+ relax_blank_list);
+ relax_blank_list = NULL;
+ }
+ }
+ else
+ {
+ /* Global symbol. */
+ while (irel_ptr)
+ {
+ if (irel_ptr->keep == 0 && irel_ptr->next)
+ {
+ /* The one can be replaced, and we have to check
+ whether there is any alignment point in the region. */
+ internal_relocs = _bfd_elf_link_read_relocs
+ (irel_ptr->sec->owner, irel_ptr->sec, NULL, NULL,
+ TRUE /* keep_memory */);
+ irelend = internal_relocs + irel_ptr->sec->reloc_count;
+ if (!nds32_get_section_contents
+ (irel_ptr->sec->owner, irel_ptr->sec, &contents))
+ return FALSE;
+
+ irel = irel_ptr->irel;
+ while (((irel_ptr->sec == irel_ptr->next->sec
+ && irel_ptr->next->keep == 0
+ && irel < irel_ptr->next->irel)
+ || ((irel_ptr->sec != irel_ptr->next->sec
+ || irel_ptr->next->keep == 1)
+ && irel < irelend))
+ && !(ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL
+ && (irel->r_addend & 0x1f) == 2))
+ irel++;
+ if (irel >= irelend
+ || !(ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL
+ && (irel->r_addend & 0x1f) == 2
+ && ((irel->r_offset
+ - get_nds32_elf_blank_total (&relax_blank_list,
+ irel->r_offset, 1)) & 0x02) == 0))
+ {
+ /* Replace by ifcall9. */
+ bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset);
+ if (!insert_nds32_elf_blank_recalc_total
+ (&relax_blank_list, irel_ptr->irel->r_offset + 2, 2))
+ return FALSE;
+
+ /* Delete the redundant code, and clear the relocation. */
+ nds32_elf_relax_delete_blanks (irel_ptr->sec->owner,
+ irel_ptr->sec,
+ relax_blank_list);
+ irel_ptr->irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info),
+ R_NDS32_10IFCU_PCREL_RELA);
+ relax_blank_list = NULL;
+ }
+ }
+
+ irel_ptr = irel_ptr->next;
+ }
+ }
+ }
+ ptr = ptr->next;
+ }
+
+ return TRUE;
+}
+
+/* Relocate ifcall. */
+
+static bfd_boolean
+nds32_elf_ifc_reloc (void)
+{
+ struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head;
+ struct elf_nds32_ifc_irel_list *irel_ptr = NULL;
+ struct elf_nds32_ifc_irel_list *irel_keeper = NULL;
+ bfd_vma relocation, address;
+ unsigned short insn16;
+ bfd_byte *contents = NULL;
+ static bfd_boolean done = FALSE;
+
+ if (done)
+ return TRUE;
+
+ done = TRUE;
+
+ while (ptr)
+ {
+ /* Check the entry is enable ifcall. */
+ if (ptr->enable == 1 || ptr->ex9_enable == 1)
+ {
+ /* Get the reserve jump. */
+ irel_ptr = ptr->irel_head;
+ while (irel_ptr)
+ {
+ if (irel_ptr->keep == 1)
+ {
+ irel_keeper = irel_ptr;
+ break;
+ }
+ irel_ptr = irel_ptr->next;
+ }
+
+ irel_ptr = ptr->irel_head;
+ if (ptr->h == NULL)
+ {
+ /* Local symbol. */
+ if (!nds32_get_section_contents (ptr->sec->owner, ptr->sec, &contents))
+ return FALSE;
+
+ while (irel_ptr)
+ {
+ if (irel_ptr->keep == 0
+ && ELF32_R_TYPE (irel_ptr->irel->r_info) == R_NDS32_10IFCU_PCREL_RELA)
+ {
+ relocation = irel_keeper->irel->r_offset;
+ relocation = relocation - irel_ptr->irel->r_offset;
+ while (irel_keeper && relocation > 1022)
+ {
+ irel_keeper = irel_keeper->next;
+ if (irel_keeper && irel_keeper->keep == 1)
+ {
+ relocation = irel_keeper->irel->r_offset;
+ relocation = relocation - irel_ptr->irel->r_offset;
+ }
+ }
+ if (relocation > 1022)
+ {
+ /* Double check. */
+ irel_keeper = ptr->irel_head;
+ while (irel_keeper)
+ {
+ if (irel_keeper->keep == 1)
+ {
+ relocation = irel_keeper->irel->r_offset;
+ relocation = relocation - irel_ptr->irel->r_offset;
+ }
+ if (relocation <= 1022)
+ break;
+ irel_keeper = irel_keeper->next;
+ }
+ if (!irel_keeper)
+ return FALSE;
+ }
+ irel_ptr->irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info),
+ R_NDS32_NONE);
+ insn16 = INSN_IFCALL9 | (relocation >> 1);
+ bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset);
+ }
+ irel_ptr = irel_ptr->next;
+ }
+ }
+ else
+ {
+ /* Global symbol. */
+ while (irel_ptr)
+ {
+ if (irel_ptr->keep == 0
+ && ELF32_R_TYPE (irel_ptr->irel->r_info) == R_NDS32_10IFCU_PCREL_RELA)
+ {
+ /* Get the distance between ifcall and jump. */
+ relocation = (irel_keeper->irel->r_offset
+ + irel_keeper->sec->output_section->vma
+ + irel_keeper->sec->output_offset);
+ address = (irel_ptr->irel->r_offset
+ + irel_ptr->sec->output_section->vma
+ + irel_ptr->sec->output_offset);
+ relocation = relocation - address;
+
+ /* The distance is over ragne, find callee again. */
+ while (irel_keeper && relocation > 1022)
+ {
+ irel_keeper = irel_keeper->next;
+ if (irel_keeper && irel_keeper->keep ==1)
+ {
+ relocation = (irel_keeper->irel->r_offset
+ + irel_keeper->sec->output_section->vma
+ + irel_keeper->sec->output_offset);
+ relocation = relocation - address;
+ }
+ }
+
+ if (relocation > 1022)
+ {
+ /* Double check. */
+ irel_keeper = ptr->irel_head;
+ while (irel_keeper)
+ {
+ if (irel_keeper->keep == 1)
+ {
+
+ relocation = (irel_keeper->irel->r_offset
+ + irel_keeper->sec->output_section->vma
+ + irel_keeper->sec->output_offset);
+ relocation = relocation - address;
+ }
+ if (relocation <= 1022)
+ break;
+ irel_keeper = irel_keeper->next;
+ }
+ if (!irel_keeper)
+ return FALSE;
+ }
+ if (!nds32_get_section_contents
+ (irel_ptr->sec->owner, irel_ptr->sec, &contents))
+ return FALSE;
+ insn16 = INSN_IFCALL9 | (relocation >> 1);
+ bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset);
+ irel_ptr->irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info),
+ R_NDS32_NONE);
+ }
+ irel_ptr =irel_ptr->next;
+ }
+ }
+ }
+ ptr = ptr->next;
+ }
+
+ return TRUE;
+}
+
+/* End of IFC relaxation. */
+
+/* EX9 Instruction Table Relaxation. */
+
+/* Global hash list. */
+struct elf_link_hash_entry_list
+{
+ struct elf_link_hash_entry *h;
+ struct elf_link_hash_entry_list *next;
+};
+
+/* Save different destination but same insn. */
+struct elf_link_hash_entry_mul_list
+{
+ /* Global symbol times. */
+ int times;
+ /* Save relocation for each global symbol but useful?? */
+ Elf_Internal_Rela *irel;
+ /* For sethi, two sethi may have the same high-part but different low-parts. */
+ Elf_Internal_Rela rel_backup;
+ struct elf_link_hash_entry_list *h_list;
+ struct elf_link_hash_entry_mul_list *next;
+};
+
+/* Instruction hash table. */
+struct elf_nds32_code_hash_entry
+{
+ struct bfd_hash_entry root;
+ int times;
+ /* For insn that can use relocation or constant ex: sethi. */
+ int const_insn;
+ asection *sec;
+ struct elf_link_hash_entry_mul_list *m_list;
+ /* Using r_addend. */
+ Elf_Internal_Rela *irel;
+ /* Using r_info. */
+ Elf_Internal_Rela rel_backup;
+};
+
+/* Instruction count list. */
+struct elf_nds32_insn_times_entry
+{
+ const char *string;
+ int times;
+ int order;
+ asection *sec;
+ struct elf_link_hash_entry_mul_list *m_list;
+ Elf_Internal_Rela *irel;
+ Elf_Internal_Rela rel_backup;
+ struct elf_nds32_insn_times_entry *next;
+};
+
+/* J and JAL symbol list. */
+struct elf_nds32_symbol_entry
+{
+ char *string;
+ unsigned long insn;
+ struct elf_nds32_symbol_entry *next;
+};
+
+/* Relocation list. */
+struct elf_nds32_irel_entry
+{
+ Elf_Internal_Rela *irel;
+ struct elf_nds32_irel_entry *next;
+};
+
+/* ex9.it insn need to be fixed. */
+struct elf_nds32_ex9_refix
+{
+ Elf_Internal_Rela *irel;
+ asection *sec;
+ struct elf_link_hash_entry *h;
+ int order;
+ struct elf_nds32_ex9_refix *next;
+};
+
+static struct bfd_hash_table ex9_code_table;
+static struct elf_nds32_insn_times_entry *ex9_insn_head = NULL;
+static struct elf_nds32_ex9_refix *ex9_refix_head = NULL;
+
+/* EX9 hash function. */
+
+static struct bfd_hash_entry *
+nds32_elf_code_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
+{
+ struct elf_nds32_code_hash_entry *ret;
+
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (entry == NULL)
+ {
+ entry = (struct bfd_hash_entry *)
+ bfd_hash_allocate (table, sizeof (*ret));
+ if (entry == NULL)
+ return entry;
+ }
+
+ /* Call the allocation method of the superclass. */
+ entry = bfd_hash_newfunc (entry, table, string);
+ if (entry == NULL)
+ return entry;
+
+ ret = (struct elf_nds32_code_hash_entry*) entry;
+ ret->times = 0;
+ ret->const_insn = 0;
+ ret->m_list = NULL;
+ ret->sec = NULL;
+ ret->irel = NULL;
+ return &ret->root;
+}
+
+/* Insert ex9 entry
+ this insert must be stable sorted by times. */
+
+static void
+nds32_elf_ex9_insert_entry (struct elf_nds32_insn_times_entry *ptr)
+{
+ struct elf_nds32_insn_times_entry *temp;
+ struct elf_nds32_insn_times_entry *temp2;
+
+ if (ex9_insn_head == NULL)
+ {
+ ex9_insn_head = ptr;
+ ptr->next = NULL;
+ }
+ else
+ {
+ temp = ex9_insn_head;
+ temp2 = ex9_insn_head;
+ while (temp->next &&
+ (temp->next->times >= ptr->times
+ || temp->times == -1))
+ {
+ if (temp->times == -1)
+ temp2 = temp;
+ temp = temp->next;
+ }
+ if (ptr->times > temp->times && temp->times != -1)
+ {
+ ptr->next = temp;
+ if (temp2->times == -1)
+ temp2->next = ptr;
+ else
+ ex9_insn_head = ptr;
+ }
+ else if (temp->next == NULL)
+ {
+ temp->next = ptr;
+ ptr->next = NULL;
+ }
+ else
+ {
+ ptr->next = temp->next;
+ temp->next = ptr;
+ }
+ }
+}
+
+/* Examine each insn times in hash table.
+ Handle multi-link hash entry.
+
+ TODO: This function doesn't assign so much info since it is fake. */
+
+static int
+nds32_elf_examine_insn_times (struct elf_nds32_code_hash_entry *h)
+{
+ struct elf_nds32_insn_times_entry *ptr;
+ int times;
+
+ if (h->m_list == NULL)
+ {
+ /* Local symbol insn or insn without relocation. */
+ if (h->times < 3)
+ return TRUE;
+
+ ptr = (struct elf_nds32_insn_times_entry *)
+ bfd_malloc (sizeof (struct elf_nds32_insn_times_entry));
+ ptr->times = h->times;
+ ptr->string = h->root.string;
+ ptr->m_list = NULL;
+ ptr->sec = h->sec;
+ ptr->irel = h->irel;
+ ptr->rel_backup = h->rel_backup;
+ nds32_elf_ex9_insert_entry (ptr);
+ }
+ else
+ {
+ /* Global symbol insn. */
+ /* Only sethi insn has multiple m_list. */
+ struct elf_link_hash_entry_mul_list *m_list = h->m_list;
+
+ times = 0;
+ while (m_list)
+ {
+ times += m_list->times;
+ m_list = m_list->next;
+ }
+ if (times >= 3)
+ {
+ m_list = h->m_list;
+ ptr = (struct elf_nds32_insn_times_entry *)
+ bfd_malloc (sizeof (struct elf_nds32_insn_times_entry));
+ ptr->times = times; /* Use the total times. */
+ ptr->string = h->root.string;
+ ptr->m_list = m_list;
+ ptr->sec = h->sec;
+ ptr->irel = m_list->irel;
+ ptr->rel_backup = m_list->rel_backup;
+ nds32_elf_ex9_insert_entry (ptr);
+ }
+ if (h->const_insn == 1)
+ {
+ /* sethi with constant value. */
+ if (h->times < 3)
+ return TRUE;
+
+ ptr = (struct elf_nds32_insn_times_entry *)
+ bfd_malloc (sizeof (struct elf_nds32_insn_times_entry));
+ ptr->times = h->times;
+ ptr->string = h->root.string;
+ ptr->m_list = NULL;
+ ptr->sec = NULL;
+ ptr->irel = NULL;
+ ptr->rel_backup = h->rel_backup;
+ nds32_elf_ex9_insert_entry (ptr);
+ }
+ }
+ return TRUE;
+}
+
+/* Count each insn times in hash table.
+ Handle multi-link hash entry. */
+
+static int
+nds32_elf_count_insn_times (struct elf_nds32_code_hash_entry *h)
+{
+ int reservation, times;
+ unsigned long relocation, min_relocation;
+ struct elf_nds32_insn_times_entry *ptr;
+
+ if (h->m_list == NULL)
+ {
+ /* Local symbol insn or insn without relocation. */
+ if (h->times < 3)
+ return TRUE;
+ ptr = (struct elf_nds32_insn_times_entry *)
+ bfd_malloc (sizeof (struct elf_nds32_insn_times_entry));
+ ptr->times = h->times;
+ ptr->string = h->root.string;
+ ptr->m_list = NULL;
+ ptr->sec = h->sec;
+ ptr->irel = h->irel;
+ ptr->rel_backup = h->rel_backup;
+ nds32_elf_ex9_insert_entry (ptr);
+ }
+ else
+ {
+ /* Global symbol insn. */
+ /* Only sethi insn has multiple m_list. */
+ struct elf_link_hash_entry_mul_list *m_list = h->m_list;
+
+ if (ELF32_R_TYPE (m_list->rel_backup.r_info) == R_NDS32_HI20_RELA
+ && m_list->next != NULL)
+ {
+ /* Sethi insn has different symbol or addend but has same hi20. */
+ times = 0;
+ reservation = 1;
+ relocation = 0;
+ min_relocation = 0xffffffff;
+ while (m_list)
+ {
+ /* Get the minimum sethi address
+ and calculate how many entry the sethi-list have to use. */
+ if ((m_list->h_list->h->root.type == bfd_link_hash_defined
+ || m_list->h_list->h->root.type == bfd_link_hash_defweak)
+ && (m_list->h_list->h->root.u.def.section != NULL
+ && m_list->h_list->h->root.u.def.section->output_section != NULL))
+ {
+ relocation = (m_list->h_list->h->root.u.def.value +
+ m_list->h_list->h->root.u.def.section->output_section->vma +
+ m_list->h_list->h->root.u.def.section->output_offset);
+ relocation += m_list->irel->r_addend;
+ }
+ else
+ relocation = 0;
+ if (relocation < min_relocation)
+ min_relocation = relocation;
+ times += m_list->times;
+ m_list = m_list->next;
+ }
+ if (min_relocation < ex9_relax_size)
+ reservation = (min_relocation >> 12) + 1;
+ else
+ reservation = (min_relocation >> 12)
+ - ((min_relocation - ex9_relax_size) >> 12) + 1;
+ if (reservation < (times / 3))
+ {
+ /* Efficient enough to use ex9. */
+ int i;
+
+ for (i = reservation ; i > 0; i--)
+ {
+ /* Allocate number of reservation ex9 entry. */
+ ptr = (struct elf_nds32_insn_times_entry *)
+ bfd_malloc (sizeof (struct elf_nds32_insn_times_entry));
+ ptr->times = h->m_list->times / reservation;
+ ptr->string = h->root.string;
+ ptr->m_list = h->m_list;
+ ptr->sec = h->sec;
+ ptr->irel = h->m_list->irel;
+ ptr->rel_backup = h->m_list->rel_backup;
+ nds32_elf_ex9_insert_entry (ptr);
+ }
+ }
+ }
+ else
+ {
+ /* Normal global symbol that means no different address symbol
+ using same ex9 entry. */
+ if (m_list->times >= 3)
+ {
+ ptr = (struct elf_nds32_insn_times_entry *)
+ bfd_malloc (sizeof (struct elf_nds32_insn_times_entry));
+ ptr->times = m_list->times;
+ ptr->string = h->root.string;
+ ptr->m_list = h->m_list;
+ ptr->sec = h->sec;
+ ptr->irel = h->m_list->irel;
+ ptr->rel_backup = h->m_list->rel_backup;
+ nds32_elf_ex9_insert_entry (ptr);
+ }
+ }
+
+ if (h->const_insn == 1)
+ {
+ /* sethi with constant value. */
+ if (h->times < 3)
+ return TRUE;
+
+ ptr = (struct elf_nds32_insn_times_entry *)
+ bfd_malloc (sizeof (struct elf_nds32_insn_times_entry));
+ ptr->times = h->times;
+ ptr->string = h->root.string;
+ ptr->m_list = NULL;
+ ptr->sec = NULL;
+ ptr->irel = NULL;
+ ptr->rel_backup = h->rel_backup;
+ nds32_elf_ex9_insert_entry (ptr);
+ }
+ }
+
+ return TRUE;
+}
+
+/* Hash table traverse function. */
+
+static void
+nds32_elf_code_hash_traverse (int (*func) (struct elf_nds32_code_hash_entry*))
+{
+ unsigned int i;
+
+ ex9_code_table.frozen = 1;
+ for (i = 0; i < ex9_code_table.size; i++)
+ {
+ struct bfd_hash_entry *p;
+
+ for (p = ex9_code_table.table[i]; p != NULL; p = p->next)
+ if (!func ((struct elf_nds32_code_hash_entry *) p))
+ goto out;
+ }
+out:
+ ex9_code_table.frozen = 0;
+}
+
+
+/* Give order number to insn list. */
+
+static void
+nds32_elf_order_insn_times (struct bfd_link_info *info)
+{
+ struct elf_nds32_insn_times_entry *ex9_insn;
+ struct elf_nds32_insn_times_entry *temp = NULL;
+ struct elf_nds32_link_hash_table *table;
+ int ex9_limit;
+ int number = 0;
+
+ if (ex9_insn_head == NULL)
+ return;
+
+/* The max number of entries is 512. */
+ ex9_insn = ex9_insn_head;
+ table = nds32_elf_hash_table (info);
+ ex9_limit = table->ex9_limit;
+
+ ex9_insn = ex9_insn_head;
+
+ while (ex9_insn != NULL && number < ex9_limit)
+ {
+ ex9_insn->order = number;
+ number++;
+ temp = ex9_insn;
+ ex9_insn = ex9_insn->next;
+ }
+
+ if (ex9_insn && temp)
+ temp->next = NULL;
+
+ while (ex9_insn != NULL)
+ {
+ /* Free useless entry. */
+ temp = ex9_insn;
+ ex9_insn = ex9_insn->next;
+ free (temp);
+ }
+}
+
+/* Build .ex9.itable section. */
+
+static void
+nds32_elf_ex9_build_itable (struct bfd_link_info *link_info)
+{
+ asection *table_sec;
+ struct elf_nds32_insn_times_entry *ptr;
+ bfd *it_abfd;
+ int number = 0;
+ bfd_byte *contents = NULL;
+
+ for (it_abfd = link_info->input_bfds; it_abfd != NULL;
+ it_abfd = it_abfd->link.next)
+ {
+ /* Find the section .ex9.itable, and put all entries into it. */
+ table_sec = bfd_get_section_by_name (it_abfd, ".ex9.itable");
+ if (table_sec != NULL)
+ {
+ if (!nds32_get_section_contents (it_abfd, table_sec, &contents))
+ return;
+
+ for (ptr = ex9_insn_head; ptr !=NULL ; ptr = ptr->next)
+ number++;
+
+ table_sec->size = number * 4;
+
+ if (number == 0)
+ return;
+
+ elf_elfheader (link_info->output_bfd)->e_flags |= E_NDS32_HAS_EX9_INST;
+ number = 0;
+ for (ptr = ex9_insn_head; ptr !=NULL ; ptr = ptr->next)
+ {
+ long val;
+
+ val = strtol (ptr->string, NULL, 16);
+ bfd_putb32 ((bfd_vma) val, (char *) contents + (number * 4));
+ number++;
+ }
+ break;
+ }
+ }
+}
+
+/* Get insn with regs according to relocation type. */
+
+static void
+nds32_elf_get_insn_with_reg (Elf_Internal_Rela *irel,
+ uint32_t insn, uint32_t *insn_with_reg)
+{
+ reloc_howto_type *howto = NULL;
+
+ if (irel == NULL
+ || (ELF32_R_TYPE (irel->r_info) >= (int) ARRAY_SIZE (nds32_elf_howto_table)
+ && (ELF32_R_TYPE (irel->r_info) - R_NDS32_RELAX_ENTRY)
+ >= (int) ARRAY_SIZE (nds32_elf_relax_howto_table)))
+ {
+ *insn_with_reg = insn;
+ return;
+ }
+
+ howto = bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE (irel->r_info));
+ *insn_with_reg = insn & (0xffffffff ^ howto->dst_mask);
+}
+
+/* Mask number of address bits according to relocation. */
+
+static unsigned long
+nds32_elf_irel_mask (Elf_Internal_Rela *irel)
+{
+ reloc_howto_type *howto = NULL;
+
+ if (irel == NULL
+ || (ELF32_R_TYPE (irel->r_info) >= (int) ARRAY_SIZE (nds32_elf_howto_table)
+ && (ELF32_R_TYPE (irel->r_info) - R_NDS32_RELAX_ENTRY)
+ >= (int) ARRAY_SIZE (nds32_elf_relax_howto_table)))
+ return 0;
+
+ howto = bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE (irel->r_info));
+ return howto->dst_mask;
+}
+
+static void
+nds32_elf_insert_irel_entry (struct elf_nds32_irel_entry **irel_list,
+ struct elf_nds32_irel_entry *irel_ptr)
+{
+ if (*irel_list == NULL)
+ {
+ *irel_list = irel_ptr;
+ irel_ptr->next = NULL;
+ }
+ else
+ {
+ irel_ptr->next = *irel_list;
+ *irel_list = irel_ptr;
+ }
+}
+
+static void
+nds32_elf_ex9_insert_fix (asection * sec, Elf_Internal_Rela * irel,
+ struct elf_link_hash_entry *h, int order)
+{
+ struct elf_nds32_ex9_refix *ptr;
+
+ ptr = bfd_malloc (sizeof (struct elf_nds32_ex9_refix));
+ ptr->sec = sec;
+ ptr->irel = irel;
+ ptr->h = h;
+ ptr->order = order;
+ ptr->next = NULL;
+
+ if (ex9_refix_head == NULL)
+ ex9_refix_head = ptr;
+ else
+ {
+ struct elf_nds32_ex9_refix *temp = ex9_refix_head;
+
+ while (temp->next != NULL)
+ temp = temp->next;
+ temp->next = ptr;
+ }
+}
+
+enum
+{
+ DATA_EXIST = 1,
+ CLEAN_PRE = 1 << 1,
+ PUSH_PRE = 1 << 2
+};
+
+/* Check relocation type if supporting for ex9. */
+
+static int
+nds32_elf_ex9_relocation_check (struct bfd_link_info *info,
+ Elf_Internal_Rela **irel,
+ Elf_Internal_Rela *irelend,
+ nds32_elf_blank_t *relax_blank_list,
+ asection *sec,bfd_vma *off,
+ bfd_byte *contents)
+{
+ /* Suppress ex9 if `.no_relax ex9' or inner loop. */
+ bfd_boolean nested_ex9, nested_loop;
+ bfd_boolean ex9_loop_aware;
+ /* We use the highest 1 byte of result to record
+ how many bytes location counter has to move. */
+ int result = 0;
+ Elf_Internal_Rela *irel_save = NULL;
+ struct elf_nds32_link_hash_table *table;
+
+ table = nds32_elf_hash_table (info);
+ ex9_loop_aware = table->ex9_loop_aware;
+
+ while ((*irel) != NULL && (*irel) < irelend && *off == (*irel)->r_offset)
+ {
+ switch (ELF32_R_TYPE ((*irel)->r_info))
+ {
+ case R_NDS32_RELAX_REGION_BEGIN:
+ /* Ignore code block. */
+ nested_ex9 = FALSE;
+ nested_loop = FALSE;
+ if (((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_EX9_FLAG)
+ || (ex9_loop_aware
+ && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG)))
+ {
+ /* Check the region if loop or not. If it is true and
+ ex9-loop-aware is true, ignore the region till region end. */
+ /* To save the status for in .no_relax ex9 region and
+ loop region to conform the block can do ex9 relaxation. */
+ nested_ex9 = ((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_EX9_FLAG);
+ nested_loop = (ex9_loop_aware
+ && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG));
+ while ((*irel) && (*irel) < irelend && (nested_ex9 || nested_loop))
+ {
+ (*irel)++;
+ if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_RELAX_REGION_BEGIN)
+ {
+ /* There may be nested region. */
+ if (((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_EX9_FLAG) != 0)
+ nested_ex9 = TRUE;
+ else if (ex9_loop_aware
+ && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG))
+ nested_loop = TRUE;
+ }
+ else if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_RELAX_REGION_END)
+ {
+ /* The end of region. */
+ if (((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_EX9_FLAG) != 0)
+ nested_ex9 = FALSE;
+ else if (ex9_loop_aware
+ && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG))
+ nested_loop = FALSE;
+ }
+ else if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_LABEL
+ && ((*irel)->r_addend & 0x1f) == 2)
+ {
+ /* Alignment exist in the region. */
+ result |= CLEAN_PRE;
+ if (((*irel)->r_offset -
+ get_nds32_elf_blank_total (&relax_blank_list,
+ (*irel)->r_offset, 0)) & 0x02)
+ result |= PUSH_PRE;
+ }
+ }
+ if ((*irel) >= irelend)
+ *off = sec->size;
+ else
+ *off = (*irel)->r_offset;
+
+ /* The final instruction in the region, regard this one as data to ignore it. */
+ result |= DATA_EXIST;
+ return result;
+ }
+ break;
+
+ case R_NDS32_LABEL:
+ if (((*irel)->r_addend & 0x1f) == 2)
+ {
+ /* Check this point is align and decide to do ex9 or not. */
+ result |= CLEAN_PRE;
+ if (((*irel)->r_offset -
+ get_nds32_elf_blank_total (&relax_blank_list,
+ (*irel)->r_offset, 0)) & 0x02)
+ result |= PUSH_PRE;
+ }
+ break;
+ case R_NDS32_32_RELA:
+ /* Data. */
+ result |= (4 << 24);
+ result |= DATA_EXIST;
+ break;
+ case R_NDS32_16_RELA:
+ /* Data. */
+ result |= (2 << 24);
+ result |= DATA_EXIST;
+ break;
+ case R_NDS32_DATA:
+ /* Data. */
+ /* The least code alignment is 2. If the data is only one byte,
+ we have to shift one more byte. */
+ if ((*irel)->r_addend == 1)
+ result |= ((*irel)->r_addend << 25) ;
+ else
+ result |= ((*irel)->r_addend << 24) ;
+
+ result |= DATA_EXIST;
+ break;
+
+ case R_NDS32_25_PCREL_RELA:
+ case R_NDS32_SDA16S3_RELA:
+ case R_NDS32_SDA15S3_RELA:
+ case R_NDS32_SDA15S3:
+ case R_NDS32_SDA17S2_RELA:
+ case R_NDS32_SDA15S2_RELA:
+ case R_NDS32_SDA12S2_SP_RELA:
+ case R_NDS32_SDA12S2_DP_RELA:
+ case R_NDS32_SDA15S2:
+ case R_NDS32_SDA18S1_RELA:
+ case R_NDS32_SDA15S1_RELA:
+ case R_NDS32_SDA15S1:
+ case R_NDS32_SDA19S0_RELA:
+ case R_NDS32_SDA15S0_RELA:
+ case R_NDS32_SDA15S0:
+ case R_NDS32_HI20_RELA:
+ case R_NDS32_LO12S0_ORI_RELA:
+ case R_NDS32_LO12S0_RELA:
+ case R_NDS32_LO12S1_RELA:
+ case R_NDS32_LO12S2_RELA:
+ /* These relocation is supported ex9 relaxation currently. */
+ /* We have to save the relocation for using later, since we have
+ to check there is any alignment in the same address. */
+ irel_save = *irel;
+ break;
+ default:
+ /* Not support relocations. */
+ if (ELF32_R_TYPE ((*irel)->r_info) < ARRAY_SIZE (nds32_elf_howto_table)
+ && ELF32_R_TYPE ((*irel)->r_info) != R_NDS32_NONE
+ && ELF32_R_TYPE ((*irel)->r_info) != R_NDS32_INSN16)
+ {
+ /* Note: To optimize aggressively, it maybe can ignore R_NDS32_INSN16 here.
+ But we have to consider if there is any side-effect. */
+ if (!(result & DATA_EXIST))
+ {
+ /* We have to confirm there is no data relocation in the
+ same address. In general case, this won't happen. */
+ /* We have to do ex9 conservative, for those relocation not
+ considerd we ignore instruction. */
+ result |= DATA_EXIST;
+ if (*(contents + *off) & 0x80)
+ result |= (2 << 24);
+ else
+ result |= (4 << 24);
+ break;
+ }
+ }
+ }
+ if ((*irel) < irelend
+ && ((*irel) + 1) < irelend
+ && (*irel)->r_offset == ((*irel) + 1)->r_offset)
+ /* There are relocations pointing to the same address, we have to
+ check all of them. */
+ (*irel)++;
+ else
+ {
+ if (irel_save)
+ *irel = irel_save;
+ return result;
+ }
+ }
+ return result;
+}
+
+/* Replace with ex9 instruction. */
+
+static bfd_boolean
+nds32_elf_ex9_push_insn (uint16_t insn16, bfd_byte *contents, bfd_vma pre_off,
+ nds32_elf_blank_t **relax_blank_list,
+ struct elf_nds32_irel_entry *pre_irel_ptr,
+ struct elf_nds32_irel_entry **irel_list)
+{
+ if (insn16 != 0)
+ {
+ /* Implement the ex9 relaxation. */
+ bfd_putb16 (insn16, contents + pre_off);
+ if (!insert_nds32_elf_blank_recalc_total (relax_blank_list,
+ pre_off + 2, 2))
+ return FALSE;
+ if (pre_irel_ptr != NULL)
+ nds32_elf_insert_irel_entry (irel_list, pre_irel_ptr);
+ }
+ return TRUE;
+}
+
+/* Replace input file instruction which is in ex9 itable. */
+
+static bfd_boolean
+nds32_elf_ex9_replace_instruction (struct bfd_link_info *info, bfd *abfd, asection *sec)
+{
+ struct elf_nds32_insn_times_entry *ex9_insn = ex9_insn_head;
+ bfd_byte *contents = NULL;
+ bfd_vma off;
+ uint16_t insn16, insn_ex9;
+ /* `pre_*' are used to track previous instruction that can use ex9.it. */
+ bfd_vma pre_off = -1;
+ uint16_t pre_insn16 = 0;
+ struct elf_nds32_irel_entry *pre_irel_ptr = NULL;
+ Elf_Internal_Rela *internal_relocs;
+ Elf_Internal_Rela *irel;
+ Elf_Internal_Rela *irelend;
+ Elf_Internal_Shdr *symtab_hdr;
+ Elf_Internal_Sym *isym = NULL;
+ nds32_elf_blank_t *relax_blank_list = NULL;
+ uint32_t insn = 0;
+ uint32_t insn_with_reg = 0;
+ uint32_t it_insn;
+ uint32_t it_insn_with_reg;
+ unsigned long r_symndx;
+ asection *isec;
+ struct elf_nds32_irel_entry *irel_list = NULL;
+ struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd);
+ int data_flag, do_replace, save_irel;
+ struct elf_link_hash_entry_list *h_list;
+
+
+ /* Load section instructions, relocations, and symbol table. */
+ if (!nds32_get_section_contents (abfd, sec, &contents)
+ || !nds32_get_local_syms (abfd, sec, &isym))
+ return FALSE;
+ internal_relocs =
+ _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, TRUE /* keep_memory */);
+ irelend = internal_relocs + sec->reloc_count;
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+
+ off = 0;
+
+ /* Check if the object enable ex9. */
+ irel = find_relocs_at_address (internal_relocs, internal_relocs,
+ irelend, R_NDS32_RELAX_ENTRY);
+
+ /* Check this section trigger ex9 relaxation. */
+ if (irel == NULL
+ || irel >= irelend
+ || ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_ENTRY
+ || (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY
+ && !(irel->r_addend & R_NDS32_RELAX_ENTRY_EX9_FLAG)))
+ return TRUE;
+
+ irel = internal_relocs;
+
+ /* Check alignment and fetch proper relocation. */
+ while (off < sec->size)
+ {
+ struct elf_link_hash_entry *h = NULL;
+ struct elf_nds32_irel_entry *irel_ptr = NULL;
+
+ /* Syn the instruction and the relocation. */
+ while (irel != NULL && irel < irelend && irel->r_offset < off)
+ irel++;
+
+ data_flag = nds32_elf_ex9_relocation_check (info, &irel, irelend,
+ relax_blank_list, sec,
+ &off, contents);
+ if (data_flag & PUSH_PRE)
+ if (!nds32_elf_ex9_push_insn (pre_insn16, contents, pre_off,
+ &relax_blank_list, pre_irel_ptr,
+ &irel_list))
+ return FALSE;
+
+ if (data_flag & CLEAN_PRE)
+ {
+ pre_off = 0;
+ pre_insn16 = 0;
+ pre_irel_ptr = NULL;
+ }
+ if (data_flag & DATA_EXIST)
+ {
+ /* We save the move offset in the highest byte. */
+ off += (data_flag >> 24);
+ continue;
+ }
+
+ if (*(contents + off) & 0x80)
+ {
+ /* 2-byte instruction. */
+ off += 2;
+ continue;
+ }
+
+ /* Load the instruction and its opcode with register for comparing. */
+ ex9_insn = ex9_insn_head;
+ insn = bfd_getb32 (contents + off);
+ insn_with_reg = 0;
+ while (ex9_insn)
+ {
+ it_insn = strtol (ex9_insn->string, NULL, 16);
+ it_insn_with_reg = 0;
+ do_replace = 0;
+ save_irel = 0;
+
+ if (irel != NULL && irel < irelend && irel->r_offset == off)
+ {
+ /* Insn with relocation. */
+ nds32_elf_get_insn_with_reg (irel, insn, &insn_with_reg);
+
+ if (ex9_insn->irel != NULL)
+ nds32_elf_get_insn_with_reg (ex9_insn->irel, it_insn,
+ &it_insn_with_reg);
+
+ if (ex9_insn->irel != NULL
+ && (ELF32_R_TYPE (irel->r_info) ==
+ ELF32_R_TYPE (ex9_insn->irel->r_info))
+ && (insn_with_reg == it_insn_with_reg))
+ {
+ /* Insn relocation and format is the same as table entry. */
+
+ if (ELF32_R_TYPE (irel->r_info) == R_NDS32_25_PCREL_RELA
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S0_ORI_RELA
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S0_RELA
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S1_RELA
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_RELA
+ || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0)
+ || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3_RELA
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0_RELA)
+ || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA12S2_DP_RELA
+ && ELF32_R_TYPE (irel->r_info) <=
+ R_NDS32_SDA12S2_SP_RELA)
+ || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA16S3_RELA
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA19S0_RELA))
+ {
+ r_symndx = ELF32_R_SYM (irel->r_info);
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ /* Local symbol. */
+ int shndx = isym[r_symndx].st_shndx;
+
+ isec = elf_elfsections (abfd)[shndx]->bfd_section;
+ if (ex9_insn->sec == isec
+ && ex9_insn->irel->r_addend == irel->r_addend
+ && ex9_insn->irel->r_info == irel->r_info)
+ {
+ do_replace = 1;
+ save_irel = 1;
+ }
+ }
+ else
+ {
+ /* External symbol. */
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ if (ex9_insn->m_list)
+ {
+ h_list = ex9_insn->m_list->h_list;
+ while (h_list)
+ {
+ if (h == h_list->h
+ && (ex9_insn->m_list->irel->r_addend ==
+ irel->r_addend))
+ {
+ do_replace = 1;
+ save_irel = 1;
+ break;
+ }
+ h_list = h_list->next;
+ }
+ }
+ }
+ }
+ else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_HI20_RELA)
+ {
+ r_symndx = ELF32_R_SYM (irel->r_info);
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ /* Local symbols. Compare its base symbol and offset. */
+ int shndx = isym[r_symndx].st_shndx;
+
+ isec = elf_elfsections (abfd)[shndx]->bfd_section;
+ if (ex9_insn->sec == isec
+ && ex9_insn->irel->r_addend == irel->r_addend
+ && ex9_insn->irel->r_info == irel->r_info)
+ {
+ do_replace = 1;
+ save_irel = 1;
+ }
+ }
+ else
+ {
+ /* External symbol. */
+ struct elf_link_hash_entry_mul_list *m_list;
+
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ m_list = ex9_insn->m_list;
+
+ while (m_list)
+ {
+ h_list = m_list->h_list;
+
+ while (h_list)
+ {
+ if (h == h_list->h
+ && (m_list->irel->r_addend
+ == irel->r_addend))
+ {
+ do_replace = 1;
+ save_irel = 1;
+ if (ex9_insn->next
+ && ex9_insn->m_list
+ && ex9_insn->m_list == ex9_insn->next->m_list)
+ {
+ /* sethi multiple entry must be fixed */
+ nds32_elf_ex9_insert_fix (sec, irel,
+ h, ex9_insn->order);
+ }
+ break;
+ }
+ h_list = h_list->next;
+ }
+ m_list = m_list->next;
+ }
+ }
+ }
+ }
+
+ /* Import table: Check the symbol hash table and the
+ jump target. Only R_NDS32_25_PCREL_RELA now. */
+ else if (ex9_insn->times == -1
+ && ELF32_R_TYPE (irel->r_info) == R_NDS32_25_PCREL_RELA)
+ {
+ nds32_elf_get_insn_with_reg (irel, it_insn, &it_insn_with_reg);
+ if (insn_with_reg == it_insn_with_reg)
+ {
+ char code[10];
+ bfd_vma relocation;
+
+ r_symndx = ELF32_R_SYM (irel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ if ((h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && h->root.u.def.section != NULL
+ && h->root.u.def.section->output_section != NULL
+ && h->root.u.def.section->gc_mark == 1
+ && bfd_is_abs_section (h->root.u.def.section)
+ && h->root.u.def.value > sec->size)
+ {
+ relocation = h->root.u.def.value +
+ h->root.u.def.section->output_section->vma +
+ h->root.u.def.section->output_offset;
+ relocation += irel->r_addend;
+ insn = insn_with_reg
+ | ((relocation >> 1) & 0xffffff);
+ snprintf (code, sizeof (code), "%08x", insn);
+ if (strcmp (code, ex9_insn->string) == 0)
+ {
+ do_replace = 1;
+ save_irel = 1;
+ }
+ }
+ }
+ }
+ }
+ else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_BEGIN
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_END
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_NONE)
+ {
+ /* These relocations do not have to relocate contens, so it can
+ be regard as instruction without relocation. */
+ if (insn == it_insn && ex9_insn->irel == NULL)
+ do_replace = 1;
+ }
+ }
+ else
+ {
+ /* Instruction without relocation, we only
+ have to compare their byte code. */
+ if (insn == it_insn && ex9_insn->irel == NULL)
+ do_replace = 1;
+ }
+
+ /* Insntruction match so replacing the code here. */
+ if (do_replace == 1)
+ {
+ /* There are two formats of ex9 instruction. */
+ if (ex9_insn->order < 32)
+ insn_ex9 = INSN_EX9_IT_2;
+ else
+ insn_ex9 = INSN_EX9_IT_1;
+ insn16 = insn_ex9 | ex9_insn->order;
+
+ /* Insert ex9 instruction. */
+ nds32_elf_ex9_push_insn (pre_insn16, contents, pre_off,
+ &relax_blank_list, pre_irel_ptr,
+ &irel_list);
+ pre_off = off;
+ pre_insn16 = insn16;
+
+ if (save_irel)
+ {
+ /* For instuction with relocation do relax. */
+ irel_ptr = (struct elf_nds32_irel_entry *)
+ bfd_malloc (sizeof (struct elf_nds32_irel_entry));
+ irel_ptr->irel = irel;
+ irel_ptr->next = NULL;
+ pre_irel_ptr = irel_ptr;
+ }
+ else
+ pre_irel_ptr = NULL;
+ break;
+ }
+ ex9_insn = ex9_insn->next;
+ }
+ off += 4;
+ }
+
+ /* Insert ex9 instruction. */
+ nds32_elf_ex9_push_insn (pre_insn16, contents, pre_off,
+ &relax_blank_list, pre_irel_ptr,
+ &irel_list);
+
+ /* Delete the redundant code. */
+ if (relax_blank_list)
+ {
+ nds32_elf_relax_delete_blanks (abfd, sec, relax_blank_list);
+ relax_blank_list = NULL;
+ }
+
+ /* Clear the relocation that is replaced by ex9. */
+ while (irel_list)
+ {
+ struct elf_nds32_irel_entry *irel_ptr;
+
+ irel_ptr = irel_list;
+ irel_list = irel_ptr->next;
+ irel_ptr->irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), R_NDS32_TRAN);
+ free (irel_ptr);
+ }
+ return TRUE;
+}
+
+/* Initialize ex9 hash table. */
+
+int
+nds32_elf_ex9_init (void)
+{
+ if (!bfd_hash_table_init_n (&ex9_code_table, nds32_elf_code_hash_newfunc,
+ sizeof (struct elf_nds32_code_hash_entry),
+ 1023))
+ {
+ (*_bfd_error_handler) (_("Linker: cannot init ex9 hash table error \n"));
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/* Predict how many bytes will be relaxed with ex9 and ifc. */
+
+static void
+nds32_elf_ex9_total_relax (struct bfd_link_info *info)
+{
+ struct elf_nds32_insn_times_entry *ex9_insn;
+ struct elf_nds32_insn_times_entry *temp;
+ int target_optimize;
+ struct elf_nds32_link_hash_table *table;
+
+ if (ex9_insn_head == NULL)
+ return;
+
+ table = nds32_elf_hash_table (info);
+ target_optimize = table->target_optimize;
+ ex9_insn = ex9_insn_head;
+ while (ex9_insn)
+ {
+ ex9_relax_size = ex9_insn->times * 2 + ex9_relax_size;
+ temp = ex9_insn;
+ ex9_insn = ex9_insn->next;
+ free (temp);
+ }
+ ex9_insn_head = NULL;
+
+ if ((target_optimize & NDS32_RELAX_JUMP_IFC_ON))
+ {
+ /* Examine ifc reduce size. */
+ struct elf_nds32_ifc_symbol_entry *ifc_ent = ifc_symbol_head;
+ struct elf_nds32_ifc_irel_list *irel_ptr = NULL;
+ int size = 0;
+
+ while (ifc_ent)
+ {
+ if (ifc_ent->enable == 0)
+ {
+ /* Not ifc yet. */
+ irel_ptr = ifc_ent->irel_head;
+ while (irel_ptr)
+ {
+ size += 2;
+ irel_ptr = irel_ptr->next;
+ }
+ }
+ size -= 2;
+ ifc_ent = ifc_ent->next;
+ }
+ ex9_relax_size += size;
+ }
+}
+
+/* Finish ex9 table. */
+
+void
+nds32_elf_ex9_finish (struct bfd_link_info *link_info)
+{
+ nds32_elf_code_hash_traverse (nds32_elf_examine_insn_times);
+ nds32_elf_order_insn_times (link_info);
+ nds32_elf_ex9_total_relax (link_info);
+ /* Traverse the hash table and count its times. */
+ nds32_elf_code_hash_traverse (nds32_elf_count_insn_times);
+ nds32_elf_order_insn_times (link_info);
+ nds32_elf_ex9_build_itable (link_info);
+}
+
+/* Relocate the entries in ex9 table. */
+
+static bfd_vma
+nds32_elf_ex9_reloc_insn (struct elf_nds32_insn_times_entry *ptr,
+ struct bfd_link_info *link_info)
+{
+ Elf_Internal_Sym *isym = NULL;
+ bfd_vma relocation = -1;
+ struct elf_link_hash_entry *h;
+
+ if (ptr->m_list != NULL)
+ {
+ /* Global symbol. */
+ h = ptr->m_list->h_list->h;
+ if ((h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && h->root.u.def.section != NULL
+ && h->root.u.def.section->output_section != NULL)
+ {
+
+ relocation = h->root.u.def.value +
+ h->root.u.def.section->output_section->vma +
+ h->root.u.def.section->output_offset;
+ relocation += ptr->m_list->irel->r_addend;
+ }
+ else
+ relocation = 0;
+ }
+ else if (ptr->sec !=NULL)
+ {
+ /* Local symbol. */
+ Elf_Internal_Sym sym;
+ asection *sec = NULL;
+ asection isec;
+ asection *isec_ptr = &isec;
+ Elf_Internal_Rela irel_backup = *(ptr->irel);
+ asection *sec_backup = ptr->sec;
+ bfd *abfd = ptr->sec->owner;
+
+ if (!nds32_get_local_syms (abfd, sec, &isym))
+ return FALSE;
+ isym = isym + ELF32_R_SYM (ptr->irel->r_info);
+
+ sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ if (sec != NULL)
+ *isec_ptr = *sec;
+ sym = *isym;
+
+ /* The purpose is same as elf_link_input_bfd. */
+ if (isec_ptr != NULL
+ && isec_ptr->sec_info_type == SEC_INFO_TYPE_MERGE
+ && ELF_ST_TYPE (isym->st_info) != STT_SECTION)
+ {
+ sym.st_value =
+ _bfd_merged_section_offset (ptr->sec->output_section->owner, &isec_ptr,
+ elf_section_data (isec_ptr)->sec_info,
+ isym->st_value);
+ }
+ relocation = _bfd_elf_rela_local_sym (link_info->output_bfd, &sym,
+ &ptr->sec, ptr->irel);
+ if (ptr->irel != NULL)
+ relocation += ptr->irel->r_addend;
+
+ /* Restore origin value since there may be some insntructions that
+ could not be replaced with ex9.it. */
+ *(ptr->irel) = irel_backup;
+ ptr->sec = sec_backup;
+ }
+
+ return relocation;
+}
+
+/* Import ex9 table and build list. */
+
+void
+nds32_elf_ex9_import_table (struct bfd_link_info *info)
+{
+ int num = 0;
+ bfd_byte *contents;
+ unsigned long insn;
+ FILE *ex9_import_file;
+ int update_ex9_table;
+ struct elf_nds32_link_hash_table *table;
+
+ table = nds32_elf_hash_table (info);
+ ex9_import_file = table->ex9_import_file;
+ rewind (table->ex9_import_file);
+
+ contents = bfd_malloc (sizeof (bfd_byte) * 4);
+
+ /* Read instructions from the input file and build the list. */
+ while (!feof (ex9_import_file))
+ {
+ char *code;
+ struct elf_nds32_insn_times_entry *ptr;
+ size_t nread;
+
+ nread = fread (contents, sizeof (bfd_byte) * 4, 1, ex9_import_file);
+ /* Ignore the final byte 0x0a. */
+ if (nread < 1)
+ break;
+ insn = bfd_getb32 (contents);
+ code = bfd_malloc (sizeof (char) * 9);
+ snprintf (code, 9, "%08lx", insn);
+ ptr = bfd_malloc (sizeof (struct elf_nds32_insn_times_entry));
+ ptr->string = code;
+ ptr->order = num;
+ ptr->times = -1;
+ ptr->sec = NULL;
+ ptr->m_list = NULL;
+ ptr->rel_backup.r_offset = 0;
+ ptr->rel_backup.r_info = 0;
+ ptr->rel_backup.r_addend = 0;
+ ptr->irel = NULL;
+ ptr->next = NULL;
+ nds32_elf_ex9_insert_entry (ptr);
+ num++;
+ }
+
+ update_ex9_table = table->update_ex9_table;
+ if (update_ex9_table == 1)
+ {
+ /* It has to consider of sethi need to use multiple page
+ but it not be done yet. */
+ nds32_elf_code_hash_traverse (nds32_elf_examine_insn_times);
+ nds32_elf_order_insn_times (info);
+ }
+}
+
+/* Export ex9 table. */
+
+static void
+nds32_elf_ex9_export (struct bfd_link_info *info,
+ bfd_byte *contents, int size)
+{
+ FILE *ex9_export_file;
+ struct elf_nds32_link_hash_table *table;
+
+ table = nds32_elf_hash_table (info);
+ ex9_export_file = table->ex9_export_file;
+ fwrite (contents, sizeof (bfd_byte), size, ex9_export_file);
+ fclose (ex9_export_file);
+}
+
+/* Adjust relocations of J and JAL in ex9.itable.
+ Export ex9 table. */
+
+static void
+nds32_elf_ex9_reloc_jmp (struct bfd_link_info *link_info)
+{
+ asection *table_sec = NULL;
+ struct elf_nds32_insn_times_entry *ex9_insn = ex9_insn_head;
+ struct elf_nds32_insn_times_entry *temp_ptr, *temp_ptr2;
+ bfd *it_abfd;
+ uint32_t insn, insn_with_reg, source_insn;
+ bfd_byte *contents = NULL, *source_contents = NULL;
+ int size = 0;
+ bfd_vma gp;
+ int shift, update_ex9_table, offset = 0;
+ reloc_howto_type *howto = NULL;
+ Elf_Internal_Rela rel_backup;
+ unsigned short insn_ex9;
+ struct elf_nds32_link_hash_table *table;
+ FILE *ex9_export_file;
+ static bfd_boolean done = FALSE;
+
+ if (done)
+ return;
+
+ done = TRUE;
+
+ table = nds32_elf_hash_table (link_info);
+ if (table)
+ table->relax_status |= NDS32_RELAX_EX9_DONE;
+
+
+ update_ex9_table = table->update_ex9_table;
+ /* Generated ex9.itable exactly. */
+ if (update_ex9_table == 0)
+ {
+ for (it_abfd = link_info->input_bfds; it_abfd != NULL;
+ it_abfd = it_abfd->link.next)
+ {
+ table_sec = bfd_get_section_by_name (it_abfd, ".ex9.itable");
+ if (table_sec != NULL)
+ break;
+ }
+
+ if (table_sec != NULL)
+ {
+ bfd *output_bfd;
+
+ output_bfd = table_sec->output_section->owner;
+ nds32_elf_final_sda_base (output_bfd, link_info, &gp, FALSE);
+ if (table_sec->size == 0)
+ return;
+
+ if (!nds32_get_section_contents (it_abfd, table_sec, &contents))
+ return;
+ }
+ }
+ else
+ {
+ /* Set gp. */
+ bfd *output_bfd;
+
+ output_bfd = link_info->input_bfds->sections->output_section->owner;
+ nds32_elf_final_sda_base (output_bfd, link_info, &gp, FALSE);
+ contents = bfd_malloc (sizeof (bfd_byte) * 2048);
+ }
+
+ /* Relocate instruction. */
+ while (ex9_insn)
+ {
+ bfd_vma relocation, min_relocation = 0xffffffff;
+
+ insn = strtol (ex9_insn->string, NULL, 16);
+ insn_with_reg = 0;
+ if (ex9_insn->m_list != NULL || ex9_insn->sec != NULL)
+ {
+ if (ex9_insn->m_list)
+ rel_backup = ex9_insn->m_list->rel_backup;
+ else
+ rel_backup = ex9_insn->rel_backup;
+
+ nds32_elf_get_insn_with_reg (&rel_backup, insn, &insn_with_reg);
+ howto =
+ bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE
+ (rel_backup.r_info));
+ shift = howto->rightshift;
+ if (ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_25_PCREL_RELA
+ || ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_LO12S0_ORI_RELA
+ || ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_LO12S0_RELA
+ || ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_LO12S1_RELA
+ || ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_LO12S2_RELA)
+ {
+ relocation = nds32_elf_ex9_reloc_insn (ex9_insn, link_info);
+ insn =
+ insn_with_reg | ((relocation >> shift) &
+ nds32_elf_irel_mask (&rel_backup));
+ bfd_putb32 (insn, contents + (ex9_insn->order) * 4);
+ }
+ else if ((ELF32_R_TYPE (rel_backup.r_info) >= R_NDS32_SDA15S3
+ && ELF32_R_TYPE (rel_backup.r_info) <= R_NDS32_SDA15S0)
+ || (ELF32_R_TYPE (rel_backup.r_info) >= R_NDS32_SDA15S3_RELA
+ && ELF32_R_TYPE (rel_backup.r_info) <= R_NDS32_SDA15S0_RELA)
+ || (ELF32_R_TYPE (rel_backup.r_info) >= R_NDS32_SDA12S2_DP_RELA
+ && ELF32_R_TYPE (rel_backup.r_info) <= R_NDS32_SDA12S2_SP_RELA)
+ || (ELF32_R_TYPE (rel_backup.r_info) >= R_NDS32_SDA16S3_RELA
+ && ELF32_R_TYPE (rel_backup.r_info) <= R_NDS32_SDA19S0_RELA))
+ {
+ relocation = nds32_elf_ex9_reloc_insn (ex9_insn, link_info);
+ insn =
+ insn_with_reg | (((relocation - gp) >> shift) &
+ nds32_elf_irel_mask (&rel_backup));
+ bfd_putb32 (insn, contents + (ex9_insn->order) * 4);
+ }
+ else if (ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_HI20_RELA)
+ {
+ /* Sethi may be multiple entry for one insn. */
+ if (ex9_insn->next && ex9_insn->m_list
+ && ex9_insn->m_list == ex9_insn->next->m_list)
+ {
+ struct elf_link_hash_entry_mul_list *m_list;
+ struct elf_nds32_ex9_refix *fix_ptr;
+ struct elf_link_hash_entry *h;
+
+ temp_ptr = ex9_insn;
+ temp_ptr2 = ex9_insn;
+ m_list = ex9_insn->m_list;
+ while (m_list)
+ {
+ h = m_list->h_list->h;
+ relocation = h->root.u.def.value +
+ h->root.u.def.section->output_section->vma +
+ h->root.u.def.section->output_offset;
+ relocation += m_list->irel->r_addend;
+
+ if (relocation < min_relocation)
+ min_relocation = relocation;
+ m_list = m_list->next;
+ }
+ relocation = min_relocation;
+
+ /* Put insntruction into ex9 table. */
+ insn = insn_with_reg
+ | ((relocation >> shift) & nds32_elf_irel_mask (&rel_backup));
+ bfd_putb32 (insn, contents + (ex9_insn->order) * 4);
+ relocation = relocation + 0x1000; /* hi20 */
+
+ while (ex9_insn->next && ex9_insn->m_list
+ && ex9_insn->m_list == ex9_insn->next->m_list)
+ {
+ /* Multiple sethi. */
+ ex9_insn = ex9_insn->next;
+ size += 4;
+ insn =
+ insn_with_reg | ((relocation >> shift) &
+ nds32_elf_irel_mask (&rel_backup));
+ bfd_putb32 (insn, contents + (ex9_insn->order) * 4);
+ relocation = relocation + 0x1000; /* hi20 */
+ }
+
+ fix_ptr = ex9_refix_head;
+ while (fix_ptr)
+ {
+ /* Fix ex9 insn. */
+ /* temp_ptr2 points to the head of multiple sethi. */
+ temp_ptr = temp_ptr2;
+ while (fix_ptr->order != temp_ptr->order && fix_ptr->next)
+ {
+ fix_ptr = fix_ptr->next;
+ }
+ if (fix_ptr->order != temp_ptr->order)
+ break;
+
+ /* Set source insn. */
+ relocation =
+ fix_ptr->h->root.u.def.value +
+ fix_ptr->h->root.u.def.section->output_section->vma +
+ fix_ptr->h->root.u.def.section->output_offset;
+ relocation += fix_ptr->irel->r_addend;
+ /* sethi imm is imm20s. */
+ source_insn = insn_with_reg | ((relocation >> shift) & 0xfffff);
+
+ while (temp_ptr)
+ {
+ /* Match entry and source code. */
+ insn = bfd_getb32 (contents + (temp_ptr->order) * 4 + offset);
+ if (insn == source_insn)
+ {
+ /* Fix the ex9 insn. */
+ if (temp_ptr->order != fix_ptr->order)
+ {
+ if (!nds32_get_section_contents
+ (fix_ptr->sec->owner, fix_ptr->sec,
+ &source_contents))
+ (*_bfd_error_handler)
+ (_("Linker: error cannot fixed ex9 relocation \n"));
+ if (temp_ptr->order < 32)
+ insn_ex9 = INSN_EX9_IT_2;
+ else
+ insn_ex9 = INSN_EX9_IT_1;
+ insn_ex9 = insn_ex9 | temp_ptr->order;
+ bfd_putb16 (insn_ex9, source_contents + fix_ptr->irel->r_offset);
+ }
+ break;
+ }
+ else
+ {
+ if (!temp_ptr->next || temp_ptr->m_list != temp_ptr->next->m_list)
+ (*_bfd_error_handler)
+ (_("Linker: error cannot fixed ex9 relocation \n"));
+ else
+ temp_ptr = temp_ptr->next;
+ }
+ }
+ fix_ptr = fix_ptr->next;
+ }
+ }
+ else
+ {
+ relocation = nds32_elf_ex9_reloc_insn (ex9_insn, link_info);
+ insn = insn_with_reg
+ | ((relocation >> shift) & nds32_elf_irel_mask (&rel_backup));
+ bfd_putb32 (insn, contents + (ex9_insn->order) * 4);
+ }
+ }
+ }
+ else
+ {
+ /* Insn without relocation does not have to be fixed
+ if need to update export table. */
+ if (update_ex9_table == 1)
+ bfd_putb32 (insn, contents + (ex9_insn->order) * 4);
+ }
+ ex9_insn = ex9_insn->next;
+ size += 4;
+ }
+
+ ex9_export_file = table->ex9_export_file;
+ if (ex9_export_file != NULL)
+ nds32_elf_ex9_export (link_info, contents, table_sec->size);
+ else if (update_ex9_table == 1)
+ {
+ table->ex9_export_file = table->ex9_import_file;
+ rewind (table->ex9_export_file);
+ nds32_elf_ex9_export (link_info, contents, size);
+ }
+}
+
+/* Generate ex9 hash table. */
+
+static bfd_boolean
+nds32_elf_ex9_build_hash_table (bfd *abfd, asection *sec,
+ struct bfd_link_info *link_info)
+{
+ Elf_Internal_Rela *internal_relocs;
+ Elf_Internal_Rela *irelend;
+ Elf_Internal_Rela *irel;
+ Elf_Internal_Rela *jrel;
+ Elf_Internal_Rela rel_backup;
+ Elf_Internal_Shdr *symtab_hdr;
+ Elf_Internal_Sym *isym = NULL;
+ asection *isec;
+ struct elf_link_hash_entry **sym_hashes;
+ bfd_byte *contents = NULL;
+ bfd_vma off = 0;
+ unsigned long r_symndx;
+ uint32_t insn, insn_with_reg;
+ struct elf_link_hash_entry *h;
+ int data_flag, shift, align;
+ bfd_vma relocation;
+ /* Suppress ex9 if `.no_relax ex9' or inner loop. */
+ reloc_howto_type *howto = NULL;
+
+ sym_hashes = elf_sym_hashes (abfd);
+ /* Load section instructions, relocations, and symbol table. */
+ if (!nds32_get_section_contents (abfd, sec, &contents))
+ return FALSE;
+
+ internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
+ TRUE /* keep_memory */);
+ irelend = internal_relocs + sec->reloc_count;
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ if (!nds32_get_local_syms (abfd, sec, &isym))
+ return FALSE;
+
+ /* Check the object if enable ex9. */
+ irel = find_relocs_at_address (internal_relocs, internal_relocs, irelend,
+ R_NDS32_RELAX_ENTRY);
+
+ /* Check this section trigger ex9 relaxation. */
+ if (irel == NULL
+ || irel >= irelend
+ || ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_ENTRY
+ || (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY
+ && !(irel->r_addend & R_NDS32_RELAX_ENTRY_EX9_FLAG)))
+ return TRUE;
+
+ irel = internal_relocs;
+
+ /* Push each insn into hash table. */
+ while (off < sec->size)
+ {
+ char code[10];
+ struct elf_nds32_code_hash_entry *entry;
+
+ while (irel != NULL && irel < irelend && irel->r_offset < off)
+ irel++;
+
+ data_flag = nds32_elf_ex9_relocation_check (link_info, &irel, irelend,
+ NULL, sec, &off, contents);
+ if (data_flag & DATA_EXIST)
+ {
+ /* We save the move offset in the highest byte. */
+ off += (data_flag >> 24);
+ continue;
+ }
+
+ if (*(contents + off) & 0x80)
+ {
+ off += 2;
+ }
+ else
+ {
+ h = NULL;
+ isec = NULL;
+ jrel = NULL;
+ rel_backup.r_info = 0;
+ rel_backup.r_offset = 0;
+ rel_backup.r_addend = 0;
+ /* Load the instruction and its opcode with register for comparing. */
+ insn = bfd_getb32 (contents + off);
+ insn_with_reg = 0;
+ if (irel != NULL && irel < irelend && irel->r_offset == off)
+ {
+ nds32_elf_get_insn_with_reg (irel, insn, &insn_with_reg);
+ howto = bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE (irel->r_info));
+ shift = howto->rightshift;
+ align = (1 << shift) - 1;
+ if (ELF32_R_TYPE (irel->r_info) == R_NDS32_25_PCREL_RELA
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_HI20_RELA
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S0_ORI_RELA
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S0_RELA
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S1_RELA
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_RELA
+ ||(ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0)
+ || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3_RELA
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0_RELA)
+ || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA12S2_DP_RELA
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA12S2_SP_RELA)
+ || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA16S3_RELA
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA19S0_RELA))
+ {
+ r_symndx = ELF32_R_SYM (irel->r_info);
+ jrel = irel;
+ rel_backup = *irel;
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ /* Local symbol. */
+ int shndx = isym[r_symndx].st_shndx;
+
+ bfd_vma st_value = (isym + r_symndx)->st_value;
+ isec = elf_elfsections (abfd)[shndx]->bfd_section;
+ relocation = (isec->output_section->vma + isec->output_offset
+ + st_value + irel->r_addend);
+ }
+ else
+ {
+ /* External symbol. */
+ bfd_boolean warned ATTRIBUTE_UNUSED;
+ bfd_boolean ignored ATTRIBUTE_UNUSED;
+ bfd_boolean unresolved_reloc ATTRIBUTE_UNUSED;
+ asection *sym_sec;
+
+ /* Maybe there is a better way to get h and relocation */
+ RELOC_FOR_GLOBAL_SYMBOL (link_info, abfd, sec, irel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sym_sec, relocation,
+ unresolved_reloc, warned, ignored);
+ relocation += irel->r_addend;
+ if ((h->root.type != bfd_link_hash_defined
+ && h->root.type != bfd_link_hash_defweak)
+ || strcmp (h->root.root.string, "_FP_BASE_") == 0)
+ {
+ off += 4;
+ continue;
+ }
+ }
+
+ /* Check for gp relative instruction alignment. */
+ if ((ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0)
+ || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3_RELA
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0_RELA)
+ || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA12S2_DP_RELA
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA12S2_SP_RELA)
+ || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA16S3_RELA
+ && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA19S0_RELA))
+ {
+ bfd_vma gp;
+ bfd *output_bfd = sec->output_section->owner;
+ bfd_reloc_status_type r;
+
+ /* If the symbol is in the abs section, the out_bfd will be null.
+ This happens when the relocation has a symbol@GOTOFF. */
+ r = nds32_elf_final_sda_base (output_bfd, link_info, &gp, FALSE);
+ if (r != bfd_reloc_ok)
+ {
+ off += 4;
+ continue;
+ }
+
+ relocation -= gp;
+
+ /* Make sure alignment is correct. */
+ if (relocation & align)
+ {
+ /* Incorrect alignment. */
+ (*_bfd_error_handler)
+ (_("%s: warning: unaligned small data access. "
+ "For entry: {%d, %d, %d}, addr = 0x%x, align = 0x%x."),
+ bfd_get_filename (abfd), irel->r_offset,
+ irel->r_info, irel->r_addend, relocation, align);
+ off += 4;
+ continue;
+ }
+ }
+
+ insn = insn_with_reg
+ | ((relocation >> shift) & nds32_elf_irel_mask (irel));
+ }
+ else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_BEGIN
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_END
+ || ELF32_R_TYPE (irel->r_info) == R_NDS32_NONE)
+ {
+ /* These relocations do not have to relocate contens, so it can
+ be regard as instruction without relocation. */
+ }
+ else
+ {
+ off += 4;
+ continue;
+ }
+ }
+
+ snprintf (code, sizeof (code), "%08x", insn);
+ /* Copy "code". */
+ entry = (struct elf_nds32_code_hash_entry*)
+ bfd_hash_lookup (&ex9_code_table, code, TRUE, TRUE);
+ if (entry == NULL)
+ {
+ (*_bfd_error_handler)
+ (_("%P%F: failed creating ex9.it %s hash table: %E\n"), code);
+ return FALSE;
+ }
+ if (h)
+ {
+ if (h->root.type == bfd_link_hash_undefined)
+ return TRUE;
+ /* Global symbol. */
+ /* In order to do sethi with different symbol but same value. */
+ if (entry->m_list == NULL)
+ {
+ struct elf_link_hash_entry_mul_list *m_list_new;
+ struct elf_link_hash_entry_list *h_list_new;
+
+ m_list_new = (struct elf_link_hash_entry_mul_list *)
+ bfd_malloc (sizeof (struct elf_link_hash_entry_mul_list));
+ h_list_new = (struct elf_link_hash_entry_list *)
+ bfd_malloc (sizeof (struct elf_link_hash_entry_list));
+ entry->m_list = m_list_new;
+ m_list_new->h_list = h_list_new;
+ m_list_new->rel_backup = rel_backup;
+ m_list_new->times = 1;
+ m_list_new->irel = jrel;
+ m_list_new->next = NULL;
+ h_list_new->h = h;
+ h_list_new->next = NULL;
+ }
+ else
+ {
+ struct elf_link_hash_entry_mul_list *m_list = entry->m_list;
+ struct elf_link_hash_entry_list *h_list;
+
+ while (m_list)
+ {
+ /* Build the different symbols that point to the same address. */
+ h_list = m_list->h_list;
+ if (h_list->h->root.u.def.value == h->root.u.def.value
+ && h_list->h->root.u.def.section->output_section->vma
+ == h->root.u.def.section->output_section->vma
+ && h_list->h->root.u.def.section->output_offset
+ == h->root.u.def.section->output_offset
+ && m_list->rel_backup.r_addend == rel_backup.r_addend)
+ {
+ m_list->times++;
+ m_list->irel = jrel;
+ while (h_list->h != h && h_list->next)
+ h_list = h_list->next;
+ if (h_list->h != h)
+ {
+ struct elf_link_hash_entry_list *h_list_new;
+
+ h_list_new = (struct elf_link_hash_entry_list *)
+ bfd_malloc (sizeof (struct elf_link_hash_entry_list));
+ h_list->next = h_list_new;
+ h_list_new->h = h;
+ h_list_new->next = NULL;
+ }
+ break;
+ }
+ /* The sethi case may have different address but the
+ hi20 is the same. */
+ else if (ELF32_R_TYPE (jrel->r_info) == R_NDS32_HI20_RELA
+ && m_list->next == NULL)
+ {
+ struct elf_link_hash_entry_mul_list *m_list_new;
+ struct elf_link_hash_entry_list *h_list_new;
+
+ m_list_new = (struct elf_link_hash_entry_mul_list *)
+ bfd_malloc (sizeof (struct elf_link_hash_entry_mul_list));
+ h_list_new = (struct elf_link_hash_entry_list *)
+ bfd_malloc (sizeof (struct elf_link_hash_entry_list));
+ m_list->next = m_list_new;
+ m_list_new->h_list = h_list_new;
+ m_list_new->rel_backup = rel_backup;
+ m_list_new->times = 1;
+ m_list_new->irel = jrel;
+ m_list_new->next = NULL;
+ h_list_new->h = h;
+ h_list_new->next = NULL;
+ break;
+ }
+ m_list = m_list->next;
+ }
+ if (!m_list)
+ {
+ off += 4;
+ continue;
+ }
+ }
+ }
+ else
+ {
+ /* Local symbol and insn without relocation*/
+ entry->times++;
+ entry->rel_backup = rel_backup;
+ }
+
+ /* Use in sethi insn with constant and global symbol in same format. */
+ if (!jrel)
+ entry->const_insn = 1;
+ else
+ entry->irel = jrel;
+ entry->sec = isec;
+ off += 4;
+ }
+ }
+ return TRUE;
+}
+
+/* Set the _ITB_BASE, and point it to ex9 table. */
+
+bfd_boolean
+nds32_elf_ex9_itb_base (struct bfd_link_info *link_info)
+{
+ bfd *abfd;
+ asection *sec;
+ bfd *output_bfd = NULL;
+ struct bfd_link_hash_entry *bh = NULL;
+
+ if (is_ITB_BASE_set == 1)
+ return TRUE;
+
+ is_ITB_BASE_set = 1;
+
+ bh = bfd_link_hash_lookup (link_info->hash, "_ITB_BASE_", FALSE, FALSE, TRUE);
+
+ if (bh && (bh->type == bfd_link_hash_defined
+ || bh->type == bfd_link_hash_defweak))
+ return TRUE;
+
+ for (abfd = link_info->input_bfds; abfd != NULL;
+ abfd = abfd->link.next)
+ {
+ sec = bfd_get_section_by_name (abfd, ".ex9.itable");
+ if (sec != NULL)
+ {
+ output_bfd = sec->output_section->owner;
+ break;
+ }
+ }
+ if (output_bfd == NULL)
+ {
+ output_bfd = link_info->output_bfd;
+ if (output_bfd->sections == NULL)
+ return TRUE;
+ else
+ sec = bfd_abs_section_ptr;
+ }
+ bh = bfd_link_hash_lookup (link_info->hash, "_ITB_BASE_",
+ FALSE, FALSE, TRUE);
+ return (_bfd_generic_link_add_one_symbol
+ (link_info, output_bfd, "_ITB_BASE_",
+ BSF_GLOBAL | BSF_WEAK, sec, 0,
+ (const char *) NULL, FALSE, get_elf_backend_data
+ (output_bfd)->collect, &bh));
+} /* End EX9.IT */
+
+
+#define ELF_ARCH bfd_arch_nds32
+#define ELF_MACHINE_CODE EM_NDS32
+#define ELF_MAXPAGESIZE 0x1000
+#define ELF_TARGET_ID NDS32_ELF_DATA
+
+#define TARGET_BIG_SYM nds32_elf32_be_vec
+#define TARGET_BIG_NAME "elf32-nds32be"
+#define TARGET_LITTLE_SYM nds32_elf32_le_vec
+#define TARGET_LITTLE_NAME "elf32-nds32le"
+
+#define elf_info_to_howto nds32_info_to_howto
+#define elf_info_to_howto_rel nds32_info_to_howto_rel
+
+#define bfd_elf32_bfd_link_hash_table_create nds32_elf_link_hash_table_create
+#define bfd_elf32_bfd_merge_private_bfd_data nds32_elf_merge_private_bfd_data
+#define bfd_elf32_bfd_print_private_bfd_data nds32_elf_print_private_bfd_data
+#define bfd_elf32_bfd_relax_section nds32_elf_relax_section
+#define bfd_elf32_bfd_set_private_flags nds32_elf_set_private_flags
+
+#define bfd_elf32_mkobject nds32_elf_mkobject
+#define elf_backend_action_discarded nds32_elf_action_discarded
+#define elf_backend_add_symbol_hook nds32_elf_add_symbol_hook
+#define elf_backend_check_relocs nds32_elf_check_relocs
+#define elf_backend_adjust_dynamic_symbol nds32_elf_adjust_dynamic_symbol
+#define elf_backend_create_dynamic_sections nds32_elf_create_dynamic_sections
+#define elf_backend_finish_dynamic_sections nds32_elf_finish_dynamic_sections
+#define elf_backend_finish_dynamic_symbol nds32_elf_finish_dynamic_symbol
+#define elf_backend_size_dynamic_sections nds32_elf_size_dynamic_sections
+#define elf_backend_relocate_section nds32_elf_relocate_section
+#define elf_backend_gc_mark_hook nds32_elf_gc_mark_hook
+#define elf_backend_gc_sweep_hook nds32_elf_gc_sweep_hook
+#define elf_backend_grok_prstatus nds32_elf_grok_prstatus
+#define elf_backend_grok_psinfo nds32_elf_grok_psinfo
+#define elf_backend_reloc_type_class nds32_elf_reloc_type_class
+#define elf_backend_copy_indirect_symbol nds32_elf_copy_indirect_symbol
+#define elf_backend_link_output_symbol_hook nds32_elf_output_symbol_hook
+#define elf_backend_output_arch_syms nds32_elf_output_arch_syms
+#define elf_backend_object_p nds32_elf_object_p
+#define elf_backend_final_write_processing nds32_elf_final_write_processing
+#define elf_backend_special_sections nds32_elf_special_sections
+#define bfd_elf32_bfd_get_relocated_section_contents \
+ nds32_elf_get_relocated_section_contents
+
+#define elf_backend_can_gc_sections 1
+#define elf_backend_can_refcount 1
+#define elf_backend_want_got_plt 1
+#define elf_backend_plt_readonly 1
+#define elf_backend_want_plt_sym 0
+#define elf_backend_got_header_size 12
+#define elf_backend_may_use_rel_p 1
+#define elf_backend_default_use_rela_p 1
+#define elf_backend_may_use_rela_p 1
+
+#include "elf32-target.h"
+
+#undef ELF_MAXPAGESIZE
+#define ELF_MAXPAGESIZE 0x2000
+
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM nds32_elf32_linux_be_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf32-nds32be-linux"
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM nds32_elf32_linux_le_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf32-nds32le-linux"
+#undef elf32_bed
+#define elf32_bed elf32_nds32_lin_bed
+
+#include "elf32-target.h"
diff --git a/binutils-2.25/bfd/elf32-nds32.h b/binutils-2.25/bfd/elf32-nds32.h
new file mode 100644
index 00000000..d4d4e934
--- /dev/null
+++ b/binutils-2.25/bfd/elf32-nds32.h
@@ -0,0 +1,155 @@
+/* NDS32-specific support for 32-bit ELF.
+ Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ Contributed by Andes Technology Corporation.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ 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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA.*/
+
+#ifndef ELF32_NDS32_H
+#define ELF32_NDS32_H
+
+/* Relocation flags encoded in r_addend. */
+
+/* Relocation flags for R_NDS32_ERLAX_ENTRY. */
+
+/* Set if relax on this section is done or disabled. */
+#define R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG (1 << 31)
+/* Optimize for performance. */
+#define R_NDS32_RELAX_ENTRY_OPTIMIZE_FLAG (1 << 30)
+/* Optimize for size. Branch destination 4-byte adjustment
+ may be disabled. */
+#define R_NDS32_RELAX_ENTRY_OPTIMIZE_FOR_SPACE_FLAG (1 << 29)
+/* To distinguish the assembly code generated by compiler
+ or written manually. */
+#define R_NDS32_RELAX_ENTRY_VERBATIM_FLAG (1 << 28)
+/* EX9 and link-time IFC must be explicitly enabled, so we
+ won't mess up handcraft assembly code. */
+/* Enable EX9 optimization for this section. */
+#define R_NDS32_RELAX_ENTRY_EX9_FLAG (1 << 2)
+/* Enable IFC optimization for this section. */
+#define R_NDS32_RELAX_ENTRY_IFC_FLAG (1 << 3)
+
+
+/* Relocation flags for R_NDS32_INSN16. */
+
+/* Tag the nop16 can be removed. */
+#define R_NDS32_INSN16_CONVERT_FLAG (1 << 0)
+/* Convert a gp-relative access (e.g., lwi.gp)
+ to fp-as-gp access (lwi37.fp).
+ This value is used by linker internally only.
+ It's fine to change the vlaue. */
+#define R_NDS32_INSN16_FP7U2_FLAG (1 << 1)
+
+/* Relocation flags for R_NDS32_RELAX_REGION_OMIT_FP_START/END. */
+
+/* OMIT_FP_FLAG marks the region for applying fp-as-gp
+ optimization. */
+#define R_NDS32_RELAX_REGION_OMIT_FP_FLAG (1 << 0)
+/* NOT_OMIT_FP_FLAG is set if this region is not worth
+ for fp-as-gp. */
+#define R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG (1 << 1)
+/* Suppress EX9 optimization in the region. */
+#define R_NDS32_RELAX_REGION_NO_EX9_FLAG (1 << 2)
+/* A Innermost loop region. Some optimizations is suppressed
+ in this region due to performance drop. */
+#define R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG (1 << 4)
+
+/* Tag range for LOADSTORE relocation. */
+enum
+{
+ NDS32_LOADSTORE_NONE = 0x0,
+ NDS32_LOADSTORE_BYTE = 0x1,
+ NDS32_LOADSTORE_HALF = 0x2,
+ NDS32_LOADSTORE_WORD = 0x4,
+ NDS32_LOADSTORE_FLOAT_S = 0x8,
+ NDS32_LOADSTORE_FLOAT_D = 0x10,
+ NDS32_LOADSTORE_IMM = 0x20
+};
+
+/* Relax tag for nds32_elf_relax_section, we have to specify which
+ optimization do in this round. */
+enum
+{
+ NDS32_RELAX_NONE_ROUND = 0,
+ NDS32_RELAX_NORMAL_ROUND,
+ NDS32_RELAX_JUMP_IFC_ROUND,
+ NDS32_RELAX_EX9_BUILD_ROUND,
+ NDS32_RELAX_EX9_REPLACE_ROUND,
+ NDS32_RELAX_EMPTY_ROUND
+};
+
+/* Optimization status mask. */
+#define NDS32_RELAX_JUMP_IFC_DONE (1 << 0)
+#define NDS32_RELAX_EX9_DONE (1 << 1)
+
+/* Optimization turn on mask. */
+#define NDS32_RELAX_JUMP_IFC_ON (1 << 0)
+#define NDS32_RELAX_EX9_ON (1 << 1)
+
+extern void nds32_insertion_sort
+ (void *, size_t, size_t, int (*) (const void *, const void *));
+
+extern int nds32_elf_ex9_init (void);
+extern int nds32_convert_32_to_16 (bfd *, uint32_t, uint16_t *, int *);
+extern int nds32_convert_16_to_32 (bfd *, uint16_t, uint32_t *);
+extern void bfd_elf32_nds32_set_target_option (struct bfd_link_info *,
+ int, int, FILE *, int,
+ int, int, int, FILE *,
+ FILE *, int, int,
+ bfd_boolean, bfd_boolean);
+
+#define nds32_elf_hash_table(info) \
+ (elf_hash_table_id ((struct elf_link_hash_table *) ((info)->hash)) \
+ == NDS32_ELF_DATA ? \
+ ((struct elf_nds32_link_hash_table *) ((info)->hash)) : NULL)
+
+/* Hash table structure for target nds32. There are some members to
+ save target options passed from nds32elf.em to bfd. */
+
+struct elf_nds32_link_hash_table
+{
+ struct elf_link_hash_table root;
+
+ /* Short-cuts to get to dynamic linker sections. */
+ asection *sgot;
+ asection *sgotplt;
+ asection *srelgot;
+ asection *splt;
+ asection *srelplt;
+ asection *sdynbss;
+ asection *srelbss;
+
+ /* Small local sym to section mapping cache. */
+ struct sym_cache sym_cache;
+
+ /* Target dependent options. */
+ int relax_fp_as_gp; /* --mrelax-omit-fp */
+ int eliminate_gc_relocs; /* --meliminate-gc-relocs */
+ FILE *sym_ld_script; /* --mgen-symbol-ld-script=<file> */
+ /* Disable if linking a dynamically linked executable. */
+ int load_store_relax;
+ int target_optimize; /* Switch optimization. */
+ int relax_status; /* Finished optimization. */
+ int relax_round; /* Going optimization. */
+ FILE *ex9_export_file; /* --mexport-ex9=<file> */
+ FILE *ex9_import_file; /* --mimport-ex9=<file> */
+ int update_ex9_table; /* --mupdate-ex9. */
+ int ex9_limit;
+ bfd_boolean ex9_loop_aware; /* Ignore ex9 if inside a loop. */
+ bfd_boolean ifc_loop_aware; /* Ignore ifc if inside a loop. */
+};
+#endif
diff --git a/binutils-2.25/bfd/elf32-nios2.c b/binutils-2.25/bfd/elf32-nios2.c
index a6c67201..9b3f4361 100644
--- a/binutils-2.25/bfd/elf32-nios2.c
+++ b/binutils-2.25/bfd/elf32-nios2.c
@@ -1,5 +1,5 @@
/* 32-bit ELF support for Nios II.
- Copyright (C) 2012, 2013 Free Software Foundation, Inc.
+ Copyright (C) 2012-2014 Free Software Foundation, Inc.
Contributed by Nigel Gray (ngray@altera.com).
Contributed by Mentor Graphics, Inc.
@@ -30,6 +30,7 @@
#include "elf-bfd.h"
#include "elf/nios2.h"
#include "opcode/nios2.h"
+#include "elf32-nios2.h"
/* Use RELA relocations. */
#ifndef USE_RELA
@@ -67,8 +68,8 @@ static bfd_reloc_status_type nios2_elf32_callr_relocate
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
/* Target vector. */
-extern const bfd_target bfd_elf32_littlenios2_vec;
-extern const bfd_target bfd_elf32_bignios2_vec;
+extern const bfd_target nios2_elf32_le_vec;
+extern const bfd_target nios2_elf32_be_vec;
/* Offset of tp and dtp pointers from start of TLS block. */
#define TP_OFFSET 0x7000
@@ -655,6 +656,76 @@ static reloc_howto_type elf_nios2_howto_table_rel[] = {
0xffffffff,
FALSE),
+ HOWTO (R_NIOS2_CALL26_NOAT, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ FALSE, /* pc_relative */
+ 6, /* bitpos */
+ complain_overflow_dont, /* complain on overflow */
+ nios2_elf32_call26_relocate, /* special function */
+ "R_NIOS2_CALL26_NOAT", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffc0, /* src_mask */
+ 0xffffffc0, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_NIOS2_GOT_LO,
+ 0,
+ 2,
+ 16,
+ FALSE,
+ 6,
+ complain_overflow_dont,
+ bfd_elf_generic_reloc,
+ "R_NIOS2_GOT_LO",
+ FALSE,
+ 0x003fffc0,
+ 0x003fffc0,
+ FALSE),
+
+ HOWTO (R_NIOS2_GOT_HA,
+ 0,
+ 2,
+ 16,
+ FALSE,
+ 6,
+ complain_overflow_dont,
+ bfd_elf_generic_reloc,
+ "R_NIOS2_GOT_HA",
+ FALSE,
+ 0x003fffc0,
+ 0x003fffc0,
+ FALSE),
+
+ HOWTO (R_NIOS2_CALL_LO,
+ 0,
+ 2,
+ 16,
+ FALSE,
+ 6,
+ complain_overflow_dont,
+ bfd_elf_generic_reloc,
+ "R_NIOS2_CALL_LO",
+ FALSE,
+ 0x003fffc0,
+ 0x003fffc0,
+ FALSE),
+
+ HOWTO (R_NIOS2_CALL_HA,
+ 0,
+ 2,
+ 16,
+ FALSE,
+ 6,
+ complain_overflow_dont,
+ bfd_elf_generic_reloc,
+ "R_NIOS2_CALL_HA",
+ FALSE,
+ 0x003fffc0,
+ 0x003fffc0,
+ FALSE),
+
/* Add other relocations here. */
};
@@ -732,9 +803,58 @@ static const struct elf_reloc_map nios2_reloc_map[] = {
{BFD_RELOC_NIOS2_GLOB_DAT, R_NIOS2_GLOB_DAT},
{BFD_RELOC_NIOS2_JUMP_SLOT, R_NIOS2_JUMP_SLOT},
{BFD_RELOC_NIOS2_RELATIVE, R_NIOS2_RELATIVE},
- {BFD_RELOC_NIOS2_GOTOFF, R_NIOS2_GOTOFF}
+ {BFD_RELOC_NIOS2_GOTOFF, R_NIOS2_GOTOFF},
+ {BFD_RELOC_NIOS2_CALL26_NOAT, R_NIOS2_CALL26_NOAT},
+ {BFD_RELOC_NIOS2_GOT_LO, R_NIOS2_GOT_LO},
+ {BFD_RELOC_NIOS2_GOT_HA, R_NIOS2_GOT_HA},
+ {BFD_RELOC_NIOS2_CALL_LO, R_NIOS2_CALL_LO},
+ {BFD_RELOC_NIOS2_CALL_HA, R_NIOS2_CALL_HA},
+};
+
+enum elf32_nios2_stub_type
+{
+ nios2_stub_call26_before,
+ nios2_stub_call26_after,
+ nios2_stub_none
+};
+
+struct elf32_nios2_stub_hash_entry
+{
+ /* Base hash table entry structure. */
+ struct bfd_hash_entry bh_root;
+
+ /* The stub section. */
+ asection *stub_sec;
+
+ /* Offset within stub_sec of the beginning of this stub. */
+ bfd_vma stub_offset;
+
+ /* Given the symbol's value and its section we can determine its final
+ value when building the stubs (so the stub knows where to jump. */
+ bfd_vma target_value;
+ asection *target_section;
+
+ enum elf32_nios2_stub_type stub_type;
+
+ /* The symbol table entry, if any, that this was derived from. */
+ struct elf32_nios2_link_hash_entry *hh;
+
+ /* And the reloc addend that this was derived from. */
+ bfd_vma addend;
+
+ /* Where this stub is being called from, or, in the case of combined
+ stub sections, the first input section in the group. */
+ asection *id_sec;
};
+#define nios2_stub_hash_entry(ent) \
+ ((struct elf32_nios2_stub_hash_entry *)(ent))
+
+#define nios2_stub_hash_lookup(table, string, create, copy) \
+ ((struct elf32_nios2_stub_hash_entry *) \
+ bfd_hash_lookup ((table), (string), (create), (copy)))
+
+
/* The Nios II linker needs to keep track of the number of relocs that it
decides to copy as dynamic relocs in check_relocs for each symbol.
This is so that it can later discard them if they are found to be
@@ -761,6 +881,10 @@ struct elf32_nios2_link_hash_entry
{
struct elf_link_hash_entry root;
+ /* A pointer to the most recently used stub hash entry against this
+ symbol. */
+ struct elf32_nios2_stub_hash_entry *hsh_cache;
+
/* Track dynamic relocs copied for this symbol. */
struct elf32_nios2_dyn_relocs *dyn_relocs;
@@ -775,10 +899,11 @@ struct elf32_nios2_link_hash_entry
a dynamic GOT reloc in shared objects, only a dynamic PLT reloc. Lazy
linking will not work if the dynamic GOT reloc exists.
To check for this condition efficiently, we compare got_types_used against
- CALL16_USED, meaning
- (got_types_used & (GOT16_USED | CALL16_USED)) == CALL16_USED. */
-#define GOT16_USED 1
-#define CALL16_USED 2
+ CALL_USED, meaning
+ (got_types_used & (GOT_USED | CALL_USED)) == CALL_USED.
+ */
+#define GOT_USED 1
+#define CALL_USED 2
unsigned char got_types_used;
};
@@ -795,11 +920,42 @@ struct elf32_nios2_link_hash_table
/* The main hash table. */
struct elf_link_hash_table root;
+ /* The stub hash table. */
+ struct bfd_hash_table bstab;
+
+ /* Linker stub bfd. */
+ bfd *stub_bfd;
+
+ /* Linker call-backs. */
+ asection * (*add_stub_section) (const char *, asection *, bfd_boolean);
+ void (*layout_sections_again) (void);
+
+ /* Array to keep track of which stub sections have been created, and
+ information on stub grouping. */
+ struct map_stub
+ {
+ /* These are the section to which stubs in the group will be
+ attached. */
+ asection *first_sec, *last_sec;
+ /* The stub sections. There might be stubs inserted either before
+ or after the real section.*/
+ asection *first_stub_sec, *last_stub_sec;
+ } *stub_group;
+
+ /* Assorted information used by nios2_elf32_size_stubs. */
+ unsigned int bfd_count;
+ int top_index;
+ asection **input_list;
+ Elf_Internal_Sym **all_local_syms;
+
/* Short-cuts to get to dynamic linker sections. */
asection *sdynbss;
asection *srelbss;
asection *sbss;
+ /* GOT pointer symbol _gp_got. */
+ struct elf_link_hash_entry *h_gp_got;
+
union {
bfd_signed_vma refcount;
bfd_vma offset;
@@ -865,6 +1021,50 @@ static const bfd_vma nios2_so_plt0_entry[] = { /* .PLTresolve */
0x6800683a /* jmp r13 */
};
+/* CALL26 stub. */
+static const bfd_vma nios2_call26_stub_entry[] = {
+ 0x00400034, /* orhi at, r0, %hiadj(dest) */
+ 0x08400004, /* addi at, at, %lo(dest) */
+ 0x0800683a /* jmp at */
+};
+
+/* Install 16-bit immediate value VALUE at offset OFFSET into section SEC. */
+static void
+nios2_elf32_install_imm16 (asection *sec, bfd_vma offset, bfd_vma value)
+{
+ bfd_vma word = bfd_get_32 (sec->owner, sec->contents + offset);
+
+ BFD_ASSERT(value <= 0xffff);
+
+ bfd_put_32 (sec->owner, word | ((value & 0xffff) << 6),
+ sec->contents + offset);
+}
+
+/* Install COUNT 32-bit values DATA starting at offset OFFSET into
+ section SEC. */
+static void
+nios2_elf32_install_data (asection *sec, const bfd_vma *data, bfd_vma offset,
+ int count)
+{
+ while (count--)
+ {
+ bfd_put_32 (sec->owner, *data, sec->contents + offset);
+ offset += 4;
+ ++data;
+ }
+}
+
+/* The usual way of loading a 32-bit constant into a Nios II register is to
+ load the high 16 bits in one instruction and then add the low 16 bits with
+ a signed add. This means that the high halfword needs to be adjusted to
+ compensate for the sign bit of the low halfword. This function returns the
+ adjusted high halfword for a given 32-bit constant. */
+static
+bfd_vma hiadj (bfd_vma symbol_value)
+{
+ return ((symbol_value + 0x8000) >> 16) & 0xffff;
+}
+
/* Implement elf_backend_grok_prstatus:
Support for core dump NOTE sections. */
static bfd_boolean
@@ -928,6 +1128,44 @@ nios2_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
return TRUE;
}
+/* Assorted hash table functions. */
+
+/* Initialize an entry in the stub hash table. */
+static struct bfd_hash_entry *
+stub_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
+{
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (entry == NULL)
+ {
+ entry = bfd_hash_allocate (table,
+ sizeof (struct elf32_nios2_stub_hash_entry));
+ if (entry == NULL)
+ return entry;
+ }
+
+ /* Call the allocation method of the superclass. */
+ entry = bfd_hash_newfunc (entry, table, string);
+ if (entry != NULL)
+ {
+ struct elf32_nios2_stub_hash_entry *hsh;
+
+ /* Initialize the local fields. */
+ hsh = (struct elf32_nios2_stub_hash_entry *) entry;
+ hsh->stub_sec = NULL;
+ hsh->stub_offset = 0;
+ hsh->target_value = 0;
+ hsh->target_section = NULL;
+ hsh->stub_type = nios2_stub_none;
+ hsh->hh = NULL;
+ hsh->id_sec = NULL;
+ }
+
+ return entry;
+}
+
/* Create an entry in a Nios II ELF linker hash table. */
static struct bfd_hash_entry *
link_hash_newfunc (struct bfd_hash_entry *entry,
@@ -950,6 +1188,7 @@ link_hash_newfunc (struct bfd_hash_entry *entry,
struct elf32_nios2_link_hash_entry *eh;
eh = (struct elf32_nios2_link_hash_entry *) entry;
+ eh->hsh_cache = NULL;
eh->dyn_relocs = NULL;
eh->tls_type = GOT_UNKNOWN;
eh->got_types_used = 0;
@@ -958,6 +1197,846 @@ link_hash_newfunc (struct bfd_hash_entry *entry,
return entry;
}
+/* Section name for stubs is the associated section name plus this
+ string. */
+#define STUB_SUFFIX ".stub"
+
+/* Build a name for an entry in the stub hash table. */
+static char *
+nios2_stub_name (const asection *input_section,
+ const asection *sym_sec,
+ const struct elf32_nios2_link_hash_entry *hh,
+ const Elf_Internal_Rela *rel,
+ enum elf32_nios2_stub_type stub_type)
+{
+ char *stub_name;
+ bfd_size_type len;
+ char stubpos = (stub_type == nios2_stub_call26_before) ? 'b' : 'a';
+
+ if (hh)
+ {
+ len = 8 + 1 + 1 + 1+ strlen (hh->root.root.root.string) + 1 + 8 + 1;
+ stub_name = bfd_malloc (len);
+ if (stub_name != NULL)
+ {
+ sprintf (stub_name, "%08x_%c_%s+%x",
+ input_section->id & 0xffffffff,
+ stubpos,
+ hh->root.root.root.string,
+ (int) rel->r_addend & 0xffffffff);
+ }
+ }
+ else
+ {
+ len = 8 + 1 + 1 + 1+ 8 + 1 + 8 + 1 + 8 + 1;
+ stub_name = bfd_malloc (len);
+ if (stub_name != NULL)
+ {
+ sprintf (stub_name, "%08x_%c_%x:%x+%x",
+ input_section->id & 0xffffffff,
+ stubpos,
+ sym_sec->id & 0xffffffff,
+ (int) ELF32_R_SYM (rel->r_info) & 0xffffffff,
+ (int) rel->r_addend & 0xffffffff);
+ }
+ }
+ return stub_name;
+}
+
+/* Look up an entry in the stub hash. Stub entries are cached because
+ creating the stub name takes a bit of time. */
+static struct elf32_nios2_stub_hash_entry *
+nios2_get_stub_entry (const asection *input_section,
+ const asection *sym_sec,
+ struct elf32_nios2_link_hash_entry *hh,
+ const Elf_Internal_Rela *rel,
+ struct elf32_nios2_link_hash_table *htab,
+ enum elf32_nios2_stub_type stub_type)
+{
+ struct elf32_nios2_stub_hash_entry *hsh;
+ const asection *id_sec;
+
+ /* If this input section is part of a group of sections sharing one
+ stub section, then use the id of the first/last section in the group,
+ depending on the stub section placement relative to the group.
+ Stub names need to include a section id, as there may well be
+ more than one stub used to reach say, printf, and we need to
+ distinguish between them. */
+ if (stub_type == nios2_stub_call26_before)
+ id_sec = htab->stub_group[input_section->id].first_sec;
+ else
+ id_sec = htab->stub_group[input_section->id].last_sec;
+
+ if (hh != NULL && hh->hsh_cache != NULL
+ && hh->hsh_cache->hh == hh
+ && hh->hsh_cache->id_sec == id_sec
+ && hh->hsh_cache->stub_type == stub_type)
+ {
+ hsh = hh->hsh_cache;
+ }
+ else
+ {
+ char *stub_name;
+
+ stub_name = nios2_stub_name (id_sec, sym_sec, hh, rel, stub_type);
+ if (stub_name == NULL)
+ return NULL;
+
+ hsh = nios2_stub_hash_lookup (&htab->bstab,
+ stub_name, FALSE, FALSE);
+
+ if (hh != NULL)
+ hh->hsh_cache = hsh;
+
+ free (stub_name);
+ }
+
+ return hsh;
+}
+
+/* Add a new stub entry to the stub hash. Not all fields of the new
+ stub entry are initialised. */
+static struct elf32_nios2_stub_hash_entry *
+nios2_add_stub (const char *stub_name,
+ asection *section,
+ struct elf32_nios2_link_hash_table *htab,
+ enum elf32_nios2_stub_type stub_type)
+{
+ asection *link_sec;
+ asection *stub_sec;
+ asection **secptr, **linkptr;
+ struct elf32_nios2_stub_hash_entry *hsh;
+ bfd_boolean afterp;
+
+ if (stub_type == nios2_stub_call26_before)
+ {
+ link_sec = htab->stub_group[section->id].first_sec;
+ secptr = &(htab->stub_group[section->id].first_stub_sec);
+ linkptr = &(htab->stub_group[link_sec->id].first_stub_sec);
+ afterp = FALSE;
+ }
+ else
+ {
+ link_sec = htab->stub_group[section->id].last_sec;
+ secptr = &(htab->stub_group[section->id].last_stub_sec);
+ linkptr = &(htab->stub_group[link_sec->id].last_stub_sec);
+ afterp = TRUE;
+ }
+ stub_sec = *secptr;
+ if (stub_sec == NULL)
+ {
+ stub_sec = *linkptr;
+ if (stub_sec == NULL)
+ {
+ size_t namelen;
+ bfd_size_type len;
+ char *s_name;
+
+ namelen = strlen (link_sec->name);
+ len = namelen + sizeof (STUB_SUFFIX);
+ s_name = bfd_alloc (htab->stub_bfd, len);
+ if (s_name == NULL)
+ return NULL;
+
+ memcpy (s_name, link_sec->name, namelen);
+ memcpy (s_name + namelen, STUB_SUFFIX, sizeof (STUB_SUFFIX));
+
+ stub_sec = (*htab->add_stub_section) (s_name, link_sec, afterp);
+ if (stub_sec == NULL)
+ return NULL;
+ *linkptr = stub_sec;
+ }
+ *secptr = stub_sec;
+ }
+
+ /* Enter this entry into the linker stub hash table. */
+ hsh = nios2_stub_hash_lookup (&htab->bstab, stub_name,
+ TRUE, FALSE);
+ if (hsh == NULL)
+ {
+ (*_bfd_error_handler) (_("%B: cannot create stub entry %s"),
+ section->owner,
+ stub_name);
+ return NULL;
+ }
+
+ hsh->stub_sec = stub_sec;
+ hsh->stub_offset = 0;
+ hsh->id_sec = link_sec;
+ return hsh;
+}
+
+/* Set up various things so that we can make a list of input sections
+ for each output section included in the link. Returns -1 on error,
+ 0 when no stubs will be needed, and 1 on success. */
+int
+nios2_elf32_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info)
+{
+ bfd *input_bfd;
+ unsigned int bfd_count;
+ int top_id, top_index;
+ asection *section;
+ asection **input_list, **list;
+ bfd_size_type amt;
+ struct elf32_nios2_link_hash_table *htab = elf32_nios2_hash_table (info);
+
+ /* Count the number of input BFDs and find the top input section id. */
+ for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0;
+ input_bfd != NULL;
+ input_bfd = input_bfd->link.next)
+ {
+ bfd_count += 1;
+ for (section = input_bfd->sections;
+ section != NULL;
+ section = section->next)
+ {
+ if (top_id < section->id)
+ top_id = section->id;
+ }
+ }
+
+ htab->bfd_count = bfd_count;
+
+ amt = sizeof (struct map_stub) * (top_id + 1);
+ htab->stub_group = bfd_zmalloc (amt);
+ if (htab->stub_group == NULL)
+ return -1;
+
+ /* We can't use output_bfd->section_count here to find the top output
+ section index as some sections may have been removed, and
+ strip_excluded_output_sections doesn't renumber the indices. */
+ for (section = output_bfd->sections, top_index = 0;
+ section != NULL;
+ section = section->next)
+ {
+ if (top_index < section->index)
+ top_index = section->index;
+ }
+
+ htab->top_index = top_index;
+ amt = sizeof (asection *) * (top_index + 1);
+ input_list = bfd_malloc (amt);
+ htab->input_list = input_list;
+ if (input_list == NULL)
+ return -1;
+
+ /* For sections we aren't interested in, mark their entries with a
+ value we can check later. */
+ list = input_list + top_index;
+ do
+ *list = bfd_abs_section_ptr;
+ while (list-- != input_list);
+
+ for (section = output_bfd->sections;
+ section != NULL;
+ section = section->next)
+ {
+ /* FIXME: This is a bit of hack. Currently our .ctors and .dtors
+ * have PC relative relocs in them but no code flag set. */
+ if (((section->flags & SEC_CODE) != 0) ||
+ strcmp(".ctors", section->name) ||
+ strcmp(".dtors", section->name))
+ input_list[section->index] = NULL;
+ }
+
+ return 1;
+}
+
+/* The linker repeatedly calls this function for each input section,
+ in the order that input sections are linked into output sections.
+ Build lists of input sections to determine groupings between which
+ we may insert linker stubs. */
+void
+nios2_elf32_next_input_section (struct bfd_link_info *info, asection *isec)
+{
+ struct elf32_nios2_link_hash_table *htab = elf32_nios2_hash_table (info);
+
+ if (isec->output_section->index <= htab->top_index)
+ {
+ asection **list = htab->input_list + isec->output_section->index;
+ if (*list != bfd_abs_section_ptr)
+ {
+ /* Steal the last_sec pointer for our list.
+ This happens to make the list in reverse order,
+ which is what we want. */
+ htab->stub_group[isec->id].last_sec = *list;
+ *list = isec;
+ }
+ }
+}
+
+/* Segment mask for CALL26 relocation relaxation. */
+#define CALL26_SEGMENT(x) ((x) & 0xf0000000)
+
+/* Fudge factor for approximate maximum size of all stubs that might
+ be inserted by the linker. This does not actually limit the number
+ of stubs that might be inserted, and only affects strategy for grouping
+ and placement of stubs. Perhaps this should be computed based on number
+ of relocations seen, or be specifiable on the command line. */
+#define MAX_STUB_SECTION_SIZE 0xffff
+
+/* See whether we can group stub sections together. Grouping stub
+ sections may result in fewer stubs. More importantly, we need to
+ put all .init* and .fini* stubs at the end of the .init or
+ .fini output sections respectively, because glibc splits the
+ _init and _fini functions into multiple parts. Putting a stub in
+ the middle of a function is not a good idea.
+ Rather than computing groups of a maximum fixed size, for Nios II
+ CALL26 relaxation it makes more sense to compute the groups based on
+ sections that fit within a 256MB address segment. Also do not allow
+ a group to span more than one output section, since different output
+ sections might correspond to different memory banks on a bare-metal
+ target, etc. */
+static void
+group_sections (struct elf32_nios2_link_hash_table *htab)
+{
+ asection **list = htab->input_list + htab->top_index;
+ do
+ {
+ /* The list is in reverse order so we'll search backwards looking
+ for the first section that begins in the same memory segment,
+ marking sections along the way to point at the tail for this
+ group. */
+ asection *tail = *list;
+ if (tail == bfd_abs_section_ptr)
+ continue;
+ while (tail != NULL)
+ {
+ bfd_vma start = tail->output_section->vma + tail->output_offset;
+ bfd_vma end = start + tail->size;
+ bfd_vma segment = CALL26_SEGMENT (end);
+ asection *prev;
+
+ if (segment != CALL26_SEGMENT (start)
+ || segment != CALL26_SEGMENT (end + MAX_STUB_SECTION_SIZE))
+ /* This section spans more than one memory segment, or is
+ close enough to the end of the segment that adding stub
+ sections before it might cause it to move so that it
+ spans memory segments, or that stubs added at the end of
+ this group might overflow into the next memory segment.
+ Put it in a group by itself to localize the effects. */
+ {
+ prev = htab->stub_group[tail->id].last_sec;
+ htab->stub_group[tail->id].last_sec = tail;
+ htab->stub_group[tail->id].first_sec = tail;
+ }
+ else
+ /* Collect more sections for this group. */
+ {
+ asection *curr, *first;
+ for (curr = tail; ; curr = prev)
+ {
+ prev = htab->stub_group[curr->id].last_sec;
+ if (!prev
+ || tail->output_section != prev->output_section
+ || (CALL26_SEGMENT (prev->output_section->vma
+ + prev->output_offset)
+ != segment))
+ break;
+ }
+ first = curr;
+ for (curr = tail; ; curr = prev)
+ {
+ prev = htab->stub_group[curr->id].last_sec;
+ htab->stub_group[curr->id].last_sec = tail;
+ htab->stub_group[curr->id].first_sec = first;
+ if (curr == first)
+ break;
+ }
+ }
+
+ /* Reset tail for the next group. */
+ tail = prev;
+ }
+ }
+ while (list-- != htab->input_list);
+ free (htab->input_list);
+}
+
+/* Determine the type of stub needed, if any, for a call. */
+static enum elf32_nios2_stub_type
+nios2_type_of_stub (asection *input_sec,
+ const Elf_Internal_Rela *rel,
+ struct elf32_nios2_link_hash_entry *hh,
+ struct elf32_nios2_link_hash_table *htab,
+ bfd_vma destination,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED)
+{
+ bfd_vma location, segment, start, end;
+ asection *s0, *s1, *s;
+
+ if (hh != NULL &&
+ !(hh->root.root.type == bfd_link_hash_defined
+ || hh->root.root.type == bfd_link_hash_defweak))
+ return nios2_stub_none;
+
+ /* Determine where the call point is. */
+ location = (input_sec->output_section->vma
+ + input_sec->output_offset + rel->r_offset);
+ segment = CALL26_SEGMENT (location);
+
+ /* Nios II CALL and JMPI instructions can transfer control to addresses
+ within the same 256MB segment as the PC. */
+ if (segment == CALL26_SEGMENT (destination))
+ return nios2_stub_none;
+
+ /* Find the start and end addresses of the stub group. Also account for
+ any already-created stub sections for this group. Note that for stubs
+ in the end section, only the first instruction of the last stub
+ (12 bytes long) needs to be within range. */
+ s0 = htab->stub_group[input_sec->id].first_sec;
+ s = htab->stub_group[s0->id].first_stub_sec;
+ if (s != NULL && s->size > 0)
+ start = s->output_section->vma + s->output_offset;
+ else
+ start = s0->output_section->vma + s0->output_offset;
+
+ s1 = htab->stub_group[input_sec->id].last_sec;
+ s = htab->stub_group[s1->id].last_stub_sec;
+ if (s != NULL && s->size > 0)
+ end = s->output_section->vma + s->output_offset + s->size - 8;
+ else
+ end = s1->output_section->vma + s1->output_offset + s1->size;
+
+ BFD_ASSERT (start < end);
+ BFD_ASSERT (start <= location);
+ BFD_ASSERT (location < end);
+
+ /* Put stubs at the end of the group unless that is not a valid
+ location and the beginning of the group is. It might be that
+ neither the beginning nor end works if we have an input section
+ so large that it spans multiple segment boundaries. In that
+ case, punt; the end result will be a relocation overflow error no
+ matter what we do here.
+
+ Note that adding stubs pushes up the addresses of all subsequent
+ sections, so that stubs allocated on one pass through the
+ relaxation loop may not be valid on the next pass. (E.g., we may
+ allocate a stub at the beginning of the section on one pass and
+ find that the call site has been bumped into the next memory
+ segment on the next pass.) The important thing to note is that
+ we never try to reclaim the space allocated to such unused stubs,
+ so code size and section addresses can only increase with each
+ iteration. Accounting for the start and end addresses of the
+ already-created stub sections ensures that when the algorithm
+ converges, it converges accurately, with the entire appropriate
+ stub section accessible from the call site and not just the
+ address at the start or end of the stub group proper. */
+
+ if (segment == CALL26_SEGMENT (end))
+ return nios2_stub_call26_after;
+ else if (segment == CALL26_SEGMENT (start))
+ return nios2_stub_call26_before;
+ else
+ /* Perhaps this should be a dedicated error code. */
+ return nios2_stub_none;
+}
+
+static bfd_boolean
+nios2_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg ATTRIBUTE_UNUSED)
+{
+ struct elf32_nios2_stub_hash_entry *hsh
+ = (struct elf32_nios2_stub_hash_entry *) gen_entry;
+ asection *stub_sec = hsh->stub_sec;
+ bfd_vma sym_value;
+
+ /* Make a note of the offset within the stubs for this entry. */
+ hsh->stub_offset = stub_sec->size;
+
+ switch (hsh->stub_type)
+ {
+ case nios2_stub_call26_before:
+ case nios2_stub_call26_after:
+ /* A call26 stub looks like:
+ orhi at, %hiadj(dest)
+ addi at, at, %lo(dest)
+ jmp at
+ Note that call/jmpi instructions can't be used in PIC code
+ so there is no reason for the stub to be PIC, either. */
+ sym_value = (hsh->target_value
+ + hsh->target_section->output_offset
+ + hsh->target_section->output_section->vma
+ + hsh->addend);
+
+ nios2_elf32_install_data (stub_sec, nios2_call26_stub_entry,
+ hsh->stub_offset, 3);
+ nios2_elf32_install_imm16 (stub_sec, hsh->stub_offset,
+ hiadj (sym_value));
+ nios2_elf32_install_imm16 (stub_sec, hsh->stub_offset + 4,
+ (sym_value & 0xffff));
+ stub_sec->size += 12;
+ break;
+ default:
+ BFD_FAIL ();
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* As above, but don't actually build the stub. Just bump offset so
+ we know stub section sizes. */
+static bfd_boolean
+nios2_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg ATTRIBUTE_UNUSED)
+{
+ struct elf32_nios2_stub_hash_entry *hsh
+ = (struct elf32_nios2_stub_hash_entry *) gen_entry;
+
+ switch (hsh->stub_type)
+ {
+ case nios2_stub_call26_before:
+ case nios2_stub_call26_after:
+ hsh->stub_sec->size += 12;
+ break;
+ default:
+ BFD_FAIL ();
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/* Read in all local syms for all input bfds.
+ Returns -1 on error, 0 otherwise. */
+
+static int
+get_local_syms (bfd *output_bfd ATTRIBUTE_UNUSED, bfd *input_bfd,
+ struct bfd_link_info *info)
+{
+ unsigned int bfd_indx;
+ Elf_Internal_Sym *local_syms, **all_local_syms;
+ struct elf32_nios2_link_hash_table *htab = elf32_nios2_hash_table (info);
+
+ /* We want to read in symbol extension records only once. To do this
+ we need to read in the local symbols in parallel and save them for
+ later use; so hold pointers to the local symbols in an array. */
+ bfd_size_type amt = sizeof (Elf_Internal_Sym *) * htab->bfd_count;
+ all_local_syms = bfd_zmalloc (amt);
+ htab->all_local_syms = all_local_syms;
+ if (all_local_syms == NULL)
+ return -1;
+
+ /* Walk over all the input BFDs, swapping in local symbols. */
+ for (bfd_indx = 0;
+ input_bfd != NULL;
+ input_bfd = input_bfd->link.next, bfd_indx++)
+ {
+ Elf_Internal_Shdr *symtab_hdr;
+
+ /* We'll need the symbol table in a second. */
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ if (symtab_hdr->sh_info == 0)
+ continue;
+
+ /* We need an array of the local symbols attached to the input bfd. */
+ local_syms = (Elf_Internal_Sym *) symtab_hdr->contents;
+ if (local_syms == NULL)
+ {
+ local_syms = bfd_elf_get_elf_syms (input_bfd, symtab_hdr,
+ symtab_hdr->sh_info, 0,
+ NULL, NULL, NULL);
+ /* Cache them for elf_link_input_bfd. */
+ symtab_hdr->contents = (unsigned char *) local_syms;
+ }
+ if (local_syms == NULL)
+ return -1;
+
+ all_local_syms[bfd_indx] = local_syms;
+ }
+
+ return 0;
+}
+
+/* Determine and set the size of the stub section for a final link. */
+bfd_boolean
+nios2_elf32_size_stubs (bfd *output_bfd, bfd *stub_bfd,
+ struct bfd_link_info *info,
+ asection *(*add_stub_section) (const char *,
+ asection *, bfd_boolean),
+ void (*layout_sections_again) (void))
+{
+ bfd_boolean stub_changed = FALSE;
+ struct elf32_nios2_link_hash_table *htab = elf32_nios2_hash_table (info);
+
+ /* Stash our params away. */
+ htab->stub_bfd = stub_bfd;
+ htab->add_stub_section = add_stub_section;
+ htab->layout_sections_again = layout_sections_again;
+
+ /* FIXME: We only compute the section groups once. This could cause
+ problems if adding a large stub section causes following sections,
+ or parts of them, to move into another segment. However, this seems
+ to be consistent with the way other back ends handle this.... */
+ group_sections (htab);
+
+ if (get_local_syms (output_bfd, info->input_bfds, info))
+ {
+ if (htab->all_local_syms)
+ goto error_ret_free_local;
+ return FALSE;
+ }
+
+ while (1)
+ {
+ bfd *input_bfd;
+ unsigned int bfd_indx;
+ asection *stub_sec;
+
+ for (input_bfd = info->input_bfds, bfd_indx = 0;
+ input_bfd != NULL;
+ input_bfd = input_bfd->link.next, bfd_indx++)
+ {
+ Elf_Internal_Shdr *symtab_hdr;
+ asection *section;
+ Elf_Internal_Sym *local_syms;
+
+ /* We'll need the symbol table in a second. */
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ if (symtab_hdr->sh_info == 0)
+ continue;
+
+ local_syms = htab->all_local_syms[bfd_indx];
+
+ /* Walk over each section attached to the input bfd. */
+ for (section = input_bfd->sections;
+ section != NULL;
+ section = section->next)
+ {
+ Elf_Internal_Rela *internal_relocs, *irelaend, *irela;
+
+ /* If there aren't any relocs, then there's nothing more
+ to do. */
+ if ((section->flags & SEC_RELOC) == 0
+ || section->reloc_count == 0)
+ continue;
+
+ /* If this section is a link-once section that will be
+ discarded, then don't create any stubs. */
+ if (section->output_section == NULL
+ || section->output_section->owner != output_bfd)
+ continue;
+
+ /* Get the relocs. */
+ internal_relocs
+ = _bfd_elf_link_read_relocs (input_bfd, section, NULL, NULL,
+ info->keep_memory);
+ if (internal_relocs == NULL)
+ goto error_ret_free_local;
+
+ /* Now examine each relocation. */
+ irela = internal_relocs;
+ irelaend = irela + section->reloc_count;
+ for (; irela < irelaend; irela++)
+ {
+ unsigned int r_type, r_indx;
+ enum elf32_nios2_stub_type stub_type;
+ struct elf32_nios2_stub_hash_entry *hsh;
+ asection *sym_sec;
+ bfd_vma sym_value;
+ bfd_vma destination;
+ struct elf32_nios2_link_hash_entry *hh;
+ char *stub_name;
+ const asection *id_sec;
+
+ r_type = ELF32_R_TYPE (irela->r_info);
+ r_indx = ELF32_R_SYM (irela->r_info);
+
+ if (r_type >= (unsigned int) R_NIOS2_ILLEGAL)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ error_ret_free_internal:
+ if (elf_section_data (section)->relocs == NULL)
+ free (internal_relocs);
+ goto error_ret_free_local;
+ }
+
+ /* Only look for stubs on CALL and JMPI instructions. */
+ if (r_type != (unsigned int) R_NIOS2_CALL26)
+ continue;
+
+ /* Now determine the call target, its name, value,
+ section. */
+ sym_sec = NULL;
+ sym_value = 0;
+ destination = 0;
+ hh = NULL;
+ if (r_indx < symtab_hdr->sh_info)
+ {
+ /* It's a local symbol. */
+ Elf_Internal_Sym *sym;
+ Elf_Internal_Shdr *hdr;
+ unsigned int shndx;
+
+ sym = local_syms + r_indx;
+ if (ELF_ST_TYPE (sym->st_info) != STT_SECTION)
+ sym_value = sym->st_value;
+ shndx = sym->st_shndx;
+ if (shndx < elf_numsections (input_bfd))
+ {
+ hdr = elf_elfsections (input_bfd)[shndx];
+ sym_sec = hdr->bfd_section;
+ destination = (sym_value + irela->r_addend
+ + sym_sec->output_offset
+ + sym_sec->output_section->vma);
+ }
+ }
+ else
+ {
+ /* It's an external symbol. */
+ int e_indx;
+
+ e_indx = r_indx - symtab_hdr->sh_info;
+ hh = ((struct elf32_nios2_link_hash_entry *)
+ elf_sym_hashes (input_bfd)[e_indx]);
+
+ while (hh->root.root.type == bfd_link_hash_indirect
+ || hh->root.root.type == bfd_link_hash_warning)
+ hh = ((struct elf32_nios2_link_hash_entry *)
+ hh->root.root.u.i.link);
+
+ if (hh->root.root.type == bfd_link_hash_defined
+ || hh->root.root.type == bfd_link_hash_defweak)
+ {
+ sym_sec = hh->root.root.u.def.section;
+ sym_value = hh->root.root.u.def.value;
+
+ if (sym_sec->output_section != NULL)
+ destination = (sym_value + irela->r_addend
+ + sym_sec->output_offset
+ + sym_sec->output_section->vma);
+ else
+ continue;
+ }
+ else if (hh->root.root.type == bfd_link_hash_undefweak)
+ {
+ if (! info->shared)
+ continue;
+ }
+ else if (hh->root.root.type == bfd_link_hash_undefined)
+ {
+ if (! (info->unresolved_syms_in_objects == RM_IGNORE
+ && (ELF_ST_VISIBILITY (hh->root.other)
+ == STV_DEFAULT)))
+ continue;
+ }
+ else
+ {
+ bfd_set_error (bfd_error_bad_value);
+ goto error_ret_free_internal;
+ }
+ }
+
+ /* Determine what (if any) linker stub is needed. */
+ stub_type = nios2_type_of_stub (section, irela, hh, htab,
+ destination, info);
+ if (stub_type == nios2_stub_none)
+ continue;
+
+ /* Support for grouping stub sections. */
+ if (stub_type == nios2_stub_call26_before)
+ id_sec = htab->stub_group[section->id].first_sec;
+ else
+ id_sec = htab->stub_group[section->id].last_sec;
+
+ /* Get the name of this stub. */
+ stub_name = nios2_stub_name (id_sec, sym_sec, hh, irela,
+ stub_type);
+ if (!stub_name)
+ goto error_ret_free_internal;
+
+ hsh = nios2_stub_hash_lookup (&htab->bstab,
+ stub_name,
+ FALSE, FALSE);
+ if (hsh != NULL)
+ {
+ /* The proper stub has already been created. */
+ free (stub_name);
+ continue;
+ }
+
+ hsh = nios2_add_stub (stub_name, section, htab, stub_type);
+ if (hsh == NULL)
+ {
+ free (stub_name);
+ goto error_ret_free_internal;
+ }
+ hsh->target_value = sym_value;
+ hsh->target_section = sym_sec;
+ hsh->stub_type = stub_type;
+ hsh->hh = hh;
+ hsh->addend = irela->r_addend;
+ stub_changed = TRUE;
+ }
+
+ /* We're done with the internal relocs, free them. */
+ if (elf_section_data (section)->relocs == NULL)
+ free (internal_relocs);
+ }
+ }
+
+ if (!stub_changed)
+ break;
+
+ /* OK, we've added some stubs. Find out the new size of the
+ stub sections. */
+ for (stub_sec = htab->stub_bfd->sections;
+ stub_sec != NULL;
+ stub_sec = stub_sec->next)
+ stub_sec->size = 0;
+
+ bfd_hash_traverse (&htab->bstab, nios2_size_one_stub, htab);
+
+ /* Ask the linker to do its stuff. */
+ (*htab->layout_sections_again) ();
+ stub_changed = FALSE;
+ }
+
+ free (htab->all_local_syms);
+ return TRUE;
+
+ error_ret_free_local:
+ free (htab->all_local_syms);
+ return FALSE;
+}
+
+/* Build all the stubs associated with the current output file. The
+ stubs are kept in a hash table attached to the main linker hash
+ table. This function is called via nios2elf_finish in the linker. */
+bfd_boolean
+nios2_elf32_build_stubs (struct bfd_link_info *info)
+{
+ asection *stub_sec;
+ struct bfd_hash_table *table;
+ struct elf32_nios2_link_hash_table *htab;
+
+ htab = elf32_nios2_hash_table (info);
+
+ for (stub_sec = htab->stub_bfd->sections;
+ stub_sec != NULL;
+ stub_sec = stub_sec->next)
+ /* The stub_bfd may contain non-stub sections if it is also the
+ dynobj. Any such non-stub sections are created with the
+ SEC_LINKER_CREATED flag set, while stub sections do not
+ have that flag. Ignore any non-stub sections here. */
+ if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
+ {
+ bfd_size_type size;
+
+ /* Allocate memory to hold the linker stubs. */
+ size = stub_sec->size;
+ stub_sec->contents = bfd_zalloc (htab->stub_bfd, size);
+ if (stub_sec->contents == NULL && size != 0)
+ return FALSE;
+ stub_sec->size = 0;
+ }
+
+ /* Build the stubs as directed by the stub hash table. */
+ table = &htab->bstab;
+ bfd_hash_traverse (table, nios2_build_one_stub, info);
+
+ return TRUE;
+}
+
+
/* Implement bfd_elf32_bfd_reloc_type_lookup:
Given a BFD reloc type, return a howto structure. */
static reloc_howto_type *
@@ -1122,21 +2201,10 @@ nios2_elf_final_gp (bfd *output_bfd, asymbol *symbol, bfd_boolean relocatable,
return bfd_reloc_ok;
}
-/* The usual way of loading a 32-bit constant into a Nios II register is to
- load the high 16 bits in one instruction and then add the low 16 bits with
- a signed add. This means that the high halfword needs to be adjusted to
- compensate for the sign bit of the low halfword. This function returns the
- adjusted high halfword for a given 32-bit constant. */
-static
-bfd_vma hiadj (bfd_vma symbol_value)
-{
- return ((symbol_value + 0x8000) >> 16) & 0xffff;
-}
-
/* Do the relocations that require special handling. */
static bfd_reloc_status_type
nios2_elf32_do_hi16_relocate (bfd *abfd, reloc_howto_type *howto,
- asection *input_section ATTRIBUTE_UNUSED,
+ asection *input_section,
bfd_byte *data, bfd_vma offset,
bfd_vma symbol_value, bfd_vma addend)
{
@@ -1149,7 +2217,7 @@ nios2_elf32_do_hi16_relocate (bfd *abfd, reloc_howto_type *howto,
static bfd_reloc_status_type
nios2_elf32_do_lo16_relocate (bfd *abfd, reloc_howto_type *howto,
- asection *input_section ATTRIBUTE_UNUSED,
+ asection *input_section,
bfd_byte *data, bfd_vma offset,
bfd_vma symbol_value, bfd_vma addend)
{
@@ -1162,7 +2230,7 @@ nios2_elf32_do_lo16_relocate (bfd *abfd, reloc_howto_type *howto,
static bfd_reloc_status_type
nios2_elf32_do_hiadj16_relocate (bfd *abfd, reloc_howto_type *howto,
- asection *input_section ATTRIBUTE_UNUSED,
+ asection *input_section,
bfd_byte *data, bfd_vma offset,
bfd_vma symbol_value, bfd_vma addend)
{
@@ -1175,7 +2243,7 @@ nios2_elf32_do_hiadj16_relocate (bfd *abfd, reloc_howto_type *howto,
static bfd_reloc_status_type
nios2_elf32_do_pcrel_lo16_relocate (bfd *abfd, reloc_howto_type *howto,
- asection *input_section ATTRIBUTE_UNUSED,
+ asection *input_section,
bfd_byte *data, bfd_vma offset,
bfd_vma symbol_value, bfd_vma addend)
{
@@ -1188,8 +2256,7 @@ nios2_elf32_do_pcrel_lo16_relocate (bfd *abfd, reloc_howto_type *howto,
static bfd_reloc_status_type
nios2_elf32_do_pcrel_hiadj16_relocate (bfd *abfd, reloc_howto_type *howto,
- asection *input_section
- ATTRIBUTE_UNUSED,
+ asection *input_section,
bfd_byte *data, bfd_vma offset,
bfd_vma symbol_value, bfd_vma addend)
{
@@ -1205,7 +2272,7 @@ nios2_elf32_do_pcrel_hiadj16_relocate (bfd *abfd, reloc_howto_type *howto,
static bfd_reloc_status_type
nios2_elf32_do_pcrel16_relocate (bfd *abfd, reloc_howto_type *howto,
- asection *input_section ATTRIBUTE_UNUSED,
+ asection *input_section,
bfd_byte *data, bfd_vma offset,
bfd_vma symbol_value, bfd_vma addend)
{
@@ -1219,13 +2286,15 @@ nios2_elf32_do_pcrel16_relocate (bfd *abfd, reloc_howto_type *howto,
static bfd_reloc_status_type
nios2_elf32_do_call26_relocate (bfd *abfd, reloc_howto_type *howto,
- asection *input_section ATTRIBUTE_UNUSED,
+ asection *input_section,
bfd_byte *data, bfd_vma offset,
bfd_vma symbol_value, bfd_vma addend)
{
/* Check that the relocation is in the same page as the current address. */
- if (((symbol_value + addend) & 0xf0000000)
- != ((input_section->output_section->vma + offset) & 0xf0000000))
+ if (CALL26_SEGMENT (symbol_value + addend)
+ != CALL26_SEGMENT (input_section->output_section->vma
+ + input_section->output_offset
+ + offset))
return bfd_reloc_overflow;
return _bfd_final_link_relocate (howto, abfd, input_section,
@@ -1234,7 +2303,7 @@ nios2_elf32_do_call26_relocate (bfd *abfd, reloc_howto_type *howto,
static bfd_reloc_status_type
nios2_elf32_do_gprel_relocate (bfd *abfd, reloc_howto_type *howto,
- asection *input_section ATTRIBUTE_UNUSED,
+ asection *input_section,
bfd_byte *data, bfd_vma offset,
bfd_vma symbol_value, bfd_vma addend)
{
@@ -1246,7 +2315,7 @@ nios2_elf32_do_gprel_relocate (bfd *abfd, reloc_howto_type *howto,
static bfd_reloc_status_type
nios2_elf32_do_ujmp_relocate (bfd *abfd, reloc_howto_type *howto,
- asection *input_section ATTRIBUTE_UNUSED,
+ asection *input_section,
bfd_byte *data, bfd_vma offset,
bfd_vma symbol_value, bfd_vma addend)
{
@@ -1269,7 +2338,7 @@ nios2_elf32_do_ujmp_relocate (bfd *abfd, reloc_howto_type *howto,
static bfd_reloc_status_type
nios2_elf32_do_cjmp_relocate (bfd *abfd, reloc_howto_type *howto,
- asection *input_section ATTRIBUTE_UNUSED,
+ asection *input_section,
bfd_byte *data, bfd_vma offset,
bfd_vma symbol_value, bfd_vma addend)
{
@@ -1292,7 +2361,7 @@ nios2_elf32_do_cjmp_relocate (bfd *abfd, reloc_howto_type *howto,
static bfd_reloc_status_type
nios2_elf32_do_callr_relocate (bfd *abfd, reloc_howto_type *howto,
- asection *input_section ATTRIBUTE_UNUSED,
+ asection *input_section,
bfd_byte *data, bfd_vma offset,
bfd_vma symbol_value, bfd_vma addend)
{
@@ -1671,6 +2740,7 @@ nios2_elf32_relocate_section (bfd *output_bfd,
asection *splt;
asection *sreloc = NULL;
bfd_vma *local_got_offsets;
+ bfd_vma got_base;
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (input_bfd);
@@ -1681,6 +2751,11 @@ nios2_elf32_relocate_section (bfd *output_bfd,
splt = htab->root.splt;
local_got_offsets = elf_local_got_offsets (input_bfd);
+ if (elf32_nios2_hash_table (info)->h_gp_got == NULL)
+ got_base = 0;
+ else
+ got_base = elf32_nios2_hash_table (info)->h_gp_got->root.u.def.value;
+
for (rel = relocs; rel < relend; rel++)
{
reloc_howto_type *howto;
@@ -1718,12 +2793,12 @@ nios2_elf32_relocate_section (bfd *output_bfd,
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec && discarded_section (sec))
@@ -1841,6 +2916,7 @@ nios2_elf32_relocate_section (bfd *output_bfd,
rel->r_addend);
break;
case R_NIOS2_CALL26:
+ case R_NIOS2_CALL26_NOAT:
/* If we have a call to an undefined weak symbol, we just want
to stuff a zero in the bits of the call instruction and
bypass the normal call26 relocation handling, because it'll
@@ -1874,6 +2950,46 @@ nios2_elf32_relocate_section (bfd *output_bfd,
unresolved_reloc = FALSE;
}
+ /* Detect R_NIOS2_CALL26 relocations that would overflow the
+ 256MB segment. Replace the target with a reference to a
+ trampoline instead.
+ Note that htab->stub_group is null if relaxation has been
+ disabled by the --no-relax linker command-line option, so
+ we can use that to skip this processing entirely. */
+ if (howto->type == R_NIOS2_CALL26 && htab->stub_group)
+ {
+ bfd_vma dest = relocation + rel->r_addend;
+ enum elf32_nios2_stub_type stub_type;
+
+ eh = (struct elf32_nios2_link_hash_entry *)h;
+ stub_type = nios2_type_of_stub (input_section, rel, eh,
+ htab, dest, NULL);
+
+ if (stub_type != nios2_stub_none)
+ {
+ struct elf32_nios2_stub_hash_entry *hsh;
+
+ hsh = nios2_get_stub_entry (input_section, sec,
+ eh, rel, htab, stub_type);
+ if (hsh == NULL)
+ {
+ r = bfd_reloc_undefined;
+ break;
+ }
+
+ dest = (hsh->stub_offset
+ + hsh->stub_sec->output_offset
+ + hsh->stub_sec->output_section->vma);
+ r = nios2_elf32_do_call26_relocate (input_bfd, howto,
+ input_section,
+ contents,
+ rel->r_offset,
+ dest, 0);
+ break;
+ }
+ }
+
+ /* Normal case. */
r = nios2_elf32_do_call26_relocate (input_bfd, howto,
input_section, contents,
rel->r_offset, relocation,
@@ -1892,6 +3008,10 @@ nios2_elf32_relocate_section (bfd *output_bfd,
case R_NIOS2_GOT16:
case R_NIOS2_CALL16:
+ case R_NIOS2_GOT_LO:
+ case R_NIOS2_GOT_HA:
+ case R_NIOS2_CALL_LO:
+ case R_NIOS2_CALL_HA:
/* Relocation is to the entry for this symbol in the
global offset table. */
if (sgot == NULL)
@@ -1907,7 +3027,7 @@ nios2_elf32_relocate_section (bfd *output_bfd,
bfd_boolean dyn;
eh = (struct elf32_nios2_link_hash_entry *)h;
- use_plt = (eh->got_types_used == CALL16_USED
+ use_plt = (eh->got_types_used == CALL_USED
&& h->plt.offset != (bfd_vma) -1);
off = h->got.offset;
@@ -1985,24 +3105,45 @@ nios2_elf32_relocate_section (bfd *output_bfd,
if (use_plt && info->shared)
{
off = ((h->plt.offset - 24) / 12 + 3) * 4;
- relocation = htab->root.sgotplt->output_offset + off;
+ relocation = (htab->root.sgotplt->output_offset + off
+ - got_base);
}
else
- relocation = sgot->output_offset + off;
+ relocation = sgot->output_offset + off - got_base;
/* This relocation does not use the addend. */
rel->r_addend = 0;
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, rel->r_addend);
+ switch (howto->type)
+ {
+ case R_NIOS2_GOT_LO:
+ case R_NIOS2_CALL_LO:
+ r = nios2_elf32_do_lo16_relocate (input_bfd, howto,
+ input_section, contents,
+ rel->r_offset, relocation,
+ rel->r_addend);
+ break;
+ case R_NIOS2_GOT_HA:
+ case R_NIOS2_CALL_HA:
+ r = nios2_elf32_do_hiadj16_relocate (input_bfd, howto,
+ input_section, contents,
+ rel->r_offset,
+ relocation,
+ rel->r_addend);
+ break;
+ default:
+ r = _bfd_final_link_relocate (howto, input_bfd,
+ input_section, contents,
+ rel->r_offset, relocation,
+ rel->r_addend);
+ break;
+ }
break;
case R_NIOS2_GOTOFF_LO:
case R_NIOS2_GOTOFF_HA:
case R_NIOS2_GOTOFF:
- /* Relocation is relative to the start of the
- global offset table. */
+ /* Relocation is relative to the global offset table pointer. */
BFD_ASSERT (sgot != NULL);
if (sgot == NULL)
@@ -2012,11 +3153,13 @@ nios2_elf32_relocate_section (bfd *output_bfd,
}
/* Note that sgot->output_offset is not involved in this
- calculation. We always want the start of .got. If we
- define _GLOBAL_OFFSET_TABLE in a different way, as is
- permitted by the ABI, we might have to change this
- calculation. */
+ calculation. We always want the start of .got. */
relocation -= sgot->output_section->vma;
+
+ /* Now we adjust the relocation to be relative to the GOT pointer
+ (the _gp_got symbol), which possibly contains the 0x8000 bias. */
+ relocation -= got_base;
+
switch (howto->type)
{
case R_NIOS2_GOTOFF_LO:
@@ -2086,7 +3229,7 @@ nios2_elf32_relocate_section (bfd *output_bfd,
htab->tls_ldm_got.offset |= 1;
}
- relocation = (htab->root.sgot->output_offset + off);
+ relocation = htab->root.sgot->output_offset + off - got_base;
r = _bfd_final_link_relocate (howto, input_bfd, input_section,
contents, rel->r_offset,
@@ -2243,7 +3386,7 @@ nios2_elf32_relocate_section (bfd *output_bfd,
if ((tls_type & GOT_TLS_GD) && r_type != R_NIOS2_TLS_GD16)
off += 8;
- relocation = (htab->root.sgot->output_offset + off);
+ relocation = htab->root.sgot->output_offset + off - got_base;
r = _bfd_final_link_relocate (howto, input_bfd, input_section,
contents, rel->r_offset,
@@ -2448,6 +3591,7 @@ static bfd_boolean
create_got_section (bfd *dynobj, struct bfd_link_info *info)
{
struct elf32_nios2_link_hash_table *htab;
+ struct elf_link_hash_entry *h;
htab = elf32_nios2_hash_table (info);
@@ -2459,6 +3603,16 @@ create_got_section (bfd *dynobj, struct bfd_link_info *info)
if (!bfd_set_section_alignment (dynobj, htab->root.sgotplt, 4))
return FALSE;
+ /* The Nios II ABI specifies that GOT-relative relocations are relative
+ to the linker-created symbol _gp_got, rather than using
+ _GLOBAL_OFFSET_TABLE_ directly. In particular, the latter always
+ points to the base of the GOT while _gp_got may include a bias. */
+ h = _bfd_elf_define_linkage_sym (dynobj, info, htab->root.sgotplt,
+ "_gp_got");
+ elf32_nios2_hash_table (info)->h_gp_got = h;
+ if (h == NULL)
+ return FALSE;
+
return TRUE;
}
@@ -2612,7 +3766,11 @@ nios2_elf32_check_relocs (bfd *abfd, struct bfd_link_info *info,
switch (r_type)
{
case R_NIOS2_GOT16:
+ case R_NIOS2_GOT_LO:
+ case R_NIOS2_GOT_HA:
case R_NIOS2_CALL16:
+ case R_NIOS2_CALL_LO:
+ case R_NIOS2_CALL_HA:
case R_NIOS2_TLS_GD16:
case R_NIOS2_TLS_IE16:
/* This symbol requires a global offset table entry. */
@@ -2623,7 +3781,11 @@ nios2_elf32_check_relocs (bfd *abfd, struct bfd_link_info *info,
{
default:
case R_NIOS2_GOT16:
+ case R_NIOS2_GOT_LO:
+ case R_NIOS2_GOT_HA:
case R_NIOS2_CALL16:
+ case R_NIOS2_CALL_LO:
+ case R_NIOS2_CALL_HA:
tls_type = GOT_NORMAL;
break;
case R_NIOS2_TLS_GD16:
@@ -2660,7 +3822,9 @@ nios2_elf32_check_relocs (bfd *abfd, struct bfd_link_info *info,
= (struct elf32_nios2_link_hash_entry *)h;
h->got.refcount++;
old_tls_type = elf32_nios2_hash_entry(h)->tls_type;
- if (r_type == R_NIOS2_CALL16)
+ if (r_type == R_NIOS2_CALL16
+ || r_type == R_NIOS2_CALL_LO
+ || r_type == R_NIOS2_CALL_HA)
{
/* Make sure a plt entry is created for this symbol if
it turns out to be a function defined by a dynamic
@@ -2668,10 +3832,10 @@ nios2_elf32_check_relocs (bfd *abfd, struct bfd_link_info *info,
h->plt.refcount++;
h->needs_plt = 1;
h->type = STT_FUNC;
- eh->got_types_used |= CALL16_USED;
+ eh->got_types_used |= CALL_USED;
}
else
- eh->got_types_used |= GOT16_USED;
+ eh->got_types_used |= GOT_USED;
}
else
{
@@ -2740,6 +3904,7 @@ nios2_elf32_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_NIOS2_BFD_RELOC_32:
case R_NIOS2_CALL26:
+ case R_NIOS2_CALL26_NOAT:
case R_NIOS2_HIADJ16:
case R_NIOS2_LO16:
@@ -2758,7 +3923,7 @@ nios2_elf32_check_relocs (bfd *abfd, struct bfd_link_info *info,
turns out to be a function defined by a dynamic object. */
h->plt.refcount++;
- if (r_type == R_NIOS2_CALL26)
+ if (r_type == R_NIOS2_CALL26 || r_type == R_NIOS2_CALL26_NOAT)
h->needs_plt = 1;
}
@@ -2842,7 +4007,7 @@ nios2_elf32_check_relocs (bfd *abfd, struct bfd_link_info *info,
relocation. */
static asection *
nios2_elf32_gc_mark_hook (asection *sec,
- struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info,
Elf_Internal_Rela *rel,
struct elf_link_hash_entry *h,
Elf_Internal_Sym *sym)
@@ -2904,7 +4069,11 @@ nios2_elf32_gc_sweep_hook (bfd *abfd,
switch (r_type)
{
case R_NIOS2_GOT16:
+ case R_NIOS2_GOT_LO:
+ case R_NIOS2_GOT_HA:
case R_NIOS2_CALL16:
+ case R_NIOS2_CALL_LO:
+ case R_NIOS2_CALL_HA:
if (h != NULL)
{
if (h->got.refcount > 0)
@@ -2921,6 +4090,7 @@ nios2_elf32_gc_sweep_hook (bfd *abfd,
case R_NIOS2_PCREL_HA:
case R_NIOS2_BFD_RELOC_32:
case R_NIOS2_CALL26:
+ case R_NIOS2_CALL26_NOAT:
if (h != NULL)
{
struct elf32_nios2_link_hash_entry *eh;
@@ -2956,32 +4126,6 @@ nios2_elf32_gc_sweep_hook (bfd *abfd,
return TRUE;
}
-/* Install 16-bit immediate value VALUE at offset OFFSET into section SEC. */
-static void
-nios2_elf32_install_imm16 (asection *sec, bfd_vma offset, bfd_vma value)
-{
- bfd_vma word = bfd_get_32 (sec->owner, sec->contents + offset);
-
- BFD_ASSERT(value <= 0xffff);
-
- bfd_put_32 (sec->owner, word | ((value & 0xffff) << 6),
- sec->contents + offset);
-}
-
-/* Install COUNT 32-bit values DATA starting at offset OFFSET into
- section SEC. */
-static void
-nios2_elf32_install_data (asection *sec, const bfd_vma *data, bfd_vma offset,
- int count)
-{
- while (count--)
- {
- bfd_put_32 (sec->owner, *data, sec->contents + offset);
- offset += 4;
- ++data;
- }
-}
-
/* Implement elf_backend_finish_dynamic_symbols:
Finish up dynamic symbol handling. We set the contents of various
dynamic sections here. */
@@ -3079,7 +4223,7 @@ nios2_elf32_finish_dynamic_symbol (bfd *output_bfd,
}
}
- use_plt = (eh->got_types_used == CALL16_USED
+ use_plt = (eh->got_types_used == CALL_USED
&& h->plt.offset != (bfd_vma) -1);
if (!use_plt && h->got.offset != (bfd_vma) -1
@@ -3161,9 +4305,10 @@ nios2_elf32_finish_dynamic_symbol (bfd *output_bfd,
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
}
- /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */
+ /* Mark _DYNAMIC, _GLOBAL_OFFSET_TABLE_, and _gp_got as absolute. */
if (strcmp (h->root.root.string, "_DYNAMIC") == 0
- || h == elf_hash_table (info)->hgot)
+ || h == elf_hash_table (info)->hgot
+ || h == elf32_nios2_hash_table (info)->h_gp_got)
sym->st_shndx = SHN_ABS;
return TRUE;
@@ -3551,7 +4696,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, PTR inf)
}
eh = (struct elf32_nios2_link_hash_entry *) h;
- use_plt = (eh->got_types_used == CALL16_USED
+ use_plt = (eh->got_types_used == CALL_USED
&& h->plt.offset != (bfd_vma) -1);
if (h->got.refcount > 0)
@@ -3746,7 +4891,7 @@ nios2_elf32_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -3829,6 +4974,16 @@ nios2_elf32_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
sym dynamic relocs. */
elf_link_hash_traverse (& htab->root, allocate_dynrelocs, info);
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ /* If the .got section is more than 0x8000 bytes, we add
+ 0x8000 to the value of _gp_got, so that 16-bit relocations
+ have a greater chance of working. */
+ if (htab->root.sgot->size >= 0x8000
+ && elf32_nios2_hash_table (info)->h_gp_got->root.u.def.value == 0)
+ elf32_nios2_hash_table (info)->h_gp_got->root.u.def.value = 0x8000;
+ }
+
/* The check_relocs and adjust_dynamic_symbol entry points have
determined the sizes of the various dynamic sections. Allocate
memory for them. */
@@ -3949,6 +5104,17 @@ nios2_elf32_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
return TRUE;
}
+/* Free the derived linker hash table. */
+static void
+nios2_elf32_link_hash_table_free (bfd *obfd)
+{
+ struct elf32_nios2_link_hash_table *htab
+ = (struct elf32_nios2_link_hash_table *) obfd->link.hash;
+
+ bfd_hash_table_free (&htab->bstab);
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
/* Implement bfd_elf32_bfd_link_hash_table_create. */
static struct bfd_link_hash_table *
nios2_elf32_link_hash_table_create (bfd *abfd)
@@ -3970,6 +5136,15 @@ nios2_elf32_link_hash_table_create (bfd *abfd)
return NULL;
}
+ /* Init the stub hash table too. */
+ if (!bfd_hash_table_init (&ret->bstab, stub_hash_newfunc,
+ sizeof (struct elf32_nios2_stub_hash_entry)))
+ {
+ _bfd_elf_link_hash_table_free (abfd);
+ return NULL;
+ }
+ ret->root.root.hash_table_free = nios2_elf32_link_hash_table_free;
+
return &ret->root.root;
}
@@ -3996,8 +5171,8 @@ nios2_elf32_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
static bfd_boolean
is_nios2_elf_target (const struct bfd_target *targ)
{
- return (targ == &bfd_elf32_littlenios2_vec
- || targ == &bfd_elf32_bignios2_vec);
+ return (targ == &nios2_elf32_le_vec
+ || targ == &nios2_elf32_be_vec);
}
/* Implement elf_backend_add_symbol_hook.
@@ -4126,9 +5301,9 @@ const struct bfd_elf_special_section elf32_nios2_special_sections[] =
#define elf_backend_special_sections elf32_nios2_special_sections
-#define TARGET_LITTLE_SYM bfd_elf32_littlenios2_vec
+#define TARGET_LITTLE_SYM nios2_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-littlenios2"
-#define TARGET_BIG_SYM bfd_elf32_bignios2_vec
+#define TARGET_BIG_SYM nios2_elf32_be_vec
#define TARGET_BIG_NAME "elf32-bignios2"
#define elf_backend_got_header_size 12
diff --git a/binutils-2.25/bfd/cpu-or32.c b/binutils-2.25/bfd/elf32-nios2.h
index 34ea52b0..1307802f 100644
--- a/binutils-2.25/bfd/cpu-or32.c
+++ b/binutils-2.25/bfd/elf32-nios2.h
@@ -1,6 +1,6 @@
-/* BFD support for the OpenRISC 1000 architecture.
- Copyright 2002, 2005, 2007 Free Software Foundation, Inc.
- Contributed by Ivan Guzvinec <ivang@opencores.org>
+/* Nios II support for 32-bit ELF
+ Copyright (C) 2013-2014 Free Software Foundation, Inc.
+ Contributed by Mentor Graphics
This file is part of BFD, the Binary File Descriptor library.
@@ -19,24 +19,20 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
-#include "sysdep.h"
-#include "bfd.h"
-#include "libbfd.h"
-
-const bfd_arch_info_type bfd_or32_arch =
- {
- 32, /* 32 bits in a word. */
- 32, /* 32 bits in an address. */
- 8, /* 8 bits in a byte. */
- bfd_arch_or32,
- 0, /* Only 1 machine. */
- "or32",
- "or32",
- 4,
- TRUE, /* The one and only. */
- bfd_default_compatible,
- bfd_default_scan,
- bfd_arch_default_fill,
- 0,
- };
+#ifndef _ELF32_NIOS2_H
+#define _ELF32_NIOS2_H
+extern int nios2_elf32_setup_section_lists
+ (bfd *, struct bfd_link_info *);
+
+extern void nios2_elf32_next_input_section
+ (struct bfd_link_info *, asection *);
+
+extern bfd_boolean nios2_elf32_size_stubs
+ (bfd *, bfd *, struct bfd_link_info *,
+ asection * (*) (const char *, asection *, bfd_boolean), void (*) (void));
+
+extern bfd_boolean nios2_elf32_build_stubs
+ (struct bfd_link_info *);
+
+#endif /* _ELF32_NIOS2_H */
diff --git a/binutils-2.25/bfd/elf32-openrisc.c b/binutils-2.25/bfd/elf32-openrisc.c
deleted file mode 100644
index 7abc938b..00000000
--- a/binutils-2.25/bfd/elf32-openrisc.c
+++ /dev/null
@@ -1,570 +0,0 @@
-/* OpenRISC-specific support for 32-bit ELF.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2012
- Free Software Foundation, Inc.
- Contributed by Johan Rydberg, jrydberg@opencores.org
-
- This file is part of BFD, the Binary File Descriptor library.
-
- 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "libbfd.h"
-#include "elf-bfd.h"
-#include "elf/openrisc.h"
-#include "libiberty.h"
-
-static reloc_howto_type openrisc_elf_howto_table[] =
-{
- /* This reloc does nothing. */
- HOWTO (R_OPENRISC_NONE, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OPENRISC_NONE", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- /* A PC relative 26 bit relocation, right shifted by 2. */
- HOWTO (R_OPENRISC_INSN_REL_26, /* type */
- 2, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 26, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OPENRISC_INSN_REL_26", /* name */
- FALSE, /* partial_inplace */
- 0x00000000, /* src_mask */
- 0x03ffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- /* A absolute 26 bit relocation, right shifted by 2. */
- HOWTO (R_OPENRISC_INSN_ABS_26, /* type */
- 2, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 26, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OPENRISC_INSN_ABS_26", /* name */
- FALSE, /* partial_inplace */
- 0x00000000, /* src_mask */
- 0x03ffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OPENRISC_LO_16_IN_INSN, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OPENRISC_LO_16_IN_INSN", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OPENRISC_HI_16_IN_INSN, /* type */
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OPENRISC_HI_16_IN_INSN", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- /* An 8 bit absolute relocation. */
- HOWTO (R_OPENRISC_8, /* type */
- 0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OPENRISC_8", /* name */
- TRUE, /* partial_inplace */
- 0x0000, /* src_mask */
- 0x00ff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- /* A 16 bit absolute relocation. */
- HOWTO (R_OPENRISC_16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OPENRISC_16", /* name */
- TRUE, /* partial_inplace */
- 0x00000000, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- /* A 32 bit absolute relocation. */
- HOWTO (R_OPENRISC_32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OPENRISC_32", /* name */
- TRUE, /* partial_inplace */
- 0x00000000, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- /* GNU extension to record C++ vtable hierarchy. */
- HOWTO (R_OPENRISC_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_OPENRISC_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- /* GNU extension to record C++ vtable member usage. */
- HOWTO (R_OPENRISC_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_OPENRISC_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
-};
-
-/* Map BFD reloc types to OpenRISC ELF reloc types. */
-
-struct openrisc_reloc_map
-{
- bfd_reloc_code_real_type bfd_reloc_val;
- unsigned int openrisc_reloc_val;
-};
-
-static const struct openrisc_reloc_map openrisc_reloc_map[] =
-{
- { BFD_RELOC_NONE, R_OPENRISC_NONE },
- { BFD_RELOC_32, R_OPENRISC_32 },
- { BFD_RELOC_16, R_OPENRISC_16 },
- { BFD_RELOC_8, R_OPENRISC_8 },
- { BFD_RELOC_OPENRISC_REL_26, R_OPENRISC_INSN_REL_26 },
- { BFD_RELOC_OPENRISC_ABS_26, R_OPENRISC_INSN_ABS_26 },
- { BFD_RELOC_HI16, R_OPENRISC_HI_16_IN_INSN },
- { BFD_RELOC_LO16, R_OPENRISC_LO_16_IN_INSN },
- { BFD_RELOC_VTABLE_INHERIT, R_OPENRISC_GNU_VTINHERIT },
- { BFD_RELOC_VTABLE_ENTRY, R_OPENRISC_GNU_VTENTRY }
-};
-
-static reloc_howto_type *
-openrisc_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type code)
-{
- unsigned int i;
-
- for (i = ARRAY_SIZE (openrisc_reloc_map); --i;)
- if (openrisc_reloc_map[i].bfd_reloc_val == code)
- return & openrisc_elf_howto_table[openrisc_reloc_map[i].
- openrisc_reloc_val];
-
- return NULL;
-}
-
-static reloc_howto_type *
-openrisc_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- const char *r_name)
-{
- unsigned int i;
-
- for (i = 0;
- i < (sizeof (openrisc_elf_howto_table)
- / sizeof (openrisc_elf_howto_table[0]));
- i++)
- if (openrisc_elf_howto_table[i].name != NULL
- && strcasecmp (openrisc_elf_howto_table[i].name, r_name) == 0)
- return &openrisc_elf_howto_table[i];
-
- return NULL;
-}
-
-/* Set the howto pointer for an OpenRISC ELF reloc. */
-
-static void
-openrisc_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
- arelent * cache_ptr,
- Elf_Internal_Rela * dst)
-{
- unsigned int r_type;
-
- r_type = ELF32_R_TYPE (dst->r_info);
- BFD_ASSERT (r_type < (unsigned int) R_OPENRISC_max);
- cache_ptr->howto = & openrisc_elf_howto_table[r_type];
-}
-
-/* Perform a single relocation. By default we use the standard BFD
- routines, but a few relocs, we have to do them ourselves. */
-
-static bfd_reloc_status_type
-openrisc_final_link_relocate (reloc_howto_type *howto,
- bfd *input_bfd,
- asection *input_section,
- bfd_byte *contents,
- Elf_Internal_Rela *rel,
- bfd_vma relocation)
-{
- bfd_reloc_status_type r = bfd_reloc_ok;
-
- switch (howto->type)
- {
- case R_OPENRISC_LO_16_IN_INSN:
- relocation &= 0xffff;
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, rel->r_addend);
- break;
-
- default:
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, rel->r_addend);
- }
-
- return r;
-}
-
-/* Relocate an OpenRISC ELF section.
-
- The RELOCATE_SECTION function is called by the new ELF backend linker
- to handle the relocations for a section.
-
- The relocs are always passed as Rela structures; if the section
- actually uses Rel structures, the r_addend field will always be
- zero.
-
- This function is responsible for adjusting the section contents as
- necessary, and (if using Rela relocs and generating a relocatable
- output file) adjusting the reloc addend as necessary.
-
- This function does not have to worry about setting the reloc
- address or the reloc symbol index.
-
- LOCAL_SYMS is a pointer to the swapped in local symbols.
-
- LOCAL_SECTIONS is an array giving the section in the input file
- corresponding to the st_shndx field of each local symbol.
-
- The global hash table entry for the global symbols can be found
- via elf_sym_hashes (input_bfd).
-
- When generating relocatable output, this function must handle
- STB_LOCAL/STT_SECTION symbols specially. The output symbol is
- going to be the section symbol corresponding to the output
- section, which means that the addend must be adjusted
- accordingly. */
-
-static bfd_boolean
-openrisc_elf_relocate_section (bfd *output_bfd,
- struct bfd_link_info *info,
- bfd *input_bfd,
- asection *input_section,
- bfd_byte *contents,
- Elf_Internal_Rela *relocs,
- Elf_Internal_Sym *local_syms,
- asection **local_sections)
-{
- Elf_Internal_Shdr *symtab_hdr;
- struct elf_link_hash_entry **sym_hashes;
- Elf_Internal_Rela *rel;
- Elf_Internal_Rela *relend;
-
- symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
- sym_hashes = elf_sym_hashes (input_bfd);
- relend = relocs + input_section->reloc_count;
-
- for (rel = relocs; rel < relend; rel++)
- {
- reloc_howto_type *howto;
- unsigned long r_symndx;
- Elf_Internal_Sym *sym;
- asection *sec;
- struct elf_link_hash_entry *h;
- bfd_vma relocation;
- bfd_reloc_status_type r;
- const char *name = NULL;
- int r_type;
-
- r_type = ELF32_R_TYPE (rel->r_info);
- r_symndx = ELF32_R_SYM (rel->r_info);
-
- if (r_type == R_OPENRISC_GNU_VTINHERIT
- || r_type == R_OPENRISC_GNU_VTENTRY)
- continue;
-
- if ((unsigned int) r_type >
- (sizeof openrisc_elf_howto_table / sizeof (reloc_howto_type)))
- abort ();
-
- howto = openrisc_elf_howto_table + ELF32_R_TYPE (rel->r_info);
- h = NULL;
- sym = NULL;
- sec = NULL;
-
- if (r_symndx < symtab_hdr->sh_info)
- {
- sym = local_syms + r_symndx;
- sec = local_sections[r_symndx];
- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-
- name = bfd_elf_string_from_elf_section
- (input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
- }
- else
- {
- bfd_boolean unresolved_reloc, warned;
-
- RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
- r_symndx, symtab_hdr, sym_hashes,
- h, sec, relocation,
- unresolved_reloc, warned);
- }
-
- if (sec != NULL && discarded_section (sec))
- RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
-
- if (info->relocatable)
- continue;
-
- r = openrisc_final_link_relocate (howto, input_bfd, input_section,
- contents, rel, relocation);
-
- if (r != bfd_reloc_ok)
- {
- const char *msg = NULL;
-
- switch (r)
- {
- case bfd_reloc_overflow:
- r = info->callbacks->reloc_overflow
- (info, (h ? &h->root : NULL), name, howto->name,
- (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
- break;
-
- case bfd_reloc_undefined:
- r = info->callbacks->undefined_symbol
- (info, name, input_bfd, input_section, rel->r_offset, TRUE);
- break;
-
- case bfd_reloc_outofrange:
- msg = _("internal error: out of range error");
- break;
-
- case bfd_reloc_notsupported:
- msg = _("internal error: unsupported relocation error");
- break;
-
- case bfd_reloc_dangerous:
- msg = _("internal error: dangerous relocation");
- break;
-
- default:
- msg = _("internal error: unknown error");
- break;
- }
-
- if (msg)
- r = info->callbacks->warning
- (info, msg, name, input_bfd, input_section, rel->r_offset);
-
- if (!r)
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-/* Return the section that should be marked against GC for a given
- relocation. */
-
-static asection *
-openrisc_elf_gc_mark_hook (asection *sec,
- struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
-{
- if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
- {
- case R_OPENRISC_GNU_VTINHERIT:
- case R_OPENRISC_GNU_VTENTRY:
- return NULL;
- }
-
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
-}
-
-/* Look through the relocs for a section during the first phase.
- Since we don't do .gots or .plts, we just need to consider the
- virtual table relocs for gc. */
-
-static bfd_boolean
-openrisc_elf_check_relocs (bfd *abfd,
- struct bfd_link_info *info,
- asection *sec,
- const Elf_Internal_Rela *relocs)
-{
- Elf_Internal_Shdr *symtab_hdr;
- struct elf_link_hash_entry **sym_hashes;
- const Elf_Internal_Rela *rel;
- const Elf_Internal_Rela *rel_end;
-
- if (info->relocatable)
- return TRUE;
-
- symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
- sym_hashes = elf_sym_hashes (abfd);
-
- rel_end = relocs + sec->reloc_count;
- for (rel = relocs; rel < rel_end; rel++)
- {
- struct elf_link_hash_entry *h;
- unsigned long r_symndx;
-
- r_symndx = ELF32_R_SYM (rel->r_info);
- if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
- else
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- /* PR15323, ref flags aren't set for references in the same
- object. */
- h->root.non_ir_ref = 1;
- }
-
- switch (ELF32_R_TYPE (rel->r_info))
- {
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_OPENRISC_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_OPENRISC_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
- }
- }
-
- return TRUE;
-}
-
-/* Set the right machine number. */
-
-static bfd_boolean
-openrisc_elf_object_p (bfd *abfd)
-{
- bfd_default_set_arch_mach (abfd, bfd_arch_openrisc, 0);
- return TRUE;
-}
-
-/* Store the machine number in the flags field. */
-
-static void
-openrisc_elf_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
-{
- unsigned long val;
-
- switch (bfd_get_mach (abfd))
- {
- default:
- val = 0;
- break;
- }
-
- elf_elfheader (abfd)->e_flags &= ~0xf;
- elf_elfheader (abfd)->e_flags |= val;
-}
-
-
-#define ELF_ARCH bfd_arch_openrisc
-#define ELF_MACHINE_CODE EM_OPENRISC
-#define ELF_MACHINE_ALT1 EM_OPENRISC_OLD
-#define ELF_MAXPAGESIZE 0x1000
-
-#define TARGET_BIG_SYM bfd_elf32_openrisc_vec
-#define TARGET_BIG_NAME "elf32-openrisc"
-
-#define elf_info_to_howto_rel NULL
-#define elf_info_to_howto openrisc_info_to_howto_rela
-#define elf_backend_relocate_section openrisc_elf_relocate_section
-#define elf_backend_gc_mark_hook openrisc_elf_gc_mark_hook
-#define elf_backend_check_relocs openrisc_elf_check_relocs
-
-#define elf_backend_can_gc_sections 1
-#define elf_backend_rela_normal 1
-
-#define bfd_elf32_bfd_reloc_type_lookup openrisc_reloc_type_lookup
-#define bfd_elf32_bfd_reloc_name_lookup openrisc_reloc_name_lookup
-
-#define elf_backend_object_p openrisc_elf_object_p
-#define elf_backend_final_write_processing openrisc_elf_final_write_processing
-
-#include "elf32-target.h"
diff --git a/binutils-2.25/bfd/elf32-or1k.c b/binutils-2.25/bfd/elf32-or1k.c
new file mode 100644
index 00000000..5cf29e13
--- /dev/null
+++ b/binutils-2.25/bfd/elf32-or1k.c
@@ -0,0 +1,2853 @@
+/* Or1k-specific support for 32-bit ELF.
+ Copyright 2001-2014 Free Software Foundation, Inc.
+ Contributed for OR32 by Johan Rydberg, jrydberg@opencores.org
+
+ PIC parts added by Stefan Kristiansson, stefan.kristiansson@saunalahti.fi,
+ largely based on elf32-m32r.c and elf32-microblaze.c.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ 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 3 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, see <http://www.gnu.org/licenses/>. */
+
+#include "sysdep.h"
+#include "bfd.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf/or1k.h"
+#include "libiberty.h"
+
+#define PLT_ENTRY_SIZE 20
+
+#define PLT0_ENTRY_WORD0 0x19800000 /* l.movhi r12, 0 <- hi(.got+4) */
+#define PLT0_ENTRY_WORD1 0xa98c0000 /* l.ori r12, r12, 0 <- lo(.got+4) */
+#define PLT0_ENTRY_WORD2 0x85ec0004 /* l.lwz r15, 4(r12) <- *(.got+8)*/
+#define PLT0_ENTRY_WORD3 0x44007800 /* l.jr r15 */
+#define PLT0_ENTRY_WORD4 0x858c0000 /* l.lwz r12, 0(r12) */
+
+#define PLT0_PIC_ENTRY_WORD0 0x85900004 /* l.lwz r12, 4(r16) */
+#define PLT0_PIC_ENTRY_WORD1 0x85f00008 /* l.lwz r15, 8(r16) */
+#define PLT0_PIC_ENTRY_WORD2 0x44007800 /* l.jr r15 */
+#define PLT0_PIC_ENTRY_WORD3 0x15000000 /* l.nop */
+#define PLT0_PIC_ENTRY_WORD4 0x15000000 /* l.nop */
+
+#define PLT_ENTRY_WORD0 0x19800000 /* l.movhi r12, 0 <- hi(got idx addr) */
+#define PLT_ENTRY_WORD1 0xa98c0000 /* l.ori r12, r12, 0 <- lo(got idx addr) */
+#define PLT_ENTRY_WORD2 0x858c0000 /* l.lwz r12, 0(r12) */
+#define PLT_ENTRY_WORD3 0x44006000 /* l.jr r12 */
+#define PLT_ENTRY_WORD4 0xa9600000 /* l.ori r11, r0, 0 <- reloc offset */
+
+#define PLT_PIC_ENTRY_WORD0 0x85900000 /* l.lwz r12, 0(r16) <- index in got */
+#define PLT_PIC_ENTRY_WORD1 0xa9600000 /* l.ori r11, r0, 0 <- reloc offset */
+#define PLT_PIC_ENTRY_WORD2 0x44006000 /* l.jr r12 */
+#define PLT_PIC_ENTRY_WORD3 0x15000000 /* l.nop */
+#define PLT_PIC_ENTRY_WORD4 0x15000000 /* l.nop */
+
+#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
+
+static reloc_howto_type or1k_elf_howto_table[] =
+{
+ /* This reloc does nothing. */
+ HOWTO (R_OR1K_NONE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_NONE", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_32,
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_32", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_16,
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_8,
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_8", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_LO_16_IN_INSN, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_LO_16_IN_INSN", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_HI_16_IN_INSN, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_HI_16_IN_INSN", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* A PC relative 26 bit relocation, right shifted by 2. */
+ HOWTO (R_OR1K_INSN_REL_26, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_INSN_REL_26", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x03ffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable hierarchy. */
+ HOWTO (R_OR1K_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_OR1K_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable member usage. */
+ HOWTO (R_OR1K_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_OR1K_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_32_PCREL,
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_32_PCREL", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_16_PCREL,
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_16_PCREL", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_8_PCREL,
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_8_PCREL", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_GOTPC_HI16, /* Type. */
+ 16, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc, /* Special Function. */
+ "R_OR1K_GOTPC_HI16", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0xffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
+
+ HOWTO (R_OR1K_GOTPC_LO16, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc, /* Special Function. */
+ "R_OR1K_GOTPC_LO16", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0xffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
+
+ HOWTO (R_OR1K_GOT16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_GOT16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* A 26 bit PLT relocation. Shifted by 2. */
+ HOWTO (R_OR1K_PLT26, /* Type. */
+ 2, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 26, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_OR1K_PLT26", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x03ffffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
+
+ HOWTO (R_OR1K_GOTOFF_HI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_GOTOFF_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_GOTOFF_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_GOTOFF_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_COPY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_COPY", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_GLOB_DAT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_GLOB_DAT", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_JMP_SLOT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_JMP_SLOT", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_RELATIVE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_RELATIVE", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_GD_HI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_GD_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_GD_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_GD_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_LDM_HI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_LDM_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_LDM_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_LDM_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_LDO_HI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_LDO_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_LDO_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_LDO_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_IE_HI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_IE_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_IE_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_IE_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_LE_HI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_LE_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_LE_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_LE_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+};
+
+/* Map BFD reloc types to Or1k ELF reloc types. */
+
+struct or1k_reloc_map
+{
+ bfd_reloc_code_real_type bfd_reloc_val;
+ unsigned int or1k_reloc_val;
+};
+
+static const struct or1k_reloc_map or1k_reloc_map[] =
+{
+ { BFD_RELOC_NONE, R_OR1K_NONE },
+ { BFD_RELOC_32, R_OR1K_32 },
+ { BFD_RELOC_16, R_OR1K_16 },
+ { BFD_RELOC_8, R_OR1K_8 },
+ { BFD_RELOC_LO16, R_OR1K_LO_16_IN_INSN },
+ { BFD_RELOC_HI16, R_OR1K_HI_16_IN_INSN },
+ { BFD_RELOC_OR1K_REL_26, R_OR1K_INSN_REL_26 },
+ { BFD_RELOC_VTABLE_ENTRY, R_OR1K_GNU_VTENTRY },
+ { BFD_RELOC_VTABLE_INHERIT, R_OR1K_GNU_VTINHERIT },
+ { BFD_RELOC_32_PCREL, R_OR1K_32_PCREL },
+ { BFD_RELOC_16_PCREL, R_OR1K_16_PCREL },
+ { BFD_RELOC_8_PCREL, R_OR1K_8_PCREL },
+ { BFD_RELOC_OR1K_GOTPC_HI16, R_OR1K_GOTPC_HI16 },
+ { BFD_RELOC_OR1K_GOTPC_LO16, R_OR1K_GOTPC_LO16 },
+ { BFD_RELOC_OR1K_GOT16, R_OR1K_GOT16 },
+ { BFD_RELOC_OR1K_PLT26, R_OR1K_PLT26 },
+ { BFD_RELOC_OR1K_GOTOFF_HI16, R_OR1K_GOTOFF_HI16 },
+ { BFD_RELOC_OR1K_GOTOFF_LO16, R_OR1K_GOTOFF_LO16 },
+ { BFD_RELOC_OR1K_GLOB_DAT, R_OR1K_GLOB_DAT },
+ { BFD_RELOC_OR1K_COPY, R_OR1K_COPY },
+ { BFD_RELOC_OR1K_JMP_SLOT, R_OR1K_JMP_SLOT },
+ { BFD_RELOC_OR1K_RELATIVE, R_OR1K_RELATIVE },
+ { BFD_RELOC_OR1K_TLS_GD_HI16, R_OR1K_TLS_GD_HI16 },
+ { BFD_RELOC_OR1K_TLS_GD_LO16, R_OR1K_TLS_GD_LO16 },
+ { BFD_RELOC_OR1K_TLS_LDM_HI16, R_OR1K_TLS_LDM_HI16 },
+ { BFD_RELOC_OR1K_TLS_LDM_LO16, R_OR1K_TLS_LDM_LO16 },
+ { BFD_RELOC_OR1K_TLS_LDO_HI16, R_OR1K_TLS_LDO_HI16 },
+ { BFD_RELOC_OR1K_TLS_LDO_LO16, R_OR1K_TLS_LDO_LO16 },
+ { BFD_RELOC_OR1K_TLS_IE_HI16, R_OR1K_TLS_IE_HI16 },
+ { BFD_RELOC_OR1K_TLS_IE_LO16, R_OR1K_TLS_IE_LO16 },
+ { BFD_RELOC_OR1K_TLS_LE_HI16, R_OR1K_TLS_LE_HI16 },
+ { BFD_RELOC_OR1K_TLS_LE_LO16, R_OR1K_TLS_LE_LO16 },
+};
+
+/* The linker needs to keep track of the number of relocs that it
+ decides to copy as dynamic relocs in check_relocs for each symbol.
+ This is so that it can later discard them if they are found to be
+ unnecessary. We store the information in a field extending the
+ regular ELF linker hash table. */
+
+struct elf_or1k_dyn_relocs
+{
+ struct elf_or1k_dyn_relocs *next;
+
+ /* The input section of the reloc. */
+ asection *sec;
+
+ /* Total number of relocs copied for the input section. */
+ bfd_size_type count;
+
+ /* Number of pc-relative relocs copied for the input section. */
+ bfd_size_type pc_count;
+};
+
+#define TLS_UNKNOWN 0
+#define TLS_NONE 1
+#define TLS_GD 2
+#define TLS_LD 3
+#define TLS_IE 4
+#define TLS_LE 5
+
+/* ELF linker hash entry. */
+struct elf_or1k_link_hash_entry
+{
+ struct elf_link_hash_entry root;
+
+ /* Track dynamic relocs copied for this symbol. */
+ struct elf_or1k_dyn_relocs *dyn_relocs;
+
+ /* Track type of TLS access. */
+ unsigned char tls_type;
+};
+
+/* ELF object data. */
+struct elf_or1k_obj_tdata
+{
+ struct elf_obj_tdata root;
+
+ /* tls_type for each local got entry. */
+ unsigned char *local_tls_type;
+};
+
+#define elf_or1k_tdata(abfd) \
+ ((struct elf_or1k_obj_tdata *) (abfd)->tdata.any)
+
+#define elf_or1k_local_tls_type(abfd) \
+ (elf_or1k_tdata (abfd)->local_tls_type)
+
+/* ELF linker hash table. */
+struct elf_or1k_link_hash_table
+{
+ struct elf_link_hash_table root;
+
+ /* Short-cuts to get to dynamic linker sections. */
+ asection *sgot;
+ asection *sgotplt;
+ asection *srelgot;
+ asection *splt;
+ asection *srelplt;
+ asection *sdynbss;
+ asection *srelbss;
+
+ /* Small local sym to section mapping cache. */
+ struct sym_cache sym_sec;
+};
+
+/* Get the ELF linker hash table from a link_info structure. */
+#define or1k_elf_hash_table(p) \
+ (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
+ == OR1K_ELF_DATA ? ((struct elf_or1k_link_hash_table *) ((p)->hash)) : NULL)
+
+static bfd_boolean
+elf_or1k_mkobject (bfd *abfd)
+{
+ return bfd_elf_allocate_object (abfd, sizeof (struct elf_or1k_obj_tdata),
+ OR1K_ELF_DATA);
+}
+
+/* Create an entry in an or1k ELF linker hash table. */
+
+static struct bfd_hash_entry *
+or1k_elf_link_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
+{
+ struct elf_or1k_link_hash_entry *ret =
+ (struct elf_or1k_link_hash_entry *) entry;
+
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (ret == NULL)
+ ret = bfd_hash_allocate (table,
+ sizeof (struct elf_or1k_link_hash_entry));
+ if (ret == NULL)
+ return NULL;
+
+ /* Call the allocation method of the superclass. */
+ ret = ((struct elf_or1k_link_hash_entry *)
+ _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
+ table, string));
+ if (ret != NULL)
+ {
+ struct elf_or1k_link_hash_entry *eh;
+
+ eh = (struct elf_or1k_link_hash_entry *) ret;
+ eh->dyn_relocs = NULL;
+ eh->tls_type = TLS_UNKNOWN;
+ }
+
+ return (struct bfd_hash_entry *) ret;
+}
+
+/* Create an or1k ELF linker hash table. */
+
+static struct bfd_link_hash_table *
+or1k_elf_link_hash_table_create (bfd *abfd)
+{
+ struct elf_or1k_link_hash_table *ret;
+ bfd_size_type amt = sizeof (struct elf_or1k_link_hash_table);
+
+ ret = bfd_zmalloc (amt);
+ if (ret == NULL)
+ return NULL;
+
+ if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
+ or1k_elf_link_hash_newfunc,
+ sizeof (struct elf_or1k_link_hash_entry),
+ OR1K_ELF_DATA))
+ {
+ free (ret);
+ return NULL;
+ }
+
+ return &ret->root.root;
+}
+
+static reloc_howto_type *
+or1k_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
+{
+ unsigned int i;
+
+ for (i = ARRAY_SIZE (or1k_reloc_map); --i;)
+ if (or1k_reloc_map[i].bfd_reloc_val == code)
+ return & or1k_elf_howto_table[or1k_reloc_map[i].or1k_reloc_val];
+
+ return NULL;
+}
+
+static reloc_howto_type *
+or1k_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ const char *r_name)
+{
+ unsigned int i;
+
+ for (i = 0;
+ i < (sizeof (or1k_elf_howto_table)
+ / sizeof (or1k_elf_howto_table[0]));
+ i++)
+ if (or1k_elf_howto_table[i].name != NULL
+ && strcasecmp (or1k_elf_howto_table[i].name, r_name) == 0)
+ return &or1k_elf_howto_table[i];
+
+ return NULL;
+}
+
+/* Set the howto pointer for an Or1k ELF reloc. */
+
+static void
+or1k_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
+ arelent * cache_ptr,
+ Elf_Internal_Rela * dst)
+{
+ unsigned int r_type;
+
+ r_type = ELF32_R_TYPE (dst->r_info);
+ BFD_ASSERT (r_type < (unsigned int) R_OR1K_max);
+ cache_ptr->howto = & or1k_elf_howto_table[r_type];
+}
+
+
+/* Return the relocation value for @tpoff relocations.. */
+static bfd_vma
+tpoff (struct bfd_link_info *info, bfd_vma address)
+{
+ /* If tls_sec is NULL, we should have signalled an error already. */
+ if (elf_hash_table (info)->tls_sec == NULL)
+ return 0;
+
+ /* The thread pointer on or1k stores the address after the TCB where
+ the data is, just compute the difference. No need to compensate
+ for the size of TCB. */
+ return (address - elf_hash_table (info)->tls_sec->vma);
+}
+
+/* Relocate an Or1k ELF section.
+
+ The RELOCATE_SECTION function is called by the new ELF backend linker
+ to handle the relocations for a section.
+
+ The relocs are always passed as Rela structures; if the section
+ actually uses Rel structures, the r_addend field will always be
+ zero.
+
+ This function is responsible for adjusting the section contents as
+ necessary, and (if using Rela relocs and generating a relocatable
+ output file) adjusting the reloc addend as necessary.
+
+ This function does not have to worry about setting the reloc
+ address or the reloc symbol index.
+
+ LOCAL_SYMS is a pointer to the swapped in local symbols.
+
+ LOCAL_SECTIONS is an array giving the section in the input file
+ corresponding to the st_shndx field of each local symbol.
+
+ The global hash table entry for the global symbols can be found
+ via elf_sym_hashes (input_bfd).
+
+ When generating relocatable output, this function must handle
+ STB_LOCAL/STT_SECTION symbols specially. The output symbol is
+ going to be the section symbol corresponding to the output
+ section, which means that the addend must be adjusted
+ accordingly. */
+
+static bfd_boolean
+or1k_elf_relocate_section (bfd *output_bfd,
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections)
+{
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ Elf_Internal_Rela *rel;
+ Elf_Internal_Rela *relend;
+ struct elf_or1k_link_hash_table *htab = or1k_elf_hash_table (info);
+ bfd *dynobj;
+ asection *sreloc;
+ bfd_vma *local_got_offsets;
+ asection *sgot;
+
+ if (htab == NULL)
+ return FALSE;
+
+ dynobj = htab->root.dynobj;
+ local_got_offsets = elf_local_got_offsets (input_bfd);
+
+ sreloc = elf_section_data (input_section)->sreloc;
+
+ sgot = htab->sgot;
+
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (input_bfd);
+ relend = relocs + input_section->reloc_count;
+
+ for (rel = relocs; rel < relend; rel++)
+ {
+ reloc_howto_type *howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym *sym;
+ asection *sec;
+ struct elf_link_hash_entry *h;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ const char *name = NULL;
+ int r_type;
+
+ r_type = ELF32_R_TYPE (rel->r_info);
+ r_symndx = ELF32_R_SYM (rel->r_info);
+
+ if (r_type == R_OR1K_GNU_VTINHERIT
+ || r_type == R_OR1K_GNU_VTENTRY)
+ continue;
+
+ if (r_type < 0 || r_type >= (int) R_OR1K_max)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
+ howto = or1k_elf_howto_table + ELF32_R_TYPE (rel->r_info);
+ h = NULL;
+ sym = NULL;
+ sec = NULL;
+
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+
+ name = bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name);
+ name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ }
+ else
+ {
+ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && discarded_section (sec))
+ RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
+ rel, 1, relend, howto, 0, contents);
+
+ if (info->relocatable)
+ continue;
+
+ switch (howto->type)
+ {
+ case R_OR1K_PLT26:
+ {
+ if (htab->splt != NULL && h != NULL
+ && h->plt.offset != (bfd_vma) -1)
+ {
+ relocation = (htab->splt->output_section->vma
+ + htab->splt->output_offset
+ + h->plt.offset);
+ }
+ break;
+ }
+
+ case R_OR1K_GOT16:
+ /* Relocation is to the entry for this symbol in the global
+ offset table. */
+ BFD_ASSERT (sgot != NULL);
+ if (h != NULL)
+ {
+ bfd_boolean dyn;
+ bfd_vma off;
+
+ off = h->got.offset;
+ BFD_ASSERT (off != (bfd_vma) -1);
+
+ dyn = htab->root.dynamic_sections_created;
+ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
+ || (info->shared
+ && SYMBOL_REFERENCES_LOCAL (info, h)))
+ {
+ /* This is actually a static link, or it is a
+ -Bsymbolic link and the symbol is defined
+ locally, or the symbol was forced to be local
+ because of a version file. We must initialize
+ this entry in the global offset table. Since the
+ offset must always be a multiple of 4, we use the
+ least significant bit to record whether we have
+ initialized it already.
+
+ When doing a dynamic link, we create a .rela.got
+ relocation entry to initialize the value. This
+ is done in the finish_dynamic_symbol routine. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ /* Write entry in GOT. */
+ bfd_put_32 (output_bfd, relocation,
+ sgot->contents + off);
+ /* Mark GOT entry as having been written. */
+ h->got.offset |= 1;
+ }
+ }
+
+ relocation = sgot->output_offset + off;
+ }
+ else
+ {
+ bfd_vma off;
+ bfd_byte *loc;
+
+ BFD_ASSERT (local_got_offsets != NULL
+ && local_got_offsets[r_symndx] != (bfd_vma) -1);
+
+ /* Get offset into GOT table. */
+ off = local_got_offsets[r_symndx];
+
+ /* The offset must always be a multiple of 4. We use
+ the least significant bit to record whether we have
+ already processed this entry. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ /* Write entry in GOT. */
+ bfd_put_32 (output_bfd, relocation, sgot->contents + off);
+ if (info->shared)
+ {
+ asection *srelgot;
+ Elf_Internal_Rela outrel;
+
+ /* We need to generate a R_OR1K_RELATIVE reloc
+ for the dynamic linker. */
+ srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+ BFD_ASSERT (srelgot != NULL);
+
+ outrel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + off);
+ outrel.r_info = ELF32_R_INFO (0, R_OR1K_RELATIVE);
+ outrel.r_addend = relocation;
+ loc = srelgot->contents;
+ loc += srelgot->reloc_count * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel,loc);
+ ++srelgot->reloc_count;
+ }
+
+ local_got_offsets[r_symndx] |= 1;
+ }
+ relocation = sgot->output_offset + off;
+ }
+
+ /* Addend should be zero. */
+ if (rel->r_addend != 0)
+ (*_bfd_error_handler)
+ (_("internal error: addend should be zero for R_OR1K_GOT16"));
+
+ break;
+
+ case R_OR1K_GOTOFF_LO16:
+ case R_OR1K_GOTOFF_HI16:
+ /* Relocation is offset from GOT. */
+ BFD_ASSERT (sgot != NULL);
+ relocation -= sgot->output_section->vma;
+ break;
+
+ case R_OR1K_INSN_REL_26:
+ case R_OR1K_HI_16_IN_INSN:
+ case R_OR1K_LO_16_IN_INSN:
+ case R_OR1K_32:
+ /* R_OR1K_16? */
+ {
+ /* r_symndx will be STN_UNDEF (zero) only for relocs against symbols
+ from removed linkonce sections, or sections discarded by
+ a linker script. */
+ if (r_symndx == STN_UNDEF
+ || (input_section->flags & SEC_ALLOC) == 0)
+ break;
+
+ if ((info->shared
+ && (h == NULL
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
+ && (howto->type != R_OR1K_INSN_REL_26
+ || !SYMBOL_CALLS_LOCAL (info, h)))
+ || (!info->shared
+ && h != NULL
+ && h->dynindx != -1
+ && !h->non_got_ref
+ && ((h->def_dynamic
+ && !h->def_regular)
+ || h->root.type == bfd_link_hash_undefweak
+ || h->root.type == bfd_link_hash_undefined)))
+ {
+ Elf_Internal_Rela outrel;
+ bfd_byte *loc;
+ bfd_boolean skip;
+
+ /* When generating a shared object, these relocations
+ are copied into the output file to be resolved at run
+ time. */
+
+ BFD_ASSERT (sreloc != NULL);
+
+ skip = FALSE;
+
+ outrel.r_offset =
+ _bfd_elf_section_offset (output_bfd, info, input_section,
+ rel->r_offset);
+ if (outrel.r_offset == (bfd_vma) -1)
+ skip = TRUE;
+ else if (outrel.r_offset == (bfd_vma) -2)
+ skip = TRUE;
+ outrel.r_offset += (input_section->output_section->vma
+ + input_section->output_offset);
+
+ if (skip)
+ memset (&outrel, 0, sizeof outrel);
+ /* h->dynindx may be -1 if the symbol was marked to
+ become local. */
+ else if (h != NULL
+ && ((! info->symbolic && h->dynindx != -1)
+ || !h->def_regular))
+ {
+ BFD_ASSERT (h->dynindx != -1);
+ outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
+ outrel.r_addend = rel->r_addend;
+ }
+ else
+ {
+ if (r_type == R_OR1K_32)
+ {
+ outrel.r_info = ELF32_R_INFO (0, R_OR1K_RELATIVE);
+ outrel.r_addend = relocation + rel->r_addend;
+ }
+ else
+ {
+ BFD_FAIL ();
+ (*_bfd_error_handler)
+ (_("%B: probably compiled without -fPIC?"),
+ input_bfd);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+ }
+
+ loc = sreloc->contents;
+ loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ break;
+ }
+ break;
+ }
+
+ case R_OR1K_TLS_LDM_HI16:
+ case R_OR1K_TLS_LDM_LO16:
+ case R_OR1K_TLS_LDO_HI16:
+ case R_OR1K_TLS_LDO_LO16:
+ /* TODO: implement support for local dynamic. */
+ BFD_FAIL ();
+ (*_bfd_error_handler)
+ (_("%B: support for local dynamic not implemented"),
+ input_bfd);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+
+
+ case R_OR1K_TLS_GD_HI16:
+ case R_OR1K_TLS_GD_LO16:
+ case R_OR1K_TLS_IE_HI16:
+ case R_OR1K_TLS_IE_LO16:
+ {
+ bfd_vma gotoff;
+ Elf_Internal_Rela rela;
+ bfd_byte *loc;
+ int dynamic;
+
+ sreloc = bfd_get_section_by_name (dynobj, ".rela.got");
+
+ /* Mark as TLS related GOT entry by setting
+ bit 2 as well as bit 1. */
+ if (h != NULL)
+ {
+ gotoff = h->got.offset;
+ h->got.offset |= 3;
+ }
+ else
+ {
+ gotoff = local_got_offsets[r_symndx];
+ local_got_offsets[r_symndx] |= 3;
+ }
+
+ /* Only process the relocation once. */
+ if (gotoff & 1)
+ {
+ relocation = sgot->output_offset + (gotoff & ~3);
+ break;
+ }
+
+ BFD_ASSERT (elf_hash_table (info)->hgot == NULL
+ || elf_hash_table (info)->hgot->root.u.def.value == 0);
+
+ /* Dynamic entries will require relocations. if we do not need
+ them we will just use the default R_OR1K_NONE and
+ not set anything. */
+ dynamic = info->shared
+ || (sec && (sec->flags & SEC_ALLOC) != 0
+ && h != NULL
+ && (h->root.type == bfd_link_hash_defweak || !h->def_regular));
+
+ /* Shared GD. */
+ if (dynamic && (howto->type == R_OR1K_TLS_GD_HI16
+ || howto->type == R_OR1K_TLS_GD_LO16))
+ {
+ int i;
+
+ /* Add DTPMOD and DTPOFF GOT and rela entries. */
+ for (i = 0; i < 2; ++i)
+ {
+ rela.r_offset = sgot->output_section->vma +
+ sgot->output_offset + gotoff + i*4;
+ if (h != NULL && h->dynindx != -1)
+ {
+ rela.r_info = ELF32_R_INFO (h->dynindx,
+ (i == 0 ? R_OR1K_TLS_DTPMOD : R_OR1K_TLS_DTPOFF));
+ rela.r_addend = 0;
+ }
+ else
+ {
+ rela.r_info = ELF32_R_INFO (0,
+ (i == 0 ? R_OR1K_TLS_DTPMOD : R_OR1K_TLS_DTPOFF));
+ rela.r_addend = tpoff (info, relocation);
+ }
+
+ loc = sreloc->contents;
+ loc += sreloc->reloc_count++ *
+ sizeof (Elf32_External_Rela);
+
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ bfd_put_32 (output_bfd, 0, sgot->contents + gotoff + i*4);
+ }
+ }
+ /* Static GD. */
+ else if (howto->type == R_OR1K_TLS_GD_HI16
+ || howto->type == R_OR1K_TLS_GD_LO16)
+ {
+ bfd_put_32 (output_bfd, 1, sgot->contents + gotoff);
+ bfd_put_32 (output_bfd, tpoff (info, relocation),
+ sgot->contents + gotoff + 4);
+ }
+ /* Shared IE. */
+ else if (dynamic)
+ {
+ /* Add TPOFF GOT and rela entries. */
+ rela.r_offset = sgot->output_section->vma +
+ sgot->output_offset + gotoff;
+ if (h != NULL && h->dynindx != -1)
+ {
+ rela.r_info = ELF32_R_INFO (h->dynindx, R_OR1K_TLS_TPOFF);
+ rela.r_addend = 0;
+ }
+ else
+ {
+ rela.r_info = ELF32_R_INFO (0, R_OR1K_TLS_TPOFF);
+ rela.r_addend = tpoff (info, relocation);
+ }
+
+ loc = sreloc->contents;
+ loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
+
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ bfd_put_32 (output_bfd, 0, sgot->contents + gotoff);
+ }
+ /* Static IE. */
+ else
+ {
+ bfd_put_32 (output_bfd, tpoff (info, relocation),
+ sgot->contents + gotoff);
+ }
+ relocation = sgot->output_offset + gotoff;
+ break;
+ }
+ case R_OR1K_TLS_LE_HI16:
+ case R_OR1K_TLS_LE_LO16:
+
+ /* Relocation is offset from TP. */
+ relocation = tpoff (info, relocation);
+ break;
+
+ case R_OR1K_TLS_DTPMOD:
+ case R_OR1K_TLS_DTPOFF:
+ case R_OR1K_TLS_TPOFF:
+ /* These are resolved dynamically on load and shouldn't
+ be used as linker input. */
+ BFD_FAIL ();
+ (*_bfd_error_handler)
+ (_("%B: will not resolve runtime TLS relocation"),
+ input_bfd);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+
+ default:
+ break;
+ }
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents,
+ rel->r_offset, relocation, rel->r_addend);
+
+ if (r != bfd_reloc_ok)
+ {
+ const char *msg = NULL;
+
+ switch (r)
+ {
+ case bfd_reloc_overflow:
+ r = info->callbacks->reloc_overflow
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
+ break;
+
+ case bfd_reloc_undefined:
+ r = info->callbacks->undefined_symbol
+ (info, name, input_bfd, input_section, rel->r_offset, TRUE);
+ break;
+
+ case bfd_reloc_outofrange:
+ msg = _("internal error: out of range error");
+ break;
+
+ case bfd_reloc_notsupported:
+ msg = _("internal error: unsupported relocation error");
+ break;
+
+ case bfd_reloc_dangerous:
+ msg = _("internal error: dangerous relocation");
+ break;
+
+ default:
+ msg = _("internal error: unknown error");
+ break;
+ }
+
+ if (msg)
+ r = info->callbacks->warning
+ (info, msg, name, input_bfd, input_section, rel->r_offset);
+
+ if (!r)
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+/* Return the section that should be marked against GC for a given
+ relocation. */
+
+static asection *
+or1k_elf_gc_mark_hook (asection *sec,
+ struct bfd_link_info *info,
+ Elf_Internal_Rela *rel,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
+{
+ if (h != NULL)
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_OR1K_GNU_VTINHERIT:
+ case R_OR1K_GNU_VTENTRY:
+ return NULL;
+ }
+
+ return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+}
+
+static bfd_boolean
+or1k_elf_gc_sweep_hook (bfd *abfd,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ asection *sec,
+ const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED)
+{
+ /* Update the got entry reference counts for the section being removed. */
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ bfd_signed_vma *local_got_refcounts;
+ const Elf_Internal_Rela *rel, *relend;
+
+ elf_section_data (sec)->local_dynrel = NULL;
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+ local_got_refcounts = elf_local_got_refcounts (abfd);
+
+ relend = relocs + sec->reloc_count;
+ for (rel = relocs; rel < relend; rel++)
+ {
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h = NULL;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ }
+
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_OR1K_GOT16:
+ if (h != NULL)
+ {
+ if (h->got.refcount > 0)
+ h->got.refcount--;
+ }
+ else
+ {
+ if (local_got_refcounts && local_got_refcounts[r_symndx] > 0)
+ local_got_refcounts[r_symndx]--;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ return TRUE;
+}
+
+/* Create .got, .gotplt, and .rela.got sections in DYNOBJ, and set up
+ shortcuts to them in our hash table. */
+
+static bfd_boolean
+create_got_section (bfd *dynobj, struct bfd_link_info *info)
+{
+ struct elf_or1k_link_hash_table *htab;
+ asection *s;
+
+ /* This function may be called more than once. */
+ s = bfd_get_section_by_name (dynobj, ".got");
+ if (s != NULL && (s->flags & SEC_LINKER_CREATED) != 0)
+ return TRUE;
+
+ htab = or1k_elf_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
+ if (! _bfd_elf_create_got_section (dynobj, info))
+ return FALSE;
+
+ htab->sgot = bfd_get_section_by_name (dynobj, ".got");
+ htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
+ htab->srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+
+ if (! htab->sgot || ! htab->sgotplt || ! htab->srelgot)
+ abort ();
+
+ if (! bfd_set_section_flags (dynobj, htab->srelgot, SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY)
+ || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2))
+ return FALSE;
+
+ return TRUE;
+}
+
+/* Look through the relocs for a section during the first phase. */
+
+static bfd_boolean
+or1k_elf_check_relocs (bfd *abfd,
+ struct bfd_link_info *info,
+ asection *sec,
+ const Elf_Internal_Rela *relocs)
+{
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ const Elf_Internal_Rela *rel;
+
+ const Elf_Internal_Rela *rel_end;
+ struct elf_or1k_link_hash_table *htab;
+ bfd *dynobj;
+ asection *sreloc = NULL;
+
+ if (info->relocatable)
+ return TRUE;
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+
+ htab = or1k_elf_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
+ dynobj = htab->root.dynobj;
+
+ rel_end = relocs + sec->reloc_count;
+ for (rel = relocs; rel < rel_end; rel++)
+ {
+ struct elf_link_hash_entry *h;
+ unsigned long r_symndx;
+ unsigned char tls_type;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx < symtab_hdr->sh_info)
+ h = NULL;
+ else
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ /* PR15323, ref flags aren't set for references in the same
+ object. */
+ h->root.non_ir_ref = 1;
+ }
+
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_OR1K_TLS_GD_HI16:
+ case R_OR1K_TLS_GD_LO16:
+ tls_type = TLS_GD;
+ break;
+ case R_OR1K_TLS_LDM_HI16:
+ case R_OR1K_TLS_LDM_LO16:
+ case R_OR1K_TLS_LDO_HI16:
+ case R_OR1K_TLS_LDO_LO16:
+ tls_type = TLS_LD;
+ break;
+ case R_OR1K_TLS_IE_HI16:
+ case R_OR1K_TLS_IE_LO16:
+ tls_type = TLS_IE;
+ break;
+ case R_OR1K_TLS_LE_HI16:
+ case R_OR1K_TLS_LE_LO16:
+ tls_type = TLS_LE;
+ break;
+ default:
+ tls_type = TLS_NONE;
+ }
+
+ /* Record TLS type. */
+ if (h != NULL)
+ ((struct elf_or1k_link_hash_entry *) h)->tls_type = tls_type;
+ else
+ {
+ unsigned char *local_tls_type;
+
+ /* This is a TLS type record for a local symbol. */
+ local_tls_type = (unsigned char *) elf_or1k_local_tls_type (abfd);
+ if (local_tls_type == NULL)
+ {
+ bfd_size_type size;
+
+ size = symtab_hdr->sh_info;
+ local_tls_type = bfd_zalloc (abfd, size);
+ if (local_tls_type == NULL)
+ return FALSE;
+ elf_or1k_local_tls_type (abfd) = local_tls_type;
+ }
+ local_tls_type[r_symndx] = tls_type;
+ }
+
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_OR1K_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_OR1K_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
+
+ /* This relocation requires .plt entry. */
+ case R_OR1K_PLT26:
+ if (h != NULL)
+ {
+ h->needs_plt = 1;
+ h->plt.refcount += 1;
+ }
+ break;
+
+ case R_OR1K_GOT16:
+ case R_OR1K_GOTOFF_HI16:
+ case R_OR1K_GOTOFF_LO16:
+ case R_OR1K_TLS_GD_HI16:
+ case R_OR1K_TLS_GD_LO16:
+ case R_OR1K_TLS_IE_HI16:
+ case R_OR1K_TLS_IE_LO16:
+ if (htab->sgot == NULL)
+ {
+ if (dynobj == NULL)
+ htab->root.dynobj = dynobj = abfd;
+ if (! create_got_section (dynobj, info))
+ return FALSE;
+ }
+
+ if (ELF32_R_TYPE (rel->r_info) != R_OR1K_GOTOFF_HI16 &&
+ ELF32_R_TYPE (rel->r_info) != R_OR1K_GOTOFF_LO16)
+ {
+ if (h != NULL)
+ h->got.refcount += 1;
+ else
+ {
+ bfd_signed_vma *local_got_refcounts;
+
+ /* This is a global offset table entry for a local symbol. */
+ local_got_refcounts = elf_local_got_refcounts (abfd);
+ if (local_got_refcounts == NULL)
+ {
+ bfd_size_type size;
+
+ size = symtab_hdr->sh_info;
+ size *= sizeof (bfd_signed_vma);
+ local_got_refcounts = bfd_zalloc (abfd, size);
+ if (local_got_refcounts == NULL)
+ return FALSE;
+ elf_local_got_refcounts (abfd) = local_got_refcounts;
+ }
+ local_got_refcounts[r_symndx] += 1;
+ }
+ }
+ break;
+
+ case R_OR1K_INSN_REL_26:
+ case R_OR1K_HI_16_IN_INSN:
+ case R_OR1K_LO_16_IN_INSN:
+ case R_OR1K_32:
+ /* R_OR1K_16? */
+ {
+ if (h != NULL && !info->shared)
+ {
+ /* We may need a copy reloc. */
+ h->non_got_ref = 1;
+
+ /* We may also need a .plt entry. */
+ h->plt.refcount += 1;
+ if (ELF32_R_TYPE (rel->r_info) != R_OR1K_INSN_REL_26)
+ h->pointer_equality_needed = 1;
+ }
+
+ /* If we are creating a shared library, and this is a reloc
+ against a global symbol, or a non PC relative reloc
+ against a local symbol, then we need to copy the reloc
+ into the shared library. However, if we are linking with
+ -Bsymbolic, we do not need to copy a reloc against a
+ global symbol which is defined in an object we are
+ including in the link (i.e., DEF_REGULAR is set). At
+ this point we have not seen all the input files, so it is
+ possible that DEF_REGULAR is not set now but will be set
+ later (it is never cleared). In case of a weak definition,
+ DEF_REGULAR may be cleared later by a strong definition in
+ a shared library. We account for that possibility below by
+ storing information in the relocs_copied field of the hash
+ table entry. A similar situation occurs when creating
+ shared libraries and symbol visibility changes render the
+ symbol local.
+
+ If on the other hand, we are creating an executable, we
+ may need to keep relocations for symbols satisfied by a
+ dynamic library if we manage to avoid copy relocs for the
+ symbol. */
+
+ if ((info->shared
+ && (sec->flags & SEC_ALLOC) != 0
+ && (ELF32_R_TYPE (rel->r_info) != R_OR1K_INSN_REL_26
+ || (h != NULL
+ && (!SYMBOLIC_BIND (info, h)
+ || h->root.type == bfd_link_hash_defweak
+ || !h->def_regular))))
+ || (!info->shared
+ && (sec->flags & SEC_ALLOC) != 0
+ && h != NULL
+ && (h->root.type == bfd_link_hash_defweak
+ || !h->def_regular)))
+ {
+ struct elf_or1k_dyn_relocs *p;
+ struct elf_or1k_dyn_relocs **head;
+
+ /* When creating a shared object, we must copy these
+ relocs into the output file. We create a reloc
+ section in dynobj and make room for the reloc. */
+ if (sreloc == NULL)
+ {
+ const char *name;
+ unsigned int strndx = elf_elfheader (abfd)->e_shstrndx;
+ unsigned int shnam = _bfd_elf_single_rel_hdr (sec)->sh_name;
+
+ name = bfd_elf_string_from_elf_section (abfd, strndx, shnam);
+ if (name == NULL)
+ return FALSE;
+
+ if (strncmp (name, ".rela", 5) != 0
+ || strcmp (bfd_get_section_name (abfd, sec),
+ name + 5) != 0)
+ {
+ (*_bfd_error_handler)
+ (_("%B: bad relocation section name `%s\'"),
+ abfd, name);
+ }
+
+ if (htab->root.dynobj == NULL)
+ htab->root.dynobj = abfd;
+ dynobj = htab->root.dynobj;
+
+ sreloc = bfd_get_section_by_name (dynobj, name);
+ if (sreloc == NULL)
+ {
+ sreloc = _bfd_elf_make_dynamic_reloc_section
+ (sec, dynobj, 2, abfd, /*rela?*/ TRUE);
+
+ if (sreloc == NULL)
+ return FALSE;
+ }
+ elf_section_data (sec)->sreloc = sreloc;
+ }
+
+ /* If this is a global symbol, we count the number of
+ relocations we need for this symbol. */
+ if (h != NULL)
+ head = &((struct elf_or1k_link_hash_entry *) h)->dyn_relocs;
+ else
+ {
+ /* Track dynamic relocs needed for local syms too.
+ We really need local syms available to do this
+ easily. Oh well. */
+
+ asection *s;
+ Elf_Internal_Sym *isym;
+ void *vpp;
+
+ isym = bfd_sym_from_r_symndx (&htab->sym_sec,
+ abfd, r_symndx);
+ if (isym == NULL)
+ return FALSE;
+
+ s = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ if (s == NULL)
+ return FALSE;
+
+ vpp = &elf_section_data (s)->local_dynrel;
+ head = (struct elf_or1k_dyn_relocs **) vpp;
+ }
+
+ p = *head;
+ if (p == NULL || p->sec != sec)
+ {
+ bfd_size_type amt = sizeof *p;
+ p = ((struct elf_or1k_dyn_relocs *)
+ bfd_alloc (htab->root.dynobj, amt));
+ if (p == NULL)
+ return FALSE;
+ p->next = *head;
+ *head = p;
+ p->sec = sec;
+ p->count = 0;
+ p->pc_count = 0;
+ }
+
+ p->count += 1;
+ if (ELF32_R_TYPE (rel->r_info) == R_OR1K_INSN_REL_26)
+ p->pc_count += 1;
+ }
+ }
+ break;
+ }
+ }
+
+ return TRUE;
+}
+
+/* Finish up the dynamic sections. */
+
+static bfd_boolean
+or1k_elf_finish_dynamic_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
+{
+ bfd *dynobj;
+ asection *sdyn, *sgot;
+ struct elf_or1k_link_hash_table *htab;
+
+ htab = or1k_elf_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
+ dynobj = htab->root.dynobj;
+
+ sgot = htab->sgotplt;
+ sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+
+ if (htab->root.dynamic_sections_created)
+ {
+ asection *splt;
+ Elf32_External_Dyn *dyncon, *dynconend;
+
+ BFD_ASSERT (sgot != NULL && sdyn != NULL);
+
+ dyncon = (Elf32_External_Dyn *) sdyn->contents;
+ dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
+
+ for (; dyncon < dynconend; dyncon++)
+ {
+ Elf_Internal_Dyn dyn;
+ asection *s;
+
+ bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+
+ switch (dyn.d_tag)
+ {
+ default:
+ continue;
+
+ case DT_PLTGOT:
+ s = htab->sgot->output_section;
+ BFD_ASSERT (s != NULL);
+ dyn.d_un.d_ptr = s->vma;
+ break;
+
+ case DT_JMPREL:
+ s = htab->srelplt->output_section;
+ BFD_ASSERT (s != NULL);
+ dyn.d_un.d_ptr = s->vma;
+ break;
+
+ case DT_PLTRELSZ:
+ s = htab->srelplt->output_section;
+ BFD_ASSERT (s != NULL);
+ dyn.d_un.d_val = s->size;
+ break;
+
+ case DT_RELASZ:
+ /* My reading of the SVR4 ABI indicates that the
+ procedure linkage table relocs (DT_JMPREL) should be
+ included in the overall relocs (DT_RELA). This is
+ what Solaris does. However, UnixWare can not handle
+ that case. Therefore, we override the DT_RELASZ entry
+ here to make it not include the JMPREL relocs. Since
+ the linker script arranges for .rela.plt to follow all
+ other relocation sections, we don't have to worry
+ about changing the DT_RELA entry. */
+ if (htab->srelplt != NULL)
+ {
+ /* FIXME: this calculation sometimes produces
+ wrong result, the problem is that the dyn.d_un.d_val
+ is not always correct, needs investigation why
+ that happens. In the meantime, reading the
+ ".rela.dyn" section by name seems to yield
+ correct result.
+
+ s = htab->srelplt->output_section;
+ dyn.d_un.d_val -= s->size;
+ */
+
+ s = bfd_get_section_by_name (output_bfd, ".rela.dyn");
+ dyn.d_un.d_val = s ? s->size : 0;
+ }
+ break;
+ }
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ }
+
+
+ /* Fill in the first entry in the procedure linkage table. */
+ splt = htab->splt;
+ if (splt && splt->size > 0)
+ {
+ if (info->shared)
+ {
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD0,
+ splt->contents);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD1,
+ splt->contents + 4);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD2,
+ splt->contents + 8);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD3,
+ splt->contents + 12);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD4,
+ splt->contents + 16);
+ }
+ else
+ {
+ unsigned long addr;
+ /* addr = .got + 4 */
+ addr = sgot->output_section->vma + sgot->output_offset + 4;
+ bfd_put_32 (output_bfd,
+ PLT0_ENTRY_WORD0 | ((addr >> 16) & 0xffff),
+ splt->contents);
+ bfd_put_32 (output_bfd,
+ PLT0_ENTRY_WORD1 | (addr & 0xffff),
+ splt->contents + 4);
+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD2, splt->contents + 8);
+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD3, splt->contents + 12);
+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD4, splt->contents + 16);
+ }
+
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4;
+ }
+ }
+
+ /* Set the first entry in the global offset table to the address of
+ the dynamic section. */
+ if (sgot && sgot->size > 0)
+ {
+ if (sdyn == NULL)
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
+ else
+ bfd_put_32 (output_bfd,
+ sdyn->output_section->vma + sdyn->output_offset,
+ sgot->contents);
+ elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
+ }
+
+ if (htab->sgot && htab->sgot->size > 0)
+ elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize = 4;
+
+ return TRUE;
+}
+
+/* Finish up dynamic symbol handling. We set the contents of various
+ dynamic sections here. */
+
+static bfd_boolean
+or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
+ struct bfd_link_info *info,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
+{
+ struct elf_or1k_link_hash_table *htab;
+ bfd_byte *loc;
+
+ htab = or1k_elf_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
+ if (h->plt.offset != (bfd_vma) -1)
+ {
+ asection *splt;
+ asection *sgot;
+ asection *srela;
+
+ bfd_vma plt_index;
+ bfd_vma got_offset;
+ bfd_vma got_addr;
+ Elf_Internal_Rela rela;
+
+ /* This symbol has an entry in the procedure linkage table. Set
+ it up. */
+ BFD_ASSERT (h->dynindx != -1);
+
+ splt = htab->splt;
+ sgot = htab->sgotplt;
+ srela = htab->srelplt;
+ BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL);
+
+ /* Get the index in the procedure linkage table which
+ corresponds to this symbol. This is the index of this symbol
+ in all the symbols for which we are making plt entries. The
+ first entry in the procedure linkage table is reserved. */
+ plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
+
+ /* Get the offset into the .got table of the entry that
+ corresponds to this function. Each .got entry is 4 bytes.
+ The first three are reserved. */
+ got_offset = (plt_index + 3) * 4;
+ got_addr = got_offset;
+
+ /* Fill in the entry in the procedure linkage table. */
+ if (! info->shared)
+ {
+ got_addr += htab->sgotplt->output_section->vma
+ + htab->sgotplt->output_offset;
+ bfd_put_32 (output_bfd, PLT_ENTRY_WORD0 | ((got_addr >> 16) & 0xffff),
+ splt->contents + h->plt.offset);
+ bfd_put_32 (output_bfd, PLT_ENTRY_WORD1 | (got_addr & 0xffff),
+ splt->contents + h->plt.offset + 4);
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD2,
+ splt->contents + h->plt.offset + 8);
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD3,
+ splt->contents + h->plt.offset + 12);
+ bfd_put_32 (output_bfd, PLT_ENTRY_WORD4
+ | plt_index * sizeof (Elf32_External_Rela),
+ splt->contents + h->plt.offset + 16);
+ }
+ else
+ {
+ bfd_put_32 (output_bfd, PLT_PIC_ENTRY_WORD0 | (got_addr & 0xffff),
+ splt->contents + h->plt.offset);
+ bfd_put_32 (output_bfd, PLT_PIC_ENTRY_WORD1
+ | plt_index * sizeof (Elf32_External_Rela),
+ splt->contents + h->plt.offset + 4);
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD2,
+ splt->contents + h->plt.offset + 8);
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD3,
+ splt->contents + h->plt.offset + 12);
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD4,
+ splt->contents + h->plt.offset + 16);
+ }
+
+ /* Fill in the entry in the global offset table. */
+ bfd_put_32 (output_bfd,
+ (splt->output_section->vma
+ + splt->output_offset), /* Same offset. */
+ sgot->contents + got_offset);
+
+ /* Fill in the entry in the .rela.plt section. */
+ rela.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + got_offset);
+ rela.r_info = ELF32_R_INFO (h->dynindx, R_OR1K_JMP_SLOT);
+ rela.r_addend = 0;
+ loc = srela->contents;
+ loc += plt_index * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+
+ if (!h->def_regular)
+ {
+ /* Mark the symbol as undefined, rather than as defined in
+ the .plt section. Leave the value alone. */
+ sym->st_shndx = SHN_UNDEF;
+ }
+
+ }
+
+ if (h->got.offset != (bfd_vma) -1
+ && (h->got.offset & 2) == 0) /* Homemade TLS check. */
+ {
+ asection *sgot;
+ asection *srela;
+ Elf_Internal_Rela rela;
+
+ /* This symbol has an entry in the global offset table. Set it
+ up. */
+ sgot = htab->sgot;
+ srela = htab->srelgot;
+ BFD_ASSERT (sgot != NULL && srela != NULL);
+
+ rela.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + (h->got.offset &~ 1));
+
+ /* If this is a -Bsymbolic link, and the symbol is defined
+ locally, we just want to emit a RELATIVE reloc. Likewise if
+ the symbol was forced to be local because of a version file.
+ The entry in the global offset table will already have been
+ initialized in the relocate_section function. */
+ if (info->shared && SYMBOL_REFERENCES_LOCAL (info, h))
+ {
+ rela.r_info = ELF32_R_INFO (0, R_OR1K_RELATIVE);
+ rela.r_addend = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ }
+ else
+ {
+ BFD_ASSERT ((h->got.offset & 1) == 0);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
+ rela.r_info = ELF32_R_INFO (h->dynindx, R_OR1K_GLOB_DAT);
+ rela.r_addend = 0;
+ }
+
+ loc = srela->contents;
+ loc += srela->reloc_count * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ ++srela->reloc_count;
+ }
+
+ if (h->needs_copy)
+ {
+ asection *s;
+ Elf_Internal_Rela rela;
+
+ /* This symbols needs a copy reloc. Set it up. */
+ BFD_ASSERT (h->dynindx != -1
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak));
+
+ s = bfd_get_section_by_name (h->root.u.def.section->owner,
+ ".rela.bss");
+ BFD_ASSERT (s != NULL);
+
+ rela.r_offset = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ rela.r_info = ELF32_R_INFO (h->dynindx, R_OR1K_COPY);
+ rela.r_addend = 0;
+ loc = s->contents;
+ loc += s->reloc_count * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ ++s->reloc_count;
+ }
+
+ /* Mark some specially defined symbols as absolute. */
+ if (strcmp (h->root.root.string, "_DYNAMIC") == 0
+ || h == htab->root.hgot)
+ sym->st_shndx = SHN_ABS;
+
+ return TRUE;
+}
+
+static enum elf_reloc_type_class
+or1k_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ const asection *rel_sec ATTRIBUTE_UNUSED,
+ const Elf_Internal_Rela *rela)
+{
+ switch ((int) ELF32_R_TYPE (rela->r_info))
+ {
+ case R_OR1K_RELATIVE: return reloc_class_relative;
+ case R_OR1K_JMP_SLOT: return reloc_class_plt;
+ case R_OR1K_COPY: return reloc_class_copy;
+ default: return reloc_class_normal;
+ }
+}
+
+/* Adjust a symbol defined by a dynamic object and referenced by a
+ regular object. The current definition is in some section of the
+ dynamic object, but we're not including those sections. We have to
+ change the definition to something the rest of the link can
+ understand. */
+
+static bfd_boolean
+or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *h)
+{
+ struct elf_or1k_link_hash_table *htab;
+ struct elf_or1k_link_hash_entry *eh;
+ struct elf_or1k_dyn_relocs *p;
+ bfd *dynobj;
+ asection *s;
+
+ dynobj = elf_hash_table (info)->dynobj;
+
+ /* Make sure we know what is going on here. */
+ BFD_ASSERT (dynobj != NULL
+ && (h->needs_plt
+ || h->u.weakdef != NULL
+ || (h->def_dynamic
+ && h->ref_regular
+ && !h->def_regular)));
+
+ /* If this is a function, put it in the procedure linkage table. We
+ will fill in the contents of the procedure linkage table later,
+ when we know the address of the .got section. */
+ if (h->type == STT_FUNC
+ || h->needs_plt)
+ {
+ if (! info->shared
+ && !h->def_dynamic
+ && !h->ref_dynamic
+ && h->root.type != bfd_link_hash_undefweak
+ && h->root.type != bfd_link_hash_undefined)
+ {
+ /* This case can occur if we saw a PLT reloc in an input
+ file, but the symbol was never referred to by a dynamic
+ object. In such a case, we don't actually need to build
+ a procedure linkage table, and we can just do a PCREL
+ reloc instead. */
+ h->plt.offset = (bfd_vma) -1;
+ h->needs_plt = 0;
+ }
+
+ return TRUE;
+ }
+ else
+ h->plt.offset = (bfd_vma) -1;
+
+ /* If this is a weak symbol, and there is a real definition, the
+ processor independent code will have arranged for us to see the
+ real definition first, and we can just use the same value. */
+ if (h->u.weakdef != NULL)
+ {
+ BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
+ || h->u.weakdef->root.type == bfd_link_hash_defweak);
+ h->root.u.def.section = h->u.weakdef->root.u.def.section;
+ h->root.u.def.value = h->u.weakdef->root.u.def.value;
+ return TRUE;
+ }
+
+ /* This is a reference to a symbol defined by a dynamic object which
+ is not a function. */
+
+ /* If we are creating a shared library, we must presume that the
+ only references to the symbol are via the global offset table.
+ For such cases we need not do anything here; the relocations will
+ be handled correctly by relocate_section. */
+ if (info->shared)
+ return TRUE;
+
+ /* If there are no references to this symbol that do not use the
+ GOT, we don't need to generate a copy reloc. */
+ if (!h->non_got_ref)
+ return TRUE;
+
+ /* If -z nocopyreloc was given, we won't generate them either. */
+ if (info->nocopyreloc)
+ {
+ h->non_got_ref = 0;
+ return TRUE;
+ }
+
+ eh = (struct elf_or1k_link_hash_entry *) h;
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ {
+ s = p->sec->output_section;
+ if (s != NULL && (s->flags & (SEC_READONLY | SEC_HAS_CONTENTS)) != 0)
+ break;
+ }
+
+ /* If we didn't find any dynamic relocs in sections which needs the
+ copy reloc, then we'll be keeping the dynamic relocs and avoiding
+ the copy reloc. */
+ if (p == NULL)
+ {
+ h->non_got_ref = 0;
+ return TRUE;
+ }
+
+ /* We must allocate the symbol in our .dynbss section, which will
+ become part of the .bss section of the executable. There will be
+ an entry for this symbol in the .dynsym section. The dynamic
+ object will contain position independent code, so all references
+ from the dynamic object to this symbol will go through the global
+ offset table. The dynamic linker will use the .dynsym entry to
+ determine the address it must put in the global offset table, so
+ both the dynamic object and the regular object will refer to the
+ same memory location for the variable. */
+
+ htab = or1k_elf_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
+ s = htab->sdynbss;
+ BFD_ASSERT (s != NULL);
+
+ /* We must generate a R_OR1K_COPY reloc to tell the dynamic linker
+ to copy the initial value out of the dynamic object and into the
+ runtime process image. We need to remember the offset into the
+ .rela.bss section we are going to use. */
+ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
+ {
+ asection *srel;
+
+ srel = htab->srelbss;
+ BFD_ASSERT (srel != NULL);
+ srel->size += sizeof (Elf32_External_Rela);
+ h->needs_copy = 1;
+ }
+
+ return _bfd_elf_adjust_dynamic_copy (h, s);
+}
+
+/* Allocate space in .plt, .got and associated reloc sections for
+ dynamic relocs. */
+
+static bfd_boolean
+allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
+{
+ struct bfd_link_info *info;
+ struct elf_or1k_link_hash_table *htab;
+ struct elf_or1k_link_hash_entry *eh;
+ struct elf_or1k_dyn_relocs *p;
+
+ if (h->root.type == bfd_link_hash_indirect)
+ return TRUE;
+
+ info = (struct bfd_link_info *) inf;
+ htab = or1k_elf_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
+ eh = (struct elf_or1k_link_hash_entry *) h;
+
+ if (htab->root.dynamic_sections_created
+ && h->plt.refcount > 0)
+ {
+ /* Make sure this symbol is output as a dynamic symbol.
+ Undefined weak syms won't yet be marked as dynamic. */
+ if (h->dynindx == -1
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h))
+ {
+ asection *s = htab->splt;
+
+ /* If this is the first .plt entry, make room for the special
+ first entry. */
+ if (s->size == 0)
+ s->size = PLT_ENTRY_SIZE;
+
+ h->plt.offset = s->size;
+
+ /* If this symbol is not defined in a regular file, and we are
+ not generating a shared library, then set the symbol to this
+ location in the .plt. This is required to make function
+ pointers compare as equal between the normal executable and
+ the shared library. */
+ if (! info->shared
+ && !h->def_regular)
+ {
+ h->root.u.def.section = s;
+ h->root.u.def.value = h->plt.offset;
+ }
+
+ /* Make room for this entry. */
+ s->size += PLT_ENTRY_SIZE;
+
+ /* We also need to make an entry in the .got.plt section, which
+ will be placed in the .got section by the linker script. */
+ htab->sgotplt->size += 4;
+
+ /* We also need to make an entry in the .rel.plt section. */
+ htab->srelplt->size += sizeof (Elf32_External_Rela);
+ }
+ else
+ {
+ h->plt.offset = (bfd_vma) -1;
+ h->needs_plt = 0;
+ }
+ }
+ else
+ {
+ h->plt.offset = (bfd_vma) -1;
+ h->needs_plt = 0;
+ }
+
+ if (h->got.refcount > 0)
+ {
+ asection *s;
+ bfd_boolean dyn;
+ unsigned char tls_type;
+
+ /* Make sure this symbol is output as a dynamic symbol.
+ Undefined weak syms won't yet be marked as dynamic. */
+ if (h->dynindx == -1
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
+ s = htab->sgot;
+
+ h->got.offset = s->size;
+
+ tls_type = ((struct elf_or1k_link_hash_entry *) h)->tls_type;
+
+ /* TLS GD requires two GOT and two relocs. */
+ if (tls_type == TLS_GD)
+ s->size += 8;
+ else
+ s->size += 4;
+ dyn = htab->root.dynamic_sections_created;
+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h))
+ {
+ if (tls_type == TLS_GD)
+ htab->srelgot->size += 2 * sizeof (Elf32_External_Rela);
+ else
+ htab->srelgot->size += sizeof (Elf32_External_Rela);
+ }
+ }
+ else
+ h->got.offset = (bfd_vma) -1;
+
+ if (eh->dyn_relocs == NULL)
+ return TRUE;
+
+ /* In the shared -Bsymbolic case, discard space allocated for
+ dynamic pc-relative relocs against symbols which turn out to be
+ defined in regular objects. For the normal shared case, discard
+ space for pc-relative relocs that have become local due to symbol
+ visibility changes. */
+
+ if (info->shared)
+ {
+ if (SYMBOL_CALLS_LOCAL (info, h))
+ {
+ struct elf_or1k_dyn_relocs **pp;
+
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
+ {
+ p->count -= p->pc_count;
+ p->pc_count = 0;
+ if (p->count == 0)
+ *pp = p->next;
+ else
+ pp = &p->next;
+ }
+ }
+
+ /* Also discard relocs on undefined weak syms with non-default
+ visibility. */
+ if (eh->dyn_relocs != NULL
+ && h->root.type == bfd_link_hash_undefweak)
+ {
+ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
+ eh->dyn_relocs = NULL;
+
+ /* Make sure undefined weak symbols are output as a dynamic
+ symbol in PIEs. */
+ else if (h->dynindx == -1
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+ }
+ }
+ else
+ {
+ /* For the non-shared case, discard space for relocs against
+ symbols which turn out to need copy relocs or are not
+ dynamic. */
+
+ if (!h->non_got_ref
+ && ((h->def_dynamic
+ && !h->def_regular)
+ || (htab->root.dynamic_sections_created
+ && (h->root.type == bfd_link_hash_undefweak
+ || h->root.type == bfd_link_hash_undefined))))
+ {
+ /* Make sure this symbol is output as a dynamic symbol.
+ Undefined weak syms won't yet be marked as dynamic. */
+ if (h->dynindx == -1
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
+ /* If that succeeded, we know we'll be keeping all the
+ relocs. */
+ if (h->dynindx != -1)
+ goto keep;
+ }
+
+ eh->dyn_relocs = NULL;
+
+ keep: ;
+ }
+
+ /* Finally, allocate space. */
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ {
+ asection *sreloc = elf_section_data (p->sec)->sreloc;
+ sreloc->size += p->count * sizeof (Elf32_External_Rela);
+ }
+
+ return TRUE;
+}
+
+/* Find any dynamic relocs that apply to read-only sections. */
+
+static bfd_boolean
+readonly_dynrelocs (struct elf_link_hash_entry *h, void * inf)
+{
+ struct elf_or1k_link_hash_entry *eh;
+ struct elf_or1k_dyn_relocs *p;
+
+ eh = (struct elf_or1k_link_hash_entry *) h;
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ {
+ asection *s = p->sec->output_section;
+
+ if (s != NULL && (s->flags & SEC_READONLY) != 0)
+ {
+ struct bfd_link_info *info = (struct bfd_link_info *) inf;
+
+ info->flags |= DF_TEXTREL;
+
+ /* Not an error, just cut short the traversal. */
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+/* Set the sizes of the dynamic sections. */
+
+static bfd_boolean
+or1k_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
+{
+ struct elf_or1k_link_hash_table *htab;
+ bfd *dynobj;
+ asection *s;
+ bfd_boolean relocs;
+ bfd *ibfd;
+
+ htab = or1k_elf_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
+ dynobj = htab->root.dynobj;
+ BFD_ASSERT (dynobj != NULL);
+
+ if (htab->root.dynamic_sections_created)
+ {
+ /* Set the contents of the .interp section to the interpreter. */
+ if (info->executable)
+ {
+ s = bfd_get_section_by_name (dynobj, ".interp");
+ BFD_ASSERT (s != NULL);
+ s->size = sizeof ELF_DYNAMIC_INTERPRETER;
+ s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
+ }
+ }
+
+ /* Set up .got offsets for local syms, and space for local dynamic
+ relocs. */
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
+ {
+ bfd_signed_vma *local_got;
+ bfd_signed_vma *end_local_got;
+ bfd_size_type locsymcount;
+ Elf_Internal_Shdr *symtab_hdr;
+ unsigned char *local_tls_type;
+ asection *srel;
+
+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour)
+ continue;
+
+ for (s = ibfd->sections; s != NULL; s = s->next)
+ {
+ struct elf_or1k_dyn_relocs *p;
+
+ for (p = ((struct elf_or1k_dyn_relocs *)
+ elf_section_data (s)->local_dynrel);
+ p != NULL;
+ p = p->next)
+ {
+ if (! bfd_is_abs_section (p->sec)
+ && bfd_is_abs_section (p->sec->output_section))
+ {
+ /* Input section has been discarded, either because
+ it is a copy of a linkonce section or due to
+ linker script /DISCARD/, so we'll be discarding
+ the relocs too. */
+ }
+ else if (p->count != 0)
+ {
+ srel = elf_section_data (p->sec)->sreloc;
+ srel->size += p->count * sizeof (Elf32_External_Rela);
+ if ((p->sec->output_section->flags & SEC_READONLY) != 0)
+ info->flags |= DF_TEXTREL;
+ }
+ }
+ }
+
+ local_got = elf_local_got_refcounts (ibfd);
+ if (!local_got)
+ continue;
+
+ symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+ locsymcount = symtab_hdr->sh_info;
+ end_local_got = local_got + locsymcount;
+ s = htab->sgot;
+ srel = htab->srelgot;
+ local_tls_type = (unsigned char *) elf_or1k_local_tls_type (ibfd);
+ for (; local_got < end_local_got; ++local_got)
+ {
+ if (*local_got > 0)
+ {
+ *local_got = s->size;
+
+ /* TLS GD requires two GOT and two relocs. */
+ if (local_tls_type != NULL && *local_tls_type == TLS_GD)
+ s->size += 8;
+ else
+ s->size += 4;
+ if (info->shared)
+ {
+ if (local_tls_type != NULL && *local_tls_type == TLS_GD)
+ srel->size += 2 * sizeof (Elf32_External_Rela);
+ else
+ srel->size += sizeof (Elf32_External_Rela);
+ }
+ }
+ else
+
+ *local_got = (bfd_vma) -1;
+
+ if (local_tls_type)
+ ++local_tls_type;
+ }
+ }
+
+ /* Allocate global sym .plt and .got entries, and space for global
+ sym dynamic relocs. */
+ elf_link_hash_traverse (&htab->root, allocate_dynrelocs, info);
+
+ /* We now have determined the sizes of the various dynamic sections.
+ Allocate memory for them. */
+ relocs = FALSE;
+ for (s = dynobj->sections; s != NULL; s = s->next)
+ {
+ if ((s->flags & SEC_LINKER_CREATED) == 0)
+ continue;
+
+ if (s == htab->splt
+ || s == htab->sgot
+ || s == htab->sgotplt
+ || s == htab->sdynbss)
+ {
+ /* Strip this section if we don't need it; see the
+ comment below. */
+ }
+ else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
+ {
+ if (s->size != 0 && s != htab->srelplt)
+ relocs = TRUE;
+
+ /* We use the reloc_count field as a counter if we need
+ to copy relocs into the output file. */
+ s->reloc_count = 0;
+ }
+ else
+ /* It's not one of our sections, so don't allocate space. */
+ continue;
+
+ if (s->size == 0)
+ {
+ /* If we don't need this section, strip it from the
+ output file. This is mostly to handle .rela.bss and
+ .rela.plt. We must create both sections in
+ create_dynamic_sections, because they must be created
+ before the linker maps input sections to output
+ sections. The linker does that before
+ adjust_dynamic_symbol is called, and it is that
+ function which decides whether anything needs to go
+ into these sections. */
+ s->flags |= SEC_EXCLUDE;
+ continue;
+ }
+
+ if ((s->flags & SEC_HAS_CONTENTS) == 0)
+ continue;
+
+ /* Allocate memory for the section contents. We use bfd_zalloc
+ here in case unused entries are not reclaimed before the
+ section's contents are written out. This should not happen,
+ but this way if it does, we get a R_OR1K_NONE reloc instead
+ of garbage. */
+ s->contents = bfd_zalloc (dynobj, s->size);
+
+ if (s->contents == NULL)
+ return FALSE;
+ }
+
+ if (htab->root.dynamic_sections_created)
+ {
+ /* Add some entries to the .dynamic section. We fill in the
+ values later, in or1k_elf_finish_dynamic_sections, but we
+ must add the entries now so that we get the correct size for
+ the .dynamic section. The DT_DEBUG entry is filled in by the
+ dynamic linker and used by the debugger. */
+#define add_dynamic_entry(TAG, VAL) \
+ _bfd_elf_add_dynamic_entry (info, TAG, VAL)
+
+ if (info->executable)
+ {
+ if (! add_dynamic_entry (DT_DEBUG, 0))
+ return FALSE;
+ }
+
+ if (htab->splt->size != 0)
+ {
+ if (! add_dynamic_entry (DT_PLTGOT, 0)
+ || ! add_dynamic_entry (DT_PLTRELSZ, 0)
+ || ! add_dynamic_entry (DT_PLTREL, DT_RELA)
+ || ! add_dynamic_entry (DT_JMPREL, 0))
+ return FALSE;
+ }
+
+ if (relocs)
+ {
+ if (! add_dynamic_entry (DT_RELA, 0)
+ || ! add_dynamic_entry (DT_RELASZ, 0)
+ || ! add_dynamic_entry (DT_RELAENT,
+ sizeof (Elf32_External_Rela)))
+ return FALSE;
+
+ /* If any dynamic relocs apply to a read-only section,
+ then we need a DT_TEXTREL entry. */
+ if ((info->flags & DF_TEXTREL) == 0)
+ elf_link_hash_traverse (&htab->root, readonly_dynrelocs,
+ info);
+
+ if ((info->flags & DF_TEXTREL) != 0)
+ {
+ if (! add_dynamic_entry (DT_TEXTREL, 0))
+ return FALSE;
+ }
+ }
+ }
+
+#undef add_dynamic_entry
+ return TRUE;
+}
+
+/* Create dynamic sections when linking against a dynamic object. */
+
+static bfd_boolean
+or1k_elf_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
+{
+ struct elf_or1k_link_hash_table *htab;
+
+ htab = or1k_elf_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
+ if (!htab->sgot && !create_got_section (dynobj, info))
+ return FALSE;
+
+ if (!_bfd_elf_create_dynamic_sections (dynobj, info))
+ return FALSE;
+
+ htab->splt = bfd_get_section_by_name (dynobj, ".plt");
+ htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt");
+ htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss");
+ if (!info->shared)
+ htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss");
+
+ if (!htab->splt || !htab->srelplt || !htab->sdynbss
+ || (!info->shared && !htab->srelbss))
+ abort ();
+
+ return TRUE;
+}
+
+/* Copy the extra info we tack onto an elf_link_hash_entry. */
+
+static void
+or1k_elf_copy_indirect_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *dir,
+ struct elf_link_hash_entry *ind)
+{
+ struct elf_or1k_link_hash_entry * edir;
+ struct elf_or1k_link_hash_entry * eind;
+
+ edir = (struct elf_or1k_link_hash_entry *) dir;
+ eind = (struct elf_or1k_link_hash_entry *) ind;
+
+ if (eind->dyn_relocs != NULL)
+ {
+ if (edir->dyn_relocs != NULL)
+ {
+ struct elf_or1k_dyn_relocs **pp;
+ struct elf_or1k_dyn_relocs *p;
+
+ /* Add reloc counts against the indirect sym to the direct sym
+ list. Merge any entries against the same section. */
+ for (pp = &eind->dyn_relocs; (p = *pp) != NULL;)
+ {
+ struct elf_or1k_dyn_relocs *q;
+
+ for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ if (q->sec == p->sec)
+ {
+ q->pc_count += p->pc_count;
+ q->count += p->count;
+ *pp = p->next;
+ break;
+ }
+ if (q == NULL)
+ pp = &p->next;
+ }
+ *pp = edir->dyn_relocs;
+ }
+
+ edir->dyn_relocs = eind->dyn_relocs;
+ eind->dyn_relocs = NULL;
+ }
+
+ if (ind->root.type == bfd_link_hash_indirect)
+ {
+ if (dir->got.refcount <= 0)
+ {
+ edir->tls_type = eind->tls_type;
+ eind->tls_type = TLS_UNKNOWN;
+ }
+ }
+
+ _bfd_elf_link_hash_copy_indirect (info, dir, ind);
+}
+
+/* Set the right machine number. */
+
+static bfd_boolean
+or1k_elf_object_p (bfd *abfd)
+{
+ unsigned long mach = bfd_mach_or1k;
+
+ if (elf_elfheader (abfd)->e_flags & EF_OR1K_NODELAY)
+ mach = bfd_mach_or1knd;
+
+ return bfd_default_set_arch_mach (abfd, bfd_arch_or1k, mach);
+}
+
+/* Store the machine number in the flags field. */
+
+static void
+or1k_elf_final_write_processing (bfd *abfd,
+ bfd_boolean linker ATTRIBUTE_UNUSED)
+{
+ switch (bfd_get_mach (abfd))
+ {
+ default:
+ case bfd_mach_or1k:
+ break;
+ case bfd_mach_or1knd:
+ elf_elfheader (abfd)->e_flags |= EF_OR1K_NODELAY;
+ break;
+ }
+}
+
+static bfd_boolean
+or1k_elf_set_private_flags (bfd *abfd, flagword flags)
+{
+ BFD_ASSERT (!elf_flags_init (abfd)
+ || elf_elfheader (abfd)->e_flags == flags);
+
+ elf_elfheader (abfd)->e_flags = flags;
+ elf_flags_init (abfd) = TRUE;
+ return TRUE;
+}
+
+/* Make sure all input files are consistent with respect to
+ EF_OR1K_NODELAY flag setting. */
+
+static bfd_boolean
+elf32_or1k_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
+{
+ flagword out_flags;
+ flagword in_flags;
+
+ in_flags = elf_elfheader (ibfd)->e_flags;
+ out_flags = elf_elfheader (obfd)->e_flags;
+
+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return TRUE;
+
+ if (!elf_flags_init (obfd))
+ {
+ elf_flags_init (obfd) = TRUE;
+ elf_elfheader (obfd)->e_flags = in_flags;
+
+ return TRUE;
+ }
+
+ if (in_flags == out_flags)
+ return TRUE;
+
+ if ((in_flags & EF_OR1K_NODELAY) != (out_flags & EF_OR1K_NODELAY))
+ {
+ (*_bfd_error_handler)
+ (_("%B: EF_OR1K_NODELAY flag mismatch with previous modules"), ibfd);
+
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
+ return TRUE;
+
+}
+
+#define ELF_ARCH bfd_arch_or1k
+#define ELF_MACHINE_CODE EM_OR1K
+#define ELF_TARGET_ID OR1K_ELF_DATA
+#define ELF_MAXPAGESIZE 0x2000
+
+#define TARGET_BIG_SYM or1k_elf32_vec
+#define TARGET_BIG_NAME "elf32-or1k"
+
+#define elf_info_to_howto_rel NULL
+#define elf_info_to_howto or1k_info_to_howto_rela
+#define elf_backend_relocate_section or1k_elf_relocate_section
+#define elf_backend_gc_mark_hook or1k_elf_gc_mark_hook
+#define elf_backend_gc_sweep_hook or1k_elf_gc_sweep_hook
+#define elf_backend_check_relocs or1k_elf_check_relocs
+#define elf_backend_reloc_type_class or1k_elf_reloc_type_class
+#define elf_backend_can_gc_sections 1
+#define elf_backend_rela_normal 1
+
+#define bfd_elf32_mkobject elf_or1k_mkobject
+
+#define bfd_elf32_bfd_merge_private_bfd_data elf32_or1k_merge_private_bfd_data
+#define bfd_elf32_bfd_set_private_flags or1k_elf_set_private_flags
+#define bfd_elf32_bfd_reloc_type_lookup or1k_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup or1k_reloc_name_lookup
+
+#define elf_backend_object_p or1k_elf_object_p
+#define elf_backend_final_write_processing or1k_elf_final_write_processing
+#define elf_backend_can_refcount 1
+
+#define elf_backend_plt_readonly 1
+#define elf_backend_want_got_plt 1
+#define elf_backend_want_plt_sym 0
+#define elf_backend_got_header_size 12
+#define bfd_elf32_bfd_link_hash_table_create or1k_elf_link_hash_table_create
+#define elf_backend_copy_indirect_symbol or1k_elf_copy_indirect_symbol
+#define elf_backend_create_dynamic_sections or1k_elf_create_dynamic_sections
+#define elf_backend_finish_dynamic_sections or1k_elf_finish_dynamic_sections
+#define elf_backend_size_dynamic_sections or1k_elf_size_dynamic_sections
+#define elf_backend_adjust_dynamic_symbol or1k_elf_adjust_dynamic_symbol
+#define elf_backend_finish_dynamic_symbol or1k_elf_finish_dynamic_symbol
+
+#include "elf32-target.h"
diff --git a/binutils-2.25/bfd/elf32-or32.c b/binutils-2.25/bfd/elf32-or32.c
deleted file mode 100644
index 466d43d0..00000000
--- a/binutils-2.25/bfd/elf32-or32.c
+++ /dev/null
@@ -1,514 +0,0 @@
-/* OR32-specific support for 32-bit ELF
- Copyright 2002, 2004, 2005, 2007 Free Software Foundation, Inc.
- Contributed by Ivan Guzvinec <ivang@opencores.org>
-
- This file is part of BFD, the Binary File Descriptor library.
-
- 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "libbfd.h"
-#include "elf-bfd.h"
-#include "elf/or32.h"
-#include "libiberty.h"
-
-/* Try to minimize the amount of space occupied by relocation tables
- on the ROM (not that the ROM won't be swamped by other ELF overhead). */
-#define USE_REL 1
-
-/* Set the right machine number for an OR32 ELF file. */
-
-static bfd_boolean
-or32_elf_object_p (bfd *abfd)
-{
- (void) bfd_default_set_arch_mach (abfd, bfd_arch_or32, 0);
- return TRUE;
-}
-
-/* The final processing done just before writing out an OR32 ELF object file.
- This gets the OR32 architecture right based on the machine number. */
-
-static void
-or32_elf_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
-{
- elf_elfheader (abfd)->e_flags &=~ EF_OR32_MACH;
-}
-
-static bfd_reloc_status_type
-or32_elf_32_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol,
- void * data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
-{
- if (output_bfd != NULL)
- {
- unsigned long insn;
- bfd_size_type addr = reloc_entry->address;
-
- reloc_entry->address += input_section->output_offset;
-
- insn = bfd_get_32 (abfd, (bfd_byte *) data + addr);
- insn += symbol->section->output_section->vma;
- insn += symbol->section->output_offset;
- insn += symbol->value;
- bfd_put_32 (abfd, insn, (bfd_byte *) data + addr);
-
- return bfd_reloc_ok;
- }
-
- return bfd_reloc_continue;
-}
-
-static bfd_reloc_status_type
-or32_elf_16_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol,
- void * data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
-{
- if (output_bfd != NULL)
- {
- unsigned short insn;
- bfd_size_type addr = reloc_entry->address;
-
- reloc_entry->address += input_section->output_offset;
-
- insn = bfd_get_16 (abfd, (bfd_byte *) data + addr);
- insn += symbol->section->output_section->vma;
- insn += symbol->section->output_offset;
- insn += symbol->value;
- bfd_put_16 (abfd, insn, (bfd_byte *) data + addr);
-
- return bfd_reloc_ok;
- }
-
- return bfd_reloc_continue;
-}
-
-static bfd_reloc_status_type
-or32_elf_8_reloc (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *reloc_entry,
- asymbol *symbol,
- void * data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
-{
- if (output_bfd != NULL)
- {
- unsigned char insn;
- bfd_size_type addr = reloc_entry->address;
-
- reloc_entry->address += input_section->output_offset;
-
- insn = bfd_get_8 (abfd, (bfd_byte *) data + addr);
- insn += symbol->section->output_section->vma;
- insn += symbol->section->output_offset;
- insn += symbol->value;
- bfd_put_8 (abfd, insn, (bfd_byte *) data + addr);
-
- return bfd_reloc_ok;
- }
-
- return bfd_reloc_continue;
-}
-
-/* Do a R_OR32_CONSTH relocation. This has to be done in combination
- with a R_OR32_CONST reloc, because there is a carry from the LO16 to
- the HI16. Here we just save the information we need; we do the
- actual relocation when we see the LO16. OR32 ELF requires that the
- LO16 immediately follow the HI16. As a GNU extension, we permit an
- arbitrary number of HI16 relocs to be associated with a single LO16
- reloc. This extension permits gcc to output the HI and LO relocs
- itself. This code is copied from the elf32-mips.c. */
-
-struct or32_consth
-{
- struct or32_consth *next;
- bfd_byte *addr;
- bfd_vma addend;
-};
-
-/* FIXME: This should not be a static variable. */
-
-static struct or32_consth *or32_consth_list;
-
-static bfd_reloc_status_type
-or32_elf_consth_reloc (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *reloc_entry,
- asymbol *symbol,
- void * data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
-{
- bfd_reloc_status_type ret;
- bfd_vma relocation;
- struct or32_consth *n;
-
- ret = bfd_reloc_ok;
-
- if (bfd_is_und_section (symbol->section)
- && output_bfd == NULL)
- ret = bfd_reloc_undefined;
-
- if (bfd_is_com_section (symbol->section))
- relocation = 0;
- else
- relocation = symbol->value;
-
- relocation += symbol->section->output_section->vma;
- relocation += symbol->section->output_offset;
- relocation += reloc_entry->addend;
-
- if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
- return bfd_reloc_outofrange;
-
- /* Save the information, and let LO16 do the actual relocation. */
- n = bfd_malloc (sizeof *n);
- if (n == NULL)
- return bfd_reloc_outofrange;
- n->addr = (bfd_byte *) data + reloc_entry->address;
- n->addend = relocation;
- n->next = or32_consth_list;
- or32_consth_list = n;
-
- if (output_bfd != NULL)
- reloc_entry->address += input_section->output_offset;
-
- return ret;
-}
-
-/* Do a R_OR32_CONST relocation. This is a straightforward 16 bit
- inplace relocation; this function exists in order to do the
- R_OR32_CONSTH relocation described above. */
-
-static bfd_reloc_status_type
-or32_elf_const_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol,
- void * data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message)
-{
- if (or32_consth_list != NULL)
- {
- struct or32_consth *l;
-
- l = or32_consth_list;
- while (l != NULL)
- {
- unsigned long insn;
- unsigned long val;
- unsigned long vallo;
- struct or32_consth *next;
-
- /* Do the HI16 relocation. Note that we actually don't need
- to know anything about the LO16 itself, except where to
- find the low 16 bits of the addend needed by the LO16. */
- insn = bfd_get_32 (abfd, l->addr);
- vallo = (bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address)
- & 0xffff);
- val = ((insn & 0xffff) << 16) + vallo;
- val += l->addend;
-
- insn = (insn &~ 0xffff) | ((val >> 16) & 0xffff);
- bfd_put_32 (abfd, insn, l->addr);
-
- next = l->next;
- free (l);
- l = next;
- }
-
- or32_consth_list = NULL;
- }
-
- if (output_bfd != NULL)
- {
- unsigned long insn, tmp;
- bfd_size_type addr = reloc_entry->address;
-
- reloc_entry->address += input_section->output_offset;
-
- insn = bfd_get_32 (abfd, (bfd_byte *) data + addr);
- tmp = insn & 0x0000ffff;
- tmp += symbol->section->output_section->vma;
- tmp += symbol->section->output_offset;
- tmp += symbol->value;
- insn = (insn & 0xffff0000) | (tmp & 0x0000ffff);
- bfd_put_32 (abfd, insn, (bfd_byte *) data + addr);
-
- return bfd_reloc_ok;
- }
-
- /* Now do the LO16 reloc in the usual way. */
- return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message);
-}
-
-static bfd_reloc_status_type
-or32_elf_jumptarg_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol ATTRIBUTE_UNUSED,
- void * data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
-{
- if (output_bfd != NULL)
- {
- unsigned long insn, tmp;
- bfd_size_type addr = reloc_entry->address;
-
- reloc_entry->address += input_section->output_offset;
-
- insn = bfd_get_32 (abfd, (bfd_byte *) data + addr);
- tmp = insn | 0xfc000000;
- tmp -= (input_section->output_offset >> 2);
- insn = (insn & 0xfc000000) | (tmp & 0x03ffffff);
- bfd_put_32 (abfd, insn, (bfd_byte *) data + addr);
-
- return bfd_reloc_ok;
- }
-
- return bfd_reloc_continue;
-}
-
-static reloc_howto_type elf_or32_howto_table[] =
-{
- /* This reloc does nothing. */
- HOWTO (R_OR32_NONE, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR32_NONE", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- /* A standard 32 bit relocation. */
- HOWTO (R_OR32_32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- or32_elf_32_reloc, /* special_function */
- "R_OR32_32", /* name */
- FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- /* A standard 16 bit relocation. */
- HOWTO (R_OR32_16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- or32_elf_16_reloc, /* special_function */
- "R_OR32_16", /* name */
- FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- /* A standard 8 bit relocation. */
- HOWTO (R_OR32_8, /* type */
- 0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- or32_elf_8_reloc, /* special_function */
- "R_OR32_8", /* name */
- FALSE, /* partial_inplace */
- 0x000000ff, /* src_mask */
- 0x000000ff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- /* A standard low 16 bit relocation. */
- HOWTO (R_OR32_CONST, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- or32_elf_const_reloc, /* special_function */
- "R_OR32_CONST", /* name */
- FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- /* A standard high 16 bit relocation. */
- HOWTO (R_OR32_CONSTH, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- or32_elf_consth_reloc, /* special_function */
- "R_OR32_CONSTH", /* name */
- FALSE, /* partial_inplace */
- 0xffff0000, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- /* A standard branch relocation. */
- HOWTO (R_OR32_JUMPTARG, /* type */
- 2, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 28, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- or32_elf_jumptarg_reloc,/* special_function */
- "R_OR32_JUMPTARG", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x03ffffff, /* dst_mask */
- TRUE), /* pcrel_offset */
-
- /* GNU extension to record C++ vtable hierarchy. */
- HOWTO (R_OR32_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_OR32_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- /* GNU extension to record C++ vtable member usage. */
- HOWTO (R_OR32_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_OR32_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
-};
-
-/* Map BFD reloc types to OR32 ELF reloc types. */
-
-struct or32_reloc_map
-{
- bfd_reloc_code_real_type bfd_reloc_val;
- unsigned char elf_reloc_val;
-};
-
-static const struct or32_reloc_map or32_reloc_map[] =
-{
- { BFD_RELOC_NONE, R_OR32_NONE },
- { BFD_RELOC_32, R_OR32_32 },
- { BFD_RELOC_16, R_OR32_16 },
- { BFD_RELOC_8, R_OR32_8 },
- { BFD_RELOC_LO16, R_OR32_CONST },
- { BFD_RELOC_HI16, R_OR32_CONSTH },
- { BFD_RELOC_32_GOT_PCREL, R_OR32_JUMPTARG },
- { BFD_RELOC_VTABLE_INHERIT, R_OR32_GNU_VTINHERIT },
- { BFD_RELOC_VTABLE_ENTRY, R_OR32_GNU_VTENTRY },
-};
-
-static reloc_howto_type *
-bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type code)
-{
- unsigned int i;
-
- for (i = ARRAY_SIZE (or32_reloc_map); i--;)
- if (or32_reloc_map[i].bfd_reloc_val == code)
- return &elf_or32_howto_table[or32_reloc_map[i].elf_reloc_val];
-
- return NULL;
-}
-
-static reloc_howto_type *
-bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- const char *r_name)
-{
- unsigned int i;
-
- for (i = 0;
- i < sizeof (elf_or32_howto_table) / sizeof (elf_or32_howto_table[0]);
- i++)
- if (elf_or32_howto_table[i].name != NULL
- && strcasecmp (elf_or32_howto_table[i].name, r_name) == 0)
- return &elf_or32_howto_table[i];
-
- return NULL;
-}
-
-/* Set the howto pointer for an OR32 ELF reloc. */
-
-static void
-or32_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *cache_ptr,
- Elf_Internal_Rela *dst)
-{
- unsigned int r_type;
-
- r_type = ELF32_R_TYPE (dst->r_info);
- BFD_ASSERT (r_type < (unsigned int) R_OR32_max);
- cache_ptr->howto = &elf_or32_howto_table[r_type];
-}
-
-#define TARGET_LITTLE_SYM bfd_elf32_or32_little_vec
-#define TARGET_LITTLE_NAME "elf32-littleor32"
-#define TARGET_BIG_SYM bfd_elf32_or32_big_vec
-#define TARGET_BIG_NAME "elf32-or32"
-#define ELF_ARCH bfd_arch_or32
-#define ELF_MACHINE_CODE EM_OR32
-#define ELF_MAXPAGESIZE 0x1000
-
-#define elf_info_to_howto 0
-#define elf_info_to_howto_rel or32_info_to_howto_rel
-#define elf_backend_object_p or32_elf_object_p
-#define elf_backend_final_write_processing \
- or32_elf_final_write_processing
-
-#include "elf32-target.h"
diff --git a/binutils-2.25/bfd/elf32-pj.c b/binutils-2.25/bfd/elf32-pj.c
index b7a10182..84b61f9b 100644
--- a/binutils-2.25/bfd/elf32-pj.c
+++ b/binutils-2.25/bfd/elf32-pj.c
@@ -1,6 +1,5 @@
/* picoJava specific support for 32-bit ELF
- Copyright 1999, 2000, 2001, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
Contributed by Steve Chamberlan of Transmeta (sac@pobox.com).
This file is part of BFD, the Binary File Descriptor library.
@@ -336,9 +335,9 @@ pj_elf_final_write_processing (bfd *abfd,
elf_elfheader (abfd)->e_flags |= EF_PICOJAVA_GNUCALLS;
}
-#define TARGET_BIG_SYM bfd_elf32_pj_vec
+#define TARGET_BIG_SYM pj_elf32_vec
#define TARGET_BIG_NAME "elf32-pj"
-#define TARGET_LITTLE_SYM bfd_elf32_pjl_vec
+#define TARGET_LITTLE_SYM pj_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-pjl"
#define ELF_ARCH bfd_arch_pj
#define ELF_MACHINE_CODE EM_PJ
diff --git a/binutils-2.25/bfd/elf32-ppc.c b/binutils-2.25/bfd/elf32-ppc.c
index d6aae81d..04c2d6ad 100644
--- a/binutils-2.25/bfd/elf32-ppc.c
+++ b/binutils-2.25/bfd/elf32-ppc.c
@@ -1,7 +1,5 @@
/* PowerPC-specific support for 32-bit ELF
- Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -52,8 +50,6 @@ static bfd_reloc_status_type ppc_elf_addr16_ha_reloc
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
static bfd_reloc_status_type ppc_elf_unhandled_reloc
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
-static void ppc_elf_vle_split16
- (bfd *, bfd_byte *, bfd_vma, bfd_vma, split16_format_type);
/* Branch prediction bit for branch taken relocs. */
#define BRANCH_PREDICT_BIT 0x200000
@@ -151,6 +147,7 @@ static const bfd_vma ppc_elf_vxworks_pic_plt0_entry
#define ADD_3_12_2 0x7c6c1214
#define ADD_11_0_11 0x7d605a14
#define B 0x48000000
+#define BA 0x48000002
#define BCL_20_31 0x429f0005
#define BCTR 0x4e800420
#define BEQLR 0x4d820020
@@ -194,7 +191,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_NONE", /* name */
FALSE, /* partial_inplace */
@@ -209,7 +206,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_ADDR32", /* name */
FALSE, /* partial_inplace */
@@ -225,7 +222,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
26, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_ADDR24", /* name */
FALSE, /* partial_inplace */
@@ -302,7 +299,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_ADDR14", /* name */
FALSE, /* partial_inplace */
@@ -319,7 +316,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_ADDR14_BRTAKEN",/* name */
FALSE, /* partial_inplace */
@@ -336,7 +333,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_ADDR14_BRNTAKEN",/* name */
FALSE, /* partial_inplace */
@@ -448,7 +445,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_GOT16_HI", /* name */
FALSE, /* partial_inplace */
@@ -464,7 +461,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
ppc_elf_addr16_ha_reloc, /* special_function */
"R_PPC_GOT16_HA", /* name */
FALSE, /* partial_inplace */
@@ -499,7 +496,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_COPY", /* name */
FALSE, /* partial_inplace */
@@ -515,7 +512,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_GLOB_DAT", /* name */
FALSE, /* partial_inplace */
@@ -530,7 +527,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_JMP_SLOT", /* name */
FALSE, /* partial_inplace */
@@ -547,7 +544,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_RELATIVE", /* name */
FALSE, /* partial_inplace */
@@ -579,7 +576,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_UADDR32", /* name */
FALSE, /* partial_inplace */
@@ -609,7 +606,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
32, /* bitsize */
TRUE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_REL32", /* name */
FALSE, /* partial_inplace */
@@ -625,7 +622,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_PLT32", /* name */
FALSE, /* partial_inplace */
@@ -641,7 +638,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
32, /* bitsize */
TRUE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_PLTREL32", /* name */
FALSE, /* partial_inplace */
@@ -673,7 +670,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_PLT16_HI", /* name */
FALSE, /* partial_inplace */
@@ -689,7 +686,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
ppc_elf_addr16_ha_reloc, /* special_function */
"R_PPC_PLT16_HA", /* name */
FALSE, /* partial_inplace */
@@ -720,7 +717,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_SECTOFF", /* name */
FALSE, /* partial_inplace */
@@ -750,7 +747,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_SECTOFF_HI", /* name */
FALSE, /* partial_inplace */
@@ -765,7 +762,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
ppc_elf_addr16_ha_reloc, /* special_function */
"R_PPC_SECTOFF_HA", /* name */
FALSE, /* partial_inplace */
@@ -1241,7 +1238,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_EMB_NADDR32", /* name */
FALSE, /* partial_inplace */
@@ -1256,7 +1253,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_EMB_NADDR16", /* name */
FALSE, /* partial_inplace */
@@ -1451,10 +1448,10 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
HOWTO (R_PPC_VLE_LO16A, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_VLE_LO16A", /* name */
FALSE, /* partial_inplace */
@@ -1466,10 +1463,10 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
HOWTO (R_PPC_VLE_LO16D, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_VLE_LO16D", /* name */
FALSE, /* partial_inplace */
@@ -1479,12 +1476,12 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
/* Bits 16-31 split16a format. */
HOWTO (R_PPC_VLE_HI16A, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_VLE_HI16A", /* name */
FALSE, /* partial_inplace */
@@ -1494,12 +1491,12 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
/* Bits 16-31 split16d format. */
HOWTO (R_PPC_VLE_HI16D, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_VLE_HI16D", /* name */
FALSE, /* partial_inplace */
@@ -1509,12 +1506,12 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
/* Bits 16-31 (High Adjusted) in split16a format. */
HOWTO (R_PPC_VLE_HA16A, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_VLE_HA16A", /* name */
FALSE, /* partial_inplace */
@@ -1524,12 +1521,12 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
/* Bits 16-31 (High Adjusted) in split16d format. */
HOWTO (R_PPC_VLE_HA16D, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_VLE_HA16D", /* name */
FALSE, /* partial_inplace */
@@ -1537,14 +1534,16 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
0x1f07ff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* This reloc does nothing. */
- HOWTO (R_PPC_VLE_SDA21, /* type */
+ /* This reloc is like R_PPC_EMB_SDA21 but only applies to e_add16i
+ instructions. If the register base is 0 then the linker changes
+ the e_add16i to an e_li instruction. */
+ HOWTO (R_PPC_VLE_SDA21, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_VLE_SDA21", /* name */
FALSE, /* partial_inplace */
@@ -1552,29 +1551,29 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* This reloc does nothing. */
+ /* Like R_PPC_VLE_SDA21 but ignore overflow. */
HOWTO (R_PPC_VLE_SDA21_LO, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_VLE_SDA21_LO", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
- 0, /* dst_mask */
+ 0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* The 16 LSBS relative to _SDA_BASE_ in split16a format. */
HOWTO (R_PPC_VLE_SDAREL_LO16A,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_VLE_SDAREL_LO16A", /* name */
FALSE, /* partial_inplace */
@@ -1583,14 +1582,13 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
FALSE), /* pcrel_offset */
/* The 16 LSBS relative to _SDA_BASE_ in split16d format. */
- /* This reloc does nothing. */
HOWTO (R_PPC_VLE_SDAREL_LO16D, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_VLE_SDAREL_LO16D", /* name */
FALSE, /* partial_inplace */
@@ -1600,12 +1598,12 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
/* Bits 16-31 relative to _SDA_BASE_ in split16a format. */
HOWTO (R_PPC_VLE_SDAREL_HI16A, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_VLE_SDAREL_HI16A", /* name */
FALSE, /* partial_inplace */
@@ -1615,12 +1613,12 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
/* Bits 16-31 relative to _SDA_BASE_ in split16d format. */
HOWTO (R_PPC_VLE_SDAREL_HI16D, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_VLE_SDAREL_HI16D", /* name */
FALSE, /* partial_inplace */
@@ -1630,12 +1628,12 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
/* Bits 16-31 (HA) relative to _SDA_BASE split16a format. */
HOWTO (R_PPC_VLE_SDAREL_HA16A, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_VLE_SDAREL_HA16A", /* name */
FALSE, /* partial_inplace */
@@ -1645,12 +1643,12 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
/* Bits 16-31 (HA) relative to _SDA_BASE split16d format. */
HOWTO (R_PPC_VLE_SDAREL_HA16D, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_VLE_SDAREL_HA16D", /* name */
FALSE, /* partial_inplace */
@@ -1664,7 +1662,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_IRELATIVE", /* name */
FALSE, /* partial_inplace */
@@ -1679,7 +1677,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = {
16, /* bitsize */
TRUE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC_REL16", /* name */
FALSE, /* partial_inplace */
@@ -2631,7 +2629,7 @@ ppc_elf_begin_write_processing (bfd *abfd, struct bfd_link_info *link_info)
apuinfo_list_init ();
/* Read in the input sections contents. */
- for (ibfd = link_info->input_bfds; ibfd; ibfd = ibfd->link_next)
+ for (ibfd = link_info->input_bfds; ibfd; ibfd = ibfd->link.next)
{
unsigned long datum;
@@ -3139,6 +3137,9 @@ struct ppc_elf_link_hash_table
{
struct elf_link_hash_table elf;
+ /* Various options passed from the linker. */
+ struct ppc_elf_params *params;
+
/* Short-cuts to get to dynamic linker sections. */
asection *got;
asection *relgot;
@@ -3184,12 +3185,6 @@ struct ppc_elf_link_hash_table
/* The type of PLT we have chosen to use. */
enum ppc_elf_plt_type plt_type;
- /* Set if we should emit symbols for stubs. */
- unsigned int emit_stub_syms:1;
-
- /* Set if __tls_get_addr optimization should not be done. */
- unsigned int no_tls_get_addr_opt:1;
-
/* True if the target system is VxWorks. */
unsigned int is_vxworks:1;
@@ -3255,6 +3250,7 @@ static struct bfd_link_hash_table *
ppc_elf_link_hash_table_create (bfd *abfd)
{
struct ppc_elf_link_hash_table *ret;
+ static struct ppc_elf_params default_params = { PLT_OLD, 0, 1, 0, 0, 12 };
ret = bfd_zmalloc (sizeof (struct ppc_elf_link_hash_table));
if (ret == NULL)
@@ -3274,6 +3270,8 @@ ppc_elf_link_hash_table_create (bfd *abfd)
ret->elf.init_plt_offset.offset = 0;
ret->elf.init_plt_offset.glist = NULL;
+ ret->params = &default_params;
+
ret->sdata[0].name = ".sdata";
ret->sdata[0].sym_name = "_SDA_BASE_";
ret->sdata[0].bss_name = ".sbss";
@@ -3289,6 +3287,17 @@ ppc_elf_link_hash_table_create (bfd *abfd)
return &ret->elf.root;
}
+/* Hook linker params into hash table. */
+
+void
+ppc_elf_link_params (struct bfd_link_info *info, struct ppc_elf_params *params)
+{
+ struct ppc_elf_link_hash_table *htab = ppc_elf_hash_table (info);
+
+ if (htab)
+ htab->params = params;
+}
+
/* Create .got and the related sections. */
static bfd_boolean
@@ -3329,6 +3338,36 @@ ppc_elf_create_got (bfd *abfd, struct bfd_link_info *info)
return TRUE;
}
+/* Create a special linker section, used for R_PPC_EMB_SDAI16 and
+ R_PPC_EMB_SDA2I16 pointers. These sections become part of .sdata
+ and .sdata2. Create _SDA_BASE_ and _SDA2_BASE too. */
+
+static bfd_boolean
+ppc_elf_create_linker_section (bfd *abfd,
+ struct bfd_link_info *info,
+ flagword flags,
+ elf_linker_section_t *lsect)
+{
+ asection *s;
+
+ flags |= (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED);
+
+ s = bfd_make_section_anyway_with_flags (abfd, lsect->name, flags);
+ if (s == NULL)
+ return FALSE;
+ lsect->section = s;
+
+ /* Define the sym on the first section of this name. */
+ s = bfd_get_section_by_name (abfd, lsect->name);
+
+ lsect->sym = _bfd_elf_define_linkage_sym (abfd, info, s, lsect->sym_name);
+ if (lsect->sym == NULL)
+ return FALSE;
+ lsect->sym->root.u.def.value = 0x8000;
+ return TRUE;
+}
+
static bfd_boolean
ppc_elf_create_glink (bfd *abfd, struct bfd_link_info *info)
{
@@ -3341,7 +3380,8 @@ ppc_elf_create_glink (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section_anyway_with_flags (abfd, ".glink", flags);
htab->glink = s;
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 4))
+ || !bfd_set_section_alignment (abfd, s,
+ htab->params->ppc476_workaround ? 6 : 4))
return FALSE;
if (!info->no_ld_generated_unwind_info)
@@ -3369,6 +3409,15 @@ ppc_elf_create_glink (bfd *abfd, struct bfd_link_info *info)
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, 2))
return FALSE;
+
+ if (!ppc_elf_create_linker_section (abfd, info, 0,
+ &htab->sdata[0]))
+ return FALSE;
+
+ if (!ppc_elf_create_linker_section (abfd, info, SEC_READONLY,
+ &htab->sdata[1]))
+ return FALSE;
+
return TRUE;
}
@@ -3587,59 +3636,15 @@ ppc_elf_add_symbol_hook (bfd *abfd,
*valp = sym->st_size;
}
- if ((abfd->flags & DYNAMIC) == 0
- && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
- || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE))
+ if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
+ || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)
+ && (abfd->flags & DYNAMIC) == 0
+ && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
return TRUE;
}
-static bfd_boolean
-create_sdata_sym (struct bfd_link_info *info, elf_linker_section_t *lsect)
-{
- struct ppc_elf_link_hash_table *htab = ppc_elf_hash_table (info);
-
- lsect->sym = elf_link_hash_lookup (&htab->elf, lsect->sym_name,
- TRUE, FALSE, TRUE);
- if (lsect->sym == NULL)
- return FALSE;
- if (lsect->sym->root.type == bfd_link_hash_new)
- lsect->sym->non_elf = 0;
- lsect->sym->ref_regular = 1;
- _bfd_elf_link_hash_hide_symbol (info, lsect->sym, TRUE);
- return TRUE;
-}
-
-/* Create a special linker section. */
-
-static bfd_boolean
-ppc_elf_create_linker_section (bfd *abfd,
- struct bfd_link_info *info,
- flagword flags,
- elf_linker_section_t *lsect)
-{
- struct ppc_elf_link_hash_table *htab = ppc_elf_hash_table (info);
- asection *s;
-
- flags |= (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
- | SEC_LINKER_CREATED);
-
- /* Record the first bfd that needs the special sections. */
- if (!htab->elf.dynobj)
- htab->elf.dynobj = abfd;
-
- s = bfd_make_section_anyway_with_flags (htab->elf.dynobj,
- lsect->name,
- flags);
- if (s == NULL
- || !bfd_set_section_alignment (htab->elf.dynobj, s, 2))
- return FALSE;
- lsect->section = s;
-
- return create_sdata_sym (info, lsect);
-}
-
/* Find a linker generated pointer with a given addend and type. */
static elf_linker_section_pointers_t *
@@ -3658,10 +3663,10 @@ elf_find_pointer_linker_section
/* Allocate a pointer to live in a linker created section. */
static bfd_boolean
-elf_create_pointer_linker_section (bfd *abfd,
- elf_linker_section_t *lsect,
- struct elf_link_hash_entry *h,
- const Elf_Internal_Rela *rel)
+elf_allocate_pointer_linker_section (bfd *abfd,
+ elf_linker_section_t *lsect,
+ struct elf_link_hash_entry *h,
+ const Elf_Internal_Rela *rel)
{
elf_linker_section_pointers_t **ptr_linker_section_ptr = NULL;
elf_linker_section_pointers_t *linker_section_ptr;
@@ -3729,6 +3734,8 @@ elf_create_pointer_linker_section (bfd *abfd,
linker_section_ptr->lsect = lsect;
*ptr_linker_section_ptr = linker_section_ptr;
+ if (!bfd_set_section_alignment (lsect->section->owner, lsect->section, 2))
+ return FALSE;
linker_section_ptr->offset = lsect->section->size;
lsect->section->size += 4;
@@ -4011,7 +4018,7 @@ ppc_elf_check_relocs (bfd *abfd,
case R_PPC_GOT_TPREL16_LO:
case R_PPC_GOT_TPREL16_HI:
case R_PPC_GOT_TPREL16_HA:
- if (!info->executable)
+ if (info->shared)
info->flags |= DF_STATIC_TLS;
tls_type = TLS_TLS | TLS_TPREL;
goto dogottls;
@@ -4064,12 +4071,9 @@ ppc_elf_check_relocs (bfd *abfd,
bad_shared_reloc (abfd, r_type);
return FALSE;
}
- if (htab->sdata[0].section == NULL
- && !ppc_elf_create_linker_section (abfd, info, 0,
- &htab->sdata[0]))
- return FALSE;
- if (!elf_create_pointer_linker_section (abfd, &htab->sdata[0],
- h, rel))
+ htab->sdata[0].sym->ref_regular = 1;
+ if (!elf_allocate_pointer_linker_section (abfd, &htab->sdata[0],
+ h, rel))
return FALSE;
if (h != NULL)
{
@@ -4085,12 +4089,9 @@ ppc_elf_check_relocs (bfd *abfd,
bad_shared_reloc (abfd, r_type);
return FALSE;
}
- if (htab->sdata[1].section == NULL
- && !ppc_elf_create_linker_section (abfd, info, SEC_READONLY,
- &htab->sdata[1]))
- return FALSE;
- if (!elf_create_pointer_linker_section (abfd, &htab->sdata[1],
- h, rel))
+ htab->sdata[1].sym->ref_regular = 1;
+ if (!elf_allocate_pointer_linker_section (abfd, &htab->sdata[1],
+ h, rel))
return FALSE;
if (h != NULL)
{
@@ -4099,21 +4100,16 @@ ppc_elf_check_relocs (bfd *abfd,
}
break;
+ case R_PPC_SDAREL16:
+ htab->sdata[0].sym->ref_regular = 1;
+ /* Fall thru */
+
case R_PPC_VLE_SDAREL_LO16A:
case R_PPC_VLE_SDAREL_LO16D:
case R_PPC_VLE_SDAREL_HI16A:
case R_PPC_VLE_SDAREL_HI16D:
case R_PPC_VLE_SDAREL_HA16A:
case R_PPC_VLE_SDAREL_HA16D:
- case R_PPC_SDAREL16:
- if (htab->sdata[0].sym == NULL
- && !create_sdata_sym (info, &htab->sdata[0]))
- return FALSE;
-
- if (htab->sdata[1].sym == NULL
- && !create_sdata_sym (info, &htab->sdata[1]))
- return FALSE;
-
if (h != NULL)
{
ppc_elf_hash_entry (h)->has_sda_refs = TRUE;
@@ -4138,9 +4134,7 @@ ppc_elf_check_relocs (bfd *abfd,
bad_shared_reloc (abfd, r_type);
return FALSE;
}
- if (htab->sdata[1].sym == NULL
- && !create_sdata_sym (info, &htab->sdata[1]))
- return FALSE;
+ htab->sdata[1].sym->ref_regular = 1;
if (h != NULL)
{
ppc_elf_hash_entry (h)->has_sda_refs = TRUE;
@@ -4157,12 +4151,6 @@ ppc_elf_check_relocs (bfd *abfd,
bad_shared_reloc (abfd, r_type);
return FALSE;
}
- if (htab->sdata[0].sym == NULL
- && !create_sdata_sym (info, &htab->sdata[0]))
- return FALSE;
- if (htab->sdata[1].sym == NULL
- && !create_sdata_sym (info, &htab->sdata[1]))
- return FALSE;
if (h != NULL)
{
ppc_elf_hash_entry (h)->has_sda_refs = TRUE;
@@ -4283,6 +4271,20 @@ ppc_elf_check_relocs (bfd *abfd,
htab->plt_type = PLT_OLD;
htab->old_bfd = abfd;
}
+ if (h != NULL && h->type == STT_GNU_IFUNC)
+ {
+ if (info->shared)
+ {
+ info->callbacks->einfo (_("%P: %H: @local call to ifunc %s\n"),
+ abfd, sec, rel->r_offset,
+ h->root.root.string);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+ h->needs_plt = 1;
+ if (!update_plt_info (abfd, &h->plt.plist, NULL, 0))
+ return FALSE;
+ }
break;
/* This relocation describes the C++ object vtable hierarchy.
@@ -4307,7 +4309,7 @@ ppc_elf_check_relocs (bfd *abfd,
case R_PPC_TPREL16_LO:
case R_PPC_TPREL16_HI:
case R_PPC_TPREL16_HA:
- if (!info->executable)
+ if (info->shared)
info->flags |= DF_STATIC_TLS;
goto dodyn;
@@ -4766,20 +4768,19 @@ ppc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
}
static void
-ppc_elf_vle_split16 (bfd *output_bfd, bfd_byte *contents,
- bfd_vma offset, bfd_vma relocation,
- split16_format_type split16_format)
+ppc_elf_vle_split16 (bfd *output_bfd, bfd_byte *loc,
+ bfd_vma value,
+ split16_format_type split16_format)
{
- bfd_vma insn, top5, bottom11;
+ unsigned int insn, top5;
- insn = bfd_get_32 (output_bfd, contents + offset);
- top5 = relocation >> 11;
- top5 = top5 << (split16_format == split16a_type ? 20 : 16);
- bottom11 = relocation & 0x7ff;
+ insn = bfd_get_32 (output_bfd, loc);
+ top5 = value & 0xf800;
+ top5 = top5 << (split16_format == split16a_type ? 9 : 5);
insn |= top5;
- insn |= bottom11;
- bfd_put_32 (output_bfd, insn, contents + offset);
+ insn |= value & 0x7ff;
+ bfd_put_32 (output_bfd, insn, loc);
}
@@ -4787,22 +4788,18 @@ ppc_elf_vle_split16 (bfd *output_bfd, bfd_byte *contents,
Returns -1 on error, 0 for old PLT, 1 for new PLT. */
int
ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info,
- enum ppc_elf_plt_type plt_style,
- int emit_stub_syms)
+ struct bfd_link_info *info)
{
struct ppc_elf_link_hash_table *htab;
flagword flags;
htab = ppc_elf_hash_table (info);
- htab->emit_stub_syms = emit_stub_syms;
-
if (htab->plt_type == PLT_UNSET)
{
struct elf_link_hash_entry *h;
- if (plt_style == PLT_OLD)
+ if (htab->params->plt_style == PLT_OLD)
htab->plt_type = PLT_OLD;
else if (info->shared
&& htab->elf.dynamic_sections_created
@@ -4824,7 +4821,7 @@ ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED,
else
{
bfd *ibfd;
- enum ppc_elf_plt_type plt_type = plt_style;
+ enum ppc_elf_plt_type plt_type = htab->params->plt_style;
/* Look through the reloc flags left by ppc_elf_check_relocs.
Use the old style bss plt if a file makes plt calls
@@ -4832,7 +4829,7 @@ ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED,
--secure-plt and we never see REL16 relocs. */
if (plt_type == PLT_UNSET)
plt_type = PLT_OLD;
- for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link.next)
if (is_ppc_elf (ibfd))
{
if (ppc_elf_tdata (ibfd)->has_rel16)
@@ -4847,7 +4844,7 @@ ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED,
htab->plt_type = plt_type;
}
}
- if (htab->plt_type == PLT_OLD && plt_style == PLT_NEW)
+ if (htab->plt_type == PLT_OLD && htab->params->plt_style == PLT_NEW)
{
if (htab->old_bfd != NULL)
info->callbacks->einfo (_("%P: bss-plt forced due to %B\n"),
@@ -5083,16 +5080,14 @@ ppc_elf_gc_sweep_hook (bfd *abfd,
generic ELF tls_setup function. */
asection *
-ppc_elf_tls_setup (bfd *obfd,
- struct bfd_link_info *info,
- int no_tls_get_addr_opt)
+ppc_elf_tls_setup (bfd *obfd, struct bfd_link_info *info)
{
struct ppc_elf_link_hash_table *htab;
htab = ppc_elf_hash_table (info);
htab->tls_get_addr = elf_link_hash_lookup (&htab->elf, "__tls_get_addr",
FALSE, FALSE, TRUE);
- if (!no_tls_get_addr_opt)
+ if (!htab->params->no_tls_get_addr_opt)
{
struct elf_link_hash_entry *opt, *tga;
opt = elf_link_hash_lookup (&htab->elf, "__tls_get_addr_opt",
@@ -5137,9 +5132,8 @@ ppc_elf_tls_setup (bfd *obfd,
}
}
else
- no_tls_get_addr_opt = TRUE;
+ htab->params->no_tls_get_addr_opt = TRUE;
}
- htab->no_tls_get_addr_opt = no_tls_get_addr_opt;
if (htab->plt_type == PLT_NEW
&& htab->plt != NULL
&& htab->plt->output_section != NULL)
@@ -5204,7 +5198,7 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
notify relocate_section that optimization can be done, and
adjust got and plt refcounts. */
for (pass = 0; pass < 2; ++pass)
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
Elf_Internal_Sym *locsyms = NULL;
Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (ibfd);
@@ -5513,9 +5507,24 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
will go to this object, or will remain undefined. */
h->plt.plist = NULL;
h->needs_plt = 0;
+ h->pointer_equality_needed = 0;
}
else
{
+ /* Taking a function's address in a read/write section
+ doesn't require us to define the function symbol in the
+ executable on a plt call stub. A dynamic reloc can
+ be used instead. */
+ if (h->pointer_equality_needed
+ && h->type != STT_GNU_IFUNC
+ && !htab->is_vxworks
+ && !ppc_elf_hash_entry (h)->has_sda_refs
+ && !readonly_dynrelocs (h))
+ {
+ h->pointer_equality_needed = 0;
+ h->non_got_ref = 0;
+ }
+
/* After adjust_dynamic_symbol, non_got_ref set in the
non-shared case means that we have allocated space in
.dynbss for the symbol and thus dyn_relocs for this
@@ -5525,12 +5534,12 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
relocations against this symbol to the PLT entry. Allow
dynamic relocs if the reference is weak, and the dynamic
relocs will not cause text relocation. */
- if (!h->ref_regular_nonweak
- && h->non_got_ref
- && h->type != STT_GNU_IFUNC
- && !htab->is_vxworks
- && !ppc_elf_hash_entry (h)->has_sda_refs
- && !readonly_dynrelocs (h))
+ else if (!h->ref_regular_nonweak
+ && h->non_got_ref
+ && h->type != STT_GNU_IFUNC
+ && !htab->is_vxworks
+ && !ppc_elf_hash_entry (h)->has_sda_refs
+ && !readonly_dynrelocs (h))
h->non_got_ref = 0;
}
return TRUE;
@@ -5770,7 +5779,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
glink_offset = s->size;
s->size += GLINK_ENTRY_SIZE;
if (h == htab->tls_get_addr
- && !htab->no_tls_get_addr_opt)
+ && !htab->params->no_tls_get_addr_opt)
s->size += TLS_GET_ADDR_GLINK_SIZE - GLINK_ENTRY_SIZE;
}
if (!doneone
@@ -5783,7 +5792,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
}
ent->glink_offset = glink_offset;
- if (htab->emit_stub_syms
+ if (htab->params->emit_stub_syms
&& !add_stub_sym (ent, h, info))
return FALSE;
}
@@ -6103,7 +6112,7 @@ static const unsigned char glink_eh_frame_cie[] =
/* Set the sizes of the dynamic sections. */
static bfd_boolean
-ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ppc_elf_size_dynamic_sections (bfd *output_bfd,
struct bfd_link_info *info)
{
struct ppc_elf_link_hash_table *htab;
@@ -6137,7 +6146,7 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -6307,14 +6316,19 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
if (info->shared)
{
struct elf_link_hash_entry *sda = htab->sdata[0].sym;
- if (sda != NULL
- && !(sda->root.type == bfd_link_hash_defined
- || sda->root.type == bfd_link_hash_defweak))
- {
- sda->root.type = bfd_link_hash_defined;
- sda->root.u.def.section = htab->elf.hgot->root.u.def.section;
- sda->root.u.def.value = htab->elf.hgot->root.u.def.value;
- }
+
+ sda->root.u.def.section = htab->elf.hgot->root.u.def.section;
+ sda->root.u.def.value = htab->elf.hgot->root.u.def.value;
+ }
+ if (info->emitrelocations)
+ {
+ struct elf_link_hash_entry *sda = htab->sdata[0].sym;
+
+ if (sda != NULL && sda->ref_regular)
+ sda->root.u.def.section->flags |= SEC_KEEP;
+ sda = htab->sdata[1].sym;
+ if (sda != NULL && sda->ref_regular)
+ sda->root.u.def.section->flags |= SEC_KEEP;
}
if (htab->glink != NULL
@@ -6325,10 +6339,11 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Space for the branch table. */
htab->glink->size += htab->glink->size / (GLINK_ENTRY_SIZE / 4) - 4;
/* Pad out to align the start of PLTresolve. */
- htab->glink->size += -htab->glink->size & 15;
+ htab->glink->size += -htab->glink->size & (htab->params->ppc476_workaround
+ ? 63 : 15);
htab->glink->size += GLINK_PLTRESOLVE;
- if (htab->emit_stub_syms)
+ if (htab->params->emit_stub_syms)
{
struct elf_link_hash_entry *sh;
sh = elf_link_hash_lookup (&htab->elf, "__glink",
@@ -6407,12 +6422,15 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
|| s == htab->sgotplt
|| s == htab->sbss
|| s == htab->dynbss
- || s == htab->dynsbss
- || s == htab->sdata[0].section
- || s == htab->sdata[1].section)
+ || s == htab->dynsbss)
{
/* Strip these too. */
}
+ else if (s == htab->sdata[0].section
+ || s == htab->sdata[1].section)
+ {
+ strip_section = (s->flags & SEC_KEEP) == 0;
+ }
else if (CONST_STRNEQ (bfd_get_section_name (htab->elf.dynobj, s),
".rela"))
{
@@ -6481,14 +6499,16 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
return FALSE;
}
- if (htab->glink != NULL && htab->glink->size != 0)
+ if (htab->plt_type == PLT_NEW
+ && htab->glink != NULL
+ && htab->glink->size != 0)
{
if (!add_dynamic_entry (DT_PPC_GOT, 0))
return FALSE;
- if (!htab->no_tls_get_addr_opt
+ if (!htab->params->no_tls_get_addr_opt
&& htab->tls_get_addr != NULL
&& htab->tls_get_addr->plt.plist != NULL
- && !add_dynamic_entry (DT_PPC_TLSOPT, 0))
+ && !add_dynamic_entry (DT_PPC_OPT, PPC_OPT_TLS))
return FALSE;
}
@@ -6580,6 +6600,46 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
return TRUE;
}
+/* Arrange to have _SDA_BASE_ or _SDA2_BASE_ stripped from the output
+ if it looks like nothing is using them. */
+
+static void
+maybe_strip_sdasym (bfd *output_bfd, elf_linker_section_t *lsect)
+{
+ struct elf_link_hash_entry *sda = lsect->sym;
+
+ if (sda != NULL && !sda->ref_regular && sda->dynindx == -1)
+ {
+ asection *s;
+
+ s = bfd_get_section_by_name (output_bfd, lsect->name);
+ if (s == NULL || bfd_section_removed_from_list (output_bfd, s))
+ {
+ s = bfd_get_section_by_name (output_bfd, lsect->bss_name);
+ if (s == NULL || bfd_section_removed_from_list (output_bfd, s))
+ {
+ sda->def_regular = 0;
+ /* This is somewhat magic. See elf_link_output_extsym. */
+ sda->ref_dynamic = 1;
+ sda->forced_local = 0;
+ }
+ }
+ }
+}
+
+void
+ppc_elf_maybe_strip_sdata_syms (struct bfd_link_info *info)
+{
+ struct ppc_elf_link_hash_table *htab = ppc_elf_hash_table (info);
+
+ if (htab != NULL)
+ {
+ maybe_strip_sdasym (info->output_bfd, &htab->sdata[0]);
+ maybe_strip_sdasym (info->output_bfd, &htab->sdata[1]);
+ }
+}
+
+
/* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */
static bfd_boolean
@@ -6604,7 +6664,7 @@ static const int shared_stub_entry[] =
0x429f0005, /* bcl 20, 31, .Lxxx */
0x7d8802a6, /* mflr 12 */
0x3d8c0000, /* addis 12, 12, (xxx-.Lxxx)@ha */
- 0x398c0008, /* addi 12, 12, (xxx-.Lxxx)@l */
+ 0x398c0000, /* addi 12, 12, (xxx-.Lxxx)@l */
0x7c0803a6, /* mtlr 0 */
0x7d8903a6, /* mtctr 12 */
0x4e800420, /* bctr */
@@ -6618,6 +6678,16 @@ static const int stub_entry[] =
0x4e800420, /* bctr */
};
+struct ppc_elf_relax_info
+{
+ unsigned int workaround_size;
+};
+
+/* This function implements long branch trampolines, and the ppc476
+ icache bug workaround. Any section needing trampolines or patch
+ space for the workaround has its size extended so that we can
+ add trampolines at the end of the section. */
+
static bfd_boolean
ppc_elf_relax_section (bfd *abfd,
asection *isec,
@@ -6638,408 +6708,488 @@ ppc_elf_relax_section (bfd *abfd,
bfd_byte *contents = NULL;
Elf_Internal_Sym *isymbuf = NULL;
Elf_Internal_Rela *internal_relocs = NULL;
- Elf_Internal_Rela *irel, *irelend;
+ Elf_Internal_Rela *irel, *irelend = NULL;
struct one_fixup *fixups = NULL;
+ struct ppc_elf_relax_info *relax_info = NULL;
unsigned changes = 0;
+ bfd_boolean workaround_change;
struct ppc_elf_link_hash_table *htab;
- bfd_size_type trampoff;
+ bfd_size_type trampbase, trampoff, newsize;
asection *got2;
bfd_boolean maybe_pasted;
*again = FALSE;
- /* Nothing to do if there are no relocations, and no need to do
- anything with non-alloc or non-code sections. */
+ /* No need to do anything with non-alloc or non-code sections. */
if ((isec->flags & SEC_ALLOC) == 0
|| (isec->flags & SEC_CODE) == 0
- || (isec->flags & SEC_RELOC) == 0
- || isec->reloc_count == 0)
+ || (isec->flags & SEC_LINKER_CREATED) != 0
+ || isec->size < 4)
return TRUE;
/* We cannot represent the required PIC relocs in the output, so don't
do anything. The linker doesn't support mixing -shared and -r
anyway. */
if (link_info->relocatable && link_info->shared)
- return TRUE;
+ return TRUE;
+
+ htab = ppc_elf_hash_table (link_info);
+ if (htab == NULL)
+ return TRUE;
+
+ isec->size = (isec->size + 3) & -4;
+ if (isec->rawsize == 0)
+ isec->rawsize = isec->size;
+ trampbase = isec->size;
+
+ BFD_ASSERT (isec->sec_info_type == SEC_INFO_TYPE_NONE
+ || isec->sec_info_type == SEC_INFO_TYPE_TARGET);
+ isec->sec_info_type = SEC_INFO_TYPE_TARGET;
+
+ if (htab->params->ppc476_workaround)
+ {
+ if (elf_section_data (isec)->sec_info == NULL)
+ {
+ elf_section_data (isec)->sec_info
+ = bfd_zalloc (abfd, sizeof (struct ppc_elf_relax_info));
+ if (elf_section_data (isec)->sec_info == NULL)
+ return FALSE;
+ }
+ relax_info = elf_section_data (isec)->sec_info;
+ trampbase -= relax_info->workaround_size;
+ }
- trampoff = (isec->size + 3) & (bfd_vma) -4;
maybe_pasted = (strcmp (isec->output_section->name, ".init") == 0
|| strcmp (isec->output_section->name, ".fini") == 0);
/* Space for a branch around any trampolines. */
- if (maybe_pasted)
+ trampoff = trampbase;
+ if (maybe_pasted && trampbase == isec->rawsize)
trampoff += 4;
symtab_hdr = &elf_symtab_hdr (abfd);
- /* Get a copy of the native relocations. */
- internal_relocs = _bfd_elf_link_read_relocs (abfd, isec, NULL, NULL,
- link_info->keep_memory);
- if (internal_relocs == NULL)
- goto error_return;
-
- htab = ppc_elf_hash_table (link_info);
- got2 = bfd_get_section_by_name (abfd, ".got2");
-
- irelend = internal_relocs + isec->reloc_count;
- for (irel = internal_relocs; irel < irelend; irel++)
+ if (htab->params->branch_trampolines)
{
- unsigned long r_type = ELF32_R_TYPE (irel->r_info);
- bfd_vma toff, roff;
- asection *tsec;
- struct one_fixup *f;
- size_t insn_offset = 0;
- bfd_vma max_branch_offset, val;
- bfd_byte *hit_addr;
- unsigned long t0;
- struct elf_link_hash_entry *h;
- struct plt_entry **plist;
- unsigned char sym_type;
-
- switch (r_type)
+ /* Get a copy of the native relocations. */
+ if (isec->reloc_count != 0)
{
- case R_PPC_REL24:
- case R_PPC_LOCAL24PC:
- case R_PPC_PLTREL24:
- max_branch_offset = 1 << 25;
- break;
-
- case R_PPC_REL14:
- case R_PPC_REL14_BRTAKEN:
- case R_PPC_REL14_BRNTAKEN:
- max_branch_offset = 1 << 15;
- break;
-
- default:
- continue;
+ internal_relocs = _bfd_elf_link_read_relocs (abfd, isec, NULL, NULL,
+ link_info->keep_memory);
+ if (internal_relocs == NULL)
+ goto error_return;
}
- /* Get the value of the symbol referred to by the reloc. */
- h = NULL;
- if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
- {
- /* A local symbol. */
- Elf_Internal_Sym *isym;
-
- /* Read this BFD's local symbols. */
- if (isymbuf == NULL)
- {
- isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
- if (isymbuf == NULL)
- isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
- symtab_hdr->sh_info, 0,
- NULL, NULL, NULL);
- if (isymbuf == 0)
- goto error_return;
- }
- isym = isymbuf + ELF32_R_SYM (irel->r_info);
- if (isym->st_shndx == SHN_UNDEF)
- tsec = bfd_und_section_ptr;
- else if (isym->st_shndx == SHN_ABS)
- tsec = bfd_abs_section_ptr;
- else if (isym->st_shndx == SHN_COMMON)
- tsec = bfd_com_section_ptr;
- else
- tsec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ got2 = bfd_get_section_by_name (abfd, ".got2");
- toff = isym->st_value;
- sym_type = ELF_ST_TYPE (isym->st_info);
- }
- else
+ irelend = internal_relocs + isec->reloc_count;
+ for (irel = internal_relocs; irel < irelend; irel++)
{
- /* Global symbol handling. */
- unsigned long indx;
-
- indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
- h = elf_sym_hashes (abfd)[indx];
+ unsigned long r_type = ELF32_R_TYPE (irel->r_info);
+ bfd_vma toff, roff;
+ asection *tsec;
+ struct one_fixup *f;
+ size_t insn_offset = 0;
+ bfd_vma max_branch_offset, val;
+ bfd_byte *hit_addr;
+ unsigned long t0;
+ struct elf_link_hash_entry *h;
+ struct plt_entry **plist;
+ unsigned char sym_type;
+
+ switch (r_type)
+ {
+ case R_PPC_REL24:
+ case R_PPC_LOCAL24PC:
+ case R_PPC_PLTREL24:
+ max_branch_offset = 1 << 25;
+ break;
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ case R_PPC_REL14:
+ case R_PPC_REL14_BRTAKEN:
+ case R_PPC_REL14_BRNTAKEN:
+ max_branch_offset = 1 << 15;
+ break;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- tsec = h->root.u.def.section;
- toff = h->root.u.def.value;
+ default:
+ continue;
}
- else if (h->root.type == bfd_link_hash_undefined
- || h->root.type == bfd_link_hash_undefweak)
+
+ /* Get the value of the symbol referred to by the reloc. */
+ h = NULL;
+ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
{
- tsec = bfd_und_section_ptr;
- toff = link_info->relocatable ? indx : 0;
+ /* A local symbol. */
+ Elf_Internal_Sym *isym;
+
+ /* Read this BFD's local symbols. */
+ if (isymbuf == NULL)
+ {
+ isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
+ if (isymbuf == NULL)
+ isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
+ symtab_hdr->sh_info, 0,
+ NULL, NULL, NULL);
+ if (isymbuf == 0)
+ goto error_return;
+ }
+ isym = isymbuf + ELF32_R_SYM (irel->r_info);
+ if (isym->st_shndx == SHN_UNDEF)
+ tsec = bfd_und_section_ptr;
+ else if (isym->st_shndx == SHN_ABS)
+ tsec = bfd_abs_section_ptr;
+ else if (isym->st_shndx == SHN_COMMON)
+ tsec = bfd_com_section_ptr;
+ else
+ tsec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+
+ toff = isym->st_value;
+ sym_type = ELF_ST_TYPE (isym->st_info);
}
else
- continue;
+ {
+ /* Global symbol handling. */
+ unsigned long indx;
- sym_type = h->type;
- }
+ indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
+ h = elf_sym_hashes (abfd)[indx];
- /* The condition here under which we call find_plt_ent must
- match that in relocate_section. If we call find_plt_ent here
- but not in relocate_section, or vice versa, then the branch
- destination used here may be incorrect. */
- plist = NULL;
- if (h != NULL)
- {
- /* We know is_branch_reloc (r_type) is true. */
- if (h->type == STT_GNU_IFUNC
- || r_type == R_PPC_PLTREL24)
- plist = &h->plt.plist;
- }
- else if (sym_type == STT_GNU_IFUNC
- && elf_local_got_offsets (abfd) != NULL)
- {
- bfd_vma *local_got_offsets = elf_local_got_offsets (abfd);
- struct plt_entry **local_plt = (struct plt_entry **)
- (local_got_offsets + symtab_hdr->sh_info);
- plist = local_plt + ELF32_R_SYM (irel->r_info);
- }
- if (plist != NULL)
- {
- bfd_vma addend = 0;
- struct plt_entry *ent;
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
- if (r_type == R_PPC_PLTREL24 && link_info->shared)
- addend = irel->r_addend;
- ent = find_plt_ent (plist, got2, addend);
- if (ent != NULL)
- {
- if (htab->plt_type == PLT_NEW
- || h == NULL
- || !htab->elf.dynamic_sections_created
- || h->dynindx == -1)
+ if (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
{
- tsec = htab->glink;
- toff = ent->glink_offset;
+ tsec = h->root.u.def.section;
+ toff = h->root.u.def.value;
}
- else
+ else if (h->root.type == bfd_link_hash_undefined
+ || h->root.type == bfd_link_hash_undefweak)
{
- tsec = htab->plt;
- toff = ent->plt.offset;
+ tsec = bfd_und_section_ptr;
+ toff = link_info->relocatable ? indx : 0;
}
- }
- }
-
- /* If the branch and target are in the same section, you have
- no hope of adding stubs. We'll error out later should the
- branch overflow. */
- if (tsec == isec)
- continue;
-
- /* There probably isn't any reason to handle symbols in
- SEC_MERGE sections; SEC_MERGE doesn't seem a likely
- attribute for a code section, and we are only looking at
- branches. However, implement it correctly here as a
- reference for other target relax_section functions. */
- if (0 && tsec->sec_info_type == SEC_INFO_TYPE_MERGE)
- {
- /* At this stage in linking, no SEC_MERGE symbol has been
- adjusted, so all references to such symbols need to be
- passed through _bfd_merged_section_offset. (Later, in
- relocate_section, all SEC_MERGE symbols *except* for
- section symbols have been adjusted.)
-
- gas may reduce relocations against symbols in SEC_MERGE
- sections to a relocation against the section symbol when
- the original addend was zero. When the reloc is against
- a section symbol we should include the addend in the
- offset passed to _bfd_merged_section_offset, since the
- location of interest is the original symbol. On the
- other hand, an access to "sym+addend" where "sym" is not
- a section symbol should not include the addend; Such an
- access is presumed to be an offset from "sym"; The
- location of interest is just "sym". */
- if (sym_type == STT_SECTION)
- toff += irel->r_addend;
+ else
+ continue;
- toff = _bfd_merged_section_offset (abfd, &tsec,
- elf_section_data (tsec)->sec_info,
- toff);
+ /* If this branch is to __tls_get_addr then we may later
+ optimise away the call. We won't be needing a long-
+ branch stub in that case. */
+ if (link_info->executable
+ && !link_info->relocatable
+ && h == htab->tls_get_addr
+ && irel != internal_relocs)
+ {
+ unsigned long t_symndx = ELF32_R_SYM (irel[-1].r_info);
+ unsigned long t_rtype = ELF32_R_TYPE (irel[-1].r_info);
+ unsigned int tls_mask = 0;
+
+ /* The previous reloc should be one of R_PPC_TLSGD or
+ R_PPC_TLSLD, or for older object files, a reloc
+ on the __tls_get_addr arg setup insn. Get tls
+ mask bits from the symbol on that reloc. */
+ if (t_symndx < symtab_hdr->sh_info)
+ {
+ bfd_vma *local_got_offsets = elf_local_got_offsets (abfd);
- if (sym_type != STT_SECTION)
- toff += irel->r_addend;
- }
- /* PLTREL24 addends are special. */
- else if (r_type != R_PPC_PLTREL24)
- toff += irel->r_addend;
+ if (local_got_offsets != NULL)
+ {
+ struct plt_entry **local_plt = (struct plt_entry **)
+ (local_got_offsets + symtab_hdr->sh_info);
+ char *lgot_masks = (char *)
+ (local_plt + symtab_hdr->sh_info);
+ tls_mask = lgot_masks[t_symndx];
+ }
+ }
+ else
+ {
+ struct elf_link_hash_entry *th
+ = elf_sym_hashes (abfd)[t_symndx - symtab_hdr->sh_info];
- /* Attempted -shared link of non-pic code loses. */
- if (tsec->output_section == NULL)
- continue;
+ while (th->root.type == bfd_link_hash_indirect
+ || th->root.type == bfd_link_hash_warning)
+ th = (struct elf_link_hash_entry *) th->root.u.i.link;
- roff = irel->r_offset;
+ tls_mask
+ = ((struct ppc_elf_link_hash_entry *) th)->tls_mask;
+ }
- /* If the branch is in range, no need to do anything. */
- if (tsec != bfd_und_section_ptr
- && (!link_info->relocatable
- /* A relocatable link may have sections moved during
- final link, so do not presume they remain in range. */
- || tsec->output_section == isec->output_section))
- {
- bfd_vma symaddr, reladdr;
+ /* The mask bits tell us if the call will be
+ optimised away. */
+ if ((tls_mask & TLS_TLS) != 0 && (tls_mask & TLS_GD) == 0
+ && (t_rtype == R_PPC_TLSGD
+ || t_rtype == R_PPC_GOT_TLSGD16
+ || t_rtype == R_PPC_GOT_TLSGD16_LO))
+ continue;
+ if ((tls_mask & TLS_TLS) != 0 && (tls_mask & TLS_LD) == 0
+ && (t_rtype == R_PPC_TLSLD
+ || t_rtype == R_PPC_GOT_TLSLD16
+ || t_rtype == R_PPC_GOT_TLSLD16_LO))
+ continue;
+ }
- symaddr = tsec->output_section->vma + tsec->output_offset + toff;
- reladdr = isec->output_section->vma + isec->output_offset + roff;
- if (symaddr - reladdr + max_branch_offset < 2 * max_branch_offset)
- continue;
- }
+ sym_type = h->type;
+ }
- /* Look for an existing fixup to this address. */
- for (f = fixups; f ; f = f->next)
- if (f->tsec == tsec && f->toff == toff)
- break;
+ /* The condition here under which we call find_plt_ent must
+ match that in relocate_section. If we call find_plt_ent here
+ but not in relocate_section, or vice versa, then the branch
+ destination used here may be incorrect. */
+ plist = NULL;
+ if (h != NULL)
+ {
+ /* We know is_branch_reloc (r_type) is true. */
+ if (h->type == STT_GNU_IFUNC
+ || r_type == R_PPC_PLTREL24)
+ plist = &h->plt.plist;
+ }
+ else if (sym_type == STT_GNU_IFUNC
+ && elf_local_got_offsets (abfd) != NULL)
+ {
+ bfd_vma *local_got_offsets = elf_local_got_offsets (abfd);
+ struct plt_entry **local_plt = (struct plt_entry **)
+ (local_got_offsets + symtab_hdr->sh_info);
+ plist = local_plt + ELF32_R_SYM (irel->r_info);
+ }
+ if (plist != NULL)
+ {
+ bfd_vma addend = 0;
+ struct plt_entry *ent;
- if (f == NULL)
- {
- size_t size;
- unsigned long stub_rtype;
+ if (r_type == R_PPC_PLTREL24 && link_info->shared)
+ addend = irel->r_addend;
+ ent = find_plt_ent (plist, got2, addend);
+ if (ent != NULL)
+ {
+ if (htab->plt_type == PLT_NEW
+ || h == NULL
+ || !htab->elf.dynamic_sections_created
+ || h->dynindx == -1)
+ {
+ tsec = htab->glink;
+ toff = ent->glink_offset;
+ }
+ else
+ {
+ tsec = htab->plt;
+ toff = ent->plt.offset;
+ }
+ }
+ }
- val = trampoff - roff;
- if (val >= max_branch_offset)
- /* Oh dear, we can't reach a trampoline. Don't try to add
- one. We'll report an error later. */
+ /* If the branch and target are in the same section, you have
+ no hope of adding stubs. We'll error out later should the
+ branch overflow. */
+ if (tsec == isec)
continue;
- if (link_info->shared)
+ /* There probably isn't any reason to handle symbols in
+ SEC_MERGE sections; SEC_MERGE doesn't seem a likely
+ attribute for a code section, and we are only looking at
+ branches. However, implement it correctly here as a
+ reference for other target relax_section functions. */
+ if (0 && tsec->sec_info_type == SEC_INFO_TYPE_MERGE)
{
- size = 4 * ARRAY_SIZE (shared_stub_entry);
- insn_offset = 12;
+ /* At this stage in linking, no SEC_MERGE symbol has been
+ adjusted, so all references to such symbols need to be
+ passed through _bfd_merged_section_offset. (Later, in
+ relocate_section, all SEC_MERGE symbols *except* for
+ section symbols have been adjusted.)
+
+ gas may reduce relocations against symbols in SEC_MERGE
+ sections to a relocation against the section symbol when
+ the original addend was zero. When the reloc is against
+ a section symbol we should include the addend in the
+ offset passed to _bfd_merged_section_offset, since the
+ location of interest is the original symbol. On the
+ other hand, an access to "sym+addend" where "sym" is not
+ a section symbol should not include the addend; Such an
+ access is presumed to be an offset from "sym"; The
+ location of interest is just "sym". */
+ if (sym_type == STT_SECTION)
+ toff += irel->r_addend;
+
+ toff
+ = _bfd_merged_section_offset (abfd, &tsec,
+ elf_section_data (tsec)->sec_info,
+ toff);
+
+ if (sym_type != STT_SECTION)
+ toff += irel->r_addend;
}
- else
+ /* PLTREL24 addends are special. */
+ else if (r_type != R_PPC_PLTREL24)
+ toff += irel->r_addend;
+
+ /* Attempted -shared link of non-pic code loses. */
+ if ((!link_info->relocatable
+ && tsec == bfd_und_section_ptr)
+ || tsec->output_section == NULL
+ || (tsec->owner != NULL
+ && (tsec->owner->flags & BFD_PLUGIN) != 0))
+ continue;
+
+ roff = irel->r_offset;
+
+ /* If the branch is in range, no need to do anything. */
+ if (tsec != bfd_und_section_ptr
+ && (!link_info->relocatable
+ /* A relocatable link may have sections moved during
+ final link, so do not presume they remain in range. */
+ || tsec->output_section == isec->output_section))
{
- size = 4 * ARRAY_SIZE (stub_entry);
- insn_offset = 0;
+ bfd_vma symaddr, reladdr;
+
+ symaddr = tsec->output_section->vma + tsec->output_offset + toff;
+ reladdr = isec->output_section->vma + isec->output_offset + roff;
+ if (symaddr - reladdr + max_branch_offset
+ < 2 * max_branch_offset)
+ continue;
}
- stub_rtype = R_PPC_RELAX;
- if (tsec == htab->plt
- || tsec == htab->glink)
+
+ /* Look for an existing fixup to this address. */
+ for (f = fixups; f ; f = f->next)
+ if (f->tsec == tsec && f->toff == toff)
+ break;
+
+ if (f == NULL)
{
- stub_rtype = R_PPC_RELAX_PLT;
- if (r_type == R_PPC_PLTREL24)
- stub_rtype = R_PPC_RELAX_PLTREL24;
- }
+ size_t size;
+ unsigned long stub_rtype;
- /* Hijack the old relocation. Since we need two
- relocations for this use a "composite" reloc. */
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- stub_rtype);
- irel->r_offset = trampoff + insn_offset;
- if (r_type == R_PPC_PLTREL24
- && stub_rtype != R_PPC_RELAX_PLTREL24)
- irel->r_addend = 0;
-
- /* Record the fixup so we don't do it again this section. */
- f = bfd_malloc (sizeof (*f));
- f->next = fixups;
- f->tsec = tsec;
- f->toff = toff;
- f->trampoff = trampoff;
- fixups = f;
-
- trampoff += size;
- changes++;
- }
- else
- {
- val = f->trampoff - roff;
- if (val >= max_branch_offset)
- continue;
+ val = trampoff - roff;
+ if (val >= max_branch_offset)
+ /* Oh dear, we can't reach a trampoline. Don't try to add
+ one. We'll report an error later. */
+ continue;
- /* Nop out the reloc, since we're finalizing things here. */
- irel->r_info = ELF32_R_INFO (0, R_PPC_NONE);
- }
+ if (link_info->shared)
+ {
+ size = 4 * ARRAY_SIZE (shared_stub_entry);
+ insn_offset = 12;
+ }
+ else
+ {
+ size = 4 * ARRAY_SIZE (stub_entry);
+ insn_offset = 0;
+ }
+ stub_rtype = R_PPC_RELAX;
+ if (tsec == htab->plt
+ || tsec == htab->glink)
+ {
+ stub_rtype = R_PPC_RELAX_PLT;
+ if (r_type == R_PPC_PLTREL24)
+ stub_rtype = R_PPC_RELAX_PLTREL24;
+ }
- /* Get the section contents. */
- if (contents == NULL)
- {
- /* Get cached copy if it exists. */
- if (elf_section_data (isec)->this_hdr.contents != NULL)
- contents = elf_section_data (isec)->this_hdr.contents;
+ /* Hijack the old relocation. Since we need two
+ relocations for this use a "composite" reloc. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ stub_rtype);
+ irel->r_offset = trampoff + insn_offset;
+ if (r_type == R_PPC_PLTREL24
+ && stub_rtype != R_PPC_RELAX_PLTREL24)
+ irel->r_addend = 0;
+
+ /* Record the fixup so we don't do it again this section. */
+ f = bfd_malloc (sizeof (*f));
+ f->next = fixups;
+ f->tsec = tsec;
+ f->toff = toff;
+ f->trampoff = trampoff;
+ fixups = f;
+
+ trampoff += size;
+ changes++;
+ }
else
{
+ val = f->trampoff - roff;
+ if (val >= max_branch_offset)
+ continue;
+
+ /* Nop out the reloc, since we're finalizing things here. */
+ irel->r_info = ELF32_R_INFO (0, R_PPC_NONE);
+ }
+
+ /* Get the section contents. */
+ if (contents == NULL)
+ {
+ /* Get cached copy if it exists. */
+ if (elf_section_data (isec)->this_hdr.contents != NULL)
+ contents = elf_section_data (isec)->this_hdr.contents;
/* Go get them off disk. */
- if (!bfd_malloc_and_get_section (abfd, isec, &contents))
+ else if (!bfd_malloc_and_get_section (abfd, isec, &contents))
goto error_return;
}
- }
- /* Fix up the existing branch to hit the trampoline. */
- hit_addr = contents + roff;
- switch (r_type)
- {
- case R_PPC_REL24:
- case R_PPC_LOCAL24PC:
- case R_PPC_PLTREL24:
- t0 = bfd_get_32 (abfd, hit_addr);
- t0 &= ~0x3fffffc;
- t0 |= val & 0x3fffffc;
- bfd_put_32 (abfd, t0, hit_addr);
- break;
+ /* Fix up the existing branch to hit the trampoline. */
+ hit_addr = contents + roff;
+ switch (r_type)
+ {
+ case R_PPC_REL24:
+ case R_PPC_LOCAL24PC:
+ case R_PPC_PLTREL24:
+ t0 = bfd_get_32 (abfd, hit_addr);
+ t0 &= ~0x3fffffc;
+ t0 |= val & 0x3fffffc;
+ bfd_put_32 (abfd, t0, hit_addr);
+ break;
- case R_PPC_REL14:
- case R_PPC_REL14_BRTAKEN:
- case R_PPC_REL14_BRNTAKEN:
- t0 = bfd_get_32 (abfd, hit_addr);
- t0 &= ~0xfffc;
- t0 |= val & 0xfffc;
- bfd_put_32 (abfd, t0, hit_addr);
- break;
+ case R_PPC_REL14:
+ case R_PPC_REL14_BRTAKEN:
+ case R_PPC_REL14_BRNTAKEN:
+ t0 = bfd_get_32 (abfd, hit_addr);
+ t0 &= ~0xfffc;
+ t0 |= val & 0xfffc;
+ bfd_put_32 (abfd, t0, hit_addr);
+ break;
+ }
}
- }
-
- /* Write out the trampolines. */
- if (fixups != NULL)
- {
- const int *stub;
- bfd_byte *dest;
- int i, size;
- do
+ while (fixups != NULL)
{
struct one_fixup *f = fixups;
fixups = fixups->next;
free (f);
}
- while (fixups);
-
- contents = bfd_realloc_or_free (contents, trampoff);
- if (contents == NULL)
- goto error_return;
-
- isec->size = (isec->size + 3) & (bfd_vma) -4;
- dest = contents + isec->size;
- /* Branch around the trampolines. */
- if (maybe_pasted)
- {
- bfd_vma val = B + trampoff - isec->size;
- bfd_put_32 (abfd, val, dest);
- dest += 4;
- }
- isec->size = trampoff;
-
- if (link_info->shared)
- {
- stub = shared_stub_entry;
- size = ARRAY_SIZE (shared_stub_entry);
- }
- else
- {
- stub = stub_entry;
- size = ARRAY_SIZE (stub_entry);
- }
+ }
- i = 0;
- while (dest < contents + trampoff)
+ workaround_change = FALSE;
+ newsize = trampoff;
+ if (htab->params->ppc476_workaround
+ && (!link_info->relocatable
+ || isec->output_section->alignment_power >= htab->params->pagesize_p2))
+ {
+ bfd_vma addr, end_addr;
+ unsigned int crossings;
+ bfd_vma pagesize = (bfd_vma) 1 << htab->params->pagesize_p2;
+
+ addr = isec->output_section->vma + isec->output_offset;
+ end_addr = addr + trampoff;
+ addr &= -pagesize;
+ crossings = ((end_addr & -pagesize) - addr) >> htab->params->pagesize_p2;
+ if (crossings != 0)
{
- bfd_put_32 (abfd, stub[i], dest);
- i++;
- if (i == size)
- i = 0;
- dest += 4;
+ /* Keep space aligned, to ensure the patch code itself does
+ not cross a page. Don't decrease size calculated on a
+ previous pass as otherwise we might never settle on a layout. */
+ newsize = 15 - (end_addr & 15);
+ newsize += crossings * 16;
+ if (relax_info->workaround_size < newsize)
+ {
+ relax_info->workaround_size = newsize;
+ workaround_change = TRUE;
+ }
+ /* Ensure relocate_section is called. */
+ isec->flags |= SEC_RELOC;
}
- BFD_ASSERT (i == 0);
+ newsize = trampoff + relax_info->workaround_size;
}
+ if (changes || workaround_change)
+ isec->size = newsize;
+
if (isymbuf != NULL
&& symtab_hdr->contents != (unsigned char *) isymbuf)
{
@@ -7090,34 +7240,20 @@ ppc_elf_relax_section (bfd *abfd,
rel_hdr = _bfd_elf_single_rel_hdr (isec);
rel_hdr->sh_size += changes * rel_hdr->sh_entsize;
}
- else if (elf_section_data (isec)->relocs != internal_relocs)
+ else if (internal_relocs != NULL
+ && elf_section_data (isec)->relocs != internal_relocs)
free (internal_relocs);
- *again = changes != 0;
- if (!*again && link_info->relocatable)
- {
- /* Convert the internal relax relocs to external form. */
- for (irel = internal_relocs; irel < irelend; irel++)
- if (ELF32_R_TYPE (irel->r_info) == R_PPC_RELAX)
- {
- unsigned long r_symndx = ELF32_R_SYM (irel->r_info);
-
- /* Rewrite the reloc and convert one of the trailing nop
- relocs to describe this relocation. */
- BFD_ASSERT (ELF32_R_TYPE (irelend[-1].r_info) == R_PPC_NONE);
- /* The relocs are at the bottom 2 bytes */
- irel[0].r_offset += 2;
- memmove (irel + 1, irel, (irelend - irel - 1) * sizeof (*irel));
- irel[0].r_info = ELF32_R_INFO (r_symndx, R_PPC_ADDR16_HA);
- irel[1].r_offset += 4;
- irel[1].r_info = ELF32_R_INFO (r_symndx, R_PPC_ADDR16_LO);
- irel++;
- }
- }
-
+ *again = changes != 0 || workaround_change;
return TRUE;
error_return:
+ while (fixups != NULL)
+ {
+ struct one_fixup *f = fixups;
+ fixups = fixups->next;
+ free (f);
+ }
if (isymbuf != NULL && (unsigned char *) isymbuf != symtab_hdr->contents)
free (isymbuf);
if (contents != NULL
@@ -7242,7 +7378,7 @@ write_glink_stub (struct plt_entry *ent, asection *plt_sec, unsigned char *p,
p += 4;
bfd_put_32 (output_bfd, BCTR, p);
p += 4;
- bfd_put_32 (output_bfd, NOP, p);
+ bfd_put_32 (output_bfd, htab->params->ppc476_workaround ? BA : NOP, p);
p += 4;
}
else
@@ -7474,6 +7610,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
bfd_boolean warned;
unsigned int tls_type, tls_mask, tls_gd;
struct plt_entry **ifunc;
+ struct reloc_howto_struct alt_howto;
r_type = ELF32_R_TYPE (rel->r_info);
sym = NULL;
@@ -7493,10 +7630,12 @@ ppc_elf_relocate_section (bfd *output_bfd,
}
else
{
+ bfd_boolean ignored;
+
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
sym_name = h->root.root.string;
}
@@ -7523,7 +7662,10 @@ ppc_elf_relocate_section (bfd *output_bfd,
addend specifies the GOT pointer offset within .got2. */
rel->r_addend += got2->output_offset;
}
- continue;
+ if (r_type != R_PPC_RELAX_PLT
+ && r_type != R_PPC_RELAX_PLTREL24
+ && r_type != R_PPC_RELAX)
+ continue;
}
/* TLS optimizations. Replace instruction sequences and relocs
@@ -7861,7 +8003,8 @@ ppc_elf_relocate_section (bfd *output_bfd,
unresolved_reloc = FALSE;
if (htab->plt_type == PLT_NEW
|| !htab->elf.dynamic_sections_created
- || h == NULL)
+ || h == NULL
+ || h->dynindx == -1)
relocation = (htab->glink->output_section->vma
+ htab->glink->output_offset
+ (ent->glink_offset & ~1));
@@ -8150,9 +8293,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
howto->name,
sym_name);
}
- break;
+ break;
- /* Relocations that need no special processing. */
+ /* Relocations that need no special processing. */
case R_PPC_LOCAL24PC:
/* It makes no sense to point a local relocation
at a symbol not in this object. */
@@ -8437,36 +8580,59 @@ ppc_elf_relocate_section (bfd *output_bfd,
/* Fall thru */
case R_PPC_RELAX:
- if (info->shared)
- relocation -= (input_section->output_section->vma
- + input_section->output_offset
- + rel->r_offset - 4);
-
{
- unsigned long t0;
- unsigned long t1;
-
- t0 = bfd_get_32 (output_bfd, contents + rel->r_offset);
- t1 = bfd_get_32 (output_bfd, contents + rel->r_offset + 4);
+ const int *stub;
+ size_t size;
+ size_t insn_offset = rel->r_offset;
+ unsigned int insn;
- /* We're clearing the bits for R_PPC_ADDR16_HA
- and R_PPC_ADDR16_LO here. */
- t0 &= ~0xffff;
- t1 &= ~0xffff;
+ if (info->shared)
+ {
+ relocation -= (input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset - 4);
+ stub = shared_stub_entry;
+ bfd_put_32 (output_bfd, stub[0], contents + insn_offset - 12);
+ bfd_put_32 (output_bfd, stub[1], contents + insn_offset - 8);
+ bfd_put_32 (output_bfd, stub[2], contents + insn_offset - 4);
+ stub += 3;
+ size = ARRAY_SIZE (shared_stub_entry) - 3;
+ }
+ else
+ {
+ stub = stub_entry;
+ size = ARRAY_SIZE (stub_entry);
+ }
- /* t0 is HA, t1 is LO */
relocation += addend;
- t0 |= ((relocation + 0x8000) >> 16) & 0xffff;
- t1 |= relocation & 0xffff;
-
- bfd_put_32 (output_bfd, t0, contents + rel->r_offset);
- bfd_put_32 (output_bfd, t1, contents + rel->r_offset + 4);
+ if (info->relocatable)
+ relocation = 0;
+
+ /* First insn is HA, second is LO. */
+ insn = *stub++;
+ insn |= ((relocation + 0x8000) >> 16) & 0xffff;
+ bfd_put_32 (output_bfd, insn, contents + insn_offset);
+ insn_offset += 4;
+
+ insn = *stub++;
+ insn |= relocation & 0xffff;
+ bfd_put_32 (output_bfd, insn, contents + insn_offset);
+ insn_offset += 4;
+ size -= 2;
+
+ while (size != 0)
+ {
+ insn = *stub++;
+ --size;
+ bfd_put_32 (output_bfd, insn, contents + insn_offset);
+ insn_offset += 4;
+ }
/* Rewrite the reloc and convert one of the trailing nop
relocs to describe this relocation. */
BFD_ASSERT (ELF32_R_TYPE (relend[-1].r_info) == R_PPC_NONE);
/* The relocs are at the bottom 2 bytes */
- rel[0].r_offset += 2;
+ rel[0].r_offset += d_offset;
memmove (rel + 1, rel, (relend - rel - 1) * sizeof (*rel));
rel[0].r_info = ELF32_R_INFO (r_symndx, R_PPC_ADDR16_HA);
rel[1].r_offset += 4;
@@ -8571,10 +8737,8 @@ ppc_elf_relocate_section (bfd *output_bfd,
addend -= SYM_VAL (sda);
name = bfd_get_section_name (output_bfd, sec->output_section);
- if (! ((CONST_STRNEQ (name, ".sdata")
- && (name[6] == 0 || name[6] == '.'))
- || (CONST_STRNEQ (name, ".sbss")
- && (name[5] == 0 || name[5] == '.'))))
+ if (!(strcmp (name, ".sdata") == 0
+ || strcmp (name, ".sbss") == 0))
{
info->callbacks->einfo
(_("%P: %B: the target (%s) of a %s relocation is "
@@ -8603,8 +8767,8 @@ ppc_elf_relocate_section (bfd *output_bfd,
addend -= SYM_VAL (sda);
name = bfd_get_section_name (output_bfd, sec->output_section);
- if (! (CONST_STRNEQ (name, ".sdata2")
- || CONST_STRNEQ (name, ".sbss2")))
+ if (!(strcmp (name, ".sdata2") == 0
+ || strcmp (name, ".sbss2") == 0))
{
info->callbacks->einfo
(_("%P: %B: the target (%s) of a %s relocation is "
@@ -8618,45 +8782,39 @@ ppc_elf_relocate_section (bfd *output_bfd,
break;
case R_PPC_VLE_LO16A:
- relocation = (relocation + addend) & 0xffff;
- ppc_elf_vle_split16 (output_bfd, contents, rel->r_offset,
- relocation, split16a_type);
+ relocation = relocation + addend;
+ ppc_elf_vle_split16 (output_bfd, contents + rel->r_offset,
+ relocation, split16a_type);
continue;
case R_PPC_VLE_LO16D:
- relocation = (relocation + addend) & 0xffff;
- ppc_elf_vle_split16 (output_bfd, contents, rel->r_offset,
- relocation, split16d_type);
+ relocation = relocation + addend;
+ ppc_elf_vle_split16 (output_bfd, contents + rel->r_offset,
+ relocation, split16d_type);
continue;
case R_PPC_VLE_HI16A:
- relocation = ((relocation + addend) >> 16) & 0xffff;
- ppc_elf_vle_split16 (output_bfd, contents, rel->r_offset,
- relocation, split16a_type);
+ relocation = (relocation + addend) >> 16;
+ ppc_elf_vle_split16 (output_bfd, contents + rel->r_offset,
+ relocation, split16a_type);
continue;
case R_PPC_VLE_HI16D:
- relocation = ((relocation + addend) >> 16) & 0xffff;
- ppc_elf_vle_split16 (output_bfd, contents, rel->r_offset,
- relocation, split16d_type);
+ relocation = (relocation + addend) >> 16;
+ ppc_elf_vle_split16 (output_bfd, contents + rel->r_offset,
+ relocation, split16d_type);
continue;
case R_PPC_VLE_HA16A:
- {
- bfd_vma value = relocation + addend;
- value = (((value >> 16) + ((value & 0x8000) ? 1 : 0)) & 0xffff);
- ppc_elf_vle_split16 (output_bfd, contents, rel->r_offset,
- value, split16a_type);
- }
+ relocation = (relocation + addend + 0x8000) >> 16;
+ ppc_elf_vle_split16 (output_bfd, contents + rel->r_offset,
+ relocation, split16a_type);
continue;
case R_PPC_VLE_HA16D:
- {
- bfd_vma value = relocation + addend;
- value = (((value >> 16) + ((value & 0x8000) ? 1 : 0)) & 0xffff);
- ppc_elf_vle_split16 (output_bfd, contents, rel->r_offset,
- value, split16d_type);
- }
+ relocation = (relocation + addend + 0x8000) >> 16;
+ ppc_elf_vle_split16 (output_bfd, contents + rel->r_offset,
+ relocation, split16d_type);
continue;
/* Relocate against either _SDA_BASE_, _SDA2_BASE_, or 0. */
@@ -8667,6 +8825,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
{
const char *name;
int reg;
+ unsigned int insn;
struct elf_link_hash_entry *sda = NULL;
if (sec == NULL || sec->output_section == NULL)
@@ -8676,16 +8835,14 @@ ppc_elf_relocate_section (bfd *output_bfd,
}
name = bfd_get_section_name (output_bfd, sec->output_section);
- if (((CONST_STRNEQ (name, ".sdata")
- && (name[6] == 0 || name[6] == '.'))
- || (CONST_STRNEQ (name, ".sbss")
- && (name[5] == 0 || name[5] == '.'))))
+ if (strcmp (name, ".sdata") == 0
+ || strcmp (name, ".sbss") == 0)
{
reg = 13;
sda = htab->sdata[0].sym;
}
- else if (CONST_STRNEQ (name, ".sdata2")
- || CONST_STRNEQ (name, ".sbss2"))
+ else if (strcmp (name, ".sdata2") == 0
+ || strcmp (name, ".sbss2") == 0)
{
reg = 2;
sda = htab->sdata[1].sym;
@@ -8720,32 +8877,41 @@ ppc_elf_relocate_section (bfd *output_bfd,
addend -= SYM_VAL (sda);
}
+ insn = bfd_get_32 (output_bfd, contents + rel->r_offset);
if (reg == 0
&& (r_type == R_PPC_VLE_SDA21
|| r_type == R_PPC_VLE_SDA21_LO))
{
- /* Use the split20 format. */
- bfd_vma insn, bits12to15, bits21to31;
- bfd_vma value = (relocation + rel->r_offset) & 0xffff;
- /* Propagate sign bit, if necessary. */
- insn = (value & 0x8000) ? 0x70107800 : 0x70000000;
- bits12to15 = value & 0x700;
- bits21to31 = value & 0x7ff;
- insn |= bits12to15;
- insn |= bits21to31;
- bfd_put_32 (output_bfd, insn, contents + rel->r_offset);
+ relocation = relocation + addend;
+ addend = 0;
+
+ /* Force e_li insn, keeping RT from original insn. */
+ insn &= 0x1f << 21;
+ insn |= 28u << 26;
+
+ /* We have an li20 field, bits 17..20, 11..15, 21..31. */
+ /* Top 4 bits of value to 17..20. */
+ insn |= (relocation & 0xf0000) >> 5;
+ /* Next 5 bits of the value to 11..15. */
+ insn |= (relocation & 0xf800) << 5;
+ /* And the final 11 bits of the value to bits 21 to 31. */
+ insn |= relocation & 0x7ff;
+
+ bfd_put_32 (output_bfd, insn, contents + rel->r_offset);
+
+ if (r_type == R_PPC_VLE_SDA21
+ && ((relocation + 0x80000) & 0xffffffff) > 0x100000)
+ goto overflow;
continue;
}
else if (r_type == R_PPC_EMB_SDA21
|| r_type == R_PPC_VLE_SDA21
|| r_type == R_PPC_VLE_SDA21_LO)
{
- bfd_vma insn; /* Fill in register field. */
-
- insn = bfd_get_32 (output_bfd, contents + rel->r_offset);
+ /* Fill in register field. */
insn = (insn & ~RA_REGISTER_MASK) | (reg << RA_REGISTER_SHIFT);
- bfd_put_32 (output_bfd, insn, contents + rel->r_offset);
}
+ bfd_put_32 (output_bfd, insn, contents + rel->r_offset);
}
break;
@@ -8768,16 +8934,14 @@ ppc_elf_relocate_section (bfd *output_bfd,
}
name = bfd_get_section_name (output_bfd, sec->output_section);
- if (((CONST_STRNEQ (name, ".sdata")
- && (name[6] == 0 || name[6] == '.'))
- || (CONST_STRNEQ (name, ".sbss")
- && (name[5] == 0 || name[5] == '.'))))
+ if (strcmp (name, ".sdata") == 0
+ || strcmp (name, ".sbss") == 0)
{
//reg = 13;
sda = htab->sdata[0].sym;
}
- else if (CONST_STRNEQ (name, ".sdata2")
- || CONST_STRNEQ (name, ".sbss2"))
+ else if (strcmp (name, ".sdata2") == 0
+ || strcmp (name, ".sbss2") == 0)
{
//reg = 2;
sda = htab->sdata[1].sym;
@@ -8806,46 +8970,39 @@ ppc_elf_relocate_section (bfd *output_bfd,
}
}
- value = sda->root.u.def.section->output_section->vma
- + sda->root.u.def.section->output_offset;
-
- if (r_type == R_PPC_VLE_SDAREL_LO16A)
- {
- value = (value + addend) & 0xffff;
- ppc_elf_vle_split16 (output_bfd, contents, rel->r_offset,
- value, split16a_type);
- }
- else if (r_type == R_PPC_VLE_SDAREL_LO16D)
+ value = (sda->root.u.def.section->output_section->vma
+ + sda->root.u.def.section->output_offset
+ + addend);
+
+ if (r_type == R_PPC_VLE_SDAREL_LO16A)
+ ppc_elf_vle_split16 (output_bfd, contents + rel->r_offset,
+ value, split16a_type);
+ else if (r_type == R_PPC_VLE_SDAREL_LO16D)
+ ppc_elf_vle_split16 (output_bfd, contents + rel->r_offset,
+ value, split16d_type);
+ else if (r_type == R_PPC_VLE_SDAREL_HI16A)
{
- value = (value + addend) & 0xffff;
- ppc_elf_vle_split16 (output_bfd, contents, rel->r_offset,
- value, split16d_type);
+ value = value >> 16;
+ ppc_elf_vle_split16 (output_bfd, contents + rel->r_offset,
+ value, split16a_type);
}
- else if (r_type == R_PPC_VLE_SDAREL_HI16A)
+ else if (r_type == R_PPC_VLE_SDAREL_HI16D)
{
- value = ((value + addend) >> 16) & 0xffff;
- ppc_elf_vle_split16 (output_bfd, contents, rel->r_offset,
- value, split16a_type);
+ value = value >> 16;
+ ppc_elf_vle_split16 (output_bfd, contents + rel->r_offset,
+ value, split16d_type);
}
- else if (r_type == R_PPC_VLE_SDAREL_HI16D)
+ else if (r_type == R_PPC_VLE_SDAREL_HA16A)
{
- value = ((value + addend) >> 16) & 0xffff;
- ppc_elf_vle_split16 (output_bfd, contents, rel->r_offset,
- value, split16d_type);
+ value = (value + 0x8000) >> 16;
+ ppc_elf_vle_split16 (output_bfd, contents + rel->r_offset,
+ value, split16a_type);
}
- else if (r_type == R_PPC_VLE_SDAREL_HA16A)
+ else if (r_type == R_PPC_VLE_SDAREL_HA16D)
{
- value += addend;
- value = (((value >> 16) + ((value & 0x8000) ? 1 : 0)) & 0xffff);
- ppc_elf_vle_split16 (output_bfd, contents, rel->r_offset,
- value, split16a_type);
- }
- else if (r_type == R_PPC_VLE_SDAREL_HA16D)
- {
- value += addend;
- value = (((value >> 16) + ((value & 0x8000) ? 1 : 0)) & 0xffff);
- ppc_elf_vle_split16 (output_bfd, contents, rel->r_offset,
- value, split16d_type);
+ value = (value + 0x8000) >> 16;
+ ppc_elf_vle_split16 (output_bfd, contents + rel->r_offset,
+ value, split16d_type);
}
}
continue;
@@ -9005,18 +9162,43 @@ ppc_elf_relocate_section (bfd *output_bfd,
ret = FALSE;
}
- r = _bfd_final_link_relocate (howto,
- input_bfd,
- input_section,
- contents,
- rel->r_offset,
- relocation,
- addend);
+ /* 16-bit fields in insns mostly have signed values, but a
+ few insns have 16-bit unsigned values. Really, we should
+ have different reloc types. */
+ if (howto->complain_on_overflow != complain_overflow_dont
+ && howto->dst_mask == 0xffff
+ && (input_section->flags & SEC_CODE) != 0)
+ {
+ enum complain_overflow complain = complain_overflow_signed;
+
+ if ((elf_section_flags (input_section) & SHF_PPC_VLE) == 0)
+ {
+ unsigned int insn;
+
+ insn = bfd_get_32 (input_bfd, contents + (rel->r_offset & ~3));
+ if ((insn & (0x3f << 26)) == 10u << 26 /* cmpli */)
+ complain = complain_overflow_bitfield;
+ else if ((insn & (0x3f << 26)) == 28u << 26 /* andi */
+ || (insn & (0x3f << 26)) == 24u << 26 /* ori */
+ || (insn & (0x3f << 26)) == 26u << 26 /* xori */)
+ complain = complain_overflow_unsigned;
+ }
+ if (howto->complain_on_overflow != complain)
+ {
+ alt_howto = *howto;
+ alt_howto.complain_on_overflow = complain;
+ howto = &alt_howto;
+ }
+ }
+
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents,
+ rel->r_offset, relocation, addend);
if (r != bfd_reloc_ok)
{
if (r == bfd_reloc_overflow)
{
+ overflow:
if (warned)
continue;
if (h != NULL
@@ -9057,6 +9239,247 @@ ppc_elf_relocate_section (bfd *output_bfd,
fprintf (stderr, "\n");
#endif
+ if (input_section->sec_info_type == SEC_INFO_TYPE_TARGET
+ && input_section->size != input_section->rawsize
+ && (strcmp (input_section->output_section->name, ".init") == 0
+ || strcmp (input_section->output_section->name, ".fini") == 0))
+ {
+ /* Branch around the trampolines. */
+ unsigned int insn = B + input_section->size - input_section->rawsize;
+ bfd_put_32 (input_bfd, insn, contents + input_section->rawsize);
+ }
+
+ if (htab->params->ppc476_workaround
+ && input_section->sec_info_type == SEC_INFO_TYPE_TARGET
+ && (!info->relocatable
+ || (input_section->output_section->alignment_power
+ >= htab->params->pagesize_p2)))
+ {
+ struct ppc_elf_relax_info *relax_info;
+ bfd_vma start_addr, end_addr, addr;
+ bfd_vma pagesize = (bfd_vma) 1 << htab->params->pagesize_p2;
+
+ relax_info = elf_section_data (input_section)->sec_info;
+ if (relax_info->workaround_size != 0)
+ {
+ bfd_byte *p;
+ unsigned int n;
+ bfd_byte fill[4];
+
+ bfd_put_32 (input_bfd, BA, fill);
+ p = contents + input_section->size - relax_info->workaround_size;
+ n = relax_info->workaround_size >> 2;
+ while (n--)
+ {
+ memcpy (p, fill, 4);
+ p += 4;
+ }
+ }
+
+ /* The idea is: Replace the last instruction on a page with a
+ branch to a patch area. Put the insn there followed by a
+ branch back to the next page. Complicated a little by
+ needing to handle moved conditional branches, and by not
+ wanting to touch data-in-text. */
+
+ start_addr = (input_section->output_section->vma
+ + input_section->output_offset);
+ end_addr = (start_addr + input_section->size
+ - relax_info->workaround_size);
+ for (addr = ((start_addr & -pagesize) + pagesize - 4);
+ addr < end_addr;
+ addr += pagesize)
+ {
+ bfd_vma offset = addr - start_addr;
+ Elf_Internal_Rela *lo, *hi;
+ bfd_boolean is_data;
+ bfd_vma patch_off, patch_addr;
+ unsigned int insn;
+
+ /* Do we have a data reloc at this offset? If so, leave
+ the word alone. */
+ is_data = FALSE;
+ lo = relocs;
+ hi = relend;
+ rel = NULL;
+ while (lo < hi)
+ {
+ rel = lo + (hi - lo) / 2;
+ if (rel->r_offset < offset)
+ lo = rel + 1;
+ else if (rel->r_offset > offset + 3)
+ hi = rel;
+ else
+ {
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_PPC_ADDR32:
+ case R_PPC_UADDR32:
+ case R_PPC_REL32:
+ case R_PPC_ADDR30:
+ is_data = TRUE;
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ }
+ if (is_data)
+ continue;
+
+ /* Some instructions can be left alone too. Unconditional
+ branches, except for bcctr with BO=0x14 (bctr, bctrl),
+ avoid the icache failure.
+
+ The problem occurs due to prefetch across a page boundary
+ where stale instructions can be fetched from the next
+ page, and the mechanism for flushing these bad
+ instructions fails under certain circumstances. The
+ unconditional branches:
+ 1) Branch: b, bl, ba, bla,
+ 2) Branch Conditional: bc, bca, bcl, bcla,
+ 3) Branch Conditional to Link Register: bclr, bclrl,
+ where (2) and (3) have BO=0x14 making them unconditional,
+ prevent the bad prefetch because the prefetch itself is
+ affected by these instructions. This happens even if the
+ instruction is not executed.
+
+ A bctr example:
+ .
+ . lis 9,new_page@ha
+ . addi 9,9,new_page@l
+ . mtctr 9
+ . bctr
+ . nop
+ . nop
+ . new_page:
+ .
+ The bctr is not predicted taken due to ctr not being
+ ready, so prefetch continues on past the bctr into the
+ new page which might have stale instructions. If they
+ fail to be flushed, then they will be executed after the
+ bctr executes. Either of the following modifications
+ prevent the bad prefetch from happening in the first
+ place:
+ .
+ . lis 9,new_page@ha lis 9,new_page@ha
+ . addi 9,9,new_page@l addi 9,9,new_page@l
+ . mtctr 9 mtctr 9
+ . bctr bctr
+ . nop b somewhere_else
+ . b somewhere_else nop
+ . new_page: new_page:
+ . */
+ insn = bfd_get_32 (input_bfd, contents + offset);
+ if ((insn & (0x3f << 26)) == (18u << 26) /* b,bl,ba,bla */
+ || ((insn & (0x3f << 26)) == (16u << 26) /* bc,bcl,bca,bcla*/
+ && (insn & (0x14 << 21)) == (0x14 << 21)) /* with BO=0x14 */
+ || ((insn & (0x3f << 26)) == (19u << 26)
+ && (insn & (0x3ff << 1)) == (16u << 1) /* bclr,bclrl */
+ && (insn & (0x14 << 21)) == (0x14 << 21)))/* with BO=0x14 */
+ continue;
+
+ patch_addr = (start_addr + input_section->size
+ - relax_info->workaround_size);
+ patch_addr = (patch_addr + 15) & -16;
+ patch_off = patch_addr - start_addr;
+ bfd_put_32 (input_bfd, B + patch_off - offset, contents + offset);
+
+ if (rel != NULL
+ && rel->r_offset >= offset
+ && rel->r_offset < offset + 4)
+ {
+ /* If the insn we are patching had a reloc, adjust the
+ reloc r_offset so that the reloc applies to the moved
+ location. This matters for -r and --emit-relocs. */
+ if (rel + 1 != relend)
+ {
+ Elf_Internal_Rela tmp = *rel;
+
+ /* Keep the relocs sorted by r_offset. */
+ memmove (rel, rel + 1, (relend - (rel + 1)) * sizeof (*rel));
+ relend[-1] = tmp;
+ }
+ relend[-1].r_offset += patch_off - offset;
+ }
+ else
+ rel = NULL;
+
+ if ((insn & (0x3f << 26)) == (16u << 26) /* bc */
+ && (insn & 2) == 0 /* relative */)
+ {
+ bfd_vma delta = ((insn & 0xfffc) ^ 0x8000) - 0x8000;
+
+ delta += offset - patch_off;
+ if (info->relocatable && rel != NULL)
+ delta = 0;
+ if (!info->relocatable && rel != NULL)
+ {
+ enum elf_ppc_reloc_type r_type;
+
+ r_type = ELF32_R_TYPE (relend[-1].r_info);
+ if (r_type == R_PPC_REL14_BRTAKEN)
+ insn |= BRANCH_PREDICT_BIT;
+ else if (r_type == R_PPC_REL14_BRNTAKEN)
+ insn &= ~BRANCH_PREDICT_BIT;
+ else
+ BFD_ASSERT (r_type == R_PPC_REL14);
+
+ if ((r_type == R_PPC_REL14_BRTAKEN
+ || r_type == R_PPC_REL14_BRNTAKEN)
+ && delta + 0x8000 < 0x10000
+ && (bfd_signed_vma) delta < 0)
+ insn ^= BRANCH_PREDICT_BIT;
+ }
+ if (delta + 0x8000 < 0x10000)
+ {
+ bfd_put_32 (input_bfd,
+ (insn & ~0xfffc) | (delta & 0xfffc),
+ contents + patch_off);
+ patch_off += 4;
+ bfd_put_32 (input_bfd,
+ B | ((offset + 4 - patch_off) & 0x3fffffc),
+ contents + patch_off);
+ patch_off += 4;
+ }
+ else
+ {
+ if (rel != NULL)
+ {
+ unsigned int r_sym = ELF32_R_SYM (relend[-1].r_info);
+
+ relend[-1].r_offset += 8;
+ relend[-1].r_info = ELF32_R_INFO (r_sym, R_PPC_REL24);
+ }
+ bfd_put_32 (input_bfd,
+ (insn & ~0xfffc) | 8,
+ contents + patch_off);
+ patch_off += 4;
+ bfd_put_32 (input_bfd,
+ B | ((offset + 4 - patch_off) & 0x3fffffc),
+ contents + patch_off);
+ patch_off += 4;
+ bfd_put_32 (input_bfd,
+ B | ((delta - 8) & 0x3fffffc),
+ contents + patch_off);
+ patch_off += 4;
+ }
+ }
+ else
+ {
+ bfd_put_32 (input_bfd, insn, contents + patch_off);
+ patch_off += 4;
+ bfd_put_32 (input_bfd,
+ B | ((offset + 4 - patch_off) & 0x3fffffc),
+ contents + patch_off);
+ patch_off += 4;
+ }
+ BFD_ASSERT (patch_off <= input_section->size);
+ relax_info->workaround_size = input_section->size - patch_off;
+ }
+ }
+
return ret;
}
@@ -9331,7 +9754,7 @@ ppc_elf_finish_dynamic_symbol (bfd *output_bfd,
p = (unsigned char *) htab->glink->contents + ent->glink_offset;
- if (h == htab->tls_get_addr && !htab->no_tls_get_addr_opt)
+ if (h == htab->tls_get_addr && !htab->params->no_tls_get_addr_opt)
{
bfd_put_32 (output_bfd, LWZ_11_3, p);
p += 4;
@@ -9741,7 +10164,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
p += htab->glink_pltresolve;
endp = htab->glink->contents;
endp += htab->glink->size - GLINK_PLTRESOLVE;
- while (p < endp - 8 * 4)
+ while (p < endp - (htab->params->ppc476_workaround ? 0 : 8 * 4))
{
bfd_put_32 (output_bfd, B + endp - p, p);
p += 4;
@@ -9756,6 +10179,39 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
+ htab->glink->output_section->vma
+ htab->glink->output_offset);
+ if (htab->params->ppc476_workaround)
+ {
+ /* Ensure that a call stub at the end of a page doesn't
+ result in prefetch over the end of the page into the
+ glink branch table. */
+ bfd_vma pagesize = (bfd_vma) 1 << htab->params->pagesize_p2;
+ bfd_vma page_addr;
+ bfd_vma glink_start = (htab->glink->output_section->vma
+ + htab->glink->output_offset);
+
+ for (page_addr = res0 & -pagesize;
+ page_addr > glink_start;
+ page_addr -= pagesize)
+ {
+ /* We have a plt call stub that may need fixing. */
+ bfd_byte *loc;
+ unsigned int insn;
+
+ loc = htab->glink->contents + page_addr - 4 - glink_start;
+ insn = bfd_get_32 (output_bfd, loc);
+ if (insn == BCTR)
+ {
+ /* By alignment, we know that there must be at least
+ one other call stub before this one. */
+ insn = bfd_get_32 (output_bfd, loc - 16);
+ if (insn == BCTR)
+ bfd_put_32 (output_bfd, B | (-16 & 0x3fffffc), loc);
+ else
+ bfd_put_32 (output_bfd, B | (-20 & 0x3fffffc), loc);
+ }
+ }
+ }
+
/* Last comes the PLTresolve stub. */
if (info->shared)
{
@@ -9763,7 +10219,11 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
for (i = 0; i < ARRAY_SIZE (pic_plt_resolve); i++)
{
- bfd_put_32 (output_bfd, pic_plt_resolve[i], p);
+ unsigned int insn = pic_plt_resolve[i];
+
+ if (htab->params->ppc476_workaround && insn == NOP)
+ insn = BA + 0;
+ bfd_put_32 (output_bfd, insn, p);
p += 4;
}
p -= 4 * ARRAY_SIZE (pic_plt_resolve);
@@ -9797,7 +10257,11 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
{
for (i = 0; i < ARRAY_SIZE (plt_resolve); i++)
{
- bfd_put_32 (output_bfd, plt_resolve[i], p);
+ unsigned int insn = plt_resolve[i];
+
+ if (htab->params->ppc476_workaround && insn == NOP)
+ insn = BA + 0;
+ bfd_put_32 (output_bfd, insn, p);
p += 4;
}
p -= 4 * ARRAY_SIZE (plt_resolve);
@@ -9854,9 +10318,9 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
return ret;
}
-#define TARGET_LITTLE_SYM bfd_elf32_powerpcle_vec
+#define TARGET_LITTLE_SYM powerpc_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-powerpcle"
-#define TARGET_BIG_SYM bfd_elf32_powerpc_vec
+#define TARGET_BIG_SYM powerpc_elf32_vec
#define TARGET_BIG_NAME "elf32-powerpc"
#define ELF_ARCH bfd_arch_powerpc
#define ELF_TARGET_ID PPC32_ELF_DATA
@@ -9882,6 +10346,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
#define elf_backend_can_gc_sections 1
#define elf_backend_can_refcount 1
#define elf_backend_rela_normal 1
+#define elf_backend_caches_rawsize 1
#define bfd_elf32_mkobject ppc_elf_mkobject
#define bfd_elf32_bfd_merge_private_bfd_data ppc_elf_merge_private_bfd_data
@@ -9920,7 +10385,6 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
#define elf_backend_plt_sym_val ppc_elf_plt_sym_val
#define elf_backend_action_discarded ppc_elf_action_discarded
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
-#define elf_backend_post_process_headers _bfd_elf_set_osabi
#define elf_backend_lookup_section_flags_hook ppc_elf_lookup_section_flags
#define elf_backend_section_processing ppc_elf_section_processing
@@ -9932,7 +10396,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
#undef TARGET_LITTLE_NAME
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_powerpc_freebsd_vec
+#define TARGET_BIG_SYM powerpc_elf32_fbsd_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-powerpc-freebsd"
@@ -9950,7 +10414,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
#undef TARGET_LITTLE_NAME
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_powerpc_vxworks_vec
+#define TARGET_BIG_SYM powerpc_elf32_vxworks_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-powerpc-vxworks"
diff --git a/binutils-2.25/bfd/elf32-ppc.h b/binutils-2.25/bfd/elf32-ppc.h
index 0bf973c9..07dc4c84 100644
--- a/binutils-2.25/bfd/elf32-ppc.h
+++ b/binutils-2.25/bfd/elf32-ppc.h
@@ -1,5 +1,5 @@
/* PowerPC-specific support for 64-bit ELF.
- Copyright 2003, 2005, 2007, 2009, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2003-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -26,11 +26,31 @@ enum ppc_elf_plt_type
PLT_VXWORKS
};
-int ppc_elf_select_plt_layout (bfd *, struct bfd_link_info *,
- enum ppc_elf_plt_type, int);
-asection *ppc_elf_tls_setup (bfd *, struct bfd_link_info *, int);
+/* Various options passed from the linker to bfd backend. */
+struct ppc_elf_params
+{
+ /* Chooses the type of .plt. */
+ enum ppc_elf_plt_type plt_style;
+
+ /* Whether to emit symbols for stubs. */
+ int emit_stub_syms;
+
+ /* Whether to emit special stub for __tls_get_addr calls. */
+ int no_tls_get_addr_opt;
+
+ /* Insert trampolines for branches that won't reach their destination. */
+ int branch_trampolines;
+
+ /* Avoid execution falling into new page. */
+ int ppc476_workaround;
+ unsigned int pagesize_p2;
+};
+
+void ppc_elf_link_params (struct bfd_link_info *, struct ppc_elf_params *);
+int ppc_elf_select_plt_layout (bfd *, struct bfd_link_info *);
+asection *ppc_elf_tls_setup (bfd *, struct bfd_link_info *);
bfd_boolean ppc_elf_tls_optimize (bfd *, struct bfd_link_info *);
-void ppc_elf_set_sdata_syms (bfd *, struct bfd_link_info *);
+void ppc_elf_maybe_strip_sdata_syms (struct bfd_link_info *);
extern bfd_boolean ppc_elf_modify_segment_map (bfd *,
struct bfd_link_info * ATTRIBUTE_UNUSED);
extern bfd_boolean ppc_elf_section_processing (bfd *, Elf_Internal_Shdr *);
diff --git a/binutils-2.25/bfd/elf32-rl78.c b/binutils-2.25/bfd/elf32-rl78.c
index a8ee414f..2a5ec99b 100644
--- a/binutils-2.25/bfd/elf32-rl78.c
+++ b/binutils-2.25/bfd/elf32-rl78.c
@@ -1,5 +1,5 @@
/* Renesas RL78 specific support for 32-bit ELF.
- Copyright (C) 2011-2013 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -460,12 +460,13 @@ rl78_elf_relocate_section
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned ATTRIBUTE_UNUSED;
+ bfd_boolean ignored ATTRIBUTE_UNUSED;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes, h,
sec, relocation, unresolved_reloc,
- warned);
+ warned, ignored);
name = h->root.root.string;
}
@@ -1048,6 +1049,19 @@ rl78_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
(*_bfd_error_handler) (_("- %s is G10, %s is not"),
bfd_get_filename (ibfd), bfd_get_filename (obfd));
}
+
+ if (changed_flags & E_FLAG_RL78_64BIT_DOUBLES)
+ {
+ (*_bfd_error_handler)
+ (_("RL78 merge conflict: cannot link 32-bit and 64-bit objects together"));
+
+ if (old_flags & E_FLAG_RL78_64BIT_DOUBLES)
+ (*_bfd_error_handler) (_("- %s is 64-bit, %s is not"),
+ bfd_get_filename (obfd), bfd_get_filename (ibfd));
+ else
+ (*_bfd_error_handler) (_("- %s is 64-bit, %s is not"),
+ bfd_get_filename (ibfd), bfd_get_filename (obfd));
+ }
}
return !error;
@@ -1070,6 +1084,9 @@ rl78_elf_print_private_bfd_data (bfd * abfd, void * ptr)
if (flags & E_FLAG_RL78_G10)
fprintf (file, _(" [G10]"));
+ if (flags & E_FLAG_RL78_64BIT_DOUBLES)
+ fprintf (file, _(" [64-bit doubles]"));
+
fputc ('\n', file);
return TRUE;
}
@@ -1353,7 +1370,7 @@ rl78_elf_relax_plt_section (bfd *dynobj,
/* Likewise for local symbols, though that's somewhat less convenient
as we have to walk the list of input bfds and swap in symbol data. */
- for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next)
{
bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd);
Elf_Internal_Shdr *symtab_hdr;
@@ -1427,7 +1444,7 @@ rl78_elf_relax_plt_section (bfd *dynobj,
elf_link_hash_traverse (elf_hash_table (info),
rl78_relax_plt_realloc, &entry);
- for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next)
{
bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd);
unsigned int nlocals = elf_tdata (ibfd)->symtab_hdr.sh_info;
@@ -1480,6 +1497,12 @@ elf32_rl78_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, int count
toaddr = alignment_rel->r_offset;
irel = elf_section_data (sec)->relocs;
+ if (irel == NULL)
+ {
+ _bfd_elf_link_read_relocs (sec->owner, sec, NULL, NULL, TRUE);
+ irel = elf_section_data (sec)->relocs;
+ }
+
irelend = irel + sec->reloc_count;
/* Actually delete the bytes. */
@@ -1495,7 +1518,7 @@ elf32_rl78_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, int count
memset (contents + toaddr - count, 0x03, count);
/* Adjust all the relocs. */
- for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
+ for (; irel && irel < irelend; irel++)
{
/* Get the new reloc address. */
if (irel->r_offset > addr
@@ -2176,7 +2199,7 @@ rl78_elf_relax_section
61 F3 EF ad SKNH ; BR $rel8
*/
- if (irel->r_addend & RL78_RELAXA_BRA)
+ if ((irel->r_addend & RL78_RELAXA_MASK) == RL78_RELAXA_BRA)
{
/* SKIP opcodes that skip non-branches will have a relax tag
but no corresponding symbol to relax against; we just
@@ -2311,7 +2334,7 @@ rl78_elf_relax_section
}
- if (irel->r_addend & RL78_RELAXA_ADDR16)
+ if ((irel->r_addend & RL78_RELAXA_MASK) == RL78_RELAXA_ADDR16)
{
/*----------------------------------------------------------------------*/
/* Some insns have both a 16-bit address operand and an 8-bit
@@ -2410,7 +2433,7 @@ rl78_elf_relax_section
#define ELF_MACHINE_CODE EM_RL78
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_LITTLE_SYM bfd_elf32_rl78_vec
+#define TARGET_LITTLE_SYM rl78_elf32_vec
#define TARGET_LITTLE_NAME "elf32-rl78"
#define elf_info_to_howto_rel NULL
diff --git a/binutils-2.25/bfd/elf32-rx.c b/binutils-2.25/bfd/elf32-rx.c
index af84e08f..5d09f21b 100644
--- a/binutils-2.25/bfd/elf32-rx.c
+++ b/binutils-2.25/bfd/elf32-rx.c
@@ -1,5 +1,5 @@
/* Renesas RX specific support for 32-bit ELF.
- Copyright (C) 2008-2013 Free Software Foundation, Inc.
+ Copyright (C) 2008-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -24,14 +24,15 @@
#include "elf-bfd.h"
#include "elf/rx.h"
#include "libiberty.h"
+#include "elf32-rx.h"
#define RX_OPCODE_BIG_ENDIAN 0
/* This is a meta-target that's used only with objcopy, to avoid the
endian-swap we would otherwise get. We check for this in
rx_elf_object_p(). */
-const bfd_target bfd_elf32_rx_be_ns_vec;
-const bfd_target bfd_elf32_rx_be_vec;
+const bfd_target rx_elf32_be_ns_vec;
+const bfd_target rx_elf32_be_vec;
#ifdef DEBUG
char * rx_get_reloc (long);
@@ -335,6 +336,26 @@ get_symbol_value (const char * name,
return value;
}
+static bfd_vma
+get_symbol_value_maybe (const char * name,
+ struct bfd_link_info * info)
+{
+ bfd_vma value = 0;
+ struct bfd_link_hash_entry * h;
+
+ h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE);
+
+ if (h == NULL
+ || (h->type != bfd_link_hash_defined
+ && h->type != bfd_link_hash_defweak))
+ return 0;
+ else
+ value = (h->u.def.value
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
+
+ return value;
+}
static bfd_vma
get_gp (bfd_reloc_status_type * status,
@@ -464,6 +485,9 @@ rx_elf_relocate_section
Elf_Internal_Rela * relend;
bfd_boolean pid_mode;
bfd_boolean saw_subtract = FALSE;
+ const char * table_default_cache = NULL;
+ bfd_vma table_start_cache = 0;
+ bfd_vma table_end_cache = 0;
if (elf_elfheader (output_bfd)->e_flags & E_FLAG_RX_PID)
pid_mode = TRUE;
@@ -510,16 +534,96 @@ rx_elf_relocate_section
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes, h,
sec, relocation, unresolved_reloc,
- warned);
+ warned, ignored);
name = h->root.root.string;
}
+ if (strncmp (name, "$tableentry$default$", 20) == 0)
+ {
+ bfd_vma entry_vma;
+ int idx;
+ char *buf;
+ bfd_reloc_status_type tstat = 0;
+
+ if (table_default_cache != name)
+ {
+
+ /* All relocs for a given table should be to the same
+ (weak) default symbol) so we can use it to detect a
+ cache miss. We use the offset into the table to find
+ the "real" symbol. Calculate and store the table's
+ offset here. */
+
+ table_default_cache = name;
+
+ /* We have already done error checking in rx_table_find(). */
+
+ buf = (char *) malloc (13 + strlen (name + 20));
+
+ sprintf (buf, "$tablestart$%s", name + 20);
+ tstat = 0;
+ table_start_cache = get_symbol_value (buf,
+ &tstat,
+ info,
+ input_bfd,
+ input_section,
+ rel->r_offset);
+
+ sprintf (buf, "$tableend$%s", name + 20);
+ tstat = 0;
+ table_end_cache = get_symbol_value (buf,
+ &tstat,
+ info,
+ input_bfd,
+ input_section,
+ rel->r_offset);
+
+ free (buf);
+ }
+
+ entry_vma = (input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset);
+
+ if (table_end_cache <= entry_vma || entry_vma < table_start_cache)
+ {
+ _bfd_error_handler (_("%B:%A: table entry %s outside table"),
+ input_bfd, input_section,
+ name);
+ }
+ else if ((int) (entry_vma - table_start_cache) % 4)
+ {
+ _bfd_error_handler (_("%B:%A: table entry %s not word-aligned within table"),
+ input_bfd, input_section,
+ name);
+ }
+ else
+ {
+ idx = (int) (entry_vma - table_start_cache) / 4;
+
+ /* This will look like $tableentry$<N>$<name> */
+ buf = (char *) malloc (12 + 20 + strlen (name + 20));
+ sprintf (buf, "$tableentry$%d$%s", idx, name + 20);
+
+ h = (struct elf_link_hash_entry *) bfd_link_hash_lookup (info->hash, buf, FALSE, FALSE, TRUE);
+
+ if (h)
+ {
+ relocation = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);;
+ }
+
+ free (buf);
+ }
+ }
+
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
rel, 1, relend, howto, 0, contents);
@@ -3071,17 +3175,17 @@ rx_elf_object_p (bfd * abfd)
/* We never want to automatically choose the non-swapping big-endian
target. The user can only get that explicitly, such as with -I
and objcopy. */
- if (abfd->xvec == &bfd_elf32_rx_be_ns_vec
+ if (abfd->xvec == &rx_elf32_be_ns_vec
&& abfd->target_defaulted)
return FALSE;
/* BFD->target_defaulted is not set to TRUE when a target is chosen
as a fallback, so we check for "scanning" to know when to stop
using the non-swapping target. */
- if (abfd->xvec == &bfd_elf32_rx_be_ns_vec
+ if (abfd->xvec == &rx_elf32_be_ns_vec
&& saw_be)
return FALSE;
- if (abfd->xvec == &bfd_elf32_rx_be_vec)
+ if (abfd->xvec == &rx_elf32_be_vec)
saw_be = TRUE;
bfd_default_set_arch_mach (abfd, bfd_arch_rx,
@@ -3544,14 +3648,302 @@ static const struct bfd_elf_special_section elf32_rx_special_sections[] =
{ NULL, 0, 0, 0, 0 }
};
+typedef struct {
+ bfd *abfd;
+ struct bfd_link_info *info;
+ bfd_vma table_start;
+ int table_size;
+ bfd_vma *table_handlers;
+ bfd_vma table_default_handler;
+ struct bfd_link_hash_entry **table_entries;
+ struct bfd_link_hash_entry *table_default_entry;
+ FILE *mapfile;
+} RX_Table_Info;
+
+static bfd_boolean
+rx_table_find (struct bfd_hash_entry *vent, void *vinfo)
+{
+ RX_Table_Info *info = (RX_Table_Info *)vinfo;
+ struct bfd_link_hash_entry *ent = (struct bfd_link_hash_entry *)vent;
+ const char *name; /* of the symbol we've found */
+ asection *sec;
+ struct bfd *abfd;
+ int idx;
+ const char *tname; /* name of the table */
+ bfd_vma start_addr, end_addr;
+ char *buf;
+ struct bfd_link_hash_entry * h;
+
+ /* We're looking for globally defined symbols of the form
+ $tablestart$<NAME>. */
+ if (ent->type != bfd_link_hash_defined
+ && ent->type != bfd_link_hash_defweak)
+ return TRUE;
+
+ name = ent->root.string;
+ sec = ent->u.def.section;
+ abfd = sec->owner;
+
+ if (strncmp (name, "$tablestart$", 12))
+ return TRUE;
+
+ sec->flags |= SEC_KEEP;
+
+ tname = name + 12;
+
+ start_addr = ent->u.def.value;
+
+ /* At this point, we can't build the table but we can (and must)
+ find all the related symbols and mark their sections as SEC_KEEP
+ so we don't garbage collect them. */
+
+ buf = (char *) malloc (12 + 10 + strlen (tname));
+
+ sprintf (buf, "$tableend$%s", tname);
+ h = bfd_link_hash_lookup (info->info->hash, buf, FALSE, FALSE, TRUE);
+ if (!h || (h->type != bfd_link_hash_defined
+ && h->type != bfd_link_hash_defweak))
+ {
+ _bfd_error_handler (_("%B:%A: table %s missing corresponding %s"),
+ abfd, sec, name, buf);
+ return TRUE;
+ }
+
+ if (h->u.def.section != ent->u.def.section)
+ {
+ _bfd_error_handler (_("%B:%A: %s and %s must be in the same input section"),
+ h->u.def.section->owner, h->u.def.section,
+ name, buf);
+ return TRUE;
+ }
+
+ end_addr = h->u.def.value;
+
+ sprintf (buf, "$tableentry$default$%s", tname);
+ h = bfd_link_hash_lookup (info->info->hash, buf, FALSE, FALSE, TRUE);
+ if (h && (h->type == bfd_link_hash_defined
+ || h->type == bfd_link_hash_defweak))
+ {
+ h->u.def.section->flags |= SEC_KEEP;
+ }
+
+ for (idx = 0; idx < (int) (end_addr - start_addr) / 4; idx ++)
+ {
+ sprintf (buf, "$tableentry$%d$%s", idx, tname);
+ h = bfd_link_hash_lookup (info->info->hash, buf, FALSE, FALSE, TRUE);
+ if (h && (h->type == bfd_link_hash_defined
+ || h->type == bfd_link_hash_defweak))
+ {
+ h->u.def.section->flags |= SEC_KEEP;
+ }
+ }
+
+ /* Return TRUE to keep scanning, FALSE to end the traversal. */
+ return TRUE;
+}
+
+/* We need to check for table entry symbols and build the tables, and
+ we need to do it before the linker does garbage collection. This function is
+ called once per input object file. */
+static bfd_boolean
+rx_check_directives
+ (bfd * abfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info * info ATTRIBUTE_UNUSED)
+{
+ RX_Table_Info stuff;
+
+ stuff.abfd = abfd;
+ stuff.info = info;
+ bfd_hash_traverse (&(info->hash->table), rx_table_find, &stuff);
+
+ return TRUE;
+}
+
+
+static bfd_boolean
+rx_table_map_2 (struct bfd_hash_entry *vent, void *vinfo)
+{
+ RX_Table_Info *info = (RX_Table_Info *)vinfo;
+ struct bfd_link_hash_entry *ent = (struct bfd_link_hash_entry *)vent;
+ int idx;
+ const char *name;
+ bfd_vma addr;
+
+ /* See if the symbol ENT has an address listed in the table, and
+ isn't a debug/special symbol. If so, put it in the table. */
+
+ if (ent->type != bfd_link_hash_defined
+ && ent->type != bfd_link_hash_defweak)
+ return TRUE;
+
+ name = ent->root.string;
+
+ if (name[0] == '$' || name[0] == '.' || name[0] < ' ')
+ return TRUE;
+
+ addr = (ent->u.def.value
+ + ent->u.def.section->output_section->vma
+ + ent->u.def.section->output_offset);
+
+ for (idx = 0; idx < info->table_size; idx ++)
+ if (addr == info->table_handlers[idx])
+ info->table_entries[idx] = ent;
+
+ if (addr == info->table_default_handler)
+ info->table_default_entry = ent;
+
+ return TRUE;
+}
+
+static bfd_boolean
+rx_table_map (struct bfd_hash_entry *vent, void *vinfo)
+{
+ RX_Table_Info *info = (RX_Table_Info *)vinfo;
+ struct bfd_link_hash_entry *ent = (struct bfd_link_hash_entry *)vent;
+ const char *name; /* of the symbol we've found */
+ int idx;
+ const char *tname; /* name of the table */
+ bfd_vma start_addr, end_addr;
+ char *buf;
+ struct bfd_link_hash_entry * h;
+ int need_elipses;
+
+ /* We're looking for globally defined symbols of the form
+ $tablestart$<NAME>. */
+ if (ent->type != bfd_link_hash_defined
+ && ent->type != bfd_link_hash_defweak)
+ return TRUE;
+
+ name = ent->root.string;
+
+ if (strncmp (name, "$tablestart$", 12))
+ return TRUE;
+
+ tname = name + 12;
+ start_addr = (ent->u.def.value
+ + ent->u.def.section->output_section->vma
+ + ent->u.def.section->output_offset);
+
+ buf = (char *) malloc (12 + 10 + strlen (tname));
+
+ sprintf (buf, "$tableend$%s", tname);
+ end_addr = get_symbol_value_maybe (buf, info->info);
+
+ sprintf (buf, "$tableentry$default$%s", tname);
+ h = bfd_link_hash_lookup (info->info->hash, buf, FALSE, FALSE, TRUE);
+ if (h)
+ {
+ info->table_default_handler = (h->u.def.value
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
+ }
+ else
+ /* Zero is a valid handler address! */
+ info->table_default_handler = (bfd_vma) (-1);
+ info->table_default_entry = NULL;
+
+ info->table_start = start_addr;
+ info->table_size = (int) (end_addr - start_addr) / 4;
+ info->table_handlers = (bfd_vma *) malloc (info->table_size * sizeof (bfd_vma));
+ info->table_entries = (struct bfd_link_hash_entry **) malloc (info->table_size * sizeof (struct bfd_link_hash_entry));
+
+ for (idx = 0; idx < (int) (end_addr - start_addr) / 4; idx ++)
+ {
+ sprintf (buf, "$tableentry$%d$%s", idx, tname);
+ h = bfd_link_hash_lookup (info->info->hash, buf, FALSE, FALSE, TRUE);
+ if (h && (h->type == bfd_link_hash_defined
+ || h->type == bfd_link_hash_defweak))
+ {
+ info->table_handlers[idx] = (h->u.def.value
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
+ }
+ else
+ info->table_handlers[idx] = info->table_default_handler;
+ info->table_entries[idx] = NULL;
+ }
+
+ free (buf);
+
+ bfd_hash_traverse (&(info->info->hash->table), rx_table_map_2, info);
+
+ fprintf (info->mapfile, "\nRX Vector Table: %s has %d entries at 0x%08" BFD_VMA_FMT "x\n\n",
+ tname, info->table_size, start_addr);
+
+ if (info->table_default_entry)
+ fprintf (info->mapfile, " default handler is: %s at 0x%08" BFD_VMA_FMT "x\n",
+ info->table_default_entry->root.string,
+ info->table_default_handler);
+ else if (info->table_default_handler != (bfd_vma)(-1))
+ fprintf (info->mapfile, " default handler is at 0x%08" BFD_VMA_FMT "x\n",
+ info->table_default_handler);
+ else
+ fprintf (info->mapfile, " no default handler\n");
+
+ need_elipses = 1;
+ for (idx = 0; idx < info->table_size; idx ++)
+ {
+ if (info->table_handlers[idx] == info->table_default_handler)
+ {
+ if (need_elipses)
+ fprintf (info->mapfile, " . . .\n");
+ need_elipses = 0;
+ continue;
+ }
+ need_elipses = 1;
+
+ fprintf (info->mapfile, " 0x%08" BFD_VMA_FMT "x [%3d] ", start_addr + 4 * idx, idx);
+
+ if (info->table_handlers[idx] == (bfd_vma) (-1))
+ fprintf (info->mapfile, "(no handler found)\n");
+
+ else if (info->table_handlers[idx] == info->table_default_handler)
+ {
+ if (info->table_default_entry)
+ fprintf (info->mapfile, "(default)\n");
+ else
+ fprintf (info->mapfile, "(default)\n");
+ }
+
+ else if (info->table_entries[idx])
+ {
+ fprintf (info->mapfile, "0x%08" BFD_VMA_FMT "x %s\n", info->table_handlers[idx], info->table_entries[idx]->root.string);
+ }
+
+ else
+ {
+ fprintf (info->mapfile, "0x%08" BFD_VMA_FMT "x ???\n", info->table_handlers[idx]);
+ }
+ }
+ if (need_elipses)
+ fprintf (info->mapfile, " . . .\n");
+
+ return TRUE;
+}
+
+void
+rx_additional_link_map_text (bfd *obfd, struct bfd_link_info *info, FILE *mapfile)
+{
+ /* We scan the symbol table looking for $tableentry$'s, and for
+ each, try to deduce which handlers go with which entries. */
+
+ RX_Table_Info stuff;
+
+ stuff.abfd = obfd;
+ stuff.info = info;
+ stuff.mapfile = mapfile;
+ bfd_hash_traverse (&(info->hash->table), rx_table_map, &stuff);
+}
+
+
#define ELF_ARCH bfd_arch_rx
#define ELF_MACHINE_CODE EM_RX
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM bfd_elf32_rx_be_vec
+#define TARGET_BIG_SYM rx_elf32_be_vec
#define TARGET_BIG_NAME "elf32-rx-be"
-#define TARGET_LITTLE_SYM bfd_elf32_rx_le_vec
+#define TARGET_LITTLE_SYM rx_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-rx-le"
#define elf_info_to_howto_rel NULL
@@ -3572,6 +3964,7 @@ static const struct bfd_elf_special_section elf32_rx_special_sections[] =
#define bfd_elf32_bfd_final_link rx_final_link
#define bfd_elf32_bfd_relax_section elf32_rx_relax_section_wrapper
#define elf_backend_special_sections elf32_rx_special_sections
+#define elf_backend_check_directives rx_check_directives
#include "elf32-target.h"
@@ -3580,7 +3973,7 @@ static const struct bfd_elf_special_section elf32_rx_special_sections[] =
pre-swapped .text sections (like objcopy). */
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_rx_be_ns_vec
+#define TARGET_BIG_SYM rx_elf32_be_ns_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-rx-be-ns"
#undef TARGET_LITTLE_SYM
diff --git a/binutils-2.25/bfd/elf32-rx.h b/binutils-2.25/bfd/elf32-rx.h
new file mode 100644
index 00000000..37793883
--- /dev/null
+++ b/binutils-2.25/bfd/elf32-rx.h
@@ -0,0 +1,21 @@
+/* Renesas RX specific support for 32-bit ELF.
+ Copyright (C) 2014 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ 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 3 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. */
+
+
+void rx_additional_link_map_text (bfd *obfd, struct bfd_link_info *info, FILE *mapfile);
diff --git a/binutils-2.25/bfd/elf32-s390.c b/binutils-2.25/bfd/elf32-s390.c
index 6467b032..ebcb028b 100644
--- a/binutils-2.25/bfd/elf32-s390.c
+++ b/binutils-2.25/bfd/elf32-s390.c
@@ -1,6 +1,5 @@
/* IBM S/390-specific support for 32-bit ELF
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
Contributed by Carl B. Pedersen and Martin Schwidefsky.
This file is part of BFD, the Binary File Descriptor library.
@@ -1251,6 +1250,12 @@ elf_s390_check_relocs (bfd *abfd,
/* Fall through. */
case R_390_TLS_LE32:
+ /* For static linking and executables this reloc will be
+ calculated at linktime otherwise a TLS_TPOFF runtime
+ reloc will be generated. */
+ if (r_type == R_390_TLS_LE32 && info->pie)
+ break;
+
if (!info->shared)
break;
info->flags |= DF_STATIC_TLS;
@@ -2046,7 +2051,7 @@ elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -2415,11 +2420,12 @@ elf_s390_relocate_section (bfd *output_bfd,
else
{
bfd_boolean warned ATTRIBUTE_UNUSED;
+ bfd_boolean ignored ATTRIBUTE_UNUSED;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -3104,7 +3110,7 @@ elf_s390_relocate_section (bfd *output_bfd,
break;
case R_390_TLS_LE32:
- if (info->shared)
+ if (info->shared && !info->pie)
{
/* Linking a shared library with non-fpic code requires
a R_390_TLS_TPOFF relocation. */
@@ -3903,7 +3909,7 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd,
->this_hdr.sh_entsize = 4;
}
/* Finish dynamic symbol for local IFUNC symbols. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
struct plt_entry *local_plt;
Elf_Internal_Sym *isym;
@@ -3982,7 +3988,7 @@ elf32_s390_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
}
-#define TARGET_BIG_SYM bfd_elf32_s390_vec
+#define TARGET_BIG_SYM s390_elf32_vec
#define TARGET_BIG_NAME "elf32-s390"
#define ELF_ARCH bfd_arch_s390
#define ELF_TARGET_ID S390_ELF_DATA
diff --git a/binutils-2.25/bfd/elf32-score.c b/binutils-2.25/bfd/elf32-score.c
index 47cc9873..1ab54cd2 100644
--- a/binutils-2.25/bfd/elf32-score.c
+++ b/binutils-2.25/bfd/elf32-score.c
@@ -1,6 +1,5 @@
/* 32-bit ELF support for S+core.
- Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
Contributed by
Brain.lin (brain.lin@sunplusct.com)
Mei Ligang (ligang@sunnorth.com.cn)
@@ -2605,6 +2604,12 @@ s3_bfd_score_elf_relocate_section (bfd *output_bfd,
/* For global symbols we look up the symbol in the hash-table. */
h = ((struct score_elf_link_hash_entry *)
elf_sym_hashes (input_bfd) [r_symndx - extsymoff]);
+
+ if (info->wrap_hash != NULL
+ && (input_section->flags & SEC_DEBUGGING) != 0)
+ h = ((struct score_elf_link_hash_entry *)
+ unwrap_hash_lookup (info, input_bfd, &h->root.root));
+
/* Find the real hash-table entry for this symbol. */
while (h->root.root.type == bfd_link_hash_indirect
|| h->root.root.type == bfd_link_hash_warning)
@@ -3194,7 +3199,7 @@ s3_bfd_score_elf_always_size_sections (bfd *output_bfd,
/* Calculate the total loadable size of the output. That will give us the
maximum number of GOT_PAGE entries required. */
- for (sub = info->input_bfds; sub; sub = sub->link_next)
+ for (sub = info->input_bfds; sub; sub = sub->link.next)
{
asection *subsection;
@@ -4447,9 +4452,9 @@ _bfd_score_elf_common_definition (Elf_Internal_Sym *sym)
#define USE_REL 1
-#define TARGET_LITTLE_SYM bfd_elf32_littlescore_vec
+#define TARGET_LITTLE_SYM score_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-littlescore"
-#define TARGET_BIG_SYM bfd_elf32_bigscore_vec
+#define TARGET_BIG_SYM score_elf32_be_vec
#define TARGET_BIG_NAME "elf32-bigscore"
#define ELF_ARCH bfd_arch_score
#define ELF_MACHINE_CODE EM_SCORE
diff --git a/binutils-2.25/bfd/elf32-score.h b/binutils-2.25/bfd/elf32-score.h
index f3156034..f71436d5 100644
--- a/binutils-2.25/bfd/elf32-score.h
+++ b/binutils-2.25/bfd/elf32-score.h
@@ -1,5 +1,5 @@
/* 32-bit ELF support for S+core.
- Copyright 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
Contributed by
Brain.lin (brain.lin@sunplusct.com)
Mei Ligang (ligang@sunnorth.com.cn)
diff --git a/binutils-2.25/bfd/elf32-score7.c b/binutils-2.25/bfd/elf32-score7.c
index c75c7038..0b3cf202 100644
--- a/binutils-2.25/bfd/elf32-score7.c
+++ b/binutils-2.25/bfd/elf32-score7.c
@@ -1,5 +1,5 @@
/* 32-bit ELF support for S+core.
- Copyright 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
Contributed by
Brain.lin (brain.lin@sunplusct.com)
Mei Ligang (ligang@sunnorth.com.cn)
@@ -2376,6 +2376,12 @@ s7_bfd_score_elf_relocate_section (bfd *output_bfd,
/* For global symbols we look up the symbol in the hash-table. */
h = ((struct score_elf_link_hash_entry *)
elf_sym_hashes (input_bfd) [r_symndx - extsymoff]);
+
+ if (info->wrap_hash != NULL
+ && (input_section->flags & SEC_DEBUGGING) != 0)
+ h = ((struct score_elf_link_hash_entry *)
+ unwrap_hash_lookup (info, input_bfd, &h->root.root));
+
/* Find the real hash-table entry for this symbol. */
while (h->root.root.type == bfd_link_hash_indirect
|| h->root.root.type == bfd_link_hash_warning)
@@ -3000,7 +3006,7 @@ s7_bfd_score_elf_always_size_sections (bfd *output_bfd,
/* Calculate the total loadable size of the output. That will give us the
maximum number of GOT_PAGE entries required. */
- for (sub = info->input_bfds; sub; sub = sub->link_next)
+ for (sub = info->input_bfds; sub; sub = sub->link.next)
{
asection *subsection;
diff --git a/binutils-2.25/bfd/elf32-sh-relocs.h b/binutils-2.25/bfd/elf32-sh-relocs.h
index 05f08756..fb54c9a6 100644
--- a/binutils-2.25/bfd/elf32-sh-relocs.h
+++ b/binutils-2.25/bfd/elf32-sh-relocs.h
@@ -1,4 +1,4 @@
-/* Copyright 2006, 2007, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf32-sh-symbian.c b/binutils-2.25/bfd/elf32-sh-symbian.c
index 85c26f35..5239de31 100644
--- a/binutils-2.25/bfd/elf32-sh-symbian.c
+++ b/binutils-2.25/bfd/elf32-sh-symbian.c
@@ -1,6 +1,5 @@
/* Renesas / SuperH specific support for Symbian 32-bit ELF files
- Copyright 2004, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright (C) 2004-2014 Free Software Foundation, Inc.
Contributed by Red Hat
This file is part of BFD, the Binary File Descriptor library.
@@ -602,7 +601,7 @@ sh_symbian_relocate_section (bfd * output_bfd,
contents, relocs, local_syms, local_sections);
}
-#define TARGET_LITTLE_SYM bfd_elf32_shl_symbian_vec
+#define TARGET_LITTLE_SYM sh_elf32_symbian_le_vec
#define TARGET_LITTLE_NAME "elf32-shl-symbian"
#undef elf_backend_relocate_section
diff --git a/binutils-2.25/bfd/elf32-sh.c b/binutils-2.25/bfd/elf32-sh.c
index 86fe1b33..44a3aa78 100644
--- a/binutils-2.25/bfd/elf32-sh.c
+++ b/binutils-2.25/bfd/elf32-sh.c
@@ -1,7 +1,5 @@
/* Renesas / SuperH SH specific support for 32-bit ELF
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Contributed by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -90,11 +88,11 @@ static bfd_boolean
vxworks_object_p (bfd *abfd ATTRIBUTE_UNUSED)
{
#if !defined INCLUDE_SHMEDIA && !defined SH_TARGET_ALREADY_DEFINED
- extern const bfd_target bfd_elf32_shlvxworks_vec;
- extern const bfd_target bfd_elf32_shvxworks_vec;
+ extern const bfd_target sh_elf32_vxworks_le_vec;
+ extern const bfd_target sh_elf32_vxworks_vec;
- return (abfd->xvec == &bfd_elf32_shlvxworks_vec
- || abfd->xvec == &bfd_elf32_shvxworks_vec);
+ return (abfd->xvec == &sh_elf32_vxworks_le_vec
+ || abfd->xvec == &sh_elf32_vxworks_vec);
#else
return FALSE;
#endif
@@ -106,11 +104,11 @@ static bfd_boolean
fdpic_object_p (bfd *abfd ATTRIBUTE_UNUSED)
{
#if !defined INCLUDE_SHMEDIA && !defined SH_TARGET_ALREADY_DEFINED
- extern const bfd_target bfd_elf32_shfd_vec;
- extern const bfd_target bfd_elf32_shbfd_vec;
+ extern const bfd_target sh_elf32_fdpic_le_vec;
+ extern const bfd_target sh_elf32_fdpic_be_vec;
- return (abfd->xvec == &bfd_elf32_shfd_vec
- || abfd->xvec == &bfd_elf32_shbfd_vec);
+ return (abfd->xvec == &sh_elf32_fdpic_le_vec
+ || abfd->xvec == &sh_elf32_fdpic_be_vec);
#else
return FALSE;
#endif
@@ -704,10 +702,10 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
elf_section_data (sec)->this_hdr.contents = contents;
symtab_hdr->contents = (unsigned char *) isymbuf;
- /* Replace the jsr with a bsr. */
+ /* Replace the jmp/jsr with a bra/bsr. */
/* Change the R_SH_USES reloc into an R_SH_IND12W reloc, and
- replace the jsr with a bsr. */
+ replace the jmp/jsr with a bra/bsr. */
irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irelfn->r_info), R_SH_IND12W);
/* We used to test (ELF32_R_SYM (irelfn->r_info) < symtab_hdr->sh_info)
here, but that only checks if the symbol is an external symbol,
@@ -718,7 +716,10 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
/* We can't fully resolve this yet, because the external
symbol value may be changed by future relaxing. We let
the final link phase handle it. */
- bfd_put_16 (abfd, (bfd_vma) 0xb000, contents + irel->r_offset);
+ if (bfd_get_16 (abfd, contents + irel->r_offset) & 0x0020)
+ bfd_put_16 (abfd, (bfd_vma) 0xa000, contents + irel->r_offset);
+ else
+ bfd_put_16 (abfd, (bfd_vma) 0xb000, contents + irel->r_offset);
irel->r_addend = -4;
@@ -3343,7 +3344,7 @@ sh_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -3678,7 +3679,9 @@ sh_elf_osec_to_segment (bfd *output_bfd, asection *osec)
{
Elf_Internal_Phdr *p = NULL;
- if (output_bfd->xvec->flavour == bfd_target_elf_flavour)
+ if (output_bfd->xvec->flavour == bfd_target_elf_flavour
+ /* PR ld/17110: Do not look for output segments in an input bfd. */
+ && output_bfd->direction != read_direction)
p = _bfd_elf_find_segment_containing_section (output_bfd, osec);
/* FIXME: Nothing ever says what this index is relative to. The kernel
@@ -6582,34 +6585,19 @@ sh_elf_get_flags_from_mach (unsigned long mach)
}
#endif /* not sh_elf_set_mach_from_flags */
-#ifndef sh_elf_set_private_flags
-/* Function to keep SH specific file flags. */
-
-static bfd_boolean
-sh_elf_set_private_flags (bfd *abfd, flagword flags)
-{
- BFD_ASSERT (! elf_flags_init (abfd)
- || elf_elfheader (abfd)->e_flags == flags);
-
- elf_elfheader (abfd)->e_flags = flags;
- elf_flags_init (abfd) = TRUE;
- return sh_elf_set_mach_from_flags (abfd);
-}
-#endif /* not sh_elf_set_private_flags */
-
#ifndef sh_elf_copy_private_data
/* Copy backend specific data from one object module to another */
static bfd_boolean
sh_elf_copy_private_data (bfd * ibfd, bfd * obfd)
{
- /* Copy object attributes. */
- _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
if (! is_sh_elf (ibfd) || ! is_sh_elf (obfd))
return TRUE;
- return sh_elf_set_private_flags (obfd, elf_elfheader (ibfd)->e_flags);
+ if (! _bfd_elf_copy_private_bfd_data (ibfd, obfd))
+ return FALSE;
+
+ return sh_elf_set_mach_from_flags (obfd);
}
#endif /* not sh_elf_copy_private_data */
@@ -7420,9 +7408,9 @@ sh_elf_encode_eh_address (bfd *abfd,
}
#if !defined SH_TARGET_ALREADY_DEFINED
-#define TARGET_BIG_SYM bfd_elf32_sh_vec
+#define TARGET_BIG_SYM sh_elf32_vec
#define TARGET_BIG_NAME "elf32-sh"
-#define TARGET_LITTLE_SYM bfd_elf32_shl_vec
+#define TARGET_LITTLE_SYM sh_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-shl"
#endif
@@ -7447,8 +7435,6 @@ sh_elf_encode_eh_address (bfd *abfd,
sh_elf_get_relocated_section_contents
#define bfd_elf32_mkobject sh_elf_mkobject
#define elf_backend_object_p sh_elf_object_p
-#define bfd_elf32_bfd_set_private_bfd_flags \
- sh_elf_set_private_flags
#define bfd_elf32_bfd_copy_private_bfd_data \
sh_elf_copy_private_data
#define bfd_elf32_bfd_merge_private_bfd_data \
@@ -7497,11 +7483,11 @@ sh_elf_encode_eh_address (bfd *abfd,
/* NetBSD support. */
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_shnbsd_vec
+#define TARGET_BIG_SYM sh_elf32_nbsd_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-sh-nbsd"
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_shlnbsd_vec
+#define TARGET_LITTLE_SYM sh_elf32_nbsd_le_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-shl-nbsd"
#undef ELF_MAXPAGESIZE
@@ -7517,11 +7503,11 @@ sh_elf_encode_eh_address (bfd *abfd,
/* Linux support. */
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_shblin_vec
+#define TARGET_BIG_SYM sh_elf32_linux_be_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-shbig-linux"
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_shlin_vec
+#define TARGET_LITTLE_SYM sh_elf32_linux_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-sh-linux"
#undef ELF_COMMONPAGESIZE
@@ -7539,11 +7525,11 @@ sh_elf_encode_eh_address (bfd *abfd,
/* FDPIC support. */
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_shbfd_vec
+#define TARGET_BIG_SYM sh_elf32_fdpic_be_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-shbig-fdpic"
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_shfd_vec
+#define TARGET_LITTLE_SYM sh_elf32_fdpic_le_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-sh-fdpic"
@@ -7556,11 +7542,11 @@ sh_elf_encode_eh_address (bfd *abfd,
/* VxWorks support. */
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_shvxworks_vec
+#define TARGET_BIG_SYM sh_elf32_vxworks_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-sh-vxworks"
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_shlvxworks_vec
+#define TARGET_LITTLE_SYM sh_elf32_vxworks_le_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-shl-vxworks"
#undef elf32_bed
diff --git a/binutils-2.25/bfd/elf32-sh64-com.c b/binutils-2.25/bfd/elf32-sh64-com.c
index a4aa1be6..50005061 100644
--- a/binutils-2.25/bfd/elf32-sh64-com.c
+++ b/binutils-2.25/bfd/elf32-sh64-com.c
@@ -1,6 +1,5 @@
/* SuperH SH64-specific support for 32-bit ELF
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf32-sh64.c b/binutils-2.25/bfd/elf32-sh64.c
index 2848f19b..9042081b 100644
--- a/binutils-2.25/bfd/elf32-sh64.c
+++ b/binutils-2.25/bfd/elf32-sh64.c
@@ -1,6 +1,5 @@
/* SuperH SH64-specific support for 32-bit ELF
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
- Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -199,7 +198,8 @@ sh64_elf_copy_private_data (bfd * ibfd, bfd * obfd)
== elf_elfheader (ibfd)->e_flags));
elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
- return TRUE;
+
+ return _bfd_elf_copy_private_bfd_data (ibfd, obfd);
}
static bfd_boolean
@@ -766,11 +766,11 @@ static const struct bfd_elf_special_section sh64_elf_special_sections[] =
};
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_sh64_vec
+#define TARGET_BIG_SYM sh64_elf32_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-sh64"
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_sh64l_vec
+#define TARGET_LITTLE_SYM sh64_elf32_le_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-sh64l"
@@ -778,11 +778,11 @@ static const struct bfd_elf_special_section sh64_elf_special_sections[] =
/* NetBSD support. */
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_sh64nbsd_vec
+#define TARGET_BIG_SYM sh64_elf32_nbsd_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-sh64-nbsd"
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_sh64lnbsd_vec
+#define TARGET_LITTLE_SYM sh64_elf32_nbsd_le_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-sh64l-nbsd"
#undef ELF_MAXPAGESIZE
@@ -797,11 +797,11 @@ static const struct bfd_elf_special_section sh64_elf_special_sections[] =
/* Linux support. */
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_sh64blin_vec
+#define TARGET_BIG_SYM sh64_elf32_linux_be_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-sh64big-linux"
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_sh64lin_vec
+#define TARGET_LITTLE_SYM sh64_elf32_linux_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-sh64-linux"
#undef elf32_bed
diff --git a/binutils-2.25/bfd/elf32-sh64.h b/binutils-2.25/bfd/elf32-sh64.h
index fa5f3538..4aee0c5f 100644
--- a/binutils-2.25/bfd/elf32-sh64.h
+++ b/binutils-2.25/bfd/elf32-sh64.h
@@ -1,5 +1,5 @@
/* SH ELF support for BFD.
- Copyright 2003, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf32-sparc.c b/binutils-2.25/bfd/elf32-sparc.c
index 52abfd43..b2a1f0fc 100644
--- a/binutils-2.25/bfd/elf32-sparc.c
+++ b/binutils-2.25/bfd/elf32-sparc.c
@@ -1,7 +1,5 @@
/* SPARC-specific support for 32-bit ELF
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -175,21 +173,22 @@ elf32_sparc_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
static bfd_boolean
elf32_sparc_add_symbol_hook (bfd * abfd,
- struct bfd_link_info * info ATTRIBUTE_UNUSED,
+ struct bfd_link_info * info,
Elf_Internal_Sym * sym,
const char ** namep ATTRIBUTE_UNUSED,
flagword * flagsp ATTRIBUTE_UNUSED,
asection ** secp ATTRIBUTE_UNUSED,
bfd_vma * valp ATTRIBUTE_UNUSED)
{
- if ((abfd->flags & DYNAMIC) == 0
- && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
- || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE))
+ if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
+ || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)
+ && (abfd->flags & DYNAMIC) == 0
+ && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
return TRUE;
}
-#define TARGET_BIG_SYM bfd_elf32_sparc_vec
+#define TARGET_BIG_SYM sparc_elf32_vec
#define TARGET_BIG_NAME "elf32-sparc"
#define ELF_ARCH bfd_arch_sparc
#define ELF_TARGET_ID SPARC_ELF_DATA
@@ -211,8 +210,6 @@ elf32_sparc_add_symbol_hook (bfd * abfd,
_bfd_sparc_elf_reloc_name_lookup
#define bfd_elf32_bfd_link_hash_table_create \
_bfd_sparc_elf_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free \
- _bfd_sparc_elf_link_hash_table_free
#define bfd_elf32_bfd_relax_section _bfd_sparc_elf_relax_section
#define bfd_elf32_new_section_hook _bfd_sparc_elf_new_section_hook
#define elf_backend_copy_indirect_symbol \
@@ -245,7 +242,6 @@ elf32_sparc_add_symbol_hook (bfd * abfd,
#define elf_backend_got_header_size 4
#define elf_backend_rela_normal 1
-#define elf_backend_post_process_headers _bfd_elf_set_osabi
#define elf_backend_add_symbol_hook elf32_sparc_add_symbol_hook
#include "elf32-target.h"
@@ -253,7 +249,7 @@ elf32_sparc_add_symbol_hook (bfd * abfd,
/* Solaris 2. */
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_sparc_sol2_vec
+#define TARGET_BIG_SYM sparc_elf32_sol2_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-sparc-sol2"
@@ -297,7 +293,7 @@ elf32_sparc_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
}
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_sparc_vxworks_vec
+#define TARGET_BIG_SYM sparc_elf32_vxworks_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-sparc-vxworks"
diff --git a/binutils-2.25/bfd/elf32-spu.c b/binutils-2.25/bfd/elf32-spu.c
index 86fb33cf..13806ad1 100644
--- a/binutils-2.25/bfd/elf32-spu.c
+++ b/binutils-2.25/bfd/elf32-spu.c
@@ -1,6 +1,6 @@
/* SPU specific support for 32-bit ELF
- Copyright 2006-2013 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -555,7 +555,7 @@ spu_elf_create_sections (struct bfd_link_info *info)
struct spu_link_hash_table *htab = spu_hash_table (info);
bfd *ibfd;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
if (bfd_get_section_by_name (ibfd, SPU_PTNOTE_SPUNAME) != NULL)
break;
@@ -1520,14 +1520,14 @@ process_stubs (struct bfd_link_info *info, bfd_boolean build)
struct spu_link_hash_table *htab = spu_hash_table (info);
bfd *ibfd;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
- extern const bfd_target bfd_elf32_spu_vec;
+ extern const bfd_target spu_elf32_vec;
Elf_Internal_Shdr *symtab_hdr;
asection *isec;
Elf_Internal_Sym *local_syms = NULL;
- if (ibfd->xvec != &bfd_elf32_spu_vec)
+ if (ibfd->xvec != &spu_elf32_vec)
continue;
/* We'll need the symbol table in a second. */
@@ -2936,7 +2936,7 @@ discover_functions (struct bfd_link_info *info)
bfd_boolean gaps = FALSE;
bfd_idx = 0;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
bfd_idx++;
psym_arr = bfd_zmalloc (bfd_idx * sizeof (*psym_arr));
@@ -2948,16 +2948,16 @@ discover_functions (struct bfd_link_info *info)
for (ibfd = info->input_bfds, bfd_idx = 0;
ibfd != NULL;
- ibfd = ibfd->link_next, bfd_idx++)
+ ibfd = ibfd->link.next, bfd_idx++)
{
- extern const bfd_target bfd_elf32_spu_vec;
+ extern const bfd_target spu_elf32_vec;
Elf_Internal_Shdr *symtab_hdr;
asection *sec;
size_t symcount;
Elf_Internal_Sym *syms, *sy, **psyms, **psy;
asection **psecs, **p;
- if (ibfd->xvec != &bfd_elf32_spu_vec)
+ if (ibfd->xvec != &spu_elf32_vec)
continue;
/* Read all the symbols. */
@@ -3056,7 +3056,7 @@ discover_functions (struct bfd_link_info *info)
relocations. */
for (ibfd = info->input_bfds, bfd_idx = 0;
ibfd != NULL;
- ibfd = ibfd->link_next, bfd_idx++)
+ ibfd = ibfd->link.next, bfd_idx++)
{
asection *sec;
@@ -3070,7 +3070,7 @@ discover_functions (struct bfd_link_info *info)
for (ibfd = info->input_bfds, bfd_idx = 0;
ibfd != NULL;
- ibfd = ibfd->link_next, bfd_idx++)
+ ibfd = ibfd->link.next, bfd_idx++)
{
Elf_Internal_Shdr *symtab_hdr;
asection *sec;
@@ -3109,12 +3109,12 @@ discover_functions (struct bfd_link_info *info)
}
}
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
- extern const bfd_target bfd_elf32_spu_vec;
+ extern const bfd_target spu_elf32_vec;
asection *sec;
- if (ibfd->xvec != &bfd_elf32_spu_vec)
+ if (ibfd->xvec != &spu_elf32_vec)
continue;
/* Some of the symbols we've installed as marking the
@@ -3152,7 +3152,7 @@ discover_functions (struct bfd_link_info *info)
for (ibfd = info->input_bfds, bfd_idx = 0;
ibfd != NULL;
- ibfd = ibfd->link_next, bfd_idx++)
+ ibfd = ibfd->link.next, bfd_idx++)
{
if (psym_arr[bfd_idx] == NULL)
continue;
@@ -3181,12 +3181,12 @@ for_each_node (bfd_boolean (*doit) (struct function_info *,
{
bfd *ibfd;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
- extern const bfd_target bfd_elf32_spu_vec;
+ extern const bfd_target spu_elf32_vec;
asection *sec;
- if (ibfd->xvec != &bfd_elf32_spu_vec)
+ if (ibfd->xvec != &spu_elf32_vec)
continue;
for (sec = ibfd->sections; sec != NULL; sec = sec->next)
@@ -3330,12 +3330,12 @@ build_call_tree (struct bfd_link_info *info)
bfd *ibfd;
unsigned int depth;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
- extern const bfd_target bfd_elf32_spu_vec;
+ extern const bfd_target spu_elf32_vec;
asection *sec;
- if (ibfd->xvec != &bfd_elf32_spu_vec)
+ if (ibfd->xvec != &spu_elf32_vec)
continue;
for (sec = ibfd->sections; sec != NULL; sec = sec->next)
@@ -3707,12 +3707,12 @@ auto_ovl_lib_functions (struct bfd_link_info *info, unsigned int lib_size)
memset (&dummy_caller, 0, sizeof (dummy_caller));
lib_count = 0;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
- extern const bfd_target bfd_elf32_spu_vec;
+ extern const bfd_target spu_elf32_vec;
asection *sec;
- if (ibfd->xvec != &bfd_elf32_spu_vec)
+ if (ibfd->xvec != &spu_elf32_vec)
continue;
for (sec = ibfd->sections; sec != NULL; sec = sec->next)
@@ -4252,7 +4252,7 @@ spu_elf_auto_overlay (struct bfd_link_info *info)
goto err_exit;
bfd_count = 0;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
++bfd_count;
bfd_arr = bfd_malloc (bfd_count * sizeof (*bfd_arr));
if (bfd_arr == NULL)
@@ -4262,13 +4262,13 @@ spu_elf_auto_overlay (struct bfd_link_info *info)
count = 0;
bfd_count = 0;
total_overlay_size = 0;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
- extern const bfd_target bfd_elf32_spu_vec;
+ extern const bfd_target spu_elf32_vec;
asection *sec;
unsigned int old_count;
- if (ibfd->xvec != &bfd_elf32_spu_vec)
+ if (ibfd->xvec != &spu_elf32_vec)
continue;
old_count = count;
@@ -4850,6 +4850,11 @@ spu_elf_relocate_section (bfd *output_bfd,
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ if (info->wrap_hash != NULL
+ && (input_section->flags & SEC_DEBUGGING) != 0)
+ h = ((struct elf_link_hash_entry *)
+ unwrap_hash_lookup (info, input_bfd, &h->root));
+
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
@@ -5146,8 +5151,7 @@ spu_elf_plugin (int val)
/* Set ELF header e_type for plugins. */
static void
-spu_elf_post_process_headers (bfd *abfd,
- struct bfd_link_info *info ATTRIBUTE_UNUSED)
+spu_elf_post_process_headers (bfd *abfd, struct bfd_link_info *info)
{
if (spu_plugin)
{
@@ -5155,6 +5159,8 @@ spu_elf_post_process_headers (bfd *abfd,
i_ehdrp->e_type = ET_DYN;
}
+
+ _bfd_elf_post_process_headers (abfd, info);
}
/* We may add an extra PT_LOAD segment for .toe. We also need extra
@@ -5389,7 +5395,7 @@ spu_elf_size_sections (bfd * output_bfd, struct bfd_link_info *info)
bfd *ibfd;
size_t size;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
asection *isec;
@@ -5445,7 +5451,7 @@ spu_elf_size_sections (bfd * output_bfd, struct bfd_link_info *info)
return TRUE;
}
-#define TARGET_BIG_SYM bfd_elf32_spu_vec
+#define TARGET_BIG_SYM spu_elf32_vec
#define TARGET_BIG_NAME "elf32-spu"
#define ELF_ARCH bfd_arch_spu
#define ELF_TARGET_ID SPU_ELF_DATA
diff --git a/binutils-2.25/bfd/elf32-spu.h b/binutils-2.25/bfd/elf32-spu.h
index a31c76ec..2330e139 100644
--- a/binutils-2.25/bfd/elf32-spu.h
+++ b/binutils-2.25/bfd/elf32-spu.h
@@ -1,6 +1,6 @@
/* SPU specific support for 32-bit ELF.
- Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf32-tic6x.c b/binutils-2.25/bfd/elf32-tic6x.c
index 7ac6325f..8381cfa7 100644
--- a/binutils-2.25/bfd/elf32-tic6x.c
+++ b/binutils-2.25/bfd/elf32-tic6x.c
@@ -1,5 +1,5 @@
/* 32-bit ELF support for TI C6X
- Copyright 2010-2013 Free Software Foundation, Inc.
+ Copyright (C) 2010-2014 Free Software Foundation, Inc.
Contributed by Joseph Myers <joseph@codesourcery.com>
Bernd Schmidt <bernds@codesourcery.com>
@@ -1919,7 +1919,7 @@ elf32_tic6x_gc_mark_extra_sections (struct bfd_link_info *info,
while (again)
{
again = FALSE;
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
asection *o;
@@ -2309,12 +2309,12 @@ elf32_tic6x_relocate_section (bfd *output_bfd,
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -3309,7 +3309,7 @@ elf32_tic6x_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -4051,7 +4051,7 @@ elf32_tic6x_fix_exidx_coverage (asection **text_section_order,
/* Walk over all EXIDX sections, and create backlinks from the corrsponding
text sections. */
- for (inp = info->input_bfds; inp != NULL; inp = inp->link_next)
+ for (inp = info->input_bfds; inp != NULL; inp = inp->link.next)
{
asection *sec;
@@ -4345,17 +4345,9 @@ elf32_tic6x_write_section (bfd *output_bfd,
return TRUE;
}
-static void
-elf32_tic6x_set_osabi (bfd *abfd, struct bfd_link_info *link_info)
-{
- if (link_info != NULL && link_info->relocatable)
- return;
- _bfd_elf_set_osabi (abfd, link_info);
-}
-
-#define TARGET_LITTLE_SYM bfd_elf32_tic6x_le_vec
+#define TARGET_LITTLE_SYM tic6x_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-tic6x-le"
-#define TARGET_BIG_SYM bfd_elf32_tic6x_be_vec
+#define TARGET_BIG_SYM tic6x_elf32_be_vec
#define TARGET_BIG_NAME "elf32-tic6x-be"
#define ELF_ARCH bfd_arch_tic6x
#define ELF_TARGET_ID TIC6X_ELF_DATA
@@ -4424,36 +4416,30 @@ elf32_tic6x_set_osabi (bfd *abfd, struct bfd_link_info *link_info)
#define elf32_bed elf32_tic6x_linux_bed
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_tic6x_linux_le_vec
+#define TARGET_LITTLE_SYM tic6x_elf32_linux_le_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-tic6x-linux-le"
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_tic6x_linux_be_vec
+#define TARGET_BIG_SYM tic6x_elf32_linux_be_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-tic6x-linux-be"
#undef ELF_OSABI
#define ELF_OSABI ELFOSABI_C6000_LINUX
-#undef elf_backend_post_process_headers
-#define elf_backend_post_process_headers elf32_tic6x_set_osabi
-
#include "elf32-target.h"
#undef elf32_bed
#define elf32_bed elf32_tic6x_elf_bed
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_tic6x_elf_le_vec
+#define TARGET_LITTLE_SYM tic6x_elf32_c6000_le_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-tic6x-elf-le"
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf32_tic6x_elf_be_vec
+#define TARGET_BIG_SYM tic6x_elf32_c6000_be_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-tic6x-elf-be"
#undef ELF_OSABI
#define ELF_OSABI ELFOSABI_C6000_ELFABI
-#undef elf_backend_post_process_headers
-#define elf_backend_post_process_headers elf32_tic6x_set_osabi
-
#include "elf32-target.h"
diff --git a/binutils-2.25/bfd/elf32-tic6x.h b/binutils-2.25/bfd/elf32-tic6x.h
index be543087..12024b87 100644
--- a/binutils-2.25/bfd/elf32-tic6x.h
+++ b/binutils-2.25/bfd/elf32-tic6x.h
@@ -1,6 +1,5 @@
/* 32-bit ELF support for TI C6X
- Copyright 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2010-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf32-tilegx.c b/binutils-2.25/bfd/elf32-tilegx.c
index 648fbf16..bc5752c2 100644
--- a/binutils-2.25/bfd/elf32-tilegx.c
+++ b/binutils-2.25/bfd/elf32-tilegx.c
@@ -1,5 +1,5 @@
/* TILE-Gx-specific support for 32-bit ELF.
- Copyright 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -87,9 +87,9 @@ tilegx_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
#define ELF_MAXPAGESIZE 0x10000
#define ELF_COMMONPAGESIZE 0x10000
-#define TARGET_BIG_SYM bfd_elf32_tilegx_be_vec
+#define TARGET_BIG_SYM tilegx_elf32_be_vec
#define TARGET_BIG_NAME "elf32-tilegx-be"
-#define TARGET_LITTLE_SYM bfd_elf32_tilegx_le_vec
+#define TARGET_LITTLE_SYM tilegx_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-tilegx-le"
#define elf_backend_reloc_type_class tilegx_reloc_type_class
diff --git a/binutils-2.25/bfd/elf32-tilegx.h b/binutils-2.25/bfd/elf32-tilegx.h
index 091bde13..abcec80f 100644
--- a/binutils-2.25/bfd/elf32-tilegx.h
+++ b/binutils-2.25/bfd/elf32-tilegx.h
@@ -1,5 +1,5 @@
/* TILE-Gx-specific support for 32-bit ELF.
- Copyright 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf32-tilepro.c b/binutils-2.25/bfd/elf32-tilepro.c
index c36da2be..b9a31d5c 100644
--- a/binutils-2.25/bfd/elf32-tilepro.c
+++ b/binutils-2.25/bfd/elf32-tilepro.c
@@ -1,5 +1,5 @@
/* TILEPro-specific support for 32-bit ELF.
- Copyright 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -2472,7 +2472,7 @@ tilepro_elf_size_dynamic_sections (bfd *output_bfd,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -2892,12 +2892,13 @@ tilepro_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned ATTRIBUTE_UNUSED;
+ bfd_boolean ignored ATTRIBUTE_UNUSED;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
if (warned)
{
/* To avoid generating warning messages about truncated
@@ -4020,7 +4021,7 @@ tilepro_additional_program_headers (bfd *abfd,
#define ELF_MAXPAGESIZE 0x10000
#define ELF_COMMONPAGESIZE 0x10000
-#define TARGET_LITTLE_SYM bfd_elf32_tilepro_vec
+#define TARGET_LITTLE_SYM tilepro_elf32_vec
#define TARGET_LITTLE_NAME "elf32-tilepro"
#define elf_backend_reloc_type_class tilepro_reloc_type_class
diff --git a/binutils-2.25/bfd/elf32-tilepro.h b/binutils-2.25/bfd/elf32-tilepro.h
index bdfe2cd2..3d2aa87a 100644
--- a/binutils-2.25/bfd/elf32-tilepro.h
+++ b/binutils-2.25/bfd/elf32-tilepro.h
@@ -1,5 +1,5 @@
/* TILEPro-specific support for 32-bit ELF.
- Copyright 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf32-v850.c b/binutils-2.25/bfd/elf32-v850.c
index 89724ade..2589a252 100644
--- a/binutils-2.25/bfd/elf32-v850.c
+++ b/binutils-2.25/bfd/elf32-v850.c
@@ -1,5 +1,5 @@
/* V850-specific support for 32-bit ELF
- Copyright 1996-2013 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -2211,7 +2211,7 @@ v850_elf_relocate_section (bfd *output_bfd,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
/* Note - this check is delayed until now as it is possible and
valid to have a file without any symbols but with relocs that
@@ -2228,7 +2228,7 @@ v850_elf_relocate_section (bfd *output_bfd,
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -3770,7 +3770,7 @@ static const struct bfd_elf_special_section v850_elf_special_sections[] =
{ NULL, 0, 0, 0, 0 }
};
-#define TARGET_LITTLE_SYM bfd_elf32_v850_vec
+#define TARGET_LITTLE_SYM v850_elf32_vec
#define TARGET_LITTLE_NAME "elf32-v850"
#define ELF_ARCH bfd_arch_v850
#define ELF_MACHINE_CODE EM_V850
@@ -3905,7 +3905,7 @@ v800_elf_info_to_howto (bfd * abfd,
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_v850_rh850_vec
+#define TARGET_LITTLE_SYM v800_elf32_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-v850-rh850"
#undef ELF_ARCH
diff --git a/binutils-2.25/bfd/elf32-vax.c b/binutils-2.25/bfd/elf32-vax.c
index c6a8f818..1f418672 100644
--- a/binutils-2.25/bfd/elf32-vax.c
+++ b/binutils-2.25/bfd/elf32-vax.c
@@ -1,7 +1,5 @@
/* VAX series support for 32-bit ELF
- Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Contributed by Matt Thomas <matt@3am-software.com>.
This file is part of BFD, the Binary File Descriptor library.
@@ -1223,7 +1221,7 @@ elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
continue;
/* Allocate memory for the section contents. */
- s->contents = (bfd_byte *) bfd_alloc (dynobj, s->size);
+ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
if (s->contents == NULL)
return FALSE;
}
@@ -1408,12 +1406,12 @@ elf_vax_relocate_section (bfd *output_bfd,
else
{
bfd_boolean unresolved_reloc;
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
@@ -2020,7 +2018,7 @@ elf_vax_plt_sym_val (bfd_vma i, const asection *plt,
return plt->vma + (i + 1) * PLT_ENTRY_SIZE;
}
-#define TARGET_LITTLE_SYM bfd_elf32_vax_vec
+#define TARGET_LITTLE_SYM vax_elf32_vec
#define TARGET_LITTLE_NAME "elf32-vax"
#define ELF_MACHINE_CODE EM_VAX
#define ELF_MAXPAGESIZE 0x1000
diff --git a/binutils-2.25/bfd/elf32-xc16x.c b/binutils-2.25/bfd/elf32-xc16x.c
index 9f285c79..9e7decab 100644
--- a/binutils-2.25/bfd/elf32-xc16x.c
+++ b/binutils-2.25/bfd/elf32-xc16x.c
@@ -1,5 +1,5 @@
/* Infineon XC16X-specific support for 16-bit ELF.
- Copyright 2006, 2007, 2009, 2010, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
Contributed by KPIT Cummins Infosystems
This file is part of BFD, the Binary File Descriptor library.
@@ -373,12 +373,12 @@ elf32_xc16x_relocate_section (bfd *output_bfd,
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -462,7 +462,7 @@ elf32_xc16x_object_p (bfd *abfd)
#define ELF_MACHINE_CODE EM_XC16X
#define ELF_MAXPAGESIZE 0x100
-#define TARGET_LITTLE_SYM bfd_elf32_xc16x_vec
+#define TARGET_LITTLE_SYM xc16x_elf32_vec
#define TARGET_LITTLE_NAME "elf32-xc16x"
#define elf_backend_final_write_processing elf32_xc16x_final_write_processing
#define elf_backend_object_p elf32_xc16x_object_p
diff --git a/binutils-2.25/bfd/elf32-xgate.c b/binutils-2.25/bfd/elf32-xgate.c
index b8222602..01f39fae 100644
--- a/binutils-2.25/bfd/elf32-xgate.c
+++ b/binutils-2.25/bfd/elf32-xgate.c
@@ -1,6 +1,5 @@
/* Freescale XGATE-specific support for 32-bit ELF
- Copyright 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2010-2014 Free Software Foundation, Inc.
Contributed by Sean Keys(skeys@ipdatasys.com)
This file is part of BFD, the Binary File Descriptor library.
@@ -427,20 +426,20 @@ xgate_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
cache_ptr->howto = &elf_xgate_howto_table[r_type];
}
-/* Free the derived linker hash table. */
+/* Destroy an XGATE ELF linker hash table. */
-void
-xgate_elf_bfd_link_hash_table_free (struct bfd_link_hash_table *hash)
+static void
+xgate_elf_bfd_link_hash_table_free (bfd *obfd)
{
struct xgate_elf_link_hash_table *ret =
- (struct xgate_elf_link_hash_table *) hash;
+ (struct xgate_elf_link_hash_table *) obfd->link.hash;
bfd_hash_table_free (ret->stub_hash_table);
free (ret->stub_hash_table);
- _bfd_elf_link_hash_table_free (hash);
+ _bfd_elf_link_hash_table_free (obfd);
}
-/* Create a XGATE ELF linker hash table. */
+/* Create an XGATE ELF linker hash table. */
static struct bfd_link_hash_table*
xgate_elf_bfd_link_hash_table_create (bfd *abfd)
@@ -465,7 +464,7 @@ xgate_elf_bfd_link_hash_table_create (bfd *abfd)
ret->stub_hash_table = (struct bfd_hash_table*) bfd_zmalloc (amt);
if (ret->stub_hash_table == NULL)
{
- free (ret);
+ _bfd_elf_link_hash_table_free (abfd);
return NULL;
}
@@ -473,9 +472,10 @@ xgate_elf_bfd_link_hash_table_create (bfd *abfd)
sizeof(struct elf32_xgate_stub_hash_entry)))
{
free (ret->stub_hash_table);
- free (ret);
+ _bfd_elf_link_hash_table_free (abfd);
return NULL;
}
+ ret->root.root.hash_table_free = xgate_elf_bfd_link_hash_table_free;
return &ret->root.root;
}
@@ -703,7 +703,7 @@ elf32_xgate_post_process_headers (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_in
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM bfd_elf32_xgate_vec
+#define TARGET_BIG_SYM xgate_elf32_vec
#define TARGET_BIG_NAME "elf32-xgate"
#define elf_info_to_howto 0
@@ -718,7 +718,6 @@ elf32_xgate_post_process_headers (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_in
#define elf_backend_add_symbol_hook elf32_xgate_add_symbol_hook
#define bfd_elf32_bfd_link_hash_table_create xgate_elf_bfd_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free xgate_elf_bfd_link_hash_table_free
#define bfd_elf32_bfd_merge_private_bfd_data _bfd_xgate_elf_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags _bfd_xgate_elf_set_private_flags
#define bfd_elf32_bfd_print_private_bfd_data _bfd_xgate_elf_print_private_bfd_data
diff --git a/binutils-2.25/bfd/elf32-xgate.h b/binutils-2.25/bfd/elf32-xgate.h
index 7ecdf12f..f1300014 100644
--- a/binutils-2.25/bfd/elf32-xgate.h
+++ b/binutils-2.25/bfd/elf32-xgate.h
@@ -1,5 +1,5 @@
/* Freescale XGATE-specific support for 32-bit ELF
- Copyright 2012 Free Software Foundation, Inc.
+ Copyright (C) 2012-2014 Free Software Foundation, Inc.
Contributed by Sean Keys (skeys@ipdatasys.com)
(Heavily copied from the HC11 port by Stephane Carrez (stcarrez@nerim.fr))
@@ -100,7 +100,6 @@ struct xgate_elf_link_hash_table
extern struct xgate_elf_link_hash_table* xgate_elf_hash_table_create
(bfd *);
-extern void xgate_elf_bfd_link_hash_table_free (struct bfd_link_hash_table *);
extern void xgate_elf_get_bank_parameters (struct bfd_link_info *);
diff --git a/binutils-2.25/bfd/elf32-xstormy16.c b/binutils-2.25/bfd/elf32-xstormy16.c
index 851ebbc6..f918a1eb 100644
--- a/binutils-2.25/bfd/elf32-xstormy16.c
+++ b/binutils-2.25/bfd/elf32-xstormy16.c
@@ -1,6 +1,5 @@
/* Xstormy16-specific support for 32-bit ELF.
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -611,7 +610,7 @@ xstormy16_elf_relax_section (bfd *dynobj,
/* Likewise for local symbols, though that's somewhat less convenient
as we have to walk the list of input bfds and swap in symbol data. */
- for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next)
{
bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd);
Elf_Internal_Shdr *symtab_hdr;
@@ -685,7 +684,7 @@ xstormy16_elf_relax_section (bfd *dynobj,
elf_link_hash_traverse (elf_hash_table (info),
xstormy16_relax_plt_realloc, &entry);
- for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next)
{
bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd);
unsigned int nlocals = elf_tdata (ibfd)->symtab_hdr.sh_info;
@@ -818,12 +817,12 @@ xstormy16_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNU
}
else
{
- bfd_boolean unresolved_reloc, warned;
+ bfd_boolean unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -1015,7 +1014,7 @@ xstormy16_elf_gc_mark_hook (asection *sec,
#define ELF_MACHINE_CODE EM_XSTORMY16
#define ELF_MAXPAGESIZE 0x100
-#define TARGET_LITTLE_SYM bfd_elf32_xstormy16_vec
+#define TARGET_LITTLE_SYM xstormy16_elf32_vec
#define TARGET_LITTLE_NAME "elf32-xstormy16"
#define elf_info_to_howto_rel NULL
diff --git a/binutils-2.25/bfd/elf32-xtensa.c b/binutils-2.25/bfd/elf32-xtensa.c
index 28ed9aa9..e32496aa 100644
--- a/binutils-2.25/bfd/elf32-xtensa.c
+++ b/binutils-2.25/bfd/elf32-xtensa.c
@@ -1,6 +1,5 @@
/* Xtensa-specific support for 32-bit ELF.
- Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2003-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -223,11 +222,11 @@ static reloc_howto_type elf_howto_table[] =
FALSE, 0, 0, FALSE),
/* Relocations for supporting difference of symbols. */
- HOWTO (R_XTENSA_DIFF8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,
+ HOWTO (R_XTENSA_DIFF8, 0, 0, 8, FALSE, 0, complain_overflow_signed,
bfd_elf_xtensa_reloc, "R_XTENSA_DIFF8", FALSE, 0, 0xff, FALSE),
- HOWTO (R_XTENSA_DIFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ HOWTO (R_XTENSA_DIFF16, 0, 1, 16, FALSE, 0, complain_overflow_signed,
bfd_elf_xtensa_reloc, "R_XTENSA_DIFF16", FALSE, 0, 0xffff, FALSE),
- HOWTO (R_XTENSA_DIFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ HOWTO (R_XTENSA_DIFF32, 0, 2, 32, FALSE, 0, complain_overflow_signed,
bfd_elf_xtensa_reloc, "R_XTENSA_DIFF32", FALSE, 0, 0xffffffff, FALSE),
/* General immediate operand relocations. */
@@ -1562,7 +1561,7 @@ elf_xtensa_allocate_local_got_size (struct bfd_link_info *info)
if (htab == NULL)
return;
- for (i = info->input_bfds; i; i = i->link_next)
+ for (i = info->input_bfds; i; i = i->link.next)
{
bfd_signed_vma *local_got_refcounts;
bfd_size_type j, cnt;
@@ -1701,7 +1700,7 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
literal tables. */
sgotloc = htab->sgotloc;
sgotloc->size = spltlittbl->size;
- for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next)
+ for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link.next)
{
if (abfd->flags & DYNAMIC)
continue;
@@ -2161,9 +2160,9 @@ vsprint_msg (const char *origmsg, const char *fmt, int arglen, ...)
static char *message = NULL;
bfd_size_type orig_len, len = 0;
bfd_boolean is_append;
+ va_list ap;
- VA_OPEN (ap, arglen);
- VA_FIXEDARG (ap, const char *, origmsg);
+ va_start (ap, arglen);
is_append = (origmsg == message);
@@ -2180,7 +2179,7 @@ vsprint_msg (const char *origmsg, const char *fmt, int arglen, ...)
memcpy (message, origmsg, orig_len);
vsprintf (message + orig_len, fmt, ap);
}
- VA_CLOSE (ap);
+ va_end (ap);
return message;
}
@@ -2638,10 +2637,12 @@ elf_xtensa_relocate_section (bfd *output_bfd,
}
else
{
+ bfd_boolean ignored;
+
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
if (relocation == 0
&& !unresolved_reloc
@@ -6745,14 +6746,14 @@ analyze_relocations (struct bfd_link_info *link_info)
bfd_boolean is_relaxable = FALSE;
/* Initialize the per-section relaxation info. */
- for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next)
+ for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link.next)
for (sec = abfd->sections; sec != NULL; sec = sec->next)
{
init_xtensa_relax_info (sec);
}
/* Mark relaxable sections (and count relocations against each one). */
- for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next)
+ for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link.next)
for (sec = abfd->sections; sec != NULL; sec = sec->next)
{
if (!find_relaxable_sections (abfd, sec, link_info, &is_relaxable))
@@ -6764,7 +6765,7 @@ analyze_relocations (struct bfd_link_info *link_info)
return TRUE;
/* Allocate space for source_relocs. */
- for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next)
+ for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link.next)
for (sec = abfd->sections; sec != NULL; sec = sec->next)
{
xtensa_relax_info *relax_info;
@@ -6781,7 +6782,7 @@ analyze_relocations (struct bfd_link_info *link_info)
}
/* Collect info on relocations against each relaxable section. */
- for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next)
+ for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link.next)
for (sec = abfd->sections; sec != NULL; sec = sec->next)
{
if (!collect_source_relocs (abfd, sec, link_info))
@@ -6789,7 +6790,7 @@ analyze_relocations (struct bfd_link_info *link_info)
}
/* Compute the text actions. */
- for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next)
+ for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link.next)
for (sec = abfd->sections; sec != NULL; sec = sec->next)
{
if (!compute_text_actions (abfd, sec, link_info))
@@ -7123,10 +7124,43 @@ is_resolvable_asm_expansion (bfd *abfd,
|| is_reloc_sym_weak (abfd, irel)))
return FALSE;
- self_address = (sec->output_section->vma
- + sec->output_offset + irel->r_offset + 3);
- dest_address = (target_sec->output_section->vma
- + target_sec->output_offset + target_offset);
+ if (target_sec->output_section != sec->output_section)
+ {
+ /* If the two sections are sufficiently far away that relaxation
+ might take the call out of range, we can't simplify. For
+ example, a positive displacement call into another memory
+ could get moved to a lower address due to literal removal,
+ but the destination won't move, and so the displacment might
+ get larger.
+
+ If the displacement is negative, assume the destination could
+ move as far back as the start of the output section. The
+ self_address will be at least as far into the output section
+ as it is prior to relaxation.
+
+ If the displacement is postive, assume the destination will be in
+ it's pre-relaxed location (because relaxation only makes sections
+ smaller). The self_address could go all the way to the beginning
+ of the output section. */
+
+ dest_address = target_sec->output_section->vma;
+ self_address = sec->output_section->vma;
+
+ if (sec->output_section->vma > target_sec->output_section->vma)
+ self_address += sec->output_offset + irel->r_offset + 3;
+ else
+ dest_address += bfd_get_section_limit (abfd, target_sec->output_section);
+ /* Call targets should be four-byte aligned. */
+ dest_address = (dest_address + 3) & ~3;
+ }
+ else
+ {
+
+ self_address = (sec->output_section->vma
+ + sec->output_offset + irel->r_offset + 3);
+ dest_address = (target_sec->output_section->vma
+ + target_sec->output_offset + target_offset);
+ }
*is_reachable_p = pcrel_reloc_fits (direct_call_opcode, 0,
self_address, dest_address);
@@ -9012,7 +9046,8 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
|| r_type == R_XTENSA_DIFF16
|| r_type == R_XTENSA_DIFF32)
{
- bfd_vma diff_value = 0, new_end_offset, diff_mask = 0;
+ bfd_signed_vma diff_value = 0;
+ bfd_vma new_end_offset, diff_mask = 0;
if (bfd_get_section_limit (abfd, sec) < old_source_offset)
{
@@ -9026,15 +9061,15 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
{
case R_XTENSA_DIFF8:
diff_value =
- bfd_get_8 (abfd, &contents[old_source_offset]);
+ bfd_get_signed_8 (abfd, &contents[old_source_offset]);
break;
case R_XTENSA_DIFF16:
diff_value =
- bfd_get_16 (abfd, &contents[old_source_offset]);
+ bfd_get_signed_16 (abfd, &contents[old_source_offset]);
break;
case R_XTENSA_DIFF32:
diff_value =
- bfd_get_32 (abfd, &contents[old_source_offset]);
+ bfd_get_signed_32 (abfd, &contents[old_source_offset]);
break;
}
@@ -9046,24 +9081,25 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
switch (r_type)
{
case R_XTENSA_DIFF8:
- diff_mask = 0xff;
- bfd_put_8 (abfd, diff_value,
+ diff_mask = 0x7f;
+ bfd_put_signed_8 (abfd, diff_value,
&contents[old_source_offset]);
break;
case R_XTENSA_DIFF16:
- diff_mask = 0xffff;
- bfd_put_16 (abfd, diff_value,
+ diff_mask = 0x7fff;
+ bfd_put_signed_16 (abfd, diff_value,
&contents[old_source_offset]);
break;
case R_XTENSA_DIFF32:
- diff_mask = 0xffffffff;
- bfd_put_32 (abfd, diff_value,
+ diff_mask = 0x7fffffff;
+ bfd_put_signed_32 (abfd, diff_value,
&contents[old_source_offset]);
break;
}
- /* Check for overflow. */
- if ((diff_value & ~diff_mask) != 0)
+ /* Check for overflow. Sign bits must be all zeroes or all ones */
+ if ((diff_value & ~diff_mask) != 0 &&
+ (diff_value & ~diff_mask) != (-1 & ~diff_mask))
{
(*link_info->callbacks->reloc_dangerous)
(link_info, _("overflow after relaxation"),
@@ -10757,9 +10793,9 @@ static const struct bfd_elf_special_section elf_xtensa_special_sections[] =
#define ELF_TARGET_ID XTENSA_ELF_DATA
#ifndef ELF_ARCH
-#define TARGET_LITTLE_SYM bfd_elf32_xtensa_le_vec
+#define TARGET_LITTLE_SYM xtensa_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-xtensa-le"
-#define TARGET_BIG_SYM bfd_elf32_xtensa_be_vec
+#define TARGET_BIG_SYM xtensa_elf32_be_vec
#define TARGET_BIG_NAME "elf32-xtensa-be"
#define ELF_ARCH bfd_arch_xtensa
diff --git a/binutils-2.25/bfd/elf32.c b/binutils-2.25/bfd/elf32.c
index 98dacc1f..1e6ae4a2 100644
--- a/binutils-2.25/bfd/elf32.c
+++ b/binutils-2.25/bfd/elf32.c
@@ -1,6 +1,5 @@
/* ELF 32-bit executable support for BFD.
- Copyright 1993, 2001, 2004, 2005, 2006, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf64-alpha.c b/binutils-2.25/bfd/elf64-alpha.c
index 289164fd..1a4fc236 100644
--- a/binutils-2.25/bfd/elf64-alpha.c
+++ b/binutils-2.25/bfd/elf64-alpha.c
@@ -1,7 +1,5 @@
/* Alpha specific support for 64-bit ELF
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@tamu.edu>.
This file is part of BFD, the Binary File Descriptor library.
@@ -1444,17 +1442,19 @@ elf64_alpha_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, const char *name)
}
static bfd_boolean
-elf64_alpha_find_nearest_line (bfd *abfd, asection *section, asymbol **symbols,
- bfd_vma offset, const char **filename_ptr,
+elf64_alpha_find_nearest_line (bfd *abfd, asymbol **symbols,
+ asection *section, bfd_vma offset,
+ const char **filename_ptr,
const char **functionname_ptr,
- unsigned int *line_ptr)
+ unsigned int *line_ptr,
+ unsigned int *discriminator_ptr)
{
asection *msec;
- if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections,
- section, symbols, offset,
+ if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset,
filename_ptr, functionname_ptr,
- line_ptr, NULL, 0,
+ line_ptr, discriminator_ptr,
+ dwarf_debug_sections, 0,
&elf_tdata (abfd)->dwarf2_find_line_info))
return TRUE;
@@ -1534,9 +1534,9 @@ elf64_alpha_find_nearest_line (bfd *abfd, asection *section, asymbol **symbols,
/* Fall back on the generic ELF find_nearest_line routine. */
- return _bfd_elf_find_nearest_line (abfd, section, symbols, offset,
+ return _bfd_elf_find_nearest_line (abfd, symbols, section, offset,
filename_ptr, functionname_ptr,
- line_ptr);
+ line_ptr, discriminator_ptr);
}
/* Structure used to pass information to alpha_elf_output_extsym. */
@@ -2468,7 +2468,8 @@ elf64_alpha_calc_got_offsets (struct bfd_link_info *info)
/* Constructs the gots. */
static bfd_boolean
-elf64_alpha_size_got_sections (struct bfd_link_info *info)
+elf64_alpha_size_got_sections (struct bfd_link_info *info,
+ bfd_boolean may_merge)
{
bfd *i, *got_list, *cur_got_obj = NULL;
struct alpha_elf_link_hash_table * htab;
@@ -2482,7 +2483,7 @@ elf64_alpha_size_got_sections (struct bfd_link_info *info)
consisting of all of the input files. */
if (got_list == NULL)
{
- for (i = info->input_bfds; i ; i = i->link_next)
+ for (i = info->input_bfds; i ; i = i->link.next)
{
bfd *this_got;
@@ -2523,21 +2524,24 @@ elf64_alpha_size_got_sections (struct bfd_link_info *info)
if (cur_got_obj == NULL)
return FALSE;
- i = alpha_elf_tdata(cur_got_obj)->got_link_next;
- while (i != NULL)
+ if (may_merge)
{
- if (elf64_alpha_can_merge_gots (cur_got_obj, i))
+ i = alpha_elf_tdata(cur_got_obj)->got_link_next;
+ while (i != NULL)
{
- elf64_alpha_merge_gots (cur_got_obj, i);
+ if (elf64_alpha_can_merge_gots (cur_got_obj, i))
+ {
+ elf64_alpha_merge_gots (cur_got_obj, i);
- alpha_elf_tdata(i)->got->size = 0;
- i = alpha_elf_tdata(i)->got_link_next;
- alpha_elf_tdata(cur_got_obj)->got_link_next = i;
- }
- else
- {
- cur_got_obj = i;
- i = alpha_elf_tdata(i)->got_link_next;
+ alpha_elf_tdata(i)->got->size = 0;
+ i = alpha_elf_tdata(i)->got_link_next;
+ alpha_elf_tdata(cur_got_obj)->got_link_next = i;
+ }
+ else
+ {
+ cur_got_obj = i;
+ i = alpha_elf_tdata(i)->got_link_next;
+ }
}
}
@@ -2640,7 +2644,7 @@ elf64_alpha_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
if (htab == NULL)
return FALSE;
- if (!elf64_alpha_size_got_sections (info))
+ if (!elf64_alpha_size_got_sections (info, TRUE))
return FALSE;
/* Allocate space for all of the .got subsections. */
@@ -3076,6 +3080,10 @@ elf64_alpha_relax_got_load (struct alpha_relax_info *info, bfd_vma symval,
}
else
{
+ /* We may only create GPREL relocs during the second pass. */
+ if (info->link_info->relax_pass == 0)
+ return TRUE;
+
disp = symval - info->gp;
insn = (OP_LDA << 26) | (insn & 0x03ff0000);
r_type = R_ALPHA_GPREL16;
@@ -3216,21 +3224,27 @@ static bfd_boolean
elf64_alpha_relax_with_lituse (struct alpha_relax_info *info,
bfd_vma symval, Elf_Internal_Rela *irel)
{
- Elf_Internal_Rela *urel, *irelend = info->relend;
- int flags, count, i;
+ Elf_Internal_Rela *urel, *erel, *irelend = info->relend;
+ int flags;
bfd_signed_vma disp;
bfd_boolean fits16;
bfd_boolean fits32;
bfd_boolean lit_reused = FALSE;
bfd_boolean all_optimized = TRUE;
+ bfd_boolean changed_contents;
+ bfd_boolean changed_relocs;
+ bfd_byte *contents = info->contents;
+ bfd *abfd = info->abfd;
+ bfd_vma sec_output_vma;
unsigned int lit_insn;
+ int relax_pass;
- lit_insn = bfd_get_32 (info->abfd, info->contents + irel->r_offset);
+ lit_insn = bfd_get_32 (abfd, contents + irel->r_offset);
if (lit_insn >> 26 != OP_LDQ)
{
((*_bfd_error_handler)
("%B: %A+0x%lx: warning: LITERAL relocation against unexpected insn",
- info->abfd, info->sec,
+ abfd, info->sec,
(unsigned long) irel->r_offset));
return TRUE;
}
@@ -3239,25 +3253,32 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info,
if (alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info))
return TRUE;
+ changed_contents = info->changed_contents;
+ changed_relocs = info->changed_relocs;
+ sec_output_vma = info->sec->output_section->vma + info->sec->output_offset;
+ relax_pass = info->link_info->relax_pass;
+
/* Summarize how this particular LITERAL is used. */
- for (urel = irel+1, flags = count = 0; urel < irelend; ++urel, ++count)
+ for (erel = irel+1, flags = 0; erel < irelend; ++erel)
{
- if (ELF64_R_TYPE (urel->r_info) != R_ALPHA_LITUSE)
+ if (ELF64_R_TYPE (erel->r_info) != R_ALPHA_LITUSE)
break;
- if (urel->r_addend <= 6)
- flags |= 1 << urel->r_addend;
+ if (erel->r_addend <= 6)
+ flags |= 1 << erel->r_addend;
}
/* A little preparation for the loop... */
disp = symval - info->gp;
- for (urel = irel+1, i = 0; i < count; ++i, ++urel)
+ for (urel = irel+1; urel < erel; ++urel)
{
+ bfd_vma urel_r_offset = urel->r_offset;
unsigned int insn;
int insn_disp;
bfd_signed_vma xdisp;
+ Elf_Internal_Rela nrel;
- insn = bfd_get_32 (info->abfd, info->contents + urel->r_offset);
+ insn = bfd_get_32 (abfd, contents + urel_r_offset);
switch (urel->r_addend)
{
@@ -3269,6 +3290,13 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info,
break;
case LITUSE_ALPHA_BASE:
+ /* We may only create GPREL relocs during the second pass. */
+ if (relax_pass == 0)
+ {
+ all_optimized = FALSE;
+ break;
+ }
+
/* We can always optimize 16-bit displacements. */
/* Extract the displacement from the instruction, sign-extending
@@ -3286,14 +3314,20 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info,
/* Take the op code and dest from this insn, take the base
register from the literal insn. Leave the offset alone. */
insn = (insn & 0xffe0ffff) | (lit_insn & 0x001f0000);
- urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
- R_ALPHA_GPREL16);
- urel->r_addend = irel->r_addend;
- info->changed_relocs = TRUE;
-
- bfd_put_32 (info->abfd, (bfd_vma) insn,
- info->contents + urel->r_offset);
- info->changed_contents = TRUE;
+ bfd_put_32 (abfd, (bfd_vma) insn, contents + urel_r_offset);
+ changed_contents = TRUE;
+
+ nrel = *urel;
+ nrel.r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
+ R_ALPHA_GPREL16);
+ nrel.r_addend = irel->r_addend;
+
+ /* As we adjust, move the reloc to the end so that we don't
+ break the LITERAL+LITUSE chain. */
+ if (urel < --erel)
+ *urel-- = *erel;
+ *erel = nrel;
+ changed_relocs = TRUE;
}
/* If all mem+byte, we can optimize 32-bit mem displacements. */
@@ -3304,15 +3338,16 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info,
irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
R_ALPHA_GPRELHIGH);
lit_insn = (OP_LDAH << 26) | (lit_insn & 0x03ff0000);
- bfd_put_32 (info->abfd, (bfd_vma) lit_insn,
- info->contents + irel->r_offset);
+ bfd_put_32 (abfd, (bfd_vma) lit_insn, contents + irel->r_offset);
lit_reused = TRUE;
- info->changed_contents = TRUE;
+ changed_contents = TRUE;
+ /* Since all relocs must be optimized, don't bother swapping
+ this relocation to the end. */
urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
R_ALPHA_GPRELLOW);
urel->r_addend = irel->r_addend;
- info->changed_relocs = TRUE;
+ changed_relocs = TRUE;
}
else
all_optimized = FALSE;
@@ -3326,14 +3361,19 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info,
insn &= ~ (unsigned) 0x001ff000;
insn |= ((symval & 7) << 13) | 0x1000;
-
- urel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE);
- urel->r_addend = 0;
- info->changed_relocs = TRUE;
-
- bfd_put_32 (info->abfd, (bfd_vma) insn,
- info->contents + urel->r_offset);
- info->changed_contents = TRUE;
+ bfd_put_32 (abfd, (bfd_vma) insn, contents + urel_r_offset);
+ changed_contents = TRUE;
+
+ nrel = *urel;
+ nrel.r_info = ELF64_R_INFO (0, R_ALPHA_NONE);
+ nrel.r_addend = 0;
+
+ /* As we adjust, move the reloc to the end so that we don't
+ break the LITERAL+LITUSE chain. */
+ if (urel < --erel)
+ *urel-- = *erel;
+ *erel = nrel;
+ changed_relocs = TRUE;
break;
case LITUSE_ALPHA_JSR:
@@ -3350,18 +3390,15 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info,
if (info->h && info->h->root.root.type == bfd_link_hash_undefweak)
{
insn |= 31 << 16;
- bfd_put_32 (info->abfd, (bfd_vma) insn,
- info->contents + urel->r_offset);
+ bfd_put_32 (abfd, (bfd_vma) insn, contents + urel_r_offset);
- info->changed_contents = TRUE;
+ changed_contents = TRUE;
break;
}
/* If not zero, place to jump without needing pv. */
optdest = elf64_alpha_relax_opt_call (info, symval);
- org = (info->sec->output_section->vma
- + info->sec->output_offset
- + urel->r_offset + 4);
+ org = sec_output_vma + urel_r_offset + 4;
odisp = (optdest ? optdest : symval) - org;
if (odisp >= -0x400000 && odisp < 0x400000)
@@ -3373,27 +3410,32 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info,
insn = (OP_BSR << 26) | (insn & 0x03e00000);
else
insn = (OP_BR << 26) | (insn & 0x03e00000);
+ bfd_put_32 (abfd, (bfd_vma) insn, contents + urel_r_offset);
+ changed_contents = TRUE;
- urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
- R_ALPHA_BRADDR);
- urel->r_addend = irel->r_addend;
+ nrel = *urel;
+ nrel.r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
+ R_ALPHA_BRADDR);
+ nrel.r_addend = irel->r_addend;
if (optdest)
- urel->r_addend += optdest - symval;
+ nrel.r_addend += optdest - symval;
else
all_optimized = FALSE;
- bfd_put_32 (info->abfd, (bfd_vma) insn,
- info->contents + urel->r_offset);
-
/* Kill any HINT reloc that might exist for this insn. */
xrel = (elf64_alpha_find_reloc_at_ofs
- (info->relocs, info->relend, urel->r_offset,
+ (info->relocs, info->relend, urel_r_offset,
R_ALPHA_HINT));
if (xrel)
xrel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE);
- info->changed_contents = TRUE;
+ /* As we adjust, move the reloc to the end so that we don't
+ break the LITERAL+LITUSE chain. */
+ if (urel < --erel)
+ *urel-- = *erel;
+ *erel = nrel;
+
info->changed_relocs = TRUE;
}
else
@@ -3405,14 +3447,14 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info,
{
Elf_Internal_Rela *gpdisp
= (elf64_alpha_find_reloc_at_ofs
- (info->relocs, irelend, urel->r_offset + 4,
+ (info->relocs, irelend, urel_r_offset + 4,
R_ALPHA_GPDISP));
if (gpdisp)
{
- bfd_byte *p_ldah = info->contents + gpdisp->r_offset;
+ bfd_byte *p_ldah = contents + gpdisp->r_offset;
bfd_byte *p_lda = p_ldah + gpdisp->r_addend;
- unsigned int ldah = bfd_get_32 (info->abfd, p_ldah);
- unsigned int lda = bfd_get_32 (info->abfd, p_lda);
+ unsigned int ldah = bfd_get_32 (abfd, p_ldah);
+ unsigned int lda = bfd_get_32 (abfd, p_lda);
/* Verify that the instruction is "ldah $29,0($26)".
Consider a function that ends in a noreturn call,
@@ -3421,12 +3463,12 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info,
In that case the insn would use $27 as the base. */
if (ldah == 0x27ba0000 && lda == 0x23bd0000)
{
- bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, p_ldah);
- bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, p_lda);
+ bfd_put_32 (abfd, (bfd_vma) INSN_UNOP, p_ldah);
+ bfd_put_32 (abfd, (bfd_vma) INSN_UNOP, p_lda);
gpdisp->r_info = ELF64_R_INFO (0, R_ALPHA_NONE);
- info->changed_contents = TRUE;
- info->changed_relocs = TRUE;
+ changed_contents = TRUE;
+ changed_relocs = TRUE;
}
}
}
@@ -3435,6 +3477,9 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info,
}
}
+ /* If we reused the literal instruction, we must have optimized all. */
+ BFD_ASSERT(!lit_reused || all_optimized);
+
/* If all cases were optimized, we can reduce the use count on this
got entry by one, possibly eliminating it. */
if (all_optimized)
@@ -3454,17 +3499,19 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info,
if (!lit_reused)
{
irel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE);
- info->changed_relocs = TRUE;
+ changed_relocs = TRUE;
- bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP,
- info->contents + irel->r_offset);
- info->changed_contents = TRUE;
+ bfd_put_32 (abfd, (bfd_vma) INSN_UNOP, contents + irel->r_offset);
+ changed_contents = TRUE;
}
-
- return TRUE;
}
- else
- return elf64_alpha_relax_got_load (info, symval, irel, R_ALPHA_LITERAL);
+
+ info->changed_contents = changed_contents;
+ info->changed_relocs = changed_relocs;
+
+ if (all_optimized || relax_pass == 0)
+ return TRUE;
+ return elf64_alpha_relax_got_load (info, symval, irel, R_ALPHA_LITERAL);
}
static bfd_boolean
@@ -3726,6 +3773,7 @@ elf64_alpha_relax_section (bfd *abfd, asection *sec,
struct alpha_elf_got_entry **local_got_entries;
struct alpha_relax_info info;
struct alpha_elf_link_hash_table * htab;
+ int relax_pass;
htab = alpha_elf_hash_table (link_info);
if (htab == NULL)
@@ -3741,15 +3789,19 @@ elf64_alpha_relax_section (bfd *abfd, asection *sec,
return TRUE;
BFD_ASSERT (is_alpha_elf (abfd));
+ relax_pass = link_info->relax_pass;
/* Make sure our GOT and PLT tables are up-to-date. */
if (htab->relax_trip != link_info->relax_trip)
{
htab->relax_trip = link_info->relax_trip;
- /* This should never fail after the initial round, since the only
- error is GOT overflow, and relaxation only shrinks the table. */
- if (!elf64_alpha_size_got_sections (link_info))
+ /* This should never fail after the initial round, since the only error
+ is GOT overflow, and relaxation only shrinks the table. However, we
+ may only merge got sections during the first pass. If we merge
+ sections after we've created GPREL relocs, the GP for the merged
+ section backs up which may put the relocs out of range. */
+ if (!elf64_alpha_size_got_sections (link_info, relax_pass == 0))
abort ();
if (elf_hash_table (link_info)->dynamic_sections_created)
{
@@ -3804,24 +3856,21 @@ elf64_alpha_relax_section (bfd *abfd, asection *sec,
unsigned long r_symndx = ELF64_R_SYM (irel->r_info);
/* Early exit for unhandled or unrelaxable relocations. */
- switch (r_type)
- {
- case R_ALPHA_LITERAL:
- case R_ALPHA_GPRELHIGH:
- case R_ALPHA_GPRELLOW:
- case R_ALPHA_GOTDTPREL:
- case R_ALPHA_GOTTPREL:
- case R_ALPHA_TLSGD:
- break;
-
- case R_ALPHA_TLSLDM:
- /* The symbol for a TLSLDM reloc is ignored. Collapse the
- reloc to the STN_UNDEF (0) symbol so that they all match. */
- r_symndx = STN_UNDEF;
- break;
-
- default:
- continue;
+ if (r_type != R_ALPHA_LITERAL)
+ {
+ /* We complete everything except LITERAL in the first pass. */
+ if (relax_pass != 0)
+ continue;
+ if (r_type == R_ALPHA_TLSLDM)
+ {
+ /* The symbol for a TLSLDM reloc is ignored. Collapse the
+ reloc to the STN_UNDEF (0) symbol so that they all match. */
+ r_symndx = STN_UNDEF;
+ }
+ else if (r_type != R_ALPHA_GOTDTPREL
+ && r_type != R_ALPHA_GOTTPREL
+ && r_type != R_ALPHA_TLSGD)
+ continue;
}
/* Get the value of the symbol referred to by the reloc. */
@@ -4303,14 +4352,14 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
struct elf_link_hash_entry *hh;
struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
hh, sec, value,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
if (warned)
continue;
@@ -5421,7 +5470,7 @@ static const struct elf_size_info alpha_elf_size_info =
bfd_elf64_swap_reloca_out
};
-#define TARGET_LITTLE_SYM bfd_elf64_alpha_vec
+#define TARGET_LITTLE_SYM alpha_elf64_vec
#define TARGET_LITTLE_NAME "elf64-alpha"
#define ELF_ARCH bfd_arch_alpha
#define ELF_TARGET_ID ALPHA_ELF_DATA
@@ -5513,7 +5562,7 @@ static const struct elf_size_info alpha_elf_size_info =
/* FreeBSD support. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf64_alpha_freebsd_vec
+#define TARGET_LITTLE_SYM alpha_elf64_fbsd_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-alpha-freebsd"
#undef ELF_OSABI
diff --git a/binutils-2.25/bfd/elf64-gen.c b/binutils-2.25/bfd/elf64-gen.c
index 1b0dadeb..d8afcfa3 100644
--- a/binutils-2.25/bfd/elf64-gen.c
+++ b/binutils-2.25/bfd/elf64-gen.c
@@ -1,6 +1,5 @@
/* Generic support for 64-bit ELF
- Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -87,9 +86,9 @@ elf64_generic_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
return bfd_elf_link_add_symbols (abfd, info);
}
-#define TARGET_LITTLE_SYM bfd_elf64_little_generic_vec
+#define TARGET_LITTLE_SYM elf64_le_vec
#define TARGET_LITTLE_NAME "elf64-little"
-#define TARGET_BIG_SYM bfd_elf64_big_generic_vec
+#define TARGET_BIG_SYM elf64_be_vec
#define TARGET_BIG_NAME "elf64-big"
#define ELF_ARCH bfd_arch_unknown
#define ELF_MACHINE_CODE EM_NONE
diff --git a/binutils-2.25/bfd/elf64-hppa.c b/binutils-2.25/bfd/elf64-hppa.c
index c9925637..86f652dc 100644
--- a/binutils-2.25/bfd/elf64-hppa.c
+++ b/binutils-2.25/bfd/elf64-hppa.c
@@ -1,7 +1,5 @@
/* Support for HPPA 64-bit ELF
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -1582,7 +1580,7 @@ elf64_hppa_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
/* Set up DLT, PLT and OPD offsets for local syms, and space for local
dynamic relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_dlt;
bfd_signed_vma *end_local_dlt;
@@ -3870,6 +3868,11 @@ elf64_hppa_relocate_section (bfd *output_bfd,
eh = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ if (info->wrap_hash != NULL
+ && (input_section->flags & SEC_DEBUGGING) != 0)
+ eh = ((struct elf_link_hash_entry *)
+ unwrap_hash_lookup (info, input_bfd, &eh->root));
+
while (eh->root.type == bfd_link_hash_indirect
|| eh->root.type == bfd_link_hash_warning)
eh = (struct elf_link_hash_entry *) eh->root.u.i.link;
@@ -4016,7 +4019,7 @@ const struct elf_size_info hppa64_elf_size_info =
bfd_elf64_swap_reloca_out
};
-#define TARGET_BIG_SYM bfd_elf64_hppa_vec
+#define TARGET_BIG_SYM hppa_elf64_vec
#define TARGET_BIG_NAME "elf64-hppa"
#define ELF_ARCH bfd_arch_hppa
#define ELF_TARGET_ID HPPA64_ELF_DATA
@@ -4098,13 +4101,11 @@ const struct elf_size_info hppa64_elf_size_info =
#include "elf64-target.h"
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf64_hppa_linux_vec
+#define TARGET_BIG_SYM hppa_elf64_linux_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf64-hppa-linux"
#undef ELF_OSABI
#define ELF_OSABI ELFOSABI_GNU
-#undef elf_backend_post_process_headers
-#define elf_backend_post_process_headers _bfd_elf_set_osabi
#undef elf64_bed
#define elf64_bed elf64_hppa_linux_bed
diff --git a/binutils-2.25/bfd/elf64-hppa.h b/binutils-2.25/bfd/elf64-hppa.h
index addbd81d..198b4467 100644
--- a/binutils-2.25/bfd/elf64-hppa.h
+++ b/binutils-2.25/bfd/elf64-hppa.h
@@ -1,6 +1,6 @@
/* ELF64/HPPA support
- Copyright 1999, 2000, 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf64-ia64-vms.c b/binutils-2.25/bfd/elf64-ia64-vms.c
index 102cdff8..dd86e3c6 100644
--- a/binutils-2.25/bfd/elf64-ia64-vms.c
+++ b/binutils-2.25/bfd/elf64-ia64-vms.c
@@ -1,6 +1,5 @@
/* IA-64 support for OpenVMS
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -976,40 +975,6 @@ elf64_ia64_local_htab_eq (const void *ptr1, const void *ptr2)
return entry1->id == entry2->id && entry1->r_sym == entry2->r_sym;
}
-/* Create the derived linker hash table. The IA-64 ELF port uses this
- derived hash table to keep information specific to the IA-64 ElF
- linker (without using static variables). */
-
-static struct bfd_link_hash_table *
-elf64_ia64_hash_table_create (bfd *abfd)
-{
- struct elf64_ia64_link_hash_table *ret;
-
- ret = bfd_zmalloc ((bfd_size_type) sizeof (*ret));
- if (!ret)
- return NULL;
-
- if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
- elf64_ia64_new_elf_hash_entry,
- sizeof (struct elf64_ia64_link_hash_entry),
- IA64_ELF_DATA))
- {
- free (ret);
- return NULL;
- }
-
- ret->loc_hash_table = htab_try_create (1024, elf64_ia64_local_htab_hash,
- elf64_ia64_local_htab_eq, NULL);
- ret->loc_hash_memory = objalloc_create ();
- if (!ret->loc_hash_table || !ret->loc_hash_memory)
- {
- free (ret);
- return NULL;
- }
-
- return &ret->root.root;
-}
-
/* Free the global elf64_ia64_dyn_sym_info array. */
static bfd_boolean
@@ -1058,10 +1023,10 @@ elf64_ia64_local_dyn_info_free (void **slot,
/* Destroy IA-64 linker hash table. */
static void
-elf64_ia64_hash_table_free (struct bfd_link_hash_table *hash)
+elf64_ia64_link_hash_table_free (bfd *obfd)
{
struct elf64_ia64_link_hash_table *ia64_info
- = (struct elf64_ia64_link_hash_table *) hash;
+ = (struct elf64_ia64_link_hash_table *) obfd->link.hash;
if (ia64_info->loc_hash_table)
{
htab_traverse (ia64_info->loc_hash_table,
@@ -1072,7 +1037,42 @@ elf64_ia64_hash_table_free (struct bfd_link_hash_table *hash)
objalloc_free ((struct objalloc *) ia64_info->loc_hash_memory);
elf_link_hash_traverse (&ia64_info->root,
elf64_ia64_global_dyn_info_free, NULL);
- _bfd_elf_link_hash_table_free (hash);
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
+/* Create the derived linker hash table. The IA-64 ELF port uses this
+ derived hash table to keep information specific to the IA-64 ElF
+ linker (without using static variables). */
+
+static struct bfd_link_hash_table *
+elf64_ia64_hash_table_create (bfd *abfd)
+{
+ struct elf64_ia64_link_hash_table *ret;
+
+ ret = bfd_zmalloc ((bfd_size_type) sizeof (*ret));
+ if (!ret)
+ return NULL;
+
+ if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
+ elf64_ia64_new_elf_hash_entry,
+ sizeof (struct elf64_ia64_link_hash_entry),
+ IA64_ELF_DATA))
+ {
+ free (ret);
+ return NULL;
+ }
+
+ ret->loc_hash_table = htab_try_create (1024, elf64_ia64_local_htab_hash,
+ elf64_ia64_local_htab_eq, NULL);
+ ret->loc_hash_memory = objalloc_create ();
+ if (!ret->loc_hash_table || !ret->loc_hash_memory)
+ {
+ elf64_ia64_link_hash_table_free (abfd);
+ return NULL;
+ }
+ ret->root.root.hash_table_free = elf64_ia64_link_hash_table_free;
+
+ return &ret->root.root;
}
/* Traverse both local and global hash tables. */
@@ -2819,7 +2819,7 @@ elf64_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
return FALSE;
/* Add entries for shared libraries. */
- for (abfd = info->input_bfds; abfd; abfd = abfd->link_next)
+ for (abfd = info->input_bfds; abfd; abfd = abfd->link.next)
{
char *soname;
size_t soname_len;
@@ -3495,13 +3495,13 @@ elf64_ia64_relocate_section (bfd *output_bfd,
else
{
bfd_boolean unresolved_reloc;
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sym_sec, value,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
if (h->root.type == bfd_link_hash_undefweak)
undef_weak_ref = TRUE;
@@ -5459,8 +5459,6 @@ static const struct elf_size_info elf64_ia64_vms_size_info = {
/* Stuff for the BFD linker: */
#define bfd_elf64_bfd_link_hash_table_create \
elf64_ia64_hash_table_create
-#define bfd_elf64_bfd_link_hash_table_free \
- elf64_ia64_hash_table_free
#define elf_backend_create_dynamic_sections \
elf64_ia64_create_dynamic_sections
#define elf_backend_check_relocs \
@@ -5513,7 +5511,7 @@ static const struct elf_size_info elf64_ia64_vms_size_info = {
/* VMS-specific vectors. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf64_ia64_vms_vec
+#define TARGET_LITTLE_SYM ia64_elf64_vms_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-ia64-vms"
#undef TARGET_BIG_SYM
diff --git a/binutils-2.25/bfd/elf64-mips.c b/binutils-2.25/bfd/elf64-mips.c
index a0c5cc59..2f323c6d 100644
--- a/binutils-2.25/bfd/elf64-mips.c
+++ b/binutils-2.25/bfd/elf64-mips.c
@@ -1,7 +1,5 @@
/* MIPS-specific support for 64-bit ELF
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Ian Lance Taylor, Cygnus Support
Linker support added by Mark Mitchell, CodeSourcery, LLC.
<mark@codesourcery.com>
@@ -130,8 +128,8 @@ static bfd_boolean elf64_mips_grok_prstatus
static bfd_boolean elf64_mips_grok_psinfo
(bfd *, Elf_Internal_Note *);
-extern const bfd_target bfd_elf64_bigmips_vec;
-extern const bfd_target bfd_elf64_littlemips_vec;
+extern const bfd_target mips_elf64_be_vec;
+extern const bfd_target mips_elf64_le_vec;
/* In case we're on a 32-bit machine, construct a 64-bit "-1" value
from smaller values. Start with zero, widen, *then* decrement. */
@@ -807,6 +805,100 @@ static reloc_howto_type mips_elf64_howto_table_rel[] =
0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
+
+ EMPTY_HOWTO (52),
+ EMPTY_HOWTO (53),
+ EMPTY_HOWTO (54),
+ EMPTY_HOWTO (55),
+ EMPTY_HOWTO (56),
+ EMPTY_HOWTO (57),
+ EMPTY_HOWTO (58),
+ EMPTY_HOWTO (59),
+
+ HOWTO (R_MIPS_PC21_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 21, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC21_S2", /* name */
+ TRUE, /* partial_inplace */
+ 0x001fffff, /* src_mask */
+ 0x001fffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC26_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC26_S2", /* name */
+ TRUE, /* partial_inplace */
+ 0x03ffffff, /* src_mask */
+ 0x03ffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC18_S3, /* type */
+ 3, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 18, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC18_S3", /* name */
+ TRUE, /* partial_inplace */
+ 0x0003ffff, /* src_mask */
+ 0x0003ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC19_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 19, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC19_S2", /* name */
+ TRUE, /* partial_inplace */
+ 0x0007ffff, /* src_mask */
+ 0x0007ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PCHI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PCHI16", /* name */
+ TRUE, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PCLO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PCLO16", /* name */
+ TRUE, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
};
/* The relocation table used for SHT_RELA sections. */
@@ -1494,6 +1586,100 @@ static reloc_howto_type mips_elf64_howto_table_rela[] =
0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
+
+ EMPTY_HOWTO (52),
+ EMPTY_HOWTO (53),
+ EMPTY_HOWTO (54),
+ EMPTY_HOWTO (55),
+ EMPTY_HOWTO (56),
+ EMPTY_HOWTO (57),
+ EMPTY_HOWTO (58),
+ EMPTY_HOWTO (59),
+
+ HOWTO (R_MIPS_PC21_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 21, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC21_S2", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x001fffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC26_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC26_S2", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x03ffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC18_S3, /* type */
+ 3, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 18, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC18_S3", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0003ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC19_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 19, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC19_S2", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0007ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PCHI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PCHI16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PCLO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PCLO16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
};
static reloc_howto_type mips16_elf64_howto_table_rel[] =
@@ -3204,7 +3390,13 @@ static const struct elf_reloc_map mips_reloc_map[] =
{ BFD_RELOC_MIPS_TLS_TPREL32, R_MIPS_TLS_TPREL32 },
{ BFD_RELOC_MIPS_TLS_TPREL64, R_MIPS_TLS_TPREL64 },
{ BFD_RELOC_MIPS_TLS_TPREL_HI16, R_MIPS_TLS_TPREL_HI16 },
- { BFD_RELOC_MIPS_TLS_TPREL_LO16, R_MIPS_TLS_TPREL_LO16 }
+ { BFD_RELOC_MIPS_TLS_TPREL_LO16, R_MIPS_TLS_TPREL_LO16 },
+ { BFD_RELOC_MIPS_21_PCREL_S2, R_MIPS_PC21_S2 },
+ { BFD_RELOC_MIPS_26_PCREL_S2, R_MIPS_PC26_S2 },
+ { BFD_RELOC_MIPS_18_PCREL_S3, R_MIPS_PC18_S3 },
+ { BFD_RELOC_MIPS_19_PCREL_S2, R_MIPS_PC19_S2 },
+ { BFD_RELOC_HI16_S_PCREL, R_MIPS_PCHI16 },
+ { BFD_RELOC_LO16_PCREL, R_MIPS_PCLO16 }
};
static const struct elf_reloc_map mips16_reloc_map[] =
@@ -4033,8 +4225,8 @@ mips_elf64_object_p (bfd *abfd)
static irix_compat_t
elf64_mips_irix_compat (bfd *abfd)
{
- if ((abfd->xvec == &bfd_elf64_bigmips_vec)
- || (abfd->xvec == &bfd_elf64_littlemips_vec))
+ if ((abfd->xvec == &mips_elf64_be_vec)
+ || (abfd->xvec == &mips_elf64_le_vec))
return ict_irix6;
else
return ict_none;
@@ -4187,6 +4379,8 @@ const struct elf_size_info mips_elf64_size_info =
#define elf_backend_collect TRUE
#define elf_backend_type_change_ok TRUE
#define elf_backend_can_gc_sections TRUE
+#define elf_backend_gc_mark_extra_sections \
+ _bfd_mips_elf_gc_mark_extra_sections
#define elf_info_to_howto mips_elf64_info_to_howto_rela
#define elf_info_to_howto_rel mips_elf64_info_to_howto_rel
#define elf_backend_object_p mips_elf64_object_p
@@ -4302,9 +4496,9 @@ extern bfd_boolean bfd_elf64_archive_write_armap
_bfd_archive_coff_update_armap_timestamp
/* The SGI style (n)64 NewABI. */
-#define TARGET_LITTLE_SYM bfd_elf64_littlemips_vec
+#define TARGET_LITTLE_SYM mips_elf64_le_vec
#define TARGET_LITTLE_NAME "elf64-littlemips"
-#define TARGET_BIG_SYM bfd_elf64_bigmips_vec
+#define TARGET_BIG_SYM mips_elf64_be_vec
#define TARGET_BIG_NAME "elf64-bigmips"
#define ELF_MAXPAGESIZE 0x10000
@@ -4321,9 +4515,9 @@ extern bfd_boolean bfd_elf64_archive_write_armap
#undef ELF_MAXPAGESIZE
#undef ELF_COMMONPAGESIZE
-#define TARGET_LITTLE_SYM bfd_elf64_tradlittlemips_vec
+#define TARGET_LITTLE_SYM mips_elf64_trad_le_vec
#define TARGET_LITTLE_NAME "elf64-tradlittlemips"
-#define TARGET_BIG_SYM bfd_elf64_tradbigmips_vec
+#define TARGET_BIG_SYM mips_elf64_trad_be_vec
#define TARGET_BIG_NAME "elf64-tradbigmips"
#define ELF_MAXPAGESIZE 0x10000
@@ -4341,26 +4535,14 @@ extern bfd_boolean bfd_elf64_archive_write_armap
#undef TARGET_BIG_SYM
#undef TARGET_BIG_NAME
-#define TARGET_LITTLE_SYM bfd_elf64_tradlittlemips_freebsd_vec
+#define TARGET_LITTLE_SYM mips_elf64_tradfbsd_le_vec
#define TARGET_LITTLE_NAME "elf64-tradlittlemips-freebsd"
-#define TARGET_BIG_SYM bfd_elf64_tradbigmips_freebsd_vec
+#define TARGET_BIG_SYM mips_elf64_tradfbsd_be_vec
#define TARGET_BIG_NAME "elf64-tradbigmips-freebsd"
#undef ELF_OSABI
#define ELF_OSABI ELFOSABI_FREEBSD
-/* The kernel recognizes executables as valid only if they carry a
- "FreeBSD" label in the ELF header. So we put this label on all
- executables and (for simplicity) also all other object files. */
-
-static void
-elf_fbsd_post_process_headers (bfd *abfd, struct bfd_link_info *info)
-{
- _bfd_elf_set_osabi (abfd, info);
-}
-
-#undef elf_backend_post_process_headers
-#define elf_backend_post_process_headers elf_fbsd_post_process_headers
#undef elf64_bed
#define elf64_bed elf64_fbsd_tradbed
diff --git a/binutils-2.25/bfd/elf64-mmix.c b/binutils-2.25/bfd/elf64-mmix.c
index 499bcd60..58fca928 100644
--- a/binutils-2.25/bfd/elf64-mmix.c
+++ b/binutils-2.25/bfd/elf64-mmix.c
@@ -1,7 +1,5 @@
/* MMIX-specific support for 64-bit ELF.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011,
- 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson <hp@bitrange.com>
This file is part of BFD, the Binary File Descriptor library.
@@ -1413,12 +1411,13 @@ mmix_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
}
else
{
- bfd_boolean unresolved_reloc;
+ bfd_boolean unresolved_reloc, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, undefined_signalled);
+ unresolved_reloc, undefined_signalled,
+ ignored);
name = h->root.root.string;
}
@@ -2323,7 +2322,7 @@ _bfd_mmix_before_linker_allocation (bfd *abfd ATTRIBUTE_UNUSED,
bfd *ibfd;
/* Set the initial size of sections. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
bfd_map_over_sections (ibfd, mmix_set_relaxable_size, info);
/* The bpo_greg_owner bfd is supposed to have been set by
@@ -2903,7 +2902,7 @@ mmix_elf_relax_section (bfd *abfd,
alignment. */
#define ELF_MAXPAGESIZE 0x100
-#define TARGET_BIG_SYM bfd_elf64_mmix_vec
+#define TARGET_BIG_SYM mmix_elf64_vec
#define TARGET_BIG_NAME "elf64-mmix"
#define elf_info_to_howto_rel NULL
diff --git a/binutils-2.25/bfd/elf64-ppc.c b/binutils-2.25/bfd/elf64-ppc.c
index 3df01f64..0b65ab19 100644
--- a/binutils-2.25/bfd/elf64-ppc.c
+++ b/binutils-2.25/bfd/elf64-ppc.c
@@ -1,6 +1,5 @@
/* PowerPC64-specific support for 64-bit ELF.
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
Written by Linus Nordberg, Swox AB <info@swox.com>,
based on elf32-ppc.c by Ian Lance Taylor.
Largely rewritten by Alan Modra.
@@ -57,9 +56,9 @@ static bfd_reloc_status_type ppc64_elf_unhandled_reloc
static bfd_vma opd_entry_value
(asection *, bfd_vma, asection **, bfd_vma *, bfd_boolean);
-#define TARGET_LITTLE_SYM bfd_elf64_powerpcle_vec
+#define TARGET_LITTLE_SYM powerpc_elf64_le_vec
#define TARGET_LITTLE_NAME "elf64-powerpcle"
-#define TARGET_BIG_SYM bfd_elf64_powerpc_vec
+#define TARGET_BIG_SYM powerpc_elf64_vec
#define TARGET_BIG_NAME "elf64-powerpc"
#define ELF_ARCH bfd_arch_powerpc
#define ELF_TARGET_ID PPC64_ELF_DATA
@@ -81,10 +80,10 @@ static bfd_vma opd_entry_value
#define bfd_elf64_mkobject ppc64_elf_mkobject
#define bfd_elf64_bfd_reloc_type_lookup ppc64_elf_reloc_type_lookup
#define bfd_elf64_bfd_reloc_name_lookup ppc64_elf_reloc_name_lookup
-#define bfd_elf64_bfd_merge_private_bfd_data _bfd_generic_verify_endian_match
+#define bfd_elf64_bfd_merge_private_bfd_data ppc64_elf_merge_private_bfd_data
+#define bfd_elf64_bfd_print_private_bfd_data ppc64_elf_print_private_bfd_data
#define bfd_elf64_new_section_hook ppc64_elf_new_section_hook
#define bfd_elf64_bfd_link_hash_table_create ppc64_elf_link_hash_table_create
-#define bfd_elf64_bfd_link_hash_table_free ppc64_elf_link_hash_table_free
#define bfd_elf64_get_synthetic_symtab ppc64_elf_get_synthetic_symtab
#define bfd_elf64_bfd_link_just_syms ppc64_elf_link_just_syms
@@ -95,7 +94,7 @@ static bfd_vma opd_entry_value
#define elf_backend_create_dynamic_sections ppc64_elf_create_dynamic_sections
#define elf_backend_copy_indirect_symbol ppc64_elf_copy_indirect_symbol
#define elf_backend_add_symbol_hook ppc64_elf_add_symbol_hook
-#define elf_backend_check_directives ppc64_elf_process_dot_syms
+#define elf_backend_check_directives ppc64_elf_before_check_relocs
#define elf_backend_notice_as_needed ppc64_elf_notice_as_needed
#define elf_backend_archive_symbol_lookup ppc64_elf_archive_symbol_lookup
#define elf_backend_check_relocs ppc64_elf_check_relocs
@@ -108,6 +107,7 @@ static bfd_vma opd_entry_value
#define elf_backend_maybe_function_sym ppc64_elf_maybe_function_sym
#define elf_backend_always_size_sections ppc64_elf_func_desc_adjust
#define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections
+#define elf_backend_hash_symbol ppc64_elf_hash_symbol
#define elf_backend_init_index_section _bfd_elf_init_2_index_sections
#define elf_backend_action_discarded ppc64_elf_action_discarded
#define elf_backend_relocate_section ppc64_elf_relocate_section
@@ -116,17 +116,25 @@ static bfd_vma opd_entry_value
#define elf_backend_finish_dynamic_sections ppc64_elf_finish_dynamic_sections
#define elf_backend_link_output_symbol_hook ppc64_elf_output_symbol_hook
#define elf_backend_special_sections ppc64_elf_special_sections
-#define elf_backend_post_process_headers _bfd_elf_set_osabi
+#define elf_backend_merge_symbol_attribute ppc64_elf_merge_symbol_attribute
/* The name of the dynamic interpreter. This is put in the .interp
section. */
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
/* The size in bytes of an entry in the procedure linkage table. */
-#define PLT_ENTRY_SIZE 24
+#define PLT_ENTRY_SIZE(htab) (htab->opd_abi ? 24 : 8)
/* The initial size of the plt reserved for the dynamic linker. */
-#define PLT_INITIAL_ENTRY_SIZE PLT_ENTRY_SIZE
+#define PLT_INITIAL_ENTRY_SIZE(htab) (htab->opd_abi ? 24 : 16)
+
+/* Offsets to some stack save slots. */
+#define STK_LR 16
+#define STK_TOC(htab) (htab->opd_abi ? 40 : 24)
+/* This one is dodgy. ELFv2 does not have a linker word, so use the
+ CR save slot. Used only by optimised __tls_get_addr call stub,
+ relying on __tls_get_addr_opt not saving CR.. */
+#define STK_LINKER(htab) (htab->opd_abi ? 32 : 8)
/* TOC base pointers offset from start of TOC. */
#define TOC_BASE_OFF 0x8000
@@ -137,33 +145,36 @@ static bfd_vma opd_entry_value
/* .plt call stub instructions. The normal stub is like this, but
sometimes the .plt entry crosses a 64k boundary and we need to
- insert an addi to adjust r12. */
-#define PLT_CALL_STUB_SIZE (7*4)
-#define ADDIS_R12_R2 0x3d820000 /* addis %r12,%r2,xxx@ha */
-#define STD_R2_40R1 0xf8410028 /* std %r2,40(%r1) */
-#define LD_R11_0R12 0xe96c0000 /* ld %r11,xxx+0@l(%r12) */
-#define MTCTR_R11 0x7d6903a6 /* mtctr %r11 */
-#define LD_R2_0R12 0xe84c0000 /* ld %r2,xxx+8@l(%r12) */
- /* ld %r11,xxx+16@l(%r12) */
+ insert an addi to adjust r11. */
+#define STD_R2_0R1 0xf8410000 /* std %r2,0+40(%r1) */
+#define ADDIS_R11_R2 0x3d620000 /* addis %r11,%r2,xxx@ha */
+#define LD_R12_0R11 0xe98b0000 /* ld %r12,xxx+0@l(%r11) */
+#define MTCTR_R12 0x7d8903a6 /* mtctr %r12 */
+#define LD_R2_0R11 0xe84b0000 /* ld %r2,xxx+8@l(%r11) */
+#define LD_R11_0R11 0xe96b0000 /* ld %r11,xxx+16@l(%r11) */
#define BCTR 0x4e800420 /* bctr */
-
-#define ADDIS_R12_R12 0x3d8c0000 /* addis %r12,%r12,off@ha */
-#define ADDI_R12_R12 0x398c0000 /* addi %r12,%r12,off@l */
+#define ADDI_R11_R11 0x396b0000 /* addi %r11,%r11,off@l */
#define ADDIS_R2_R2 0x3c420000 /* addis %r2,%r2,off@ha */
#define ADDI_R2_R2 0x38420000 /* addi %r2,%r2,off@l */
-#define XOR_R11_R11_R11 0x7d6b5a78 /* xor %r11,%r11,%r11 */
-#define ADD_R12_R12_R11 0x7d8c5a14 /* add %r12,%r12,%r11 */
+#define XOR_R2_R12_R12 0x7d826278 /* xor %r2,%r12,%r12 */
+#define ADD_R11_R11_R2 0x7d6b1214 /* add %r11,%r11,%r2 */
+#define XOR_R11_R12_R12 0x7d8b6278 /* xor %r11,%r12,%r12 */
#define ADD_R2_R2_R11 0x7c425a14 /* add %r2,%r2,%r11 */
#define CMPLDI_R2_0 0x28220000 /* cmpldi %r2,0 */
#define BNECTR 0x4ca20420 /* bnectr+ */
#define BNECTR_P4 0x4ce20420 /* bnectr+ */
+#define LD_R12_0R2 0xe9820000 /* ld %r12,xxx+0(%r2) */
#define LD_R11_0R2 0xe9620000 /* ld %r11,xxx+0(%r2) */
#define LD_R2_0R2 0xe8420000 /* ld %r2,xxx+0(%r2) */
-#define LD_R2_40R1 0xe8410028 /* ld %r2,40(%r1) */
+#define LD_R2_0R1 0xe8410000 /* ld %r2,0(%r1) */
+
+#define ADDIS_R12_R2 0x3d820000 /* addis %r12,%r2,xxx@ha */
+#define ADDIS_R12_R12 0x3d8c0000 /* addis %r12,%r12,xxx@ha */
+#define LD_R12_0R12 0xe98c0000 /* ld %r12,xxx@l(%r12) */
/* glink call stub instructions. We enter with the index in R0. */
#define GLINK_CALL_STUB_SIZE (16*4)
@@ -174,14 +185,19 @@ static bfd_vma opd_entry_value
#define BCL_20_31 0x429f0005 /* bcl 20,31,1f */
/* 1: */
#define MFLR_R11 0x7d6802a6 /* mflr %11 */
-#define LD_R2_M16R11 0xe84bfff0 /* ld %2,(0b-1b)(%11) */
+ /* ld %2,(0b-1b)(%11) */
#define MTLR_R12 0x7d8803a6 /* mtlr %12 */
-#define ADD_R12_R2_R11 0x7d825a14 /* add %12,%2,%11 */
- /* ld %11,0(%12) */
- /* ld %2,8(%12) */
- /* mtctr %11 */
- /* ld %11,16(%12) */
+#define ADD_R11_R2_R11 0x7d625a14 /* add %11,%2,%11 */
+ /* ld %12,0(%11) */
+ /* ld %2,8(%11) */
+ /* mtctr %12 */
+ /* ld %11,16(%11) */
/* bctr */
+#define MFLR_R0 0x7c0802a6 /* mflr %r0 */
+#define MTLR_R0 0x7c0803a6 /* mtlr %r0 */
+#define SUB_R12_R12_R11 0x7d8b6050 /* subf %r12,%r11,%r12 */
+#define ADDI_R0_R12 0x380c0000 /* addi %r0,%r12,0 */
+#define SRDI_R0_R0_2 0x7800f082 /* rldicl %r0,%r0,62,2 */
/* Pad with this. */
#define NOP 0x60000000
@@ -219,6 +235,19 @@ static bfd_vma opd_entry_value
#ifndef NO_OPD_RELOCS
#define NO_OPD_RELOCS 0
#endif
+
+static inline int
+abiversion (bfd *abfd)
+{
+ return elf_elfheader (abfd)->e_flags & EF_PPC64_ABI;
+}
+
+static inline void
+set_abiversion (bfd *abfd, int ver)
+{
+ elf_elfheader (abfd)->e_flags &= ~EF_PPC64_ABI;
+ elf_elfheader (abfd)->e_flags |= ver & EF_PPC64_ABI;
+}
#define ONES(n) (((bfd_vma) 1 << ((n) - 1) << 1) - 1)
@@ -309,7 +338,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC64_ADDR16_HI", /* name */
FALSE, /* partial_inplace */
@@ -325,7 +354,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_ha_reloc, /* special_function */
"R_PPC64_ADDR16_HA", /* name */
FALSE, /* partial_inplace */
@@ -341,7 +370,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_branch_reloc, /* special_function */
"R_PPC64_ADDR14", /* name */
FALSE, /* partial_inplace */
@@ -358,7 +387,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_brtaken_reloc, /* special_function */
"R_PPC64_ADDR14_BRTAKEN",/* name */
FALSE, /* partial_inplace */
@@ -375,7 +404,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_brtaken_reloc, /* special_function */
"R_PPC64_ADDR14_BRNTAKEN",/* name */
FALSE, /* partial_inplace */
@@ -487,7 +516,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
+ complain_overflow_signed,/* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_GOT16_HI", /* name */
FALSE, /* partial_inplace */
@@ -503,7 +532,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
+ complain_overflow_signed,/* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_GOT16_HA", /* name */
FALSE, /* partial_inplace */
@@ -616,7 +645,6 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
32, /* bitsize */
TRUE, /* pc_relative */
0, /* bitpos */
- /* FIXME: Verify. Was complain_overflow_bitfield. */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC64_REL32", /* name */
@@ -680,7 +708,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_PLT16_HI", /* name */
FALSE, /* partial_inplace */
@@ -696,7 +724,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_PLT16_HA", /* name */
FALSE, /* partial_inplace */
@@ -711,7 +739,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_sectoff_reloc, /* special_function */
"R_PPC64_SECTOFF", /* name */
FALSE, /* partial_inplace */
@@ -741,7 +769,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_sectoff_reloc, /* special_function */
"R_PPC64_SECTOFF_HI", /* name */
FALSE, /* partial_inplace */
@@ -756,7 +784,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_sectoff_ha_reloc, /* special_function */
"R_PPC64_SECTOFF_HA", /* name */
FALSE, /* partial_inplace */
@@ -963,7 +991,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_toc_reloc, /* special_function */
"R_PPC64_TOC16_HI", /* name */
FALSE, /* partial_inplace */
@@ -982,7 +1010,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_toc_ha_reloc, /* special_function */
"R_PPC64_TOC16_HA", /* name */
FALSE, /* partial_inplace */
@@ -999,7 +1027,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
64, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
ppc64_elf_toc64_reloc, /* special_function */
"R_PPC64_TOC", /* name */
FALSE, /* partial_inplace */
@@ -1054,7 +1082,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_PLTGOT16_HI", /* name */
FALSE, /* partial_inplace */
@@ -1072,7 +1100,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_PLTGOT16_HA", /* name */
FALSE, /* partial_inplace */
@@ -1087,7 +1115,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC64_ADDR16_DS", /* name */
FALSE, /* partial_inplace */
@@ -1162,7 +1190,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_sectoff_reloc, /* special_function */
"R_PPC64_SECTOFF_DS", /* name */
FALSE, /* partial_inplace */
@@ -1374,7 +1402,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_DTPREL16_HI", /* name */
FALSE, /* partial_inplace */
@@ -1389,7 +1417,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_DTPREL16_HA", /* name */
FALSE, /* partial_inplace */
@@ -1540,7 +1568,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_TPREL16_HI", /* name */
FALSE, /* partial_inplace */
@@ -1555,7 +1583,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_TPREL16_HA", /* name */
FALSE, /* partial_inplace */
@@ -1692,7 +1720,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_GOT_TLSGD16_HI", /* name */
FALSE, /* partial_inplace */
@@ -1707,7 +1735,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_GOT_TLSGD16_HA", /* name */
FALSE, /* partial_inplace */
@@ -1754,7 +1782,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_GOT_TLSLD16_HI", /* name */
FALSE, /* partial_inplace */
@@ -1769,7 +1797,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_GOT_TLSLD16_HA", /* name */
FALSE, /* partial_inplace */
@@ -1815,7 +1843,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_GOT_DTPREL16_HI", /* name */
FALSE, /* partial_inplace */
@@ -1830,7 +1858,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_GOT_DTPREL16_HA", /* name */
FALSE, /* partial_inplace */
@@ -1876,7 +1904,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_GOT_TPREL16_HI", /* name */
FALSE, /* partial_inplace */
@@ -1891,7 +1919,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_unhandled_reloc, /* special_function */
"R_PPC64_GOT_TPREL16_HA", /* name */
FALSE, /* partial_inplace */
@@ -1934,7 +1962,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
TRUE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC64_REL16", /* name */
FALSE, /* partial_inplace */
@@ -1964,7 +1992,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
TRUE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_PPC64_REL16_HI", /* name */
FALSE, /* partial_inplace */
@@ -1980,7 +2008,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
16, /* bitsize */
TRUE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
ppc64_elf_ha_reloc, /* special_function */
"R_PPC64_REL16_HA", /* name */
FALSE, /* partial_inplace */
@@ -1988,6 +2016,111 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
0xffff, /* dst_mask */
TRUE), /* pcrel_offset */
+ /* Like R_PPC64_ADDR16_HI, but no overflow. */
+ HOWTO (R_PPC64_ADDR16_HIGH, /* type */
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC64_ADDR16_HIGH", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like R_PPC64_ADDR16_HA, but no overflow. */
+ HOWTO (R_PPC64_ADDR16_HIGHA, /* type */
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc64_elf_ha_reloc, /* special_function */
+ "R_PPC64_ADDR16_HIGHA", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like R_PPC64_DTPREL16_HI, but no overflow. */
+ HOWTO (R_PPC64_DTPREL16_HIGH,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc64_elf_unhandled_reloc, /* special_function */
+ "R_PPC64_DTPREL16_HIGH", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like R_PPC64_DTPREL16_HA, but no overflow. */
+ HOWTO (R_PPC64_DTPREL16_HIGHA,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc64_elf_unhandled_reloc, /* special_function */
+ "R_PPC64_DTPREL16_HIGHA", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like R_PPC64_TPREL16_HI, but no overflow. */
+ HOWTO (R_PPC64_TPREL16_HIGH,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc64_elf_unhandled_reloc, /* special_function */
+ "R_PPC64_TPREL16_HIGH", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like R_PPC64_TPREL16_HA, but no overflow. */
+ HOWTO (R_PPC64_TPREL16_HIGHA,
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc64_elf_unhandled_reloc, /* special_function */
+ "R_PPC64_TPREL16_HIGHA", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* Like ADDR64, but use local entry point of function. */
+ HOWTO (R_PPC64_ADDR64_LOCAL, /* type */
+ 0, /* rightshift */
+ 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */
+ 64, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC64_ADDR64_LOCAL", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ ONES (64), /* dst_mask */
+ FALSE), /* pcrel_offset */
+
/* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_PPC64_GNU_VTINHERIT, /* type */
0, /* rightshift */
@@ -2066,8 +2199,12 @@ ppc64_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
break;
case BFD_RELOC_HI16: r = R_PPC64_ADDR16_HI;
break;
+ case BFD_RELOC_PPC64_ADDR16_HIGH: r = R_PPC64_ADDR16_HIGH;
+ break;
case BFD_RELOC_HI16_S: r = R_PPC64_ADDR16_HA;
break;
+ case BFD_RELOC_PPC64_ADDR16_HIGHA: r = R_PPC64_ADDR16_HIGHA;
+ break;
case BFD_RELOC_PPC_BA16: r = R_PPC64_ADDR14;
break;
case BFD_RELOC_PPC_BA16_BRTAKEN: r = R_PPC64_ADDR14_BRTAKEN;
@@ -2186,8 +2323,12 @@ ppc64_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
break;
case BFD_RELOC_PPC_TPREL16_HI: r = R_PPC64_TPREL16_HI;
break;
+ case BFD_RELOC_PPC64_TPREL16_HIGH: r = R_PPC64_TPREL16_HIGH;
+ break;
case BFD_RELOC_PPC_TPREL16_HA: r = R_PPC64_TPREL16_HA;
break;
+ case BFD_RELOC_PPC64_TPREL16_HIGHA: r = R_PPC64_TPREL16_HIGHA;
+ break;
case BFD_RELOC_PPC_TPREL: r = R_PPC64_TPREL64;
break;
case BFD_RELOC_PPC_DTPREL16: r = R_PPC64_DTPREL16;
@@ -2196,8 +2337,12 @@ ppc64_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
break;
case BFD_RELOC_PPC_DTPREL16_HI: r = R_PPC64_DTPREL16_HI;
break;
+ case BFD_RELOC_PPC64_DTPREL16_HIGH: r = R_PPC64_DTPREL16_HIGH;
+ break;
case BFD_RELOC_PPC_DTPREL16_HA: r = R_PPC64_DTPREL16_HA;
break;
+ case BFD_RELOC_PPC64_DTPREL16_HIGHA: r = R_PPC64_DTPREL16_HIGHA;
+ break;
case BFD_RELOC_PPC_DTPREL: r = R_PPC64_DTPREL64;
break;
case BFD_RELOC_PPC_GOT_TLSGD16: r = R_PPC64_GOT_TLSGD16;
@@ -2264,6 +2409,8 @@ ppc64_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
break;
case BFD_RELOC_HI16_S_PCREL: r = R_PPC64_REL16_HA;
break;
+ case BFD_RELOC_PPC64_ADDR64_LOCAL: r = R_PPC64_ADDR64_LOCAL;
+ break;
case BFD_RELOC_VTABLE_INHERIT: r = R_PPC64_GNU_VTINHERIT;
break;
case BFD_RELOC_VTABLE_ENTRY: r = R_PPC64_GNU_VTENTRY;
@@ -2353,6 +2500,29 @@ ppc64_elf_branch_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
+ symbol->section->output_section->vma
+ symbol->section->output_offset);
}
+ else
+ {
+ elf_symbol_type *elfsym = (elf_symbol_type *) symbol;
+
+ if (symbol->section->owner != abfd
+ && abiversion (symbol->section->owner) >= 2)
+ {
+ unsigned int i;
+
+ for (i = 0; i < symbol->section->owner->symcount; ++i)
+ {
+ asymbol *symdef = symbol->section->owner->outsymbols[i];
+
+ if (strcmp (symdef->name, symbol->name) == 0)
+ {
+ elfsym = (elf_symbol_type *) symdef;
+ break;
+ }
+ }
+ }
+ reloc_entry->addend
+ += PPC64_LOCAL_ENTRY_OFFSET (elfsym->internal_elf_sym.st_other);
+ }
return bfd_reloc_continue;
}
@@ -2987,15 +3157,19 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
long count;
char *names;
long symcount, codesecsym, codesecsymend, secsymend, opdsymend;
- asection *opd;
+ asection *opd = NULL;
bfd_boolean relocatable = (abfd->flags & (EXEC_P | DYNAMIC)) == 0;
asymbol **syms;
+ int abi = abiversion (abfd);
*ret = NULL;
- opd = bfd_get_section_by_name (abfd, ".opd");
- if (opd == NULL)
- return 0;
+ if (abi < 2)
+ {
+ opd = bfd_get_section_by_name (abfd, ".opd");
+ if (opd == NULL && abi == 1)
+ return 0;
+ }
symcount = static_count;
if (!relocatable)
@@ -3164,20 +3338,18 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
else
{
bfd_boolean (*slurp_relocs) (bfd *, asection *, asymbol **, bfd_boolean);
- bfd_byte *contents;
+ bfd_byte *contents = NULL;
size_t size;
long plt_count = 0;
bfd_vma glink_vma = 0, resolv_vma = 0;
asection *dynamic, *glink = NULL, *relplt = NULL;
arelent *p;
- if (!bfd_malloc_and_get_section (abfd, opd, &contents))
+ if (opd != NULL && !bfd_malloc_and_get_section (abfd, opd, &contents))
{
+ free_contents_and_exit:
if (contents)
- {
- free_contents_and_exit:
- free (contents);
- }
+ free (contents);
count = -1;
goto done;
}
@@ -3226,9 +3398,9 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
if (dyn.d_tag == DT_PPC64_GLINK)
{
- /* The first glink stub starts at offset 32; see comment in
- ppc64_elf_finish_dynamic_sections. */
- glink_vma = dyn.d_un.d_val + 32;
+ /* The first glink stub starts at offset 32; see
+ comment in ppc64_elf_finish_dynamic_sections. */
+ glink_vma = dyn.d_un.d_val + GLINK_CALL_STUB_SIZE - 8 * 4;
/* The .glink section usually does not survive the final
link; search for the section (usually .text) where the
glink stubs now reside. */
@@ -3246,13 +3418,21 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
/* Determine __glink trampoline by reading the relative branch
from the first glink stub. */
bfd_byte buf[4];
- if (bfd_get_section_contents (abfd, glink, buf,
- glink_vma + 4 - glink->vma, 4))
+ unsigned int off = 0;
+
+ while (bfd_get_section_contents (abfd, glink, buf,
+ glink_vma + off - glink->vma, 4))
{
unsigned int insn = bfd_get_32 (abfd, buf);
insn ^= B_DOT;
if ((insn & ~0x3fffffc) == 0)
- resolv_vma = glink_vma + 4 + (insn ^ 0x2000000) - 0x2000000;
+ {
+ resolv_vma = glink_vma + off + (insn ^ 0x2000000) - 0x2000000;
+ break;
+ }
+ off += 4;
+ if (off > 4)
+ break;
}
if (resolv_vma)
@@ -3405,8 +3585,13 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
memcpy (names, "@plt", sizeof ("@plt"));
names += sizeof ("@plt");
s++;
- glink_vma += 8;
- if (i >= 0x8000)
+ if (abi < 2)
+ {
+ glink_vma += 8;
+ if (i >= 0x8000)
+ glink_vma += 4;
+ }
+ else
glink_vma += 4;
}
count += plt_count;
@@ -3457,13 +3642,13 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
.
.
. .foo_stub:
- . addis 12,2,Lfoo@toc@ha # in practice, the call stub
- . addi 12,12,Lfoo@toc@l # is slightly optimized, but
- . std 2,40(1) # this is the general idea
- . ld 11,0(12)
- . ld 2,8(12)
- . mtctr 11
- . ld 11,16(12)
+ . std 2,40(1) # in practice, the call stub
+ . addis 11,2,Lfoo@toc@ha # is slightly optimized, but
+ . addi 11,11,Lfoo@toc@l # this is the general idea
+ . ld 12,0(11)
+ . ld 2,8(11)
+ . mtctr 12
+ . ld 11,16(11)
. bctr
.
. .section .plt
@@ -3514,6 +3699,8 @@ must_be_dyn_reloc (struct bfd_link_info *info,
case R_PPC64_TPREL16_HA:
case R_PPC64_TPREL16_DS:
case R_PPC64_TPREL16_LO_DS:
+ case R_PPC64_TPREL16_HIGH:
+ case R_PPC64_TPREL16_HIGHA:
case R_PPC64_TPREL16_HIGHER:
case R_PPC64_TPREL16_HIGHERA:
case R_PPC64_TPREL16_HIGHEST:
@@ -3553,21 +3740,21 @@ must_be_dyn_reloc (struct bfd_link_info *info,
ppc_stub_plt_branch:
Similar to the above, but a 24 bit branch in the stub section won't
reach its destination.
- . addis %r12,%r2,xxx@toc@ha
- . ld %r11,xxx@toc@l(%r12)
- . mtctr %r11
+ . addis %r11,%r2,xxx@toc@ha
+ . ld %r12,xxx@toc@l(%r11)
+ . mtctr %r12
. bctr
ppc_stub_plt_call:
Used to call a function in a shared library. If it so happens that
the plt entry referenced crosses a 64k boundary, then an extra
- "addi %r12,%r12,xxx@toc@l" will be inserted before the "mtctr".
- . addis %r12,%r2,xxx@toc@ha
+ "addi %r11,%r11,xxx@toc@l" will be inserted before the "mtctr".
. std %r2,40(%r1)
- . ld %r11,xxx+0@toc@l(%r12)
- . mtctr %r11
- . ld %r2,xxx+8@toc@l(%r12)
- . ld %r11,xxx+16@toc@l(%r12)
+ . addis %r11,%r2,xxx@toc@ha
+ . ld %r12,xxx+0@toc@l(%r11)
+ . mtctr %r12
+ . ld %r2,xxx+8@toc@l(%r11)
+ . ld %r11,xxx+16@toc@l(%r11)
. bctr
ppc_stub_long_branch and ppc_stub_plt_branch may also have additional
@@ -3580,11 +3767,11 @@ must_be_dyn_reloc (struct bfd_link_info *info,
A ppc_stub_plt_branch with an r2 offset looks like:
. std %r2,40(%r1)
- . addis %r12,%r2,xxx@toc@ha
- . ld %r11,xxx@toc@l(%r12)
+ . addis %r11,%r2,xxx@toc@ha
+ . ld %r12,xxx@toc@l(%r11)
. addis %r2,%r2,off@ha
. addi %r2,%r2,off@l
- . mtctr %r11
+ . mtctr %r12
. bctr
In cases where the "addis" instruction would add zero, the "addis" is
@@ -3598,7 +3785,8 @@ enum ppc_stub_type {
ppc_stub_plt_branch,
ppc_stub_plt_branch_r2off,
ppc_stub_plt_call,
- ppc_stub_plt_call_r2save
+ ppc_stub_plt_call_r2save,
+ ppc_stub_global_entry
};
struct ppc_stub_hash_entry {
@@ -3626,6 +3814,9 @@ struct ppc_stub_hash_entry {
/* Where this stub is being called from, or, in the case of combined
stub sections, the first input section in the group. */
asection *id_sec;
+
+ /* Symbol st_other. */
+ unsigned char other;
};
struct ppc_branch_hash_entry {
@@ -3721,12 +3912,8 @@ struct ppc_link_hash_table
/* Hash table for function prologue tocsave. */
htab_t tocsave_htab;
- /* Linker stub bfd. */
- bfd *stub_bfd;
-
- /* Linker call-backs. */
- asection * (*add_stub_section) (const char *, asection *);
- void (*layout_sections_again) (void);
+ /* Various options and other info passed from the linker. */
+ struct ppc64_elf_params *params;
/* Array to keep track of which stub sections have been created, and
information on stub grouping. */
@@ -3756,12 +3943,7 @@ struct ppc_link_hash_table
/* List of input sections for each output section. */
asection **input_list;
- /* Short-cuts to get to dynamic linker sections. */
- asection *got;
- asection *plt;
- asection *relplt;
- asection *iplt;
- asection *reliplt;
+ /* Shortcuts to get to dynamic linker sections. */
asection *dynbss;
asection *relbss;
asection *glink;
@@ -3778,25 +3960,13 @@ struct ppc_link_hash_table
bfd_size_type got_reli_size;
/* Statistics. */
- unsigned long stub_count[ppc_stub_plt_call_r2save];
+ unsigned long stub_count[ppc_stub_global_entry];
/* Number of stubs against global syms. */
unsigned long stub_globals;
- /* Alignment of PLT call stubs. */
- unsigned int plt_stub_align:4;
-
- /* Set if PLT call stubs should load r11. */
- unsigned int plt_static_chain:1;
-
- /* Set if PLT call stubs need a read-read barrier. */
- unsigned int plt_thread_safe:1;
-
- /* Set if we should emit symbols for stubs. */
- unsigned int emit_stub_syms:1;
-
- /* Set if __tls_get_addr optimization should not be done. */
- unsigned int no_tls_get_addr_opt:1;
+ /* Set if we're linking code with function descriptors. */
+ unsigned int opd_abi:1;
/* Support for multiple toc sections. */
unsigned int do_multi_toc:1;
@@ -3807,7 +3977,7 @@ struct ppc_link_hash_table
/* Set on error. */
unsigned int stub_error:1;
- /* Temp used by ppc64_elf_process_dot_syms. */
+ /* Temp used by ppc64_elf_before_check_relocs. */
unsigned int twiddled_syms:1;
/* Incremented every time we size stubs. */
@@ -3881,7 +4051,9 @@ stub_hash_newfunc (struct bfd_hash_entry *entry,
eh->target_value = 0;
eh->target_section = NULL;
eh->h = NULL;
+ eh->plt_ent = NULL;
eh->id_sec = NULL;
+ eh->other = 0;
}
return entry;
@@ -3993,6 +4165,21 @@ tocsave_htab_eq (const void *p1, const void *p2)
return e1->sec == e2->sec && e1->offset == e2->offset;
}
+/* Destroy a ppc64 ELF linker hash table. */
+
+static void
+ppc64_elf_link_hash_table_free (bfd *obfd)
+{
+ struct ppc_link_hash_table *htab;
+
+ htab = (struct ppc_link_hash_table *) obfd->link.hash;
+ if (htab->tocsave_htab)
+ htab_delete (htab->tocsave_htab);
+ bfd_hash_table_free (&htab->branch_hash_table);
+ bfd_hash_table_free (&htab->stub_hash_table);
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
/* Create a ppc64 ELF linker hash table. */
static struct bfd_link_hash_table *
@@ -4016,19 +4203,30 @@ ppc64_elf_link_hash_table_create (bfd *abfd)
/* Init the stub hash table too. */
if (!bfd_hash_table_init (&htab->stub_hash_table, stub_hash_newfunc,
sizeof (struct ppc_stub_hash_entry)))
- return NULL;
+ {
+ _bfd_elf_link_hash_table_free (abfd);
+ return NULL;
+ }
/* And the branch hash table. */
if (!bfd_hash_table_init (&htab->branch_hash_table, branch_hash_newfunc,
sizeof (struct ppc_branch_hash_entry)))
- return NULL;
+ {
+ bfd_hash_table_free (&htab->stub_hash_table);
+ _bfd_elf_link_hash_table_free (abfd);
+ return NULL;
+ }
htab->tocsave_htab = htab_try_create (1024,
tocsave_htab_hash,
tocsave_htab_eq,
NULL);
if (htab->tocsave_htab == NULL)
- return NULL;
+ {
+ ppc64_elf_link_hash_table_free (abfd);
+ return NULL;
+ }
+ htab->elf.root.hash_table_free = ppc64_elf_link_hash_table_free;
/* Initializing two fields of the union is just cosmetic. We really
only care about glist, but when compiled on a 32-bit host the
@@ -4046,20 +4244,6 @@ ppc64_elf_link_hash_table_create (bfd *abfd)
return &htab->elf.root;
}
-/* Free the derived linker hash table. */
-
-static void
-ppc64_elf_link_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct ppc_link_hash_table *htab = (struct ppc_link_hash_table *) hash;
-
- bfd_hash_table_free (&htab->stub_hash_table);
- bfd_hash_table_free (&htab->branch_hash_table);
- if (htab->tocsave_htab)
- htab_delete (htab->tocsave_htab);
- _bfd_elf_link_hash_table_free (hash);
-}
-
/* Create sections for linker generated code. */
static bfd_boolean
@@ -4099,18 +4283,17 @@ create_linkage_sections (bfd *dynobj, struct bfd_link_info *info)
}
flags = SEC_ALLOC | SEC_LINKER_CREATED;
- htab->iplt = bfd_make_section_anyway_with_flags (dynobj, ".iplt", flags);
- if (htab->iplt == NULL
- || ! bfd_set_section_alignment (dynobj, htab->iplt, 3))
+ htab->elf.iplt = bfd_make_section_anyway_with_flags (dynobj, ".iplt", flags);
+ if (htab->elf.iplt == NULL
+ || ! bfd_set_section_alignment (dynobj, htab->elf.iplt, 3))
return FALSE;
flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY
| SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED);
- htab->reliplt = bfd_make_section_anyway_with_flags (dynobj,
- ".rela.iplt",
- flags);
- if (htab->reliplt == NULL
- || ! bfd_set_section_alignment (dynobj, htab->reliplt, 3))
+ htab->elf.irelplt
+ = bfd_make_section_anyway_with_flags (dynobj, ".rela.iplt", flags);
+ if (htab->elf.irelplt == NULL
+ || ! bfd_set_section_alignment (dynobj, htab->elf.irelplt, 3))
return FALSE;
/* Create branch lookup table for plt_branch stubs. */
@@ -4140,11 +4323,12 @@ create_linkage_sections (bfd *dynobj, struct bfd_link_info *info)
/* Satisfy the ELF linker by filling in some fields in our fake bfd. */
bfd_boolean
-ppc64_elf_init_stub_bfd (bfd *abfd, struct bfd_link_info *info)
+ppc64_elf_init_stub_bfd (struct bfd_link_info *info,
+ struct ppc64_elf_params *params)
{
struct ppc_link_hash_table *htab;
- elf_elfheader (abfd)->e_ident[EI_CLASS] = ELFCLASS64;
+ elf_elfheader (params->stub_bfd)->e_ident[EI_CLASS] = ELFCLASS64;
/* Always hook our dynamic sections into the first bfd, which is the
linker created stub bfd. This ensures that the GOT header is at
@@ -4152,8 +4336,8 @@ ppc64_elf_init_stub_bfd (bfd *abfd, struct bfd_link_info *info)
htab = ppc_hash_table (info);
if (htab == NULL)
return FALSE;
- htab->stub_bfd = abfd;
- htab->elf.dynobj = abfd;
+ htab->elf.dynobj = params->stub_bfd;
+ htab->params = params;
if (info->relocatable)
return TRUE;
@@ -4278,13 +4462,13 @@ ppc_add_stub (const char *stub_name,
namelen = strlen (link_sec->name);
len = namelen + sizeof (STUB_SUFFIX);
- s_name = bfd_alloc (htab->stub_bfd, len);
+ s_name = bfd_alloc (htab->params->stub_bfd, len);
if (s_name == NULL)
return NULL;
memcpy (s_name, link_sec->name, namelen);
memcpy (s_name + namelen, STUB_SUFFIX, sizeof (STUB_SUFFIX));
- stub_sec = (*htab->add_stub_section) (s_name, link_sec);
+ stub_sec = (*htab->params->add_stub_section) (s_name, link_sec);
if (stub_sec == NULL)
return NULL;
htab->stub_group[link_sec->id].stub_sec = stub_sec;
@@ -4323,15 +4507,9 @@ create_got_section (bfd *abfd, struct bfd_link_info *info)
if (htab == NULL)
return FALSE;
- if (!htab->got)
- {
- if (! _bfd_elf_create_got_section (htab->elf.dynobj, info))
- return FALSE;
-
- htab->got = bfd_get_linker_section (htab->elf.dynobj, ".got");
- if (!htab->got)
- abort ();
- }
+ if (!htab->elf.sgot
+ && !_bfd_elf_create_got_section (htab->elf.dynobj, info))
+ return FALSE;
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
| SEC_LINKER_CREATED);
@@ -4366,15 +4544,11 @@ ppc64_elf_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
if (htab == NULL)
return FALSE;
- if (!htab->got)
- htab->got = bfd_get_linker_section (dynobj, ".got");
- htab->plt = bfd_get_linker_section (dynobj, ".plt");
- htab->relplt = bfd_get_linker_section (dynobj, ".rela.plt");
htab->dynbss = bfd_get_linker_section (dynobj, ".dynbss");
if (!info->shared)
htab->relbss = bfd_get_linker_section (dynobj, ".rela.bss");
- if (!htab->got || !htab->plt || !htab->relplt || !htab->dynbss
+ if (!htab->elf.sgot || !htab->elf.splt || !htab->elf.srelplt || !htab->dynbss
|| (!info->shared && !htab->relbss))
abort ();
@@ -4469,6 +4643,7 @@ ppc64_elf_copy_indirect_symbol (struct bfd_link_info *info,
edir->elf.ref_regular |= eind->elf.ref_regular;
edir->elf.ref_regular_nonweak |= eind->elf.ref_regular_nonweak;
edir->elf.needs_plt |= eind->elf.needs_plt;
+ edir->elf.pointer_equality_needed |= eind->elf.pointer_equality_needed;
/* Copy over any dynamic relocs we may have on the indirect sym. */
if (eind->dyn_relocs != NULL)
@@ -4627,29 +4802,68 @@ static bfd_boolean
ppc64_elf_add_symbol_hook (bfd *ibfd,
struct bfd_link_info *info,
Elf_Internal_Sym *isym,
- const char **name ATTRIBUTE_UNUSED,
+ const char **name,
flagword *flags ATTRIBUTE_UNUSED,
asection **sec,
- bfd_vma *value ATTRIBUTE_UNUSED)
+ bfd_vma *value)
{
- if ((ibfd->flags & DYNAMIC) == 0
- && ELF_ST_BIND (isym->st_info) == STB_GNU_UNIQUE)
+ if ((ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC
+ || ELF_ST_BIND (isym->st_info) == STB_GNU_UNIQUE)
+ && (ibfd->flags & DYNAMIC) == 0
+ && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
- if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC)
+ if (*sec != NULL
+ && strcmp ((*sec)->name, ".opd") == 0)
{
- if ((ibfd->flags & DYNAMIC) == 0)
- elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
+ asection *code_sec;
+
+ if (!(ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC
+ || ELF_ST_TYPE (isym->st_info) == STT_FUNC))
+ isym->st_info = ELF_ST_INFO (ELF_ST_BIND (isym->st_info), STT_FUNC);
+
+ /* If the symbol is a function defined in .opd, and the function
+ code is in a discarded group, let it appear to be undefined. */
+ if (!info->relocatable
+ && (*sec)->reloc_count != 0
+ && opd_entry_value (*sec, *value, &code_sec, NULL,
+ FALSE) != (bfd_vma) -1
+ && discarded_section (code_sec))
+ {
+ *sec = bfd_und_section_ptr;
+ isym->st_shndx = SHN_UNDEF;
+ }
+ }
+
+ if ((STO_PPC64_LOCAL_MASK & isym->st_other) != 0)
+ {
+ if (abiversion (ibfd) == 0)
+ set_abiversion (ibfd, 2);
+ else if (abiversion (ibfd) == 1)
+ {
+ info->callbacks->einfo (_("%P: symbol '%s' has invalid st_other"
+ " for ABI version 1\n"), name);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
}
- else if (ELF_ST_TYPE (isym->st_info) == STT_FUNC)
- ;
- else if (*sec != NULL
- && strcmp ((*sec)->name, ".opd") == 0)
- isym->st_info = ELF_ST_INFO (ELF_ST_BIND (isym->st_info), STT_FUNC);
return TRUE;
}
+/* Merge non-visibility st_other attributes: local entry point. */
+
+static void
+ppc64_elf_merge_symbol_attribute (struct elf_link_hash_entry *h,
+ const Elf_Internal_Sym *isym,
+ bfd_boolean definition,
+ bfd_boolean dynamic)
+{
+ if (definition && !dynamic)
+ h->other = ((isym->st_other & ~ELF_ST_VISIBILITY (-1))
+ | ELF_ST_VISIBILITY (h->other));
+}
+
/* This function makes an old ABI object reference to ".bar" cause the
inclusion of a new ABI object archive that defines "bar".
NAME is a symbol defined in an archive. Return a symbol in the hash
@@ -4753,13 +4967,53 @@ add_symbol_adjust (struct ppc_link_hash_entry *eh, struct bfd_link_info *info)
return TRUE;
}
-/* Process list of dot-symbols we made in link_hash_newfunc. */
+/* Set up opd section info and abiversion for IBFD, and process list
+ of dot-symbols we made in link_hash_newfunc. */
static bfd_boolean
-ppc64_elf_process_dot_syms (bfd *ibfd, struct bfd_link_info *info)
+ppc64_elf_before_check_relocs (bfd *ibfd, struct bfd_link_info *info)
{
struct ppc_link_hash_table *htab;
struct ppc_link_hash_entry **p, *eh;
+ asection *opd = bfd_get_section_by_name (ibfd, ".opd");
+
+ if (opd != NULL && opd->size != 0)
+ {
+ if (abiversion (ibfd) == 0)
+ set_abiversion (ibfd, 1);
+ else if (abiversion (ibfd) == 2)
+ {
+ info->callbacks->einfo (_("%P: %B .opd not allowed in ABI"
+ " version %d\n"),
+ ibfd, abiversion (ibfd));
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
+ if ((ibfd->flags & DYNAMIC) == 0
+ && (opd->flags & SEC_RELOC) != 0
+ && opd->reloc_count != 0
+ && !bfd_is_abs_section (opd->output_section))
+ {
+ /* Garbage collection needs some extra help with .opd sections.
+ We don't want to necessarily keep everything referenced by
+ relocs in .opd, as that would keep all functions. Instead,
+ if we reference an .opd symbol (a function descriptor), we
+ want to keep the function code symbol's section. This is
+ easy for global symbols, but for local syms we need to keep
+ information about the associated function section. */
+ bfd_size_type amt;
+ asection **opd_sym_map;
+
+ amt = opd->size * sizeof (*opd_sym_map) / 8;
+ opd_sym_map = bfd_zalloc (ibfd, amt);
+ if (opd_sym_map == NULL)
+ return FALSE;
+ ppc64_elf_section_data (opd)->u.opd.func_sec = opd_sym_map;
+ BFD_ASSERT (ppc64_elf_section_data (opd)->sec_type == sec_normal);
+ ppc64_elf_section_data (opd)->sec_type = sec_opd;
+ }
+ }
if (!is_ppc64_elf (info->output_bfd))
return TRUE;
@@ -4767,21 +5021,29 @@ ppc64_elf_process_dot_syms (bfd *ibfd, struct bfd_link_info *info)
if (htab == NULL)
return FALSE;
- if (is_ppc64_elf (ibfd))
+ /* For input files without an explicit abiversion in e_flags
+ we should have flagged any with symbol st_other bits set
+ as ELFv1 and above flagged those with .opd as ELFv2.
+ Set the output abiversion if not yet set, and for any input
+ still ambiguous, take its abiversion from the output.
+ Differences in ABI are reported later. */
+ if (abiversion (info->output_bfd) == 0)
+ set_abiversion (info->output_bfd, abiversion (ibfd));
+ else if (abiversion (ibfd) == 0)
+ set_abiversion (ibfd, abiversion (info->output_bfd));
+
+ p = &htab->dot_syms;
+ while ((eh = *p) != NULL)
{
- p = &htab->dot_syms;
- while ((eh = *p) != NULL)
- {
- *p = NULL;
- if (&eh->elf == htab->elf.hgot)
- ;
- else if (htab->elf.hgot == NULL
- && strcmp (eh->elf.root.root.string, ".TOC.") == 0)
- htab->elf.hgot = &eh->elf;
- else if (!add_symbol_adjust (eh, info))
- return FALSE;
- p = &eh->u.next_dot_sym;
- }
+ *p = NULL;
+ if (&eh->elf == htab->elf.hgot)
+ ;
+ else if (htab->elf.hgot == NULL
+ && strcmp (eh->elf.root.root.string, ".TOC.") == 0)
+ htab->elf.hgot = &eh->elf;
+ else if (!add_symbol_adjust (eh, info))
+ return FALSE;
+ p = &eh->u.next_dot_sym;
}
/* Clear the list for non-ppc64 input files. */
@@ -4832,10 +5094,8 @@ ppc64_elf_link_just_syms (asection *sec, struct bfd_link_info *info)
&& (sec->owner->flags & (EXEC_P | DYNAMIC)) != 0
&& is_ppc64_elf (sec->owner))
{
- asection *got = bfd_get_section_by_name (sec->owner, ".got");
- if (got != NULL
- && got->size >= elf_backend_got_header_size
- && bfd_get_section_by_name (sec->owner, ".opd") != NULL)
+ if (abiversion (sec->owner) >= 2
+ || bfd_get_section_by_name (sec->owner, ".opd") != NULL)
sec->has_toc_reloc = 1;
}
_bfd_elf_link_just_syms (sec, info);
@@ -4974,25 +5234,9 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
sym_hashes = elf_sym_hashes (abfd);
sreloc = NULL;
opd_sym_map = NULL;
- if (strcmp (sec->name, ".opd") == 0)
- {
- /* Garbage collection needs some extra help with .opd sections.
- We don't want to necessarily keep everything referenced by
- relocs in .opd, as that would keep all functions. Instead,
- if we reference an .opd symbol (a function descriptor), we
- want to keep the function code symbol's section. This is
- easy for global symbols, but for local syms we need to keep
- information about the associated function section. */
- bfd_size_type amt;
-
- amt = sec->size * sizeof (*opd_sym_map) / 8;
- opd_sym_map = bfd_zalloc (abfd, amt);
- if (opd_sym_map == NULL)
- return FALSE;
- ppc64_elf_section_data (sec)->u.opd.func_sec = opd_sym_map;
- BFD_ASSERT (ppc64_elf_section_data (sec)->sec_type == sec_normal);
- ppc64_elf_section_data (sec)->sec_type = sec_opd;
- }
+ if (ppc64_elf_section_data (sec) != NULL
+ && ppc64_elf_section_data (sec)->sec_type == sec_opd)
+ opd_sym_map = ppc64_elf_section_data (sec)->u.opd.func_sec;
rel_end = relocs + sec->reloc_count;
for (rel = relocs; rel < rel_end; rel++)
@@ -5093,7 +5337,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_PPC64_GOT_TPREL16_LO_DS:
case R_PPC64_GOT_TPREL16_HI:
case R_PPC64_GOT_TPREL16_HA:
- if (!info->executable)
+ if (info->shared)
info->flags |= DF_STATIC_TLS;
tls_type = TLS_TLS | TLS_TPREL;
goto dogottls;
@@ -5163,6 +5407,14 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (!update_local_sym_info (abfd, symtab_hdr, r_symndx,
rel->r_addend, tls_type))
return FALSE;
+
+ /* We may also need a plt entry if the symbol turns out to be
+ an ifunc. */
+ if (h != NULL && !info->shared && abiversion (abfd) != 1)
+ {
+ if (!update_plt_info (abfd, &h->plt.plist, rel->r_addend))
+ return FALSE;
+ }
break;
case R_PPC64_PLT16_HA:
@@ -5208,6 +5460,8 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_PPC64_DTPREL16_HA:
case R_PPC64_DTPREL16_DS:
case R_PPC64_DTPREL16_LO_DS:
+ case R_PPC64_DTPREL16_HIGH:
+ case R_PPC64_DTPREL16_HIGHA:
case R_PPC64_DTPREL16_HIGHER:
case R_PPC64_DTPREL16_HIGHERA:
case R_PPC64_DTPREL16_HIGHEST:
@@ -5221,6 +5475,21 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_PPC64_REL16_HA:
break;
+ /* Not supported as a dynamic relocation. */
+ case R_PPC64_ADDR64_LOCAL:
+ if (info->shared)
+ {
+ if (!ppc64_elf_howto_table[R_PPC64_ADDR32])
+ ppc_howto_init ();
+ info->callbacks->einfo (_("%P: %H: %s reloc unsupported "
+ "in shared libraries and PIEs.\n"),
+ abfd, sec, rel->r_offset,
+ ppc64_elf_howto_table[r_type]->name);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+ break;
+
case R_PPC64_TOC16:
case R_PPC64_TOC16_DS:
htab->do_multi_toc = 1;
@@ -5298,7 +5567,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_PPC64_TPREL64:
tls_type = TLS_EXPLICIT | TLS_TLS | TLS_TPREL;
- if (!info->executable)
+ if (info->shared)
info->flags |= DF_STATIC_TLS;
goto dotlstoc;
@@ -5368,14 +5637,15 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_PPC64_TPREL16_HA:
case R_PPC64_TPREL16_DS:
case R_PPC64_TPREL16_LO_DS:
+ case R_PPC64_TPREL16_HIGH:
+ case R_PPC64_TPREL16_HIGHA:
case R_PPC64_TPREL16_HIGHER:
case R_PPC64_TPREL16_HIGHERA:
case R_PPC64_TPREL16_HIGHEST:
case R_PPC64_TPREL16_HIGHESTA:
if (info->shared)
{
- if (!info->executable)
- info->flags |= DF_STATIC_TLS;
+ info->flags |= DF_STATIC_TLS;
goto dodyn;
}
break;
@@ -5411,22 +5681,35 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
}
/* Fall through. */
- case R_PPC64_REL30:
- case R_PPC64_REL32:
- case R_PPC64_REL64:
- case R_PPC64_ADDR14:
- case R_PPC64_ADDR14_BRNTAKEN:
- case R_PPC64_ADDR14_BRTAKEN:
case R_PPC64_ADDR16:
case R_PPC64_ADDR16_DS:
case R_PPC64_ADDR16_HA:
case R_PPC64_ADDR16_HI:
+ case R_PPC64_ADDR16_HIGH:
+ case R_PPC64_ADDR16_HIGHA:
case R_PPC64_ADDR16_HIGHER:
case R_PPC64_ADDR16_HIGHERA:
case R_PPC64_ADDR16_HIGHEST:
case R_PPC64_ADDR16_HIGHESTA:
case R_PPC64_ADDR16_LO:
case R_PPC64_ADDR16_LO_DS:
+ if (h != NULL && !info->shared && abiversion (abfd) != 1
+ && rel->r_addend == 0)
+ {
+ /* We may need a .plt entry if this reloc refers to a
+ function in a shared lib. */
+ if (!update_plt_info (abfd, &h->plt.plist, rel->r_addend))
+ return FALSE;
+ h->pointer_equality_needed = 1;
+ }
+ /* Fall through. */
+
+ case R_PPC64_REL30:
+ case R_PPC64_REL32:
+ case R_PPC64_REL64:
+ case R_PPC64_ADDR14:
+ case R_PPC64_ADDR14_BRNTAKEN:
+ case R_PPC64_ADDR14_BRTAKEN:
case R_PPC64_ADDR24:
case R_PPC64_ADDR32:
case R_PPC64_UADDR16:
@@ -5564,8 +5847,74 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
return TRUE;
}
+/* Merge backend specific data from an object file to the output
+ object file when linking. */
+
+static bfd_boolean
+ppc64_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
+{
+ unsigned long iflags, oflags;
+
+ if ((ibfd->flags & BFD_LINKER_CREATED) != 0)
+ return TRUE;
+
+ if (!is_ppc64_elf (ibfd) || !is_ppc64_elf (obfd))
+ return TRUE;
+
+ if (!_bfd_generic_verify_endian_match (ibfd, obfd))
+ return FALSE;
+
+ iflags = elf_elfheader (ibfd)->e_flags;
+ oflags = elf_elfheader (obfd)->e_flags;
+
+ if (iflags & ~EF_PPC64_ABI)
+ {
+ (*_bfd_error_handler)
+ (_("%B uses unknown e_flags 0x%lx"), ibfd, iflags);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+ else if (iflags != oflags && iflags != 0)
+ {
+ (*_bfd_error_handler)
+ (_("%B: ABI version %ld is not compatible with ABI version %ld output"),
+ ibfd, iflags, oflags);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
+ /* Merge Tag_compatibility attributes and any common GNU ones. */
+ _bfd_elf_merge_object_attributes (ibfd, obfd);
+
+ return TRUE;
+}
+
+static bfd_boolean
+ppc64_elf_print_private_bfd_data (bfd *abfd, void *ptr)
+{
+ /* Print normal ELF private data. */
+ _bfd_elf_print_private_bfd_data (abfd, ptr);
+
+ if (elf_elfheader (abfd)->e_flags != 0)
+ {
+ FILE *file = ptr;
+
+ /* xgettext:c-format */
+ fprintf (file, _("private flags = 0x%lx:"),
+ elf_elfheader (abfd)->e_flags);
+
+ if ((elf_elfheader (abfd)->e_flags & EF_PPC64_ABI) != 0)
+ fprintf (file, _(" [abiv%ld]"),
+ elf_elfheader (abfd)->e_flags & EF_PPC64_ABI);
+ fputc ('\n', file);
+ }
+
+ return TRUE;
+}
+
/* OFFSET in OPD_SEC specifies a function descriptor. Return the address
- of the code entry point, and its section. */
+ of the code entry point, and its section, which must be in the same
+ object as OPD_SEC. Returns (bfd_vma) -1 on error. */
static bfd_vma
opd_entry_value (asection *opd_sec,
@@ -5648,32 +5997,10 @@ opd_entry_value (asection *opd_sec,
&& ELF64_R_TYPE ((look + 1)->r_info) == R_PPC64_TOC)
{
unsigned long symndx = ELF64_R_SYM (look->r_info);
- asection *sec;
+ asection *sec = NULL;
- if (symndx < symtab_hdr->sh_info
- || elf_sym_hashes (opd_bfd) == NULL)
- {
- Elf_Internal_Sym *sym;
-
- sym = (Elf_Internal_Sym *) symtab_hdr->contents;
- if (sym == NULL)
- {
- size_t symcnt = symtab_hdr->sh_info;
- if (elf_sym_hashes (opd_bfd) == NULL)
- symcnt = symtab_hdr->sh_size / symtab_hdr->sh_entsize;
- sym = bfd_elf_get_elf_syms (opd_bfd, symtab_hdr, symcnt,
- 0, NULL, NULL, NULL);
- if (sym == NULL)
- break;
- symtab_hdr->contents = (bfd_byte *) sym;
- }
-
- sym += symndx;
- val = sym->st_value;
- sec = bfd_section_from_elf_index (opd_bfd, sym->st_shndx);
- BFD_ASSERT ((sec->flags & SEC_MERGE) == 0);
- }
- else
+ if (symndx >= symtab_hdr->sh_info
+ && elf_sym_hashes (opd_bfd) != NULL)
{
struct elf_link_hash_entry **sym_hashes;
struct elf_link_hash_entry *rh;
@@ -5687,24 +6014,48 @@ opd_entry_value (asection *opd_sec,
|| rh->root.type == bfd_link_hash_defweak);
val = rh->root.u.def.value;
sec = rh->root.u.def.section;
+ if (sec->owner != opd_bfd)
+ {
+ sec = NULL;
+ val = (bfd_vma) -1;
+ }
+ }
+ }
+
+ if (sec == NULL)
+ {
+ Elf_Internal_Sym *sym;
+
+ if (symndx < symtab_hdr->sh_info)
+ {
+ sym = (Elf_Internal_Sym *) symtab_hdr->contents;
+ if (sym == NULL)
+ {
+ size_t symcnt = symtab_hdr->sh_info;
+ sym = bfd_elf_get_elf_syms (opd_bfd, symtab_hdr,
+ symcnt, 0,
+ NULL, NULL, NULL);
+ if (sym == NULL)
+ break;
+ symtab_hdr->contents = (bfd_byte *) sym;
+ }
+ sym += symndx;
}
else
{
- /* Handle the odd case where we can be called
- during bfd_elf_link_add_symbols before the
- symbol hashes have been fully populated. */
- Elf_Internal_Sym *sym;
-
- sym = bfd_elf_get_elf_syms (opd_bfd, symtab_hdr, 1,
- symndx, NULL, NULL, NULL);
+ sym = bfd_elf_get_elf_syms (opd_bfd, symtab_hdr,
+ 1, symndx,
+ NULL, NULL, NULL);
if (sym == NULL)
break;
-
- val = sym->st_value;
- sec = bfd_section_from_elf_index (opd_bfd, sym->st_shndx);
- free (sym);
}
+ sec = bfd_section_from_elf_index (opd_bfd, sym->st_shndx);
+ if (sec == NULL)
+ break;
+ BFD_ASSERT ((sec->flags & SEC_MERGE) == 0);
+ val = sym->st_value;
}
+
val += look->r_addend;
if (code_off != NULL)
*code_off = val;
@@ -5715,7 +6066,7 @@ opd_entry_value (asection *opd_sec,
else
*code_sec = sec;
}
- if (sec != NULL && sec->output_section != NULL)
+ if (sec->output_section != NULL)
val += sec->output_section->vma + sec->output_offset;
}
break;
@@ -5869,6 +6220,7 @@ ppc64_elf_gc_mark_dynamic_ref (struct elf_link_hash_entry *h, void *inf)
struct bfd_link_info *info = (struct bfd_link_info *) inf;
struct ppc_link_hash_entry *eh = (struct ppc_link_hash_entry *) h;
struct ppc_link_hash_entry *fdh;
+ struct bfd_elf_dynamic_list *d = info->dynamic_list;
/* Dynamic linking info is on the func descriptor sym. */
fdh = defined_func_desc (eh);
@@ -5878,10 +6230,14 @@ ppc64_elf_gc_mark_dynamic_ref (struct elf_link_hash_entry *h, void *inf)
if ((eh->elf.root.type == bfd_link_hash_defined
|| eh->elf.root.type == bfd_link_hash_defweak)
&& (eh->elf.ref_dynamic
- || (!info->executable
- && eh->elf.def_regular
+ || (eh->elf.def_regular
&& ELF_ST_VISIBILITY (eh->elf.other) != STV_INTERNAL
&& ELF_ST_VISIBILITY (eh->elf.other) != STV_HIDDEN
+ && (!info->executable
+ || info->export_dynamic
+ || (eh->elf.dynamic
+ && d != NULL
+ && (*d->match) (&d->head, NULL, eh->elf.root.root.string)))
&& (strchr (eh->elf.root.root.string, ELF_VER_CHR) != NULL
|| !bfd_hide_sym_by_version (info->version_info,
eh->elf.root.root.string)))))
@@ -6246,7 +6602,7 @@ static bfd_byte *
savegpr0_tail (bfd *abfd, bfd_byte *p, int r)
{
p = savegpr0 (abfd, p, r);
- bfd_put_32 (abfd, STD_R0_0R1 + 16, p);
+ bfd_put_32 (abfd, STD_R0_0R1 + STK_LR, p);
p = p + 4;
bfd_put_32 (abfd, BLR, p);
return p + 4;
@@ -6262,7 +6618,7 @@ restgpr0 (bfd *abfd, bfd_byte *p, int r)
static bfd_byte *
restgpr0_tail (bfd *abfd, bfd_byte *p, int r)
{
- bfd_put_32 (abfd, LD_R0_0R1 + 16, p);
+ bfd_put_32 (abfd, LD_R0_0R1 + STK_LR, p);
p = p + 4;
p = restgpr0 (abfd, p, r);
bfd_put_32 (abfd, MTLR_R0, p);
@@ -6317,7 +6673,7 @@ static bfd_byte *
savefpr0_tail (bfd *abfd, bfd_byte *p, int r)
{
p = savefpr (abfd, p, r);
- bfd_put_32 (abfd, STD_R0_0R1 + 16, p);
+ bfd_put_32 (abfd, STD_R0_0R1 + STK_LR, p);
p = p + 4;
bfd_put_32 (abfd, BLR, p);
return p + 4;
@@ -6333,7 +6689,7 @@ restfpr (bfd *abfd, bfd_byte *p, int r)
static bfd_byte *
restfpr0_tail (bfd *abfd, bfd_byte *p, int r)
{
- bfd_put_32 (abfd, LD_R0_0R1 + 16, p);
+ bfd_put_32 (abfd, LD_R0_0R1 + STK_LR, p);
p = p + 4;
p = restfpr (abfd, p, r);
bfd_put_32 (abfd, MTLR_R0, p);
@@ -6562,7 +6918,18 @@ ppc64_elf_func_desc_adjust (bfd *obfd ATTRIBUTE_UNUSED,
if (!info->relocatable
&& htab->elf.hgot != NULL)
- _bfd_elf_link_hash_hide_symbol (info, htab->elf.hgot, TRUE);
+ {
+ _bfd_elf_link_hash_hide_symbol (info, htab->elf.hgot, TRUE);
+ /* Make .TOC. defined so as to prevent it being made dynamic.
+ The wrong value here is fixed later in ppc64_elf_set_toc. */
+ htab->elf.hgot->type = STT_OBJECT;
+ htab->elf.hgot->root.type = bfd_link_hash_defined;
+ htab->elf.hgot->root.u.def.value = 0;
+ htab->elf.hgot->root.u.def.section = bfd_abs_section_ptr;
+ htab->elf.hgot->def_regular = 1;
+ htab->elf.hgot->other = ((htab->elf.hgot->other & ~ELF_ST_VISIBILITY (-1))
+ | STV_HIDDEN);
+ }
if (htab->sfpr == NULL)
/* We don't have any relocs. */
@@ -6570,7 +6937,7 @@ ppc64_elf_func_desc_adjust (bfd *obfd ATTRIBUTE_UNUSED,
/* Provide any missing _save* and _rest* functions. */
htab->sfpr->size = 0;
- if (!info->relocatable)
+ if (htab->params->save_restore_funcs)
for (i = 0; i < sizeof (funcs) / sizeof (funcs[0]); i++)
if (!sfpr_define (info, &funcs[i]))
return FALSE;
@@ -6583,6 +6950,25 @@ ppc64_elf_func_desc_adjust (bfd *obfd ATTRIBUTE_UNUSED,
return TRUE;
}
+/* Return true if we have dynamic relocs that apply to read-only sections. */
+
+static bfd_boolean
+readonly_dynrelocs (struct elf_link_hash_entry *h)
+{
+ struct ppc_link_hash_entry *eh;
+ struct elf_dyn_relocs *p;
+
+ eh = (struct ppc_link_hash_entry *) h;
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ {
+ asection *s = p->sec->output_section;
+
+ if (s != NULL && (s->flags & SEC_READONLY) != 0)
+ return TRUE;
+ }
+ return FALSE;
+}
+
/* Adjust a symbol defined by a dynamic object and referenced by a
regular object. The current definition is in some section of the
dynamic object, but we're not including those sections. We have to
@@ -6619,6 +7005,39 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
{
h->plt.plist = NULL;
h->needs_plt = 0;
+ h->pointer_equality_needed = 0;
+ }
+ else if (abiversion (info->output_bfd) == 2)
+ {
+ /* Taking a function's address in a read/write section
+ doesn't require us to define the function symbol in the
+ executable on a global entry stub. A dynamic reloc can
+ be used instead. */
+ if (h->pointer_equality_needed
+ && h->type != STT_GNU_IFUNC
+ && !readonly_dynrelocs (h))
+ {
+ h->pointer_equality_needed = 0;
+ h->non_got_ref = 0;
+ }
+
+ /* After adjust_dynamic_symbol, non_got_ref set in the
+ non-shared case means that we have allocated space in
+ .dynbss for the symbol and thus dyn_relocs for this
+ symbol should be discarded.
+ If we get here we know we are making a PLT entry for this
+ symbol, and in an executable we'd normally resolve
+ relocations against this symbol to the PLT entry. Allow
+ dynamic relocs if the reference is weak, and the dynamic
+ relocs will not cause text relocation. */
+ else if (!h->ref_regular_nonweak
+ && h->non_got_ref
+ && h->type != STT_GNU_IFUNC
+ && !readonly_dynrelocs (h))
+ h->non_got_ref = 0;
+
+ /* If making a plt entry, then we don't need copy relocs. */
+ return TRUE;
}
}
else
@@ -6654,26 +7073,12 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
if (!h->def_dynamic || !h->ref_regular || h->def_regular)
return TRUE;
- if (ELIMINATE_COPY_RELOCS)
+ /* If we didn't find any dynamic relocs in read-only sections, then
+ we'll be keeping the dynamic relocs and avoiding the copy reloc. */
+ if (ELIMINATE_COPY_RELOCS && !readonly_dynrelocs (h))
{
- struct ppc_link_hash_entry * eh;
- struct elf_dyn_relocs *p;
-
- eh = (struct ppc_link_hash_entry *) h;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
- {
- s = p->sec->output_section;
- if (s != NULL && (s->flags & SEC_READONLY) != 0)
- break;
- }
-
- /* If we didn't find any dynamic relocs in read-only sections, then
- we'll be keeping the dynamic relocs and avoiding the copy reloc. */
- if (p == NULL)
- {
- h->non_got_ref = 0;
- return TRUE;
- }
+ h->non_got_ref = 0;
+ return TRUE;
}
if (h->plt.plist != NULL)
@@ -7052,6 +7457,8 @@ dec_dynrel_count (bfd_vma r_info,
case R_PPC64_TPREL16_HA:
case R_PPC64_TPREL16_DS:
case R_PPC64_TPREL16_LO_DS:
+ case R_PPC64_TPREL16_HIGH:
+ case R_PPC64_TPREL16_HIGHA:
case R_PPC64_TPREL16_HIGHER:
case R_PPC64_TPREL16_HIGHERA:
case R_PPC64_TPREL16_HIGHEST:
@@ -7073,6 +7480,8 @@ dec_dynrel_count (bfd_vma r_info,
case R_PPC64_ADDR16_DS:
case R_PPC64_ADDR16_HA:
case R_PPC64_ADDR16_HI:
+ case R_PPC64_ADDR16_HIGH:
+ case R_PPC64_ADDR16_HIGHA:
case R_PPC64_ADDR16_HIGHER:
case R_PPC64_ADDR16_HIGHERA:
case R_PPC64_ADDR16_HIGHEST:
@@ -7185,13 +7594,18 @@ dec_dynrel_count (bfd_vma r_info,
applications. */
bfd_boolean
-ppc64_elf_edit_opd (struct bfd_link_info *info, bfd_boolean non_overlapping)
+ppc64_elf_edit_opd (struct bfd_link_info *info)
{
bfd *ibfd;
bfd_boolean some_edited = FALSE;
asection *need_pad = NULL;
+ struct ppc_link_hash_table *htab;
+
+ htab = ppc_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
asection *sec;
Elf_Internal_Rela *relstart, *rel, *relend;
@@ -7342,7 +7756,7 @@ ppc64_elf_edit_opd (struct bfd_link_info *info, bfd_boolean non_overlapping)
goto broken_opd;
}
- add_aux_fields = non_overlapping && cnt_16b > 0;
+ add_aux_fields = htab->params->non_overlapping_opd && cnt_16b > 0;
if (need_edit || add_aux_fields)
{
@@ -7433,12 +7847,7 @@ ppc64_elf_edit_opd (struct bfd_link_info *info, bfd_boolean non_overlapping)
if (h != NULL
&& h->root.root.string[0] == '.')
{
- struct ppc_link_hash_table *htab;
-
- htab = ppc_hash_table (info);
- if (htab != NULL)
- fdh = lookup_fdh ((struct ppc_link_hash_entry *) h,
- htab);
+ fdh = lookup_fdh ((struct ppc_link_hash_entry *) h, htab);
if (fdh != NULL
&& fdh->elf.root.type != bfd_link_hash_defined
&& fdh->elf.root.type != bfd_link_hash_defweak)
@@ -7587,9 +7996,7 @@ ppc64_elf_edit_opd (struct bfd_link_info *info, bfd_boolean non_overlapping)
/* Set htab->tls_get_addr and call the generic ELF tls_setup function. */
asection *
-ppc64_elf_tls_setup (struct bfd_link_info *info,
- int no_tls_get_addr_opt,
- int *no_multi_toc)
+ppc64_elf_tls_setup (struct bfd_link_info *info)
{
struct ppc_link_hash_table *htab;
@@ -7597,10 +8004,13 @@ ppc64_elf_tls_setup (struct bfd_link_info *info,
if (htab == NULL)
return NULL;
- if (*no_multi_toc)
+ if (abiversion (info->output_bfd) == 1)
+ htab->opd_abi = 1;
+
+ if (htab->params->no_multi_toc)
htab->do_multi_toc = 0;
else if (!htab->do_multi_toc)
- *no_multi_toc = 1;
+ htab->params->no_multi_toc = 1;
htab->tls_get_addr = ((struct ppc_link_hash_entry *)
elf_link_hash_lookup (&htab->elf, ".__tls_get_addr",
@@ -7611,7 +8021,7 @@ ppc64_elf_tls_setup (struct bfd_link_info *info,
htab->tls_get_addr_fd = ((struct ppc_link_hash_entry *)
elf_link_hash_lookup (&htab->elf, "__tls_get_addr",
FALSE, FALSE, TRUE));
- if (!no_tls_get_addr_opt)
+ if (!htab->params->no_tls_get_addr_opt)
{
struct elf_link_hash_entry *opt, *opt_fd, *tga, *tga_fd;
@@ -7679,9 +8089,8 @@ ppc64_elf_tls_setup (struct bfd_link_info *info,
}
}
else
- no_tls_get_addr_opt = TRUE;
+ htab->params->no_tls_get_addr_opt = TRUE;
}
- htab->no_tls_get_addr_opt = no_tls_get_addr_opt;
return _bfd_elf_tls_setup (info->output_bfd, info);
}
@@ -7743,7 +8152,7 @@ ppc64_elf_tls_optimize (struct bfd_link_info *info)
and plt refcounts. */
toc_ref = NULL;
for (pass = 0; pass < 2; ++pass)
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
Elf_Internal_Sym *locsyms = NULL;
asection *toc = bfd_get_section_by_name (ibfd, ".toc");
@@ -7758,7 +8167,10 @@ ppc64_elf_tls_optimize (struct bfd_link_info *info)
relstart = _bfd_elf_link_read_relocs (ibfd, sec, NULL, NULL,
info->keep_memory);
if (relstart == NULL)
- return FALSE;
+ {
+ free (toc_ref);
+ return FALSE;
+ }
relend = relstart + sec->reloc_count;
for (rel = relstart; rel < relend; rel++)
@@ -7931,7 +8343,10 @@ ppc64_elf_tls_optimize (struct bfd_link_info *info)
else
value = sym->st_value;
value += rel->r_addend;
- BFD_ASSERT (value < toc->size && value % 8 == 0);
+ if (value % 8 != 0)
+ continue;
+ BFD_ASSERT (value < toc->size
+ && toc->output_offset % 8 == 0);
toc_ref_index = (value + toc->output_offset) / 8;
if (r_type == R_PPC64_TLS
|| r_type == R_PPC64_TLSGD
@@ -8237,7 +8652,7 @@ ppc64_elf_edit_toc (struct bfd_link_info *info)
htab->do_toc_opt = 1;
toc_inf.global_toc_syms = TRUE;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
asection *toc, *sec;
Elf_Internal_Shdr *symtab_hdr;
@@ -8380,7 +8795,7 @@ ppc64_elf_edit_toc (struct bfd_link_info *info)
|| discarded_section (sym_sec))
continue;
- if (!SYMBOL_CALLS_LOCAL (info, h))
+ if (!SYMBOL_REFERENCES_LOCAL (info, h))
continue;
if (h != NULL)
@@ -8466,7 +8881,10 @@ ppc64_elf_edit_toc (struct bfd_link_info *info)
relstart = _bfd_elf_link_read_relocs (ibfd, sec, NULL, NULL,
info->keep_memory);
if (relstart == NULL)
- goto error_ret;
+ {
+ free (used);
+ goto error_ret;
+ }
/* Mark toc entries referenced as used. */
do
@@ -8909,7 +9327,7 @@ allocate_got (struct elf_link_hash_entry *h,
dyn = htab->elf.dynamic_sections_created;
if (h->type == STT_GNU_IFUNC)
{
- htab->reliplt->size += rentsize;
+ htab->elf.irelplt->size += rentsize;
htab->got_reli_size += rentsize;
}
else if ((info->shared
@@ -8976,35 +9394,40 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
if (!htab->elf.dynamic_sections_created
|| h->dynindx == -1)
{
- s = htab->iplt;
+ s = htab->elf.iplt;
pent->plt.offset = s->size;
- s->size += PLT_ENTRY_SIZE;
- s = htab->reliplt;
+ s->size += PLT_ENTRY_SIZE (htab);
+ s = htab->elf.irelplt;
}
else
{
/* If this is the first .plt entry, make room for the special
first entry. */
- s = htab->plt;
+ s = htab->elf.splt;
if (s->size == 0)
- s->size += PLT_INITIAL_ENTRY_SIZE;
+ s->size += PLT_INITIAL_ENTRY_SIZE (htab);
pent->plt.offset = s->size;
/* Make room for this entry. */
- s->size += PLT_ENTRY_SIZE;
+ s->size += PLT_ENTRY_SIZE (htab);
/* Make room for the .glink code. */
s = htab->glink;
if (s->size == 0)
s->size += GLINK_CALL_STUB_SIZE;
- /* We need bigger stubs past index 32767. */
- if (s->size >= GLINK_CALL_STUB_SIZE + 32768*2*4)
+ if (htab->opd_abi)
+ {
+ /* We need bigger stubs past index 32767. */
+ if (s->size >= GLINK_CALL_STUB_SIZE + 32768*2*4)
+ s->size += 4;
+ s->size += 2*4;
+ }
+ else
s->size += 4;
- s->size += 2*4;
/* We also need to make an entry in the .rela.plt section. */
- s = htab->relplt;
+ s = htab->elf.srelplt;
}
s->size += sizeof (Elf64_External_Rela);
doneone = TRUE;
@@ -9183,35 +9606,72 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
if (eh->elf.type == STT_GNU_IFUNC)
- sreloc = htab->reliplt;
+ sreloc = htab->elf.irelplt;
sreloc->size += p->count * sizeof (Elf64_External_Rela);
}
return TRUE;
}
-/* Find any dynamic relocs that apply to read-only sections. */
+/* Called via elf_link_hash_traverse from ppc64_elf_size_dynamic_sections
+ to set up space for global entry stubs. These are put in glink,
+ after the branch table. */
static bfd_boolean
-readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf)
+size_global_entry_stubs (struct elf_link_hash_entry *h, void *inf)
{
- struct ppc_link_hash_entry *eh;
- struct elf_dyn_relocs *p;
+ struct bfd_link_info *info;
+ struct ppc_link_hash_table *htab;
+ struct plt_entry *pent;
+ asection *s;
- eh = (struct ppc_link_hash_entry *) h;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
- {
- asection *s = p->sec->output_section;
+ if (h->root.type == bfd_link_hash_indirect)
+ return TRUE;
- if (s != NULL && (s->flags & SEC_READONLY) != 0)
- {
- struct bfd_link_info *info = inf;
+ if (!h->pointer_equality_needed)
+ return TRUE;
- info->flags |= DF_TEXTREL;
+ if (h->def_regular)
+ return TRUE;
- /* Not an error, just cut short the traversal. */
- return FALSE;
- }
+ info = inf;
+ htab = ppc_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
+ s = htab->glink;
+ for (pent = h->plt.plist; pent != NULL; pent = pent->next)
+ if (pent->plt.offset != (bfd_vma) -1
+ && pent->addend == 0)
+ {
+ /* For ELFv2, if this symbol is not defined in a regular file
+ and we are not generating a shared library or pie, then we
+ need to define the symbol in the executable on a call stub.
+ This is to avoid text relocations. */
+ s->size = (s->size + 15) & -16;
+ h->root.u.def.section = s;
+ h->root.u.def.value = s->size;
+ s->size += 16;
+ break;
+ }
+ return TRUE;
+}
+
+/* Set DF_TEXTREL if we find any dynamic relocs that apply to
+ read-only sections. */
+
+static bfd_boolean
+maybe_set_textrel (struct elf_link_hash_entry *h, void *info)
+{
+ if (h->root.type == bfd_link_hash_indirect)
+ return TRUE;
+
+ if (readonly_dynrelocs (h))
+ {
+ ((struct bfd_link_info *) info)->flags |= DF_TEXTREL;
+
+ /* Not an error, just cut short the traversal. */
+ return FALSE;
}
return TRUE;
}
@@ -9219,7 +9679,7 @@ readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf)
/* Set the sizes of the dynamic sections. */
static bfd_boolean
-ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ppc64_elf_size_dynamic_sections (bfd *output_bfd,
struct bfd_link_info *info)
{
struct ppc_link_hash_table *htab;
@@ -9252,7 +9712,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
struct got_entry **lgot_ents;
struct got_entry **end_lgot_ents;
@@ -9283,7 +9743,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
{
asection *srel = elf_section_data (p->sec)->sreloc;
if (p->ifunc)
- srel = htab->reliplt;
+ srel = htab->elf.irelplt;
srel->size += p->count * sizeof (Elf64_External_Rela);
if ((p->sec->output_section->flags & SEC_READONLY) != 0)
info->flags |= DF_TEXTREL;
@@ -9329,7 +9789,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
s->size += ent_size;
if ((*lgot_masks & PLT_IFUNC) != 0)
{
- htab->reliplt->size += rel_size;
+ htab->elf.irelplt->size += rel_size;
htab->got_reli_size += rel_size;
}
else if (info->shared)
@@ -9352,11 +9812,11 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
for (ent = *local_plt; ent != NULL; ent = ent->next)
if (ent->plt.refcount > 0)
{
- s = htab->iplt;
+ s = htab->elf.iplt;
ent->plt.offset = s->size;
- s->size += PLT_ENTRY_SIZE;
+ s->size += PLT_ENTRY_SIZE (htab);
- htab->reliplt->size += sizeof (Elf64_External_Rela);
+ htab->elf.irelplt->size += sizeof (Elf64_External_Rela);
}
else
ent->plt.offset = (bfd_vma) -1;
@@ -9366,9 +9826,15 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Allocate global sym .plt and .got entries, and space for global
sym dynamic relocs. */
elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info);
+ /* Stash the end of glink branch table. */
+ if (htab->glink != NULL)
+ htab->glink->rawsize = htab->glink->size;
+
+ if (!htab->opd_abi && !info->shared)
+ elf_link_hash_traverse (&htab->elf, size_global_entry_stubs, info);
first_tlsld = NULL;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
struct got_entry *ent;
@@ -9413,9 +9879,9 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
if (s == htab->brlt || s == htab->relbrlt)
/* These haven't been allocated yet; don't strip. */
continue;
- else if (s == htab->got
- || s == htab->plt
- || s == htab->iplt
+ else if (s == htab->elf.sgot
+ || s == htab->elf.splt
+ || s == htab->elf.iplt
|| s == htab->glink
|| s == htab->dynbss)
{
@@ -9432,7 +9898,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
{
if (s->size != 0)
{
- if (s != htab->relplt)
+ if (s != htab->elf.srelplt)
relocs = TRUE;
/* We use the reloc_count field as a counter if we need
@@ -9476,13 +9942,13 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
return FALSE;
}
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
if (!is_ppc64_elf (ibfd))
continue;
s = ppc64_elf_tdata (ibfd)->got;
- if (s != NULL && s != htab->got)
+ if (s != NULL && s != htab->elf.sgot)
{
if (s->size == 0)
s->flags |= SEC_EXCLUDE;
@@ -9511,6 +9977,8 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
if (htab->elf.dynamic_sections_created)
{
+ bfd_boolean tls_opt;
+
/* Add some entries to the .dynamic section. We fill in the
values later, in ppc64_elf_finish_dynamic_sections, but we
must add the entries now so that we get the correct size for
@@ -9525,7 +9993,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
return FALSE;
}
- if (htab->plt != NULL && htab->plt->size != 0)
+ if (htab->elf.splt != NULL && htab->elf.splt->size != 0)
{
if (!add_dynamic_entry (DT_PLTGOT, 0)
|| !add_dynamic_entry (DT_PLTRELSZ, 0)
@@ -9535,18 +10003,21 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
return FALSE;
}
- if (NO_OPD_RELOCS)
+ if (NO_OPD_RELOCS && abiversion (output_bfd) <= 1)
{
if (!add_dynamic_entry (DT_PPC64_OPD, 0)
|| !add_dynamic_entry (DT_PPC64_OPDSZ, 0))
return FALSE;
}
- if (!htab->no_tls_get_addr_opt
- && htab->tls_get_addr_fd != NULL
- && htab->tls_get_addr_fd->elf.plt.plist != NULL
- && !add_dynamic_entry (DT_PPC64_TLSOPT, 0))
- return FALSE;
+ tls_opt = (!htab->params->no_tls_get_addr_opt
+ && htab->tls_get_addr_fd != NULL
+ && htab->tls_get_addr_fd->elf.plt.plist != NULL);
+ if (tls_opt || !htab->opd_abi)
+ {
+ if (!add_dynamic_entry (DT_PPC64_OPT, tls_opt ? PPC64_OPT_TLS : 0))
+ return FALSE;
+ }
if (relocs)
{
@@ -9558,7 +10029,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* If any dynamic relocs apply to a read-only section,
then we need a DT_TEXTREL entry. */
if ((info->flags & DF_TEXTREL) == 0)
- elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, info);
+ elf_link_hash_traverse (&htab->elf, maybe_set_textrel, info);
if ((info->flags & DF_TEXTREL) != 0)
{
@@ -9572,6 +10043,19 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
return TRUE;
}
+/* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */
+
+static bfd_boolean
+ppc64_elf_hash_symbol (struct elf_link_hash_entry *h)
+{
+ if (h->plt.plist != NULL
+ && !h->def_regular
+ && !h->pointer_equality_needed)
+ return FALSE;
+
+ return _bfd_elf_hash_symbol (h);
+}
+
/* Determine the type of stub needed, if any, for a call. */
static inline enum ppc_stub_type
@@ -9579,7 +10063,8 @@ ppc_type_of_stub (asection *input_sec,
const Elf_Internal_Rela *rel,
struct ppc_link_hash_entry **hash,
struct plt_entry **plt_ent,
- bfd_vma destination)
+ bfd_vma destination,
+ unsigned long local_off)
{
struct ppc_link_hash_entry *h = *hash;
bfd_vma location;
@@ -9648,7 +10133,7 @@ ppc_type_of_stub (asection *input_sec,
if (r_type != R_PPC64_REL24)
max_branch_offset = 1 << 15;
- if (branch_offset + max_branch_offset >= 2 * max_branch_offset)
+ if (branch_offset + max_branch_offset >= 2 * max_branch_offset - local_off)
/* We need a stub. Figure out whether a long_branch or plt_branch
is needed later. */
return ppc_stub_long_branch;
@@ -9665,9 +10150,9 @@ ppc_type_of_stub (asection *input_sec,
the appropriate glink entry if so.
. fake dep barrier compare
- . ld 11,xxx(2) ld 11,xxx(2)
- . mtctr 11 mtctr 11
- . xor 11,11,11 ld 2,xxx+8(2)
+ . ld 12,xxx(2) ld 12,xxx(2)
+ . mtctr 12 mtctr 12
+ . xor 11,12,12 ld 2,xxx+8(2)
. add 2,2,11 cmpldi 2,0
. ld 2,xxx+8(2) bnectr+
. bctr b <glink_entry>
@@ -9687,23 +10172,27 @@ plt_stub_size (struct ppc_link_hash_table *htab,
struct ppc_stub_hash_entry *stub_entry,
bfd_vma off)
{
- unsigned size = PLT_CALL_STUB_SIZE;
-
- if (!(ALWAYS_EMIT_R2SAVE
- || stub_entry->stub_type == ppc_stub_plt_call_r2save))
- size -= 4;
- if (!htab->plt_static_chain)
- size -= 4;
- if (htab->plt_thread_safe)
- size += 8;
- if (PPC_HA (off) == 0)
- size -= 4;
- if (PPC_HA (off + 8 + 8 * htab->plt_static_chain) != PPC_HA (off))
+ unsigned size = 12;
+
+ if (ALWAYS_EMIT_R2SAVE
+ || stub_entry->stub_type == ppc_stub_plt_call_r2save)
+ size += 4;
+ if (PPC_HA (off) != 0)
size += 4;
+ if (htab->opd_abi)
+ {
+ size += 4;
+ if (htab->params->plt_static_chain)
+ size += 4;
+ if (htab->params->plt_thread_safe)
+ size += 8;
+ if (PPC_HA (off + 8 + 8 * htab->params->plt_static_chain) != PPC_HA (off))
+ size += 4;
+ }
if (stub_entry->h != NULL
&& (stub_entry->h == htab->tls_get_addr_fd
|| stub_entry->h == htab->tls_get_addr)
- && !htab->no_tls_get_addr_opt)
+ && !htab->params->no_tls_get_addr_opt)
size += 13 * 4;
return size;
}
@@ -9715,7 +10204,7 @@ plt_stub_pad (struct ppc_link_hash_table *htab,
struct ppc_stub_hash_entry *stub_entry,
bfd_vma plt_off)
{
- int stub_align = 1 << htab->plt_stub_align;
+ int stub_align = 1 << htab->params->plt_stub_align;
unsigned stub_size = plt_stub_size (htab, stub_entry, plt_off);
bfd_vma stub_off = stub_entry->stub_sec->size;
@@ -9732,21 +10221,24 @@ build_plt_stub (struct ppc_link_hash_table *htab,
struct ppc_stub_hash_entry *stub_entry,
bfd_byte *p, bfd_vma offset, Elf_Internal_Rela *r)
{
- bfd *obfd = htab->stub_bfd;
- bfd_boolean plt_static_chain = htab->plt_static_chain;
- bfd_boolean plt_thread_safe = htab->plt_thread_safe;
+ bfd *obfd = htab->params->stub_bfd;
+ bfd_boolean plt_load_toc = htab->opd_abi;
+ bfd_boolean plt_static_chain = htab->params->plt_static_chain;
+ bfd_boolean plt_thread_safe = htab->params->plt_thread_safe;
bfd_boolean use_fake_dep = plt_thread_safe;
bfd_vma cmp_branch_off = 0;
if (!ALWAYS_USE_FAKE_DEP
+ && plt_load_toc
&& plt_thread_safe
&& !(stub_entry->h != NULL
&& (stub_entry->h == htab->tls_get_addr_fd
|| stub_entry->h == htab->tls_get_addr)
- && !htab->no_tls_get_addr_opt))
+ && !htab->params->no_tls_get_addr_opt))
{
bfd_vma pltoff = stub_entry->plt_ent->plt.offset & ~1;
- bfd_vma pltindex = (pltoff - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE;
+ bfd_vma pltindex = ((pltoff - PLT_INITIAL_ENTRY_SIZE (htab))
+ / PLT_ENTRY_SIZE (htab));
bfd_vma glinkoff = GLINK_CALL_STUB_SIZE + pltindex * 8;
bfd_vma to, from;
@@ -9780,44 +10272,59 @@ build_plt_stub (struct ppc_link_hash_table *htab,
r[1].r_offset = r[0].r_offset + 4;
r[1].r_info = ELF64_R_INFO (0, R_PPC64_TOC16_LO_DS);
r[1].r_addend = r[0].r_addend;
- if (PPC_HA (offset + 8 + 8 * plt_static_chain) != PPC_HA (offset))
+ if (plt_load_toc)
{
- r[2].r_offset = r[1].r_offset + 4;
- r[2].r_info = ELF64_R_INFO (0, R_PPC64_TOC16_LO);
- r[2].r_addend = r[0].r_addend;
- }
- else
- {
- r[2].r_offset = r[1].r_offset + 8 + 8 * use_fake_dep;
- r[2].r_info = ELF64_R_INFO (0, R_PPC64_TOC16_LO_DS);
- r[2].r_addend = r[0].r_addend + 8;
- if (plt_static_chain)
+ if (PPC_HA (offset + 8 + 8 * plt_static_chain) != PPC_HA (offset))
{
- r[3].r_offset = r[2].r_offset + 4;
- r[3].r_info = ELF64_R_INFO (0, R_PPC64_TOC16_LO_DS);
- r[3].r_addend = r[0].r_addend + 16;
+ r[2].r_offset = r[1].r_offset + 4;
+ r[2].r_info = ELF64_R_INFO (0, R_PPC64_TOC16_LO);
+ r[2].r_addend = r[0].r_addend;
+ }
+ else
+ {
+ r[2].r_offset = r[1].r_offset + 8 + 8 * use_fake_dep;
+ r[2].r_info = ELF64_R_INFO (0, R_PPC64_TOC16_LO_DS);
+ r[2].r_addend = r[0].r_addend + 8;
+ if (plt_static_chain)
+ {
+ r[3].r_offset = r[2].r_offset + 4;
+ r[3].r_info = ELF64_R_INFO (0, R_PPC64_TOC16_LO_DS);
+ r[3].r_addend = r[0].r_addend + 16;
+ }
}
}
}
if (ALWAYS_EMIT_R2SAVE
|| stub_entry->stub_type == ppc_stub_plt_call_r2save)
- bfd_put_32 (obfd, STD_R2_40R1, p), p += 4;
- bfd_put_32 (obfd, ADDIS_R12_R2 | PPC_HA (offset), p), p += 4;
- bfd_put_32 (obfd, LD_R11_0R12 | PPC_LO (offset), p), p += 4;
- if (PPC_HA (offset + 8 + 8 * plt_static_chain) != PPC_HA (offset))
+ bfd_put_32 (obfd, STD_R2_0R1 + STK_TOC (htab), p), p += 4;
+ if (plt_load_toc)
+ {
+ bfd_put_32 (obfd, ADDIS_R11_R2 | PPC_HA (offset), p), p += 4;
+ bfd_put_32 (obfd, LD_R12_0R11 | PPC_LO (offset), p), p += 4;
+ }
+ else
{
- bfd_put_32 (obfd, ADDI_R12_R12 | PPC_LO (offset), p), p += 4;
+ bfd_put_32 (obfd, ADDIS_R12_R2 | PPC_HA (offset), p), p += 4;
+ bfd_put_32 (obfd, LD_R12_0R12 | PPC_LO (offset), p), p += 4;
+ }
+ if (plt_load_toc
+ && PPC_HA (offset + 8 + 8 * plt_static_chain) != PPC_HA (offset))
+ {
+ bfd_put_32 (obfd, ADDI_R11_R11 | PPC_LO (offset), p), p += 4;
offset = 0;
}
- bfd_put_32 (obfd, MTCTR_R11, p), p += 4;
- if (use_fake_dep)
+ bfd_put_32 (obfd, MTCTR_R12, p), p += 4;
+ if (plt_load_toc)
{
- bfd_put_32 (obfd, XOR_R11_R11_R11, p), p += 4;
- bfd_put_32 (obfd, ADD_R12_R12_R11, p), p += 4;
+ if (use_fake_dep)
+ {
+ bfd_put_32 (obfd, XOR_R2_R12_R12, p), p += 4;
+ bfd_put_32 (obfd, ADD_R11_R11_R2, p), p += 4;
+ }
+ bfd_put_32 (obfd, LD_R2_0R11 | PPC_LO (offset + 8), p), p += 4;
+ if (plt_static_chain)
+ bfd_put_32 (obfd, LD_R11_0R11 | PPC_LO (offset + 16), p), p += 4;
}
- bfd_put_32 (obfd, LD_R2_0R12 | PPC_LO (offset + 8), p), p += 4;
- if (plt_static_chain)
- bfd_put_32 (obfd, LD_R11_0R12 | PPC_LO (offset + 16), p), p += 4;
}
else
{
@@ -9827,45 +10334,52 @@ build_plt_stub (struct ppc_link_hash_table *htab,
|| stub_entry->stub_type == ppc_stub_plt_call_r2save)
r[0].r_offset += 4;
r[0].r_info = ELF64_R_INFO (0, R_PPC64_TOC16_DS);
- if (PPC_HA (offset + 8 + 8 * plt_static_chain) != PPC_HA (offset))
+ if (plt_load_toc)
{
- r[1].r_offset = r[0].r_offset + 4;
- r[1].r_info = ELF64_R_INFO (0, R_PPC64_TOC16);
- r[1].r_addend = r[0].r_addend;
- }
- else
- {
- r[1].r_offset = r[0].r_offset + 8 + 8 * use_fake_dep;
- r[1].r_info = ELF64_R_INFO (0, R_PPC64_TOC16_DS);
- r[1].r_addend = r[0].r_addend + 8 + 8 * plt_static_chain;
- if (plt_static_chain)
+ if (PPC_HA (offset + 8 + 8 * plt_static_chain) != PPC_HA (offset))
{
- r[2].r_offset = r[1].r_offset + 4;
- r[2].r_info = ELF64_R_INFO (0, R_PPC64_TOC16_DS);
- r[2].r_addend = r[0].r_addend + 8;
+ r[1].r_offset = r[0].r_offset + 4;
+ r[1].r_info = ELF64_R_INFO (0, R_PPC64_TOC16);
+ r[1].r_addend = r[0].r_addend;
+ }
+ else
+ {
+ r[1].r_offset = r[0].r_offset + 8 + 8 * use_fake_dep;
+ r[1].r_info = ELF64_R_INFO (0, R_PPC64_TOC16_DS);
+ r[1].r_addend = r[0].r_addend + 8 + 8 * plt_static_chain;
+ if (plt_static_chain)
+ {
+ r[2].r_offset = r[1].r_offset + 4;
+ r[2].r_info = ELF64_R_INFO (0, R_PPC64_TOC16_DS);
+ r[2].r_addend = r[0].r_addend + 8;
+ }
}
}
}
if (ALWAYS_EMIT_R2SAVE
|| stub_entry->stub_type == ppc_stub_plt_call_r2save)
- bfd_put_32 (obfd, STD_R2_40R1, p), p += 4;
- bfd_put_32 (obfd, LD_R11_0R2 | PPC_LO (offset), p), p += 4;
- if (PPC_HA (offset + 8 + 8 * plt_static_chain) != PPC_HA (offset))
+ bfd_put_32 (obfd, STD_R2_0R1 + STK_TOC (htab), p), p += 4;
+ bfd_put_32 (obfd, LD_R12_0R2 | PPC_LO (offset), p), p += 4;
+ if (plt_load_toc
+ && PPC_HA (offset + 8 + 8 * plt_static_chain) != PPC_HA (offset))
{
bfd_put_32 (obfd, ADDI_R2_R2 | PPC_LO (offset), p), p += 4;
offset = 0;
}
- bfd_put_32 (obfd, MTCTR_R11, p), p += 4;
- if (use_fake_dep)
+ bfd_put_32 (obfd, MTCTR_R12, p), p += 4;
+ if (plt_load_toc)
{
- bfd_put_32 (obfd, XOR_R11_R11_R11, p), p += 4;
- bfd_put_32 (obfd, ADD_R2_R2_R11, p), p += 4;
+ if (use_fake_dep)
+ {
+ bfd_put_32 (obfd, XOR_R11_R12_R12, p), p += 4;
+ bfd_put_32 (obfd, ADD_R2_R2_R11, p), p += 4;
+ }
+ if (plt_static_chain)
+ bfd_put_32 (obfd, LD_R11_0R2 | PPC_LO (offset + 16), p), p += 4;
+ bfd_put_32 (obfd, LD_R2_0R2 | PPC_LO (offset + 8), p), p += 4;
}
- if (plt_static_chain)
- bfd_put_32 (obfd, LD_R11_0R2 | PPC_LO (offset + 16), p), p += 4;
- bfd_put_32 (obfd, LD_R2_0R2 | PPC_LO (offset + 8), p), p += 4;
}
- if (plt_thread_safe && !use_fake_dep)
+ if (plt_load_toc && plt_thread_safe && !use_fake_dep)
{
bfd_put_32 (obfd, CMPLDI_R2_0, p), p += 4;
bfd_put_32 (obfd, BNECTR_P4, p), p += 4;
@@ -9885,11 +10399,9 @@ build_plt_stub (struct ppc_link_hash_table *htab,
#define ADD_R3_R12_R13 0x7c6c6a14
#define BEQLR 0x4d820020
#define MR_R3_R0 0x7c030378
-#define MFLR_R11 0x7d6802a6
#define STD_R11_0R1 0xf9610000
#define BCTRL 0x4e800421
#define LD_R11_0R1 0xe9610000
-#define LD_R2_0R1 0xe8410000
#define MTLR_R11 0x7d6803a6
static inline bfd_byte *
@@ -9897,7 +10409,7 @@ build_tls_get_addr_stub (struct ppc_link_hash_table *htab,
struct ppc_stub_hash_entry *stub_entry,
bfd_byte *p, bfd_vma offset, Elf_Internal_Rela *r)
{
- bfd *obfd = htab->stub_bfd;
+ bfd *obfd = htab->params->stub_bfd;
bfd_put_32 (obfd, LD_R11_0R3 + 0, p), p += 4;
bfd_put_32 (obfd, LD_R12_0R3 + 8, p), p += 4;
@@ -9907,15 +10419,15 @@ build_tls_get_addr_stub (struct ppc_link_hash_table *htab,
bfd_put_32 (obfd, BEQLR, p), p += 4;
bfd_put_32 (obfd, MR_R3_R0, p), p += 4;
bfd_put_32 (obfd, MFLR_R11, p), p += 4;
- bfd_put_32 (obfd, STD_R11_0R1 + 32, p), p += 4;
+ bfd_put_32 (obfd, STD_R11_0R1 + STK_LINKER (htab), p), p += 4;
if (r != NULL)
r[0].r_offset += 9 * 4;
p = build_plt_stub (htab, stub_entry, p, offset, r);
bfd_put_32 (obfd, BCTRL, p - 4);
- bfd_put_32 (obfd, LD_R11_0R1 + 32, p), p += 4;
- bfd_put_32 (obfd, LD_R2_0R1 + 40, p), p += 4;
+ bfd_put_32 (obfd, LD_R11_0R1 + STK_LINKER (htab), p), p += 4;
+ bfd_put_32 (obfd, LD_R2_0R1 + STK_TOC (htab), p), p += 4;
bfd_put_32 (obfd, MTLR_R11, p), p += 4;
bfd_put_32 (obfd, BLR, p), p += 4;
@@ -9964,6 +10476,8 @@ get_r2off (struct bfd_link_info *info,
/* Support linking -R objects. Get the toc pointer from the
opd entry. */
char buf[8];
+ if (!htab->opd_abi)
+ return r2off;
asection *opd = stub_entry->h->elf.root.u.def.section;
bfd_vma opd_off = stub_entry->h->elf.root.u.def.value;
@@ -10016,9 +10530,11 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
case ppc_stub_long_branch:
case ppc_stub_long_branch_r2off:
/* Branches are relative. This is where we are going to. */
- off = dest = (stub_entry->target_value
- + stub_entry->target_section->output_offset
- + stub_entry->target_section->output_section->vma);
+ dest = (stub_entry->target_value
+ + stub_entry->target_section->output_offset
+ + stub_entry->target_section->output_section->vma);
+ dest += PPC64_LOCAL_ENTRY_OFFSET (stub_entry->other);
+ off = dest;
/* And this is where we are coming from. */
off -= (stub_entry->stub_offset
@@ -10035,20 +10551,21 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
htab->stub_error = TRUE;
return FALSE;
}
- bfd_put_32 (htab->stub_bfd, STD_R2_40R1, loc);
+ bfd_put_32 (htab->params->stub_bfd, STD_R2_0R1 + STK_TOC (htab), loc);
loc += 4;
size = 12;
if (PPC_HA (r2off) != 0)
{
size = 16;
- bfd_put_32 (htab->stub_bfd, ADDIS_R2_R2 | PPC_HA (r2off), loc);
+ bfd_put_32 (htab->params->stub_bfd,
+ ADDIS_R2_R2 | PPC_HA (r2off), loc);
loc += 4;
}
- bfd_put_32 (htab->stub_bfd, ADDI_R2_R2 | PPC_LO (r2off), loc);
+ bfd_put_32 (htab->params->stub_bfd, ADDI_R2_R2 | PPC_LO (r2off), loc);
loc += 4;
off -= size - 4;
}
- bfd_put_32 (htab->stub_bfd, B_DOT | (off & 0x3fffffc), loc);
+ bfd_put_32 (htab->params->stub_bfd, B_DOT | (off & 0x3fffffc), loc);
if (off + (1 << 25) >= (bfd_vma) (1 << 26))
{
@@ -10073,16 +10590,16 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
unsigned long symndx;
struct ppc_link_hash_entry *h;
- hashes = elf_sym_hashes (htab->stub_bfd);
+ hashes = elf_sym_hashes (htab->params->stub_bfd);
if (hashes == NULL)
{
bfd_size_type hsize;
hsize = (htab->stub_globals + 1) * sizeof (*hashes);
- hashes = bfd_zalloc (htab->stub_bfd, hsize);
+ hashes = bfd_zalloc (htab->params->stub_bfd, hsize);
if (hashes == NULL)
return FALSE;
- elf_sym_hashes (htab->stub_bfd) = hashes;
+ elf_sym_hashes (htab->params->stub_bfd) = hashes;
htab->stub_globals = 1;
}
symndx = htab->stub_globals++;
@@ -10121,6 +10638,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
dest = (stub_entry->target_value
+ stub_entry->target_section->output_offset
+ stub_entry->target_section->output_section->vma);
+ if (stub_entry->stub_type != ppc_stub_plt_branch_r2off)
+ dest += PPC64_LOCAL_ENTRY_OFFSET (stub_entry->other);
bfd_put_64 (htab->brlt->owner, dest,
htab->brlt->contents + br_entry->offset);
@@ -10207,55 +10726,63 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
if (PPC_HA (off) != 0)
{
size = 16;
- bfd_put_32 (htab->stub_bfd, ADDIS_R12_R2 | PPC_HA (off), loc);
+ bfd_put_32 (htab->params->stub_bfd,
+ ADDIS_R12_R2 | PPC_HA (off), loc);
loc += 4;
- bfd_put_32 (htab->stub_bfd, LD_R11_0R12 | PPC_LO (off), loc);
+ bfd_put_32 (htab->params->stub_bfd,
+ LD_R12_0R12 | PPC_LO (off), loc);
}
else
{
size = 12;
- bfd_put_32 (htab->stub_bfd, LD_R11_0R2 | PPC_LO (off), loc);
+ bfd_put_32 (htab->params->stub_bfd,
+ LD_R12_0R2 | PPC_LO (off), loc);
}
}
else
{
bfd_vma r2off = get_r2off (info, stub_entry);
- if (r2off == 0)
+ if (r2off == 0 && htab->opd_abi)
{
htab->stub_error = TRUE;
return FALSE;
}
- bfd_put_32 (htab->stub_bfd, STD_R2_40R1, loc);
+ bfd_put_32 (htab->params->stub_bfd, STD_R2_0R1 + STK_TOC (htab), loc);
loc += 4;
- size = 20;
+ size = 16;
if (PPC_HA (off) != 0)
{
size += 4;
- bfd_put_32 (htab->stub_bfd, ADDIS_R12_R2 | PPC_HA (off), loc);
- loc += 4;
- bfd_put_32 (htab->stub_bfd, LD_R11_0R12 | PPC_LO (off), loc);
+ bfd_put_32 (htab->params->stub_bfd,
+ ADDIS_R12_R2 | PPC_HA (off), loc);
loc += 4;
+ bfd_put_32 (htab->params->stub_bfd,
+ LD_R12_0R12 | PPC_LO (off), loc);
}
else
+ bfd_put_32 (htab->params->stub_bfd, LD_R12_0R2 | PPC_LO (off), loc);
+
+ if (PPC_HA (r2off) != 0)
{
- bfd_put_32 (htab->stub_bfd, LD_R11_0R2 | PPC_LO (off), loc);
+ size += 4;
loc += 4;
+ bfd_put_32 (htab->params->stub_bfd,
+ ADDIS_R2_R2 | PPC_HA (r2off), loc);
}
-
- if (PPC_HA (r2off) != 0)
+ if (PPC_LO (r2off) != 0)
{
size += 4;
- bfd_put_32 (htab->stub_bfd, ADDIS_R2_R2 | PPC_HA (r2off), loc);
loc += 4;
+ bfd_put_32 (htab->params->stub_bfd,
+ ADDI_R2_R2 | PPC_LO (r2off), loc);
}
- bfd_put_32 (htab->stub_bfd, ADDI_R2_R2 | PPC_LO (r2off), loc);
}
loc += 4;
- bfd_put_32 (htab->stub_bfd, MTCTR_R11, loc);
+ bfd_put_32 (htab->params->stub_bfd, MTCTR_R12, loc);
loc += 4;
- bfd_put_32 (htab->stub_bfd, BCTR, loc);
+ bfd_put_32 (htab->params->stub_bfd, BCTR, loc);
break;
case ppc_stub_plt_call:
@@ -10283,11 +10810,11 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
if (dest >= (bfd_vma) -2)
abort ();
- plt = htab->plt;
+ plt = htab->elf.splt;
if (!htab->elf.dynamic_sections_created
|| stub_entry->h == NULL
|| stub_entry->h->elf.dynindx == -1)
- plt = htab->iplt;
+ plt = htab->elf.iplt;
dest += plt->output_offset + plt->output_section->vma;
@@ -10298,13 +10825,16 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
bfd_byte *rl;
rela.r_offset = dest;
- rela.r_info = ELF64_R_INFO (0, R_PPC64_JMP_IREL);
+ if (htab->opd_abi)
+ rela.r_info = ELF64_R_INFO (0, R_PPC64_JMP_IREL);
+ else
+ rela.r_info = ELF64_R_INFO (0, R_PPC64_IRELATIVE);
rela.r_addend = (stub_entry->target_value
+ stub_entry->target_section->output_offset
+ stub_entry->target_section->output_section->vma);
- rl = (htab->reliplt->contents
- + (htab->reliplt->reloc_count++
+ rl = (htab->elf.irelplt->contents
+ + (htab->elf.irelplt->reloc_count++
* sizeof (Elf64_External_Rela)));
bfd_elf64_swap_reloca_out (info->output_bfd, &rela, rl);
stub_entry->plt_ent->plt.offset |= 1;
@@ -10326,7 +10856,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
return FALSE;
}
- if (htab->plt_stub_align != 0)
+ if (htab->params->plt_stub_align != 0)
{
unsigned pad = plt_stub_pad (htab, stub_entry, off);
@@ -10339,10 +10869,11 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
if (info->emitrelocations)
{
r = get_relocs (stub_entry->stub_sec,
- (2
- + (PPC_HA (off) != 0)
- + (htab->plt_static_chain
- && PPC_HA (off + 16) == PPC_HA (off))));
+ ((PPC_HA (off) != 0)
+ + (htab->opd_abi
+ ? 2 + (htab->params->plt_static_chain
+ && PPC_HA (off + 16) == PPC_HA (off))
+ : 1)));
if (r == NULL)
return FALSE;
r[0].r_offset = loc - stub_entry->stub_sec->contents;
@@ -10353,7 +10884,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
if (stub_entry->h != NULL
&& (stub_entry->h == htab->tls_get_addr_fd
|| stub_entry->h == htab->tls_get_addr)
- && !htab->no_tls_get_addr_opt)
+ && !htab->params->no_tls_get_addr_opt)
p = build_tls_get_addr_stub (htab, stub_entry, loc, off, r);
else
p = build_plt_stub (htab, stub_entry, loc, off, r);
@@ -10367,7 +10898,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
stub_entry->stub_sec->size += size;
- if (htab->emit_stub_syms)
+ if (htab->params->emit_stub_syms)
{
struct elf_link_hash_entry *h;
size_t len1, len2;
@@ -10434,26 +10965,27 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
off = stub_entry->plt_ent->plt.offset & ~(bfd_vma) 1;
if (off >= (bfd_vma) -2)
abort ();
- plt = htab->plt;
+ plt = htab->elf.splt;
if (!htab->elf.dynamic_sections_created
|| stub_entry->h == NULL
|| stub_entry->h->elf.dynindx == -1)
- plt = htab->iplt;
+ plt = htab->elf.iplt;
off += (plt->output_offset
+ plt->output_section->vma
- elf_gp (plt->output_section->owner)
- htab->stub_group[stub_entry->id_sec->id].toc_off);
size = plt_stub_size (htab, stub_entry, off);
- if (htab->plt_stub_align)
+ if (htab->params->plt_stub_align)
size += plt_stub_pad (htab, stub_entry, off);
if (info->emitrelocations)
{
stub_entry->stub_sec->reloc_count
- += (2
- + (PPC_HA (off) != 0)
- + (htab->plt_static_chain
- && PPC_HA (off + 16) == PPC_HA (off)));
+ += ((PPC_HA (off) != 0)
+ + (htab->opd_abi
+ ? 2 + (htab->params->plt_static_chain
+ && PPC_HA (off + 16) == PPC_HA (off))
+ : 1));
stub_entry->stub_sec->flags |= SEC_RELOC;
}
}
@@ -10462,6 +10994,7 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
/* ppc_stub_long_branch or ppc_stub_plt_branch, or their r2off
variants. */
bfd_vma r2off = 0;
+ bfd_vma local_off = 0;
off = (stub_entry->target_value
+ stub_entry->target_section->output_offset
@@ -10479,7 +11012,7 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
if (stub_entry->stub_type == ppc_stub_long_branch_r2off)
{
r2off = get_r2off (info, stub_entry);
- if (r2off == 0)
+ if (r2off == 0 && htab->opd_abi)
{
htab->stub_error = TRUE;
return FALSE;
@@ -10490,8 +11023,13 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
off -= size - 4;
}
- /* If the branch offset if too big, use a ppc_stub_plt_branch. */
- if (off + (1 << 25) >= (bfd_vma) (1 << 26))
+ local_off = PPC64_LOCAL_ENTRY_OFFSET (stub_entry->other);
+
+ /* If the branch offset if too big, use a ppc_stub_plt_branch.
+ Do the same for -R objects without function descriptors. */
+ if (off + (1 << 25) >= (bfd_vma) (1 << 26) - local_off
+ || (stub_entry->stub_type == ppc_stub_long_branch_r2off
+ && r2off == 0))
{
struct ppc_branch_hash_entry *br_entry;
@@ -10542,12 +11080,14 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
}
else
{
- size = 20;
+ size = 16;
if (PPC_HA (off) != 0)
size += 4;
if (PPC_HA (r2off) != 0)
size += 4;
+ if (PPC_LO (r2off) != 0)
+ size += 4;
}
}
else if (info->emitrelocations)
@@ -10566,10 +11106,7 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
0 when no stubs will be needed, and 1 on success. */
int
-ppc64_elf_setup_section_lists
- (struct bfd_link_info *info,
- asection *(*add_stub_section) (const char *, asection *),
- void (*layout_sections_again) (void))
+ppc64_elf_setup_section_lists (struct bfd_link_info *info)
{
bfd *input_bfd;
int top_id, top_index, id;
@@ -10580,14 +11117,11 @@ ppc64_elf_setup_section_lists
if (htab == NULL)
return -1;
- /* Stash our params away. */
- htab->add_stub_section = add_stub_section;
- htab->layout_sections_again = layout_sections_again;
/* Find the top input section id. */
for (input_bfd = info->input_bfds, top_id = 3;
input_bfd != NULL;
- input_bfd = input_bfd->link_next)
+ input_bfd = input_bfd->link.next)
{
for (section = input_bfd->sections;
section != NULL;
@@ -10768,7 +11302,7 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info)
elf_link_hash_traverse (&htab->elf, merge_global_got, info);
/* And tlsld_got. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
struct got_entry *ent, *ent2;
@@ -10779,7 +11313,7 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info)
if (!ent->is_indirect
&& ent->got.offset != (bfd_vma) -1)
{
- for (ibfd2 = ibfd->link_next; ibfd2 != NULL; ibfd2 = ibfd2->link_next)
+ for (ibfd2 = ibfd->link.next; ibfd2 != NULL; ibfd2 = ibfd2->link.next)
{
if (!is_ppc64_elf (ibfd2))
continue;
@@ -10797,11 +11331,11 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info)
}
/* Zap sizes of got sections. */
- htab->reliplt->rawsize = htab->reliplt->size;
- htab->reliplt->size -= htab->got_reli_size;
+ htab->elf.irelplt->rawsize = htab->elf.irelplt->size;
+ htab->elf.irelplt->size -= htab->got_reli_size;
htab->got_reli_size = 0;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
asection *got, *relgot;
@@ -10821,7 +11355,7 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info)
/* Now reallocate the got, local syms first. We don't need to
allocate section contents again since we never increase size. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
struct got_entry **lgot_ents;
struct got_entry **end_lgot_ents;
@@ -10864,7 +11398,7 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info)
s->size += ent_size;
if ((*lgot_masks & PLT_IFUNC) != 0)
{
- htab->reliplt->size += rel_size;
+ htab->elf.irelplt->size += rel_size;
htab->got_reli_size += rel_size;
}
else if (info->shared)
@@ -10878,7 +11412,7 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info)
elf_link_hash_traverse (&htab->elf, reallocate_got, info);
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
struct got_entry *ent;
@@ -10900,9 +11434,9 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info)
}
}
- done_something = htab->reliplt->rawsize != htab->reliplt->size;
+ done_something = htab->elf.irelplt->rawsize != htab->elf.irelplt->size;
if (!done_something)
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
asection *got;
@@ -10919,7 +11453,7 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info)
}
if (done_something)
- (*htab->layout_sections_again) ();
+ (*htab->params->layout_sections_again) ();
/* Set up for second pass over toc sections to recalculate elf_gp
on input sections. */
@@ -11088,7 +11622,10 @@ toc_adjusting_stub_needed (struct bfd_link_info *info, asection *isec)
need a plt_branch stub. A plt_branch stub uses r2. */
else if (dest - (isec->output_offset
+ isec->output_section->vma
- + rel->r_offset) + (1 << 25) >= (2 << 25))
+ + rel->r_offset) + (1 << 25)
+ >= (2u << 25) - PPC64_LOCAL_ENTRY_OFFSET (h
+ ? h->other
+ : sym->st_other))
{
ret = 1;
break;
@@ -11182,42 +11719,25 @@ ppc64_elf_next_input_section (struct bfd_link_info *info, asection *isec)
if (htab->multi_toc_needed)
{
- /* If a code section has a function that uses the TOC then we need
- to use the right TOC (obviously). Also, make sure that .opd gets
- the correct TOC value for R_PPC64_TOC relocs that don't have or
- can't find their function symbol (shouldn't ever happen now).
- Also specially treat .fixup for the linux kernel. .fixup
- contains branches, but only back to the function that hit an
- exception. */
- if (isec->has_toc_reloc
- || (isec->flags & SEC_CODE) == 0
- || strcmp (isec->name, ".fixup") == 0)
- {
- if (elf_gp (isec->owner) != 0)
- htab->toc_curr = elf_gp (isec->owner);
- }
- else
+ /* Analyse sections that aren't already flagged as needing a
+ valid toc pointer. Exclude .fixup for the linux kernel.
+ .fixup contains branches, but only back to the function that
+ hit an exception. */
+ if (!(isec->has_toc_reloc
+ || (isec->flags & SEC_CODE) == 0
+ || strcmp (isec->name, ".fixup") == 0
+ || isec->call_check_done))
{
- if (!isec->call_check_done
- && toc_adjusting_stub_needed (info, isec) < 0)
+ if (toc_adjusting_stub_needed (info, isec) < 0)
return FALSE;
- /* If we make a local call from this section, ie. a branch
- without a following nop, then we have no place to put a
- toc restoring insn. We must use the same toc group as
- the callee.
- Testing makes_toc_func_call actually tests for *any*
- calls to functions that need a good toc pointer. A more
- precise test would be better, as this one will set
- incorrect values for pasted .init/.fini fragments.
- (Fixed later in check_pasted_section.) */
- if (isec->makes_toc_func_call
- && elf_gp (isec->owner) != 0)
- htab->toc_curr = elf_gp (isec->owner);
- }
- }
-
- /* Functions that don't use the TOC can belong in any TOC group.
- Use the last TOC base. */
+ }
+ /* Make all sections use the TOC assigned for this object file.
+ This will be wrong for pasted sections; We fix that in
+ check_pasted_section(). */
+ if (elf_gp (isec->owner) != 0)
+ htab->toc_curr = elf_gp (isec->owner);
+ }
+
htab->stub_group[isec->id].toc_off = htab->toc_curr;
return TRUE;
}
@@ -11389,7 +11909,8 @@ static const unsigned char glink_eh_frame_cie[] =
65, /* RA reg. */
1, /* Augmentation size. */
DW_EH_PE_pcrel | DW_EH_PE_sdata4, /* FDE encoding. */
- DW_CFA_def_cfa, 1, 0 /* def_cfa: r1 offset 0. */
+ DW_CFA_def_cfa, 1, 0, /* def_cfa: r1 offset 0. */
+ 0, 0, 0, 0
};
/* Stripping output sections is normally done before dynamic section
@@ -11420,9 +11941,7 @@ maybe_strip_output (struct bfd_link_info *info, asection *isec)
instruction. */
bfd_boolean
-ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size,
- bfd_boolean plt_static_chain, int plt_thread_safe,
- int plt_stub_align)
+ppc64_elf_size_stubs (struct bfd_link_info *info)
{
bfd_size_type stub_group_size;
bfd_boolean stubs_always_before_branch;
@@ -11431,11 +11950,11 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size,
if (htab == NULL)
return FALSE;
- htab->plt_static_chain = plt_static_chain;
- htab->plt_stub_align = plt_stub_align;
- if (plt_thread_safe == -1 && !info->executable)
- plt_thread_safe = 1;
- if (plt_thread_safe == -1)
+ if (htab->params->plt_thread_safe == -1 && !info->executable)
+ htab->params->plt_thread_safe = 1;
+ if (!htab->opd_abi)
+ htab->params->plt_thread_safe = 0;
+ else if (htab->params->plt_thread_safe == -1)
{
static const char *const thread_starter[] =
{
@@ -11448,11 +11967,17 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size,
/* libanl */
"getaddrinfo_a",
/* libgomp */
+ "GOMP_parallel",
"GOMP_parallel_start",
+ "GOMP_parallel_loop_static",
"GOMP_parallel_loop_static_start",
+ "GOMP_parallel_loop_dynamic",
"GOMP_parallel_loop_dynamic_start",
+ "GOMP_parallel_loop_guided",
"GOMP_parallel_loop_guided_start",
+ "GOMP_parallel_loop_runtime",
"GOMP_parallel_loop_runtime_start",
+ "GOMP_parallel_sections",
"GOMP_parallel_sections_start",
};
unsigned i;
@@ -11462,17 +11987,16 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size,
struct elf_link_hash_entry *h;
h = elf_link_hash_lookup (&htab->elf, thread_starter[i],
FALSE, FALSE, TRUE);
- plt_thread_safe = h != NULL && h->ref_regular;
- if (plt_thread_safe)
+ htab->params->plt_thread_safe = h != NULL && h->ref_regular;
+ if (htab->params->plt_thread_safe)
break;
}
}
- htab->plt_thread_safe = plt_thread_safe;
- stubs_always_before_branch = group_size < 0;
- if (group_size < 0)
- stub_group_size = -group_size;
+ stubs_always_before_branch = htab->params->group_size < 0;
+ if (htab->params->group_size < 0)
+ stub_group_size = -htab->params->group_size;
else
- stub_group_size = group_size;
+ stub_group_size = htab->params->group_size;
group_sections (htab, stub_group_size, stubs_always_before_branch);
@@ -11486,7 +12010,7 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size,
for (input_bfd = info->input_bfds, bfd_indx = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next, bfd_indx++)
+ input_bfd = input_bfd->link.next, bfd_indx++)
{
Elf_Internal_Shdr *symtab_hdr;
asection *section;
@@ -11541,6 +12065,7 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size,
asection *sym_sec, *code_sec;
bfd_vma sym_value, code_value;
bfd_vma destination;
+ unsigned long local_off;
bfd_boolean ok_dest;
struct ppc_link_hash_entry *hash;
struct ppc_link_hash_entry *fdh;
@@ -11617,12 +12142,16 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size,
}
destination = 0;
+ local_off = 0;
if (ok_dest)
{
sym_value += irela->r_addend;
destination = (sym_value
+ sym_sec->output_offset
+ sym_sec->output_section->vma);
+ local_off = PPC64_LOCAL_ENTRY_OFFSET (hash
+ ? hash->elf.other
+ : sym->st_other);
}
code_sec = sym_sec;
@@ -11659,7 +12188,8 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size,
/* Determine what (if any) linker stub is needed. */
plt_ent = NULL;
stub_type = ppc_type_of_stub (section, irela, &hash,
- &plt_ent, destination);
+ &plt_ent, destination,
+ local_off);
if (stub_type != ppc_stub_plt_call)
{
@@ -11759,6 +12289,7 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size,
}
stub_entry->h = hash;
stub_entry->plt_ent = plt_ent;
+ stub_entry->other = hash ? hash->elf.other : sym->st_other;
if (stub_entry->h != NULL)
htab->stub_globals += 1;
@@ -11781,7 +12312,7 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size,
/* We may have added some stubs. Find out the new size of the
stub sections. */
- for (stub_sec = htab->stub_bfd->sections;
+ for (stub_sec = htab->params->stub_bfd->sections;
stub_sec != NULL;
stub_sec = stub_sec->next)
if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
@@ -11813,11 +12344,11 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size,
{
size_t size = 0, align;
- for (stub_sec = htab->stub_bfd->sections;
+ for (stub_sec = htab->params->stub_bfd->sections;
stub_sec != NULL;
stub_sec = stub_sec->next)
if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
- size += 20;
+ size += 24;
if (htab->glink != NULL && htab->glink->size != 0)
size += 24;
if (size != 0)
@@ -11830,15 +12361,16 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size,
htab->glink_eh_frame->size = size;
}
- if (htab->plt_stub_align != 0)
- for (stub_sec = htab->stub_bfd->sections;
+ if (htab->params->plt_stub_align != 0)
+ for (stub_sec = htab->params->stub_bfd->sections;
stub_sec != NULL;
stub_sec = stub_sec->next)
if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
- stub_sec->size = ((stub_sec->size + (1 << htab->plt_stub_align) - 1)
- & (-1 << htab->plt_stub_align));
+ stub_sec->size = ((stub_sec->size
+ + (1 << htab->params->plt_stub_align) - 1)
+ & (-1 << htab->params->plt_stub_align));
- for (stub_sec = htab->stub_bfd->sections;
+ for (stub_sec = htab->params->stub_bfd->sections;
stub_sec != NULL;
stub_sec = stub_sec->next)
if ((stub_sec->flags & SEC_LINKER_CREATED) == 0
@@ -11853,7 +12385,90 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size,
break;
/* Ask the linker to do its stuff. */
- (*htab->layout_sections_again) ();
+ (*htab->params->layout_sections_again) ();
+ }
+
+ if (htab->glink_eh_frame != NULL
+ && htab->glink_eh_frame->size != 0)
+ {
+ bfd_vma val;
+ bfd_byte *p, *last_fde;
+ size_t last_fde_len, size, align, pad;
+ asection *stub_sec;
+
+ p = bfd_zalloc (htab->glink_eh_frame->owner, htab->glink_eh_frame->size);
+ if (p == NULL)
+ return FALSE;
+ htab->glink_eh_frame->contents = p;
+ last_fde = p;
+
+ memcpy (p, glink_eh_frame_cie, sizeof (glink_eh_frame_cie));
+ /* CIE length (rewrite in case little-endian). */
+ last_fde_len = sizeof (glink_eh_frame_cie) - 4;
+ bfd_put_32 (htab->elf.dynobj, last_fde_len, p);
+ p += sizeof (glink_eh_frame_cie);
+
+ for (stub_sec = htab->params->stub_bfd->sections;
+ stub_sec != NULL;
+ stub_sec = stub_sec->next)
+ if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
+ {
+ last_fde = p;
+ last_fde_len = 20;
+ /* FDE length. */
+ bfd_put_32 (htab->elf.dynobj, 20, p);
+ p += 4;
+ /* CIE pointer. */
+ val = p - htab->glink_eh_frame->contents;
+ bfd_put_32 (htab->elf.dynobj, val, p);
+ p += 4;
+ /* Offset to stub section, written later. */
+ p += 4;
+ /* stub section size. */
+ bfd_put_32 (htab->elf.dynobj, stub_sec->size, p);
+ p += 4;
+ /* Augmentation. */
+ p += 1;
+ /* Pad. */
+ p += 7;
+ }
+ if (htab->glink != NULL && htab->glink->size != 0)
+ {
+ last_fde = p;
+ last_fde_len = 20;
+ /* FDE length. */
+ bfd_put_32 (htab->elf.dynobj, 20, p);
+ p += 4;
+ /* CIE pointer. */
+ val = p - htab->glink_eh_frame->contents;
+ bfd_put_32 (htab->elf.dynobj, val, p);
+ p += 4;
+ /* Offset to .glink, written later. */
+ p += 4;
+ /* .glink size. */
+ bfd_put_32 (htab->elf.dynobj, htab->glink->size - 8, p);
+ p += 4;
+ /* Augmentation. */
+ p += 1;
+
+ *p++ = DW_CFA_advance_loc + 1;
+ *p++ = DW_CFA_register;
+ *p++ = 65;
+ *p++ = 12;
+ *p++ = DW_CFA_advance_loc + 4;
+ *p++ = DW_CFA_restore_extended;
+ *p++ = 65;
+ }
+ /* Subsume any padding into the last FDE if user .eh_frame
+ sections are aligned more than glink_eh_frame. Otherwise any
+ zero padding will be seen as a terminator. */
+ size = p - htab->glink_eh_frame->contents;
+ align = 1;
+ align <<= htab->glink_eh_frame->output_section->alignment_power;
+ align -= 1;
+ pad = ((size + align) & ~align) - size;
+ htab->glink_eh_frame->size = size + pad;
+ bfd_put_32 (htab->elf.dynobj, last_fde_len + pad, last_fde);
}
maybe_strip_output (info, htab->brlt);
@@ -11920,29 +12535,127 @@ ppc64_elf_set_toc (struct bfd_link_info *info, bfd *obfd)
_bfd_set_gp_value (obfd, TOCstart);
- if (info != NULL && s != NULL && is_ppc64_elf (obfd))
+ if (info != NULL && s != NULL)
{
struct ppc_link_hash_table *htab = ppc_hash_table (info);
- if (htab != NULL
- && htab->elf.hgot != NULL)
+ if (htab != NULL)
+ {
+ if (htab->elf.hgot != NULL)
+ {
+ htab->elf.hgot->root.u.def.value = TOC_BASE_OFF;
+ htab->elf.hgot->root.u.def.section = s;
+ }
+ }
+ else
{
- htab->elf.hgot->type = STT_OBJECT;
- htab->elf.hgot->root.type = bfd_link_hash_defined;
- htab->elf.hgot->root.u.def.value = TOC_BASE_OFF;
- htab->elf.hgot->root.u.def.section = s;
+ struct bfd_link_hash_entry *bh = NULL;
+ _bfd_generic_link_add_one_symbol (info, obfd, ".TOC.", BSF_GLOBAL,
+ s, TOC_BASE_OFF, NULL, FALSE,
+ FALSE, &bh);
}
}
return TOCstart;
}
+/* Called via elf_link_hash_traverse from ppc64_elf_build_stubs to
+ write out any global entry stubs. */
+
+static bfd_boolean
+build_global_entry_stubs (struct elf_link_hash_entry *h, void *inf)
+{
+ struct bfd_link_info *info;
+ struct ppc_link_hash_table *htab;
+ struct plt_entry *pent;
+ asection *s;
+
+ if (h->root.type == bfd_link_hash_indirect)
+ return TRUE;
+
+ if (!h->pointer_equality_needed)
+ return TRUE;
+
+ if (h->def_regular)
+ return TRUE;
+
+ info = inf;
+ htab = ppc_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
+ s = htab->glink;
+ for (pent = h->plt.plist; pent != NULL; pent = pent->next)
+ if (pent->plt.offset != (bfd_vma) -1
+ && pent->addend == 0)
+ {
+ bfd_byte *p;
+ asection *plt;
+ bfd_vma off;
+
+ p = s->contents + h->root.u.def.value;
+ plt = htab->elf.splt;
+ if (!htab->elf.dynamic_sections_created
+ || h->dynindx == -1)
+ plt = htab->elf.iplt;
+ off = pent->plt.offset + plt->output_offset + plt->output_section->vma;
+ off -= h->root.u.def.value + s->output_offset + s->output_section->vma;
+
+ if (off + 0x80008000 > 0xffffffff || (off & 3) != 0)
+ {
+ info->callbacks->einfo
+ (_("%P: linkage table error against `%T'\n"),
+ h->root.root.string);
+ bfd_set_error (bfd_error_bad_value);
+ htab->stub_error = TRUE;
+ }
+
+ htab->stub_count[ppc_stub_global_entry - 1] += 1;
+ if (htab->params->emit_stub_syms)
+ {
+ size_t len = strlen (h->root.root.string);
+ char *name = bfd_malloc (sizeof "12345678.global_entry." + len);
+
+ if (name == NULL)
+ return FALSE;
+
+ sprintf (name, "%08x.global_entry.%s", s->id, h->root.root.string);
+ h = elf_link_hash_lookup (&htab->elf, name, TRUE, FALSE, FALSE);
+ if (h == NULL)
+ return FALSE;
+ if (h->root.type == bfd_link_hash_new)
+ {
+ h->root.type = bfd_link_hash_defined;
+ h->root.u.def.section = s;
+ h->root.u.def.value = p - s->contents;
+ h->ref_regular = 1;
+ h->def_regular = 1;
+ h->ref_regular_nonweak = 1;
+ h->forced_local = 1;
+ h->non_elf = 0;
+ }
+ }
+
+ if (PPC_HA (off) != 0)
+ {
+ bfd_put_32 (s->owner, ADDIS_R12_R12 | PPC_HA (off), p);
+ p += 4;
+ }
+ bfd_put_32 (s->owner, LD_R12_0R12 | PPC_LO (off), p);
+ p += 4;
+ bfd_put_32 (s->owner, MTCTR_R12, p);
+ p += 4;
+ bfd_put_32 (s->owner, BCTR, p);
+ break;
+ }
+ return TRUE;
+}
+
/* Build all the stubs associated with the current output file.
The stubs are kept in a hash table attached to the main linker
hash table. This function is called via gldelf64ppc_finish. */
bfd_boolean
-ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
- struct bfd_link_info *info,
+ppc64_elf_build_stubs (struct bfd_link_info *info,
char **stats)
{
struct ppc_link_hash_table *htab = ppc_hash_table (info);
@@ -11953,16 +12666,14 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
if (htab == NULL)
return FALSE;
- htab->emit_stub_syms = emit_stub_syms;
-
/* Allocate memory to hold the linker stubs. */
- for (stub_sec = htab->stub_bfd->sections;
+ for (stub_sec = htab->params->stub_bfd->sections;
stub_sec != NULL;
stub_sec = stub_sec->next)
if ((stub_sec->flags & SEC_LINKER_CREATED) == 0
&& stub_sec->size != 0)
{
- stub_sec->contents = bfd_zalloc (htab->stub_bfd, stub_sec->size);
+ stub_sec->contents = bfd_zalloc (htab->params->stub_bfd, stub_sec->size);
if (stub_sec->contents == NULL)
return FALSE;
/* We want to check that built size is the same as calculated
@@ -11977,7 +12688,7 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
bfd_vma plt0;
/* Build the .glink plt call stub. */
- if (htab->emit_stub_syms)
+ if (htab->params->emit_stub_syms)
{
struct elf_link_hash_entry *h;
h = elf_link_hash_lookup (&htab->elf, "__glink_PLTresolve",
@@ -11996,7 +12707,9 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
h->non_elf = 0;
}
}
- plt0 = htab->plt->output_section->vma + htab->plt->output_offset - 16;
+ plt0 = (htab->elf.splt->output_section->vma
+ + htab->elf.splt->output_offset
+ - 16);
if (info->emitrelocations)
{
Elf_Internal_Rela *r = get_relocs (htab->glink, 1);
@@ -12011,26 +12724,56 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
plt0 -= htab->glink->output_section->vma + htab->glink->output_offset;
bfd_put_64 (htab->glink->owner, plt0, p);
p += 8;
- bfd_put_32 (htab->glink->owner, MFLR_R12, p);
- p += 4;
- bfd_put_32 (htab->glink->owner, BCL_20_31, p);
- p += 4;
- bfd_put_32 (htab->glink->owner, MFLR_R11, p);
- p += 4;
- bfd_put_32 (htab->glink->owner, LD_R2_M16R11, p);
- p += 4;
- bfd_put_32 (htab->glink->owner, MTLR_R12, p);
- p += 4;
- bfd_put_32 (htab->glink->owner, ADD_R12_R2_R11, p);
- p += 4;
- bfd_put_32 (htab->glink->owner, LD_R11_0R12, p);
- p += 4;
- bfd_put_32 (htab->glink->owner, LD_R2_0R12 | 8, p);
- p += 4;
- bfd_put_32 (htab->glink->owner, MTCTR_R11, p);
- p += 4;
- bfd_put_32 (htab->glink->owner, LD_R11_0R12 | 16, p);
- p += 4;
+ if (htab->opd_abi)
+ {
+ bfd_put_32 (htab->glink->owner, MFLR_R12, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, BCL_20_31, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, MFLR_R11, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, LD_R2_0R11 | (-16 & 0xfffc), p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, MTLR_R12, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, ADD_R11_R2_R11, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, LD_R12_0R11, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, LD_R2_0R11 | 8, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, MTCTR_R12, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, LD_R11_0R11 | 16, p);
+ p += 4;
+ }
+ else
+ {
+ bfd_put_32 (htab->glink->owner, MFLR_R0, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, BCL_20_31, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, MFLR_R11, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, LD_R2_0R11 | (-16 & 0xfffc), p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, MTLR_R0, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, SUB_R12_R12_R11, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, ADD_R11_R2_R11, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, ADDI_R0_R12 | (-48 & 0xffff), p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, LD_R12_0R11, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, SRDI_R0_R0_2, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, MTCTR_R12, p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, LD_R11_0R11 | 8, p);
+ p += 4;
+ }
bfd_put_32 (htab->glink->owner, BCTR, p);
p += 4;
while (p - htab->glink->contents < GLINK_CALL_STUB_SIZE)
@@ -12041,29 +12784,36 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
/* Build the .glink lazy link call stubs. */
indx = 0;
- while (p < htab->glink->contents + htab->glink->size)
+ while (p < htab->glink->contents + htab->glink->rawsize)
{
- if (indx < 0x8000)
- {
- bfd_put_32 (htab->glink->owner, LI_R0_0 | indx, p);
- p += 4;
- }
- else
+ if (htab->opd_abi)
{
- bfd_put_32 (htab->glink->owner, LIS_R0_0 | PPC_HI (indx), p);
- p += 4;
- bfd_put_32 (htab->glink->owner, ORI_R0_R0_0 | PPC_LO (indx), p);
- p += 4;
+ if (indx < 0x8000)
+ {
+ bfd_put_32 (htab->glink->owner, LI_R0_0 | indx, p);
+ p += 4;
+ }
+ else
+ {
+ bfd_put_32 (htab->glink->owner, LIS_R0_0 | PPC_HI (indx), p);
+ p += 4;
+ bfd_put_32 (htab->glink->owner, ORI_R0_R0_0 | PPC_LO (indx),
+ p);
+ p += 4;
+ }
}
bfd_put_32 (htab->glink->owner,
B_DOT | ((htab->glink->contents - p + 8) & 0x3fffffc), p);
indx++;
p += 4;
}
- htab->glink->rawsize = p - htab->glink->contents;
+
+ /* Build .glink global entry stubs. */
+ if (htab->glink->size > htab->glink->rawsize)
+ elf_link_hash_traverse (&htab->elf, build_global_entry_stubs, info);
}
- if (htab->brlt->size != 0)
+ if (htab->brlt != NULL && htab->brlt->size != 0)
{
htab->brlt->contents = bfd_zalloc (htab->brlt->owner,
htab->brlt->size);
@@ -12078,132 +12828,22 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
return FALSE;
}
- if (htab->glink_eh_frame != NULL
- && htab->glink_eh_frame->size != 0)
- {
- bfd_vma val;
- bfd_byte *last_fde;
- size_t last_fde_len, size, align, pad;
-
- p = bfd_zalloc (htab->glink_eh_frame->owner, htab->glink_eh_frame->size);
- if (p == NULL)
- return FALSE;
- htab->glink_eh_frame->contents = p;
- last_fde = p;
-
- htab->glink_eh_frame->rawsize = htab->glink_eh_frame->size;
-
- memcpy (p, glink_eh_frame_cie, sizeof (glink_eh_frame_cie));
- /* CIE length (rewrite in case little-endian). */
- last_fde_len = sizeof (glink_eh_frame_cie) - 4;
- bfd_put_32 (htab->elf.dynobj, last_fde_len, p);
- p += sizeof (glink_eh_frame_cie);
-
- for (stub_sec = htab->stub_bfd->sections;
- stub_sec != NULL;
- stub_sec = stub_sec->next)
- if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
- {
- last_fde = p;
- last_fde_len = 16;
- /* FDE length. */
- bfd_put_32 (htab->elf.dynobj, 16, p);
- p += 4;
- /* CIE pointer. */
- val = p - htab->glink_eh_frame->contents;
- bfd_put_32 (htab->elf.dynobj, val, p);
- p += 4;
- /* Offset to stub section. */
- val = (stub_sec->output_section->vma
- + stub_sec->output_offset);
- val -= (htab->glink_eh_frame->output_section->vma
- + htab->glink_eh_frame->output_offset);
- val -= p - htab->glink_eh_frame->contents;
- if (val + 0x80000000 > 0xffffffff)
- {
- info->callbacks->einfo
- (_("%P: %s offset too large for .eh_frame sdata4 encoding"),
- stub_sec->name);
- return FALSE;
- }
- bfd_put_32 (htab->elf.dynobj, val, p);
- p += 4;
- /* stub section size. */
- bfd_put_32 (htab->elf.dynobj, stub_sec->rawsize, p);
- p += 4;
- /* Augmentation. */
- p += 1;
- /* Pad. */
- p += 3;
- }
- if (htab->glink != NULL && htab->glink->size != 0)
- {
- last_fde = p;
- last_fde_len = 20;
- /* FDE length. */
- bfd_put_32 (htab->elf.dynobj, 20, p);
- p += 4;
- /* CIE pointer. */
- val = p - htab->glink_eh_frame->contents;
- bfd_put_32 (htab->elf.dynobj, val, p);
- p += 4;
- /* Offset to .glink. */
- val = (htab->glink->output_section->vma
- + htab->glink->output_offset
- + 8);
- val -= (htab->glink_eh_frame->output_section->vma
- + htab->glink_eh_frame->output_offset);
- val -= p - htab->glink_eh_frame->contents;
- if (val + 0x80000000 > 0xffffffff)
- {
- info->callbacks->einfo
- (_("%P: %s offset too large for .eh_frame sdata4 encoding"),
- htab->glink->name);
- return FALSE;
- }
- bfd_put_32 (htab->elf.dynobj, val, p);
- p += 4;
- /* .glink size. */
- bfd_put_32 (htab->elf.dynobj, htab->glink->rawsize - 8, p);
- p += 4;
- /* Augmentation. */
- p += 1;
-
- *p++ = DW_CFA_advance_loc + 1;
- *p++ = DW_CFA_register;
- *p++ = 65;
- *p++ = 12;
- *p++ = DW_CFA_advance_loc + 4;
- *p++ = DW_CFA_restore_extended;
- *p++ = 65;
- }
- /* Subsume any padding into the last FDE if user .eh_frame
- sections are aligned more than glink_eh_frame. Otherwise any
- zero padding will be seen as a terminator. */
- size = p - htab->glink_eh_frame->contents;
- align = 1;
- align <<= htab->glink_eh_frame->output_section->alignment_power;
- align -= 1;
- pad = ((size + align) & ~align) - size;
- htab->glink_eh_frame->size = size + pad;
- bfd_put_32 (htab->elf.dynobj, last_fde_len + pad, last_fde);
- }
-
/* Build the stubs as directed by the stub hash table. */
bfd_hash_traverse (&htab->stub_hash_table, ppc_build_one_stub, info);
if (htab->relbrlt != NULL)
htab->relbrlt->reloc_count = 0;
- if (htab->plt_stub_align != 0)
- for (stub_sec = htab->stub_bfd->sections;
+ if (htab->params->plt_stub_align != 0)
+ for (stub_sec = htab->params->stub_bfd->sections;
stub_sec != NULL;
stub_sec = stub_sec->next)
if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
- stub_sec->size = ((stub_sec->size + (1 << htab->plt_stub_align) - 1)
- & (-1 << htab->plt_stub_align));
+ stub_sec->size = ((stub_sec->size
+ + (1 << htab->params->plt_stub_align) - 1)
+ & (-1 << htab->params->plt_stub_align));
- for (stub_sec = htab->stub_bfd->sections;
+ for (stub_sec = htab->params->stub_bfd->sections;
stub_sec != NULL;
stub_sec = stub_sec->next)
if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
@@ -12213,8 +12853,10 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
break;
}
+ /* Note that the glink_eh_frame check here is not only testing that
+ the generated size matched the calculated size but also that
+ bfd_elf_discard_info didn't make any changes to the section. */
if (stub_sec != NULL
- || htab->glink->rawsize != htab->glink->size
|| (htab->glink_eh_frame != NULL
&& htab->glink_eh_frame->rawsize != htab->glink_eh_frame->size))
{
@@ -12237,7 +12879,8 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
" long branch %lu\n"
" long toc adj %lu\n"
" plt call %lu\n"
- " plt call toc %lu"),
+ " plt call toc %lu\n"
+ " global entry %lu"),
stub_sec_count,
stub_sec_count == 1 ? "" : "s",
htab->stub_count[ppc_stub_long_branch - 1],
@@ -12245,7 +12888,8 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
htab->stub_count[ppc_stub_plt_branch - 1],
htab->stub_count[ppc_stub_plt_branch_r2off - 1],
htab->stub_count[ppc_stub_plt_call - 1],
- htab->stub_count[ppc_stub_plt_call_r2save - 1]);
+ htab->stub_count[ppc_stub_plt_call_r2save - 1],
+ htab->stub_count[ppc_stub_global_entry - 1]);
}
return TRUE;
}
@@ -12358,7 +13002,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
return FALSE;
/* Don't relocate stub sections. */
- if (input_section->owner == htab->stub_bfd)
+ if (input_section->owner == htab->params->stub_bfd)
return TRUE;
BFD_ASSERT (is_ppc64_elf (input_bfd));
@@ -12396,6 +13040,8 @@ ppc64_elf_relocate_section (bfd *output_bfd,
bfd_vma max_br_offset;
bfd_vma from;
const Elf_Internal_Rela orig_rel = *rel;
+ reloc_howto_type *howto;
+ struct reloc_howto_struct alt_howto;
r_type = ELF64_R_TYPE (rel->r_info);
r_symndx = ELF64_R_SYM (rel->r_info);
@@ -12448,10 +13094,12 @@ ppc64_elf_relocate_section (bfd *output_bfd,
}
else
{
+ bfd_boolean ignored;
+
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h_elf, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
sym_name = h_elf->root.root.string;
sym_type = h_elf->type;
if (sec != NULL
@@ -12956,6 +13604,40 @@ ppc64_elf_relocate_section (bfd *output_bfd,
rel->r_info = ELF64_R_INFO (r_symndx, r_type);
}
break;
+
+ case R_PPC64_REL16_HA:
+ /* If we are generating a non-PIC executable, edit
+ . 0: addis 2,12,.TOC.-0b@ha
+ . addi 2,2,.TOC.-0b@l
+ used by ELFv2 global entry points to set up r2, to
+ . lis 2,.TOC.@ha
+ . addi 2,2,.TOC.@l
+ if .TOC. is in range. */
+ if (!info->shared
+ && !info->traditional_format
+ && h != NULL && &h->elf == htab->elf.hgot
+ && rel + 1 < relend
+ && rel[1].r_info == ELF64_R_INFO (r_symndx, R_PPC64_REL16_LO)
+ && rel[1].r_offset == rel->r_offset + 4
+ && rel[1].r_addend == rel->r_addend + 4
+ && relocation + 0x80008000 <= 0xffffffff)
+ {
+ unsigned int insn1, insn2;
+ bfd_vma offset = rel->r_offset - d_offset;
+ insn1 = bfd_get_32 (output_bfd, contents + offset);
+ insn2 = bfd_get_32 (output_bfd, contents + offset + 4);
+ if ((insn1 & 0xffff0000) == 0x3c4c0000 /* addis 2,12 */
+ && (insn2 & 0xffff0000) == 0x38420000 /* addi 2,2 */)
+ {
+ r_type = R_PPC64_ADDR16_HA;
+ rel->r_info = ELF64_R_INFO (r_symndx, r_type);
+ rel->r_addend -= d_offset;
+ rel[1].r_info = ELF64_R_INFO (r_symndx, R_PPC64_ADDR16_LO);
+ rel[1].r_addend -= d_offset + 4;
+ bfd_put_32 (output_bfd, 0x3c400000, contents + offset);
+ }
+ }
+ break;
}
/* Handle other relocations that tweak non-addend part of insn. */
@@ -12978,7 +13660,8 @@ ppc64_elf_relocate_section (bfd *output_bfd,
insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
if (insn == NOP
|| insn == CROR_151515 || insn == CROR_313131)
- bfd_put_32 (input_bfd, STD_R2_40R1,
+ bfd_put_32 (input_bfd,
+ STD_R2_0R1 + STK_TOC (htab),
contents + rel->r_offset);
}
break;
@@ -13043,12 +13726,13 @@ ppc64_elf_relocate_section (bfd *output_bfd,
if (h != NULL
&& (h == htab->tls_get_addr_fd
|| h == htab->tls_get_addr)
- && !htab->no_tls_get_addr_opt)
+ && !htab->params->no_tls_get_addr_opt)
{
/* Special stub used, leave nop alone. */
}
else
- bfd_put_32 (input_bfd, LD_R2_40R1,
+ bfd_put_32 (input_bfd,
+ LD_R2_0R1 + STK_TOC (htab),
contents + rel->r_offset + 4);
can_plt_call = TRUE;
}
@@ -13098,10 +13782,17 @@ ppc64_elf_relocate_section (bfd *output_bfd,
if (!can_plt_call)
{
- info->callbacks->einfo
- (_("%P: %H: call to `%T' lacks nop, can't restore toc; "
- "recompile with -fPIC"),
- input_bfd, input_section, rel->r_offset, sym_name);
+ if (stub_entry->stub_type == ppc_stub_plt_call
+ || stub_entry->stub_type == ppc_stub_plt_call_r2save)
+ info->callbacks->einfo
+ (_("%P: %H: call to `%T' lacks nop, can't restore toc; "
+ "recompile with -fPIC\n"),
+ input_bfd, input_section, rel->r_offset, sym_name);
+ else
+ info->callbacks->einfo
+ (_("%P: %H: call to `%T' lacks nop, can't restore toc; "
+ "(-mcmodel=small toc adjust stub)\n"),
+ input_bfd, input_section, rel->r_offset, sym_name);
bfd_set_error (bfd_error_bad_value);
ret = FALSE;
@@ -13137,6 +13828,10 @@ ppc64_elf_relocate_section (bfd *output_bfd,
+ input_section->output_offset
+ input_section->output_section->vma);
+ relocation += PPC64_LOCAL_ENTRY_OFFSET (fdh
+ ? fdh->elf.other
+ : sym->st_other);
+
if (stub_entry != NULL
&& (stub_entry->stub_type == ppc_stub_long_branch
|| stub_entry->stub_type == ppc_stub_plt_branch)
@@ -13290,7 +13985,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared,
&h->elf)
|| (info->shared
- && SYMBOL_CALLS_LOCAL (info, &h->elf)))
+ && SYMBOL_REFERENCES_LOCAL (info, &h->elf)))
/* This is actually a static link, or it is a
-Bsymbolic link and the symbol is defined
locally, or the symbol was forced to be local
@@ -13347,7 +14042,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
? h->elf.type == STT_GNU_IFUNC
: ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC);
if (ifunc)
- relgot = htab->reliplt;
+ relgot = htab->elf.irelplt;
else if ((info->shared || indx != 0)
&& (h == NULL
|| (tls_type == (TLS_TLS | TLS_LD)
@@ -13461,17 +14156,18 @@ ppc64_elf_relocate_section (bfd *output_bfd,
symbol. This happens when statically linking PIC code,
or when using -Bsymbolic. Go find a match if there is a
PLT entry. */
- if (htab->plt != NULL)
+ if (htab->elf.splt != NULL)
{
struct plt_entry *ent;
for (ent = h->elf.plt.plist; ent != NULL; ent = ent->next)
- if (ent->addend == orig_rel.r_addend
- && ent->plt.offset != (bfd_vma) -1)
+ if (ent->plt.offset != (bfd_vma) -1
+ && ent->addend == orig_rel.r_addend)
{
- relocation = (htab->plt->output_section->vma
- + htab->plt->output_offset
+ relocation = (htab->elf.splt->output_section->vma
+ + htab->elf.splt->output_offset
+ ent->plt.offset);
unresolved_reloc = FALSE;
+ break;
}
}
break;
@@ -13531,6 +14227,8 @@ ppc64_elf_relocate_section (bfd *output_bfd,
case R_PPC64_TPREL16_HA:
case R_PPC64_TPREL16_DS:
case R_PPC64_TPREL16_LO_DS:
+ case R_PPC64_TPREL16_HIGH:
+ case R_PPC64_TPREL16_HIGHA:
case R_PPC64_TPREL16_HIGHER:
case R_PPC64_TPREL16_HIGHERA:
case R_PPC64_TPREL16_HIGHEST:
@@ -13565,6 +14263,8 @@ ppc64_elf_relocate_section (bfd *output_bfd,
case R_PPC64_DTPREL16_HA:
case R_PPC64_DTPREL16_DS:
case R_PPC64_DTPREL16_LO_DS:
+ case R_PPC64_DTPREL16_HIGH:
+ case R_PPC64_DTPREL16_HIGHA:
case R_PPC64_DTPREL16_HIGHER:
case R_PPC64_DTPREL16_HIGHERA:
case R_PPC64_DTPREL16_HIGHEST:
@@ -13572,6 +14272,12 @@ ppc64_elf_relocate_section (bfd *output_bfd,
addend -= htab->elf.tls_sec->vma + DTP_OFFSET;
break;
+ case R_PPC64_ADDR64_LOCAL:
+ addend += PPC64_LOCAL_ENTRY_OFFSET (h != NULL
+ ? h->elf.other
+ : sym->st_other);
+ break;
+
case R_PPC64_DTPMOD64:
relocation = 1;
addend = 0;
@@ -13597,6 +14303,8 @@ ppc64_elf_relocate_section (bfd *output_bfd,
case R_PPC64_ADDR16_DS:
case R_PPC64_ADDR16_HA:
case R_PPC64_ADDR16_HI:
+ case R_PPC64_ADDR16_HIGH:
+ case R_PPC64_ADDR16_HIGHA:
case R_PPC64_ADDR16_HIGHER:
case R_PPC64_ADDR16_HIGHERA:
case R_PPC64_ADDR16_HIGHEST:
@@ -13668,7 +14376,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
if (skip)
memset (&outrel, 0, sizeof outrel);
- else if (!SYMBOL_CALLS_LOCAL (info, &h->elf)
+ else if (!SYMBOL_REFERENCES_LOCAL (info, &h->elf)
&& !is_opd
&& r_type != R_PPC64_TOC)
{
@@ -13771,7 +14479,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
if (h != NULL
? h->elf.type == STT_GNU_IFUNC
: ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
- sreloc = htab->reliplt;
+ sreloc = htab->elf.irelplt;
if (sreloc == NULL)
abort ();
@@ -13906,26 +14614,26 @@ ppc64_elf_relocate_section (bfd *output_bfd,
}
/* Do any further special processing. */
+ howto = ppc64_elf_howto_table[(int) r_type];
switch (r_type)
{
default:
break;
- case R_PPC64_ADDR16_HA:
case R_PPC64_REL16_HA:
+ case R_PPC64_ADDR16_HA:
+ case R_PPC64_ADDR16_HIGHA:
case R_PPC64_ADDR16_HIGHERA:
case R_PPC64_ADDR16_HIGHESTA:
case R_PPC64_TOC16_HA:
case R_PPC64_SECTOFF_HA:
case R_PPC64_TPREL16_HA:
- case R_PPC64_DTPREL16_HA:
- case R_PPC64_TPREL16_HIGHER:
+ case R_PPC64_TPREL16_HIGHA:
case R_PPC64_TPREL16_HIGHERA:
- case R_PPC64_TPREL16_HIGHEST:
case R_PPC64_TPREL16_HIGHESTA:
- case R_PPC64_DTPREL16_HIGHER:
+ case R_PPC64_DTPREL16_HA:
+ case R_PPC64_DTPREL16_HIGHA:
case R_PPC64_DTPREL16_HIGHERA:
- case R_PPC64_DTPREL16_HIGHEST:
case R_PPC64_DTPREL16_HIGHESTA:
/* It's just possible that this symbol is a weak symbol
that's not actually defined anywhere. In that case,
@@ -13981,7 +14689,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
info->callbacks->einfo
(_("%P: %H: error: %s not a multiple of %u\n"),
input_bfd, input_section, rel->r_offset,
- ppc64_elf_howto_table[r_type]->name,
+ howto->name,
mask + 1);
bfd_set_error (bfd_error_bad_value);
ret = FALSE;
@@ -14002,23 +14710,46 @@ ppc64_elf_relocate_section (bfd *output_bfd,
info->callbacks->einfo
(_("%P: %H: unresolvable %s against `%T'\n"),
input_bfd, input_section, rel->r_offset,
- ppc64_elf_howto_table[(int) r_type]->name,
+ howto->name,
h->elf.root.root.string);
ret = FALSE;
}
- r = _bfd_final_link_relocate (ppc64_elf_howto_table[(int) r_type],
- input_bfd,
- input_section,
- contents,
- rel->r_offset,
- relocation,
- addend);
+ /* 16-bit fields in insns mostly have signed values, but a
+ few insns have 16-bit unsigned values. Really, we should
+ have different reloc types. */
+ if (howto->complain_on_overflow != complain_overflow_dont
+ && howto->dst_mask == 0xffff
+ && (input_section->flags & SEC_CODE) != 0)
+ {
+ enum complain_overflow complain = complain_overflow_signed;
+
+ insn = bfd_get_32 (input_bfd, contents + (rel->r_offset & ~3));
+ if ((insn & (0x3f << 26)) == 10u << 26 /* cmpli */)
+ complain = complain_overflow_bitfield;
+ else if (howto->rightshift == 0
+ ? ((insn & (0x3f << 26)) == 28u << 26 /* andi */
+ || (insn & (0x3f << 26)) == 24u << 26 /* ori */
+ || (insn & (0x3f << 26)) == 26u << 26 /* xori */)
+ : ((insn & (0x3f << 26)) == 29u << 26 /* andis */
+ || (insn & (0x3f << 26)) == 25u << 26 /* oris */
+ || (insn & (0x3f << 26)) == 27u << 26 /* xoris */))
+ complain = complain_overflow_unsigned;
+ if (howto->complain_on_overflow != complain)
+ {
+ alt_howto = *howto;
+ alt_howto.complain_on_overflow = complain;
+ howto = &alt_howto;
+ }
+ }
+
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents,
+ rel->r_offset, relocation, addend);
if (r != bfd_reloc_ok)
{
char *more_info = NULL;
- const char *reloc_name = ppc64_elf_howto_table[r_type]->name;
+ const char *reloc_name = howto->name;
if (reloc_dest != DEST_NORMAL)
{
@@ -14038,7 +14769,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
continue;
if (h != NULL
&& h->elf.root.type == bfd_link_hash_undefweak
- && ppc64_elf_howto_table[r_type]->pc_relative)
+ && howto->pc_relative)
{
/* Assume this is a call protected by other code that
detects the symbol is undefined. If this is the case,
@@ -14149,30 +14880,57 @@ ppc64_elf_finish_dynamic_symbol (bfd *output_bfd,
&& h->def_regular
&& (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak));
- rela.r_offset = (htab->iplt->output_section->vma
- + htab->iplt->output_offset
+ rela.r_offset = (htab->elf.iplt->output_section->vma
+ + htab->elf.iplt->output_offset
+ ent->plt.offset);
- rela.r_info = ELF64_R_INFO (0, R_PPC64_JMP_IREL);
+ if (htab->opd_abi)
+ rela.r_info = ELF64_R_INFO (0, R_PPC64_JMP_IREL);
+ else
+ rela.r_info = ELF64_R_INFO (0, R_PPC64_IRELATIVE);
rela.r_addend = (h->root.u.def.value
+ h->root.u.def.section->output_offset
+ h->root.u.def.section->output_section->vma
+ ent->addend);
- loc = (htab->reliplt->contents
- + (htab->reliplt->reloc_count++
+ loc = (htab->elf.irelplt->contents
+ + (htab->elf.irelplt->reloc_count++
* sizeof (Elf64_External_Rela)));
}
else
{
- rela.r_offset = (htab->plt->output_section->vma
- + htab->plt->output_offset
+ rela.r_offset = (htab->elf.splt->output_section->vma
+ + htab->elf.splt->output_offset
+ ent->plt.offset);
rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_JMP_SLOT);
rela.r_addend = ent->addend;
- loc = (htab->relplt->contents
- + ((ent->plt.offset - PLT_INITIAL_ENTRY_SIZE)
- / (PLT_ENTRY_SIZE / sizeof (Elf64_External_Rela))));
+ loc = (htab->elf.srelplt->contents
+ + ((ent->plt.offset - PLT_INITIAL_ENTRY_SIZE (htab))
+ / PLT_ENTRY_SIZE (htab) * sizeof (Elf64_External_Rela)));
}
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
+
+ if (!htab->opd_abi)
+ {
+ if (!h->def_regular)
+ {
+ /* Mark the symbol as undefined, rather than as
+ defined in glink. Leave the value if there were
+ any relocations where pointer equality matters
+ (this is a clue for the dynamic linker, to make
+ function pointer comparisons work between an
+ application and shared library), otherwise set it
+ to zero. */
+ sym->st_shndx = SHN_UNDEF;
+ if (!h->pointer_equality_needed)
+ sym->st_value = 0;
+ else if (!h->ref_regular_nonweak)
+ {
+ /* This breaks function pointer comparisons, but
+ that is better than breaking tests for a NULL
+ function pointer. */
+ sym->st_value = 0;
+ }
+ }
+ }
}
if (h->needs_copy)
@@ -14209,7 +14967,7 @@ ppc64_elf_reloc_type_class (const struct bfd_link_info *info,
enum elf_ppc64_reloc_type r_type;
struct ppc_link_hash_table *htab = ppc_hash_table (info);
- if (rel_sec == htab->reliplt)
+ if (rel_sec == htab->elf.irelplt)
return reloc_class_ifunc;
r_type = ELF64_R_TYPE (rela->r_info);
@@ -14247,7 +15005,7 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
{
Elf64_External_Dyn *dyncon, *dynconend;
- if (sdyn == NULL || htab->got == NULL)
+ if (sdyn == NULL || htab->elf.sgot == NULL)
abort ();
dyncon = (Elf64_External_Dyn *) sdyn->contents;
@@ -14271,7 +15029,7 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
of glink rather than the first entry point, which is
what ld.so needs, and now have a bigger stub to
support automatic multiple TOCs. */
- dyn.d_un.d_ptr += GLINK_CALL_STUB_SIZE - 32;
+ dyn.d_un.d_ptr += GLINK_CALL_STUB_SIZE - 8 * 4;
break;
case DT_PPC64_OPD:
@@ -14281,6 +15039,11 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
dyn.d_un.d_ptr = s->vma;
break;
+ case DT_PPC64_OPT:
+ if (htab->do_multi_toc && htab->multi_toc_needed)
+ dyn.d_un.d_val |= PPC64_OPT_MULTI_TOC;
+ break;
+
case DT_PPC64_OPDSZ:
s = bfd_get_section_by_name (output_bfd, ".opd");
if (s == NULL)
@@ -14289,23 +15052,23 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
break;
case DT_PLTGOT:
- s = htab->plt;
+ s = htab->elf.splt;
dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
break;
case DT_JMPREL:
- s = htab->relplt;
+ s = htab->elf.srelplt;
dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
break;
case DT_PLTRELSZ:
- dyn.d_un.d_val = htab->relplt->size;
+ dyn.d_un.d_val = htab->elf.srelplt->size;
break;
case DT_RELASZ:
/* Don't count procedure linkage table relocs in the
overall reloc count. */
- s = htab->relplt;
+ s = htab->elf.srelplt;
if (s == NULL)
continue;
dyn.d_un.d_val -= s->size;
@@ -14315,7 +15078,7 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
/* We may not be using the standard ELF linker script.
If .rela.plt is the first .rela section, we adjust
DT_RELA to not include it. */
- s = htab->relplt;
+ s = htab->elf.srelplt;
if (s == NULL)
continue;
if (dyn.d_un.d_ptr != s->output_section->vma + s->output_offset)
@@ -14328,23 +15091,23 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
}
}
- if (htab->got != NULL && htab->got->size != 0)
+ if (htab->elf.sgot != NULL && htab->elf.sgot->size != 0)
{
/* Fill in the first entry in the global offset table.
We use it to hold the link-time TOCbase. */
bfd_put_64 (output_bfd,
elf_gp (output_bfd) + TOC_BASE_OFF,
- htab->got->contents);
+ htab->elf.sgot->contents);
/* Set .got entry size. */
- elf_section_data (htab->got->output_section)->this_hdr.sh_entsize = 8;
+ elf_section_data (htab->elf.sgot->output_section)->this_hdr.sh_entsize = 8;
}
- if (htab->plt != NULL && htab->plt->size != 0)
+ if (htab->elf.splt != NULL && htab->elf.splt->size != 0)
{
/* Set .plt entry size. */
- elf_section_data (htab->plt->output_section)->this_hdr.sh_entsize
- = PLT_ENTRY_SIZE;
+ elf_section_data (htab->elf.splt->output_section)->this_hdr.sh_entsize
+ = PLT_ENTRY_SIZE (htab);
}
/* brlt is SEC_LINKER_CREATED, so we need to write out relocs for
@@ -14367,18 +15130,86 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
NULL))
return FALSE;
-
if (htab->glink_eh_frame != NULL
- && htab->glink_eh_frame->sec_info_type == SEC_INFO_TYPE_EH_FRAME
- && !_bfd_elf_write_section_eh_frame (output_bfd, info,
- htab->glink_eh_frame,
- htab->glink_eh_frame->contents))
- return FALSE;
+ && htab->glink_eh_frame->size != 0)
+ {
+ bfd_vma val;
+ bfd_byte *p;
+ asection *stub_sec;
+
+ p = htab->glink_eh_frame->contents + sizeof (glink_eh_frame_cie);
+ for (stub_sec = htab->params->stub_bfd->sections;
+ stub_sec != NULL;
+ stub_sec = stub_sec->next)
+ if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
+ {
+ /* FDE length. */
+ p += 4;
+ /* CIE pointer. */
+ p += 4;
+ /* Offset to stub section. */
+ val = (stub_sec->output_section->vma
+ + stub_sec->output_offset);
+ val -= (htab->glink_eh_frame->output_section->vma
+ + htab->glink_eh_frame->output_offset
+ + (p - htab->glink_eh_frame->contents));
+ if (val + 0x80000000 > 0xffffffff)
+ {
+ info->callbacks->einfo
+ (_("%P: %s offset too large for .eh_frame sdata4 encoding"),
+ stub_sec->name);
+ return FALSE;
+ }
+ bfd_put_32 (dynobj, val, p);
+ p += 4;
+ /* stub section size. */
+ p += 4;
+ /* Augmentation. */
+ p += 1;
+ /* Pad. */
+ p += 7;
+ }
+ if (htab->glink != NULL && htab->glink->size != 0)
+ {
+ /* FDE length. */
+ p += 4;
+ /* CIE pointer. */
+ p += 4;
+ /* Offset to .glink. */
+ val = (htab->glink->output_section->vma
+ + htab->glink->output_offset
+ + 8);
+ val -= (htab->glink_eh_frame->output_section->vma
+ + htab->glink_eh_frame->output_offset
+ + (p - htab->glink_eh_frame->contents));
+ if (val + 0x80000000 > 0xffffffff)
+ {
+ info->callbacks->einfo
+ (_("%P: %s offset too large for .eh_frame sdata4 encoding"),
+ htab->glink->name);
+ return FALSE;
+ }
+ bfd_put_32 (dynobj, val, p);
+ p += 4;
+ /* .glink size. */
+ p += 4;
+ /* Augmentation. */
+ p += 1;
+ /* Ops. */
+ p += 7;
+ }
+
+ if (htab->glink_eh_frame->sec_info_type == SEC_INFO_TYPE_EH_FRAME
+ && !_bfd_elf_write_section_eh_frame (output_bfd, info,
+ htab->glink_eh_frame,
+ htab->glink_eh_frame->contents))
+ return FALSE;
+ }
/* We need to handle writing out multiple GOT sections ourselves,
since we didn't add them to DYNOBJ. We know dynobj is the first
bfd. */
- while ((dynobj = dynobj->link_next) != NULL)
+ while ((dynobj = dynobj->link.next) != NULL)
{
asection *s;
@@ -14414,7 +15245,7 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
#undef TARGET_LITTLE_NAME
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf64_powerpc_freebsd_vec
+#define TARGET_BIG_SYM powerpc_elf64_fbsd_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf64-powerpc-freebsd"
diff --git a/binutils-2.25/bfd/elf64-ppc.h b/binutils-2.25/bfd/elf64-ppc.h
index 06c655f7..d05fee5c 100644
--- a/binutils-2.25/bfd/elf64-ppc.h
+++ b/binutils-2.25/bfd/elf64-ppc.h
@@ -1,6 +1,5 @@
/* PowerPC64-specific support for 64-bit ELF.
- Copyright 2002, 2003, 2004, 2005, 2007, 2008, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -19,12 +18,53 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
+/* Used to pass info between ld and bfd. */
+struct ppc64_elf_params
+{
+ /* Linker stub bfd. */
+ bfd *stub_bfd;
+
+ /* Linker call-backs. */
+ asection * (*add_stub_section) (const char *, asection *);
+ void (*layout_sections_again) (void);
+
+ /* Maximum size of a group of input sections that can be handled by
+ one stub section. A value of +/-1 indicates the bfd back-end
+ should use a suitable default size. */
+ bfd_signed_vma group_size;
+
+ /* Whether to use a special call stub for __tls_get_addr. */
+ int no_tls_get_addr_opt;
+
+ /* Whether to allow multiple toc sections. */
+ int no_multi_toc;
+
+ /* Set if PLT call stubs should load r11. */
+ int plt_static_chain;
+
+ /* Set if PLT call stubs need to be thread safe on power7+. */
+ int plt_thread_safe;
+
+ /* Set if individual PLT call stubs should be aligned. */
+ int plt_stub_align;
+
+ /* Whether to canonicalize .opd so that there are no overlapping
+ .opd entries. */
+ int non_overlapping_opd;
+
+ /* Whether to emit symbols for stubs. */
+ int emit_stub_syms;
+
+ /* Whether to generate out-of-line register save/restore for gcc -Os code. */
+ int save_restore_funcs;
+};
+
bfd_boolean ppc64_elf_init_stub_bfd
- (bfd *, struct bfd_link_info *);
+ (struct bfd_link_info *, struct ppc64_elf_params *);
bfd_boolean ppc64_elf_edit_opd
- (struct bfd_link_info *, bfd_boolean);
+ (struct bfd_link_info *);
asection *ppc64_elf_tls_setup
- (struct bfd_link_info *, int, int *);
+ (struct bfd_link_info *);
bfd_boolean ppc64_elf_tls_optimize
(struct bfd_link_info *);
bfd_boolean ppc64_elf_edit_toc
@@ -34,8 +74,7 @@ bfd_boolean ppc64_elf_has_small_toc_reloc
bfd_vma ppc64_elf_set_toc
(struct bfd_link_info *, bfd *);
int ppc64_elf_setup_section_lists
- (struct bfd_link_info *, asection *(*) (const char *, asection *),
- void (*) (void));
+ (struct bfd_link_info *);
void ppc64_elf_start_multitoc_partition
(struct bfd_link_info *);
bfd_boolean ppc64_elf_next_toc_section
@@ -49,8 +88,8 @@ bfd_boolean ppc64_elf_check_init_fini
bfd_boolean ppc64_elf_next_input_section
(struct bfd_link_info *, asection *);
bfd_boolean ppc64_elf_size_stubs
-(struct bfd_link_info *, bfd_signed_vma, bfd_boolean, int, int);
+(struct bfd_link_info *);
bfd_boolean ppc64_elf_build_stubs
- (bfd_boolean, struct bfd_link_info *, char **);
+ (struct bfd_link_info *, char **);
void ppc64_elf_restore_symbols
(struct bfd_link_info *info);
diff --git a/binutils-2.25/bfd/elf64-s390.c b/binutils-2.25/bfd/elf64-s390.c
index 3aea98ce..b2f1aa59 100644
--- a/binutils-2.25/bfd/elf64-s390.c
+++ b/binutils-2.25/bfd/elf64-s390.c
@@ -1,6 +1,5 @@
/* IBM S/390-specific support for 64-bit ELF
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
Contributed Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of BFD, the Binary File Descriptor library.
@@ -1184,6 +1183,12 @@ elf_s390_check_relocs (bfd *abfd,
/* Fall through */
case R_390_TLS_LE64:
+ /* For static linking and executables this reloc will be
+ calculated at linktime otherwise a TLS_TPOFF runtime
+ reloc will be generated. */
+ if (r_type == R_390_TLS_LE64 && info->pie)
+ break;
+
if (!info->shared)
break;
info->flags |= DF_STATIC_TLS;
@@ -1996,7 +2001,7 @@ elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -2374,11 +2379,12 @@ elf_s390_relocate_section (bfd *output_bfd,
else
{
bfd_boolean warned ATTRIBUTE_UNUSED;
+ bfd_boolean ignored ATTRIBUTE_UNUSED;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
}
if (sec != NULL && discarded_section (sec))
@@ -3074,7 +3080,7 @@ elf_s390_relocate_section (bfd *output_bfd,
break;
case R_390_TLS_LE64:
- if (info->shared)
+ if (info->shared && !info->pie)
{
/* Linking a shared library with non-fpic code requires
a R_390_TLS_TPOFF relocation. */
@@ -3717,7 +3723,7 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd,
}
/* Finish dynamic symbol for local IFUNC symbols. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
struct plt_entry *local_plt;
Elf_Internal_Sym *isym;
@@ -3795,7 +3801,7 @@ const struct elf_size_info s390_elf64_size_info =
bfd_elf64_swap_reloca_out
};
-#define TARGET_BIG_SYM bfd_elf64_s390_vec
+#define TARGET_BIG_SYM s390_elf64_vec
#define TARGET_BIG_NAME "elf64-s390"
#define ELF_ARCH bfd_arch_s390
#define ELF_TARGET_ID S390_ELF_DATA
diff --git a/binutils-2.25/bfd/elf64-sh64.c b/binutils-2.25/bfd/elf64-sh64.c
index e70887bd..311d7c3e 100644
--- a/binutils-2.25/bfd/elf64-sh64.c
+++ b/binutils-2.25/bfd/elf64-sh64.c
@@ -1,6 +1,5 @@
/* SuperH SH64-specific support for 64-bit ELF
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -2286,8 +2285,8 @@ sh_elf64_copy_private_data_internal (bfd *ibfd, bfd *obfd)
}
/* Copy object attributes. */
- _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
+ _bfd_elf_copy_private_bfd_data (ibfd, obfd);
+
return sh_elf64_set_private_flags (obfd, elf_elfheader (ibfd)->e_flags);
}
@@ -3958,9 +3957,9 @@ static const struct bfd_elf_special_section sh64_elf64_special_sections[]=
{ NULL, 0, 0, 0, 0 }
};
-#define TARGET_BIG_SYM bfd_elf64_sh64_vec
+#define TARGET_BIG_SYM sh64_elf64_vec
#define TARGET_BIG_NAME "elf64-sh64"
-#define TARGET_LITTLE_SYM bfd_elf64_sh64l_vec
+#define TARGET_LITTLE_SYM sh64_elf64_le_vec
#define TARGET_LITTLE_NAME "elf64-sh64l"
#define ELF_ARCH bfd_arch_sh
#define ELF_MACHINE_CODE EM_SH
@@ -4030,11 +4029,11 @@ static const struct bfd_elf_special_section sh64_elf64_special_sections[]=
/* NetBSD support. */
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf64_sh64nbsd_vec
+#define TARGET_BIG_SYM sh64_elf64_nbsd_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf64-sh64-nbsd"
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf64_sh64lnbsd_vec
+#define TARGET_LITTLE_SYM sh64_elf64_nbsd_le_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-sh64l-nbsd"
#undef ELF_MAXPAGESIZE
@@ -4048,11 +4047,11 @@ static const struct bfd_elf_special_section sh64_elf64_special_sections[]=
/* Linux support. */
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf64_sh64blin_vec
+#define TARGET_BIG_SYM sh64_elf64_linux_be_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf64-sh64big-linux"
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf64_sh64lin_vec
+#define TARGET_LITTLE_SYM sh64_elf64_linux_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-sh64-linux"
#undef elf64_bed
diff --git a/binutils-2.25/bfd/elf64-sparc.c b/binutils-2.25/bfd/elf64-sparc.c
index 65e39070..eeb94a9e 100644
--- a/binutils-2.25/bfd/elf64-sparc.c
+++ b/binutils-2.25/bfd/elf64-sparc.c
@@ -1,7 +1,5 @@
/* SPARC-specific support for 64-bit ELF
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -426,9 +424,10 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
{
static const char *const stt_types[] = { "NOTYPE", "OBJECT", "FUNCTION" };
- if ((abfd->flags & DYNAMIC) == 0
- && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
- || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE))
+ if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
+ || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)
+ && (abfd->flags & DYNAMIC) == 0
+ && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
if (ELF_ST_TYPE (sym->st_info) == STT_REGISTER)
@@ -823,7 +822,7 @@ const struct elf_size_info elf64_sparc_size_info =
bfd_elf64_swap_reloca_out
};
-#define TARGET_BIG_SYM bfd_elf64_sparc_vec
+#define TARGET_BIG_SYM sparc_elf64_vec
#define TARGET_BIG_NAME "elf64-sparc"
#define ELF_ARCH bfd_arch_sparc
#define ELF_MAXPAGESIZE 0x100000
@@ -866,8 +865,6 @@ const struct elf_size_info elf64_sparc_size_info =
_bfd_sparc_elf_plt_sym_val
#define bfd_elf64_bfd_link_hash_table_create \
_bfd_sparc_elf_link_hash_table_create
-#define bfd_elf64_bfd_link_hash_table_free \
- _bfd_sparc_elf_link_hash_table_free
#define elf_info_to_howto \
_bfd_sparc_elf_info_to_howto
#define elf_backend_copy_indirect_symbol \
@@ -922,13 +919,11 @@ const struct elf_size_info elf64_sparc_size_info =
/* Section 5.2.4 of the ABI specifies a 256-byte boundary for the table. */
#define elf_backend_plt_alignment 8
-#define elf_backend_post_process_headers _bfd_elf_set_osabi
-
#include "elf64-target.h"
/* FreeBSD support */
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf64_sparc_freebsd_vec
+#define TARGET_BIG_SYM sparc_elf64_fbsd_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf64-sparc-freebsd"
#undef ELF_OSABI
@@ -942,7 +937,7 @@ const struct elf_size_info elf64_sparc_size_info =
/* Solaris 2. */
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elf64_sparc_sol2_vec
+#define TARGET_BIG_SYM sparc_elf64_sol2_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf64-sparc-sol2"
diff --git a/binutils-2.25/bfd/elf64-tilegx.c b/binutils-2.25/bfd/elf64-tilegx.c
index 10433461..f388e72c 100644
--- a/binutils-2.25/bfd/elf64-tilegx.c
+++ b/binutils-2.25/bfd/elf64-tilegx.c
@@ -1,5 +1,5 @@
/* TILE-Gx-specific support for 64-bit ELF.
- Copyright 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -88,9 +88,9 @@ tilegx_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
#define ELF_COMMONPAGESIZE 0x10000
-#define TARGET_BIG_SYM bfd_elf64_tilegx_be_vec
+#define TARGET_BIG_SYM tilegx_elf64_be_vec
#define TARGET_BIG_NAME "elf64-tilegx-be"
-#define TARGET_LITTLE_SYM bfd_elf64_tilegx_le_vec
+#define TARGET_LITTLE_SYM tilegx_elf64_le_vec
#define TARGET_LITTLE_NAME "elf64-tilegx-le"
#define elf_backend_reloc_type_class tilegx_reloc_type_class
diff --git a/binutils-2.25/bfd/elf64-tilegx.h b/binutils-2.25/bfd/elf64-tilegx.h
index 91a7c75a..12aec464 100644
--- a/binutils-2.25/bfd/elf64-tilegx.h
+++ b/binutils-2.25/bfd/elf64-tilegx.h
@@ -1,5 +1,5 @@
/* TILE-Gx-specific support for 64-bit ELF.
- Copyright 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elf64-x86-64.c b/binutils-2.25/bfd/elf64-x86-64.c
index a89485a1..3881f60f 100644
--- a/binutils-2.25/bfd/elf64-x86-64.c
+++ b/binutils-2.25/bfd/elf64-x86-64.c
@@ -1,7 +1,5 @@
/* X86-64 specific support for ELF
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011, 2012, 2013
- Free Software Foundation, Inc.
+ Copyright (C) 2000-2014 Free Software Foundation, Inc.
Contributed by Jan Hubicka <jh@suse.cz>.
This file is part of BFD, the Binary File Descriptor library.
@@ -172,12 +170,18 @@ static reloc_howto_type x86_64_elf_howto_table[] =
HOWTO(R_X86_64_RELATIVE64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_X86_64_RELATIVE64", FALSE, MINUS_ONE,
MINUS_ONE, FALSE),
+ HOWTO(R_X86_64_PC32_BND, 0, 2, 32, TRUE, 0, complain_overflow_signed,
+ bfd_elf_generic_reloc, "R_X86_64_PC32_BND", FALSE, 0xffffffff, 0xffffffff,
+ TRUE),
+ HOWTO(R_X86_64_PLT32_BND, 0, 2, 32, TRUE, 0, complain_overflow_signed,
+ bfd_elf_generic_reloc, "R_X86_64_PLT32_BND", FALSE, 0xffffffff, 0xffffffff,
+ TRUE),
/* We have a gap in the reloc numbers here.
R_X86_64_standard counts the number up to this point, and
R_X86_64_vt_offset is the value to subtract from a reloc type of
R_X86_64_GNU_VT* to form an index into this table. */
-#define R_X86_64_standard (R_X86_64_RELATIVE64 + 1)
+#define R_X86_64_standard (R_X86_64_PLT32_BND + 1)
#define R_X86_64_vt_offset (R_X86_64_GNU_VTINHERIT - R_X86_64_standard)
/* GNU extension to record C++ vtable hierarchy. */
@@ -199,6 +203,7 @@ static reloc_howto_type x86_64_elf_howto_table[] =
( ((TYPE) == R_X86_64_PC8) \
|| ((TYPE) == R_X86_64_PC16) \
|| ((TYPE) == R_X86_64_PC32) \
+ || ((TYPE) == R_X86_64_PC32_BND) \
|| ((TYPE) == R_X86_64_PC64))
/* Map BFD relocs to the x86_64 elf relocs. */
@@ -248,6 +253,8 @@ static const struct elf_reloc_map x86_64_reloc_map[] =
{ BFD_RELOC_X86_64_TLSDESC_CALL, R_X86_64_TLSDESC_CALL, },
{ BFD_RELOC_X86_64_TLSDESC, R_X86_64_TLSDESC, },
{ BFD_RELOC_X86_64_IRELATIVE, R_X86_64_IRELATIVE, },
+ { BFD_RELOC_X86_64_PC32_BND, R_X86_64_PC32_BND,},
+ { BFD_RELOC_X86_64_PLT32_BND, R_X86_64_PLT32_BND,},
{ BFD_RELOC_VTABLE_INHERIT, R_X86_64_GNU_VTINHERIT, },
{ BFD_RELOC_VTABLE_ENTRY, R_X86_64_GNU_VTENTRY, },
};
@@ -553,6 +560,56 @@ static const bfd_byte elf_x86_64_plt_entry[PLT_ENTRY_SIZE] =
0, 0, 0, 0 /* replaced with offset to start of .plt0. */
};
+/* The first entry in a procedure linkage table with BND relocations
+ like this. */
+
+static const bfd_byte elf_x86_64_bnd_plt0_entry[PLT_ENTRY_SIZE] =
+{
+ 0xff, 0x35, 8, 0, 0, 0, /* pushq GOT+8(%rip) */
+ 0xf2, 0xff, 0x25, 16, 0, 0, 0, /* bnd jmpq *GOT+16(%rip) */
+ 0x0f, 0x1f, 0 /* nopl (%rax) */
+};
+
+/* Subsequent entries for legacy branches in a procedure linkage table
+ with BND relocations look like this. */
+
+static const bfd_byte elf_x86_64_legacy_plt_entry[PLT_ENTRY_SIZE] =
+{
+ 0x68, 0, 0, 0, 0, /* pushq immediate */
+ 0xe9, 0, 0, 0, 0, /* jmpq relative */
+ 0x66, 0x0f, 0x1f, 0x44, 0, 0 /* nopw (%rax,%rax,1) */
+};
+
+/* Subsequent entries for branches with BND prefx in a procedure linkage
+ table with BND relocations look like this. */
+
+static const bfd_byte elf_x86_64_bnd_plt_entry[PLT_ENTRY_SIZE] =
+{
+ 0x68, 0, 0, 0, 0, /* pushq immediate */
+ 0xf2, 0xe9, 0, 0, 0, 0, /* bnd jmpq relative */
+ 0x0f, 0x1f, 0x44, 0, 0 /* nopl 0(%rax,%rax,1) */
+};
+
+/* Entries for legacy branches in the second procedure linkage table
+ look like this. */
+
+static const bfd_byte elf_x86_64_legacy_plt2_entry[8] =
+{
+ 0xff, 0x25, /* jmpq *name@GOTPC(%rip) */
+ 0, 0, 0, 0, /* replaced with offset to this symbol in .got. */
+ 0x66, 0x90 /* xchg %ax,%ax */
+};
+
+/* Entries for branches with BND prefix in the second procedure linkage
+ table look like this. */
+
+static const bfd_byte elf_x86_64_bnd_plt2_entry[8] =
+{
+ 0xf2, 0xff, 0x25, /* bnd jmpq *name@GOTPC(%rip) */
+ 0, 0, 0, 0, /* replaced with offset to this symbol in .got. */
+ 0x90 /* nop */
+};
+
/* .eh_frame covering the .plt section. */
static const bfd_byte elf_x86_64_eh_frame_plt[] =
@@ -656,6 +713,24 @@ static const struct elf_x86_64_backend_data elf_x86_64_arch_bed =
sizeof (elf_x86_64_eh_frame_plt), /* eh_frame_plt_size */
};
+static const struct elf_x86_64_backend_data elf_x86_64_bnd_arch_bed =
+ {
+ elf_x86_64_bnd_plt0_entry, /* plt0_entry */
+ elf_x86_64_bnd_plt_entry, /* plt_entry */
+ sizeof (elf_x86_64_bnd_plt_entry), /* plt_entry_size */
+ 2, /* plt0_got1_offset */
+ 1+8, /* plt0_got2_offset */
+ 1+12, /* plt0_got2_insn_end */
+ 1+2, /* plt_got_offset */
+ 1, /* plt_reloc_offset */
+ 7, /* plt_plt_offset */
+ 1+6, /* plt_got_insn_size */
+ 11, /* plt_plt_insn_end */
+ 0, /* plt_lazy_offset */
+ elf_x86_64_eh_frame_plt, /* eh_frame_plt */
+ sizeof (elf_x86_64_eh_frame_plt), /* eh_frame_plt_size */
+ };
+
#define elf_backend_arch_data &elf_x86_64_arch_bed
/* x86-64 ELF linker hash entry. */
@@ -682,6 +757,13 @@ struct elf_x86_64_link_hash_entry
(GOT_TLS_GD_P (type) || GOT_TLS_GDESC_P (type))
unsigned char tls_type;
+ /* TRUE if symbol has at least one BND relocation. */
+ bfd_boolean has_bnd_reloc;
+
+ /* Information about the second PLT entry. Filled when has_bnd_reloc is
+ set. */
+ union gotplt_union plt_bnd;
+
/* Offset of the GOTPLT entry reserved for the TLS descriptor,
starting at the end of the jump table. */
bfd_vma tlsdesc_got;
@@ -732,6 +814,7 @@ struct elf_x86_64_link_hash_table
asection *sdynbss;
asection *srelbss;
asection *plt_eh_frame;
+ asection *plt_bnd;
union
{
@@ -809,6 +892,8 @@ elf_x86_64_link_hash_newfunc (struct bfd_hash_entry *entry,
eh = (struct elf_x86_64_link_hash_entry *) entry;
eh->dyn_relocs = NULL;
eh->tls_type = GOT_UNKNOWN;
+ eh->has_bnd_reloc = FALSE;
+ eh->plt_bnd.offset = (bfd_vma) -1;
eh->tlsdesc_got = (bfd_vma) -1;
}
@@ -882,6 +967,21 @@ elf_x86_64_get_local_sym_hash (struct elf_x86_64_link_hash_table *htab,
return &ret->elf;
}
+/* Destroy an X86-64 ELF linker hash table. */
+
+static void
+elf_x86_64_link_hash_table_free (bfd *obfd)
+{
+ struct elf_x86_64_link_hash_table *htab
+ = (struct elf_x86_64_link_hash_table *) obfd->link.hash;
+
+ if (htab->loc_hash_table)
+ htab_delete (htab->loc_hash_table);
+ if (htab->loc_hash_memory)
+ objalloc_free ((struct objalloc *) htab->loc_hash_memory);
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
/* Create an X86-64 ELF linker hash table. */
static struct bfd_link_hash_table *
@@ -927,28 +1027,14 @@ elf_x86_64_link_hash_table_create (bfd *abfd)
ret->loc_hash_memory = objalloc_create ();
if (!ret->loc_hash_table || !ret->loc_hash_memory)
{
- free (ret);
+ elf_x86_64_link_hash_table_free (abfd);
return NULL;
}
+ ret->elf.root.hash_table_free = elf_x86_64_link_hash_table_free;
return &ret->elf.root;
}
-/* Destroy an X86-64 ELF linker hash table. */
-
-static void
-elf_x86_64_link_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct elf_x86_64_link_hash_table *htab
- = (struct elf_x86_64_link_hash_table *) hash;
-
- if (htab->loc_hash_table)
- htab_delete (htab->loc_hash_table);
- if (htab->loc_hash_memory)
- objalloc_free ((struct objalloc *) htab->loc_hash_memory);
- _bfd_elf_link_hash_table_free (hash);
-}
-
/* Create .plt, .rela.plt, .got, .got.plt, .rela.got, .dynbss, and
.rela.bss sections in DYNOBJ, and set up shortcuts to them in our
hash table. */
@@ -1002,6 +1088,9 @@ elf_x86_64_copy_indirect_symbol (struct bfd_link_info *info,
edir = (struct elf_x86_64_link_hash_entry *) dir;
eind = (struct elf_x86_64_link_hash_entry *) ind;
+ if (!edir->has_bnd_reloc)
+ edir->has_bnd_reloc = eind->has_bnd_reloc;
+
if (eind->dyn_relocs != NULL)
{
if (edir->dyn_relocs != NULL)
@@ -1538,12 +1627,60 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info,
default:
break;
- case R_X86_64_32S:
+ case R_X86_64_PC32_BND:
+ case R_X86_64_PLT32_BND:
+ case R_X86_64_PC32:
+ case R_X86_64_PLT32:
case R_X86_64_32:
case R_X86_64_64:
- case R_X86_64_PC32:
+ /* MPX PLT is supported only if elf_x86_64_arch_bed
+ is used in 64-bit mode. */
+ if (ABI_64_P (abfd)
+ && info->bndplt
+ && (get_elf_x86_64_backend_data (abfd)
+ == &elf_x86_64_arch_bed))
+ {
+ elf_x86_64_hash_entry (h)->has_bnd_reloc = TRUE;
+
+ /* Create the second PLT for Intel MPX support. */
+ if (htab->plt_bnd == NULL)
+ {
+ unsigned int plt_bnd_align;
+ const struct elf_backend_data *bed;
+
+ bed = get_elf_backend_data (info->output_bfd);
+ switch (sizeof (elf_x86_64_bnd_plt2_entry))
+ {
+ case 8:
+ plt_bnd_align = 3;
+ break;
+ case 16:
+ plt_bnd_align = 4;
+ break;
+ default:
+ abort ();
+ }
+
+ if (htab->elf.dynobj == NULL)
+ htab->elf.dynobj = abfd;
+ htab->plt_bnd
+ = bfd_make_section_anyway_with_flags (htab->elf.dynobj,
+ ".plt.bnd",
+ (bed->dynamic_sec_flags
+ | SEC_ALLOC
+ | SEC_CODE
+ | SEC_LOAD
+ | SEC_READONLY));
+ if (htab->plt_bnd == NULL
+ || !bfd_set_section_alignment (htab->elf.dynobj,
+ htab->plt_bnd,
+ plt_bnd_align))
+ return FALSE;
+ }
+ }
+
+ case R_X86_64_32S:
case R_X86_64_PC64:
- case R_X86_64_PLT32:
case R_X86_64_GOTPCREL:
case R_X86_64_GOTPCREL64:
if (htab->elf.dynobj == NULL)
@@ -1706,6 +1843,7 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info,
break;
case R_X86_64_PLT32:
+ case R_X86_64_PLT32_BND:
/* This symbol requires a procedure linkage table entry. We
actually build the entry in adjust_dynamic_symbol,
because this might be a case of linking PIC code which is
@@ -1766,6 +1904,7 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_X86_64_PC8:
case R_X86_64_PC16:
case R_X86_64_PC32:
+ case R_X86_64_PC32_BND:
case R_X86_64_PC64:
case R_X86_64_64:
pointer:
@@ -1782,7 +1921,9 @@ pointer:
/* We may need a .plt entry if the function this reloc
refers to is in a shared lib. */
h->plt.refcount += 1;
- if (r_type != R_X86_64_PC32 && r_type != R_X86_64_PC64)
+ if (r_type != R_X86_64_PC32
+ && r_type != R_X86_64_PC32_BND
+ && r_type != R_X86_64_PC64)
h->pointer_equality_needed = 1;
}
@@ -2066,6 +2207,7 @@ elf_x86_64_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
case R_X86_64_PC8:
case R_X86_64_PC16:
case R_X86_64_PC32:
+ case R_X86_64_PC32_BND:
case R_X86_64_PC64:
case R_X86_64_SIZE32:
case R_X86_64_SIZE64:
@@ -2075,6 +2217,7 @@ elf_x86_64_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
/* Fall thru */
case R_X86_64_PLT32:
+ case R_X86_64_PLT32_BND:
case R_X86_64_PLTOFF64:
if (h != NULL)
{
@@ -2293,11 +2436,28 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
here if it is defined and referenced in a non-shared object. */
if (h->type == STT_GNU_IFUNC
&& h->def_regular)
- return _bfd_elf_allocate_ifunc_dyn_relocs (info, h,
- &eh->dyn_relocs,
- plt_entry_size,
- plt_entry_size,
- GOT_ENTRY_SIZE);
+ {
+ if (_bfd_elf_allocate_ifunc_dyn_relocs (info, h,
+ &eh->dyn_relocs,
+ plt_entry_size,
+ plt_entry_size,
+ GOT_ENTRY_SIZE))
+ {
+ asection *s = htab->plt_bnd;
+ if (h->plt.offset != (bfd_vma) -1 && s != NULL)
+ {
+ /* Use the .plt.bnd section if it is created. */
+ eh->plt_bnd.offset = s->size;
+
+ /* Make room for this entry in the .plt.bnd section. */
+ s->size += sizeof (elf_x86_64_legacy_plt2_entry);
+ }
+
+ return TRUE;
+ }
+ else
+ return FALSE;
+ }
else if (htab->elf.dynamic_sections_created
&& h->plt.refcount > 0)
{
@@ -2314,13 +2474,16 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|| WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h))
{
asection *s = htab->elf.splt;
+ asection *bnd_s = htab->plt_bnd;
/* If this is the first .plt entry, make room for the special
first entry. */
if (s->size == 0)
- s->size += plt_entry_size;
+ s->size = plt_entry_size;
h->plt.offset = s->size;
+ if (bnd_s)
+ eh->plt_bnd.offset = bnd_s->size;
/* If this symbol is not defined in a regular file, and we are
not generating a shared library, then set the symbol to this
@@ -2330,12 +2493,28 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
if (! info->shared
&& !h->def_regular)
{
- h->root.u.def.section = s;
- h->root.u.def.value = h->plt.offset;
+ if (bnd_s)
+ {
+ /* We need to make a call to the entry of the second
+ PLT instead of regular PLT entry. */
+ h->root.u.def.section = bnd_s;
+ h->root.u.def.value = eh->plt_bnd.offset;
+ }
+ else
+ {
+ h->root.u.def.section = s;
+ h->root.u.def.value = h->plt.offset;
+ }
}
/* Make room for this entry. */
s->size += plt_entry_size;
+ if (bnd_s)
+ {
+ BFD_ASSERT (sizeof (elf_x86_64_bnd_plt2_entry)
+ == sizeof (elf_x86_64_legacy_plt2_entry));
+ bnd_s->size += sizeof (elf_x86_64_legacy_plt2_entry);
+ }
/* We also need to make an entry in the .got.plt section, which
will be placed in the .got section by the linker script. */
@@ -2599,7 +2778,7 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec,
/* Nothing to do if there are no codes, no relocations or no output. */
if ((sec->flags & (SEC_CODE | SEC_RELOC)) != (SEC_CODE | SEC_RELOC)
|| sec->reloc_count == 0
- || discarded_section (sec))
+ || bfd_is_abs_section (sec->output_section))
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
@@ -2758,7 +2937,7 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -2959,6 +3138,7 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd,
|| s == htab->elf.sgotplt
|| s == htab->elf.iplt
|| s == htab->elf.igotplt
+ || s == htab->plt_bnd
|| s == htab->plt_eh_frame
|| s == htab->sdynbss)
{
@@ -3237,14 +3417,15 @@ elf_x86_64_relocate_section (bfd *output_bfd,
reloc_howto_type *howto;
unsigned long r_symndx;
struct elf_link_hash_entry *h;
+ struct elf_x86_64_link_hash_entry *eh;
Elf_Internal_Sym *sym;
asection *sec;
- bfd_vma off, offplt;
+ bfd_vma off, offplt, plt_offset;
bfd_vma relocation;
bfd_boolean unresolved_reloc;
bfd_reloc_status_type r;
int tls_type;
- asection *base_got;
+ asection *base_got, *resolved_plt;
bfd_vma st_size;
r_type = ELF32_R_TYPE (rel->r_info);
@@ -3298,11 +3479,12 @@ elf_x86_64_relocate_section (bfd *output_bfd,
else
{
bfd_boolean warned ATTRIBUTE_UNUSED;
+ bfd_boolean ignored ATTRIBUTE_UNUSED;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
st_size = h->size;
}
@@ -3331,13 +3513,14 @@ elf_x86_64_relocate_section (bfd *output_bfd,
}
}
+ eh = (struct elf_x86_64_link_hash_entry *) h;
+
/* Since STT_GNU_IFUNC symbol must go through PLT, we handle
it here if it is defined in a non-shared object. */
if (h != NULL
&& h->type == STT_GNU_IFUNC
&& h->def_regular)
{
- asection *plt;
bfd_vma plt_index;
const char *name;
@@ -3346,9 +3529,27 @@ elf_x86_64_relocate_section (bfd *output_bfd,
abort ();
/* STT_GNU_IFUNC symbol must go through PLT. */
- plt = htab->elf.splt ? htab->elf.splt : htab->elf.iplt;
- relocation = (plt->output_section->vma
- + plt->output_offset + h->plt.offset);
+ if (htab->elf.splt != NULL)
+ {
+ if (htab->plt_bnd != NULL)
+ {
+ resolved_plt = htab->plt_bnd;
+ plt_offset = eh->plt_bnd.offset;
+ }
+ else
+ {
+ resolved_plt = htab->elf.splt;
+ plt_offset = h->plt.offset;
+ }
+ }
+ else
+ {
+ resolved_plt = htab->elf.iplt;
+ plt_offset = h->plt.offset;
+ }
+
+ relocation = (resolved_plt->output_section->vma
+ + resolved_plt->output_offset + plt_offset);
switch (r_type)
{
@@ -3440,8 +3641,10 @@ elf_x86_64_relocate_section (bfd *output_bfd,
}
/* FALLTHROUGH */
case R_X86_64_PC32:
+ case R_X86_64_PC32_BND:
case R_X86_64_PC64:
case R_X86_64_PLT32:
+ case R_X86_64_PLT32_BND:
goto do_relocation;
case R_X86_64_GOTPCREL:
@@ -3675,9 +3878,20 @@ elf_x86_64_relocate_section (bfd *output_bfd,
&& h->plt.offset != (bfd_vma) -1
&& htab->elf.splt != NULL)
{
- relocation = (htab->elf.splt->output_section->vma
- + htab->elf.splt->output_offset
- + h->plt.offset);
+ if (htab->plt_bnd != NULL)
+ {
+ resolved_plt = htab->plt_bnd;
+ plt_offset = eh->plt_bnd.offset;
+ }
+ else
+ {
+ resolved_plt = htab->elf.splt;
+ plt_offset = h->plt.offset;
+ }
+
+ relocation = (resolved_plt->output_section->vma
+ + resolved_plt->output_offset
+ + plt_offset);
unresolved_reloc = FALSE;
}
@@ -3686,6 +3900,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
break;
case R_X86_64_PLT32:
+ case R_X86_64_PLT32_BND:
/* Relocation is to the entry for this symbol in the
procedure linkage table. */
@@ -3703,9 +3918,20 @@ elf_x86_64_relocate_section (bfd *output_bfd,
break;
}
- relocation = (htab->elf.splt->output_section->vma
- + htab->elf.splt->output_offset
- + h->plt.offset);
+ if (htab->plt_bnd != NULL)
+ {
+ resolved_plt = htab->plt_bnd;
+ plt_offset = eh->plt_bnd.offset;
+ }
+ else
+ {
+ resolved_plt = htab->elf.splt;
+ plt_offset = h->plt.offset;
+ }
+
+ relocation = (resolved_plt->output_section->vma
+ + resolved_plt->output_offset
+ + plt_offset);
unresolved_reloc = FALSE;
break;
@@ -3718,6 +3944,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
case R_X86_64_PC8:
case R_X86_64_PC16:
case R_X86_64_PC32:
+ case R_X86_64_PC32_BND:
if (info->shared
&& (input_section->flags & SEC_ALLOC) != 0
&& (input_section->flags & SEC_READONLY) != 0
@@ -3725,7 +3952,8 @@ elf_x86_64_relocate_section (bfd *output_bfd,
{
bfd_boolean fail = FALSE;
bfd_boolean branch
- = (r_type == R_X86_64_PC32
+ = ((r_type == R_X86_64_PC32
+ || r_type == R_X86_64_PC32_BND)
&& is_32bit_relative_branch (contents, rel->r_offset));
if (SYMBOL_REFERENCES_LOCAL (info, h))
@@ -4054,17 +4282,27 @@ direct:
else if (ELF32_R_TYPE (rel->r_info) == R_X86_64_GOTTPOFF)
{
/* IE->LE transition:
- Originally it can be one of:
+ For 64bit, originally it can be one of:
movq foo@gottpoff(%rip), %reg
addq foo@gottpoff(%rip), %reg
We change it into:
movq $foo, %reg
leaq foo(%reg), %reg
- addq $foo, %reg. */
+ addq $foo, %reg.
+ For 32bit, originally it can be one of:
+ movq foo@gottpoff(%rip), %reg
+ addl foo@gottpoff(%rip), %reg
+ We change it into:
+ movq $foo, %reg
+ leal foo(%reg), %reg
+ addl $foo, %reg. */
unsigned int val, type, reg;
- val = bfd_get_8 (input_bfd, contents + roff - 3);
+ if (roff >= 3)
+ val = bfd_get_8 (input_bfd, contents + roff - 3);
+ else
+ val = 0;
type = bfd_get_8 (input_bfd, contents + roff - 2);
reg = bfd_get_8 (input_bfd, contents + roff - 1);
reg >>= 3;
@@ -4084,8 +4322,8 @@ direct:
}
else if (reg == 4)
{
- /* addq -> addq - addressing with %rsp/%r12 is
- special */
+ /* addq/addl -> addq/addl - addressing with %rsp/%r12
+ is special */
if (val == 0x4c)
bfd_put_8 (output_bfd, 0x49,
contents + roff - 3);
@@ -4099,7 +4337,7 @@ direct:
}
else
{
- /* addq -> leaq */
+ /* addq/addl -> leaq/leal */
if (val == 0x4c)
bfd_put_8 (output_bfd, 0x4d,
contents + roff - 3);
@@ -4501,20 +4739,28 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
Elf_Internal_Sym *sym ATTRIBUTE_UNUSED)
{
struct elf_x86_64_link_hash_table *htab;
- const struct elf_x86_64_backend_data *const abed
- = get_elf_x86_64_backend_data (output_bfd);
+ const struct elf_x86_64_backend_data *abed;
+ bfd_boolean use_plt_bnd;
htab = elf_x86_64_hash_table (info);
if (htab == NULL)
return FALSE;
+ /* Use MPX backend data in case of BND relocation. Use .plt_bnd
+ section only if there is .plt section. */
+ use_plt_bnd = htab->elf.splt != NULL && htab->plt_bnd != NULL;
+ abed = (use_plt_bnd
+ ? &elf_x86_64_bnd_arch_bed
+ : get_elf_x86_64_backend_data (output_bfd));
+
if (h->plt.offset != (bfd_vma) -1)
{
bfd_vma plt_index;
- bfd_vma got_offset;
+ bfd_vma got_offset, plt_offset, plt_plt_offset, plt_got_offset;
+ bfd_vma plt_plt_insn_end, plt_got_insn_size;
Elf_Internal_Rela rela;
bfd_byte *loc;
- asection *plt, *gotplt, *relplt;
+ asection *plt, *gotplt, *relplt, *resolved_plt;
const struct elf_backend_data *bed;
/* When building a static executable, use .iplt, .igot.plt and
@@ -4565,9 +4811,56 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
got_offset = got_offset * GOT_ENTRY_SIZE;
}
- /* Fill in the entry in the procedure linkage table. */
- memcpy (plt->contents + h->plt.offset, abed->plt_entry,
- abed->plt_entry_size);
+ plt_plt_insn_end = abed->plt_plt_insn_end;
+ plt_plt_offset = abed->plt_plt_offset;
+ plt_got_insn_size = abed->plt_got_insn_size;
+ plt_got_offset = abed->plt_got_offset;
+ if (use_plt_bnd)
+ {
+ /* Use the second PLT with BND relocations. */
+ const bfd_byte *plt_entry, *plt2_entry;
+ struct elf_x86_64_link_hash_entry *eh
+ = (struct elf_x86_64_link_hash_entry *) h;
+
+ if (eh->has_bnd_reloc)
+ {
+ plt_entry = elf_x86_64_bnd_plt_entry;
+ plt2_entry = elf_x86_64_bnd_plt2_entry;
+ }
+ else
+ {
+ plt_entry = elf_x86_64_legacy_plt_entry;
+ plt2_entry = elf_x86_64_legacy_plt2_entry;
+
+ /* Subtract 1 since there is no BND prefix. */
+ plt_plt_insn_end -= 1;
+ plt_plt_offset -= 1;
+ plt_got_insn_size -= 1;
+ plt_got_offset -= 1;
+ }
+
+ BFD_ASSERT (sizeof (elf_x86_64_bnd_plt_entry)
+ == sizeof (elf_x86_64_legacy_plt_entry));
+
+ /* Fill in the entry in the procedure linkage table. */
+ memcpy (plt->contents + h->plt.offset,
+ plt_entry, sizeof (elf_x86_64_legacy_plt_entry));
+ /* Fill in the entry in the second PLT. */
+ memcpy (htab->plt_bnd->contents + eh->plt_bnd.offset,
+ plt2_entry, sizeof (elf_x86_64_legacy_plt2_entry));
+
+ resolved_plt = htab->plt_bnd;
+ plt_offset = eh->plt_bnd.offset;
+ }
+ else
+ {
+ /* Fill in the entry in the procedure linkage table. */
+ memcpy (plt->contents + h->plt.offset, abed->plt_entry,
+ abed->plt_entry_size);
+
+ resolved_plt = plt;
+ plt_offset = h->plt.offset;
+ }
/* Insert the relocation positions of the plt section. */
@@ -4577,11 +4870,11 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
(gotplt->output_section->vma
+ gotplt->output_offset
+ got_offset
- - plt->output_section->vma
- - plt->output_offset
- - h->plt.offset
- - abed->plt_got_insn_size),
- plt->contents + h->plt.offset + abed->plt_got_offset);
+ - resolved_plt->output_section->vma
+ - resolved_plt->output_offset
+ - plt_offset
+ - plt_got_insn_size),
+ resolved_plt->contents + plt_offset + plt_got_offset);
/* Fill in the entry in the global offset table, initially this
points to the second part of the PLT entry. */
@@ -4623,8 +4916,8 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
bfd_put_32 (output_bfd, plt_index,
plt->contents + h->plt.offset + abed->plt_reloc_offset);
/* Put offset for jmp .PLT0. */
- bfd_put_32 (output_bfd, - (h->plt.offset + abed->plt_plt_insn_end),
- plt->contents + h->plt.offset + abed->plt_plt_offset);
+ bfd_put_32 (output_bfd, - (h->plt.offset + plt_plt_insn_end),
+ plt->contents + h->plt.offset + plt_plt_offset);
}
bed = get_elf_backend_data (output_bfd);
@@ -4786,13 +5079,18 @@ elf_x86_64_finish_dynamic_sections (bfd *output_bfd,
struct elf_x86_64_link_hash_table *htab;
bfd *dynobj;
asection *sdyn;
- const struct elf_x86_64_backend_data *const abed
- = get_elf_x86_64_backend_data (output_bfd);
+ const struct elf_x86_64_backend_data *abed;
htab = elf_x86_64_hash_table (info);
if (htab == NULL)
return FALSE;
+ /* Use MPX backend data in case of BND relocation. Use .plt_bnd
+ section only if there is .plt section. */
+ abed = (htab->elf.splt != NULL && htab->plt_bnd != NULL
+ ? &elf_x86_64_bnd_arch_bed
+ : get_elf_x86_64_backend_data (output_bfd));
+
dynobj = htab->elf.dynobj;
sdyn = bfd_get_linker_section (dynobj, ".dynamic");
@@ -4933,6 +5231,10 @@ elf_x86_64_finish_dynamic_sections (bfd *output_bfd,
}
}
+ if (htab->plt_bnd != NULL)
+ elf_section_data (htab->plt_bnd->output_section)
+ ->this_hdr.sh_entsize = sizeof (elf_x86_64_bnd_plt2_entry);
+
if (htab->elf.sgotplt)
{
if (bfd_is_abs_section (htab->elf.sgotplt->output_section))
@@ -5001,24 +5303,208 @@ elf_x86_64_finish_dynamic_sections (bfd *output_bfd,
return TRUE;
}
-/* Return address for Ith PLT stub in section PLT, for relocation REL
- or (bfd_vma) -1 if it should not be included. */
+/* Return address in section PLT for the Ith GOTPLT relocation, for
+ relocation REL or (bfd_vma) -1 if it should not be included. */
static bfd_vma
elf_x86_64_plt_sym_val (bfd_vma i, const asection *plt,
- const arelent *rel ATTRIBUTE_UNUSED)
+ const arelent *rel)
+{
+ bfd *abfd;
+ const struct elf_x86_64_backend_data *bed;
+ bfd_vma plt_offset;
+
+ /* Only match R_X86_64_JUMP_SLOT and R_X86_64_IRELATIVE. */
+ if (rel->howto->type != R_X86_64_JUMP_SLOT
+ && rel->howto->type != R_X86_64_IRELATIVE)
+ return (bfd_vma) -1;
+
+ abfd = plt->owner;
+ bed = get_elf_x86_64_backend_data (abfd);
+ plt_offset = bed->plt_entry_size;
+
+ if (elf_elfheader (abfd)->e_ident[EI_OSABI] != ELFOSABI_GNU)
+ return plt->vma + (i + 1) * plt_offset;
+
+ while (plt_offset < plt->size)
+ {
+ bfd_vma reloc_index;
+ bfd_byte reloc_index_raw[4];
+
+ if (!bfd_get_section_contents (abfd, (asection *) plt,
+ reloc_index_raw,
+ plt_offset + bed->plt_reloc_offset,
+ sizeof (reloc_index_raw)))
+ return (bfd_vma) -1;
+
+ reloc_index = H_GET_32 (abfd, reloc_index_raw);
+ if (reloc_index == i)
+ return plt->vma + plt_offset;
+ plt_offset += bed->plt_entry_size;
+ }
+
+ abort ();
+}
+
+/* Return offset in .plt.bnd section for the Ith GOTPLT relocation with
+ PLT section, or (bfd_vma) -1 if it should not be included. */
+
+static bfd_vma
+elf_x86_64_plt_sym_val_offset_plt_bnd (bfd_vma i, const asection *plt)
+{
+ const struct elf_x86_64_backend_data *bed = &elf_x86_64_bnd_arch_bed;
+ bfd *abfd = plt->owner;
+ bfd_vma plt_offset = bed->plt_entry_size;
+
+ if (elf_elfheader (abfd)->e_ident[EI_OSABI] != ELFOSABI_GNU)
+ return i * sizeof (elf_x86_64_legacy_plt2_entry);
+
+ while (plt_offset < plt->size)
+ {
+ bfd_vma reloc_index;
+ bfd_byte reloc_index_raw[4];
+
+ if (!bfd_get_section_contents (abfd, (asection *) plt,
+ reloc_index_raw,
+ plt_offset + bed->plt_reloc_offset,
+ sizeof (reloc_index_raw)))
+ return (bfd_vma) -1;
+
+ reloc_index = H_GET_32 (abfd, reloc_index_raw);
+ if (reloc_index == i)
+ {
+ /* This is the index in .plt section. */
+ long plt_index = plt_offset / bed->plt_entry_size;
+ /* Return the offset in .plt.bnd section. */
+ return (plt_index - 1) * sizeof (elf_x86_64_legacy_plt2_entry);
+ }
+ plt_offset += bed->plt_entry_size;
+ }
+
+ abort ();
+}
+
+/* Similar to _bfd_elf_get_synthetic_symtab, with .plt.bnd section
+ support. */
+
+static long
+elf_x86_64_get_synthetic_symtab (bfd *abfd,
+ long symcount,
+ asymbol **syms,
+ long dynsymcount,
+ asymbol **dynsyms,
+ asymbol **ret)
{
- return plt->vma + (i + 1) * GET_PLT_ENTRY_SIZE (plt->owner);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ asection *relplt;
+ asymbol *s;
+ bfd_boolean (*slurp_relocs) (bfd *, asection *, asymbol **, bfd_boolean);
+ arelent *p;
+ long count, i, n;
+ size_t size;
+ Elf_Internal_Shdr *hdr;
+ char *names;
+ asection *plt, *plt_push;
+
+ plt_push = bfd_get_section_by_name (abfd, ".plt");
+ if (plt_push == NULL)
+ return 0;
+
+ plt = bfd_get_section_by_name (abfd, ".plt.bnd");
+ /* Use the generic ELF version if there is no .plt.bnd section. */
+ if (plt == NULL)
+ return _bfd_elf_get_synthetic_symtab (abfd, symcount, syms,
+ dynsymcount, dynsyms, ret);
+
+ *ret = NULL;
+
+ if ((abfd->flags & (DYNAMIC | EXEC_P)) == 0)
+ return 0;
+
+ if (dynsymcount <= 0)
+ return 0;
+
+ relplt = bfd_get_section_by_name (abfd, ".rela.plt");
+ if (relplt == NULL)
+ return 0;
+
+ hdr = &elf_section_data (relplt)->this_hdr;
+ if (hdr->sh_link != elf_dynsymtab (abfd)
+ || (hdr->sh_type != SHT_REL && hdr->sh_type != SHT_RELA))
+ return 0;
+
+ slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table;
+ if (! (*slurp_relocs) (abfd, relplt, dynsyms, TRUE))
+ return -1;
+
+ count = relplt->size / hdr->sh_entsize;
+ size = count * sizeof (asymbol);
+ p = relplt->relocation;
+ for (i = 0; i < count; i++, p += bed->s->int_rels_per_ext_rel)
+ {
+ size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt");
+ if (p->addend != 0)
+ size += sizeof ("+0x") - 1 + 8 + 8;
+ }
+
+ s = *ret = (asymbol *) bfd_malloc (size);
+ if (s == NULL)
+ return -1;
+
+ names = (char *) (s + count);
+ p = relplt->relocation;
+ n = 0;
+ for (i = 0; i < count; i++, p++)
+ {
+ bfd_vma offset;
+ size_t len;
+
+ if (p->howto->type != R_X86_64_JUMP_SLOT
+ && p->howto->type != R_X86_64_IRELATIVE)
+ continue;
+
+ offset = elf_x86_64_plt_sym_val_offset_plt_bnd (i, plt_push);
+
+ *s = **p->sym_ptr_ptr;
+ /* Undefined syms won't have BSF_LOCAL or BSF_GLOBAL set. Since
+ we are defining a symbol, ensure one of them is set. */
+ if ((s->flags & BSF_LOCAL) == 0)
+ s->flags |= BSF_GLOBAL;
+ s->flags |= BSF_SYNTHETIC;
+ s->section = plt;
+ s->value = offset;
+ s->name = names;
+ s->udata.p = NULL;
+ len = strlen ((*p->sym_ptr_ptr)->name);
+ memcpy (names, (*p->sym_ptr_ptr)->name, len);
+ names += len;
+ if (p->addend != 0)
+ {
+ char buf[30], *a;
+
+ memcpy (names, "+0x", sizeof ("+0x") - 1);
+ names += sizeof ("+0x") - 1;
+ bfd_sprintf_vma (abfd, buf, p->addend);
+ for (a = buf; *a == '0'; ++a)
+ ;
+ len = strlen (a);
+ memcpy (names, a, len);
+ names += len;
+ }
+ memcpy (names, "@plt", sizeof ("@plt"));
+ names += sizeof ("@plt");
+ ++s, ++n;
+ }
+
+ return n;
}
/* Handle an x86-64 specific section when reading an object file. This
is called when elfcode.h finds a section with an unknown type. */
static bfd_boolean
-elf_x86_64_section_from_shdr (bfd *abfd,
- Elf_Internal_Shdr *hdr,
- const char *name,
- int shindex)
+elf_x86_64_section_from_shdr (bfd *abfd, Elf_Internal_Shdr *hdr,
+ const char *name, int shindex)
{
if (hdr->sh_type != SHT_X86_64_UNWIND)
return FALSE;
@@ -5064,9 +5550,10 @@ elf_x86_64_add_symbol_hook (bfd *abfd,
return TRUE;
}
- if ((abfd->flags & DYNAMIC) == 0
- && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
- || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE))
+ if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
+ || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)
+ && (abfd->flags & DYNAMIC) == 0
+ && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
return TRUE;
@@ -5223,7 +5710,7 @@ static const struct bfd_elf_special_section
{ NULL, 0, 0, 0, 0 }
};
-#define TARGET_LITTLE_SYM bfd_elf64_x86_64_vec
+#define TARGET_LITTLE_SYM x86_64_elf64_vec
#define TARGET_LITTLE_NAME "elf64-x86-64"
#define ELF_ARCH bfd_arch_i386
#define ELF_TARGET_ID X86_64_ELF_DATA
@@ -5245,8 +5732,6 @@ static const struct bfd_elf_special_section
#define bfd_elf64_bfd_link_hash_table_create \
elf_x86_64_link_hash_table_create
-#define bfd_elf64_bfd_link_hash_table_free \
- elf_x86_64_link_hash_table_free
#define bfd_elf64_bfd_reloc_type_lookup elf_x86_64_reloc_type_lookup
#define bfd_elf64_bfd_reloc_name_lookup \
elf_x86_64_reloc_name_lookup
@@ -5273,6 +5758,7 @@ static const struct bfd_elf_special_section
#define elf_backend_plt_sym_val elf_x86_64_plt_sym_val
#define elf_backend_object_p elf64_x86_64_elf_object_p
#define bfd_elf64_mkobject elf_x86_64_mkobject
+#define bfd_elf64_get_synthetic_symtab elf_x86_64_get_synthetic_symtab
#define elf_backend_section_from_shdr \
elf_x86_64_section_from_shdr
@@ -5298,14 +5784,12 @@ static const struct bfd_elf_special_section
#define elf_backend_hash_symbol \
elf_x86_64_hash_symbol
-#define elf_backend_post_process_headers _bfd_elf_set_osabi
-
#include "elf64-target.h"
/* FreeBSD support. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf64_x86_64_freebsd_vec
+#define TARGET_LITTLE_SYM x86_64_elf64_fbsd_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-x86-64-freebsd"
@@ -5320,7 +5804,7 @@ static const struct bfd_elf_special_section
/* Solaris 2 support. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf64_x86_64_sol2_vec
+#define TARGET_LITTLE_SYM x86_64_elf64_sol2_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-x86-64-sol2"
@@ -5345,10 +5829,20 @@ static const struct bfd_elf_special_section
#include "elf64-target.h"
+#undef bfd_elf64_get_synthetic_symtab
+
/* Native Client support. */
+static bfd_boolean
+elf64_x86_64_nacl_elf_object_p (bfd *abfd)
+{
+ /* Set the right machine number for a NaCl x86-64 ELF64 file. */
+ bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_x86_64_nacl);
+ return TRUE;
+}
+
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf64_x86_64_nacl_vec
+#define TARGET_LITTLE_SYM x86_64_elf64_nacl_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-x86-64-nacl"
#undef elf64_bed
@@ -5383,7 +5877,7 @@ static const bfd_byte elf_x86_64_nacl_plt0_entry[NACL_PLT_ENTRY_SIZE] =
0x41, 0xff, 0xe3, /* jmpq *%r11 */
/* 9-byte nop sequence to pad out to the next 32-byte boundary. */
- 0x2e, 0x0f, 0x1f, 0x84, 0, 0, 0, 0, 0, /* nopl %cs:0x0(%rax,%rax,1) */
+ 0x66, 0x0f, 0x1f, 0x84, 0, 0, 0, 0, 0, /* nopw 0x0(%rax,%rax,1) */
/* 32 bytes of nop to pad out to the standard size. */
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, /* excess data32 prefixes */
@@ -5479,6 +5973,8 @@ static const struct elf_x86_64_backend_data elf_x86_64_nacl_arch_bed =
#undef elf_backend_arch_data
#define elf_backend_arch_data &elf_x86_64_nacl_arch_bed
+#undef elf_backend_object_p
+#define elf_backend_object_p elf64_x86_64_nacl_elf_object_p
#undef elf_backend_modify_segment_map
#define elf_backend_modify_segment_map nacl_modify_segment_map
#undef elf_backend_modify_program_headers
@@ -5490,8 +5986,16 @@ static const struct elf_x86_64_backend_data elf_x86_64_nacl_arch_bed =
/* Native Client x32 support. */
+static bfd_boolean
+elf32_x86_64_nacl_elf_object_p (bfd *abfd)
+{
+ /* Set the right machine number for a NaCl x86-64 ELF32 file. */
+ bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_x64_32_nacl);
+ return TRUE;
+}
+
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_x86_64_nacl_vec
+#define TARGET_LITTLE_SYM x86_64_elf32_nacl_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-x86-64-nacl"
#undef elf32_bed
@@ -5499,8 +6003,6 @@ static const struct elf_x86_64_backend_data elf_x86_64_nacl_arch_bed =
#define bfd_elf32_bfd_link_hash_table_create \
elf_x86_64_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free \
- elf_x86_64_link_hash_table_free
#define bfd_elf32_bfd_reloc_type_lookup \
elf_x86_64_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup \
@@ -5510,7 +6012,7 @@ static const struct elf_x86_64_backend_data elf_x86_64_nacl_arch_bed =
#undef elf_backend_object_p
#define elf_backend_object_p \
- elf32_x86_64_elf_object_p
+ elf32_x86_64_nacl_elf_object_p
#undef elf_backend_bfd_from_remote_memory
#define elf_backend_bfd_from_remote_memory \
@@ -5542,7 +6044,7 @@ elf64_l1om_elf_object_p (bfd *abfd)
}
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf64_l1om_vec
+#define TARGET_LITTLE_SYM l1om_elf64_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-l1om"
#undef ELF_ARCH
@@ -5576,7 +6078,7 @@ elf64_l1om_elf_object_p (bfd *abfd)
/* FreeBSD L1OM support. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf64_l1om_freebsd_vec
+#define TARGET_LITTLE_SYM l1om_elf64_fbsd_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-l1om-freebsd"
@@ -5599,7 +6101,7 @@ elf64_k1om_elf_object_p (bfd *abfd)
}
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf64_k1om_vec
+#define TARGET_LITTLE_SYM k1om_elf64_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-k1om"
#undef ELF_ARCH
@@ -5626,7 +6128,7 @@ elf64_k1om_elf_object_p (bfd *abfd)
/* FreeBSD K1OM support. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf64_k1om_freebsd_vec
+#define TARGET_LITTLE_SYM k1om_elf64_fbsd_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-k1om-freebsd"
@@ -5641,7 +6143,7 @@ elf64_k1om_elf_object_p (bfd *abfd)
/* 32bit x86-64 support. */
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfd_elf32_x86_64_vec
+#define TARGET_LITTLE_SYM x86_64_elf32_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-x86-64"
#undef elf32_bed
diff --git a/binutils-2.25/bfd/elf64.c b/binutils-2.25/bfd/elf64.c
index 04fd3f0b..975262db 100644
--- a/binutils-2.25/bfd/elf64.c
+++ b/binutils-2.25/bfd/elf64.c
@@ -1,5 +1,5 @@
/* ELF 64-bit executable support for BFD.
- Copyright 1993, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elfcode.h b/binutils-2.25/bfd/elfcode.h
index e296c5ce..ec53c3bb 100644
--- a/binutils-2.25/bfd/elfcode.h
+++ b/binutils-2.25/bfd/elfcode.h
@@ -1,7 +1,5 @@
/* ELF executable support for BFD.
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1991-2014 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, from information published
in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -73,6 +71,7 @@
#include "bfdlink.h"
#include "libbfd.h"
#include "elf-bfd.h"
+#include "libiberty.h"
/* Renaming structures, typedefs, macros and functions to be size-specific. */
#define Elf_External_Ehdr NAME(Elf,External_Ehdr)
@@ -1588,37 +1587,40 @@ elf_debug_file (Elf_Internal_Ehdr *ehdrp)
#endif
/* Create a new BFD as if by bfd_openr. Rather than opening a file,
- reconstruct an ELF file by reading the segments out of remote memory
- based on the ELF file header at EHDR_VMA and the ELF program headers it
- points to. If not null, *LOADBASEP is filled in with the difference
- between the VMAs from which the segments were read, and the VMAs the
- file headers (and hence BFD's idea of each section's VMA) put them at.
-
- The function TARGET_READ_MEMORY is called to copy LEN bytes from the
- remote memory at target address VMA into the local buffer at MYADDR; it
- should return zero on success or an `errno' code on failure. TEMPL must
- be a BFD for a target with the word size and byte order found in the
- remote memory. */
+ reconstruct an ELF file by reading the segments out of remote
+ memory based on the ELF file header at EHDR_VMA and the ELF program
+ headers it points to. If non-zero, SIZE is the known extent of the
+ object. If not null, *LOADBASEP is filled in with the difference
+ between the VMAs from which the segments were read, and the VMAs
+ the file headers (and hence BFD's idea of each section's VMA) put
+ them at.
+
+ The function TARGET_READ_MEMORY is called to copy LEN bytes from
+ the remote memory at target address VMA into the local buffer at
+ MYADDR; it should return zero on success or an `errno' code on
+ failure. TEMPL must be a BFD for a target with the word size and
+ byte order found in the remote memory. */
bfd *
NAME(_bfd_elf,bfd_from_remote_memory)
(bfd *templ,
bfd_vma ehdr_vma,
+ bfd_size_type size,
bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type))
{
Elf_External_Ehdr x_ehdr; /* Elf file header, external form */
Elf_Internal_Ehdr i_ehdr; /* Elf file header, internal form */
Elf_External_Phdr *x_phdrs;
- Elf_Internal_Phdr *i_phdrs, *last_phdr;
+ Elf_Internal_Phdr *i_phdrs, *last_phdr, *first_phdr;
bfd *nbfd;
struct bfd_in_memory *bim;
- int contents_size;
bfd_byte *contents;
int err;
unsigned int i;
+ bfd_vma high_offset;
+ bfd_vma shdr_end;
bfd_vma loadbase;
- bfd_boolean loadbase_set;
/* Read in the ELF header in external format. */
err = target_read_memory (ehdr_vma, (bfd_byte *) &x_ehdr, sizeof x_ehdr);
@@ -1678,10 +1680,7 @@ NAME(_bfd_elf,bfd_from_remote_memory)
x_phdrs = (Elf_External_Phdr *)
bfd_malloc (i_ehdr.e_phnum * (sizeof *x_phdrs + sizeof *i_phdrs));
if (x_phdrs == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return NULL;
- }
+ return NULL;
err = target_read_memory (ehdr_vma + i_ehdr.e_phoff, (bfd_byte *) x_phdrs,
i_ehdr.e_phnum * sizeof x_phdrs[0]);
if (err)
@@ -1693,34 +1692,44 @@ NAME(_bfd_elf,bfd_from_remote_memory)
}
i_phdrs = (Elf_Internal_Phdr *) &x_phdrs[i_ehdr.e_phnum];
- contents_size = 0;
+ high_offset = 0;
+ loadbase = 0;
+ first_phdr = NULL;
last_phdr = NULL;
- loadbase = ehdr_vma;
- loadbase_set = FALSE;
for (i = 0; i < i_ehdr.e_phnum; ++i)
{
elf_swap_phdr_in (templ, &x_phdrs[i], &i_phdrs[i]);
if (i_phdrs[i].p_type == PT_LOAD)
{
- bfd_vma segment_end;
- segment_end = (i_phdrs[i].p_offset + i_phdrs[i].p_filesz
- + i_phdrs[i].p_align - 1) & -i_phdrs[i].p_align;
- if (segment_end > (bfd_vma) contents_size)
- contents_size = segment_end;
-
- /* LOADADDR is the `Base address' from the gELF specification:
- `lowest p_vaddr value for a PT_LOAD segment' is P_VADDR from the
- first PT_LOAD as PT_LOADs are ordered by P_VADDR. */
- if (!loadbase_set && (i_phdrs[i].p_offset & -i_phdrs[i].p_align) == 0)
+ bfd_vma segment_end = i_phdrs[i].p_offset + i_phdrs[i].p_filesz;
+
+ if (segment_end > high_offset)
{
- loadbase = ehdr_vma - (i_phdrs[i].p_vaddr & -i_phdrs[i].p_align);
- loadbase_set = TRUE;
+ high_offset = segment_end;
+ last_phdr = &i_phdrs[i];
}
- last_phdr = &i_phdrs[i];
+ /* If this program header covers offset zero, where the file
+ header sits, then we can figure out the loadbase. */
+ if (first_phdr == NULL)
+ {
+ bfd_vma p_offset = i_phdrs[i].p_offset;
+ bfd_vma p_vaddr = i_phdrs[i].p_vaddr;
+
+ if (i_phdrs[i].p_align > 1)
+ {
+ p_offset &= -i_phdrs[i].p_align;
+ p_vaddr &= -i_phdrs[i].p_align;
+ }
+ if (p_offset == 0)
+ {
+ loadbase = ehdr_vma - p_vaddr;
+ first_phdr = &i_phdrs[i];
+ }
+ }
}
}
- if (last_phdr == NULL)
+ if (high_offset == 0)
{
/* There were no PT_LOAD segments, so we don't have anything to read. */
free (x_phdrs);
@@ -1728,40 +1737,64 @@ NAME(_bfd_elf,bfd_from_remote_memory)
return NULL;
}
- /* Trim the last segment so we don't bother with zeros in the last page
- that are off the end of the file. However, if the extra bit in that
- page includes the section headers, keep them. */
- if ((bfd_vma) contents_size > last_phdr->p_offset + last_phdr->p_filesz
- && (bfd_vma) contents_size >= (i_ehdr.e_shoff
- + i_ehdr.e_shnum * i_ehdr.e_shentsize))
+ shdr_end = 0;
+ if (i_ehdr.e_shoff != 0 && i_ehdr.e_shnum != 0 && i_ehdr.e_shentsize != 0)
{
- contents_size = last_phdr->p_offset + last_phdr->p_filesz;
- if ((bfd_vma) contents_size < (i_ehdr.e_shoff
- + i_ehdr.e_shnum * i_ehdr.e_shentsize))
- contents_size = i_ehdr.e_shoff + i_ehdr.e_shnum * i_ehdr.e_shentsize;
+ shdr_end = i_ehdr.e_shoff + i_ehdr.e_shnum * i_ehdr.e_shentsize;
+
+ if (last_phdr->p_filesz != last_phdr->p_memsz)
+ {
+ /* If the last PT_LOAD header has a bss area then ld.so will
+ have cleared anything past p_filesz, zapping the section
+ headers. */
+ }
+ else if (size >= shdr_end)
+ high_offset = size;
+ else
+ {
+ bfd_vma page_size = get_elf_backend_data (templ)->minpagesize;
+ bfd_vma segment_end = last_phdr->p_offset + last_phdr->p_filesz;
+
+ /* Assume we loaded full pages, allowing us to sometimes see
+ section headers. */
+ if (page_size > 1 && shdr_end > segment_end)
+ {
+ bfd_vma page_end = (segment_end + page_size - 1) & -page_size;
+
+ if (page_end >= shdr_end)
+ /* Whee, section headers covered. */
+ high_offset = shdr_end;
+ }
+ }
}
- else
- contents_size = last_phdr->p_offset + last_phdr->p_filesz;
/* Now we know the size of the whole image we want read in. */
- contents = (bfd_byte *) bfd_zmalloc (contents_size);
+ contents = (bfd_byte *) bfd_zmalloc (high_offset);
if (contents == NULL)
{
free (x_phdrs);
- bfd_set_error (bfd_error_no_memory);
return NULL;
}
for (i = 0; i < i_ehdr.e_phnum; ++i)
if (i_phdrs[i].p_type == PT_LOAD)
{
- bfd_vma start = i_phdrs[i].p_offset & -i_phdrs[i].p_align;
- bfd_vma end = (i_phdrs[i].p_offset + i_phdrs[i].p_filesz
- + i_phdrs[i].p_align - 1) & -i_phdrs[i].p_align;
- if (end > (bfd_vma) contents_size)
- end = contents_size;
- err = target_read_memory ((loadbase + i_phdrs[i].p_vaddr)
- & -i_phdrs[i].p_align,
+ bfd_vma start = i_phdrs[i].p_offset;
+ bfd_vma end = start + i_phdrs[i].p_filesz;
+ bfd_vma vaddr = i_phdrs[i].p_vaddr;
+
+ /* Extend the beginning of the first pt_load to cover file
+ header and program headers, if we proved earlier that its
+ aligned offset is 0. */
+ if (first_phdr == &i_phdrs[i])
+ {
+ vaddr -= start;
+ start = 0;
+ }
+ /* Extend the end of the last pt_load to cover section headers. */
+ if (last_phdr == &i_phdrs[i])
+ end = high_offset;
+ err = target_read_memory (loadbase + vaddr,
contents + start, end - start);
if (err)
{
@@ -1776,8 +1809,7 @@ NAME(_bfd_elf,bfd_from_remote_memory)
/* If the segments visible in memory didn't include the section headers,
then clear them from the file header. */
- if ((bfd_vma) contents_size < (i_ehdr.e_shoff
- + i_ehdr.e_shnum * i_ehdr.e_shentsize))
+ if (high_offset < shdr_end)
{
memset (&x_ehdr.e_shoff, 0, sizeof x_ehdr.e_shoff);
memset (&x_ehdr.e_shnum, 0, sizeof x_ehdr.e_shnum);
@@ -1793,7 +1825,6 @@ NAME(_bfd_elf,bfd_from_remote_memory)
if (bim == NULL)
{
free (contents);
- bfd_set_error (bfd_error_no_memory);
return NULL;
}
nbfd = _bfd_new_bfd ();
@@ -1801,12 +1832,11 @@ NAME(_bfd_elf,bfd_from_remote_memory)
{
free (bim);
free (contents);
- bfd_set_error (bfd_error_no_memory);
return NULL;
}
- nbfd->filename = "<in-memory>";
+ nbfd->filename = xstrdup ("<in-memory>");
nbfd->xvec = templ->xvec;
- bim->size = contents_size;
+ bim->size = high_offset;
bim->buffer = contents;
nbfd->iostream = bim;
nbfd->flags = BFD_IN_MEMORY;
diff --git a/binutils-2.25/bfd/elfcore.h b/binutils-2.25/bfd/elfcore.h
index 429c09c7..97fd7abd 100644
--- a/binutils-2.25/bfd/elfcore.h
+++ b/binutils-2.25/bfd/elfcore.h
@@ -1,6 +1,5 @@
/* ELF core file support for BFD.
- Copyright 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2007,
- 2008, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elflink.c b/binutils-2.25/bfd/elflink.c
index 99b7ca1c..c8068c01 100644
--- a/binutils-2.25/bfd/elflink.c
+++ b/binutils-2.25/bfd/elflink.c
@@ -1,5 +1,5 @@
/* ELF linking support for BFD.
- Copyright 1995-2013 Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -851,47 +851,26 @@ _bfd_elf_link_renumber_dynsyms (bfd *output_bfd,
static void
elf_merge_st_other (bfd *abfd, struct elf_link_hash_entry *h,
- Elf_Internal_Sym *isym, bfd_boolean definition,
- bfd_boolean dynamic)
+ const Elf_Internal_Sym *isym,
+ bfd_boolean definition, bfd_boolean dynamic)
{
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
/* If st_other has a processor-specific meaning, specific
- code might be needed here. We never merge the visibility
- attribute with the one from a dynamic object. */
+ code might be needed here. */
if (bed->elf_backend_merge_symbol_attribute)
(*bed->elf_backend_merge_symbol_attribute) (h, isym, definition,
dynamic);
- /* If this symbol has default visibility and the user has requested
- we not re-export it, then mark it as hidden. */
- if (definition
- && !dynamic
- && (abfd->no_export
- || (abfd->my_archive && abfd->my_archive->no_export))
- && ELF_ST_VISIBILITY (isym->st_other) != STV_INTERNAL)
- isym->st_other = (STV_HIDDEN
- | (isym->st_other & ~ELF_ST_VISIBILITY (-1)));
-
- if (!dynamic && ELF_ST_VISIBILITY (isym->st_other) != 0)
- {
- unsigned char hvis, symvis, other, nvis;
-
- /* Only merge the visibility. Leave the remainder of the
- st_other field to elf_backend_merge_symbol_attribute. */
- other = h->other & ~ELF_ST_VISIBILITY (-1);
-
- /* Combine visibilities, using the most constraining one. */
- hvis = ELF_ST_VISIBILITY (h->other);
- symvis = ELF_ST_VISIBILITY (isym->st_other);
- if (! hvis)
- nvis = symvis;
- else if (! symvis)
- nvis = hvis;
- else
- nvis = hvis < symvis ? hvis : symvis;
+ if (!dynamic)
+ {
+ unsigned symvis = ELF_ST_VISIBILITY (isym->st_other);
+ unsigned hvis = ELF_ST_VISIBILITY (h->other);
- h->other = other | nvis;
+ /* Keep the most constraining visibility. Leave the remainder
+ of the st_other field to elf_backend_merge_symbol_attribute. */
+ if (symvis - 1 < hvis - 1)
+ h->other = symvis | (h->other & ~ELF_ST_VISIBILITY (-1));
}
}
@@ -1087,34 +1066,32 @@ _bfd_elf_merge_symbol (bfd *abfd,
/* When we try to create a default indirect symbol from the dynamic
definition with the default version, we skip it if its type and
- the type of existing regular definition mismatch. We only do it
- if the existing regular definition won't be dynamic. */
+ the type of existing regular definition mismatch. */
if (pold_alignment == NULL
- && !info->shared
- && !info->export_dynamic
- && !h->ref_dynamic
&& newdyn
&& newdef
&& !olddyn
- && (olddef || h->root.type == bfd_link_hash_common)
- && ELF_ST_TYPE (sym->st_info) != h->type
- && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE
- && h->type != STT_NOTYPE
- && !(newfunc && oldfunc))
+ && (((olddef || h->root.type == bfd_link_hash_common)
+ && ELF_ST_TYPE (sym->st_info) != h->type
+ && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE
+ && h->type != STT_NOTYPE
+ && !(newfunc && oldfunc))
+ || (olddef
+ && ((h->type == STT_GNU_IFUNC)
+ != (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)))))
{
*skip = TRUE;
return TRUE;
}
- /* Plugin symbol type isn't currently set. Stop bogus errors. */
- if (oldbfd != NULL && (oldbfd->flags & BFD_PLUGIN) != 0)
- *type_change_ok = TRUE;
-
- /* Check TLS symbol. We don't check undefined symbol introduced by
- "ld -u". */
- else if (oldbfd != NULL
- && ELF_ST_TYPE (sym->st_info) != h->type
- && (ELF_ST_TYPE (sym->st_info) == STT_TLS || h->type == STT_TLS))
+ /* Check TLS symbols. We don't check undefined symbols introduced
+ by "ld -u" which have no type (and oldbfd NULL), and we don't
+ check symbols from plugins because they also have no type. */
+ if (oldbfd != NULL
+ && (oldbfd->flags & BFD_PLUGIN) == 0
+ && (abfd->flags & BFD_PLUGIN) == 0
+ && ELF_ST_TYPE (sym->st_info) != h->type
+ && (ELF_ST_TYPE (sym->st_info) == STT_TLS || h->type == STT_TLS))
{
bfd *ntbfd, *tbfd;
bfd_boolean ntdef, tdef;
@@ -1437,7 +1414,10 @@ _bfd_elf_merge_symbol (bfd *abfd,
if (!(oldbfd != NULL
&& (oldbfd->flags & BFD_PLUGIN) != 0
&& (abfd->flags & BFD_PLUGIN) == 0))
- *skip = TRUE;
+ {
+ newdef = FALSE;
+ *skip = TRUE;
+ }
/* Merge st_other. If the symbol already has a dynamic index,
but visibility says it should not be visible, turn it into a
@@ -1702,6 +1682,12 @@ _bfd_elf_add_default_symbol (bfd *abfd,
ht = (struct elf_link_hash_entry *) hi->root.u.i.link;
(*bed->elf_backend_copy_indirect_symbol) (info, ht, hi);
+ /* A reference to the SHORTNAME symbol from a dynamic library
+ will be satisfied by the versioned symbol at runtime. In
+ effect, we have a reference to the versioned symbol. */
+ ht->ref_dynamic_nonweak |= hi->ref_dynamic_nonweak;
+ hi->dynamic_def |= ht->dynamic_def;
+
/* See if the new flags lead us to realize that the symbol must
be dynamic. */
if (! *dynsym)
@@ -1737,7 +1723,7 @@ nondefault:
size_change_ok = FALSE;
tmp_sec = sec;
if (!_bfd_elf_merge_symbol (abfd, info, shortname, sym, &tmp_sec, &value,
- &hi, NULL, NULL, NULL, &skip, &override,
+ &hi, poldbfd, NULL, NULL, &skip, &override,
&type_change_ok, &size_change_ok))
return FALSE;
@@ -1771,6 +1757,8 @@ nondefault:
if (hi->root.type == bfd_link_hash_indirect)
{
(*bed->elf_backend_copy_indirect_symbol) (info, h, hi);
+ h->ref_dynamic_nonweak |= hi->ref_dynamic_nonweak;
+ hi->dynamic_def |= h->dynamic_def;
/* See if the new flags lead us to realize that the symbol
must be dynamic. */
@@ -2943,13 +2931,6 @@ elf_link_is_defined_archive_symbol (bfd * abfd, carsym * symdef)
if (! bfd_check_format (abfd, bfd_object))
return FALSE;
- /* If we have already included the element containing this symbol in the
- link then we do not need to include it again. Just claim that any symbol
- it contains is not a definition, so that our caller will not decide to
- (re)include this element. */
- if (abfd->archive_pass)
- return FALSE;
-
/* Select the appropriate symbol table. */
if ((abfd->flags & DYNAMIC) == 0 || elf_dynsymtab (abfd) == 0)
hdr = &elf_tdata (abfd)->symtab_hdr;
@@ -3105,7 +3086,8 @@ static bfd_boolean
on_needed_list (const char *soname, struct bfd_link_needed_list *needed)
{
for (; needed != NULL; needed = needed->next)
- if (strcmp (soname, needed->name) == 0)
+ if ((elf_dyn_lib_class (needed->by) & DYN_AS_NEEDED) == 0
+ && strcmp (soname, needed->name) == 0)
return TRUE;
return FALSE;
@@ -3318,7 +3300,7 @@ _bfd_elf_notice_as_needed (bfd *ibfd,
struct bfd_link_info *info,
enum notice_asneeded_action act)
{
- return (*info->callbacks->notice) (info, NULL, ibfd, NULL, act, 0, NULL);
+ return (*info->callbacks->notice) (info, NULL, NULL, ibfd, NULL, act, 0);
}
/* Add symbols from an ELF object file to the linker hash table. */
@@ -3357,6 +3339,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
bfd_size_type old_dynstr_size = 0;
size_t tabsize = 0;
asection *s;
+ bfd_boolean just_syms;
htab = elf_hash_table (info);
bed = get_elf_backend_data (abfd);
@@ -3460,15 +3443,20 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
}
}
+ just_syms = ((s = abfd->sections) != NULL
+ && s->sec_info_type == SEC_INFO_TYPE_JUST_SYMS);
+
add_needed = TRUE;
if (! dynamic)
{
/* If we are creating a shared library, create all the dynamic
sections immediately. We need to attach them to something,
so we attach them to this BFD, provided it is the right
- format. FIXME: If there are no input BFD's of the same
- format as the output, we can't make a shared library. */
- if (info->shared
+ format and is not from ld --just-symbols. FIXME: If there
+ are no input BFD's of the same format as the output, we can't
+ make a shared library. */
+ if (!just_syms
+ && info->shared
&& is_elf_hash_table (htab)
&& info->output_bfd->xvec == abfd->xvec
&& !htab->dynamic_sections_created)
@@ -3488,8 +3476,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
/* ld --just-symbols and dynamic objects don't mix very well.
ld shouldn't allow it. */
- if ((s = abfd->sections) != NULL
- && s->sec_info_type == SEC_INFO_TYPE_JUST_SYMS)
+ if (just_syms)
abort ();
/* If this dynamic lib was specified on the command line with
@@ -4086,6 +4073,16 @@ error_free_dyn:
name = newname;
}
+ /* If this symbol has default visibility and the user has
+ requested we not re-export it, then mark it as hidden. */
+ if (definition
+ && !dynamic
+ && (abfd->no_export
+ || (abfd->my_archive && abfd->my_archive->no_export))
+ && ELF_ST_VISIBILITY (isym->st_other) != STV_INTERNAL)
+ isym->st_other = (STV_HIDDEN
+ | (isym->st_other & ~ELF_ST_VISIBILITY (-1)));
+
if (!_bfd_elf_merge_symbol (abfd, info, name, isym, &sec, &value,
sym_hash, &old_bfd, &old_weak,
&old_alignment, &skip, &override,
@@ -4427,6 +4424,9 @@ error_free_dyn:
int ret;
const char *soname = elf_dt_name (abfd);
+ info->callbacks->minfo ("%!", soname, old_bfd,
+ h->root.root.string);
+
/* A symbol from a library loaded via DT_NEEDED of some
other library is referenced by a regular object.
Add a DT_NEEDED entry for it. Issue an error if
@@ -4927,20 +4927,8 @@ _bfd_elf_archive_symbol_lookup (bfd *abfd,
}
/* Add symbols from an ELF archive file to the linker hash table. We
- don't use _bfd_generic_link_add_archive_symbols because of a
- problem which arises on UnixWare. The UnixWare libc.so is an
- archive which includes an entry libc.so.1 which defines a bunch of
- symbols. The libc.so archive also includes a number of other
- object files, which also define symbols, some of which are the same
- as those defined in libc.so.1. Correct linking requires that we
- consider each object file in turn, and include it if it defines any
- symbols we need. _bfd_generic_link_add_archive_symbols does not do
- this; it looks through the list of undefined symbols, and includes
- any object file which defines them. When this algorithm is used on
- UnixWare, it winds up pulling in libc.so.1 early and defining a
- bunch of symbols. This means that some of the other objects in the
- archive are not included in the link, which is incorrect since they
- precede libc.so.1 in the archive.
+ don't use _bfd_generic_link_add_archive_symbols because we need to
+ handle versioned symbols.
Fortunately, ELF archive handling is simpler than that done by
_bfd_generic_link_add_archive_symbols, which has to allow for a.out
@@ -4955,8 +4943,7 @@ static bfd_boolean
elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
{
symindex c;
- bfd_boolean *defined = NULL;
- bfd_boolean *included = NULL;
+ unsigned char *included = NULL;
carsym *symdefs;
bfd_boolean loop;
bfd_size_type amt;
@@ -4980,11 +4967,10 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
if (c == 0)
return TRUE;
amt = c;
- amt *= sizeof (bfd_boolean);
- defined = (bfd_boolean *) bfd_zmalloc (amt);
- included = (bfd_boolean *) bfd_zmalloc (amt);
- if (defined == NULL || included == NULL)
- goto error_return;
+ amt *= sizeof (*included);
+ included = (unsigned char *) bfd_zmalloc (amt);
+ if (included == NULL)
+ return FALSE;
symdefs = bfd_ardata (abfd)->symdefs;
bed = get_elf_backend_data (abfd);
@@ -5009,7 +4995,7 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
struct bfd_link_hash_entry *undefs_tail;
symindex mark;
- if (defined[i] || included[i])
+ if (included[i])
continue;
if (symdef->file_offset == last)
{
@@ -5044,7 +5030,8 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
else if (h->root.type != bfd_link_hash_undefined)
{
if (h->root.type != bfd_link_hash_undefweak)
- defined[i] = TRUE;
+ /* Symbol must be defined. Don't check it again. */
+ included[i] = TRUE;
continue;
}
@@ -5056,16 +5043,6 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
if (! bfd_check_format (element, bfd_object))
goto error_return;
- /* Doublecheck that we have not included this object
- already--it should be impossible, but there may be
- something wrong with the archive. */
- if (element->archive_pass != 0)
- {
- bfd_set_error (bfd_error_bad_value);
- goto error_return;
- }
- element->archive_pass = 1;
-
undefs_tail = info->hash->undefs_tail;
if (!(*info->callbacks
@@ -5103,14 +5080,11 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
}
while (loop);
- free (defined);
free (included);
return TRUE;
error_return:
- if (defined != NULL)
- free (defined);
if (included != NULL)
free (included);
return FALSE;
@@ -5476,7 +5450,7 @@ _bfd_elf_size_group_sections (struct bfd_link_info *info)
{
bfd *ibfd;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour
&& !_bfd_elf_fixup_group_sections (ibfd, bfd_abs_section_ptr))
return FALSE;
@@ -5603,7 +5577,7 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
for (inputobj = info->input_bfds;
inputobj;
- inputobj = inputobj->link_next)
+ inputobj = inputobj->link.next)
{
asection *s;
@@ -5869,7 +5843,7 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
asection *o;
for (sub = info->input_bfds; sub != NULL;
- sub = sub->link_next)
+ sub = sub->link.next)
if (bfd_get_flavour (sub) == bfd_target_elf_flavour)
for (o = sub->sections; o != NULL; o = o->next)
if (elf_section_data (o)->this_hdr.sh_type
@@ -6699,7 +6673,7 @@ _bfd_elf_merge_sections (bfd *abfd, struct bfd_link_info *info)
if (!is_elf_hash_table (info->hash))
return FALSE;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
if ((ibfd->flags & DYNAMIC) == 0)
for (sec = ibfd->sections; sec != NULL; sec = sec->next)
if ((sec->flags & SEC_MERGE) != 0
@@ -6889,6 +6863,7 @@ _bfd_elf_link_hash_table_create (bfd *abfd)
free (ret);
return NULL;
}
+ ret->root.hash_table_free = _bfd_elf_link_hash_table_free;
return &ret->root;
}
@@ -6896,13 +6871,15 @@ _bfd_elf_link_hash_table_create (bfd *abfd)
/* Destroy an ELF linker hash table. */
void
-_bfd_elf_link_hash_table_free (struct bfd_link_hash_table *hash)
+_bfd_elf_link_hash_table_free (bfd *obfd)
{
- struct elf_link_hash_table *htab = (struct elf_link_hash_table *) hash;
+ struct elf_link_hash_table *htab;
+
+ htab = (struct elf_link_hash_table *) obfd->link.hash;
if (htab->dynstr != NULL)
_bfd_elf_strtab_free (htab->dynstr);
_bfd_merge_sections_free (htab->merge_info);
- _bfd_generic_link_hash_table_free (hash);
+ _bfd_generic_link_hash_table_free (obfd);
}
/* This is a hook for the ELF emulation code in the generic linker to
@@ -7460,6 +7437,7 @@ struct elf_outext_info
bfd_boolean localsyms;
bfd_boolean need_second_pass;
bfd_boolean second_pass;
+ bfd_boolean file_sym_done;
struct elf_final_link_info *flinfo;
};
@@ -8678,6 +8656,22 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data)
|| h->root.type == bfd_link_hash_defweak)
&& h->root.u.def.section->output_section != NULL))
return TRUE;
+
+ if (!eoinfo->file_sym_done
+ && (eoinfo->second_pass ? eoinfo->flinfo->filesym_count == 1
+ : eoinfo->flinfo->filesym_count > 1))
+ {
+ /* Output a FILE symbol so that following locals are not associated
+ with the wrong input file. */
+ memset (&sym, 0, sizeof (sym));
+ sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_FILE);
+ sym.st_shndx = SHN_ABS;
+ if (!elf_link_output_sym (eoinfo->flinfo, NULL, &sym,
+ bfd_und_section_ptr, NULL))
+ return FALSE;
+
+ eoinfo->file_sym_done = TRUE;
+ }
}
else
{
@@ -9519,7 +9513,16 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd)
file, so the contents field will not have been set by any of
the routines which work on output files. */
if (elf_section_data (o)->this_hdr.contents != NULL)
- contents = elf_section_data (o)->this_hdr.contents;
+ {
+ contents = elf_section_data (o)->this_hdr.contents;
+ if (bed->caches_rawsize
+ && o->rawsize != 0
+ && o->rawsize < o->size)
+ {
+ memcpy (flinfo->contents, contents, o->rawsize);
+ contents = flinfo->contents;
+ }
+ }
else
{
contents = flinfo->contents;
@@ -10688,12 +10691,10 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
esdo->rela.count = 0;
}
- _bfd_elf_assign_file_positions_for_relocs (abfd);
-
/* We have now assigned file positions for all the sections except
- .symtab and .strtab. We start the .symtab section at the current
- file position, and write directly to it. We build the .strtab
- section in memory. */
+ .symtab, .strtab, and non-loaded reloc sections. We start the
+ .symtab section at the current file position, and write directly
+ to it. We build the .strtab section in memory. */
bfd_get_symcount (abfd) = 0;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* sh_name is set in prep_headers. */
@@ -10891,7 +10892,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
we could write the relocs out and then read them again; I don't
know how bad the memory loss will be. */
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
sub->output_has_begun = FALSE;
for (o = abfd->sections; o != NULL; o = o->next)
{
@@ -10953,7 +10954,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
/* Free symbol buffer if needed. */
if (!info->reduce_memory_overheads)
{
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
if (bfd_get_flavour (sub) == bfd_target_elf_flavour
&& elf_tdata (sub)->symbuf)
{
@@ -10962,17 +10963,6 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
}
}
- /* Output a FILE symbol so that following locals are not associated
- with the wrong input file. */
- memset (&elfsym, 0, sizeof (elfsym));
- elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_FILE);
- elfsym.st_shndx = SHN_ABS;
-
- if (flinfo.filesym_count > 1
- && !elf_link_output_sym (&flinfo, NULL, &elfsym,
- bfd_und_section_ptr, NULL))
- return FALSE;
-
/* Output any global symbols that got converted to local in a
version script or due to symbol visibility. We do this in a
separate step since ELF requires all local symbols to appear
@@ -10984,15 +10974,11 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
eoinfo.localsyms = TRUE;
eoinfo.need_second_pass = FALSE;
eoinfo.second_pass = FALSE;
+ eoinfo.file_sym_done = FALSE;
bfd_hash_traverse (&info->hash->table, elf_link_output_extsym, &eoinfo);
if (eoinfo.failed)
return FALSE;
- if (flinfo.filesym_count == 1
- && !elf_link_output_sym (&flinfo, NULL, &elfsym,
- bfd_und_section_ptr, NULL))
- return FALSE;
-
if (eoinfo.need_second_pass)
{
eoinfo.second_pass = TRUE;
@@ -11654,7 +11640,7 @@ _bfd_elf_gc_mark_hook (asection *sec,
{
bfd *i;
- for (i = info->input_bfds; i; i = i->link_next)
+ for (i = info->input_bfds; i; i = i->link.next)
{
sec = bfd_get_section_by_name (i, sec_name);
if (sec)
@@ -11803,7 +11789,7 @@ _bfd_elf_gc_mark_extra_sections (struct bfd_link_info *info,
{
bfd *ibfd;
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
asection *isec;
bfd_boolean some_kept;
@@ -11931,7 +11917,7 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
unsigned long section_sym_count;
struct elf_gc_sweep_symbol_info sweep_info;
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
asection *o;
@@ -11968,7 +11954,9 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
info we collected before. */
if (gc_sweep_hook
&& (o->flags & SEC_RELOC) != 0
- && o->reloc_count > 0
+ && o->reloc_count != 0
+ && !((info->strip == strip_all || info->strip == strip_debugger)
+ && (o->flags & SEC_DEBUGGING) != 0)
&& !bfd_is_abs_section (o->output_section))
{
Elf_Internal_Rela *internal_relocs;
@@ -12116,14 +12104,19 @@ bfd_boolean
bfd_elf_gc_mark_dynamic_ref_symbol (struct elf_link_hash_entry *h, void *inf)
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
+ struct bfd_elf_dynamic_list *d = info->dynamic_list;
if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
&& (h->ref_dynamic
- || ((!info->executable || info->export_dynamic)
- && h->def_regular
+ || (h->def_regular
&& ELF_ST_VISIBILITY (h->other) != STV_INTERNAL
&& ELF_ST_VISIBILITY (h->other) != STV_HIDDEN
+ && (!info->executable
+ || info->export_dynamic
+ || (h->dynamic
+ && d != NULL
+ && (*d->match) (&d->head, NULL, h->root.root.string)))
&& (strchr (h->root.root.string, ELF_VER_CHR) != NULL
|| !bfd_hide_sym_by_version (info->version_info,
h->root.root.string)))))
@@ -12164,6 +12157,7 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info)
bfd *sub;
elf_gc_mark_hook_fn gc_mark_hook;
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ struct elf_link_hash_table *htab;
if (!bed->can_gc_sections
|| !is_elf_hash_table (info->hash))
@@ -12173,11 +12167,11 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info)
}
bed->gc_keep (info);
+ htab = elf_hash_table (info);
/* Try to parse each bfd's .eh_frame section. Point elf_eh_frame_section
at the .eh_frame section if we can mark the FDEs individually. */
- _bfd_elf_begin_eh_frame_parsing (info);
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
asection *sec;
struct elf_reloc_cookie cookie;
@@ -12193,31 +12187,24 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info)
sec = bfd_get_next_section_by_name (sec);
}
}
- _bfd_elf_end_eh_frame_parsing (info);
/* Apply transitive closure to the vtable entry usage info. */
- elf_link_hash_traverse (elf_hash_table (info),
- elf_gc_propagate_vtable_entries_used,
- &ok);
+ elf_link_hash_traverse (htab, elf_gc_propagate_vtable_entries_used, &ok);
if (!ok)
return FALSE;
/* Kill the vtable relocations that were not used. */
- elf_link_hash_traverse (elf_hash_table (info),
- elf_gc_smash_unused_vtentry_relocs,
- &ok);
+ elf_link_hash_traverse (htab, elf_gc_smash_unused_vtentry_relocs, &ok);
if (!ok)
return FALSE;
/* Mark dynamically referenced symbols. */
- if (elf_hash_table (info)->dynamic_sections_created)
- elf_link_hash_traverse (elf_hash_table (info),
- bed->gc_mark_dynamic_ref,
- info);
+ if (htab->dynamic_sections_created)
+ elf_link_hash_traverse (htab, bed->gc_mark_dynamic_ref, info);
/* Grovel through relocs to find out who stays ... */
gc_mark_hook = bed->gc_mark_hook;
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
asection *o;
@@ -12526,7 +12513,7 @@ bfd_elf_gc_common_finalize_got_offsets (bfd *abfd,
gotoff = bed->got_header_size;
/* Do the local .got entries first. */
- for (i = info->input_bfds; i; i = i->link_next)
+ for (i = info->input_bfds; i; i = i->link.next)
{
bfd_signed_vma *local_got;
bfd_size_type j, locsymcount;
@@ -12615,10 +12602,10 @@ bfd_elf_reloc_symbol_deleted_p (bfd_vma offset, void *cookie)
if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
- && discarded_section (h->root.u.def.section))
+ && (h->root.u.def.section->owner != rcookie->abfd
+ || h->root.u.def.section->kept_section != NULL
+ || discarded_section (h->root.u.def.section)))
return TRUE;
- else
- return FALSE;
}
else
{
@@ -12631,7 +12618,9 @@ bfd_elf_reloc_symbol_deleted_p (bfd_vma offset, void *cookie)
/* Need to: get the symbol; get the section. */
isym = &rcookie->locsyms[r_symndx];
isec = bfd_section_from_elf_index (rcookie->abfd, isym->st_shndx);
- if (isec != NULL && discarded_section (isec))
+ if (isec != NULL
+ && (isec->kept_section != NULL
+ || discarded_section (isec)))
return TRUE;
}
return FALSE;
@@ -12640,94 +12629,105 @@ bfd_elf_reloc_symbol_deleted_p (bfd_vma offset, void *cookie)
}
/* Discard unneeded references to discarded sections.
- Returns TRUE if any section's size was changed. */
-/* This function assumes that the relocations are in sorted order,
- which is true for all known assemblers. */
+ Returns -1 on error, 1 if any section's size was changed, 0 if
+ nothing changed. This function assumes that the relocations are in
+ sorted order, which is true for all known assemblers. */
-bfd_boolean
+int
bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
{
struct elf_reloc_cookie cookie;
- asection *stab, *eh;
- const struct elf_backend_data *bed;
+ asection *o;
bfd *abfd;
- bfd_boolean ret = FALSE;
+ int changed = 0;
if (info->traditional_format
|| !is_elf_hash_table (info->hash))
- return FALSE;
+ return 0;
- _bfd_elf_begin_eh_frame_parsing (info);
- for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next)
+ o = bfd_get_section_by_name (output_bfd, ".stab");
+ if (o != NULL)
{
- if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
- continue;
+ asection *i;
- bed = get_elf_backend_data (abfd);
-
- eh = NULL;
- if (!info->relocatable)
+ for (i = o->map_head.s; i != NULL; i = i->map_head.s)
{
- eh = bfd_get_section_by_name (abfd, ".eh_frame");
- while (eh != NULL
- && (eh->size == 0
- || bfd_is_abs_section (eh->output_section)))
- eh = bfd_get_next_section_by_name (eh);
- }
-
- stab = bfd_get_section_by_name (abfd, ".stab");
- if (stab != NULL
- && (stab->size == 0
- || bfd_is_abs_section (stab->output_section)
- || stab->sec_info_type != SEC_INFO_TYPE_STABS))
- stab = NULL;
+ if (i->size == 0
+ || i->reloc_count == 0
+ || i->sec_info_type != SEC_INFO_TYPE_STABS)
+ continue;
- if (stab == NULL
- && eh == NULL
- && bed->elf_backend_discard_info == NULL)
- continue;
+ abfd = i->owner;
+ if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
+ continue;
- if (!init_reloc_cookie (&cookie, info, abfd))
- return FALSE;
+ if (!init_reloc_cookie_for_section (&cookie, info, i))
+ return -1;
- if (stab != NULL
- && stab->reloc_count > 0
- && init_reloc_cookie_rels (&cookie, info, abfd, stab))
- {
- if (_bfd_discard_section_stabs (abfd, stab,
- elf_section_data (stab)->sec_info,
+ if (_bfd_discard_section_stabs (abfd, i,
+ elf_section_data (i)->sec_info,
bfd_elf_reloc_symbol_deleted_p,
&cookie))
- ret = TRUE;
- fini_reloc_cookie_rels (&cookie, stab);
+ changed = 1;
+
+ fini_reloc_cookie_for_section (&cookie, i);
}
+ }
- while (eh != NULL
- && init_reloc_cookie_rels (&cookie, info, abfd, eh))
+ o = bfd_get_section_by_name (output_bfd, ".eh_frame");
+ if (o != NULL)
+ {
+ asection *i;
+
+ for (i = o->map_head.s; i != NULL; i = i->map_head.s)
{
- _bfd_elf_parse_eh_frame (abfd, info, eh, &cookie);
- if (_bfd_elf_discard_section_eh_frame (abfd, info, eh,
+ if (i->size == 0)
+ continue;
+
+ abfd = i->owner;
+ if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
+ continue;
+
+ if (!init_reloc_cookie_for_section (&cookie, info, i))
+ return -1;
+
+ _bfd_elf_parse_eh_frame (abfd, info, i, &cookie);
+ if (_bfd_elf_discard_section_eh_frame (abfd, info, i,
bfd_elf_reloc_symbol_deleted_p,
&cookie))
- ret = TRUE;
- fini_reloc_cookie_rels (&cookie, eh);
- eh = bfd_get_next_section_by_name (eh);
+ changed = 1;
+
+ fini_reloc_cookie_for_section (&cookie, i);
}
+ }
+
+ for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link.next)
+ {
+ const struct elf_backend_data *bed;
+
+ if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
+ continue;
- if (bed->elf_backend_discard_info != NULL
- && (*bed->elf_backend_discard_info) (abfd, &cookie, info))
- ret = TRUE;
+ bed = get_elf_backend_data (abfd);
- fini_reloc_cookie (&cookie, abfd);
+ if (bed->elf_backend_discard_info != NULL)
+ {
+ if (!init_reloc_cookie (&cookie, info, abfd))
+ return -1;
+
+ if ((*bed->elf_backend_discard_info) (abfd, &cookie, info))
+ changed = 1;
+
+ fini_reloc_cookie (&cookie, abfd);
+ }
}
- _bfd_elf_end_eh_frame_parsing (info);
if (info->eh_frame_hdr
&& !info->relocatable
&& _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info))
- ret = TRUE;
+ changed = 1;
- return ret;
+ return changed;
}
bfd_boolean
@@ -13011,17 +13011,24 @@ _bfd_elf_make_dynamic_reloc_section (asection * sec,
return reloc_sec;
}
-/* Copy the ELF symbol type associated with a linker hash entry. */
+/* Copy the ELF symbol type and other attributes for a linker script
+ assignment from HSRC to HDEST. Generally this should be treated as
+ if we found a strong non-dynamic definition for HDEST (except that
+ ld ignores multiple definition errors). */
void
-_bfd_elf_copy_link_hash_symbol_type (bfd *abfd ATTRIBUTE_UNUSED,
- struct bfd_link_hash_entry * hdest,
- struct bfd_link_hash_entry * hsrc)
+_bfd_elf_copy_link_hash_symbol_type (bfd *abfd,
+ struct bfd_link_hash_entry *hdest,
+ struct bfd_link_hash_entry *hsrc)
{
- struct elf_link_hash_entry *ehdest = (struct elf_link_hash_entry *)hdest;
- struct elf_link_hash_entry *ehsrc = (struct elf_link_hash_entry *)hsrc;
+ struct elf_link_hash_entry *ehdest = (struct elf_link_hash_entry *) hdest;
+ struct elf_link_hash_entry *ehsrc = (struct elf_link_hash_entry *) hsrc;
+ Elf_Internal_Sym isym;
ehdest->type = ehsrc->type;
ehdest->target_internal = ehsrc->target_internal;
+
+ isym.st_other = ehsrc->other;
+ elf_merge_st_other (abfd, ehdest, &isym, TRUE, FALSE);
}
/* Append a RELA relocation REL to section S in BFD. */
diff --git a/binutils-2.25/bfd/elfn32-mips.c b/binutils-2.25/bfd/elfn32-mips.c
index 2daf79e8..9ddde245 100644
--- a/binutils-2.25/bfd/elfn32-mips.c
+++ b/binutils-2.25/bfd/elfn32-mips.c
@@ -1,6 +1,5 @@
/* MIPS-specific support for 32-bit ELF
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Most of the information added by Ian Lance Taylor, Cygnus Support,
<ian@cygnus.com>.
@@ -84,8 +83,8 @@ static bfd_boolean elf32_mips_grok_psinfo
static irix_compat_t elf_n32_mips_irix_compat
(bfd *);
-extern const bfd_target bfd_elf32_nbigmips_vec;
-extern const bfd_target bfd_elf32_nlittlemips_vec;
+extern const bfd_target mips_elf32_n_be_vec;
+extern const bfd_target mips_elf32_n_le_vec;
/* Nonzero if ABFD is using the N32 ABI. */
#define ABI_N32_P(abfd) \
@@ -771,6 +770,100 @@ static reloc_howto_type elf_mips_howto_table_rel[] =
0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
+
+ EMPTY_HOWTO (52),
+ EMPTY_HOWTO (53),
+ EMPTY_HOWTO (54),
+ EMPTY_HOWTO (55),
+ EMPTY_HOWTO (56),
+ EMPTY_HOWTO (57),
+ EMPTY_HOWTO (58),
+ EMPTY_HOWTO (59),
+
+ HOWTO (R_MIPS_PC21_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 21, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC21_S2", /* name */
+ TRUE, /* partial_inplace */
+ 0x001fffff, /* src_mask */
+ 0x001fffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC26_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC26_S2", /* name */
+ TRUE, /* partial_inplace */
+ 0x03ffffff, /* src_mask */
+ 0x03ffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC18_S3, /* type */
+ 3, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 18, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC18_S3", /* name */
+ TRUE, /* partial_inplace */
+ 0x0003ffff, /* src_mask */
+ 0x0003ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC19_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 19, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC19_S2", /* name */
+ TRUE, /* partial_inplace */
+ 0x0007ffff, /* src_mask */
+ 0x0007ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PCHI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PCHI16", /* name */
+ TRUE, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PCLO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PCLO16", /* name */
+ TRUE, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
};
/* The relocation table used for SHT_RELA sections. */
@@ -1459,6 +1552,100 @@ static reloc_howto_type elf_mips_howto_table_rela[] =
0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
+
+ EMPTY_HOWTO (52),
+ EMPTY_HOWTO (53),
+ EMPTY_HOWTO (54),
+ EMPTY_HOWTO (55),
+ EMPTY_HOWTO (56),
+ EMPTY_HOWTO (57),
+ EMPTY_HOWTO (58),
+ EMPTY_HOWTO (59),
+
+ HOWTO (R_MIPS_PC21_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 21, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC21_S2", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x001fffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC26_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC26_S2", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x03ffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC18_S3, /* type */
+ 3, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 18, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC18_S3", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0003ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PC19_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 19, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC19_S2", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0007ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PCHI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PCHI16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_MIPS_PCLO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PCLO16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
};
static reloc_howto_type elf_mips16_howto_table_rel[] =
@@ -3019,7 +3206,13 @@ static const struct elf_reloc_map mips_reloc_map[] =
{ BFD_RELOC_MIPS_TLS_TPREL32, R_MIPS_TLS_TPREL32 },
{ BFD_RELOC_MIPS_TLS_TPREL64, R_MIPS_TLS_TPREL64 },
{ BFD_RELOC_MIPS_TLS_TPREL_HI16, R_MIPS_TLS_TPREL_HI16 },
- { BFD_RELOC_MIPS_TLS_TPREL_LO16, R_MIPS_TLS_TPREL_LO16 }
+ { BFD_RELOC_MIPS_TLS_TPREL_LO16, R_MIPS_TLS_TPREL_LO16 },
+ { BFD_RELOC_MIPS_21_PCREL_S2, R_MIPS_PC21_S2 },
+ { BFD_RELOC_MIPS_26_PCREL_S2, R_MIPS_PC26_S2 },
+ { BFD_RELOC_MIPS_18_PCREL_S3, R_MIPS_PC18_S3 },
+ { BFD_RELOC_MIPS_19_PCREL_S2, R_MIPS_PC19_S2 },
+ { BFD_RELOC_HI16_S_PCREL, R_MIPS_PCHI16 },
+ { BFD_RELOC_LO16_PCREL, R_MIPS_PCLO16 }
};
static const struct elf_reloc_map mips16_reloc_map[] =
@@ -3355,8 +3548,8 @@ elf32_mips_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
static irix_compat_t
elf_n32_mips_irix_compat (bfd *abfd)
{
- if ((abfd->xvec == &bfd_elf32_nbigmips_vec)
- || (abfd->xvec == &bfd_elf32_nlittlemips_vec))
+ if ((abfd->xvec == &mips_elf32_n_be_vec)
+ || (abfd->xvec == &mips_elf32_n_le_vec))
return ict_irix6;
else
return ict_none;
@@ -3411,6 +3604,8 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
#define elf_backend_collect TRUE
#define elf_backend_type_change_ok TRUE
#define elf_backend_can_gc_sections TRUE
+#define elf_backend_gc_mark_extra_sections \
+ _bfd_mips_elf_gc_mark_extra_sections
#define elf_info_to_howto mips_info_to_howto_rela
#define elf_info_to_howto_rel mips_info_to_howto_rel
#define elf_backend_sym_is_global mips_elf_sym_is_global
@@ -3494,9 +3689,9 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
/* Support for SGI-ish mips targets using n32 ABI. */
-#define TARGET_LITTLE_SYM bfd_elf32_nlittlemips_vec
+#define TARGET_LITTLE_SYM mips_elf32_n_le_vec
#define TARGET_LITTLE_NAME "elf32-nlittlemips"
-#define TARGET_BIG_SYM bfd_elf32_nbigmips_vec
+#define TARGET_BIG_SYM mips_elf32_n_be_vec
#define TARGET_BIG_NAME "elf32-nbigmips"
#define ELF_MAXPAGESIZE 0x10000
@@ -3513,9 +3708,9 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
#undef ELF_MAXPAGESIZE
#undef ELF_COMMONPAGESIZE
-#define TARGET_LITTLE_SYM bfd_elf32_ntradlittlemips_vec
+#define TARGET_LITTLE_SYM mips_elf32_ntrad_le_vec
#define TARGET_LITTLE_NAME "elf32-ntradlittlemips"
-#define TARGET_BIG_SYM bfd_elf32_ntradbigmips_vec
+#define TARGET_BIG_SYM mips_elf32_ntrad_be_vec
#define TARGET_BIG_NAME "elf32-ntradbigmips"
#define ELF_MAXPAGESIZE 0x10000
@@ -3533,26 +3728,14 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
#undef TARGET_BIG_SYM
#undef TARGET_BIG_NAME
-#define TARGET_LITTLE_SYM bfd_elf32_ntradlittlemips_freebsd_vec
+#define TARGET_LITTLE_SYM mips_elf32_ntradfbsd_le_vec
#define TARGET_LITTLE_NAME "elf32-ntradlittlemips-freebsd"
-#define TARGET_BIG_SYM bfd_elf32_ntradbigmips_freebsd_vec
+#define TARGET_BIG_SYM mips_elf32_ntradfbsd_be_vec
#define TARGET_BIG_NAME "elf32-ntradbigmips-freebsd"
#undef ELF_OSABI
#define ELF_OSABI ELFOSABI_FREEBSD
-/* The kernel recognizes executables as valid only if they carry a
- "FreeBSD" label in the ELF header. So we put this label on all
- executables and (for simplicity) also all other object files. */
-
-static void
-elf_fbsd_post_process_headers (bfd *abfd, struct bfd_link_info *info)
-{
- _bfd_elf_set_osabi (abfd, info);
-}
-
-#undef elf_backend_post_process_headers
-#define elf_backend_post_process_headers elf_fbsd_post_process_headers
#undef elf32_bed
#define elf32_bed elf32_fbsd_tradbed
diff --git a/binutils-2.25/bfd/elfnn-aarch64.c b/binutils-2.25/bfd/elfnn-aarch64.c
index 8f0e7169..19ad4d29 100644
--- a/binutils-2.25/bfd/elfnn-aarch64.c
+++ b/binutils-2.25/bfd/elfnn-aarch64.c
@@ -1,5 +1,5 @@
/* AArch64-specific support for NN-bit ELF.
- Copyright 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of BFD, the Binary File Descriptor library.
@@ -1297,7 +1297,11 @@ static reloc_howto_type elfNN_aarch64_howto_table[] =
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
+#if ARCH_SIZE == 64
+ AARCH64_R_STR (TLS_DTPMOD64), /* name */
+#else
AARCH64_R_STR (TLS_DTPMOD), /* name */
+#endif
FALSE, /* partial_inplace */
0, /* src_mask */
ALL_ONES, /* dst_mask */
@@ -1311,7 +1315,11 @@ static reloc_howto_type elfNN_aarch64_howto_table[] =
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
+#if ARCH_SIZE == 64
+ AARCH64_R_STR (TLS_DTPREL64), /* name */
+#else
AARCH64_R_STR (TLS_DTPREL), /* name */
+#endif
FALSE, /* partial_inplace */
0, /* src_mask */
ALL_ONES, /* dst_mask */
@@ -1325,7 +1333,11 @@ static reloc_howto_type elfNN_aarch64_howto_table[] =
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
+#if ARCH_SIZE == 64
+ AARCH64_R_STR (TLS_TPREL64), /* name */
+#else
AARCH64_R_STR (TLS_TPREL), /* name */
+#endif
FALSE, /* partial_inplace */
0, /* src_mask */
ALL_ONES, /* dst_mask */
@@ -1536,9 +1548,9 @@ elfNN_aarch64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
return NULL;
}
-#define TARGET_LITTLE_SYM bfd_elfNN_littleaarch64_vec
+#define TARGET_LITTLE_SYM aarch64_elfNN_le_vec
#define TARGET_LITTLE_NAME "elfNN-littleaarch64"
-#define TARGET_BIG_SYM bfd_elfNN_bigaarch64_vec
+#define TARGET_BIG_SYM aarch64_elfNN_be_vec
#define TARGET_BIG_NAME "elfNN-bigaarch64"
/* The linker script knows the section names for placement.
@@ -1599,6 +1611,12 @@ static const uint32_t aarch64_long_branch_stub[] =
0x00000000,
};
+static const uint32_t aarch64_erratum_835769_stub[] =
+{
+ 0x00000000, /* Placeholder for multiply accumulate. */
+ 0x14000000, /* b <label> */
+};
+
/* Section name for stubs is the associated section name plus this
string. */
#define STUB_SUFFIX ".stub"
@@ -1608,6 +1626,7 @@ enum elf_aarch64_stub_type
aarch64_stub_none,
aarch64_stub_adrp_branch,
aarch64_stub_long_branch,
+ aarch64_stub_erratum_835769_veneer,
};
struct elf_aarch64_stub_hash_entry
@@ -1642,6 +1661,10 @@ struct elf_aarch64_stub_hash_entry
stub name in the hash table has to be unique; this does not, so
it can be friendlier. */
char *output_name;
+
+ /* The instruction which caused this stub to be generated (only valid for
+ erratum 835769 workaround stubs at present). */
+ uint32_t veneered_insn;
};
/* Used to build a map of a section. This is required for mixed-endian
@@ -1667,6 +1690,17 @@ _aarch64_elf_section_data;
#define elf_aarch64_section_data(sec) \
((_aarch64_elf_section_data *) elf_section_data (sec))
+/* A fix-descriptor for erratum 835769. */
+struct aarch64_erratum_835769_fix
+{
+ bfd *input_bfd;
+ asection *section;
+ bfd_vma offset;
+ uint32_t veneered_insn;
+ char *stub_name;
+ enum elf_aarch64_stub_type stub_type;
+};
+
/* The size of the thread control block which is defined to be two pointers. */
#define TCB_SIZE (ARCH_SIZE/8)*2
@@ -1787,6 +1821,15 @@ struct elf_aarch64_link_hash_table
/* Nonzero to force PIC branch veneers. */
int pic_veneer;
+ /* Fix erratum 835769. */
+ int fix_erratum_835769;
+
+ /* A table of fix locations for erratum 835769. This holds erratum
+ fix locations between elfNN_aarch64_size_stubs() and
+ elfNN_aarch64_write_section(). */
+ struct aarch64_erratum_835769_fix *aarch64_erratum_835769_fixes;
+ unsigned int num_aarch64_erratum_835769_fixes;
+
/* The number of bytes in the initial entry in the PLT. */
bfd_size_type plt_header_size;
@@ -2043,6 +2086,23 @@ elfNN_aarch64_copy_indirect_symbol (struct bfd_link_info *info,
_bfd_elf_link_hash_copy_indirect (info, dir, ind);
}
+/* Destroy an AArch64 elf linker hash table. */
+
+static void
+elfNN_aarch64_link_hash_table_free (bfd *obfd)
+{
+ struct elf_aarch64_link_hash_table *ret
+ = (struct elf_aarch64_link_hash_table *) obfd->link.hash;
+
+ if (ret->loc_hash_table)
+ htab_delete (ret->loc_hash_table);
+ if (ret->loc_hash_memory)
+ objalloc_free ((struct objalloc *) ret->loc_hash_memory);
+
+ bfd_hash_table_free (&ret->stub_hash_table);
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
/* Create an AArch64 elf linker hash table. */
static struct bfd_link_hash_table *
@@ -2071,7 +2131,7 @@ elfNN_aarch64_link_hash_table_create (bfd *abfd)
if (!bfd_hash_table_init (&ret->stub_hash_table, stub_hash_newfunc,
sizeof (struct elf_aarch64_stub_hash_entry)))
{
- free (ret);
+ _bfd_elf_link_hash_table_free (abfd);
return NULL;
}
@@ -2082,30 +2142,14 @@ elfNN_aarch64_link_hash_table_create (bfd *abfd)
ret->loc_hash_memory = objalloc_create ();
if (!ret->loc_hash_table || !ret->loc_hash_memory)
{
- free (ret);
+ elfNN_aarch64_link_hash_table_free (abfd);
return NULL;
}
+ ret->root.root.hash_table_free = elfNN_aarch64_link_hash_table_free;
return &ret->root.root;
}
-/* Free the derived linker hash table. */
-
-static void
-elfNN_aarch64_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct elf_aarch64_link_hash_table *ret
- = (struct elf_aarch64_link_hash_table *) hash;
-
- if (ret->loc_hash_table)
- htab_delete (ret->loc_hash_table);
- if (ret->loc_hash_memory)
- objalloc_free ((struct objalloc *) ret->loc_hash_memory);
-
- bfd_hash_table_free (&ret->stub_hash_table);
- _bfd_elf_link_hash_table_free (hash);
-}
-
static bfd_boolean
aarch64_relocate (unsigned int r_type, bfd *input_bfd, asection *input_section,
bfd_vma offset, bfd_vma value)
@@ -2330,6 +2374,9 @@ aarch64_build_one_stub (struct bfd_hash_entry *gen_entry,
bfd *stub_bfd;
bfd_byte *loc;
bfd_vma sym_value;
+ bfd_vma veneered_insn_loc;
+ bfd_vma veneer_entry_loc;
+ bfd_signed_vma branch_offset = 0;
unsigned int template_size;
const uint32_t *template;
unsigned int i;
@@ -2370,6 +2417,10 @@ aarch64_build_one_stub (struct bfd_hash_entry *gen_entry,
template = aarch64_long_branch_stub;
template_size = sizeof (aarch64_long_branch_stub);
break;
+ case aarch64_stub_erratum_835769_veneer:
+ template = aarch64_erratum_835769_stub;
+ template_size = sizeof (aarch64_erratum_835769_stub);
+ break;
default:
BFD_FAIL ();
return FALSE;
@@ -2412,6 +2463,23 @@ aarch64_build_one_stub (struct bfd_hash_entry *gen_entry,
stub_entry->stub_offset + 16,
sym_value + 12, 0);
break;
+
+ case aarch64_stub_erratum_835769_veneer:
+ veneered_insn_loc = stub_entry->target_section->output_section->vma
+ + stub_entry->target_section->output_offset
+ + stub_entry->target_value;
+ veneer_entry_loc = stub_entry->stub_sec->output_section->vma
+ + stub_entry->stub_sec->output_offset
+ + stub_entry->stub_offset;
+ branch_offset = veneered_insn_loc - veneer_entry_loc;
+ branch_offset >>= 2;
+ branch_offset &= 0x3ffffff;
+ bfd_putl32 (stub_entry->veneered_insn,
+ stub_sec->contents + stub_entry->stub_offset);
+ bfd_putl32 (template[1] | branch_offset,
+ stub_sec->contents + stub_entry->stub_offset + 4);
+ break;
+
default:
break;
}
@@ -2440,6 +2508,9 @@ aarch64_size_one_stub (struct bfd_hash_entry *gen_entry,
case aarch64_stub_long_branch:
size = sizeof (aarch64_long_branch_stub);
break;
+ case aarch64_stub_erratum_835769_veneer:
+ size = sizeof (aarch64_erratum_835769_stub);
+ break;
default:
BFD_FAIL ();
return FALSE;
@@ -2475,7 +2546,7 @@ elfNN_aarch64_setup_section_lists (bfd *output_bfd,
/* Count the number of input BFDs and find the top input section id. */
for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0;
- input_bfd != NULL; input_bfd = input_bfd->link_next)
+ input_bfd != NULL; input_bfd = input_bfd->link.next)
{
bfd_count += 1;
for (section = input_bfd->sections;
@@ -2628,6 +2699,388 @@ group_sections (struct elf_aarch64_link_hash_table *htab,
#undef PREV_SEC
+#define AARCH64_BITS(x, pos, n) (((x) >> (pos)) & ((1 << (n)) - 1))
+
+#define AARCH64_RT(insn) AARCH64_BITS (insn, 0, 5)
+#define AARCH64_RT2(insn) AARCH64_BITS (insn, 10, 5)
+#define AARCH64_RA(insn) AARCH64_BITS (insn, 10, 5)
+#define AARCH64_RD(insn) AARCH64_BITS (insn, 0, 5)
+#define AARCH64_RN(insn) AARCH64_BITS (insn, 5, 5)
+#define AARCH64_RM(insn) AARCH64_BITS (insn, 16, 5)
+
+#define AARCH64_MAC(insn) (((insn) & 0xff000000) == 0x9b000000)
+#define AARCH64_BIT(insn, n) AARCH64_BITS (insn, n, 1)
+#define AARCH64_OP31(insn) AARCH64_BITS (insn, 21, 3)
+#define AARCH64_ZR 0x1f
+
+/* All ld/st ops. See C4-182 of the ARM ARM. The encoding space for
+ LD_PCREL, LDST_RO, LDST_UI and LDST_UIMM cover prefetch ops. */
+
+#define AARCH64_LD(insn) (AARCH64_BIT (insn, 22) == 1)
+#define AARCH64_LDST(insn) (((insn) & 0x0a000000) == 0x08000000)
+#define AARCH64_LDST_EX(insn) (((insn) & 0x3f000000) == 0x08000000)
+#define AARCH64_LDST_PCREL(insn) (((insn) & 0x3b000000) == 0x18000000)
+#define AARCH64_LDST_NAP(insn) (((insn) & 0x3b800000) == 0x28000000)
+#define AARCH64_LDSTP_PI(insn) (((insn) & 0x3b800000) == 0x28800000)
+#define AARCH64_LDSTP_O(insn) (((insn) & 0x3b800000) == 0x29000000)
+#define AARCH64_LDSTP_PRE(insn) (((insn) & 0x3b800000) == 0x29800000)
+#define AARCH64_LDST_UI(insn) (((insn) & 0x3b200c00) == 0x38000000)
+#define AARCH64_LDST_PIIMM(insn) (((insn) & 0x3b200c00) == 0x38000400)
+#define AARCH64_LDST_U(insn) (((insn) & 0x3b200c00) == 0x38000800)
+#define AARCH64_LDST_PREIMM(insn) (((insn) & 0x3b200c00) == 0x38000c00)
+#define AARCH64_LDST_RO(insn) (((insn) & 0x3b200c00) == 0x38200800)
+#define AARCH64_LDST_UIMM(insn) (((insn) & 0x3b000000) == 0x39000000)
+#define AARCH64_LDST_SIMD_M(insn) (((insn) & 0xbfbf0000) == 0x0c000000)
+#define AARCH64_LDST_SIMD_M_PI(insn) (((insn) & 0xbfa00000) == 0x0c800000)
+#define AARCH64_LDST_SIMD_S(insn) (((insn) & 0xbf9f0000) == 0x0d000000)
+#define AARCH64_LDST_SIMD_S_PI(insn) (((insn) & 0xbf800000) == 0x0d800000)
+
+/* Classify an INSN if it is indeed a load/store. Return TRUE if INSN
+ is a load/store along with the Rt and Rtn. Return FALSE if not a
+ load/store. */
+
+static bfd_boolean
+aarch64_mem_op_p (uint32_t insn, unsigned int *rt, unsigned int *rtn,
+ bfd_boolean *pair, bfd_boolean *load)
+{
+ uint32_t opcode;
+ unsigned int r;
+ uint32_t opc = 0;
+ uint32_t v = 0;
+ uint32_t opc_v = 0;
+
+ /* Bail out quickly if INSN doesn't fall into the the load-store
+ encoding space. */
+ if (!AARCH64_LDST (insn))
+ return FALSE;
+
+ *pair = FALSE;
+ *load = FALSE;
+ if (AARCH64_LDST_EX (insn))
+ {
+ *rt = AARCH64_RT (insn);
+ *rtn = *rt;
+ if (AARCH64_BIT (insn, 21) == 1)
+ {
+ *pair = TRUE;
+ *rtn = AARCH64_RT2 (insn);
+ }
+ *load = AARCH64_LD (insn);
+ return TRUE;
+ }
+ else if (AARCH64_LDST_NAP (insn)
+ || AARCH64_LDSTP_PI (insn)
+ || AARCH64_LDSTP_O (insn)
+ || AARCH64_LDSTP_PRE (insn))
+ {
+ *pair = TRUE;
+ *rt = AARCH64_RT (insn);
+ *rtn = AARCH64_RT2 (insn);
+ *load = AARCH64_LD (insn);
+ return TRUE;
+ }
+ else if (AARCH64_LDST_PCREL (insn)
+ || AARCH64_LDST_UI (insn)
+ || AARCH64_LDST_PIIMM (insn)
+ || AARCH64_LDST_U (insn)
+ || AARCH64_LDST_PREIMM (insn)
+ || AARCH64_LDST_RO (insn)
+ || AARCH64_LDST_UIMM (insn))
+ {
+ *rt = AARCH64_RT (insn);
+ *rtn = *rt;
+ if (AARCH64_LDST_PCREL (insn))
+ *load = TRUE;
+ opc = AARCH64_BITS (insn, 22, 2);
+ v = AARCH64_BIT (insn, 26);
+ opc_v = opc | (v << 2);
+ *load = (opc_v == 1 || opc_v == 2 || opc_v == 3
+ || opc_v == 5 || opc_v == 7);
+ return TRUE;
+ }
+ else if (AARCH64_LDST_SIMD_M (insn)
+ || AARCH64_LDST_SIMD_M_PI (insn))
+ {
+ *rt = AARCH64_RT (insn);
+ *load = AARCH64_BIT (insn, 22);
+ opcode = (insn >> 12) & 0xf;
+ switch (opcode)
+ {
+ case 0:
+ case 2:
+ *rtn = *rt + 3;
+ break;
+
+ case 4:
+ case 6:
+ *rtn = *rt + 2;
+ break;
+
+ case 7:
+ *rtn = *rt;
+ break;
+
+ case 8:
+ case 10:
+ *rtn = *rt + 1;
+ break;
+
+ default:
+ return FALSE;
+ }
+ return TRUE;
+ }
+ else if (AARCH64_LDST_SIMD_S (insn)
+ || AARCH64_LDST_SIMD_S_PI (insn))
+ {
+ *rt = AARCH64_RT (insn);
+ r = (insn >> 21) & 1;
+ *load = AARCH64_BIT (insn, 22);
+ opcode = (insn >> 13) & 0x7;
+ switch (opcode)
+ {
+ case 0:
+ case 2:
+ case 4:
+ *rtn = *rt + r;
+ break;
+
+ case 1:
+ case 3:
+ case 5:
+ *rtn = *rt + (r == 0 ? 2 : 3);
+ break;
+
+ case 6:
+ *rtn = *rt + r;
+ break;
+
+ case 7:
+ *rtn = *rt + (r == 0 ? 2 : 3);
+ break;
+
+ default:
+ return FALSE;
+ }
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/* Return TRUE if INSN is multiply-accumulate. */
+
+static bfd_boolean
+aarch64_mlxl_p (uint32_t insn)
+{
+ uint32_t op31 = AARCH64_OP31 (insn);
+
+ if (AARCH64_MAC (insn)
+ && (op31 == 0 || op31 == 1 || op31 == 5)
+ /* Exclude MUL instructions which are encoded as a multiple accumulate
+ with RA = XZR. */
+ && AARCH64_RA (insn) != AARCH64_ZR)
+ return TRUE;
+
+ return FALSE;
+}
+
+/* Some early revisions of the Cortex-A53 have an erratum (835769) whereby
+ it is possible for a 64-bit multiply-accumulate instruction to generate an
+ incorrect result. The details are quite complex and hard to
+ determine statically, since branches in the code may exist in some
+ circumstances, but all cases end with a memory (load, store, or
+ prefetch) instruction followed immediately by the multiply-accumulate
+ operation. We employ a linker patching technique, by moving the potentially
+ affected multiply-accumulate instruction into a patch region and replacing
+ the original instruction with a branch to the patch. This function checks
+ if INSN_1 is the memory operation followed by a multiply-accumulate
+ operation (INSN_2). Return TRUE if an erratum sequence is found, FALSE
+ if INSN_1 and INSN_2 are safe. */
+
+static bfd_boolean
+aarch64_erratum_sequence (uint32_t insn_1, uint32_t insn_2)
+{
+ uint32_t rt;
+ uint32_t rtn;
+ uint32_t rn;
+ uint32_t rm;
+ uint32_t ra;
+ bfd_boolean pair;
+ bfd_boolean load;
+
+ if (aarch64_mlxl_p (insn_2)
+ && aarch64_mem_op_p (insn_1, &rt, &rtn, &pair, &load))
+ {
+ /* Any SIMD memory op is independent of the subsequent MLA
+ by definition of the erratum. */
+ if (AARCH64_BIT (insn_1, 26))
+ return TRUE;
+
+ /* If not SIMD, check for integer memory ops and MLA relationship. */
+ rn = AARCH64_RN (insn_2);
+ ra = AARCH64_RA (insn_2);
+ rm = AARCH64_RM (insn_2);
+
+ /* If this is a load and there's a true(RAW) dependency, we are safe
+ and this is not an erratum sequence. */
+ if (load &&
+ (rt == rn || rt == rm || rt == ra
+ || (pair && (rtn == rn || rtn == rm || rtn == ra))))
+ return FALSE;
+
+ /* We conservatively put out stubs for all other cases (including
+ writebacks). */
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static bfd_boolean
+erratum_835769_scan (bfd *input_bfd,
+ struct bfd_link_info *info,
+ struct aarch64_erratum_835769_fix **fixes_p,
+ unsigned int *num_fixes_p,
+ unsigned int *fix_table_size_p)
+{
+ asection *section;
+ struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
+ struct aarch64_erratum_835769_fix *fixes = *fixes_p;
+ unsigned int num_fixes = *num_fixes_p;
+ unsigned int fix_table_size = *fix_table_size_p;
+
+ if (htab == NULL)
+ return FALSE;
+
+ for (section = input_bfd->sections;
+ section != NULL;
+ section = section->next)
+ {
+ bfd_byte *contents = NULL;
+ struct _aarch64_elf_section_data *sec_data;
+ unsigned int span;
+
+ if (elf_section_type (section) != SHT_PROGBITS
+ || (elf_section_flags (section) & SHF_EXECINSTR) == 0
+ || (section->flags & SEC_EXCLUDE) != 0
+ || (section->sec_info_type == SEC_INFO_TYPE_JUST_SYMS)
+ || (section->output_section == bfd_abs_section_ptr))
+ continue;
+
+ if (elf_section_data (section)->this_hdr.contents != NULL)
+ contents = elf_section_data (section)->this_hdr.contents;
+ else if (! bfd_malloc_and_get_section (input_bfd, section, &contents))
+ return TRUE;
+
+ sec_data = elf_aarch64_section_data (section);
+ for (span = 0; span < sec_data->mapcount; span++)
+ {
+ unsigned int span_start = sec_data->map[span].vma;
+ unsigned int span_end = ((span == sec_data->mapcount - 1)
+ ? sec_data->map[0].vma + section->size
+ : sec_data->map[span + 1].vma);
+ unsigned int i;
+ char span_type = sec_data->map[span].type;
+
+ if (span_type == 'd')
+ continue;
+
+ for (i = span_start; i + 4 < span_end; i += 4)
+ {
+ uint32_t insn_1 = bfd_getl32 (contents + i);
+ uint32_t insn_2 = bfd_getl32 (contents + i + 4);
+
+ if (aarch64_erratum_sequence (insn_1, insn_2))
+ {
+ char *stub_name = NULL;
+ stub_name = (char *) bfd_malloc
+ (strlen ("__erratum_835769_veneer_") + 16);
+ if (stub_name != NULL)
+ sprintf
+ (stub_name,"__erratum_835769_veneer_%d", num_fixes);
+ else
+ return TRUE;
+
+ if (num_fixes == fix_table_size)
+ {
+ fix_table_size *= 2;
+ fixes =
+ (struct aarch64_erratum_835769_fix *)
+ bfd_realloc (fixes,
+ sizeof (struct aarch64_erratum_835769_fix)
+ * fix_table_size);
+ if (fixes == NULL)
+ return TRUE;
+ }
+
+ fixes[num_fixes].input_bfd = input_bfd;
+ fixes[num_fixes].section = section;
+ fixes[num_fixes].offset = i + 4;
+ fixes[num_fixes].veneered_insn = insn_2;
+ fixes[num_fixes].stub_name = stub_name;
+ fixes[num_fixes].stub_type = aarch64_stub_erratum_835769_veneer;
+ num_fixes++;
+ }
+ }
+ }
+ if (elf_section_data (section)->this_hdr.contents == NULL)
+ free (contents);
+ }
+
+ *fixes_p = fixes;
+ *num_fixes_p = num_fixes;
+ *fix_table_size_p = fix_table_size;
+ return FALSE;
+}
+
+/* Find or create a stub section. Returns a pointer to the stub section, and
+ the section to which the stub section will be attached (in *LINK_SEC_P).
+ LINK_SEC_P may be NULL. */
+
+static asection *
+elf_aarch64_create_or_find_stub_sec (asection **link_sec_p, asection *section,
+ struct elf_aarch64_link_hash_table *htab)
+{
+ asection *link_sec;
+ asection *stub_sec;
+
+ link_sec = htab->stub_group[section->id].link_sec;
+ BFD_ASSERT (link_sec != NULL);
+ stub_sec = htab->stub_group[section->id].stub_sec;
+
+ if (stub_sec == NULL)
+ {
+ stub_sec = htab->stub_group[link_sec->id].stub_sec;
+ if (stub_sec == NULL)
+ {
+ size_t namelen;
+ bfd_size_type len;
+ char *s_name;
+
+ namelen = strlen (link_sec->name);
+ len = namelen + sizeof (STUB_SUFFIX);
+ s_name = (char *) bfd_alloc (htab->stub_bfd, len);
+ if (s_name == NULL)
+ return NULL;
+
+ memcpy (s_name, link_sec->name, namelen);
+ memcpy (s_name + namelen, STUB_SUFFIX, sizeof (STUB_SUFFIX));
+ stub_sec = (*htab->add_stub_section) (s_name, link_sec);
+
+ if (stub_sec == NULL)
+ return NULL;
+ htab->stub_group[link_sec->id].stub_sec = stub_sec;
+ }
+ htab->stub_group[section->id].stub_sec = stub_sec;
+ }
+
+ if (link_sec_p)
+ *link_sec_p = link_sec;
+
+ return stub_sec;
+}
+
/* Determine and set the size of the stub section for a final link.
The basic idea here is to examine all the relocations looking for
@@ -2647,6 +3100,21 @@ elfNN_aarch64_size_stubs (bfd *output_bfd,
bfd_boolean stubs_always_before_branch;
bfd_boolean stub_changed = 0;
struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
+ struct aarch64_erratum_835769_fix *erratum_835769_fixes = NULL;
+ unsigned int num_erratum_835769_fixes = 0;
+ unsigned int erratum_835769_fix_table_size = 10;
+ unsigned int i;
+
+ if (htab->fix_erratum_835769)
+ {
+ erratum_835769_fixes
+ = (struct aarch64_erratum_835769_fix *)
+ bfd_zmalloc
+ (sizeof (struct aarch64_erratum_835769_fix) *
+ erratum_835769_fix_table_size);
+ if (erratum_835769_fixes == NULL)
+ goto error_ret_free_local;
+ }
/* Propagate mach to stub bfd, because it may not have been
finalized when we created stub_bfd. */
@@ -2677,9 +3145,11 @@ elfNN_aarch64_size_stubs (bfd *output_bfd,
bfd *input_bfd;
unsigned int bfd_indx;
asection *stub_sec;
+ unsigned prev_num_erratum_835769_fixes = num_erratum_835769_fixes;
+ num_erratum_835769_fixes = 0;
for (input_bfd = info->input_bfds, bfd_indx = 0;
- input_bfd != NULL; input_bfd = input_bfd->link_next, bfd_indx++)
+ input_bfd != NULL; input_bfd = input_bfd->link.next, bfd_indx++)
{
Elf_Internal_Shdr *symtab_hdr;
asection *section;
@@ -2930,8 +3400,20 @@ elfNN_aarch64_size_stubs (bfd *output_bfd,
if (elf_section_data (section)->relocs == NULL)
free (internal_relocs);
}
+
+ if (htab->fix_erratum_835769)
+ {
+ /* Scan for sequences which might trigger erratum 835769. */
+ if (erratum_835769_scan (input_bfd, info, &erratum_835769_fixes,
+ &num_erratum_835769_fixes,
+ &erratum_835769_fix_table_size) != 0)
+ goto error_ret_free_local;
+ }
}
+ if (prev_num_erratum_835769_fixes != num_erratum_835769_fixes)
+ stub_changed = TRUE;
+
if (!stub_changed)
break;
@@ -2939,15 +3421,76 @@ elfNN_aarch64_size_stubs (bfd *output_bfd,
stub sections. */
for (stub_sec = htab->stub_bfd->sections;
stub_sec != NULL; stub_sec = stub_sec->next)
- stub_sec->size = 0;
+ {
+ /* Ignore non-stub sections. */
+ if (!strstr (stub_sec->name, STUB_SUFFIX))
+ continue;
+ stub_sec->size = 0;
+ }
bfd_hash_traverse (&htab->stub_hash_table, aarch64_size_one_stub, htab);
+ /* Add erratum 835769 veneers to stub section sizes too. */
+ if (htab->fix_erratum_835769)
+ for (i = 0; i < num_erratum_835769_fixes; i++)
+ {
+ stub_sec = elf_aarch64_create_or_find_stub_sec (NULL,
+ erratum_835769_fixes[i].section, htab);
+
+ if (stub_sec == NULL)
+ goto error_ret_free_local;
+
+ stub_sec->size += 8;
+ }
+
/* Ask the linker to do its stuff. */
(*htab->layout_sections_again) ();
stub_changed = FALSE;
}
+ /* Add stubs for erratum 835769 fixes now. */
+ if (htab->fix_erratum_835769)
+ {
+ for (i = 0; i < num_erratum_835769_fixes; i++)
+ {
+ struct elf_aarch64_stub_hash_entry *stub_entry;
+ char *stub_name = erratum_835769_fixes[i].stub_name;
+ asection *section = erratum_835769_fixes[i].section;
+ unsigned int section_id = erratum_835769_fixes[i].section->id;
+ asection *link_sec = htab->stub_group[section_id].link_sec;
+ asection *stub_sec = htab->stub_group[section_id].stub_sec;
+
+ stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table,
+ stub_name, TRUE, FALSE);
+ if (stub_entry == NULL)
+ {
+ (*_bfd_error_handler) (_("%s: cannot create stub entry %s"),
+ section->owner,
+ stub_name);
+ return FALSE;
+ }
+
+ stub_entry->stub_sec = stub_sec;
+ stub_entry->stub_offset = 0;
+ stub_entry->id_sec = link_sec;
+ stub_entry->stub_type = erratum_835769_fixes[i].stub_type;
+ stub_entry->target_section = section;
+ stub_entry->target_value = erratum_835769_fixes[i].offset;
+ stub_entry->veneered_insn = erratum_835769_fixes[i].veneered_insn;
+ stub_entry->output_name = erratum_835769_fixes[i].stub_name;
+ }
+
+ /* Stash the erratum 835769 fix array for use later in
+ elfNN_aarch64_write_section(). */
+ htab->aarch64_erratum_835769_fixes = erratum_835769_fixes;
+ htab->num_aarch64_erratum_835769_fixes = num_erratum_835769_fixes;
+ }
+ else
+ {
+ htab->aarch64_erratum_835769_fixes = NULL;
+ htab->num_aarch64_erratum_835769_fixes = 0;
+ }
+
return TRUE;
error_ret_free_local:
@@ -3040,7 +3583,7 @@ bfd_elfNN_aarch64_init_maps (bfd *abfd)
return;
if ((abfd->flags & DYNAMIC) != 0)
- return;
+ return;
hdr = &elf_symtab_hdr (abfd);
localsyms = hdr->sh_info;
@@ -3078,12 +3621,14 @@ void
bfd_elfNN_aarch64_set_options (struct bfd *output_bfd,
struct bfd_link_info *link_info,
int no_enum_warn,
- int no_wchar_warn, int pic_veneer)
+ int no_wchar_warn, int pic_veneer,
+ int fix_erratum_835769)
{
struct elf_aarch64_link_hash_table *globals;
globals = elf_aarch64_hash_table (link_info);
globals->pic_veneer = pic_veneer;
+ globals->fix_erratum_835769 = fix_erratum_835769;
BFD_ASSERT (is_aarch64_elf (output_bfd));
elf_aarch64_tdata (output_bfd)->no_enum_size_warning = no_enum_warn;
@@ -3289,8 +3834,7 @@ tpoff_base (struct bfd_link_info *info)
struct elf_link_hash_table *htab = elf_hash_table (info);
/* If tls_sec is NULL, we should have signalled an error already. */
- if (htab->tls_sec == NULL)
- return 0;
+ BFD_ASSERT (htab->tls_sec != NULL);
bfd_vma base = align_power ((bfd_vma) TCB_SIZE,
htab->tls_sec->alignment_power);
@@ -3394,6 +3938,89 @@ symbol_tlsdesc_got_offset (bfd *input_bfd, struct elf_link_hash_entry *h,
return value;
}
+/* Data for make_branch_to_erratum_835769_stub(). */
+
+struct erratum_835769_branch_to_stub_data
+{
+ asection *output_section;
+ bfd_byte *contents;
+};
+
+/* Helper to insert branches to erratum 835769 stubs in the right
+ places for a particular section. */
+
+static bfd_boolean
+make_branch_to_erratum_835769_stub (struct bfd_hash_entry *gen_entry,
+ void *in_arg)
+{
+ struct elf_aarch64_stub_hash_entry *stub_entry;
+ struct erratum_835769_branch_to_stub_data *data;
+ bfd_byte *contents;
+ unsigned long branch_insn = 0;
+ bfd_vma veneered_insn_loc, veneer_entry_loc;
+ bfd_signed_vma branch_offset;
+ unsigned int target;
+ bfd *abfd;
+
+ stub_entry = (struct elf_aarch64_stub_hash_entry *) gen_entry;
+ data = (struct erratum_835769_branch_to_stub_data *) in_arg;
+
+ if (stub_entry->target_section != data->output_section
+ || stub_entry->stub_type != aarch64_stub_erratum_835769_veneer)
+ return TRUE;
+
+ contents = data->contents;
+ veneered_insn_loc = stub_entry->target_section->output_section->vma
+ + stub_entry->target_section->output_offset
+ + stub_entry->target_value;
+ veneer_entry_loc = stub_entry->stub_sec->output_section->vma
+ + stub_entry->stub_sec->output_offset
+ + stub_entry->stub_offset;
+ branch_offset = veneer_entry_loc - veneered_insn_loc;
+
+ abfd = stub_entry->target_section->owner;
+ if (!aarch64_valid_branch_p (veneer_entry_loc, veneered_insn_loc))
+ (*_bfd_error_handler)
+ (_("%B: error: Erratum 835769 stub out "
+ "of range (input file too large)"), abfd);
+
+ target = stub_entry->target_value;
+ branch_insn = 0x14000000;
+ branch_offset >>= 2;
+ branch_offset &= 0x3ffffff;
+ branch_insn |= branch_offset;
+ bfd_putl32 (branch_insn, &contents[target]);
+
+ return TRUE;
+}
+
+static bfd_boolean
+elfNN_aarch64_write_section (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *link_info,
+ asection *sec,
+ bfd_byte *contents)
+
+{
+ struct elf_aarch64_link_hash_table *globals =
+ elf_aarch64_hash_table (link_info);
+
+ if (globals == NULL)
+ return FALSE;
+
+ /* Fix code to point to erratum 835769 stubs. */
+ if (globals->fix_erratum_835769)
+ {
+ struct erratum_835769_branch_to_stub_data data;
+
+ data.output_section = sec;
+ data.contents = contents;
+ bfd_hash_traverse (&globals->stub_hash_table,
+ make_branch_to_erratum_835769_stub, &data);
+ }
+
+ return FALSE;
+}
+
/* Perform a relocation as part of a final link. */
static bfd_reloc_status_type
elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
@@ -3577,7 +4204,8 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
if (globals->root.splt != NULL)
{
- plt_index = h->plt.offset / globals->plt_entry_size - 1;
+ plt_index = ((h->plt.offset - globals->plt_header_size) /
+ globals->plt_entry_size);
off = (plt_index + 3) * GOT_ENTRY_SIZE;
base_got = globals->root.sgotplt;
}
@@ -3831,7 +4459,7 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
value = (symbol_got_offset (input_bfd, h, r_symndx)
+ globals->root.sgot->output_section->vma
- + globals->root.sgot->output_section->output_offset);
+ + globals->root.sgot->output_offset);
value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value,
0, weak_undef_p);
@@ -3860,10 +4488,9 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
case BFD_RELOC_AARCH64_TLSDESC_LDR:
if (globals->root.sgot == NULL)
return bfd_reloc_notsupported;
-
value = (symbol_tlsdesc_got_offset (input_bfd, h, r_symndx)
+ globals->root.sgotplt->output_section->vma
- + globals->root.sgotplt->output_section->output_offset
+ + globals->root.sgotplt->output_offset
+ globals->sgotplt_jump_table_size);
value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value,
@@ -3926,7 +4553,6 @@ elfNN_aarch64_tls_relax (struct elf_aarch64_link_hash_table *globals,
or
adrp x0, :tlsdesc:var => adrp x0, :gottprel:var
*/
- insn = bfd_getl32 (contents + rel->r_offset);
return bfd_reloc_continue;
}
@@ -3945,7 +4571,7 @@ elfNN_aarch64_tls_relax (struct elf_aarch64_link_hash_table *globals,
ldr xd, [x0, #:tlsdesc_lo12:var] => ldr x0, [x0, #:gottprel_lo12:var]
*/
insn = bfd_getl32 (contents + rel->r_offset);
- insn &= 0xfffffff0;
+ insn &= 0xffffffe0;
bfd_putl32 (insn, contents + rel->r_offset);
return bfd_reloc_continue;
}
@@ -4132,12 +4758,12 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
sym_type = h->type;
}
@@ -4147,15 +4773,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
rel, 1, relend, howto, 0, contents);
if (info->relocatable)
- {
- /* This is a relocatable link. We don't have to change
- anything, unless the reloc is against a section symbol,
- in which case we have to adjust according to where the
- section symbol winds up in the output section. */
- if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
- rel->r_addend += sec->output_offset;
- continue;
- }
+ continue;
if (h != NULL)
name = h->root.root.string;
@@ -4525,31 +5143,6 @@ elfNN_aarch64_set_private_flags (bfd *abfd, flagword flags)
return TRUE;
}
-/* Copy backend specific data from one object module to another. */
-
-static bfd_boolean
-elfNN_aarch64_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
-{
- flagword in_flags;
-
- if (!is_aarch64_elf (ibfd) || !is_aarch64_elf (obfd))
- return TRUE;
-
- in_flags = elf_elfheader (ibfd)->e_flags;
-
- elf_elfheader (obfd)->e_flags = in_flags;
- elf_flags_init (obfd) = TRUE;
-
- /* Also copy the EI_OSABI field. */
- elf_elfheader (obfd)->e_ident[EI_OSABI] =
- elf_elfheader (ibfd)->e_ident[EI_OSABI];
-
- /* Copy object attributes. */
- _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
- return TRUE;
-}
-
/* Merge backend specific data from an object file to the output
object file when linking. */
@@ -4788,16 +5381,6 @@ elfNN_aarch64_gc_sweep_hook (bfd *abfd,
}
break;
- case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
- case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
- case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
- if (h != NULL && info->executable)
- {
- if (h->plt.refcount > 0)
- h->plt.refcount -= 1;
- }
- break;
-
case BFD_RELOC_AARCH64_CALL26:
case BFD_RELOC_AARCH64_JUMP26:
/* If this is a local symbol then we resolve it
@@ -4809,6 +5392,13 @@ elfNN_aarch64_gc_sweep_hook (bfd *abfd,
h->plt.refcount -= 1;
break;
+ case BFD_RELOC_AARCH64_MOVW_G0_NC:
+ case BFD_RELOC_AARCH64_MOVW_G1_NC:
+ case BFD_RELOC_AARCH64_MOVW_G2_NC:
+ case BFD_RELOC_AARCH64_MOVW_G3:
+ case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
+ case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
+ case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
case BFD_RELOC_AARCH64_NN:
if (h != NULL && info->executable)
{
@@ -5305,6 +5895,22 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
break;
}
+ case BFD_RELOC_AARCH64_MOVW_G0_NC:
+ case BFD_RELOC_AARCH64_MOVW_G1_NC:
+ case BFD_RELOC_AARCH64_MOVW_G2_NC:
+ case BFD_RELOC_AARCH64_MOVW_G3:
+ if (info->shared)
+ {
+ int howto_index = bfd_r_type - BFD_RELOC_AARCH64_RELOC_START;
+ (*_bfd_error_handler)
+ (_("%B: relocation %s against `%s' can not be used when making "
+ "a shared object; recompile with -fPIC"),
+ abfd, elfNN_aarch64_howto_table[howto_index].name,
+ (h) ? h->root.root.string : "a local symbol");
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
@@ -5362,8 +5968,8 @@ elfNN_aarch64_is_target_special_symbol (bfd *abfd ATTRIBUTE_UNUSED,
static bfd_boolean
aarch64_elf_find_function (bfd *abfd ATTRIBUTE_UNUSED,
- asection *section,
asymbol **symbols,
+ asection *section,
bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr)
@@ -5422,32 +6028,33 @@ aarch64_elf_find_function (bfd *abfd ATTRIBUTE_UNUSED,
static bfd_boolean
elfNN_aarch64_find_nearest_line (bfd *abfd,
- asection *section,
asymbol **symbols,
+ asection *section,
bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr,
- unsigned int *line_ptr)
+ unsigned int *line_ptr,
+ unsigned int *discriminator_ptr)
{
bfd_boolean found = FALSE;
- /* We skip _bfd_dwarf1_find_nearest_line since no known AArch64
- toolchain uses it. */
-
- if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections,
- section, symbols, offset,
+ if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset,
filename_ptr, functionname_ptr,
- line_ptr, NULL, 0,
+ line_ptr, discriminator_ptr,
+ dwarf_debug_sections, 0,
&elf_tdata (abfd)->dwarf2_find_line_info))
{
if (!*functionname_ptr)
- aarch64_elf_find_function (abfd, section, symbols, offset,
+ aarch64_elf_find_function (abfd, symbols, section, offset,
*filename_ptr ? NULL : filename_ptr,
functionname_ptr);
return TRUE;
}
+ /* Skip _bfd_dwarf1_find_nearest_line since no known AArch64
+ toolchain uses DWARF1. */
+
if (!_bfd_stab_section_find_nearest_line (abfd, symbols, section, offset,
&found, filename_ptr,
functionname_ptr, line_ptr,
@@ -5460,7 +6067,7 @@ elfNN_aarch64_find_nearest_line (bfd *abfd,
if (symbols == NULL)
return FALSE;
- if (!aarch64_elf_find_function (abfd, section, symbols, offset,
+ if (!aarch64_elf_find_function (abfd, symbols, section, offset,
filename_ptr, functionname_ptr))
return FALSE;
@@ -5491,7 +6098,7 @@ elfNN_aarch64_post_process_headers (bfd *abfd,
i_ehdrp = elf_elfheader (abfd);
i_ehdrp->e_ident[EI_ABIVERSION] = AARCH64_ELF_ABI_VERSION;
- _bfd_elf_set_osabi (abfd, link_info);
+ _bfd_elf_post_process_headers (abfd, link_info);
}
static enum elf_reloc_type_class
@@ -5512,17 +6119,6 @@ elfNN_aarch64_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSE
}
}
-/* Set the right machine number for an AArch64 ELF file. */
-
-static bfd_boolean
-elfNN_aarch64_section_flags (flagword *flags, const Elf_Internal_Shdr *hdr)
-{
- if (hdr->sh_type == SHT_NOTE)
- *flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_SAME_CONTENTS;
-
- return TRUE;
-}
-
/* Handle an AArch64 specific section when reading an object file. This is
called when bfd_section_from_shdr finds a section with an unknown
type. */
@@ -5767,6 +6363,13 @@ aarch64_map_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
if (!elfNN_aarch64_output_map_sym (osi, AARCH64_MAP_DATA, addr + 16))
return FALSE;
break;
+ case aarch64_stub_erratum_835769_veneer:
+ if (!elfNN_aarch64_output_stub_sym (osi, stub_name, addr,
+ sizeof (aarch64_erratum_835769_stub)))
+ return FALSE;
+ if (!elfNN_aarch64_output_map_sym (osi, AARCH64_MAP_INSN, addr))
+ return FALSE;
+ break;
default:
BFD_FAIL ();
}
@@ -6315,7 +6918,7 @@ elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
struct elf_aarch64_local_symbol *locals = NULL;
Elf_Internal_Shdr *symtab_hdr;
@@ -6462,6 +7065,16 @@ elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
}
}
+ /* Init mapping symbols information to use later to distingush between
+ code and data while scanning for erratam 835769. */
+ if (htab->fix_erratum_835769)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
+ {
+ if (!is_aarch64_elf (ibfd))
+ continue;
+ bfd_elfNN_aarch64_init_maps (ibfd);
+ }
+
/* We now have determined the sizes of the various dynamic sections.
Allocate memory for them. */
relocs = FALSE;
@@ -6639,7 +7252,7 @@ elfNN_aarch64_create_small_pltn_entry (struct elf_link_hash_entry *h,
plt_entry = plt->contents + h->plt.offset;
plt_entry_address = plt->output_section->vma
- + plt->output_section->output_offset + h->plt.offset;
+ + plt->output_offset + h->plt.offset;
gotplt_entry_address = gotplt->output_section->vma +
gotplt->output_offset + got_offset;
@@ -6811,7 +7424,34 @@ elfNN_aarch64_finish_dynamic_symbol (bfd *output_bfd,
+ htab->root.sgot->output_offset
+ (h->got.offset & ~(bfd_vma) 1));
- if (info->shared && SYMBOL_REFERENCES_LOCAL (info, h))
+ if (h->def_regular
+ && h->type == STT_GNU_IFUNC)
+ {
+ if (info->shared)
+ {
+ /* Generate R_AARCH64_GLOB_DAT. */
+ goto do_glob_dat;
+ }
+ else
+ {
+ asection *plt;
+
+ if (!h->pointer_equality_needed)
+ abort ();
+
+ /* For non-shared object, we can't use .got.plt, which
+ contains the real function address if we need pointer
+ equality. We load the GOT entry with the PLT entry. */
+ plt = htab->root.splt ? htab->root.splt : htab->root.iplt;
+ bfd_put_NN (output_bfd, (plt->output_section->vma
+ + plt->output_offset
+ + h->plt.offset),
+ htab->root.sgot->contents
+ + (h->got.offset & ~(bfd_vma) 1));
+ return TRUE;
+ }
+ }
+ else if (info->shared && SYMBOL_REFERENCES_LOCAL (info, h))
{
if (!h->def_regular)
return FALSE;
@@ -6824,6 +7464,7 @@ elfNN_aarch64_finish_dynamic_symbol (bfd *output_bfd,
}
else
{
+do_glob_dat:
BFD_ASSERT ((h->got.offset & 1) == 0);
bfd_put_NN (output_bfd, (bfd_vma) 0,
htab->root.sgot->contents + h->got.offset);
@@ -6918,7 +7559,7 @@ elfNN_aarch64_init_small_plt0_entry (bfd *output_bfd ATTRIBUTE_UNUSED,
+ GOT_ENTRY_SIZE * 2);
plt_base = htab->root.splt->output_section->vma +
- htab->root.splt->output_section->output_offset;
+ htab->root.splt->output_offset;
/* Fill in the top 21 bits for this: ADRP x16, PLT_GOT + n * 8.
ADRP: ((PG(S+A)-PG(P)) >> 12) & 0x1fffff */
@@ -6978,7 +7619,7 @@ elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd,
break;
case DT_PLTRELSZ:
- s = htab->root.srelplt->output_section;
+ s = htab->root.srelplt;
dyn.d_un.d_val = s->size;
break;
@@ -6992,7 +7633,7 @@ elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd,
about changing the DT_RELA entry. */
if (htab->root.srelplt != NULL)
{
- s = htab->root.srelplt->output_section;
+ s = htab->root.srelplt;
dyn.d_un.d_val -= s->size;
}
break;
@@ -7185,9 +7826,6 @@ const struct elf_size_info elfNN_aarch64_size_info =
#define bfd_elfNN_close_and_cleanup \
elfNN_aarch64_close_and_cleanup
-#define bfd_elfNN_bfd_copy_private_bfd_data \
- elfNN_aarch64_copy_private_bfd_data
-
#define bfd_elfNN_bfd_free_cached_info \
elfNN_aarch64_bfd_free_cached_info
@@ -7197,9 +7835,6 @@ const struct elf_size_info elfNN_aarch64_size_info =
#define bfd_elfNN_bfd_link_hash_table_create \
elfNN_aarch64_link_hash_table_create
-#define bfd_elfNN_bfd_link_hash_table_free \
- elfNN_aarch64_hash_table_free
-
#define bfd_elfNN_bfd_merge_private_bfd_data \
elfNN_aarch64_merge_private_bfd_data
@@ -7274,9 +7909,6 @@ const struct elf_size_info elfNN_aarch64_size_info =
#define elf_backend_reloc_type_class \
elfNN_aarch64_reloc_type_class
-#define elf_backend_section_flags \
- elfNN_aarch64_section_flags
-
#define elf_backend_section_from_shdr \
elfNN_aarch64_section_from_shdr
@@ -7286,6 +7918,9 @@ const struct elf_size_info elfNN_aarch64_size_info =
#define elf_backend_size_info \
elfNN_aarch64_size_info
+#define elf_backend_write_section \
+ elfNN_aarch64_write_section
+
#define elf_backend_can_refcount 1
#define elf_backend_can_gc_sections 1
#define elf_backend_plt_readonly 1
@@ -7294,6 +7929,7 @@ const struct elf_size_info elfNN_aarch64_size_info =
#define elf_backend_may_use_rel_p 0
#define elf_backend_may_use_rela_p 1
#define elf_backend_default_use_rela_p 1
+#define elf_backend_rela_normal 1
#define elf_backend_got_header_size (GOT_ENTRY_SIZE * 3)
#define elf_backend_default_execstack 0
diff --git a/binutils-2.25/bfd/elfnn-ia64.c b/binutils-2.25/bfd/elfnn-ia64.c
index 117b4c8c..a8d8d0bc 100644
--- a/binutils-2.25/bfd/elfnn-ia64.c
+++ b/binutils-2.25/bfd/elfnn-ia64.c
@@ -1,5 +1,5 @@
/* IA-64 support for 64-bit ELF
- Copyright 1998-2013 Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library.
@@ -1369,40 +1369,6 @@ elfNN_ia64_local_htab_eq (const void *ptr1, const void *ptr2)
return entry1->id == entry2->id && entry1->r_sym == entry2->r_sym;
}
-/* Create the derived linker hash table. The IA-64 ELF port uses this
- derived hash table to keep information specific to the IA-64 ElF
- linker (without using static variables). */
-
-static struct bfd_link_hash_table *
-elfNN_ia64_hash_table_create (bfd *abfd)
-{
- struct elfNN_ia64_link_hash_table *ret;
-
- ret = bfd_zmalloc ((bfd_size_type) sizeof (*ret));
- if (!ret)
- return NULL;
-
- if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
- elfNN_ia64_new_elf_hash_entry,
- sizeof (struct elfNN_ia64_link_hash_entry),
- IA64_ELF_DATA))
- {
- free (ret);
- return NULL;
- }
-
- ret->loc_hash_table = htab_try_create (1024, elfNN_ia64_local_htab_hash,
- elfNN_ia64_local_htab_eq, NULL);
- ret->loc_hash_memory = objalloc_create ();
- if (!ret->loc_hash_table || !ret->loc_hash_memory)
- {
- free (ret);
- return NULL;
- }
-
- return &ret->root.root;
-}
-
/* Free the global elfNN_ia64_dyn_sym_info array. */
static bfd_boolean
@@ -1448,10 +1414,10 @@ elfNN_ia64_local_dyn_info_free (void **slot,
/* Destroy IA-64 linker hash table. */
static void
-elfNN_ia64_hash_table_free (struct bfd_link_hash_table *hash)
+elfNN_ia64_link_hash_table_free (bfd *obfd)
{
struct elfNN_ia64_link_hash_table *ia64_info
- = (struct elfNN_ia64_link_hash_table *) hash;
+ = (struct elfNN_ia64_link_hash_table *) obfd->link.hash;
if (ia64_info->loc_hash_table)
{
htab_traverse (ia64_info->loc_hash_table,
@@ -1462,7 +1428,42 @@ elfNN_ia64_hash_table_free (struct bfd_link_hash_table *hash)
objalloc_free ((struct objalloc *) ia64_info->loc_hash_memory);
elf_link_hash_traverse (&ia64_info->root,
elfNN_ia64_global_dyn_info_free, NULL);
- _bfd_elf_link_hash_table_free (hash);
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
+/* Create the derived linker hash table. The IA-64 ELF port uses this
+ derived hash table to keep information specific to the IA-64 ElF
+ linker (without using static variables). */
+
+static struct bfd_link_hash_table *
+elfNN_ia64_hash_table_create (bfd *abfd)
+{
+ struct elfNN_ia64_link_hash_table *ret;
+
+ ret = bfd_zmalloc ((bfd_size_type) sizeof (*ret));
+ if (!ret)
+ return NULL;
+
+ if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
+ elfNN_ia64_new_elf_hash_entry,
+ sizeof (struct elfNN_ia64_link_hash_entry),
+ IA64_ELF_DATA))
+ {
+ free (ret);
+ return NULL;
+ }
+
+ ret->loc_hash_table = htab_try_create (1024, elfNN_ia64_local_htab_hash,
+ elfNN_ia64_local_htab_eq, NULL);
+ ret->loc_hash_memory = objalloc_create ();
+ if (!ret->loc_hash_table || !ret->loc_hash_memory)
+ {
+ elfNN_ia64_link_hash_table_free (abfd);
+ return NULL;
+ }
+ ret->root.root.hash_table_free = elfNN_ia64_link_hash_table_free;
+
+ return &ret->root.root;
}
/* Traverse both local and global hash tables. */
@@ -3902,17 +3903,17 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
else
{
bfd_boolean unresolved_reloc;
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sym_sec, value,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
if (h->root.type == bfd_link_hash_undefweak)
undef_weak_ref = TRUE;
- else if (warned)
+ else if (warned || (ignored && info->executable))
continue;
}
@@ -4936,8 +4937,8 @@ elfNN_ia64_object_p (bfd *abfd)
static bfd_boolean
elfNN_ia64_hpux_vec (const bfd_target *vec)
{
- extern const bfd_target bfd_elfNN_ia64_hpux_big_vec;
- return (vec == & bfd_elfNN_ia64_hpux_big_vec);
+ extern const bfd_target ia64_elfNN_hpux_be_vec;
+ return (vec == &ia64_elfNN_hpux_be_vec);
}
static void
@@ -4978,9 +4979,9 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED,
}
}
-#define TARGET_LITTLE_SYM bfd_elfNN_ia64_little_vec
+#define TARGET_LITTLE_SYM ia64_elfNN_le_vec
#define TARGET_LITTLE_NAME "elfNN-ia64-little"
-#define TARGET_BIG_SYM bfd_elfNN_ia64_big_vec
+#define TARGET_BIG_SYM ia64_elfNN_be_vec
#define TARGET_BIG_NAME "elfNN-ia64-big"
#define ELF_ARCH bfd_arch_ia64
#define ELF_TARGET_ID IA64_ELF_DATA
@@ -5024,8 +5025,6 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED,
/* Stuff for the BFD linker: */
#define bfd_elfNN_bfd_link_hash_table_create \
elfNN_ia64_hash_table_create
-#define bfd_elfNN_bfd_link_hash_table_free \
- elfNN_ia64_hash_table_free
#define elf_backend_create_dynamic_sections \
elfNN_ia64_create_dynamic_sections
#define elf_backend_check_relocs \
@@ -5083,7 +5082,7 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED,
#undef TARGET_LITTLE_SYM
#undef TARGET_LITTLE_NAME
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM bfd_elfNN_ia64_hpux_big_vec
+#define TARGET_BIG_SYM ia64_elfNN_hpux_be_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elfNN-ia64-hpux-big"
diff --git a/binutils-2.25/bfd/elfxx-aarch64.c b/binutils-2.25/bfd/elfxx-aarch64.c
index 395c999d..6ae4adf8 100644
--- a/binutils-2.25/bfd/elfxx-aarch64.c
+++ b/binutils-2.25/bfd/elfxx-aarch64.c
@@ -1,5 +1,5 @@
/* AArch64-specific support for ELF.
- Copyright 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of BFD, the Binary File Descriptor library.
@@ -20,6 +20,8 @@
#include "sysdep.h"
#include "elfxx-aarch64.h"
+#include <stdarg.h>
+#include <string.h>
#define MASK(n) ((1u << (n)) - 1)
@@ -479,9 +481,10 @@ _bfd_aarch64_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
asection **secp ATTRIBUTE_UNUSED,
bfd_vma *valp ATTRIBUTE_UNUSED)
{
- if ((abfd->flags & DYNAMIC) == 0
- && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
- || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE))
+ if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
+ || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)
+ && (abfd->flags & DYNAMIC) == 0
+ && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
return TRUE;
@@ -500,7 +503,7 @@ _bfd_aarch64_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
default:
return FALSE;
- case 408: /* sizeof(struct elf_prstatus) on Linux/arm64. */
+ case 392: /* sizeof(struct elf_prstatus) on Linux/arm64. */
/* pr_cursig */
elf_tdata (abfd)->core->signal
= bfd_get_16 (abfd, note->descdata + 12);
@@ -520,3 +523,82 @@ _bfd_aarch64_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
return _bfd_elfcore_make_pseudosection (abfd, ".reg",
size, note->descpos + offset);
}
+
+bfd_boolean
+_bfd_aarch64_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
+{
+ switch (note->descsz)
+ {
+ default:
+ return FALSE;
+
+ case 136: /* This is sizeof(struct elf_prpsinfo) on Linux/aarch64. */
+ elf_tdata (abfd)->core->pid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->program
+ = _bfd_elfcore_strndup (abfd, note->descdata + 40, 16);
+ elf_tdata (abfd)->core->command
+ = _bfd_elfcore_strndup (abfd, note->descdata + 56, 80);
+ }
+
+ /* Note that for some reason, a spurious space is tacked
+ onto the end of the args in some (at least one anyway)
+ implementations, so strip it off if it exists. */
+
+ {
+ char *command = elf_tdata (abfd)->core->command;
+ int n = strlen (command);
+
+ if (0 < n && command[n - 1] == ' ')
+ command[n - 1] = '\0';
+ }
+
+ return TRUE;
+}
+
+char *
+_bfd_aarch64_elf_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type,
+ ...)
+{
+ switch (note_type)
+ {
+ default:
+ return NULL;
+
+ case NT_PRPSINFO:
+ {
+ char data[136];
+ va_list ap;
+
+ va_start (ap, note_type);
+ memset (data, 0, sizeof (data));
+ strncpy (data + 40, va_arg (ap, const char *), 16);
+ strncpy (data + 56, va_arg (ap, const char *), 80);
+ va_end (ap);
+
+ return elfcore_write_note (abfd, buf, bufsiz, "CORE",
+ note_type, data, sizeof (data));
+ }
+
+ case NT_PRSTATUS:
+ {
+ char data[392];
+ va_list ap;
+ long pid;
+ int cursig;
+ const void *greg;
+
+ va_start (ap, note_type);
+ memset (data, 0, sizeof (data));
+ pid = va_arg (ap, long);
+ bfd_put_32 (abfd, pid, data + 32);
+ cursig = va_arg (ap, int);
+ bfd_put_16 (abfd, cursig, data + 12);
+ greg = va_arg (ap, const void *);
+ memcpy (data + 112, greg, 272);
+ va_end (ap);
+
+ return elfcore_write_note (abfd, buf, bufsiz, "CORE",
+ note_type, data, sizeof (data));
+ }
+ }
+}
diff --git a/binutils-2.25/bfd/elfxx-aarch64.h b/binutils-2.25/bfd/elfxx-aarch64.h
index dece641d..88081043 100644
--- a/binutils-2.25/bfd/elfxx-aarch64.h
+++ b/binutils-2.25/bfd/elfxx-aarch64.h
@@ -1,5 +1,5 @@
/* AArch64-specific backend routines.
- Copyright 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of BFD, the Binary File Descriptor library.
@@ -23,8 +23,8 @@
#include "stdint.h"
/* Take the PAGE component of an address or offset. */
-#define PG(x) ((x) & ~ (bfd_vma) 0xfff)
-#define PG_OFFSET(x) ((x) & (bfd_vma) 0xfff)
+#define PG(x) ((x) & ~ (bfd_vma) 0xfff)
+#define PG_OFFSET(x) ((x) & (bfd_vma) 0xfff)
extern bfd_reloc_status_type
_bfd_aarch64_elf_put_addend (bfd *, bfd_byte *, bfd_reloc_code_real_type,
@@ -42,6 +42,13 @@ _bfd_aarch64_elf_add_symbol_hook (bfd *, struct bfd_link_info *,
extern bfd_boolean
_bfd_aarch64_elf_grok_prstatus (bfd *, Elf_Internal_Note *);
+extern bfd_boolean
+_bfd_aarch64_elf_grok_psinfo (bfd *, Elf_Internal_Note *);
+
+extern char *
+_bfd_aarch64_elf_write_core_note (bfd *, char *, int *, int, ...);
#define elf_backend_add_symbol_hook _bfd_aarch64_elf_add_symbol_hook
#define elf_backend_grok_prstatus _bfd_aarch64_elf_grok_prstatus
+#define elf_backend_grok_psinfo _bfd_aarch64_elf_grok_psinfo
+#define elf_backend_write_core_note _bfd_aarch64_elf_write_core_note
diff --git a/binutils-2.25/bfd/elfxx-ia64.c b/binutils-2.25/bfd/elfxx-ia64.c
index ff45e9a0..e9f884be 100644
--- a/binutils-2.25/bfd/elfxx-ia64.c
+++ b/binutils-2.25/bfd/elfxx-ia64.c
@@ -1,6 +1,5 @@
/* IA-64 support for 64-bit ELF
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elfxx-ia64.h b/binutils-2.25/bfd/elfxx-ia64.h
index dfd9e08e..9f01315f 100644
--- a/binutils-2.25/bfd/elfxx-ia64.h
+++ b/binutils-2.25/bfd/elfxx-ia64.h
@@ -1,6 +1,5 @@
/* IA-64 support for 64-bit ELF
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/elfxx-mips.c b/binutils-2.25/bfd/elfxx-mips.c
index 1c64ad35..27176100 100644
--- a/binutils-2.25/bfd/elfxx-mips.c
+++ b/binutils-2.25/bfd/elfxx-mips.c
@@ -1,5 +1,5 @@
/* MIPS-specific support for ELF
- Copyright 1993-2013 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Most of the information added by Ian Lance Taylor, Cygnus Support,
<ian@cygnus.com>.
@@ -168,8 +168,10 @@ struct mips_got_info
unsigned int page_gotno;
/* The number of relocations needed for the GOT entries. */
unsigned int relocs;
- /* The number of local .got entries we have used. */
- unsigned int assigned_gotno;
+ /* The first unused local .got entry. */
+ unsigned int assigned_low_gotno;
+ /* The last unused local .got entry. */
+ unsigned int assigned_high_gotno;
/* A hash table holding members of the got. */
struct htab *got_entries;
/* A hash table holding mips_got_page_ref structures. */
@@ -545,6 +547,10 @@ struct mips_elf_obj_tdata
/* Input BFD providing Tag_GNU_MIPS_ABI_MSA attribute for output. */
bfd *abi_msa_bfd;
+ /* The abiflags for this object. */
+ Elf_Internal_ABIFlags_v0 abiflags;
+ bfd_boolean abiflags_valid;
+
/* The GOT requirements of input bfds. */
struct mips_got_info *got;
@@ -774,6 +780,10 @@ static bfd *reldyn_sorting_bfd;
#define PIC_OBJECT_P(abfd) \
((elf_elfheader (abfd)->e_flags & EF_MIPS_PIC) != 0)
+/* Nonzero if ABFD is using the O32 ABI. */
+#define ABI_O32_P(abfd) \
+ ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_O32)
+
/* Nonzero if ABFD is using the N32 ABI. */
#define ABI_N32_P(abfd) \
((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI2) != 0)
@@ -789,6 +799,11 @@ static bfd *reldyn_sorting_bfd;
#define MICROMIPS_P(abfd) \
((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH_ASE_MICROMIPS) != 0)
+/* Nonzero if ABFD is MIPS R6. */
+#define MIPSR6_P(abfd) \
+ ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32R6 \
+ || (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64R6)
+
/* The IRIX compatibility level we are striving for. */
#define IRIX_COMPAT(abfd) \
(get_elf_backend_data (abfd)->elf_backend_mips_irix_compat (abfd))
@@ -806,6 +821,10 @@ static bfd *reldyn_sorting_bfd;
#define MIPS_ELF_OPTIONS_SECTION_NAME_P(NAME) \
(strcmp (NAME, ".MIPS.options") == 0 || strcmp (NAME, ".options") == 0)
+/* True if NAME is the recognized name of any SHT_MIPS_ABIFLAGS section. */
+#define MIPS_ELF_ABIFLAGS_SECTION_NAME_P(NAME) \
+ (strcmp (NAME, ".MIPS.abiflags") == 0)
+
/* Whether the section is readonly. */
#define MIPS_ELF_READONLY_SECTION(sec) \
((sec->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY)) \
@@ -1086,6 +1105,17 @@ static const bfd_vma mips_exec_plt_entry[] =
0x03200008 /* jr $25 */
};
+/* In the following PLT entry the JR and ADDIU instructions will
+ be swapped in _bfd_mips_elf_finish_dynamic_symbol because
+ LOAD_INTERLOCKS_P will be true for MIPS R6. */
+static const bfd_vma mipsr6_exec_plt_entry[] =
+{
+ 0x3c0f0000, /* lui $15, %hi(.got.plt entry) */
+ 0x01f90000, /* l[wd] $25, %lo(.got.plt entry)($15) */
+ 0x25f80000, /* addiu $24, $15, %lo(.got.plt entry) */
+ 0x03200009 /* jr $25 */
+};
+
/* The format of subsequent MIPS16 o32 PLT entries. We use v0 ($2)
and v1 ($3) as temporaries because t8 ($24) and t9 ($25) are not
directly addressable. */
@@ -2166,7 +2196,8 @@ hi16_reloc_p (int r_type)
{
return (r_type == R_MIPS_HI16
|| r_type == R_MIPS16_HI16
- || r_type == R_MICROMIPS_HI16);
+ || r_type == R_MICROMIPS_HI16
+ || r_type == R_MIPS_PCHI16);
}
static inline bfd_boolean
@@ -2174,7 +2205,8 @@ lo16_reloc_p (int r_type)
{
return (r_type == R_MIPS_LO16
|| r_type == R_MIPS16_LO16
- || r_type == R_MICROMIPS_LO16);
+ || r_type == R_MICROMIPS_LO16
+ || r_type == R_MIPS_PCLO16);
}
static inline bfd_boolean
@@ -2192,6 +2224,13 @@ jal_reloc_p (int r_type)
}
static inline bfd_boolean
+aligned_pcrel_reloc_p (int r_type)
+{
+ return (r_type == R_MIPS_PC18_S3
+ || r_type == R_MIPS_PC19_S2);
+}
+
+static inline bfd_boolean
micromips_branch_reloc_p (int r_type)
{
return (r_type == R_MICROMIPS_26_S1
@@ -2662,6 +2701,46 @@ bfd_mips_elf_swap_options_out (bfd *abfd, const Elf_Internal_Options *in,
H_PUT_16 (abfd, in->section, ex->section);
H_PUT_32 (abfd, in->info, ex->info);
}
+
+/* Swap in an abiflags structure. */
+
+void
+bfd_mips_elf_swap_abiflags_v0_in (bfd *abfd,
+ const Elf_External_ABIFlags_v0 *ex,
+ Elf_Internal_ABIFlags_v0 *in)
+{
+ in->version = H_GET_16 (abfd, ex->version);
+ in->isa_level = H_GET_8 (abfd, ex->isa_level);
+ in->isa_rev = H_GET_8 (abfd, ex->isa_rev);
+ in->gpr_size = H_GET_8 (abfd, ex->gpr_size);
+ in->cpr1_size = H_GET_8 (abfd, ex->cpr1_size);
+ in->cpr2_size = H_GET_8 (abfd, ex->cpr2_size);
+ in->fp_abi = H_GET_8 (abfd, ex->fp_abi);
+ in->isa_ext = H_GET_32 (abfd, ex->isa_ext);
+ in->ases = H_GET_32 (abfd, ex->ases);
+ in->flags1 = H_GET_32 (abfd, ex->flags1);
+ in->flags2 = H_GET_32 (abfd, ex->flags2);
+}
+
+/* Swap out an abiflags structure. */
+
+void
+bfd_mips_elf_swap_abiflags_v0_out (bfd *abfd,
+ const Elf_Internal_ABIFlags_v0 *in,
+ Elf_External_ABIFlags_v0 *ex)
+{
+ H_PUT_16 (abfd, in->version, ex->version);
+ H_PUT_8 (abfd, in->isa_level, ex->isa_level);
+ H_PUT_8 (abfd, in->isa_rev, ex->isa_rev);
+ H_PUT_8 (abfd, in->gpr_size, ex->gpr_size);
+ H_PUT_8 (abfd, in->cpr1_size, ex->cpr1_size);
+ H_PUT_8 (abfd, in->cpr2_size, ex->cpr2_size);
+ H_PUT_8 (abfd, in->fp_abi, ex->fp_abi);
+ H_PUT_32 (abfd, in->isa_ext, ex->isa_ext);
+ H_PUT_32 (abfd, in->ases, ex->ases);
+ H_PUT_32 (abfd, in->flags1, ex->flags1);
+ H_PUT_32 (abfd, in->flags2, ex->flags2);
+}
/* This function is called via qsort() to sort the dynamic relocation
entries by increasing r_symndx value. */
@@ -3635,7 +3714,7 @@ mips_elf_create_local_got_entry (bfd *abfd, struct bfd_link_info *info,
if (entry)
return entry;
- if (g->assigned_gotno >= g->local_gotno)
+ if (g->assigned_low_gotno > g->assigned_high_gotno)
{
/* We didn't allocate enough space in the GOT. */
(*_bfd_error_handler)
@@ -3648,7 +3727,14 @@ mips_elf_create_local_got_entry (bfd *abfd, struct bfd_link_info *info,
if (!entry)
return NULL;
- lookup.gotidx = MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno++;
+ if (got16_reloc_p (r_type)
+ || call16_reloc_p (r_type)
+ || got_page_reloc_p (r_type)
+ || got_disp_reloc_p (r_type))
+ lookup.gotidx = MIPS_ELF_GOT_SIZE (abfd) * g->assigned_low_gotno++;
+ else
+ lookup.gotidx = MIPS_ELF_GOT_SIZE (abfd) * g->assigned_high_gotno--;
+
*entry = lookup;
*loc = entry;
@@ -4089,9 +4175,10 @@ mips_elf_pages_for_range (const struct mips_got_page_range *range)
/* Record that G requires a page entry that can reach SEC + ADDEND. */
static bfd_boolean
-mips_elf_record_got_page_entry (struct mips_got_info *g,
+mips_elf_record_got_page_entry (struct mips_elf_traverse_got_arg *arg,
asection *sec, bfd_signed_vma addend)
{
+ struct mips_got_info *g = arg->g;
struct mips_got_page_entry lookup, *entry;
struct mips_got_page_range **range_ptr, *range;
bfd_vma old_pages, new_pages;
@@ -4108,7 +4195,7 @@ mips_elf_record_got_page_entry (struct mips_got_info *g,
entry = (struct mips_got_page_entry *) *loc;
if (!entry)
{
- entry = bfd_zalloc (sec->owner, sizeof (*entry));
+ entry = bfd_zalloc (arg->info->output_bfd, sizeof (*entry));
if (!entry)
return FALSE;
@@ -4128,7 +4215,7 @@ mips_elf_record_got_page_entry (struct mips_got_info *g,
range = *range_ptr;
if (!range || addend < range->min_addend - 0xffff)
{
- range = bfd_zalloc (sec->owner, sizeof (*range));
+ range = bfd_zalloc (arg->info->output_bfd, sizeof (*range));
if (!range)
return FALSE;
@@ -4248,7 +4335,7 @@ mips_elf_resolve_got_page_ref (void **refp, void *data)
else
addend = isym->st_value + ref->addend;
}
- if (!mips_elf_record_got_page_entry (arg->g, sec, addend))
+ if (!mips_elf_record_got_page_entry (arg, sec, addend))
{
arg->g = NULL;
return 0;
@@ -4627,12 +4714,12 @@ mips_elf_set_global_gotidx (void **entryp, void *data)
&& entry->symndx == -1
&& entry->d.h->global_got_area != GGA_NONE)
{
- if (!mips_elf_set_gotidx (entryp, arg->value * arg->g->assigned_gotno))
+ if (!mips_elf_set_gotidx (entryp, arg->value * arg->g->assigned_low_gotno))
{
arg->g = NULL;
return 0;
}
- arg->g->assigned_gotno += 1;
+ arg->g->assigned_low_gotno += 1;
if (arg->info->shared
|| (elf_hash_table (arg->info)->dynamic_sections_created
@@ -4727,7 +4814,7 @@ mips_elf_multi_got (bfd *abfd, struct bfd_link_info *info,
/* Try to merge the GOTs of input bfds together, as long as they
don't seem to exceed the maximum GOT size, choosing one of them
to be the primary GOT. */
- for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link.next)
{
gg = mips_elf_bfd_got (ibfd, FALSE);
if (gg && !mips_elf_merge_got (ibfd, gg, &got_per_bfd_arg))
@@ -4765,7 +4852,7 @@ mips_elf_multi_got (bfd *abfd, struct bfd_link_info *info,
htab_traverse (g->got_entries, mips_elf_set_global_got_area, &tga);
/* Now go through the GOTs assigning them offset ranges.
- [assigned_gotno, local_gotno[ will be set to the range of local
+ [assigned_low_gotno, local_gotno[ will be set to the range of local
entries in each GOT. We can then compute the end of a GOT by
adding local_gotno to global_gotno. We reverse the list and make
it circular since then we'll be able to quickly compute the
@@ -4788,9 +4875,10 @@ mips_elf_multi_got (bfd *abfd, struct bfd_link_info *info,
struct mips_got_info *gn;
assign += htab->reserved_gotno;
- g->assigned_gotno = assign;
+ g->assigned_low_gotno = assign;
g->local_gotno += assign;
g->local_gotno += (pages < g->page_gotno ? pages : g->page_gotno);
+ g->assigned_high_gotno = g->local_gotno - 1;
assign = g->local_gotno + g->global_gotno + g->tls_gotno;
/* Take g out of the direct list, and push it onto the reversed
@@ -4829,21 +4917,21 @@ mips_elf_multi_got (bfd *abfd, struct bfd_link_info *info,
/* Assign offsets to global GOT entries and count how many
relocations they need. */
- save_assign = g->assigned_gotno;
- g->assigned_gotno = g->local_gotno;
+ save_assign = g->assigned_low_gotno;
+ g->assigned_low_gotno = g->local_gotno;
tga.info = info;
tga.value = MIPS_ELF_GOT_SIZE (abfd);
tga.g = g;
htab_traverse (g->got_entries, mips_elf_set_global_gotidx, &tga);
if (!tga.g)
return FALSE;
- BFD_ASSERT (g->assigned_gotno == g->local_gotno + g->global_gotno);
- g->assigned_gotno = save_assign;
+ BFD_ASSERT (g->assigned_low_gotno == g->local_gotno + g->global_gotno);
+ g->assigned_low_gotno = save_assign;
if (info->shared)
{
- g->relocs += g->local_gotno - g->assigned_gotno;
- BFD_ASSERT (g->assigned_gotno == g->next->local_gotno
+ g->relocs += g->local_gotno - g->assigned_low_gotno;
+ BFD_ASSERT (g->assigned_low_gotno == g->next->local_gotno
+ g->next->global_gotno
+ g->next->tls_gotno
+ htab->reserved_gotno);
@@ -5098,6 +5186,8 @@ mips_elf_relocation_needs_la25_stub (bfd *input_bfd, int r_type,
{
case R_MIPS_26:
case R_MIPS_PC16:
+ case R_MIPS_PC21_S2:
+ case R_MIPS_PC26_S2:
case R_MICROMIPS_26_S1:
case R_MICROMIPS_PC7_S1:
case R_MICROMIPS_PC10_S1:
@@ -5624,7 +5714,9 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
return bfd_reloc_continue;
case R_MIPS_16:
- value = symbol + _bfd_mips_elf_sign_extend (addend, 16);
+ if (howto->partial_inplace)
+ addend = _bfd_mips_elf_sign_extend (addend, 16);
+ value = symbol + addend;
overflowed_p = mips_elf_overflow_p (value, 16);
break;
@@ -5696,8 +5788,10 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
if (was_local_p)
value = addend | ((p + 4) & (0xfc000000 << shift));
- else
+ else if (howto->partial_inplace)
value = _bfd_mips_elf_sign_extend (addend, 26 + shift);
+ else
+ value = addend;
value = (value + symbol) >> shift;
if (!was_local_p && h->root.root.type != bfd_link_hash_undefweak)
overflowed_p = (value >> 26) != ((p + 4) >> (26 + shift));
@@ -5882,35 +5976,114 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
case R_MIPS_PC16:
case R_MIPS_GNU_REL16_S2:
- value = symbol + _bfd_mips_elf_sign_extend (addend, 18) - p;
+ if (howto->partial_inplace)
+ addend = _bfd_mips_elf_sign_extend (addend, 18);
+
+ if ((symbol + addend) & 3)
+ return bfd_reloc_outofrange;
+
+ value = symbol + addend - p;
overflowed_p = mips_elf_overflow_p (value, 18);
value >>= howto->rightshift;
value &= howto->dst_mask;
break;
+ case R_MIPS_PC21_S2:
+ if (howto->partial_inplace)
+ addend = _bfd_mips_elf_sign_extend (addend, 23);
+
+ if ((symbol + addend) & 3)
+ return bfd_reloc_outofrange;
+
+ value = symbol + addend - p;
+ overflowed_p = mips_elf_overflow_p (value, 23);
+ value >>= howto->rightshift;
+ value &= howto->dst_mask;
+ break;
+
+ case R_MIPS_PC26_S2:
+ if (howto->partial_inplace)
+ addend = _bfd_mips_elf_sign_extend (addend, 28);
+
+ if ((symbol + addend) & 3)
+ return bfd_reloc_outofrange;
+
+ value = symbol + addend - p;
+ overflowed_p = mips_elf_overflow_p (value, 28);
+ value >>= howto->rightshift;
+ value &= howto->dst_mask;
+ break;
+
+ case R_MIPS_PC18_S3:
+ if (howto->partial_inplace)
+ addend = _bfd_mips_elf_sign_extend (addend, 21);
+
+ if ((symbol + addend) & 7)
+ return bfd_reloc_outofrange;
+
+ value = symbol + addend - ((p | 7) ^ 7);
+ overflowed_p = mips_elf_overflow_p (value, 21);
+ value >>= howto->rightshift;
+ value &= howto->dst_mask;
+ break;
+
+ case R_MIPS_PC19_S2:
+ if (howto->partial_inplace)
+ addend = _bfd_mips_elf_sign_extend (addend, 21);
+
+ if ((symbol + addend) & 3)
+ return bfd_reloc_outofrange;
+
+ value = symbol + addend - p;
+ overflowed_p = mips_elf_overflow_p (value, 21);
+ value >>= howto->rightshift;
+ value &= howto->dst_mask;
+ break;
+
+ case R_MIPS_PCHI16:
+ value = mips_elf_high (symbol + addend - p);
+ overflowed_p = mips_elf_overflow_p (value, 16);
+ value &= howto->dst_mask;
+ break;
+
+ case R_MIPS_PCLO16:
+ if (howto->partial_inplace)
+ addend = _bfd_mips_elf_sign_extend (addend, 16);
+ value = symbol + addend - p;
+ value &= howto->dst_mask;
+ break;
+
case R_MICROMIPS_PC7_S1:
- value = symbol + _bfd_mips_elf_sign_extend (addend, 8) - p;
+ if (howto->partial_inplace)
+ addend = _bfd_mips_elf_sign_extend (addend, 8);
+ value = symbol + addend - p;
overflowed_p = mips_elf_overflow_p (value, 8);
value >>= howto->rightshift;
value &= howto->dst_mask;
break;
case R_MICROMIPS_PC10_S1:
- value = symbol + _bfd_mips_elf_sign_extend (addend, 11) - p;
+ if (howto->partial_inplace)
+ addend = _bfd_mips_elf_sign_extend (addend, 11);
+ value = symbol + addend - p;
overflowed_p = mips_elf_overflow_p (value, 11);
value >>= howto->rightshift;
value &= howto->dst_mask;
break;
case R_MICROMIPS_PC16_S1:
- value = symbol + _bfd_mips_elf_sign_extend (addend, 17) - p;
+ if (howto->partial_inplace)
+ addend = _bfd_mips_elf_sign_extend (addend, 17);
+ value = symbol + addend - p;
overflowed_p = mips_elf_overflow_p (value, 17);
value >>= howto->rightshift;
value &= howto->dst_mask;
break;
case R_MICROMIPS_PC23_S2:
- value = symbol + _bfd_mips_elf_sign_extend (addend, 25) - ((p | 3) ^ 3);
+ if (howto->partial_inplace)
+ addend = _bfd_mips_elf_sign_extend (addend, 25);
+ value = symbol + addend - ((p | 3) ^ 3);
overflowed_p = mips_elf_overflow_p (value, 25);
value >>= howto->rightshift;
value &= howto->dst_mask;
@@ -6454,6 +6627,12 @@ _bfd_elf_mips_mach (flagword flags)
case E_MIPS_ARCH_64R2:
return bfd_mach_mipsisa64r2;
+
+ case E_MIPS_ARCH_32R6:
+ return bfd_mach_mipsisa32r6;
+
+ case E_MIPS_ARCH_64R6:
+ return bfd_mach_mipsisa64r6;
}
}
@@ -6899,6 +7078,11 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd,
if (!MIPS_ELF_OPTIONS_SECTION_NAME_P (name))
return FALSE;
break;
+ case SHT_MIPS_ABIFLAGS:
+ if (!MIPS_ELF_ABIFLAGS_SECTION_NAME_P (name))
+ return FALSE;
+ flags = (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_SAME_SIZE);
+ break;
case SHT_MIPS_DWARF:
if (! CONST_STRNEQ (name, ".debug_")
&& ! CONST_STRNEQ (name, ".zdebug_"))
@@ -6929,6 +7113,20 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd,
return FALSE;
}
+ if (hdr->sh_type == SHT_MIPS_ABIFLAGS)
+ {
+ Elf_External_ABIFlags_v0 ext;
+
+ if (! bfd_get_section_contents (abfd, hdr->bfd_section,
+ &ext, 0, sizeof ext))
+ return FALSE;
+ bfd_mips_elf_swap_abiflags_v0_in (abfd, &ext,
+ &mips_elf_tdata (abfd)->abiflags);
+ if (mips_elf_tdata (abfd)->abiflags.version != 0)
+ return FALSE;
+ mips_elf_tdata (abfd)->abiflags_valid = TRUE;
+ }
+
/* FIXME: We should record sh_info for a .gptab section. */
/* For a .reginfo section, set the gp value in the tdata information
@@ -7095,6 +7293,11 @@ _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec)
hdr->sh_entsize = 1;
hdr->sh_flags |= SHF_MIPS_NOSTRIP;
}
+ else if (CONST_STRNEQ (name, ".MIPS.abiflags"))
+ {
+ hdr->sh_type = SHT_MIPS_ABIFLAGS;
+ hdr->sh_entsize = sizeof (Elf_External_ABIFlags_v0);
+ }
else if (CONST_STRNEQ (name, ".debug_")
|| CONST_STRNEQ (name, ".zdebug_"))
{
@@ -7606,6 +7809,8 @@ mips_elf_add_lo16_rel_addend (bfd *abfd,
lo16_type = R_MIPS16_LO16;
else if (micromips_reloc_p (r_type))
lo16_type = R_MICROMIPS_LO16;
+ else if (r_type == R_MIPS_PCHI16)
+ lo16_type = R_MIPS_PCLO16;
else
lo16_type = R_MIPS_LO16;
@@ -8118,6 +8323,8 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_MIPS_26:
case R_MIPS_PC16:
+ case R_MIPS_PC21_S2:
+ case R_MIPS_PC26_S2:
case R_MIPS16_26:
case R_MICROMIPS_26_S1:
case R_MICROMIPS_PC7_S1:
@@ -9014,7 +9221,7 @@ bfd_boolean
_bfd_mips_elf_always_size_sections (bfd *output_bfd,
struct bfd_link_info *info)
{
- asection *ri;
+ asection *sect;
struct mips_elf_link_hash_table *htab;
struct mips_htab_traverse_info hti;
@@ -9022,9 +9229,14 @@ _bfd_mips_elf_always_size_sections (bfd *output_bfd,
BFD_ASSERT (htab != NULL);
/* The .reginfo section has a fixed size. */
- ri = bfd_get_section_by_name (output_bfd, ".reginfo");
- if (ri != NULL)
- bfd_set_section_size (output_bfd, ri, sizeof (Elf32_External_RegInfo));
+ sect = bfd_get_section_by_name (output_bfd, ".reginfo");
+ if (sect != NULL)
+ bfd_set_section_size (output_bfd, sect, sizeof (Elf32_External_RegInfo));
+
+ /* The .MIPS.abiflags section has a fixed size. */
+ sect = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags");
+ if (sect != NULL)
+ bfd_set_section_size (output_bfd, sect, sizeof (Elf_External_ABIFlags_v0));
hti.info = info;
hti.output_bfd = output_bfd;
@@ -9063,13 +9275,13 @@ mips_elf_lay_out_got (bfd *output_bfd, struct bfd_link_info *info)
/* Allocate room for the reserved entries. VxWorks always reserves
3 entries; other objects only reserve 2 entries. */
- BFD_ASSERT (g->assigned_gotno == 0);
+ BFD_ASSERT (g->assigned_low_gotno == 0);
if (htab->is_vxworks)
htab->reserved_gotno = 3;
else
htab->reserved_gotno = 2;
g->local_gotno += htab->reserved_gotno;
- g->assigned_gotno = htab->reserved_gotno;
+ g->assigned_low_gotno = htab->reserved_gotno;
/* Decide which symbols need to go in the global part of the GOT and
count the number of reloc-only GOT symbols. */
@@ -9081,7 +9293,7 @@ mips_elf_lay_out_got (bfd *output_bfd, struct bfd_link_info *info)
/* Calculate the total loadable size of the output. That
will give us the maximum number of GOT_PAGE entries
required. */
- for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link.next)
{
asection *subsection;
@@ -9112,6 +9324,7 @@ mips_elf_lay_out_got (bfd *output_bfd, struct bfd_link_info *info)
page_gotno = g->page_gotno;
g->local_gotno += page_gotno;
+ g->assigned_high_gotno = g->local_gotno - 1;
s->size += g->local_gotno * MIPS_ELF_GOT_SIZE (output_bfd);
s->size += g->global_gotno * MIPS_ELF_GOT_SIZE (output_bfd);
@@ -9129,7 +9342,7 @@ mips_elf_lay_out_got (bfd *output_bfd, struct bfd_link_info *info)
{
/* Record that all bfds use G. This also has the effect of freeing
the per-bfd GOTs, which we no longer need. */
- for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link.next)
if (mips_elf_bfd_got (ibfd, FALSE))
mips_elf_replace_bfd_got (ibfd, g);
mips_elf_replace_bfd_got (output_bfd, g);
@@ -10036,6 +10249,13 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
(info, msg, name, input_bfd, input_section, rel->r_offset);
return FALSE;
}
+ if (aligned_pcrel_reloc_p (howto->type))
+ {
+ msg = _("PC-relative load from unaligned address");
+ info->callbacks->warning
+ (info, msg, name, input_bfd, input_section, rel->r_offset);
+ return FALSE;
+ }
/* Fall through. */
default:
@@ -10325,7 +10545,11 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
load = MIPS_ELF_LOAD_WORD (output_bfd);
/* Fill in the PLT entry itself. */
- plt_entry = mips_exec_plt_entry;
+
+ if (MIPSR6_P (output_bfd))
+ plt_entry = mipsr6_exec_plt_entry;
+ else
+ plt_entry = mips_exec_plt_entry;
bfd_put_32 (output_bfd, plt_entry[0] | got_address_high, loc);
bfd_put_32 (output_bfd, plt_entry[1] | got_address_low | load,
loc + 4);
@@ -11386,10 +11610,14 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
if (! info->shared)
continue;
- while (got_index < g->assigned_gotno)
+ for (; got_index < g->local_gotno; got_index++)
{
+ if (got_index >= g->assigned_low_gotno
+ && got_index <= g->assigned_high_gotno)
+ continue;
+
rel[0].r_offset = rel[1].r_offset = rel[2].r_offset
- = got_index++ * MIPS_ELF_GOT_SIZE (output_bfd);
+ = got_index * MIPS_ELF_GOT_SIZE (output_bfd);
if (!(mips_elf_create_dynamic_relocation
(output_bfd, info, rel, NULL,
bfd_abs_section_ptr,
@@ -11623,7 +11851,7 @@ mips_set_isa_flags (bfd *abfd)
break;
case bfd_mach_mips_loongson_3a:
- val = E_MIPS_ARCH_64 | E_MIPS_MACH_LS3A;
+ val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_LS3A;
break;
case bfd_mach_mips_octeon:
@@ -11648,12 +11876,24 @@ mips_set_isa_flags (bfd *abfd)
break;
case bfd_mach_mipsisa32r2:
+ case bfd_mach_mipsisa32r3:
+ case bfd_mach_mipsisa32r5:
val = E_MIPS_ARCH_32R2;
break;
case bfd_mach_mipsisa64r2:
+ case bfd_mach_mipsisa64r3:
+ case bfd_mach_mipsisa64r5:
val = E_MIPS_ARCH_64R2;
break;
+
+ case bfd_mach_mipsisa32r6:
+ val = E_MIPS_ARCH_32R6;
+ break;
+
+ case bfd_mach_mipsisa64r6:
+ val = E_MIPS_ARCH_64R6;
+ break;
}
elf_elfheader (abfd)->e_flags &= ~(EF_MIPS_ARCH | EF_MIPS_MACH);
elf_elfheader (abfd)->e_flags |= val;
@@ -11762,6 +12002,10 @@ _bfd_mips_elf_additional_program_headers (bfd *abfd,
if (s && (s->flags & SEC_LOAD))
++ret;
+ /* See if we need a PT_MIPS_ABIFLAGS segment. */
+ if (bfd_get_section_by_name (abfd, ".MIPS.abiflags"))
+ ++ret;
+
/* See if we need a PT_MIPS_OPTIONS segment. */
if (IRIX_COMPAT (abfd) == ict_irix6
&& bfd_get_section_by_name (abfd,
@@ -11824,6 +12068,37 @@ _bfd_mips_elf_modify_segment_map (bfd *abfd,
}
}
+ /* If there is a .MIPS.abiflags section, we need a PT_MIPS_ABIFLAGS
+ segment. */
+ s = bfd_get_section_by_name (abfd, ".MIPS.abiflags");
+ if (s != NULL && (s->flags & SEC_LOAD) != 0)
+ {
+ for (m = elf_seg_map (abfd); m != NULL; m = m->next)
+ if (m->p_type == PT_MIPS_ABIFLAGS)
+ break;
+ if (m == NULL)
+ {
+ amt = sizeof *m;
+ m = bfd_zalloc (abfd, amt);
+ if (m == NULL)
+ return FALSE;
+
+ m->p_type = PT_MIPS_ABIFLAGS;
+ m->count = 1;
+ m->sections[0] = s;
+
+ /* We want to put it after the PHDR and INTERP segments. */
+ pm = &elf_seg_map (abfd);
+ while (*pm != NULL
+ && ((*pm)->p_type == PT_PHDR
+ || (*pm)->p_type == PT_INTERP))
+ pm = &(*pm)->next;
+
+ m->next = *pm;
+ *pm = m;
+ }
+ }
+
/* For IRIX 6, we don't have .mdebug sections, nor does anything but
.dynamic end up in PT_DYNAMIC. However, we do have to insert a
PT_MIPS_OPTIONS segment immediately following the program header
@@ -11918,18 +12193,6 @@ _bfd_mips_elf_modify_segment_map (bfd *abfd,
if ((*pm)->p_type == PT_DYNAMIC)
break;
m = *pm;
- if (m != NULL && IRIX_COMPAT (abfd) == ict_none)
- {
- /* For a normal mips executable the permissions for the PT_DYNAMIC
- segment are read, write and execute. We do that here since
- the code in elf.c sets only the read permission. This matters
- sometimes for the dynamic linker. */
- if (bfd_get_section_by_name (abfd, ".dynamic") != NULL)
- {
- m->p_flags = PF_R | PF_W | PF_X;
- m->p_flags_valid = 1;
- }
- }
/* GNU/Linux binaries do not need the extended PT_DYNAMIC section.
glibc's dynamic linker has traditionally derived the number of
tags from the p_filesz field, and sometimes allocates stack
@@ -12119,6 +12382,36 @@ _bfd_mips_elf_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED,
return TRUE;
}
+
+/* Prevent .MIPS.abiflags from being discarded with --gc-sections. */
+
+bfd_boolean
+_bfd_mips_elf_gc_mark_extra_sections (struct bfd_link_info *info,
+ elf_gc_mark_hook_fn gc_mark_hook)
+{
+ bfd *sub;
+
+ _bfd_elf_gc_mark_extra_sections (info, gc_mark_hook);
+
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
+ {
+ asection *o;
+
+ if (! is_mips_elf (sub))
+ continue;
+
+ for (o = sub->sections; o != NULL; o = o->next)
+ if (!o->gc_mark
+ && MIPS_ELF_ABIFLAGS_SECTION_NAME_P
+ (bfd_get_section_name (sub, o)))
+ {
+ if (!_bfd_elf_gc_mark (info, o, gc_mark_hook))
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
/* Copy data from a MIPS ELF indirect symbol to its direct symbol,
hiding the old indirect symbol. Process additional relocation
@@ -12226,6 +12519,8 @@ _bfd_mips_elf_discard_info (bfd *abfd, struct elf_reloc_cookie *cookie,
if (skip != 0)
{
mips_elf_section_data (o)->u.tdata = tdata;
+ if (o->rawsize == 0)
+ o->rawsize = o->size;
o->size -= skip * PDR_SIZE;
ret = TRUE;
}
@@ -12296,24 +12591,26 @@ struct mips_elf_find_line
};
bfd_boolean
-_bfd_mips_elf_find_nearest_line (bfd *abfd, asection *section,
- asymbol **symbols, bfd_vma offset,
+_bfd_mips_elf_find_nearest_line (bfd *abfd, asymbol **symbols,
+ asection *section, bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr,
- unsigned int *line_ptr)
+ unsigned int *line_ptr,
+ unsigned int *discriminator_ptr)
{
asection *msec;
- if (_bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset,
+ if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset,
filename_ptr, functionname_ptr,
- line_ptr))
+ line_ptr, discriminator_ptr,
+ dwarf_debug_sections,
+ ABI_64_P (abfd) ? 8 : 0,
+ &elf_tdata (abfd)->dwarf2_find_line_info))
return TRUE;
- if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections,
- section, symbols, offset,
+ if (_bfd_dwarf1_find_nearest_line (abfd, symbols, section, offset,
filename_ptr, functionname_ptr,
- line_ptr, NULL, ABI_64_P (abfd) ? 8 : 0,
- &elf_tdata (abfd)->dwarf2_find_line_info))
+ line_ptr))
return TRUE;
msec = bfd_get_section_by_name (abfd, ".mdebug");
@@ -12392,9 +12689,9 @@ _bfd_mips_elf_find_nearest_line (bfd *abfd, asection *section,
/* Fall back on the generic ELF find_nearest_line routine. */
- return _bfd_elf_find_nearest_line (abfd, section, symbols, offset,
+ return _bfd_elf_find_nearest_line (abfd, symbols, section, offset,
filename_ptr, functionname_ptr,
- line_ptr);
+ line_ptr, discriminator_ptr);
}
bfd_boolean
@@ -13569,6 +13866,179 @@ _bfd_mips_elf_insn32 (struct bfd_link_info *info, bfd_boolean on)
mips_elf_hash_table (info)->insn32 = on;
}
+/* Return the .MIPS.abiflags value representing each ISA Extension. */
+
+unsigned int
+bfd_mips_isa_ext (bfd *abfd)
+{
+ switch (bfd_get_mach (abfd))
+ {
+ case bfd_mach_mips3900:
+ return AFL_EXT_3900;
+ case bfd_mach_mips4010:
+ return AFL_EXT_4010;
+ case bfd_mach_mips4100:
+ return AFL_EXT_4100;
+ case bfd_mach_mips4111:
+ return AFL_EXT_4111;
+ case bfd_mach_mips4120:
+ return AFL_EXT_4120;
+ case bfd_mach_mips4650:
+ return AFL_EXT_4650;
+ case bfd_mach_mips5400:
+ return AFL_EXT_5400;
+ case bfd_mach_mips5500:
+ return AFL_EXT_5500;
+ case bfd_mach_mips5900:
+ return AFL_EXT_5900;
+ case bfd_mach_mips10000:
+ return AFL_EXT_10000;
+ case bfd_mach_mips_loongson_2e:
+ return AFL_EXT_LOONGSON_2E;
+ case bfd_mach_mips_loongson_2f:
+ return AFL_EXT_LOONGSON_2F;
+ case bfd_mach_mips_loongson_3a:
+ return AFL_EXT_LOONGSON_3A;
+ case bfd_mach_mips_sb1:
+ return AFL_EXT_SB1;
+ case bfd_mach_mips_octeon:
+ return AFL_EXT_OCTEON;
+ case bfd_mach_mips_octeonp:
+ return AFL_EXT_OCTEONP;
+ case bfd_mach_mips_octeon2:
+ return AFL_EXT_OCTEON2;
+ case bfd_mach_mips_xlr:
+ return AFL_EXT_XLR;
+ }
+ return 0;
+}
+
+/* Update the isa_level, isa_rev, isa_ext fields of abiflags. */
+
+static void
+update_mips_abiflags_isa (bfd *abfd, Elf_Internal_ABIFlags_v0 *abiflags)
+{
+ switch (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH)
+ {
+ case E_MIPS_ARCH_1:
+ abiflags->isa_level = 1;
+ abiflags->isa_rev = 0;
+ break;
+ case E_MIPS_ARCH_2:
+ abiflags->isa_level = 2;
+ abiflags->isa_rev = 0;
+ break;
+ case E_MIPS_ARCH_3:
+ abiflags->isa_level = 3;
+ abiflags->isa_rev = 0;
+ break;
+ case E_MIPS_ARCH_4:
+ abiflags->isa_level = 4;
+ abiflags->isa_rev = 0;
+ break;
+ case E_MIPS_ARCH_5:
+ abiflags->isa_level = 5;
+ abiflags->isa_rev = 0;
+ break;
+ case E_MIPS_ARCH_32:
+ abiflags->isa_level = 32;
+ abiflags->isa_rev = 1;
+ break;
+ case E_MIPS_ARCH_32R2:
+ abiflags->isa_level = 32;
+ /* Handle MIPS32r3 and MIPS32r5 which do not have a header flag. */
+ if (abiflags->isa_rev < 2)
+ abiflags->isa_rev = 2;
+ break;
+ case E_MIPS_ARCH_32R6:
+ abiflags->isa_level = 32;
+ abiflags->isa_rev = 6;
+ break;
+ case E_MIPS_ARCH_64:
+ abiflags->isa_level = 64;
+ abiflags->isa_rev = 1;
+ break;
+ case E_MIPS_ARCH_64R2:
+ /* Handle MIPS64r3 and MIPS64r5 which do not have a header flag. */
+ abiflags->isa_level = 64;
+ if (abiflags->isa_rev < 2)
+ abiflags->isa_rev = 2;
+ break;
+ case E_MIPS_ARCH_64R6:
+ abiflags->isa_level = 64;
+ abiflags->isa_rev = 6;
+ break;
+ default:
+ (*_bfd_error_handler)
+ (_("%B: Unknown architecture %s"),
+ abfd, bfd_printable_name (abfd));
+ }
+
+ abiflags->isa_ext = bfd_mips_isa_ext (abfd);
+}
+
+/* Return true if the given ELF header flags describe a 32-bit binary. */
+
+static bfd_boolean
+mips_32bit_flags_p (flagword flags)
+{
+ return ((flags & EF_MIPS_32BITMODE) != 0
+ || (flags & EF_MIPS_ABI) == E_MIPS_ABI_O32
+ || (flags & EF_MIPS_ABI) == E_MIPS_ABI_EABI32
+ || (flags & EF_MIPS_ARCH) == E_MIPS_ARCH_1
+ || (flags & EF_MIPS_ARCH) == E_MIPS_ARCH_2
+ || (flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32
+ || (flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32R2
+ || (flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32R6);
+}
+
+/* Infer the content of the ABI flags based on the elf header. */
+
+static void
+infer_mips_abiflags (bfd *abfd, Elf_Internal_ABIFlags_v0* abiflags)
+{
+ obj_attribute *in_attr;
+
+ memset (abiflags, 0, sizeof (Elf_Internal_ABIFlags_v0));
+ update_mips_abiflags_isa (abfd, abiflags);
+
+ if (mips_32bit_flags_p (elf_elfheader (abfd)->e_flags))
+ abiflags->gpr_size = AFL_REG_32;
+ else
+ abiflags->gpr_size = AFL_REG_64;
+
+ abiflags->cpr1_size = AFL_REG_NONE;
+
+ in_attr = elf_known_obj_attributes (abfd)[OBJ_ATTR_GNU];
+ abiflags->fp_abi = in_attr[Tag_GNU_MIPS_ABI_FP].i;
+
+ if (abiflags->fp_abi == Val_GNU_MIPS_ABI_FP_SINGLE
+ || abiflags->fp_abi == Val_GNU_MIPS_ABI_FP_XX
+ || (abiflags->fp_abi == Val_GNU_MIPS_ABI_FP_DOUBLE
+ && abiflags->gpr_size == AFL_REG_32))
+ abiflags->cpr1_size = AFL_REG_32;
+ else if (abiflags->fp_abi == Val_GNU_MIPS_ABI_FP_DOUBLE
+ || abiflags->fp_abi == Val_GNU_MIPS_ABI_FP_64
+ || abiflags->fp_abi == Val_GNU_MIPS_ABI_FP_64A)
+ abiflags->cpr1_size = AFL_REG_64;
+
+ abiflags->cpr2_size = AFL_REG_NONE;
+
+ if (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH_ASE_MDMX)
+ abiflags->ases |= AFL_ASE_MDMX;
+ if (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH_ASE_M16)
+ abiflags->ases |= AFL_ASE_MIPS16;
+ if (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH_ASE_MICROMIPS)
+ abiflags->ases |= AFL_ASE_MICROMIPS;
+
+ if (abiflags->fp_abi != Val_GNU_MIPS_ABI_FP_ANY
+ && abiflags->fp_abi != Val_GNU_MIPS_ABI_FP_SOFT
+ && abiflags->fp_abi != Val_GNU_MIPS_ABI_FP_64A
+ && abiflags->isa_level >= 32
+ && abiflags->isa_ext != AFL_EXT_LOONGSON_3A)
+ abiflags->flags1 |= AFL_FLAGS1_ODDSPREG;
+}
+
/* We need to use a special link routine to handle the .reginfo and
the .mdebug sections. We need to merge all instances of these
sections together, not write them all out sequentially. */
@@ -13579,7 +14049,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
asection *o;
struct bfd_link_order *p;
asection *reginfo_sec, *mdebug_sec, *gptab_data_sec, *gptab_bss_sec;
- asection *rtproc_sec;
+ asection *rtproc_sec, *abiflags_sec;
Elf32_RegInfo reginfo;
struct ecoff_debug_info debug;
struct mips_htab_traverse_info hti;
@@ -13661,12 +14131,46 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
/* Go through the sections and collect the .reginfo and .mdebug
information. */
+ abiflags_sec = NULL;
reginfo_sec = NULL;
mdebug_sec = NULL;
gptab_data_sec = NULL;
gptab_bss_sec = NULL;
for (o = abfd->sections; o != NULL; o = o->next)
{
+ if (strcmp (o->name, ".MIPS.abiflags") == 0)
+ {
+ /* We have found the .MIPS.abiflags section in the output file.
+ Look through all the link_orders comprising it and remove them.
+ The data is merged in _bfd_mips_elf_merge_private_bfd_data. */
+ for (p = o->map_head.link_order; p != NULL; p = p->next)
+ {
+ asection *input_section;
+
+ if (p->type != bfd_indirect_link_order)
+ {
+ if (p->type == bfd_data_link_order)
+ continue;
+ abort ();
+ }
+
+ input_section = p->u.indirect.section;
+
+ /* Hack: reset the SEC_HAS_CONTENTS flag so that
+ elf_link_input_bfd ignores this section. */
+ input_section->flags &= ~SEC_HAS_CONTENTS;
+ }
+
+ /* Size has been set in _bfd_mips_elf_always_size_sections. */
+ BFD_ASSERT(o->size == sizeof (Elf_External_ABIFlags_v0));
+
+ /* Skip this section later on (I don't think this currently
+ matters, but someday it might). */
+ o->map_head.link_order = NULL;
+
+ abiflags_sec = o;
+ }
+
if (strcmp (o->name, ".reginfo") == 0)
{
memset (&reginfo, 0, sizeof reginfo);
@@ -14151,6 +14655,24 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
/* Now write out the computed sections. */
+ if (abiflags_sec != NULL)
+ {
+ Elf_External_ABIFlags_v0 ext;
+ Elf_Internal_ABIFlags_v0 *abiflags;
+
+ abiflags = &mips_elf_tdata (abfd)->abiflags;
+
+ /* Set up the abiflags if no valid input sections were found. */
+ if (!mips_elf_tdata (abfd)->abiflags_valid)
+ {
+ infer_mips_abiflags (abfd, abiflags);
+ mips_elf_tdata (abfd)->abiflags_valid = TRUE;
+ }
+ bfd_mips_elf_swap_abiflags_v0_out (abfd, abiflags, &ext);
+ if (! bfd_set_section_contents (abfd, abiflags_sec, &ext, 0, sizeof ext))
+ return FALSE;
+ }
+
if (reginfo_sec != NULL)
{
Elf32_External_RegInfo ext;
@@ -14219,12 +14741,12 @@ static const struct mips_mach_extension mips_mach_extensions[] =
{ bfd_mach_mips_octeon2, bfd_mach_mips_octeonp },
{ bfd_mach_mips_octeonp, bfd_mach_mips_octeon },
{ bfd_mach_mips_octeon, bfd_mach_mipsisa64r2 },
+ { bfd_mach_mips_loongson_3a, bfd_mach_mipsisa64r2 },
/* MIPS64 extensions. */
{ bfd_mach_mipsisa64r2, bfd_mach_mipsisa64 },
{ bfd_mach_mips_sb1, bfd_mach_mipsisa64 },
{ bfd_mach_mips_xlr, bfd_mach_mipsisa64 },
- { bfd_mach_mips_loongson_3a, bfd_mach_mipsisa64 },
/* MIPS V extensions. */
{ bfd_mach_mipsisa64, bfd_mach_mips5 },
@@ -14308,21 +14830,6 @@ mips_mach_extends_p (unsigned long base, unsigned long extension)
}
-/* Return true if the given ELF header flags describe a 32-bit binary. */
-
-static bfd_boolean
-mips_32bit_flags_p (flagword flags)
-{
- return ((flags & EF_MIPS_32BITMODE) != 0
- || (flags & EF_MIPS_ABI) == E_MIPS_ABI_O32
- || (flags & EF_MIPS_ABI) == E_MIPS_ABI_EABI32
- || (flags & EF_MIPS_ARCH) == E_MIPS_ARCH_1
- || (flags & EF_MIPS_ARCH) == E_MIPS_ARCH_2
- || (flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32
- || (flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32R2);
-}
-
-
/* Merge object attributes from IBFD into OBFD. Raise an error if
there are conflicting attributes. */
static bfd_boolean
@@ -14360,176 +14867,71 @@ mips_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
out_attr = elf_known_obj_attributes (obfd)[OBJ_ATTR_GNU];
if (in_attr[Tag_GNU_MIPS_ABI_FP].i != out_attr[Tag_GNU_MIPS_ABI_FP].i)
{
- out_attr[Tag_GNU_MIPS_ABI_FP].type = 1;
- if (out_attr[Tag_GNU_MIPS_ABI_FP].i == Val_GNU_MIPS_ABI_FP_ANY)
- out_attr[Tag_GNU_MIPS_ABI_FP].i = in_attr[Tag_GNU_MIPS_ABI_FP].i;
- else if (in_attr[Tag_GNU_MIPS_ABI_FP].i != Val_GNU_MIPS_ABI_FP_ANY)
- switch (out_attr[Tag_GNU_MIPS_ABI_FP].i)
- {
- case Val_GNU_MIPS_ABI_FP_DOUBLE:
- switch (in_attr[Tag_GNU_MIPS_ABI_FP].i)
- {
- case Val_GNU_MIPS_ABI_FP_SINGLE:
- _bfd_error_handler
- (_("Warning: %B uses %s (set by %B), %B uses %s"),
- obfd, abi_fp_bfd, ibfd, "-mdouble-float", "-msingle-float");
- break;
-
- case Val_GNU_MIPS_ABI_FP_SOFT:
- _bfd_error_handler
- (_("Warning: %B uses %s (set by %B), %B uses %s"),
- obfd, abi_fp_bfd, ibfd, "-mhard-float", "-msoft-float");
- break;
-
- case Val_GNU_MIPS_ABI_FP_64:
- _bfd_error_handler
- (_("Warning: %B uses %s (set by %B), %B uses %s"),
- obfd, abi_fp_bfd, ibfd,
- "-mdouble-float", "-mips32r2 -mfp64");
- break;
-
- default:
- _bfd_error_handler
- (_("Warning: %B uses %s (set by %B), "
- "%B uses unknown floating point ABI %d"),
- obfd, abi_fp_bfd, ibfd,
- "-mdouble-float", in_attr[Tag_GNU_MIPS_ABI_FP].i);
- break;
- }
- break;
-
- case Val_GNU_MIPS_ABI_FP_SINGLE:
- switch (in_attr[Tag_GNU_MIPS_ABI_FP].i)
- {
- case Val_GNU_MIPS_ABI_FP_DOUBLE:
- _bfd_error_handler
- (_("Warning: %B uses %s (set by %B), %B uses %s"),
- obfd, abi_fp_bfd, ibfd, "-msingle-float", "-mdouble-float");
- break;
-
- case Val_GNU_MIPS_ABI_FP_SOFT:
- _bfd_error_handler
- (_("Warning: %B uses %s (set by %B), %B uses %s"),
- obfd, abi_fp_bfd, ibfd, "-mhard-float", "-msoft-float");
- break;
-
- case Val_GNU_MIPS_ABI_FP_64:
- _bfd_error_handler
- (_("Warning: %B uses %s (set by %B), %B uses %s"),
- obfd, abi_fp_bfd, ibfd,
- "-msingle-float", "-mips32r2 -mfp64");
- break;
-
- default:
- _bfd_error_handler
- (_("Warning: %B uses %s (set by %B), "
- "%B uses unknown floating point ABI %d"),
- obfd, abi_fp_bfd, ibfd,
- "-msingle-float", in_attr[Tag_GNU_MIPS_ABI_FP].i);
- break;
- }
- break;
-
- case Val_GNU_MIPS_ABI_FP_SOFT:
- switch (in_attr[Tag_GNU_MIPS_ABI_FP].i)
- {
- case Val_GNU_MIPS_ABI_FP_DOUBLE:
- case Val_GNU_MIPS_ABI_FP_SINGLE:
- case Val_GNU_MIPS_ABI_FP_64:
- _bfd_error_handler
- (_("Warning: %B uses %s (set by %B), %B uses %s"),
- obfd, abi_fp_bfd, ibfd, "-msoft-float", "-mhard-float");
- break;
-
- default:
- _bfd_error_handler
- (_("Warning: %B uses %s (set by %B), "
- "%B uses unknown floating point ABI %d"),
- obfd, abi_fp_bfd, ibfd,
- "-msoft-float", in_attr[Tag_GNU_MIPS_ABI_FP].i);
- break;
- }
- break;
-
- case Val_GNU_MIPS_ABI_FP_64:
- switch (in_attr[Tag_GNU_MIPS_ABI_FP].i)
- {
- case Val_GNU_MIPS_ABI_FP_DOUBLE:
- _bfd_error_handler
- (_("Warning: %B uses %s (set by %B), %B uses %s"),
- obfd, abi_fp_bfd, ibfd,
- "-mips32r2 -mfp64", "-mdouble-float");
- break;
-
- case Val_GNU_MIPS_ABI_FP_SINGLE:
- _bfd_error_handler
- (_("Warning: %B uses %s (set by %B), %B uses %s"),
- obfd, abi_fp_bfd, ibfd,
- "-mips32r2 -mfp64", "-msingle-float");
- break;
-
- case Val_GNU_MIPS_ABI_FP_SOFT:
- _bfd_error_handler
- (_("Warning: %B uses %s (set by %B), %B uses %s"),
- obfd, abi_fp_bfd, ibfd, "-mhard-float", "-msoft-float");
- break;
-
- default:
- _bfd_error_handler
- (_("Warning: %B uses %s (set by %B), "
- "%B uses unknown floating point ABI %d"),
- obfd, abi_fp_bfd, ibfd,
- "-mips32r2 -mfp64", in_attr[Tag_GNU_MIPS_ABI_FP].i);
- break;
- }
- break;
-
- default:
- switch (in_attr[Tag_GNU_MIPS_ABI_FP].i)
- {
- case Val_GNU_MIPS_ABI_FP_DOUBLE:
- _bfd_error_handler
- (_("Warning: %B uses unknown floating point ABI %d "
- "(set by %B), %B uses %s"),
- obfd, abi_fp_bfd, ibfd,
- out_attr[Tag_GNU_MIPS_ABI_FP].i, "-mdouble-float");
- break;
-
- case Val_GNU_MIPS_ABI_FP_SINGLE:
- _bfd_error_handler
- (_("Warning: %B uses unknown floating point ABI %d "
- "(set by %B), %B uses %s"),
- obfd, abi_fp_bfd, ibfd,
- out_attr[Tag_GNU_MIPS_ABI_FP].i, "-msingle-float");
- break;
+ int out_fp, in_fp;
- case Val_GNU_MIPS_ABI_FP_SOFT:
- _bfd_error_handler
- (_("Warning: %B uses unknown floating point ABI %d "
- "(set by %B), %B uses %s"),
- obfd, abi_fp_bfd, ibfd,
- out_attr[Tag_GNU_MIPS_ABI_FP].i, "-msoft-float");
- break;
-
- case Val_GNU_MIPS_ABI_FP_64:
- _bfd_error_handler
- (_("Warning: %B uses unknown floating point ABI %d "
- "(set by %B), %B uses %s"),
- obfd, abi_fp_bfd, ibfd,
- out_attr[Tag_GNU_MIPS_ABI_FP].i, "-mips32r2 -mfp64");
- break;
-
- default:
- _bfd_error_handler
- (_("Warning: %B uses unknown floating point ABI %d "
- "(set by %B), %B uses unknown floating point ABI %d"),
- obfd, abi_fp_bfd, ibfd,
- out_attr[Tag_GNU_MIPS_ABI_FP].i,
- in_attr[Tag_GNU_MIPS_ABI_FP].i);
- break;
- }
- break;
- }
+ out_fp = out_attr[Tag_GNU_MIPS_ABI_FP].i;
+ in_fp = in_attr[Tag_GNU_MIPS_ABI_FP].i;
+ out_attr[Tag_GNU_MIPS_ABI_FP].type = 1;
+ if (out_fp == Val_GNU_MIPS_ABI_FP_ANY)
+ out_attr[Tag_GNU_MIPS_ABI_FP].i = in_fp;
+ else if (out_fp == Val_GNU_MIPS_ABI_FP_XX
+ && (in_fp == Val_GNU_MIPS_ABI_FP_DOUBLE
+ || in_fp == Val_GNU_MIPS_ABI_FP_64
+ || in_fp == Val_GNU_MIPS_ABI_FP_64A))
+ {
+ mips_elf_tdata (obfd)->abi_fp_bfd = ibfd;
+ out_attr[Tag_GNU_MIPS_ABI_FP].i = in_attr[Tag_GNU_MIPS_ABI_FP].i;
+ }
+ else if (in_fp == Val_GNU_MIPS_ABI_FP_XX
+ && (out_fp == Val_GNU_MIPS_ABI_FP_DOUBLE
+ || out_fp == Val_GNU_MIPS_ABI_FP_64
+ || out_fp == Val_GNU_MIPS_ABI_FP_64A))
+ /* Keep the current setting. */;
+ else if (out_fp == Val_GNU_MIPS_ABI_FP_64A
+ && in_fp == Val_GNU_MIPS_ABI_FP_64)
+ {
+ mips_elf_tdata (obfd)->abi_fp_bfd = ibfd;
+ out_attr[Tag_GNU_MIPS_ABI_FP].i = in_attr[Tag_GNU_MIPS_ABI_FP].i;
+ }
+ else if (in_fp == Val_GNU_MIPS_ABI_FP_64A
+ && out_fp == Val_GNU_MIPS_ABI_FP_64)
+ /* Keep the current setting. */;
+ else if (in_fp != Val_GNU_MIPS_ABI_FP_ANY)
+ {
+ const char *out_string, *in_string;
+
+ out_string = _bfd_mips_fp_abi_string (out_fp);
+ in_string = _bfd_mips_fp_abi_string (in_fp);
+ /* First warn about cases involving unrecognised ABIs. */
+ if (!out_string && !in_string)
+ _bfd_error_handler
+ (_("Warning: %B uses unknown floating point ABI %d "
+ "(set by %B), %B uses unknown floating point ABI %d"),
+ obfd, abi_fp_bfd, ibfd, out_fp, in_fp);
+ else if (!out_string)
+ _bfd_error_handler
+ (_("Warning: %B uses unknown floating point ABI %d "
+ "(set by %B), %B uses %s"),
+ obfd, abi_fp_bfd, ibfd, out_fp, in_string);
+ else if (!in_string)
+ _bfd_error_handler
+ (_("Warning: %B uses %s (set by %B), "
+ "%B uses unknown floating point ABI %d"),
+ obfd, abi_fp_bfd, ibfd, out_string, in_fp);
+ else
+ {
+ /* If one of the bfds is soft-float, the other must be
+ hard-float. The exact choice of hard-float ABI isn't
+ really relevant to the error message. */
+ if (in_fp == Val_GNU_MIPS_ABI_FP_SOFT)
+ out_string = "-mhard-float";
+ else if (out_fp == Val_GNU_MIPS_ABI_FP_SOFT)
+ in_string = "-mhard-float";
+ _bfd_error_handler
+ (_("Warning: %B uses %s (set by %B), %B uses %s"),
+ obfd, abi_fp_bfd, ibfd, out_string, in_string);
+ }
+ }
}
/* Check for conflicting Tag_GNU_MIPS_ABI_MSA attributes and merge
@@ -14590,6 +14992,7 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
bfd_boolean ok;
bfd_boolean null_input_bfd = TRUE;
asection *sec;
+ obj_attribute *out_attr;
/* Check if we have the same endianness. */
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
@@ -14611,17 +15014,98 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
return FALSE;
}
+ /* Set up the FP ABI attribute from the abiflags if it is not already
+ set. */
+ if (mips_elf_tdata (ibfd)->abiflags_valid)
+ {
+ obj_attribute *in_attr = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU];
+ if (in_attr[Tag_GNU_MIPS_ABI_FP].i == Val_GNU_MIPS_ABI_FP_ANY)
+ in_attr[Tag_GNU_MIPS_ABI_FP].i =
+ mips_elf_tdata (ibfd)->abiflags.fp_abi;
+ }
+
if (!mips_elf_merge_obj_attributes (ibfd, obfd))
return FALSE;
- new_flags = elf_elfheader (ibfd)->e_flags;
- elf_elfheader (obfd)->e_flags |= new_flags & EF_MIPS_NOREORDER;
- old_flags = elf_elfheader (obfd)->e_flags;
+ /* Check to see if the input BFD actually contains any sections.
+ If not, its flags may not have been initialised either, but it cannot
+ actually cause any incompatibility. */
+ for (sec = ibfd->sections; sec != NULL; sec = sec->next)
+ {
+ /* Ignore synthetic sections and empty .text, .data and .bss sections
+ which are automatically generated by gas. Also ignore fake
+ (s)common sections, since merely defining a common symbol does
+ not affect compatibility. */
+ if ((sec->flags & SEC_IS_COMMON) == 0
+ && strcmp (sec->name, ".reginfo")
+ && strcmp (sec->name, ".mdebug")
+ && (sec->size != 0
+ || (strcmp (sec->name, ".text")
+ && strcmp (sec->name, ".data")
+ && strcmp (sec->name, ".bss"))))
+ {
+ null_input_bfd = FALSE;
+ break;
+ }
+ }
+ if (null_input_bfd)
+ return TRUE;
+
+ /* Populate abiflags using existing information. */
+ if (!mips_elf_tdata (ibfd)->abiflags_valid)
+ {
+ infer_mips_abiflags (ibfd, &mips_elf_tdata (ibfd)->abiflags);
+ mips_elf_tdata (ibfd)->abiflags_valid = TRUE;
+ }
+ else
+ {
+ Elf_Internal_ABIFlags_v0 abiflags;
+ Elf_Internal_ABIFlags_v0 in_abiflags;
+ infer_mips_abiflags (ibfd, &abiflags);
+ in_abiflags = mips_elf_tdata (ibfd)->abiflags;
+
+ /* It is not possible to infer the correct ISA revision
+ for R3 or R5 so drop down to R2 for the checks. */
+ if (in_abiflags.isa_rev == 3 || in_abiflags.isa_rev == 5)
+ in_abiflags.isa_rev = 2;
+
+ if (in_abiflags.isa_level != abiflags.isa_level
+ || in_abiflags.isa_rev != abiflags.isa_rev
+ || in_abiflags.isa_ext != abiflags.isa_ext)
+ (*_bfd_error_handler)
+ (_("%B: warning: Inconsistent ISA between e_flags and "
+ ".MIPS.abiflags"), ibfd);
+ if (abiflags.fp_abi != Val_GNU_MIPS_ABI_FP_ANY
+ && in_abiflags.fp_abi != abiflags.fp_abi)
+ (*_bfd_error_handler)
+ (_("%B: warning: Inconsistent FP ABI between e_flags and "
+ ".MIPS.abiflags"), ibfd);
+ if ((in_abiflags.ases & abiflags.ases) != abiflags.ases)
+ (*_bfd_error_handler)
+ (_("%B: warning: Inconsistent ASEs between e_flags and "
+ ".MIPS.abiflags"), ibfd);
+ if (in_abiflags.isa_ext != abiflags.isa_ext)
+ (*_bfd_error_handler)
+ (_("%B: warning: Inconsistent ISA extensions between e_flags and "
+ ".MIPS.abiflags"), ibfd);
+ if (in_abiflags.flags2 != 0)
+ (*_bfd_error_handler)
+ (_("%B: warning: Unexpected flag in the flags2 field of "
+ ".MIPS.abiflags (0x%lx)"), ibfd,
+ (unsigned long) in_abiflags.flags2);
+ }
+
+ if (!mips_elf_tdata (obfd)->abiflags_valid)
+ {
+ /* Copy input abiflags if output abiflags are not already valid. */
+ mips_elf_tdata (obfd)->abiflags = mips_elf_tdata (ibfd)->abiflags;
+ mips_elf_tdata (obfd)->abiflags_valid = TRUE;
+ }
if (! elf_flags_init (obfd))
{
elf_flags_init (obfd) = TRUE;
- elf_elfheader (obfd)->e_flags = new_flags;
+ elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
elf_elfheader (obfd)->e_ident[EI_CLASS]
= elf_elfheader (ibfd)->e_ident[EI_CLASS];
@@ -14633,11 +15117,42 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
if (! bfd_set_arch_mach (obfd, bfd_get_arch (ibfd),
bfd_get_mach (ibfd)))
return FALSE;
+
+ /* Update the ABI flags isa_level, isa_rev and isa_ext fields. */
+ update_mips_abiflags_isa (obfd, &mips_elf_tdata (obfd)->abiflags);
}
return TRUE;
}
+ /* Update the output abiflags fp_abi using the computed fp_abi. */
+ out_attr = elf_known_obj_attributes (obfd)[OBJ_ATTR_GNU];
+ mips_elf_tdata (obfd)->abiflags.fp_abi = out_attr[Tag_GNU_MIPS_ABI_FP].i;
+
+#define max(a,b) ((a) > (b) ? (a) : (b))
+ /* Merge abiflags. */
+ mips_elf_tdata (obfd)->abiflags.isa_rev
+ = max (mips_elf_tdata (obfd)->abiflags.isa_rev,
+ mips_elf_tdata (ibfd)->abiflags.isa_rev);
+ mips_elf_tdata (obfd)->abiflags.gpr_size
+ = max (mips_elf_tdata (obfd)->abiflags.gpr_size,
+ mips_elf_tdata (ibfd)->abiflags.gpr_size);
+ mips_elf_tdata (obfd)->abiflags.cpr1_size
+ = max (mips_elf_tdata (obfd)->abiflags.cpr1_size,
+ mips_elf_tdata (ibfd)->abiflags.cpr1_size);
+ mips_elf_tdata (obfd)->abiflags.cpr2_size
+ = max (mips_elf_tdata (obfd)->abiflags.cpr2_size,
+ mips_elf_tdata (ibfd)->abiflags.cpr2_size);
+#undef max
+ mips_elf_tdata (obfd)->abiflags.ases
+ |= mips_elf_tdata (ibfd)->abiflags.ases;
+ mips_elf_tdata (obfd)->abiflags.flags1
+ |= mips_elf_tdata (ibfd)->abiflags.flags1;
+
+ new_flags = elf_elfheader (ibfd)->e_flags;
+ elf_elfheader (obfd)->e_flags |= new_flags & EF_MIPS_NOREORDER;
+ old_flags = elf_elfheader (obfd)->e_flags;
+
/* Check flag compatibility. */
new_flags &= ~EF_MIPS_NOREORDER;
@@ -14660,30 +15175,6 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
if (new_flags == old_flags)
return TRUE;
- /* Check to see if the input BFD actually contains any sections.
- If not, its flags may not have been initialised either, but it cannot
- actually cause any incompatibility. */
- for (sec = ibfd->sections; sec != NULL; sec = sec->next)
- {
- /* Ignore synthetic sections and empty .text, .data and .bss sections
- which are automatically generated by gas. Also ignore fake
- (s)common sections, since merely defining a common symbol does
- not affect compatibility. */
- if ((sec->flags & SEC_IS_COMMON) == 0
- && strcmp (sec->name, ".reginfo")
- && strcmp (sec->name, ".mdebug")
- && (sec->size != 0
- || (strcmp (sec->name, ".text")
- && strcmp (sec->name, ".data")
- && strcmp (sec->name, ".bss"))))
- {
- null_input_bfd = FALSE;
- break;
- }
- }
- if (null_input_bfd)
- return TRUE;
-
ok = TRUE;
if (((new_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0)
@@ -14724,6 +15215,9 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
elf_elfheader (obfd)->e_flags
|= new_flags & (EF_MIPS_ARCH | EF_MIPS_MACH | EF_MIPS_32BITMODE);
+ /* Update the ABI flags isa_level, isa_rev, isa_ext fields. */
+ update_mips_abiflags_isa (obfd, &mips_elf_tdata (obfd)->abiflags);
+
/* Copy across the ABI flags if OBFD doesn't use them
and if that was what caused us to treat IBFD as 32-bit. */
if ((old_flags & EF_MIPS_ABI) == 0
@@ -14809,6 +15303,20 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
old_flags &= ~EF_MIPS_NAN2008;
}
+ /* Compare FP64 state. */
+ if ((new_flags & EF_MIPS_FP64) != (old_flags & EF_MIPS_FP64))
+ {
+ _bfd_error_handler (_("%B: linking %s module with previous %s modules"),
+ ibfd,
+ (new_flags & EF_MIPS_FP64
+ ? "-mfp64" : "-mfp32"),
+ (old_flags & EF_MIPS_FP64
+ ? "-mfp64" : "-mfp32"));
+ ok = FALSE;
+ new_flags &= ~EF_MIPS_FP64;
+ old_flags &= ~EF_MIPS_FP64;
+ }
+
/* Warn about any other mismatches */
if (new_flags != old_flags)
{
@@ -14940,6 +15448,190 @@ _bfd_mips_elf_get_target_dtag (bfd_vma dtag)
}
}
+/* Return the meaning of Tag_GNU_MIPS_ABI_FP value FP, or null if
+ not known. */
+
+const char *
+_bfd_mips_fp_abi_string (int fp)
+{
+ switch (fp)
+ {
+ /* These strings aren't translated because they're simply
+ option lists. */
+ case Val_GNU_MIPS_ABI_FP_DOUBLE:
+ return "-mdouble-float";
+
+ case Val_GNU_MIPS_ABI_FP_SINGLE:
+ return "-msingle-float";
+
+ case Val_GNU_MIPS_ABI_FP_SOFT:
+ return "-msoft-float";
+
+ case Val_GNU_MIPS_ABI_FP_OLD_64:
+ return _("-mips32r2 -mfp64 (12 callee-saved)");
+
+ case Val_GNU_MIPS_ABI_FP_XX:
+ return "-mfpxx";
+
+ case Val_GNU_MIPS_ABI_FP_64:
+ return "-mgp32 -mfp64";
+
+ case Val_GNU_MIPS_ABI_FP_64A:
+ return "-mgp32 -mfp64 -mno-odd-spreg";
+
+ default:
+ return 0;
+ }
+}
+
+static void
+print_mips_ases (FILE *file, unsigned int mask)
+{
+ if (mask & AFL_ASE_DSP)
+ fputs ("\n\tDSP ASE", file);
+ if (mask & AFL_ASE_DSPR2)
+ fputs ("\n\tDSP R2 ASE", file);
+ if (mask & AFL_ASE_EVA)
+ fputs ("\n\tEnhanced VA Scheme", file);
+ if (mask & AFL_ASE_MCU)
+ fputs ("\n\tMCU (MicroController) ASE", file);
+ if (mask & AFL_ASE_MDMX)
+ fputs ("\n\tMDMX ASE", file);
+ if (mask & AFL_ASE_MIPS3D)
+ fputs ("\n\tMIPS-3D ASE", file);
+ if (mask & AFL_ASE_MT)
+ fputs ("\n\tMT ASE", file);
+ if (mask & AFL_ASE_SMARTMIPS)
+ fputs ("\n\tSmartMIPS ASE", file);
+ if (mask & AFL_ASE_VIRT)
+ fputs ("\n\tVZ ASE", file);
+ if (mask & AFL_ASE_MSA)
+ fputs ("\n\tMSA ASE", file);
+ if (mask & AFL_ASE_MIPS16)
+ fputs ("\n\tMIPS16 ASE", file);
+ if (mask & AFL_ASE_MICROMIPS)
+ fputs ("\n\tMICROMIPS ASE", file);
+ if (mask & AFL_ASE_XPA)
+ fputs ("\n\tXPA ASE", file);
+ if (mask == 0)
+ fprintf (file, "\n\t%s", _("None"));
+ else if ((mask & ~AFL_ASE_MASK) != 0)
+ fprintf (stdout, "\n\t%s (%x)", _("Unknown"), mask & ~AFL_ASE_MASK);
+}
+
+static void
+print_mips_isa_ext (FILE *file, unsigned int isa_ext)
+{
+ switch (isa_ext)
+ {
+ case 0:
+ fputs (_("None"), file);
+ break;
+ case AFL_EXT_XLR:
+ fputs ("RMI XLR", file);
+ break;
+ case AFL_EXT_OCTEON2:
+ fputs ("Cavium Networks Octeon2", file);
+ break;
+ case AFL_EXT_OCTEONP:
+ fputs ("Cavium Networks OcteonP", file);
+ break;
+ case AFL_EXT_LOONGSON_3A:
+ fputs ("Loongson 3A", file);
+ break;
+ case AFL_EXT_OCTEON:
+ fputs ("Cavium Networks Octeon", file);
+ break;
+ case AFL_EXT_5900:
+ fputs ("Toshiba R5900", file);
+ break;
+ case AFL_EXT_4650:
+ fputs ("MIPS R4650", file);
+ break;
+ case AFL_EXT_4010:
+ fputs ("LSI R4010", file);
+ break;
+ case AFL_EXT_4100:
+ fputs ("NEC VR4100", file);
+ break;
+ case AFL_EXT_3900:
+ fputs ("Toshiba R3900", file);
+ break;
+ case AFL_EXT_10000:
+ fputs ("MIPS R10000", file);
+ break;
+ case AFL_EXT_SB1:
+ fputs ("Broadcom SB-1", file);
+ break;
+ case AFL_EXT_4111:
+ fputs ("NEC VR4111/VR4181", file);
+ break;
+ case AFL_EXT_4120:
+ fputs ("NEC VR4120", file);
+ break;
+ case AFL_EXT_5400:
+ fputs ("NEC VR5400", file);
+ break;
+ case AFL_EXT_5500:
+ fputs ("NEC VR5500", file);
+ break;
+ case AFL_EXT_LOONGSON_2E:
+ fputs ("ST Microelectronics Loongson 2E", file);
+ break;
+ case AFL_EXT_LOONGSON_2F:
+ fputs ("ST Microelectronics Loongson 2F", file);
+ break;
+ default:
+ fprintf (file, "%s (%d)", _("Unknown"), isa_ext);
+ break;
+ }
+}
+
+static void
+print_mips_fp_abi_value (FILE *file, int val)
+{
+ switch (val)
+ {
+ case Val_GNU_MIPS_ABI_FP_ANY:
+ fprintf (file, _("Hard or soft float\n"));
+ break;
+ case Val_GNU_MIPS_ABI_FP_DOUBLE:
+ fprintf (file, _("Hard float (double precision)\n"));
+ break;
+ case Val_GNU_MIPS_ABI_FP_SINGLE:
+ fprintf (file, _("Hard float (single precision)\n"));
+ break;
+ case Val_GNU_MIPS_ABI_FP_SOFT:
+ fprintf (file, _("Soft float\n"));
+ break;
+ case Val_GNU_MIPS_ABI_FP_OLD_64:
+ fprintf (file, _("Hard float (MIPS32r2 64-bit FPU 12 callee-saved)\n"));
+ break;
+ case Val_GNU_MIPS_ABI_FP_XX:
+ fprintf (file, _("Hard float (32-bit CPU, Any FPU)\n"));
+ break;
+ case Val_GNU_MIPS_ABI_FP_64:
+ fprintf (file, _("Hard float (32-bit CPU, 64-bit FPU)\n"));
+ break;
+ case Val_GNU_MIPS_ABI_FP_64A:
+ fprintf (file, _("Hard float compat (32-bit CPU, 64-bit FPU)\n"));
+ break;
+ default:
+ fprintf (file, "??? (%d)\n", val);
+ break;
+ }
+}
+
+static int
+get_mips_reg_size (int reg_size)
+{
+ return (reg_size == AFL_REG_NONE) ? 0
+ : (reg_size == AFL_REG_32) ? 32
+ : (reg_size == AFL_REG_64) ? 64
+ : (reg_size == AFL_REG_128) ? 128
+ : -1;
+}
+
bfd_boolean
_bfd_mips_elf_print_private_bfd_data (bfd *abfd, void *ptr)
{
@@ -14988,6 +15680,10 @@ _bfd_mips_elf_print_private_bfd_data (bfd *abfd, void *ptr)
fprintf (file, " [mips32r2]");
else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64R2)
fprintf (file, " [mips64r2]");
+ else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32R6)
+ fprintf (file, " [mips32r6]");
+ else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64R6)
+ fprintf (file, " [mips64r6]");
else
fprintf (file, _(" [unknown ISA]"));
@@ -15004,7 +15700,7 @@ _bfd_mips_elf_print_private_bfd_data (bfd *abfd, void *ptr)
fprintf (file, " [nan2008]");
if (elf_elfheader (abfd)->e_flags & EF_MIPS_FP64)
- fprintf (file, " [fp64]");
+ fprintf (file, " [old fp64]");
if (elf_elfheader (abfd)->e_flags & EF_MIPS_32BITMODE)
fprintf (file, " [32bitmode]");
@@ -15028,6 +15724,30 @@ _bfd_mips_elf_print_private_bfd_data (bfd *abfd, void *ptr)
fputc ('\n', file);
+ if (mips_elf_tdata (abfd)->abiflags_valid)
+ {
+ Elf_Internal_ABIFlags_v0 *abiflags = &mips_elf_tdata (abfd)->abiflags;
+ fprintf (file, "\nMIPS ABI Flags Version: %d\n", abiflags->version);
+ fprintf (file, "\nISA: MIPS%d", abiflags->isa_level);
+ if (abiflags->isa_rev > 1)
+ fprintf (file, "r%d", abiflags->isa_rev);
+ fprintf (file, "\nGPR size: %d",
+ get_mips_reg_size (abiflags->gpr_size));
+ fprintf (file, "\nCPR1 size: %d",
+ get_mips_reg_size (abiflags->cpr1_size));
+ fprintf (file, "\nCPR2 size: %d",
+ get_mips_reg_size (abiflags->cpr2_size));
+ fputs ("\nFP ABI: ", file);
+ print_mips_fp_abi_value (file, abiflags->fp_abi);
+ fputs ("ISA Extension: ", file);
+ print_mips_isa_ext (file, abiflags->isa_ext);
+ fputs ("\nASEs:", file);
+ print_mips_ases (file, abiflags->ases);
+ fprintf (file, "\nFLAGS 1: %8.8lx", abiflags->flags1);
+ fprintf (file, "\nFLAGS 2: %8.8lx", abiflags->flags2);
+ fputc ('\n', file);
+ }
+
return TRUE;
}
@@ -15348,4 +16068,10 @@ _bfd_mips_post_process_headers (bfd *abfd, struct bfd_link_info *link_info)
if (htab->use_plts_and_copy_relocs && !htab->is_vxworks)
i_ehdrp->e_ident[EI_ABIVERSION] = 1;
}
+
+ _bfd_elf_post_process_headers (abfd, link_info);
+
+ if (mips_elf_tdata (abfd)->abiflags.fp_abi == Val_GNU_MIPS_ABI_FP_64
+ || mips_elf_tdata (abfd)->abiflags.fp_abi == Val_GNU_MIPS_ABI_FP_64A)
+ i_ehdrp->e_ident[EI_ABIVERSION] = 3;
}
diff --git a/binutils-2.25/bfd/elfxx-mips.h b/binutils-2.25/bfd/elfxx-mips.h
index f27dc15a..8f5c53ee 100644
--- a/binutils-2.25/bfd/elfxx-mips.h
+++ b/binutils-2.25/bfd/elfxx-mips.h
@@ -1,6 +1,5 @@
/* MIPS ELF specific backend routines.
- Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -87,8 +86,8 @@ extern bfd_boolean _bfd_mips_elf_ignore_discarded_relocs
extern bfd_boolean _bfd_mips_elf_is_target_special_symbol
(bfd *abfd, asymbol *sym);
extern bfd_boolean _bfd_mips_elf_find_nearest_line
- (bfd *, asection *, asymbol **, bfd_vma, const char **,
- const char **, unsigned int *);
+ (bfd *, asymbol **, asection *, bfd_vma,
+ const char **, const char **, unsigned int *, unsigned int *);
extern bfd_boolean _bfd_mips_elf_find_inliner_info
(bfd *, const char **, const char **, unsigned int *);
extern bfd_boolean _bfd_mips_elf_set_section_contents
@@ -109,6 +108,8 @@ extern bfd_boolean _bfd_mips_elf_merge_private_bfd_data
(bfd *, bfd *);
extern bfd_boolean _bfd_mips_elf_set_private_flags
(bfd *, flagword);
+extern const char * _bfd_mips_fp_abi_string
+ (int);
extern bfd_boolean _bfd_mips_elf_print_private_bfd_data
(bfd *, void *);
extern bfd_boolean _bfd_mips_elf_discard_info
@@ -156,6 +157,8 @@ extern bfd_vma _bfd_mips_elf_plt_sym_val
(bfd_vma, const asection *, const arelent *rel);
extern long _bfd_mips_elf_get_synthetic_symtab
(bfd *, long, asymbol **, long, asymbol **, asymbol **);
+extern bfd_boolean _bfd_mips_elf_gc_mark_extra_sections
+ (struct bfd_link_info *, elf_gc_mark_hook_fn);
extern void _bfd_mips_post_process_headers
(bfd *abfd, struct bfd_link_info *link_info);
diff --git a/binutils-2.25/bfd/elfxx-sparc.c b/binutils-2.25/bfd/elfxx-sparc.c
index 94da3600..d5f92d46 100644
--- a/binutils-2.25/bfd/elfxx-sparc.c
+++ b/binutils-2.25/bfd/elfxx-sparc.c
@@ -1,6 +1,5 @@
/* SPARC-specific support for ELF
- Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2005-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -1103,6 +1102,21 @@ elf_sparc_get_local_sym_hash (struct _bfd_sparc_elf_link_hash_table *htab,
return &ret->elf;
}
+/* Destroy a SPARC ELF linker hash table. */
+
+static void
+_bfd_sparc_elf_link_hash_table_free (bfd *obfd)
+{
+ struct _bfd_sparc_elf_link_hash_table *htab
+ = (struct _bfd_sparc_elf_link_hash_table *) obfd->link.hash;
+
+ if (htab->loc_hash_table)
+ htab_delete (htab->loc_hash_table);
+ if (htab->loc_hash_memory)
+ objalloc_free ((struct objalloc *) htab->loc_hash_memory);
+ _bfd_elf_link_hash_table_free (obfd);
+}
+
/* Create a SPARC ELF linker hash table. */
struct bfd_link_hash_table *
@@ -1169,28 +1183,14 @@ _bfd_sparc_elf_link_hash_table_create (bfd *abfd)
ret->loc_hash_memory = objalloc_create ();
if (!ret->loc_hash_table || !ret->loc_hash_memory)
{
- free (ret);
+ _bfd_sparc_elf_link_hash_table_free (abfd);
return NULL;
}
+ ret->elf.root.hash_table_free = _bfd_sparc_elf_link_hash_table_free;
return &ret->elf.root;
}
-/* Destroy a SPARC ELF linker hash table. */
-
-void
-_bfd_sparc_elf_link_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct _bfd_sparc_elf_link_hash_table *htab
- = (struct _bfd_sparc_elf_link_hash_table *) hash;
-
- if (htab->loc_hash_table)
- htab_delete (htab->loc_hash_table);
- if (htab->loc_hash_memory)
- objalloc_free ((struct objalloc *) htab->loc_hash_memory);
- _bfd_generic_link_hash_table_free (hash);
-}
-
/* Create .plt, .rela.plt, .got, .rela.got, .dynbss, and
.rela.bss sections in DYNOBJ, and set up shortcuts to them in our
hash table. */
@@ -1970,7 +1970,7 @@ _bfd_sparc_elf_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
}
r_type = SPARC_ELF_R_TYPE (rel->r_info);
- r_type = sparc_elf_tls_transition (info, abfd, r_type, h != NULL);
+ r_type = sparc_elf_tls_transition (info, abfd, r_type, h == NULL);
switch (r_type)
{
case R_SPARC_TLS_LDM_HI22:
@@ -2568,7 +2568,7 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -3019,12 +3019,12 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
if (warned)
{
/* To avoid generating warning messages about truncated
@@ -4908,10 +4908,17 @@ _bfd_sparc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
in_attr = &in_attrs[Tag_GNU_Sparc_HWCAPS];
out_attr = &out_attrs[Tag_GNU_Sparc_HWCAPS];
+
+ out_attr->i |= in_attr->i;
+ out_attr->type = 1;
+ in_attr = &in_attrs[Tag_GNU_Sparc_HWCAPS2];
+ out_attr = &out_attrs[Tag_GNU_Sparc_HWCAPS2];
+
out_attr->i |= in_attr->i;
out_attr->type = 1;
+
/* Merge Tag_compatibility attributes and any common GNU ones. */
_bfd_elf_merge_object_attributes (ibfd, obfd);
diff --git a/binutils-2.25/bfd/elfxx-sparc.h b/binutils-2.25/bfd/elfxx-sparc.h
index d95e8255..cf1991b4 100644
--- a/binutils-2.25/bfd/elfxx-sparc.h
+++ b/binutils-2.25/bfd/elfxx-sparc.h
@@ -1,6 +1,5 @@
/* SPARC ELF specific backend routines.
- Copyright 2005, 2006, 2007, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2005-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -107,8 +106,6 @@ extern bfd_boolean _bfd_sparc_elf_mkobject
(bfd *);
extern struct bfd_link_hash_table *_bfd_sparc_elf_link_hash_table_create
(bfd *);
-extern void _bfd_sparc_elf_link_hash_table_free
- (struct bfd_link_hash_table *);
extern bfd_boolean _bfd_sparc_elf_create_dynamic_sections
(bfd *, struct bfd_link_info *);
extern void _bfd_sparc_elf_copy_indirect_symbol
diff --git a/binutils-2.25/bfd/elfxx-target.h b/binutils-2.25/bfd/elfxx-target.h
index d42ce26f..692fb465 100644
--- a/binutils-2.25/bfd/elfxx-target.h
+++ b/binutils-2.25/bfd/elfxx-target.h
@@ -1,7 +1,5 @@
/* Target definitions for NN-bit ELF
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -51,6 +49,9 @@
#ifndef bfd_elfNN_find_nearest_line
#define bfd_elfNN_find_nearest_line _bfd_elf_find_nearest_line
#endif
+#ifndef bfd_elfNN_find_line
+#define bfd_elfNN_find_line _bfd_elf_find_line
+#endif
#ifndef bfd_elfNN_find_inliner_info
#define bfd_elfNN_find_inliner_info _bfd_elf_find_inliner_info
#endif
@@ -109,6 +110,9 @@
#ifndef elf_backend_default_execstack
#define elf_backend_default_execstack 1
#endif
+#ifndef elf_backend_caches_rawsize
+#define elf_backend_caches_rawsize 0
+#endif
#ifndef elf_backend_stack_align
#define elf_backend_stack_align 16
#endif
@@ -236,9 +240,6 @@
#ifndef bfd_elfNN_bfd_link_hash_table_create
#define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
#endif
-#ifndef bfd_elfNN_bfd_link_hash_table_free
-#define bfd_elfNN_bfd_link_hash_table_free _bfd_elf_link_hash_table_free
-#endif
#ifndef bfd_elfNN_bfd_link_add_symbols
#define bfd_elfNN_bfd_link_add_symbols bfd_elf_link_add_symbols
#endif
@@ -255,9 +256,6 @@
#define bfd_elfNN_bfd_link_hash_table_create \
_bfd_generic_link_hash_table_create
#endif
-#ifndef bfd_elfNN_bfd_link_hash_table_free
-#define bfd_elfNN_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
-#endif
#ifndef bfd_elfNN_bfd_link_add_symbols
#define bfd_elfNN_bfd_link_add_symbols _bfd_generic_link_add_symbols
#endif
@@ -498,7 +496,7 @@
#define elf_backend_static_tls_alignment 1
#endif
#ifndef elf_backend_post_process_headers
-#define elf_backend_post_process_headers NULL
+#define elf_backend_post_process_headers _bfd_elf_post_process_headers
#endif
#ifndef elf_backend_print_symbol_all
#define elf_backend_print_symbol_all NULL
@@ -794,7 +792,8 @@ static struct elf_backend_data elfNN_bed =
elf_backend_want_got_sym,
elf_backend_want_dynbss,
elf_backend_want_p_paddr_set_to_zero,
- elf_backend_default_execstack
+ elf_backend_default_execstack,
+ elf_backend_caches_rawsize
};
/* Forward declaration for use when initialising alternative_target field. */
diff --git a/binutils-2.25/bfd/elfxx-tilegx.c b/binutils-2.25/bfd/elfxx-tilegx.c
index c57e38f3..e206bc72 100644
--- a/binutils-2.25/bfd/elfxx-tilegx.c
+++ b/binutils-2.25/bfd/elfxx-tilegx.c
@@ -1,5 +1,5 @@
/* TILE-Gx-specific support for ELF.
- Copyright 2011, 2012, 2013 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -2733,7 +2733,7 @@ tilegx_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
- for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
{
bfd_signed_vma *local_got;
bfd_signed_vma *end_local_got;
@@ -3191,12 +3191,13 @@ tilegx_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
}
else
{
- bfd_boolean warned;
+ bfd_boolean warned ATTRIBUTE_UNUSED;
+ bfd_boolean ignored ATTRIBUTE_UNUSED;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
- unresolved_reloc, warned);
+ unresolved_reloc, warned, ignored);
if (warned)
{
/* To avoid generating warning messages about truncated
diff --git a/binutils-2.25/bfd/elfxx-tilegx.h b/binutils-2.25/bfd/elfxx-tilegx.h
index 78900ad3..4c3f2bf1 100644
--- a/binutils-2.25/bfd/elfxx-tilegx.h
+++ b/binutils-2.25/bfd/elfxx-tilegx.h
@@ -1,5 +1,5 @@
/* TILE-Gx ELF specific backend routines.
- Copyright 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/epoc-pe-arm.c b/binutils-2.25/bfd/epoc-pe-arm.c
index a15f703c..71a7bf7d 100644
--- a/binutils-2.25/bfd/epoc-pe-arm.c
+++ b/binutils-2.25/bfd/epoc-pe-arm.c
@@ -1,5 +1,5 @@
/* BFD back-end for ARM EPOC PE files.
- Copyright 1999, 2000, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -21,9 +21,9 @@
#define TARGET_UNDERSCORE 0
#define USER_LABEL_PREFIX ""
-#define TARGET_LITTLE_SYM arm_epoc_pe_little_vec
+#define TARGET_LITTLE_SYM arm_pe_epoc_le_vec
#define TARGET_LITTLE_NAME "epoc-pe-arm-little"
-#define TARGET_BIG_SYM arm_epoc_pe_big_vec
+#define TARGET_BIG_SYM arm_pe_epoc_be_vec
#define TARGET_BIG_NAME "epoc-pe-arm-big"
#define bfd_arm_allocate_interworking_sections \
diff --git a/binutils-2.25/bfd/epoc-pei-arm.c b/binutils-2.25/bfd/epoc-pei-arm.c
index 13adf2f6..716775ce 100644
--- a/binutils-2.25/bfd/epoc-pei-arm.c
+++ b/binutils-2.25/bfd/epoc-pei-arm.c
@@ -1,5 +1,5 @@
/* BFD back-end for ARM EPOC PE IMAGE COFF files.
- Copyright 1999, 2000, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -21,9 +21,9 @@
#define TARGET_UNDERSCORE 0
#define USER_LABEL_PREFIX ""
-#define TARGET_LITTLE_SYM arm_epoc_pei_little_vec
+#define TARGET_LITTLE_SYM arm_pei_epoc_le_vec
#define TARGET_LITTLE_NAME "epoc-pei-arm-little"
-#define TARGET_BIG_SYM arm_epoc_pei_big_vec
+#define TARGET_BIG_SYM arm_pei_epoc_be_vec
#define TARGET_BIG_NAME "epoc-pei-arm-big"
#define EXTRA_S_FLAGS (SEC_CODE | SEC_READONLY | SEC_DATA)
diff --git a/binutils-2.25/bfd/format.c b/binutils-2.25/bfd/format.c
index b8f39ca0..c4bc9440 100644
--- a/binutils-2.25/bfd/format.c
+++ b/binutils-2.25/bfd/format.c
@@ -1,6 +1,5 @@
/* Generic BFD support for file formats.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
- 2003, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/freebsd.h b/binutils-2.25/bfd/freebsd.h
index 7478e026..8387d64b 100644
--- a/binutils-2.25/bfd/freebsd.h
+++ b/binutils-2.25/bfd/freebsd.h
@@ -1,6 +1,5 @@
/* BFD back-end definitions used by all FreeBSD targets.
- Copyright 1990, 1991, 1992, 1996, 1997, 2000, 2001, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/gen-aout.c b/binutils-2.25/bfd/gen-aout.c
index 5e791ec1..b1a59ff1 100644
--- a/binutils-2.25/bfd/gen-aout.c
+++ b/binutils-2.25/bfd/gen-aout.c
@@ -1,5 +1,5 @@
/* Generate parameters for an a.out system.
- Copyright 1990-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/genlink.h b/binutils-2.25/bfd/genlink.h
index 8fb59a5b..c1c16d09 100644
--- a/binutils-2.25/bfd/genlink.h
+++ b/binutils-2.25/bfd/genlink.h
@@ -1,5 +1,5 @@
/* genlink.h -- interface to the BFD generic linker
- Copyright 1993, 1994, 1996, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hash.c b/binutils-2.25/bfd/hash.c
index 82e711af..4149474f 100644
--- a/binutils-2.25/bfd/hash.c
+++ b/binutils-2.25/bfd/hash.c
@@ -1,6 +1,5 @@
/* hash.c -- hash table routines for BFD
- Copyright 1993, 1994, 1995, 1997, 1999, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
This file is part of BFD, the Binary File Descriptor library.
@@ -393,6 +392,7 @@ bfd_hash_table_init_n (struct bfd_hash_table *table,
objalloc_alloc ((struct objalloc *) table->memory, alloc);
if (table->table == NULL)
{
+ bfd_hash_table_free (table);
bfd_set_error (bfd_error_no_memory);
return FALSE;
}
diff --git a/binutils-2.25/bfd/host-aout.c b/binutils-2.25/bfd/host-aout.c
index 5a759108..0693f6c8 100644
--- a/binutils-2.25/bfd/host-aout.c
+++ b/binutils-2.25/bfd/host-aout.c
@@ -1,6 +1,5 @@
/* BFD backend for local host's a.out binaries
- Copyright 1990, 1991, 1992, 1994, 1995, 2001, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support. Probably John Gilmore's fault.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/alphalinux.h b/binutils-2.25/bfd/hosts/alphalinux.h
index af5331d2..5b67e755 100644
--- a/binutils-2.25/bfd/hosts/alphalinux.h
+++ b/binutils-2.25/bfd/hosts/alphalinux.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/alphavms.h b/binutils-2.25/bfd/hosts/alphavms.h
index 8d21826f..831a94cc 100644
--- a/binutils-2.25/bfd/hosts/alphavms.h
+++ b/binutils-2.25/bfd/hosts/alphavms.h
@@ -1,6 +1,5 @@
/* alphavms.h -- BFD definitions for an openVMS host
- Copyright 1996, 2000, 2001, 2005, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Written by Klaus Kämpf (kkaempf@progis.de)
of proGIS Softwareentwicklung, Aachen, Germany
diff --git a/binutils-2.25/bfd/hosts/decstation.h b/binutils-2.25/bfd/hosts/decstation.h
index ceccfcba..2a072e82 100644
--- a/binutils-2.25/bfd/hosts/decstation.h
+++ b/binutils-2.25/bfd/hosts/decstation.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/delta68.h b/binutils-2.25/bfd/hosts/delta68.h
index 3788272a..a7abc8f8 100644
--- a/binutils-2.25/bfd/hosts/delta68.h
+++ b/binutils-2.25/bfd/hosts/delta68.h
@@ -1,4 +1,4 @@
-/* Copyright 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/dpx2.h b/binutils-2.25/bfd/hosts/dpx2.h
index d1b4ff06..639b82f3 100644
--- a/binutils-2.25/bfd/hosts/dpx2.h
+++ b/binutils-2.25/bfd/hosts/dpx2.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/hp300bsd.h b/binutils-2.25/bfd/hosts/hp300bsd.h
index d00cada4..4b9d0d8a 100644
--- a/binutils-2.25/bfd/hosts/hp300bsd.h
+++ b/binutils-2.25/bfd/hosts/hp300bsd.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/i386bsd.h b/binutils-2.25/bfd/hosts/i386bsd.h
index b2145e6b..24a35c9d 100644
--- a/binutils-2.25/bfd/hosts/i386bsd.h
+++ b/binutils-2.25/bfd/hosts/i386bsd.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/i386linux.h b/binutils-2.25/bfd/hosts/i386linux.h
index d0ac14e7..0c8536e5 100644
--- a/binutils-2.25/bfd/hosts/i386linux.h
+++ b/binutils-2.25/bfd/hosts/i386linux.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/i386mach3.h b/binutils-2.25/bfd/hosts/i386mach3.h
index 02df406d..8872f0df 100644
--- a/binutils-2.25/bfd/hosts/i386mach3.h
+++ b/binutils-2.25/bfd/hosts/i386mach3.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/i386sco.h b/binutils-2.25/bfd/hosts/i386sco.h
index 119dbfcc..3e2a8b6c 100644
--- a/binutils-2.25/bfd/hosts/i386sco.h
+++ b/binutils-2.25/bfd/hosts/i386sco.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/i860mach3.h b/binutils-2.25/bfd/hosts/i860mach3.h
index 3dcbf211..b16e2767 100644
--- a/binutils-2.25/bfd/hosts/i860mach3.h
+++ b/binutils-2.25/bfd/hosts/i860mach3.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/m68kaux.h b/binutils-2.25/bfd/hosts/m68kaux.h
index 756b6087..1a34c4f9 100644
--- a/binutils-2.25/bfd/hosts/m68kaux.h
+++ b/binutils-2.25/bfd/hosts/m68kaux.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/m68klinux.h b/binutils-2.25/bfd/hosts/m68klinux.h
index a808d78f..533158b9 100644
--- a/binutils-2.25/bfd/hosts/m68klinux.h
+++ b/binutils-2.25/bfd/hosts/m68klinux.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/m88kmach3.h b/binutils-2.25/bfd/hosts/m88kmach3.h
index 712de0ac..af4a1cec 100644
--- a/binutils-2.25/bfd/hosts/m88kmach3.h
+++ b/binutils-2.25/bfd/hosts/m88kmach3.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/mipsbsd.h b/binutils-2.25/bfd/hosts/mipsbsd.h
index 359487ae..fd4b4313 100644
--- a/binutils-2.25/bfd/hosts/mipsbsd.h
+++ b/binutils-2.25/bfd/hosts/mipsbsd.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/mipsmach3.h b/binutils-2.25/bfd/hosts/mipsmach3.h
index 5a2e2295..fd8357b4 100644
--- a/binutils-2.25/bfd/hosts/mipsmach3.h
+++ b/binutils-2.25/bfd/hosts/mipsmach3.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/news-mips.h b/binutils-2.25/bfd/hosts/news-mips.h
index 06f9f582..8358c76d 100644
--- a/binutils-2.25/bfd/hosts/news-mips.h
+++ b/binutils-2.25/bfd/hosts/news-mips.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/news.h b/binutils-2.25/bfd/hosts/news.h
index d4301c94..798263e5 100644
--- a/binutils-2.25/bfd/hosts/news.h
+++ b/binutils-2.25/bfd/hosts/news.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/pc532mach.h b/binutils-2.25/bfd/hosts/pc532mach.h
index bac4a329..981ee956 100644
--- a/binutils-2.25/bfd/hosts/pc532mach.h
+++ b/binutils-2.25/bfd/hosts/pc532mach.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/riscos.h b/binutils-2.25/bfd/hosts/riscos.h
index e4b7f466..16d1b924 100644
--- a/binutils-2.25/bfd/hosts/riscos.h
+++ b/binutils-2.25/bfd/hosts/riscos.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/symmetry.h b/binutils-2.25/bfd/hosts/symmetry.h
index a5959055..4ece03ad 100644
--- a/binutils-2.25/bfd/hosts/symmetry.h
+++ b/binutils-2.25/bfd/hosts/symmetry.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/tahoe.h b/binutils-2.25/bfd/hosts/tahoe.h
index fa6e7a65..f41d6c4a 100644
--- a/binutils-2.25/bfd/hosts/tahoe.h
+++ b/binutils-2.25/bfd/hosts/tahoe.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/vaxbsd.h b/binutils-2.25/bfd/hosts/vaxbsd.h
index 3e02c3de..9e51fbe8 100644
--- a/binutils-2.25/bfd/hosts/vaxbsd.h
+++ b/binutils-2.25/bfd/hosts/vaxbsd.h
@@ -1,4 +1,4 @@
-/* Copyright 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/vaxlinux.h b/binutils-2.25/bfd/hosts/vaxlinux.h
index 271587ed..ef1f5dcc 100644
--- a/binutils-2.25/bfd/hosts/vaxlinux.h
+++ b/binutils-2.25/bfd/hosts/vaxlinux.h
@@ -1,4 +1,4 @@
-/* Copyright 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/vaxult.h b/binutils-2.25/bfd/hosts/vaxult.h
index 045a15d7..c7ed333e 100644
--- a/binutils-2.25/bfd/hosts/vaxult.h
+++ b/binutils-2.25/bfd/hosts/vaxult.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/vaxult2.h b/binutils-2.25/bfd/hosts/vaxult2.h
index 045a15d7..c7ed333e 100644
--- a/binutils-2.25/bfd/hosts/vaxult2.h
+++ b/binutils-2.25/bfd/hosts/vaxult2.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/hosts/x86-64linux.h b/binutils-2.25/bfd/hosts/x86-64linux.h
index 78be09af..27fd1766 100644
--- a/binutils-2.25/bfd/hosts/x86-64linux.h
+++ b/binutils-2.25/bfd/hosts/x86-64linux.h
@@ -1,5 +1,4 @@
-/* Copyright (C) 2006, 2011, 2012
- Free Software Foundation, Inc.
+/* Copyright (C) 2006-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/binutils-2.25/bfd/hp300bsd.c b/binutils-2.25/bfd/hp300bsd.c
index 2688b802..9cca44a4 100644
--- a/binutils-2.25/bfd/hp300bsd.c
+++ b/binutils-2.25/bfd/hp300bsd.c
@@ -1,6 +1,5 @@
/* BFD back-end for HP 9000/300 (68000-based) machines running BSD Unix.
- Copyright 1992, 1994, 1995, 2001, 2003, 2005, 2007, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -30,7 +29,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (hp300bsd_,OP)
+#define MY(OP) CONCAT2 (m68k_aout_hp300bsd_,OP)
#define TARGETNAME "a.out-hp300bsd"
#include "sysdep.h"
diff --git a/binutils-2.25/bfd/hp300hpux.c b/binutils-2.25/bfd/hp300hpux.c
index 6803d742..fa21a77d 100644
--- a/binutils-2.25/bfd/hp300hpux.c
+++ b/binutils-2.25/bfd/hp300hpux.c
@@ -1,6 +1,5 @@
/* BFD backend for hp-ux 9000/300
- Copyright 1990, 1991, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007, 2010, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Glenn Engel.
This file is part of BFD, the Binary File Descriptor library.
@@ -105,7 +104,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (hp300hpux_,OP)
+#define MY(OP) CONCAT2 (m68k_aout_hp300hpux_,OP)
#define external_exec hp300hpux_exec_bytes
#define external_nlist hp300hpux_nlist_bytes
@@ -130,10 +129,10 @@
/* these don't use MY because that causes problems within JUMP_TABLE
(CONCAT2 winds up being expanded recursively, which ANSI C compilers
will not do). */
-#define MY_canonicalize_symtab hp300hpux_canonicalize_symtab
-#define MY_get_symtab_upper_bound hp300hpux_get_symtab_upper_bound
-#define MY_canonicalize_reloc hp300hpux_canonicalize_reloc
-#define MY_write_object_contents hp300hpux_write_object_contents
+#define MY_canonicalize_symtab m68k_aout_hp300hpux_canonicalize_symtab
+#define MY_get_symtab_upper_bound m68k_aout_hp300hpux_get_symtab_upper_bound
+#define MY_canonicalize_reloc m68k_aout_hp300hpux_canonicalize_reloc
+#define MY_write_object_contents m68k_aout_hp300hpux_write_object_contents
#define MY_read_minisymbols _bfd_generic_read_minisymbols
#define MY_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
@@ -149,7 +148,7 @@
were allocated using malloc. */
#define MY_bfd_free_cached_info bfd_true
-#define hp300hpux_write_syms aout_32_write_syms
+#define m68k_aout_hp300hpux_write_syms aout_32_write_syms
#define MY_callback MY(callback)
diff --git a/binutils-2.25/bfd/hppabsd-core.c b/binutils-2.25/bfd/hppabsd-core.c
index c9e0985a..3b1215b0 100644
--- a/binutils-2.25/bfd/hppabsd-core.c
+++ b/binutils-2.25/bfd/hppabsd-core.c
@@ -1,6 +1,5 @@
/* BFD back-end for HPPA BSD core files.
- Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -218,7 +217,7 @@ swap_abort (void)
#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
-const bfd_target hppabsd_core_vec =
+const bfd_target core_hppabsd_vec =
{
"hppabsd-core",
bfd_target_unknown_flavour,
diff --git a/binutils-2.25/bfd/hpux-core.c b/binutils-2.25/bfd/hpux-core.c
index 3731210e..c6674651 100644
--- a/binutils-2.25/bfd/hpux-core.c
+++ b/binutils-2.25/bfd/hpux-core.c
@@ -1,6 +1,5 @@
/* BFD back-end for HP/UX core files.
- Copyright 1993, 1994, 1996, 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Stu Grossman, Cygnus Support.
Converted to back-end form by Ian Lance Taylor, Cygnus SUpport
@@ -377,7 +376,7 @@ swap_abort (void)
#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
-const bfd_target hpux_core_vec =
+const bfd_target core_hpux_vec =
{
"hpux-core",
bfd_target_unknown_flavour,
diff --git a/binutils-2.25/bfd/i386aout.c b/binutils-2.25/bfd/i386aout.c
index 25d046f1..4b5a83d2 100644
--- a/binutils-2.25/bfd/i386aout.c
+++ b/binutils-2.25/bfd/i386aout.c
@@ -1,6 +1,5 @@
/* BFD back-end for i386 a.out binaries.
- Copyright 1990, 1991, 1992, 1994, 1996, 1997, 2001, 2002, 2003, 2005,
- 2007 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -37,7 +36,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (i386aout_,OP)
+#define MY(OP) CONCAT2 (i386_aout_,OP)
#define TARGETNAME "a.out-i386"
#define NO_WRITE_HEADER_KLUDGE 1
diff --git a/binutils-2.25/bfd/i386bsd.c b/binutils-2.25/bfd/i386bsd.c
index d54841ce..d1ed35b0 100644
--- a/binutils-2.25/bfd/i386bsd.c
+++ b/binutils-2.25/bfd/i386bsd.c
@@ -1,6 +1,5 @@
/* BFD back-end for i386 a.out binaries under BSD.
- Copyright 1990, 1991, 1992, 1993, 1994, 2001, 2005, 2007, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -40,7 +39,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (i386bsd_,OP)
+#define MY(OP) CONCAT2 (i386_aout_bsd_,OP)
#define TARGETNAME "a.out-i386-bsd"
#include "sysdep.h"
diff --git a/binutils-2.25/bfd/i386dynix.c b/binutils-2.25/bfd/i386dynix.c
index a33571e4..d9a41822 100644
--- a/binutils-2.25/bfd/i386dynix.c
+++ b/binutils-2.25/bfd/i386dynix.c
@@ -1,6 +1,5 @@
/* BFD back-end for i386 a.out binaries under dynix.
- Copyright 1994, 1995, 2001, 2003, 2005, 2007, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -35,7 +34,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (i386dynix_,OP)
+#define MY(OP) CONCAT2 (i386_aout_dynix_,OP)
#define TARGETNAME "a.out-i386-dynix"
#define NAME(x,y) CONCAT3 (i386dynix,_32_,y)
#define ARCH_SIZE 32
diff --git a/binutils-2.25/bfd/i386freebsd.c b/binutils-2.25/bfd/i386freebsd.c
index 52a3f6ec..7c5ed900 100644
--- a/binutils-2.25/bfd/i386freebsd.c
+++ b/binutils-2.25/bfd/i386freebsd.c
@@ -1,6 +1,5 @@
/* BFD back-end for FreeBSD/386 a.out-ish binaries.
- Copyright 1990, 1991, 1992, 1996, 2001, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -31,7 +30,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (i386freebsd_,OP)
+#define MY(OP) CONCAT2 (i386_aout_fbsd_,OP)
/* This needs to start with a.out so GDB knows it is an a.out variant. */
#define TARGETNAME "a.out-i386-freebsd"
diff --git a/binutils-2.25/bfd/i386linux.c b/binutils-2.25/bfd/i386linux.c
index 65ae5c9c..461a7a5c 100644
--- a/binutils-2.25/bfd/i386linux.c
+++ b/binutils-2.25/bfd/i386linux.c
@@ -1,7 +1,5 @@
/* BFD back-end for linux flavored i386 a.out binaries.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -40,7 +38,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (i386linux_,OP)
+#define MY(OP) CONCAT2 (i386_aout_linux_,OP)
#define TARGETNAME "a.out-i386-linux"
extern const bfd_target MY(vec);
diff --git a/binutils-2.25/bfd/i386lynx.c b/binutils-2.25/bfd/i386lynx.c
index d373e2ae..9c1b9f2b 100644
--- a/binutils-2.25/bfd/i386lynx.c
+++ b/binutils-2.25/bfd/i386lynx.c
@@ -1,6 +1,5 @@
/* BFD back-end for i386 a.out binaries under LynxOS.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2001, 2002,
- 2003, 2005, 2007, 2009, 2010, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -27,7 +26,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (i386lynx_aout_,OP)
+#define MY(OP) CONCAT2 (i386_aout_lynx_,OP)
#define TARGETNAME "a.out-i386-lynx"
#include "sysdep.h"
diff --git a/binutils-2.25/bfd/i386mach3.c b/binutils-2.25/bfd/i386mach3.c
index 74b5e5ed..233041a2 100644
--- a/binutils-2.25/bfd/i386mach3.c
+++ b/binutils-2.25/bfd/i386mach3.c
@@ -1,6 +1,5 @@
/* BFD back-end for i386 a.out binaries.
- Copyright 1990, 1991, 1993, 1994, 1995, 1997, 2001, 2002, 2003, 2005, 2007,
- 2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -48,7 +47,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (i386mach3_,OP)
+#define MY(OP) CONCAT2 (i386_aout_mach3_,OP)
#define TARGETNAME "a.out-mach3"
static bfd_boolean MY (set_sizes) (bfd *);
diff --git a/binutils-2.25/bfd/i386msdos.c b/binutils-2.25/bfd/i386msdos.c
index ed7d8961..f02659fb 100644
--- a/binutils-2.25/bfd/i386msdos.c
+++ b/binutils-2.25/bfd/i386msdos.c
@@ -1,7 +1,5 @@
/* BFD back-end for MS-DOS executables.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2009, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Bryan Ford of the University of Utah.
Contributed by the Center for Software Science at the
@@ -152,7 +150,6 @@ msdos_set_section_contents (bfd *abfd,
_bfd_generic_section_already_linked
#define msdos_bfd_define_common_symbol bfd_generic_define_common_symbol
#define msdos_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define msdos_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define msdos_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define msdos_bfd_link_just_syms _bfd_generic_link_just_syms
#define msdos_bfd_copy_link_hash_symbol_type \
@@ -166,6 +163,7 @@ msdos_set_section_contents (bfd *abfd,
#define msdos_print_symbol _bfd_nosymbols_print_symbol
#define msdos_get_symbol_info _bfd_nosymbols_get_symbol_info
#define msdos_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define msdos_find_line _bfd_nosymbols_find_line
#define msdos_find_inliner_info _bfd_nosymbols_find_inliner_info
#define msdos_get_lineno _bfd_nosymbols_get_lineno
#define msdos_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
@@ -178,7 +176,7 @@ msdos_set_section_contents (bfd *abfd,
#define msdos_get_reloc_upper_bound _bfd_norelocs_get_reloc_upper_bound
#define msdos_32_bfd_link_split_section _bfd_generic_link_split_section
-const bfd_target i386msdos_vec =
+const bfd_target i386_msdos_vec =
{
"msdos", /* name */
bfd_target_msdos_flavour,
diff --git a/binutils-2.25/bfd/i386netbsd.c b/binutils-2.25/bfd/i386netbsd.c
index 47607b6f..5e4d1300 100644
--- a/binutils-2.25/bfd/i386netbsd.c
+++ b/binutils-2.25/bfd/i386netbsd.c
@@ -1,6 +1,5 @@
/* BFD back-end for NetBSD/386 a.out-ish binaries.
- Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998, 2001, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -31,7 +30,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (i386netbsd_,OP)
+#define MY(OP) CONCAT2 (i386_aout_nbsd_,OP)
/* This needs to start with a.out so GDB knows it is an a.out variant. */
#define TARGETNAME "a.out-i386-netbsd"
diff --git a/binutils-2.25/bfd/i386os9k.c b/binutils-2.25/bfd/i386os9k.c
index cea63bd2..d8d54089 100644
--- a/binutils-2.25/bfd/i386os9k.c
+++ b/binutils-2.25/bfd/i386os9k.c
@@ -1,6 +1,5 @@
/* BFD back-end for os9000 i386 binaries.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 2002,
- 2004, 2005, 2006, 2007, 2009, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -155,6 +154,7 @@ os9k_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
#define aout_32_close_and_cleanup aout_32_bfd_free_cached_info
+#define aout_32_find_line _bfd_nosymbols_find_line
#define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define aout_32_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
@@ -175,7 +175,6 @@ os9k_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
_bfd_generic_section_already_linked
#define os9k_bfd_define_common_symbol bfd_generic_define_common_symbol
#define os9k_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define os9k_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define os9k_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define os9k_bfd_link_just_syms _bfd_generic_link_just_syms
#define os9k_bfd_copy_link_hash_symbol_type \
@@ -183,7 +182,7 @@ os9k_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
#define os9k_bfd_final_link _bfd_generic_final_link
#define os9k_bfd_link_split_section _bfd_generic_link_split_section
-const bfd_target i386os9k_vec =
+const bfd_target i386_aout_os9k_vec =
{
"i386os9k", /* name */
bfd_target_os9k_flavour,
diff --git a/binutils-2.25/bfd/ieee.c b/binutils-2.25/bfd/ieee.c
index b93fdeb8..313834e7 100644
--- a/binutils-2.25/bfd/ieee.c
+++ b/binutils-2.25/bfd/ieee.c
@@ -1,7 +1,5 @@
/* BFD back-end for ieee-695 objects.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
@@ -35,6 +33,7 @@
#include "ieee.h"
#include "libieee.h"
#include "safe-ctype.h"
+#include "libiberty.h"
struct output_buffer_struct
{
@@ -1313,7 +1312,8 @@ ieee_archive_p (bfd *abfd)
/* Ignore the return value here. It doesn't matter if we don't read
the entire buffer. We might have a very small ieee file. */
- bfd_bread ((void *) buffer, (bfd_size_type) sizeof (buffer), abfd);
+ if (bfd_bread ((void *) buffer, (bfd_size_type) sizeof (buffer), abfd) <= 0)
+ goto got_wrong_format_error;
ieee->h.first_byte = buffer;
ieee->h.input_p = buffer;
@@ -1802,7 +1802,8 @@ ieee_object_p (bfd *abfd)
goto fail;
/* Read the first few bytes in to see if it makes sense. Ignore
bfd_bread return value; The file might be very small. */
- bfd_bread ((void *) buffer, (bfd_size_type) sizeof (buffer), abfd);
+ if (bfd_bread ((void *) buffer, (bfd_size_type) sizeof (buffer), abfd) <= 0)
+ goto got_wrong_format;
ieee->h.input_p = buffer;
if (this_byte_and_next (&(ieee->h)) != Module_Beginning)
@@ -1824,7 +1825,7 @@ ieee_object_p (bfd *abfd)
goto got_wrong_format;
ieee->mb.module_name = read_id (&(ieee->h));
if (abfd->filename == (const char *) NULL)
- abfd->filename = ieee->mb.module_name;
+ abfd->filename = xstrdup (ieee->mb.module_name);
/* Determine the architecture and machine type of the object file. */
{
@@ -3676,26 +3677,9 @@ ieee_openr_next_archived_file (bfd *arch, bfd *prev)
}
}
-static bfd_boolean
-ieee_find_nearest_line (bfd *abfd ATTRIBUTE_UNUSED,
- asection *section ATTRIBUTE_UNUSED,
- asymbol **symbols ATTRIBUTE_UNUSED,
- bfd_vma offset ATTRIBUTE_UNUSED,
- const char **filename_ptr ATTRIBUTE_UNUSED,
- const char **functionname_ptr ATTRIBUTE_UNUSED,
- unsigned int *line_ptr ATTRIBUTE_UNUSED)
-{
- return FALSE;
-}
-
-static bfd_boolean
-ieee_find_inliner_info (bfd *abfd ATTRIBUTE_UNUSED,
- const char **filename_ptr ATTRIBUTE_UNUSED,
- const char **functionname_ptr ATTRIBUTE_UNUSED,
- unsigned int *line_ptr ATTRIBUTE_UNUSED)
-{
- return FALSE;
-}
+#define ieee_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define ieee_find_line _bfd_nosymbols_find_line
+#define ieee_find_inliner_info _bfd_nosymbols_find_inliner_info
static int
ieee_generic_stat_arch_elt (bfd *abfd, struct stat *buf)
@@ -3780,7 +3764,6 @@ ieee_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
_bfd_generic_section_already_linked
#define ieee_bfd_define_common_symbol bfd_generic_define_common_symbol
#define ieee_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define ieee_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define ieee_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define ieee_bfd_link_just_syms _bfd_generic_link_just_syms
#define ieee_bfd_copy_link_hash_symbol_type \
@@ -3858,7 +3841,6 @@ const bfd_target ieee_vec =
/* ieee_sizeof_headers, ieee_bfd_get_relocated_section_contents,
ieee_bfd_relax_section, ieee_bfd_link_hash_table_create,
- _bfd_generic_link_hash_table_free,
ieee_bfd_link_add_symbols, ieee_bfd_final_link,
ieee_bfd_link_split_section, ieee_bfd_gc_sections,
ieee_bfd_merge_sections. */
diff --git a/binutils-2.25/bfd/ihex.c b/binutils-2.25/bfd/ihex.c
index 09f756a1..9b3b8138 100644
--- a/binutils-2.25/bfd/ihex.c
+++ b/binutils-2.25/bfd/ihex.c
@@ -1,6 +1,5 @@
/* BFD back-end for Intel Hex objects.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
Written by Ian Lance Taylor of Cygnus Support <ian@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@@ -322,7 +321,7 @@ ihex_scan (bfd *abfd)
{
if (! ISHEX (buf[i]))
{
- ihex_bad_byte (abfd, lineno, hdr[i], error);
+ ihex_bad_byte (abfd, lineno, buf[i], error);
goto error_return;
}
}
@@ -923,6 +922,7 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
#define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
#define ihex_get_lineno _bfd_nosymbols_get_lineno
#define ihex_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define ihex_find_line _bfd_nosymbols_find_line
#define ihex_find_inliner_info _bfd_nosymbols_find_inliner_info
#define ihex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define ihex_read_minisymbols _bfd_nosymbols_read_minisymbols
@@ -937,7 +937,6 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
#define ihex_section_already_linked _bfd_generic_section_already_linked
#define ihex_bfd_define_common_symbol bfd_generic_define_common_symbol
#define ihex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define ihex_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define ihex_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define ihex_bfd_link_just_syms _bfd_generic_link_just_syms
#define ihex_bfd_copy_link_hash_symbol_type \
diff --git a/binutils-2.25/bfd/init.c b/binutils-2.25/bfd/init.c
index a023fb68..c0874961 100644
--- a/binutils-2.25/bfd/init.c
+++ b/binutils-2.25/bfd/init.c
@@ -1,6 +1,5 @@
/* bfd initialization stuff
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2003, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/irix-core.c b/binutils-2.25/bfd/irix-core.c
index 9a39929d..9dcc4653 100644
--- a/binutils-2.25/bfd/irix-core.c
+++ b/binutils-2.25/bfd/irix-core.c
@@ -1,6 +1,5 @@
/* BFD back-end for Irix core files.
- Copyright 1993, 1994, 1996, 1999, 2001, 2002, 2004, 2005, 2006, 2007,
- 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Stu Grossman, Cygnus Support.
Converted to back-end form by Ian Lance Taylor, Cygnus Support
@@ -280,7 +279,7 @@ swap_abort(void)
#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
-const bfd_target irix_core_vec =
+const bfd_target core_irix_vec =
{
"irix-core",
bfd_target_unknown_flavour,
diff --git a/binutils-2.25/bfd/libaout.h b/binutils-2.25/bfd/libaout.h
index ed2ec45a..25277cbd 100644
--- a/binutils-2.25/bfd/libaout.h
+++ b/binutils-2.25/bfd/libaout.h
@@ -1,7 +1,5 @@
/* BFD back-end data structures for a.out (and similar) files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -553,8 +551,8 @@ extern void NAME (aout, get_symbol_info)
(bfd *, asymbol *, symbol_info *);
extern bfd_boolean NAME (aout, find_nearest_line)
- (bfd *, asection *, asymbol **, bfd_vma, const char **,
- const char **, unsigned int *);
+ (bfd *, asymbol **, asection *, bfd_vma,
+ const char **, const char **, unsigned int *, unsigned int *);
extern long NAME (aout, read_minisymbols)
(bfd *, bfd_boolean, void * *, unsigned int *);
diff --git a/binutils-2.25/bfd/libbfd-in.h b/binutils-2.25/bfd/libbfd-in.h
index 52c1f5f8..50a46ac4 100644
--- a/binutils-2.25/bfd/libbfd-in.h
+++ b/binutils-2.25/bfd/libbfd-in.h
@@ -1,10 +1,7 @@
/* libbfd.h -- Declarations used by bfd library *implementation*.
(This include file is not for users of the library.)
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -402,8 +399,13 @@ extern bfd_boolean _bfd_vms_lib_ia64_mkarchive (bfd *abfd);
#define _bfd_nosymbols_get_lineno \
((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr)
#define _bfd_nosymbols_find_nearest_line \
- ((bfd_boolean (*) (bfd *, asection *, asymbol **, bfd_vma, const char **, \
- const char **, unsigned int *)) \
+ ((bfd_boolean (*) (bfd *, asymbol **, asection *, bfd_vma, \
+ const char **, const char **, unsigned int *, \
+ unsigned int *)) \
+ bfd_false)
+#define _bfd_nosymbols_find_line \
+ ((bfd_boolean (*) (bfd *, asymbol **, asymbol *, \
+ const char **, unsigned int *)) \
bfd_false)
#define _bfd_nosymbols_find_inliner_info \
((bfd_boolean (*) (bfd *, const char **, const char **, unsigned int *)) \
@@ -474,8 +476,6 @@ extern bfd_boolean _bfd_generic_set_section_contents
bfd_false)
#define _bfd_nolink_bfd_link_hash_table_create \
((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr)
-#define _bfd_nolink_bfd_link_hash_table_free \
- ((void (*) (struct bfd_link_hash_table *)) bfd_void)
#define _bfd_nolink_bfd_link_add_symbols \
((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
#define _bfd_nolink_bfd_link_just_syms \
@@ -525,8 +525,8 @@ extern bfd_boolean _bfd_stab_section_find_nearest_line
/* Find the nearest line using DWARF 1 debugging information. */
extern bfd_boolean _bfd_dwarf1_find_nearest_line
- (bfd *, asection *, asymbol **, bfd_vma, const char **,
- const char **, unsigned int *);
+ (bfd *, asymbol **, asection *, bfd_vma,
+ const char **, const char **, unsigned int *);
struct dwarf_debug_section
{
@@ -541,21 +541,9 @@ extern const struct dwarf_debug_section dwarf_debug_sections[];
/* Find the nearest line using DWARF 2 debugging information. */
extern bfd_boolean _bfd_dwarf2_find_nearest_line
- (bfd *, const struct dwarf_debug_section *, asection *, asymbol **, bfd_vma,
- const char **, const char **, unsigned int *, unsigned int *, unsigned int,
- void **);
-
-/* Find the line using DWARF 2 debugging information. */
-extern bfd_boolean _bfd_dwarf2_find_line
- (bfd *, asymbol **, asymbol *, const char **,
- unsigned int *, unsigned int *, unsigned int, void **);
-
-bfd_boolean _bfd_generic_find_line
- (bfd *, asymbol **, asymbol *, const char **, unsigned int *);
-
-bfd_boolean _bfd_generic_find_nearest_line_discriminator
- (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **,
- unsigned int *, unsigned int *);
+ (bfd *, asymbol **, asymbol *, asection *, bfd_vma,
+ const char **, const char **, unsigned int *, unsigned int *,
+ const struct dwarf_debug_section *, unsigned int, void **);
/* Find inliner info after calling bfd_find_nearest_line. */
extern bfd_boolean _bfd_dwarf2_find_inliner_info
@@ -563,7 +551,8 @@ extern bfd_boolean _bfd_dwarf2_find_inliner_info
/* Read DWARF 2 debugging information. */
extern bfd_boolean _bfd_dwarf2_slurp_debug_info
- (bfd *, bfd *, const struct dwarf_debug_section *, asymbol **, void **);
+ (bfd *, bfd *, const struct dwarf_debug_section *, asymbol **, void **,
+ bfd_boolean);
/* Clean up the data used to handle DWARF 2 debugging information. */
extern void _bfd_dwarf2_cleanup_debug_info
@@ -592,7 +581,7 @@ extern struct bfd_link_hash_table *_bfd_generic_link_hash_table_create
/* Generic link hash table destruction routine. */
extern void _bfd_generic_link_hash_table_free
- (struct bfd_link_hash_table *);
+ (bfd *);
/* Generic add symbol routine. */
extern bfd_boolean _bfd_generic_link_add_symbols
@@ -607,7 +596,9 @@ extern bfd_boolean _bfd_generic_link_add_symbols_collect
/* Generic archive add symbol routine. */
extern bfd_boolean _bfd_generic_link_add_archive_symbols
(bfd *, struct bfd_link_info *,
- bfd_boolean (*) (bfd *, struct bfd_link_info *, bfd_boolean *));
+ bfd_boolean (*) (bfd *, struct bfd_link_info *,
+ struct bfd_link_hash_entry *, const char *,
+ bfd_boolean *));
/* Forward declaration to avoid prototype errors. */
typedef struct bfd_link_hash_entry _bfd_link_hash_entry;
diff --git a/binutils-2.25/bfd/libbfd.c b/binutils-2.25/bfd/libbfd.c
index 553c7295..6352c9cf 100644
--- a/binutils-2.25/bfd/libbfd.c
+++ b/binutils-2.25/bfd/libbfd.c
@@ -1,7 +1,5 @@
/* Assorted BFD support routines, only used internally.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -550,11 +548,10 @@ DESCRIPTION
.*/
/* Sign extension to bfd_signed_vma. */
-#define COERCE16(x) (((bfd_signed_vma) (x) ^ 0x8000) - 0x8000)
-#define COERCE32(x) (((bfd_signed_vma) (x) ^ 0x80000000) - 0x80000000)
-#define EIGHT_GAZILLION ((bfd_int64_t) 1 << 63)
+#define COERCE16(x) (((bfd_vma) (x) ^ 0x8000) - 0x8000)
+#define COERCE32(x) (((bfd_vma) (x) ^ 0x80000000) - 0x80000000)
#define COERCE64(x) \
- (((bfd_int64_t) (x) ^ EIGHT_GAZILLION) - EIGHT_GAZILLION)
+ (((bfd_uint64_t) (x) ^ ((bfd_uint64_t) 1 << 63)) - ((bfd_uint64_t) 1 << 63))
bfd_vma
bfd_getb16 (const void *p)
@@ -1108,29 +1105,6 @@ read_signed_leb128 (bfd *abfd ATTRIBUTE_UNUSED,
}
bfd_boolean
-_bfd_generic_find_line (bfd *abfd ATTRIBUTE_UNUSED,
- asymbol **symbols ATTRIBUTE_UNUSED,
- asymbol *symbol ATTRIBUTE_UNUSED,
- const char **filename_ptr ATTRIBUTE_UNUSED,
- unsigned int *linenumber_ptr ATTRIBUTE_UNUSED)
-{
- return FALSE;
-}
-
-bfd_boolean
-_bfd_generic_find_nearest_line_discriminator (bfd *abfd ATTRIBUTE_UNUSED,
- asection *section ATTRIBUTE_UNUSED,
- asymbol **symbols ATTRIBUTE_UNUSED,
- bfd_vma offset ATTRIBUTE_UNUSED,
- const char **filename_ptr ATTRIBUTE_UNUSED,
- const char **functionname_ptr ATTRIBUTE_UNUSED,
- unsigned int *line_ptr ATTRIBUTE_UNUSED,
- unsigned int *discriminator_ptr ATTRIBUTE_UNUSED)
-{
- return FALSE;
-}
-
-bfd_boolean
_bfd_generic_init_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED,
asection *isec ATTRIBUTE_UNUSED,
bfd *obfd ATTRIBUTE_UNUSED,
diff --git a/binutils-2.25/bfd/libbfd.h b/binutils-2.25/bfd/libbfd.h
index 1381803f..6c48f82a 100644
--- a/binutils-2.25/bfd/libbfd.h
+++ b/binutils-2.25/bfd/libbfd.h
@@ -6,10 +6,7 @@
/* libbfd.h -- Declarations used by bfd library *implementation*.
(This include file is not for users of the library.)
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -407,8 +404,13 @@ extern bfd_boolean _bfd_vms_lib_ia64_mkarchive (bfd *abfd);
#define _bfd_nosymbols_get_lineno \
((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr)
#define _bfd_nosymbols_find_nearest_line \
- ((bfd_boolean (*) (bfd *, asection *, asymbol **, bfd_vma, const char **, \
- const char **, unsigned int *)) \
+ ((bfd_boolean (*) (bfd *, asymbol **, asection *, bfd_vma, \
+ const char **, const char **, unsigned int *, \
+ unsigned int *)) \
+ bfd_false)
+#define _bfd_nosymbols_find_line \
+ ((bfd_boolean (*) (bfd *, asymbol **, asymbol *, \
+ const char **, unsigned int *)) \
bfd_false)
#define _bfd_nosymbols_find_inliner_info \
((bfd_boolean (*) (bfd *, const char **, const char **, unsigned int *)) \
@@ -479,8 +481,6 @@ extern bfd_boolean _bfd_generic_set_section_contents
bfd_false)
#define _bfd_nolink_bfd_link_hash_table_create \
((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr)
-#define _bfd_nolink_bfd_link_hash_table_free \
- ((void (*) (struct bfd_link_hash_table *)) bfd_void)
#define _bfd_nolink_bfd_link_add_symbols \
((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
#define _bfd_nolink_bfd_link_just_syms \
@@ -530,8 +530,8 @@ extern bfd_boolean _bfd_stab_section_find_nearest_line
/* Find the nearest line using DWARF 1 debugging information. */
extern bfd_boolean _bfd_dwarf1_find_nearest_line
- (bfd *, asection *, asymbol **, bfd_vma, const char **,
- const char **, unsigned int *);
+ (bfd *, asymbol **, asection *, bfd_vma,
+ const char **, const char **, unsigned int *);
struct dwarf_debug_section
{
@@ -546,21 +546,9 @@ extern const struct dwarf_debug_section dwarf_debug_sections[];
/* Find the nearest line using DWARF 2 debugging information. */
extern bfd_boolean _bfd_dwarf2_find_nearest_line
- (bfd *, const struct dwarf_debug_section *, asection *, asymbol **, bfd_vma,
- const char **, const char **, unsigned int *, unsigned int *, unsigned int,
- void **);
-
-/* Find the line using DWARF 2 debugging information. */
-extern bfd_boolean _bfd_dwarf2_find_line
- (bfd *, asymbol **, asymbol *, const char **,
- unsigned int *, unsigned int *, unsigned int, void **);
-
-bfd_boolean _bfd_generic_find_line
- (bfd *, asymbol **, asymbol *, const char **, unsigned int *);
-
-bfd_boolean _bfd_generic_find_nearest_line_discriminator
- (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **,
- unsigned int *, unsigned int *);
+ (bfd *, asymbol **, asymbol *, asection *, bfd_vma,
+ const char **, const char **, unsigned int *, unsigned int *,
+ const struct dwarf_debug_section *, unsigned int, void **);
/* Find inliner info after calling bfd_find_nearest_line. */
extern bfd_boolean _bfd_dwarf2_find_inliner_info
@@ -568,7 +556,8 @@ extern bfd_boolean _bfd_dwarf2_find_inliner_info
/* Read DWARF 2 debugging information. */
extern bfd_boolean _bfd_dwarf2_slurp_debug_info
- (bfd *, bfd *, const struct dwarf_debug_section *, asymbol **, void **);
+ (bfd *, bfd *, const struct dwarf_debug_section *, asymbol **, void **,
+ bfd_boolean);
/* Clean up the data used to handle DWARF 2 debugging information. */
extern void _bfd_dwarf2_cleanup_debug_info
@@ -597,7 +586,7 @@ extern struct bfd_link_hash_table *_bfd_generic_link_hash_table_create
/* Generic link hash table destruction routine. */
extern void _bfd_generic_link_hash_table_free
- (struct bfd_link_hash_table *);
+ (bfd *);
/* Generic add symbol routine. */
extern bfd_boolean _bfd_generic_link_add_symbols
@@ -612,7 +601,9 @@ extern bfd_boolean _bfd_generic_link_add_symbols_collect
/* Generic archive add symbol routine. */
extern bfd_boolean _bfd_generic_link_add_archive_symbols
(bfd *, struct bfd_link_info *,
- bfd_boolean (*) (bfd *, struct bfd_link_info *, bfd_boolean *));
+ bfd_boolean (*) (bfd *, struct bfd_link_info *,
+ struct bfd_link_hash_entry *, const char *,
+ bfd_boolean *));
/* Forward declaration to avoid prototype errors. */
typedef struct bfd_link_hash_entry _bfd_link_hash_entry;
@@ -1128,6 +1119,10 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_MICROMIPS_7_PCREL_S1",
"BFD_RELOC_MICROMIPS_10_PCREL_S1",
"BFD_RELOC_MICROMIPS_16_PCREL_S1",
+ "BFD_RELOC_MIPS_21_PCREL_S2",
+ "BFD_RELOC_MIPS_26_PCREL_S2",
+ "BFD_RELOC_MIPS_18_PCREL_S3",
+ "BFD_RELOC_MIPS_19_PCREL_S2",
"BFD_RELOC_MICROMIPS_GPREL16",
"BFD_RELOC_MICROMIPS_HI16",
"BFD_RELOC_MICROMIPS_HI16_S",
@@ -1307,6 +1302,8 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_X86_64_TLSDESC_CALL",
"BFD_RELOC_X86_64_TLSDESC",
"BFD_RELOC_X86_64_IRELATIVE",
+ "BFD_RELOC_X86_64_PC32_BND",
+ "BFD_RELOC_X86_64_PLT32_BND",
"BFD_RELOC_NS32K_IMM_8",
"BFD_RELOC_NS32K_IMM_16",
"BFD_RELOC_NS32K_IMM_32",
@@ -1397,6 +1394,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_PPC64_TOC16_LO_DS",
"BFD_RELOC_PPC64_PLTGOT16_DS",
"BFD_RELOC_PPC64_PLTGOT16_LO_DS",
+ "BFD_RELOC_PPC64_ADDR16_HIGH",
+ "BFD_RELOC_PPC64_ADDR16_HIGHA",
+ "BFD_RELOC_PPC64_ADDR64_LOCAL",
"BFD_RELOC_PPC_TLS",
"BFD_RELOC_PPC_TLSGD",
"BFD_RELOC_PPC_TLSLD",
@@ -1439,6 +1439,10 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_PPC64_DTPREL16_HIGHERA",
"BFD_RELOC_PPC64_DTPREL16_HIGHEST",
"BFD_RELOC_PPC64_DTPREL16_HIGHESTA",
+ "BFD_RELOC_PPC64_TPREL16_HIGH",
+ "BFD_RELOC_PPC64_TPREL16_HIGHA",
+ "BFD_RELOC_PPC64_DTPREL16_HIGH",
+ "BFD_RELOC_PPC64_DTPREL16_HIGHA",
"BFD_RELOC_I370_D12",
"BFD_RELOC_CTOR",
"BFD_RELOC_ARM_PCREL_BRANCH",
@@ -1738,6 +1742,121 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_M32R_GOTPC_HI_ULO",
"BFD_RELOC_M32R_GOTPC_HI_SLO",
"BFD_RELOC_M32R_GOTPC_LO",
+ "BFD_RELOC_NDS32_20",
+ "BFD_RELOC_NDS32_9_PCREL",
+ "BFD_RELOC_NDS32_WORD_9_PCREL",
+ "BFD_RELOC_NDS32_15_PCREL",
+ "BFD_RELOC_NDS32_17_PCREL",
+ "BFD_RELOC_NDS32_25_PCREL",
+ "BFD_RELOC_NDS32_HI20",
+ "BFD_RELOC_NDS32_LO12S3",
+ "BFD_RELOC_NDS32_LO12S2",
+ "BFD_RELOC_NDS32_LO12S1",
+ "BFD_RELOC_NDS32_LO12S0",
+ "BFD_RELOC_NDS32_LO12S0_ORI",
+ "BFD_RELOC_NDS32_SDA15S3",
+ "BFD_RELOC_NDS32_SDA15S2",
+ "BFD_RELOC_NDS32_SDA15S1",
+ "BFD_RELOC_NDS32_SDA15S0",
+ "BFD_RELOC_NDS32_SDA16S3",
+ "BFD_RELOC_NDS32_SDA17S2",
+ "BFD_RELOC_NDS32_SDA18S1",
+ "BFD_RELOC_NDS32_SDA19S0",
+ "BFD_RELOC_NDS32_GOT20",
+ "BFD_RELOC_NDS32_9_PLTREL",
+ "BFD_RELOC_NDS32_25_PLTREL",
+ "BFD_RELOC_NDS32_COPY",
+ "BFD_RELOC_NDS32_GLOB_DAT",
+ "BFD_RELOC_NDS32_JMP_SLOT",
+ "BFD_RELOC_NDS32_RELATIVE",
+ "BFD_RELOC_NDS32_GOTOFF",
+ "BFD_RELOC_NDS32_GOTOFF_HI20",
+ "BFD_RELOC_NDS32_GOTOFF_LO12",
+ "BFD_RELOC_NDS32_GOTPC20",
+ "BFD_RELOC_NDS32_GOT_HI20",
+ "BFD_RELOC_NDS32_GOT_LO12",
+ "BFD_RELOC_NDS32_GOTPC_HI20",
+ "BFD_RELOC_NDS32_GOTPC_LO12",
+ "BFD_RELOC_NDS32_INSN16",
+ "BFD_RELOC_NDS32_LABEL",
+ "BFD_RELOC_NDS32_LONGCALL1",
+ "BFD_RELOC_NDS32_LONGCALL2",
+ "BFD_RELOC_NDS32_LONGCALL3",
+ "BFD_RELOC_NDS32_LONGJUMP1",
+ "BFD_RELOC_NDS32_LONGJUMP2",
+ "BFD_RELOC_NDS32_LONGJUMP3",
+ "BFD_RELOC_NDS32_LOADSTORE",
+ "BFD_RELOC_NDS32_9_FIXED",
+ "BFD_RELOC_NDS32_15_FIXED",
+ "BFD_RELOC_NDS32_17_FIXED",
+ "BFD_RELOC_NDS32_25_FIXED",
+ "BFD_RELOC_NDS32_LONGCALL4",
+ "BFD_RELOC_NDS32_LONGCALL5",
+ "BFD_RELOC_NDS32_LONGCALL6",
+ "BFD_RELOC_NDS32_LONGJUMP4",
+ "BFD_RELOC_NDS32_LONGJUMP5",
+ "BFD_RELOC_NDS32_LONGJUMP6",
+ "BFD_RELOC_NDS32_LONGJUMP7",
+ "BFD_RELOC_NDS32_PLTREL_HI20",
+ "BFD_RELOC_NDS32_PLTREL_LO12",
+ "BFD_RELOC_NDS32_PLT_GOTREL_HI20",
+ "BFD_RELOC_NDS32_PLT_GOTREL_LO12",
+ "BFD_RELOC_NDS32_SDA12S2_DP",
+ "BFD_RELOC_NDS32_SDA12S2_SP",
+ "BFD_RELOC_NDS32_LO12S2_DP",
+ "BFD_RELOC_NDS32_LO12S2_SP",
+ "BFD_RELOC_NDS32_DWARF2_OP1",
+ "BFD_RELOC_NDS32_DWARF2_OP2",
+ "BFD_RELOC_NDS32_DWARF2_LEB",
+ "BFD_RELOC_NDS32_UPDATE_TA",
+ "BFD_RELOC_NDS32_PLT_GOTREL_LO20",
+ "BFD_RELOC_NDS32_PLT_GOTREL_LO15",
+ "BFD_RELOC_NDS32_PLT_GOTREL_LO19",
+ "BFD_RELOC_NDS32_GOT_LO15",
+ "BFD_RELOC_NDS32_GOT_LO19",
+ "BFD_RELOC_NDS32_GOTOFF_LO15",
+ "BFD_RELOC_NDS32_GOTOFF_LO19",
+ "BFD_RELOC_NDS32_GOT15S2",
+ "BFD_RELOC_NDS32_GOT17S2",
+ "BFD_RELOC_NDS32_5",
+ "BFD_RELOC_NDS32_10_UPCREL",
+ "BFD_RELOC_NDS32_SDA_FP7U2_RELA",
+ "BFD_RELOC_NDS32_RELAX_ENTRY",
+ "BFD_RELOC_NDS32_GOT_SUFF",
+ "BFD_RELOC_NDS32_GOTOFF_SUFF",
+ "BFD_RELOC_NDS32_PLT_GOT_SUFF",
+ "BFD_RELOC_NDS32_MULCALL_SUFF",
+ "BFD_RELOC_NDS32_PTR",
+ "BFD_RELOC_NDS32_PTR_COUNT",
+ "BFD_RELOC_NDS32_PTR_RESOLVED",
+ "BFD_RELOC_NDS32_PLTBLOCK",
+ "BFD_RELOC_NDS32_RELAX_REGION_BEGIN",
+ "BFD_RELOC_NDS32_RELAX_REGION_END",
+ "BFD_RELOC_NDS32_MINUEND",
+ "BFD_RELOC_NDS32_SUBTRAHEND",
+ "BFD_RELOC_NDS32_DIFF8",
+ "BFD_RELOC_NDS32_DIFF16",
+ "BFD_RELOC_NDS32_DIFF32",
+ "BFD_RELOC_NDS32_DIFF_ULEB128",
+ "BFD_RELOC_NDS32_EMPTY",
+ "BFD_RELOC_NDS32_25_ABS",
+ "BFD_RELOC_NDS32_DATA",
+ "BFD_RELOC_NDS32_TRAN",
+ "BFD_RELOC_NDS32_17IFC_PCREL",
+ "BFD_RELOC_NDS32_10IFCU_PCREL",
+ "BFD_RELOC_NDS32_TPOFF",
+ "BFD_RELOC_NDS32_TLS_LE_HI20",
+ "BFD_RELOC_NDS32_TLS_LE_LO12",
+ "BFD_RELOC_NDS32_TLS_LE_ADD",
+ "BFD_RELOC_NDS32_TLS_LE_LS",
+ "BFD_RELOC_NDS32_GOTTPOFF",
+ "BFD_RELOC_NDS32_TLS_IE_HI20",
+ "BFD_RELOC_NDS32_TLS_IE_LO12S2",
+ "BFD_RELOC_NDS32_TLS_TPOFF",
+ "BFD_RELOC_NDS32_TLS_LE_20",
+ "BFD_RELOC_NDS32_TLS_LE_15S0",
+ "BFD_RELOC_NDS32_TLS_LE_15S1",
+ "BFD_RELOC_NDS32_TLS_LE_15S2",
"BFD_RELOC_V850_9_PCREL",
"BFD_RELOC_V850_22_PCREL",
"BFD_RELOC_V850_SDA_16_16_OFFSET",
@@ -1939,6 +2058,12 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_AVR_8_LO",
"BFD_RELOC_AVR_8_HI",
"BFD_RELOC_AVR_8_HLO",
+ "BFD_RELOC_AVR_DIFF8",
+ "BFD_RELOC_AVR_DIFF16",
+ "BFD_RELOC_AVR_DIFF32",
+ "BFD_RELOC_AVR_LDS_STS_16",
+ "BFD_RELOC_AVR_PORT6",
+ "BFD_RELOC_AVR_PORT5",
"BFD_RELOC_RL78_NEG8",
"BFD_RELOC_RL78_NEG16",
"BFD_RELOC_RL78_NEG24",
@@ -2347,8 +2472,30 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_860_HIGH",
"BFD_RELOC_860_HIGOT",
"BFD_RELOC_860_HIGOTOFF",
- "BFD_RELOC_OPENRISC_ABS_26",
- "BFD_RELOC_OPENRISC_REL_26",
+ "BFD_RELOC_OR1K_REL_26",
+ "BFD_RELOC_OR1K_GOTPC_HI16",
+ "BFD_RELOC_OR1K_GOTPC_LO16",
+ "BFD_RELOC_OR1K_GOT16",
+ "BFD_RELOC_OR1K_PLT26",
+ "BFD_RELOC_OR1K_GOTOFF_HI16",
+ "BFD_RELOC_OR1K_GOTOFF_LO16",
+ "BFD_RELOC_OR1K_COPY",
+ "BFD_RELOC_OR1K_GLOB_DAT",
+ "BFD_RELOC_OR1K_JMP_SLOT",
+ "BFD_RELOC_OR1K_RELATIVE",
+ "BFD_RELOC_OR1K_TLS_GD_HI16",
+ "BFD_RELOC_OR1K_TLS_GD_LO16",
+ "BFD_RELOC_OR1K_TLS_LDM_HI16",
+ "BFD_RELOC_OR1K_TLS_LDM_LO16",
+ "BFD_RELOC_OR1K_TLS_LDO_HI16",
+ "BFD_RELOC_OR1K_TLS_LDO_LO16",
+ "BFD_RELOC_OR1K_TLS_IE_HI16",
+ "BFD_RELOC_OR1K_TLS_IE_LO16",
+ "BFD_RELOC_OR1K_TLS_LE_HI16",
+ "BFD_RELOC_OR1K_TLS_LE_LO16",
+ "BFD_RELOC_OR1K_TLS_TPOFF",
+ "BFD_RELOC_OR1K_TLS_DTPOFF",
+ "BFD_RELOC_OR1K_TLS_DTPMOD",
"BFD_RELOC_H8_DIR16A8",
"BFD_RELOC_H8_DIR16R8",
"BFD_RELOC_H8_DIR24A8",
@@ -2430,6 +2577,11 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_NIOS2_JUMP_SLOT",
"BFD_RELOC_NIOS2_RELATIVE",
"BFD_RELOC_NIOS2_GOTOFF",
+ "BFD_RELOC_NIOS2_CALL26_NOAT",
+ "BFD_RELOC_NIOS2_GOT_LO",
+ "BFD_RELOC_NIOS2_GOT_HA",
+ "BFD_RELOC_NIOS2_CALL_LO",
+ "BFD_RELOC_NIOS2_CALL_HA",
"BFD_RELOC_IQ2000_OFFSET_16",
"BFD_RELOC_IQ2000_OFFSET_21",
"BFD_RELOC_IQ2000_UHI16",
diff --git a/binutils-2.25/bfd/libcoff-in.h b/binutils-2.25/bfd/libcoff-in.h
index 6efbc524..6b6eb287 100644
--- a/binutils-2.25/bfd/libcoff-in.h
+++ b/binutils-2.25/bfd/libcoff-in.h
@@ -1,7 +1,5 @@
/* BFD COFF object file private structure.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -37,6 +35,7 @@
#define obj_coff_external_syms(bfd) (coff_data (bfd)->external_syms)
#define obj_coff_keep_syms(bfd) (coff_data (bfd)->keep_syms)
#define obj_coff_strings(bfd) (coff_data (bfd)->strings)
+#define obj_coff_strings_len(bfd) (coff_data (bfd)->strings_len)
#define obj_coff_keep_strings(bfd) (coff_data (bfd)->keep_strings)
#define obj_coff_sym_hashes(bfd) (coff_data (bfd)->sym_hashes)
#define obj_coff_strings_written(bfd) (coff_data (bfd)->strings_written)
@@ -55,7 +54,7 @@ typedef struct coff_tdata
unsigned long raw_syment_count;
/* These are only valid once writing has begun. */
- long int relocbase;
+ unsigned long int relocbase;
/* These members communicate important constants about the symbol table
to GDB's symbol-reading code. These `constants' unfortunately vary
@@ -77,6 +76,8 @@ typedef struct coff_tdata
/* The string table. May be NULL. Read by
_bfd_coff_read_string_table. */
char *strings;
+ /* The length of the strings table. For error checking. */
+ bfd_size_type strings_len;
/* If this is TRUE, the strings may not be freed. */
bfd_boolean keep_strings;
/* If this is TRUE, the strings have been written out already. */
@@ -118,8 +119,17 @@ typedef struct pe_tdata
int dll;
int has_reloc_section;
int dont_strip_reloc;
+ bfd_boolean insert_timestamp;
bfd_boolean (*in_reloc_p) (bfd *, reloc_howto_type *);
flagword real_flags;
+
+ /* Build-id info. */
+ struct
+ {
+ bfd_boolean (*after_write_object_contents) (bfd *);
+ const char *style;
+ asection *sec;
+ } build_id;
} pe_data_type;
#define pe_data(bfd) ((bfd)->tdata.pe_obj_data)
@@ -348,15 +358,13 @@ extern bfd_boolean _bfd_coff_is_local_label_name
extern asymbol *coff_bfd_make_debug_symbol
(bfd *, void *, unsigned long);
extern bfd_boolean coff_find_nearest_line
- (bfd *, asection *, asymbol **, bfd_vma, const char **,
- const char **, unsigned int *);
-extern bfd_boolean coff_find_nearest_line_discriminator
- (bfd *, asection *, asymbol **, bfd_vma, const char **,
- const char **, unsigned int *, unsigned int *);
+ (bfd *, asymbol **, asection *, bfd_vma,
+ const char **, const char **, unsigned int *, unsigned int *);
+#define coff_find_line _bfd_nosymbols_find_line
struct dwarf_debug_section;
extern bfd_boolean coff_find_nearest_line_with_names
- (bfd *, const struct dwarf_debug_section *, asection *, asymbol **,
- bfd_vma, const char **, const char **, unsigned int *);
+ (bfd *, asymbol **, asection *, bfd_vma, const char **, const char **,
+ unsigned int *, const struct dwarf_debug_section *);
extern bfd_boolean coff_find_inliner_info
(bfd *, const char **, const char **, unsigned int *);
extern int coff_sizeof_headers
@@ -596,8 +604,6 @@ extern long _bfd_xcoff_canonicalize_dynamic_reloc
(bfd *, arelent **, asymbol **);
extern struct bfd_link_hash_table *_bfd_xcoff_bfd_link_hash_table_create
(bfd *);
-extern void _bfd_xcoff_bfd_link_hash_table_free
- (struct bfd_link_hash_table *);
extern bfd_boolean _bfd_xcoff_bfd_link_add_symbols
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_xcoff_bfd_final_link
diff --git a/binutils-2.25/bfd/libcoff.h b/binutils-2.25/bfd/libcoff.h
index 6270bab8..94799857 100644
--- a/binutils-2.25/bfd/libcoff.h
+++ b/binutils-2.25/bfd/libcoff.h
@@ -3,9 +3,7 @@
Run "make headers" in your build bfd/ to regenerate. */
/* BFD COFF object file private structure.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -41,6 +39,7 @@
#define obj_coff_external_syms(bfd) (coff_data (bfd)->external_syms)
#define obj_coff_keep_syms(bfd) (coff_data (bfd)->keep_syms)
#define obj_coff_strings(bfd) (coff_data (bfd)->strings)
+#define obj_coff_strings_len(bfd) (coff_data (bfd)->strings_len)
#define obj_coff_keep_strings(bfd) (coff_data (bfd)->keep_strings)
#define obj_coff_sym_hashes(bfd) (coff_data (bfd)->sym_hashes)
#define obj_coff_strings_written(bfd) (coff_data (bfd)->strings_written)
@@ -59,7 +58,7 @@ typedef struct coff_tdata
unsigned long raw_syment_count;
/* These are only valid once writing has begun. */
- long int relocbase;
+ unsigned long int relocbase;
/* These members communicate important constants about the symbol table
to GDB's symbol-reading code. These `constants' unfortunately vary
@@ -81,6 +80,8 @@ typedef struct coff_tdata
/* The string table. May be NULL. Read by
_bfd_coff_read_string_table. */
char *strings;
+ /* The length of the strings table. For error checking. */
+ bfd_size_type strings_len;
/* If this is TRUE, the strings may not be freed. */
bfd_boolean keep_strings;
/* If this is TRUE, the strings have been written out already. */
@@ -122,8 +123,17 @@ typedef struct pe_tdata
int dll;
int has_reloc_section;
int dont_strip_reloc;
+ bfd_boolean insert_timestamp;
bfd_boolean (*in_reloc_p) (bfd *, reloc_howto_type *);
flagword real_flags;
+
+ /* Build-id info. */
+ struct
+ {
+ bfd_boolean (*after_write_object_contents) (bfd *);
+ const char *style;
+ asection *sec;
+ } build_id;
} pe_data_type;
#define pe_data(bfd) ((bfd)->tdata.pe_obj_data)
@@ -352,15 +362,13 @@ extern bfd_boolean _bfd_coff_is_local_label_name
extern asymbol *coff_bfd_make_debug_symbol
(bfd *, void *, unsigned long);
extern bfd_boolean coff_find_nearest_line
- (bfd *, asection *, asymbol **, bfd_vma, const char **,
- const char **, unsigned int *);
-extern bfd_boolean coff_find_nearest_line_discriminator
- (bfd *, asection *, asymbol **, bfd_vma, const char **,
- const char **, unsigned int *, unsigned int *);
+ (bfd *, asymbol **, asection *, bfd_vma,
+ const char **, const char **, unsigned int *, unsigned int *);
+#define coff_find_line _bfd_nosymbols_find_line
struct dwarf_debug_section;
extern bfd_boolean coff_find_nearest_line_with_names
- (bfd *, const struct dwarf_debug_section *, asection *, asymbol **,
- bfd_vma, const char **, const char **, unsigned int *);
+ (bfd *, asymbol **, asection *, bfd_vma, const char **, const char **,
+ unsigned int *, const struct dwarf_debug_section *);
extern bfd_boolean coff_find_inliner_info
(bfd *, const char **, const char **, unsigned int *);
extern int coff_sizeof_headers
@@ -600,8 +608,6 @@ extern long _bfd_xcoff_canonicalize_dynamic_reloc
(bfd *, arelent **, asymbol **);
extern struct bfd_link_hash_table *_bfd_xcoff_bfd_link_hash_table_create
(bfd *);
-extern void _bfd_xcoff_bfd_link_hash_table_free
- (struct bfd_link_hash_table *);
extern bfd_boolean _bfd_xcoff_bfd_link_add_symbols
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_xcoff_bfd_final_link
@@ -620,10 +626,11 @@ extern bfd_boolean ppc_allocate_toc_section
extern bfd_boolean ppc_process_before_allocation
(bfd *, struct bfd_link_info *);
/* Extracted from coffcode.h. */
+
typedef struct coff_ptr_struct
{
/* Remembers the offset from the first symbol in the file for
- this symbol. Generated by coff_renumber_symbols. */
+ this symbol. Generated by coff_renumber_symbols. */
unsigned int offset;
/* Should the value of this symbol be renumbered. Used for
@@ -631,15 +638,15 @@ typedef struct coff_ptr_struct
unsigned int fix_value : 1;
/* Should the tag field of this symbol be renumbered.
- Created by coff_pointerize_aux. */
+ Created by coff_pointerize_aux. */
unsigned int fix_tag : 1;
/* Should the endidx field of this symbol be renumbered.
- Created by coff_pointerize_aux. */
+ Created by coff_pointerize_aux. */
unsigned int fix_end : 1;
/* Should the x_csect.x_scnlen field be renumbered.
- Created by coff_pointerize_aux. */
+ Created by coff_pointerize_aux. */
unsigned int fix_scnlen : 1;
/* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the
@@ -647,12 +654,15 @@ typedef struct coff_ptr_struct
unsigned int fix_line : 1;
/* The container for the symbol structure as read and translated
- from the file. */
+ from the file. */
union
{
union internal_auxent auxent;
struct internal_syment syment;
} u;
+
+ /* Selector for the union above. */
+ bfd_boolean is_sym;
} combined_entry_type;
@@ -737,6 +747,7 @@ typedef struct
unsigned int _bfd_coff_default_section_alignment_power;
bfd_boolean _bfd_coff_force_symnames_in_strings;
unsigned int _bfd_coff_debug_string_prefix_length;
+ unsigned int _bfd_coff_max_nscns;
void (*_bfd_coff_swap_filehdr_in)
(bfd *, void *, void *);
@@ -874,6 +885,9 @@ typedef struct
((coff_backend_info (abfd)->_bfd_coff_set_long_section_names) (abfd, enable))
#define bfd_coff_default_section_alignment_power(abfd) \
(coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power)
+#define bfd_coff_max_nscns(abfd) \
+ (coff_backend_info (abfd)->_bfd_coff_max_nscns)
+
#define bfd_coff_swap_filehdr_in(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o))
diff --git a/binutils-2.25/bfd/libecoff.h b/binutils-2.25/bfd/libecoff.h
index 8afdccb0..06434c27 100644
--- a/binutils-2.25/bfd/libecoff.h
+++ b/binutils-2.25/bfd/libecoff.h
@@ -1,7 +1,5 @@
/* BFD ECOFF object file private structure.
- Copyright 1993, 1994, 1995, 1996, 1999, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -291,8 +289,9 @@ extern bfd_boolean _bfd_ecoff_bfd_is_local_label_name
(bfd *, const char *);
#define _bfd_ecoff_get_lineno _bfd_nosymbols_get_lineno
extern bfd_boolean _bfd_ecoff_find_nearest_line
- (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **,
- unsigned int *);
+ (bfd *, asymbol **, asection *, bfd_vma,
+ const char **, const char **, unsigned int *, unsigned int *);
+#define _bfd_ecoff_find_line _bfd_nosymbols_find_line
#define _bfd_ecoff_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define _bfd_ecoff_read_minisymbols _bfd_generic_read_minisymbols
#define _bfd_ecoff_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
@@ -313,7 +312,6 @@ extern int _bfd_ecoff_sizeof_headers (bfd *, struct bfd_link_info *);
/* ecoff_bfd_relax_section defined by backend. */
extern struct bfd_link_hash_table *_bfd_ecoff_bfd_link_hash_table_create
(bfd *);
-#define _bfd_ecoff_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
extern bfd_boolean _bfd_ecoff_bfd_link_add_symbols
(bfd *, struct bfd_link_info *);
#define _bfd_ecoff_bfd_link_just_syms _bfd_generic_link_just_syms
diff --git a/binutils-2.25/bfd/libhppa.h b/binutils-2.25/bfd/libhppa.h
index 5e0b155b..deb89d1c 100644
--- a/binutils-2.25/bfd/libhppa.h
+++ b/binutils-2.25/bfd/libhppa.h
@@ -1,6 +1,5 @@
/* HP PA-RISC SOM object file format: definitions internal to BFD.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
- 2003, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
diff --git a/binutils-2.25/bfd/libieee.h b/binutils-2.25/bfd/libieee.h
index 53f4c08a..7026b85f 100644
--- a/binutils-2.25/bfd/libieee.h
+++ b/binutils-2.25/bfd/libieee.h
@@ -1,6 +1,5 @@
/* IEEE-695 object file formats: definitions internal to BFD.
- Copyright 1990, 1991, 1992, 1994, 1996, 2001, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support. Mostly Steve Chamberlain's fault.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/libnlm.h b/binutils-2.25/bfd/libnlm.h
index 4a4939ee..96cc73d8 100644
--- a/binutils-2.25/bfd/libnlm.h
+++ b/binutils-2.25/bfd/libnlm.h
@@ -1,6 +1,5 @@
/* BFD back-end data structures for NLM (NetWare Loadable Modules) files.
- Copyright 1993, 1994, 2001, 2002, 2003, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/liboasys.h b/binutils-2.25/bfd/liboasys.h
index 8228d977..ea04d7e2 100644
--- a/binutils-2.25/bfd/liboasys.h
+++ b/binutils-2.25/bfd/liboasys.h
@@ -1,6 +1,5 @@
/* BFD internal declarations for Oasys file format handling.
- Copyright 1990, 1991, 1992, 1993, 1994, 1997, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Scrawled by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/libpei.h b/binutils-2.25/bfd/libpei.h
index 40026efa..ffcafded 100644
--- a/binutils-2.25/bfd/libpei.h
+++ b/binutils-2.25/bfd/libpei.h
@@ -1,6 +1,5 @@
/* Support for the generic parts of PE/PEI; common header information.
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005,
- 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
Written by Cygnus Solutions.
This file is part of BFD, the Binary File Descriptor library.
@@ -236,6 +235,9 @@
#define _bfd_XXi_swap_scnhdr_out _bfd_pex64i_swap_scnhdr_out
#define _bfd_XXi_swap_sym_in _bfd_pex64i_swap_sym_in
#define _bfd_XXi_swap_sym_out _bfd_pex64i_swap_sym_out
+#define _bfd_XXi_swap_debugdir_in _bfd_pex64i_swap_debugdir_in
+#define _bfd_XXi_swap_debugdir_out _bfd_pex64i_swap_debugdir_out
+#define _bfd_XXi_write_codeview_record _bfd_pex64i_write_codeview_record
#elif defined COFF_WITH_pep
@@ -267,6 +269,9 @@
#define _bfd_XXi_swap_scnhdr_out _bfd_pepi_swap_scnhdr_out
#define _bfd_XXi_swap_sym_in _bfd_pepi_swap_sym_in
#define _bfd_XXi_swap_sym_out _bfd_pepi_swap_sym_out
+#define _bfd_XXi_swap_debugdir_in _bfd_pepi_swap_debugdir_in
+#define _bfd_XXi_swap_debugdir_out _bfd_pepi_swap_debugdir_out
+#define _bfd_XXi_write_codeview_record _bfd_pepi_write_codeview_record
#else /* !COFF_WITH_pep */
@@ -298,6 +303,9 @@
#define _bfd_XXi_swap_scnhdr_out _bfd_pei_swap_scnhdr_out
#define _bfd_XXi_swap_sym_in _bfd_pei_swap_sym_in
#define _bfd_XXi_swap_sym_out _bfd_pei_swap_sym_out
+#define _bfd_XXi_swap_debugdir_in _bfd_pei_swap_debugdir_in
+#define _bfd_XXi_swap_debugdir_out _bfd_pei_swap_debugdir_out
+#define _bfd_XXi_write_codeview_record _bfd_pei_write_codeview_record
#endif /* !COFF_WITH_pep */
@@ -340,6 +348,9 @@ bfd_boolean _bfd_XX_print_private_bfd_data_common (bfd *, void *);
bfd_boolean _bfd_XX_bfd_copy_private_bfd_data_common (bfd *, bfd *);
void _bfd_XX_get_symbol_info (bfd *, asymbol *, symbol_info *);
bfd_boolean _bfd_XXi_final_link_postscript (bfd *, struct coff_final_link_info *);
+void _bfd_XXi_swap_debugdir_in (bfd *, void *, void *);
+unsigned _bfd_XXi_swap_debugdir_out (bfd *, void *, void *);
+unsigned _bfd_XXi_write_codeview_record (bfd *, file_ptr, CODEVIEW_INFO *);
/* The following are needed only for ONE of pe or pei, but don't
otherwise vary; peicode.h fixes up ifdefs but we provide the
diff --git a/binutils-2.25/bfd/libxcoff.h b/binutils-2.25/bfd/libxcoff.h
index 3f665247..9b9c9c71 100644
--- a/binutils-2.25/bfd/libxcoff.h
+++ b/binutils-2.25/bfd/libxcoff.h
@@ -1,5 +1,5 @@
/* BFD XCOFF object file private structure.
- Copyright 2001, 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
Written by Tom Rix, Redhat.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/linker.c b/binutils-2.25/bfd/linker.c
index 190520a5..abdf5b0e 100644
--- a/binutils-2.25/bfd/linker.c
+++ b/binutils-2.25/bfd/linker.c
@@ -1,7 +1,5 @@
/* linker.c -- BFD linker routines
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support
This file is part of BFD, the Binary File Descriptor library.
@@ -231,28 +229,16 @@ SUBSUBSECTION
@findex _bfd_generic_link_add_archive_symbols
In most cases the work of looking through the symbols in the
archive should be done by the
- <<_bfd_generic_link_add_archive_symbols>> function. This
- function builds a hash table from the archive symbol table and
- looks through the list of undefined symbols to see which
- elements should be included.
+ <<_bfd_generic_link_add_archive_symbols>> function.
<<_bfd_generic_link_add_archive_symbols>> is passed a function
to call to make the final decision about adding an archive
element to the link and to do the actual work of adding the
- symbols to the linker hash table.
-
- The function passed to
- <<_bfd_generic_link_add_archive_symbols>> must read the
- symbols of the archive element and decide whether the archive
- element should be included in the link. If the element is to
+ symbols to the linker hash table. If the element is to
be included, the <<add_archive_element>> linker callback
routine must be called with the element as an argument, and
the element's symbols must be added to the linker hash table
just as though the element had itself been passed to the
- <<_bfd_link_add_symbols>> function. The <<add_archive_element>>
- callback has the option to indicate that it would like to
- replace the element archive with a substitute BFD, in which
- case it is the symbols of that substitute BFD that must be
- added to the linker hash table instead.
+ <<_bfd_link_add_symbols>> function.
When the a.out <<_bfd_link_add_symbols>> function receives an
archive, it calls <<_bfd_generic_link_add_archive_symbols>>
@@ -315,7 +301,7 @@ SUBSUBSECTION
The <<input_bfds>> field of the <<bfd_link_info>> structure
will point to a list of all the input files included in the
- link. These files are linked through the <<link_next>> field
+ link. These files are linked through the <<link.next>> field
of the <<bfd>> structure.
Each section in the output file will have a list of
@@ -421,11 +407,14 @@ static bfd_boolean generic_link_add_object_symbols
static bfd_boolean generic_link_add_symbols
(bfd *, struct bfd_link_info *, bfd_boolean);
static bfd_boolean generic_link_check_archive_element_no_collect
- (bfd *, struct bfd_link_info *, bfd_boolean *);
+ (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, const char *,
+ bfd_boolean *);
static bfd_boolean generic_link_check_archive_element_collect
- (bfd *, struct bfd_link_info *, bfd_boolean *);
+ (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, const char *,
+ bfd_boolean *);
static bfd_boolean generic_link_check_archive_element
- (bfd *, struct bfd_link_info *, bfd_boolean *, bfd_boolean);
+ (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, const char *,
+ bfd_boolean *, bfd_boolean);
static bfd_boolean generic_link_add_symbol_list
(bfd *, struct bfd_link_info *, bfd_size_type count, asymbol **,
bfd_boolean);
@@ -484,11 +473,22 @@ _bfd_link_hash_table_init
const char *),
unsigned int entsize)
{
+ bfd_boolean ret;
+
+ BFD_ASSERT (!abfd->is_linker_output && !abfd->link.hash);
table->undefs = NULL;
table->undefs_tail = NULL;
table->type = bfd_link_generic_hash_table;
- return bfd_hash_table_init (&table->table, newfunc, entsize);
+ ret = bfd_hash_table_init (&table->table, newfunc, entsize);
+ if (ret)
+ {
+ /* Arrange for destruction of this hash table on closing ABFD. */
+ table->hash_table_free = _bfd_generic_link_hash_table_free;
+ abfd->link.hash = table;
+ abfd->is_linker_output = TRUE;
+ }
+ return ret;
}
/* Look up a symbol in a link hash table. If follow is TRUE, we
@@ -568,8 +568,6 @@ bfd_wrapped_link_hash_lookup (bfd *abfd,
return h;
}
-#undef WRAP
-
#undef REAL
#define REAL "__real_"
@@ -604,6 +602,42 @@ bfd_wrapped_link_hash_lookup (bfd *abfd,
return bfd_link_hash_lookup (info->hash, string, create, copy, follow);
}
+/* If H is a wrapped symbol, ie. the symbol name starts with "__wrap_"
+ and the remainder is found in wrap_hash, return the real symbol. */
+
+struct bfd_link_hash_entry *
+unwrap_hash_lookup (struct bfd_link_info *info,
+ bfd *input_bfd,
+ struct bfd_link_hash_entry *h)
+{
+ const char *l = h->root.string;
+
+ if (*l == bfd_get_symbol_leading_char (input_bfd)
+ || *l == info->wrap_char)
+ ++l;
+
+ if (CONST_STRNEQ (l, WRAP))
+ {
+ l += sizeof WRAP - 1;
+
+ if (bfd_hash_lookup (info->wrap_hash, l, FALSE, FALSE) != NULL)
+ {
+ char save = 0;
+ if (l - (sizeof WRAP - 1) != h->root.string)
+ {
+ --l;
+ save = *l;
+ *(char *) l = *h->root.string;
+ }
+ h = bfd_link_hash_lookup (info->hash, l, FALSE, FALSE, FALSE);
+ if (save)
+ *(char *) l = save;
+ }
+ }
+ return h;
+}
+#undef WRAP
+
/* Traverse a generic link hash table. Differs from bfd_hash_traverse
in the treatment of warning symbols. When warning symbols are
created they replace the real symbol, so you don't get to see the
@@ -739,13 +773,16 @@ _bfd_generic_link_hash_table_create (bfd *abfd)
}
void
-_bfd_generic_link_hash_table_free (struct bfd_link_hash_table *hash)
+_bfd_generic_link_hash_table_free (bfd *obfd)
{
- struct generic_link_hash_table *ret
- = (struct generic_link_hash_table *) hash;
+ struct generic_link_hash_table *ret;
+ BFD_ASSERT (obfd->is_linker_output && obfd->link.hash);
+ ret = (struct generic_link_hash_table *) obfd->link.hash;
bfd_hash_table_free (&ret->root.table);
free (ret);
+ obfd->link.hash = NULL;
+ obfd->is_linker_output = FALSE;
}
/* Grab the symbols for an object file when doing a generic link. We
@@ -815,14 +852,13 @@ _bfd_generic_link_just_syms (asection *sec,
sec->output_offset = sec->vma;
}
-/* Copy the type of a symbol assiciated with a linker hast table entry.
- Override this so that symbols created in linker scripts get their
- type from the RHS of the assignment.
+/* Copy the symbol type and other attributes for a linker script
+ assignment from HSRC to HDEST.
The default implementation does nothing. */
void
_bfd_generic_copy_link_hash_symbol_type (bfd *abfd ATTRIBUTE_UNUSED,
- struct bfd_link_hash_entry * hdest ATTRIBUTE_UNUSED,
- struct bfd_link_hash_entry * hsrc ATTRIBUTE_UNUSED)
+ struct bfd_link_hash_entry *hdest ATTRIBUTE_UNUSED,
+ struct bfd_link_hash_entry *hsrc ATTRIBUTE_UNUSED)
{
}
@@ -872,138 +908,32 @@ generic_link_add_object_symbols (bfd *abfd,
return generic_link_add_symbol_list (abfd, info, symcount, outsyms, collect);
}
-/* We build a hash table of all symbols defined in an archive. */
-
-/* An archive symbol may be defined by multiple archive elements.
- This linked list is used to hold the elements. */
-
-struct archive_list
-{
- struct archive_list *next;
- unsigned int indx;
-};
-
-/* An entry in an archive hash table. */
-
-struct archive_hash_entry
-{
- struct bfd_hash_entry root;
- /* Where the symbol is defined. */
- struct archive_list *defs;
-};
-
-/* An archive hash table itself. */
-
-struct archive_hash_table
-{
- struct bfd_hash_table table;
-};
-
-/* Create a new entry for an archive hash table. */
-
-static struct bfd_hash_entry *
-archive_hash_newfunc (struct bfd_hash_entry *entry,
- struct bfd_hash_table *table,
- const char *string)
-{
- struct archive_hash_entry *ret = (struct archive_hash_entry *) entry;
-
- /* Allocate the structure if it has not already been allocated by a
- subclass. */
- if (ret == NULL)
- ret = (struct archive_hash_entry *)
- bfd_hash_allocate (table, sizeof (struct archive_hash_entry));
- if (ret == NULL)
- return NULL;
-
- /* Call the allocation method of the superclass. */
- ret = ((struct archive_hash_entry *)
- bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));
-
- if (ret)
- {
- /* Initialize the local fields. */
- ret->defs = NULL;
- }
-
- return &ret->root;
-}
-
-/* Initialize an archive hash table. */
-
-static bfd_boolean
-archive_hash_table_init
- (struct archive_hash_table *table,
- struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *,
- struct bfd_hash_table *,
- const char *),
- unsigned int entsize)
-{
- return bfd_hash_table_init (&table->table, newfunc, entsize);
-}
-
-/* Look up an entry in an archive hash table. */
-
-#define archive_hash_lookup(t, string, create, copy) \
- ((struct archive_hash_entry *) \
- bfd_hash_lookup (&(t)->table, (string), (create), (copy)))
-
-/* Allocate space in an archive hash table. */
-
-#define archive_hash_allocate(t, size) bfd_hash_allocate (&(t)->table, (size))
-
-/* Free an archive hash table. */
-
-#define archive_hash_table_free(t) bfd_hash_table_free (&(t)->table)
-
/* Generic function to add symbols from an archive file to the global
hash file. This function presumes that the archive symbol table
has already been read in (this is normally done by the
- bfd_check_format entry point). It looks through the undefined and
- common symbols and searches the archive symbol table for them. If
- it finds an entry, it includes the associated object file in the
- link.
-
- The old linker looked through the archive symbol table for
- undefined symbols. We do it the other way around, looking through
- undefined symbols for symbols defined in the archive. The
- advantage of the newer scheme is that we only have to look through
- the list of undefined symbols once, whereas the old method had to
- re-search the symbol table each time a new object file was added.
-
- The CHECKFN argument is used to see if an object file should be
- included. CHECKFN should set *PNEEDED to TRUE if the object file
- should be included, and must also call the bfd_link_info
- add_archive_element callback function and handle adding the symbols
- to the global hash table. CHECKFN must notice if the callback
- indicates a substitute BFD, and arrange to add those symbols instead
- if it does so. CHECKFN should only return FALSE if some sort of
- error occurs.
-
- For some formats, such as a.out, it is possible to look through an
- object file but not actually include it in the link. The
- archive_pass field in a BFD is used to avoid checking the symbols
- of an object files too many times. When an object is included in
- the link, archive_pass is set to -1. If an object is scanned but
- not included, archive_pass is set to the pass number. The pass
- number is incremented each time a new object file is included. The
- pass number is used because when a new object file is included it
- may create new undefined symbols which cause a previously examined
- object file to be included. */
+ bfd_check_format entry point). It looks through the archive symbol
+ table for symbols that are undefined or common in the linker global
+ symbol hash table. When one is found, the CHECKFN argument is used
+ to see if an object file should be included. This allows targets
+ to customize common symbol behaviour. CHECKFN should set *PNEEDED
+ to TRUE if the object file should be included, and must also call
+ the bfd_link_info add_archive_element callback function and handle
+ adding the symbols to the global hash table. CHECKFN must notice
+ if the callback indicates a substitute BFD, and arrange to add
+ those symbols instead if it does so. CHECKFN should only return
+ FALSE if some sort of error occurs. */
bfd_boolean
_bfd_generic_link_add_archive_symbols
(bfd *abfd,
struct bfd_link_info *info,
- bfd_boolean (*checkfn) (bfd *, struct bfd_link_info *, bfd_boolean *))
+ bfd_boolean (*checkfn) (bfd *, struct bfd_link_info *,
+ struct bfd_link_hash_entry *, const char *,
+ bfd_boolean *))
{
- carsym *arsyms;
- carsym *arsym_end;
- register carsym *arsym;
- int pass;
- struct archive_hash_table arsym_hash;
- unsigned int indx;
- struct bfd_link_hash_entry **pundef;
+ bfd_boolean loop;
+ bfd_size_type amt;
+ unsigned char *included;
if (! bfd_has_map (abfd))
{
@@ -1014,148 +944,103 @@ _bfd_generic_link_add_archive_symbols
return FALSE;
}
- arsyms = bfd_ardata (abfd)->symdefs;
- arsym_end = arsyms + bfd_ardata (abfd)->symdef_count;
-
- /* In order to quickly determine whether an symbol is defined in
- this archive, we build a hash table of the symbols. */
- if (! archive_hash_table_init (&arsym_hash, archive_hash_newfunc,
- sizeof (struct archive_hash_entry)))
+ amt = bfd_ardata (abfd)->symdef_count;
+ if (amt == 0)
+ return TRUE;
+ amt *= sizeof (*included);
+ included = (unsigned char *) bfd_zmalloc (amt);
+ if (included == NULL)
return FALSE;
- for (arsym = arsyms, indx = 0; arsym < arsym_end; arsym++, indx++)
- {
- struct archive_hash_entry *arh;
- struct archive_list *l, **pp;
-
- arh = archive_hash_lookup (&arsym_hash, arsym->name, TRUE, FALSE);
- if (arh == NULL)
- goto error_return;
- l = ((struct archive_list *)
- archive_hash_allocate (&arsym_hash, sizeof (struct archive_list)));
- if (l == NULL)
- goto error_return;
- l->indx = indx;
- for (pp = &arh->defs; *pp != NULL; pp = &(*pp)->next)
- ;
- *pp = l;
- l->next = NULL;
- }
-
- /* The archive_pass field in the archive itself is used to
- initialize PASS, sine we may search the same archive multiple
- times. */
- pass = abfd->archive_pass + 1;
- /* New undefined symbols are added to the end of the list, so we
- only need to look through it once. */
- pundef = &info->hash->undefs;
- while (*pundef != NULL)
+ do
{
- struct bfd_link_hash_entry *h;
- struct archive_hash_entry *arh;
- struct archive_list *l;
-
- h = *pundef;
-
- /* When a symbol is defined, it is not necessarily removed from
- the list. */
- if (h->type != bfd_link_hash_undefined
- && h->type != bfd_link_hash_common)
+ carsym *arsyms;
+ carsym *arsym_end;
+ carsym *arsym;
+ unsigned int indx;
+ file_ptr last_ar_offset = -1;
+ bfd_boolean needed = FALSE;
+ bfd *element = NULL;
+
+ loop = FALSE;
+ arsyms = bfd_ardata (abfd)->symdefs;
+ arsym_end = arsyms + bfd_ardata (abfd)->symdef_count;
+ for (arsym = arsyms, indx = 0; arsym < arsym_end; arsym++, indx++)
{
- /* Remove this entry from the list, for general cleanliness
- and because we are going to look through the list again
- if we search any more libraries. We can't remove the
- entry if it is the tail, because that would lose any
- entries we add to the list later on (it would also cause
- us to lose track of whether the symbol has been
- referenced). */
- if (*pundef != info->hash->undefs_tail)
- *pundef = (*pundef)->u.undef.next;
- else
- pundef = &(*pundef)->u.undef.next;
- continue;
- }
-
- /* Look for this symbol in the archive symbol map. */
- arh = archive_hash_lookup (&arsym_hash, h->root.string, FALSE, FALSE);
- if (arh == NULL)
- {
- /* If we haven't found the exact symbol we're looking for,
- let's look for its import thunk */
- if (info->pei386_auto_import)
- {
- bfd_size_type amt = strlen (h->root.string) + 10;
- char *buf = (char *) bfd_malloc (amt);
- if (buf == NULL)
- return FALSE;
+ struct bfd_link_hash_entry *h;
+ struct bfd_link_hash_entry *undefs_tail;
- sprintf (buf, "__imp_%s", h->root.string);
- arh = archive_hash_lookup (&arsym_hash, buf, FALSE, FALSE);
- free(buf);
- }
- if (arh == NULL)
+ if (included[indx])
+ continue;
+ if (needed && arsym->file_offset == last_ar_offset)
{
- pundef = &(*pundef)->u.undef.next;
+ included[indx] = 1;
continue;
}
- }
- /* Look at all the objects which define this symbol. */
- for (l = arh->defs; l != NULL; l = l->next)
- {
- bfd *element;
- bfd_boolean needed;
-
- /* If the symbol has gotten defined along the way, quit. */
- if (h->type != bfd_link_hash_undefined
- && h->type != bfd_link_hash_common)
- break;
- element = bfd_get_elt_at_index (abfd, l->indx);
- if (element == NULL)
- goto error_return;
+ h = bfd_link_hash_lookup (info->hash, arsym->name,
+ FALSE, FALSE, TRUE);
- /* If we've already included this element, or if we've
- already checked it on this pass, continue. */
- if (element->archive_pass == -1
- || element->archive_pass == pass)
+ if (h == NULL
+ && info->pei386_auto_import
+ && CONST_STRNEQ (arsym->name, "__imp_"))
+ h = bfd_link_hash_lookup (info->hash, arsym->name + 6,
+ FALSE, FALSE, TRUE);
+ if (h == NULL)
continue;
- /* If we can't figure this element out, just ignore it. */
- if (! bfd_check_format (element, bfd_object))
+ if (h->type != bfd_link_hash_undefined
+ && h->type != bfd_link_hash_common)
{
- element->archive_pass = -1;
+ if (h->type != bfd_link_hash_undefweak)
+ /* Symbol must be defined. Don't check it again. */
+ included[indx] = 1;
continue;
}
+ if (last_ar_offset != arsym->file_offset)
+ {
+ last_ar_offset = arsym->file_offset;
+ element = _bfd_get_elt_at_filepos (abfd, last_ar_offset);
+ if (element == NULL
+ || !bfd_check_format (element, bfd_object))
+ goto error_return;
+ }
+
+ undefs_tail = info->hash->undefs_tail;
+
/* CHECKFN will see if this element should be included, and
go ahead and include it if appropriate. */
- if (! (*checkfn) (element, info, &needed))
+ if (! (*checkfn) (element, info, h, arsym->name, &needed))
goto error_return;
- if (! needed)
- element->archive_pass = pass;
- else
+ if (needed)
{
- element->archive_pass = -1;
+ unsigned int mark;
- /* Increment the pass count to show that we may need to
- recheck object files which were already checked. */
- ++pass;
+ /* Look backward to mark all symbols from this object file
+ which we have already seen in this pass. */
+ mark = indx;
+ do
+ {
+ included[mark] = 1;
+ if (mark == 0)
+ break;
+ --mark;
+ }
+ while (arsyms[mark].file_offset == last_ar_offset);
+
+ if (undefs_tail != info->hash->undefs_tail)
+ loop = TRUE;
}
}
+ } while (loop);
- pundef = &(*pundef)->u.undef.next;
- }
-
- archive_hash_table_free (&arsym_hash);
-
- /* Save PASS in case we are called again. */
- abfd->archive_pass = pass;
-
+ free (included);
return TRUE;
error_return:
- archive_hash_table_free (&arsym_hash);
+ free (included);
return FALSE;
}
@@ -1165,12 +1050,14 @@ _bfd_generic_link_add_archive_symbols
for finding them. */
static bfd_boolean
-generic_link_check_archive_element_no_collect (
- bfd *abfd,
+generic_link_check_archive_element_no_collect (bfd *abfd,
struct bfd_link_info *info,
+ struct bfd_link_hash_entry *h,
+ const char *name,
bfd_boolean *pneeded)
{
- return generic_link_check_archive_element (abfd, info, pneeded, FALSE);
+ return generic_link_check_archive_element (abfd, info, h, name, pneeded,
+ FALSE);
}
/* See if we should include an archive element. This version is used
@@ -1180,9 +1067,12 @@ generic_link_check_archive_element_no_collect (
static bfd_boolean
generic_link_check_archive_element_collect (bfd *abfd,
struct bfd_link_info *info,
+ struct bfd_link_hash_entry *h,
+ const char *name,
bfd_boolean *pneeded)
{
- return generic_link_check_archive_element (abfd, info, pneeded, TRUE);
+ return generic_link_check_archive_element (abfd, info, h, name, pneeded,
+ TRUE);
}
/* See if we should include an archive element. Optionally collect
@@ -1191,6 +1081,8 @@ generic_link_check_archive_element_collect (bfd *abfd,
static bfd_boolean
generic_link_check_archive_element (bfd *abfd,
struct bfd_link_info *info,
+ struct bfd_link_hash_entry *h,
+ const char *name ATTRIBUTE_UNUSED,
bfd_boolean *pneeded,
bfd_boolean collect)
{
@@ -1206,7 +1098,6 @@ generic_link_check_archive_element (bfd *abfd,
for (; pp < ppend; pp++)
{
asymbol *p;
- struct bfd_link_hash_entry *h;
p = *pp;
@@ -1229,29 +1120,21 @@ generic_link_check_archive_element (bfd *abfd,
/* P is a symbol we are looking for. */
- if (! bfd_is_com_section (p->section))
+ if (! bfd_is_com_section (p->section)
+ || (h->type == bfd_link_hash_undefined
+ && h->u.undef.abfd == NULL))
{
- bfd_size_type symcount;
- asymbol **symbols;
- bfd *oldbfd = abfd;
-
- /* This object file defines this symbol, so pull it in. */
+ /* P is not a common symbol, or an undefined reference was
+ created from outside BFD such as from a linker -u option.
+ This object file defines the symbol, so pull it in. */
+ *pneeded = TRUE;
if (!(*info->callbacks
->add_archive_element) (info, abfd, bfd_asymbol_name (p),
&abfd))
return FALSE;
/* Potentially, the add_archive_element hook may have set a
substitute BFD for us. */
- if (abfd != oldbfd
- && !bfd_generic_link_read_symbols (abfd))
- return FALSE;
- symcount = _bfd_generic_link_get_symcount (abfd);
- symbols = _bfd_generic_link_get_symbols (abfd);
- if (! generic_link_add_symbol_list (abfd, info, symcount,
- symbols, collect))
- return FALSE;
- *pneeded = TRUE;
- return TRUE;
+ return generic_link_add_object_symbols (abfd, info, collect);
}
/* P is a common symbol. */
@@ -1262,23 +1145,6 @@ generic_link_check_archive_element (bfd *abfd,
bfd_vma size;
unsigned int power;
- symbfd = h->u.undef.abfd;
- if (symbfd == NULL)
- {
- /* This symbol was created as undefined from outside
- BFD. We assume that we should link in the object
- file. This is for the -u option in the linker. */
- if (!(*info->callbacks
- ->add_archive_element) (info, abfd, bfd_asymbol_name (p),
- &abfd))
- return FALSE;
- /* Potentially, the add_archive_element hook may have set a
- substitute BFD for us. But no symbols are going to get
- registered by anything we're returning to from here. */
- *pneeded = TRUE;
- return TRUE;
- }
-
/* Turn the symbol into a common symbol but do not link in
the object file. This is how a.out works. Object
formats that require different semantics must implement
@@ -1286,6 +1152,7 @@ generic_link_check_archive_element (bfd *abfd,
undefs list. We add the section to a common section
attached to symbfd to ensure that it is in a BFD which
will be linked in. */
+ symbfd = h->u.undef.abfd;
h->type = bfd_link_hash_common;
h->u.c.p = (struct bfd_link_hash_common_entry *)
bfd_hash_allocate (&info->hash->table,
@@ -1475,8 +1342,7 @@ enum link_action
CIND, /* Make indirect symbol from existing common symbol. */
SET, /* Add value to set. */
MWARN, /* Make warning symbol. */
- WARN, /* Issue warning. */
- CWARN, /* Warn if referenced, else MWARN. */
+ WARN, /* Warn if referenced, else MWARN. */
CYCLE, /* Repeat with symbol pointed to. */
REFC, /* Mark indirect symbol referenced and then CYCLE. */
WARNC /* Issue warning and then CYCLE. */
@@ -1494,7 +1360,7 @@ static const enum link_action link_action[8][8] =
/* DEFW_ROW */ {DEFW, DEFW, DEFW, NOACT, NOACT, NOACT, NOACT, CYCLE },
/* COMMON_ROW */ {COM, COM, COM, CREF, COM, BIG, REFC, WARNC },
/* INDR_ROW */ {IND, IND, IND, MDEF, IND, CIND, MIND, CYCLE },
- /* WARN_ROW */ {MWARN, WARN, WARN, CWARN, CWARN, WARN, CWARN, NOACT },
+ /* WARN_ROW */ {MWARN, WARN, WARN, WARN, WARN, WARN, WARN, NOACT },
/* SET_ROW */ {SET, SET, SET, SET, SET, SET, CYCLE, CYCLE }
};
@@ -1576,13 +1442,23 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
{
enum link_row row;
struct bfd_link_hash_entry *h;
+ struct bfd_link_hash_entry *inh = NULL;
bfd_boolean cycle;
BFD_ASSERT (section != NULL);
if (bfd_is_ind_section (section)
|| (flags & BSF_INDIRECT) != 0)
- row = INDR_ROW;
+ {
+ row = INDR_ROW;
+ /* Create the indirect symbol here. This is for the benefit of
+ the plugin "notice" function.
+ STRING is the name of the symbol we want to indirect to. */
+ inh = bfd_wrapped_link_hash_lookup (abfd, info, string, TRUE,
+ copy, FALSE);
+ if (inh == NULL)
+ return FALSE;
+ }
else if ((flags & BSF_WARNING) != 0)
row = WARN_ROW;
else if ((flags & BSF_CONSTRUCTOR) != 0)
@@ -1597,7 +1473,13 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
else if ((flags & BSF_WEAK) != 0)
row = DEFW_ROW;
else if (bfd_is_com_section (section))
- row = COMMON_ROW;
+ {
+ row = COMMON_ROW;
+ if (strcmp (name, "__gnu_lto_slim") == 0)
+ (*_bfd_error_handler)
+ (_("%s: plugin needed to handle lto object"),
+ bfd_get_filename (abfd));
+ }
else
row = DEF_ROW;
@@ -1621,8 +1503,8 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
|| (info->notice_hash != NULL
&& bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) != NULL))
{
- if (! (*info->callbacks->notice) (info, h,
- abfd, section, value, flags, string))
+ if (! (*info->callbacks->notice) (info, h, inh,
+ abfd, section, value, flags))
return FALSE;
}
@@ -1856,44 +1738,40 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
return FALSE;
/* Fall through. */
case IND:
- /* Create an indirect symbol. */
- {
- struct bfd_link_hash_entry *inh;
-
- /* STRING is the name of the symbol we want to indirect
- to. */
- inh = bfd_wrapped_link_hash_lookup (abfd, info, string, TRUE,
- copy, FALSE);
- if (inh == NULL)
+ if (inh->type == bfd_link_hash_indirect
+ && inh->u.i.link == h)
+ {
+ (*_bfd_error_handler)
+ (_("%B: indirect symbol `%s' to `%s' is a loop"),
+ abfd, name, string);
+ bfd_set_error (bfd_error_invalid_operation);
return FALSE;
- if (inh->type == bfd_link_hash_indirect
- && inh->u.i.link == h)
- {
- (*_bfd_error_handler)
- (_("%B: indirect symbol `%s' to `%s' is a loop"),
- abfd, name, string);
- bfd_set_error (bfd_error_invalid_operation);
- return FALSE;
- }
- if (inh->type == bfd_link_hash_new)
- {
- inh->type = bfd_link_hash_undefined;
- inh->u.undef.abfd = abfd;
- bfd_link_add_undef (info->hash, inh);
- }
+ }
+ if (inh->type == bfd_link_hash_new)
+ {
+ inh->type = bfd_link_hash_undefined;
+ inh->u.undef.abfd = abfd;
+ bfd_link_add_undef (info->hash, inh);
+ }
- /* If the indirect symbol has been referenced, we need to
- push the reference down to the symbol we are
- referencing. */
- if (h->type != bfd_link_hash_new)
- {
- row = UNDEF_ROW;
- cycle = TRUE;
- }
+ /* If the indirect symbol has been referenced, we need to
+ push the reference down to the symbol we are referencing. */
+ if (h->type != bfd_link_hash_new)
+ {
+ /* ??? If inh->type == bfd_link_hash_undefweak this
+ converts inh to bfd_link_hash_undefined. */
+ row = UNDEF_ROW;
+ cycle = TRUE;
+ }
- h->type = bfd_link_hash_indirect;
- h->u.i.link = inh;
- }
+ h->type = bfd_link_hash_indirect;
+ h->u.i.link = inh;
+ /* Not setting h = h->u.i.link here means that when cycle is
+ set above we'll always go to REFC, and then cycle again
+ to the indirected symbol. This means that any successful
+ change of an existing symbol to indirect counts as a
+ reference. ??? That may not be correct when the existing
+ symbol was defweak. */
break;
case SET:
@@ -1904,8 +1782,10 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
break;
case WARNC:
- /* Issue a warning and cycle. */
- if (h->u.i.warning != NULL)
+ /* Issue a warning and cycle, except when the reference is
+ in LTO IR. */
+ if (h->u.i.warning != NULL
+ && (abfd->flags & BFD_PLUGIN) == 0)
{
if (! (*info->callbacks->warning) (info, h->u.i.warning,
h->root.string, abfd,
@@ -1930,19 +1810,11 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
break;
case WARN:
- /* Issue a warning. */
- if (! (*info->callbacks->warning) (info, string, h->root.string,
- hash_entry_bfd (h), NULL, 0))
- return FALSE;
- break;
-
- case CWARN:
- /* Warn if this symbol has been referenced already,
- otherwise add a warning. A symbol has been referenced if
- the u.undef.next field is not NULL, or it is the tail of the
- undefined symbol list. The REF case above helps to
- ensure this. */
- if (h->u.undef.next != NULL || info->hash->undefs_tail == h)
+ /* Warn if this symbol has been referenced already from non-IR,
+ otherwise add a warning. */
+ if ((!info->lto_plugin_active
+ && (h->u.undef.next != NULL || info->hash->undefs_tail == h))
+ || h->non_ir_ref)
{
if (! (*info->callbacks->warning) (info, string, h->root.string,
hash_entry_bfd (h), NULL, 0))
@@ -2014,7 +1886,7 @@ _bfd_generic_final_link (bfd *abfd, struct bfd_link_info *info)
p->u.indirect.section->linker_mark = TRUE;
/* Build the output symbol table. */
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
if (! _bfd_generic_link_output_symbols (abfd, sub, info, &outsymalloc))
return FALSE;
diff --git a/binutils-2.25/bfd/lynx-core.c b/binutils-2.25/bfd/lynx-core.c
index 0b4af043..dc4e4575 100644
--- a/binutils-2.25/bfd/lynx-core.c
+++ b/binutils-2.25/bfd/lynx-core.c
@@ -1,6 +1,5 @@
/* BFD back end for Lynx core files
- Copyright 1993, 1994, 1995, 2001, 2002, 2004, 2005, 2006, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Stu Grossman of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/m68k4knetbsd.c b/binutils-2.25/bfd/m68k4knetbsd.c
index 0722c3aa..254f9efe 100644
--- a/binutils-2.25/bfd/m68k4knetbsd.c
+++ b/binutils-2.25/bfd/m68k4knetbsd.c
@@ -1,6 +1,5 @@
/* BFD back-end for NetBSD/m68k a.out-ish binaries.
- Copyright 1990, 1991, 1992, 1995, 1998, 2001, 2003, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -29,7 +28,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (m68k4knetbsd_,OP)
+#define MY(OP) CONCAT2 (m68k_aout_4knbsd_,OP)
/* This needs to start with a.out so GDB knows it is an a.out variant. */
#define TARGETNAME "a.out-m68k4k-netbsd"
diff --git a/binutils-2.25/bfd/m68klinux.c b/binutils-2.25/bfd/m68klinux.c
index f612782a..036870fe 100644
--- a/binutils-2.25/bfd/m68klinux.c
+++ b/binutils-2.25/bfd/m68klinux.c
@@ -1,7 +1,5 @@
/* BFD back-end for linux flavored m68k a.out binaries.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -41,7 +39,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (m68klinux_,OP)
+#define MY(OP) CONCAT2 (m68k_aout_linux_,OP)
#define TARGETNAME "a.out-m68k-linux"
extern const bfd_target MY(vec);
diff --git a/binutils-2.25/bfd/m68knetbsd.c b/binutils-2.25/bfd/m68knetbsd.c
index 8ff0bddd..53a25633 100644
--- a/binutils-2.25/bfd/m68knetbsd.c
+++ b/binutils-2.25/bfd/m68knetbsd.c
@@ -1,6 +1,5 @@
/* BFD back-end for NetBSD/m68k a.out-ish binaries.
- Copyright 1990, 1991, 1992, 1994, 1995, 1997, 1998, 2000, 2001, 2003,
- 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -31,7 +30,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (m68knetbsd_,OP)
+#define MY(OP) CONCAT2 (m68k_aout_nbsd_,OP)
/* This needs to start with a.out so GDB knows it is an a.out variant. */
#define TARGETNAME "a.out-m68k-netbsd"
diff --git a/binutils-2.25/bfd/m88kmach3.c b/binutils-2.25/bfd/m88kmach3.c
index d98b4c77..b6c87fb6 100644
--- a/binutils-2.25/bfd/m88kmach3.c
+++ b/binutils-2.25/bfd/m88kmach3.c
@@ -1,6 +1,5 @@
/* BFD back-end for Motorola m88k a.out (Mach 3) binaries.
- Copyright 1990, 1991, 1993, 1994, 1995, 2001, 2003, 2005, 2007, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -36,7 +35,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (m88kmach3_,OP)
+#define MY(OP) CONCAT2 (m88k_aout_mach3_,OP)
#define TARGETNAME "a.out-m88k-mach3"
#include "aout-target.h"
diff --git a/binutils-2.25/bfd/m88kopenbsd.c b/binutils-2.25/bfd/m88kopenbsd.c
index 8d9f0337..d970d946 100644
--- a/binutils-2.25/bfd/m88kopenbsd.c
+++ b/binutils-2.25/bfd/m88kopenbsd.c
@@ -1,5 +1,5 @@
/* BFD back-end for OpenBSD/m88k a.out binaries.
- Copyright 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -28,7 +28,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (m88kopenbsd_,OP)
+#define MY(OP) CONCAT2 (m88k_aout_obsd_,OP)
#define TARGETNAME "a.out-m88k-openbsd"
#include "netbsd.h"
diff --git a/binutils-2.25/bfd/mach-o-i386.c b/binutils-2.25/bfd/mach-o-i386.c
index 97e0d58b..a7d3a110 100644
--- a/binutils-2.25/bfd/mach-o-i386.c
+++ b/binutils-2.25/bfd/mach-o-i386.c
@@ -1,6 +1,5 @@
/* Intel i386 Mach-O support for BFD.
- Copyright 2009
- Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -211,7 +210,8 @@ bfd_mach_o_i386_swap_reloc_out (arelent *rel, bfd_mach_o_reloc_info *rinfo)
if ((*rel->sym_ptr_ptr)->flags & BSF_SECTION_SYM)
{
rinfo->r_extern = 0;
- rinfo->r_value = (*rel->sym_ptr_ptr)->section->target_index;
+ rinfo->r_value =
+ (*rel->sym_ptr_ptr)->section->output_section->target_index;
}
else
{
@@ -394,9 +394,10 @@ const mach_o_segment_name_xlat mach_o_i386_segsec_names_xlat[] =
#define bfd_mach_o_bfd_reloc_type_lookup bfd_mach_o_i386_bfd_reloc_type_lookup
#define bfd_mach_o_bfd_reloc_name_lookup bfd_mach_o_i386_bfd_reloc_name_lookup
-#define TARGET_NAME mach_o_i386_vec
+#define TARGET_NAME i386_mach_o_vec
#define TARGET_STRING "mach-o-i386"
#define TARGET_ARCHITECTURE bfd_arch_i386
+#define TARGET_PAGESIZE 4096
#define TARGET_BIG_ENDIAN 0
#define TARGET_ARCHIVE 0
#define TARGET_PRIORITY 0
diff --git a/binutils-2.25/bfd/mach-o-target.c b/binutils-2.25/bfd/mach-o-target.c
index 497d1fae..a070e677 100644
--- a/binutils-2.25/bfd/mach-o-target.c
+++ b/binutils-2.25/bfd/mach-o-target.c
@@ -1,6 +1,5 @@
/* Mach-O support for BFD.
- Copyright 1999, 2000, 2001, 2002, 2005, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -38,7 +37,6 @@
#define bfd_mach_o_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
#define bfd_mach_o_bfd_relax_section bfd_generic_relax_section
#define bfd_mach_o_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define bfd_mach_o_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define bfd_mach_o_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define bfd_mach_o_bfd_link_just_syms _bfd_generic_link_just_syms
#define bfd_mach_o_bfd_copy_link_hash_symbol_type \
@@ -55,7 +53,7 @@
#define bfd_mach_o_bfd_discard_group bfd_generic_discard_group
#define bfd_mach_o_section_already_linked _bfd_generic_section_already_linked
#define bfd_mach_o_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define bfd_mach_o_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
+#define bfd_mach_o_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
#define bfd_mach_o_core_file_matches_executable_p generic_core_file_matches_executable_p
#define bfd_mach_o_core_file_pid _bfd_nocore_core_file_pid
@@ -86,6 +84,10 @@
#error TARGET_ARCHIVE must be defined
#endif /* TARGET_ARCHIVE */
+#ifndef TARGET_PAGESIZE
+#error TARGET_PAGESIZE must be defined
+#endif
+
#if ((TARGET_ARCHIVE) && (! TARGET_BIG_ENDIAN))
#error Mach-O fat files must always be big-endian.
#endif /* ((TARGET_ARCHIVE) && (! TARGET_BIG_ENDIAN)) */
@@ -93,6 +95,7 @@
static const bfd_mach_o_backend_data TARGET_NAME_BACKEND =
{
TARGET_ARCHITECTURE,
+ TARGET_PAGESIZE,
bfd_mach_o_swap_reloc_in,
bfd_mach_o_swap_reloc_out,
bfd_mach_o_print_thread,
diff --git a/binutils-2.25/bfd/mach-o-x86-64.c b/binutils-2.25/bfd/mach-o-x86-64.c
index 232701e8..c0042cb1 100644
--- a/binutils-2.25/bfd/mach-o-x86-64.c
+++ b/binutils-2.25/bfd/mach-o-x86-64.c
@@ -1,6 +1,5 @@
/* Intel x86-64 Mach-O support for BFD.
- Copyright 2010
- Free Software Foundation, Inc.
+ Copyright (C) 2010-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -54,7 +53,8 @@ bfd_mach_o_x86_64_mkobject (bfd *abfd)
mdata = bfd_mach_o_get_data (abfd);
mdata->header.magic = BFD_MACH_O_MH_MAGIC_64;
mdata->header.cputype = BFD_MACH_O_CPU_TYPE_X86_64;
- mdata->header.cpusubtype = BFD_MACH_O_CPU_SUBTYPE_X86_ALL;
+ mdata->header.cpusubtype =
+ BFD_MACH_O_CPU_SUBTYPE_X86_ALL | BFD_MACH_O_CPU_SUBTYPE_LIB64;
mdata->header.byteorder = BFD_ENDIAN_LITTLE;
mdata->header.version = 2;
@@ -285,7 +285,8 @@ bfd_mach_o_x86_64_swap_reloc_out (arelent *rel, bfd_mach_o_reloc_info *rinfo)
if ((*rel->sym_ptr_ptr)->flags & BSF_SECTION_SYM)
{
rinfo->r_extern = 0;
- rinfo->r_value = (*rel->sym_ptr_ptr)->section->target_index;
+ rinfo->r_value =
+ (*rel->sym_ptr_ptr)->section->output_section->target_index;
}
else
{
@@ -352,9 +353,10 @@ const mach_o_segment_name_xlat mach_o_x86_64_segsec_names_xlat[] =
#define bfd_mach_o_tgt_seg_table mach_o_x86_64_segsec_names_xlat
#define bfd_mach_o_section_type_valid_for_tgt bfd_mach_o_section_type_valid_for_x86_64
-#define TARGET_NAME mach_o_x86_64_vec
+#define TARGET_NAME x86_64_mach_o_vec
#define TARGET_STRING "mach-o-x86-64"
#define TARGET_ARCHITECTURE bfd_arch_i386
+#define TARGET_PAGESIZE 4096
#define TARGET_BIG_ENDIAN 0
#define TARGET_ARCHIVE 0
#define TARGET_PRIORITY 0
diff --git a/binutils-2.25/bfd/mach-o.c b/binutils-2.25/bfd/mach-o.c
index 32e48ac3..39526898 100644
--- a/binutils-2.25/bfd/mach-o.c
+++ b/binutils-2.25/bfd/mach-o.c
@@ -1,5 +1,5 @@
/* Mach-O support for BFD.
- Copyright 1999-2013 Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -37,6 +37,9 @@
#define FILE_ALIGN(off, algn) \
(((off) + ((file_ptr) 1 << (algn)) - 1) & ((file_ptr) -1 << (algn)))
+static bfd_boolean
+bfd_mach_o_read_dyld_content (bfd *abfd, bfd_mach_o_dyld_info_command *cmd);
+
unsigned int
bfd_mach_o_version (bfd *abfd)
{
@@ -467,7 +470,8 @@ bfd_mach_o_convert_section_name_to_mach_o (bfd *abfd ATTRIBUTE_UNUSED,
seglen = dot - name;
seclen = len - (dot + 1 - name);
- if (seglen < 16 && seclen < 16)
+ if (seglen <= BFD_MACH_O_SEGNAME_SIZE
+ && seclen <= BFD_MACH_O_SECTNAME_SIZE)
{
memcpy (section->segname, name, seglen);
section->segname[seglen] = 0;
@@ -528,6 +532,20 @@ bfd_mach_o_section_get_nbr_indirect (bfd *abfd, bfd_mach_o_section *sec)
return sec->size / elsz;
}
+/* Append command CMD to ABFD. Note that header.ncmds is not updated. */
+
+static void
+bfd_mach_o_append_command (bfd *abfd, bfd_mach_o_load_command *cmd)
+{
+ bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
+
+ if (mdata->last_command != NULL)
+ mdata->last_command->next = cmd;
+ else
+ mdata->first_command = cmd;
+ mdata->last_command = cmd;
+ cmd->next = NULL;
+}
/* Copy any private info we understand from the input symbol
to the output symbol. */
@@ -539,12 +557,14 @@ bfd_mach_o_bfd_copy_private_symbol_data (bfd *ibfd ATTRIBUTE_UNUSED,
asymbol *osymbol)
{
bfd_mach_o_asymbol *os, *is;
+
os = (bfd_mach_o_asymbol *)osymbol;
is = (bfd_mach_o_asymbol *)isymbol;
os->n_type = is->n_type;
os->n_sect = is->n_sect;
os->n_desc = is->n_desc;
os->symbol.udata.i = is->symbol.udata.i;
+
return TRUE;
}
@@ -552,20 +572,22 @@ bfd_mach_o_bfd_copy_private_symbol_data (bfd *ibfd ATTRIBUTE_UNUSED,
to the output section. */
bfd_boolean
-bfd_mach_o_bfd_copy_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED,
- asection *isection,
- bfd *obfd ATTRIBUTE_UNUSED,
- asection *osection)
+bfd_mach_o_bfd_copy_private_section_data (bfd *ibfd, asection *isection,
+ bfd *obfd, asection *osection)
{
- if (osection->used_by_bfd == NULL)
- osection->used_by_bfd = isection->used_by_bfd;
- else
- if (isection->used_by_bfd != NULL)
- memcpy (osection->used_by_bfd, isection->used_by_bfd,
- sizeof (bfd_mach_o_section));
+ bfd_mach_o_section *os = bfd_mach_o_get_mach_o_section (osection);
+ bfd_mach_o_section *is = bfd_mach_o_get_mach_o_section (isection);
+
+ if (ibfd->xvec->flavour != bfd_target_mach_o_flavour
+ || obfd->xvec->flavour != bfd_target_mach_o_flavour)
+ return TRUE;
+
+ BFD_ASSERT (is != NULL && os != NULL);
- if (osection->used_by_bfd != NULL)
- ((bfd_mach_o_section *)osection->used_by_bfd)->bfdsection = osection;
+ os->flags = is->flags;
+ os->reserved1 = is->reserved1;
+ os->reserved2 = is->reserved2;
+ os->reserved3 = is->reserved3;
return TRUE;
}
@@ -574,8 +596,12 @@ bfd_mach_o_bfd_copy_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED,
to the output bfd. */
bfd_boolean
-bfd_mach_o_bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
+bfd_mach_o_bfd_copy_private_header_data (bfd *ibfd, bfd *obfd)
{
+ bfd_mach_o_data_struct *imdata;
+ bfd_mach_o_data_struct *omdata;
+ bfd_mach_o_load_command *icmd;
+
if (bfd_get_flavour (ibfd) != bfd_target_mach_o_flavour
|| bfd_get_flavour (obfd) != bfd_target_mach_o_flavour)
return TRUE;
@@ -583,7 +609,98 @@ bfd_mach_o_bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
BFD_ASSERT (bfd_mach_o_valid (ibfd));
BFD_ASSERT (bfd_mach_o_valid (obfd));
- /* FIXME: copy commands. */
+ imdata = bfd_mach_o_get_data (ibfd);
+ omdata = bfd_mach_o_get_data (obfd);
+
+ /* Copy header flags. */
+ omdata->header.flags = imdata->header.flags;
+
+ /* Copy commands. */
+ for (icmd = imdata->first_command; icmd != NULL; icmd = icmd->next)
+ {
+ bfd_mach_o_load_command *ocmd;
+
+ switch (icmd->type)
+ {
+ case BFD_MACH_O_LC_LOAD_DYLIB:
+ case BFD_MACH_O_LC_LOAD_DYLINKER:
+ case BFD_MACH_O_LC_DYLD_INFO:
+ /* Command is copied. */
+ ocmd = bfd_alloc (obfd, sizeof (bfd_mach_o_load_command));
+ if (ocmd == NULL)
+ return FALSE;
+
+ /* Copy common fields. */
+ ocmd->type = icmd->type;
+ ocmd->type_required = icmd->type_required;
+ ocmd->offset = 0;
+ ocmd->len = icmd->len;
+ break;
+
+ default:
+ /* Command is not copied. */
+ continue;
+ break;
+ }
+
+ switch (icmd->type)
+ {
+ case BFD_MACH_O_LC_LOAD_DYLIB:
+ {
+ bfd_mach_o_dylib_command *idy = &icmd->command.dylib;
+ bfd_mach_o_dylib_command *ody = &ocmd->command.dylib;
+
+ ody->name_offset = idy->name_offset;
+ ody->timestamp = idy->timestamp;
+ ody->current_version = idy->current_version;
+ ody->compatibility_version = idy->compatibility_version;
+ ody->name_str = idy->name_str;
+ }
+ break;
+
+ case BFD_MACH_O_LC_LOAD_DYLINKER:
+ {
+ bfd_mach_o_dylinker_command *idy = &icmd->command.dylinker;
+ bfd_mach_o_dylinker_command *ody = &ocmd->command.dylinker;
+
+ ody->name_offset = idy->name_offset;
+ ody->name_str = idy->name_str;
+ }
+ break;
+
+ case BFD_MACH_O_LC_DYLD_INFO:
+ {
+ bfd_mach_o_dyld_info_command *idy = &icmd->command.dyld_info;
+ bfd_mach_o_dyld_info_command *ody = &ocmd->command.dyld_info;
+
+ if (bfd_mach_o_read_dyld_content (ibfd, idy))
+ {
+ ody->rebase_size = idy->rebase_size;
+ ody->rebase_content = idy->rebase_content;
+
+ ody->bind_size = idy->bind_size;
+ ody->bind_content = idy->bind_content;
+
+ ody->weak_bind_size = idy->weak_bind_size;
+ ody->weak_bind_content = idy->weak_bind_content;
+
+ ody->lazy_bind_size = idy->lazy_bind_size;
+ ody->lazy_bind_content = idy->lazy_bind_content;
+
+ ody->export_size = idy->export_size;
+ ody->export_content = idy->export_content;
+ }
+ }
+ break;
+
+ default:
+ /* That command should be handled. */
+ abort ();
+ }
+
+ /* Insert command. */
+ bfd_mach_o_append_command (obfd, ocmd);
+ }
return TRUE;
}
@@ -905,12 +1022,57 @@ bfd_mach_o_convert_architecture (bfd_mach_o_cpu_type mtype,
*type = bfd_arch_powerpc;
*subtype = bfd_mach_ppc64;
break;
+ case BFD_MACH_O_CPU_TYPE_ARM64:
+ *type = bfd_arch_aarch64;
+ *subtype = bfd_mach_aarch64;
+ break;
default:
*type = bfd_arch_unknown;
break;
}
}
+/* Write n NUL bytes to ABFD so that LEN + n is a multiple of 4. Return the
+ number of bytes written or -1 in case of error. */
+
+static int
+bfd_mach_o_pad4 (bfd *abfd, unsigned int len)
+{
+ if (len % 4 != 0)
+ {
+ char pad[4] = {0,0,0,0};
+ unsigned int padlen = 4 - (len % 4);
+
+ if (bfd_bwrite (pad, padlen, abfd) != padlen)
+ return -1;
+
+ return padlen;
+ }
+ else
+ return 0;
+}
+
+/* Likewise, but for a command. */
+
+static int
+bfd_mach_o_pad_command (bfd *abfd, unsigned int len)
+{
+ unsigned int align = bfd_mach_o_wide_p (abfd) ? 8 : 4;
+
+ if (len % align != 0)
+ {
+ char pad[8] = {0};
+ unsigned int padlen = align - (len % align);
+
+ if (bfd_bwrite (pad, padlen, abfd) != padlen)
+ return -1;
+
+ return padlen;
+ }
+ else
+ return 0;
+}
+
static bfd_boolean
bfd_mach_o_write_header (bfd *abfd, bfd_mach_o_header *header)
{
@@ -938,7 +1100,7 @@ bfd_mach_o_write_header (bfd *abfd, bfd_mach_o_header *header)
return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_write_thread (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_thread_command *cmd = &command->command.thread;
@@ -949,7 +1111,7 @@ bfd_mach_o_write_thread (bfd *abfd, bfd_mach_o_load_command *command)
BFD_ASSERT ((command->type == BFD_MACH_O_LC_THREAD)
|| (command->type == BFD_MACH_O_LC_UNIXTHREAD));
- offset = 8;
+ offset = BFD_MACH_O_LC_SIZE;
for (i = 0; i < cmd->nflavours; i++)
{
BFD_ASSERT ((cmd->flavours[i].size % 4) == 0);
@@ -961,12 +1123,131 @@ bfd_mach_o_write_thread (bfd *abfd, bfd_mach_o_load_command *command)
if (bfd_seek (abfd, command->offset + offset, SEEK_SET) != 0
|| bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
offset += cmd->flavours[i].size + sizeof (raw);
}
- return 0;
+ return TRUE;
+}
+
+static bfd_boolean
+bfd_mach_o_write_dylinker (bfd *abfd, bfd_mach_o_load_command *command)
+{
+ bfd_mach_o_dylinker_command *cmd = &command->command.dylinker;
+ struct mach_o_str_command_external raw;
+ unsigned int namelen;
+
+ bfd_h_put_32 (abfd, cmd->name_offset, raw.str);
+
+ if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
+ || bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
+ return FALSE;
+
+ namelen = strlen (cmd->name_str) + 1;
+ if (bfd_bwrite (cmd->name_str, namelen, abfd) != namelen)
+ return FALSE;
+
+ if (bfd_mach_o_pad_command (abfd, namelen) < 0)
+ return FALSE;
+
+ return TRUE;
+}
+
+static bfd_boolean
+bfd_mach_o_write_dylib (bfd *abfd, bfd_mach_o_load_command *command)
+{
+ bfd_mach_o_dylib_command *cmd = &command->command.dylib;
+ struct mach_o_dylib_command_external raw;
+ unsigned int namelen;
+
+ bfd_h_put_32 (abfd, cmd->name_offset, raw.name);
+ bfd_h_put_32 (abfd, cmd->timestamp, raw.timestamp);
+ bfd_h_put_32 (abfd, cmd->current_version, raw.current_version);
+ bfd_h_put_32 (abfd, cmd->compatibility_version, raw.compatibility_version);
+
+ if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
+ || bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
+ return FALSE;
+
+ namelen = strlen (cmd->name_str) + 1;
+ if (bfd_bwrite (cmd->name_str, namelen, abfd) != namelen)
+ return FALSE;
+
+ if (bfd_mach_o_pad_command (abfd, namelen) < 0)
+ return FALSE;
+
+ return TRUE;
+}
+
+static bfd_boolean
+bfd_mach_o_write_main (bfd *abfd, bfd_mach_o_load_command *command)
+{
+ bfd_mach_o_main_command *cmd = &command->command.main;
+ struct mach_o_entry_point_command_external raw;
+
+ bfd_h_put_64 (abfd, cmd->entryoff, raw.entryoff);
+ bfd_h_put_64 (abfd, cmd->stacksize, raw.stacksize);
+
+ if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
+ || bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
+ return FALSE;
+
+ return TRUE;
+}
+
+static bfd_boolean
+bfd_mach_o_write_dyld_info (bfd *abfd, bfd_mach_o_load_command *command)
+{
+ bfd_mach_o_dyld_info_command *cmd = &command->command.dyld_info;
+ struct mach_o_dyld_info_command_external raw;
+
+ bfd_h_put_32 (abfd, cmd->rebase_off, raw.rebase_off);
+ bfd_h_put_32 (abfd, cmd->rebase_size, raw.rebase_size);
+ bfd_h_put_32 (abfd, cmd->bind_off, raw.bind_off);
+ bfd_h_put_32 (abfd, cmd->bind_size, raw.bind_size);
+ bfd_h_put_32 (abfd, cmd->weak_bind_off, raw.weak_bind_off);
+ bfd_h_put_32 (abfd, cmd->weak_bind_size, raw.weak_bind_size);
+ bfd_h_put_32 (abfd, cmd->lazy_bind_off, raw.lazy_bind_off);
+ bfd_h_put_32 (abfd, cmd->lazy_bind_size, raw.lazy_bind_size);
+ bfd_h_put_32 (abfd, cmd->export_off, raw.export_off);
+ bfd_h_put_32 (abfd, cmd->export_size, raw.export_size);
+
+ if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
+ || bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
+ return FALSE;
+
+ if (cmd->rebase_size != 0)
+ if (bfd_seek (abfd, cmd->rebase_off, SEEK_SET) != 0
+ || (bfd_bwrite (cmd->rebase_content, cmd->rebase_size, abfd) !=
+ cmd->rebase_size))
+ return FALSE;
+
+ if (cmd->bind_size != 0)
+ if (bfd_seek (abfd, cmd->bind_off, SEEK_SET) != 0
+ || (bfd_bwrite (cmd->bind_content, cmd->bind_size, abfd) !=
+ cmd->bind_size))
+ return FALSE;
+
+ if (cmd->weak_bind_size != 0)
+ if (bfd_seek (abfd, cmd->weak_bind_off, SEEK_SET) != 0
+ || (bfd_bwrite (cmd->weak_bind_content, cmd->weak_bind_size, abfd) !=
+ cmd->weak_bind_size))
+ return FALSE;
+
+ if (cmd->lazy_bind_size != 0)
+ if (bfd_seek (abfd, cmd->lazy_bind_off, SEEK_SET) != 0
+ || (bfd_bwrite (cmd->lazy_bind_content, cmd->lazy_bind_size, abfd) !=
+ cmd->lazy_bind_size))
+ return FALSE;
+
+ if (cmd->export_size != 0)
+ if (bfd_seek (abfd, cmd->export_off, SEEK_SET) != 0
+ || (bfd_bwrite (cmd->export_content, cmd->export_size, abfd) !=
+ cmd->export_size))
+ return FALSE;
+
+ return TRUE;
}
long
@@ -1071,7 +1352,7 @@ bfd_mach_o_canonicalize_one_reloc (bfd *abfd,
/* An external symbol number. */
sym = syms + num;
}
- else if (num == 0x00ffffff)
+ else if (num == 0x00ffffff || num == 0)
{
/* The 'symnum' in a non-scattered PAIR is 0x00ffffff. But as this
is generic code, we don't know wether this is really a PAIR.
@@ -1083,7 +1364,6 @@ bfd_mach_o_canonicalize_one_reloc (bfd *abfd,
else
{
/* A section number. */
- BFD_ASSERT (num != 0);
BFD_ASSERT (num <= mdata->nsects);
sym = mdata->sections[num - 1]->bfdsection->symbol_ptr_ptr;
@@ -1322,9 +1602,9 @@ bfd_mach_o_write_relocs (bfd *abfd, bfd_mach_o_section *section)
v = BFD_MACH_O_SR_SCATTERED
| (pinfo->r_pcrel ? BFD_MACH_O_SR_PCREL : 0)
- | BFD_MACH_O_SET_SR_LENGTH(pinfo->r_length)
- | BFD_MACH_O_SET_SR_TYPE(pinfo->r_type)
- | BFD_MACH_O_SET_SR_ADDRESS(pinfo->r_address);
+ | BFD_MACH_O_SET_SR_LENGTH (pinfo->r_length)
+ | BFD_MACH_O_SET_SR_TYPE (pinfo->r_type)
+ | BFD_MACH_O_SET_SR_ADDRESS (pinfo->r_address);
/* Note: scattered relocs have field in reverse order... */
bfd_put_32 (abfd, v, raw.r_address);
bfd_put_32 (abfd, pinfo->r_value, raw.r_symbolnum);
@@ -1343,7 +1623,7 @@ bfd_mach_o_write_relocs (bfd *abfd, bfd_mach_o_section *section)
return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_write_section_32 (bfd *abfd, bfd_mach_o_section *section)
{
struct mach_o_section_32_external raw;
@@ -1362,12 +1642,12 @@ bfd_mach_o_write_section_32 (bfd *abfd, bfd_mach_o_section *section)
if (bfd_bwrite (&raw, BFD_MACH_O_SECTION_SIZE, abfd)
!= BFD_MACH_O_SECTION_SIZE)
- return -1;
+ return FALSE;
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_write_section_64 (bfd *abfd, bfd_mach_o_section *section)
{
struct mach_o_section_64_external raw;
@@ -1387,12 +1667,12 @@ bfd_mach_o_write_section_64 (bfd *abfd, bfd_mach_o_section *section)
if (bfd_bwrite (&raw, BFD_MACH_O_SECTION_64_SIZE, abfd)
!= BFD_MACH_O_SECTION_64_SIZE)
- return -1;
+ return FALSE;
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_write_segment_32 (bfd *abfd, bfd_mach_o_load_command *command)
{
struct mach_o_segment_command_32_external raw;
@@ -1403,7 +1683,7 @@ bfd_mach_o_write_segment_32 (bfd *abfd, bfd_mach_o_load_command *command)
for (sec = seg->sect_head; sec != NULL; sec = sec->next)
if (!bfd_mach_o_write_relocs (abfd, sec))
- return -1;
+ return FALSE;
memcpy (raw.segname, seg->segname, 16);
bfd_h_put_32 (abfd, seg->vmaddr, raw.vmaddr);
@@ -1417,16 +1697,16 @@ bfd_mach_o_write_segment_32 (bfd *abfd, bfd_mach_o_load_command *command)
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
for (sec = seg->sect_head; sec != NULL; sec = sec->next)
- if (bfd_mach_o_write_section_32 (abfd, sec))
- return -1;
+ if (!bfd_mach_o_write_section_32 (abfd, sec))
+ return FALSE;
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_write_segment_64 (bfd *abfd, bfd_mach_o_load_command *command)
{
struct mach_o_segment_command_64_external raw;
@@ -1437,7 +1717,7 @@ bfd_mach_o_write_segment_64 (bfd *abfd, bfd_mach_o_load_command *command)
for (sec = seg->sect_head; sec != NULL; sec = sec->next)
if (!bfd_mach_o_write_relocs (abfd, sec))
- return -1;
+ return FALSE;
memcpy (raw.segname, seg->segname, 16);
bfd_h_put_64 (abfd, seg->vmaddr, raw.vmaddr);
@@ -1451,37 +1731,29 @@ bfd_mach_o_write_segment_64 (bfd *abfd, bfd_mach_o_load_command *command)
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
for (sec = seg->sect_head; sec != NULL; sec = sec->next)
- if (bfd_mach_o_write_section_64 (abfd, sec))
- return -1;
+ if (!bfd_mach_o_write_section_64 (abfd, sec))
+ return FALSE;
- return 0;
+ return TRUE;
}
static bfd_boolean
-bfd_mach_o_write_symtab (bfd *abfd, bfd_mach_o_load_command *command)
+bfd_mach_o_write_symtab_content (bfd *abfd, bfd_mach_o_symtab_command *sym)
{
bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
- bfd_mach_o_symtab_command *sym = &command->command.symtab;
unsigned long i;
unsigned int wide = bfd_mach_o_wide_p (abfd);
- unsigned int symlen = wide ? BFD_MACH_O_NLIST_64_SIZE : BFD_MACH_O_NLIST_SIZE;
struct bfd_strtab_hash *strtab;
asymbol **symbols = bfd_get_outsymbols (abfd);
-
- BFD_ASSERT (command->type == BFD_MACH_O_LC_SYMTAB);
+ int padlen;
/* Write the symbols first. */
- mdata->filelen = FILE_ALIGN(mdata->filelen, wide ? 3 : 2);
- sym->symoff = mdata->filelen;
if (bfd_seek (abfd, sym->symoff, SEEK_SET) != 0)
return FALSE;
- sym->nsyms = bfd_get_symcount (abfd);
- mdata->filelen += sym->nsyms * symlen;
-
strtab = _bfd_stringtab_init ();
if (strtab == NULL)
return FALSE;
@@ -1541,23 +1813,19 @@ bfd_mach_o_write_symtab (bfd *abfd, bfd_mach_o_load_command *command)
sym->stroff = mdata->filelen;
mdata->filelen += sym->strsize;
+ if (bfd_seek (abfd, sym->stroff, SEEK_SET) != 0)
+ return FALSE;
+
if (_bfd_stringtab_emit (abfd, strtab) != TRUE)
goto err;
_bfd_stringtab_free (strtab);
- /* The command. */
- {
- struct mach_o_symtab_command_external raw;
-
- bfd_h_put_32 (abfd, sym->symoff, raw.symoff);
- bfd_h_put_32 (abfd, sym->nsyms, raw.nsyms);
- bfd_h_put_32 (abfd, sym->stroff, raw.stroff);
- bfd_h_put_32 (abfd, sym->strsize, raw.strsize);
-
- if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
- || bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
- return FALSE;
- }
+ /* Pad string table. */
+ padlen = bfd_mach_o_pad4 (abfd, sym->strsize);
+ if (padlen < 0)
+ return FALSE;
+ mdata->filelen += padlen;
+ sym->strsize += padlen;
return TRUE;
@@ -1566,6 +1834,165 @@ bfd_mach_o_write_symtab (bfd *abfd, bfd_mach_o_load_command *command)
return FALSE;
}
+static bfd_boolean
+bfd_mach_o_write_symtab (bfd *abfd, bfd_mach_o_load_command *command)
+{
+ bfd_mach_o_symtab_command *sym = &command->command.symtab;
+ struct mach_o_symtab_command_external raw;
+
+ BFD_ASSERT (command->type == BFD_MACH_O_LC_SYMTAB);
+
+ /* The command. */
+ bfd_h_put_32 (abfd, sym->symoff, raw.symoff);
+ bfd_h_put_32 (abfd, sym->nsyms, raw.nsyms);
+ bfd_h_put_32 (abfd, sym->stroff, raw.stroff);
+ bfd_h_put_32 (abfd, sym->strsize, raw.strsize);
+
+ if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
+ || bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
+ return FALSE;
+
+ return TRUE;
+}
+
+/* Count the number of indirect symbols in the image.
+ Requires that the sections are in their final order. */
+
+static unsigned int
+bfd_mach_o_count_indirect_symbols (bfd *abfd, bfd_mach_o_data_struct *mdata)
+{
+ unsigned int i;
+ unsigned int nisyms = 0;
+
+ for (i = 0; i < mdata->nsects; ++i)
+ {
+ bfd_mach_o_section *sec = mdata->sections[i];
+
+ switch (sec->flags & BFD_MACH_O_SECTION_TYPE_MASK)
+ {
+ case BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS:
+ case BFD_MACH_O_S_LAZY_SYMBOL_POINTERS:
+ case BFD_MACH_O_S_SYMBOL_STUBS:
+ nisyms += bfd_mach_o_section_get_nbr_indirect (abfd, sec);
+ break;
+ default:
+ break;
+ }
+ }
+ return nisyms;
+}
+
+/* Create the dysymtab. */
+
+static bfd_boolean
+bfd_mach_o_build_dysymtab (bfd *abfd, bfd_mach_o_dysymtab_command *cmd)
+{
+ bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
+
+ /* TODO:
+ We are not going to try and fill these in yet and, moreover, we are
+ going to bail if they are already set. */
+ if (cmd->nmodtab != 0
+ || cmd->ntoc != 0
+ || cmd->nextrefsyms != 0)
+ {
+ (*_bfd_error_handler) (_("sorry: modtab, toc and extrefsyms are not yet"
+ " implemented for dysymtab commands."));
+ return FALSE;
+ }
+
+ cmd->ilocalsym = 0;
+
+ if (bfd_get_symcount (abfd) > 0)
+ {
+ asymbol **symbols = bfd_get_outsymbols (abfd);
+ unsigned long i;
+
+ /* Count the number of each kind of symbol. */
+ for (i = 0; i < bfd_get_symcount (abfd); ++i)
+ {
+ bfd_mach_o_asymbol *s = (bfd_mach_o_asymbol *)symbols[i];
+ if (s->n_type & (BFD_MACH_O_N_EXT | BFD_MACH_O_N_PEXT))
+ break;
+ }
+ cmd->nlocalsym = i;
+ cmd->iextdefsym = i;
+ for (; i < bfd_get_symcount (abfd); ++i)
+ {
+ bfd_mach_o_asymbol *s = (bfd_mach_o_asymbol *)symbols[i];
+ if ((s->n_type & BFD_MACH_O_N_TYPE) == BFD_MACH_O_N_UNDF)
+ break;
+ }
+ cmd->nextdefsym = i - cmd->nlocalsym;
+ cmd->iundefsym = cmd->nextdefsym + cmd->iextdefsym;
+ cmd->nundefsym = bfd_get_symcount (abfd)
+ - cmd->nlocalsym
+ - cmd->nextdefsym;
+ }
+ else
+ {
+ cmd->nlocalsym = 0;
+ cmd->iextdefsym = 0;
+ cmd->nextdefsym = 0;
+ cmd->iundefsym = 0;
+ cmd->nundefsym = 0;
+ }
+
+ cmd->nindirectsyms = bfd_mach_o_count_indirect_symbols (abfd, mdata);
+ if (cmd->nindirectsyms > 0)
+ {
+ unsigned i;
+ unsigned n;
+
+ mdata->filelen = FILE_ALIGN (mdata->filelen, 2);
+ cmd->indirectsymoff = mdata->filelen;
+ mdata->filelen += cmd->nindirectsyms * 4;
+
+ cmd->indirect_syms = bfd_zalloc (abfd, cmd->nindirectsyms * 4);
+ if (cmd->indirect_syms == NULL)
+ return FALSE;
+
+ n = 0;
+ for (i = 0; i < mdata->nsects; ++i)
+ {
+ bfd_mach_o_section *sec = mdata->sections[i];
+
+ switch (sec->flags & BFD_MACH_O_SECTION_TYPE_MASK)
+ {
+ case BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS:
+ case BFD_MACH_O_S_LAZY_SYMBOL_POINTERS:
+ case BFD_MACH_O_S_SYMBOL_STUBS:
+ {
+ unsigned j, num;
+ bfd_mach_o_asymbol **isyms = sec->indirect_syms;
+
+ num = bfd_mach_o_section_get_nbr_indirect (abfd, sec);
+ if (isyms == NULL || num == 0)
+ break;
+ /* Record the starting index in the reserved1 field. */
+ sec->reserved1 = n;
+ for (j = 0; j < num; j++, n++)
+ {
+ if (isyms[j] == NULL)
+ cmd->indirect_syms[n] = BFD_MACH_O_INDIRECT_SYM_LOCAL;
+ else if (isyms[j]->symbol.section == bfd_abs_section_ptr
+ && ! (isyms[j]->n_type & BFD_MACH_O_N_EXT))
+ cmd->indirect_syms[n] = BFD_MACH_O_INDIRECT_SYM_LOCAL
+ | BFD_MACH_O_INDIRECT_SYM_ABS;
+ else
+ cmd->indirect_syms[n] = isyms[j]->symbol.udata.i;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ return TRUE;
+}
+
/* Write a dysymtab command.
TODO: Possibly coalesce writes of smaller objects. */
@@ -1870,7 +2297,7 @@ bfd_mach_o_mangle_symbols (bfd *abfd)
&& s->symbol.section != bfd_com_section_ptr)
|| ((s->n_type & BFD_MACH_O_N_STAB) != 0
&& s->symbol.name == NULL))
- s->n_sect = s->symbol.section->target_index;
+ s->n_sect = s->symbol.section->output_section->target_index;
/* Number to preserve order for local and debug syms. */
s->symbol.udata.i = i;
@@ -1946,76 +2373,181 @@ bfd_mach_o_mangle_sections (bfd *abfd, bfd_mach_o_data_struct *mdata)
bfd_boolean
bfd_mach_o_write_contents (bfd *abfd)
{
- unsigned int i;
bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
+ bfd_mach_o_load_command *cmd;
+ bfd_mach_o_symtab_command *symtab = NULL;
+ bfd_mach_o_dysymtab_command *dysymtab = NULL;
+ bfd_mach_o_segment_command *linkedit = NULL;
/* Make the commands, if not already present. */
- if (mdata->header.ncmds == 0)
- if (!bfd_mach_o_build_commands (abfd))
- return FALSE;
+ if (!abfd->output_has_begun && !bfd_mach_o_build_commands (abfd))
+ return FALSE;
+ abfd->output_has_begun = TRUE;
+ /* Write the header. */
if (!bfd_mach_o_write_header (abfd, &mdata->header))
return FALSE;
- for (i = 0; i < mdata->header.ncmds; i++)
+ /* First pass: allocate the linkedit segment. */
+ for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next)
+ switch (cmd->type)
+ {
+ case BFD_MACH_O_LC_SEGMENT_64:
+ case BFD_MACH_O_LC_SEGMENT:
+ if (strcmp (cmd->command.segment.segname, "__LINKEDIT") == 0)
+ linkedit = &cmd->command.segment;
+ break;
+ case BFD_MACH_O_LC_SYMTAB:
+ symtab = &cmd->command.symtab;
+ break;
+ case BFD_MACH_O_LC_DYSYMTAB:
+ dysymtab = &cmd->command.dysymtab;
+ break;
+ case BFD_MACH_O_LC_DYLD_INFO:
+ {
+ bfd_mach_o_dyld_info_command *di = &cmd->command.dyld_info;
+
+ if (di->rebase_size != 0)
+ {
+ di->rebase_off = mdata->filelen;
+ mdata->filelen += di->rebase_size;
+ }
+ if (di->bind_size != 0)
+ {
+ di->bind_off = mdata->filelen;
+ mdata->filelen += di->bind_size;
+ }
+ if (di->weak_bind_size != 0)
+ {
+ di->weak_bind_off = mdata->filelen;
+ mdata->filelen += di->weak_bind_size;
+ }
+ if (di->lazy_bind_size != 0)
+ {
+ di->lazy_bind_off = mdata->filelen;
+ mdata->filelen += di->lazy_bind_size;
+ }
+ if (di->export_size != 0)
+ {
+ di->export_off = mdata->filelen;
+ mdata->filelen += di->export_size;
+ }
+ }
+ break;
+ case BFD_MACH_O_LC_LOAD_DYLIB:
+ case BFD_MACH_O_LC_LOAD_DYLINKER:
+ case BFD_MACH_O_LC_MAIN:
+ /* Nothing to do. */
+ break;
+ default:
+ (*_bfd_error_handler)
+ (_("unable to allocate data for load command 0x%lx"),
+ (unsigned long) cmd->type);
+ break;
+ }
+
+ /* Specially handle symtab and dysymtab. */
+
+ /* Pre-allocate the symbol table (but not the string table). The reason
+ is that the dysymtab is after the symbol table but before the string
+ table (required by the native strip tool). */
+ if (symtab != NULL)
+ {
+ unsigned int symlen;
+ unsigned int wide = bfd_mach_o_wide_p (abfd);
+
+ symlen = wide ? BFD_MACH_O_NLIST_64_SIZE : BFD_MACH_O_NLIST_SIZE;
+
+ /* Align for symbols. */
+ mdata->filelen = FILE_ALIGN (mdata->filelen, wide ? 3 : 2);
+ symtab->symoff = mdata->filelen;
+
+ symtab->nsyms = bfd_get_symcount (abfd);
+ mdata->filelen += symtab->nsyms * symlen;
+ }
+
+ /* Build the dysymtab. */
+ if (dysymtab != NULL)
+ if (!bfd_mach_o_build_dysymtab (abfd, dysymtab))
+ return FALSE;
+
+ /* Write symtab and strtab. */
+ if (symtab != NULL)
+ if (!bfd_mach_o_write_symtab_content (abfd, symtab))
+ return FALSE;
+
+ /* Adjust linkedit size. */
+ if (linkedit != NULL)
+ {
+ /* bfd_vma pagemask = bfd_mach_o_get_backend_data (abfd)->page_size - 1; */
+
+ linkedit->vmsize = mdata->filelen - linkedit->fileoff;
+ /* linkedit->vmsize = (linkedit->vmsize + pagemask) & ~pagemask; */
+ linkedit->filesize = mdata->filelen - linkedit->fileoff;
+
+ linkedit->initprot = BFD_MACH_O_PROT_READ;
+ linkedit->maxprot = BFD_MACH_O_PROT_READ | BFD_MACH_O_PROT_WRITE
+ | BFD_MACH_O_PROT_EXECUTE;
+ }
+
+ /* Second pass: write commands. */
+ for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next)
{
struct mach_o_load_command_external raw;
- bfd_mach_o_load_command *cur = &mdata->commands[i];
unsigned long typeflag;
- typeflag = cur->type | (cur->type_required ? BFD_MACH_O_LC_REQ_DYLD : 0);
+ typeflag = cmd->type | (cmd->type_required ? BFD_MACH_O_LC_REQ_DYLD : 0);
bfd_h_put_32 (abfd, typeflag, raw.cmd);
- bfd_h_put_32 (abfd, cur->len, raw.cmdsize);
+ bfd_h_put_32 (abfd, cmd->len, raw.cmdsize);
- if (bfd_seek (abfd, cur->offset, SEEK_SET) != 0
+ if (bfd_seek (abfd, cmd->offset, SEEK_SET) != 0
|| bfd_bwrite (&raw, BFD_MACH_O_LC_SIZE, abfd) != 8)
return FALSE;
- switch (cur->type)
+ switch (cmd->type)
{
case BFD_MACH_O_LC_SEGMENT:
- if (bfd_mach_o_write_segment_32 (abfd, cur) != 0)
+ if (!bfd_mach_o_write_segment_32 (abfd, cmd))
return FALSE;
break;
case BFD_MACH_O_LC_SEGMENT_64:
- if (bfd_mach_o_write_segment_64 (abfd, cur) != 0)
+ if (!bfd_mach_o_write_segment_64 (abfd, cmd))
return FALSE;
break;
case BFD_MACH_O_LC_SYMTAB:
- if (!bfd_mach_o_write_symtab (abfd, cur))
+ if (!bfd_mach_o_write_symtab (abfd, cmd))
return FALSE;
break;
case BFD_MACH_O_LC_DYSYMTAB:
- if (!bfd_mach_o_write_dysymtab (abfd, cur))
+ if (!bfd_mach_o_write_dysymtab (abfd, cmd))
return FALSE;
break;
- case BFD_MACH_O_LC_SYMSEG:
- break;
case BFD_MACH_O_LC_THREAD:
case BFD_MACH_O_LC_UNIXTHREAD:
- if (bfd_mach_o_write_thread (abfd, cur) != 0)
+ if (!bfd_mach_o_write_thread (abfd, cmd))
return FALSE;
break;
- case BFD_MACH_O_LC_LOADFVMLIB:
- case BFD_MACH_O_LC_IDFVMLIB:
- case BFD_MACH_O_LC_IDENT:
- case BFD_MACH_O_LC_FVMFILE:
- case BFD_MACH_O_LC_PREPAGE:
case BFD_MACH_O_LC_LOAD_DYLIB:
- case BFD_MACH_O_LC_LOAD_WEAK_DYLIB:
- case BFD_MACH_O_LC_ID_DYLIB:
- case BFD_MACH_O_LC_REEXPORT_DYLIB:
- case BFD_MACH_O_LC_LOAD_UPWARD_DYLIB:
+ if (!bfd_mach_o_write_dylib (abfd, cmd))
+ return FALSE;
+ break;
case BFD_MACH_O_LC_LOAD_DYLINKER:
- case BFD_MACH_O_LC_ID_DYLINKER:
- case BFD_MACH_O_LC_PREBOUND_DYLIB:
- case BFD_MACH_O_LC_ROUTINES:
- case BFD_MACH_O_LC_SUB_FRAMEWORK:
+ if (!bfd_mach_o_write_dylinker (abfd, cmd))
+ return FALSE;
+ break;
+ case BFD_MACH_O_LC_MAIN:
+ if (!bfd_mach_o_write_main (abfd, cmd))
+ return FALSE;
+ break;
+ case BFD_MACH_O_LC_DYLD_INFO:
+ if (!bfd_mach_o_write_dyld_info (abfd, cmd))
+ return FALSE;
break;
default:
- (*_bfd_error_handler) (_("unable to write unknown load command 0x%lx"),
- (unsigned long) cur->type);
+ (*_bfd_error_handler)
+ (_("unable to write unknown load command 0x%lx"),
+ (unsigned long) cmd->type);
return FALSE;
}
}
@@ -2025,9 +2557,8 @@ bfd_mach_o_write_contents (bfd *abfd)
static void
bfd_mach_o_append_section_to_segment (bfd_mach_o_segment_command *seg,
- asection *sec)
+ bfd_mach_o_section *s)
{
- bfd_mach_o_section *s = (bfd_mach_o_section *)sec->used_by_bfd;
if (seg->sect_head == NULL)
seg->sect_head = s;
else
@@ -2038,7 +2569,8 @@ bfd_mach_o_append_section_to_segment (bfd_mach_o_segment_command *seg,
/* Create section Mach-O flags from BFD flags. */
static void
-bfd_mach_o_set_section_flags_from_bfd (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
+bfd_mach_o_set_section_flags_from_bfd (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *sec)
{
flagword bfd_flags;
bfd_mach_o_section *s = bfd_mach_o_get_mach_o_section (sec);
@@ -2057,71 +2589,17 @@ bfd_mach_o_set_section_flags_from_bfd (bfd *abfd ATTRIBUTE_UNUSED, asection *sec
s->flags = BFD_MACH_O_S_REGULAR;
}
-/* Count the number of sections in the list for the segment named.
-
- The special case of NULL or "" for the segment name is valid for
- an MH_OBJECT file and means 'all sections available'.
-
- Requires that the sections table in mdata be filled in.
-
- Returns the number of sections (0 is valid).
- Any number > 255 signals an invalid section count, although we will,
- perhaps, allow the file to be written (in line with Darwin tools up
- to XCode 4).
-
- A section count of (unsigned long) -1 signals a definite error. */
-
-static unsigned long
-bfd_mach_o_count_sections_for_seg (const char *segment,
- bfd_mach_o_data_struct *mdata)
-{
- unsigned i,j;
- if (mdata == NULL || mdata->sections == NULL)
- return (unsigned long) -1;
-
- /* The MH_OBJECT case, all sections are considered; Although nsects is
- is an unsigned long, the maximum valid section count is 255 and this
- will have been checked already by mangle_sections. */
- if (segment == NULL || segment[0] == '\0')
- return mdata->nsects;
-
- /* Count the number of sections we see in this segment. */
- j = 0;
- for (i = 0; i < mdata->nsects; ++i)
- {
- bfd_mach_o_section *s = mdata->sections[i];
- if (strncmp (segment, s->segname, BFD_MACH_O_SEGNAME_SIZE) == 0)
- j++;
- }
- return j;
-}
-
static bfd_boolean
-bfd_mach_o_build_seg_command (const char *segment,
- bfd_mach_o_data_struct *mdata,
- bfd_mach_o_segment_command *seg)
+bfd_mach_o_build_obj_seg_command (bfd *abfd, bfd_mach_o_segment_command *seg)
{
- unsigned i;
- int is_mho = (segment == NULL || segment[0] == '\0');
-
- /* Fill segment command. */
- if (is_mho)
- memset (seg->segname, 0, sizeof (seg->segname));
- else
- strncpy (seg->segname, segment, sizeof (seg->segname));
+ bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
+ unsigned int i, j;
- /* TODO: fix this up for non-MH_OBJECT cases. */
seg->vmaddr = 0;
- seg->vmsize = 0;
-
seg->fileoff = mdata->filelen;
- seg->filesize = 0;
- seg->maxprot = BFD_MACH_O_PROT_READ | BFD_MACH_O_PROT_WRITE
- | BFD_MACH_O_PROT_EXECUTE;
- seg->initprot = seg->maxprot;
- seg->flags = 0;
- seg->sect_head = NULL;
- seg->sect_tail = NULL;
+ seg->initprot = BFD_MACH_O_PROT_READ | BFD_MACH_O_PROT_WRITE
+ | BFD_MACH_O_PROT_EXECUTE;
+ seg->maxprot = seg->initprot;
/* Append sections to the segment.
@@ -2129,94 +2607,85 @@ bfd_mach_o_build_seg_command (const char *segment,
sections after all the rest. This forces us to do the calculation of
total vmsize in three passes so that any alignment increments are
properly accounted. */
-
for (i = 0; i < mdata->nsects; ++i)
{
bfd_mach_o_section *s = mdata->sections[i];
asection *sec = s->bfdsection;
- /* If we're not making an MH_OBJECT, check whether this section is from
- our segment, and skip if not. Otherwise, just add all sections. */
- if (! is_mho
- && strncmp (segment, s->segname, BFD_MACH_O_SEGNAME_SIZE) != 0)
- continue;
-
/* Although we account for zerofill section sizes in vm order, they are
placed in the file in source sequence. */
- bfd_mach_o_append_section_to_segment (seg, sec);
+ bfd_mach_o_append_section_to_segment (seg, s);
s->offset = 0;
- /* Zerofill sections have zero file size & offset,
- and are not written. */
+ /* Zerofill sections have zero file size & offset, the only content
+ written to the file is the symbols. */
if ((s->flags & BFD_MACH_O_SECTION_TYPE_MASK) == BFD_MACH_O_S_ZEROFILL
- || (s->flags & BFD_MACH_O_SECTION_TYPE_MASK)
- == BFD_MACH_O_S_GB_ZEROFILL)
+ || ((s->flags & BFD_MACH_O_SECTION_TYPE_MASK)
+ == BFD_MACH_O_S_GB_ZEROFILL))
continue;
+ /* The Darwin system tools (in MH_OBJECT files, at least) always account
+ sections, even those with zero size. */
if (s->size > 0)
- {
+ {
seg->vmsize = FILE_ALIGN (seg->vmsize, s->align);
seg->vmsize += s->size;
- seg->filesize = FILE_ALIGN (seg->filesize, s->align);
+ /* MH_OBJECT files have unaligned content. */
+ if (1)
+ {
+ seg->filesize = FILE_ALIGN (seg->filesize, s->align);
+ mdata->filelen = FILE_ALIGN (mdata->filelen, s->align);
+ }
seg->filesize += s->size;
- mdata->filelen = FILE_ALIGN (mdata->filelen, s->align);
+ /* The system tools write even zero-sized sections with an offset
+ field set to the current file position. */
s->offset = mdata->filelen;
- }
+ }
sec->filepos = s->offset;
mdata->filelen += s->size;
}
- /* Now pass through again, for zerofill, only now we just update the vmsize. */
- for (i = 0; i < mdata->nsects; ++i)
+ /* Now pass through again, for zerofill, only now we just update the
+ vmsize, and then for zerofill_GB. */
+ for (j = 0; j < 2; j++)
{
- bfd_mach_o_section *s = mdata->sections[i];
-
- if ((s->flags & BFD_MACH_O_SECTION_TYPE_MASK) != BFD_MACH_O_S_ZEROFILL)
- continue;
+ unsigned int stype;
- if (! is_mho
- && strncmp (segment, s->segname, BFD_MACH_O_SEGNAME_SIZE) != 0)
- continue;
+ if (j == 0)
+ stype = BFD_MACH_O_S_ZEROFILL;
+ else
+ stype = BFD_MACH_O_S_GB_ZEROFILL;
- if (s->size > 0)
+ for (i = 0; i < mdata->nsects; ++i)
{
- seg->vmsize = FILE_ALIGN (seg->vmsize, s->align);
- seg->vmsize += s->size;
- }
- }
-
- /* Now pass through again, for zerofill_GB. */
- for (i = 0; i < mdata->nsects; ++i)
- {
- bfd_mach_o_section *s = mdata->sections[i];
+ bfd_mach_o_section *s = mdata->sections[i];
- if ((s->flags & BFD_MACH_O_SECTION_TYPE_MASK) != BFD_MACH_O_S_GB_ZEROFILL)
- continue;
+ if ((s->flags & BFD_MACH_O_SECTION_TYPE_MASK) != stype)
+ continue;
- if (! is_mho
- && strncmp (segment, s->segname, BFD_MACH_O_SEGNAME_SIZE) != 0)
- continue;
-
- if (s->size > 0)
- {
- seg->vmsize = FILE_ALIGN (seg->vmsize, s->align);
- seg->vmsize += s->size;
+ if (s->size > 0)
+ {
+ seg->vmsize = FILE_ALIGN (seg->vmsize, s->align);
+ seg->vmsize += s->size;
+ }
}
}
/* Allocate space for the relocations. */
- mdata->filelen = FILE_ALIGN(mdata->filelen, 2);
+ mdata->filelen = FILE_ALIGN (mdata->filelen, 2);
for (i = 0; i < mdata->nsects; ++i)
{
bfd_mach_o_section *ms = mdata->sections[i];
asection *sec = ms->bfdsection;
- if ((ms->nreloc = sec->reloc_count) == 0)
+ ms->nreloc = sec->reloc_count;
+ if (ms->nreloc == 0)
{
+ /* Clear nreloc and reloff if there is no relocs. */
ms->reloff = 0;
continue;
}
@@ -2228,142 +2697,211 @@ bfd_mach_o_build_seg_command (const char *segment,
return TRUE;
}
-/* Count the number of indirect symbols in the image.
- Requires that the sections are in their final order. */
-
-static unsigned int
-bfd_mach_o_count_indirect_symbols (bfd *abfd, bfd_mach_o_data_struct *mdata)
+static bfd_boolean
+bfd_mach_o_build_exec_seg_command (bfd *abfd, bfd_mach_o_segment_command *seg)
{
+ bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
unsigned int i;
- unsigned int nisyms = 0;
+ bfd_vma pagemask = bfd_mach_o_get_backend_data (abfd)->page_size - 1;
+ bfd_vma vma;
+ bfd_mach_o_section *s;
+
+ seg->vmsize = 0;
+
+ seg->fileoff = mdata->filelen;
+ seg->maxprot = 0;
+ seg->initprot = 0;
+ seg->flags = 0;
+ /* Append sections to the segment. We assume they are properly ordered
+ by vma (but we check that). */
+ vma = 0;
for (i = 0; i < mdata->nsects; ++i)
{
- bfd_mach_o_section *sec = mdata->sections[i];
+ s = mdata->sections[i];
- switch (sec->flags & BFD_MACH_O_SECTION_TYPE_MASK)
- {
- case BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS:
- case BFD_MACH_O_S_LAZY_SYMBOL_POINTERS:
- case BFD_MACH_O_S_SYMBOL_STUBS:
- nisyms += bfd_mach_o_section_get_nbr_indirect (abfd, sec);
- break;
- default:
- break;
- }
- }
- return nisyms;
-}
+ /* Consider only sections for this segment. */
+ if (strcmp (seg->segname, s->segname) != 0)
+ continue;
-static bfd_boolean
-bfd_mach_o_build_dysymtab_command (bfd *abfd,
- bfd_mach_o_data_struct *mdata,
- bfd_mach_o_load_command *cmd)
-{
- bfd_mach_o_dysymtab_command *dsym = &cmd->command.dysymtab;
+ bfd_mach_o_append_section_to_segment (seg, s);
- /* TODO:
- We are not going to try and fill these in yet and, moreover, we are
- going to bail if they are already set. */
- if (dsym->nmodtab != 0
- || dsym->ntoc != 0
- || dsym->nextrefsyms != 0)
- {
- (*_bfd_error_handler) (_("sorry: modtab, toc and extrefsyms are not yet"
- " implemented for dysymtab commands."));
- return FALSE;
+ BFD_ASSERT (s->addr >= vma);
+ vma = s->addr + s->size;
}
- dsym->ilocalsym = 0;
+ /* Set segment file offset: make it page aligned. */
+ vma = seg->sect_head->addr;
+ seg->vmaddr = vma & ~pagemask;
+ if ((mdata->filelen & pagemask) > (vma & pagemask))
+ mdata->filelen += pagemask + 1;
+ seg->fileoff = mdata->filelen & ~pagemask;
+ mdata->filelen = seg->fileoff + (vma & pagemask);
- if (bfd_get_symcount (abfd) > 0)
+ /* Set section file offset. */
+ for (s = seg->sect_head; s != NULL; s = s->next)
{
- asymbol **symbols = bfd_get_outsymbols (abfd);
- unsigned long i;
+ asection *sec = s->bfdsection;
+ flagword flags = bfd_get_section_flags (abfd, sec);
- /* Count the number of each kind of symbol. */
- for (i = 0; i < bfd_get_symcount (abfd); ++i)
+ /* Adjust segment size. */
+ seg->vmsize = FILE_ALIGN (seg->vmsize, s->align);
+ seg->vmsize += s->size;
+
+ /* File offset and length. */
+ seg->filesize = FILE_ALIGN (seg->filesize, s->align);
+
+ if ((s->flags & BFD_MACH_O_SECTION_TYPE_MASK) != BFD_MACH_O_S_ZEROFILL
+ && ((s->flags & BFD_MACH_O_SECTION_TYPE_MASK)
+ != BFD_MACH_O_S_GB_ZEROFILL))
{
- bfd_mach_o_asymbol *s = (bfd_mach_o_asymbol *)symbols[i];
- if (s->n_type & (BFD_MACH_O_N_EXT | BFD_MACH_O_N_PEXT))
- break;
+ mdata->filelen = FILE_ALIGN (mdata->filelen, s->align);
+
+ s->offset = mdata->filelen;
+ s->bfdsection->filepos = s->offset;
+
+ seg->filesize += s->size;
+ mdata->filelen += s->size;
}
- dsym->nlocalsym = i;
- dsym->iextdefsym = i;
- for (; i < bfd_get_symcount (abfd); ++i)
+ else
{
- bfd_mach_o_asymbol *s = (bfd_mach_o_asymbol *)symbols[i];
- if ((s->n_type & BFD_MACH_O_N_TYPE) == BFD_MACH_O_N_UNDF)
- break;
+ s->offset = 0;
+ s->bfdsection->filepos = 0;
}
- dsym->nextdefsym = i - dsym->nlocalsym;
- dsym->iundefsym = dsym->nextdefsym + dsym->iextdefsym;
- dsym->nundefsym = bfd_get_symcount (abfd)
- - dsym->nlocalsym
- - dsym->nextdefsym;
+
+ /* Set protection. */
+ if (flags & SEC_LOAD)
+ {
+ if (flags & SEC_CODE)
+ seg->initprot |= BFD_MACH_O_PROT_READ | BFD_MACH_O_PROT_EXECUTE;
+ if ((flags & (SEC_DATA | SEC_READONLY)) == SEC_DATA)
+ seg->initprot |= BFD_MACH_O_PROT_WRITE | BFD_MACH_O_PROT_READ;
+ }
+
+ /* Relocs shouldn't appear in non-object files. */
+ if (s->bfdsection->reloc_count != 0)
+ return FALSE;
}
+
+ /* Set maxprot. */
+ if (seg->initprot != 0)
+ seg->maxprot = BFD_MACH_O_PROT_READ | BFD_MACH_O_PROT_WRITE
+ | BFD_MACH_O_PROT_EXECUTE;
else
- {
- dsym->nlocalsym = 0;
- dsym->iextdefsym = 0;
- dsym->nextdefsym = 0;
- dsym->iundefsym = 0;
- dsym->nundefsym = 0;
- }
+ seg->maxprot = 0;
- dsym->nindirectsyms = bfd_mach_o_count_indirect_symbols (abfd, mdata);
- if (dsym->nindirectsyms > 0)
- {
- unsigned i;
- unsigned n;
+ /* Round segment size (and file size). */
+ seg->vmsize = (seg->vmsize + pagemask) & ~pagemask;
+ seg->filesize = (seg->filesize + pagemask) & ~pagemask;
+ mdata->filelen = (mdata->filelen + pagemask) & ~pagemask;
- mdata->filelen = FILE_ALIGN (mdata->filelen, 2);
- dsym->indirectsymoff = mdata->filelen;
- mdata->filelen += dsym->nindirectsyms * 4;
+ return TRUE;
+}
- dsym->indirect_syms = bfd_zalloc (abfd, dsym->nindirectsyms * 4);
- if (dsym->indirect_syms == NULL)
- return FALSE;
+/* Layout the commands: set commands size and offset, set ncmds and sizeofcmds
+ fields in header. */
- n = 0;
- for (i = 0; i < mdata->nsects; ++i)
- {
- bfd_mach_o_section *sec = mdata->sections[i];
+static void
+bfd_mach_o_layout_commands (bfd_mach_o_data_struct *mdata)
+{
+ unsigned wide = mach_o_wide_p (&mdata->header);
+ unsigned int hdrlen;
+ ufile_ptr offset;
+ bfd_mach_o_load_command *cmd;
+ unsigned int align;
+
+ hdrlen = wide ? BFD_MACH_O_HEADER_64_SIZE : BFD_MACH_O_HEADER_SIZE;
+ align = wide ? 8 - 1 : 4 - 1;
+ offset = hdrlen;
+ mdata->header.ncmds = 0;
- switch (sec->flags & BFD_MACH_O_SECTION_TYPE_MASK)
- {
- case BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS:
- case BFD_MACH_O_S_LAZY_SYMBOL_POINTERS:
- case BFD_MACH_O_S_SYMBOL_STUBS:
- {
- unsigned j, num;
- bfd_mach_o_asymbol **isyms = sec->indirect_syms;
+ for (cmd = mdata->first_command; cmd; cmd = cmd->next)
+ {
+ mdata->header.ncmds++;
+ cmd->offset = offset;
- num = bfd_mach_o_section_get_nbr_indirect (abfd, sec);
- if (isyms == NULL || num == 0)
- break;
- /* Record the starting index in the reserved1 field. */
- sec->reserved1 = n;
- for (j = 0; j < num; j++, n++)
- {
- if (isyms[j] == NULL)
- dsym->indirect_syms[n] = BFD_MACH_O_INDIRECT_SYM_LOCAL;
- else if (isyms[j]->symbol.section == bfd_abs_section_ptr
- && ! (isyms[j]->n_type & BFD_MACH_O_N_EXT))
- dsym->indirect_syms[n] = BFD_MACH_O_INDIRECT_SYM_LOCAL
- | BFD_MACH_O_INDIRECT_SYM_ABS;
- else
- dsym->indirect_syms[n] = isyms[j]->symbol.udata.i;
- }
- }
- break;
- default:
- break;
- }
+ switch (cmd->type)
+ {
+ case BFD_MACH_O_LC_SEGMENT_64:
+ cmd->len = BFD_MACH_O_LC_SEGMENT_64_SIZE
+ + BFD_MACH_O_SECTION_64_SIZE * cmd->command.segment.nsects;
+ break;
+ case BFD_MACH_O_LC_SEGMENT:
+ cmd->len = BFD_MACH_O_LC_SEGMENT_SIZE
+ + BFD_MACH_O_SECTION_SIZE * cmd->command.segment.nsects;
+ break;
+ case BFD_MACH_O_LC_SYMTAB:
+ cmd->len = sizeof (struct mach_o_symtab_command_external)
+ + BFD_MACH_O_LC_SIZE;
+ break;
+ case BFD_MACH_O_LC_DYSYMTAB:
+ cmd->len = sizeof (struct mach_o_dysymtab_command_external)
+ + BFD_MACH_O_LC_SIZE;
+ break;
+ case BFD_MACH_O_LC_LOAD_DYLIB:
+ cmd->len = sizeof (struct mach_o_dylib_command_external)
+ + BFD_MACH_O_LC_SIZE;
+ cmd->command.dylib.name_offset = cmd->len;
+ cmd->len += strlen (cmd->command.dylib.name_str);
+ cmd->len = (cmd->len + align) & ~align;
+ break;
+ case BFD_MACH_O_LC_LOAD_DYLINKER:
+ cmd->len = sizeof (struct mach_o_str_command_external)
+ + BFD_MACH_O_LC_SIZE;
+ cmd->command.dylinker.name_offset = cmd->len;
+ cmd->len += strlen (cmd->command.dylinker.name_str);
+ cmd->len = (cmd->len + align) & ~align;
+ break;
+ case BFD_MACH_O_LC_MAIN:
+ cmd->len = sizeof (struct mach_o_entry_point_command_external)
+ + BFD_MACH_O_LC_SIZE;
+ break;
+ case BFD_MACH_O_LC_DYLD_INFO:
+ cmd->len = sizeof (struct mach_o_dyld_info_command_external)
+ + BFD_MACH_O_LC_SIZE;
+ break;
+ default:
+ (*_bfd_error_handler)
+ (_("unable to layout unknown load command 0x%lx"),
+ (unsigned long) cmd->type);
+ break;
}
+
+ BFD_ASSERT (cmd->len % (align + 1) == 0);
+ offset += cmd->len;
}
+ mdata->header.sizeofcmds = offset - hdrlen;
+ mdata->filelen = offset;
+}
- return TRUE;
+/* Subroutine of bfd_mach_o_build_commands: set type, name and nsects of a
+ segment. */
+
+static void
+bfd_mach_o_init_segment (bfd_mach_o_data_struct *mdata,
+ bfd_mach_o_load_command *cmd,
+ const char *segname, unsigned int nbr_sect)
+{
+ bfd_mach_o_segment_command *seg = &cmd->command.segment;
+ unsigned wide = mach_o_wide_p (&mdata->header);
+
+ /* Init segment command. */
+ cmd->type = wide ? BFD_MACH_O_LC_SEGMENT_64 : BFD_MACH_O_LC_SEGMENT;
+ cmd->type_required = FALSE;
+
+ strcpy (seg->segname, segname);
+ seg->nsects = nbr_sect;
+
+ seg->vmaddr = 0;
+ seg->vmsize = 0;
+
+ seg->fileoff = 0;
+ seg->filesize = 0;
+ seg->maxprot = 0;
+ seg->initprot = 0;
+ seg->flags = 0;
+ seg->sect_head = NULL;
+ seg->sect_tail = NULL;
}
/* Build Mach-O load commands (currently assuming an MH_OBJECT file).
@@ -2375,17 +2913,19 @@ bfd_mach_o_build_commands (bfd *abfd)
{
bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
unsigned wide = mach_o_wide_p (&mdata->header);
- int segcmd_idx = -1;
+ unsigned int nbr_segcmd = 0;
+ bfd_mach_o_load_command *commands;
+ unsigned int nbr_commands;
int symtab_idx = -1;
int dysymtab_idx = -1;
- unsigned long base_offset = 0;
+ int main_idx = -1;
+ unsigned int i;
- /* Return now if commands are already present. */
- if (mdata->header.ncmds)
- return FALSE;
+ /* Return now if already built. */
+ if (mdata->header.ncmds != 0)
+ return TRUE;
/* Fill in the file type, if not already set. */
-
if (mdata->header.filetype == 0)
{
if (abfd->flags & EXEC_P)
@@ -2408,142 +2948,189 @@ bfd_mach_o_build_commands (bfd *abfd)
if (!bfd_mach_o_mangle_symbols (abfd))
return FALSE;
- /* Very simple command set (only really applicable to MH_OBJECTs):
- All the commands are optional - present only when there is suitable data.
- (i.e. it is valid to have an empty file)
+ /* Segment commands. */
+ if (mdata->header.filetype == BFD_MACH_O_MH_OBJECT)
+ {
+ /* Only one segment for all the sections. But the segment is
+ optional if there is no sections. */
+ nbr_segcmd = (mdata->nsects > 0) ? 1 : 0;
+ }
+ else
+ {
+ bfd_mach_o_section *prev_sect = NULL;
- a command (segment) to contain all the sections,
- command for the symbol table,
- a command for the dysymtab.
+ /* One pagezero segment and one linkedit segment. */
+ nbr_segcmd = 2;
- ??? maybe we should assert that this is an MH_OBJECT? */
+ /* Create one segment for associated segment name in sections.
+ Assume that sections with the same segment name are consecutive. */
+ for (i = 0; i < mdata->nsects; i++)
+ {
+ bfd_mach_o_section *this_sect = mdata->sections[i];
- if (mdata->nsects > 0)
- {
- segcmd_idx = 0;
- mdata->header.ncmds = 1;
+ if (prev_sect == NULL
+ || strcmp (prev_sect->segname, this_sect->segname) != 0)
+ {
+ nbr_segcmd++;
+ prev_sect = this_sect;
+ }
+ }
}
+ nbr_commands = nbr_segcmd;
+
+ /* One command for the symbol table (only if there are symbols. */
if (bfd_get_symcount (abfd) > 0)
- {
- mdata->header.ncmds++;
- symtab_idx = segcmd_idx + 1; /* 0 if the seg command is absent. */
- }
+ symtab_idx = nbr_commands++;
/* FIXME:
This is a rather crude test for whether we should build a dysymtab. */
if (bfd_mach_o_should_emit_dysymtab ()
&& bfd_get_symcount (abfd))
{
- mdata->header.ncmds++;
/* If there should be a case where a dysymtab could be emitted without
a symtab (seems improbable), this would need amending. */
- dysymtab_idx = symtab_idx + 1;
+ dysymtab_idx = nbr_commands++;
}
- if (wide)
- base_offset = BFD_MACH_O_HEADER_64_SIZE;
- else
- base_offset = BFD_MACH_O_HEADER_SIZE;
+ /* Add an entry point command. */
+ if (mdata->header.filetype == BFD_MACH_O_MH_EXECUTE
+ && bfd_get_start_address (abfd) != 0)
+ main_idx = nbr_commands++;
/* Well, we must have a header, at least. */
- mdata->filelen = base_offset;
+ mdata->filelen = wide ? BFD_MACH_O_HEADER_64_SIZE : BFD_MACH_O_HEADER_SIZE;
/* A bit unusual, but no content is valid;
as -n empty.s -o empty.o */
- if (mdata->header.ncmds == 0)
- return TRUE;
+ if (nbr_commands == 0)
+ {
+ /* Layout commands (well none...) and set headers command fields. */
+ bfd_mach_o_layout_commands (mdata);
+ return TRUE;
+ }
- mdata->commands = bfd_zalloc (abfd, mdata->header.ncmds
- * sizeof (bfd_mach_o_load_command));
- if (mdata->commands == NULL)
+ /* Create commands for segments (and symtabs), prepend them. */
+ commands = bfd_zalloc (abfd, nbr_commands * sizeof (bfd_mach_o_load_command));
+ if (commands == NULL)
return FALSE;
-
- if (segcmd_idx >= 0)
+ for (i = 0; i < nbr_commands - 1; i++)
+ commands[i].next = &commands[i + 1];
+ commands[nbr_commands - 1].next = mdata->first_command;
+ if (mdata->first_command == NULL)
+ mdata->last_command = &commands[nbr_commands - 1];
+ mdata->first_command = &commands[0];
+
+ if (mdata->header.filetype == BFD_MACH_O_MH_OBJECT && nbr_segcmd != 0)
{
- bfd_mach_o_load_command *cmd = &mdata->commands[segcmd_idx];
- bfd_mach_o_segment_command *seg = &cmd->command.segment;
+ /* For object file, there is only one segment. */
+ bfd_mach_o_init_segment (mdata, &commands[0], "", mdata->nsects);
+ }
+ else if (nbr_segcmd != 0)
+ {
+ bfd_mach_o_load_command *cmd;
- /* Count the segctions in the special blank segment used for MH_OBJECT. */
- seg->nsects = bfd_mach_o_count_sections_for_seg (NULL, mdata);
- if (seg->nsects == (unsigned long) -1)
- return FALSE;
+ BFD_ASSERT (nbr_segcmd >= 2);
- /* Init segment command. */
- cmd->offset = base_offset;
- if (wide)
- {
- cmd->type = BFD_MACH_O_LC_SEGMENT_64;
- cmd->len = BFD_MACH_O_LC_SEGMENT_64_SIZE
- + BFD_MACH_O_SECTION_64_SIZE * seg->nsects;
- }
- else
+ /* The pagezero. */
+ cmd = &commands[0];
+ bfd_mach_o_init_segment (mdata, cmd, "__PAGEZERO", 0);
+
+ /* Segments from sections. */
+ cmd++;
+ for (i = 0; i < mdata->nsects;)
{
- cmd->type = BFD_MACH_O_LC_SEGMENT;
- cmd->len = BFD_MACH_O_LC_SEGMENT_SIZE
- + BFD_MACH_O_SECTION_SIZE * seg->nsects;
+ const char *segname = mdata->sections[i]->segname;
+ unsigned int nbr_sect = 1;
+
+ /* Count number of sections for this segment. */
+ for (i++; i < mdata->nsects; i++)
+ if (strcmp (mdata->sections[i]->segname, segname) == 0)
+ nbr_sect++;
+ else
+ break;
+
+ bfd_mach_o_init_segment (mdata, cmd, segname, nbr_sect);
+ cmd++;
}
- cmd->type_required = FALSE;
- mdata->header.sizeofcmds = cmd->len;
- mdata->filelen += cmd->len;
+ /* The linkedit. */
+ bfd_mach_o_init_segment (mdata, cmd, "__LINKEDIT", 0);
}
if (symtab_idx >= 0)
{
/* Init symtab command. */
- bfd_mach_o_load_command *cmd = &mdata->commands[symtab_idx];
+ bfd_mach_o_load_command *cmd = &commands[symtab_idx];
cmd->type = BFD_MACH_O_LC_SYMTAB;
- cmd->offset = base_offset;
- if (segcmd_idx >= 0)
- cmd->offset += mdata->commands[segcmd_idx].len;
-
- cmd->len = sizeof (struct mach_o_symtab_command_external)
- + BFD_MACH_O_LC_SIZE;
cmd->type_required = FALSE;
- mdata->header.sizeofcmds += cmd->len;
- mdata->filelen += cmd->len;
}
/* If required, setup symtab command, see comment above about the quality
of this test. */
if (dysymtab_idx >= 0)
{
- bfd_mach_o_load_command *cmd = &mdata->commands[dysymtab_idx];
+ bfd_mach_o_load_command *cmd = &commands[dysymtab_idx];
cmd->type = BFD_MACH_O_LC_DYSYMTAB;
- if (symtab_idx >= 0)
- cmd->offset = mdata->commands[symtab_idx].offset
- + mdata->commands[symtab_idx].len;
- else if (segcmd_idx >= 0)
- cmd->offset = mdata->commands[segcmd_idx].offset
- + mdata->commands[segcmd_idx].len;
- else
- cmd->offset = base_offset;
-
cmd->type_required = FALSE;
- cmd->len = sizeof (struct mach_o_dysymtab_command_external)
- + BFD_MACH_O_LC_SIZE;
+ }
+
+ /* Create the main command. */
+ if (main_idx >= 0)
+ {
+ bfd_mach_o_load_command *cmd = &commands[main_idx];
- mdata->header.sizeofcmds += cmd->len;
- mdata->filelen += cmd->len;
+ cmd->type = BFD_MACH_O_LC_MAIN;
+ cmd->type_required = TRUE;
+
+ cmd->command.main.entryoff = 0;
+ cmd->command.main.stacksize = 0;
}
+ /* Layout commands. */
+ bfd_mach_o_layout_commands (mdata);
+
/* So, now we have sized the commands and the filelen set to that.
Now we can build the segment command and set the section file offsets. */
- if (segcmd_idx >= 0
- && ! bfd_mach_o_build_seg_command
- (NULL, mdata, &mdata->commands[segcmd_idx].command.segment))
- return FALSE;
+ if (mdata->header.filetype == BFD_MACH_O_MH_OBJECT)
+ {
+ for (i = 0; i < nbr_segcmd; i++)
+ if (!bfd_mach_o_build_obj_seg_command
+ (abfd, &commands[i].command.segment))
+ return FALSE;
+ }
+ else
+ {
+ bfd_vma maxvma = 0;
- /* If we're doing a dysymtab, cmd points to its load command. */
- if (dysymtab_idx >= 0
- && ! bfd_mach_o_build_dysymtab_command (abfd, mdata,
- &mdata->commands[dysymtab_idx]))
- return FALSE;
+ /* Skip pagezero and linkedit segments. */
+ for (i = 1; i < nbr_segcmd - 1; i++)
+ {
+ bfd_mach_o_segment_command *seg = &commands[i].command.segment;
+
+ if (!bfd_mach_o_build_exec_seg_command (abfd, seg))
+ return FALSE;
+
+ if (seg->vmaddr + seg->vmsize > maxvma)
+ maxvma = seg->vmaddr + seg->vmsize;
+ }
+
+ /* Set the size of __PAGEZERO. */
+ commands[0].command.segment.vmsize =
+ commands[1].command.segment.vmaddr;
+
+ /* Set the vma and fileoff of __LINKEDIT. */
+ commands[nbr_segcmd - 1].command.segment.vmaddr = maxvma;
+ commands[nbr_segcmd - 1].command.segment.fileoff = mdata->filelen;
+
+ /* Set entry point (once segments have been laid out). */
+ if (main_idx >= 0)
+ commands[main_idx].command.main.entryoff =
+ bfd_get_start_address (abfd) - commands[1].command.segment.vmaddr;
+ }
- /* The symtab command is filled in when the symtab is written. */
return TRUE;
}
@@ -2560,7 +3147,7 @@ bfd_mach_o_set_section_contents (bfd *abfd,
/* Trying to write the first section contents will trigger the creation of
the load commands if they are not already present. */
- if (! abfd->output_has_begun && ! bfd_mach_o_build_commands (abfd))
+ if (!abfd->output_has_begun && !bfd_mach_o_build_commands (abfd))
return FALSE;
if (count == 0)
@@ -3135,43 +3722,44 @@ bfd_mach_o_ppc_flavour_string (unsigned int flavour)
}
}
-static int
+static bfd_boolean
bfd_mach_o_read_dylinker (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_dylinker_command *cmd = &command->command.dylinker;
struct mach_o_str_command_external raw;
unsigned int nameoff;
-
- BFD_ASSERT ((command->type == BFD_MACH_O_LC_ID_DYLINKER)
- || (command->type == BFD_MACH_O_LC_LOAD_DYLINKER));
+ unsigned int namelen;
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
nameoff = bfd_h_get_32 (abfd, raw.str);
- cmd->name_offset = command->offset + nameoff;
- cmd->name_len = command->len - nameoff;
- cmd->name_str = bfd_alloc (abfd, cmd->name_len);
+ cmd->name_offset = nameoff;
+ namelen = command->len - nameoff;
+ nameoff += command->offset;
+ cmd->name_str = bfd_alloc (abfd, namelen);
if (cmd->name_str == NULL)
- return -1;
- if (bfd_seek (abfd, cmd->name_offset, SEEK_SET) != 0
- || bfd_bread (cmd->name_str, cmd->name_len, abfd) != cmd->name_len)
- return -1;
- return 0;
+ return FALSE;
+ if (bfd_seek (abfd, nameoff, SEEK_SET) != 0
+ || bfd_bread (cmd->name_str, namelen, abfd) != namelen)
+ return FALSE;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_dylib (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_dylib_command *cmd = &command->command.dylib;
struct mach_o_dylib_command_external raw;
unsigned int nameoff;
+ unsigned int namelen;
switch (command->type)
{
case BFD_MACH_O_LC_LOAD_DYLIB:
+ case BFD_MACH_O_LC_LAZY_LOAD_DYLIB:
case BFD_MACH_O_LC_LOAD_WEAK_DYLIB:
case BFD_MACH_O_LC_ID_DYLIB:
case BFD_MACH_O_LC_REEXPORT_DYLIB:
@@ -3179,12 +3767,12 @@ bfd_mach_o_read_dylib (bfd *abfd, bfd_mach_o_load_command *command)
break;
default:
BFD_FAIL ();
- return -1;
+ return FALSE;
}
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
nameoff = bfd_h_get_32 (abfd, raw.name);
cmd->timestamp = bfd_h_get_32 (abfd, raw.timestamp);
@@ -3192,53 +3780,111 @@ bfd_mach_o_read_dylib (bfd *abfd, bfd_mach_o_load_command *command)
cmd->compatibility_version = bfd_h_get_32 (abfd, raw.compatibility_version);
cmd->name_offset = command->offset + nameoff;
- cmd->name_len = command->len - nameoff;
- cmd->name_str = bfd_alloc (abfd, cmd->name_len);
+ namelen = command->len - nameoff;
+ cmd->name_str = bfd_alloc (abfd, namelen);
if (cmd->name_str == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, cmd->name_offset, SEEK_SET) != 0
- || bfd_bread (cmd->name_str, cmd->name_len, abfd) != cmd->name_len)
- return -1;
- return 0;
+ || bfd_bread (cmd->name_str, namelen, abfd) != namelen)
+ return FALSE;
+ return TRUE;
}
-static int
-bfd_mach_o_read_prebound_dylib (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_mach_o_load_command *command ATTRIBUTE_UNUSED)
+static bfd_boolean
+bfd_mach_o_read_prebound_dylib (bfd *abfd,
+ bfd_mach_o_load_command *command)
{
- /* bfd_mach_o_prebound_dylib_command *cmd = &command->command.prebound_dylib; */
+ bfd_mach_o_prebound_dylib_command *cmd = &command->command.prebound_dylib;
+ struct mach_o_prebound_dylib_command_external raw;
+ unsigned int nameoff;
+ unsigned int modoff;
+ unsigned int str_len;
+ unsigned char *str;
- BFD_ASSERT (command->type == BFD_MACH_O_LC_PREBOUND_DYLIB);
- return 0;
+ if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
+ || bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
+ return FALSE;
+
+ nameoff = bfd_h_get_32 (abfd, raw.name);
+ modoff = bfd_h_get_32 (abfd, raw.linked_modules);
+ if (nameoff > command->len || modoff > command->len)
+ return FALSE;
+
+ str_len = command->len - sizeof (raw);
+ str = bfd_alloc (abfd, str_len);
+ if (str == NULL)
+ return FALSE;
+ if (bfd_bread (str, str_len, abfd) != str_len)
+ return FALSE;
+
+ cmd->name_offset = command->offset + nameoff;
+ cmd->nmodules = bfd_h_get_32 (abfd, raw.nmodules);
+ cmd->linked_modules_offset = command->offset + modoff;
+
+ cmd->name_str = (char *)str + nameoff - (sizeof (raw) + BFD_MACH_O_LC_SIZE);
+ cmd->linked_modules = str + modoff - (sizeof (raw) + BFD_MACH_O_LC_SIZE);
+ return TRUE;
}
-static int
+static bfd_boolean
+bfd_mach_o_read_prebind_cksum (bfd *abfd,
+ bfd_mach_o_load_command *command)
+{
+ bfd_mach_o_prebind_cksum_command *cmd = &command->command.prebind_cksum;
+ struct mach_o_prebind_cksum_command_external raw;
+
+ if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
+ || bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
+ return FALSE;
+
+ cmd->cksum = bfd_get_32 (abfd, raw.cksum);
+ return TRUE;
+}
+
+static bfd_boolean
+bfd_mach_o_read_twolevel_hints (bfd *abfd,
+ bfd_mach_o_load_command *command)
+{
+ bfd_mach_o_twolevel_hints_command *cmd = &command->command.twolevel_hints;
+ struct mach_o_twolevel_hints_command_external raw;
+
+ if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
+ || bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
+ return FALSE;
+
+ cmd->offset = bfd_get_32 (abfd, raw.offset);
+ cmd->nhints = bfd_get_32 (abfd, raw.nhints);
+ return TRUE;
+}
+
+static bfd_boolean
bfd_mach_o_read_fvmlib (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_fvmlib_command *fvm = &command->command.fvmlib;
struct mach_o_fvmlib_command_external raw;
unsigned int nameoff;
+ unsigned int namelen;
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
nameoff = bfd_h_get_32 (abfd, raw.name);
fvm->minor_version = bfd_h_get_32 (abfd, raw.minor_version);
fvm->header_addr = bfd_h_get_32 (abfd, raw.header_addr);
fvm->name_offset = command->offset + nameoff;
- fvm->name_len = command->len - nameoff;
- fvm->name_str = bfd_alloc (abfd, fvm->name_len);
+ namelen = command->len - nameoff;
+ fvm->name_str = bfd_alloc (abfd, namelen);
if (fvm->name_str == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, fvm->name_offset, SEEK_SET) != 0
- || bfd_bread (fvm->name_str, fvm->name_len, abfd) != fvm->name_len)
- return -1;
- return 0;
+ || bfd_bread (fvm->name_str, namelen, abfd) != namelen)
+ return FALSE;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_thread (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
@@ -3258,11 +3904,11 @@ bfd_mach_o_read_thread (bfd *abfd, bfd_mach_o_load_command *command)
struct mach_o_thread_command_external raw;
if (offset >= command->len)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, command->offset + offset, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
offset += sizeof (raw) + bfd_h_get_32 (abfd, raw.count) * 4;
nflavours++;
@@ -3272,7 +3918,7 @@ bfd_mach_o_read_thread (bfd *abfd, bfd_mach_o_load_command *command)
cmd->flavours = bfd_alloc
(abfd, nflavours * sizeof (bfd_mach_o_thread_flavour));
if (cmd->flavours == NULL)
- return -1;
+ return FALSE;
cmd->nflavours = nflavours;
offset = 8;
@@ -3282,14 +3928,14 @@ bfd_mach_o_read_thread (bfd *abfd, bfd_mach_o_load_command *command)
struct mach_o_thread_command_external raw;
if (offset >= command->len)
- return -1;
+ return FALSE;
if (nflavours >= cmd->nflavours)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, command->offset + offset, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
cmd->flavours[nflavours].flavour = bfd_h_get_32 (abfd, raw.flavour);
cmd->flavours[nflavours].offset = command->offset + offset + sizeof (raw);
@@ -3311,11 +3957,13 @@ bfd_mach_o_read_thread (bfd *abfd, bfd_mach_o_load_command *command)
{
case BFD_MACH_O_CPU_TYPE_POWERPC:
case BFD_MACH_O_CPU_TYPE_POWERPC_64:
- flavourstr = bfd_mach_o_ppc_flavour_string (cmd->flavours[i].flavour);
+ flavourstr =
+ bfd_mach_o_ppc_flavour_string (cmd->flavours[i].flavour);
break;
case BFD_MACH_O_CPU_TYPE_I386:
case BFD_MACH_O_CPU_TYPE_X86_64:
- flavourstr = bfd_mach_o_i386_flavour_string (cmd->flavours[i].flavour);
+ flavourstr =
+ bfd_mach_o_i386_flavour_string (cmd->flavours[i].flavour);
break;
default:
flavourstr = "UNKNOWN_ARCHITECTURE";
@@ -3325,7 +3973,7 @@ bfd_mach_o_read_thread (bfd *abfd, bfd_mach_o_load_command *command)
snamelen = strlen (prefix) + 1 + 20 + 1 + strlen (flavourstr) + 1;
sname = bfd_alloc (abfd, snamelen);
if (sname == NULL)
- return -1;
+ return FALSE;
for (;;)
{
@@ -3346,10 +3994,10 @@ bfd_mach_o_read_thread (bfd *abfd, bfd_mach_o_load_command *command)
cmd->section = bfdsec;
}
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_dysymtab (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_dysymtab_command *cmd = &command->command.dysymtab;
@@ -3362,7 +4010,7 @@ bfd_mach_o_read_dysymtab (bfd *abfd, bfd_mach_o_load_command *command)
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
cmd->ilocalsym = bfd_h_get_32 (abfd, raw.ilocalsym);
cmd->nlocalsym = bfd_h_get_32 (abfd, raw.nlocalsym);
@@ -3393,10 +4041,10 @@ bfd_mach_o_read_dysymtab (bfd *abfd, bfd_mach_o_load_command *command)
cmd->dylib_module =
bfd_alloc (abfd, cmd->nmodtab * sizeof (bfd_mach_o_dylib_module));
if (cmd->dylib_module == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, cmd->modtaboff, SEEK_SET) != 0)
- return -1;
+ return FALSE;
for (i = 0; i < cmd->nmodtab; i++)
{
@@ -3405,7 +4053,7 @@ bfd_mach_o_read_dysymtab (bfd *abfd, bfd_mach_o_load_command *command)
unsigned char buf[56];
if (bfd_bread ((void *) buf, module_len, abfd) != module_len)
- return -1;
+ return FALSE;
module->module_name_idx = bfd_h_get_32 (abfd, buf + 0);
module->iextdefsym = bfd_h_get_32 (abfd, buf + 4);
@@ -3442,10 +4090,10 @@ bfd_mach_o_read_dysymtab (bfd *abfd, bfd_mach_o_load_command *command)
cmd->dylib_toc = bfd_alloc
(abfd, cmd->ntoc * sizeof (bfd_mach_o_dylib_table_of_content));
if (cmd->dylib_toc == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, cmd->tocoff, SEEK_SET) != 0)
- return -1;
+ return FALSE;
for (i = 0; i < cmd->ntoc; i++)
{
@@ -3453,7 +4101,7 @@ bfd_mach_o_read_dysymtab (bfd *abfd, bfd_mach_o_load_command *command)
bfd_mach_o_dylib_table_of_content *toc = &cmd->dylib_toc[i];
if (bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
toc->symbol_index = bfd_h_get_32 (abfd, raw.symbol_index);
toc->module_index = bfd_h_get_32 (abfd, raw.module_index);
@@ -3467,10 +4115,10 @@ bfd_mach_o_read_dysymtab (bfd *abfd, bfd_mach_o_load_command *command)
cmd->indirect_syms = bfd_alloc
(abfd, cmd->nindirectsyms * sizeof (unsigned int));
if (cmd->indirect_syms == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, cmd->indirectsymoff, SEEK_SET) != 0)
- return -1;
+ return FALSE;
for (i = 0; i < cmd->nindirectsyms; i++)
{
@@ -3478,7 +4126,7 @@ bfd_mach_o_read_dysymtab (bfd *abfd, bfd_mach_o_load_command *command)
unsigned int *is = &cmd->indirect_syms[i];
if (bfd_bread (raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
*is = bfd_h_get_32 (abfd, raw);
}
@@ -3492,10 +4140,10 @@ bfd_mach_o_read_dysymtab (bfd *abfd, bfd_mach_o_load_command *command)
cmd->ext_refs = bfd_alloc
(abfd, cmd->nextrefsyms * sizeof (bfd_mach_o_dylib_reference));
if (cmd->ext_refs == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, cmd->extrefsymoff, SEEK_SET) != 0)
- return -1;
+ return FALSE;
for (i = 0; i < cmd->nextrefsyms; i++)
{
@@ -3503,7 +4151,7 @@ bfd_mach_o_read_dysymtab (bfd *abfd, bfd_mach_o_load_command *command)
bfd_mach_o_dylib_reference *ref = &cmd->ext_refs[i];
if (bfd_bread (raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
/* Fields isym and flags are written as bit-fields, thus we need
a specific processing for endianness. */
@@ -3522,13 +4170,13 @@ bfd_mach_o_read_dysymtab (bfd *abfd, bfd_mach_o_load_command *command)
}
if (mdata->dysymtab)
- return -1;
+ return FALSE;
mdata->dysymtab = cmd;
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_symtab (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_symtab_command *symtab = &command->command.symtab;
@@ -3539,7 +4187,7 @@ bfd_mach_o_read_symtab (bfd *abfd, bfd_mach_o_load_command *command)
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
symtab->symoff = bfd_h_get_32 (abfd, raw.symoff);
symtab->nsyms = bfd_h_get_32 (abfd, raw.nsyms);
@@ -3552,12 +4200,12 @@ bfd_mach_o_read_symtab (bfd *abfd, bfd_mach_o_load_command *command)
abfd->flags |= HAS_SYMS;
if (mdata->symtab)
- return -1;
+ return FALSE;
mdata->symtab = symtab;
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_uuid (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_uuid_command *cmd = &command->command.uuid;
@@ -3566,12 +4214,12 @@ bfd_mach_o_read_uuid (bfd *abfd, bfd_mach_o_load_command *command)
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (cmd->uuid, 16, abfd) != 16)
- return -1;
+ return FALSE;
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_linkedit (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_linkedit_command *cmd = &command->command.linkedit;
@@ -3579,14 +4227,14 @@ bfd_mach_o_read_linkedit (bfd *abfd, bfd_mach_o_load_command *command)
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
cmd->dataoff = bfd_get_32 (abfd, raw.dataoff);
cmd->datasize = bfd_get_32 (abfd, raw.datasize);
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_str (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_str_command *cmd = &command->command.str;
@@ -3595,21 +4243,86 @@ bfd_mach_o_read_str (bfd *abfd, bfd_mach_o_load_command *command)
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
off = bfd_get_32 (abfd, raw.str);
cmd->stroff = command->offset + off;
cmd->str_len = command->len - off;
cmd->str = bfd_alloc (abfd, cmd->str_len);
if (cmd->str == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, cmd->stroff, SEEK_SET) != 0
|| bfd_bread ((void *) cmd->str, cmd->str_len, abfd) != cmd->str_len)
- return -1;
- return 0;
+ return FALSE;
+ return TRUE;
}
-static int
+static unsigned char *
+bfd_mach_o_alloc_and_read (bfd *abfd, unsigned int off, unsigned int size)
+{
+ unsigned char *buf;
+
+ buf = bfd_alloc (abfd, size);
+ if (buf == NULL)
+ return NULL;
+ if (bfd_seek (abfd, off, SEEK_SET) != 0
+ || bfd_bread (buf, size, abfd) != size)
+ return NULL;
+ return buf;
+}
+
+static bfd_boolean
+bfd_mach_o_read_dyld_content (bfd *abfd, bfd_mach_o_dyld_info_command *cmd)
+{
+ /* Read rebase content. */
+ if (cmd->rebase_content == NULL && cmd->rebase_size != 0)
+ {
+ cmd->rebase_content =
+ bfd_mach_o_alloc_and_read (abfd, cmd->rebase_off, cmd->rebase_size);
+ if (cmd->rebase_content == NULL)
+ return FALSE;
+ }
+
+ /* Read bind content. */
+ if (cmd->bind_content == NULL && cmd->bind_size != 0)
+ {
+ cmd->bind_content =
+ bfd_mach_o_alloc_and_read (abfd, cmd->bind_off, cmd->bind_size);
+ if (cmd->bind_content == NULL)
+ return FALSE;
+ }
+
+ /* Read weak bind content. */
+ if (cmd->weak_bind_content == NULL && cmd->weak_bind_size != 0)
+ {
+ cmd->weak_bind_content = bfd_mach_o_alloc_and_read
+ (abfd, cmd->weak_bind_off, cmd->weak_bind_size);
+ if (cmd->weak_bind_content == NULL)
+ return FALSE;
+ }
+
+ /* Read lazy bind content. */
+ if (cmd->lazy_bind_content == NULL && cmd->lazy_bind_size != 0)
+ {
+ cmd->lazy_bind_content = bfd_mach_o_alloc_and_read
+ (abfd, cmd->lazy_bind_off, cmd->lazy_bind_size);
+ if (cmd->lazy_bind_content == NULL)
+ return FALSE;
+ }
+
+ /* Read export content. */
+ if (cmd->export_content == NULL && cmd->export_size != 0)
+ {
+ cmd->export_content = bfd_mach_o_alloc_and_read
+ (abfd, cmd->export_off, cmd->export_size);
+ if (cmd->export_content == NULL)
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static bfd_boolean
bfd_mach_o_read_dyld_info (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_dyld_info_command *cmd = &command->command.dyld_info;
@@ -3617,19 +4330,24 @@ bfd_mach_o_read_dyld_info (bfd *abfd, bfd_mach_o_load_command *command)
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
cmd->rebase_off = bfd_get_32 (abfd, raw.rebase_off);
cmd->rebase_size = bfd_get_32 (abfd, raw.rebase_size);
+ cmd->rebase_content = NULL;
cmd->bind_off = bfd_get_32 (abfd, raw.bind_off);
cmd->bind_size = bfd_get_32 (abfd, raw.bind_size);
+ cmd->bind_content = NULL;
cmd->weak_bind_off = bfd_get_32 (abfd, raw.weak_bind_off);
cmd->weak_bind_size = bfd_get_32 (abfd, raw.weak_bind_size);
+ cmd->weak_bind_content = NULL;
cmd->lazy_bind_off = bfd_get_32 (abfd, raw.lazy_bind_off);
cmd->lazy_bind_size = bfd_get_32 (abfd, raw.lazy_bind_size);
+ cmd->lazy_bind_content = NULL;
cmd->export_off = bfd_get_32 (abfd, raw.export_off);
cmd->export_size = bfd_get_32 (abfd, raw.export_size);
- return 0;
+ cmd->export_content = NULL;
+ return TRUE;
}
static bfd_boolean
@@ -3709,7 +4427,7 @@ bfd_mach_o_read_source_version (bfd *abfd, bfd_mach_o_load_command *command)
return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_segment (bfd *abfd,
bfd_mach_o_load_command *command,
unsigned int wide)
@@ -3725,7 +4443,7 @@ bfd_mach_o_read_segment (bfd *abfd,
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
memcpy (seg->segname, raw.segname, 16);
seg->segname[16] = '\0';
@@ -3747,7 +4465,7 @@ bfd_mach_o_read_segment (bfd *abfd,
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
memcpy (seg->segname, raw.segname, 16);
seg->segname[16] = '\0';
@@ -3778,27 +4496,28 @@ bfd_mach_o_read_segment (bfd *abfd,
sec = bfd_mach_o_read_section (abfd, segoff, seg->initprot, wide);
if (sec == NULL)
- return -1;
+ return FALSE;
- bfd_mach_o_append_section_to_segment (seg, sec);
+ bfd_mach_o_append_section_to_segment
+ (seg, bfd_mach_o_get_mach_o_section (sec));
}
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_segment_32 (bfd *abfd, bfd_mach_o_load_command *command)
{
return bfd_mach_o_read_segment (abfd, command, 0);
}
-static int
+static bfd_boolean
bfd_mach_o_read_segment_64 (bfd *abfd, bfd_mach_o_load_command *command)
{
return bfd_mach_o_read_segment (abfd, command, 1);
}
-static int
+static bfd_boolean
bfd_mach_o_read_command (bfd *abfd, bfd_mach_o_load_command *command)
{
struct mach_o_load_command_external raw;
@@ -3807,7 +4526,7 @@ bfd_mach_o_read_command (bfd *abfd, bfd_mach_o_load_command *command)
/* Read command type and length. */
if (bfd_seek (abfd, command->offset, SEEK_SET) != 0
|| bfd_bread (&raw, BFD_MACH_O_LC_SIZE, abfd) != BFD_MACH_O_LC_SIZE)
- return -1;
+ return FALSE;
cmd = bfd_h_get_32 (abfd, raw.cmd);
command->type = cmd & ~BFD_MACH_O_LC_REQ_DYLD;
@@ -3817,45 +4536,47 @@ bfd_mach_o_read_command (bfd *abfd, bfd_mach_o_load_command *command)
switch (command->type)
{
case BFD_MACH_O_LC_SEGMENT:
- if (bfd_mach_o_read_segment_32 (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_segment_32 (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_SEGMENT_64:
- if (bfd_mach_o_read_segment_64 (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_segment_64 (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_SYMTAB:
- if (bfd_mach_o_read_symtab (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_symtab (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_SYMSEG:
break;
case BFD_MACH_O_LC_THREAD:
case BFD_MACH_O_LC_UNIXTHREAD:
- if (bfd_mach_o_read_thread (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_thread (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_LOAD_DYLINKER:
case BFD_MACH_O_LC_ID_DYLINKER:
- if (bfd_mach_o_read_dylinker (abfd, command) != 0)
- return -1;
+ case BFD_MACH_O_LC_DYLD_ENVIRONMENT:
+ if (!bfd_mach_o_read_dylinker (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_LOAD_DYLIB:
+ case BFD_MACH_O_LC_LAZY_LOAD_DYLIB:
case BFD_MACH_O_LC_ID_DYLIB:
case BFD_MACH_O_LC_LOAD_WEAK_DYLIB:
case BFD_MACH_O_LC_REEXPORT_DYLIB:
case BFD_MACH_O_LC_LOAD_UPWARD_DYLIB:
- if (bfd_mach_o_read_dylib (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_dylib (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_PREBOUND_DYLIB:
- if (bfd_mach_o_read_prebound_dylib (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_prebound_dylib (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_LOADFVMLIB:
case BFD_MACH_O_LC_IDFVMLIB:
- if (bfd_mach_o_read_fvmlib (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_fvmlib (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_IDENT:
case BFD_MACH_O_LC_FVMFILE:
@@ -3868,48 +4589,53 @@ bfd_mach_o_read_command (bfd *abfd, bfd_mach_o_load_command *command)
case BFD_MACH_O_LC_SUB_LIBRARY:
case BFD_MACH_O_LC_SUB_CLIENT:
case BFD_MACH_O_LC_RPATH:
- if (bfd_mach_o_read_str (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_str (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_DYSYMTAB:
- if (bfd_mach_o_read_dysymtab (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_dysymtab (abfd, command))
+ return FALSE;
break;
- case BFD_MACH_O_LC_TWOLEVEL_HINTS:
case BFD_MACH_O_LC_PREBIND_CKSUM:
+ if (!bfd_mach_o_read_prebind_cksum (abfd, command))
+ return FALSE;
+ break;
+ case BFD_MACH_O_LC_TWOLEVEL_HINTS:
+ if (!bfd_mach_o_read_twolevel_hints (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_UUID:
- if (bfd_mach_o_read_uuid (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_uuid (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_CODE_SIGNATURE:
case BFD_MACH_O_LC_SEGMENT_SPLIT_INFO:
case BFD_MACH_O_LC_FUNCTION_STARTS:
case BFD_MACH_O_LC_DATA_IN_CODE:
case BFD_MACH_O_LC_DYLIB_CODE_SIGN_DRS:
- if (bfd_mach_o_read_linkedit (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_linkedit (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_ENCRYPTION_INFO:
if (!bfd_mach_o_read_encryption_info (abfd, command))
- return -1;
+ return FALSE;
break;
case BFD_MACH_O_LC_DYLD_INFO:
- if (bfd_mach_o_read_dyld_info (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_dyld_info (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_VERSION_MIN_MACOSX:
case BFD_MACH_O_LC_VERSION_MIN_IPHONEOS:
if (!bfd_mach_o_read_version_min (abfd, command))
- return -1;
+ return FALSE;
break;
case BFD_MACH_O_LC_MAIN:
if (!bfd_mach_o_read_main (abfd, command))
- return -1;
+ return FALSE;
break;
case BFD_MACH_O_LC_SOURCE_VERSION:
if (!bfd_mach_o_read_source_version (abfd, command))
- return -1;
+ return FALSE;
break;
default:
(*_bfd_error_handler)(_("%B: unknown load command 0x%lx"),
@@ -3917,27 +4643,26 @@ bfd_mach_o_read_command (bfd *abfd, bfd_mach_o_load_command *command)
break;
}
- return 0;
+ return TRUE;
}
static void
bfd_mach_o_flatten_sections (bfd *abfd)
{
bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
+ bfd_mach_o_load_command *cmd;
long csect = 0;
- unsigned long i;
/* Count total number of sections. */
mdata->nsects = 0;
- for (i = 0; i < mdata->header.ncmds; i++)
+ for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next)
{
- if (mdata->commands[i].type == BFD_MACH_O_LC_SEGMENT
- || mdata->commands[i].type == BFD_MACH_O_LC_SEGMENT_64)
+ if (cmd->type == BFD_MACH_O_LC_SEGMENT
+ || cmd->type == BFD_MACH_O_LC_SEGMENT_64)
{
- bfd_mach_o_segment_command *seg;
+ bfd_mach_o_segment_command *seg = &cmd->command.segment;
- seg = &mdata->commands[i].command.segment;
mdata->nsects += seg->nsects;
}
}
@@ -3949,15 +4674,14 @@ bfd_mach_o_flatten_sections (bfd *abfd)
/* Fill the array. */
csect = 0;
- for (i = 0; i < mdata->header.ncmds; i++)
+ for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next)
{
- if (mdata->commands[i].type == BFD_MACH_O_LC_SEGMENT
- || mdata->commands[i].type == BFD_MACH_O_LC_SEGMENT_64)
+ if (cmd->type == BFD_MACH_O_LC_SEGMENT
+ || cmd->type == BFD_MACH_O_LC_SEGMENT_64)
{
- bfd_mach_o_segment_command *seg;
+ bfd_mach_o_segment_command *seg = &cmd->command.segment;
bfd_mach_o_section *sec;
- seg = &mdata->commands[i].command.segment;
BFD_ASSERT (csect + seg->nsects <= mdata->nsects);
for (sec = seg->sect_head; sec != NULL; sec = sec->next)
@@ -3970,21 +4694,22 @@ static bfd_boolean
bfd_mach_o_scan_start_address (bfd *abfd)
{
bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
- bfd_mach_o_thread_command *cmd = NULL;
+ bfd_mach_o_thread_command *thr = NULL;
+ bfd_mach_o_load_command *cmd;
unsigned long i;
- for (i = 0; i < mdata->header.ncmds; i++)
- if ((mdata->commands[i].type == BFD_MACH_O_LC_THREAD) ||
- (mdata->commands[i].type == BFD_MACH_O_LC_UNIXTHREAD))
+ for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next)
+ if (cmd->type == BFD_MACH_O_LC_THREAD
+ || cmd->type == BFD_MACH_O_LC_UNIXTHREAD)
{
- cmd = &mdata->commands[i].command.thread;
+ thr = &cmd->command.thread;
break;
}
- else if (mdata->commands[i].type == BFD_MACH_O_LC_MAIN
- && mdata->nsects > 1)
+ else if (cmd->type == BFD_MACH_O_LC_MAIN && mdata->nsects > 1)
{
- bfd_mach_o_main_command *main_cmd = &mdata->commands[i].command.main;
+ bfd_mach_o_main_command *main_cmd = &cmd->command.main;
bfd_mach_o_section *text_sect = mdata->sections[0];
+
if (text_sect)
{
abfd->start_address = main_cmd->entryoff
@@ -3994,52 +4719,51 @@ bfd_mach_o_scan_start_address (bfd *abfd)
}
/* An object file has no start address, so do not fail if not found. */
- if (cmd == NULL)
+ if (thr == NULL)
return TRUE;
/* FIXME: create a subtarget hook ? */
- for (i = 0; i < cmd->nflavours; i++)
+ for (i = 0; i < thr->nflavours; i++)
{
if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_I386)
- && (cmd->flavours[i].flavour
- == (unsigned long) BFD_MACH_O_x86_THREAD_STATE32))
+ && (thr->flavours[i].flavour == BFD_MACH_O_x86_THREAD_STATE32))
{
unsigned char buf[4];
- if (bfd_seek (abfd, cmd->flavours[i].offset + 40, SEEK_SET) != 0
+ if (bfd_seek (abfd, thr->flavours[i].offset + 40, SEEK_SET) != 0
|| bfd_bread (buf, 4, abfd) != 4)
return FALSE;
abfd->start_address = bfd_h_get_32 (abfd, buf);
}
else if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_POWERPC)
- && (cmd->flavours[i].flavour == BFD_MACH_O_PPC_THREAD_STATE))
+ && (thr->flavours[i].flavour == BFD_MACH_O_PPC_THREAD_STATE))
{
unsigned char buf[4];
- if (bfd_seek (abfd, cmd->flavours[i].offset + 0, SEEK_SET) != 0
+ if (bfd_seek (abfd, thr->flavours[i].offset + 0, SEEK_SET) != 0
|| bfd_bread (buf, 4, abfd) != 4)
return FALSE;
abfd->start_address = bfd_h_get_32 (abfd, buf);
}
else if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_POWERPC_64)
- && (cmd->flavours[i].flavour == BFD_MACH_O_PPC_THREAD_STATE64))
+ && (thr->flavours[i].flavour == BFD_MACH_O_PPC_THREAD_STATE64))
{
unsigned char buf[8];
- if (bfd_seek (abfd, cmd->flavours[i].offset + 0, SEEK_SET) != 0
+ if (bfd_seek (abfd, thr->flavours[i].offset + 0, SEEK_SET) != 0
|| bfd_bread (buf, 8, abfd) != 8)
return FALSE;
abfd->start_address = bfd_h_get_64 (abfd, buf);
}
else if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_X86_64)
- && (cmd->flavours[i].flavour == BFD_MACH_O_x86_THREAD_STATE64))
+ && (thr->flavours[i].flavour == BFD_MACH_O_x86_THREAD_STATE64))
{
unsigned char buf[8];
- if (bfd_seek (abfd, cmd->flavours[i].offset + (16 * 8), SEEK_SET) != 0
+ if (bfd_seek (abfd, thr->flavours[i].offset + (16 * 8), SEEK_SET) != 0
|| bfd_bread (buf, 8, abfd) != 8)
return FALSE;
@@ -4113,24 +4837,29 @@ bfd_mach_o_scan (bfd *abfd,
if (header->ncmds != 0)
{
- mdata->commands = bfd_alloc
- (abfd, header->ncmds * sizeof (bfd_mach_o_load_command));
- if (mdata->commands == NULL)
+ bfd_mach_o_load_command *cmd;
+
+ mdata->first_command = NULL;
+ mdata->last_command = NULL;
+ cmd = bfd_alloc (abfd, header->ncmds * sizeof (bfd_mach_o_load_command));
+ if (cmd == NULL)
return FALSE;
for (i = 0; i < header->ncmds; i++)
{
- bfd_mach_o_load_command *cur = &mdata->commands[i];
+ bfd_mach_o_load_command *cur = &cmd[i];
+
+ bfd_mach_o_append_command (abfd, cur);
if (i == 0)
cur->offset = hdrsize;
else
{
- bfd_mach_o_load_command *prev = &mdata->commands[i - 1];
+ bfd_mach_o_load_command *prev = &cmd[i - 1];
cur->offset = prev->offset + prev->len;
}
- if (bfd_mach_o_read_command (abfd, cur) < 0)
+ if (!bfd_mach_o_read_command (abfd, cur))
return FALSE;
}
}
@@ -4148,7 +4877,7 @@ bfd_mach_o_mkobject_init (bfd *abfd)
{
bfd_mach_o_data_struct *mdata = NULL;
- mdata = bfd_alloc (abfd, sizeof (bfd_mach_o_data_struct));
+ mdata = bfd_zalloc (abfd, sizeof (bfd_mach_o_data_struct));
if (mdata == NULL)
return FALSE;
abfd->tdata.mach_o_data = mdata;
@@ -4161,7 +4890,8 @@ bfd_mach_o_mkobject_init (bfd *abfd)
mdata->header.sizeofcmds = 0;
mdata->header.flags = 0;
mdata->header.byteorder = BFD_ENDIAN_UNKNOWN;
- mdata->commands = NULL;
+ mdata->first_command = NULL;
+ mdata->last_command = NULL;
mdata->nsects = 0;
mdata->sections = NULL;
mdata->dyn_reloc_cache = NULL;
@@ -4222,6 +4952,15 @@ bfd_mach_o_header_p (bfd *abfd,
if (header.cputype != cputype)
goto wrong;
}
+ else
+ {
+#ifndef BFD64
+ /* Do not recognize 64 architectures if not configured for 64bit targets.
+ This could happen only for generic targets. */
+ if (mach_o_wide_p (&header))
+ goto wrong;
+#endif
+ }
if (filetype)
{
@@ -4268,6 +5007,34 @@ bfd_mach_o_gen_core_p (bfd *abfd)
return bfd_mach_o_header_p (abfd, BFD_MACH_O_MH_CORE, 0);
}
+/* Return the base address of ABFD, ie the address at which the image is
+ mapped. The possible initial pagezero is ignored. */
+
+bfd_vma
+bfd_mach_o_get_base_address (bfd *abfd)
+{
+ bfd_mach_o_data_struct *mdata;
+ bfd_mach_o_load_command *cmd;
+
+ /* Check for Mach-O. */
+ if (!bfd_mach_o_valid (abfd))
+ return 0;
+ mdata = bfd_mach_o_get_data (abfd);
+
+ for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next)
+ {
+ if ((cmd->type == BFD_MACH_O_LC_SEGMENT
+ || cmd->type == BFD_MACH_O_LC_SEGMENT_64))
+ {
+ struct bfd_mach_o_segment_command *segcmd = &cmd->command.segment;
+
+ if (segcmd->initprot != 0)
+ return segcmd->vmaddr;
+ }
+ }
+ return 0;
+}
+
typedef struct mach_o_fat_archentry
{
unsigned long cputype;
@@ -4353,13 +5120,13 @@ bfd_mach_o_fat_member_init (bfd *abfd,
if (ap)
{
/* Use the architecture name if known. */
- abfd->filename = ap->printable_name;
+ abfd->filename = xstrdup (ap->printable_name);
}
else
{
/* Forge a uniq id. */
const size_t namelen = 2 + 8 + 1 + 2 + 8 + 1;
- char *name = bfd_alloc (abfd, namelen);
+ char *name = xmalloc (namelen);
snprintf (name, namelen, "0x%lx-0x%lx",
entry->cputype, entry->cpusubtype);
abfd->filename = name;
@@ -4516,27 +5283,24 @@ bfd_mach_o_lookup_command (bfd *abfd,
bfd_mach_o_load_command_type type,
bfd_mach_o_load_command **mcommand)
{
- struct mach_o_data_struct *md = bfd_mach_o_get_data (abfd);
- bfd_mach_o_load_command *ncmd = NULL;
- unsigned int i, num;
+ struct mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
+ struct bfd_mach_o_load_command *cmd;
+ unsigned int num;
- BFD_ASSERT (md != NULL);
+ BFD_ASSERT (mdata != NULL);
BFD_ASSERT (mcommand != NULL);
num = 0;
- for (i = 0; i < md->header.ncmds; i++)
+ for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next)
{
- struct bfd_mach_o_load_command *cmd = &md->commands[i];
-
if (cmd->type != type)
continue;
if (num == 0)
- ncmd = cmd;
+ *mcommand = cmd;
num++;
}
- *mcommand = ncmd;
return num;
}
@@ -4647,17 +5411,16 @@ bfd_mach_o_core_fetch_environment (bfd *abfd,
{
bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
unsigned long stackaddr = bfd_mach_o_stack_addr (mdata->header.cputype);
- unsigned int i = 0;
+ bfd_mach_o_load_command *cmd;
- for (i = 0; i < mdata->header.ncmds; i++)
+ for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next)
{
- bfd_mach_o_load_command *cur = &mdata->commands[i];
- bfd_mach_o_segment_command *seg = NULL;
+ bfd_mach_o_segment_command *seg;
- if (cur->type != BFD_MACH_O_LC_SEGMENT)
+ if (cmd->type != BFD_MACH_O_LC_SEGMENT)
continue;
- seg = &cur->command.segment;
+ seg = &cmd->command.segment;
if ((seg->vmaddr + seg->vmsize) == stackaddr)
{
@@ -4737,7 +5500,7 @@ bfd_mach_o_core_file_failing_command (bfd *abfd)
{
unsigned char *buf = NULL;
unsigned int len = 0;
- int ret = -1;
+ int ret;
ret = bfd_mach_o_core_fetch_environment (abfd, &buf, &len);
if (ret < 0)
@@ -4868,12 +5631,13 @@ bfd_mach_o_follow_dsym (bfd *abfd)
bfd_boolean
bfd_mach_o_find_nearest_line (bfd *abfd,
- asection *section,
asymbol **symbols,
+ asection *section,
bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr,
- unsigned int *line_ptr)
+ unsigned int *line_ptr,
+ unsigned int *discriminator_ptr)
{
bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
if (mdata == NULL)
@@ -4897,20 +5661,19 @@ bfd_mach_o_find_nearest_line (bfd *abfd,
break;
if (! _bfd_dwarf2_slurp_debug_info (abfd, mdata->dsym_bfd,
dwarf_debug_sections, symbols,
- &mdata->dwarf2_find_line_info))
+ &mdata->dwarf2_find_line_info,
+ FALSE))
return FALSE;
}
break;
default:
return FALSE;
}
- if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections,
- section, symbols, offset,
- filename_ptr, functionname_ptr,
- line_ptr, NULL, 0,
- &mdata->dwarf2_find_line_info))
- return TRUE;
- return FALSE;
+ return _bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset,
+ filename_ptr, functionname_ptr,
+ line_ptr, discriminator_ptr,
+ dwarf_debug_sections, 0,
+ &mdata->dwarf2_find_line_info);
}
bfd_boolean
@@ -4968,6 +5731,7 @@ bfd_boolean bfd_mach_o_free_cached_info (bfd *abfd)
#define TARGET_NAME mach_o_be_vec
#define TARGET_STRING "mach-o-be"
#define TARGET_ARCHITECTURE bfd_arch_unknown
+#define TARGET_PAGESIZE 1
#define TARGET_BIG_ENDIAN 1
#define TARGET_ARCHIVE 0
#define TARGET_PRIORITY 1
@@ -4976,6 +5740,7 @@ bfd_boolean bfd_mach_o_free_cached_info (bfd *abfd)
#undef TARGET_NAME
#undef TARGET_STRING
#undef TARGET_ARCHITECTURE
+#undef TARGET_PAGESIZE
#undef TARGET_BIG_ENDIAN
#undef TARGET_ARCHIVE
#undef TARGET_PRIORITY
@@ -4983,6 +5748,7 @@ bfd_boolean bfd_mach_o_free_cached_info (bfd *abfd)
#define TARGET_NAME mach_o_le_vec
#define TARGET_STRING "mach-o-le"
#define TARGET_ARCHITECTURE bfd_arch_unknown
+#define TARGET_PAGESIZE 1
#define TARGET_BIG_ENDIAN 0
#define TARGET_ARCHIVE 0
#define TARGET_PRIORITY 1
@@ -4992,6 +5758,7 @@ bfd_boolean bfd_mach_o_free_cached_info (bfd *abfd)
#undef TARGET_NAME
#undef TARGET_STRING
#undef TARGET_ARCHITECTURE
+#undef TARGET_PAGESIZE
#undef TARGET_BIG_ENDIAN
#undef TARGET_ARCHIVE
#undef TARGET_PRIORITY
@@ -5014,6 +5781,7 @@ bfd_boolean bfd_mach_o_free_cached_info (bfd *abfd)
#define TARGET_NAME mach_o_fat_vec
#define TARGET_STRING "mach-o-fat"
#define TARGET_ARCHITECTURE bfd_arch_unknown
+#define TARGET_PAGESIZE 1
#define TARGET_BIG_ENDIAN 1
#define TARGET_ARCHIVE 1
#define TARGET_PRIORITY 0
@@ -5023,6 +5791,7 @@ bfd_boolean bfd_mach_o_free_cached_info (bfd *abfd)
#undef TARGET_NAME
#undef TARGET_STRING
#undef TARGET_ARCHITECTURE
+#undef TARGET_PAGESIZE
#undef TARGET_BIG_ENDIAN
#undef TARGET_ARCHIVE
#undef TARGET_PRIORITY
diff --git a/binutils-2.25/bfd/mach-o.h b/binutils-2.25/bfd/mach-o.h
index 916028fd..afe2dee0 100644
--- a/binutils-2.25/bfd/mach-o.h
+++ b/binutils-2.25/bfd/mach-o.h
@@ -1,7 +1,5 @@
/* Mach-O support for BFD.
- Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2008, 2009, 2011,
- 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -377,6 +375,27 @@ bfd_mach_o_dysymtab_command;
#define BFD_MACH_O_INDIRECT_SYMBOL_ABS 0x40000000
#define BFD_MACH_O_INDIRECT_SYMBOL_SIZE 4
+/* For LC_TWOLEVEL_HINTS. */
+
+typedef struct bfd_mach_o_twolevel_hints_command
+{
+ /* Offset to the hint table. */
+ unsigned int offset;
+
+ /* Number of entries in the table. */
+ unsigned int nhints;
+}
+bfd_mach_o_twolevel_hints_command;
+
+/* For LC_PREBIND_CKSUM. */
+
+typedef struct bfd_mach_o_prebind_cksum_command
+{
+ /* Checksum or zero. */
+ unsigned int cksum;
+}
+bfd_mach_o_prebind_cksum_command;
+
/* For LC_THREAD or LC_UNIXTHREAD. */
typedef struct bfd_mach_o_thread_flavour
@@ -399,8 +418,7 @@ bfd_mach_o_thread_command;
typedef struct bfd_mach_o_dylinker_command
{
- unsigned long name_offset; /* Offset to library's path name. */
- unsigned long name_len; /* Offset to library's path name. */
+ unsigned int name_offset; /* Offset to library's path name. */
char *name_str;
}
bfd_mach_o_dylinker_command;
@@ -410,8 +428,7 @@ bfd_mach_o_dylinker_command;
typedef struct bfd_mach_o_dylib_command
{
- unsigned long name_offset; /* Offset to library's path name. */
- unsigned long name_len; /* Offset to library's path name. */
+ unsigned int name_offset; /* Offset to library's path name. */
unsigned long timestamp; /* Library's build time stamp. */
unsigned long current_version; /* Library's current version number. */
unsigned long compatibility_version; /* Library's compatibility vers number. */
@@ -423,9 +440,12 @@ bfd_mach_o_dylib_command;
typedef struct bfd_mach_o_prebound_dylib_command
{
- unsigned long name; /* Library's path name. */
- unsigned long nmodules; /* Number of modules in library. */
- unsigned long linked_modules; /* Bit vector of linked modules. */
+ unsigned int name_offset; /* Library's path name. */
+ unsigned int nmodules; /* Number of modules in library. */
+ unsigned int linked_modules_offset; /* Bit vector of linked modules. */
+
+ char *name_str;
+ unsigned char *linked_modules;
}
bfd_mach_o_prebound_dylib_command;
@@ -457,7 +477,6 @@ bfd_mach_o_str_command;
typedef struct bfd_mach_o_fvmlib_command
{
unsigned int name_offset;
- unsigned int name_len;
char *name_str;
unsigned int minor_version;
unsigned int header_addr;
@@ -469,22 +488,27 @@ typedef struct bfd_mach_o_dyld_info_command
/* File offset and size to rebase info. */
unsigned int rebase_off;
unsigned int rebase_size;
+ unsigned char *rebase_content;
/* File offset and size of binding info. */
unsigned int bind_off;
unsigned int bind_size;
+ unsigned char *bind_content;
/* File offset and size of weak binding info. */
unsigned int weak_bind_off;
unsigned int weak_bind_size;
+ unsigned char *weak_bind_content;
/* File offset and size of lazy binding info. */
unsigned int lazy_bind_off;
unsigned int lazy_bind_size;
+ unsigned char *lazy_bind_content;
/* File offset and size of export info. */
unsigned int export_off;
unsigned int export_size;
+ unsigned char *export_content;
}
bfd_mach_o_dyld_info_command;
@@ -524,10 +548,17 @@ bfd_mach_o_source_version_command;
typedef struct bfd_mach_o_load_command
{
+ /* Next command in the single linked list. */
+ struct bfd_mach_o_load_command *next;
+
+ /* Type and required flag. */
bfd_mach_o_load_command_type type;
bfd_boolean type_required;
+
+ /* Offset and length in the file. */
unsigned int offset;
unsigned int len;
+
union
{
bfd_mach_o_segment_command segment;
@@ -537,6 +568,8 @@ typedef struct bfd_mach_o_load_command
bfd_mach_o_dylib_command dylib;
bfd_mach_o_dylinker_command dylinker;
bfd_mach_o_prebound_dylib_command prebound_dylib;
+ bfd_mach_o_prebind_cksum_command prebind_cksum;
+ bfd_mach_o_twolevel_hints_command twolevel_hints;
bfd_mach_o_uuid_command uuid;
bfd_mach_o_linkedit_command linkedit;
bfd_mach_o_str_command str;
@@ -546,8 +579,7 @@ typedef struct bfd_mach_o_load_command
bfd_mach_o_fvmlib_command fvmlib;
bfd_mach_o_main_command main;
bfd_mach_o_source_version_command source_version;
- }
- command;
+ } command;
}
bfd_mach_o_load_command;
@@ -556,7 +588,8 @@ typedef struct mach_o_data_struct
/* Mach-O header. */
bfd_mach_o_header header;
/* Array of load commands (length is given by header.ncmds). */
- bfd_mach_o_load_command *commands;
+ bfd_mach_o_load_command *first_command;
+ bfd_mach_o_load_command *last_command;
/* Flatten array of sections. The array is 0-based. */
unsigned long nsects;
@@ -615,7 +648,7 @@ bfd_boolean bfd_mach_o_bfd_copy_private_symbol_data (bfd *, asymbol *,
bfd *, asymbol *);
bfd_boolean bfd_mach_o_bfd_copy_private_section_data (bfd *, asection *,
bfd *, asection *);
-bfd_boolean bfd_mach_o_bfd_copy_private_bfd_data (bfd *, bfd *);
+bfd_boolean bfd_mach_o_bfd_copy_private_header_data (bfd *, bfd *);
bfd_boolean bfd_mach_o_bfd_set_private_flags (bfd *, flagword);
long bfd_mach_o_get_symtab_upper_bound (bfd *);
long bfd_mach_o_canonicalize_symtab (bfd *, asymbol **);
@@ -647,9 +680,11 @@ unsigned int bfd_mach_o_get_section_attribute_from_name (const char *);
void bfd_mach_o_convert_section_name_to_bfd (bfd *, const char *, const char *,
const char **, flagword *);
-bfd_boolean bfd_mach_o_find_nearest_line (bfd *, asection *, asymbol **,
- bfd_vma, const char **,
- const char **, unsigned int *);
+bfd_boolean bfd_mach_o_find_nearest_line (bfd *, asymbol **,
+ asection *, bfd_vma,
+ const char **, const char **,
+ unsigned int *, unsigned int *);
+#define bfd_mach_o_find_line _bfd_nosymbols_find_line
bfd_boolean bfd_mach_o_close_and_cleanup (bfd *);
bfd_boolean bfd_mach_o_free_cached_info (bfd *);
@@ -658,6 +693,8 @@ unsigned int bfd_mach_o_section_get_entry_size (bfd *, bfd_mach_o_section *);
bfd_boolean bfd_mach_o_read_symtab_symbols (bfd *);
bfd_boolean bfd_mach_o_read_symtab_strtab (bfd *abfd);
+bfd_vma bfd_mach_o_get_base_address (bfd *);
+
/* A placeholder in case we need to suppress emitting the dysymtab for some
reason (e.g. compatibility with older system versions). */
#define bfd_mach_o_should_emit_dysymtab(x) TRUE
@@ -693,6 +730,7 @@ bfd_mach_o_section_data_for_bfd_name (bfd *, const char *, const char **);
typedef struct bfd_mach_o_backend_data
{
enum bfd_architecture arch;
+ bfd_vma page_size;
bfd_boolean (*_bfd_mach_o_swap_reloc_in)(arelent *, bfd_mach_o_reloc_info *);
bfd_boolean (*_bfd_mach_o_swap_reloc_out)(arelent *, bfd_mach_o_reloc_info *);
bfd_boolean (*_bfd_mach_o_print_thread)(bfd *, bfd_mach_o_thread_flavour *,
diff --git a/binutils-2.25/bfd/makefile.vms b/binutils-2.25/bfd/makefile.vms
index 5534822c..9ef4019f 100644
--- a/binutils-2.25/bfd/makefile.vms
+++ b/binutils-2.25/bfd/makefile.vms
@@ -5,7 +5,7 @@
#
# Created by Klaus K"ampf, kkaempf@rmi.de
#
-# Copyright 2012 Free Software Foundation
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,13 +27,13 @@ HOSTFILE=alphavms.h
OBJS:=cpu-ia64.obj,elfxx-ia64.obj,elf64-ia64-vms.obj,\
vms-misc.obj,vms-lib.obj,elf-strtab.obj,corefile.obj,stabs.obj,\
merge.obj,elf-eh-frame.obj,elflink.obj,elf-attrs.obj,dwarf1.obj,elf64.obj
-DEFS=SELECT_VECS="&bfd_elf64_ia64_vms_vec",\
- SELECT_ARCHITECTURES="&bfd_ia64_arch","HAVE_bfd_elf64_ia64_vms_vec"=1
+DEFS=SELECT_VECS="&ia64_elf64_vms_vec",\
+ SELECT_ARCHITECTURES="&bfd_ia64_arch","HAVE_ia64_elf64_vms_vec"=1
endif
ifeq ($(ARCH),ALPHA)
HOSTFILE=alphavms.h
OBJS:=vms-alpha.obj,vms-lib.obj,vms-misc.obj,cpu-alpha.obj
-DEFS=SELECT_VECS="&vms_alpha_vec",SELECT_ARCHITECTURES="&bfd_alpha_arch"
+DEFS=SELECT_VECS="&alpha_vms_vec",SELECT_ARCHITECTURES="&bfd_alpha_arch"
endif
OBJS:=$(OBJS),archive.obj,archive64.obj,archures.obj,bfd.obj,bfdio.obj,\
diff --git a/binutils-2.25/bfd/mep-relocs.pl b/binutils-2.25/bfd/mep-relocs.pl
index a4f10d38..97f16272 100755
--- a/binutils-2.25/bfd/mep-relocs.pl
+++ b/binutils-2.25/bfd/mep-relocs.pl
@@ -2,7 +2,7 @@
# -*- perl -*-
#
# Toshiba MeP Media Engine Relocation Generator
-# Copyright (C) 2001, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# This file is part of BFD.
# Originally written by DJ Delorie <dj@redhat.com>
#
diff --git a/binutils-2.25/bfd/merge.c b/binutils-2.25/bfd/merge.c
index 0e49faea..15328f17 100644
--- a/binutils-2.25/bfd/merge.c
+++ b/binutils-2.25/bfd/merge.c
@@ -1,6 +1,5 @@
/* SEC_MERGE support.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
Written by Jakub Jelinek <jakub@redhat.com>.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/mipsbsd.c b/binutils-2.25/bfd/mipsbsd.c
index 202c23fb..d124cfda 100644
--- a/binutils-2.25/bfd/mipsbsd.c
+++ b/binutils-2.25/bfd/mipsbsd.c
@@ -1,6 +1,5 @@
/* BFD backend for MIPS BSD (a.out) binaries.
- Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2005, 2007, 2009, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Ralph Campbell.
This file is part of BFD, the Binary File Descriptor library.
@@ -399,9 +398,9 @@ static const struct aout_backend_data MY(backend_data) =
0 /* finish_dynamic_link */
};
-extern const bfd_target aout_mips_big_vec;
+extern const bfd_target mips_aout_be_vec;
-const bfd_target aout_mips_little_vec =
+const bfd_target mips_aout_le_vec =
{
"a.out-mips-little", /* name */
bfd_target_aout_flavour,
@@ -438,12 +437,12 @@ const bfd_target aout_mips_little_vec =
BFD_JUMP_TABLE_LINK (MY),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- & aout_mips_big_vec,
+ & mips_aout_be_vec,
MY_backend_data
};
-const bfd_target aout_mips_big_vec =
+const bfd_target mips_aout_be_vec =
{
"a.out-mips-big", /* name */
bfd_target_aout_flavour,
@@ -480,7 +479,7 @@ const bfd_target aout_mips_big_vec =
BFD_JUMP_TABLE_LINK (MY),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- & aout_mips_little_vec,
+ & mips_aout_le_vec,
MY_backend_data
};
diff --git a/binutils-2.25/bfd/mmo.c b/binutils-2.25/bfd/mmo.c
index cd7b0fc6..2c74c764 100644
--- a/binutils-2.25/bfd/mmo.c
+++ b/binutils-2.25/bfd/mmo.c
@@ -1,5 +1,5 @@
/* BFD back-end for mmo objects (MMIX-specific object-format).
- Copyright 2001-2013 Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
Written by Hans-Peter Nilsson (hp@bitrange.com).
Infrastructure and other bits originally copied from srec.c and
binary.c.
@@ -29,14 +29,14 @@ SECTION
The mmo object format is used exclusively together with Professor
Donald E.@: Knuth's educational 64-bit processor MMIX. The simulator
@command{mmix} which is available at
- @url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}
+ @url{http://mmix.cs.hm.edu/src/index.html}
understands this format. That package also includes a combined
assembler and linker called @command{mmixal}. The mmo format has
no advantages feature-wise compared to e.g. ELF. It is a simple
non-relocatable object format with no support for archives or
debugging information, except for symbol value information and
line numbers (which is not yet implemented in BFD). See
- @url{http://www-cs-faculty.stanford.edu/~knuth/mmix.html} for more
+ @url{http://mmix.cs.hm.edu/} for more
information about MMIX. The ELF format is used for intermediate
object files in the BFD implementation.
@@ -75,7 +75,7 @@ SUBSECTION
two remaining bytes, called the @samp{Y} and @samp{Z} fields, or
the @samp{YZ} field (a 16-bit big-endian number), are used for
various purposes different for each lopcode. As documented in
- @url{http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz},
+ @url{http://mmix.cs.hm.edu/doc/mmixal.pdf},
the lopcodes are:
@table @code
@@ -88,7 +88,11 @@ SUBSECTION
directive, setting the location for the next data to the next
32-bit word (for @math{Z = 1}) or 64-bit word (for @math{Z = 2}),
plus @math{Y * 2^56}. Normally @samp{Y} is 0 for the text segment
- and 2 for the data segment.
+ and 2 for the data segment. Beware that the low bits of non-
+ tetrabyte-aligned values are silently discarded when being
+ automatically incremented and when storing contents (in contrast
+ to e.g. its use as current location when followed by lop_fixo
+ et al before the next possibly-quoted tetrabyte contents).
@item lop_skip
0x9802YYZZ. Increase the current location by @samp{YZ} bytes.
@@ -822,6 +826,9 @@ mmo_write_chunk (bfd *abfd, const bfd_byte *loc, unsigned int len)
if (len)
{
+ /* We must have flushed a previous remainder if we get one from
+ this chunk too. */
+ BFD_ASSERT (mmop->byte_no == 0);
memcpy (mmop->buf, loc, len);
mmop->byte_no = len;
}
@@ -869,25 +876,27 @@ static bfd_boolean
mmo_write_loc_chunk (bfd *abfd, bfd_vma vma, const bfd_byte *loc,
unsigned int len, bfd_vma *last_vmap)
{
- /* Find an initial and trailing section of zero tetras; we don't need to
- write out zeros. FIXME: When we do this, we should emit section size
- and address specifiers, else objcopy can't always perform an identity
- translation. Only do this if we *don't* have left-over data from a
- previous write or the vma of this chunk is *not* the next address,
- because then data isn't tetrabyte-aligned and we're concatenating to
- that left-over data. */
-
- if (abfd->tdata.mmo_data->byte_no == 0 || vma != *last_vmap)
+ /* Find an initial and trailing section of zero (aligned) tetras; we don't
+ need to write out zeros. FIXME: When we do this, we should emit
+ section size and address specifiers, else objcopy can't always perform
+ an identity translation. Only do this if we *don't* have left-over
+ data from a previous write (and will not add any) or else the vma of
+ this chunk is *not* the next address, because then data isn't
+ tetrabyte-aligned and we're concatenating to that left-over data. */
+
+ if ((vma & 3) == 0
+ && (abfd->tdata.mmo_data->byte_no == 0 || vma != *last_vmap))
{
- while (len >= 4 && bfd_get_32 (abfd, loc) == 0)
+ while (len > 4 && bfd_get_32 (abfd, loc) == 0)
{
vma += 4;
len -= 4;
loc += 4;
}
- while (len >= 4 && bfd_get_32 (abfd, loc + len - 4) == 0)
- len -= 4;
+ if ((len & 3) == 0)
+ while (len > 4 && bfd_get_32 (abfd, loc + len - 4) == 0)
+ len -= 4;
}
/* Only write out the location if it's different than the one the caller
@@ -897,6 +906,22 @@ mmo_write_loc_chunk (bfd *abfd, bfd_vma vma, const bfd_byte *loc,
/* We might be in the middle of a sequence. */
mmo_flush_chunk (abfd);
+ /* This should not happen during normal usage, but can presumably
+ happen with an erroneous linker-script, so handle gracefully.
+ Avoid Knuth-specific terms in the message, such as "tetrabyte".
+ Note that this function will get non-4-multiple lengths and
+ unaligned vmas but those come in tuples (mostly pairs) and are
+ continuous (i.e. the if-condition above false) and they are
+ group-wise aligned. */
+ if ((vma & 3) != 0)
+ {
+ (*_bfd_error_handler)
+ (_("%s: attempt to emit contents at non-multiple-of-4 address 0x%lx\n"),
+ bfd_get_filename (abfd), (unsigned long) vma);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
/* We always write the location as 64 bits; no use saving bytes
here. */
mmo_write_tetra_raw (abfd, (LOP << 24) | (LOP_LOC << 16) | 2);
@@ -1206,8 +1231,8 @@ Symbol-table, mmo section mapping, File layout, mmo
SUBSECTION
Symbol table format
- From mmixal.w (or really, the generated mmixal.tex) in
- @url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}):
+ From mmixal.w (or really, the generated mmixal.tex) in the
+ MMIXware package which also contains the @command{mmix} simulator:
``Symbols are stored and retrieved by means of a @samp{ternary
search trie}, following ideas of Bentley and Sedgewick. (See
ACM--SIAM Symp.@: on Discrete Algorithms @samp{8} (1997), 360--369;
@@ -1583,9 +1608,9 @@ mmo_scan (bfd *abfd)
if (bfd_bread (buf, 4, abfd) != 4)
goto error_return;
+ vma &= ~3;
mmo_xore_32 (sec, vma, bfd_get_32 (abfd, buf));
vma += 4;
- vma &= ~3;
lineno++;
break;
@@ -1617,7 +1642,10 @@ mmo_scan (bfd *abfd)
goto error_return;
}
- sec = mmo_decide_section (abfd, vma);
+ /* When we decide which section the data goes into, we might
+ create the section. If that happens, make sure the VMA at
+ creation time is tetra-aligned. */
+ sec = mmo_decide_section (abfd, vma & ~3);
if (sec == NULL)
goto error_return;
break;
@@ -3182,6 +3210,7 @@ mmo_write_object_contents (bfd *abfd)
/* FIXME: We can do better on this one, if we have a dwarf2 .debug_line
section or if MMO line numbers are implemented. */
#define mmo_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define mmo_find_line _bfd_nosymbols_find_line
#define mmo_find_inliner_info _bfd_nosymbols_find_inliner_info
#define mmo_make_empty_symbol _bfd_generic_make_empty_symbol
#define mmo_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
@@ -3195,7 +3224,6 @@ mmo_write_object_contents (bfd *abfd)
#define mmo_bfd_gc_sections bfd_generic_gc_sections
#define mmo_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define mmo_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define mmo_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define mmo_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define mmo_bfd_link_just_syms _bfd_generic_link_just_syms
#define mmo_bfd_copy_link_hash_symbol_type \
@@ -3223,7 +3251,7 @@ mmo_write_object_contents (bfd *abfd)
#define mmo_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
#define mmo_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
-const bfd_target bfd_mmo_vec =
+const bfd_target mmix_mmo_vec =
{
"mmo", /* name */
bfd_target_mmo_flavour,
diff --git a/binutils-2.25/bfd/netbsd-core.c b/binutils-2.25/bfd/netbsd-core.c
index 695d3f5b..a048f130 100644
--- a/binutils-2.25/bfd/netbsd-core.c
+++ b/binutils-2.25/bfd/netbsd-core.c
@@ -1,7 +1,5 @@
/* BFD back end for NetBSD style core files
- Copyright 1988, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1988-2014 Free Software Foundation, Inc.
Written by Paul Kranenburg, EUR
This file is part of BFD, the Binary File Descriptor library.
@@ -267,7 +265,7 @@ swap_abort (void)
#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
-const bfd_target netbsd_core_vec =
+const bfd_target core_netbsd_vec =
{
"netbsd-core",
bfd_target_unknown_flavour,
diff --git a/binutils-2.25/bfd/netbsd.h b/binutils-2.25/bfd/netbsd.h
index 5f0303af..e4b861cc 100644
--- a/binutils-2.25/bfd/netbsd.h
+++ b/binutils-2.25/bfd/netbsd.h
@@ -1,6 +1,5 @@
/* BFD back-end definitions used by all NetBSD targets.
- Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2002,
- 2005, 2007, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/newsos3.c b/binutils-2.25/bfd/newsos3.c
index 650901c8..4eb4bee9 100644
--- a/binutils-2.25/bfd/newsos3.c
+++ b/binutils-2.25/bfd/newsos3.c
@@ -1,6 +1,5 @@
/* BFD back-end for NewsOS3 (Sony, 68k) binaries.
- Copyright 1990, 1991, 1994, 1995, 2000, 2001, 2003, 2005, 2007, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -26,7 +25,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (newsos3_,OP)
+#define MY(OP) CONCAT2 (m68k_aout_newsos3_,OP)
#define TARGETNAME "a.out-newsos3"
#define ENTRY_CAN_BE_ZERO
#define DEFAULT_ARCH bfd_arch_m68k
diff --git a/binutils-2.25/bfd/nlm-target.h b/binutils-2.25/bfd/nlm-target.h
index 9a3b7bef..2343cff1 100644
--- a/binutils-2.25/bfd/nlm-target.h
+++ b/binutils-2.25/bfd/nlm-target.h
@@ -1,6 +1,5 @@
/* Target definitions for 32/64-bit NLM (NetWare Loadable Module)
- Copyright 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -30,6 +29,7 @@
#define nlm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
#define nlm_get_lineno _bfd_nosymbols_get_lineno
#define nlm_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define nlm_find_line _bfd_nosymbols_find_line
#define nlm_find_inliner_info _bfd_nosymbols_find_inliner_info
#define nlm_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define nlm_read_minisymbols _bfd_generic_read_minisymbols
@@ -52,7 +52,6 @@
#define nlm_section_already_linked _bfd_generic_section_already_linked
#define nlm_bfd_define_common_symbol bfd_generic_define_common_symbol
#define nlm_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define nlm_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define nlm_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define nlm_bfd_link_just_syms _bfd_generic_link_just_syms
#define nlm_bfd_copy_link_hash_symbol_type \
diff --git a/binutils-2.25/bfd/nlm.c b/binutils-2.25/bfd/nlm.c
index eb25ab6a..acfc5d87 100644
--- a/binutils-2.25/bfd/nlm.c
+++ b/binutils-2.25/bfd/nlm.c
@@ -1,6 +1,5 @@
/* NLM (NetWare Loadable Module) executable support for BFD.
- Copyright 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/nlm32-alpha.c b/binutils-2.25/bfd/nlm32-alpha.c
index 33bb5b31..1e403a12 100644
--- a/binutils-2.25/bfd/nlm32-alpha.c
+++ b/binutils-2.25/bfd/nlm32-alpha.c
@@ -1,6 +1,5 @@
/* Support for 32-bit Alpha NLM (NetWare Loadable Module)
- Copyright 1993, 1994, 2000, 2001, 2002, 2003, 2004, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -854,7 +853,7 @@ static const struct nlm_backend_data nlm32_alpha_backend =
};
#define TARGET_LITTLE_NAME "nlm32-alpha"
-#define TARGET_LITTLE_SYM nlmNAME (alpha_vec)
+#define TARGET_LITTLE_SYM alpha_nlm32_vec
#define TARGET_BACKEND_DATA & nlm32_alpha_backend
#include "nlm-target.h"
diff --git a/binutils-2.25/bfd/nlm32-i386.c b/binutils-2.25/bfd/nlm32-i386.c
index 28b4433f..797e667a 100644
--- a/binutils-2.25/bfd/nlm32-i386.c
+++ b/binutils-2.25/bfd/nlm32-i386.c
@@ -1,6 +1,5 @@
/* Support for 32-bit i386 NLM (NetWare Loadable Module)
- Copyright 1993, 1994, 2000, 2001, 2002, 2003, 2005, 2007, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -424,7 +423,7 @@ static const struct nlm_backend_data nlm32_i386_backend =
};
#define TARGET_LITTLE_NAME "nlm32-i386"
-#define TARGET_LITTLE_SYM nlmNAME (i386_vec)
+#define TARGET_LITTLE_SYM i386_nlm32_vec
#define TARGET_BACKEND_DATA & nlm32_i386_backend
#include "nlm-target.h"
diff --git a/binutils-2.25/bfd/nlm32-ppc.c b/binutils-2.25/bfd/nlm32-ppc.c
index ef5bfa98..5ff11f07 100644
--- a/binutils-2.25/bfd/nlm32-ppc.c
+++ b/binutils-2.25/bfd/nlm32-ppc.c
@@ -1,6 +1,5 @@
/* Support for 32-bit PowerPC NLM (NetWare Loadable Module)
- Copyright 1994, 1995, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2007, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -981,7 +980,7 @@ static const struct nlm_backend_data nlm32_powerpc_backend =
};
#define TARGET_BIG_NAME "nlm32-powerpc"
-#define TARGET_BIG_SYM nlmNAME (powerpc_vec)
+#define TARGET_BIG_SYM powerpc_nlm32_vec
#define TARGET_BACKEND_DATA & nlm32_powerpc_backend
#include "nlm-target.h"
diff --git a/binutils-2.25/bfd/nlm32-sparc.c b/binutils-2.25/bfd/nlm32-sparc.c
index ba60e440..4a68fa21 100644
--- a/binutils-2.25/bfd/nlm32-sparc.c
+++ b/binutils-2.25/bfd/nlm32-sparc.c
@@ -1,6 +1,5 @@
/* Support for 32-bit SPARC NLM (NetWare Loadable Module)
- Copyright 1993, 1994, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -373,7 +372,7 @@ static const struct nlm_backend_data nlm32_sparc_backend =
};
#define TARGET_BIG_NAME "nlm32-sparc"
-#define TARGET_BIG_SYM nlmNAME (sparc_vec)
+#define TARGET_BIG_SYM sparc_nlm32_vec
#define TARGET_BACKEND_DATA & nlm32_sparc_backend
#include "nlm-target.h"
diff --git a/binutils-2.25/bfd/nlm32.c b/binutils-2.25/bfd/nlm32.c
index 99f4b006..ea20c6a4 100644
--- a/binutils-2.25/bfd/nlm32.c
+++ b/binutils-2.25/bfd/nlm32.c
@@ -1,5 +1,5 @@
/* NLM (NetWare Loadable Module) 32-bit executable support for BFD.
- Copyright 1993, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/nlm64.c b/binutils-2.25/bfd/nlm64.c
index 02d36136..a9f46062 100644
--- a/binutils-2.25/bfd/nlm64.c
+++ b/binutils-2.25/bfd/nlm64.c
@@ -1,5 +1,5 @@
/* NLM (NetWare Loadable Module) 64-bit executable support for BFD.
- Copyright 1993, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/nlmcode.h b/binutils-2.25/bfd/nlmcode.h
index ba0c9c6c..c8092e0c 100644
--- a/binutils-2.25/bfd/nlmcode.h
+++ b/binutils-2.25/bfd/nlmcode.h
@@ -1,6 +1,5 @@
/* NLM (NetWare Loadable Module) executable support for BFD.
- Copyright 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, using ELF support as the
template.
diff --git a/binutils-2.25/bfd/nlmswap.h b/binutils-2.25/bfd/nlmswap.h
index 3c0c8b36..5a34c4f0 100644
--- a/binutils-2.25/bfd/nlmswap.h
+++ b/binutils-2.25/bfd/nlmswap.h
@@ -1,5 +1,5 @@
/* NLM (NetWare Loadable Module) swapping routines for BFD.
- Copyright 1993, 2000, 2001, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, using ELF support as the
template.
diff --git a/binutils-2.25/bfd/ns32k.h b/binutils-2.25/bfd/ns32k.h
index 9018887d..f6715e1f 100644
--- a/binutils-2.25/bfd/ns32k.h
+++ b/binutils-2.25/bfd/ns32k.h
@@ -1,5 +1,5 @@
/* Header file for ns32k routines.
- Copyright 1996, 2001, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/ns32knetbsd.c b/binutils-2.25/bfd/ns32knetbsd.c
index fe0a6882..4af3aea2 100644
--- a/binutils-2.25/bfd/ns32knetbsd.c
+++ b/binutils-2.25/bfd/ns32knetbsd.c
@@ -1,6 +1,5 @@
/* BFD back-end for NetBSD/ns32k a.out-ish binaries.
- Copyright 1990, 1991, 1992, 1994, 1995, 1998, 2000, 2001, 2002, 2005,
- 2007, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -31,7 +30,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (pc532netbsd_,OP)
+#define MY(OP) CONCAT2 (ns32k_aout_pc532nbsd_,OP)
#define NAME(x,y) CONCAT3 (ns32kaout,_32_,y)
@@ -44,7 +43,7 @@
/* We can`t use the MYNS macro here for cpp reasons too subtle
for me -- IWD. */
-#define MY_bfd_reloc_type_lookup ns32kaout_bfd_reloc_type_lookup
+#define MY_bfd_reloc_type_lookup ns32k_aout_bfd_reloc_type_lookup
#include "sysdep.h"
#include "bfd.h" /* To ensure following declaration is OK. */
diff --git a/binutils-2.25/bfd/oasys.c b/binutils-2.25/bfd/oasys.c
index ebb12e84..9ff9b9e5 100644
--- a/binutils-2.25/bfd/oasys.c
+++ b/binutils-2.25/bfd/oasys.c
@@ -1,7 +1,5 @@
/* BFD back-end for oasys objects.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support, <sac@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@@ -28,6 +26,7 @@
#include "libbfd.h"
#include "oasys.h"
#include "liboasys.h"
+#include "libiberty.h"
/* Read in all the section data and relocation stuff too. */
@@ -1118,7 +1117,7 @@ oasys_openr_next_archived_file (bfd *arch, bfd *prev)
{
p->abfd = _bfd_create_empty_archive_element_shell (arch);
p->abfd->origin = p->pos;
- p->abfd->filename = p->name;
+ p->abfd->filename = xstrdup (p->name);
/* Fixup a pointer to this element for the member. */
p->abfd->arelt_data = (void *) p;
@@ -1130,26 +1129,9 @@ oasys_openr_next_archived_file (bfd *arch, bfd *prev)
return NULL;
}
-static bfd_boolean
-oasys_find_nearest_line (bfd *abfd ATTRIBUTE_UNUSED,
- asection *section ATTRIBUTE_UNUSED,
- asymbol **symbols ATTRIBUTE_UNUSED,
- bfd_vma offset ATTRIBUTE_UNUSED,
- const char **filename_ptr ATTRIBUTE_UNUSED,
- const char **functionname_ptr ATTRIBUTE_UNUSED,
- unsigned int *line_ptr ATTRIBUTE_UNUSED)
-{
- return FALSE;
-}
-
-static bfd_boolean
-oasys_find_inliner_info (bfd *abfd ATTRIBUTE_UNUSED,
- const char **filename_ptr ATTRIBUTE_UNUSED,
- const char **functionname_ptr ATTRIBUTE_UNUSED,
- unsigned int *line_ptr ATTRIBUTE_UNUSED)
-{
- return FALSE;
-}
+#define oasys_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define oasys_find_line _bfd_nosymbols_find_line
+#define oasys_find_inliner_info _bfd_nosymbols_find_inliner_info
static int
oasys_generic_stat_arch_elt (bfd *abfd, struct stat *buf)
@@ -1205,7 +1187,6 @@ oasys_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
#define oasys_section_already_linked _bfd_generic_section_already_linked
#define oasys_bfd_define_common_symbol bfd_generic_define_common_symbol
#define oasys_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define oasys_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define oasys_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define oasys_bfd_link_just_syms _bfd_generic_link_just_syms
#define oasys_bfd_copy_link_hash_symbol_type \
diff --git a/binutils-2.25/bfd/opncls.c b/binutils-2.25/bfd/opncls.c
index 2147deec..75af627d 100644
--- a/binutils-2.25/bfd/opncls.c
+++ b/binutils-2.25/bfd/opncls.c
@@ -1,5 +1,5 @@
/* opncls.c -- open and close a BFD.
- Copyright 1990-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -80,27 +80,12 @@ _bfd_new_bfd (void)
nbfd->arch_info = &bfd_default_arch_struct;
- nbfd->direction = no_direction;
- nbfd->iostream = NULL;
- nbfd->where = 0;
if (!bfd_hash_table_init_n (& nbfd->section_htab, bfd_section_hash_newfunc,
sizeof (struct section_hash_entry), 13))
{
free (nbfd);
return NULL;
}
- nbfd->sections = NULL;
- nbfd->section_last = NULL;
- nbfd->format = bfd_unknown;
- nbfd->my_archive = NULL;
- nbfd->origin = 0;
- nbfd->opened_once = FALSE;
- nbfd->output_has_begun = FALSE;
- nbfd->section_count = 0;
- nbfd->usrdata = NULL;
- nbfd->cacheable = FALSE;
- nbfd->flags = BFD_NO_FLAGS;
- nbfd->mtime_set = FALSE;
return nbfd;
}
@@ -138,6 +123,8 @@ _bfd_delete_bfd (bfd *abfd)
objalloc_free ((struct objalloc *) abfd->memory);
}
+ if (abfd->filename)
+ free ((char *) abfd->filename);
free (abfd->arelt_data);
free (abfd);
}
@@ -196,6 +183,9 @@ DESCRIPTION
<<system_call>> error.
On error, @var{fd} is always closed.
+
+ A copy of the @var{filename} argument is stored in the newly created
+ BFD. It can be accessed via the bfd_get_filename() macro.
*/
bfd *
@@ -235,7 +225,10 @@ bfd_fopen (const char *filename, const char *target, const char *mode, int fd)
}
/* OK, put everything where it belongs. */
- nbfd->filename = filename;
+
+ /* PR 11983: Do not cache the original filename, but
+ rather make a copy - the original might go away. */
+ nbfd->filename = xstrdup (filename);
/* Figure out whether the user is opening the file for reading,
writing, or both, by looking at the MODE argument. */
@@ -281,6 +274,9 @@ DESCRIPTION
If <<NULL>> is returned then an error has occured. Possible errors
are <<bfd_error_no_memory>>, <<bfd_error_invalid_target>> or
<<system_call>> error.
+
+ A copy of the @var{filename} argument is stored in the newly created
+ BFD. It can be accessed via the bfd_get_filename() macro.
*/
bfd *
@@ -322,6 +318,9 @@ DESCRIPTION
<<bfd_error_invalid_target>> and <<bfd_error_system_call>>.
On error, @var{fd} is closed.
+
+ A copy of the @var{filename} argument is stored in the newly created
+ BFD. It can be accessed via the bfd_get_filename() macro.
*/
bfd *
@@ -364,12 +363,15 @@ FUNCTION
bfd_openstreamr
SYNOPSIS
- bfd *bfd_openstreamr (const char *, const char *, void *);
+ bfd *bfd_openstreamr (const char * filename, const char * target, void * stream);
DESCRIPTION
Open a BFD for read access on an existing stdio stream. When
the BFD is passed to <<bfd_close>>, the stream will be closed.
+
+ A copy of the @var{filename} argument is stored in the newly created
+ BFD. It can be accessed via the bfd_get_filename() macro.
*/
bfd *
@@ -391,7 +393,9 @@ bfd_openstreamr (const char *filename, const char *target, void *streamarg)
}
nbfd->iostream = stream;
- nbfd->filename = filename;
+ /* PR 11983: Do not cache the original filename, but
+ rather make a copy - the original might go away. */
+ nbfd->filename = xstrdup (filename);
nbfd->direction = read_direction;
if (! bfd_cache_init (nbfd))
@@ -456,6 +460,8 @@ DESCRIPTION
occurred. Possible errors are <<bfd_error_no_memory>>,
<<bfd_error_invalid_target>> and <<bfd_error_system_call>>.
+ A copy of the @var{filename} argument is stored in the newly created
+ BFD. It can be accessed via the bfd_get_filename() macro.
*/
struct opncls
@@ -581,7 +587,9 @@ bfd_openr_iovec (const char *filename, const char *target,
return NULL;
}
- nbfd->filename = filename;
+ /* PR 11983: Do not cache the original filename, but
+ rather make a copy - the original might go away. */
+ nbfd->filename = xstrdup (filename);
nbfd->direction = read_direction;
/* `open_p (...)' would get expanded by an the open(2) syscall macro. */
@@ -622,6 +630,9 @@ DESCRIPTION
Possible errors are <<bfd_error_system_call>>, <<bfd_error_no_memory>>,
<<bfd_error_invalid_target>>.
+
+ A copy of the @var{filename} argument is stored in the newly created
+ BFD. It can be accessed via the bfd_get_filename() macro.
*/
bfd *
@@ -643,7 +654,9 @@ bfd_openw (const char *filename, const char *target)
return NULL;
}
- nbfd->filename = filename;
+ /* PR 11983: Do not cache the original filename, but
+ rather make a copy - the original might go away. */
+ nbfd->filename = xstrdup (filename);
nbfd->direction = write_direction;
if (bfd_open_file (nbfd) == NULL)
@@ -780,6 +793,9 @@ DESCRIPTION
Create a new BFD in the manner of <<bfd_openw>>, but without
opening a file. The new BFD takes the target from the target
used by @var{templ}. The format is always set to <<bfd_object>>.
+
+ A copy of the @var{filename} argument is stored in the newly created
+ BFD. It can be accessed via the bfd_get_filename() macro.
*/
bfd *
@@ -790,7 +806,9 @@ bfd_create (const char *filename, bfd *templ)
nbfd = _bfd_new_bfd ();
if (nbfd == NULL)
return NULL;
- nbfd->filename = filename;
+ /* PR 11983: Do not cache the original filename, but
+ rather make a copy - the original might go away. */
+ nbfd->filename = xstrdup (filename);
if (templ)
nbfd->xvec = templ->xvec;
nbfd->direction = no_direction;
@@ -919,14 +937,19 @@ void *
bfd_alloc (bfd *abfd, bfd_size_type size)
{
void *ret;
+ unsigned long ul_size = (unsigned long) size;
- if (size != (unsigned long) size)
+ if (size != ul_size
+ /* A small negative size can result in objalloc_alloc allocating just
+ 1 byte of memory, but the caller will be expecting more. So catch
+ this case here. */
+ || (size != 0 && (((ul_size + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1)) == 0)))
{
bfd_set_error (bfd_error_no_memory);
return NULL;
}
-
- ret = objalloc_alloc ((struct objalloc *) abfd->memory, (unsigned long) size);
+
+ ret = objalloc_alloc ((struct objalloc *) abfd->memory, ul_size);
if (ret == NULL)
bfd_set_error (bfd_error_no_memory);
return ret;
@@ -947,8 +970,6 @@ DESCRIPTION
void *
bfd_alloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size)
{
- void *ret;
-
if ((nmemb | size) >= HALF_BFD_SIZE_TYPE
&& size != 0
&& nmemb > ~(bfd_size_type) 0 / size)
@@ -957,18 +978,7 @@ bfd_alloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size)
return NULL;
}
- size *= nmemb;
-
- if (size != (unsigned long) size)
- {
- bfd_set_error (bfd_error_no_memory);
- return NULL;
- }
-
- ret = objalloc_alloc ((struct objalloc *) abfd->memory, (unsigned long) size);
- if (ret == NULL)
- bfd_set_error (bfd_error_no_memory);
- return ret;
+ return bfd_alloc (abfd, size * nmemb);
}
/*
@@ -1147,8 +1157,8 @@ SYNOPSIS
char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
DESCRIPTION
- fetch the filename and CRC32 value for any separate debuginfo
- associated with @var{abfd}. Return NULL if no such info found,
+ Fetch the filename and CRC32 value for any separate debuginfo
+ associated with @var{abfd}. Return NULL if no such info found,
otherwise return filename and update @var{crc32_out}. The
returned filename is allocated with @code{malloc}; freeing it
is the responsibility of the caller.
@@ -1160,7 +1170,7 @@ bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out)
asection *sect;
unsigned long crc32;
bfd_byte *contents;
- int crc_offset;
+ unsigned int crc_offset;
char *name;
BFD_ASSERT (abfd);
@@ -1178,10 +1188,13 @@ bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out)
return NULL;
}
- /* Crc value is stored after the filename, aligned up to 4 bytes. */
+ /* CRC value is stored after the filename, aligned up to 4 bytes. */
name = (char *) contents;
- crc_offset = strlen (name) + 1;
+ /* PR 17597: avoid reading off the end of the buffer. */
+ crc_offset = strnlen (name, bfd_get_section_size (sect)) + 1;
crc_offset = (crc_offset + 3) & ~3;
+ if (crc_offset >= bfd_get_section_size (sect))
+ return NULL;
crc32 = bfd_get_32 (abfd, contents + crc_offset);
@@ -1213,7 +1226,7 @@ bfd_get_alt_debug_link_info (bfd * abfd, bfd_size_type *buildid_len,
{
asection *sect;
bfd_byte *contents;
- int buildid_offset;
+ unsigned int buildid_offset;
char *name;
BFD_ASSERT (abfd);
@@ -1234,7 +1247,9 @@ bfd_get_alt_debug_link_info (bfd * abfd, bfd_size_type *buildid_len,
/* BuildID value is stored after the filename. */
name = (char *) contents;
- buildid_offset = strlen (name) + 1;
+ buildid_offset = strnlen (name, bfd_get_section_size (sect)) + 1;
+ if (buildid_offset >= bfd_get_section_size (sect))
+ return NULL;
*buildid_len = bfd_get_section_size (sect) - buildid_offset;
*buildid_out = bfd_malloc (*buildid_len);
diff --git a/binutils-2.25/bfd/osf-core.c b/binutils-2.25/bfd/osf-core.c
index ed5fbbe1..e4e2adbf 100644
--- a/binutils-2.25/bfd/osf-core.c
+++ b/binutils-2.25/bfd/osf-core.c
@@ -1,6 +1,5 @@
/* BFD back-end for OSF/1 core files.
- Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -174,7 +173,7 @@ swap_abort (void)
#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
-const bfd_target osf_core_vec =
+const bfd_target core_osf_vec =
{
"osf-core",
bfd_target_unknown_flavour,
diff --git a/binutils-2.25/bfd/pc532-mach.c b/binutils-2.25/bfd/pc532-mach.c
index 92523331..c9dcc669 100644
--- a/binutils-2.25/bfd/pc532-mach.c
+++ b/binutils-2.25/bfd/pc532-mach.c
@@ -1,6 +1,5 @@
/* BFD back-end for Mach3/532 a.out-ish binaries.
- Copyright 1990, 1991, 1992, 1994, 1995, 2000, 2001, 2002, 2005, 2007, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -52,7 +51,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (pc532machaout_,OP)
+#define MY(OP) CONCAT2 (ns32k_aout_pc532mach_,OP)
/* Must be the same as aout-ns32k.c */
#define NAME(x,y) CONCAT3 (ns32kaout,_32_,y)
@@ -65,7 +64,7 @@
#include "libbfd.h"
#include "aout/aout64.h"
-#define MY_bfd_reloc_type_lookup ns32kaout_bfd_reloc_type_lookup
+#define MY_bfd_reloc_type_lookup ns32k_aout_bfd_reloc_type_lookup
/* libaout doesn't use NAME for these ... */
@@ -75,7 +74,7 @@
#define MY_exec_header_not_counted 1
-reloc_howto_type *ns32kaout_bfd_reloc_type_lookup
+reloc_howto_type *MY_bfd_reloc_type_lookup
(bfd *abfd, bfd_reloc_code_real_type code);
static bfd_boolean
diff --git a/binutils-2.25/bfd/pdp11.c b/binutils-2.25/bfd/pdp11.c
index 1560f177..593c5ca9 100644
--- a/binutils-2.25/bfd/pdp11.c
+++ b/binutils-2.25/bfd/pdp11.c
@@ -1,6 +1,5 @@
/* BFD back-end for PDP-11 a.out binaries.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -252,7 +251,7 @@ HOWTO( 1, 0, 1, 16, TRUE, 0, complain_overflow_signed,0,"DISP16", TRU
#define TABLE_SIZE(TABLE) (sizeof(TABLE)/sizeof(TABLE[0]))
-static bfd_boolean aout_link_check_archive_element (bfd *, struct bfd_link_info *, bfd_boolean *);
+static bfd_boolean aout_link_check_archive_element (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, const char *, bfd_boolean *);
static bfd_boolean aout_link_add_object_symbols (bfd *, struct bfd_link_info *);
static bfd_boolean aout_link_add_symbols (bfd *, struct bfd_link_info *);
static bfd_boolean aout_link_write_symbols (struct aout_final_link_info *, bfd *);
@@ -2183,12 +2182,13 @@ NAME (aout, minisymbol_to_symbol) (bfd *abfd,
bfd_boolean
NAME (aout, find_nearest_line) (bfd *abfd,
- asection *section,
asymbol **symbols,
+ asection *section,
bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr,
- unsigned int *line_ptr)
+ unsigned int *line_ptr,
+ unsigned int *discriminator_ptr)
{
/* Run down the file looking for the filename, function and linenumber. */
asymbol **p;
@@ -2205,6 +2205,8 @@ NAME (aout, find_nearest_line) (bfd *abfd,
*filename_ptr = abfd->filename;
*functionname_ptr = 0;
*line_ptr = 0;
+ if (discriminator_ptr)
+ *discriminator_ptr = 0;
if (symbols != NULL)
{
@@ -2680,6 +2682,8 @@ aout_link_check_ar_symbols (bfd *abfd,
static bfd_boolean
aout_link_check_archive_element (bfd *abfd,
struct bfd_link_info *info,
+ struct bfd_link_hash_entry *h ATTRIBUTE_UNUSED,
+ const char *name ATTRIBUTE_UNUSED,
bfd_boolean *pneeded)
{
bfd *oldbfd;
@@ -3639,7 +3643,7 @@ aout_link_input_bfd (struct aout_final_link_info *flaginfo, bfd *input_bfd)
/* Do the final link step. This is called on the output BFD. The
INFO structure should point to a list of BFDs linked through the
- link_next field which can be used to find each BFD which takes part
+ link.next field which can be used to find each BFD which takes part
in the output. Also, each section in ABFD should point to a list
of bfd_link_order structures which list all the input sections for
the output section. */
@@ -3686,7 +3690,7 @@ NAME (aout, final_link) (bfd *abfd,
max_contents_size = 0;
max_relocs_size = 0;
max_sym_count = 0;
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
size_t sz;
@@ -3824,7 +3828,7 @@ NAME (aout, final_link) (bfd *abfd,
We use the output_has_begun field of the input BFDs to see
whether we have already handled it. */
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
sub->output_has_begun = FALSE;
/* Mark all sections which are to be included in the link. This
diff --git a/binutils-2.25/bfd/pe-arm-wince.c b/binutils-2.25/bfd/pe-arm-wince.c
index ab86a2c5..dcfccb3a 100644
--- a/binutils-2.25/bfd/pe-arm-wince.c
+++ b/binutils-2.25/bfd/pe-arm-wince.c
@@ -1,5 +1,5 @@
/* BFD back-end for ARM WINCE PE files.
- Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -21,9 +21,9 @@
#define TARGET_UNDERSCORE 0
#define USER_LABEL_PREFIX ""
-#define TARGET_LITTLE_SYM arm_wince_pe_little_vec
+#define TARGET_LITTLE_SYM arm_pe_wince_le_vec
#define TARGET_LITTLE_NAME "pe-arm-wince-little"
-#define TARGET_BIG_SYM arm_wince_pe_big_vec
+#define TARGET_BIG_SYM arm_pe_wince_be_vec
#define TARGET_BIG_NAME "pe-arm-wince-big"
#define bfd_arm_allocate_interworking_sections \
diff --git a/binutils-2.25/bfd/pe-arm.c b/binutils-2.25/bfd/pe-arm.c
index 909221f4..136fbf5c 100644
--- a/binutils-2.25/bfd/pe-arm.c
+++ b/binutils-2.25/bfd/pe-arm.c
@@ -1,6 +1,5 @@
/* BFD back-end for ARM PECOFF files.
- Copyright 1995, 1996, 1999, 2000, 2001, 2002, 2005, 2006, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -35,9 +34,9 @@
#include "bfd.h"
#ifndef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM armpe_little_vec
+#define TARGET_LITTLE_SYM arm_pe_le_vec
#define TARGET_LITTLE_NAME "pe-arm-little"
-#define TARGET_BIG_SYM armpe_big_vec
+#define TARGET_BIG_SYM arm_pe_be_vec
#define TARGET_BIG_NAME "pe-arm-big"
#endif
diff --git a/binutils-2.25/bfd/pe-i386.c b/binutils-2.25/bfd/pe-i386.c
index b26243a9..5f3789ca 100644
--- a/binutils-2.25/bfd/pe-i386.c
+++ b/binutils-2.25/bfd/pe-i386.c
@@ -1,6 +1,5 @@
/* BFD back-end for Intel 386 PECOFF files.
- Copyright 1995, 1996, 1999, 2001, 2002, 2004, 2005, 2006, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -22,7 +21,7 @@
#include "sysdep.h"
#include "bfd.h"
-#define TARGET_SYM i386pe_vec
+#define TARGET_SYM i386_pe_vec
#define TARGET_NAME "pe-i386"
#define COFF_WITH_PE
#define PCRELOFFSET TRUE
diff --git a/binutils-2.25/bfd/pe-mcore.c b/binutils-2.25/bfd/pe-mcore.c
index 32791c36..f9b9d343 100644
--- a/binutils-2.25/bfd/pe-mcore.c
+++ b/binutils-2.25/bfd/pe-mcore.c
@@ -1,5 +1,5 @@
/* BFD back-end for MCore PECOFF files.
- Copyright 1999, 2002, 2005, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -22,9 +22,9 @@
#include "bfd.h"
#ifndef TARGET_BIG_SYM
-#define TARGET_BIG_SYM mcore_pe_big_vec
+#define TARGET_BIG_SYM mcore_pe_be_vec
#define TARGET_BIG_NAME "pe-mcore-big"
-#define TARGET_LITTLE_SYM mcore_pe_little_vec
+#define TARGET_LITTLE_SYM mcore_pe_le_vec
#define TARGET_LITTLE_NAME "pe-mcore-little"
#endif
diff --git a/binutils-2.25/bfd/pe-mips.c b/binutils-2.25/bfd/pe-mips.c
index 2025e7df..57ec51fe 100644
--- a/binutils-2.25/bfd/pe-mips.c
+++ b/binutils-2.25/bfd/pe-mips.c
@@ -1,7 +1,5 @@
/* BFD back-end for MIPS PE COFF files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Modified from coff-i386.c by DJ Delorie, dj@cygnus.com
This file is part of BFD, the Binary File Descriptor library.
@@ -341,6 +339,8 @@ static reloc_howto_type howto_table[] =
FALSE), /* Pcrel_offset. */
};
+#define NUM_HOWTOS (sizeof (howto_table) / sizeof (howto_table[0]))
+
/* Turn a howto into a reloc nunmber. */
#define SELECT_RELOC(x, howto) { x.r_type = howto->type; }
@@ -381,7 +381,8 @@ static reloc_howto_type howto_table[] =
cache_ptr->addend = - (ptr->section->vma + ptr->value); \
else \
cache_ptr->addend = 0; \
- if (ptr && howto_table[reloc.r_type].pc_relative) \
+ if (ptr && reloc.r_type < NUM_HOWTOS \
+ && howto_table[reloc.r_type].pc_relative) \
cache_ptr->addend += asect->vma; \
}
@@ -511,9 +512,7 @@ coff_mips_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
{
unsigned int i;
- for (i = 0;
- i < sizeof (howto_table) / sizeof (howto_table[0]);
- i++)
+ for (i = 0; i < NUM_HOWTOS; i++)
if (howto_table[i].name != NULL
&& strcasecmp (howto_table[i].name, r_name) == 0)
return &howto_table[i];
@@ -858,7 +857,7 @@ const bfd_target
#ifdef TARGET_SYM
TARGET_SYM =
#else
- mipslpe_vec =
+ mips_pe_le_vec =
#endif
{
#ifdef TARGET_NAME
diff --git a/binutils-2.25/bfd/pe-ppc.c b/binutils-2.25/bfd/pe-ppc.c
index d36fbfb9..ea082b9b 100644
--- a/binutils-2.25/bfd/pe-ppc.c
+++ b/binutils-2.25/bfd/pe-ppc.c
@@ -1,6 +1,5 @@
/* BFD back-end for PowerPC PECOFF files.
- Copyright 1995, 1996, 1999, 2001, 2005, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -26,10 +25,10 @@
#define PPC_PE
-#define TARGET_LITTLE_SYM bfd_powerpcle_pe_vec
+#define TARGET_LITTLE_SYM powerpc_pe_le_vec
#define TARGET_LITTLE_NAME "pe-powerpcle"
-#define TARGET_BIG_SYM bfd_powerpc_pe_vec
+#define TARGET_BIG_SYM powerpc_pe_vec
#define TARGET_BIG_NAME "pe-powerpc"
#define COFF_WITH_PE
diff --git a/binutils-2.25/bfd/pe-sh.c b/binutils-2.25/bfd/pe-sh.c
index dabc3fff..9516a856 100644
--- a/binutils-2.25/bfd/pe-sh.c
+++ b/binutils-2.25/bfd/pe-sh.c
@@ -1,5 +1,5 @@
/* BFD back-end for SH PECOFF files.
- Copyright 1995, 2000, 2001, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -21,7 +21,7 @@
#include "sysdep.h"
#include "bfd.h"
-#define TARGET_SHL_SYM shlpe_vec
+#define TARGET_SHL_SYM sh_pe_le_vec
#define TARGET_SHL_NAME "pe-shl"
#define COFF_WITH_PE
#define PCRELOFFSET TRUE
diff --git a/binutils-2.25/bfd/pe-x86_64.c b/binutils-2.25/bfd/pe-x86_64.c
index 79d34d78..673a544b 100644
--- a/binutils-2.25/bfd/pe-x86_64.c
+++ b/binutils-2.25/bfd/pe-x86_64.c
@@ -1,5 +1,5 @@
/* BFD back-end for Intel/AMD x86_64 PECOFF files.
- Copyright 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -23,10 +23,11 @@
#include "sysdep.h"
#include "bfd.h"
-#define TARGET_SYM x86_64pe_vec
+#define TARGET_SYM x86_64_pe_vec
#define TARGET_NAME "pe-x86-64"
#define COFF_WITH_PE
#define COFF_WITH_pex64
+#define COFF_WITH_PE_BIGOBJ
#define PCRELOFFSET TRUE
#if defined (USE_MINGW64_LEADING_UNDERSCORES)
#define TARGET_UNDERSCORE '_'
@@ -58,3 +59,56 @@
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }
#include "coff-x86_64.c"
+
+/* Entry for big object files. */
+
+const bfd_target
+x86_64_pe_be_vec =
+{
+ "pe-bigobj-x86-64", /* Name. */
+ bfd_target_coff_flavour,
+ BFD_ENDIAN_LITTLE, /* Data byte order is little. */
+ BFD_ENDIAN_LITTLE, /* Header byte order is little. */
+
+ (HAS_RELOC | EXEC_P | /* Object flags. */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED | BFD_COMPRESS | BFD_DECOMPRESS),
+
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* Section flags. */
+ | SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_READONLY | SEC_DEBUGGING
+ | SEC_CODE | SEC_DATA | SEC_EXCLUDE ),
+
+ TARGET_UNDERSCORE, /* Leading underscore. */
+ '/', /* Ar_pad_char. */
+ 15, /* Ar_max_namelen. */
+ 0, /* match priority. */
+
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Data. */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Hdrs. */
+
+ /* Note that we allow an object file to be treated as a core file as well. */
+ { _bfd_dummy_target, amd64coff_object_p, /* BFD_check_format. */
+ bfd_generic_archive_p, amd64coff_object_p },
+ { bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format. */
+ bfd_false },
+ { bfd_false, coff_write_object_contents, /* bfd_write_contents. */
+ _bfd_write_archive_contents, bfd_false },
+
+ BFD_JUMP_TABLE_GENERIC (coff),
+ BFD_JUMP_TABLE_COPY (coff),
+ BFD_JUMP_TABLE_CORE (_bfd_nocore),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (coff),
+ BFD_JUMP_TABLE_LINK (coff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ NULL,
+
+ &bigobj_swap_table
+};
diff --git a/binutils-2.25/bfd/peXXigen.c b/binutils-2.25/bfd/peXXigen.c
index d0f7a96e..13e39e48 100644
--- a/binutils-2.25/bfd/peXXigen.c
+++ b/binutils-2.25/bfd/peXXigen.c
@@ -1,6 +1,5 @@
/* Support for the generic parts of PE/PEI; the common executable parts.
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
Written by Cygnus Solutions.
This file is part of BFD, the Binary File Descriptor library.
@@ -63,6 +62,9 @@
#include "libbfd.h"
#include "coff/internal.h"
#include "bfdver.h"
+#ifdef HAVE_WCHAR_H
+#include <wchar.h>
+#endif
/* NOTE: it's strange to be including an architecture specific header
in what's supposed to be general (to PE/PEI) code. However, that's
@@ -81,6 +83,7 @@
#include "coff/pe.h"
#include "libcoff.h"
#include "libpei.h"
+#include "safe-ctype.h"
#if defined COFF_WITH_pep || defined COFF_WITH_pex64
# undef AOUTSZ
@@ -88,6 +91,10 @@
# define PEAOUTHDR PEPAOUTHDR
#endif
+#define HighBitSet(val) ((val) & 0x80000000)
+#define SetHighBit(val) ((val) | 0x80000000)
+#define WithoutHighBit(val) ((val) & 0x7fffffff)
+
/* FIXME: This file has various tests of POWERPC_LE_PE. Those tests
worked when the code was in peicode.h, but no longer work now that
the code is in peigen.c. PowerPC NT is said to be dead. If
@@ -142,8 +149,13 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * ext1, void * in1)
name = _bfd_coff_internal_syment_name (abfd, in, namebuf);
if (name == NULL)
- /* FIXME: Return error. */
- abort ();
+ {
+ _bfd_error_handler (_("%B: unable to find name for empty section"),
+ abfd);
+ bfd_set_error (bfd_error_invalid_target);
+ return;
+ }
+
sec = bfd_get_section_by_name (abfd, name);
if (sec != NULL)
in->n_scnum = sec->target_index;
@@ -163,15 +175,22 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * ext1, void * in1)
{
name = (const char *) bfd_alloc (abfd, strlen (namebuf) + 1);
if (name == NULL)
- /* FIXME: Return error. */
- abort ();
+ {
+ _bfd_error_handler (_("%B: out of memory creating name for empty section"),
+ abfd);
+ return;
+ }
strcpy ((char *) name, namebuf);
}
+
flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_DATA | SEC_LOAD;
sec = bfd_make_section_anyway_with_flags (abfd, name, flags);
if (sec == NULL)
- /* FIXME: Return error. */
- abort ();
+ {
+ _bfd_error_handler (_("%B: unable to create fake empty section"),
+ abfd);
+ return;
+ }
sec->vma = 0;
sec->lma = 0;
@@ -200,6 +219,14 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * ext1, void * in1)
#endif
}
+static bfd_boolean
+abs_finder (bfd * abfd ATTRIBUTE_UNUSED, asection * sec, void * data)
+{
+ bfd_vma abs_val = * (bfd_vma *) data;
+
+ return (sec->vma <= abs_val) && ((sec->vma + (1ULL << 32)) > abs_val);
+}
+
unsigned int
_bfd_XXi_swap_sym_out (bfd * abfd, void * inp, void * extp)
{
@@ -214,6 +241,34 @@ _bfd_XXi_swap_sym_out (bfd * abfd, void * inp, void * extp)
else
memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN);
+ /* The PE32 and PE32+ formats only use 4 bytes to hold the value of a
+ symbol. This is a problem on 64-bit targets where we can generate
+ absolute symbols with values >= 1^32. We try to work around this
+ problem by finding a section whose base address is sufficient to
+ reduce the absolute value to < 1^32, and then transforming the
+ symbol into a section relative symbol. This of course is a hack. */
+ if (sizeof (in->n_value) > 4
+ /* The strange computation of the shift amount is here in order to
+ avoid a compile time warning about the comparison always being
+ false. It does not matter if this test fails to work as expected
+ as the worst that can happen is that some absolute symbols are
+ needlessly converted into section relative symbols. */
+ && in->n_value > ((1ULL << (sizeof (in->n_value) > 4 ? 32 : 31)) - 1)
+ && in->n_scnum == -1)
+ {
+ asection * sec;
+
+ sec = bfd_sections_find_if (abfd, abs_finder, & in->n_value);
+ if (sec)
+ {
+ in->n_value -= sec->vma;
+ in->n_scnum = sec->target_index;
+ }
+ /* else: FIXME: The value is outside the range of any section. This
+ happens for __image_base__ and __ImageBase and maybe some other
+ symbols as well. We should find a way to handle these values. */
+ }
+
H_PUT_32 (abfd, in->n_value, ext->e_value);
H_PUT_16 (abfd, in->n_scnum, ext->e_scnum);
@@ -240,6 +295,9 @@ _bfd_XXi_swap_aux_in (bfd * abfd,
AUXENT *ext = (AUXENT *) ext1;
union internal_auxent *in = (union internal_auxent *) in1;
+ /* PR 17521: Make sure that all fields in the aux structure
+ are initialised. */
+ memset (in, 0, sizeof * in);
switch (in_class)
{
case C_FILE:
@@ -415,6 +473,7 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd,
aouthdr_int->entry = GET_AOUTHDR_ENTRY (abfd, aouthdr_ext->entry);
aouthdr_int->text_start =
GET_AOUTHDR_TEXT_START (abfd, aouthdr_ext->text_start);
+
#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
/* PE32+ does not have data_start member! */
aouthdr_int->data_start =
@@ -461,6 +520,17 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd,
{
int idx;
+ /* PR 17512: Corrupt PE binaries can cause seg-faults. */
+ if (a->NumberOfRvaAndSizes > IMAGE_NUMBEROF_DIRECTORY_ENTRIES)
+ {
+ (*_bfd_error_handler)
+ (_("%B: aout header specifies an invalid number of data-directory entries: %d"),
+ abfd, a->NumberOfRvaAndSizes);
+ /* Paranoia: If the number is corrupt, then assume that the
+ actual entries themselves might be corrupt as well. */
+ a->NumberOfRvaAndSizes = 0;
+ }
+
for (idx = 0; idx < a->NumberOfRvaAndSizes; idx++)
{
/* If data directory is empty, rva also should be 0. */
@@ -475,6 +545,13 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd,
else
a->DataDirectory[idx].VirtualAddress = 0;
}
+
+ while (idx < IMAGE_NUMBEROF_DIRECTORY_ENTRIES)
+ {
+ a->DataDirectory[idx].Size = 0;
+ a->DataDirectory[idx].VirtualAddress = 0;
+ idx ++;
+ }
}
if (aouthdr_int->entry)
@@ -718,7 +795,7 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out)
{
int idx;
- for (idx = 0; idx < 16; idx++)
+ for (idx = 0; idx < IMAGE_NUMBEROF_DIRECTORY_ENTRIES; idx++)
{
H_PUT_32 (abfd, extra->DataDirectory[idx].VirtualAddress,
aouthdr_out->DataDirectory[idx][0]);
@@ -793,7 +870,10 @@ _bfd_XXi_only_swap_filehdr_out (bfd * abfd, void * in, void * out)
H_PUT_16 (abfd, filehdr_in->f_magic, filehdr_out->f_magic);
H_PUT_16 (abfd, filehdr_in->f_nscns, filehdr_out->f_nscns);
- H_PUT_32 (abfd, time (0), filehdr_out->f_timdat);
+ /* Only use a real timestamp if the option was chosen. */
+ if ((pe_data (abfd)->insert_timestamp))
+ H_PUT_32 (abfd, time (0), filehdr_out->f_timdat);
+
PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr,
filehdr_out->f_symptr);
H_PUT_32 (abfd, filehdr_in->f_nsyms, filehdr_out->f_nsyms);
@@ -1021,6 +1101,121 @@ _bfd_XXi_swap_scnhdr_out (bfd * abfd, void * in, void * out)
return ret;
}
+void
+_bfd_XXi_swap_debugdir_in (bfd * abfd, void * ext1, void * in1)
+{
+ struct external_IMAGE_DEBUG_DIRECTORY *ext = (struct external_IMAGE_DEBUG_DIRECTORY *) ext1;
+ struct internal_IMAGE_DEBUG_DIRECTORY *in = (struct internal_IMAGE_DEBUG_DIRECTORY *) in1;
+
+ in->Characteristics = H_GET_32(abfd, ext->Characteristics);
+ in->TimeDateStamp = H_GET_32(abfd, ext->TimeDateStamp);
+ in->MajorVersion = H_GET_16(abfd, ext->MajorVersion);
+ in->MinorVersion = H_GET_16(abfd, ext->MinorVersion);
+ in->Type = H_GET_32(abfd, ext->Type);
+ in->SizeOfData = H_GET_32(abfd, ext->SizeOfData);
+ in->AddressOfRawData = H_GET_32(abfd, ext->AddressOfRawData);
+ in->PointerToRawData = H_GET_32(abfd, ext->PointerToRawData);
+}
+
+unsigned int
+_bfd_XXi_swap_debugdir_out (bfd * abfd, void * inp, void * extp)
+{
+ struct external_IMAGE_DEBUG_DIRECTORY *ext = (struct external_IMAGE_DEBUG_DIRECTORY *) extp;
+ struct internal_IMAGE_DEBUG_DIRECTORY *in = (struct internal_IMAGE_DEBUG_DIRECTORY *) inp;
+
+ H_PUT_32(abfd, in->Characteristics, ext->Characteristics);
+ H_PUT_32(abfd, in->TimeDateStamp, ext->TimeDateStamp);
+ H_PUT_16(abfd, in->MajorVersion, ext->MajorVersion);
+ H_PUT_16(abfd, in->MinorVersion, ext->MinorVersion);
+ H_PUT_32(abfd, in->Type, ext->Type);
+ H_PUT_32(abfd, in->SizeOfData, ext->SizeOfData);
+ H_PUT_32(abfd, in->AddressOfRawData, ext->AddressOfRawData);
+ H_PUT_32(abfd, in->PointerToRawData, ext->PointerToRawData);
+
+ return sizeof (struct external_IMAGE_DEBUG_DIRECTORY);
+}
+
+static CODEVIEW_INFO *
+_bfd_XXi_slurp_codeview_record (bfd * abfd, file_ptr where, unsigned long length, CODEVIEW_INFO *cvinfo)
+{
+ char buffer[256+1];
+
+ if (bfd_seek (abfd, where, SEEK_SET) != 0)
+ return NULL;
+
+ if (bfd_bread (buffer, 256, abfd) < 4)
+ return NULL;
+
+ /* Ensure null termination of filename. */
+ buffer[256] = '\0';
+
+ cvinfo->CVSignature = H_GET_32(abfd, buffer);
+ cvinfo->Age = 0;
+
+ if ((cvinfo->CVSignature == CVINFO_PDB70_CVSIGNATURE)
+ && (length > sizeof (CV_INFO_PDB70)))
+ {
+ CV_INFO_PDB70 *cvinfo70 = (CV_INFO_PDB70 *)(buffer);
+
+ cvinfo->Age = H_GET_32(abfd, cvinfo70->Age);
+
+ /* A GUID consists of 4,2,2 byte values in little-endian order, followed
+ by 8 single bytes. Byte swap them so we can conveniently treat the GUID
+ as 16 bytes in big-endian order. */
+ bfd_putb32 (bfd_getl32 (cvinfo70->Signature), cvinfo->Signature);
+ bfd_putb16 (bfd_getl16 (&(cvinfo70->Signature[4])), &(cvinfo->Signature[4]));
+ bfd_putb16 (bfd_getl16 (&(cvinfo70->Signature[6])), &(cvinfo->Signature[6]));
+ memcpy (&(cvinfo->Signature[8]), &(cvinfo70->Signature[8]), 8);
+
+ cvinfo->SignatureLength = CV_INFO_SIGNATURE_LENGTH;
+ // cvinfo->PdbFileName = cvinfo70->PdbFileName;
+
+ return cvinfo;
+ }
+ else if ((cvinfo->CVSignature == CVINFO_PDB20_CVSIGNATURE)
+ && (length > sizeof (CV_INFO_PDB20)))
+ {
+ CV_INFO_PDB20 *cvinfo20 = (CV_INFO_PDB20 *)(buffer);
+ cvinfo->Age = H_GET_32(abfd, cvinfo20->Age);
+ memcpy (cvinfo->Signature, cvinfo20->Signature, 4);
+ cvinfo->SignatureLength = 4;
+ // cvinfo->PdbFileName = cvinfo20->PdbFileName;
+
+ return cvinfo;
+ }
+
+ return NULL;
+}
+
+unsigned int
+_bfd_XXi_write_codeview_record (bfd * abfd, file_ptr where, CODEVIEW_INFO *cvinfo)
+{
+ unsigned int size = sizeof (CV_INFO_PDB70) + 1;
+ CV_INFO_PDB70 *cvinfo70;
+ char buffer[size];
+
+ if (bfd_seek (abfd, where, SEEK_SET) != 0)
+ return 0;
+
+ cvinfo70 = (CV_INFO_PDB70 *) buffer;
+ H_PUT_32 (abfd, CVINFO_PDB70_CVSIGNATURE, cvinfo70->CvSignature);
+
+ /* Byte swap the GUID from 16 bytes in big-endian order to 4,2,2 byte values
+ in little-endian order, followed by 8 single bytes. */
+ bfd_putl32 (bfd_getb32 (cvinfo->Signature), cvinfo70->Signature);
+ bfd_putl16 (bfd_getb16 (&(cvinfo->Signature[4])), &(cvinfo70->Signature[4]));
+ bfd_putl16 (bfd_getb16 (&(cvinfo->Signature[6])), &(cvinfo70->Signature[6]));
+ memcpy (&(cvinfo70->Signature[8]), &(cvinfo->Signature[8]), 8);
+
+ H_PUT_32 (abfd, cvinfo->Age, cvinfo70->Age);
+ cvinfo70->PdbFileName[0] = '\0';
+
+ if (bfd_bwrite (buffer, size, abfd) != size)
+ return 0;
+
+ return size;
+}
+
static char * dir_names[IMAGE_NUMBEROF_DIRECTORY_ENTRIES] =
{
N_("Export Directory [.edata (or where ever we found it)]"),
@@ -1101,6 +1296,13 @@ pe_print_idata (bfd * abfd, void * vfile)
_("\nThere is an import table, but the section containing it could not be found\n"));
return TRUE;
}
+ else if (!(section->flags & SEC_HAS_CONTENTS))
+ {
+ fprintf (file,
+ _("\nThere is an import table in %s, but that section has no contents\n"),
+ section->name);
+ return TRUE;
+ }
}
fprintf (file, _("\nThere is an import table in %s at 0x%lx\n"),
@@ -1212,7 +1414,9 @@ pe_print_idata (bfd * abfd, void * vfile)
break;
dll = (char *) data + dll_name - adj;
- fprintf (file, _("\n\tDLL Name: %s\n"), dll);
+ /* PR 17512 file: 078-12277-0.004. */
+ bfd_size_type maxlen = (char *)(data + datasize) - dll - 1;
+ fprintf (file, _("\n\tDLL Name: %.*s\n"), (int) maxlen, dll);
if (hint_addr != 0)
{
@@ -1277,23 +1481,31 @@ pe_print_idata (bfd * abfd, void * vfile)
#ifdef COFF_WITH_pex64
for (j = 0; idx + j + 8 <= datasize; j += 8)
{
+ bfd_size_type amt;
unsigned long member = bfd_get_32 (abfd, data + idx + j);
unsigned long member_high = bfd_get_32 (abfd, data + idx + j + 4);
if (!member && !member_high)
break;
- if (member_high & 0x80000000)
+ amt = member - adj;
+
+ if (HighBitSet (member_high))
fprintf (file, "\t%lx%08lx\t %4lx%08lx <none>",
- member_high,member, member_high & 0x7fffffff, member);
+ member_high, member,
+ WithoutHighBit (member_high), member);
+ /* PR binutils/17512: Handle corrupt PE data. */
+ else if (amt + 2 >= datasize)
+ fprintf (file, _("\t<corrupt: 0x%04lx>"), member);
else
{
int ordinal;
char *member_name;
- ordinal = bfd_get_16 (abfd, data + member - adj);
- member_name = (char *) data + member - adj + 2;
- fprintf (file, "\t%04lx\t %4d %s",member, ordinal, member_name);
+ ordinal = bfd_get_16 (abfd, data + amt);
+ member_name = (char *) data + amt + 2;
+ fprintf (file, "\t%04lx\t %4d %.*s",member, ordinal,
+ (int) (datasize - (amt + 2)), member_name);
}
/* If the time stamp is not zero, the import address
@@ -1309,24 +1521,30 @@ pe_print_idata (bfd * abfd, void * vfile)
#else
for (j = 0; idx + j + 4 <= datasize; j += 4)
{
+ bfd_size_type amt;
unsigned long member = bfd_get_32 (abfd, data + idx + j);
/* Print single IMAGE_IMPORT_BY_NAME vector. */
if (member == 0)
break;
- if (member & 0x80000000)
+ amt = member - adj;
+ if (HighBitSet (member))
fprintf (file, "\t%04lx\t %4lu <none>",
- member, member & 0x7fffffff);
+ member, WithoutHighBit (member));
+ /* PR binutils/17512: Handle corrupt PE data. */
+ else if (amt + 2 >= datasize)
+ fprintf (file, _("\t<corrupt: 0x%04lx>"), member);
else
{
int ordinal;
char *member_name;
- ordinal = bfd_get_16 (abfd, data + member - adj);
- member_name = (char *) data + member - adj + 2;
- fprintf (file, "\t%04lx\t %4d %s",
- member, ordinal, member_name);
+ ordinal = bfd_get_16 (abfd, data + amt);
+ member_name = (char *) data + amt + 2;
+ fprintf (file, "\t%04lx\t %4d %.*s",
+ member, ordinal,
+ (int) (datasize - (amt + 2)), member_name);
}
/* If the time stamp is not zero, the import address
@@ -1362,7 +1580,7 @@ pe_print_edata (bfd * abfd, void * vfile)
bfd_size_type datasize = 0;
bfd_size_type dataoff;
bfd_size_type i;
- bfd_signed_vma adj;
+ bfd_vma adj;
struct EDT_type
{
long export_flags; /* Reserved - should be zero. */
@@ -1412,6 +1630,13 @@ pe_print_edata (bfd * abfd, void * vfile)
_("\nThere is an export table, but the section containing it could not be found\n"));
return TRUE;
}
+ else if (!(section->flags & SEC_HAS_CONTENTS))
+ {
+ fprintf (file,
+ _("\nThere is an export table in %s, but that section has no contents\n"),
+ section->name);
+ return TRUE;
+ }
dataoff = addr - section->vma;
datasize = extra->DataDirectory[PE_EXPORT_TABLE].Size;
@@ -1424,6 +1649,15 @@ pe_print_edata (bfd * abfd, void * vfile)
}
}
+ /* PR 17512: Handle corrupt PE binaries. */
+ if (datasize < 36)
+ {
+ fprintf (file,
+ _("\nThere is an export table in %s, but it is too small (%d)\n"),
+ section->name, (int) datasize);
+ return TRUE;
+ }
+
fprintf (file, _("\nThere is an export table in %s at 0x%lx\n"),
section->name, (unsigned long) addr);
@@ -1467,8 +1701,13 @@ pe_print_edata (bfd * abfd, void * vfile)
fprintf (file,
_("Name \t\t\t\t"));
bfd_fprintf_vma (abfd, file, edt.name);
- fprintf (file,
- " %s\n", data + edt.name - adj);
+
+ if ((edt.name >= adj) && (edt.name < adj + datasize))
+ fprintf (file, " %.*s\n",
+ (int) (datasize - (edt.name - adj)),
+ data + edt.name - adj);
+ else
+ fprintf (file, "(outside .edata section)\n");
fprintf (file,
_("Ordinal Base \t\t\t%ld\n"), edt.base);
@@ -1514,7 +1753,14 @@ pe_print_edata (bfd * abfd, void * vfile)
_("\nExport Address Table -- Ordinal Base %ld\n"),
edt.base);
- for (i = 0; i < edt.num_functions; ++i)
+ /* PR 17512: Handle corrupt PE binaries. */
+ if (edt.eat_addr + (edt.num_functions * 4) - adj >= datasize
+ /* PR 17512 file: 140-165018-0.004. */
+ || data + edt.eat_addr - adj < data)
+ fprintf (file, _("\tInvalid Export Address Table rva (0x%lx) or entry count (0x%lx)\n"),
+ (long) edt.eat_addr,
+ (long) edt.num_functions);
+ else for (i = 0; i < edt.num_functions; ++i)
{
bfd_vma eat_member = bfd_get_32 (abfd,
data + edt.eat_addr + (i * 4) - adj);
@@ -1526,11 +1772,12 @@ pe_print_edata (bfd * abfd, void * vfile)
/* This rva is to a name (forwarding function) in our section. */
/* Should locate a function descriptor. */
fprintf (file,
- "\t[%4ld] +base[%4ld] %04lx %s -- %s\n",
+ "\t[%4ld] +base[%4ld] %04lx %s -- %.*s\n",
(long) i,
(long) (i + edt.base),
(unsigned long) eat_member,
_("Forwarder RVA"),
+ (int)(datasize - (eat_member - adj)),
data + eat_member - adj);
}
else
@@ -1550,21 +1797,38 @@ pe_print_edata (bfd * abfd, void * vfile)
fprintf (file,
_("\n[Ordinal/Name Pointer] Table\n"));
- for (i = 0; i < edt.num_names; ++i)
+ /* PR 17512: Handle corrupt PE binaries. */
+ if (edt.npt_addr + (edt.num_names * 4) - adj >= datasize
+ || (data + edt.npt_addr - adj) < data)
+ fprintf (file, _("\tInvalid Name Pointer Table rva (0x%lx) or entry count (0x%lx)\n"),
+ (long) edt.npt_addr,
+ (long) edt.num_names);
+ /* PR 17512: file: 140-147171-0.004. */
+ else if (edt.ot_addr + (edt.num_names * 2) - adj >= datasize
+ || data + edt.ot_addr - adj < data)
+ fprintf (file, _("\tInvalid Ordinal Table rva (0x%lx) or entry count (0x%lx)\n"),
+ (long) edt.ot_addr,
+ (long) edt.num_names);
+ else for (i = 0; i < edt.num_names; ++i)
{
- bfd_vma name_ptr = bfd_get_32 (abfd,
- data +
- edt.npt_addr
- + (i*4) - adj);
+ bfd_vma name_ptr;
+ bfd_vma ord;
- char *name = (char *) data + name_ptr - adj;
+ ord = bfd_get_16 (abfd, data + edt.ot_addr + (i * 2) - adj);
+ name_ptr = bfd_get_32 (abfd, data + edt.npt_addr + (i * 4) - adj);
- bfd_vma ord = bfd_get_16 (abfd,
- data +
- edt.ot_addr
- + (i*2) - adj);
- fprintf (file,
- "\t[%4ld] %s\n", (long) ord, name);
+ if ((name_ptr - adj) >= datasize)
+ {
+ fprintf (file, _("\t[%4ld] <corrupt offset: %lx>\n"),
+ (long) ord, (long) name_ptr);
+ }
+ else
+ {
+ char * name = (char *) data + name_ptr - adj;
+
+ fprintf (file, "\t[%4ld] %.*s\n", (long) ord,
+ (int)((char *)(data + datasize) - name), name);
+ }
}
free (data);
@@ -1913,13 +2177,9 @@ pe_print_reloc (bfd * abfd, void * vfile)
FILE *file = (FILE *) vfile;
bfd_byte *data = 0;
asection *section = bfd_get_section_by_name (abfd, ".reloc");
- bfd_size_type i;
- bfd_size_type start, stop;
+ bfd_byte *p, *end;
- if (section == NULL)
- return TRUE;
-
- if (section->size == 0)
+ if (section == NULL || section->size == 0 || !(section->flags & SEC_HAS_CONTENTS))
return TRUE;
fprintf (file,
@@ -1932,20 +2192,20 @@ pe_print_reloc (bfd * abfd, void * vfile)
return FALSE;
}
- start = 0;
-
- stop = section->size;
-
- for (i = start; i < stop;)
+ p = data;
+ end = data + section->size;
+ while (p + 8 <= end)
{
int j;
bfd_vma virtual_address;
long number, size;
+ bfd_byte *chunk_end;
/* The .reloc section is a sequence of blocks, with a header consisting
of two 32 bit quantities, followed by a number of 16 bit entries. */
- virtual_address = bfd_get_32 (abfd, data+i);
- size = bfd_get_32 (abfd, data+i+4);
+ virtual_address = bfd_get_32 (abfd, p);
+ size = bfd_get_32 (abfd, p + 4);
+ p += 8;
number = (size - 8) / 2;
if (size == 0)
@@ -1955,9 +2215,13 @@ pe_print_reloc (bfd * abfd, void * vfile)
_("\nVirtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n"),
(unsigned long) virtual_address, size, (unsigned long) size, number);
- for (j = 0; j < number; ++j)
+ chunk_end = p + size;
+ if (chunk_end > end)
+ chunk_end = end;
+ j = 0;
+ while (p + 2 <= chunk_end)
{
- unsigned short e = bfd_get_16 (abfd, data + i + 8 + j * 2);
+ unsigned short e = bfd_get_16 (abfd, p);
unsigned int t = (e & 0xF000) >> 12;
int off = e & 0x0FFF;
@@ -1968,26 +2232,450 @@ pe_print_reloc (bfd * abfd, void * vfile)
_("\treloc %4d offset %4x [%4lx] %s"),
j, off, (unsigned long) (off + virtual_address), tbl[t]);
+ p += 2;
+ j++;
+
/* HIGHADJ takes an argument, - the next record *is* the
low 16 bits of addend. */
- if (t == IMAGE_REL_BASED_HIGHADJ)
+ if (t == IMAGE_REL_BASED_HIGHADJ && p + 2 <= chunk_end)
{
- fprintf (file, " (%4x)",
- ((unsigned int)
- bfd_get_16 (abfd, data + i + 8 + j * 2 + 2)));
+ fprintf (file, " (%4x)", (unsigned int) bfd_get_16 (abfd, p));
+ p += 2;
j++;
}
fprintf (file, "\n");
}
-
- i += size;
}
free (data);
return TRUE;
}
+
+/* A data structure describing the regions of a .rsrc section.
+ Some fields are filled in as the section is parsed. */
+
+typedef struct rsrc_regions
+{
+ bfd_byte * section_start;
+ bfd_byte * section_end;
+ bfd_byte * strings_start;
+ bfd_byte * resource_start;
+} rsrc_regions;
+
+static bfd_byte *
+rsrc_print_resource_directory (FILE * , bfd *, unsigned int, bfd_byte *,
+ rsrc_regions *, bfd_vma);
+
+/* Print the resource entry at DATA, with the text indented by INDENT.
+ Recusively calls rsrc_print_resource_directory to print the contents
+ of directory entries.
+ Returns the address of the end of the data associated with the entry
+ or section_end + 1 upon failure. */
+
+static bfd_byte *
+rsrc_print_resource_entries (FILE * file,
+ bfd * abfd,
+ unsigned int indent,
+ bfd_boolean is_name,
+ bfd_byte * data,
+ rsrc_regions * regions,
+ bfd_vma rva_bias)
+{
+ unsigned long entry, addr, size;
+
+ if (data + 8 >= regions->section_end)
+ return regions->section_end + 1;
+
+ fprintf (file, _("%03x %*.s Entry: "), (int)(data - regions->section_start), indent, " ");
+
+ entry = (unsigned long) bfd_get_32 (abfd, data);
+ if (is_name)
+ {
+ bfd_byte * name;
+
+ /* Note - the documentation says that this field is an RVA value
+ but windres appears to produce a section relative offset with
+ the top bit set. Support both styles for now. */
+ if (HighBitSet (entry))
+ name = regions->section_start + WithoutHighBit (entry);
+ else
+ name = regions->section_start + entry - rva_bias;
+
+ if (name + 2 < regions->section_end && name > regions->section_start)
+ {
+ unsigned int len;
+
+ if (regions->strings_start == NULL)
+ regions->strings_start = name;
+
+ len = bfd_get_16 (abfd, name);
+
+ fprintf (file, _("name: [val: %08lx len %d]: "), entry, len);
+
+ if (name + 2 + len * 2 < regions->section_end)
+ {
+ /* This strange loop is to cope with multibyte characters. */
+ while (len --)
+ {
+ char c;
+
+ name += 2;
+ c = * name;
+ /* Avoid printing control characters. */
+ if (c > 0 && c < 32)
+ fprintf (file, "^%c", c + 64);
+ else
+ fprintf (file, "%.1s", name);
+ }
+ }
+ else
+ {
+ fprintf (file, _("<corrupt string length: %#x>\n"), len);
+ /* PR binutils/17512: Do not try to continue decoding a
+ corrupted resource section. It is likely to end up with
+ reams of extraneous output. FIXME: We could probably
+ continue if we disable the printing of strings... */
+ return regions->section_end + 1;
+ }
+ }
+ else
+ {
+ fprintf (file, _("<corrupt string offset: %#lx>\n"), entry);
+ return regions->section_end + 1;
+ }
+ }
+ else
+ fprintf (file, _("ID: %#08lx"), entry);
+
+ entry = (long) bfd_get_32 (abfd, data + 4);
+ fprintf (file, _(", Value: %#08lx\n"), entry);
+
+ if (HighBitSet (entry))
+ {
+ data = regions->section_start + WithoutHighBit (entry);
+ if (data <= regions->section_start || data > regions->section_end)
+ return regions->section_end + 1;
+
+ /* FIXME: PR binutils/17512: A corrupt file could contain a loop
+ in the resource table. We need some way to detect this. */
+ return rsrc_print_resource_directory (file, abfd, indent + 1, data,
+ regions, rva_bias);
+ }
+
+ if (regions->section_start + entry + 16 >= regions->section_end)
+ return regions->section_end + 1;
+
+ fprintf (file, _("%03x %*.s Leaf: Addr: %#08lx, Size: %#08lx, Codepage: %d\n"),
+ (int) (entry),
+ indent, " ",
+ addr = (long) bfd_get_32 (abfd, regions->section_start + entry),
+ size = (long) bfd_get_32 (abfd, regions->section_start + entry + 4),
+ (int) bfd_get_32 (abfd, regions->section_start + entry + 8));
+
+ /* Check that the reserved entry is 0. */
+ if (bfd_get_32 (abfd, regions->section_start + entry + 12) != 0
+ /* And that the data address/size is valid too. */
+ || (regions->section_start + (addr - rva_bias) + size > regions->section_end))
+ return regions->section_end + 1;
+
+ if (regions->resource_start == NULL)
+ regions->resource_start = regions->section_start + (addr - rva_bias);
+
+ return regions->section_start + (addr - rva_bias) + size;
+}
+
+#define max(a,b) ((a) > (b) ? (a) : (b))
+#define min(a,b) ((a) < (b) ? (a) : (b))
+
+static bfd_byte *
+rsrc_print_resource_directory (FILE * file,
+ bfd * abfd,
+ unsigned int indent,
+ bfd_byte * data,
+ rsrc_regions * regions,
+ bfd_vma rva_bias)
+{
+ unsigned int num_names, num_ids;
+ bfd_byte * highest_data = data;
+
+ if (data + 16 >= regions->section_end)
+ return regions->section_end + 1;
+
+ fprintf (file, "%03x %*.s ", (int)(data - regions->section_start), indent, " ");
+ switch (indent)
+ {
+ case 0: fprintf (file, "Type"); break;
+ case 2: fprintf (file, "Name"); break;
+ case 4: fprintf (file, "Language"); break;
+ default:
+ fprintf (file, _("<unknown directory type: %d>\n"), indent);
+ /* FIXME: For now we end the printing here. If in the
+ future more directory types are added to the RSRC spec
+ then we will need to change this. */
+ return regions->section_end + 1;
+ }
+
+ fprintf (file, _(" Table: Char: %d, Time: %08lx, Ver: %d/%d, Num Names: %d, IDs: %d\n"),
+ (int) bfd_get_32 (abfd, data),
+ (long) bfd_get_32 (abfd, data + 4),
+ (int) bfd_get_16 (abfd, data + 8),
+ (int) bfd_get_16 (abfd, data + 10),
+ num_names = (int) bfd_get_16 (abfd, data + 12),
+ num_ids = (int) bfd_get_16 (abfd, data + 14));
+ data += 16;
+
+ while (num_names --)
+ {
+ bfd_byte * entry_end;
+
+ entry_end = rsrc_print_resource_entries (file, abfd, indent + 1, TRUE,
+ data, regions, rva_bias);
+ data += 8;
+ highest_data = max (highest_data, entry_end);
+ if (entry_end >= regions->section_end)
+ return entry_end;
+ }
+
+ while (num_ids --)
+ {
+ bfd_byte * entry_end;
+
+ entry_end = rsrc_print_resource_entries (file, abfd, indent + 1, FALSE,
+ data, regions, rva_bias);
+ data += 8;
+ highest_data = max (highest_data, entry_end);
+ if (entry_end >= regions->section_end)
+ return entry_end;
+ }
+
+ return max (highest_data, data);
+}
+
+/* Display the contents of a .rsrc section. We do not try to
+ reproduce the resources, windres does that. Instead we dump
+ the tables in a human readable format. */
+
+static bfd_boolean
+rsrc_print_section (bfd * abfd, void * vfile)
+{
+ bfd_vma rva_bias;
+ pe_data_type * pe;
+ FILE * file = (FILE *) vfile;
+ bfd_size_type datasize;
+ asection * section;
+ bfd_byte * data;
+ rsrc_regions regions;
+
+ pe = pe_data (abfd);
+ if (pe == NULL)
+ return TRUE;
+
+ section = bfd_get_section_by_name (abfd, ".rsrc");
+ if (section == NULL)
+ return TRUE;
+ if (!(section->flags & SEC_HAS_CONTENTS))
+ return TRUE;
+
+ datasize = section->size;
+ if (datasize == 0)
+ return TRUE;
+
+ rva_bias = section->vma - pe->pe_opthdr.ImageBase;
+
+ if (! bfd_malloc_and_get_section (abfd, section, & data))
+ {
+ if (data != NULL)
+ free (data);
+ return FALSE;
+ }
+
+ regions.section_start = data;
+ regions.section_end = data + datasize;
+ regions.strings_start = NULL;
+ regions.resource_start = NULL;
+
+ fflush (file);
+ fprintf (file, "\nThe .rsrc Resource Directory section:\n");
+
+ while (data < regions.section_end)
+ {
+ bfd_byte * p = data;
+
+ data = rsrc_print_resource_directory (file, abfd, 0, data, & regions, rva_bias);
+
+ if (data == regions.section_end + 1)
+ fprintf (file, _("Corrupt .rsrc section detected!\n"));
+ else
+ {
+ /* Align data before continuing. */
+ int align = (1 << section->alignment_power) - 1;
+
+ data = (bfd_byte *) (((ptrdiff_t) (data + align)) & ~ align);
+ rva_bias += data - p;
+
+ /* For reasons that are unclear .rsrc sections are sometimes created
+ aligned to a 1^3 boundary even when their alignment is set at
+ 1^2. Catch that case here before we issue a spurious warning
+ message. */
+ if (data == (regions.section_end - 4))
+ data = regions.section_end;
+ else if (data < regions.section_end)
+ {
+ /* If the extra data is all zeros then do not complain.
+ This is just padding so that the section meets the
+ page size requirements. */
+ while (data ++ < regions.section_end)
+ if (*data != 0)
+ break;
+ if (data < regions.section_end)
+ fprintf (file, _("\nWARNING: Extra data in .rsrc section - it will be ignored by Windows:\n"));
+ }
+ }
+ }
+
+ if (regions.strings_start != NULL)
+ fprintf (file, " String table starts at offset: %#03x\n",
+ (int) (regions.strings_start - regions.section_start));
+ if (regions.resource_start != NULL)
+ fprintf (file, " Resources start at offset: %#03x\n",
+ (int) (regions.resource_start - regions.section_start));
+
+ free (regions.section_start);
+ return TRUE;
+}
+
+#define IMAGE_NUMBEROF_DEBUG_TYPES 12
+
+static char * debug_type_names[IMAGE_NUMBEROF_DEBUG_TYPES] =
+{
+ "Unknown",
+ "COFF",
+ "CodeView",
+ "FPO",
+ "Misc",
+ "Exception",
+ "Fixup",
+ "OMAP-to-SRC",
+ "OMAP-from-SRC",
+ "Borland",
+ "Reserved",
+ "CLSID",
+};
+
+static bfd_boolean
+pe_print_debugdata (bfd * abfd, void * vfile)
+{
+ FILE *file = (FILE *) vfile;
+ pe_data_type *pe = pe_data (abfd);
+ struct internal_extra_pe_aouthdr *extra = &pe->pe_opthdr;
+ asection *section;
+ bfd_byte *data = 0;
+ bfd_size_type dataoff;
+ unsigned int i;
+
+ bfd_vma addr = extra->DataDirectory[PE_DEBUG_DATA].VirtualAddress;
+ bfd_size_type size = extra->DataDirectory[PE_DEBUG_DATA].Size;
+
+ if (size == 0)
+ return TRUE;
+
+ addr += extra->ImageBase;
+ for (section = abfd->sections; section != NULL; section = section->next)
+ {
+ if ((addr >= section->vma) && (addr < (section->vma + section->size)))
+ break;
+ }
+
+ if (section == NULL)
+ {
+ fprintf (file,
+ _("\nThere is a debug directory, but the section containing it could not be found\n"));
+ return TRUE;
+ }
+ else if (!(section->flags & SEC_HAS_CONTENTS))
+ {
+ fprintf (file,
+ _("\nThere is a debug directory in %s, but that section has no contents\n"),
+ section->name);
+ return TRUE;
+ }
+ else if (section->size < size)
+ {
+ fprintf (file,
+ _("\nError: section %s contains the debug data starting address but it is too small\n"),
+ section->name);
+ return FALSE;
+ }
+
+ fprintf (file, _("\nThere is a debug directory in %s at 0x%lx\n\n"),
+ section->name, (unsigned long) addr);
+
+ dataoff = addr - section->vma;
+
+ if (size > (section->size - dataoff))
+ {
+ fprintf (file, _("The debug data size field in the data directory is too big for the section"));
+ return FALSE;
+ }
+
+ fprintf (file,
+ _("Type Size Rva Offset\n"));
+
+ /* Read the whole section. */
+ if (!bfd_malloc_and_get_section (abfd, section, &data))
+ {
+ if (data != NULL)
+ free (data);
+ return FALSE;
+ }
+
+ for (i = 0; i < size / sizeof (struct external_IMAGE_DEBUG_DIRECTORY); i++)
+ {
+ const char *type_name;
+ struct external_IMAGE_DEBUG_DIRECTORY *ext
+ = &((struct external_IMAGE_DEBUG_DIRECTORY *)(data + dataoff))[i];
+ struct internal_IMAGE_DEBUG_DIRECTORY idd;
+
+ _bfd_XXi_swap_debugdir_in (abfd, ext, &idd);
+
+ if ((idd.Type) >= IMAGE_NUMBEROF_DEBUG_TYPES)
+ type_name = debug_type_names[0];
+ else
+ type_name = debug_type_names[idd.Type];
+
+ fprintf (file, " %2ld %14s %08lx %08lx %08lx\n",
+ idd.Type, type_name, idd.SizeOfData,
+ idd.AddressOfRawData, idd.PointerToRawData);
+
+ if (idd.Type == PE_IMAGE_DEBUG_TYPE_CODEVIEW)
+ {
+ char signature[CV_INFO_SIGNATURE_LENGTH * 2 + 1];
+ char buffer[256 + 1];
+ CODEVIEW_INFO *cvinfo = (CODEVIEW_INFO *) buffer;
+
+ /* The debug entry doesn't have to have to be in a section,
+ in which case AddressOfRawData is 0, so always use PointerToRawData. */
+ if (!_bfd_XXi_slurp_codeview_record (abfd, (file_ptr) idd.PointerToRawData,
+ idd.SizeOfData, cvinfo))
+ continue;
+
+ for (i = 0; i < cvinfo->SignatureLength; i++)
+ sprintf (&signature[i*2], "%02x", cvinfo->Signature[i] & 0xff);
+
+ fprintf (file, "(format %c%c%c%c signature %s age %ld)\n",
+ buffer[0], buffer[1], buffer[2], buffer[3],
+ signature, cvinfo->Age);
+ }
+ }
+
+ if (size % sizeof (struct external_IMAGE_DEBUG_DIRECTORY) != 0)
+ fprintf (file,
+ _("The debug directory size is not a multiple of the debug directory entry size\n"));
+
+ return TRUE;
+}
/* Print out the program headers. */
@@ -2162,10 +2850,26 @@ _bfd_XX_print_private_bfd_data_common (bfd * abfd, void * vfile)
else
pe_print_pdata (abfd, vfile);
pe_print_reloc (abfd, vfile);
+ pe_print_debugdata (abfd, file);
+
+ rsrc_print_section (abfd, vfile);
return TRUE;
}
+static bfd_boolean
+is_vma_in_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sect, void *obj)
+{
+ bfd_vma addr = * (bfd_vma *) obj;
+ return (addr >= sect->vma) && (addr < (sect->vma + sect->size));
+}
+
+static asection *
+find_section_by_vma (bfd *abfd, bfd_vma addr)
+{
+ return bfd_sections_find_if (abfd, is_vma_in_section, (void *) & addr);
+}
+
/* Copy any private info we understand from the input bfd
to the output bfd. */
@@ -2204,6 +2908,47 @@ _bfd_XX_bfd_copy_private_bfd_data_common (bfd * ibfd, bfd * obfd)
&& ! (pe_data (ibfd)->real_flags & IMAGE_FILE_RELOCS_STRIPPED))
pe_data (obfd)->dont_strip_reloc = 1;
+ /* The file offsets contained in the debug directory need rewriting. */
+ if (ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size != 0)
+ {
+ bfd_vma addr = ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].VirtualAddress
+ + ope->pe_opthdr.ImageBase;
+ asection *section = find_section_by_vma (obfd, addr);
+ bfd_byte *data;
+
+ if (section && bfd_malloc_and_get_section (obfd, section, &data))
+ {
+ unsigned int i;
+ struct external_IMAGE_DEBUG_DIRECTORY *dd =
+ (struct external_IMAGE_DEBUG_DIRECTORY *)(data + (addr - section->vma));
+
+ for (i = 0; i < ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size
+ / sizeof (struct external_IMAGE_DEBUG_DIRECTORY); i++)
+ {
+ asection *ddsection;
+ struct external_IMAGE_DEBUG_DIRECTORY *edd = &(dd[i]);
+ struct internal_IMAGE_DEBUG_DIRECTORY idd;
+
+ _bfd_XXi_swap_debugdir_in (obfd, edd, &idd);
+
+ if (idd.AddressOfRawData == 0)
+ continue; /* RVA 0 means only offset is valid, not handled yet. */
+
+ ddsection = find_section_by_vma (obfd, idd.AddressOfRawData + ope->pe_opthdr.ImageBase);
+ if (!ddsection)
+ continue; /* Not in a section! */
+
+ idd.PointerToRawData = ddsection->filepos + (idd.AddressOfRawData
+ + ope->pe_opthdr.ImageBase) - ddsection->vma;
+
+ _bfd_XXi_swap_debugdir_out (obfd, &idd, edd);
+ }
+
+ if (!bfd_set_section_contents (obfd, section, data, 0, section->size))
+ _bfd_error_handler (_("Failed to update file offsets in debug directory"));
+ }
+ }
+
return TRUE;
}
@@ -2267,6 +3012,1245 @@ sort_x64_pdata (const void *l, const void *r)
return 0;
}
#endif
+
+/* Functions to process a .rsrc section. */
+
+static unsigned int sizeof_leaves;
+static unsigned int sizeof_strings;
+static unsigned int sizeof_tables_and_entries;
+
+static bfd_byte *
+rsrc_count_directory (bfd *, bfd_byte *, bfd_byte *, bfd_byte *, bfd_vma);
+
+static bfd_byte *
+rsrc_count_entries (bfd * abfd,
+ bfd_boolean is_name,
+ bfd_byte * datastart,
+ bfd_byte * data,
+ bfd_byte * dataend,
+ bfd_vma rva_bias)
+{
+ unsigned long entry, addr, size;
+
+ if (data + 8 >= dataend)
+ return dataend + 1;
+
+ if (is_name)
+ {
+ bfd_byte * name;
+
+ entry = (long) bfd_get_32 (abfd, data);
+
+ if (HighBitSet (entry))
+ name = datastart + WithoutHighBit (entry);
+ else
+ name = datastart + entry - rva_bias;
+
+ if (name + 2 >= dataend || name < datastart)
+ return dataend + 1;
+
+ unsigned int len = bfd_get_16 (abfd, name);
+ if (len == 0 || len > 256)
+ return dataend + 1;
+ }
+
+ entry = (long) bfd_get_32 (abfd, data + 4);
+
+ if (HighBitSet (entry))
+ {
+ data = datastart + WithoutHighBit (entry);
+
+ if (data <= datastart || data >= dataend)
+ return dataend + 1;
+
+ return rsrc_count_directory (abfd, datastart, data, dataend, rva_bias);
+ }
+
+ if (datastart + entry + 16 >= dataend)
+ return dataend + 1;
+
+ addr = (long) bfd_get_32 (abfd, datastart + entry);
+ size = (long) bfd_get_32 (abfd, datastart + entry + 4);
+
+ return datastart + addr - rva_bias + size;
+}
+
+static bfd_byte *
+rsrc_count_directory (bfd * abfd,
+ bfd_byte * datastart,
+ bfd_byte * data,
+ bfd_byte * dataend,
+ bfd_vma rva_bias)
+{
+ unsigned int num_entries, num_ids;
+ bfd_byte * highest_data = data;
+
+ if (data + 16 >= dataend)
+ return dataend + 1;
+
+ num_entries = (int) bfd_get_16 (abfd, data + 12);
+ num_ids = (int) bfd_get_16 (abfd, data + 14);
+
+ num_entries += num_ids;
+
+ data += 16;
+
+ while (num_entries --)
+ {
+ bfd_byte * entry_end;
+
+ entry_end = rsrc_count_entries (abfd, num_entries >= num_ids,
+ datastart, data, dataend, rva_bias);
+ data += 8;
+ highest_data = max (highest_data, entry_end);
+ if (entry_end >= dataend)
+ break;
+ }
+
+ return max (highest_data, data);
+}
+
+typedef struct rsrc_dir_chain
+{
+ unsigned int num_entries;
+ struct rsrc_entry * first_entry;
+ struct rsrc_entry * last_entry;
+} rsrc_dir_chain;
+
+typedef struct rsrc_directory
+{
+ unsigned int characteristics;
+ unsigned int time;
+ unsigned int major;
+ unsigned int minor;
+
+ rsrc_dir_chain names;
+ rsrc_dir_chain ids;
+
+ struct rsrc_entry * entry;
+} rsrc_directory;
+
+typedef struct rsrc_string
+{
+ unsigned int len;
+ bfd_byte * string;
+} rsrc_string;
+
+typedef struct rsrc_leaf
+{
+ unsigned int size;
+ unsigned int codepage;
+ bfd_byte * data;
+} rsrc_leaf;
+
+typedef struct rsrc_entry
+{
+ bfd_boolean is_name;
+ union
+ {
+ unsigned int id;
+ struct rsrc_string name;
+ } name_id;
+
+ bfd_boolean is_dir;
+ union
+ {
+ struct rsrc_directory * directory;
+ struct rsrc_leaf * leaf;
+ } value;
+
+ struct rsrc_entry * next_entry;
+ struct rsrc_directory * parent;
+} rsrc_entry;
+
+static bfd_byte *
+rsrc_parse_directory (bfd *, rsrc_directory *, bfd_byte *,
+ bfd_byte *, bfd_byte *, bfd_vma, rsrc_entry *);
+
+static bfd_byte *
+rsrc_parse_entry (bfd * abfd,
+ bfd_boolean is_name,
+ rsrc_entry * entry,
+ bfd_byte * datastart,
+ bfd_byte * data,
+ bfd_byte * dataend,
+ bfd_vma rva_bias,
+ rsrc_directory * parent)
+{
+ unsigned long val, addr, size;
+
+ val = bfd_get_32 (abfd, data);
+
+ entry->parent = parent;
+ entry->is_name = is_name;
+
+ if (is_name)
+ {
+ bfd_byte * address;
+
+ if (HighBitSet (val))
+ {
+ val = WithoutHighBit (val);
+
+ address = datastart + val;
+ }
+ else
+ {
+ address = datastart + val - rva_bias;
+ }
+
+ if (address + 3 > dataend)
+ return dataend;
+
+ entry->name_id.name.len = bfd_get_16 (abfd, address);
+ entry->name_id.name.string = address + 2;
+ }
+ else
+ entry->name_id.id = val;
+
+ val = bfd_get_32 (abfd, data + 4);
+
+ if (HighBitSet (val))
+ {
+ entry->is_dir = TRUE;
+ entry->value.directory = bfd_malloc (sizeof * entry->value.directory);
+ if (entry->value.directory == NULL)
+ return dataend;
+
+ return rsrc_parse_directory (abfd, entry->value.directory,
+ datastart,
+ datastart + WithoutHighBit (val),
+ dataend, rva_bias, entry);
+ }
+
+ entry->is_dir = FALSE;
+ entry->value.leaf = bfd_malloc (sizeof * entry->value.leaf);
+ if (entry->value.leaf == NULL)
+ return dataend;
+
+ addr = bfd_get_32 (abfd, datastart + val);
+ size = entry->value.leaf->size = bfd_get_32 (abfd, datastart + val + 4);
+ entry->value.leaf->codepage = bfd_get_32 (abfd, datastart + val + 8);
+
+ entry->value.leaf->data = bfd_malloc (size);
+ if (entry->value.leaf->data == NULL)
+ return dataend;
+
+ memcpy (entry->value.leaf->data, datastart + addr - rva_bias, size);
+ return datastart + (addr - rva_bias) + size;
+}
+
+static bfd_byte *
+rsrc_parse_entries (bfd * abfd,
+ rsrc_dir_chain * chain,
+ bfd_boolean is_name,
+ bfd_byte * highest_data,
+ bfd_byte * datastart,
+ bfd_byte * data,
+ bfd_byte * dataend,
+ bfd_vma rva_bias,
+ rsrc_directory * parent)
+{
+ unsigned int i;
+ rsrc_entry * entry;
+
+ if (chain->num_entries == 0)
+ {
+ chain->first_entry = chain->last_entry = NULL;
+ return highest_data;
+ }
+
+ entry = bfd_malloc (sizeof * entry);
+ if (entry == NULL)
+ return dataend;
+
+ chain->first_entry = entry;
+
+ for (i = chain->num_entries; i--;)
+ {
+ bfd_byte * entry_end;
+
+ entry_end = rsrc_parse_entry (abfd, is_name, entry, datastart,
+ data, dataend, rva_bias, parent);
+ data += 8;
+ highest_data = max (entry_end, highest_data);
+ if (entry_end > dataend)
+ return dataend;
+
+ if (i)
+ {
+ entry->next_entry = bfd_malloc (sizeof * entry);
+ entry = entry->next_entry;
+ if (entry == NULL)
+ return dataend;
+ }
+ else
+ entry->next_entry = NULL;
+ }
+
+ chain->last_entry = entry;
+
+ return highest_data;
+}
+
+static bfd_byte *
+rsrc_parse_directory (bfd * abfd,
+ rsrc_directory * table,
+ bfd_byte * datastart,
+ bfd_byte * data,
+ bfd_byte * dataend,
+ bfd_vma rva_bias,
+ rsrc_entry * entry)
+{
+ bfd_byte * highest_data = data;
+
+ if (table == NULL)
+ return dataend;
+
+ table->characteristics = bfd_get_32 (abfd, data);
+ table->time = bfd_get_32 (abfd, data + 4);
+ table->major = bfd_get_16 (abfd, data + 8);
+ table->minor = bfd_get_16 (abfd, data + 10);
+ table->names.num_entries = bfd_get_16 (abfd, data + 12);
+ table->ids.num_entries = bfd_get_16 (abfd, data + 14);
+ table->entry = entry;
+
+ data += 16;
+
+ highest_data = rsrc_parse_entries (abfd, & table->names, TRUE, data,
+ datastart, data, dataend, rva_bias, table);
+ data += table->names.num_entries * 8;
+
+ highest_data = rsrc_parse_entries (abfd, & table->ids, FALSE, highest_data,
+ datastart, data, dataend, rva_bias, table);
+ data += table->ids.num_entries * 8;
+
+ return max (highest_data, data);
+}
+
+typedef struct rsrc_write_data
+{
+ bfd * abfd;
+ bfd_byte * datastart;
+ bfd_byte * next_table;
+ bfd_byte * next_leaf;
+ bfd_byte * next_string;
+ bfd_byte * next_data;
+ bfd_vma rva_bias;
+} rsrc_write_data;
+
+static void
+rsrc_write_string (rsrc_write_data * data,
+ rsrc_string * string)
+{
+ bfd_put_16 (data->abfd, string->len, data->next_string);
+ memcpy (data->next_string + 2, string->string, string->len * 2);
+ data->next_string += (string->len + 1) * 2;
+}
+
+static inline unsigned int
+rsrc_compute_rva (rsrc_write_data * data,
+ bfd_byte * addr)
+{
+ return (addr - data->datastart) + data->rva_bias;
+}
+
+static void
+rsrc_write_leaf (rsrc_write_data * data,
+ rsrc_leaf * leaf)
+{
+ bfd_put_32 (data->abfd, rsrc_compute_rva (data, data->next_data),
+ data->next_leaf);
+ bfd_put_32 (data->abfd, leaf->size, data->next_leaf + 4);
+ bfd_put_32 (data->abfd, leaf->codepage, data->next_leaf + 8);
+ bfd_put_32 (data->abfd, 0 /*reserved*/, data->next_leaf + 12);
+ data->next_leaf += 16;
+
+ memcpy (data->next_data, leaf->data, leaf->size);
+ /* An undocumented feature of Windows resources is that each unit
+ of raw data is 8-byte aligned... */
+ data->next_data += ((leaf->size + 7) & ~7);
+}
+
+static void rsrc_write_directory (rsrc_write_data *, rsrc_directory *);
+
+static void
+rsrc_write_entry (rsrc_write_data * data,
+ bfd_byte * where,
+ rsrc_entry * entry)
+{
+ if (entry->is_name)
+ {
+ bfd_put_32 (data->abfd,
+ SetHighBit (data->next_string - data->datastart),
+ where);
+ rsrc_write_string (data, & entry->name_id.name);
+ }
+ else
+ bfd_put_32 (data->abfd, entry->name_id.id, where);
+
+ if (entry->is_dir)
+ {
+ bfd_put_32 (data->abfd,
+ SetHighBit (data->next_table - data->datastart),
+ where + 4);
+ rsrc_write_directory (data, entry->value.directory);
+ }
+ else
+ {
+ bfd_put_32 (data->abfd, data->next_leaf - data->datastart, where + 4);
+ rsrc_write_leaf (data, entry->value.leaf);
+ }
+}
+
+static void
+rsrc_compute_region_sizes (rsrc_directory * dir)
+{
+ struct rsrc_entry * entry;
+
+ if (dir == NULL)
+ return;
+
+ sizeof_tables_and_entries += 16;
+
+ for (entry = dir->names.first_entry; entry != NULL; entry = entry->next_entry)
+ {
+ sizeof_tables_and_entries += 8;
+
+ sizeof_strings += (entry->name_id.name.len + 1) * 2;
+
+ if (entry->is_dir)
+ rsrc_compute_region_sizes (entry->value.directory);
+ else
+ sizeof_leaves += 16;
+ }
+
+ for (entry = dir->ids.first_entry; entry != NULL; entry = entry->next_entry)
+ {
+ sizeof_tables_and_entries += 8;
+
+ if (entry->is_dir)
+ rsrc_compute_region_sizes (entry->value.directory);
+ else
+ sizeof_leaves += 16;
+ }
+}
+
+static void
+rsrc_write_directory (rsrc_write_data * data,
+ rsrc_directory * dir)
+{
+ rsrc_entry * entry;
+ unsigned int i;
+ bfd_byte * next_entry;
+ bfd_byte * nt;
+
+ bfd_put_32 (data->abfd, dir->characteristics, data->next_table);
+ bfd_put_32 (data->abfd, 0 /*dir->time*/, data->next_table + 4);
+ bfd_put_16 (data->abfd, dir->major, data->next_table + 8);
+ bfd_put_16 (data->abfd, dir->minor, data->next_table + 10);
+ bfd_put_16 (data->abfd, dir->names.num_entries, data->next_table + 12);
+ bfd_put_16 (data->abfd, dir->ids.num_entries, data->next_table + 14);
+
+ /* Compute where the entries and the next table will be placed. */
+ next_entry = data->next_table + 16;
+ data->next_table = next_entry + (dir->names.num_entries * 8)
+ + (dir->ids.num_entries * 8);
+ nt = data->next_table;
+
+ /* Write the entries. */
+ for (i = dir->names.num_entries, entry = dir->names.first_entry;
+ i > 0 && entry != NULL;
+ i--, entry = entry->next_entry)
+ {
+ BFD_ASSERT (entry->is_name);
+ rsrc_write_entry (data, next_entry, entry);
+ next_entry += 8;
+ }
+ BFD_ASSERT (i == 0);
+ BFD_ASSERT (entry == NULL);
+
+ for (i = dir->ids.num_entries, entry = dir->ids.first_entry;
+ i > 0 && entry != NULL;
+ i--, entry = entry->next_entry)
+ {
+ BFD_ASSERT (! entry->is_name);
+ rsrc_write_entry (data, next_entry, entry);
+ next_entry += 8;
+ }
+ BFD_ASSERT (i == 0);
+ BFD_ASSERT (entry == NULL);
+ BFD_ASSERT (nt == next_entry);
+}
+
+#if defined HAVE_WCHAR_H && ! defined __CYGWIN__ && ! defined __MINGW32__
+/* Return the length (number of units) of the first character in S,
+ putting its 'ucs4_t' representation in *PUC. */
+
+static unsigned int
+u16_mbtouc (wchar_t * puc, const unsigned short * s, unsigned int n)
+{
+ unsigned short c = * s;
+
+ if (c < 0xd800 || c >= 0xe000)
+ {
+ *puc = c;
+ return 1;
+ }
+
+ if (c < 0xdc00)
+ {
+ if (n >= 2)
+ {
+ if (s[1] >= 0xdc00 && s[1] < 0xe000)
+ {
+ *puc = 0x10000 + ((c - 0xd800) << 10) + (s[1] - 0xdc00);
+ return 2;
+ }
+ }
+ else
+ {
+ /* Incomplete multibyte character. */
+ *puc = 0xfffd;
+ return n;
+ }
+ }
+
+ /* Invalid multibyte character. */
+ *puc = 0xfffd;
+ return 1;
+}
+#endif /* HAVE_WCHAR_H and not Cygwin/Mingw */
+
+/* Perform a comparison of two entries. */
+static signed int
+rsrc_cmp (bfd_boolean is_name, rsrc_entry * a, rsrc_entry * b)
+{
+ signed int res;
+ bfd_byte * astring;
+ unsigned int alen;
+ bfd_byte * bstring;
+ unsigned int blen;
+
+ if (! is_name)
+ return a->name_id.id - b->name_id.id;
+
+ /* We have to perform a case insenstive, unicode string comparison... */
+ astring = a->name_id.name.string;
+ alen = a->name_id.name.len;
+ bstring = b->name_id.name.string;
+ blen = b->name_id.name.len;
+
+#if defined __CYGWIN__ || defined __MINGW32__
+ /* Under Windows hosts (both Cygwin and Mingw types),
+ unicode == UTF-16 == wchar_t. The case insensitive string comparison
+ function however goes by different names in the two environments... */
+
+#undef rscpcmp
+#ifdef __CYGWIN__
+#define rscpcmp wcsncasecmp
+#endif
+#ifdef __MINGW32__
+#define rscpcmp wcsnicmp
+#endif
+
+ res = rscpcmp ((const wchar_t *) astring, (const wchar_t *) bstring,
+ min (alen, blen));
+
+#elif defined HAVE_WCHAR_H
+ {
+ unsigned int i;
+ res = 0;
+ for (i = min (alen, blen); i--; astring += 2, bstring += 2)
+ {
+ wchar_t awc;
+ wchar_t bwc;
+
+ /* Convert UTF-16 unicode characters into wchar_t characters so
+ that we can then perform a case insensitive comparison. */
+ int Alen = u16_mbtouc (& awc, (const unsigned short *) astring, 2);
+ int Blen = u16_mbtouc (& bwc, (const unsigned short *) bstring, 2);
+
+ if (Alen != Blen)
+ return Alen - Blen;
+ res = wcsncasecmp (& awc, & bwc, 1);
+ if (res)
+ break;
+ }
+ }
+#else
+ /* Do the best we can - a case sensitive, untranslated comparison. */
+ res = memcmp (astring, bstring, min (alen, blen) * 2);
+#endif
+
+ if (res == 0)
+ res = alen - blen;
+
+ return res;
+}
+
+static void
+rsrc_print_name (char * buffer, rsrc_string string)
+{
+ unsigned int i;
+ bfd_byte * name = string.string;
+
+ for (i = string.len; i--; name += 2)
+ sprintf (buffer + strlen (buffer), "%.1s", name);
+}
+
+static const char *
+rsrc_resource_name (rsrc_entry * entry, rsrc_directory * dir)
+{
+ static char buffer [256];
+ bfd_boolean is_string = FALSE;
+
+ buffer[0] = 0;
+
+ if (dir != NULL && dir->entry != NULL && dir->entry->parent != NULL
+ && dir->entry->parent->entry != NULL)
+ {
+ strcpy (buffer, "type: ");
+ if (dir->entry->parent->entry->is_name)
+ rsrc_print_name (buffer + strlen (buffer),
+ dir->entry->parent->entry->name_id.name);
+ else
+ {
+ unsigned int id = dir->entry->parent->entry->name_id.id;
+
+ sprintf (buffer + strlen (buffer), "%x", id);
+ switch (id)
+ {
+ case 1: strcat (buffer, " (CURSOR)"); break;
+ case 2: strcat (buffer, " (BITMAP)"); break;
+ case 3: strcat (buffer, " (ICON)"); break;
+ case 4: strcat (buffer, " (MENU)"); break;
+ case 5: strcat (buffer, " (DIALOG)"); break;
+ case 6: strcat (buffer, " (STRING)"); is_string = TRUE; break;
+ case 7: strcat (buffer, " (FONTDIR)"); break;
+ case 8: strcat (buffer, " (FONT)"); break;
+ case 9: strcat (buffer, " (ACCELERATOR)"); break;
+ case 10: strcat (buffer, " (RCDATA)"); break;
+ case 11: strcat (buffer, " (MESSAGETABLE)"); break;
+ case 12: strcat (buffer, " (GROUP_CURSOR)"); break;
+ case 14: strcat (buffer, " (GROUP_ICON)"); break;
+ case 16: strcat (buffer, " (VERSION)"); break;
+ case 17: strcat (buffer, " (DLGINCLUDE)"); break;
+ case 19: strcat (buffer, " (PLUGPLAY)"); break;
+ case 20: strcat (buffer, " (VXD)"); break;
+ case 21: strcat (buffer, " (ANICURSOR)"); break;
+ case 22: strcat (buffer, " (ANIICON)"); break;
+ case 23: strcat (buffer, " (HTML)"); break;
+ case 24: strcat (buffer, " (MANIFEST)"); break;
+ case 240: strcat (buffer, " (DLGINIT)"); break;
+ case 241: strcat (buffer, " (TOOLBAR)"); break;
+ }
+ }
+ }
+
+ if (dir != NULL && dir->entry != NULL)
+ {
+ strcat (buffer, " name: ");
+ if (dir->entry->is_name)
+ rsrc_print_name (buffer + strlen (buffer), dir->entry->name_id.name);
+ else
+ {
+ unsigned int id = dir->entry->name_id.id;
+
+ sprintf (buffer + strlen (buffer), "%x", id);
+
+ if (is_string)
+ sprintf (buffer + strlen (buffer), " (resource id range: %d - %d)",
+ (id - 1) << 4, (id << 4) - 1);
+ }
+ }
+
+ if (entry != NULL)
+ {
+ strcat (buffer, " lang: ");
+
+ if (entry->is_name)
+ rsrc_print_name (buffer + strlen (buffer), entry->name_id.name);
+ else
+ sprintf (buffer + strlen (buffer), "%x", entry->name_id.id);
+ }
+
+ return buffer;
+}
+
+/* *sigh* Windows resource strings are special. Only the top 28-bits of
+ their ID is stored in the NAME entry. The bottom four bits are used as
+ an index into unicode string table that makes up the data of the leaf.
+ So identical type-name-lang string resources may not actually be
+ identical at all.
+
+ This function is called when we have detected two string resources with
+ match top-28-bit IDs. We have to scan the string tables inside the leaves
+ and discover if there are any real collisions. If there are then we report
+ them and return FALSE. Otherwise we copy any strings from B into A and
+ then return TRUE. */
+
+static bfd_boolean
+rsrc_merge_string_entries (rsrc_entry * a ATTRIBUTE_UNUSED,
+ rsrc_entry * b ATTRIBUTE_UNUSED)
+{
+ unsigned int copy_needed = 0;
+ unsigned int i;
+ bfd_byte * astring;
+ bfd_byte * bstring;
+ bfd_byte * new_data;
+ bfd_byte * nstring;
+
+ /* Step one: Find out what we have to do. */
+ BFD_ASSERT (! a->is_dir);
+ astring = a->value.leaf->data;
+
+ BFD_ASSERT (! b->is_dir);
+ bstring = b->value.leaf->data;
+
+ for (i = 0; i < 16; i++)
+ {
+ unsigned int alen = astring[0] + (astring[1] << 8);
+ unsigned int blen = bstring[0] + (bstring[1] << 8);
+
+ if (alen == 0)
+ {
+ copy_needed += blen * 2;
+ }
+ else if (blen == 0)
+ ;
+ else if (alen != blen)
+ /* FIXME: Should we continue the loop in order to report other duplicates ? */
+ break;
+ /* alen == blen != 0. We might have two identical strings. If so we
+ can ignore the second one. There is no need for wchar_t vs UTF-16
+ theatrics here - we are only interested in (case sensitive) equality. */
+ else if (memcmp (astring + 2, bstring + 2, alen * 2) != 0)
+ break;
+
+ astring += (alen + 1) * 2;
+ bstring += (blen + 1) * 2;
+ }
+
+ if (i != 16)
+ {
+ if (a->parent != NULL
+ && a->parent->entry != NULL
+ && a->parent->entry->is_name == FALSE)
+ _bfd_error_handler (_(".rsrc merge failure: duplicate string resource: %d"),
+ ((a->parent->entry->name_id.id - 1) << 4) + i);
+ return FALSE;
+ }
+
+ if (copy_needed == 0)
+ return TRUE;
+
+ /* If we reach here then A and B must both have non-colliding strings.
+ (We never get string resources with fully empty string tables).
+ We need to allocate an extra COPY_NEEDED bytes in A and then bring
+ in B's strings. */
+ new_data = bfd_malloc (a->value.leaf->size + copy_needed);
+ if (new_data == NULL)
+ return FALSE;
+
+ nstring = new_data;
+ astring = a->value.leaf->data;
+ bstring = b->value.leaf->data;
+
+ for (i = 0; i < 16; i++)
+ {
+ unsigned int alen = astring[0] + (astring[1] << 8);
+ unsigned int blen = bstring[0] + (bstring[1] << 8);
+
+ if (alen != 0)
+ {
+ memcpy (nstring, astring, (alen + 1) * 2);
+ nstring += (alen + 1) * 2;
+ }
+ else if (blen != 0)
+ {
+ memcpy (nstring, bstring, (blen + 1) * 2);
+ nstring += (blen + 1) * 2;
+ }
+ else
+ {
+ * nstring++ = 0;
+ * nstring++ = 0;
+ }
+
+ astring += (alen + 1) * 2;
+ bstring += (blen + 1) * 2;
+ }
+
+ BFD_ASSERT (nstring - new_data == (signed) (a->value.leaf->size + copy_needed));
+
+ free (a->value.leaf->data);
+ a->value.leaf->data = new_data;
+ a->value.leaf->size += copy_needed;
+
+ return TRUE;
+}
+
+static void rsrc_merge (rsrc_entry *, rsrc_entry *);
+
+/* Sort the entries in given part of the directory.
+ We use an old fashioned bubble sort because we are dealing
+ with lists and we want to handle matches specially. */
+
+static void
+rsrc_sort_entries (rsrc_dir_chain * chain,
+ bfd_boolean is_name,
+ rsrc_directory * dir)
+{
+ rsrc_entry * entry;
+ rsrc_entry * next;
+ rsrc_entry ** points_to_entry;
+ bfd_boolean swapped;
+
+ if (chain->num_entries < 2)
+ return;
+
+ do
+ {
+ swapped = FALSE;
+ points_to_entry = & chain->first_entry;
+ entry = * points_to_entry;
+ next = entry->next_entry;
+
+ do
+ {
+ signed int cmp = rsrc_cmp (is_name, entry, next);
+
+ if (cmp > 0)
+ {
+ entry->next_entry = next->next_entry;
+ next->next_entry = entry;
+ * points_to_entry = next;
+ points_to_entry = & next->next_entry;
+ next = entry->next_entry;
+ swapped = TRUE;
+ }
+ else if (cmp == 0)
+ {
+ if (entry->is_dir && next->is_dir)
+ {
+ /* When we encounter identical directory entries we have to
+ merge them together. The exception to this rule is for
+ resource manifests - there can only be one of these,
+ even if they differ in language. Zero-language manifests
+ are assumed to be default manifests (provided by the
+ Cygwin/MinGW build system) and these can be silently dropped,
+ unless that would reduce the number of manifests to zero.
+ There should only ever be one non-zero lang manifest -
+ if there are more it is an error. A non-zero lang
+ manifest takes precedence over a default manifest. */
+ if (entry->is_name == FALSE
+ && entry->name_id.id == 1
+ && dir != NULL
+ && dir->entry != NULL
+ && dir->entry->is_name == FALSE
+ && dir->entry->name_id.id == 0x18)
+ {
+ if (next->value.directory->names.num_entries == 0
+ && next->value.directory->ids.num_entries == 1
+ && next->value.directory->ids.first_entry->is_name == FALSE
+ && next->value.directory->ids.first_entry->name_id.id == 0)
+ /* Fall through so that NEXT is dropped. */
+ ;
+ else if (entry->value.directory->names.num_entries == 0
+ && entry->value.directory->ids.num_entries == 1
+ && entry->value.directory->ids.first_entry->is_name == FALSE
+ && entry->value.directory->ids.first_entry->name_id.id == 0)
+ {
+ /* Swap ENTRY and NEXT. Then fall through so that the old ENTRY is dropped. */
+ entry->next_entry = next->next_entry;
+ next->next_entry = entry;
+ * points_to_entry = next;
+ points_to_entry = & next->next_entry;
+ next = entry->next_entry;
+ swapped = TRUE;
+ }
+ else
+ {
+ _bfd_error_handler (_(".rsrc merge failure: multiple non-default manifests"));
+ bfd_set_error (bfd_error_file_truncated);
+ return;
+ }
+
+ /* Unhook NEXT from the chain. */
+ /* FIXME: memory loss here. */
+ entry->next_entry = next->next_entry;
+ chain->num_entries --;
+ if (chain->num_entries < 2)
+ return;
+ next = next->next_entry;
+ }
+ else
+ rsrc_merge (entry, next);
+ }
+ else if (entry->is_dir != next->is_dir)
+ {
+ _bfd_error_handler (_(".rsrc merge failure: a directory matches a leaf"));
+ bfd_set_error (bfd_error_file_truncated);
+ return;
+ }
+ else
+ {
+ /* Otherwise with identical leaves we issue an error
+ message - because there should never be duplicates.
+ The exception is Type 18/Name 1/Lang 0 which is the
+ defaul manifest - this can just be dropped. */
+ if (entry->is_name == FALSE
+ && entry->name_id.id == 0
+ && dir != NULL
+ && dir->entry != NULL
+ && dir->entry->is_name == FALSE
+ && dir->entry->name_id.id == 1
+ && dir->entry->parent != NULL
+ && dir->entry->parent->entry != NULL
+ && dir->entry->parent->entry->is_name == FALSE
+ && dir->entry->parent->entry->name_id.id == 0x18 /* RT_MANIFEST */)
+ ;
+ else if (dir != NULL
+ && dir->entry != NULL
+ && dir->entry->parent != NULL
+ && dir->entry->parent->entry != NULL
+ && dir->entry->parent->entry->is_name == FALSE
+ && dir->entry->parent->entry->name_id.id == 0x6 /* RT_STRING */)
+ {
+ /* Strings need special handling. */
+ if (! rsrc_merge_string_entries (entry, next))
+ {
+ /* _bfd_error_handler should have been called inside merge_strings. */
+ bfd_set_error (bfd_error_file_truncated);
+ return;
+ }
+ }
+ else
+ {
+ if (dir == NULL
+ || dir->entry == NULL
+ || dir->entry->parent == NULL
+ || dir->entry->parent->entry == NULL)
+ _bfd_error_handler (_(".rsrc merge failure: duplicate leaf"));
+ else
+ _bfd_error_handler (_(".rsrc merge failure: duplicate leaf: %s"),
+ rsrc_resource_name (entry, dir));
+ bfd_set_error (bfd_error_file_truncated);
+ return;
+ }
+ }
+
+ /* Unhook NEXT from the chain. */
+ entry->next_entry = next->next_entry;
+ chain->num_entries --;
+ if (chain->num_entries < 2)
+ return;
+ next = next->next_entry;
+ }
+ else
+ {
+ points_to_entry = & entry->next_entry;
+ entry = next;
+ next = next->next_entry;
+ }
+ }
+ while (next);
+
+ chain->last_entry = entry;
+ }
+ while (swapped);
+}
+
+/* Attach B's chain onto A. */
+static void
+rsrc_attach_chain (rsrc_dir_chain * achain, rsrc_dir_chain * bchain)
+{
+ if (bchain->num_entries == 0)
+ return;
+
+ achain->num_entries += bchain->num_entries;
+
+ if (achain->first_entry == NULL)
+ {
+ achain->first_entry = bchain->first_entry;
+ achain->last_entry = bchain->last_entry;
+ }
+ else
+ {
+ achain->last_entry->next_entry = bchain->first_entry;
+ achain->last_entry = bchain->last_entry;
+ }
+
+ bchain->num_entries = 0;
+ bchain->first_entry = bchain->last_entry = NULL;
+}
+
+static void
+rsrc_merge (struct rsrc_entry * a, struct rsrc_entry * b)
+{
+ rsrc_directory * adir;
+ rsrc_directory * bdir;
+
+ BFD_ASSERT (a->is_dir);
+ BFD_ASSERT (b->is_dir);
+
+ adir = a->value.directory;
+ bdir = b->value.directory;
+
+ if (adir->characteristics != bdir->characteristics)
+ {
+ _bfd_error_handler (_(".rsrc merge failure: dirs with differing characteristics\n"));
+ bfd_set_error (bfd_error_file_truncated);
+ return;
+ }
+
+ if (adir->major != bdir->major || adir->minor != bdir->minor)
+ {
+ _bfd_error_handler (_(".rsrc merge failure: differing directory versions\n"));
+ bfd_set_error (bfd_error_file_truncated);
+ return;
+ }
+
+ /* Attach B's name chain to A. */
+ rsrc_attach_chain (& adir->names, & bdir->names);
+
+ /* Attach B's ID chain to A. */
+ rsrc_attach_chain (& adir->ids, & bdir->ids);
+
+ /* Now sort A's entries. */
+ rsrc_sort_entries (& adir->names, TRUE, adir);
+ rsrc_sort_entries (& adir->ids, FALSE, adir);
+}
+
+/* Check the .rsrc section. If it contains multiple concatenated
+ resources then we must merge them properly. Otherwise Windows
+ will ignore all but the first set. */
+
+static void
+rsrc_process_section (bfd * abfd,
+ struct coff_final_link_info * pfinfo)
+{
+ rsrc_directory new_table;
+ bfd_size_type size;
+ asection * sec;
+ pe_data_type * pe;
+ bfd_vma rva_bias;
+ bfd_byte * data;
+ bfd_byte * datastart;
+ bfd_byte * dataend;
+ bfd_byte * new_data;
+ unsigned int num_resource_sets;
+ rsrc_directory * type_tables;
+ rsrc_write_data write_data;
+ unsigned int indx;
+ bfd * input;
+ unsigned int num_input_rsrc = 0;
+ unsigned int max_num_input_rsrc = 4;
+ ptrdiff_t * rsrc_sizes = NULL;
+
+ new_table.names.num_entries = 0;
+ new_table.ids.num_entries = 0;
+
+ sec = bfd_get_section_by_name (abfd, ".rsrc");
+ if (sec == NULL || (size = sec->rawsize) == 0)
+ return;
+
+ pe = pe_data (abfd);
+ if (pe == NULL)
+ return;
+
+ rva_bias = sec->vma - pe->pe_opthdr.ImageBase;
+
+ data = bfd_malloc (size);
+ if (data == NULL)
+ return;
+
+ datastart = data;
+
+ if (! bfd_get_section_contents (abfd, sec, data, 0, size))
+ goto end;
+
+ /* Step zero: Scan the input bfds looking for .rsrc sections and record
+ their lengths. Note - we rely upon the fact that the linker script
+ does *not* sort the input .rsrc sections, so that the order in the
+ linkinfo list matches the order in the output .rsrc section.
+
+ We need to know the lengths because each input .rsrc section has padding
+ at the end of a variable amount. (It does not appear to be based upon
+ the section alignment or the file alignment). We need to skip any
+ padding bytes when parsing the input .rsrc sections. */
+ rsrc_sizes = bfd_malloc (max_num_input_rsrc * sizeof * rsrc_sizes);
+ if (rsrc_sizes == NULL)
+ goto end;
+
+ for (input = pfinfo->info->input_bfds;
+ input != NULL;
+ input = input->link.next)
+ {
+ asection * rsrc_sec = bfd_get_section_by_name (input, ".rsrc");
+
+ if (rsrc_sec != NULL)
+ {
+ if (num_input_rsrc == max_num_input_rsrc)
+ {
+ max_num_input_rsrc += 10;
+ rsrc_sizes = bfd_realloc (rsrc_sizes, max_num_input_rsrc
+ * sizeof * rsrc_sizes);
+ if (rsrc_sizes == NULL)
+ goto end;
+ }
+
+ BFD_ASSERT (rsrc_sec->size > 0);
+ rsrc_sizes [num_input_rsrc ++] = rsrc_sec->size;
+ }
+ }
+
+ if (num_input_rsrc < 2)
+ goto end;
+
+ /* Step one: Walk the section, computing the size of the tables,
+ leaves and data and decide if we need to do anything. */
+ dataend = data + size;
+ num_resource_sets = 0;
+
+ while (data < dataend)
+ {
+ bfd_byte * p = data;
+
+ data = rsrc_count_directory (abfd, data, data, dataend, rva_bias);
+
+ if (data > dataend)
+ {
+ /* Corrupted .rsrc section - cannot merge. */
+ _bfd_error_handler (_("%s: .rsrc merge failure: corrupt .rsrc section"),
+ bfd_get_filename (abfd));
+ bfd_set_error (bfd_error_file_truncated);
+ goto end;
+ }
+
+ if ((data - p) > rsrc_sizes [num_resource_sets])
+ {
+ _bfd_error_handler (_("%s: .rsrc merge failure: unexpected .rsrc size"),
+ bfd_get_filename (abfd));
+ bfd_set_error (bfd_error_file_truncated);
+ goto end;
+ }
+ /* FIXME: Should we add a check for "data - p" being much smaller
+ than rsrc_sizes[num_resource_sets] ? */
+
+ data = p + rsrc_sizes[num_resource_sets];
+ rva_bias += data - p;
+ ++ num_resource_sets;
+ }
+ BFD_ASSERT (num_resource_sets == num_input_rsrc);
+
+ /* Step two: Walk the data again, building trees of the resources. */
+ data = datastart;
+ rva_bias = sec->vma - pe->pe_opthdr.ImageBase;
+
+ type_tables = bfd_malloc (num_resource_sets * sizeof * type_tables);
+ if (type_tables == NULL)
+ goto end;
+
+ indx = 0;
+ while (data < dataend)
+ {
+ bfd_byte * p = data;
+
+ (void) rsrc_parse_directory (abfd, type_tables + indx, data, data,
+ dataend, rva_bias, NULL);
+ data = p + rsrc_sizes[indx];
+ rva_bias += data - p;
+ ++ indx;
+ }
+ BFD_ASSERT (indx == num_resource_sets);
+
+ /* Step three: Merge the top level tables (there can be only one).
+
+ We must ensure that the merged entries are in ascending order.
+
+ We also thread the top level table entries from the old tree onto
+ the new table, so that they can be pulled off later. */
+
+ /* FIXME: Should we verify that all type tables are the same ? */
+ new_table.characteristics = type_tables[0].characteristics;
+ new_table.time = type_tables[0].time;
+ new_table.major = type_tables[0].major;
+ new_table.minor = type_tables[0].minor;
+
+ /* Chain the NAME entries onto the table. */
+ new_table.names.first_entry = NULL;
+ new_table.names.last_entry = NULL;
+
+ for (indx = 0; indx < num_resource_sets; indx++)
+ rsrc_attach_chain (& new_table.names, & type_tables[indx].names);
+
+ rsrc_sort_entries (& new_table.names, TRUE, & new_table);
+
+ /* Chain the ID entries onto the table. */
+ new_table.ids.first_entry = NULL;
+ new_table.ids.last_entry = NULL;
+
+ for (indx = 0; indx < num_resource_sets; indx++)
+ rsrc_attach_chain (& new_table.ids, & type_tables[indx].ids);
+
+ rsrc_sort_entries (& new_table.ids, FALSE, & new_table);
+
+ /* Step four: Create new contents for the .rsrc section. */
+ /* Step four point one: Compute the size of each region of the .rsrc section.
+ We do this now, rather than earlier, as the merging above may have dropped
+ some entries. */
+ sizeof_leaves = sizeof_strings = sizeof_tables_and_entries = 0;
+ rsrc_compute_region_sizes (& new_table);
+ /* We increment sizeof_strings to make sure that resource data
+ starts on an 8-byte boundary. FIXME: Is this correct ? */
+ sizeof_strings = (sizeof_strings + 7) & ~ 7;
+
+ new_data = bfd_zalloc (abfd, size);
+ if (new_data == NULL)
+ goto end;
+
+ write_data.abfd = abfd;
+ write_data.datastart = new_data;
+ write_data.next_table = new_data;
+ write_data.next_leaf = new_data + sizeof_tables_and_entries;
+ write_data.next_string = write_data.next_leaf + sizeof_leaves;
+ write_data.next_data = write_data.next_string + sizeof_strings;
+ write_data.rva_bias = sec->vma - pe->pe_opthdr.ImageBase;
+
+ rsrc_write_directory (& write_data, & new_table);
+
+ /* Step five: Replace the old contents with the new.
+ We recompute the size as we may have lost entries due to mergeing. */
+ size = ((write_data.next_data - new_data) + 3) & ~ 3;
+
+ {
+ int page_size;
+
+ if (coff_data (abfd)->link_info)
+ {
+ page_size = pe_data (abfd)->pe_opthdr.FileAlignment;
+
+ /* If no file alignment has been set, default to one.
+ This repairs 'ld -r' for arm-wince-pe target. */
+ if (page_size == 0)
+ page_size = 1;
+ }
+ else
+ page_size = PE_DEF_FILE_ALIGNMENT;
+ size = (size + page_size - 1) & - page_size;
+ }
+
+ bfd_set_section_contents (pfinfo->output_bfd, sec, new_data, 0, size);
+ sec->size = sec->rawsize = size;
+
+ end:
+ /* Step six: Free all the memory that we have used. */
+ /* FIXME: Free the resource tree, if we have one. */
+ free (datastart);
+ free (rsrc_sizes);
+}
/* Handle the .idata section and other things that need symbol table
access. */
@@ -2415,7 +4399,7 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo)
}
h1 = coff_link_hash_lookup (coff_hash_table (info),
- (bfd_get_symbol_leading_char(abfd) != 0
+ (bfd_get_symbol_leading_char (abfd) != 0
? "__tls_used" : "_tls_used"),
FALSE, FALSE, TRUE);
if (h1 != NULL)
@@ -2477,6 +4461,8 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo)
}
#endif
+ rsrc_process_section (abfd, pfinfo);
+
/* If we couldn't find idata$2, we either have an excessively
trivial program or are in DEEP trouble; we have to assume trivial
program.... */
diff --git a/binutils-2.25/bfd/pef-traceback.h b/binutils-2.25/bfd/pef-traceback.h
index 77ba47ae..fe5bf4dc 100644
--- a/binutils-2.25/bfd/pef-traceback.h
+++ b/binutils-2.25/bfd/pef-traceback.h
@@ -1,6 +1,5 @@
/* PowerPC traceback table support for BFD.
- Copyright 1993, 1998, 1999, 2000, 2001, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/pef.c b/binutils-2.25/bfd/pef.c
index 6c52e0f3..4c294173 100644
--- a/binutils-2.25/bfd/pef.c
+++ b/binutils-2.25/bfd/pef.c
@@ -1,6 +1,5 @@
/* PEF support for BFD.
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -42,6 +41,7 @@
#define bfd_pef_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
#define bfd_pef_get_lineno _bfd_nosymbols_get_lineno
#define bfd_pef_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define bfd_pef_find_line _bfd_nosymbols_find_line
#define bfd_pef_find_inliner_info _bfd_nosymbols_find_inliner_info
#define bfd_pef_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define bfd_pef_read_minisymbols _bfd_generic_read_minisymbols
@@ -59,7 +59,6 @@
#define bfd_pef_section_already_linked _bfd_generic_section_already_linked
#define bfd_pef_bfd_define_common_symbol bfd_generic_define_common_symbol
#define bfd_pef_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define bfd_pef_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define bfd_pef_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define bfd_pef_bfd_link_just_syms _bfd_generic_link_just_syms
#define bfd_pef_bfd_copy_link_hash_symbol_type \
@@ -1065,11 +1064,11 @@ const bfd_target pef_vec =
static int
bfd_pef_xlib_read_header (bfd *abfd, bfd_pef_xlib_header *header)
{
- unsigned char buf[76];
+ unsigned char buf[80];
bfd_seek (abfd, 0, SEEK_SET);
- if (bfd_bread ((void *) buf, 76, abfd) != 76)
+ if (bfd_bread ((void *) buf, sizeof buf, abfd) != sizeof buf)
return -1;
header->tag1 = bfd_getb32 (buf);
diff --git a/binutils-2.25/bfd/pef.h b/binutils-2.25/bfd/pef.h
index d73ff370..49527c9c 100644
--- a/binutils-2.25/bfd/pef.h
+++ b/binutils-2.25/bfd/pef.h
@@ -1,6 +1,5 @@
/* PEF support for BFD.
- Copyright 1999, 2000, 2001, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/pei-arm-wince.c b/binutils-2.25/bfd/pei-arm-wince.c
index 4e29d802..6ef9aa9f 100644
--- a/binutils-2.25/bfd/pei-arm-wince.c
+++ b/binutils-2.25/bfd/pei-arm-wince.c
@@ -1,5 +1,5 @@
/* BFD back-end for ARM WINCE PE IMAGE COFF files.
- Copyright 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -21,9 +21,9 @@
#define TARGET_UNDERSCORE 0
#define USER_LABEL_PREFIX ""
-#define TARGET_LITTLE_SYM arm_wince_pei_little_vec
+#define TARGET_LITTLE_SYM arm_pei_wince_le_vec
#define TARGET_LITTLE_NAME "pei-arm-wince-little"
-#define TARGET_BIG_SYM arm_wince_pei_big_vec
+#define TARGET_BIG_SYM arm_pei_wince_be_vec
#define TARGET_BIG_NAME "pei-arm-wince-big"
#define LOCAL_LABEL_PREFIX "."
diff --git a/binutils-2.25/bfd/pei-arm.c b/binutils-2.25/bfd/pei-arm.c
index 21c37a3c..84318f23 100644
--- a/binutils-2.25/bfd/pei-arm.c
+++ b/binutils-2.25/bfd/pei-arm.c
@@ -1,6 +1,5 @@
/* BFD back-end for arm PE IMAGE COFF files.
- Copyright 1995, 1996, 1999, 2002, 2005, 2006, 2007, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -23,9 +22,9 @@
#include "bfd.h"
#ifndef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM armpei_little_vec
+#define TARGET_LITTLE_SYM arm_pei_le_vec
#define TARGET_LITTLE_NAME "pei-arm-little"
-#define TARGET_BIG_SYM armpei_big_vec
+#define TARGET_BIG_SYM arm_pei_be_vec
#define TARGET_BIG_NAME "pei-arm-big"
#endif
diff --git a/binutils-2.25/bfd/pei-i386.c b/binutils-2.25/bfd/pei-i386.c
index d17dd65f..080ed1a6 100644
--- a/binutils-2.25/bfd/pei-i386.c
+++ b/binutils-2.25/bfd/pei-i386.c
@@ -1,6 +1,5 @@
/* BFD back-end for Intel 386 PE IMAGE COFF files.
- Copyright 1995, 1996, 1999, 2002, 2004, 2005, 2006, 2007, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -22,7 +21,7 @@
#include "sysdep.h"
#include "bfd.h"
-#define TARGET_SYM i386pei_vec
+#define TARGET_SYM i386_pei_vec
#define TARGET_NAME "pei-i386"
#define COFF_IMAGE_WITH_PE
#define COFF_WITH_PE
diff --git a/binutils-2.25/bfd/pei-ia64.c b/binutils-2.25/bfd/pei-ia64.c
index 745147e1..a3cf735a 100644
--- a/binutils-2.25/bfd/pei-ia64.c
+++ b/binutils-2.25/bfd/pei-ia64.c
@@ -1,6 +1,5 @@
/* BFD back-end for HP/Intel IA-64 PE IMAGE COFF files.
- Copyright 1999, 2000, 2001, 2002, 2007, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
Contributed by David Mosberger <davidm@hpl.hp.com>
This implementation only supports objcopy to ouput IA-64 PE IMAGE COFF
@@ -26,7 +25,7 @@
#include "sysdep.h"
#include "bfd.h"
-#define TARGET_SYM bfd_pei_ia64_vec
+#define TARGET_SYM ia64_pei_vec
#define TARGET_NAME "pei-ia64"
#define COFF_IMAGE_WITH_PE
#define COFF_WITH_PE
diff --git a/binutils-2.25/bfd/pei-mcore.c b/binutils-2.25/bfd/pei-mcore.c
index bad8108f..cb0652dc 100644
--- a/binutils-2.25/bfd/pei-mcore.c
+++ b/binutils-2.25/bfd/pei-mcore.c
@@ -1,6 +1,5 @@
/* BFD back-end for MCore PECOFF files.
- Copyright 1999, 2002, 2005, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -23,9 +22,9 @@
#include "bfd.h"
#ifndef TARGET_BIG_SYM
-#define TARGET_BIG_SYM mcore_pei_big_vec
+#define TARGET_BIG_SYM mcore_pei_be_vec
#define TARGET_BIG_NAME "pei-mcore-big"
-#define TARGET_LITTLE_SYM mcore_pei_little_vec
+#define TARGET_LITTLE_SYM mcore_pei_le_vec
#define TARGET_LITTLE_NAME "pei-mcore-little"
#endif
diff --git a/binutils-2.25/bfd/pei-mips.c b/binutils-2.25/bfd/pei-mips.c
index cb5e9621..58853904 100644
--- a/binutils-2.25/bfd/pei-mips.c
+++ b/binutils-2.25/bfd/pei-mips.c
@@ -1,6 +1,5 @@
/* BFD back-end for MIPS PE IMAGE COFF files.
- Copyright 1995, 2000, 2001, 2002, 2005, 2007, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -22,7 +21,7 @@
#include "sysdep.h"
#include "bfd.h"
-#define TARGET_SYM mipslpei_vec
+#define TARGET_SYM mips_pei_le_vec
#define TARGET_NAME "pei-mips"
#define COFF_IMAGE_WITH_PE
#define PCRELOFFSET TRUE
diff --git a/binutils-2.25/bfd/pei-ppc.c b/binutils-2.25/bfd/pei-ppc.c
index 671b2cea..6a5bb29d 100644
--- a/binutils-2.25/bfd/pei-ppc.c
+++ b/binutils-2.25/bfd/pei-ppc.c
@@ -1,6 +1,5 @@
/* BFD back-end for PowerPC PE IMAGE COFF files.
- Copyright 1995, 1996, 1999, 2005, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -27,10 +26,10 @@
#define PPC_PE
-#define TARGET_LITTLE_SYM bfd_powerpcle_pei_vec
+#define TARGET_LITTLE_SYM powerpc_pei_le_vec
#define TARGET_LITTLE_NAME "pei-powerpcle"
-#define TARGET_BIG_SYM bfd_powerpc_pei_vec
+#define TARGET_BIG_SYM powerpc_pei_vec
#define TARGET_BIG_NAME "pei-powerpc"
#define COFF_IMAGE_WITH_PE
diff --git a/binutils-2.25/bfd/pei-sh.c b/binutils-2.25/bfd/pei-sh.c
index a7975d8f..50d677b2 100644
--- a/binutils-2.25/bfd/pei-sh.c
+++ b/binutils-2.25/bfd/pei-sh.c
@@ -1,6 +1,5 @@
/* BFD back-end for SH PE IMAGE COFF files.
- Copyright 1995, 2000, 2001, 2002, 2005, 2007, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -22,7 +21,7 @@
#include "sysdep.h"
#include "bfd.h"
-#define TARGET_SHL_SYM shlpei_vec
+#define TARGET_SHL_SYM sh_pei_le_vec
#define TARGET_SHL_NAME "pei-shl"
#define IMAGE_BASE NT_IMAGE_BASE
#define COFF_IMAGE_WITH_PE
diff --git a/binutils-2.25/bfd/pei-x86_64.c b/binutils-2.25/bfd/pei-x86_64.c
index 6139ca24..48554d3c 100644
--- a/binutils-2.25/bfd/pei-x86_64.c
+++ b/binutils-2.25/bfd/pei-x86_64.c
@@ -1,5 +1,5 @@
/* BFD back-end for Intel 386 PE IMAGE COFF files.
- Copyright 2006, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -23,7 +23,7 @@
#include "sysdep.h"
#include "bfd.h"
-#define TARGET_SYM x86_64pei_vec
+#define TARGET_SYM x86_64_pei_vec
#define TARGET_NAME "pei-x86-64"
#define COFF_IMAGE_WITH_PE
#define COFF_WITH_PE
@@ -76,11 +76,15 @@
#define AOUTSZ PEPAOUTSZ
#define PEAOUTHDR PEPAOUTHDR
-static const char *pex_regs[16] = {
+/* Name of registers according to SEH conventions. */
+
+static const char * const pex_regs[16] = {
"rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
};
+/* Swap in a runtime function. */
+
static void
pex64_get_runtime_function (bfd *abfd, struct pex64_runtime_function *rf,
const void *data)
@@ -90,10 +94,10 @@ pex64_get_runtime_function (bfd *abfd, struct pex64_runtime_function *rf,
rf->rva_BeginAddress = bfd_get_32 (abfd, ex_rf->rva_BeginAddress);
rf->rva_EndAddress = bfd_get_32 (abfd, ex_rf->rva_EndAddress);
rf->rva_UnwindData = bfd_get_32 (abfd, ex_rf->rva_UnwindData);
- rf->isChained = PEX64_IS_RUNTIME_FUNCTION_CHAINED (rf);
- rf->rva_UnwindData = PEX64_GET_UNWINDDATA_UNIFIED_RVA (rf);
}
+/* Swap in unwind info header. */
+
static void
pex64_get_unwind_info (bfd *abfd, struct pex64_unwind_info *ui, void *data)
{
@@ -115,7 +119,15 @@ pex64_get_unwind_info (bfd *abfd, struct pex64_unwind_info *ui, void *data)
switch (ui->Flags)
{
case UNW_FLAG_CHAININFO:
- ui->rva_FunctionEntry = bfd_get_32 (abfd, ex_dta);
+ ui->rva_BeginAddress = bfd_get_32 (abfd, ex_dta + 0);
+ ui->rva_EndAddress = bfd_get_32 (abfd, ex_dta + 4);
+ ui->rva_UnwindData = bfd_get_32 (abfd, ex_dta + 8);
+ ui->SizeOfBlock += 12;
+ return;
+ case UNW_FLAG_EHANDLER:
+ case UNW_FLAG_UHANDLER:
+ case UNW_FLAG_FHANDLER:
+ ui->rva_ExceptionHandler = bfd_get_32 (abfd, ex_dta);
ui->SizeOfBlock += 4;
return;
default:
@@ -123,168 +135,158 @@ pex64_get_unwind_info (bfd *abfd, struct pex64_unwind_info *ui, void *data)
}
}
+/* Display unwind codes. */
+
static void
-pex64_xdata_print_uwd_codes (FILE *file, struct pex64_unwind_info *ui,
- bfd_vma pc_addr)
+pex64_xdata_print_uwd_codes (FILE *file, bfd *abfd,
+ struct pex64_unwind_info *ui,
+ struct pex64_runtime_function *rf)
{
- bfd_vma i;
- bfd_vma tmp = 0;
- const bfd_byte *insns[256];
- bfd_vma insns_count = 0;
- const bfd_byte *dta = ui->rawUnwindCodes;
+ unsigned int i;
+ unsigned int tmp; /* At least 32 bits. */
+ int save_allowed;
- if (ui->CountOfCodes == 0 || !dta)
+ if (ui->CountOfCodes == 0 || ui->rawUnwindCodes == NULL)
return;
- /* Sort array ascending. Note: it is stored in reversed order. */
- for (i = 0; i < ui->CountOfCodes; i++)
- {
- const bfd_byte *t;
+ /* According to UNWIND_CODE documentation:
+ If an FP reg is used, the any unwind code taking an offset must only be
+ used after the FP reg is established in the prolog.
+ But there are counter examples of that in system dlls... */
+ save_allowed = TRUE;
- t = insns[insns_count++] = &dta[i * 2];
- switch (PEX64_UNWCODE_CODE (t[1]))
+ i = 0;
+
+ if (ui->Version == 2
+ && PEX64_UNWCODE_CODE (ui->rawUnwindCodes[1]) == UWOP_EPILOG)
+ {
+ /* Display epilog opcode (whose docoding is not fully documented).
+ Looks to be designed to speed-up unwinding, as there is no need
+ to decode instruction flow if outside an epilog. */
+ unsigned int func_size = rf->rva_EndAddress - rf->rva_BeginAddress;
+
+ fprintf (file, "\tv2 epilog (length: %02x) at pc+:",
+ ui->rawUnwindCodes[0]);
+ if (PEX64_UNWCODE_INFO (ui->rawUnwindCodes[1]))
+ fprintf (file, " 0x%x", func_size - ui->rawUnwindCodes[0]);
+ i++;
+ for (; i < ui->CountOfCodes; i++)
{
- case UWOP_PUSH_NONVOL:
- case UWOP_ALLOC_SMALL:
- case UWOP_SET_FPREG:
- case UWOP_PUSH_MACHFRAME:
- break;
- case UWOP_ALLOC_LARGE:
- if (PEX64_UNWCODE_INFO (t[1]) == 0)
- {
- i += 1;
- break;
- }
- else if (PEX64_UNWCODE_INFO (t[1]) == 1)
- {
- i += 2;
- break;
- }
- /* fall through. */
- default:
- fprintf (file, "\t contains unknown code (%u).\n",
- (unsigned int) PEX64_UNWCODE_CODE (t[1]));
- return;
- case UWOP_SAVE_NONVOL:
- case UWOP_SAVE_XMM:
- case UWOP_SAVE_XMM128:
- i++;
- break;
- case UWOP_SAVE_NONVOL_FAR:
- case UWOP_SAVE_XMM_FAR:
- case UWOP_SAVE_XMM128_FAR:
- i += 2;
- break;
+ const bfd_byte *dta = ui->rawUnwindCodes + 2 * i;
+ unsigned int off;
+
+ if (PEX64_UNWCODE_CODE (dta[1]) != UWOP_EPILOG)
+ break;
+ off = dta[0] | (PEX64_UNWCODE_INFO (dta[1]) << 8);
+ if (off == 0)
+ fprintf (file, " [pad]");
+ else
+ fprintf (file, " 0x%x", func_size - off);
}
+ fputc ('\n', file);
}
- fprintf (file, "\t At pc 0x");
- fprintf_vma (file, pc_addr);
- fprintf (file, " there are the following saves (in logical order).\n");
- for (i = insns_count; i > 0;)
+
+ for (; i < ui->CountOfCodes; i++)
{
- --i;
- dta = insns[i];
- fprintf (file, "\t insn ends at pc+0x%02x: ", (unsigned int) dta[0]);
+ const bfd_byte *dta = ui->rawUnwindCodes + 2 * i;
+ unsigned int info = PEX64_UNWCODE_INFO (dta[1]);
+ int unexpected = FALSE;
+
+ fprintf (file, "\t pc+0x%02x: ", (unsigned int) dta[0]);
switch (PEX64_UNWCODE_CODE (dta[1]))
{
case UWOP_PUSH_NONVOL:
- fprintf (file, "push %s.\n", pex_regs[PEX64_UNWCODE_INFO (dta[1])]);
+ fprintf (file, "push %s", pex_regs[info]);
break;
case UWOP_ALLOC_LARGE:
- if (PEX64_UNWCODE_INFO (dta[1]) == 0)
+ if (info == 0)
{
- tmp = (bfd_vma) (*((unsigned short *) &dta[2]));
- tmp *= 8;
+ tmp = bfd_get_16 (abfd, &dta[2]) * 8;
+ i++;
}
else
- tmp = (bfd_vma) (*((unsigned int *)&dta[2]));
- fprintf (file, "save stack region of size 0x");
- fprintf_vma (file, tmp);
- fprintf (file,".\n");
+ {
+ tmp = bfd_get_32 (abfd, &dta[2]);
+ i += 2;
+ }
+ fprintf (file, "alloc large area: rsp = rsp - 0x%x", tmp);
break;
case UWOP_ALLOC_SMALL:
- tmp = (bfd_vma) PEX64_UNWCODE_INFO (dta[1]);
- tmp += 1;
- tmp *= 8;
- fprintf (file, "save stack region of size 0x");
- fprintf_vma (file, tmp);
- fprintf (file,".\n");
+ fprintf (file, "alloc small area: rsp = rsp - 0x%x", (info + 1) * 8);
break;
case UWOP_SET_FPREG:
- tmp = (bfd_vma) PEX64_UNWCODE_INFO (dta[1]);
- tmp *= 16;
- fprintf (file, "FPReg = (FrameReg) + 0x");
- fprintf_vma (file, tmp);
- fprintf (file, ".\n");
+ /* According to the documentation, info field is unused. */
+ fprintf (file, "FPReg: %s = rsp + 0x%x (info = 0x%x)",
+ pex_regs[ui->FrameRegister],
+ (unsigned int) ui->FrameOffset * 16, info);
+ unexpected = ui->FrameRegister == 0;
+ save_allowed = FALSE;
break;
case UWOP_SAVE_NONVOL:
- fprintf (file, "mov %s at 0x",
- pex_regs[PEX64_UNWCODE_INFO (dta[1])]);
- tmp = (bfd_vma) (*((unsigned short *) &dta[2]));
- tmp *= 8;
- fprintf_vma (file, tmp);
- fprintf (file, ".\n");
+ tmp = bfd_get_16 (abfd, &dta[2]) * 8;
+ i++;
+ fprintf (file, "save %s at rsp + 0x%x", pex_regs[info], tmp);
+ unexpected = !save_allowed;
break;
case UWOP_SAVE_NONVOL_FAR:
- fprintf (file, "mov %s at 0x",
- pex_regs[PEX64_UNWCODE_INFO (dta[1])]);
- tmp = (bfd_vma) (*((unsigned int *) &dta[2]));
- fprintf_vma (file, tmp);
- fprintf (file, ".\n");
+ tmp = bfd_get_32 (abfd, &dta[2]);
+ i += 2;
+ fprintf (file, "save %s at rsp + 0x%x", pex_regs[info], tmp);
+ unexpected = !save_allowed;
break;
case UWOP_SAVE_XMM:
- tmp = (bfd_vma) (*((unsigned short *) &dta[2]));
- tmp *= 8;
- fprintf (file, "mov mm%u at 0x",
- (unsigned int) PEX64_UNWCODE_INFO (dta[1]));
- fprintf_vma (file, tmp);
- fprintf (file, ".\n");
+ if (ui->Version == 1)
+ {
+ tmp = bfd_get_16 (abfd, &dta[2]) * 8;
+ i++;
+ fprintf (file, "save mm%u at rsp + 0x%x", info, tmp);
+ unexpected = !save_allowed;
+ }
+ else if (ui->Version == 2)
+ {
+ fprintf (file, "epilog %02x %01x", dta[0], info);
+ unexpected = TRUE;
+ }
break;
case UWOP_SAVE_XMM_FAR:
- tmp = (bfd_vma) (*((unsigned int *) &dta[2]));
- fprintf (file, "mov mm%u at 0x",
- (unsigned int) PEX64_UNWCODE_INFO (dta[1]));
- fprintf_vma (file, tmp);
- fprintf (file, ".\n");
+ tmp = bfd_get_32 (abfd, &dta[2]) * 8;
+ i += 2;
+ fprintf (file, "save mm%u at rsp + 0x%x", info, tmp);
+ unexpected = !save_allowed;
break;
case UWOP_SAVE_XMM128:
- tmp = (bfd_vma) (*((unsigned short *) &dta[2]));
- tmp *= 16;
- fprintf (file, "mov xmm%u at 0x",
- (unsigned int) PEX64_UNWCODE_INFO ( dta[1]));
- fprintf_vma (file, tmp);
- fprintf (file, ".\n");
+ tmp = bfd_get_16 (abfd, &dta[2]) * 16;
+ i++;
+ fprintf (file, "save xmm%u at rsp + 0x%x", info, tmp);
+ unexpected = !save_allowed;
break;
case UWOP_SAVE_XMM128_FAR:
- tmp = (bfd_vma) (*((unsigned int *) &dta[2]));
- fprintf (file, "mov xmm%u at 0x",
- (unsigned int) PEX64_UNWCODE_INFO (dta[1]));
- fprintf_vma (file, tmp);
- fprintf (file, ".\n");
+ tmp = bfd_get_32 (abfd, &dta[2]) * 16;
+ i += 2;
+ fprintf (file, "save xmm%u at rsp + 0x%x", info, tmp);
+ unexpected = !save_allowed;
break;
case UWOP_PUSH_MACHFRAME:
fprintf (file, "interrupt entry (SS, old RSP, EFLAGS, CS, RIP");
- if (PEX64_UNWCODE_INFO (dta[1]) == 0)
- {
- fprintf (file, ")");
- }
- else if (PEX64_UNWCODE_INFO (dta[1]) == 1)
- {
- fprintf (file, ",ErrorCode)");
- }
+ if (info == 0)
+ fprintf (file, ")");
+ else if (info == 1)
+ fprintf (file, ",ErrorCode)");
else
- fprintf (file, ", unknown(%u))",
- (unsigned int) PEX64_UNWCODE_INFO (dta[1]));
- fprintf (file,".\n");
+ fprintf (file, ", unknown(%u))", info);
break;
default:
- fprintf (file, "unknown code %u.\n",
- (unsigned int) PEX64_UNWCODE_INFO (dta[1]));
- break;
+ /* Already caught by the previous scan. */
+ abort ();
}
+ if (unexpected)
+ fprintf (file, " [Unexpected!]");
+ fputc ('\n', file);
}
}
+/* Check wether section SEC_NAME contains the xdata at address ADDR. */
+
static asection *
pex64_get_section_by_rva (bfd *abfd, bfd_vma addr, const char *sec_name)
{
@@ -303,110 +305,126 @@ pex64_get_section_by_rva (bfd *abfd, bfd_vma addr, const char *sec_name)
return section;
}
+/* Dump xdata at for function RF to FILE. The argument XDATA_SECTION
+ designate the bfd section containing the xdata, XDATA is its content,
+ and ENDX the size if known (or NULL). */
+
static void
-pex64_dump_xdata (FILE *file, bfd *abfd, bfd_vma addr, bfd_vma pc_addr,
- bfd_vma *endx)
+pex64_dump_xdata (FILE *file, bfd *abfd,
+ asection *xdata_section, bfd_byte *xdata, bfd_vma *endx,
+ struct pex64_runtime_function *rf)
{
- asection *section = pex64_get_section_by_rva (abfd, addr, ".rdata");
- bfd_vma vsize;
- bfd_byte *data = NULL;
+ bfd_vma vaddr;
bfd_vma end_addr;
+ bfd_vma addr = rf->rva_UnwindData;
+ struct pex64_unwind_info ui;
- if (!section)
- section = pex64_get_section_by_rva (abfd, addr, ".data");
- if (!section)
- section = pex64_get_section_by_rva (abfd, addr, ".xdata");
- if (!section)
- {
- section = pex64_get_section_by_rva (abfd, addr, ".pdata");
- if (section)
- {
- fprintf (file, "\t Shares information with pdata element at 0x");
- fprintf_vma (file, addr + pe_data (abfd)->pe_opthdr.ImageBase);
- fprintf (file, ".\n");
- }
- }
- if (!section)
- return;
-
- vsize = section->vma - pe_data (abfd)->pe_opthdr.ImageBase;
- addr -= vsize;
+ vaddr = xdata_section->vma - pe_data (abfd)->pe_opthdr.ImageBase;
+ addr -= vaddr;
if (endx)
- end_addr = endx[0] - vsize;
+ end_addr = endx[0] - vaddr;
else
- end_addr = (section->rawsize != 0 ? section->rawsize : section->size);
-
- if (bfd_malloc_and_get_section (abfd, section, &data))
- {
- struct pex64_unwind_info ui;
+ end_addr = (xdata_section->rawsize != 0 ?
+ xdata_section->rawsize : xdata_section->size);
- if (!data)
- return;
- pex64_get_unwind_info (abfd, &ui, &data[addr]);
+ pex64_get_unwind_info (abfd, &ui, &xdata[addr]);
- if (ui.Version != 1)
+ if (ui.Version != 1 && ui.Version != 2)
+ {
+ unsigned int i;
+ fprintf (file, "\tVersion %u (unknown).\n",
+ (unsigned int) ui.Version);
+ for (i = 0; addr < end_addr; addr += 1, i++)
{
- fprintf (file, "\tVersion %u (unknown).\n", (unsigned int) ui.Version);
- return;
+ if ((i & 15) == 0)
+ fprintf (file, "\t %03x:", i);
+ fprintf (file, " %02x", xdata[addr]);
+ if ((i & 15) == 15)
+ fprintf (file, "\n");
}
+ if ((i & 15) != 0)
+ fprintf (file, "\n");
+ return;
+ }
- fprintf (file, "\tFlags: ");
- switch (ui.Flags)
- {
- case UNW_FLAG_NHANDLER:
- fprintf (file, "UNW_FLAG_NHANDLER");
- break;
- case UNW_FLAG_EHANDLER:
- fprintf (file, "UNW_FLAG_EHANDLER");
- break;
- case UNW_FLAG_UHANDLER:
- fprintf (file, "UNW_FLAG_UHANDLER");
- break;
- case UNW_FLAG_FHANDLER:
- fprintf (file, "UNW_FLAG_FHANDLER = (UNW_FLAG_EHANDLER | UNW_FLAG_UHANDLER)");
- break;
- case UNW_FLAG_CHAININFO:
- fprintf (file, "UNW_FLAG_CHAININFO");
- break;
- default:
- fprintf (file, "unknown flags value 0x%x", (unsigned int) ui.Flags);
- break;
- }
+ fprintf (file, "\tVersion: %d, Flags: ", ui.Version);
+ switch (ui.Flags)
+ {
+ case UNW_FLAG_NHANDLER:
+ fprintf (file, "none");
+ break;
+ case UNW_FLAG_EHANDLER:
+ fprintf (file, "UNW_FLAG_EHANDLER");
+ break;
+ case UNW_FLAG_UHANDLER:
+ fprintf (file, "UNW_FLAG_UHANDLER");
+ break;
+ case UNW_FLAG_FHANDLER:
+ fprintf
+ (file, "UNW_FLAG_EHANDLER | UNW_FLAG_UHANDLER");
+ break;
+ case UNW_FLAG_CHAININFO:
+ fprintf (file, "UNW_FLAG_CHAININFO");
+ break;
+ default:
+ fprintf (file, "unknown flags value 0x%x", (unsigned int) ui.Flags);
+ break;
+ }
+ fputc ('\n', file);
+ fprintf (file, "\tNbr codes: %u, ", (unsigned int) ui.CountOfCodes);
+ fprintf (file, "Prologue size: 0x%02x, Frame offset: 0x%x, ",
+ (unsigned int) ui.SizeOfPrologue, (unsigned int) ui.FrameOffset);
+ fprintf (file, "Frame reg: %s\n",
+ ui.FrameRegister == 0 ? "none"
+ : pex_regs[(unsigned int) ui.FrameRegister]);
+
+ pex64_xdata_print_uwd_codes (file, abfd, &ui, rf);
+
+ switch (ui.Flags)
+ {
+ case UNW_FLAG_EHANDLER:
+ case UNW_FLAG_UHANDLER:
+ case UNW_FLAG_FHANDLER:
+ fprintf (file, "\tHandler: ");
+ fprintf_vma (file, (ui.rva_ExceptionHandler
+ + pe_data (abfd)->pe_opthdr.ImageBase));
fprintf (file, ".\n");
- if (ui.CountOfCodes != 0)
- fprintf (file, "\tEntry has %u codes.", (unsigned int) ui.CountOfCodes);
- fprintf (file, "\tPrologue size: %u, Frame offset = 0x%x.\n",
- (unsigned int) ui.SizeOfPrologue, (unsigned int) ui.FrameOffset);
- fprintf (file, "\tFrame register is %s.\n",
- ui.FrameRegister == 0 ? "none"
- : pex_regs[(unsigned int) ui.FrameRegister]);
-
- pex64_xdata_print_uwd_codes (file, &ui, pc_addr);
-
- /* Now we need end of this xdata block. */
- addr += ui.SizeOfBlock;
- if (addr < end_addr)
- {
- unsigned int i;
- fprintf (file,"\tUser data:\n");
- for (i = 0; addr < end_addr; addr += 1, i++)
- {
- if ((i & 15) == 0)
- fprintf (file, "\t %03x:", i);
- fprintf (file, " %02x", data[addr]);
- if ((i & 15) == 15)
- fprintf (file, "\n");
- }
- if ((i & 15) != 0)
+ break;
+ case UNW_FLAG_CHAININFO:
+ fprintf (file, "\tChain: start: ");
+ fprintf_vma (file, ui.rva_BeginAddress);
+ fprintf (file, ", end: ");
+ fprintf_vma (file, ui.rva_EndAddress);
+ fprintf (file, "\n\t unwind data: ");
+ fprintf_vma (file, ui.rva_UnwindData);
+ fprintf (file, ".\n");
+ break;
+ }
+
+ /* Now we need end of this xdata block. */
+ addr += ui.SizeOfBlock;
+ if (addr < end_addr)
+ {
+ unsigned int i;
+ fprintf (file,"\tUser data:\n");
+ for (i = 0; addr < end_addr; addr += 1, i++)
+ {
+ if ((i & 15) == 0)
+ fprintf (file, "\t %03x:", i);
+ fprintf (file, " %02x", xdata[addr]);
+ if ((i & 15) == 15)
fprintf (file, "\n");
- }
+ }
+ if ((i & 15) != 0)
+ fprintf (file, "\n");
}
- if (data != NULL)
- free (data);
}
+/* Helper function to sort xdata. The entries of xdata are sorted to know
+ the size of each entry. */
+
static int
sort_xdata_arr (const void *l, const void *r)
{
@@ -418,71 +436,74 @@ sort_xdata_arr (const void *l, const void *r)
return (*lp < *rp ? -1 : 1);
}
+/* Display unwind tables for x86-64. */
+
static bfd_boolean
pex64_bfd_print_pdata (bfd *abfd, void *vfile)
{
FILE *file = (FILE *) vfile;
- bfd_byte *data = NULL;
- asection *section = bfd_get_section_by_name (abfd, ".pdata");
- bfd_size_type datasize = 0;
+ bfd_byte *pdata = NULL;
+ bfd_byte *xdata = NULL;
+ asection *pdata_section = bfd_get_section_by_name (abfd, ".pdata");
+ asection *xdata_section;
+ bfd_vma xdata_base;
bfd_size_type i;
bfd_size_type stop;
bfd_vma prev_beginaddress = 0;
+ bfd_vma prev_unwinddata_rva = 0;
+ bfd_vma imagebase;
int onaline = PDATA_ROW_SIZE;
int seen_error = 0;
- bfd_vma *xdata_arr;
+ bfd_vma *xdata_arr = NULL;
int xdata_arr_cnt;
- if (section == NULL
- || coff_section_data (abfd, section) == NULL
- || pei_section_data (abfd, section) == NULL)
+ /* Sanity checks. */
+ if (pdata_section == NULL
+ || coff_section_data (abfd, pdata_section) == NULL
+ || pei_section_data (abfd, pdata_section) == NULL)
return TRUE;
- stop = pei_section_data (abfd, section)->virt_size;
+ stop = pei_section_data (abfd, pdata_section)->virt_size;
if ((stop % onaline) != 0)
fprintf (file,
_("warning: .pdata section size (%ld) is not a multiple of %d\n"),
(long) stop, onaline);
+ /* Display functions table. */
fprintf (file,
_("\nThe Function Table (interpreted .pdata section contents)\n"));
fprintf (file, _("vma:\t\t\tBeginAddress\t EndAddress\t UnwindData\n"));
- datasize = section->size;
- if (datasize == 0)
- return TRUE;
-
- if (!bfd_malloc_and_get_section (abfd, section, &data))
- {
- if (data != NULL)
- free (data);
- return FALSE;
- }
+ if (!bfd_malloc_and_get_section (abfd, pdata_section, &pdata))
+ goto done;
+ /* Table of xdata entries. */
xdata_arr = (bfd_vma *) xmalloc (sizeof (bfd_vma) * ((stop / onaline) + 1));
xdata_arr_cnt = 0;
- /* Do sanity check of pdata. */
+
+ imagebase = pe_data (abfd)->pe_opthdr.ImageBase;
+
for (i = 0; i < stop; i += onaline)
{
struct pex64_runtime_function rf;
if (i + PDATA_ROW_SIZE > stop)
break;
- pex64_get_runtime_function (abfd, &rf, &data[i]);
+ pex64_get_runtime_function (abfd, &rf, &pdata[i]);
if (rf.rva_BeginAddress == 0 && rf.rva_EndAddress == 0
&& rf.rva_UnwindData == 0)
/* We are probably into the padding of the section now. */
break;
fputc (' ', file);
- fprintf_vma (file, i + section->vma);
+ fprintf_vma (file, i + pdata_section->vma);
fprintf (file, ":\t");
- fprintf_vma (file, rf.rva_BeginAddress);
- fputc (' ', file);
- fprintf_vma (file, rf.rva_EndAddress);
- fputc (' ', file);
- fprintf_vma (file, rf.rva_UnwindData);
+ fprintf_vma (file, imagebase + rf.rva_BeginAddress);
+ fprintf (file, " ");
+ fprintf_vma (file, imagebase + rf.rva_EndAddress);
+ fprintf (file, " ");
+ fprintf_vma (file, imagebase + rf.rva_UnwindData);
fprintf (file, "\n");
if (i != 0 && rf.rva_BeginAddress <= prev_beginaddress)
{
@@ -507,17 +528,12 @@ pex64_bfd_print_pdata (bfd *abfd, void *vfile)
seen_error = 1;
fprintf (file, " has negative unwind address\n");
}
- if (rf.rva_UnwindData && !rf.isChained)
+ if (rf.rva_UnwindData && !PEX64_IS_RUNTIME_FUNCTION_CHAINED (&rf))
xdata_arr[xdata_arr_cnt++] = rf.rva_UnwindData;
}
if (seen_error)
- {
- free (data);
- free (xdata_arr);
-
- return TRUE;
- }
+ goto done;
/* Add end of list marker. */
xdata_arr[xdata_arr_cnt++] = ~((bfd_vma) 0);
@@ -527,15 +543,30 @@ pex64_bfd_print_pdata (bfd *abfd, void *vfile)
qsort (xdata_arr, (size_t) xdata_arr_cnt, sizeof (bfd_vma),
sort_xdata_arr);
- /* Do dump of pdata related xdata. */
+ /* Find the section containing the unwind data (.xdata). */
+ xdata_base = xdata_arr[0];
+ xdata_section = pex64_get_section_by_rva (abfd, xdata_base, ".rdata");
+
+ if (!xdata_section)
+ xdata_section = pex64_get_section_by_rva (abfd, xdata_base, ".data");
+ if (!xdata_section)
+ xdata_section = pex64_get_section_by_rva (abfd, xdata_base, ".xdata");
+ if (!xdata_section)
+ xdata_section = pex64_get_section_by_rva (abfd, xdata_base, ".pdata");
+ if (!xdata_section)
+ xdata_section = pex64_get_section_by_rva (abfd, xdata_base, ".text");
+ if (!xdata_section
+ || !bfd_malloc_and_get_section (abfd, xdata_section, &xdata))
+ goto done;
+ /* Do dump of pdata related xdata. */
for (i = 0; i < stop; i += onaline)
{
struct pex64_runtime_function rf;
if (i + PDATA_ROW_SIZE > stop)
break;
- pex64_get_runtime_function (abfd, &rf, &data[i]);
+ pex64_get_runtime_function (abfd, &rf, &pdata[i]);
if (rf.rva_BeginAddress == 0 && rf.rva_EndAddress == 0
&& rf.rva_UnwindData == 0)
@@ -543,19 +574,50 @@ pex64_bfd_print_pdata (bfd *abfd, void *vfile)
break;
if (i == 0)
fprintf (file, "\nDump of .xdata\n");
+
fputc (' ', file);
- fprintf_vma (file, rf.rva_UnwindData);
- fprintf (file, ":\n");
+ fprintf_vma (file, rf.rva_UnwindData + imagebase);
+
+ if (prev_unwinddata_rva == rf.rva_UnwindData)
+ {
+ /* Do not dump again the xdata for the same entry. */
+ fprintf (file, " also used for function at ");
+ fprintf_vma (file, rf.rva_BeginAddress + imagebase);
+ fputc ('\n', file);
+ continue;
+ }
+ else
+ prev_unwinddata_rva = rf.rva_UnwindData;
- rf.rva_BeginAddress += pe_data (abfd)->pe_opthdr.ImageBase;
- rf.rva_EndAddress += pe_data (abfd)->pe_opthdr.ImageBase;
+ fprintf (file, " (rva: %08x): ",
+ (unsigned int) rf.rva_UnwindData);
+ fprintf_vma (file, rf.rva_BeginAddress + imagebase);
+ fprintf (file, " - ");
+ fprintf_vma (file, rf.rva_EndAddress + imagebase);
+ fputc ('\n', file);
if (rf.rva_UnwindData != 0)
{
- if (rf.isChained)
+ if (PEX64_IS_RUNTIME_FUNCTION_CHAINED (&rf))
{
- fprintf (file, "\t shares information with pdata element at 0x");
- fprintf_vma (file, rf.rva_UnwindData);
+ bfd_vma altent = PEX64_GET_UNWINDDATA_UNIFIED_RVA (&rf);
+ bfd_vma pdata_vma = bfd_get_section_vma (abfd, pdata_section);
+ struct pex64_runtime_function arf;
+
+ fprintf (file, "\t shares information with ");
+ altent += imagebase;
+
+ if (altent >= pdata_vma
+ && (altent + PDATA_ROW_SIZE <= pdata_vma
+ + pei_section_data (abfd, pdata_section)->virt_size))
+ {
+ pex64_get_runtime_function
+ (abfd, &arf, &pdata[altent - pdata_vma]);
+ fprintf (file, "pdata element at 0x");
+ fprintf_vma (file, arf.rva_UnwindData);
+ }
+ else
+ fprintf (file, "unknown pdata element");
fprintf (file, ".\n");
}
else
@@ -576,14 +638,15 @@ pex64_bfd_print_pdata (bfd *abfd, void *vfile)
if (p[0] == ~((bfd_vma) 0))
p = NULL;
- pex64_dump_xdata (file, abfd, rf.rva_UnwindData,
- rf.rva_BeginAddress, p);
+ pex64_dump_xdata (file, abfd, xdata_section, xdata, p, &rf);
}
}
}
- free (data);
+ done:
+ free (pdata);
free (xdata_arr);
+ free (xdata);
return TRUE;
}
diff --git a/binutils-2.25/bfd/peicode.h b/binutils-2.25/bfd/peicode.h
index 64ca0929..83653535 100644
--- a/binutils-2.25/bfd/peicode.h
+++ b/binutils-2.25/bfd/peicode.h
@@ -1,5 +1,5 @@
/* Support for the generic parts of PE/PEI, for BFD.
- Copyright 1995-2013 Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
Written by Cygnus Solutions.
This file is part of BFD, the Binary File Descriptor library.
@@ -271,6 +271,7 @@ pe_mkobject (bfd * abfd)
/* in_reloc_p is architecture dependent. */
pe->in_reloc_p = in_reloc_p;
+ memset (& pe->pe_opthdr, 0, sizeof pe->pe_opthdr);
return TRUE;
}
@@ -567,6 +568,7 @@ pe_ILF_make_a_symbol (pe_ILF_vars * vars,
ent->u.syment.n_sclass = sclass;
ent->u.syment.n_scnum = section->target_index;
ent->u.syment._n._n_n._n_offset = (bfd_hostptr_t) sym;
+ ent->is_sym = TRUE;
sym->symbol.the_bfd = vars->abfd;
sym->symbol.name = vars->string_ptr;
@@ -1077,7 +1079,7 @@ pe_ILF_build_a_bfd (bfd * abfd,
static const bfd_target *
pe_ILF_object_p (bfd * abfd)
{
- bfd_byte buffer[16];
+ bfd_byte buffer[14];
bfd_byte * ptr;
char * symbol_name;
char * source_dll;
@@ -1087,17 +1089,13 @@ pe_ILF_object_p (bfd * abfd)
unsigned int types;
unsigned int magic;
- /* Upon entry the first four buyes of the ILF header have
+ /* Upon entry the first six bytes of the ILF header have
already been read. Now read the rest of the header. */
- if (bfd_bread (buffer, (bfd_size_type) 16, abfd) != 16)
+ if (bfd_bread (buffer, (bfd_size_type) 14, abfd) != 14)
return NULL;
ptr = buffer;
- /* We do not bother to check the version number.
- version = H_GET_16 (abfd, ptr); */
- ptr += 2;
-
machine = H_GET_16 (abfd, ptr);
ptr += 2;
@@ -1251,7 +1249,7 @@ pe_ILF_object_p (bfd * abfd)
static const bfd_target *
pe_bfd_object_p (bfd * abfd)
{
- bfd_byte buffer[4];
+ bfd_byte buffer[6];
struct external_PEI_DOS_hdr dos_hdr;
struct external_PEI_IMAGE_hdr image_hdr;
struct internal_filehdr internal_f;
@@ -1260,15 +1258,18 @@ pe_bfd_object_p (bfd * abfd)
file_ptr offset;
/* Detect if this a Microsoft Import Library Format element. */
+ /* First read the beginning of the header. */
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
- || bfd_bread (buffer, (bfd_size_type) 4, abfd) != 4)
+ || bfd_bread (buffer, (bfd_size_type) 6, abfd) != 6)
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format);
return NULL;
}
- if (H_GET_32 (abfd, buffer) == 0xffff0000)
+ /* Then check the magic and the version (only 0 is supported). */
+ if (H_GET_32 (abfd, buffer) == 0xffff0000
+ && H_GET_16 (abfd, buffer + 4) == 0)
return pe_ILF_object_p (abfd);
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
@@ -1314,7 +1315,7 @@ pe_bfd_object_p (bfd * abfd)
/* Swap file header, so that we get the location for calling
real_object_p. */
- bfd_coff_swap_filehdr_in (abfd, (PTR)&image_hdr, &internal_f);
+ bfd_coff_swap_filehdr_in (abfd, &image_hdr, &internal_f);
if (! bfd_coff_bad_format_hook (abfd, &internal_f)
|| internal_f.f_opthdr > bfd_coff_aoutsz (abfd))
@@ -1328,16 +1329,21 @@ pe_bfd_object_p (bfd * abfd)
if (opt_hdr_size != 0)
{
- PTR opthdr;
+ bfd_size_type amt = opt_hdr_size;
+ void * opthdr;
+
+ /* PR 17521 file: 230-131433-0.004. */
+ if (amt < sizeof (PEAOUTHDR))
+ amt = sizeof (PEAOUTHDR);
- opthdr = bfd_alloc (abfd, opt_hdr_size);
+ opthdr = bfd_zalloc (abfd, amt);
if (opthdr == NULL)
return NULL;
if (bfd_bread (opthdr, opt_hdr_size, abfd)
!= (bfd_size_type) opt_hdr_size)
return NULL;
- bfd_coff_swap_aouthdr_in (abfd, opthdr, (PTR) & internal_a);
+ bfd_coff_swap_aouthdr_in (abfd, opthdr, & internal_a);
}
return coff_real_object_p (abfd, internal_f.f_nscns, &internal_f,
diff --git a/binutils-2.25/bfd/plugin.c b/binutils-2.25/bfd/plugin.c
index 3306607f..a0688616 100644
--- a/binutils-2.25/bfd/plugin.c
+++ b/binutils-2.25/bfd/plugin.c
@@ -1,6 +1,5 @@
/* Plugin support for BFD.
- Copyright 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -84,6 +83,7 @@ dlerror (void)
#define bfd_plugin_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
#define bfd_plugin_get_lineno _bfd_nosymbols_get_lineno
#define bfd_plugin_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define bfd_plugin_find_line _bfd_nosymbols_find_line
#define bfd_plugin_find_inliner_info _bfd_nosymbols_find_inliner_info
#define bfd_plugin_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define bfd_plugin_read_minisymbols _bfd_generic_read_minisymbols
@@ -93,7 +93,6 @@ dlerror (void)
#define bfd_plugin_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
#define bfd_plugin_bfd_relax_section bfd_generic_relax_section
#define bfd_plugin_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define bfd_plugin_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define bfd_plugin_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define bfd_plugin_bfd_link_just_syms _bfd_generic_link_just_syms
#define bfd_plugin_bfd_final_link _bfd_generic_final_link
@@ -158,9 +157,54 @@ bfd_plugin_set_program_name (const char *program_name)
}
static int
-try_load_plugin (const char *pname)
+try_claim (bfd *abfd)
{
- static void *plugin_handle;
+ int claimed = 0;
+ struct ld_plugin_input_file file;
+ bfd *iobfd;
+
+ file.name = abfd->filename;
+
+ if (abfd->my_archive)
+ {
+ iobfd = abfd->my_archive;
+ file.offset = abfd->origin;
+ file.filesize = arelt_size (abfd);
+ }
+ else
+ {
+ iobfd = abfd;
+ file.offset = 0;
+ file.filesize = 0;
+ }
+
+ if (!iobfd->iostream && !bfd_open_file (iobfd))
+ return 0;
+
+ file.fd = fileno ((FILE *) iobfd->iostream);
+
+ if (!abfd->my_archive)
+ {
+ struct stat stat_buf;
+ if (fstat (file.fd, &stat_buf))
+ return 0;
+ file.filesize = stat_buf.st_size;
+ }
+
+ file.handle = abfd;
+ off_t cur_offset = lseek(file.fd, 0, SEEK_CUR);
+ claim_file (&file, &claimed);
+ lseek(file.fd, cur_offset, SEEK_SET);
+ if (!claimed)
+ return 0;
+
+ return 1;
+}
+
+static int
+try_load_plugin (const char *pname, bfd *abfd)
+{
+ void *plugin_handle;
int tv_size = 4;
struct ld_plugin_tv tv[tv_size];
int i;
@@ -202,6 +246,9 @@ try_load_plugin (const char *pname)
if (!claim_file)
goto err;
+ if (!try_claim (abfd))
+ goto err;
+
return 1;
err:
@@ -218,7 +265,7 @@ bfd_plugin_set_plugin (const char *p)
}
static int
-load_plugin (void)
+load_plugin (bfd *abfd)
{
char *plugin_dir;
char *p;
@@ -227,7 +274,7 @@ load_plugin (void)
int found = 0;
if (plugin_name)
- return try_load_plugin (plugin_name);
+ return try_load_plugin (plugin_name, abfd);
if (plugin_program_name == NULL)
return 0;
@@ -250,7 +297,7 @@ load_plugin (void)
full_name = concat (p, "/", ent->d_name, NULL);
if (stat(full_name, &s) == 0 && S_ISREG (s.st_mode))
- found = try_load_plugin (full_name);
+ found = try_load_plugin (full_name, abfd);
free (full_name);
if (found)
break;
@@ -268,53 +315,7 @@ load_plugin (void)
static const bfd_target *
bfd_plugin_object_p (bfd *abfd)
{
- int claimed = 0;
- struct ld_plugin_input_file file;
- bfd *iobfd;
- static int have_loaded = 0;
- static int have_plugin = 0;
-
- if (!have_loaded)
- {
- have_loaded = 1;
- have_plugin = load_plugin ();
- }
- if (!have_plugin)
- return NULL;
-
- file.name = abfd->filename;
-
- if (abfd->my_archive)
- {
- iobfd = abfd->my_archive;
- file.offset = abfd->origin;
- file.filesize = arelt_size (abfd);
- }
- else
- {
- iobfd = abfd;
- file.offset = 0;
- file.filesize = 0;
- }
-
- if (!iobfd->iostream && !bfd_open_file (iobfd))
- return NULL;
-
- file.fd = fileno ((FILE *) iobfd->iostream);
-
- if (!abfd->my_archive)
- {
- struct stat stat_buf;
- if (fstat (file.fd, &stat_buf))
- return NULL;
- file.filesize = stat_buf.st_size;
- }
-
- file.handle = abfd;
- off_t cur_offset = lseek(file.fd, 0, SEEK_CUR);
- claim_file (&file, &claimed);
- lseek(file.fd, cur_offset, SEEK_SET);
- if (!claimed)
+ if (!load_plugin (abfd))
return NULL;
return abfd->xvec;
diff --git a/binutils-2.25/bfd/plugin.h b/binutils-2.25/bfd/plugin.h
index 3091f970..4f1d18be 100644
--- a/binutils-2.25/bfd/plugin.h
+++ b/binutils-2.25/bfd/plugin.h
@@ -1,5 +1,5 @@
/* Plugin support for BFD.
- Copyright 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/po/Make-in b/binutils-2.25/bfd/po/Make-in
index a9d3aeaa..c40a2435 100644
--- a/binutils-2.25/bfd/po/Make-in
+++ b/binutils-2.25/bfd/po/Make-in
@@ -1,6 +1,6 @@
# Makefile for program source directory in GNU NLS utilities package.
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-# Copyright 2001, 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file may be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
diff --git a/binutils-2.25/bfd/po/SRC-POTFILES.in b/binutils-2.25/bfd/po/SRC-POTFILES.in
index b179a473..3e5cbd0b 100644
--- a/binutils-2.25/bfd/po/SRC-POTFILES.in
+++ b/binutils-2.25/bfd/po/SRC-POTFILES.in
@@ -38,7 +38,6 @@ coff-i960.c
coff-m68k.c
coff-m88k.c
coff-mips.c
-coff-or32.c
coff-rs6000.c
coff-sh.c
coff-sparc.c
@@ -109,10 +108,10 @@ cpu-mmix.c
cpu-moxie.c
cpu-msp430.c
cpu-mt.c
+cpu-nds32.c
cpu-nios2.c
cpu-ns32k.c
-cpu-openrisc.c
-cpu-or32.c
+cpu-or1k.c
cpu-pdp11.c
cpu-pj.c
cpu-plugin.c
@@ -202,9 +201,9 @@ elf32-mips.c
elf32-moxie.c
elf32-msp430.c
elf32-mt.c
+elf32-nds32.c
elf32-nios2.c
-elf32-openrisc.c
-elf32-or32.c
+elf32-or1k.c
elf32-pj.c
elf32-ppc.c
elf32-rl78.c
diff --git a/binutils-2.25/bfd/po/bfd.pot b/binutils-2.25/bfd/po/bfd.pot
index b7d5a1ec..f2ae349e 100644
--- a/binutils-2.25/bfd/po/bfd.pot
+++ b/binutils-2.25/bfd/po/bfd.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: bug-binutils@gnu.org\n"
-"POT-Creation-Date: 2011-10-25 11:58+0100\n"
+"POT-Creation-Date: 2014-02-10 09:42+1030\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -21,16 +21,16 @@ msgstr ""
msgid "%B: Unknown section type in a.out.adobe file: %x\n"
msgstr ""
-#: aout-cris.c:199
+#: aout-cris.c:200
#, c-format
msgid "%s: Invalid relocation type exported: %d"
msgstr ""
-#: aout-cris.c:242
+#: aout-cris.c:243
msgid "%B: Invalid relocation type imported: %d"
msgstr ""
-#: aout-cris.c:253
+#: aout-cris.c:254
msgid "%B: Bad relocation record imported: %d"
msgstr ""
@@ -45,7 +45,7 @@ msgid ""
"%s: can not represent section for symbol `%s' in a.out object file format"
msgstr ""
-#: aoutx.h:1579 vms-alpha.c:7671
+#: aoutx.h:1579 vms-alpha.c:7564
msgid "*unknown*"
msgstr ""
@@ -58,119 +58,123 @@ msgstr ""
msgid "%s: relocatable link from %s to %s not supported"
msgstr ""
-#: archive.c:2203
+#: archive.c:2249
msgid "Warning: writing archive was slow: rewriting timestamp\n"
msgstr ""
-#: archive.c:2491
+#: archive.c:2549
msgid "Reading archive file mod timestamp"
msgstr ""
-#: archive.c:2515
+#: archive.c:2573
msgid "Writing updated armap timestamp"
msgstr ""
-#: bfd.c:398
+#: bfd.c:411
msgid "No error"
msgstr ""
-#: bfd.c:399
+#: bfd.c:412
msgid "System call error"
msgstr ""
-#: bfd.c:400
+#: bfd.c:413
msgid "Invalid bfd target"
msgstr ""
-#: bfd.c:401
+#: bfd.c:414
msgid "File in wrong format"
msgstr ""
-#: bfd.c:402
+#: bfd.c:415
msgid "Archive object file in wrong format"
msgstr ""
-#: bfd.c:403
+#: bfd.c:416
msgid "Invalid operation"
msgstr ""
-#: bfd.c:404
+#: bfd.c:417
msgid "Memory exhausted"
msgstr ""
-#: bfd.c:405
+#: bfd.c:418
msgid "No symbols"
msgstr ""
-#: bfd.c:406
+#: bfd.c:419
msgid "Archive has no index; run ranlib to add one"
msgstr ""
-#: bfd.c:407
+#: bfd.c:420
msgid "No more archived files"
msgstr ""
-#: bfd.c:408
+#: bfd.c:421
msgid "Malformed archive"
msgstr ""
-#: bfd.c:409
+#: bfd.c:422
+msgid "DSO missing from command line"
+msgstr ""
+
+#: bfd.c:423
msgid "File format not recognized"
msgstr ""
-#: bfd.c:410
+#: bfd.c:424
msgid "File format is ambiguous"
msgstr ""
-#: bfd.c:411
+#: bfd.c:425
msgid "Section has no contents"
msgstr ""
-#: bfd.c:412
+#: bfd.c:426
msgid "Nonrepresentable section on output"
msgstr ""
-#: bfd.c:413
+#: bfd.c:427
msgid "Symbol needs debug section which does not exist"
msgstr ""
-#: bfd.c:414
+#: bfd.c:428
msgid "Bad value"
msgstr ""
-#: bfd.c:415
+#: bfd.c:429
msgid "File truncated"
msgstr ""
-#: bfd.c:416
+#: bfd.c:430
msgid "File too big"
msgstr ""
-#: bfd.c:417
+#: bfd.c:431
#, c-format
msgid "Error reading %s: %s"
msgstr ""
-#: bfd.c:418
+#: bfd.c:432
msgid "#<Invalid error code>"
msgstr ""
-#: bfd.c:945
+#: bfd.c:1046
#, c-format
msgid "BFD %s assertion fail %s:%d"
msgstr ""
-#: bfd.c:957
+#: bfd.c:1058
#, c-format
msgid "BFD %s internal error, aborting at %s line %d in %s\n"
msgstr ""
-#: bfd.c:961
+#: bfd.c:1062
#, c-format
msgid "BFD %s internal error, aborting at %s line %d\n"
msgstr ""
-#: bfd.c:963
+#: bfd.c:1064
msgid "Please report this bug.\n"
msgstr ""
@@ -189,65 +193,65 @@ msgstr ""
msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx."
msgstr ""
-#: bout.c:1146 elf-m10300.c:2063 elf32-avr.c:1654 elf32-frv.c:5734
-#: elfxx-sparc.c:2802 reloc.c:6115 reloc16.c:162 elf32-ia64.c:360
-#: elf64-ia64.c:360
+#: bout.c:1146 elf-m10300.c:2665 elf32-avr.c:1706 elf32-frv.c:5641
+#: elf64-ia64-vms.c:354 elfxx-sparc.c:2869 reloc.c:7324 reloc16.c:160
+#: elf32-ia64.c:351 elf64-ia64.c:351
msgid "%P%F: --relax and -r may not be used together\n"
msgstr ""
-#: cache.c:227
+#: cache.c:253
msgid "reopening %B: %s\n"
msgstr ""
-#: coff-alpha.c:491
+#: coff-alpha.c:452
msgid ""
"%B: Cannot handle compressed Alpha binaries.\n"
" Use compiler flags, or objZ, to generate uncompressed binaries."
msgstr ""
-#: coff-alpha.c:648
+#: coff-alpha.c:603
msgid "%B: unknown/unsupported relocation type %d"
msgstr ""
-#: coff-alpha.c:900 coff-alpha.c:937 coff-alpha.c:2025 coff-mips.c:1003
+#: coff-alpha.c:852 coff-alpha.c:889 coff-alpha.c:1973 coff-mips.c:946
msgid "GP relative relocation used when GP not defined"
msgstr ""
-#: coff-alpha.c:1502
+#: coff-alpha.c:1450
msgid "using multiple gp values"
msgstr ""
-#: coff-alpha.c:1561
+#: coff-alpha.c:1509
msgid "%B: unsupported relocation: ALPHA_R_GPRELHIGH"
msgstr ""
-#: coff-alpha.c:1568
+#: coff-alpha.c:1516
msgid "%B: unsupported relocation: ALPHA_R_GPRELLOW"
msgstr ""
-#: coff-alpha.c:1575 elf32-m32r.c:2484 elf64-alpha.c:4074 elf64-alpha.c:4224
-#: elf32-ia64.c:3839 elf64-ia64.c:3839
+#: coff-alpha.c:1523 elf32-m32r.c:2443 elf64-alpha.c:4083 elf64-alpha.c:4233
+#: elf64-ia64-vms.c:3429 elf32-ia64.c:3836 elf64-ia64.c:3836
msgid "%B: unknown relocation type %d"
msgstr ""
-#: coff-arm.c:1038
+#: coff-arm.c:1034
#, c-format
msgid "%B: unable to find THUMB glue '%s' for `%s'"
msgstr ""
-#: coff-arm.c:1067
+#: coff-arm.c:1063
#, c-format
msgid "%B: unable to find ARM glue '%s' for `%s'"
msgstr ""
-#: coff-arm.c:1369 elf32-arm.c:7023
+#: coff-arm.c:1365 elf32-arm.c:7141
#, c-format
msgid ""
"%B(%s): warning: interworking not enabled.\n"
" first occurrence: %B: arm call to thumb"
msgstr ""
-#: coff-arm.c:1459
+#: coff-arm.c:1455
#, c-format
msgid ""
"%B(%s): warning: interworking not enabled.\n"
@@ -255,110 +259,110 @@ msgid ""
" consider relinking with --support-old-code enabled"
msgstr ""
-#: coff-arm.c:1754 coff-tic80.c:695 cofflink.c:3081
+#: coff-arm.c:1750 coff-tic80.c:673 cofflink.c:3168
msgid "%B: bad reloc address 0x%lx in section `%A'"
msgstr ""
-#: coff-arm.c:2079
+#: coff-arm.c:2075
msgid "%B: illegal symbol index in reloc: %d"
msgstr ""
-#: coff-arm.c:2210
+#: coff-arm.c:2206
#, c-format
msgid "error: %B is compiled for APCS-%d, whereas %B is compiled for APCS-%d"
msgstr ""
-#: coff-arm.c:2226 elf32-arm.c:15621
+#: coff-arm.c:2222 elf32-arm.c:16123
#, c-format
msgid ""
"error: %B passes floats in float registers, whereas %B passes them in "
"integer registers"
msgstr ""
-#: coff-arm.c:2229 elf32-arm.c:15625
+#: coff-arm.c:2225 elf32-arm.c:16127
#, c-format
msgid ""
"error: %B passes floats in integer registers, whereas %B passes them in "
"float registers"
msgstr ""
-#: coff-arm.c:2243
+#: coff-arm.c:2239
#, c-format
msgid ""
"error: %B is compiled as position independent code, whereas target %B is "
"absolute position"
msgstr ""
-#: coff-arm.c:2246
+#: coff-arm.c:2242
#, c-format
msgid ""
"error: %B is compiled as absolute position code, whereas target %B is "
"position independent"
msgstr ""
-#: coff-arm.c:2274 elf32-arm.c:15690
+#: coff-arm.c:2270 elf32-arm.c:16192
#, c-format
msgid "Warning: %B supports interworking, whereas %B does not"
msgstr ""
-#: coff-arm.c:2277 elf32-arm.c:15696
+#: coff-arm.c:2273 elf32-arm.c:16198
#, c-format
msgid "Warning: %B does not support interworking, whereas %B does"
msgstr ""
-#: coff-arm.c:2301
+#: coff-arm.c:2297
#, c-format
msgid "private flags = %x:"
msgstr ""
-#: coff-arm.c:2309 elf32-arm.c:11806
+#: coff-arm.c:2305 elf32-arm.c:12119
#, c-format
msgid " [floats passed in float registers]"
msgstr ""
-#: coff-arm.c:2311
+#: coff-arm.c:2307
#, c-format
msgid " [floats passed in integer registers]"
msgstr ""
-#: coff-arm.c:2314 elf32-arm.c:11809
+#: coff-arm.c:2310 elf32-arm.c:12122
#, c-format
msgid " [position independent]"
msgstr ""
-#: coff-arm.c:2316
+#: coff-arm.c:2312
#, c-format
msgid " [absolute position]"
msgstr ""
-#: coff-arm.c:2320
+#: coff-arm.c:2316
#, c-format
msgid " [interworking flag not initialised]"
msgstr ""
-#: coff-arm.c:2322
+#: coff-arm.c:2318
#, c-format
msgid " [interworking supported]"
msgstr ""
-#: coff-arm.c:2324
+#: coff-arm.c:2320
#, c-format
msgid " [interworking not supported]"
msgstr ""
-#: coff-arm.c:2370 elf32-arm.c:10841
+#: coff-arm.c:2366 elf32-arm.c:11104
#, c-format
msgid ""
"Warning: Not setting interworking flag of %B since it has already been "
"specified as non-interworking"
msgstr ""
-#: coff-arm.c:2374 elf32-arm.c:10845
+#: coff-arm.c:2370 elf32-arm.c:11108
#, c-format
msgid "Warning: Clearing the interworking flag of %B due to outside request"
msgstr ""
-#: coff-h8300.c:1122
+#: coff-h8300.c:1096
#, c-format
msgid "cannot handle R_MEM_INDIRECT reloc when using %s output"
msgstr ""
@@ -368,919 +372,975 @@ msgstr ""
msgid "relocation `%s' not yet implemented"
msgstr ""
-#: coff-i860.c:605 coff-tic54x.c:398 coffcode.h:5198
+#: coff-i860.c:605 coff-tic54x.c:365 coffcode.h:5209
msgid "%B: warning: illegal symbol index %ld in relocs"
msgstr ""
-#: coff-i960.c:144 coff-i960.c:507
+#: coff-i960.c:124 coff-i960.c:480
msgid "uncertain calling convention for non-COFF symbol"
msgstr ""
-#: coff-m68k.c:506 elf32-bfin.c:5690 elf32-cr16.c:2897 elf32-m68k.c:4677
+#: coff-m68k.c:484 elf32-bfin.c:5556 elf32-cr16.c:2853 elf32-m68k.c:4632
msgid "unsupported reloc type"
msgstr ""
-#: coff-mips.c:688 elf32-mips.c:1516 elf32-score.c:431 elf32-score7.c:330
-#: elf64-mips.c:2618 elfn32-mips.c:2431
+#: coff-mips.c:636 elf32-mips.c:1637 elf32-score.c:431 elf32-score7.c:330
+#: elf64-mips.c:2925 elfn32-mips.c:2737
msgid "GP relative relocation when _gp not defined"
msgstr ""
-#: coff-or32.c:229
+#: coff-or32.c:216
msgid "Unrecognized reloc"
msgstr ""
-#: coff-rs6000.c:2720
+#: coff-rs6000.c:2802
#, c-format
msgid "%s: unsupported relocation type 0x%02x"
msgstr ""
-#: coff-rs6000.c:2805
+#: coff-rs6000.c:2887
#, c-format
msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry"
msgstr ""
-#: coff-rs6000.c:3556 coff64-rs6000.c:2111
+#: coff-rs6000.c:3638 coff64-rs6000.c:2117
msgid "%B: symbol `%s' has unrecognized smclas %d"
msgstr ""
-#: coff-sh.c:521
+#: coff-sh.c:506
#, c-format
msgid "SH Error: unknown reloc type %d"
msgstr ""
-#: coff-tic4x.c:195 coff-tic54x.c:299 coff-tic80.c:458
+#: coff-tic4x.c:184 coff-tic54x.c:279 coff-tic80.c:440
#, c-format
msgid "Unrecognized reloc type 0x%x"
msgstr ""
-#: coff-tic4x.c:240
+#: coff-tic4x.c:227
#, c-format
msgid "%s: warning: illegal symbol index %ld in relocs"
msgstr ""
-#: coff-w65.c:367
+#: coff-w65.c:355
#, c-format
msgid "ignoring reloc %s\n"
msgstr ""
-#: coffcode.h:997
+#: coffcode.h:1005
msgid "%B: warning: COMDAT symbol '%s' does not match section name '%s'"
msgstr ""
#. Generate a warning message rather using the 'unhandled'
#. variable as this will allow some .sys files generate by
#. other toolchains to be processed. See bugzilla issue 196.
-#: coffcode.h:1221
+#: coffcode.h:1230
msgid ""
"%B: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section %s"
msgstr ""
-#: coffcode.h:1288
+#: coffcode.h:1297
msgid "%B (%s): Section flag %s (0x%x) ignored"
msgstr ""
-#: coffcode.h:2430
+#: coffcode.h:2439
#, c-format
msgid "Unrecognized TI COFF target id '0x%x'"
msgstr ""
-#: coffcode.h:2744
+#: coffcode.h:2753
msgid "%B: reloc against a non-existant symbol index: %ld"
msgstr ""
-#: coffcode.h:3302
+#: coffcode.h:3311
msgid "%B: too many sections (%d)"
msgstr ""
-#: coffcode.h:3718
+#: coffcode.h:3729
msgid "%B: section %s: string table overflow at offset %ld"
msgstr ""
-#: coffcode.h:4523
+#: coffcode.h:4534
msgid "%B: warning: line number table read failed"
msgstr ""
-#: coffcode.h:4553
+#: coffcode.h:4564
msgid "%B: warning: illegal symbol index %ld in line numbers"
msgstr ""
-#: coffcode.h:4567
+#: coffcode.h:4578
msgid "%B: warning: duplicate line number information for `%s'"
msgstr ""
-#: coffcode.h:4967
+#: coffcode.h:4978
msgid "%B: Unrecognized storage class %d for %s symbol `%s'"
msgstr ""
-#: coffcode.h:5093
+#: coffcode.h:5104
msgid "warning: %B: local symbol `%s' has no section"
msgstr ""
-#: coffcode.h:5237
+#: coffcode.h:5248
msgid "%B: illegal relocation type %d at address 0x%lx"
msgstr ""
-#: coffgen.c:1595
+#: coffgen.c:179 elf.c:1030
+msgid "%B: unable to initialize compress status for section %s"
+msgstr ""
+
+#: coffgen.c:199 elf.c:1050
+msgid "%B: unable to initialize decompress status for section %s"
+msgstr ""
+
+#: coffgen.c:1685
msgid "%B: bad string table size %lu"
msgstr ""
-#: coffgen.c:2500 elflink.c:12689 linker.c:3122
+#: coffgen.c:2608 elflink.c:12906 linker.c:3136
msgid "%F%P: already_linked_table: %E\n"
msgstr ""
-#: cofflink.c:533 elflink.c:4323
+#: cofflink.c:533 elf64-ia64-vms.c:5173 elflink.c:4356
msgid "Warning: type of symbol `%s' changed from %d to %d in %B"
msgstr ""
-#: cofflink.c:2329
+#: cofflink.c:2416
msgid "%B: relocs in section `%A', but it has no contents"
msgstr ""
-#: cofflink.c:2391 elflink.c:9545
+#: cofflink.c:2478 elflink.c:9711
msgid ""
"%X`%s' referenced in section `%A' of %B: defined in discarded section `%A' "
"of %B\n"
msgstr ""
-#: cofflink.c:2690 coffswap.h:826
+#: cofflink.c:2777 coffswap.h:826
#, c-format
msgid "%s: %s: reloc overflow: 0x%lx > 0xffff"
msgstr ""
-#: cofflink.c:2699 coffswap.h:812
+#: cofflink.c:2786 coffswap.h:812
#, c-format
msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff"
msgstr ""
-#: cpu-arm.c:189 cpu-arm.c:200
+#: cpu-arm.c:190 cpu-arm.c:201
msgid "error: %B is compiled for the EP9312, whereas %B is compiled for XScale"
msgstr ""
-#: cpu-arm.c:333
+#: cpu-arm.c:334
#, c-format
msgid "warning: unable to update contents of %s section in %s"
msgstr ""
-#: dwarf2.c:496
+#: dwarf2.c:514
#, c-format
msgid "Dwarf Error: Can't find %s section."
msgstr ""
-#: dwarf2.c:525
+#: dwarf2.c:543
#, c-format
msgid "Dwarf Error: Offset (%lu) greater than or equal to %s size (%lu)."
msgstr ""
-#: dwarf2.c:949
+#: dwarf2.c:1071
#, c-format
-msgid "Dwarf Error: Invalid or unhandled FORM value: %u."
+msgid "Dwarf Error: Invalid or unhandled FORM value: %#x."
msgstr ""
-#: dwarf2.c:1200
+#: dwarf2.c:1332
msgid "Dwarf Error: mangled line number section (bad file number)."
msgstr ""
-#: dwarf2.c:1453
+#: dwarf2.c:1590
#, c-format
msgid "Dwarf Error: Unhandled .debug_line version %d."
msgstr ""
-#: dwarf2.c:1475
+#: dwarf2.c:1612
msgid "Dwarf Error: Invalid maximum operations per instruction."
msgstr ""
-#: dwarf2.c:1662
+#: dwarf2.c:1807
msgid "Dwarf Error: mangled line number section."
msgstr ""
-#: dwarf2.c:1989 dwarf2.c:2109 dwarf2.c:2394
+#: dwarf2.c:2160
+#, c-format
+msgid "Dwarf Error: Unable to read alt ref %u."
+msgstr ""
+
+#: dwarf2.c:2179 dwarf2.c:2299 dwarf2.c:2595
#, c-format
msgid "Dwarf Error: Could not find abbrev number %u."
msgstr ""
-#: dwarf2.c:2355
+#: dwarf2.c:2551
#, c-format
msgid ""
"Dwarf Error: found dwarf version '%u', this reader only handles version 2, 3 "
"and 4 information."
msgstr ""
-#: dwarf2.c:2362
+#: dwarf2.c:2560
#, c-format
msgid ""
"Dwarf Error: found address size '%u', this reader can not handle sizes "
"greater than '%u'."
msgstr ""
-#: dwarf2.c:2385
+#: dwarf2.c:2586
#, c-format
msgid "Dwarf Error: Bad abbrev number: %u."
msgstr ""
-#: ecoff.c:1239
+#: ecoff.c:1233
#, c-format
msgid "Unknown basic type %d"
msgstr ""
-#: ecoff.c:1496
+#: ecoff.c:1490
#, c-format
msgid ""
"\n"
" End+1 symbol: %ld"
msgstr ""
-#: ecoff.c:1503 ecoff.c:1506
+#: ecoff.c:1497 ecoff.c:1500
#, c-format
msgid ""
"\n"
" First symbol: %ld"
msgstr ""
-#: ecoff.c:1518
+#: ecoff.c:1512
#, c-format
msgid ""
"\n"
" End+1 symbol: %-7ld Type: %s"
msgstr ""
-#: ecoff.c:1525
+#: ecoff.c:1519
#, c-format
msgid ""
"\n"
" Local symbol: %ld"
msgstr ""
-#: ecoff.c:1533
+#: ecoff.c:1527
#, c-format
msgid ""
"\n"
" struct; End+1 symbol: %ld"
msgstr ""
-#: ecoff.c:1538
+#: ecoff.c:1532
#, c-format
msgid ""
"\n"
" union; End+1 symbol: %ld"
msgstr ""
-#: ecoff.c:1543
+#: ecoff.c:1537
#, c-format
msgid ""
"\n"
" enum; End+1 symbol: %ld"
msgstr ""
-#: ecoff.c:1549
+#: ecoff.c:1543
#, c-format
msgid ""
"\n"
" Type: %s"
msgstr ""
-#: elf-attrs.c:569
+#: elf-attrs.c:573
msgid ""
"error: %B: Object has vendor-specific contents that must be processed by the "
"'%s' toolchain"
msgstr ""
-#: elf-attrs.c:578
+#: elf-attrs.c:582
msgid "error: %B: Object tag '%d, %s' is incompatible with tag '%d, %s'"
msgstr ""
-#: elf-eh-frame.c:917
+#: elf-eh-frame.c:921
msgid "%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"
msgstr ""
-#: elf-eh-frame.c:1189
+#: elf-eh-frame.c:1193
msgid ""
"%P: fde encoding in %B(%A) prevents .eh_frame_hdr table being created.\n"
msgstr ""
-#: elf-eh-frame.c:1605
+#: elf-eh-frame.c:1612
msgid "%P: DW_EH_PE_datarel unspecified for this architecture.\n"
msgstr ""
-#: elf-ifunc.c:179
+#: elf-ifunc.c:135
msgid ""
"%F%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer equality in `%B' can "
"not be used when making an executable; recompile with -fPIE and relink with -"
"pie\n"
msgstr ""
-#: elf-m10200.c:450 elf-m10300.c:1563 elf32-avr.c:1221 elf32-bfin.c:3213
-#: elf32-cr16.c:1482 elf32-cr16c.c:780 elf32-cris.c:2081 elf32-crx.c:922
-#: elf32-d10v.c:509 elf32-epiphany.c:556 elf32-fr30.c:609 elf32-frv.c:4105
-#: elf32-h8300.c:509 elf32-i860.c:1211 elf32-ip2k.c:1468 elf32-iq2000.c:684
-#: elf32-lm32.c:1168 elf32-m32c.c:553 elf32-m32r.c:3106 elf32-m68hc1x.c:1138
-#: elf32-mep.c:535 elf32-microblaze.c:1231 elf32-moxie.c:282
-#: elf32-msp430.c:486 elf32-mt.c:395 elf32-openrisc.c:404 elf32-score.c:2729
-#: elf32-score7.c:2537 elf32-spu.c:5044 elf32-tilepro.c:3214 elf32-v850.c:2143
-#: elf32-xstormy16.c:935 elf64-mmix.c:1590 elfxx-tilegx.c:3577
+#: elf-m10200.c:430 elf-m10300.c:2164 elf32-avr.c:1256 elf32-bfin.c:3220
+#: elf32-cr16.c:1484 elf32-cr16c.c:780 elf32-cris.c:2016 elf32-crx.c:922
+#: elf32-d10v.c:513 elf32-epiphany.c:557 elf32-fr30.c:589 elf32-frv.c:4039
+#: elf32-h8300.c:525 elf32-i860.c:1212 elf32-ip2k.c:1468 elf32-iq2000.c:688
+#: elf32-lm32.c:1160 elf32-m32c.c:553 elf32-m32r.c:3066 elf32-m68hc1x.c:1283
+#: elf32-mep.c:535 elf32-metag.c:1992 elf32-microblaze.c:1560
+#: elf32-moxie.c:282 elf32-mt.c:395 elf32-nds32.c:4910 elf32-openrisc.c:404
+#: elf32-score.c:2729 elf32-score7.c:2537 elf32-spu.c:5041
+#: elf32-tilepro.c:3666 elf32-v850.c:2281 elf32-xstormy16.c:936
+#: elf64-mmix.c:1538 elfxx-tilegx.c:4051
msgid "internal error: out of range error"
msgstr ""
-#: elf-m10200.c:454 elf-m10300.c:1567 elf32-avr.c:1225 elf32-bfin.c:3217
-#: elf32-cr16.c:1486 elf32-cr16c.c:784 elf32-cris.c:2085 elf32-crx.c:926
-#: elf32-d10v.c:513 elf32-fr30.c:613 elf32-frv.c:4109 elf32-h8300.c:513
-#: elf32-i860.c:1215 elf32-iq2000.c:688 elf32-lm32.c:1172 elf32-m32c.c:557
-#: elf32-m32r.c:3110 elf32-m68hc1x.c:1142 elf32-mep.c:539
-#: elf32-microblaze.c:1235 elf32-moxie.c:286 elf32-msp430.c:490
-#: elf32-openrisc.c:408 elf32-score.c:2733 elf32-score7.c:2541
-#: elf32-spu.c:5048 elf32-tilepro.c:3218 elf32-v850.c:2147
-#: elf32-xstormy16.c:939 elf64-mmix.c:1594 elfxx-mips.c:9465
-#: elfxx-tilegx.c:3581
+#: elf-m10200.c:434 elf-m10300.c:2168 elf32-avr.c:1260 elf32-bfin.c:3224
+#: elf32-cr16.c:1488 elf32-cr16c.c:784 elf32-cris.c:2020 elf32-crx.c:926
+#: elf32-d10v.c:517 elf32-fr30.c:593 elf32-frv.c:4043 elf32-h8300.c:529
+#: elf32-i860.c:1216 elf32-iq2000.c:692 elf32-lm32.c:1164 elf32-m32c.c:557
+#: elf32-m32r.c:3070 elf32-m68hc1x.c:1287 elf32-mep.c:539 elf32-metag.c:1996
+#: elf32-microblaze.c:1564 elf32-moxie.c:286 elf32-msp430.c:1321
+#: elf32-nds32.c:4914 elf32-openrisc.c:408 elf32-score.c:2733
+#: elf32-score7.c:2541 elf32-spu.c:5045 elf32-tilepro.c:3670 elf32-v850.c:2285
+#: elf32-xstormy16.c:940 elf64-mmix.c:1542 elfxx-mips.c:9995
+#: elfxx-tilegx.c:4055
msgid "internal error: unsupported relocation error"
msgstr ""
-#: elf-m10200.c:458 elf32-cr16.c:1490 elf32-cr16c.c:788 elf32-crx.c:930
-#: elf32-d10v.c:517 elf32-h8300.c:517 elf32-lm32.c:1176 elf32-m32r.c:3114
-#: elf32-m68hc1x.c:1146 elf32-microblaze.c:1239 elf32-score.c:2737
-#: elf32-score7.c:2545 elf32-spu.c:5052
+#: elf-m10200.c:438 elf32-cr16.c:1492 elf32-cr16c.c:788 elf32-crx.c:930
+#: elf32-d10v.c:521 elf32-h8300.c:533 elf32-lm32.c:1168 elf32-m32r.c:3074
+#: elf32-m68hc1x.c:1291 elf32-microblaze.c:1568 elf32-nds32.c:4918
+#: elf32-score.c:2737 elf32-score7.c:2545 elf32-spu.c:5049
msgid "internal error: dangerous error"
msgstr ""
-#: elf-m10200.c:462 elf-m10300.c:1580 elf32-avr.c:1233 elf32-bfin.c:3225
-#: elf32-cr16.c:1494 elf32-cr16c.c:792 elf32-cris.c:2093 elf32-crx.c:934
-#: elf32-d10v.c:521 elf32-epiphany.c:571 elf32-fr30.c:621 elf32-frv.c:4117
-#: elf32-h8300.c:521 elf32-i860.c:1223 elf32-ip2k.c:1483 elf32-iq2000.c:696
-#: elf32-lm32.c:1180 elf32-m32c.c:565 elf32-m32r.c:3118 elf32-m68hc1x.c:1150
-#: elf32-mep.c:547 elf32-microblaze.c:1243 elf32-moxie.c:294
-#: elf32-msp430.c:498 elf32-mt.c:403 elf32-openrisc.c:416 elf32-score.c:2746
-#: elf32-score7.c:2549 elf32-spu.c:5056 elf32-tilepro.c:3226 elf32-v850.c:2167
-#: elf32-xstormy16.c:947 elf64-mmix.c:1602 elfxx-tilegx.c:3589
+#: elf-m10200.c:442 elf-m10300.c:2184 elf32-avr.c:1268 elf32-bfin.c:3232
+#: elf32-cr16.c:1496 elf32-cr16c.c:792 elf32-cris.c:2028 elf32-crx.c:934
+#: elf32-d10v.c:525 elf32-epiphany.c:572 elf32-fr30.c:601 elf32-frv.c:4051
+#: elf32-h8300.c:537 elf32-i860.c:1224 elf32-ip2k.c:1483 elf32-iq2000.c:700
+#: elf32-lm32.c:1172 elf32-m32c.c:565 elf32-m32r.c:3078 elf32-m68hc1x.c:1295
+#: elf32-mep.c:547 elf32-metag.c:2004 elf32-microblaze.c:1572
+#: elf32-moxie.c:294 elf32-msp430.c:1329 elf32-mt.c:403 elf32-nds32.c:4922
+#: elf32-openrisc.c:416 elf32-score.c:2746 elf32-score7.c:2549
+#: elf32-spu.c:5053 elf32-tilepro.c:3678 elf32-v850.c:2305
+#: elf32-xstormy16.c:948 elf64-mmix.c:1550 elfxx-tilegx.c:4063
msgid "internal error: unknown error"
msgstr ""
-#: elf-m10300.c:1507 elf32-arm.c:10419 elf32-i386.c:4264 elf32-m32r.c:2599
-#: elf32-m68k.c:4156 elf32-s390.c:3003 elf32-sh.c:4218 elf32-tilepro.c:3117
-#: elf32-xtensa.c:3066 elf64-s390.c:2978 elf64-sh64.c:1640 elf64-x86-64.c:4110
-#: elfxx-sparc.c:3835 elfxx-tilegx.c:3500
+#: elf-m10300.c:1021
+#, c-format
+msgid "%s: Unsupported transition from %s to %s"
+msgstr ""
+
+#: elf-m10300.c:1213
+msgid "%B: %s' accessed both as normal and thread local symbol"
+msgstr ""
+
+#: elf-m10300.c:2108 elf32-arm.c:10632 elf32-i386.c:4363 elf32-m32r.c:2558
+#: elf32-m68k.c:4120 elf32-s390.c:3303 elf32-sh.c:4109 elf32-tilepro.c:3569
+#: elf32-xtensa.c:3063 elf64-s390.c:3229 elf64-sh64.c:1640 elf64-x86-64.c:4463
+#: elfxx-sparc.c:3904 elfxx-tilegx.c:3974
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:4450
msgid "%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"
msgstr ""
-#: elf-m10300.c:1572
+#: elf-m10300.c:2173
msgid ""
"error: inappropriate relocation type for shared library (did you forget -"
"fpic?)"
msgstr ""
-#: elf-m10300.c:1575
-msgid "internal error: suspicious relocation type used in shared library"
+#: elf-m10300.c:2176
+msgid ""
+"%B: taking the address of protected function '%s' cannot be done when making "
+"a shared library"
msgstr ""
-#: elf-m10300.c:4372 elf32-arm.c:12800 elf32-cr16.c:2451 elf32-cris.c:3057
-#: elf32-hppa.c:1894 elf32-i370.c:503 elf32-i386.c:2182 elf32-lm32.c:1868
-#: elf32-m32r.c:1927 elf32-m68k.c:3253 elf32-s390.c:1652 elf32-sh.c:2931
-#: elf32-tic6x.c:2162 elf32-tilepro.c:1940 elf32-vax.c:1041 elf64-s390.c:1635
-#: elf64-sh64.c:3381 elf64-x86-64.c:2176 elfxx-sparc.c:2119
-#: elfxx-tilegx.c:2261
-#, c-format
-msgid "dynamic variable `%s' is zero size"
+#: elf-m10300.c:2179
+msgid "internal error: suspicious relocation type used in shared library"
msgstr ""
-#: elf.c:334
+#: elf.c:343
msgid "%B: invalid string offset %u >= %lu for section `%s'"
msgstr ""
-#: elf.c:446
+#: elf.c:455
msgid "%B symbol number %lu references nonexistent SHT_SYMTAB_SHNDX section"
msgstr ""
-#: elf.c:602
+#: elf.c:611
msgid "%B: Corrupt size field in group section header: 0x%lx"
msgstr ""
-#: elf.c:638
+#: elf.c:647
msgid "%B: invalid SHT_GROUP entry"
msgstr ""
-#: elf.c:708
+#: elf.c:717
msgid "%B: no group info for section %A"
msgstr ""
-#: elf.c:737 elf.c:3121 elflink.c:10135
+#: elf.c:746 elf.c:3144 elflink.c:10290
msgid "%B: warning: sh_link not set for section `%A'"
msgstr ""
-#: elf.c:756
+#: elf.c:765
msgid "%B: sh_link [%d] in section `%A' is incorrect"
msgstr ""
-#: elf.c:791
+#: elf.c:800
msgid "%B: unknown [%d] section `%s' in group [%s]"
msgstr ""
-#: elf.c:1041
-msgid "%B: unable to initialize commpress status for section %s"
-msgstr ""
-
-#: elf.c:1061
-msgid "%B: unable to initialize decommpress status for section %s"
-msgstr ""
-
-#: elf.c:1181
+#: elf.c:1174
#, c-format
msgid ""
"\n"
"Program Header:\n"
msgstr ""
-#: elf.c:1223
+#: elf.c:1216
#, c-format
msgid ""
"\n"
"Dynamic Section:\n"
msgstr ""
-#: elf.c:1359
+#: elf.c:1352
#, c-format
msgid ""
"\n"
"Version definitions:\n"
msgstr ""
-#: elf.c:1384
+#: elf.c:1377
#, c-format
msgid ""
"\n"
"Version References:\n"
msgstr ""
-#: elf.c:1389
+#: elf.c:1382
#, c-format
msgid " required from %s:\n"
msgstr ""
-#: elf.c:1796
+#: elf.c:1807
msgid "%B: invalid link %lu for reloc section %s (index %u)"
msgstr ""
-#: elf.c:1966
+#: elf.c:1977
msgid ""
"%B: don't know how to handle allocated, application specific section `%s' [0x"
"%8x]"
msgstr ""
-#: elf.c:1978
+#: elf.c:1989
msgid "%B: don't know how to handle processor specific section `%s' [0x%8x]"
msgstr ""
-#: elf.c:1989
+#: elf.c:2000
msgid "%B: don't know how to handle OS specific section `%s' [0x%8x]"
msgstr ""
-#: elf.c:1999
+#: elf.c:2010
msgid "%B: don't know how to handle section `%s' [0x%8x]"
msgstr ""
-#: elf.c:2634
+#: elf.c:2648
#, c-format
msgid "warning: section `%A' type changed to PROGBITS"
msgstr ""
-#: elf.c:3078
-msgid "%B: sh_link of section `%A' points to discarded section `%A' of `%B'"
+#: elf.c:3015
+msgid "%B: too many sections: %u"
msgstr ""
#: elf.c:3101
+msgid "%B: sh_link of section `%A' points to discarded section `%A' of `%B'"
+msgstr ""
+
+#: elf.c:3124
msgid "%B: sh_link of section `%A' points to removed section `%A' of `%B'"
msgstr ""
-#: elf.c:4527
+#: elf.c:4126
+msgid "%B: TLS sections are not adjacent:"
+msgstr ""
+
+#: elf.c:4133
+#, c-format
+msgid "\t TLS: %A"
+msgstr ""
+
+#: elf.c:4137
+#, c-format
+msgid "\tnon-TLS: %A"
+msgstr ""
+
+#: elf.c:4596
msgid ""
"%B: The first section in the PT_DYNAMIC segment is not the .dynamic section"
msgstr ""
-#: elf.c:4554
+#: elf.c:4621
msgid "%B: Not enough room for program headers, try linking with -N"
msgstr ""
-#: elf.c:4641
+#: elf.c:4707
msgid "%B: section %A lma %#lx adjusted to %#lx"
msgstr ""
-#: elf.c:4776
+#: elf.c:4843
msgid "%B: section `%A' can't be allocated in segment %d"
msgstr ""
-#: elf.c:4824
+#: elf.c:4892
msgid "%B: warning: allocated section `%s' not in segment"
msgstr ""
-#: elf.c:5324
+#: elf.c:5473
msgid "%B: symbol `%s' required but not present"
msgstr ""
-#: elf.c:5662
+#: elf.c:5811
msgid "%B: warning: Empty loadable segment detected, is this intentional ?\n"
msgstr ""
-#: elf.c:6692
+#: elf.c:6867
#, c-format
msgid ""
"Unable to find equivalent output section for symbol '%s' from section '%s'"
msgstr ""
-#: elf.c:7692
+#: elf.c:7915
msgid "%B: unsupported relocation type %s"
msgstr ""
-#: elf32-arm.c:3617
+#: elf32-arm.c:3722 elf32-arm.c:7051
msgid ""
"%B(%s): warning: interworking not enabled.\n"
" first occurrence: %B: Thumb call to ARM"
msgstr ""
-#: elf32-arm.c:3664
+#: elf32-arm.c:3769
msgid ""
"%B(%s): warning: interworking not enabled.\n"
" first occurrence: %B: ARM call to Thumb"
msgstr ""
-#: elf32-arm.c:3878 elf32-arm.c:5315
+#: elf32-arm.c:3988 elf32-arm.c:5433
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:2324
#, c-format
msgid "%s: cannot create stub entry %s"
msgstr ""
-#: elf32-arm.c:5431
+#: elf32-arm.c:5549
#, c-format
msgid "unable to find THUMB glue '%s' for '%s'"
msgstr ""
-#: elf32-arm.c:5467
+#: elf32-arm.c:5585
#, c-format
msgid "unable to find ARM glue '%s' for '%s'"
msgstr ""
-#: elf32-arm.c:6005
+#: elf32-arm.c:6123
msgid "%B: BE8 images only valid in big-endian mode."
msgstr ""
#. Give a warning, but do as the user requests anyway.
-#: elf32-arm.c:6235
+#: elf32-arm.c:6353
msgid ""
"%B: warning: selected VFP11 erratum workaround is not necessary for target "
"architecture"
msgstr ""
-#: elf32-arm.c:6779 elf32-arm.c:6799
+#: elf32-arm.c:6897 elf32-arm.c:6917
msgid "%B: unable to find VFP11 veneer `%s'"
msgstr ""
-#: elf32-arm.c:6848
+#: elf32-arm.c:6966
#, c-format
msgid "Invalid TARGET2 relocation type '%s'."
msgstr ""
-#: elf32-arm.c:6933
-msgid ""
-"%B(%s): warning: interworking not enabled.\n"
-" first occurrence: %B: thumb call to arm"
+#. PR ld/16017: Do not generate ARM instructions for
+#. the PLT if compiling for a thumb-only target.
+#.
+#. FIXME: We ought to be able to generate thumb PLT instructions...
+#: elf32-arm.c:7696
+msgid "%B: Warning: thumb mode PLT generation not currently supported"
msgstr ""
-#: elf32-arm.c:7717
+#: elf32-arm.c:7909
msgid "%B(%A+0x%lx):unexpected Thumb instruction '0x%x' in TLS trampoline"
msgstr ""
-#: elf32-arm.c:7756
+#: elf32-arm.c:7948
msgid "%B(%A+0x%lx):unexpected ARM instruction '0x%x' in TLS trampoline"
msgstr ""
-#: elf32-arm.c:8209
+#: elf32-arm.c:8412
msgid "\\%B: Warning: Arm BLX instruction targets Arm function '%s'."
msgstr ""
-#: elf32-arm.c:8622
+#: elf32-arm.c:8831
msgid "%B: Warning: Thumb BLX instruction targets thumb function '%s'."
msgstr ""
-#: elf32-arm.c:9460
+#: elf32-arm.c:9672
msgid ""
"%B(%A+0x%lx):unexpected Thumb instruction '0x%x' referenced by TLS_GOTDESC"
msgstr ""
-#: elf32-arm.c:9483
+#: elf32-arm.c:9695
msgid ""
"%B(%A+0x%lx):unexpected ARM instruction '0x%x' referenced by TLS_GOTDESC"
msgstr ""
-#: elf32-arm.c:9512
+#: elf32-arm.c:9724
msgid "%B(%A+0x%lx): R_ARM_TLS_LE32 relocation not permitted in shared object"
msgstr ""
-#: elf32-arm.c:9727
+#: elf32-arm.c:9937
msgid ""
"%B(%A+0x%lx): Only ADD or SUB instructions are allowed for ALU group "
"relocations"
msgstr ""
-#: elf32-arm.c:9767 elf32-arm.c:9854 elf32-arm.c:9937 elf32-arm.c:10022
+#: elf32-arm.c:9977 elf32-arm.c:10065 elf32-arm.c:10149 elf32-arm.c:10235
msgid "%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"
msgstr ""
-#: elf32-arm.c:10261 elf32-sh.c:4103 elf64-sh64.c:1544
+#: elf32-arm.c:10474 elf32-sh.c:3994 elf64-sh64.c:1544
msgid "%B(%A+0x%lx): %s relocation against SEC_MERGE section"
msgstr ""
-#: elf32-arm.c:10372 elf32-m68k.c:4191 elf32-xtensa.c:2802
+#: elf32-arm.c:10585 elf32-m68k.c:4155 elf32-xtensa.c:2799
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:4192
msgid "%B(%A+0x%lx): %s used with TLS symbol %s"
msgstr ""
-#: elf32-arm.c:10373 elf32-m68k.c:4192 elf32-xtensa.c:2803
+#: elf32-arm.c:10586 elf32-m68k.c:4156 elf32-xtensa.c:2800
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:4193
msgid "%B(%A+0x%lx): %s used with non-TLS symbol %s"
msgstr ""
-#: elf32-arm.c:10453 elf32-tic6x.c:2753
+#: elf32-arm.c:10666 elf32-tic6x.c:2736
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:4481
msgid "out of range"
msgstr ""
-#: elf32-arm.c:10457 elf32-tic6x.c:2757
+#: elf32-arm.c:10670 elf32-nios2.c:3525 elf32-tic6x.c:2740
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:4485
msgid "unsupported relocation"
msgstr ""
-#: elf32-arm.c:10465 elf32-tic6x.c:2765
+#: elf32-arm.c:10678 elf32-nios2.c:3535 elf32-tic6x.c:2748
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:4493
msgid "unknown error"
msgstr ""
-#: elf32-arm.c:10890
+#: elf32-arm.c:11153
msgid ""
"Warning: Clearing the interworking flag of %B because non-interworking code "
"in %B has been linked with it"
msgstr ""
-#: elf32-arm.c:10984
+#: elf32-arm.c:11240
msgid "%B: Unknown mandatory EABI object attribute %d"
msgstr ""
-#: elf32-arm.c:10992
+#: elf32-arm.c:11248
msgid "Warning: %B: Unknown EABI object attribute %d"
msgstr ""
-#: elf32-arm.c:11173
+#: elf32-arm.c:11449
msgid "error: %B: Unknown CPU architecture"
msgstr ""
-#: elf32-arm.c:11211
+#: elf32-arm.c:11487
msgid "error: %B: Conflicting CPU architectures %d/%d"
msgstr ""
-#: elf32-arm.c:11260
+#: elf32-arm.c:11576
msgid ""
"Error: %B has both the current and legacy Tag_MPextension_use attributes"
msgstr ""
-#: elf32-arm.c:11285
+#: elf32-arm.c:11601
msgid "error: %B uses VFP register arguments, %B does not"
msgstr ""
-#: elf32-arm.c:11430
+#: elf32-arm.c:11747
msgid "error: %B: unable to merge virtualization attributes with %B"
msgstr ""
-#: elf32-arm.c:11456
+#: elf32-arm.c:11773
msgid "error: %B: Conflicting architecture profiles %c/%c"
msgstr ""
-#: elf32-arm.c:11557
+#: elf32-arm.c:11877
msgid "Warning: %B: Conflicting platform configuration"
msgstr ""
-#: elf32-arm.c:11566
+#: elf32-arm.c:11886
msgid "error: %B: Conflicting use of R9"
msgstr ""
-#: elf32-arm.c:11578
+#: elf32-arm.c:11898
msgid "error: %B: SB relative addressing conflicts with use of R9"
msgstr ""
-#: elf32-arm.c:11591
+#: elf32-arm.c:11911
msgid ""
"warning: %B uses %u-byte wchar_t yet the output is to use %u-byte wchar_t; "
"use of wchar_t values across objects may fail"
msgstr ""
-#: elf32-arm.c:11622
+#: elf32-arm.c:11942
msgid ""
"warning: %B uses %s enums yet the output is to use %s enums; use of enum "
"values across objects may fail"
msgstr ""
-#: elf32-arm.c:11634
+#: elf32-arm.c:11954
msgid "error: %B uses iWMMXt register arguments, %B does not"
msgstr ""
-#: elf32-arm.c:11651
+#: elf32-arm.c:11971
msgid "error: fp16 format mismatch between %B and %B"
msgstr ""
-#: elf32-arm.c:11675
-msgid "DIV usage mismatch between %B and %B"
-msgstr ""
-
-#: elf32-arm.c:11694
+#: elf32-arm.c:12007
msgid "%B has has both the current and legacy Tag_MPextension_use attributes"
msgstr ""
#. Ignore init flag - it may not be set, despite the flags field
#. containing valid data.
#. Ignore init flag - it may not be set, despite the flags field containing valid data.
-#: elf32-arm.c:11782 elf32-bfin.c:5079 elf32-cris.c:4169 elf32-m68hc1x.c:1282
-#: elf32-m68k.c:1236 elf32-score.c:3994 elf32-score7.c:3800 elf32-vax.c:529
-#: elfxx-mips.c:14103
+#. Ignore init flag - it may not be set, despite the flags field
+#. containing valid data.
+#: elf32-arm.c:12095 elf32-bfin.c:4949 elf32-cris.c:4139 elf32-m68hc1x.c:1427
+#: elf32-m68k.c:1195 elf32-score.c:4004 elf32-score7.c:3808 elf32-vax.c:529
+#: elf32-xgate.c:674 elfxx-mips.c:14955
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:4645
#, c-format
msgid "private flags = %lx:"
msgstr ""
-#: elf32-arm.c:11791
+#: elf32-arm.c:12104
#, c-format
msgid " [interworking enabled]"
msgstr ""
-#: elf32-arm.c:11799
+#: elf32-arm.c:12112
#, c-format
msgid " [VFP float format]"
msgstr ""
-#: elf32-arm.c:11801
+#: elf32-arm.c:12114
#, c-format
msgid " [Maverick float format]"
msgstr ""
-#: elf32-arm.c:11803
+#: elf32-arm.c:12116
#, c-format
msgid " [FPA float format]"
msgstr ""
-#: elf32-arm.c:11812
+#: elf32-arm.c:12125
#, c-format
msgid " [new ABI]"
msgstr ""
-#: elf32-arm.c:11815
+#: elf32-arm.c:12128
#, c-format
msgid " [old ABI]"
msgstr ""
-#: elf32-arm.c:11818
+#: elf32-arm.c:12131
#, c-format
msgid " [software FP]"
msgstr ""
-#: elf32-arm.c:11827
+#: elf32-arm.c:12140
#, c-format
msgid " [Version1 EABI]"
msgstr ""
-#: elf32-arm.c:11830 elf32-arm.c:11841
+#: elf32-arm.c:12143 elf32-arm.c:12154
#, c-format
msgid " [sorted symbol table]"
msgstr ""
-#: elf32-arm.c:11832 elf32-arm.c:11843
+#: elf32-arm.c:12145 elf32-arm.c:12156
#, c-format
msgid " [unsorted symbol table]"
msgstr ""
-#: elf32-arm.c:11838
+#: elf32-arm.c:12151
#, c-format
msgid " [Version2 EABI]"
msgstr ""
-#: elf32-arm.c:11846
+#: elf32-arm.c:12159
#, c-format
msgid " [dynamic symbols use segment index]"
msgstr ""
-#: elf32-arm.c:11849
+#: elf32-arm.c:12162
#, c-format
msgid " [mapping symbols precede others]"
msgstr ""
-#: elf32-arm.c:11856
+#: elf32-arm.c:12169
#, c-format
msgid " [Version3 EABI]"
msgstr ""
-#: elf32-arm.c:11860
+#: elf32-arm.c:12173
#, c-format
msgid " [Version4 EABI]"
msgstr ""
-#: elf32-arm.c:11864
+#: elf32-arm.c:12177
#, c-format
msgid " [Version5 EABI]"
msgstr ""
-#: elf32-arm.c:11867
+#: elf32-arm.c:12180
+#, c-format
+msgid " [soft-float ABI]"
+msgstr ""
+
+#: elf32-arm.c:12183
+#, c-format
+msgid " [hard-float ABI]"
+msgstr ""
+
+#: elf32-arm.c:12189
#, c-format
msgid " [BE8]"
msgstr ""
-#: elf32-arm.c:11870
+#: elf32-arm.c:12192
#, c-format
msgid " [LE8]"
msgstr ""
-#: elf32-arm.c:11876
+#: elf32-arm.c:12198
#, c-format
msgid " <EABI version unrecognised>"
msgstr ""
-#: elf32-arm.c:11883
+#: elf32-arm.c:12205
#, c-format
msgid " [relocatable executable]"
msgstr ""
-#: elf32-arm.c:11886
+#: elf32-arm.c:12208
#, c-format
msgid " [has entry point]"
msgstr ""
-#: elf32-arm.c:11891
+#: elf32-arm.c:12213 /src/binutils-gdb/bfd/elfnn-aarch64.c:4648
#, c-format
msgid "<Unrecognised flag bits set>"
msgstr ""
-#: elf32-arm.c:12189 elf32-i386.c:1461 elf32-s390.c:1000 elf32-tic6x.c:2829
-#: elf32-tilepro.c:1336 elf32-xtensa.c:1009 elf64-s390.c:960
-#: elf64-x86-64.c:1364 elfxx-sparc.c:1371 elfxx-tilegx.c:1586
+#: elf32-arm.c:12522 elf32-i386.c:1452 elf32-s390.c:1005 elf32-tic6x.c:2812
+#: elf32-tilepro.c:1511 elf32-xtensa.c:999 elf64-s390.c:927
+#: elf64-x86-64.c:1467 elfxx-sparc.c:1415 elfxx-tilegx.c:1728
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:5038
msgid "%B: bad symbol index: %d"
msgstr ""
-#: elf32-arm.c:12337 elf64-x86-64.c:1561 elf64-x86-64.c:1732 elfxx-mips.c:8223
+#: elf32-arm.c:12674 elf32-metag.c:2283 elf64-x86-64.c:1593
+#: elf64-x86-64.c:1771 elfxx-mips.c:8482
msgid ""
"%B: relocation %s against `%s' can not be used when making a shared object; "
"recompile with -fPIC"
msgstr ""
-#: elf32-arm.c:13460
+#: elf32-arm.c:13796
#, c-format
msgid "Errors encountered processing file %s"
msgstr ""
-#: elf32-arm.c:14837
+#: elf32-arm.c:14230
+#, c-format
+msgid "error: required section '%s' not found in the linker script"
+msgstr ""
+
+#: elf32-arm.c:15252
msgid "%B: error: Cortex-A8 erratum stub is allocated in unsafe location"
msgstr ""
#. There's not much we can do apart from complain if this
#. happens.
-#: elf32-arm.c:14864
+#: elf32-arm.c:15279
msgid "%B: error: Cortex-A8 erratum stub out of range (input file too large)"
msgstr ""
-#: elf32-arm.c:14958 elf32-arm.c:14980
+#: elf32-arm.c:15373 elf32-arm.c:15395
msgid "%B: error: VFP11 veneer out of range"
msgstr ""
-#: elf32-arm.c:15518
+#: elf32-arm.c:16020
msgid "error: %B is already in final BE8 format"
msgstr ""
-#: elf32-arm.c:15594
+#: elf32-arm.c:16096
msgid ""
"error: Source object %B has EABI version %d, but target %B has EABI version "
"%d"
msgstr ""
-#: elf32-arm.c:15610
+#: elf32-arm.c:16112
msgid "error: %B is compiled for APCS-%d, whereas target %B uses APCS-%d"
msgstr ""
-#: elf32-arm.c:15635
+#: elf32-arm.c:16137
msgid "error: %B uses VFP instructions, whereas %B does not"
msgstr ""
-#: elf32-arm.c:15639
+#: elf32-arm.c:16141
msgid "error: %B uses FPA instructions, whereas %B does not"
msgstr ""
-#: elf32-arm.c:15649
+#: elf32-arm.c:16151
msgid "error: %B uses Maverick instructions, whereas %B does not"
msgstr ""
-#: elf32-arm.c:15653
+#: elf32-arm.c:16155
msgid "error: %B does not use Maverick instructions, whereas %B does"
msgstr ""
-#: elf32-arm.c:15672
+#: elf32-arm.c:16174
msgid "error: %B uses software FP, whereas %B uses hardware FP"
msgstr ""
-#: elf32-arm.c:15676
+#: elf32-arm.c:16178
msgid "error: %B uses hardware FP, whereas %B uses software FP"
msgstr ""
-#: elf32-avr.c:1229 elf32-bfin.c:3221 elf32-cris.c:2089 elf32-epiphany.c:567
-#: elf32-fr30.c:617 elf32-frv.c:4113 elf32-i860.c:1219 elf32-ip2k.c:1479
-#: elf32-iq2000.c:692 elf32-m32c.c:561 elf32-mep.c:543 elf32-moxie.c:290
-#: elf32-msp430.c:494 elf32-mt.c:399 elf32-openrisc.c:412 elf32-tilepro.c:3222
-#: elf32-v850.c:2151 elf32-xstormy16.c:943 elf64-mmix.c:1598
-#: elfxx-tilegx.c:3585
+#: elf32-avr.c:1264 elf32-bfin.c:3228 elf32-cris.c:2024 elf32-epiphany.c:568
+#: elf32-fr30.c:597 elf32-frv.c:4047 elf32-i860.c:1220 elf32-ip2k.c:1479
+#: elf32-iq2000.c:696 elf32-m32c.c:561 elf32-mep.c:543 elf32-metag.c:2000
+#: elf32-moxie.c:290 elf32-msp430.c:1325 elf32-mt.c:399 elf32-openrisc.c:412
+#: elf32-tilepro.c:3674 elf32-v850.c:2289 elf32-xstormy16.c:944
+#: elf64-mmix.c:1546 elfxx-tilegx.c:4059
msgid "internal error: dangerous relocation"
msgstr ""
-#: elf32-avr.c:2415 elf32-hppa.c:598 elf32-m68hc1x.c:166
+#: elf32-avr.c:2476 elf32-hppa.c:578 elf32-m68hc1x.c:160 elf32-metag.c:1197
+#: elf32-nios2.c:1357
msgid "%B: cannot create stub entry %s"
msgstr ""
@@ -1288,181 +1348,181 @@ msgstr ""
msgid "relocation should be even number"
msgstr ""
-#: elf32-bfin.c:1593
+#: elf32-bfin.c:1601
msgid "%B(%A+0x%lx): unresolvable relocation against symbol `%s'"
msgstr ""
-#: elf32-bfin.c:1626 elf32-i386.c:4307 elf32-m68k.c:4233 elf32-s390.c:3055
-#: elf64-s390.c:3030 elf64-x86-64.c:4151
+#: elf32-bfin.c:1634 elf32-i386.c:4406 elf32-m68k.c:4197 elf32-s390.c:3364
+#: elf64-s390.c:3290 elf64-x86-64.c:4506
msgid "%B(%A+0x%lx): reloc against `%s': error %d"
msgstr ""
-#: elf32-bfin.c:2725
+#: elf32-bfin.c:2732
msgid "%B: relocation at `%A+0x%x' references symbol `%s' with nonzero addend"
msgstr ""
-#: elf32-bfin.c:2741
+#: elf32-bfin.c:2748
msgid "relocation references symbol not defined in the module"
msgstr ""
-#: elf32-bfin.c:2838
+#: elf32-bfin.c:2845
msgid "R_BFIN_FUNCDESC references dynamic symbol with nonzero addend"
msgstr ""
-#: elf32-bfin.c:2879 elf32-bfin.c:3002
+#: elf32-bfin.c:2886 elf32-bfin.c:3009
msgid "cannot emit fixups in read-only section"
msgstr ""
-#: elf32-bfin.c:2910 elf32-bfin.c:3040 elf32-lm32.c:1103 elf32-sh.c:5016
+#: elf32-bfin.c:2917 elf32-bfin.c:3047 elf32-lm32.c:1095 elf32-sh.c:4913
msgid "cannot emit dynamic relocations in read-only section"
msgstr ""
-#: elf32-bfin.c:2960
+#: elf32-bfin.c:2967
msgid "R_BFIN_FUNCDESC_VALUE references dynamic symbol with nonzero addend"
msgstr ""
-#: elf32-bfin.c:3125
+#: elf32-bfin.c:3132
msgid "relocations between different segments are not supported"
msgstr ""
-#: elf32-bfin.c:3126
+#: elf32-bfin.c:3133
msgid "warning: relocation references a different segment"
msgstr ""
-#: elf32-bfin.c:4971
+#: elf32-bfin.c:4907
msgid "%B: unsupported relocation type %i"
msgstr ""
-#: elf32-bfin.c:5125 elf32-frv.c:6808
+#: elf32-bfin.c:4995 elf32-frv.c:6600
#, c-format
msgid "%s: cannot link non-fdpic object file into fdpic executable"
msgstr ""
-#: elf32-bfin.c:5129 elf32-frv.c:6812
+#: elf32-bfin.c:4999 elf32-frv.c:6604
#, c-format
msgid "%s: cannot link fdpic object file into non-fdpic executable"
msgstr ""
-#: elf32-bfin.c:5283
+#: elf32-bfin.c:5153
#, c-format
msgid "*** check this relocation %s"
msgstr ""
-#: elf32-cris.c:1176
+#: elf32-cris.c:1110
msgid "%B, section %A: unresolvable relocation %s against symbol `%s'"
msgstr ""
-#: elf32-cris.c:1238
+#: elf32-cris.c:1172
msgid "%B, section %A: No PLT nor GOT for relocation %s against symbol `%s'"
msgstr ""
-#: elf32-cris.c:1240
+#: elf32-cris.c:1174
msgid "%B, section %A: No PLT for relocation %s against symbol `%s'"
msgstr ""
-#: elf32-cris.c:1246 elf32-cris.c:1379 elf32-cris.c:1639 elf32-cris.c:1722
-#: elf32-cris.c:1875 elf32-tic6x.c:2662
+#: elf32-cris.c:1180 elf32-cris.c:1313 elf32-cris.c:1573 elf32-cris.c:1656
+#: elf32-cris.c:1809 elf32-tic6x.c:2645
msgid "[whose name is lost]"
msgstr ""
-#: elf32-cris.c:1365 elf32-tic6x.c:2647
+#: elf32-cris.c:1299 elf32-tic6x.c:2630
msgid ""
"%B, section %A: relocation %s with non-zero addend %d against local symbol"
msgstr ""
-#: elf32-cris.c:1373 elf32-cris.c:1716 elf32-cris.c:1869 elf32-tic6x.c:2655
+#: elf32-cris.c:1307 elf32-cris.c:1650 elf32-cris.c:1803 elf32-tic6x.c:2638
msgid ""
"%B, section %A: relocation %s with non-zero addend %d against symbol `%s'"
msgstr ""
-#: elf32-cris.c:1399
+#: elf32-cris.c:1333
msgid "%B, section %A: relocation %s is not allowed for global symbol: `%s'"
msgstr ""
-#: elf32-cris.c:1415
+#: elf32-cris.c:1349
msgid "%B, section %A: relocation %s with no GOT created"
msgstr ""
#. We shouldn't get here for GCC-emitted code.
-#: elf32-cris.c:1630
+#: elf32-cris.c:1564
msgid ""
"%B, section %A: relocation %s has an undefined reference to `%s', perhaps a "
"declaration mixup?"
msgstr ""
-#: elf32-cris.c:2002
+#: elf32-cris.c:1937
msgid ""
"%B, section %A: relocation %s is not allowed for symbol: `%s' which is "
"defined outside the program, perhaps a declaration mixup?"
msgstr ""
-#: elf32-cris.c:2055
+#: elf32-cris.c:1990
msgid "(too many global variables for -fpic: recompile with -fPIC)"
msgstr ""
-#: elf32-cris.c:2062
+#: elf32-cris.c:1997
msgid ""
"(thread-local data too big for -fpic or -msmall-tls: recompile with -fPIC or "
"-mno-small-tls)"
msgstr ""
-#: elf32-cris.c:3261
+#: elf32-cris.c:3234
msgid ""
"%B, section %A:\n"
" v10/v32 compatible object %s must not contain a PIC relocation"
msgstr ""
-#: elf32-cris.c:3366
+#: elf32-cris.c:3342
msgid ""
"%B, section %A:\n"
" relocation %s not valid in a shared object; typically an option mixup, "
"recompile with -fPIC"
msgstr ""
-#: elf32-cris.c:3580
+#: elf32-cris.c:3556
msgid ""
"%B, section %A:\n"
" relocation %s should not be used in a shared object; recompile with -fPIC"
msgstr ""
-#: elf32-cris.c:4002
+#: elf32-cris.c:3978
msgid ""
"%B, section `%A', to symbol `%s':\n"
" relocation %s should not be used in a shared object; recompile with -fPIC"
msgstr ""
-#: elf32-cris.c:4118
+#: elf32-cris.c:4091
msgid "Unexpected machine number"
msgstr ""
-#: elf32-cris.c:4172
+#: elf32-cris.c:4142
#, c-format
msgid " [symbols have a _ prefix]"
msgstr ""
-#: elf32-cris.c:4175
+#: elf32-cris.c:4145
#, c-format
msgid " [v10 and v32]"
msgstr ""
-#: elf32-cris.c:4178
+#: elf32-cris.c:4148
#, c-format
msgid " [v32]"
msgstr ""
-#: elf32-cris.c:4223
+#: elf32-cris.c:4191
msgid "%B: uses _-prefixed symbols, but writing file with non-prefixed symbols"
msgstr ""
-#: elf32-cris.c:4224
+#: elf32-cris.c:4192
msgid "%B: uses non-prefixed symbols, but writing file with _-prefixed symbols"
msgstr ""
-#: elf32-cris.c:4243
+#: elf32-cris.c:4211
msgid "%B contains CRIS v32 code, incompatible with previous objects"
msgstr ""
-#: elf32-cris.c:4245
+#: elf32-cris.c:4213
msgid "%B contains non-CRIS-v32 code, incompatible with previous objects"
msgstr ""
@@ -1477,119 +1537,119 @@ msgid "BFD Link Error: jump (PC rel26) to section (%s) not supported"
msgstr ""
#. Only if it's not an unresolved symbol.
-#: elf32-epiphany.c:563 elf32-ip2k.c:1475
+#: elf32-epiphany.c:564 elf32-ip2k.c:1475
msgid "unsupported relocation between data/insn address spaces"
msgstr ""
-#: elf32-frv.c:1509 elf32-frv.c:1658
+#: elf32-frv.c:1460 elf32-frv.c:1609
msgid "relocation requires zero addend"
msgstr ""
-#: elf32-frv.c:2888
+#: elf32-frv.c:2822
msgid "%H: relocation to `%s+%v' may have caused the error above\n"
msgstr ""
-#: elf32-frv.c:2905
+#: elf32-frv.c:2839
msgid "%H: relocation references symbol not defined in the module\n"
msgstr ""
-#: elf32-frv.c:2981
+#: elf32-frv.c:2915
msgid "%H: R_FRV_GETTLSOFF not applied to a call instruction\n"
msgstr ""
-#: elf32-frv.c:3022
+#: elf32-frv.c:2956
msgid "%H: R_FRV_GOTTLSDESC12 not applied to an lddi instruction\n"
msgstr ""
-#: elf32-frv.c:3093
+#: elf32-frv.c:3027
msgid "%H: R_FRV_GOTTLSDESCHI not applied to a sethi instruction\n"
msgstr ""
-#: elf32-frv.c:3130
+#: elf32-frv.c:3064
msgid "%H: R_FRV_GOTTLSDESCLO not applied to a setlo or setlos instruction\n"
msgstr ""
-#: elf32-frv.c:3177
+#: elf32-frv.c:3111
msgid "%H: R_FRV_TLSDESC_RELAX not applied to an ldd instruction\n"
msgstr ""
-#: elf32-frv.c:3261
+#: elf32-frv.c:3195
msgid "%H: R_FRV_GETTLSOFF_RELAX not applied to a calll instruction\n"
msgstr ""
-#: elf32-frv.c:3315
+#: elf32-frv.c:3249
msgid "%H: R_FRV_GOTTLSOFF12 not applied to an ldi instruction\n"
msgstr ""
-#: elf32-frv.c:3345
+#: elf32-frv.c:3279
msgid "%H: R_FRV_GOTTLSOFFHI not applied to a sethi instruction\n"
msgstr ""
-#: elf32-frv.c:3374
+#: elf32-frv.c:3308
msgid "%H: R_FRV_GOTTLSOFFLO not applied to a setlo or setlos instruction\n"
msgstr ""
-#: elf32-frv.c:3404
+#: elf32-frv.c:3338
msgid "%H: R_FRV_TLSOFF_RELAX not applied to an ld instruction\n"
msgstr ""
-#: elf32-frv.c:3449
+#: elf32-frv.c:3383
msgid "%H: R_FRV_TLSMOFFHI not applied to a sethi instruction\n"
msgstr ""
-#: elf32-frv.c:3476
+#: elf32-frv.c:3410
msgid "R_FRV_TLSMOFFLO not applied to a setlo or setlos instruction\n"
msgstr ""
-#: elf32-frv.c:3597
+#: elf32-frv.c:3531
msgid "%H: R_FRV_FUNCDESC references dynamic symbol with nonzero addend\n"
msgstr ""
-#: elf32-frv.c:3638 elf32-frv.c:3760
+#: elf32-frv.c:3572 elf32-frv.c:3694
msgid "%H: cannot emit fixups in read-only section\n"
msgstr ""
-#: elf32-frv.c:3669 elf32-frv.c:3803
+#: elf32-frv.c:3603 elf32-frv.c:3737
msgid "%H: cannot emit dynamic relocations in read-only section\n"
msgstr ""
-#: elf32-frv.c:3718
+#: elf32-frv.c:3652
msgid ""
"%H: R_FRV_FUNCDESC_VALUE references dynamic symbol with nonzero addend\n"
msgstr ""
-#: elf32-frv.c:3974
+#: elf32-frv.c:3908
msgid "%H: reloc against `%s' references a different segment\n"
msgstr ""
-#: elf32-frv.c:4124
+#: elf32-frv.c:4058
msgid "%H: reloc against `%s': %s\n"
msgstr ""
-#: elf32-frv.c:6400
+#: elf32-frv.c:6265
msgid "%B: unsupported relocation type %i\n"
msgstr ""
-#: elf32-frv.c:6722
+#: elf32-frv.c:6514
#, c-format
msgid ""
"%s: compiled with %s and linked with modules that use non-pic relocations"
msgstr ""
-#: elf32-frv.c:6775 elf32-iq2000.c:845 elf32-m32c.c:807
+#: elf32-frv.c:6567 elf32-iq2000.c:828 elf32-m32c.c:812
#, c-format
msgid "%s: compiled with %s and linked with modules compiled with %s"
msgstr ""
-#: elf32-frv.c:6787
+#: elf32-frv.c:6579
#, c-format
msgid ""
"%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x"
"%lx)"
msgstr ""
-#: elf32-frv.c:6837 elf32-iq2000.c:882 elf32-m32c.c:843 elf32-mt.c:576
-#: elf32-rx.c:3001
+#: elf32-frv.c:6627 elf32-iq2000.c:865 elf32-m32c.c:848 elf32-mt.c:561
+#: elf32-rl78.c:1069 elf32-rx.c:3040 elf64-ppc.c:5839
#, c-format
msgid "private flags = 0x%lx:"
msgstr ""
@@ -1598,97 +1658,98 @@ msgstr ""
msgid "%B: Relocations in generic ELF (EM: %d)"
msgstr ""
-#: elf32-hppa.c:850 elf32-hppa.c:3598
+#: elf32-hppa.c:830 elf32-hppa.c:3592
msgid "%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"
msgstr ""
-#: elf32-hppa.c:1284
+#: elf32-hppa.c:1268
msgid ""
"%B: relocation %s can not be used when making a shared object; recompile "
"with -fPIC"
msgstr ""
-#: elf32-hppa.c:2791
+#: elf32-hppa.c:2781
msgid "%B: duplicate export stub %s"
msgstr ""
-#: elf32-hppa.c:3437
+#: elf32-hppa.c:3427
msgid ""
"%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"
msgstr ""
-#: elf32-hppa.c:4284
+#: elf32-hppa.c:4279
msgid "%B(%A+0x%lx): cannot handle %s for %s"
msgstr ""
-#: elf32-hppa.c:4603
+#: elf32-hppa.c:4598
msgid ".got section not immediately after .plt section"
msgstr ""
#. Unknown relocation.
-#: elf32-i386.c:373 elf32-m68k.c:384 elf32-ppc.c:1676 elf32-s390.c:379
-#: elf32-tic6x.c:2684 elf64-ppc.c:2300 elf64-s390.c:403 elf64-x86-64.c:265
+#: elf32-i386.c:380 elf32-m68k.c:353 elf32-ppc.c:2035 elf32-s390.c:345
+#: elf32-tic6x.c:2667 elf64-ppc.c:2427 elf64-s390.c:371 elf64-x86-64.c:281
msgid "%B: invalid relocation type %d"
msgstr ""
-#: elf32-i386.c:1404 elf64-x86-64.c:1308
+#: elf32-i386.c:1394 elf64-x86-64.c:1410
msgid ""
"%B: TLS transition from %s to %s against `%s' at 0x%lx in section `%A' failed"
msgstr ""
-#: elf32-i386.c:1549 elf32-i386.c:3244 elf64-x86-64.c:1487 elf64-x86-64.c:3125
-#: elfxx-sparc.c:3083
-msgid "%B: relocation %s against STT_GNU_IFUNC symbol `%s' isn't handled by %s"
-msgstr ""
-
-#: elf32-i386.c:1711 elf32-s390.c:1182 elf32-sh.c:6362 elf32-tilepro.c:1434
-#: elf32-xtensa.c:1182 elf64-s390.c:1151 elfxx-sparc.c:1548
-#: elfxx-tilegx.c:1701
+#: elf32-i386.c:1642 elf32-s390.c:1233 elf32-sh.c:6263 elf32-tilepro.c:1627
+#: elf32-xtensa.c:1176 elf64-s390.c:1166 elfxx-sparc.c:1596
+#: elfxx-tilegx.c:1836
msgid "%B: `%s' accessed both as normal and thread local symbol"
msgstr ""
-#: elf32-i386.c:2539 elf64-x86-64.c:2506
+#: elf32-i386.c:2500 elf64-x86-64.c:2582
msgid "%P: %B: warning: relocation against `%s' in readonly section `%A'.\n"
msgstr ""
-#: elf32-i386.c:2629 elf64-x86-64.c:2593
+#: elf32-i386.c:2740 elf64-x86-64.c:2820
msgid "%P: %B: warning: relocation in readonly section `%A'.\n"
msgstr ""
-#: elf32-i386.c:3086 elf32-tilepro.c:2557 elfxx-tilegx.c:2871
+#: elf32-i386.c:3207 elf32-tilepro.c:2873 elf64-x86-64.c:3275
+#: elfxx-tilegx.c:3172 /src/binutils-gdb/bfd/elfnn-aarch64.c:4099
msgid "%B: unrecognized relocation (0x%x) in section `%A'"
msgstr ""
-#: elf32-i386.c:3494 elf64-x86-64.c:3513
+#: elf32-i386.c:3368 elf64-x86-64.c:3380 elfxx-sparc.c:3150
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:3496
+msgid "%B: relocation %s against STT_GNU_IFUNC symbol `%s' isn't handled by %s"
+msgstr ""
+
+#: elf32-i386.c:3610 elf64-x86-64.c:3777
msgid "hidden symbol"
msgstr ""
-#: elf32-i386.c:3497 elf64-x86-64.c:3516
+#: elf32-i386.c:3613 elf64-x86-64.c:3780
msgid "internal symbol"
msgstr ""
-#: elf32-i386.c:3500 elf64-x86-64.c:3519
+#: elf32-i386.c:3616 elf64-x86-64.c:3783
msgid "protected symbol"
msgstr ""
-#: elf32-i386.c:3503 elf64-x86-64.c:3522
+#: elf32-i386.c:3619 elf64-x86-64.c:3786
msgid "symbol"
msgstr ""
-#: elf32-i386.c:3508
+#: elf32-i386.c:3624
msgid ""
"%B: relocation R_386_GOTOFF against undefined %s `%s' can not be used when "
"making a shared object"
msgstr ""
-#: elf32-i386.c:3518
+#: elf32-i386.c:3635
msgid ""
"%B: relocation R_386_GOTOFF against protected function `%s' can not be used "
"when making a shared object"
msgstr ""
-#: elf32-i386.c:4839 elf32-tilepro.c:3467 elf64-x86-64.c:4609
-#: elfxx-tilegx.c:3847
+#: elf32-i386.c:4923 elf32-tilepro.c:3923 elf64-x86-64.c:4964
+#: elfxx-tilegx.c:4326 /src/binutils-gdb/bfd/elfnn-aarch64.c:7105
#, c-format
msgid "discarded output section: `%A'"
msgstr ""
@@ -1712,20 +1773,20 @@ msgstr ""
msgid "ip2k linker: redundant page instruction at 0x%08lx (dest = 0x%08lx)."
msgstr ""
-#: elf32-iq2000.c:858 elf32-m32c.c:819
+#: elf32-iq2000.c:841 elf32-m32c.c:824
#, c-format
msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
msgstr ""
-#: elf32-lm32.c:706
+#: elf32-lm32.c:698 elf32-nios2.c:2191
msgid "global pointer relative relocation when _gp not defined"
msgstr ""
-#: elf32-lm32.c:761
+#: elf32-lm32.c:753 elf32-nios2.c:2623
msgid "global pointer relative address out of range"
msgstr ""
-#: elf32-lm32.c:1057
+#: elf32-lm32.c:1049
msgid "internal error: addend should be zero for R_LM32_16_GOT"
msgstr ""
@@ -1733,133 +1794,152 @@ msgstr ""
msgid "SDA relocation when _SDA_BASE_ not defined"
msgstr ""
-#: elf32-m32r.c:3043
+#: elf32-m32r.c:3003
msgid "%B: The target (%s) of an %s relocation is in the wrong section (%A)"
msgstr ""
-#: elf32-m32r.c:3571
+#: elf32-m32r.c:3529
msgid "%B: Instruction set mismatch with previous modules"
msgstr ""
-#: elf32-m32r.c:3592
+#: elf32-m32r.c:3550 elf32-nds32.c:5636
#, c-format
msgid "private flags = %lx"
msgstr ""
-#: elf32-m32r.c:3597
+#: elf32-m32r.c:3555
#, c-format
msgid ": m32r instructions"
msgstr ""
-#: elf32-m32r.c:3598
+#: elf32-m32r.c:3556
#, c-format
msgid ": m32rx instructions"
msgstr ""
-#: elf32-m32r.c:3599
+#: elf32-m32r.c:3557
#, c-format
msgid ": m32r2 instructions"
msgstr ""
-#: elf32-m68hc1x.c:1050
+#: elf32-m68hc1x.c:1114
#, c-format
msgid ""
"Reference to the far symbol `%s' using a wrong relocation may result in "
"incorrect execution"
msgstr ""
-#: elf32-m68hc1x.c:1073
+#: elf32-m68hc1x.c:1150
+#, c-format
+msgid ""
+"XGATE address (%lx) is not within shared RAM(0xE000-0xFFFF), therefore you "
+"must manually offset the address, and possibly manage the page, in your code."
+msgstr ""
+
+#: elf32-m68hc1x.c:1170
#, c-format
msgid ""
"banked address [%lx:%04lx] (%lx) is not in the same bank as current banked "
"address [%lx:%04lx] (%lx)"
msgstr ""
-#: elf32-m68hc1x.c:1092
+#: elf32-m68hc1x.c:1190
#, c-format
msgid ""
"reference to a banked address [%lx:%04lx] in the normal address space at "
"%04lx"
msgstr ""
-#: elf32-m68hc1x.c:1225
+#: elf32-m68hc1x.c:1237
+#, c-format
+msgid ""
+"S12 address (%lx) is not within shared RAM(0x2000-0x4000), therefore you "
+"must manually offset the address in your code"
+msgstr ""
+
+#: elf32-m68hc1x.c:1370
msgid ""
"%B: linking files compiled for 16-bit integers (-mshort) and others for 32-"
"bit integers"
msgstr ""
-#: elf32-m68hc1x.c:1232
+#: elf32-m68hc1x.c:1377
msgid ""
"%B: linking files compiled for 32-bit double (-fshort-double) and others for "
"64-bit double"
msgstr ""
-#: elf32-m68hc1x.c:1241
+#: elf32-m68hc1x.c:1386
msgid "%B: linking files compiled for HCS12 with others compiled for HC12"
msgstr ""
-#: elf32-m68hc1x.c:1257 elf32-ppc.c:4227 elf64-sparc.c:706 elfxx-mips.c:13965
+#: elf32-m68hc1x.c:1402 elf32-ppc.c:4776 elf64-sparc.c:706 elfxx-mips.c:14817
msgid "%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
msgstr ""
-#: elf32-m68hc1x.c:1285
+#: elf32-m68hc1x.c:1430 elf32-xgate.c:677
#, c-format
msgid "[abi=32-bit int, "
msgstr ""
-#: elf32-m68hc1x.c:1287
+#: elf32-m68hc1x.c:1432 elf32-xgate.c:679
#, c-format
msgid "[abi=16-bit int, "
msgstr ""
-#: elf32-m68hc1x.c:1290
+#: elf32-m68hc1x.c:1435 elf32-xgate.c:682
#, c-format
msgid "64-bit double, "
msgstr ""
-#: elf32-m68hc1x.c:1292
+#: elf32-m68hc1x.c:1437 elf32-xgate.c:684
#, c-format
msgid "32-bit double, "
msgstr ""
-#: elf32-m68hc1x.c:1295
+#: elf32-m68hc1x.c:1440
#, c-format
msgid "cpu=HC11]"
msgstr ""
-#: elf32-m68hc1x.c:1297
+#: elf32-m68hc1x.c:1442
#, c-format
msgid "cpu=HCS12]"
msgstr ""
-#: elf32-m68hc1x.c:1299
+#: elf32-m68hc1x.c:1444
#, c-format
msgid "cpu=HC12]"
msgstr ""
-#: elf32-m68hc1x.c:1302
+#: elf32-m68hc1x.c:1447
#, c-format
msgid " [memory=bank-model]"
msgstr ""
-#: elf32-m68hc1x.c:1304
+#: elf32-m68hc1x.c:1449
#, c-format
msgid " [memory=flat]"
msgstr ""
-#: elf32-m68k.c:1251 elf32-m68k.c:1252 vms-alpha.c:7314 vms-alpha.c:7329
+#: elf32-m68hc1x.c:1452
+#, c-format
+msgid " [XGATE RAM offsetting]"
+msgstr ""
+
+#: elf32-m68k.c:1210 elf32-m68k.c:1211 vms-alpha.c:7207 vms-alpha.c:7222
msgid "unknown"
msgstr ""
-#: elf32-m68k.c:1715
+#: elf32-m68k.c:1674
msgid "%B: GOT overflow: Number of relocations with 8-bit offset > %d"
msgstr ""
-#: elf32-m68k.c:1721
+#: elf32-m68k.c:1680
msgid "%B: GOT overflow: Number of relocations with 8- or 16-bit offset > %d"
msgstr ""
-#: elf32-m68k.c:3957
+#: elf32-m68k.c:3921
msgid "%B(%A+0x%lx): R_68K_TLS_LE32 relocation not permitted in shared object"
msgstr ""
@@ -1882,136 +1962,312 @@ msgstr ""
msgid "MeP: howto %d has type %d"
msgstr ""
-#: elf32-mep.c:648
+#: elf32-mep.c:632
msgid "%B and %B are for different cores"
msgstr ""
-#: elf32-mep.c:665
+#: elf32-mep.c:649
msgid "%B and %B are for different configurations"
msgstr ""
-#: elf32-mep.c:702
+#: elf32-mep.c:686
#, c-format
msgid "private flags = 0x%lx"
msgstr ""
-#: elf32-microblaze.c:742
+#: elf32-metag.c:1921
+msgid ""
+"%B(%A+0x%lx): R_METAG_TLS_LE/IENONPIC relocation not permitted in shared "
+"object"
+msgstr ""
+
+#: elf32-microblaze.c:950
#, c-format
msgid "%s: unknown relocation type %d"
msgstr ""
-#: elf32-microblaze.c:867 elf32-microblaze.c:912
+#: elf32-microblaze.c:1076 elf32-microblaze.c:1121
#, c-format
msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)"
msgstr ""
-#: elf32-microblaze.c:1155 elf32-tilepro.c:2891 elfxx-sparc.c:3457
-#: elfxx-tilegx.c:3230
+#: elf32-microblaze.c:1484 elf32-tilepro.c:3320 elfxx-sparc.c:3526
+#: elfxx-tilegx.c:3729
msgid "%B: probably compiled without -fPIC?"
msgstr ""
-#: elf32-microblaze.c:2074
-msgid "%B: bad relocation section name `%s'"
-msgstr ""
-
-#: elf32-mips.c:1549 elf64-mips.c:2683 elfn32-mips.c:2487
+#: elf32-mips.c:1670 elf64-mips.c:2990 elfn32-mips.c:2793
msgid "literal relocation occurs for an external symbol"
msgstr ""
-#: elf32-mips.c:1596 elf32-score.c:570 elf32-score7.c:469 elf64-mips.c:2726
-#: elfn32-mips.c:2528
+#: elf32-mips.c:1717 elf32-score.c:570 elf32-score7.c:469 elf64-mips.c:3033
+#: elfn32-mips.c:2834
msgid "32bits gp relative relocation occurs for an external symbol"
msgstr ""
-#: elf32-ppc.c:1741
+#: elf32-msp430.c:801 elf32-msp430.c:1109
+msgid "Try enabling relaxation to avoid relocation truncations"
+msgstr ""
+
+#: elf32-msp430.c:1317
+msgid "internal error: branch/jump to an odd address detected"
+msgstr ""
+
+#: elf32-msp430.c:2221
+msgid "Warning: %B: Unknown MSPABI object attribute %d"
+msgstr ""
+
+#: elf32-msp430.c:2312
+msgid "error: %B uses %s instructions but %B uses %s"
+msgstr ""
+
+#: elf32-msp430.c:2324
+msgid "error: %B uses the %s code model whereas %B uses the %s code model"
+msgstr ""
+
+#: elf32-msp430.c:2336
+msgid "error: %B uses the large code model but %B uses MSP430 instructions"
+msgstr ""
+
+#: elf32-msp430.c:2346
+msgid "error: %B uses the %s data model whereas %B uses the %s data model"
+msgstr ""
+
+#: elf32-msp430.c:2358
+msgid "error: %B uses the small code model but %B uses the %s data model"
+msgstr ""
+
+#: elf32-msp430.c:2369
+msgid "error: %B uses the %s data model but %B only uses MSP430 instructions"
+msgstr ""
+
+#: elf32-nds32.c:2921
+msgid "error: Can't find symbol: _SDA_BASE_."
+msgstr ""
+
+#: elf32-nds32.c:4142
+msgid "%B: error: unknown relocation type %d."
+msgstr ""
+
+#: elf32-nds32.c:4584
+#, c-format
+msgid "%s: warning: cannot deal R_NDS32_25_ABS_RELA in shared mode."
+msgstr ""
+
+#: elf32-nds32.c:4716
+msgid "%B: warning: unaligned access to GOT entry."
+msgstr ""
+
+#: elf32-nds32.c:4758
+msgid "%B: warning: relocate SDA_BASE failed."
+msgstr ""
+
+#: elf32-nds32.c:4779
+msgid "%B(%A): warning: unaligned small data access of type %d."
+msgstr ""
+
+#: elf32-nds32.c:5446
+msgid ""
+"%B: ISR vector size mismatch with previous modules, previous %u-byte, "
+"current %u-byte"
+msgstr ""
+
+#: elf32-nds32.c:5489
+msgid "%B: warning: Endian mismatch with previous modules."
+msgstr ""
+
+#: elf32-nds32.c:5499
+msgid ""
+"%B: warning: Older version of object file encountered, Please recompile with "
+"current tool chain."
+msgstr ""
+
+#: elf32-nds32.c:5577
+msgid "%B: error: ABI mismatch with previous modules."
+msgstr ""
+
+#: elf32-nds32.c:5588
+msgid "%B: error: Instruction set mismatch with previous modules."
+msgstr ""
+
+#: elf32-nds32.c:5612
+msgid "%B: warning: Incompatible elf-versions %s and %s."
+msgstr ""
+
+#: elf32-nds32.c:5642
+#, c-format
+msgid ": n1 instructions"
+msgstr ""
+
+#: elf32-nds32.c:5645
+#, c-format
+msgid ": n1h instructions"
+msgstr ""
+
+#: elf32-nds32.c:8147
+msgid "%B: %s\n"
+msgstr ""
+
+#: elf32-nds32.c:8449
+msgid ""
+"%B(%A): warning: relax is suppressed for sections of alignment %d-bytes > 4-"
+"byte."
+msgstr ""
+
+#: elf32-nds32.c:8502
+msgid "%B: error: Cannot set _ITB_BASE_"
+msgstr ""
+
+#: elf32-nds32.c:11384
+msgid "%B: Nested OMIT_FP in %A."
+msgstr ""
+
+#: elf32-nds32.c:11401
+msgid "%B: Unmatched OMIT_FP in %A."
+msgstr ""
+
+#: elf32-nds32.c:13357
+msgid "Linker: cannot init ex9 hash table error \n"
+msgstr ""
+
+#: elf32-nds32.c:13790 elf32-nds32.c:13804
+msgid "Linker: error cannot fixed ex9 relocation \n"
+msgstr ""
+
+#: elf32-nds32.c:14015
+#, c-format
+msgid ""
+"%s: warning: unaligned small data access. For entry: {%d, %d, %d}, addr = 0x"
+"%x, align = 0x%x."
+msgstr ""
+
+#: elf32-nds32.c:14047
+msgid "%P%F: failed creating ex9.it %s hash table: %E\n"
+msgstr ""
+
+#: elf32-nios2.c:2861
+#, c-format
+msgid ""
+"global pointer relative relocation at address 0x%08x when _gp not defined\n"
+msgstr ""
+
+#: elf32-nios2.c:2878
+#, c-format
+msgid ""
+"Unable to reach %s (at 0x%08x) from the global pointer (at 0x%08x) because "
+"the offset (%d) is out of the allowed range, -32678 to 32767.\n"
+msgstr ""
+
+#: elf32-nios2.c:3392
+msgid ""
+"%B(%A+0x%lx): R_NIOS2_TLS_LE16 relocation not permitted in shared object"
+msgstr ""
+
+#: elf32-nios2.c:3520
+msgid "relocation out of range"
+msgstr ""
+
+#: elf32-nios2.c:3530 elf32-tic6x.c:2744
+msgid "dangerous relocation"
+msgstr ""
+
+#: elf32-nios2.c:4529
+#, c-format
+msgid "dynamic variable `%s' is zero size"
+msgstr ""
+
+#: elf32-ppc.c:2100
#, c-format
msgid "generic linker can't handle %s"
msgstr ""
-#: elf32-ppc.c:2184
+#: elf32-ppc.c:2642
msgid "corrupt %s section in %B"
msgstr ""
-#: elf32-ppc.c:2203
+#: elf32-ppc.c:2661
msgid "unable to read in %s section from %B"
msgstr ""
-#: elf32-ppc.c:2244
+#: elf32-ppc.c:2702
msgid "warning: unable to set size of %s section in %B"
msgstr ""
-#: elf32-ppc.c:2294
+#: elf32-ppc.c:2752
msgid "failed to allocate space for new APUinfo section."
msgstr ""
-#: elf32-ppc.c:2313
+#: elf32-ppc.c:2771
msgid "failed to compute new APUinfo section."
msgstr ""
-#: elf32-ppc.c:2316
+#: elf32-ppc.c:2774
msgid "failed to install new APUinfo section."
msgstr ""
-#: elf32-ppc.c:3356
+#: elf32-ppc.c:3844
msgid "%B: relocation %s cannot be used when making a shared object"
msgstr ""
#. It does not make sense to have a procedure linkage
#. table entry for a local symbol.
-#: elf32-ppc.c:3700
+#: elf32-ppc.c:4218
msgid "%P: %H: %s reloc against local symbol\n"
msgstr ""
-#: elf32-ppc.c:4039 elf32-ppc.c:4054 elfxx-mips.c:13651 elfxx-mips.c:13677
-#: elfxx-mips.c:13699 elfxx-mips.c:13725
+#: elf32-ppc.c:4299
+msgid "%P: %H: @local call to ifunc %s\n"
+msgstr ""
+
+#: elf32-ppc.c:4588 elf32-ppc.c:4603
msgid "Warning: %B uses hard float, %B uses soft float"
msgstr ""
-#: elf32-ppc.c:4042 elf32-ppc.c:4046
+#: elf32-ppc.c:4591 elf32-ppc.c:4595
msgid ""
"Warning: %B uses double-precision hard float, %B uses single-precision hard "
"float"
msgstr ""
-#: elf32-ppc.c:4050
+#: elf32-ppc.c:4599
msgid "Warning: %B uses soft float, %B uses single-precision hard float"
msgstr ""
-#: elf32-ppc.c:4057 elf32-ppc.c:4061 elfxx-mips.c:13631 elfxx-mips.c:13635
+#: elf32-ppc.c:4606 elf32-ppc.c:4610
msgid "Warning: %B uses unknown floating point ABI %d"
msgstr ""
-#: elf32-ppc.c:4103 elf32-ppc.c:4107
+#: elf32-ppc.c:4652 elf32-ppc.c:4656
msgid "Warning: %B uses unknown vector ABI %d"
msgstr ""
-#: elf32-ppc.c:4111
+#: elf32-ppc.c:4660
msgid "Warning: %B uses vector ABI \"%s\", %B uses \"%s\""
msgstr ""
-#: elf32-ppc.c:4128 elf32-ppc.c:4131
+#: elf32-ppc.c:4677 elf32-ppc.c:4680
msgid "Warning: %B uses r3/r4 for small structure returns, %B uses memory"
msgstr ""
-#: elf32-ppc.c:4134 elf32-ppc.c:4138
+#: elf32-ppc.c:4683 elf32-ppc.c:4687
msgid "Warning: %B uses unknown small structure return convention %d"
msgstr ""
-#: elf32-ppc.c:4192
+#: elf32-ppc.c:4741
msgid ""
"%B: compiled with -mrelocatable and linked with modules compiled normally"
msgstr ""
-#: elf32-ppc.c:4200
+#: elf32-ppc.c:4749
msgid ""
"%B: compiled normally and linked with modules compiled with -mrelocatable"
msgstr ""
-#: elf32-ppc.c:4309
+#: elf32-ppc.c:4872
msgid "%P: bss-plt forced due to %B\n"
msgstr ""
-#: elf32-ppc.c:4312
+#: elf32-ppc.c:4875
msgid "%P: bss-plt forced by profiling\n"
msgstr ""
@@ -2019,103 +2275,116 @@ msgstr ""
#. could just mark this symbol to exclude it
#. from tls optimization but it's safer to skip
#. the entire optimization.
-#: elf32-ppc.c:4809 elf64-ppc.c:7858
+#: elf32-ppc.c:5369 elf64-ppc.c:8371
msgid "%H arg lost __tls_get_addr, TLS optimization disabled\n"
msgstr ""
-#: elf32-ppc.c:5044 elf64-ppc.c:6528
-msgid "%P: dynamic variable `%s' is zero size\n"
-msgstr ""
-
-#: elf32-ppc.c:7263 elf64-ppc.c:12675
+#: elf32-ppc.c:7927
msgid "%P: %B: unknown relocation type %d for symbol %s\n"
msgstr ""
-#: elf32-ppc.c:7524
+#: elf32-ppc.c:8191
msgid "%P: %H: non-zero addend on %s reloc against `%s'\n"
msgstr ""
-#: elf32-ppc.c:7720 elf64-ppc.c:13181
+#: elf32-ppc.c:8389
msgid "%P: %H: relocation %s for indirect function %s unsupported\n"
msgstr ""
-#: elf32-ppc.c:7948 elf32-ppc.c:7978 elf32-ppc.c:8025
+#: elf32-ppc.c:8646 elf32-ppc.c:8676 elf32-ppc.c:8767
msgid ""
"%P: %B: the target (%s) of a %s relocation is in the wrong output section "
"(%s)\n"
msgstr ""
-#: elf32-ppc.c:8097
-msgid "%P: %B: relocation %s is not yet supported for symbol %s\n"
+#: elf32-ppc.c:8854
+msgid ""
+"%B: the target (%s) of a %s relocation is in the wrong output section (%s)"
msgstr ""
-#: elf32-ppc.c:8158 elf64-ppc.c:13467
-msgid "%P: %H: unresolvable %s relocation against symbol `%s'\n"
+#: elf32-ppc.c:8958
+msgid "%P: %B: relocation %s is not yet supported for symbol %s\n"
msgstr ""
-#: elf32-ppc.c:8205 elf64-ppc.c:13512
-msgid "%P: %H: %s reloc against `%s': error %d\n"
+#: elf32-ppc.c:9038
+msgid "%P: %H: error: %s against `%s' not a multiple of %u\n"
msgstr ""
-#: elf32-ppc.c:8696
-msgid "%P: %s not defined in linker created %s\n"
+#: elf32-ppc.c:9067
+msgid "%P: %H: unresolvable %s relocation against symbol `%s'\n"
msgstr ""
-#: elf32-rx.c:563
-msgid "%B:%A: Warning: deprecated Red Hat reloc "
+#: elf32-ppc.c:9114
+msgid "%P: %H: %s reloc against `%s': error %d\n"
msgstr ""
-#. Check for unsafe relocs in PID mode. These are any relocs where
-#. an absolute address is being computed. There are special cases
-#. for relocs against symbols that are known to be referenced in
-#. crt0.o before the PID base address register has been initialised.
-#: elf32-rx.c:581
-msgid "%B(%A): unsafe PID relocation %s at 0x%08lx (against %s in %s)"
+#: elf32-ppc.c:9750
+msgid "%P: %s not defined in linker created %s\n"
msgstr ""
-#: elf32-rx.c:1157
-msgid "Warning: RX_SYM reloc with an unknown symbol"
+#: elf32-rl78.c:784
+msgid "Warning: RL78_SYM reloc with an unknown symbol"
msgstr ""
-#: elf32-rx.c:1324
+#: elf32-rl78.c:952 elf32-rx.c:1324
msgid "%B(%A): error: call to undefined function '%s'"
msgstr ""
-#: elf32-rx.c:1338
+#: elf32-rl78.c:966 elf32-rx.c:1338
msgid "%B(%A): warning: unaligned access to symbol '%s' in the small data area"
msgstr ""
-#: elf32-rx.c:1342
+#: elf32-rl78.c:970 elf32-rx.c:1342
msgid "%B(%A): internal error: out of range error"
msgstr ""
-#: elf32-rx.c:1346
+#: elf32-rl78.c:974 elf32-rx.c:1346
msgid "%B(%A): internal error: unsupported relocation error"
msgstr ""
-#: elf32-rx.c:1350
+#: elf32-rl78.c:978 elf32-rx.c:1350
msgid "%B(%A): internal error: dangerous relocation"
msgstr ""
-#: elf32-rx.c:1354
+#: elf32-rl78.c:982 elf32-rx.c:1354
msgid "%B(%A): internal error: unknown error"
msgstr ""
-#: elf32-rx.c:3004
+#: elf32-rl78.c:1043
+msgid "RL78/G10 ABI conflict: cannot link G10 and non-G10 objects together"
+msgstr ""
+
+#: elf32-rl78.c:1046 elf32-rl78.c:1049
#, c-format
-msgid " [64-bit doubles]"
+msgid "- %s is G10, %s is not"
msgstr ""
-#: elf32-rx.c:3006
+#: elf32-rl78.c:1072
#, c-format
-msgid " [dsp]"
+msgid " [G10]"
+msgstr ""
+
+#: elf32-rx.c:563
+msgid "%B:%A: Warning: deprecated Red Hat reloc "
+msgstr ""
+
+#. Check for unsafe relocs in PID mode. These are any relocs where
+#. an absolute address is being computed. There are special cases
+#. for relocs against symbols that are known to be referenced in
+#. crt0.o before the PID base address register has been initialised.
+#: elf32-rx.c:581
+msgid "%B(%A): unsafe PID relocation %s at 0x%08lx (against %s in %s)"
msgstr ""
-#: elf32-s390.c:2200 elf64-s390.c:2187
+#: elf32-rx.c:1157
+msgid "Warning: RX_SYM reloc with an unknown symbol"
+msgstr ""
+
+#: elf32-s390.c:2292 elf64-s390.c:2244
msgid "%B(%A+0x%lx): invalid instruction for TLS relocation %s"
msgstr ""
-#: elf32-score.c:1520 elf32-score7.c:1379 elfxx-mips.c:3435
+#: elf32-score.c:1520 elf32-score7.c:1379 elfxx-mips.c:3642
msgid "not enough GOT space for local GOT entries"
msgstr ""
@@ -2128,21 +2397,21 @@ msgstr ""
msgid "%s: Malformed reloc detected for section %s"
msgstr ""
-#: elf32-score.c:2878 elf32-score7.c:2682
+#: elf32-score.c:2882 elf32-score7.c:2686
msgid "%B: CALL15 reloc at 0x%lx not against global symbol"
msgstr ""
-#: elf32-score.c:3997 elf32-score7.c:3803
+#: elf32-score.c:4007 elf32-score7.c:3811
#, c-format
msgid " [pic]"
msgstr ""
-#: elf32-score.c:4001 elf32-score7.c:3807
+#: elf32-score.c:4011 elf32-score7.c:3815
#, c-format
msgid " [fix dep]"
msgstr ""
-#: elf32-score.c:4043 elf32-score7.c:3849
+#: elf32-score.c:4053 elf32-score7.c:3857
msgid "%B: warning: linking PIC files with non-PIC files"
msgstr ""
@@ -2154,139 +2423,139 @@ msgstr ""
msgid "%B: Unrecognised .directive command: %s"
msgstr ""
-#: elf32-sh-symbian.c:504
+#: elf32-sh-symbian.c:500
msgid "%B: Failed to add renamed symbol %s"
msgstr ""
-#: elf32-sh.c:568
+#: elf32-sh.c:569
msgid "%B: 0x%lx: warning: bad R_SH_USES offset"
msgstr ""
-#: elf32-sh.c:580
+#: elf32-sh.c:581
msgid "%B: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x"
msgstr ""
-#: elf32-sh.c:597
+#: elf32-sh.c:598
msgid "%B: 0x%lx: warning: bad R_SH_USES load offset"
msgstr ""
-#: elf32-sh.c:612
+#: elf32-sh.c:613
msgid "%B: 0x%lx: warning: could not find expected reloc"
msgstr ""
-#: elf32-sh.c:640
+#: elf32-sh.c:641
msgid "%B: 0x%lx: warning: symbol in unexpected section"
msgstr ""
-#: elf32-sh.c:766
+#: elf32-sh.c:767
msgid "%B: 0x%lx: warning: could not find expected COUNT reloc"
msgstr ""
-#: elf32-sh.c:775
+#: elf32-sh.c:776
msgid "%B: 0x%lx: warning: bad count"
msgstr ""
-#: elf32-sh.c:1179 elf32-sh.c:1549
+#: elf32-sh.c:1180 elf32-sh.c:1550
msgid "%B: 0x%lx: fatal: reloc overflow while relaxing"
msgstr ""
-#: elf32-sh.c:4048 elf64-sh64.c:1514
+#: elf32-sh.c:3939 elf64-sh64.c:1514
msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled"
msgstr ""
-#: elf32-sh.c:4299
+#: elf32-sh.c:4190
msgid "%B: 0x%lx: fatal: unaligned branch target for relax-support relocation"
msgstr ""
-#: elf32-sh.c:4332 elf32-sh.c:4347
+#: elf32-sh.c:4223 elf32-sh.c:4238
msgid "%B: 0x%lx: fatal: unaligned %s relocation 0x%lx"
msgstr ""
-#: elf32-sh.c:4361
+#: elf32-sh.c:4252
msgid "%B: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32"
msgstr ""
-#: elf32-sh.c:4375
+#: elf32-sh.c:4266
msgid "%B: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32"
msgstr ""
-#: elf32-sh.c:4519 elf32-sh.c:4989
+#: elf32-sh.c:4410 elf32-sh.c:4886
msgid "%B(%A+0x%lx): cannot emit fixup to `%s' in read-only section"
msgstr ""
-#: elf32-sh.c:5096
+#: elf32-sh.c:4993
msgid "%B(%A+0x%lx): %s relocation against external symbol \"%s\""
msgstr ""
-#: elf32-sh.c:5569
+#: elf32-sh.c:5466
#, c-format
msgid "%X%C: relocation to \"%s\" references a different segment\n"
msgstr ""
-#: elf32-sh.c:5575
+#: elf32-sh.c:5472
#, c-format
msgid "%C: warning: relocation to \"%s\" references a different segment\n"
msgstr ""
-#: elf32-sh.c:6353 elf32-sh.c:6436
+#: elf32-sh.c:6254 elf32-sh.c:6337
msgid "%B: `%s' accessed both as normal and FDPIC symbol"
msgstr ""
-#: elf32-sh.c:6358 elf32-sh.c:6440
+#: elf32-sh.c:6259 elf32-sh.c:6341
msgid "%B: `%s' accessed both as FDPIC and thread local symbol"
msgstr ""
-#: elf32-sh.c:6388
+#: elf32-sh.c:6289
msgid "%B: Function descriptor relocation with non-zero addend"
msgstr ""
-#: elf32-sh.c:6624 elf64-alpha.c:4652
+#: elf32-sh.c:6525 elf64-alpha.c:4661
msgid "%B: TLS local exec code cannot be linked into shared objects"
msgstr ""
-#: elf32-sh64.c:223 elf64-sh64.c:2318
+#: elf32-sh64.c:224 elf64-sh64.c:2318
#, c-format
msgid "%s: compiled as 32-bit object and %s is 64-bit"
msgstr ""
-#: elf32-sh64.c:226 elf64-sh64.c:2321
+#: elf32-sh64.c:227 elf64-sh64.c:2321
#, c-format
msgid "%s: compiled as 64-bit object and %s is 32-bit"
msgstr ""
-#: elf32-sh64.c:228 elf64-sh64.c:2323
+#: elf32-sh64.c:229 elf64-sh64.c:2323
#, c-format
msgid "%s: object size does not match that of target %s"
msgstr ""
-#: elf32-sh64.c:451 elf64-sh64.c:2837
+#: elf32-sh64.c:452 elf64-sh64.c:2839
#, c-format
msgid "%s: encountered datalabel symbol in input"
msgstr ""
-#: elf32-sh64.c:528
+#: elf32-sh64.c:529
msgid "PTB mismatch: a SHmedia address (bit 0 == 1)"
msgstr ""
-#: elf32-sh64.c:531
+#: elf32-sh64.c:532
msgid "PTA mismatch: a SHcompact address (bit 0 == 0)"
msgstr ""
-#: elf32-sh64.c:549
+#: elf32-sh64.c:550
#, c-format
msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16"
msgstr ""
-#: elf32-sh64.c:598
+#: elf32-sh64.c:599
msgid "%B: error: unaligned relocation type %d at %08x reloc %p\n"
msgstr ""
-#: elf32-sh64.c:674
+#: elf32-sh64.c:675
#, c-format
msgid "%s: could not write out added .cranges entries"
msgstr ""
-#: elf32-sh64.c:734
+#: elf32-sh64.c:735
#, c-format
msgid "%s: could not write out sorted .cranges entries"
msgstr ""
@@ -2299,266 +2568,286 @@ msgstr ""
msgid "%B: linking little endian files with big endian files"
msgstr ""
-#: elf32-spu.c:719
+#: elf32-spu.c:716
msgid "%X%P: overlay section %A does not start on a cache line.\n"
msgstr ""
-#: elf32-spu.c:727
+#: elf32-spu.c:724
msgid "%X%P: overlay section %A is larger than a cache line.\n"
msgstr ""
-#: elf32-spu.c:747
+#: elf32-spu.c:744
msgid "%X%P: overlay section %A is not in cache area.\n"
msgstr ""
-#: elf32-spu.c:787
+#: elf32-spu.c:784
msgid "%X%P: overlay sections %A and %A do not start at the same address.\n"
msgstr ""
-#: elf32-spu.c:1011
+#: elf32-spu.c:1008
msgid "warning: call to non-function symbol %s defined in %B"
msgstr ""
-#: elf32-spu.c:1361
+#: elf32-spu.c:1358
msgid "%A:0x%v lrlive .brinfo (%u) differs from analysis (%u)\n"
msgstr ""
-#: elf32-spu.c:1880
+#: elf32-spu.c:1877
msgid "%B is not allowed to define %s"
msgstr ""
-#: elf32-spu.c:1888
+#: elf32-spu.c:1885
#, c-format
msgid "you are not allowed to define %s in a script"
msgstr ""
-#: elf32-spu.c:1922
+#: elf32-spu.c:1919
#, c-format
msgid "%s in overlay section"
msgstr ""
-#: elf32-spu.c:1951
+#: elf32-spu.c:1948
msgid "overlay stub relocation overflow"
msgstr ""
-#: elf32-spu.c:1960
+#: elf32-spu.c:1957
msgid "stubs don't match calculated size"
msgstr ""
-#: elf32-spu.c:2542
+#: elf32-spu.c:2539
#, c-format
msgid "warning: %s overlaps %s\n"
msgstr ""
-#: elf32-spu.c:2558
+#: elf32-spu.c:2555
#, c-format
msgid "warning: %s exceeds section size\n"
msgstr ""
-#: elf32-spu.c:2589
+#: elf32-spu.c:2586
msgid "%A:0x%v not found in function table\n"
msgstr ""
-#: elf32-spu.c:2729
+#: elf32-spu.c:2726
msgid "%B(%A+0x%v): call to non-code section %B(%A), analysis incomplete\n"
msgstr ""
-#: elf32-spu.c:3297
+#: elf32-spu.c:3294
#, c-format
msgid "Stack analysis will ignore the call from %s to %s\n"
msgstr ""
-#: elf32-spu.c:3988
+#: elf32-spu.c:3985
msgid " %s: 0x%v\n"
msgstr ""
-#: elf32-spu.c:3989
+#: elf32-spu.c:3986
msgid "%s: 0x%v 0x%v\n"
msgstr ""
-#: elf32-spu.c:3994
+#: elf32-spu.c:3991
msgid " calls:\n"
msgstr ""
-#: elf32-spu.c:4002
+#: elf32-spu.c:3999
#, c-format
msgid " %s%s %s\n"
msgstr ""
-#: elf32-spu.c:4307
+#: elf32-spu.c:4304
#, c-format
msgid "%s duplicated in %s\n"
msgstr ""
-#: elf32-spu.c:4311
+#: elf32-spu.c:4308
#, c-format
msgid "%s duplicated\n"
msgstr ""
-#: elf32-spu.c:4318
+#: elf32-spu.c:4315
msgid "sorry, no support for duplicate object files in auto-overlay script\n"
msgstr ""
-#: elf32-spu.c:4359
+#: elf32-spu.c:4356
msgid ""
"non-overlay size of 0x%v plus maximum overlay size of 0x%v exceeds local "
"store\n"
msgstr ""
-#: elf32-spu.c:4514
+#: elf32-spu.c:4511
msgid "%B:%A%s exceeds overlay size\n"
msgstr ""
-#: elf32-spu.c:4676
+#: elf32-spu.c:4673
msgid "Stack size for call graph root nodes.\n"
msgstr ""
-#: elf32-spu.c:4677
+#: elf32-spu.c:4674
msgid ""
"\n"
"Stack size for functions. Annotations: '*' max stack, 't' tail call\n"
msgstr ""
-#: elf32-spu.c:4687
+#: elf32-spu.c:4684
msgid "Maximum stack required is 0x%v\n"
msgstr ""
-#: elf32-spu.c:4778
+#: elf32-spu.c:4775
msgid "fatal error while creating .fixup"
msgstr ""
-#: elf32-spu.c:5008
+#: elf32-spu.c:5005
msgid "%B(%s+0x%lx): unresolvable %s relocation against symbol `%s'"
msgstr ""
-#: elf32-tic6x.c:1602
+#: elf32-tic6x.c:1600
msgid "warning: generating a shared library containing non-PIC code"
msgstr ""
-#: elf32-tic6x.c:1607
+#: elf32-tic6x.c:1605
msgid "warning: generating a shared library containing non-PID code"
msgstr ""
-#: elf32-tic6x.c:2541
+#: elf32-tic6x.c:2524
msgid "%B: SB-relative relocation but __c6xabi_DSBT_BASE not defined"
msgstr ""
-#: elf32-tic6x.c:2761
-msgid "dangerous relocation"
-msgstr ""
-
-#: elf32-tic6x.c:3733
+#: elf32-tic6x.c:3648
msgid "%B: error: unknown mandatory EABI object attribute %d"
msgstr ""
-#: elf32-tic6x.c:3741
+#: elf32-tic6x.c:3656
msgid "%B: warning: unknown EABI object attribute %d"
msgstr ""
-#: elf32-tic6x.c:3853 elf32-tic6x.c:3861
+#: elf32-tic6x.c:3768 elf32-tic6x.c:3776
msgid "error: %B requires more stack alignment than %B preserves"
msgstr ""
-#: elf32-tic6x.c:3871 elf32-tic6x.c:3880
+#: elf32-tic6x.c:3786 elf32-tic6x.c:3795
msgid "error: unknown Tag_ABI_array_object_alignment value in %B"
msgstr ""
-#: elf32-tic6x.c:3889 elf32-tic6x.c:3898
+#: elf32-tic6x.c:3804 elf32-tic6x.c:3813
msgid "error: unknown Tag_ABI_array_object_align_expected value in %B"
msgstr ""
-#: elf32-tic6x.c:3906 elf32-tic6x.c:3913
+#: elf32-tic6x.c:3821 elf32-tic6x.c:3828
msgid "error: %B requires more array alignment than %B preserves"
msgstr ""
-#: elf32-tic6x.c:3935
+#: elf32-tic6x.c:3850
msgid "warning: %B and %B differ in wchar_t size"
msgstr ""
-#: elf32-tic6x.c:3953
+#: elf32-tic6x.c:3868
msgid "warning: %B and %B differ in whether code is compiled for DSBT"
msgstr ""
-#: elf32-v850.c:173
+#: elf32-v850.c:157
#, c-format
msgid "Variable `%s' cannot occupy in multiple small data regions"
msgstr ""
-#: elf32-v850.c:176
+#: elf32-v850.c:160
#, c-format
msgid ""
"Variable `%s' can only be in one of the small, zero, and tiny data regions"
msgstr ""
-#: elf32-v850.c:179
+#: elf32-v850.c:163
#, c-format
msgid ""
"Variable `%s' cannot be in both small and zero data regions simultaneously"
msgstr ""
-#: elf32-v850.c:182
+#: elf32-v850.c:166
#, c-format
msgid ""
"Variable `%s' cannot be in both small and tiny data regions simultaneously"
msgstr ""
-#: elf32-v850.c:185
+#: elf32-v850.c:169
#, c-format
msgid ""
"Variable `%s' cannot be in both zero and tiny data regions simultaneously"
msgstr ""
-#: elf32-v850.c:483
+#: elf32-v850.c:467
msgid "FAILED to find previous HI16 reloc"
msgstr ""
-#: elf32-v850.c:2155
+#: elf32-v850.c:2293
msgid "could not locate special linker symbol __gp"
msgstr ""
-#: elf32-v850.c:2159
+#: elf32-v850.c:2297
msgid "could not locate special linker symbol __ep"
msgstr ""
-#: elf32-v850.c:2163
+#: elf32-v850.c:2301
msgid "could not locate special linker symbol __ctbp"
msgstr ""
-#: elf32-v850.c:2341
+#: elf32-v850.c:2471 elf32-v850.c:2534
msgid "%B: Architecture mismatch with previous modules"
msgstr ""
+#: elf32-v850.c:2478
+msgid "%B: Alignment mismatch with previous modules"
+msgstr ""
+
#. xgettext:c-format.
-#: elf32-v850.c:2360
+#: elf32-v850.c:2553
#, c-format
msgid "private flags = %lx: "
msgstr ""
-#: elf32-v850.c:2365
+#: elf32-v850.c:2558
+#, c-format
+msgid "unknown v850 architecture"
+msgstr ""
+
+#: elf32-v850.c:2560
+#, c-format
+msgid "v850 E3 architecture"
+msgstr ""
+
+#: elf32-v850.c:2562 elf32-v850.c:2572
#, c-format
msgid "v850 architecture"
msgstr ""
-#: elf32-v850.c:2366
+#: elf32-v850.c:2565
+#, c-format
+msgid ", 8-byte data alignment"
+msgstr ""
+
+#: elf32-v850.c:2573
#, c-format
msgid "v850e architecture"
msgstr ""
-#: elf32-v850.c:2367
+#: elf32-v850.c:2574
#, c-format
msgid "v850e1 architecture"
msgstr ""
-#: elf32-v850.c:2368
+#: elf32-v850.c:2575
#, c-format
msgid "v850e2 architecture"
msgstr ""
-#: elf32-v850.c:2369
+#: elf32-v850.c:2576
#, c-format
msgid "v850e2v3 architecture"
msgstr ""
+#: elf32-v850.c:2577
+#, c-format
+msgid "v850e3v5 architecture"
+msgstr ""
+
#: elf32-vax.c:532
#, c-format
msgid " [nonpic]"
@@ -2574,151 +2863,256 @@ msgstr ""
msgid " [g-float]"
msgstr ""
-#: elf32-vax.c:655
+#: elf32-vax.c:656
#, c-format
msgid ""
"%s: warning: GOT addend of %ld to `%s' does not match previous GOT addend of "
"%ld"
msgstr ""
-#: elf32-vax.c:1585
+#: elf32-vax.c:1543
#, c-format
msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored"
msgstr ""
-#: elf32-vax.c:1712
+#: elf32-vax.c:1668
#, c-format
msgid "%s: warning: %s relocation against symbol `%s' from %s section"
msgstr ""
-#: elf32-vax.c:1718
+#: elf32-vax.c:1674
#, c-format
msgid "%s: warning: %s relocation to 0x%x from %s section"
msgstr ""
-#: elf32-xstormy16.c:451 elf32-ia64.c:2336 elf64-ia64.c:2336
+#: elf32-xgate.c:686
+#, c-format
+msgid "cpu=XGATE]"
+msgstr ""
+
+#: elf32-xgate.c:688
+#, c-format
+msgid "error reading cpu type from elf private data"
+msgstr ""
+
+#: elf32-xstormy16.c:455 elf64-ia64-vms.c:2072 elf32-ia64.c:2330
+#: elf64-ia64.c:2330
msgid "non-zero addend in @fptr reloc"
msgstr ""
-#: elf32-xtensa.c:918
+#: elf32-xtensa.c:908
msgid "%B(%A): invalid property table"
msgstr ""
-#: elf32-xtensa.c:2777
+#: elf32-xtensa.c:2774
msgid "%B(%A+0x%lx): relocation offset out of range (size=0x%x)"
msgstr ""
-#: elf32-xtensa.c:2856 elf32-xtensa.c:2977
+#: elf32-xtensa.c:2853 elf32-xtensa.c:2974
msgid "dynamic relocation in read-only section"
msgstr ""
-#: elf32-xtensa.c:2953
+#: elf32-xtensa.c:2950
msgid "TLS relocation invalid without dynamic sections"
msgstr ""
-#: elf32-xtensa.c:3172
+#: elf32-xtensa.c:3169
msgid "internal inconsistency in size of .got.loc section"
msgstr ""
-#: elf32-xtensa.c:3485
+#: elf32-xtensa.c:3482
msgid "%B: incompatible machine type. Output is 0x%x. Input is 0x%x"
msgstr ""
-#: elf32-xtensa.c:4714 elf32-xtensa.c:4722
+#: elf32-xtensa.c:4713 elf32-xtensa.c:4721
msgid "Attempt to convert L32R/CALLX to CALL failed"
msgstr ""
-#: elf32-xtensa.c:6332 elf32-xtensa.c:6408 elf32-xtensa.c:7524
+#: elf32-xtensa.c:6330 elf32-xtensa.c:6406 elf32-xtensa.c:7522
msgid ""
"%B(%A+0x%lx): could not decode instruction; possible configuration mismatch"
msgstr ""
-#: elf32-xtensa.c:7264
+#: elf32-xtensa.c:7262
msgid ""
"%B(%A+0x%lx): could not decode instruction for XTENSA_ASM_SIMPLIFY "
"relocation; possible configuration mismatch"
msgstr ""
-#: elf32-xtensa.c:9023
+#: elf32-xtensa.c:9022
msgid "invalid relocation address"
msgstr ""
-#: elf32-xtensa.c:9072
+#: elf32-xtensa.c:9071
msgid "overflow after relaxation"
msgstr ""
-#: elf32-xtensa.c:10204
+#: elf32-xtensa.c:10203
msgid "%B(%A+0x%lx): unexpected fix for %s relocation"
msgstr ""
-#: elf64-alpha.c:460
+#: elf64-alpha.c:474
msgid "GPDISP relocation did not find ldah and lda instructions"
msgstr ""
-#: elf64-alpha.c:2497
+#: elf64-alpha.c:2503
msgid "%B: .got subsegment exceeds 64K (size %d)"
msgstr ""
-#: elf64-alpha.c:4387 elf64-alpha.c:4399
+#: elf64-alpha.c:4396 elf64-alpha.c:4408
msgid "%B: gp-relative relocation against dynamic symbol %s"
msgstr ""
-#: elf64-alpha.c:4425 elf64-alpha.c:4565
+#: elf64-alpha.c:4434 elf64-alpha.c:4574
msgid "%B: pc-relative relocation against dynamic symbol %s"
msgstr ""
-#: elf64-alpha.c:4453
+#: elf64-alpha.c:4462
msgid "%B: change in gp: BRSGP %s"
msgstr ""
-#: elf64-alpha.c:4478
+#: elf64-alpha.c:4487
msgid "<unknown>"
msgstr ""
-#: elf64-alpha.c:4483
+#: elf64-alpha.c:4492
msgid "%B: !samegp reloc against symbol without .prologue: %s"
msgstr ""
-#: elf64-alpha.c:4540
+#: elf64-alpha.c:4549
msgid "%B: unhandled dynamic relocation against %s"
msgstr ""
-#: elf64-alpha.c:4572
+#: elf64-alpha.c:4581
msgid "%B: pc-relative relocation against undefined weak symbol %s"
msgstr ""
-#: elf64-alpha.c:4636
+#: elf64-alpha.c:4645
msgid "%B: dtp-relative relocation against dynamic symbol %s"
msgstr ""
-#: elf64-alpha.c:4659
+#: elf64-alpha.c:4668
msgid "%B: tp-relative relocation against dynamic symbol %s"
msgstr ""
-#: elf64-hppa.c:2083
+#: elf64-hppa.c:2084
#, c-format
msgid "stub entry for %s cannot load .plt, dp offset = %ld"
msgstr ""
-#: elf64-hppa.c:3275
-msgid "%B(%A+0x"
+#: elf64-hppa.c:3280
+msgid "%B(%A+0x%"
+msgstr ""
+
+#: elf64-ia64-vms.c:587 elf32-ia64.c:619 elf64-ia64.c:619
+msgid ""
+"%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect "
+"branch."
+msgstr ""
+
+#: elf64-ia64-vms.c:2027 elf32-ia64.c:2278 elf64-ia64.c:2278
+msgid "@pltoff reloc against local symbol"
+msgstr ""
+
+#: elf64-ia64-vms.c:3279 elf32-ia64.c:3684 elf64-ia64.c:3684
+#, c-format
+msgid "%s: short data segment overflowed (0x%lx >= 0x400000)"
+msgstr ""
+
+#: elf64-ia64-vms.c:3290 elf32-ia64.c:3695 elf64-ia64.c:3695
+#, c-format
+msgid "%s: __gp does not cover short data segment"
+msgstr ""
+
+#: elf64-ia64-vms.c:3555 elf32-ia64.c:3962 elf64-ia64.c:3962
+msgid "%B: non-pic code with imm relocation against dynamic symbol `%s'"
+msgstr ""
+
+#: elf64-ia64-vms.c:3617 elf32-ia64.c:4029 elf64-ia64.c:4029
+msgid "%B: @gprel relocation against dynamic symbol %s"
+msgstr ""
+
+#: elf64-ia64-vms.c:3676 elf32-ia64.c:4092 elf64-ia64.c:4092
+msgid "%B: linking non-pic code in a position independent executable"
+msgstr ""
+
+#: elf64-ia64-vms.c:3777 elf32-ia64.c:4229 elf64-ia64.c:4229
+msgid "%B: @internal branch to dynamic symbol %s"
+msgstr ""
+
+#: elf64-ia64-vms.c:3779 elf32-ia64.c:4231 elf64-ia64.c:4231
+msgid "%B: speculation fixup to dynamic symbol %s"
+msgstr ""
+
+#: elf64-ia64-vms.c:3781 elf32-ia64.c:4233 elf64-ia64.c:4233
+msgid "%B: @pcrel relocation against dynamic symbol %s"
+msgstr ""
+
+#: elf64-ia64-vms.c:3905 elf32-ia64.c:4430 elf64-ia64.c:4430
+msgid "unsupported reloc"
msgstr ""
-#: elf64-mmix.c:1034
+#: elf64-ia64-vms.c:3942 elf32-ia64.c:4468 elf64-ia64.c:4468
+msgid ""
+"%B: missing TLS section for relocation %s against `%s' at 0x%lx in section `"
+"%A'."
+msgstr ""
+
+#: elf64-ia64-vms.c:3957 elf32-ia64.c:4483 elf64-ia64.c:4483
+msgid ""
+"%B: Can't relax br (%s) to `%s' at 0x%lx in section `%A' with size 0x%lx (> "
+"0x1000000)."
+msgstr ""
+
+#: elf64-ia64-vms.c:4246 elf32-ia64.c:4745 elf64-ia64.c:4745
+msgid "%B: linking trap-on-NULL-dereference with non-trapping files"
+msgstr ""
+
+#: elf64-ia64-vms.c:4255 elf32-ia64.c:4754 elf64-ia64.c:4754
+msgid "%B: linking big-endian files with little-endian files"
+msgstr ""
+
+#: elf64-ia64-vms.c:4264 elf32-ia64.c:4763 elf64-ia64.c:4763
+msgid "%B: linking 64-bit files with 32-bit files"
+msgstr ""
+
+#: elf64-ia64-vms.c:4273 elf32-ia64.c:4772 elf64-ia64.c:4772
+msgid "%B: linking constant-gp files with non-constant-gp files"
+msgstr ""
+
+#: elf64-ia64-vms.c:4283 elf32-ia64.c:4782 elf64-ia64.c:4782
+msgid "%B: linking auto-pic files with non-auto-pic files"
+msgstr ""
+
+#: elf64-ia64-vms.c:5125 elflink.c:4299
+msgid ""
+"Warning: alignment %u of common symbol `%s' in %B is greater than the "
+"alignment (%u) of its section %A"
+msgstr ""
+
+#: elf64-ia64-vms.c:5131 elflink.c:4305
+msgid "Warning: alignment %u of symbol `%s' in %B is smaller than %u in %B"
+msgstr ""
+
+#: elf64-ia64-vms.c:5146 elflink.c:4321
+msgid "Warning: size of symbol `%s' changed from %lu in %B to %lu in %B"
+msgstr ""
+
+#: elf64-mmix.c:986
msgid ""
"invalid input relocation when producing non-ELF, non-mmo format output.\n"
" Please use the objcopy program to convert from ELF or mmo,\n"
" or assemble using \"-no-expand\" (for gcc, \"-Wa,-no-expand\""
msgstr ""
-#: elf64-mmix.c:1218
+#: elf64-mmix.c:1170
msgid ""
"invalid input relocation when producing non-ELF, non-mmo format output.\n"
" Please use the objcopy program to convert from ELF or mmo,\n"
" or compile using the gcc-option \"-mno-base-addresses\"."
msgstr ""
-#: elf64-mmix.c:1244
+#: elf64-mmix.c:1196
#, c-format
msgid ""
"%s: Internal inconsistency error for value for\n"
@@ -2726,133 +3120,158 @@ msgid ""
"%08lx\n"
msgstr ""
-#: elf64-mmix.c:1670
+#: elf64-mmix.c:1618
#, c-format
msgid ""
"%s: base-plus-offset relocation against register symbol: (unknown) in %s"
msgstr ""
-#: elf64-mmix.c:1675
+#: elf64-mmix.c:1623
#, c-format
msgid "%s: base-plus-offset relocation against register symbol: %s in %s"
msgstr ""
-#: elf64-mmix.c:1719
+#: elf64-mmix.c:1667
#, c-format
msgid "%s: register relocation against non-register symbol: (unknown) in %s"
msgstr ""
-#: elf64-mmix.c:1724
+#: elf64-mmix.c:1672
#, c-format
msgid "%s: register relocation against non-register symbol: %s in %s"
msgstr ""
-#: elf64-mmix.c:1761
+#: elf64-mmix.c:1709
#, c-format
msgid "%s: directive LOCAL valid only with a register or absolute value"
msgstr ""
-#: elf64-mmix.c:1789
+#: elf64-mmix.c:1739
#, c-format
msgid ""
"%s: LOCAL directive: Register $%ld is not a local register. First global "
"register is $%ld."
msgstr ""
-#: elf64-mmix.c:2253
+#: elf64-mmix.c:2198
#, c-format
msgid ""
"%s: Error: multiple definition of `%s'; start of %s is set in a earlier "
"linked file\n"
msgstr ""
-#: elf64-mmix.c:2311
+#: elf64-mmix.c:2252
msgid "Register section has contents\n"
msgstr ""
-#: elf64-mmix.c:2503
+#: elf64-mmix.c:2441
#, c-format
msgid ""
"Internal inconsistency: remaining %u != max %u.\n"
" Please report this bug."
msgstr ""
-#: elf64-ppc.c:4185
+#: elf64-ppc.c:4463
msgid "%P: %B: cannot create stub entry %s\n"
msgstr ""
-#: elf64-ppc.c:6518
+#: elf64-ppc.c:4810
+msgid "%P: symbol '%s' has invalid st_other for ABI version 1\n"
+msgstr ""
+
+#: elf64-ppc.c:5170
+msgid "%P: .opd not allowed in ABI version %d\n"
+msgstr ""
+
+#: elf64-ppc.c:5809
+msgid "%B uses unknown e_flags 0x%lx"
+msgstr ""
+
+#: elf64-ppc.c:5816
+msgid "%B: ABI version %ld is not compatible with ABI version %ld output"
+msgstr ""
+
+#: elf64-ppc.c:5843
+#, c-format
+msgid " [abiv%ld]"
+msgstr ""
+
+#: elf64-ppc.c:7007
msgid ""
-"%P: copy reloc against `%s' requires lazy plt linking; avoid setting "
+"%P: copy reloc against `%T' requires lazy plt linking; avoid setting "
"LD_BIND_NOW=1 or upgrade gcc\n"
msgstr ""
-#: elf64-ppc.c:6788
+#: elf64-ppc.c:7270
msgid "%B: undefined symbol on R_PPC64_TOCSAVE relocation"
msgstr ""
-#: elf64-ppc.c:6992
+#: elf64-ppc.c:7499
msgid "%P: dynreloc miscount for %B, section %A\n"
msgstr ""
-#: elf64-ppc.c:7076
+#: elf64-ppc.c:7583
msgid "%B: .opd is not a regular array of opd entries"
msgstr ""
-#: elf64-ppc.c:7085
+#: elf64-ppc.c:7592
msgid "%B: unexpected reloc type %u in .opd section"
msgstr ""
-#: elf64-ppc.c:7106
+#: elf64-ppc.c:7613
msgid "%B: undefined sym `%s' in .opd section"
msgstr ""
-#: elf64-ppc.c:7664
+#: elf64-ppc.c:8177
msgid "%H __tls_get_addr lost arg, TLS optimization disabled\n"
msgstr ""
-#: elf64-ppc.c:8003 elf64-ppc.c:8564
+#: elf64-ppc.c:8516 elf64-ppc.c:9139
#, c-format
msgid "%s defined on removed toc entry"
msgstr ""
-#: elf64-ppc.c:8521
-msgid "%P: %H: %s relocation references optimized away TOC entry\n"
+#: elf64-ppc.c:8868
+msgid "%P: %H: toc optimization is not supported for %s instruction.\n"
+msgstr ""
+
+#: elf64-ppc.c:9096
+msgid "%P: %H: %s references optimized away TOC entry\n"
msgstr ""
-#: elf64-ppc.c:9598
-msgid "%P: cannot find opd entry toc for %s\n"
+#: elf64-ppc.c:10394
+msgid "%P: cannot find opd entry toc for `%T'\n"
msgstr ""
-#: elf64-ppc.c:9680
+#: elf64-ppc.c:10479
msgid "%P: long branch stub `%s' offset overflow\n"
msgstr ""
-#: elf64-ppc.c:9739
+#: elf64-ppc.c:10538
msgid "%P: can't find branch stub `%s'\n"
msgstr ""
-#: elf64-ppc.c:9801 elf64-ppc.c:9943
-msgid "%P: linkage table error against `%s'\n"
+#: elf64-ppc.c:10602 elf64-ppc.c:10749 elf64-ppc.c:12416
+msgid "%P: linkage table error against `%T'\n"
msgstr ""
-#: elf64-ppc.c:10126
+#: elf64-ppc.c:10940
msgid "%P: can't build branch stub `%s'\n"
msgstr ""
-#: elf64-ppc.c:10941
+#: elf64-ppc.c:11748
msgid "%B section %A exceeds stub group size"
msgstr ""
-#: elf64-ppc.c:11666 elf64-ppc.c:11699
+#: elf64-ppc.c:12662 elf64-ppc.c:12697
msgid "%P: %s offset too large for .eh_frame sdata4 encoding"
msgstr ""
-#: elf64-ppc.c:11744
+#: elf64-ppc.c:12758
msgid "%P: stubs don't match calculated size\n"
msgstr ""
-#: elf64-ppc.c:11756
+#: elf64-ppc.c:12770
#, c-format
msgid ""
"linker stubs in %u group%s\n"
@@ -2860,38 +3279,47 @@ msgid ""
" toc adjust %lu\n"
" long branch %lu\n"
" long toc adj %lu\n"
-" plt call %lu"
+" plt call %lu\n"
+" plt call toc %lu"
msgstr ""
-#: elf64-ppc.c:12042
-msgid "%P: %H: %s used with TLS symbol %s\n"
+#: elf64-ppc.c:13096
+msgid "%P: %H: %s used with TLS symbol `%T'\n"
msgstr ""
-#: elf64-ppc.c:12043
-msgid "%P: %H: %s used with non-TLS symbol %s\n"
+#: elf64-ppc.c:13097
+msgid "%P: %H: %s used with non-TLS symbol `%T'\n"
msgstr ""
-#: elf64-ppc.c:12556
+#: elf64-ppc.c:13675
msgid ""
-"%P: %H: automatic multiple TOCs not supported using your crt files; "
-"recompile with -mminimal-toc or upgrade gcc\n"
+"%P: %H: call to `%T' lacks nop, can't restore toc; recompile with -fPIC\n"
msgstr ""
-#: elf64-ppc.c:12562
-msgid ""
-"%P: %H: sibling call optimization to `%s' does not allow automatic multiple "
-"TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, or make `"
-"%s' extern\n"
+#: elf64-ppc.c:13793
+msgid "%P: %B: unknown relocation type %d for `%T'\n"
+msgstr ""
+
+#: elf64-ppc.c:14310
+msgid "%P: %H: %s for indirect function `%T' unsupported\n"
msgstr ""
-#: elf64-ppc.c:13286
-msgid "%P: %B: relocation %s is not supported for symbol %s\n"
+#: elf64-ppc.c:14417
+msgid "%P: %B: %s is not supported for `%T'\n"
msgstr ""
-#: elf64-ppc.c:13446
+#: elf64-ppc.c:14565
msgid "%P: %H: error: %s not a multiple of %u\n"
msgstr ""
+#: elf64-ppc.c:14586
+msgid "%P: %H: unresolvable %s against `%T'\n"
+msgstr ""
+
+#: elf64-ppc.c:14644
+msgid "%P: %H: %s against `%T': error %d\n"
+msgstr ""
+
#: elf64-sh64.c:1686
#, c-format
msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n"
@@ -2917,463 +3345,493 @@ msgstr ""
msgid "%B: linking UltraSPARC specific with HAL specific code"
msgstr ""
-#: elf64-x86-64.c:1427
+#: elf64-x86-64.c:1530
msgid "%B: relocation %s against symbol `%s' isn't supported in x32 mode"
msgstr ""
-#: elf64-x86-64.c:1656
+#: elf64-x86-64.c:1688
msgid "%B: '%s' accessed both as normal and thread local symbol"
msgstr ""
-#: elf64-x86-64.c:3150
+#: elf64-x86-64.c:3405 /src/binutils-gdb/bfd/elfnn-aarch64.c:3511
msgid ""
"%B: relocation %s against STT_GNU_IFUNC symbol `%s' has non-zero addend: %d"
msgstr ""
-#: elf64-x86-64.c:3411
+#: elf64-x86-64.c:3667
msgid ""
"%B: relocation R_X86_64_GOTOFF64 against protected function `%s' can not be "
"used when making a shared object"
msgstr ""
-#: elf64-x86-64.c:3523
+#: elf64-x86-64.c:3787
msgid "; recompile with -fPIC"
msgstr ""
-#: elf64-x86-64.c:3528
+#: elf64-x86-64.c:3792
msgid ""
"%B: relocation %s against %s `%s' can not be used when making a shared object"
"%s"
msgstr ""
-#: elf64-x86-64.c:3530
+#: elf64-x86-64.c:3794
msgid ""
"%B: relocation %s against undefined %s `%s' can not be used when making a "
"shared object%s"
msgstr ""
-#: elfcode.h:767
+#: elf64-x86-64.c:3900
+msgid ""
+"%B: addend -0x%x in relocation %s against symbol `%s' at 0x%lx in section `"
+"%A' is out of range"
+msgstr ""
+
+#: elf64-x86-64.c:3908
+msgid ""
+"%B: addend 0x%x in relocation %s against symbol `%s' at 0x%lx in section `"
+"%A' is out of range"
+msgstr ""
+
+#: elfcode.h:760
#, c-format
msgid "warning: %s has a corrupt string table index - ignoring"
msgstr ""
-#: elfcode.h:1177
+#: elfcode.h:1186
#, c-format
msgid "%s: version count (%ld) does not match symbol count (%ld)"
msgstr ""
-#: elfcode.h:1431
+#: elfcode.h:1440
#, c-format
msgid "%s(%s): relocation %d has invalid symbol index %ld"
msgstr ""
-#: elfcore.h:312
+#: elfcore.h:305
msgid "Warning: %B is truncated: expected core file size >= %lu, found: %lu."
msgstr ""
-#: elflink.c:1117
+#: elflink.c:1143
msgid ""
"%s: TLS definition in %B section %A mismatches non-TLS definition in %B "
"section %A"
msgstr ""
-#: elflink.c:1121
+#: elflink.c:1148
msgid "%s: TLS reference in %B mismatches non-TLS reference in %B"
msgstr ""
-#: elflink.c:1125
+#: elflink.c:1153
msgid "%s: TLS definition in %B section %A mismatches non-TLS reference in %B"
msgstr ""
-#: elflink.c:1129
+#: elflink.c:1158
msgid "%s: TLS reference in %B mismatches non-TLS definition in %B section %A"
msgstr ""
-#: elflink.c:1762
+#: elflink.c:1763
msgid "%B: unexpected redefinition of indirect versioned symbol `%s'"
msgstr ""
-#: elflink.c:2063
+#: elflink.c:2066
msgid "%B: version node not found for symbol %s"
msgstr ""
-#: elflink.c:2154
+#: elflink.c:2157
msgid ""
"%B: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%A'"
msgstr ""
-#: elflink.c:2165
+#: elflink.c:2168
msgid ""
"%B: non-zero symbol index (0x%lx) for offset 0x%lx in section `%A' when the "
"object file has no symbol table"
msgstr ""
-#: elflink.c:2355
+#: elflink.c:2358
msgid "%B: relocation size mismatch in %B section %A"
msgstr ""
-#: elflink.c:2639
+#: elflink.c:2640
#, c-format
msgid "warning: type and size of dynamic symbol `%s' are not defined"
msgstr ""
-#: elflink.c:3391
+#: elflink.c:3403
msgid "%P: alternate ELF machine code found (%d) in %B, expecting %d\n"
msgstr ""
-#: elflink.c:4037
+#: elflink.c:4032
msgid "%B: %s: invalid version %u (max %d)"
msgstr ""
-#: elflink.c:4073
+#: elflink.c:4068
msgid "%B: %s: invalid needed version %d"
msgstr ""
-#: elflink.c:4269
-msgid ""
-"Warning: alignment %u of common symbol `%s' in %B is greater than the "
-"alignment (%u) of its section %A"
-msgstr ""
-
-#: elflink.c:4275
-msgid "Warning: alignment %u of symbol `%s' in %B is smaller than %u in %B"
-msgstr ""
-
-#: elflink.c:4290
-msgid "Warning: size of symbol `%s' changed from %lu in %B to %lu in %B"
+#: elflink.c:4452
+msgid "%B: undefined reference to symbol '%s'"
msgstr ""
-#: elflink.c:4463
-msgid "%B: undefined reference to symbol '%s'"
+#: elflink.c:5523
+msgid "%B: stack size specified and %s set"
msgstr ""
-#: elflink.c:4466
-msgid ""
-"note: '%s' is defined in DSO %B so try adding it to the linker command line"
+#: elflink.c:5526
+msgid "%B: %s not absolute"
msgstr ""
-#: elflink.c:5781
+#: elflink.c:5824
#, c-format
msgid "%s: undefined version: %s"
msgstr ""
-#: elflink.c:5849
+#: elflink.c:5892
msgid "%B: .preinit_array section is not allowed in DSO"
msgstr ""
-#: elflink.c:7604
+#: elflink.c:7657
#, c-format
msgid "undefined %s reference in complex symbol: %s"
msgstr ""
-#: elflink.c:7758
+#: elflink.c:7811
#, c-format
msgid "unknown operator '%c' in complex symbol"
msgstr ""
-#: elflink.c:8097 elflink.c:8114 elflink.c:8151 elflink.c:8168
+#: elflink.c:8165 elflink.c:8182 elflink.c:8219 elflink.c:8236
msgid "%B: Unable to sort relocs - they are in more than one size"
msgstr ""
-#: elflink.c:8128 elflink.c:8182
+#: elflink.c:8196 elflink.c:8250
msgid "%B: Unable to sort relocs - they are of an unknown size"
msgstr ""
-#: elflink.c:8233
+#: elflink.c:8301
msgid "Not enough memory to sort relocations"
msgstr ""
-#: elflink.c:8426
+#: elflink.c:8494
msgid "%B: Too many sections: %d (>= %d)"
msgstr ""
-#: elflink.c:8675
+#: elflink.c:8775
msgid "%B: internal symbol `%s' in %B is referenced by DSO"
msgstr ""
-#: elflink.c:8677
+#: elflink.c:8777
msgid "%B: hidden symbol `%s' in %B is referenced by DSO"
msgstr ""
-#: elflink.c:8679
+#: elflink.c:8779
msgid "%B: local symbol `%s' in %B is referenced by DSO"
msgstr ""
-#: elflink.c:8776
+#: elflink.c:8890
msgid "%B: could not find output section %A for input section %A"
msgstr ""
-#: elflink.c:8899
+#: elflink.c:9013
msgid "%B: protected symbol `%s' isn't defined"
msgstr ""
-#: elflink.c:8901
+#: elflink.c:9015
msgid "%B: internal symbol `%s' isn't defined"
msgstr ""
-#: elflink.c:8903
+#: elflink.c:9017
msgid "%B: hidden symbol `%s' isn't defined"
msgstr ""
-#: elflink.c:9432
+#: elflink.c:9043
+msgid "%B: No symbol version section for versioned symbol `%s'"
+msgstr ""
+
+#: elflink.c:9598
msgid "error: %B: size of section %A is not multiple of address size"
msgstr ""
-#: elflink.c:9479
+#: elflink.c:9645
msgid ""
"error: %B contains a reloc (0x%s) for section %A that references a non-"
"existent global symbol"
msgstr ""
-#: elflink.c:10214
+#: elflink.c:10369
msgid "%A has both ordered [`%A' in %B] and unordered [`%A' in %B] sections"
msgstr ""
-#: elflink.c:10219
+#: elflink.c:10374
#, c-format
msgid "%A has both ordered and unordered sections"
msgstr ""
-#: elflink.c:10784
+#: elflink.c:10982
msgid "%B: file class %s incompatible with %s"
msgstr ""
-#: elflink.c:11093 elflink.c:11137
+#: elflink.c:11303 elflink.c:11347
msgid "%B: could not find output section %s"
msgstr ""
-#: elflink.c:11098
+#: elflink.c:11308
#, c-format
msgid "warning: %s section has zero size"
msgstr ""
-#: elflink.c:11143
+#: elflink.c:11353
#, c-format
msgid "warning: section '%s' is being made into a note"
msgstr ""
-#: elflink.c:11212
+#: elflink.c:11419
msgid "%P%X: read-only segment has dynamic relocations.\n"
msgstr ""
-#: elflink.c:11215
+#: elflink.c:11422
msgid "%P: warning: creating a DT_TEXTREL in a shared object.\n"
msgstr ""
-#: elflink.c:11402
+#: elflink.c:11545
msgid "%P%X: can not read symbols: %E\n"
msgstr ""
-#: elflink.c:11792
+#: elflink.c:11989
msgid "Removing unused section '%s' in file '%B'"
msgstr ""
-#: elflink.c:11998
+#: elflink.c:12200
msgid "Warning: gc-sections option ignored"
msgstr ""
-#: elflink.c:12277
+#: elflink.c:12489
#, c-format
msgid "Unrecognized INPUT_SECTION_FLAG %s\n"
msgstr ""
-#: elfxx-mips.c:1234
+#: elfxx-mips.c:1419
msgid "static procedure (no name)"
msgstr ""
-#: elfxx-mips.c:5259
+#: elfxx-mips.c:5476
msgid "MIPS16 and microMIPS functions cannot call each other"
msgstr ""
-#: elfxx-mips.c:5856
+#: elfxx-mips.c:6087
msgid ""
-"%B: %A+0x%lx: Direct jumps between ISA modes are not allowed; consider "
-"recompiling with interlinking enabled."
+"%B: %A+0x%lx: Unsupported jump between ISA modes; consider recompiling with "
+"interlinking enabled."
msgstr ""
-#: elfxx-mips.c:6519 elfxx-mips.c:6742
+#: elfxx-mips.c:6756 elfxx-mips.c:6979
msgid "%B: Warning: bad `%s' option size %u smaller than its header"
msgstr ""
-#: elfxx-mips.c:7495 elfxx-mips.c:7620
+#: elfxx-mips.c:7734 elfxx-mips.c:7859
msgid "%B: Warning: cannot determine the target function for stub section `%s'"
msgstr ""
-#: elfxx-mips.c:7749
+#: elfxx-mips.c:7990
msgid "%B: Malformed reloc detected for section %s"
msgstr ""
-#: elfxx-mips.c:7801
+#: elfxx-mips.c:8065
msgid "%B: GOT reloc at 0x%lx not expected in executables"
msgstr ""
-#: elfxx-mips.c:7930
+#: elfxx-mips.c:8199
msgid "%B: CALL16 reloc at 0x%lx not against global symbol"
msgstr ""
-#: elfxx-mips.c:8645
+#: elfxx-mips.c:8977
#, c-format
msgid "non-dynamic relocations refer to dynamic symbol %s"
msgstr ""
-#: elfxx-mips.c:9347
+#: elfxx-mips.c:9877
msgid ""
"%B: Can't find matching LO16 reloc against `%s' for %s at 0x%lx in section `"
"%A'"
msgstr ""
-#: elfxx-mips.c:9486
+#: elfxx-mips.c:10016
msgid ""
"small-data section exceeds 64KB; lower small-data size limit (see option -G)"
msgstr ""
-#: elfxx-mips.c:9505
+#: elfxx-mips.c:10035
msgid "JALX to a non-word-aligned address"
msgstr ""
-#: elfxx-mips.c:13266
+#: elfxx-mips.c:10402 elfxx-mips.c:10966
+msgid "%B: `%A' offset of %ld from `%A' beyond the range of ADDIUPC"
+msgstr ""
+
+#: elfxx-mips.c:13990
#, c-format
msgid "%s: illegal section name `%s'"
msgstr ""
-#: elfxx-mips.c:13645 elfxx-mips.c:13671
-msgid "Warning: %B uses -msingle-float, %B uses -mdouble-float"
+#: elfxx-mips.c:14375 elfxx-mips.c:14381 elfxx-mips.c:14387 elfxx-mips.c:14407
+#: elfxx-mips.c:14413 elfxx-mips.c:14419 elfxx-mips.c:14441 elfxx-mips.c:14460
+#: elfxx-mips.c:14467 elfxx-mips.c:14474
+msgid "Warning: %B uses %s (set by %B), %B uses %s"
+msgstr ""
+
+#: elfxx-mips.c:14394 elfxx-mips.c:14426 elfxx-mips.c:14447 elfxx-mips.c:14480
+msgid "Warning: %B uses %s (set by %B), %B uses unknown floating point ABI %d"
+msgstr ""
+
+#: elfxx-mips.c:14493 elfxx-mips.c:14501 elfxx-mips.c:14509 elfxx-mips.c:14517
+msgid "Warning: %B uses unknown floating point ABI %d (set by %B), %B uses %s"
+msgstr ""
+
+#: elfxx-mips.c:14525
+msgid ""
+"Warning: %B uses unknown floating point ABI %d (set by %B), %B uses unknown "
+"floating point ABI %d"
msgstr ""
-#: elfxx-mips.c:13657 elfxx-mips.c:13713
-msgid "Warning: %B uses -msingle-float, %B uses -mips32r2 -mfp64"
+#: elfxx-mips.c:14548
+msgid "Warning: %B uses %s (set by %B), %B uses unknown MSA ABI %d"
msgstr ""
-#: elfxx-mips.c:13683 elfxx-mips.c:13719
-msgid "Warning: %B uses -mdouble-float, %B uses -mips32r2 -mfp64"
+#: elfxx-mips.c:14559
+msgid "Warning: %B uses unknown MSA ABI %d (set by %B), %B uses %s"
msgstr ""
-#: elfxx-mips.c:13761
+#: elfxx-mips.c:14567
+msgid ""
+"Warning: %B uses unknown MSA ABI %d (set by %B), %B uses unknown MSA ABI %d"
+msgstr ""
+
+#: elfxx-mips.c:14599
msgid "%B: endianness incompatible with that of the selected emulation"
msgstr ""
-#: elfxx-mips.c:13772
+#: elfxx-mips.c:14610
msgid "%B: ABI is incompatible with that of the selected emulation"
msgstr ""
-#: elfxx-mips.c:13856
+#: elfxx-mips.c:14694
msgid "%B: warning: linking abicalls files with non-abicalls files"
msgstr ""
-#: elfxx-mips.c:13873
+#: elfxx-mips.c:14711
msgid "%B: linking 32-bit code with 64-bit code"
msgstr ""
-#: elfxx-mips.c:13901
+#: elfxx-mips.c:14739 elfxx-mips.c:14802
msgid "%B: linking %s module with previous %s modules"
msgstr ""
-#: elfxx-mips.c:13924
+#: elfxx-mips.c:14762
msgid "%B: ABI mismatch: linking %s module with previous %s modules"
msgstr ""
-#: elfxx-mips.c:13948
+#: elfxx-mips.c:14786
msgid "%B: ASE mismatch: linking %s module with previous %s modules"
msgstr ""
-#: elfxx-mips.c:14106
+#: elfxx-mips.c:14958
#, c-format
msgid " [abi=O32]"
msgstr ""
-#: elfxx-mips.c:14108
+#: elfxx-mips.c:14960
#, c-format
msgid " [abi=O64]"
msgstr ""
-#: elfxx-mips.c:14110
+#: elfxx-mips.c:14962
#, c-format
msgid " [abi=EABI32]"
msgstr ""
-#: elfxx-mips.c:14112
+#: elfxx-mips.c:14964
#, c-format
msgid " [abi=EABI64]"
msgstr ""
-#: elfxx-mips.c:14114
+#: elfxx-mips.c:14966
#, c-format
msgid " [abi unknown]"
msgstr ""
-#: elfxx-mips.c:14116
+#: elfxx-mips.c:14968
#, c-format
msgid " [abi=N32]"
msgstr ""
-#: elfxx-mips.c:14118
+#: elfxx-mips.c:14970
#, c-format
msgid " [abi=64]"
msgstr ""
-#: elfxx-mips.c:14120
+#: elfxx-mips.c:14972
#, c-format
msgid " [no abi set]"
msgstr ""
-#: elfxx-mips.c:14141
+#: elfxx-mips.c:14993
#, c-format
msgid " [unknown ISA]"
msgstr ""
-#: elfxx-mips.c:14155
+#: elfxx-mips.c:15013
#, c-format
msgid " [not 32bitmode]"
msgstr ""
-#: elfxx-sparc.c:596
+#: elfxx-sparc.c:640
#, c-format
msgid "invalid relocation type %d"
msgstr ""
-#: elfxx-tilegx.c:3952
+#: elfxx-tilegx.c:4433
msgid "%B: Cannot link together %s and %s objects."
msgstr ""
-#: i386linux.c:451 m68klinux.c:456 sparclinux.c:450
+#: i386linux.c:418 m68klinux.c:421 sparclinux.c:414
#, c-format
msgid "Output file requires shared library `%s'\n"
msgstr ""
-#: i386linux.c:459 m68klinux.c:464 sparclinux.c:458
+#: i386linux.c:426 m68klinux.c:429 sparclinux.c:422
#, c-format
msgid "Output file requires shared library `%s.so.%s'\n"
msgstr ""
-#: i386linux.c:648 i386linux.c:698 m68klinux.c:656 m68klinux.c:704
-#: sparclinux.c:648 sparclinux.c:698
+#: i386linux.c:613 i386linux.c:663 m68klinux.c:618 m68klinux.c:666
+#: sparclinux.c:609 sparclinux.c:659
#, c-format
msgid "Symbol %s not defined for fixups\n"
msgstr ""
-#: i386linux.c:722 m68klinux.c:728 sparclinux.c:722
+#: i386linux.c:687 m68klinux.c:690 sparclinux.c:683
msgid "Warning: fixup count mismatch\n"
msgstr ""
-#: ieee.c:159
+#: ieee.c:158
#, c-format
msgid "%s: string too long (%d chars, max 65535)"
msgstr ""
-#: ieee.c:286
+#: ieee.c:285
#, c-format
msgid "%s: unrecognized symbol `%s' flags 0x%x"
msgstr ""
-#: ieee.c:792
+#: ieee.c:791
msgid "%B: unimplemented ATI record %u for symbol %u"
msgstr ""
-#: ieee.c:816
+#: ieee.c:815
msgid "%B: unexpected ATN type %d in external part"
msgstr ""
-#: ieee.c:838
+#: ieee.c:837
msgid "%B: unexpected type after ATN"
msgstr ""
@@ -3440,304 +3898,246 @@ msgstr ""
msgid "Deprecated %s called\n"
msgstr ""
-#: linker.c:1872
+#: linker.c:1873
msgid "%B: indirect symbol `%s' to `%s' is a loop"
msgstr ""
-#: linker.c:2736
+#: linker.c:2750
#, c-format
msgid "Attempt to do relocatable link with %s input and %s output"
msgstr ""
-#: linker.c:3021
+#: linker.c:3035
msgid "%B: ignoring duplicate section `%A'\n"
msgstr ""
-#: linker.c:3030 linker.c:3039
+#: linker.c:3044 linker.c:3053
msgid "%B: duplicate section `%A' has different size\n"
msgstr ""
-#: linker.c:3047 linker.c:3052
+#: linker.c:3061 linker.c:3066
msgid "%B: could not read contents of section `%A'\n"
msgstr ""
-#: linker.c:3056
+#: linker.c:3070
msgid "%B: duplicate section `%A' has different contents\n"
msgstr ""
-#: mach-o.c:407
+#: mach-o.c:648
msgid "bfd_mach_o_canonicalize_symtab: unable to load symbols"
msgstr ""
-#: mach-o.c:1301
+#: mach-o.c:1918
+#, c-format
+msgid "mach-o: there are too many sections (%d) maximum is 255,\n"
+msgstr ""
+
+#: mach-o.c:2017
#, c-format
msgid "unable to write unknown load command 0x%lx"
msgstr ""
-#: mach-o.c:1789
+#: mach-o.c:2272
+msgid ""
+"sorry: modtab, toc and extrefsyms are not yet implemented for dysymtab "
+"commands."
+msgstr ""
+
+#: mach-o.c:2898
#, c-format
msgid "bfd_mach_o_read_symtab_symbol: unable to read %d bytes at %lu"
msgstr ""
-#: mach-o.c:1807
+#: mach-o.c:2916
#, c-format
msgid "bfd_mach_o_read_symtab_symbol: name out of range (%lu >= %lu)"
msgstr ""
-#: mach-o.c:1892
+#: mach-o.c:2997
#, c-format
msgid ""
"bfd_mach_o_read_symtab_symbol: symbol \"%s\" specified invalid section %d "
"(max %lu): setting to undefined"
msgstr ""
-#: mach-o.c:1900
-#, c-format
-msgid ""
-"bfd_mach_o_read_symtab_symbol: symbol \"%s\" is unsupported 'indirect' "
-"reference: setting to undefined"
-msgstr ""
-
-#: mach-o.c:1906
+#: mach-o.c:3013
#, c-format
msgid ""
"bfd_mach_o_read_symtab_symbol: symbol \"%s\" specified invalid type field 0x"
"%x: setting to undefined"
msgstr ""
-#: mach-o.c:1979
+#: mach-o.c:3085
msgid "bfd_mach_o_read_symtab_symbols: unable to allocate memory for symbols"
msgstr ""
-#: mach-o.c:2014
-#, c-format
-msgid "bfd_mach_o_read_dysymtab_symbol: unable to read %lu bytes at %lu"
+#: mach-o.c:3915
+msgid "%B: unknown load command 0x%lx"
msgstr ""
-#: mach-o.c:2734
-#, c-format
-msgid "unable to read unknown load command 0x%lx"
-msgstr ""
-
-#: mach-o.c:2915
+#: mach-o.c:4107
#, c-format
msgid "bfd_mach_o_scan: unknown architecture 0x%lx/0x%lx"
msgstr ""
-#: mach-o.c:3011
+#: mach-o.c:4204
#, c-format
msgid "unknown header byte-order value 0x%lx"
msgstr ""
-#: mach-o.c:3577
-msgid "Mach-O header:\n"
-msgstr ""
-
-#: mach-o.c:3578
-#, c-format
-msgid " magic : %08lx\n"
-msgstr ""
-
-#: mach-o.c:3579
-#, c-format
-msgid " cputype : %08lx (%s)\n"
-msgstr ""
-
-#: mach-o.c:3581
-#, c-format
-msgid " cpusubtype: %08lx\n"
-msgstr ""
-
-#: mach-o.c:3582
-#, c-format
-msgid " filetype : %08lx (%s)\n"
-msgstr ""
-
-#: mach-o.c:3585
-#, c-format
-msgid " ncmds : %08lx (%lu)\n"
-msgstr ""
-
-#: mach-o.c:3586
-#, c-format
-msgid " sizeofcmds: %08lx\n"
-msgstr ""
-
-#: mach-o.c:3587
-#, c-format
-msgid " flags : %08lx ("
-msgstr ""
-
-#: mach-o.c:3589 vms-alpha.c:7674
-msgid ")\n"
-msgstr ""
-
-#: mach-o.c:3590
-#, c-format
-msgid " reserved : %08x\n"
-msgstr ""
-
-#: mach-o.c:3600
-msgid "Segments and Sections:\n"
-msgstr ""
-
-#: mach-o.c:3601
-msgid " #: Segment name Section name Address\n"
-msgstr ""
-
#: merge.c:832
#, c-format
msgid "%s: access beyond end of merged section (%ld)"
msgstr ""
-#: mmo.c:456
+#: mmo.c:455
#, c-format
msgid "%s: No core to allocate section name %s\n"
msgstr ""
-#: mmo.c:531
+#: mmo.c:530
#, c-format
msgid "%s: No core to allocate a symbol %d bytes long\n"
msgstr ""
-#: mmo.c:1187
+#: mmo.c:1189
#, c-format
msgid "%s: invalid mmo file: initialization value for $255 is not `Main'\n"
msgstr ""
-#: mmo.c:1332
+#: mmo.c:1334
#, c-format
msgid ""
"%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name "
"starting with `%s'\n"
msgstr ""
-#: mmo.c:1565
+#: mmo.c:1568
#, c-format
msgid "%s: invalid mmo file: unsupported lopcode `%d'\n"
msgstr ""
-#: mmo.c:1575
+#: mmo.c:1578
#, c-format
msgid "%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n"
msgstr ""
-#: mmo.c:1611
+#: mmo.c:1614
#, c-format
msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n"
msgstr ""
-#: mmo.c:1657
+#: mmo.c:1660
#, c-format
msgid ""
"%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n"
msgstr ""
-#: mmo.c:1696
+#: mmo.c:1699
#, c-format
msgid "%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n"
msgstr ""
-#: mmo.c:1705
+#: mmo.c:1708
#, c-format
msgid ""
"%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n"
msgstr ""
-#: mmo.c:1728
+#: mmo.c:1731
#, c-format
msgid ""
"%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d "
"for lop_fixrx\n"
msgstr ""
-#: mmo.c:1751
+#: mmo.c:1754
#, c-format
msgid "%s: cannot allocate file name for file number %d, %d bytes\n"
msgstr ""
-#: mmo.c:1771
+#: mmo.c:1774
#, c-format
msgid ""
"%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n"
msgstr ""
-#: mmo.c:1784
+#: mmo.c:1787
#, c-format
msgid ""
"%s: invalid mmo file: file name for number %d was not specified before use\n"
msgstr ""
-#: mmo.c:1890
+#: mmo.c:1893
#, c-format
msgid ""
"%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n"
msgstr ""
-#: mmo.c:1926
+#: mmo.c:1929
#, c-format
msgid "%s: invalid mmo file: lop_end not last item in file\n"
msgstr ""
-#: mmo.c:1939
+#: mmo.c:1942
#, c-format
msgid ""
"%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras "
"to the preceding lop_stab (%ld)\n"
msgstr ""
-#: mmo.c:2649
+#: mmo.c:2652
#, c-format
msgid "%s: invalid symbol table: duplicate symbol `%s'\n"
msgstr ""
-#: mmo.c:2889
+#: mmo.c:2892
#, c-format
msgid ""
"%s: Bad symbol definition: `Main' set to %s rather than the start address "
"%s\n"
msgstr ""
-#: mmo.c:2981
+#: mmo.c:2984
#, c-format
msgid ""
"%s: warning: symbol table too large for mmo, larger than 65535 32-bit words: "
"%d. Only `Main' will be emitted.\n"
msgstr ""
-#: mmo.c:3026
+#: mmo.c:3029
#, c-format
msgid "%s: internal error, symbol table changed size from %d to %d words\n"
msgstr ""
-#: mmo.c:3078
+#: mmo.c:3081
#, c-format
msgid "%s: internal error, internal register section %s had contents\n"
msgstr ""
-#: mmo.c:3129
+#: mmo.c:3132
#, c-format
msgid "%s: no initialized registers; section length 0\n"
msgstr ""
-#: mmo.c:3135
+#: mmo.c:3138
#, c-format
msgid "%s: too many initialized registers; section length %ld\n"
msgstr ""
-#: mmo.c:3140
+#: mmo.c:3143
#, c-format
msgid ""
"%s: invalid start address for initialized registers of length %ld: 0x%lx"
"%08lx\n"
msgstr ""
-#: oasys.c:882
+#: oasys.c:881
#, c-format
msgid "%s: can not represent section `%s' in oasys"
msgstr ""
-#: osf-core.c:140
+#: osf-core.c:128
#, c-format
msgid "Unhandled OSF/1 core file section type %d\n"
msgstr ""
@@ -3762,113 +4162,117 @@ msgstr ""
msgid "%B: bad pair/reflo after refhi\n"
msgstr ""
-#: pef.c:520
+#: pef.c:522
#, c-format
msgid "bfd_pef_scan: unknown architecture 0x%lx"
msgstr ""
-#: pei-x86_64.c:444
+#: pei-x86_64.c:469
#, c-format
msgid "warning: .pdata section size (%ld) is not a multiple of %d\n"
msgstr ""
-#: pei-x86_64.c:448 peigen.c:1618 peigen.c:1801 pepigen.c:1618 pepigen.c:1801
-#: pex64igen.c:1618 pex64igen.c:1801
+#: pei-x86_64.c:474 peigen.c:1626 peigen.c:1809 pepigen.c:1626 pepigen.c:1809
+#: pex64igen.c:1626 pex64igen.c:1809
#, c-format
msgid ""
"\n"
"The Function Table (interpreted .pdata section contents)\n"
msgstr ""
-#: pei-x86_64.c:450
+#: pei-x86_64.c:476
#, c-format
msgid "vma:\t\t\tBeginAddress\t EndAddress\t UnwindData\n"
msgstr ""
#. XXX code yet to be written.
-#: peicode.h:751
+#: peicode.h:758
msgid "%B: Unhandled import type; %x"
msgstr ""
-#: peicode.h:756
+#: peicode.h:763
msgid "%B: Unrecognised import type; %x"
msgstr ""
-#: peicode.h:770
+#: peicode.h:777
msgid "%B: Unrecognised import name type; %x"
msgstr ""
-#: peicode.h:1166
+#: peicode.h:1173
msgid "%B: Unrecognised machine type (0x%x) in Import Library Format archive"
msgstr ""
-#: peicode.h:1178
+#: peicode.h:1185
msgid ""
"%B: Recognised but unhandled machine type (0x%x) in Import Library Format "
"archive"
msgstr ""
-#: peicode.h:1196
+#: peicode.h:1203
msgid "%B: size field is zero in Import Library Format header"
msgstr ""
-#: peicode.h:1227
+#: peicode.h:1234
msgid "%B: string not null terminated in ILF object file."
msgstr ""
-#: ppcboot.c:414
+#: ppcboot.c:391
#, c-format
msgid ""
"\n"
"ppcboot header:\n"
msgstr ""
-#: ppcboot.c:415
+#: ppcboot.c:392
#, c-format
msgid "Entry offset = 0x%.8lx (%ld)\n"
msgstr ""
-#: ppcboot.c:417
+#: ppcboot.c:394
#, c-format
msgid "Length = 0x%.8lx (%ld)\n"
msgstr ""
-#: ppcboot.c:421
+#: ppcboot.c:398
#, c-format
msgid "Flag field = 0x%.2x\n"
msgstr ""
-#: ppcboot.c:427
+#: ppcboot.c:404
#, c-format
msgid "Partition name = \"%s\"\n"
msgstr ""
-#: ppcboot.c:446
+#: ppcboot.c:423
#, c-format
msgid ""
"\n"
"Partition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
msgstr ""
-#: ppcboot.c:452
+#: ppcboot.c:429
#, c-format
msgid "Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
msgstr ""
-#: ppcboot.c:458
+#: ppcboot.c:435
#, c-format
msgid "Partition[%d] sector = 0x%.8lx (%ld)\n"
msgstr ""
-#: ppcboot.c:460
+#: ppcboot.c:437
#, c-format
msgid "Partition[%d] length = 0x%.8lx (%ld)\n"
msgstr ""
-#: reloc.c:6160
+#: reloc.c:7371
msgid "INPUT_SECTION_FLAGS are not supported.\n"
msgstr ""
+#: reloc.c:7526
+msgid "%X%P: %B(%A): relocation \"%R\" goes out of range\n"
+msgstr ""
+
#: rs6000-core.c:448
#, c-format
msgid "%s: warning core file truncated"
@@ -3901,32 +4305,32 @@ msgstr ""
msgid "Unsupported .stab relocation"
msgstr ""
-#: vms-alpha.c:1299
+#: vms-alpha.c:1294
#, c-format
msgid "Unknown EGSD subtype %d"
msgstr ""
-#: vms-alpha.c:1330
+#: vms-alpha.c:1325
#, c-format
msgid "Stack overflow (%d) in _bfd_vms_push"
msgstr ""
-#: vms-alpha.c:1343
+#: vms-alpha.c:1338
msgid "Stack underflow in _bfd_vms_pop"
msgstr ""
#. These names have not yet been added to this switch statement.
-#: vms-alpha.c:1580
+#: vms-alpha.c:1575
#, c-format
msgid "unknown ETIR command %d"
msgstr ""
-#: vms-alpha.c:1767
+#: vms-alpha.c:1762
#, c-format
msgid "bad section index in %s"
msgstr ""
-#: vms-alpha.c:1780
+#: vms-alpha.c:1775
#, c-format
msgid "unsupported STA cmd %s"
msgstr ""
@@ -3936,1859 +4340,1858 @@ msgstr ""
#. Rotate.
#. Redefine symbol to current location.
#. Define a literal.
-#: vms-alpha.c:1956 vms-alpha.c:1987 vms-alpha.c:2234
+#: vms-alpha.c:1951 vms-alpha.c:1982 vms-alpha.c:2229
#, c-format
msgid "%s: not supported"
msgstr ""
-#: vms-alpha.c:1962
+#: vms-alpha.c:1957
#, c-format
msgid "%s: not implemented"
msgstr ""
-#: vms-alpha.c:2218
+#: vms-alpha.c:2213
#, c-format
msgid "invalid use of %s with contexts"
msgstr ""
-#: vms-alpha.c:2252
+#: vms-alpha.c:2247
#, c-format
msgid "reserved cmd %d"
msgstr ""
-#: vms-alpha.c:2337
+#: vms-alpha.c:2332
msgid "Object module NOT error-free !\n"
msgstr ""
-#: vms-alpha.c:2766
-#, c-format
-msgid "Symbol %s replaced by %s\n"
-msgstr ""
-
-#: vms-alpha.c:3769
+#: vms-alpha.c:3657
#, c-format
msgid "SEC_RELOC with no relocs in section %s"
msgstr ""
-#: vms-alpha.c:3822 vms-alpha.c:4049
+#: vms-alpha.c:3709 vms-alpha.c:3922
#, c-format
msgid "Size error in section %s"
msgstr ""
-#: vms-alpha.c:3991
+#: vms-alpha.c:3868
msgid "Spurious ALPHA_R_BSR reloc"
msgstr ""
-#: vms-alpha.c:4036
+#: vms-alpha.c:3909
#, c-format
msgid "Unhandled relocation %s"
msgstr ""
-#: vms-alpha.c:4326
+#: vms-alpha.c:4199
#, c-format
msgid "unknown source command %d"
msgstr ""
-#: vms-alpha.c:4387
+#: vms-alpha.c:4260
msgid "DST__K_SET_LINUM_INCR not implemented"
msgstr ""
-#: vms-alpha.c:4393
+#: vms-alpha.c:4266
msgid "DST__K_SET_LINUM_INCR_W not implemented"
msgstr ""
-#: vms-alpha.c:4399
+#: vms-alpha.c:4272
msgid "DST__K_RESET_LINUM_INCR not implemented"
msgstr ""
-#: vms-alpha.c:4405
+#: vms-alpha.c:4278
msgid "DST__K_BEG_STMT_MODE not implemented"
msgstr ""
-#: vms-alpha.c:4411
+#: vms-alpha.c:4284
msgid "DST__K_END_STMT_MODE not implemented"
msgstr ""
-#: vms-alpha.c:4438
+#: vms-alpha.c:4311
msgid "DST__K_SET_PC not implemented"
msgstr ""
-#: vms-alpha.c:4444
+#: vms-alpha.c:4317
msgid "DST__K_SET_PC_W not implemented"
msgstr ""
-#: vms-alpha.c:4450
+#: vms-alpha.c:4323
msgid "DST__K_SET_PC_L not implemented"
msgstr ""
-#: vms-alpha.c:4456
+#: vms-alpha.c:4329
msgid "DST__K_SET_STMTNUM not implemented"
msgstr ""
-#: vms-alpha.c:4499
+#: vms-alpha.c:4372
#, c-format
msgid "unknown line command %d"
msgstr ""
-#: vms-alpha.c:4953 vms-alpha.c:4970 vms-alpha.c:4984 vms-alpha.c:4999
-#: vms-alpha.c:5011 vms-alpha.c:5022 vms-alpha.c:5034
+#: vms-alpha.c:4846 vms-alpha.c:4863 vms-alpha.c:4877 vms-alpha.c:4892
+#: vms-alpha.c:4904 vms-alpha.c:4915 vms-alpha.c:4927
#, c-format
msgid "Unknown reloc %s + %s"
msgstr ""
-#: vms-alpha.c:5089
+#: vms-alpha.c:4982
#, c-format
msgid "Unknown reloc %s"
msgstr ""
-#: vms-alpha.c:5102
+#: vms-alpha.c:4995
msgid "Invalid section index in ETIR"
msgstr ""
-#: vms-alpha.c:5109
+#: vms-alpha.c:5002
msgid "Relocation for non-REL psect"
msgstr ""
-#: vms-alpha.c:5156
+#: vms-alpha.c:5049
#, c-format
msgid "Unknown symbol in command %s"
msgstr ""
-#: vms-alpha.c:5671
+#: vms-alpha.c:5564
#, c-format
msgid " EMH %u (len=%u): "
msgstr ""
-#: vms-alpha.c:5680
+#: vms-alpha.c:5573
#, c-format
msgid "Module header\n"
msgstr ""
-#: vms-alpha.c:5681
+#: vms-alpha.c:5574
#, c-format
msgid " structure level: %u\n"
msgstr ""
-#: vms-alpha.c:5682
+#: vms-alpha.c:5575
#, c-format
msgid " max record size: %u\n"
msgstr ""
-#: vms-alpha.c:5685
+#: vms-alpha.c:5578
#, c-format
msgid " module name : %.*s\n"
msgstr ""
-#: vms-alpha.c:5687
+#: vms-alpha.c:5580
#, c-format
msgid " module version : %.*s\n"
msgstr ""
-#: vms-alpha.c:5689
+#: vms-alpha.c:5582
#, c-format
msgid " compile date : %.17s\n"
msgstr ""
-#: vms-alpha.c:5694
+#: vms-alpha.c:5587
#, c-format
msgid "Language Processor Name\n"
msgstr ""
-#: vms-alpha.c:5695
+#: vms-alpha.c:5588
#, c-format
msgid " language name: %.*s\n"
msgstr ""
-#: vms-alpha.c:5702
+#: vms-alpha.c:5595
#, c-format
msgid "Source Files Header\n"
msgstr ""
-#: vms-alpha.c:5703
+#: vms-alpha.c:5596
#, c-format
msgid " file: %.*s\n"
msgstr ""
-#: vms-alpha.c:5710
+#: vms-alpha.c:5603
#, c-format
msgid "Title Text Header\n"
msgstr ""
-#: vms-alpha.c:5711
+#: vms-alpha.c:5604
#, c-format
msgid " title: %.*s\n"
msgstr ""
-#: vms-alpha.c:5718
+#: vms-alpha.c:5611
#, c-format
msgid "Copyright Header\n"
msgstr ""
-#: vms-alpha.c:5719
+#: vms-alpha.c:5612
#, c-format
msgid " copyright: %.*s\n"
msgstr ""
-#: vms-alpha.c:5725
+#: vms-alpha.c:5618
#, c-format
msgid "unhandled emh subtype %u\n"
msgstr ""
-#: vms-alpha.c:5735
+#: vms-alpha.c:5628
#, c-format
msgid " EEOM (len=%u):\n"
msgstr ""
-#: vms-alpha.c:5736
+#: vms-alpha.c:5629
#, c-format
msgid " number of cond linkage pairs: %u\n"
msgstr ""
-#: vms-alpha.c:5738
+#: vms-alpha.c:5631
#, c-format
msgid " completion code: %u\n"
msgstr ""
-#: vms-alpha.c:5742
+#: vms-alpha.c:5635
#, c-format
msgid " transfer addr flags: 0x%02x\n"
msgstr ""
-#: vms-alpha.c:5743
+#: vms-alpha.c:5636
#, c-format
msgid " transfer addr psect: %u\n"
msgstr ""
-#: vms-alpha.c:5745
+#: vms-alpha.c:5638
#, c-format
msgid " transfer address : 0x%08x\n"
msgstr ""
-#: vms-alpha.c:5754
+#: vms-alpha.c:5647
msgid " WEAK"
msgstr ""
-#: vms-alpha.c:5756
+#: vms-alpha.c:5649
msgid " DEF"
msgstr ""
-#: vms-alpha.c:5758
+#: vms-alpha.c:5651
msgid " UNI"
msgstr ""
-#: vms-alpha.c:5760 vms-alpha.c:5781
+#: vms-alpha.c:5653 vms-alpha.c:5674
msgid " REL"
msgstr ""
-#: vms-alpha.c:5762
+#: vms-alpha.c:5655
msgid " COMM"
msgstr ""
-#: vms-alpha.c:5764
+#: vms-alpha.c:5657
msgid " VECEP"
msgstr ""
-#: vms-alpha.c:5766
+#: vms-alpha.c:5659
msgid " NORM"
msgstr ""
-#: vms-alpha.c:5768
+#: vms-alpha.c:5661
msgid " QVAL"
msgstr ""
-#: vms-alpha.c:5775
+#: vms-alpha.c:5668
msgid " PIC"
msgstr ""
-#: vms-alpha.c:5777
+#: vms-alpha.c:5670
msgid " LIB"
msgstr ""
-#: vms-alpha.c:5779
+#: vms-alpha.c:5672
msgid " OVR"
msgstr ""
-#: vms-alpha.c:5783
+#: vms-alpha.c:5676
msgid " GBL"
msgstr ""
-#: vms-alpha.c:5785
+#: vms-alpha.c:5678
msgid " SHR"
msgstr ""
-#: vms-alpha.c:5787
+#: vms-alpha.c:5680
msgid " EXE"
msgstr ""
-#: vms-alpha.c:5789
+#: vms-alpha.c:5682
msgid " RD"
msgstr ""
-#: vms-alpha.c:5791
+#: vms-alpha.c:5684
msgid " WRT"
msgstr ""
-#: vms-alpha.c:5793
+#: vms-alpha.c:5686
msgid " VEC"
msgstr ""
-#: vms-alpha.c:5795
+#: vms-alpha.c:5688
msgid " NOMOD"
msgstr ""
-#: vms-alpha.c:5797
+#: vms-alpha.c:5690
msgid " COM"
msgstr ""
-#: vms-alpha.c:5799
+#: vms-alpha.c:5692
msgid " 64B"
msgstr ""
-#: vms-alpha.c:5808
+#: vms-alpha.c:5701
#, c-format
msgid " EGSD (len=%u):\n"
msgstr ""
-#: vms-alpha.c:5820
+#: vms-alpha.c:5713
#, c-format
msgid " EGSD entry %2u (type: %u, len: %u): "
msgstr ""
-#: vms-alpha.c:5832
+#: vms-alpha.c:5725
#, c-format
msgid "PSC - Program section definition\n"
msgstr ""
-#: vms-alpha.c:5833 vms-alpha.c:5850
+#: vms-alpha.c:5726 vms-alpha.c:5743
#, c-format
msgid " alignment : 2**%u\n"
msgstr ""
-#: vms-alpha.c:5834 vms-alpha.c:5851
+#: vms-alpha.c:5727 vms-alpha.c:5744
#, c-format
msgid " flags : 0x%04x"
msgstr ""
-#: vms-alpha.c:5838
+#: vms-alpha.c:5731
#, c-format
msgid " alloc (len): %u (0x%08x)\n"
msgstr ""
-#: vms-alpha.c:5839 vms-alpha.c:5896 vms-alpha.c:5945
+#: vms-alpha.c:5732 vms-alpha.c:5789 vms-alpha.c:5838
#, c-format
msgid " name : %.*s\n"
msgstr ""
-#: vms-alpha.c:5849
+#: vms-alpha.c:5742
#, c-format
msgid "SPSC - Shared Image Program section def\n"
msgstr ""
-#: vms-alpha.c:5855
+#: vms-alpha.c:5748
#, c-format
msgid " alloc (len) : %u (0x%08x)\n"
msgstr ""
-#: vms-alpha.c:5856
+#: vms-alpha.c:5749
#, c-format
msgid " image offset : 0x%08x\n"
msgstr ""
-#: vms-alpha.c:5858
+#: vms-alpha.c:5751
#, c-format
msgid " symvec offset : 0x%08x\n"
msgstr ""
-#: vms-alpha.c:5860
+#: vms-alpha.c:5753
#, c-format
msgid " name : %.*s\n"
msgstr ""
-#: vms-alpha.c:5873
+#: vms-alpha.c:5766
#, c-format
msgid "SYM - Global symbol definition\n"
msgstr ""
-#: vms-alpha.c:5874 vms-alpha.c:5934 vms-alpha.c:5955 vms-alpha.c:5974
+#: vms-alpha.c:5767 vms-alpha.c:5827 vms-alpha.c:5848 vms-alpha.c:5867
#, c-format
msgid " flags: 0x%04x"
msgstr ""
-#: vms-alpha.c:5877
+#: vms-alpha.c:5770
#, c-format
msgid " psect offset: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:5881
+#: vms-alpha.c:5774
#, c-format
msgid " code address: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:5883
+#: vms-alpha.c:5776
#, c-format
msgid " psect index for entry point : %u\n"
msgstr ""
-#: vms-alpha.c:5886 vms-alpha.c:5962 vms-alpha.c:5981
+#: vms-alpha.c:5779 vms-alpha.c:5855 vms-alpha.c:5874
#, c-format
msgid " psect index : %u\n"
msgstr ""
-#: vms-alpha.c:5888 vms-alpha.c:5964 vms-alpha.c:5983
+#: vms-alpha.c:5781 vms-alpha.c:5857 vms-alpha.c:5876
#, c-format
msgid " name : %.*s\n"
msgstr ""
-#: vms-alpha.c:5895
+#: vms-alpha.c:5788
#, c-format
msgid "SYM - Global symbol reference\n"
msgstr ""
-#: vms-alpha.c:5907
+#: vms-alpha.c:5800
#, c-format
msgid "IDC - Ident Consistency check\n"
msgstr ""
-#: vms-alpha.c:5908
+#: vms-alpha.c:5801
#, c-format
msgid " flags : 0x%08x"
msgstr ""
-#: vms-alpha.c:5912
+#: vms-alpha.c:5805
#, c-format
msgid " id match : %x\n"
msgstr ""
-#: vms-alpha.c:5914
+#: vms-alpha.c:5807
#, c-format
msgid " error severity: %x\n"
msgstr ""
-#: vms-alpha.c:5917
+#: vms-alpha.c:5810
#, c-format
msgid " entity name : %.*s\n"
msgstr ""
-#: vms-alpha.c:5919
+#: vms-alpha.c:5812
#, c-format
msgid " object name : %.*s\n"
msgstr ""
-#: vms-alpha.c:5922
+#: vms-alpha.c:5815
#, c-format
msgid " binary ident : 0x%08x\n"
msgstr ""
-#: vms-alpha.c:5925
+#: vms-alpha.c:5818
#, c-format
msgid " ascii ident : %.*s\n"
msgstr ""
-#: vms-alpha.c:5933
+#: vms-alpha.c:5826
#, c-format
msgid "SYMG - Universal symbol definition\n"
msgstr ""
-#: vms-alpha.c:5937
+#: vms-alpha.c:5830
#, c-format
msgid " symbol vector offset: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:5939
+#: vms-alpha.c:5832
#, c-format
msgid " entry point: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:5941
+#: vms-alpha.c:5834
#, c-format
msgid " proc descr : 0x%08x\n"
msgstr ""
-#: vms-alpha.c:5943
+#: vms-alpha.c:5836
#, c-format
msgid " psect index: %u\n"
msgstr ""
-#: vms-alpha.c:5954
+#: vms-alpha.c:5847
#, c-format
msgid "SYMV - Vectored symbol definition\n"
msgstr ""
-#: vms-alpha.c:5958
+#: vms-alpha.c:5851
#, c-format
msgid " vector : 0x%08x\n"
msgstr ""
-#: vms-alpha.c:5960 vms-alpha.c:5979
+#: vms-alpha.c:5853 vms-alpha.c:5872
#, c-format
msgid " psect offset: %u\n"
msgstr ""
-#: vms-alpha.c:5973
+#: vms-alpha.c:5866
#, c-format
msgid "SYMM - Global symbol definition with version\n"
msgstr ""
-#: vms-alpha.c:5977
+#: vms-alpha.c:5870
#, c-format
msgid " version mask: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:5988
+#: vms-alpha.c:5881
#, c-format
msgid "unhandled egsd entry type %u\n"
msgstr ""
-#: vms-alpha.c:6022
+#: vms-alpha.c:5915
#, c-format
msgid " linkage index: %u, replacement insn: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:6025
+#: vms-alpha.c:5918
#, c-format
msgid " psect idx 1: %u, offset 1: 0x%08x %08x\n"
msgstr ""
-#: vms-alpha.c:6029
+#: vms-alpha.c:5922
#, c-format
msgid " psect idx 2: %u, offset 2: 0x%08x %08x\n"
msgstr ""
-#: vms-alpha.c:6034
+#: vms-alpha.c:5927
#, c-format
msgid " psect idx 3: %u, offset 3: 0x%08x %08x\n"
msgstr ""
-#: vms-alpha.c:6039
+#: vms-alpha.c:5932
#, c-format
msgid " global name: %.*s\n"
msgstr ""
-#: vms-alpha.c:6049
+#: vms-alpha.c:5942
#, c-format
msgid " %s (len=%u+%u):\n"
msgstr ""
-#: vms-alpha.c:6064
+#: vms-alpha.c:5957
#, c-format
msgid " (type: %3u, size: 4+%3u): "
msgstr ""
-#: vms-alpha.c:6068
+#: vms-alpha.c:5961
#, c-format
msgid "STA_GBL (stack global) %.*s\n"
msgstr ""
-#: vms-alpha.c:6072
+#: vms-alpha.c:5965
#, c-format
msgid "STA_LW (stack longword) 0x%08x\n"
msgstr ""
-#: vms-alpha.c:6076
+#: vms-alpha.c:5969
#, c-format
msgid "STA_QW (stack quadword) 0x%08x %08x\n"
msgstr ""
-#: vms-alpha.c:6081
+#: vms-alpha.c:5974
#, c-format
msgid "STA_PQ (stack psect base + offset)\n"
msgstr ""
-#: vms-alpha.c:6082
+#: vms-alpha.c:5975
#, c-format
msgid " psect: %u, offset: 0x%08x %08x\n"
msgstr ""
-#: vms-alpha.c:6088
+#: vms-alpha.c:5981
#, c-format
msgid "STA_LI (stack literal)\n"
msgstr ""
-#: vms-alpha.c:6091
+#: vms-alpha.c:5984
#, c-format
msgid "STA_MOD (stack module)\n"
msgstr ""
-#: vms-alpha.c:6094
+#: vms-alpha.c:5987
#, c-format
msgid "STA_CKARG (compare procedure argument)\n"
msgstr ""
-#: vms-alpha.c:6098
+#: vms-alpha.c:5991
#, c-format
msgid "STO_B (store byte)\n"
msgstr ""
-#: vms-alpha.c:6101
+#: vms-alpha.c:5994
#, c-format
msgid "STO_W (store word)\n"
msgstr ""
-#: vms-alpha.c:6104
+#: vms-alpha.c:5997
#, c-format
msgid "STO_LW (store longword)\n"
msgstr ""
-#: vms-alpha.c:6107
+#: vms-alpha.c:6000
#, c-format
msgid "STO_QW (store quadword)\n"
msgstr ""
-#: vms-alpha.c:6113
+#: vms-alpha.c:6006
#, c-format
msgid "STO_IMMR (store immediate repeat) %u bytes\n"
msgstr ""
-#: vms-alpha.c:6120
+#: vms-alpha.c:6013
#, c-format
msgid "STO_GBL (store global) %.*s\n"
msgstr ""
-#: vms-alpha.c:6124
+#: vms-alpha.c:6017
#, c-format
msgid "STO_CA (store code address) %.*s\n"
msgstr ""
-#: vms-alpha.c:6128
+#: vms-alpha.c:6021
#, c-format
msgid "STO_RB (store relative branch)\n"
msgstr ""
-#: vms-alpha.c:6131
+#: vms-alpha.c:6024
#, c-format
msgid "STO_AB (store absolute branch)\n"
msgstr ""
-#: vms-alpha.c:6134
+#: vms-alpha.c:6027
#, c-format
msgid "STO_OFF (store offset to psect)\n"
msgstr ""
-#: vms-alpha.c:6140
+#: vms-alpha.c:6033
#, c-format
msgid "STO_IMM (store immediate) %u bytes\n"
msgstr ""
-#: vms-alpha.c:6147
+#: vms-alpha.c:6040
#, c-format
msgid "STO_GBL_LW (store global longword) %.*s\n"
msgstr ""
-#: vms-alpha.c:6151
+#: vms-alpha.c:6044
#, c-format
msgid "STO_OFF (store LP with procedure signature)\n"
msgstr ""
-#: vms-alpha.c:6154
+#: vms-alpha.c:6047
#, c-format
msgid "STO_BR_GBL (store branch global) *todo*\n"
msgstr ""
-#: vms-alpha.c:6157
+#: vms-alpha.c:6050
#, c-format
msgid "STO_BR_PS (store branch psect + offset) *todo*\n"
msgstr ""
-#: vms-alpha.c:6161
+#: vms-alpha.c:6054
#, c-format
msgid "OPR_NOP (no-operation)\n"
msgstr ""
-#: vms-alpha.c:6164
+#: vms-alpha.c:6057
#, c-format
msgid "OPR_ADD (add)\n"
msgstr ""
-#: vms-alpha.c:6167
+#: vms-alpha.c:6060
#, c-format
msgid "OPR_SUB (substract)\n"
msgstr ""
-#: vms-alpha.c:6170
+#: vms-alpha.c:6063
#, c-format
msgid "OPR_MUL (multiply)\n"
msgstr ""
-#: vms-alpha.c:6173
+#: vms-alpha.c:6066
#, c-format
msgid "OPR_DIV (divide)\n"
msgstr ""
-#: vms-alpha.c:6176
+#: vms-alpha.c:6069
#, c-format
msgid "OPR_AND (logical and)\n"
msgstr ""
-#: vms-alpha.c:6179
+#: vms-alpha.c:6072
#, c-format
msgid "OPR_IOR (logical inclusive or)\n"
msgstr ""
-#: vms-alpha.c:6182
+#: vms-alpha.c:6075
#, c-format
msgid "OPR_EOR (logical exclusive or)\n"
msgstr ""
-#: vms-alpha.c:6185
+#: vms-alpha.c:6078
#, c-format
msgid "OPR_NEG (negate)\n"
msgstr ""
-#: vms-alpha.c:6188
+#: vms-alpha.c:6081
#, c-format
msgid "OPR_COM (complement)\n"
msgstr ""
-#: vms-alpha.c:6191
+#: vms-alpha.c:6084
#, c-format
msgid "OPR_INSV (insert field)\n"
msgstr ""
-#: vms-alpha.c:6194
+#: vms-alpha.c:6087
#, c-format
msgid "OPR_ASH (arithmetic shift)\n"
msgstr ""
-#: vms-alpha.c:6197
+#: vms-alpha.c:6090
#, c-format
msgid "OPR_USH (unsigned shift)\n"
msgstr ""
-#: vms-alpha.c:6200
+#: vms-alpha.c:6093
#, c-format
msgid "OPR_ROT (rotate)\n"
msgstr ""
-#: vms-alpha.c:6203
+#: vms-alpha.c:6096
#, c-format
msgid "OPR_SEL (select)\n"
msgstr ""
-#: vms-alpha.c:6206
+#: vms-alpha.c:6099
#, c-format
msgid "OPR_REDEF (redefine symbol to curr location)\n"
msgstr ""
-#: vms-alpha.c:6209
+#: vms-alpha.c:6102
#, c-format
msgid "OPR_REDEF (define a literal)\n"
msgstr ""
-#: vms-alpha.c:6213
+#: vms-alpha.c:6106
#, c-format
msgid "STC_LP (store cond linkage pair)\n"
msgstr ""
-#: vms-alpha.c:6217
+#: vms-alpha.c:6110
#, c-format
msgid "STC_LP_PSB (store cond linkage pair + signature)\n"
msgstr ""
-#: vms-alpha.c:6218
+#: vms-alpha.c:6111
#, c-format
msgid " linkage index: %u, procedure: %.*s\n"
msgstr ""
-#: vms-alpha.c:6221
+#: vms-alpha.c:6114
#, c-format
msgid " signature: %.*s\n"
msgstr ""
-#: vms-alpha.c:6224
+#: vms-alpha.c:6117
#, c-format
msgid "STC_GBL (store cond global)\n"
msgstr ""
-#: vms-alpha.c:6225
+#: vms-alpha.c:6118
#, c-format
msgid " linkage index: %u, global: %.*s\n"
msgstr ""
-#: vms-alpha.c:6229
+#: vms-alpha.c:6122
#, c-format
msgid "STC_GCA (store cond code address)\n"
msgstr ""
-#: vms-alpha.c:6230
+#: vms-alpha.c:6123
#, c-format
msgid " linkage index: %u, procedure name: %.*s\n"
msgstr ""
-#: vms-alpha.c:6234
+#: vms-alpha.c:6127
#, c-format
msgid "STC_PS (store cond psect + offset)\n"
msgstr ""
-#: vms-alpha.c:6236
+#: vms-alpha.c:6129
#, c-format
msgid " linkage index: %u, psect: %u, offset: 0x%08x %08x\n"
msgstr ""
-#: vms-alpha.c:6243
+#: vms-alpha.c:6136
#, c-format
msgid "STC_NOP_GBL (store cond NOP at global addr)\n"
msgstr ""
-#: vms-alpha.c:6247
+#: vms-alpha.c:6140
#, c-format
msgid "STC_NOP_PS (store cond NOP at psect + offset)\n"
msgstr ""
-#: vms-alpha.c:6251
+#: vms-alpha.c:6144
#, c-format
msgid "STC_BSR_GBL (store cond BSR at global addr)\n"
msgstr ""
-#: vms-alpha.c:6255
+#: vms-alpha.c:6148
#, c-format
msgid "STC_BSR_PS (store cond BSR at psect + offset)\n"
msgstr ""
-#: vms-alpha.c:6259
+#: vms-alpha.c:6152
#, c-format
msgid "STC_LDA_GBL (store cond LDA at global addr)\n"
msgstr ""
-#: vms-alpha.c:6263
+#: vms-alpha.c:6156
#, c-format
msgid "STC_LDA_PS (store cond LDA at psect + offset)\n"
msgstr ""
-#: vms-alpha.c:6267
+#: vms-alpha.c:6160
#, c-format
msgid "STC_BOH_GBL (store cond BOH at global addr)\n"
msgstr ""
-#: vms-alpha.c:6271
+#: vms-alpha.c:6164
#, c-format
msgid "STC_BOH_PS (store cond BOH at psect + offset)\n"
msgstr ""
-#: vms-alpha.c:6276
+#: vms-alpha.c:6169
#, c-format
msgid "STC_NBH_GBL (store cond or hint at global addr)\n"
msgstr ""
-#: vms-alpha.c:6280
+#: vms-alpha.c:6173
#, c-format
msgid "STC_NBH_PS (store cond or hint at psect + offset)\n"
msgstr ""
-#: vms-alpha.c:6284
+#: vms-alpha.c:6177
#, c-format
msgid "CTL_SETRB (set relocation base)\n"
msgstr ""
-#: vms-alpha.c:6290
+#: vms-alpha.c:6183
#, c-format
msgid "CTL_AUGRB (augment relocation base) %u\n"
msgstr ""
-#: vms-alpha.c:6294
+#: vms-alpha.c:6187
#, c-format
msgid "CTL_DFLOC (define location)\n"
msgstr ""
-#: vms-alpha.c:6297
+#: vms-alpha.c:6190
#, c-format
msgid "CTL_STLOC (set location)\n"
msgstr ""
-#: vms-alpha.c:6300
+#: vms-alpha.c:6193
#, c-format
msgid "CTL_STKDL (stack defined location)\n"
msgstr ""
-#: vms-alpha.c:6303 vms-alpha.c:6717
+#: vms-alpha.c:6196 vms-alpha.c:6610
#, c-format
msgid "*unhandled*\n"
msgstr ""
-#: vms-alpha.c:6333 vms-alpha.c:6372
+#: vms-alpha.c:6226 vms-alpha.c:6265
#, c-format
msgid "cannot read GST record length\n"
msgstr ""
#. Ill-formed.
-#: vms-alpha.c:6354
+#: vms-alpha.c:6247
#, c-format
msgid "cannot find EMH in first GST record\n"
msgstr ""
-#: vms-alpha.c:6380
+#: vms-alpha.c:6273
#, c-format
msgid "cannot read GST record header\n"
msgstr ""
-#: vms-alpha.c:6393
+#: vms-alpha.c:6286
#, c-format
msgid " corrupted GST\n"
msgstr ""
-#: vms-alpha.c:6401
+#: vms-alpha.c:6294
#, c-format
msgid "cannot read GST record\n"
msgstr ""
-#: vms-alpha.c:6430
+#: vms-alpha.c:6323
#, c-format
msgid " unhandled EOBJ record type %u\n"
msgstr ""
-#: vms-alpha.c:6453
+#: vms-alpha.c:6346
#, c-format
msgid " bitcount: %u, base addr: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:6466
+#: vms-alpha.c:6359
#, c-format
msgid " bitmap: 0x%08x (count: %u):\n"
msgstr ""
-#: vms-alpha.c:6473
+#: vms-alpha.c:6366
#, c-format
msgid " %08x"
msgstr ""
-#: vms-alpha.c:6498
+#: vms-alpha.c:6391
#, c-format
msgid " image %u (%u entries)\n"
msgstr ""
-#: vms-alpha.c:6503
+#: vms-alpha.c:6396
#, c-format
msgid " offset: 0x%08x, val: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:6524
+#: vms-alpha.c:6417
#, c-format
msgid " image %u (%u entries), offsets:\n"
msgstr ""
-#: vms-alpha.c:6531
+#: vms-alpha.c:6424
#, c-format
msgid " 0x%08x"
msgstr ""
#. 64 bits.
-#: vms-alpha.c:6653
+#: vms-alpha.c:6546
#, c-format
msgid "64 bits *unhandled*\n"
msgstr ""
-#: vms-alpha.c:6657
+#: vms-alpha.c:6550
#, c-format
msgid "class: %u, dtype: %u, length: %u, pointer: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:6668
+#: vms-alpha.c:6561
#, c-format
msgid "non-contiguous array of %s\n"
msgstr ""
-#: vms-alpha.c:6672
+#: vms-alpha.c:6565
#, c-format
msgid "dimct: %u, aflags: 0x%02x, digits: %u, scale: %u\n"
msgstr ""
-#: vms-alpha.c:6676
+#: vms-alpha.c:6569
#, c-format
msgid "arsize: %u, a0: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:6680
+#: vms-alpha.c:6573
#, c-format
msgid "Strides:\n"
msgstr ""
-#: vms-alpha.c:6685
+#: vms-alpha.c:6578
#, c-format
msgid "[%u]: %u\n"
msgstr ""
-#: vms-alpha.c:6690
+#: vms-alpha.c:6583
#, c-format
msgid "Bounds:\n"
msgstr ""
-#: vms-alpha.c:6695
+#: vms-alpha.c:6588
#, c-format
msgid "[%u]: Lower: %u, upper: %u\n"
msgstr ""
-#: vms-alpha.c:6707
+#: vms-alpha.c:6600
#, c-format
msgid "unaligned bit-string of %s\n"
msgstr ""
-#: vms-alpha.c:6711
+#: vms-alpha.c:6604
#, c-format
msgid "base: %u, pos: %u\n"
msgstr ""
-#: vms-alpha.c:6731
+#: vms-alpha.c:6624
#, c-format
msgid "vflags: 0x%02x, value: 0x%08x "
msgstr ""
-#: vms-alpha.c:6737
+#: vms-alpha.c:6630
#, c-format
msgid "(no value)\n"
msgstr ""
-#: vms-alpha.c:6740
+#: vms-alpha.c:6633
#, c-format
msgid "(not active)\n"
msgstr ""
-#: vms-alpha.c:6743
+#: vms-alpha.c:6636
#, c-format
msgid "(not allocated)\n"
msgstr ""
-#: vms-alpha.c:6746
+#: vms-alpha.c:6639
#, c-format
msgid "(descriptor)\n"
msgstr ""
-#: vms-alpha.c:6750
+#: vms-alpha.c:6643
#, c-format
msgid "(trailing value)\n"
msgstr ""
-#: vms-alpha.c:6753
+#: vms-alpha.c:6646
#, c-format
msgid "(value spec follows)\n"
msgstr ""
-#: vms-alpha.c:6756
+#: vms-alpha.c:6649
#, c-format
msgid "(at bit offset %u)\n"
msgstr ""
-#: vms-alpha.c:6759
+#: vms-alpha.c:6652
#, c-format
msgid "(reg: %u, disp: %u, indir: %u, kind: "
msgstr ""
-#: vms-alpha.c:6766
+#: vms-alpha.c:6659
msgid "literal"
msgstr ""
-#: vms-alpha.c:6769
+#: vms-alpha.c:6662
msgid "address"
msgstr ""
-#: vms-alpha.c:6772
+#: vms-alpha.c:6665
msgid "desc"
msgstr ""
-#: vms-alpha.c:6775
+#: vms-alpha.c:6668
msgid "reg"
msgstr ""
-#: vms-alpha.c:6850
+#: vms-alpha.c:6743
#, c-format
msgid "Debug symbol table:\n"
msgstr ""
-#: vms-alpha.c:6861
+#: vms-alpha.c:6754
#, c-format
msgid "cannot read DST header\n"
msgstr ""
-#: vms-alpha.c:6866
+#: vms-alpha.c:6759
#, c-format
msgid " type: %3u, len: %3u (at 0x%08x): "
msgstr ""
-#: vms-alpha.c:6880
+#: vms-alpha.c:6773
#, c-format
msgid "cannot read DST symbol\n"
msgstr ""
-#: vms-alpha.c:6923
+#: vms-alpha.c:6816
#, c-format
msgid "standard data: %s\n"
msgstr ""
-#: vms-alpha.c:6926 vms-alpha.c:7010
+#: vms-alpha.c:6819 vms-alpha.c:6903
#, c-format
msgid " name: %.*s\n"
msgstr ""
-#: vms-alpha.c:6933
+#: vms-alpha.c:6826
#, c-format
msgid "modbeg\n"
msgstr ""
-#: vms-alpha.c:6934
+#: vms-alpha.c:6827
#, c-format
msgid " flags: %d, language: %u, major: %u, minor: %u\n"
msgstr ""
-#: vms-alpha.c:6940 vms-alpha.c:7206
+#: vms-alpha.c:6833 vms-alpha.c:7099
#, c-format
msgid " module name: %.*s\n"
msgstr ""
-#: vms-alpha.c:6943
+#: vms-alpha.c:6836
#, c-format
msgid " compiler : %.*s\n"
msgstr ""
-#: vms-alpha.c:6948
+#: vms-alpha.c:6841
#, c-format
msgid "modend\n"
msgstr ""
-#: vms-alpha.c:6955
+#: vms-alpha.c:6848
msgid "rtnbeg\n"
msgstr ""
-#: vms-alpha.c:6956
+#: vms-alpha.c:6849
#, c-format
msgid " flags: %u, address: 0x%08x, pd-address: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:6961
+#: vms-alpha.c:6854
#, c-format
msgid " routine name: %.*s\n"
msgstr ""
-#: vms-alpha.c:6969
+#: vms-alpha.c:6862
#, c-format
msgid "rtnend: size 0x%08x\n"
msgstr ""
-#: vms-alpha.c:6977
+#: vms-alpha.c:6870
#, c-format
msgid "prolog: bkpt address 0x%08x\n"
msgstr ""
-#: vms-alpha.c:6985
+#: vms-alpha.c:6878
#, c-format
msgid "epilog: flags: %u, count: %u\n"
msgstr ""
-#: vms-alpha.c:6994
+#: vms-alpha.c:6887
#, c-format
msgid "blkbeg: address: 0x%08x, name: %.*s\n"
msgstr ""
-#: vms-alpha.c:7003
+#: vms-alpha.c:6896
#, c-format
msgid "blkend: size: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:7009
+#: vms-alpha.c:6902
#, c-format
msgid "typspec (len: %u)\n"
msgstr ""
-#: vms-alpha.c:7016
+#: vms-alpha.c:6909
#, c-format
msgid "septyp, name: %.*s\n"
msgstr ""
-#: vms-alpha.c:7025
+#: vms-alpha.c:6918
#, c-format
msgid "recbeg: name: %.*s\n"
msgstr ""
-#: vms-alpha.c:7032
+#: vms-alpha.c:6925
#, c-format
msgid "recend\n"
msgstr ""
-#: vms-alpha.c:7035
+#: vms-alpha.c:6928
#, c-format
msgid "enumbeg, len: %u, name: %.*s\n"
msgstr ""
-#: vms-alpha.c:7039
+#: vms-alpha.c:6932
#, c-format
msgid "enumelt, name: %.*s\n"
msgstr ""
-#: vms-alpha.c:7043
+#: vms-alpha.c:6936
#, c-format
msgid "enumend\n"
msgstr ""
-#: vms-alpha.c:7060
+#: vms-alpha.c:6953
#, c-format
msgid "discontiguous range (nbr: %u)\n"
msgstr ""
-#: vms-alpha.c:7062
+#: vms-alpha.c:6955
#, c-format
msgid " address: 0x%08x, size: %u\n"
msgstr ""
-#: vms-alpha.c:7072
+#: vms-alpha.c:6965
#, c-format
msgid "line num (len: %u)\n"
msgstr ""
-#: vms-alpha.c:7089
+#: vms-alpha.c:6982
#, c-format
msgid "delta_pc_w %u\n"
msgstr ""
-#: vms-alpha.c:7096
+#: vms-alpha.c:6989
#, c-format
msgid "incr_linum(b): +%u\n"
msgstr ""
-#: vms-alpha.c:7102
+#: vms-alpha.c:6995
#, c-format
msgid "incr_linum_w: +%u\n"
msgstr ""
-#: vms-alpha.c:7108
+#: vms-alpha.c:7001
#, c-format
msgid "incr_linum_l: +%u\n"
msgstr ""
-#: vms-alpha.c:7114
+#: vms-alpha.c:7007
#, c-format
msgid "set_line_num(w) %u\n"
msgstr ""
-#: vms-alpha.c:7119
+#: vms-alpha.c:7012
#, c-format
msgid "set_line_num_b %u\n"
msgstr ""
-#: vms-alpha.c:7124
+#: vms-alpha.c:7017
#, c-format
msgid "set_line_num_l %u\n"
msgstr ""
-#: vms-alpha.c:7129
+#: vms-alpha.c:7022
#, c-format
msgid "set_abs_pc: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:7133
+#: vms-alpha.c:7026
#, c-format
msgid "delta_pc_l: +0x%08x\n"
msgstr ""
-#: vms-alpha.c:7138
+#: vms-alpha.c:7031
#, c-format
msgid "term(b): 0x%02x"
msgstr ""
-#: vms-alpha.c:7140
+#: vms-alpha.c:7033
#, c-format
msgid " pc: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:7145
+#: vms-alpha.c:7038
#, c-format
msgid "term_w: 0x%04x"
msgstr ""
-#: vms-alpha.c:7147
+#: vms-alpha.c:7040
#, c-format
msgid " pc: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:7153
+#: vms-alpha.c:7046
#, c-format
msgid "delta pc +%-4d"
msgstr ""
-#: vms-alpha.c:7156
+#: vms-alpha.c:7049
#, c-format
msgid " pc: 0x%08x line: %5u\n"
msgstr ""
-#: vms-alpha.c:7161
+#: vms-alpha.c:7054
#, c-format
msgid " *unhandled* cmd %u\n"
msgstr ""
-#: vms-alpha.c:7176
+#: vms-alpha.c:7069
#, c-format
msgid "source (len: %u)\n"
msgstr ""
-#: vms-alpha.c:7190
+#: vms-alpha.c:7083
#, c-format
msgid " declfile: len: %u, flags: %u, fileid: %u\n"
msgstr ""
-#: vms-alpha.c:7194
+#: vms-alpha.c:7087
#, c-format
msgid " rms: cdt: 0x%08x %08x, ebk: 0x%08x, ffb: 0x%04x, rfo: %u\n"
msgstr ""
-#: vms-alpha.c:7203
+#: vms-alpha.c:7096
#, c-format
msgid " filename : %.*s\n"
msgstr ""
-#: vms-alpha.c:7212
+#: vms-alpha.c:7105
#, c-format
msgid " setfile %u\n"
msgstr ""
-#: vms-alpha.c:7217 vms-alpha.c:7222
+#: vms-alpha.c:7110 vms-alpha.c:7115
#, c-format
msgid " setrec %u\n"
msgstr ""
-#: vms-alpha.c:7227 vms-alpha.c:7232
+#: vms-alpha.c:7120 vms-alpha.c:7125
#, c-format
msgid " setlnum %u\n"
msgstr ""
-#: vms-alpha.c:7237 vms-alpha.c:7242
+#: vms-alpha.c:7130 vms-alpha.c:7135
#, c-format
msgid " deflines %u\n"
msgstr ""
-#: vms-alpha.c:7246
+#: vms-alpha.c:7139
#, c-format
msgid " formfeed\n"
msgstr ""
-#: vms-alpha.c:7250
+#: vms-alpha.c:7143
#, c-format
msgid " *unhandled* cmd %u\n"
msgstr ""
-#: vms-alpha.c:7262
+#: vms-alpha.c:7155
#, c-format
msgid "*unhandled* dst type %u\n"
msgstr ""
-#: vms-alpha.c:7294
+#: vms-alpha.c:7187
#, c-format
msgid "cannot read EIHD\n"
msgstr ""
-#: vms-alpha.c:7297
+#: vms-alpha.c:7190
#, c-format
msgid "EIHD: (size: %u, nbr blocks: %u)\n"
msgstr ""
-#: vms-alpha.c:7300
+#: vms-alpha.c:7193
#, c-format
msgid " majorid: %u, minorid: %u\n"
msgstr ""
-#: vms-alpha.c:7308
+#: vms-alpha.c:7201
msgid "executable"
msgstr ""
-#: vms-alpha.c:7311
+#: vms-alpha.c:7204
msgid "linkable image"
msgstr ""
-#: vms-alpha.c:7317
+#: vms-alpha.c:7210
#, c-format
msgid " image type: %u (%s)"
msgstr ""
-#: vms-alpha.c:7323
+#: vms-alpha.c:7216
msgid "native"
msgstr ""
-#: vms-alpha.c:7326
+#: vms-alpha.c:7219
msgid "CLI"
msgstr ""
-#: vms-alpha.c:7332
+#: vms-alpha.c:7225
#, c-format
msgid ", subtype: %u (%s)\n"
msgstr ""
-#: vms-alpha.c:7338
+#: vms-alpha.c:7231
#, c-format
msgid " offsets: isd: %u, activ: %u, symdbg: %u, imgid: %u, patch: %u\n"
msgstr ""
-#: vms-alpha.c:7342
+#: vms-alpha.c:7235
#, c-format
msgid " fixup info rva: "
msgstr ""
-#: vms-alpha.c:7344
+#: vms-alpha.c:7237
#, c-format
msgid ", symbol vector rva: "
msgstr ""
-#: vms-alpha.c:7347
+#: vms-alpha.c:7240
#, c-format
msgid ""
"\n"
" version array off: %u\n"
msgstr ""
-#: vms-alpha.c:7351
+#: vms-alpha.c:7244
#, c-format
msgid " img I/O count: %u, nbr channels: %u, req pri: %08x%08x\n"
msgstr ""
-#: vms-alpha.c:7357
+#: vms-alpha.c:7250
#, c-format
msgid " linker flags: %08x:"
msgstr ""
-#: vms-alpha.c:7387
+#: vms-alpha.c:7280
#, c-format
msgid " ident: 0x%08x, sysver: 0x%08x, match ctrl: %u, symvect_size: %u\n"
msgstr ""
-#: vms-alpha.c:7393
+#: vms-alpha.c:7286
#, c-format
msgid " BPAGE: %u"
msgstr ""
-#: vms-alpha.c:7399
+#: vms-alpha.c:7292
#, c-format
msgid ", ext fixup offset: %u, no_opt psect off: %u"
msgstr ""
-#: vms-alpha.c:7402
+#: vms-alpha.c:7295
#, c-format
msgid ", alias: %u\n"
msgstr ""
-#: vms-alpha.c:7410
+#: vms-alpha.c:7303
#, c-format
msgid "system version array information:\n"
msgstr ""
-#: vms-alpha.c:7414
+#: vms-alpha.c:7307
#, c-format
msgid "cannot read EIHVN header\n"
msgstr ""
-#: vms-alpha.c:7424
+#: vms-alpha.c:7317
#, c-format
msgid "cannot read EIHVN version\n"
msgstr ""
-#: vms-alpha.c:7427
+#: vms-alpha.c:7320
#, c-format
msgid " %02u "
msgstr ""
-#: vms-alpha.c:7431
+#: vms-alpha.c:7324
msgid "BASE_IMAGE "
msgstr ""
-#: vms-alpha.c:7434
+#: vms-alpha.c:7327
msgid "MEMORY_MANAGEMENT"
msgstr ""
-#: vms-alpha.c:7437
+#: vms-alpha.c:7330
msgid "IO "
msgstr ""
-#: vms-alpha.c:7440
+#: vms-alpha.c:7333
msgid "FILES_VOLUMES "
msgstr ""
-#: vms-alpha.c:7443
+#: vms-alpha.c:7336
msgid "PROCESS_SCHED "
msgstr ""
-#: vms-alpha.c:7446
+#: vms-alpha.c:7339
msgid "SYSGEN "
msgstr ""
-#: vms-alpha.c:7449
+#: vms-alpha.c:7342
msgid "CLUSTERS_LOCKMGR "
msgstr ""
-#: vms-alpha.c:7452
+#: vms-alpha.c:7345
msgid "LOGICAL_NAMES "
msgstr ""
-#: vms-alpha.c:7455
+#: vms-alpha.c:7348
msgid "SECURITY "
msgstr ""
-#: vms-alpha.c:7458
+#: vms-alpha.c:7351
msgid "IMAGE_ACTIVATOR "
msgstr ""
-#: vms-alpha.c:7461
+#: vms-alpha.c:7354
msgid "NETWORKS "
msgstr ""
-#: vms-alpha.c:7464
+#: vms-alpha.c:7357
msgid "COUNTERS "
msgstr ""
-#: vms-alpha.c:7467
+#: vms-alpha.c:7360
msgid "STABLE "
msgstr ""
-#: vms-alpha.c:7470
+#: vms-alpha.c:7363
msgid "MISC "
msgstr ""
-#: vms-alpha.c:7473
+#: vms-alpha.c:7366
msgid "CPU "
msgstr ""
-#: vms-alpha.c:7476
+#: vms-alpha.c:7369
msgid "VOLATILE "
msgstr ""
-#: vms-alpha.c:7479
+#: vms-alpha.c:7372
msgid "SHELL "
msgstr ""
-#: vms-alpha.c:7482
+#: vms-alpha.c:7375
msgid "POSIX "
msgstr ""
-#: vms-alpha.c:7485
+#: vms-alpha.c:7378
msgid "MULTI_PROCESSING "
msgstr ""
-#: vms-alpha.c:7488
+#: vms-alpha.c:7381
msgid "GALAXY "
msgstr ""
-#: vms-alpha.c:7491
+#: vms-alpha.c:7384
msgid "*unknown* "
msgstr ""
-#: vms-alpha.c:7494
+#: vms-alpha.c:7387
#, c-format
msgid ": %u.%u\n"
msgstr ""
-#: vms-alpha.c:7507 vms-alpha.c:7766
+#: vms-alpha.c:7400 vms-alpha.c:7659
#, c-format
msgid "cannot read EIHA\n"
msgstr ""
-#: vms-alpha.c:7510
+#: vms-alpha.c:7403
#, c-format
msgid "Image activation: (size=%u)\n"
msgstr ""
-#: vms-alpha.c:7512
+#: vms-alpha.c:7405
#, c-format
msgid " First address : 0x%08x 0x%08x\n"
msgstr ""
-#: vms-alpha.c:7515
+#: vms-alpha.c:7408
#, c-format
msgid " Second address: 0x%08x 0x%08x\n"
msgstr ""
-#: vms-alpha.c:7518
+#: vms-alpha.c:7411
#, c-format
msgid " Third address : 0x%08x 0x%08x\n"
msgstr ""
-#: vms-alpha.c:7521
+#: vms-alpha.c:7414
#, c-format
msgid " Fourth address: 0x%08x 0x%08x\n"
msgstr ""
-#: vms-alpha.c:7524
+#: vms-alpha.c:7417
#, c-format
msgid " Shared image : 0x%08x 0x%08x\n"
msgstr ""
-#: vms-alpha.c:7535
+#: vms-alpha.c:7428
#, c-format
msgid "cannot read EIHI\n"
msgstr ""
-#: vms-alpha.c:7538
+#: vms-alpha.c:7431
#, c-format
msgid "Image identification: (major: %u, minor: %u)\n"
msgstr ""
-#: vms-alpha.c:7541
+#: vms-alpha.c:7434
#, c-format
msgid " image name : %.*s\n"
msgstr ""
-#: vms-alpha.c:7543
+#: vms-alpha.c:7436
#, c-format
msgid " link time : %s\n"
msgstr ""
-#: vms-alpha.c:7545
+#: vms-alpha.c:7438
#, c-format
msgid " image ident : %.*s\n"
msgstr ""
-#: vms-alpha.c:7547
+#: vms-alpha.c:7440
#, c-format
msgid " linker ident : %.*s\n"
msgstr ""
-#: vms-alpha.c:7549
+#: vms-alpha.c:7442
#, c-format
msgid " image build ident: %.*s\n"
msgstr ""
-#: vms-alpha.c:7559
+#: vms-alpha.c:7452
#, c-format
msgid "cannot read EIHS\n"
msgstr ""
-#: vms-alpha.c:7562
+#: vms-alpha.c:7455
#, c-format
msgid "Image symbol & debug table: (major: %u, minor: %u)\n"
msgstr ""
-#: vms-alpha.c:7567
+#: vms-alpha.c:7460
#, c-format
msgid " debug symbol table : vbn: %u, size: %u (0x%x)\n"
msgstr ""
-#: vms-alpha.c:7571
+#: vms-alpha.c:7464
#, c-format
msgid " global symbol table: vbn: %u, records: %u\n"
msgstr ""
-#: vms-alpha.c:7575
+#: vms-alpha.c:7468
#, c-format
msgid " debug module table : vbn: %u, size: %u\n"
msgstr ""
-#: vms-alpha.c:7588
+#: vms-alpha.c:7481
#, c-format
msgid "cannot read EISD\n"
msgstr ""
-#: vms-alpha.c:7598
+#: vms-alpha.c:7491
#, c-format
msgid ""
"Image section descriptor: (major: %u, minor: %u, size: %u, offset: %u)\n"
msgstr ""
-#: vms-alpha.c:7605
+#: vms-alpha.c:7498
#, c-format
msgid " section: base: 0x%08x%08x size: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:7610
+#: vms-alpha.c:7503
#, c-format
msgid " flags: 0x%04x"
msgstr ""
-#: vms-alpha.c:7647
+#: vms-alpha.c:7540
#, c-format
msgid " vbn: %u, pfc: %u, matchctl: %u type: %u ("
msgstr ""
-#: vms-alpha.c:7653
+#: vms-alpha.c:7546
msgid "NORMAL"
msgstr ""
-#: vms-alpha.c:7656
+#: vms-alpha.c:7549
msgid "SHRFXD"
msgstr ""
-#: vms-alpha.c:7659
+#: vms-alpha.c:7552
msgid "PRVFXD"
msgstr ""
-#: vms-alpha.c:7662
+#: vms-alpha.c:7555
msgid "SHRPIC"
msgstr ""
-#: vms-alpha.c:7665
+#: vms-alpha.c:7558
msgid "PRVPIC"
msgstr ""
-#: vms-alpha.c:7668
+#: vms-alpha.c:7561
msgid "USRSTACK"
msgstr ""
-#: vms-alpha.c:7676
+#: vms-alpha.c:7567
+msgid ")\n"
+msgstr ""
+
+#: vms-alpha.c:7569
#, c-format
msgid " ident: 0x%08x, name: %.*s\n"
msgstr ""
-#: vms-alpha.c:7686
+#: vms-alpha.c:7579
#, c-format
msgid "cannot read DMT\n"
msgstr ""
-#: vms-alpha.c:7690
+#: vms-alpha.c:7583
#, c-format
msgid "Debug module table:\n"
msgstr ""
-#: vms-alpha.c:7699
+#: vms-alpha.c:7592
#, c-format
msgid "cannot read DMT header\n"
msgstr ""
-#: vms-alpha.c:7704
+#: vms-alpha.c:7597
#, c-format
msgid " module offset: 0x%08x, size: 0x%08x, (%u psects)\n"
msgstr ""
-#: vms-alpha.c:7714
+#: vms-alpha.c:7607
#, c-format
msgid "cannot read DMT psect\n"
msgstr ""
-#: vms-alpha.c:7717
+#: vms-alpha.c:7610
#, c-format
msgid " psect start: 0x%08x, length: %u\n"
msgstr ""
-#: vms-alpha.c:7730
+#: vms-alpha.c:7623
#, c-format
msgid "cannot read DST\n"
msgstr ""
-#: vms-alpha.c:7740
+#: vms-alpha.c:7633
#, c-format
msgid "cannot read GST\n"
msgstr ""
-#: vms-alpha.c:7744
+#: vms-alpha.c:7637
#, c-format
msgid "Global symbol table:\n"
msgstr ""
-#: vms-alpha.c:7772
+#: vms-alpha.c:7665
#, c-format
msgid "Image activator fixup: (major: %u, minor: %u)\n"
msgstr ""
-#: vms-alpha.c:7775
+#: vms-alpha.c:7668
#, c-format
msgid " iaflink : 0x%08x %08x\n"
msgstr ""
-#: vms-alpha.c:7778
+#: vms-alpha.c:7671
#, c-format
msgid " fixuplnk: 0x%08x %08x\n"
msgstr ""
-#: vms-alpha.c:7781
+#: vms-alpha.c:7674
#, c-format
msgid " size : %u\n"
msgstr ""
-#: vms-alpha.c:7783
+#: vms-alpha.c:7676
#, c-format
msgid " flags: 0x%08x\n"
msgstr ""
-#: vms-alpha.c:7787
+#: vms-alpha.c:7680
#, c-format
msgid " qrelfixoff: %5u, lrelfixoff: %5u\n"
msgstr ""
-#: vms-alpha.c:7791
+#: vms-alpha.c:7684
#, c-format
msgid " qdotadroff: %5u, ldotadroff: %5u\n"
msgstr ""
-#: vms-alpha.c:7795
+#: vms-alpha.c:7688
#, c-format
msgid " codeadroff: %5u, lpfixoff : %5u\n"
msgstr ""
-#: vms-alpha.c:7798
+#: vms-alpha.c:7691
#, c-format
msgid " chgprtoff : %5u\n"
msgstr ""
-#: vms-alpha.c:7801
+#: vms-alpha.c:7694
#, c-format
msgid " shlstoff : %5u, shrimgcnt : %5u\n"
msgstr ""
-#: vms-alpha.c:7803
+#: vms-alpha.c:7696
#, c-format
msgid " shlextra : %5u, permctx : %5u\n"
msgstr ""
-#: vms-alpha.c:7806
+#: vms-alpha.c:7699
#, c-format
msgid " base_va : 0x%08x\n"
msgstr ""
-#: vms-alpha.c:7808
+#: vms-alpha.c:7701
#, c-format
msgid " lppsbfixoff: %5u\n"
msgstr ""
-#: vms-alpha.c:7816
+#: vms-alpha.c:7709
#, c-format
msgid " Shareable images:\n"
msgstr ""
-#: vms-alpha.c:7820
+#: vms-alpha.c:7713
#, c-format
msgid " %u: size: %u, flags: 0x%02x, name: %.*s\n"
msgstr ""
-#: vms-alpha.c:7827
+#: vms-alpha.c:7720
#, c-format
msgid " quad-word relocation fixups:\n"
msgstr ""
-#: vms-alpha.c:7832
+#: vms-alpha.c:7725
#, c-format
msgid " long-word relocation fixups:\n"
msgstr ""
-#: vms-alpha.c:7837
+#: vms-alpha.c:7730
#, c-format
msgid " quad-word .address reference fixups:\n"
msgstr ""
-#: vms-alpha.c:7842
+#: vms-alpha.c:7735
#, c-format
msgid " long-word .address reference fixups:\n"
msgstr ""
-#: vms-alpha.c:7847
+#: vms-alpha.c:7740
#, c-format
msgid " Code Address Reference Fixups:\n"
msgstr ""
-#: vms-alpha.c:7852
+#: vms-alpha.c:7745
#, c-format
-msgid " Linkage Pairs Referece Fixups:\n"
+msgid " Linkage Pairs Reference Fixups:\n"
msgstr ""
-#: vms-alpha.c:7861
+#: vms-alpha.c:7754
#, c-format
msgid " Change Protection (%u entries):\n"
msgstr ""
-#: vms-alpha.c:7866
+#: vms-alpha.c:7759
#, c-format
msgid " base: 0x%08x %08x, size: 0x%08x, prot: 0x%08x "
msgstr ""
#. FIXME: we do not yet support relocatable link. It is not obvious
#. how to do it for debug infos.
-#: vms-alpha.c:8706
+#: vms-alpha.c:8599
msgid "%P: relocatable link is not supported\n"
msgstr ""
-#: vms-alpha.c:8776
+#: vms-alpha.c:8669
msgid "%P: multiple entry points: in modules %B and %B\n"
msgstr ""
-#: vms-lib.c:1423
+#: vms-lib.c:1444
#, c-format
msgid "could not open shared image '%s' from '%s'"
msgstr ""
@@ -5801,316 +6204,236 @@ msgstr ""
msgid "_bfd_vms_output_counted called with too many bytes"
msgstr ""
-#: xcofflink.c:836
+#: xcofflink.c:824
#, c-format
msgid "%s: XCOFF shared object when not producing XCOFF output"
msgstr ""
-#: xcofflink.c:857
+#: xcofflink.c:845
#, c-format
msgid "%s: dynamic object with no .loader section"
msgstr ""
-#: xcofflink.c:1416
+#: xcofflink.c:1404
msgid "%B: `%s' has line numbers but no enclosing section"
msgstr ""
-#: xcofflink.c:1468
+#: xcofflink.c:1456
msgid "%B: class %d symbol `%s' has no aux entries"
msgstr ""
-#: xcofflink.c:1490
+#: xcofflink.c:1478
msgid "%B: symbol `%s' has unrecognized csect type %d"
msgstr ""
-#: xcofflink.c:1502
+#: xcofflink.c:1490
msgid "%B: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d"
msgstr ""
-#: xcofflink.c:1531
+#: xcofflink.c:1519
msgid "%B: XMC_TC0 symbol `%s' is class %d scnlen %d"
msgstr ""
-#: xcofflink.c:1677
+#: xcofflink.c:1665
msgid "%B: csect `%s' not in enclosing section"
msgstr ""
-#: xcofflink.c:1784
+#: xcofflink.c:1772
msgid "%B: misplaced XTY_LD `%s'"
msgstr ""
-#: xcofflink.c:2103
+#: xcofflink.c:2091
msgid "%B: reloc %s:%d not in csect"
msgstr ""
-#: xcofflink.c:3194
+#: xcofflink.c:3182
#, c-format
msgid "%s: no such symbol"
msgstr ""
-#: xcofflink.c:3299
+#: xcofflink.c:3287
#, c-format
msgid "warning: attempt to export undefined symbol `%s'"
msgstr ""
-#: xcofflink.c:3678
+#: xcofflink.c:3666
msgid "error: undefined symbol __rtinit"
msgstr ""
-#: xcofflink.c:4057
+#: xcofflink.c:4045
msgid "%B: loader reloc in unrecognized section `%s'"
msgstr ""
-#: xcofflink.c:4068
+#: xcofflink.c:4056
msgid "%B: `%s' in loader reloc but not loader sym"
msgstr ""
-#: xcofflink.c:4084
+#: xcofflink.c:4072
msgid "%B: loader reloc in read-only section %A"
msgstr ""
-#: xcofflink.c:5106
+#: xcofflink.c:5094
#, c-format
msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling"
msgstr ""
-#: elf32-ia64.c:628 elf64-ia64.c:628
-msgid ""
-"%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect "
-"branch."
-msgstr ""
-
-#: elf32-ia64.c:2284 elf64-ia64.c:2284
-msgid "@pltoff reloc against local symbol"
-msgstr ""
-
-#: elf32-ia64.c:3687 elf64-ia64.c:3687
-#, c-format
-msgid "%s: short data segment overflowed (0x%lx >= 0x400000)"
-msgstr ""
-
-#: elf32-ia64.c:3698 elf64-ia64.c:3698
-#, c-format
-msgid "%s: __gp does not cover short data segment"
-msgstr ""
-
-#: elf32-ia64.c:3965 elf64-ia64.c:3965
-msgid "%B: non-pic code with imm relocation against dynamic symbol `%s'"
-msgstr ""
-
-#: elf32-ia64.c:4032 elf64-ia64.c:4032
-msgid "%B: @gprel relocation against dynamic symbol %s"
-msgstr ""
-
-#: elf32-ia64.c:4095 elf64-ia64.c:4095
-msgid "%B: linking non-pic code in a position independent executable"
-msgstr ""
-
-#: elf32-ia64.c:4232 elf64-ia64.c:4232
-msgid "%B: @internal branch to dynamic symbol %s"
-msgstr ""
-
-#: elf32-ia64.c:4234 elf64-ia64.c:4234
-msgid "%B: speculation fixup to dynamic symbol %s"
-msgstr ""
-
-#: elf32-ia64.c:4236 elf64-ia64.c:4236
-msgid "%B: @pcrel relocation against dynamic symbol %s"
-msgstr ""
-
-#: elf32-ia64.c:4433 elf64-ia64.c:4433
-msgid "unsupported reloc"
-msgstr ""
-
-#: elf32-ia64.c:4471 elf64-ia64.c:4471
-msgid ""
-"%B: missing TLS section for relocation %s against `%s' at 0x%lx in section `"
-"%A'."
-msgstr ""
-
-#: elf32-ia64.c:4486 elf64-ia64.c:4486
-msgid ""
-"%B: Can't relax br (%s) to `%s' at 0x%lx in section `%A' with size 0x%lx (> "
-"0x1000000)."
-msgstr ""
-
-#: elf32-ia64.c:4748 elf64-ia64.c:4748
-msgid "%B: linking trap-on-NULL-dereference with non-trapping files"
-msgstr ""
-
-#: elf32-ia64.c:4757 elf64-ia64.c:4757
-msgid "%B: linking big-endian files with little-endian files"
-msgstr ""
-
-#: elf32-ia64.c:4766 elf64-ia64.c:4766
-msgid "%B: linking 64-bit files with 32-bit files"
-msgstr ""
-
-#: elf32-ia64.c:4775 elf64-ia64.c:4775
-msgid "%B: linking constant-gp files with non-constant-gp files"
-msgstr ""
-
-#: elf32-ia64.c:4785 elf64-ia64.c:4785
-msgid "%B: linking auto-pic files with non-auto-pic files"
-msgstr ""
-
-#: peigen.c:1002 pepigen.c:1002 pex64igen.c:1002
+#: peigen.c:1009 pepigen.c:1009 pex64igen.c:1009
#, c-format
msgid "%s: line number overflow: 0x%lx > 0xffff"
msgstr ""
-#: peigen.c:1029 pepigen.c:1029 pex64igen.c:1029
+#: peigen.c:1036 pepigen.c:1036 pex64igen.c:1036
msgid "Export Directory [.edata (or where ever we found it)]"
msgstr ""
-#: peigen.c:1030 pepigen.c:1030 pex64igen.c:1030
+#: peigen.c:1037 pepigen.c:1037 pex64igen.c:1037
msgid "Import Directory [parts of .idata]"
msgstr ""
-#: peigen.c:1031 pepigen.c:1031 pex64igen.c:1031
+#: peigen.c:1038 pepigen.c:1038 pex64igen.c:1038
msgid "Resource Directory [.rsrc]"
msgstr ""
-#: peigen.c:1032 pepigen.c:1032 pex64igen.c:1032
+#: peigen.c:1039 pepigen.c:1039 pex64igen.c:1039
msgid "Exception Directory [.pdata]"
msgstr ""
-#: peigen.c:1033 pepigen.c:1033 pex64igen.c:1033
+#: peigen.c:1040 pepigen.c:1040 pex64igen.c:1040
msgid "Security Directory"
msgstr ""
-#: peigen.c:1034 pepigen.c:1034 pex64igen.c:1034
+#: peigen.c:1041 pepigen.c:1041 pex64igen.c:1041
msgid "Base Relocation Directory [.reloc]"
msgstr ""
-#: peigen.c:1035 pepigen.c:1035 pex64igen.c:1035
+#: peigen.c:1042 pepigen.c:1042 pex64igen.c:1042
msgid "Debug Directory"
msgstr ""
-#: peigen.c:1036 pepigen.c:1036 pex64igen.c:1036
+#: peigen.c:1043 pepigen.c:1043 pex64igen.c:1043
msgid "Description Directory"
msgstr ""
-#: peigen.c:1037 pepigen.c:1037 pex64igen.c:1037
+#: peigen.c:1044 pepigen.c:1044 pex64igen.c:1044
msgid "Special Directory"
msgstr ""
-#: peigen.c:1038 pepigen.c:1038 pex64igen.c:1038
+#: peigen.c:1045 pepigen.c:1045 pex64igen.c:1045
msgid "Thread Storage Directory [.tls]"
msgstr ""
-#: peigen.c:1039 pepigen.c:1039 pex64igen.c:1039
+#: peigen.c:1046 pepigen.c:1046 pex64igen.c:1046
msgid "Load Configuration Directory"
msgstr ""
-#: peigen.c:1040 pepigen.c:1040 pex64igen.c:1040
+#: peigen.c:1047 pepigen.c:1047 pex64igen.c:1047
msgid "Bound Import Directory"
msgstr ""
-#: peigen.c:1041 pepigen.c:1041 pex64igen.c:1041
+#: peigen.c:1048 pepigen.c:1048 pex64igen.c:1048
msgid "Import Address Table Directory"
msgstr ""
-#: peigen.c:1042 pepigen.c:1042 pex64igen.c:1042
+#: peigen.c:1049 pepigen.c:1049 pex64igen.c:1049
msgid "Delay Import Directory"
msgstr ""
-#: peigen.c:1043 pepigen.c:1043 pex64igen.c:1043
+#: peigen.c:1050 pepigen.c:1050 pex64igen.c:1050
msgid "CLR Runtime Header"
msgstr ""
-#: peigen.c:1044 pepigen.c:1044 pex64igen.c:1044
+#: peigen.c:1051 pepigen.c:1051 pex64igen.c:1051
msgid "Reserved"
msgstr ""
-#: peigen.c:1104 pepigen.c:1104 pex64igen.c:1104
+#: peigen.c:1111 pepigen.c:1111 pex64igen.c:1111
#, c-format
msgid ""
"\n"
"There is an import table, but the section containing it could not be found\n"
msgstr ""
-#: peigen.c:1109 pepigen.c:1109 pex64igen.c:1109
+#: peigen.c:1116 pepigen.c:1116 pex64igen.c:1116
#, c-format
msgid ""
"\n"
"There is an import table in %s at 0x%lx\n"
msgstr ""
-#: peigen.c:1151 pepigen.c:1151 pex64igen.c:1151
+#: peigen.c:1158 pepigen.c:1158 pex64igen.c:1158
#, c-format
msgid ""
"\n"
"Function descriptor located at the start address: %04lx\n"
msgstr ""
-#: peigen.c:1154 pepigen.c:1154 pex64igen.c:1154
+#: peigen.c:1161 pepigen.c:1161 pex64igen.c:1161
#, c-format
msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n"
msgstr ""
-#: peigen.c:1162 pepigen.c:1162 pex64igen.c:1162
+#: peigen.c:1169 pepigen.c:1169 pex64igen.c:1169
#, c-format
msgid ""
"\n"
"No reldata section! Function descriptor not decoded.\n"
msgstr ""
-#: peigen.c:1167 pepigen.c:1167 pex64igen.c:1167
+#: peigen.c:1174 pepigen.c:1174 pex64igen.c:1174
#, c-format
msgid ""
"\n"
"The Import Tables (interpreted %s section contents)\n"
msgstr ""
-#: peigen.c:1170 pepigen.c:1170 pex64igen.c:1170
+#: peigen.c:1177 pepigen.c:1177 pex64igen.c:1177
#, c-format
msgid ""
" vma: Hint Time Forward DLL First\n"
" Table Stamp Chain Name Thunk\n"
msgstr ""
-#: peigen.c:1218 pepigen.c:1218 pex64igen.c:1218
+#: peigen.c:1225 pepigen.c:1225 pex64igen.c:1225
#, c-format
msgid ""
"\n"
"\tDLL Name: %s\n"
msgstr ""
-#: peigen.c:1229 pepigen.c:1229 pex64igen.c:1229
+#: peigen.c:1236 pepigen.c:1236 pex64igen.c:1236
#, c-format
msgid "\tvma: Hint/Ord Member-Name Bound-To\n"
msgstr ""
-#: peigen.c:1254 pepigen.c:1254 pex64igen.c:1254
+#: peigen.c:1261 pepigen.c:1261 pex64igen.c:1261
#, c-format
msgid ""
"\n"
"There is a first thunk, but the section containing it could not be found\n"
msgstr ""
-#: peigen.c:1415 pepigen.c:1415 pex64igen.c:1415
+#: peigen.c:1423 pepigen.c:1423 pex64igen.c:1423
#, c-format
msgid ""
"\n"
"There is an export table, but the section containing it could not be found\n"
msgstr ""
-#: peigen.c:1424 pepigen.c:1424 pex64igen.c:1424
+#: peigen.c:1432 pepigen.c:1432 pex64igen.c:1432
#, c-format
msgid ""
"\n"
"There is an export table in %s, but it does not fit into that section\n"
msgstr ""
-#: peigen.c:1430 pepigen.c:1430 pex64igen.c:1430
+#: peigen.c:1438 pepigen.c:1438 pex64igen.c:1438
#, c-format
msgid ""
"\n"
"There is an export table in %s at 0x%lx\n"
msgstr ""
-#: peigen.c:1458 pepigen.c:1458 pex64igen.c:1458
+#: peigen.c:1466 pepigen.c:1466 pex64igen.c:1466
#, c-format
msgid ""
"\n"
@@ -6118,129 +6441,129 @@ msgid ""
"\n"
msgstr ""
-#: peigen.c:1462 pepigen.c:1462 pex64igen.c:1462
+#: peigen.c:1470 pepigen.c:1470 pex64igen.c:1470
#, c-format
msgid "Export Flags \t\t\t%lx\n"
msgstr ""
-#: peigen.c:1465 pepigen.c:1465 pex64igen.c:1465
+#: peigen.c:1473 pepigen.c:1473 pex64igen.c:1473
#, c-format
msgid "Time/Date stamp \t\t%lx\n"
msgstr ""
-#: peigen.c:1468 pepigen.c:1468 pex64igen.c:1468
+#: peigen.c:1476 pepigen.c:1476 pex64igen.c:1476
#, c-format
msgid "Major/Minor \t\t\t%d/%d\n"
msgstr ""
-#: peigen.c:1471 pepigen.c:1471 pex64igen.c:1471
+#: peigen.c:1479 pepigen.c:1479 pex64igen.c:1479
#, c-format
msgid "Name \t\t\t\t"
msgstr ""
-#: peigen.c:1477 pepigen.c:1477 pex64igen.c:1477
+#: peigen.c:1485 pepigen.c:1485 pex64igen.c:1485
#, c-format
msgid "Ordinal Base \t\t\t%ld\n"
msgstr ""
-#: peigen.c:1480 pepigen.c:1480 pex64igen.c:1480
+#: peigen.c:1488 pepigen.c:1488 pex64igen.c:1488
#, c-format
msgid "Number in:\n"
msgstr ""
-#: peigen.c:1483 pepigen.c:1483 pex64igen.c:1483
+#: peigen.c:1491 pepigen.c:1491 pex64igen.c:1491
#, c-format
msgid "\tExport Address Table \t\t%08lx\n"
msgstr ""
-#: peigen.c:1487 pepigen.c:1487 pex64igen.c:1487
+#: peigen.c:1495 pepigen.c:1495 pex64igen.c:1495
#, c-format
msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n"
msgstr ""
-#: peigen.c:1490 pepigen.c:1490 pex64igen.c:1490
+#: peigen.c:1498 pepigen.c:1498 pex64igen.c:1498
#, c-format
msgid "Table Addresses\n"
msgstr ""
-#: peigen.c:1493 pepigen.c:1493 pex64igen.c:1493
+#: peigen.c:1501 pepigen.c:1501 pex64igen.c:1501
#, c-format
msgid "\tExport Address Table \t\t"
msgstr ""
-#: peigen.c:1498 pepigen.c:1498 pex64igen.c:1498
+#: peigen.c:1506 pepigen.c:1506 pex64igen.c:1506
#, c-format
msgid "\tName Pointer Table \t\t"
msgstr ""
-#: peigen.c:1503 pepigen.c:1503 pex64igen.c:1503
+#: peigen.c:1511 pepigen.c:1511 pex64igen.c:1511
#, c-format
msgid "\tOrdinal Table \t\t\t"
msgstr ""
-#: peigen.c:1517 pepigen.c:1517 pex64igen.c:1517
+#: peigen.c:1525 pepigen.c:1525 pex64igen.c:1525
#, c-format
msgid ""
"\n"
"Export Address Table -- Ordinal Base %ld\n"
msgstr ""
-#: peigen.c:1536 pepigen.c:1536 pex64igen.c:1536
+#: peigen.c:1544 pepigen.c:1544 pex64igen.c:1544
msgid "Forwarder RVA"
msgstr ""
-#: peigen.c:1547 pepigen.c:1547 pex64igen.c:1547
+#: peigen.c:1555 pepigen.c:1555 pex64igen.c:1555
msgid "Export RVA"
msgstr ""
-#: peigen.c:1554 pepigen.c:1554 pex64igen.c:1554
+#: peigen.c:1562 pepigen.c:1562 pex64igen.c:1562
#, c-format
msgid ""
"\n"
"[Ordinal/Name Pointer] Table\n"
msgstr ""
-#: peigen.c:1614 peigen.c:1797 pepigen.c:1614 pepigen.c:1797 pex64igen.c:1614
-#: pex64igen.c:1797
+#: peigen.c:1622 peigen.c:1805 pepigen.c:1622 pepigen.c:1805 pex64igen.c:1622
+#: pex64igen.c:1805
#, c-format
msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n"
msgstr ""
-#: peigen.c:1621 pepigen.c:1621 pex64igen.c:1621
+#: peigen.c:1629 pepigen.c:1629 pex64igen.c:1629
#, c-format
msgid " vma:\t\t\tBegin Address End Address Unwind Info\n"
msgstr ""
-#: peigen.c:1623 pepigen.c:1623 pex64igen.c:1623
+#: peigen.c:1631 pepigen.c:1631 pex64igen.c:1631
#, c-format
msgid ""
" vma:\t\tBegin End EH EH PrologEnd Exception\n"
" \t\tAddress Address Handler Data Address Mask\n"
msgstr ""
-#: peigen.c:1697 pepigen.c:1697 pex64igen.c:1697
+#: peigen.c:1705 pepigen.c:1705 pex64igen.c:1705
#, c-format
msgid " Register save millicode"
msgstr ""
-#: peigen.c:1700 pepigen.c:1700 pex64igen.c:1700
+#: peigen.c:1708 pepigen.c:1708 pex64igen.c:1708
#, c-format
msgid " Register restore millicode"
msgstr ""
-#: peigen.c:1703 pepigen.c:1703 pex64igen.c:1703
+#: peigen.c:1711 pepigen.c:1711 pex64igen.c:1711
#, c-format
msgid " Glue code sequence"
msgstr ""
-#: peigen.c:1803 pepigen.c:1803 pex64igen.c:1803
+#: peigen.c:1811 pepigen.c:1811 pex64igen.c:1811
#, c-format
msgid ""
" vma:\t\tBegin Prolog Function Flags Exception EH\n"
" \t\tAddress Length Length 32b exc Handler Data\n"
msgstr ""
-#: peigen.c:1929 pepigen.c:1929 pex64igen.c:1929
+#: peigen.c:1937 pepigen.c:1937 pex64igen.c:1937
#, c-format
msgid ""
"\n"
@@ -6248,52 +6571,140 @@ msgid ""
"PE File Base Relocations (interpreted .reloc section contents)\n"
msgstr ""
-#: peigen.c:1958 pepigen.c:1958 pex64igen.c:1958
+#: peigen.c:1966 pepigen.c:1966 pex64igen.c:1966
#, c-format
msgid ""
"\n"
"Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n"
msgstr ""
-#: peigen.c:1971 pepigen.c:1971 pex64igen.c:1971
+#: peigen.c:1979 pepigen.c:1979 pex64igen.c:1979
#, c-format
msgid "\treloc %4d offset %4x [%4lx] %s"
msgstr ""
+#: peigen.c:2023 pepigen.c:2023 pex64igen.c:2023
+#, c-format
+msgid "%*.s Entry: "
+msgstr ""
+
+#: peigen.c:2043 pepigen.c:2043 pex64igen.c:2043
+#, c-format
+msgid "name: [val: %08lx len %d]: "
+msgstr ""
+
+#: peigen.c:2054 pepigen.c:2054 pex64igen.c:2054
+#, c-format
+msgid "<corrupt string length: %#x>"
+msgstr ""
+
+#: peigen.c:2057 pepigen.c:2057 pex64igen.c:2057
+#, c-format
+msgid "<corrupt string offset: %#lx>"
+msgstr ""
+
+#: peigen.c:2060 pepigen.c:2060 pex64igen.c:2060
+#, c-format
+msgid "ID: %#08lx"
+msgstr ""
+
+#: peigen.c:2063 pepigen.c:2063 pex64igen.c:2063
+#, c-format
+msgid ", Value: %#08lx\n"
+msgstr ""
+
+#: peigen.c:2074 pepigen.c:2074 pex64igen.c:2074
+#, c-format
+msgid "%*.s Leaf: Addr: %#08lx, Size: %#08lx, Codepage: %d\n"
+msgstr ""
+
+#: peigen.c:2116 pepigen.c:2116 pex64igen.c:2116
+#, c-format
+msgid " Table: Char: %d, Time: %08lx, Ver: %d/%d, Num Names: %d, IDs: %d\n"
+msgstr ""
+
+#: peigen.c:2204 pepigen.c:2204 pex64igen.c:2204
+#, c-format
+msgid "Corrupt .rsrc section detected!\n"
+msgstr ""
+
+#: peigen.c:2220 pepigen.c:2220 pex64igen.c:2220
+#, c-format
+msgid ""
+"\n"
+"WARNING: Extra data in .rsrc section - it will be ignored by Windows:\n"
+msgstr ""
+
#. The MS dumpbin program reportedly ands with 0xff0f before
#. printing the characteristics field. Not sure why. No reason to
#. emulate it here.
-#: peigen.c:2010 pepigen.c:2010 pex64igen.c:2010
+#: peigen.c:2243 pepigen.c:2243 pex64igen.c:2243
#, c-format
msgid ""
"\n"
"Characteristics 0x%x\n"
msgstr ""
-#: peigen.c:2310 pepigen.c:2310 pex64igen.c:2310
+#: peigen.c:3194 pepigen.c:3194 pex64igen.c:3194
+#, c-format
+msgid ".rsrc merge failure: duplicate string resource: %d"
+msgstr ""
+
+#: peigen.c:3329 pepigen.c:3329 pex64igen.c:3329
+msgid ".rsrc merge failure: multiple non-default manifests"
+msgstr ""
+
+#: peigen.c:3347 pepigen.c:3347 pex64igen.c:3347
+msgid ".rsrc merge failure: a directory matches a leaf"
+msgstr ""
+
+#: peigen.c:3389 pepigen.c:3389 pex64igen.c:3389
+msgid ".rsrc merge failure: duplicate leaf"
+msgstr ""
+
+#: peigen.c:3391 pepigen.c:3391 pex64igen.c:3391
+#, c-format
+msgid ".rsrc merge failure: duplicate leaf: %s"
+msgstr ""
+
+#: peigen.c:3457 pepigen.c:3457 pex64igen.c:3457
+msgid ".rsrc merge failure: dirs with differing characteristics\n"
+msgstr ""
+
+#: peigen.c:3464 pepigen.c:3464 pex64igen.c:3464
+msgid ".rsrc merge failure: differing directory versions\n"
+msgstr ""
+
+#. Corrupted .rsrc section - cannot merge.
+#: peigen.c:3537 pepigen.c:3537 pex64igen.c:3537
+#, c-format
+msgid "%s: .rsrc merge failure: corrupt .rsrc section"
+msgstr ""
+
+#: peigen.c:3673 pepigen.c:3673 pex64igen.c:3673
msgid "%B: unable to fill in DataDictionary[1] because .idata$2 is missing"
msgstr ""
-#: peigen.c:2330 pepigen.c:2330 pex64igen.c:2330
+#: peigen.c:3693 pepigen.c:3693 pex64igen.c:3693
msgid "%B: unable to fill in DataDictionary[1] because .idata$4 is missing"
msgstr ""
-#: peigen.c:2351 pepigen.c:2351 pex64igen.c:2351
+#: peigen.c:3714 pepigen.c:3714 pex64igen.c:3714
msgid "%B: unable to fill in DataDictionary[12] because .idata$5 is missing"
msgstr ""
-#: peigen.c:2371 pepigen.c:2371 pex64igen.c:2371
+#: peigen.c:3734 pepigen.c:3734 pex64igen.c:3734
msgid ""
"%B: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE (12)] because ."
"idata$6 is missing"
msgstr ""
-#: peigen.c:2413 pepigen.c:2413 pex64igen.c:2413
+#: peigen.c:3776 pepigen.c:3776 pex64igen.c:3776
msgid ""
"%B: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE(12)] because ."
"idata$6 is missing"
msgstr ""
-#: peigen.c:2438 pepigen.c:2438 pex64igen.c:2438
+#: peigen.c:3801 pepigen.c:3801 pex64igen.c:3801
msgid "%B: unable to fill in DataDictionary[9] because __tls_used is missing"
msgstr ""
diff --git a/binutils-2.25/bfd/po/fi.po b/binutils-2.25/bfd/po/fi.po
index c2d751c0..7f2fa2c8 100644
--- a/binutils-2.25/bfd/po/fi.po
+++ b/binutils-2.25/bfd/po/fi.po
@@ -1,14 +1,14 @@
# Finnish messages for bfd.
-# Copyright © 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+# Copyright © 2007, 2009, 2010, 2011, 2012, 2014 Free Software Foundation, Inc.
# This file is distributed under the same license as the binutils package.
-# Jorma Karvonen <karvonen.jorma@gmail.com>, 2007, 2009-2012.
+# Jorma Karvonen <karvonen.jorma@gmail.com>, 2007, 2009-2012, 2014.
#
msgid ""
msgstr ""
-"Project-Id-Version: bfd 2.22.90\n"
+"Project-Id-Version: bfd 2.24.90\n"
"Report-Msgid-Bugs-To: bug-binutils@gnu.org\n"
-"POT-Creation-Date: 2011-10-25 11:58+0100\n"
-"PO-Revision-Date: 2012-07-28 23:26+0200\n"
+"POT-Creation-Date: 2014-02-10 09:42+1030\n"
+"PO-Revision-Date: 2014-11-03 01:40+0200\n"
"Last-Translator: Jorma Karvonen <karvonen.jorma@gmail.com>\n"
"Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n"
"Language: fi\n"
@@ -22,16 +22,16 @@ msgstr ""
msgid "%B: Unknown section type in a.out.adobe file: %x\n"
msgstr "%B: Tuntematon lohkotyyppi â€a.out.adobeâ€-tiedostossa: %x\n"
-#: aout-cris.c:199
+#: aout-cris.c:200
#, c-format
msgid "%s: Invalid relocation type exported: %d"
msgstr "%s: Virheellinen sijoitustyyppi viety: %d"
-#: aout-cris.c:242
+#: aout-cris.c:243
msgid "%B: Invalid relocation type imported: %d"
msgstr "%B: Virheellinen sijoitustyyppi tuotu: %d"
-#: aout-cris.c:253
+#: aout-cris.c:254
msgid "%B: Bad relocation record imported: %d"
msgstr "%B: Väärä sijoitustietue tuotu: %d"
@@ -45,7 +45,7 @@ msgstr "%s: ei voi edustaa lohkoa ’%s’ â€a.outâ€-objektitiedostomuodossa"
msgid "%s: can not represent section for symbol `%s' in a.out object file format"
msgstr "%s: ei voi edustaa lohkoa symbolille ’%s’ â€a.outâ€-objektitiedostomuodossa"
-#: aoutx.h:1579 vms-alpha.c:7671
+#: aoutx.h:1579 vms-alpha.c:7564
msgid "*unknown*"
msgstr "*tuntematon*"
@@ -58,120 +58,124 @@ msgstr "%P: %B: odottamaton sijoitustyyppi\n"
msgid "%s: relocatable link from %s to %s not supported"
msgstr "%s: sijoitettava linkki kohteesta %s kohteeseen %s ei ole tuettu"
-#: archive.c:2203
+#: archive.c:2249
msgid "Warning: writing archive was slow: rewriting timestamp\n"
msgstr "Varoitus: arkiston kirjoitus oli hidasta: aikaleiman uudelleenkirjoitus\n"
-#: archive.c:2491
+#: archive.c:2549
msgid "Reading archive file mod timestamp"
msgstr "Luetaan arkistotiedoston muokkausaikaleima"
# Intel coff armap
-#: archive.c:2515
+#: archive.c:2573
msgid "Writing updated armap timestamp"
msgstr "Kirjoitetaan päivitetty â€armapâ€-aikaleima"
-#: bfd.c:398
+#: bfd.c:411
msgid "No error"
msgstr "Ei virhettä"
-#: bfd.c:399
+#: bfd.c:412
msgid "System call error"
msgstr "Järjestelmäkutsuvirhe"
-#: bfd.c:400
+#: bfd.c:413
msgid "Invalid bfd target"
msgstr "Virheellinen bfd-kohde"
-#: bfd.c:401
+#: bfd.c:414
msgid "File in wrong format"
msgstr "Tiedosto väärässä muodossa"
-#: bfd.c:402
+#: bfd.c:415
msgid "Archive object file in wrong format"
msgstr "Arkisto-objektitiedosto väärässä muodossa"
-#: bfd.c:403
+#: bfd.c:416
msgid "Invalid operation"
msgstr "Virheellinen toiminta"
-#: bfd.c:404
+#: bfd.c:417
msgid "Memory exhausted"
msgstr "Muisti loppunut"
-#: bfd.c:405
+#: bfd.c:418
msgid "No symbols"
msgstr "Ei symboleja"
-#: bfd.c:406
+#: bfd.c:419
msgid "Archive has no index; run ranlib to add one"
msgstr "Arkistossa ei ole hakemistoa; lisää sellainen suorittamalla ranlib"
-#: bfd.c:407
+#: bfd.c:420
msgid "No more archived files"
msgstr "Ei enää arkistoituja tiedostoja"
-#: bfd.c:408
+#: bfd.c:421
msgid "Malformed archive"
msgstr "Muodoltaan virheellinen arkisto"
-#: bfd.c:409
+#: bfd.c:422
+msgid "DSO missing from command line"
+msgstr "DSO puuttuu komentoriviltä"
+
+#: bfd.c:423
msgid "File format not recognized"
msgstr "Tiedostomuotoa ei tunnistettu"
-#: bfd.c:410
+#: bfd.c:424
msgid "File format is ambiguous"
msgstr "Tiedostomuoto ei ole yksiselitteinen"
-#: bfd.c:411
+#: bfd.c:425
msgid "Section has no contents"
msgstr "Lohkossa ei ole sisältöä"
-#: bfd.c:412
+#: bfd.c:426
msgid "Nonrepresentable section on output"
msgstr "Ei-edustava lohko tulosteessa"
-#: bfd.c:413
+#: bfd.c:427
msgid "Symbol needs debug section which does not exist"
msgstr "Symboli tarvitsee vianjäljityslohkon, jota ei ole"
-#: bfd.c:414
+#: bfd.c:428
msgid "Bad value"
msgstr "Väärä arvo"
-#: bfd.c:415
+#: bfd.c:429
msgid "File truncated"
msgstr "Tiedosto typistetty"
-#: bfd.c:416
+#: bfd.c:430
msgid "File too big"
msgstr "Tiedosto on liian iso"
-#: bfd.c:417
+#: bfd.c:431
#, c-format
msgid "Error reading %s: %s"
msgstr "Virhe luettaessa %s: %s"
-#: bfd.c:418
+#: bfd.c:432
msgid "#<Invalid error code>"
msgstr "#<Virheellinen virhekoodi>"
-#: bfd.c:945
+#: bfd.c:1046
#, c-format
msgid "BFD %s assertion fail %s:%d"
msgstr "BFD %s suoritusehto epäonnistui %s:%d"
-#: bfd.c:957
+#: bfd.c:1058
#, c-format
msgid "BFD %s internal error, aborting at %s line %d in %s\n"
msgstr "BFD %s sisäinen virhe, keskeytetään tiedostossa %s rivillä %d funktiossa %s\n"
-#: bfd.c:961
+#: bfd.c:1062
#, c-format
msgid "BFD %s internal error, aborting at %s line %d\n"
msgstr "BFD %s sisäinen virhe, keskeytetään tiedostossa %s rivillä %d\n"
-#: bfd.c:963
+#: bfd.c:1064
msgid "Please report this bug.\n"
msgstr "Ilmoita tästä virheestä.\n"
@@ -191,17 +195,17 @@ msgstr "ei kuvausta: ympäristömuuttuja ei ole asetettu\n"
msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx."
msgstr "Varoitus: Kirjoitetaan lohko â€%s†valtavaan (ts. negatiiviseen) tiedostosiirrososoitteeseen 0x%lx."
-#: bout.c:1146 elf-m10300.c:2063 elf32-avr.c:1654 elf32-frv.c:5734
-#: elfxx-sparc.c:2802 reloc.c:6115 reloc16.c:162 elf32-ia64.c:360
-#: elf64-ia64.c:360
+#: bout.c:1146 elf-m10300.c:2665 elf32-avr.c:1706 elf32-frv.c:5641
+#: elf64-ia64-vms.c:354 elfxx-sparc.c:2869 reloc.c:7324 reloc16.c:160
+#: elf32-ia64.c:351 elf64-ia64.c:351
msgid "%P%F: --relax and -r may not be used together\n"
msgstr "%P%F: valitsimia --relax ja -r ei saa käyttää yhdessä\n"
-#: cache.c:227
+#: cache.c:253
msgid "reopening %B: %s\n"
msgstr "avataan uudelleen %B: %s\n"
-#: coff-alpha.c:491
+#: coff-alpha.c:452
msgid ""
"%B: Cannot handle compressed Alpha binaries.\n"
" Use compiler flags, or objZ, to generate uncompressed binaries."
@@ -209,42 +213,42 @@ msgstr ""
"%B: Ei voi käsitellä tiivistettyjä Alpha-binaareja.\n"
" Käytä kääntäjälippuja, tai objZ:aa, tiivistämättömien binaarien tuottamiseksi."
-#: coff-alpha.c:648
+#: coff-alpha.c:603
msgid "%B: unknown/unsupported relocation type %d"
msgstr "%B: tuntematon/ei-tuettu sijoitustyyppi %d"
-#: coff-alpha.c:900 coff-alpha.c:937 coff-alpha.c:2025 coff-mips.c:1003
+#: coff-alpha.c:852 coff-alpha.c:889 coff-alpha.c:1973 coff-mips.c:946
msgid "GP relative relocation used when GP not defined"
msgstr "Yleisosoitinsuhteellista sijoitusta käytetty kun yleisosoitinta ei ole määritelty"
-#: coff-alpha.c:1502
+#: coff-alpha.c:1450
msgid "using multiple gp values"
msgstr "käytetään useita yleisosoitinarvoja"
-#: coff-alpha.c:1561
+#: coff-alpha.c:1509
msgid "%B: unsupported relocation: ALPHA_R_GPRELHIGH"
msgstr "%B: ei-tuettu sijoitus: ALPHA_R_GPRELHIGH"
-#: coff-alpha.c:1568
+#: coff-alpha.c:1516
msgid "%B: unsupported relocation: ALPHA_R_GPRELLOW"
msgstr "%B: ei-tuettu sijoitus: ALPHA_R_GPRELLOW"
-#: coff-alpha.c:1575 elf32-m32r.c:2484 elf64-alpha.c:4074 elf64-alpha.c:4224
-#: elf32-ia64.c:3839 elf64-ia64.c:3839
+#: coff-alpha.c:1523 elf32-m32r.c:2443 elf64-alpha.c:4083 elf64-alpha.c:4233
+#: elf64-ia64-vms.c:3429 elf32-ia64.c:3836 elf64-ia64.c:3836
msgid "%B: unknown relocation type %d"
msgstr "%B: tuntematon sijoitustyyppi %d"
-#: coff-arm.c:1038
+#: coff-arm.c:1034
#, c-format
msgid "%B: unable to find THUMB glue '%s' for `%s'"
msgstr "%B: ei löydetty THUMB-vihjettä â€%s†nimelle â€%sâ€"
-#: coff-arm.c:1067
+#: coff-arm.c:1063
#, c-format
msgid "%B: unable to find ARM glue '%s' for `%s'"
msgstr "%B: ei löydetty ARM-vihjettä â€%s†nimelle â€%sâ€"
-#: coff-arm.c:1369 elf32-arm.c:7023
+#: coff-arm.c:1365 elf32-arm.c:7141
#, c-format
msgid ""
"%B(%s): warning: interworking not enabled.\n"
@@ -253,7 +257,7 @@ msgstr ""
"%B(%s): varoitus: yhteistoimivuus vanhan koodin kanssa ei ole käytössä.\n"
" ensimmäinen esiintymä: %B: â€armâ€-kutsu thumb-koodiin"
-#: coff-arm.c:1459
+#: coff-arm.c:1455
#, c-format
msgid ""
"%B(%s): warning: interworking not enabled.\n"
@@ -264,100 +268,100 @@ msgstr ""
" ensimmäinen esiintymä: %B: thumb-kutsu arm-koodiin\n"
" harkitse uudelleenlinkitystä --support-old-code aktivoituna"
-#: coff-arm.c:1754 coff-tic80.c:695 cofflink.c:3081
+#: coff-arm.c:1750 coff-tic80.c:673 cofflink.c:3168
msgid "%B: bad reloc address 0x%lx in section `%A'"
msgstr "%B: virheellinen reloc-tietueosoite 0x%lx lohkossa â€%Aâ€"
-#: coff-arm.c:2079
+#: coff-arm.c:2075
msgid "%B: illegal symbol index in reloc: %d"
msgstr "%B: virheellinen symboli-indeksi reloc-tietueessa: %d"
-#: coff-arm.c:2210
+#: coff-arm.c:2206
#, c-format
msgid "error: %B is compiled for APCS-%d, whereas %B is compiled for APCS-%d"
msgstr "virhe: %B on käännetty APCS-%d:lle, kun taas %B on käännetty APCS-%d:lle"
-#: coff-arm.c:2226 elf32-arm.c:15621
+#: coff-arm.c:2222 elf32-arm.c:16123
#, c-format
msgid "error: %B passes floats in float registers, whereas %B passes them in integer registers"
msgstr "virhe: %B välittää float-liukuluvut liukulukurekistereissa, kun taas %B välittää ne kokonaislukurekistereissa"
-#: coff-arm.c:2229 elf32-arm.c:15625
+#: coff-arm.c:2225 elf32-arm.c:16127
#, c-format
msgid "error: %B passes floats in integer registers, whereas %B passes them in float registers"
msgstr "virhe: %B välittää float-liukuluvut kokonaislukurekistereissa, kun taas %B välittää ne float-liukulukurekistereissa"
-#: coff-arm.c:2243
+#: coff-arm.c:2239
#, c-format
msgid "error: %B is compiled as position independent code, whereas target %B is absolute position"
msgstr "virhe: %B käännetään paikkariippumattomana koodina, kun taas kohde %B on absoluuttipaikkainen"
-#: coff-arm.c:2246
+#: coff-arm.c:2242
#, c-format
msgid "error: %B is compiled as absolute position code, whereas target %B is position independent"
msgstr "virhe: %B käännetään absoluuttisella paikkakoodilla, kun taas kohde %B on paikkariippumaton"
-#: coff-arm.c:2274 elf32-arm.c:15690
+#: coff-arm.c:2270 elf32-arm.c:16192
#, c-format
msgid "Warning: %B supports interworking, whereas %B does not"
msgstr "Varoitus: %B tukee yhteistoimivuutta vanhan koodin kanssa, kun taas %B ei tue"
-#: coff-arm.c:2277 elf32-arm.c:15696
+#: coff-arm.c:2273 elf32-arm.c:16198
#, c-format
msgid "Warning: %B does not support interworking, whereas %B does"
msgstr "Varoitus: %B ei tue yhteistoimivuutta vanhan koodin kanssa, kun taas %B tukee"
-#: coff-arm.c:2301
+#: coff-arm.c:2297
#, c-format
msgid "private flags = %x:"
msgstr "yksityiset liput = %x:"
-#: coff-arm.c:2309 elf32-arm.c:11806
+#: coff-arm.c:2305 elf32-arm.c:12119
#, c-format
msgid " [floats passed in float registers]"
msgstr " [liukuluvut välitetty liukulukurekistereissä]"
-#: coff-arm.c:2311
+#: coff-arm.c:2307
#, c-format
msgid " [floats passed in integer registers]"
msgstr " [liukuluvut välitetty kokonaislukurekistereissä]"
-#: coff-arm.c:2314 elf32-arm.c:11809
+#: coff-arm.c:2310 elf32-arm.c:12122
#, c-format
msgid " [position independent]"
msgstr " [paikkariippumaton]"
-#: coff-arm.c:2316
+#: coff-arm.c:2312
#, c-format
msgid " [absolute position]"
msgstr " [absoluuttinen paikka]"
-#: coff-arm.c:2320
+#: coff-arm.c:2316
#, c-format
msgid " [interworking flag not initialised]"
msgstr " [vanhan koodin kanssa toimimisen yhteistoimivuulippua ei ole alustettu]"
-#: coff-arm.c:2322
+#: coff-arm.c:2318
#, c-format
msgid " [interworking supported]"
msgstr " [yhteistoimivuutta vanhan koodin kanssa tuettu]"
-#: coff-arm.c:2324
+#: coff-arm.c:2320
#, c-format
msgid " [interworking not supported]"
msgstr " [yhteistoimivuutta vanhan koodin kanssa ei tueta]"
-#: coff-arm.c:2370 elf32-arm.c:10841
+#: coff-arm.c:2366 elf32-arm.c:11104
#, c-format
msgid "Warning: Not setting interworking flag of %B since it has already been specified as non-interworking"
msgstr "Varoitus: Ei aseteta %B:n lippua yhteistoimivuudesta vanhan koodin kanssa koska se on jo määritelty ei-yhteistoimivuuskohteena"
-#: coff-arm.c:2374 elf32-arm.c:10845
+#: coff-arm.c:2370 elf32-arm.c:11108
#, c-format
msgid "Warning: Clearing the interworking flag of %B due to outside request"
msgstr "Varoitus: %B:n yhteistoimivuuslipun nollaus johtuu ulkopuolisesta pyynnöstä"
-#: coff-h8300.c:1122
+#: coff-h8300.c:1096
#, c-format
msgid "cannot handle R_MEM_INDIRECT reloc when using %s output"
msgstr "ei voi käsitellä â€R_MEM_INDIRECT relocâ€-tietuetta kun käytetään %s tulostetta"
@@ -367,57 +371,57 @@ msgstr "ei voi käsitellä â€R_MEM_INDIRECT relocâ€-tietuetta kun käytetään
msgid "relocation `%s' not yet implemented"
msgstr "sijoitusta â€%s†ei ole vielä toteutettu"
-#: coff-i860.c:605 coff-tic54x.c:398 coffcode.h:5198
+#: coff-i860.c:605 coff-tic54x.c:365 coffcode.h:5209
msgid "%B: warning: illegal symbol index %ld in relocs"
msgstr "%B: varoitus: virheellinen symboli-indeksi %ld relocs-tietueissa"
-#: coff-i960.c:144 coff-i960.c:507
+#: coff-i960.c:124 coff-i960.c:480
msgid "uncertain calling convention for non-COFF symbol"
msgstr "epävarma kutsukäytäntö ei-COFF-symbolille"
-#: coff-m68k.c:506 elf32-bfin.c:5690 elf32-cr16.c:2897 elf32-m68k.c:4677
+#: coff-m68k.c:484 elf32-bfin.c:5556 elf32-cr16.c:2853 elf32-m68k.c:4632
msgid "unsupported reloc type"
msgstr "ei-tuettu reloc-tyyppi"
-#: coff-mips.c:688 elf32-mips.c:1516 elf32-score.c:431 elf32-score7.c:330
-#: elf64-mips.c:2618 elfn32-mips.c:2431
+#: coff-mips.c:636 elf32-mips.c:1637 elf32-score.c:431 elf32-score7.c:330
+#: elf64-mips.c:2925 elfn32-mips.c:2737
msgid "GP relative relocation when _gp not defined"
msgstr "Yleisosoitinsuhteellinen sijoitus kun â€_gp†ei ole määritelty"
-#: coff-or32.c:229
+#: coff-or32.c:216
msgid "Unrecognized reloc"
msgstr "Tunnistamaton reloc-tietue"
-#: coff-rs6000.c:2720
+#: coff-rs6000.c:2802
#, c-format
msgid "%s: unsupported relocation type 0x%02x"
msgstr "%s: ei-tuettu sijoitustyyppi 0x%02x"
-#: coff-rs6000.c:2805
+#: coff-rs6000.c:2887
#, c-format
msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry"
msgstr "%s: â€Sisältöluettelo-relocâ€-tietue osoitteessa 0x%x symboliin â€%s†ilman sisältöluettelotulokohtaa"
-#: coff-rs6000.c:3556 coff64-rs6000.c:2111
+#: coff-rs6000.c:3638 coff64-rs6000.c:2117
msgid "%B: symbol `%s' has unrecognized smclas %d"
msgstr "%B: symbolissa â€%s†on tunnistamaton â€smclasâ€-arvo %d"
-#: coff-sh.c:521
+#: coff-sh.c:506
#, c-format
msgid "SH Error: unknown reloc type %d"
msgstr "SH-virhe: tuntematon sijoitustyyppi %d"
-#: coff-tic4x.c:195 coff-tic54x.c:299 coff-tic80.c:458
+#: coff-tic4x.c:184 coff-tic54x.c:279 coff-tic80.c:440
#, c-format
msgid "Unrecognized reloc type 0x%x"
msgstr "Tunnistamaton reloc-tyyppi 0x%x"
-#: coff-tic4x.c:240
+#: coff-tic4x.c:227
#, c-format
msgid "%s: warning: illegal symbol index %ld in relocs"
msgstr "%s: varoitus: virheellinen symboli-indeksi %ld relocs-tietueissa"
-#: coff-w65.c:367
+#: coff-w65.c:355
#, c-format
msgid "ignoring reloc %s\n"
msgstr "ei oteta huomioon reloc-tietuetta %s\n"
@@ -427,161 +431,174 @@ msgstr "ei oteta huomioon reloc-tietuetta %s\n"
# C++ ABI-ryhmä on pyrkinyt ratkaisemaan tämän pulman sallimalla kääntäjän lähettää vaaditut
# tiedot useisiin käännösyksiköihin, mikä sallii linkkerin poistaa kaikki muuta paitsi yhden
# kopion. Tätä ominaisuutta kutsutaan useissa olemassa olevissa toteutuksissa nimellä COMDAT.
-#: coffcode.h:997
+#: coffcode.h:1005
msgid "%B: warning: COMDAT symbol '%s' does not match section name '%s'"
msgstr "%B: varoitus: COMDAT-symboli â€%s†ei täsmää lohkonimen â€%s†kanssa"
#. Generate a warning message rather using the 'unhandled'
#. variable as this will allow some .sys files generate by
#. other toolchains to be processed. See bugzilla issue 196.
-#: coffcode.h:1221
+#: coffcode.h:1230
msgid "%B: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section %s"
msgstr "%B: Varoitus: Ei oteta huomioon lohkolippua IMAGE_SCN_MEM_NOT_PAGED lohkossa %s"
-#: coffcode.h:1288
+#: coffcode.h:1297
msgid "%B (%s): Section flag %s (0x%x) ignored"
msgstr "%B (%s): Lohkolippua %s (0x%x) ei oteta huomioon"
# TI tarkoittaa luultavasti Texas Instruments
-#: coffcode.h:2430
+#: coffcode.h:2439
#, c-format
msgid "Unrecognized TI COFF target id '0x%x'"
msgstr "Tunnistamaton â€TI COFFâ€-kohdetunniste â€0x%xâ€"
-#: coffcode.h:2744
+#: coffcode.h:2753
msgid "%B: reloc against a non-existant symbol index: %ld"
msgstr "%B: reloc-tietue käyttäen ei-olemassaolevaa symboli-indeksiä: %ld"
-#: coffcode.h:3302
+#: coffcode.h:3311
msgid "%B: too many sections (%d)"
msgstr "%B: liian monia lohkoja (%d)"
-#: coffcode.h:3718
+#: coffcode.h:3729
msgid "%B: section %s: string table overflow at offset %ld"
msgstr "%B: lohko %s: merkkijonotaulun ylitys siirrososoitteessa %ld"
-#: coffcode.h:4523
+#: coffcode.h:4534
msgid "%B: warning: line number table read failed"
msgstr "%B: varoitus: rivinumerotaulun lukeminen ei onnistunut"
-#: coffcode.h:4553
+#: coffcode.h:4564
msgid "%B: warning: illegal symbol index %ld in line numbers"
msgstr "%B: varoitus: virheellinen symboli-indeksi %ld rivinumeroissa"
-#: coffcode.h:4567
+#: coffcode.h:4578
msgid "%B: warning: duplicate line number information for `%s'"
msgstr "%B: varoitus: rivinumerojen kaksoiskappaleita symbolille â€%sâ€"
-#: coffcode.h:4967
+#: coffcode.h:4978
msgid "%B: Unrecognized storage class %d for %s symbol `%s'"
msgstr "%B: Tunnistamaton tallennusluokka: %d lohkonimi: %s symbolinimi: â€%sâ€"
-#: coffcode.h:5093
+#: coffcode.h:5104
msgid "warning: %B: local symbol `%s' has no section"
msgstr "varoitus: %B: paikallisessa symbolissa â€%s†ei ole lohkoa"
-#: coffcode.h:5237
+#: coffcode.h:5248
msgid "%B: illegal relocation type %d at address 0x%lx"
msgstr "%B: virheellinen sijoitustyyppi %d osoitteessa 0x%lx"
-#: coffgen.c:1595
+#: coffgen.c:179 elf.c:1030
+msgid "%B: unable to initialize compress status for section %s"
+msgstr "%B: ei kyetä alustamaan tiivistystilaa lohkolle %s"
+
+#: coffgen.c:199 elf.c:1050
+msgid "%B: unable to initialize decompress status for section %s"
+msgstr "%B: ei kyetä alustamaan tiivistyksenpurkutilaa lohkolle %s"
+
+#: coffgen.c:1685
msgid "%B: bad string table size %lu"
msgstr "%B: virheellinen merkkijonotaulukoko %lu"
-#: coffgen.c:2500 elflink.c:12689 linker.c:3122
+#: coffgen.c:2608 elflink.c:12906 linker.c:3136
msgid "%F%P: already_linked_table: %E\n"
msgstr "%F%P: already_linked_table: %E\n"
# Epäilen, että lähdekoodissa on virhe: tyypit ovat kaksi viimeistä parametriä.
-#: cofflink.c:533 elflink.c:4323
+#: cofflink.c:533 elf64-ia64-vms.c:5173 elflink.c:4356
msgid "Warning: type of symbol `%s' changed from %d to %d in %B"
msgstr "Varoitus: symbolityyppi â€%s†vaihtui tyypistä %d tyyppiin %d kohteessa %B"
-#: cofflink.c:2329
+#: cofflink.c:2416
msgid "%B: relocs in section `%A', but it has no contents"
msgstr "%B: relocs-tietueet lohkossa â€%Aâ€, mutta ilman sisältöä"
-#: cofflink.c:2391 elflink.c:9545
+#: cofflink.c:2478 elflink.c:9711
msgid "%X`%s' referenced in section `%A' of %B: defined in discarded section `%A' of %B\n"
msgstr "%Xâ€%s†viitattu lohkossa â€%A†kohteessa %B: määritelty hylätyssä lohkossa â€%A†/ %B\n"
-#: cofflink.c:2690 coffswap.h:826
+#: cofflink.c:2777 coffswap.h:826
#, c-format
msgid "%s: %s: reloc overflow: 0x%lx > 0xffff"
msgstr "%s: %s: reloc-tietueylivuoto: 0x%lx > 0xffff"
-#: cofflink.c:2699 coffswap.h:812
+#: cofflink.c:2786 coffswap.h:812
#, c-format
msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff"
msgstr "%s: varoitus: %s: rivinumeroylivuoto: 0x%lx > 0xffff"
-#: cpu-arm.c:189 cpu-arm.c:200
+#: cpu-arm.c:190 cpu-arm.c:201
msgid "error: %B is compiled for the EP9312, whereas %B is compiled for XScale"
msgstr "virhe: %B on käännetty EP9312:lle, kun taas %B on käännetty XScalelle"
-#: cpu-arm.c:333
+#: cpu-arm.c:334
#, c-format
msgid "warning: unable to update contents of %s section in %s"
msgstr "varoitus: ei voi päivittää %s-lohkon sisältöä kohteessa %s"
-#: dwarf2.c:496
+#: dwarf2.c:514
#, c-format
msgid "Dwarf Error: Can't find %s section."
msgstr "Dwarf-virhe: Ei löydy %s-lohkoa."
-#: dwarf2.c:525
+#: dwarf2.c:543
#, c-format
msgid "Dwarf Error: Offset (%lu) greater than or equal to %s size (%lu)."
msgstr "Dwarf-virhe: Siirrososoite (%lu) suurempi tai yhtäsuuri kuin %s-koko (%lu)."
-#: dwarf2.c:949
+#: dwarf2.c:1071
#, c-format
-msgid "Dwarf Error: Invalid or unhandled FORM value: %u."
-msgstr "Dwarf-virhe: Virheellinen tai käsittelemätön FORM-arvo: %u."
+msgid "Dwarf Error: Invalid or unhandled FORM value: %#x."
+msgstr "Dwarf-virhe: Virheellinen tai käsittelemätön FORM-arvo: %#x."
-#: dwarf2.c:1200
+#: dwarf2.c:1332
msgid "Dwarf Error: mangled line number section (bad file number)."
msgstr "Dwarf-virhe: runneltu rivinumerolohko (virheellinen tiedostonumero)."
-#: dwarf2.c:1453
+#: dwarf2.c:1590
#, c-format
msgid "Dwarf Error: Unhandled .debug_line version %d."
msgstr "Dwarf-virhe: Käsittelemätön â€.debug_lineâ€-versio %d."
-#: dwarf2.c:1475
+#: dwarf2.c:1612
msgid "Dwarf Error: Invalid maximum operations per instruction."
msgstr "Dwarf-virhe: Virheellinen toimintojen enimmäismäärä per käsky."
-#: dwarf2.c:1662
+#: dwarf2.c:1807
msgid "Dwarf Error: mangled line number section."
msgstr "Dwarf-virhe: runneltu rivinumerolohko."
-#: dwarf2.c:1989 dwarf2.c:2109 dwarf2.c:2394
+#: dwarf2.c:2160
+#, c-format
+msgid "Dwarf Error: Unable to read alt ref %u."
+msgstr "Dwarf-virhe: Kohteen alt ref %u lukeminen epäonnistui."
+
+#: dwarf2.c:2179 dwarf2.c:2299 dwarf2.c:2595
#, c-format
msgid "Dwarf Error: Could not find abbrev number %u."
msgstr "Dwarf-virhe: Ei löytynyt lyhennenumeroa %u."
-#: dwarf2.c:2355
+#: dwarf2.c:2551
#, c-format
msgid "Dwarf Error: found dwarf version '%u', this reader only handles version 2, 3 and 4 information."
msgstr "Dwarf-virhe: löytyi dwarf-versio ’%u’, tämä lukija käsittelee vain version 2, 3 ja 4 tietoja."
-#: dwarf2.c:2362
+#: dwarf2.c:2560
#, c-format
msgid "Dwarf Error: found address size '%u', this reader can not handle sizes greater than '%u'."
msgstr "Dwarf-virhe: löytyi osoitekoko ’%u’, tämä lukija ei voi käsitellä kokoja, jotka ovat suurempia kuin ’%u’."
-#: dwarf2.c:2385
+#: dwarf2.c:2586
#, c-format
msgid "Dwarf Error: Bad abbrev number: %u."
msgstr "Dwarf-virhe: Väärä lyhennenumero: %u."
-#: ecoff.c:1239
+#: ecoff.c:1233
#, c-format
msgid "Unknown basic type %d"
msgstr "Tuntematon perustyyppi %d"
-#: ecoff.c:1496
+#: ecoff.c:1490
#, c-format
msgid ""
"\n"
@@ -590,7 +607,7 @@ msgstr ""
"\n"
" Loppu+1 symboli: %ld"
-#: ecoff.c:1503 ecoff.c:1506
+#: ecoff.c:1497 ecoff.c:1500
#, c-format
msgid ""
"\n"
@@ -599,7 +616,7 @@ msgstr ""
"\n"
" Ensimmäinen symboli: %ld"
-#: ecoff.c:1518
+#: ecoff.c:1512
#, c-format
msgid ""
"\n"
@@ -608,7 +625,7 @@ msgstr ""
"\n"
" Loppu+1 symboli: %-7ld Tyyppi: %s"
-#: ecoff.c:1525
+#: ecoff.c:1519
#, c-format
msgid ""
"\n"
@@ -617,7 +634,7 @@ msgstr ""
"\n"
" Paikallinen symboli: %ld"
-#: ecoff.c:1533
+#: ecoff.c:1527
#, c-format
msgid ""
"\n"
@@ -626,7 +643,7 @@ msgstr ""
"\n"
" struct; Loppu+1 symboli: %ld"
-#: ecoff.c:1538
+#: ecoff.c:1532
#, c-format
msgid ""
"\n"
@@ -635,7 +652,7 @@ msgstr ""
"\n"
" union; Loppu+1 symboli: %ld"
-#: ecoff.c:1543
+#: ecoff.c:1537
#, c-format
msgid ""
"\n"
@@ -644,7 +661,7 @@ msgstr ""
"\n"
" enum; Loppu+1 symboli: %ld"
-#: ecoff.c:1549
+#: ecoff.c:1543
#, c-format
msgid ""
"\n"
@@ -653,140 +670,138 @@ msgstr ""
"\n"
" Tyyppi: %s"
-#: elf-attrs.c:569
+#: elf-attrs.c:573
msgid "error: %B: Object has vendor-specific contents that must be processed by the '%s' toolchain"
msgstr "virhe: %B: Objektilla on toimittajakohtainen sisältö, joka on käsiteltävä ’%s’-työkaluketjulla"
-#: elf-attrs.c:578
+#: elf-attrs.c:582
msgid "error: %B: Object tag '%d, %s' is incompatible with tag '%d, %s'"
msgstr "virhe: %B: Objektitunniste ’%d, %s’ ei ole yhteensopiva tunnisteen ’%d, %s’ kanssa"
-#: elf-eh-frame.c:917
+#: elf-eh-frame.c:921
msgid "%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"
msgstr "%P: virhe kohteessa %B(%A); â€.eh_frame_hdrâ€-taulua ei luotu.\n"
-#: elf-eh-frame.c:1189
+#: elf-eh-frame.c:1193
msgid "%P: fde encoding in %B(%A) prevents .eh_frame_hdr table being created.\n"
msgstr "%P: fde-koodaus kohteessa %B(%A) estää â€.eh_frame_hdrâ€-taulun luomisen.\n"
-#: elf-eh-frame.c:1605
+#: elf-eh-frame.c:1612
msgid "%P: DW_EH_PE_datarel unspecified for this architecture.\n"
msgstr "%P: DW_EH_PE_datarel määrittelemätön tälle arkkitehtuurille.\n"
-#: elf-ifunc.c:179
+#: elf-ifunc.c:135
msgid "%F%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer equality in `%B' can not be used when making an executable; recompile with -fPIE and relink with -pie\n"
msgstr "%F%P: dynaamista STT_GNU_IFUNC symbolia â€%s†osoitinyhtäläisyydellä kohteessa â€%B†ei voida käyttää tekemään suoritettavaa tiedostoa; käännä uudelleen valitsimella -fPIE ja linkitä uudelleen valitsemella -pie\n"
-#: elf-m10200.c:450 elf-m10300.c:1563 elf32-avr.c:1221 elf32-bfin.c:3213
-#: elf32-cr16.c:1482 elf32-cr16c.c:780 elf32-cris.c:2081 elf32-crx.c:922
-#: elf32-d10v.c:509 elf32-epiphany.c:556 elf32-fr30.c:609 elf32-frv.c:4105
-#: elf32-h8300.c:509 elf32-i860.c:1211 elf32-ip2k.c:1468 elf32-iq2000.c:684
-#: elf32-lm32.c:1168 elf32-m32c.c:553 elf32-m32r.c:3106 elf32-m68hc1x.c:1138
-#: elf32-mep.c:535 elf32-microblaze.c:1231 elf32-moxie.c:282
-#: elf32-msp430.c:486 elf32-mt.c:395 elf32-openrisc.c:404 elf32-score.c:2729
-#: elf32-score7.c:2537 elf32-spu.c:5044 elf32-tilepro.c:3214 elf32-v850.c:2143
-#: elf32-xstormy16.c:935 elf64-mmix.c:1590 elfxx-tilegx.c:3577
+#: elf-m10200.c:430 elf-m10300.c:2164 elf32-avr.c:1256 elf32-bfin.c:3220
+#: elf32-cr16.c:1484 elf32-cr16c.c:780 elf32-cris.c:2016 elf32-crx.c:922
+#: elf32-d10v.c:513 elf32-epiphany.c:557 elf32-fr30.c:589 elf32-frv.c:4039
+#: elf32-h8300.c:525 elf32-i860.c:1212 elf32-ip2k.c:1468 elf32-iq2000.c:688
+#: elf32-lm32.c:1160 elf32-m32c.c:553 elf32-m32r.c:3066 elf32-m68hc1x.c:1283
+#: elf32-mep.c:535 elf32-metag.c:1992 elf32-microblaze.c:1560
+#: elf32-moxie.c:282 elf32-mt.c:395 elf32-nds32.c:4910 elf32-openrisc.c:404
+#: elf32-score.c:2729 elf32-score7.c:2537 elf32-spu.c:5041
+#: elf32-tilepro.c:3666 elf32-v850.c:2281 elf32-xstormy16.c:936
+#: elf64-mmix.c:1538 elfxx-tilegx.c:4051
msgid "internal error: out of range error"
msgstr "sisäinen virhe: â€lukualueen ulkopuolellaâ€-virhe"
-#: elf-m10200.c:454 elf-m10300.c:1567 elf32-avr.c:1225 elf32-bfin.c:3217
-#: elf32-cr16.c:1486 elf32-cr16c.c:784 elf32-cris.c:2085 elf32-crx.c:926
-#: elf32-d10v.c:513 elf32-fr30.c:613 elf32-frv.c:4109 elf32-h8300.c:513
-#: elf32-i860.c:1215 elf32-iq2000.c:688 elf32-lm32.c:1172 elf32-m32c.c:557
-#: elf32-m32r.c:3110 elf32-m68hc1x.c:1142 elf32-mep.c:539
-#: elf32-microblaze.c:1235 elf32-moxie.c:286 elf32-msp430.c:490
-#: elf32-openrisc.c:408 elf32-score.c:2733 elf32-score7.c:2541
-#: elf32-spu.c:5048 elf32-tilepro.c:3218 elf32-v850.c:2147
-#: elf32-xstormy16.c:939 elf64-mmix.c:1594 elfxx-mips.c:9465
-#: elfxx-tilegx.c:3581
+#: elf-m10200.c:434 elf-m10300.c:2168 elf32-avr.c:1260 elf32-bfin.c:3224
+#: elf32-cr16.c:1488 elf32-cr16c.c:784 elf32-cris.c:2020 elf32-crx.c:926
+#: elf32-d10v.c:517 elf32-fr30.c:593 elf32-frv.c:4043 elf32-h8300.c:529
+#: elf32-i860.c:1216 elf32-iq2000.c:692 elf32-lm32.c:1164 elf32-m32c.c:557
+#: elf32-m32r.c:3070 elf32-m68hc1x.c:1287 elf32-mep.c:539 elf32-metag.c:1996
+#: elf32-microblaze.c:1564 elf32-moxie.c:286 elf32-msp430.c:1321
+#: elf32-nds32.c:4914 elf32-openrisc.c:408 elf32-score.c:2733
+#: elf32-score7.c:2541 elf32-spu.c:5045 elf32-tilepro.c:3670 elf32-v850.c:2285
+#: elf32-xstormy16.c:940 elf64-mmix.c:1542 elfxx-mips.c:9995
+#: elfxx-tilegx.c:4055
msgid "internal error: unsupported relocation error"
msgstr "sisäinen virhe: ei-tuettu sijoitusvirhe"
-#: elf-m10200.c:458 elf32-cr16.c:1490 elf32-cr16c.c:788 elf32-crx.c:930
-#: elf32-d10v.c:517 elf32-h8300.c:517 elf32-lm32.c:1176 elf32-m32r.c:3114
-#: elf32-m68hc1x.c:1146 elf32-microblaze.c:1239 elf32-score.c:2737
-#: elf32-score7.c:2545 elf32-spu.c:5052
+#: elf-m10200.c:438 elf32-cr16.c:1492 elf32-cr16c.c:788 elf32-crx.c:930
+#: elf32-d10v.c:521 elf32-h8300.c:533 elf32-lm32.c:1168 elf32-m32r.c:3074
+#: elf32-m68hc1x.c:1291 elf32-microblaze.c:1568 elf32-nds32.c:4918
+#: elf32-score.c:2737 elf32-score7.c:2545 elf32-spu.c:5049
msgid "internal error: dangerous error"
msgstr "sisäinen virhe: vaarallinen virhe"
-#: elf-m10200.c:462 elf-m10300.c:1580 elf32-avr.c:1233 elf32-bfin.c:3225
-#: elf32-cr16.c:1494 elf32-cr16c.c:792 elf32-cris.c:2093 elf32-crx.c:934
-#: elf32-d10v.c:521 elf32-epiphany.c:571 elf32-fr30.c:621 elf32-frv.c:4117
-#: elf32-h8300.c:521 elf32-i860.c:1223 elf32-ip2k.c:1483 elf32-iq2000.c:696
-#: elf32-lm32.c:1180 elf32-m32c.c:565 elf32-m32r.c:3118 elf32-m68hc1x.c:1150
-#: elf32-mep.c:547 elf32-microblaze.c:1243 elf32-moxie.c:294
-#: elf32-msp430.c:498 elf32-mt.c:403 elf32-openrisc.c:416 elf32-score.c:2746
-#: elf32-score7.c:2549 elf32-spu.c:5056 elf32-tilepro.c:3226 elf32-v850.c:2167
-#: elf32-xstormy16.c:947 elf64-mmix.c:1602 elfxx-tilegx.c:3589
+#: elf-m10200.c:442 elf-m10300.c:2184 elf32-avr.c:1268 elf32-bfin.c:3232
+#: elf32-cr16.c:1496 elf32-cr16c.c:792 elf32-cris.c:2028 elf32-crx.c:934
+#: elf32-d10v.c:525 elf32-epiphany.c:572 elf32-fr30.c:601 elf32-frv.c:4051
+#: elf32-h8300.c:537 elf32-i860.c:1224 elf32-ip2k.c:1483 elf32-iq2000.c:700
+#: elf32-lm32.c:1172 elf32-m32c.c:565 elf32-m32r.c:3078 elf32-m68hc1x.c:1295
+#: elf32-mep.c:547 elf32-metag.c:2004 elf32-microblaze.c:1572
+#: elf32-moxie.c:294 elf32-msp430.c:1329 elf32-mt.c:403 elf32-nds32.c:4922
+#: elf32-openrisc.c:416 elf32-score.c:2746 elf32-score7.c:2549
+#: elf32-spu.c:5053 elf32-tilepro.c:3678 elf32-v850.c:2305
+#: elf32-xstormy16.c:948 elf64-mmix.c:1550 elfxx-tilegx.c:4063
msgid "internal error: unknown error"
msgstr "sisäinen virhe: tuntematon virhe"
-#: elf-m10300.c:1507 elf32-arm.c:10419 elf32-i386.c:4264 elf32-m32r.c:2599
-#: elf32-m68k.c:4156 elf32-s390.c:3003 elf32-sh.c:4218 elf32-tilepro.c:3117
-#: elf32-xtensa.c:3066 elf64-s390.c:2978 elf64-sh64.c:1640 elf64-x86-64.c:4110
-#: elfxx-sparc.c:3835 elfxx-tilegx.c:3500
+#: elf-m10300.c:1021
+#, c-format
+msgid "%s: Unsupported transition from %s to %s"
+msgstr "%s: Tukematon siirto kohteesta %s kohteeseen %s"
+
+#: elf-m10300.c:1213
+msgid "%B: %s' accessed both as normal and thread local symbol"
+msgstr "%B: %s’ haettu sekä normaalina että säikeisenä paikallissymbolina"
+
+#: elf-m10300.c:2108 elf32-arm.c:10632 elf32-i386.c:4363 elf32-m32r.c:2558
+#: elf32-m68k.c:4120 elf32-s390.c:3303 elf32-sh.c:4109 elf32-tilepro.c:3569
+#: elf32-xtensa.c:3063 elf64-s390.c:3229 elf64-sh64.c:1640 elf64-x86-64.c:4463
+#: elfxx-sparc.c:3904 elfxx-tilegx.c:3974
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:4450
msgid "%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"
-msgstr "%B(%A+0x%lx): ratkaisematon %s sijoitus symbolia â€%s†varten"
+msgstr "%B(%A+0x%lx): ratkaisematon %s-sijoitus käyttäen symbolia â€%sâ€"
-#: elf-m10300.c:1572
+#: elf-m10300.c:2173
msgid "error: inappropriate relocation type for shared library (did you forget -fpic?)"
msgstr "virhe: sopimaton sijoitustyyppi jaetulle kirjastolle (unohtuiko -fpic?)"
-#: elf-m10300.c:1575
+#: elf-m10300.c:2176
+msgid "%B: taking the address of protected function '%s' cannot be done when making a shared library"
+msgstr "%B: suojatun funktion ’%s’ osoitteen ottamista ei voida tehdä, kun tehdään jaettua kirjastoa"
+
+#: elf-m10300.c:2179
msgid "internal error: suspicious relocation type used in shared library"
msgstr "sisäinen virhe: epäilyttävää sijoitustyyppiä käytetään jaetussa kirjastossa"
-#: elf-m10300.c:4372 elf32-arm.c:12800 elf32-cr16.c:2451 elf32-cris.c:3057
-#: elf32-hppa.c:1894 elf32-i370.c:503 elf32-i386.c:2182 elf32-lm32.c:1868
-#: elf32-m32r.c:1927 elf32-m68k.c:3253 elf32-s390.c:1652 elf32-sh.c:2931
-#: elf32-tic6x.c:2162 elf32-tilepro.c:1940 elf32-vax.c:1041 elf64-s390.c:1635
-#: elf64-sh64.c:3381 elf64-x86-64.c:2176 elfxx-sparc.c:2119
-#: elfxx-tilegx.c:2261
-#, c-format
-msgid "dynamic variable `%s' is zero size"
-msgstr "dynaaminen muuttuja â€%s†on nollakokoinen"
-
-#: elf.c:334
+#: elf.c:343
msgid "%B: invalid string offset %u >= %lu for section `%s'"
msgstr "%B: virheellinen merkkijonosiirrososoite %u >= %lu lohkolle â€%sâ€"
-#: elf.c:446
+#: elf.c:455
msgid "%B symbol number %lu references nonexistent SHT_SYMTAB_SHNDX section"
msgstr "%B symbolinumero %lu viittaa puuttuvaan SHT_SYMTAB_SHNDX-lohkoon"
-#: elf.c:602
+#: elf.c:611
msgid "%B: Corrupt size field in group section header: 0x%lx"
msgstr "%B: Rikkinäinen kokokenttä ryhmälohko-otsakkeessa: 0x%lx"
-#: elf.c:638
+#: elf.c:647
msgid "%B: invalid SHT_GROUP entry"
msgstr "%B: virheellinen SHT_GROUP-tulokohta"
-#: elf.c:708
+#: elf.c:717
msgid "%B: no group info for section %A"
msgstr "%B: ei ryhmätietoja lohkolle %A"
-#: elf.c:737 elf.c:3121 elflink.c:10135
+#: elf.c:746 elf.c:3144 elflink.c:10290
msgid "%B: warning: sh_link not set for section `%A'"
msgstr "%B: varoitus: sh_link-kenttää ei aseteta lohkolle â€%Aâ€"
-#: elf.c:756
+#: elf.c:765
msgid "%B: sh_link [%d] in section `%A' is incorrect"
msgstr "%B: sh_link [%d]-kenttä lohkossa â€%A†on virheellinen"
-#: elf.c:791
+#: elf.c:800
msgid "%B: unknown [%d] section `%s' in group [%s]"
msgstr "%B: tuntematon [%d] lohko â€%s†ryhmässä [%s]"
-#: elf.c:1041
-msgid "%B: unable to initialize commpress status for section %s"
-msgstr "%B: ei kyetä alustamaan tiivistystilaa lohkolle %s"
-
-#: elf.c:1061
-msgid "%B: unable to initialize decommpress status for section %s"
-msgstr "%B: ei kyetä alustamaan tiivistyksenpurkutilaa lohkolle %s"
-
-#: elf.c:1181
+#: elf.c:1174
#, c-format
msgid ""
"\n"
@@ -795,7 +810,7 @@ msgstr ""
"\n"
"Ohjelmaotsake:\n"
-#: elf.c:1223
+#: elf.c:1216
#, c-format
msgid ""
"\n"
@@ -804,7 +819,7 @@ msgstr ""
"\n"
"Dynaaminen lohko:\n"
-#: elf.c:1359
+#: elf.c:1352
#, c-format
msgid ""
"\n"
@@ -813,7 +828,7 @@ msgstr ""
"\n"
"Versiomäärittelyt:\n"
-#: elf.c:1384
+#: elf.c:1377
#, c-format
msgid ""
"\n"
@@ -822,82 +837,100 @@ msgstr ""
"\n"
"Versioviitteet:\n"
-#: elf.c:1389
+#: elf.c:1382
#, c-format
msgid " required from %s:\n"
msgstr " kysytty kohteesta %s:\n"
-#: elf.c:1796
+#: elf.c:1807
msgid "%B: invalid link %lu for reloc section %s (index %u)"
msgstr "%B: virheellinen linkki %lu reloc-tietueelle %s (indeksi %u)"
-#: elf.c:1966
+#: elf.c:1977
msgid "%B: don't know how to handle allocated, application specific section `%s' [0x%8x]"
msgstr "%B: ei tiedä kuinka käsitellä varattua, sovelluskohtaista lohkoa â€%s†[0x%8x]"
-#: elf.c:1978
+#: elf.c:1989
msgid "%B: don't know how to handle processor specific section `%s' [0x%8x]"
msgstr "%B: ei tiedä, kuinka käsitellä prosessorikohtaista lohkoa â€%s†[0x%8x]"
-#: elf.c:1989
+#: elf.c:2000
msgid "%B: don't know how to handle OS specific section `%s' [0x%8x]"
msgstr "%B: ei tiedä, kuinka käsitellä käyttöjärjestelmäkohtaista lohkoa â€%s†[0x%8x]"
-#: elf.c:1999
+#: elf.c:2010
msgid "%B: don't know how to handle section `%s' [0x%8x]"
msgstr "%B: ei tiedä kuinka käsitellä lohkoa â€%s†[0x%8x]"
-#: elf.c:2634
+#: elf.c:2648
#, c-format
msgid "warning: section `%A' type changed to PROGBITS"
msgstr "varoitus: lohkon â€%A†tyyppi vaihtunut tyypiksi PROGBITS"
-#: elf.c:3078
+#: elf.c:3015
+msgid "%B: too many sections: %u"
+msgstr "%B: liian monia lohkoja: %u"
+
+#: elf.c:3101
msgid "%B: sh_link of section `%A' points to discarded section `%A' of `%B'"
msgstr "%B: sh_link-lohko â€%A†osoittaa hylättyyn lohkoon â€%A†kohteessa â€%Bâ€"
-#: elf.c:3101
+#: elf.c:3124
msgid "%B: sh_link of section `%A' points to removed section `%A' of `%B'"
msgstr "%B: sh_link-lohko â€%A†osoittaa poistettuun lohkoon â€%A†kohteessa â€%Bâ€"
-#: elf.c:4527
+#: elf.c:4126
+msgid "%B: TLS sections are not adjacent:"
+msgstr "%B: TLS-lohkot eivät ole vierekkäisiä:"
+
+#: elf.c:4133
+#, c-format
+msgid "\t TLS: %A"
+msgstr "\t TLS: %A"
+
+#: elf.c:4137
+#, c-format
+msgid "\tnon-TLS: %A"
+msgstr "\tei-TLS: %A"
+
+#: elf.c:4596
msgid "%B: The first section in the PT_DYNAMIC segment is not the .dynamic section"
msgstr "%B: Ensimmäinen lohko PT_DYNAMIC-segmentissä ei ole â€.dynamicâ€-lohko"
-#: elf.c:4554
+#: elf.c:4621
msgid "%B: Not enough room for program headers, try linking with -N"
msgstr "%B: Ei tarpeeksi tilaa ohjelmaotsakkeille, yritä linkittää â€-Nâ€-argumentilla"
-#: elf.c:4641
+#: elf.c:4707
msgid "%B: section %A lma %#lx adjusted to %#lx"
msgstr "%B: lohko %A vma %#lx säädetty kohteeseen %#lx"
-#: elf.c:4776
+#: elf.c:4843
msgid "%B: section `%A' can't be allocated in segment %d"
msgstr "%B: lohkoa â€%A†ei voida varata segmentissä %d"
-#: elf.c:4824
+#: elf.c:4892
msgid "%B: warning: allocated section `%s' not in segment"
msgstr "%B: varoitus: varattu lohko â€%s†ei ole segmentissä"
-#: elf.c:5324
+#: elf.c:5473
msgid "%B: symbol `%s' required but not present"
msgstr "%B: symboli â€%s†vaadittu, mutta ei ole annettu"
-#: elf.c:5662
+#: elf.c:5811
msgid "%B: warning: Empty loadable segment detected, is this intentional ?\n"
msgstr "%B: varoitus: Tyhjä ladattava segmentti havaittu, onko tämä tarkoituksellinen ?\n"
-#: elf.c:6692
+#: elf.c:6867
#, c-format
msgid "Unable to find equivalent output section for symbol '%s' from section '%s'"
msgstr "Ei löydy samanlaista tulostelohkoa symbolille â€%s†lohkosta â€%sâ€"
-#: elf.c:7692
+#: elf.c:7915
msgid "%B: unsupported relocation type %s"
msgstr "%B: ei-tuettu sijoitustyyppi %s"
-#: elf32-arm.c:3617
+#: elf32-arm.c:3722 elf32-arm.c:7051
msgid ""
"%B(%s): warning: interworking not enabled.\n"
" first occurrence: %B: Thumb call to ARM"
@@ -905,7 +938,7 @@ msgstr ""
"%B(%s): varoitus: yhteistoimivuus vanhan koodin kanssa ei ole käytössä.\n"
" ensimmäinen esiintymä: %B: Thumb-kutsu ARM-koodiin"
-#: elf32-arm.c:3664
+#: elf32-arm.c:3769
msgid ""
"%B(%s): warning: interworking not enabled.\n"
" first occurrence: %B: ARM call to Thumb"
@@ -913,378 +946,401 @@ msgstr ""
"%B(%s): varoitus: yhteistoimivuus vanhan koodin kanssa ei ole käytössä.\n"
" ensimmäinen esiintymä: %B: ARM-kutsu Thumb-koodiin"
-#: elf32-arm.c:3878 elf32-arm.c:5315
+#: elf32-arm.c:3988 elf32-arm.c:5433
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:2324
#, c-format
msgid "%s: cannot create stub entry %s"
msgstr "%s: ei voi luoda stub-tulokohtaa %s"
-#: elf32-arm.c:5431
+#: elf32-arm.c:5549
#, c-format
msgid "unable to find THUMB glue '%s' for '%s'"
msgstr "ei löydy THUMB-vihjettä â€%s†kohteelle â€%sâ€"
-#: elf32-arm.c:5467
+#: elf32-arm.c:5585
#, c-format
msgid "unable to find ARM glue '%s' for '%s'"
msgstr "ei löydy ARM-vihjettä â€%s†kohteelle â€%sâ€"
-#: elf32-arm.c:6005
+#: elf32-arm.c:6123
msgid "%B: BE8 images only valid in big-endian mode."
msgstr "%B: BE8-vedokset ovat oikeita vain big-endian-tavujärjestyksessä."
# Vector Floating Point (VFP)
#. Give a warning, but do as the user requests anyway.
-#: elf32-arm.c:6235
+#: elf32-arm.c:6353
msgid "%B: warning: selected VFP11 erratum workaround is not necessary for target architecture"
msgstr "%B: varoitus: valittu VFP11-virheenkiertotapa ei ole välttämätön kohdearkkitehtuurille"
-#: elf32-arm.c:6779 elf32-arm.c:6799
+#: elf32-arm.c:6897 elf32-arm.c:6917
msgid "%B: unable to find VFP11 veneer `%s'"
msgstr "%B: ei löydy VFP11-julkisivua â€%sâ€"
-#: elf32-arm.c:6848
+#: elf32-arm.c:6966
#, c-format
msgid "Invalid TARGET2 relocation type '%s'."
msgstr "Virheellinen TARGET2-sijoitustyyppi â€%sâ€."
-#: elf32-arm.c:6933
-msgid ""
-"%B(%s): warning: interworking not enabled.\n"
-" first occurrence: %B: thumb call to arm"
-msgstr ""
-"%B(%s): varoitus: yhteistoimivuus vanhan koodin kanssa ei ole käytössä.\n"
-" ensimmäinen esiintymä: %B: thumb-kutsu arm-koodiin"
+#. PR ld/16017: Do not generate ARM instructions for
+#. the PLT if compiling for a thumb-only target.
+#.
+#. FIXME: We ought to be able to generate thumb PLT instructions...
+#: elf32-arm.c:7696
+msgid "%B: Warning: thumb mode PLT generation not currently supported"
+msgstr "%B: Varoitus: thumb-tila-PLT-tuottamista ei tällä hetkellä tueta"
-#: elf32-arm.c:7717
+#: elf32-arm.c:7909
msgid "%B(%A+0x%lx):unexpected Thumb instruction '0x%x' in TLS trampoline"
msgstr "%B(%A+0x%lx):odottamaton Thumb-käsky ’0x%x’ TLS-trampoliinissa"
-#: elf32-arm.c:7756
+#: elf32-arm.c:7948
msgid "%B(%A+0x%lx):unexpected ARM instruction '0x%x' in TLS trampoline"
msgstr "%B(%A+0x%lx):odottamaton ARM-käsky ’0x%x’ TLS-trampoliinissa"
-#: elf32-arm.c:8209
+#: elf32-arm.c:8412
msgid "\\%B: Warning: Arm BLX instruction targets Arm function '%s'."
msgstr "\\%B: Varoitus: â€Arm BLXâ€-käskykohteet Arm-funktiossa â€%sâ€."
-#: elf32-arm.c:8622
+#: elf32-arm.c:8831
msgid "%B: Warning: Thumb BLX instruction targets thumb function '%s'."
msgstr "%B: Varoitus: â€Thumb BLXâ€-käskykohteet thumb-funktiossa â€%sâ€."
-#: elf32-arm.c:9460
+#: elf32-arm.c:9672
msgid "%B(%A+0x%lx):unexpected Thumb instruction '0x%x' referenced by TLS_GOTDESC"
msgstr "%B(%A+0x%lx):TLS_GOTDESC viittasi odottamattomaann Thumb-käskyyn ’0x%x’"
-#: elf32-arm.c:9483
+#: elf32-arm.c:9695
msgid "%B(%A+0x%lx):unexpected ARM instruction '0x%x' referenced by TLS_GOTDESC"
msgstr "%B(%A+0x%lx):TLS_GOTDESC viittasi odottamattomaan ARM-käskyyn ’0x%x’"
-#: elf32-arm.c:9512
+#: elf32-arm.c:9724
msgid "%B(%A+0x%lx): R_ARM_TLS_LE32 relocation not permitted in shared object"
msgstr "%B(%A+0x%lx): R_ARM_TLS_LE32-sijoitukset eivät ole sallittuja jaetuissa objekteissa"
-#: elf32-arm.c:9727
+#: elf32-arm.c:9937
msgid "%B(%A+0x%lx): Only ADD or SUB instructions are allowed for ALU group relocations"
msgstr "%B(%A+0x%lx): Vain ADD- tai SUB-käskyt ovat sallittuja ALU-ryhmän sijoituksille"
-#: elf32-arm.c:9767 elf32-arm.c:9854 elf32-arm.c:9937 elf32-arm.c:10022
+#: elf32-arm.c:9977 elf32-arm.c:10065 elf32-arm.c:10149 elf32-arm.c:10235
msgid "%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"
msgstr "%B(%A+0x%lx): Ylivuoto, kun halkaistaan 0x%lx ryhmäsijoitukselle %s"
-#: elf32-arm.c:10261 elf32-sh.c:4103 elf64-sh64.c:1544
+#: elf32-arm.c:10474 elf32-sh.c:3994 elf64-sh64.c:1544
msgid "%B(%A+0x%lx): %s relocation against SEC_MERGE section"
-msgstr "%B(%A+0x%lx): %s sijoitus SEC_MERGE-lohkoa varten"
+msgstr "%B(%A+0x%lx): %s-sijoitus käyttäen SEC_MERGE-lohkoa"
# TLS: transport layer security
-#: elf32-arm.c:10372 elf32-m68k.c:4191 elf32-xtensa.c:2802
+#: elf32-arm.c:10585 elf32-m68k.c:4155 elf32-xtensa.c:2799
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:4192
msgid "%B(%A+0x%lx): %s used with TLS symbol %s"
msgstr "%B(%A+0x%lx): %s käytetään TLS-symbolin %s kanssa"
-#: elf32-arm.c:10373 elf32-m68k.c:4192 elf32-xtensa.c:2803
+#: elf32-arm.c:10586 elf32-m68k.c:4156 elf32-xtensa.c:2800
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:4193
msgid "%B(%A+0x%lx): %s used with non-TLS symbol %s"
msgstr "%B(%A+0x%lx): %s käytetään ei-TLS-symbolin %s kanssa"
-#: elf32-arm.c:10453 elf32-tic6x.c:2753
+#: elf32-arm.c:10666 elf32-tic6x.c:2736
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:4481
msgid "out of range"
msgstr "lukualueen ulkopuolella"
-#: elf32-arm.c:10457 elf32-tic6x.c:2757
+#: elf32-arm.c:10670 elf32-nios2.c:3525 elf32-tic6x.c:2740
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:4485
msgid "unsupported relocation"
msgstr "ei-tuettu sijoitus"
-#: elf32-arm.c:10465 elf32-tic6x.c:2765
+#: elf32-arm.c:10678 elf32-nios2.c:3535 elf32-tic6x.c:2748
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:4493
msgid "unknown error"
msgstr "tuntematon virhe"
-#: elf32-arm.c:10890
+#: elf32-arm.c:11153
msgid "Warning: Clearing the interworking flag of %B because non-interworking code in %B has been linked with it"
msgstr "Varoitus: Nollataan %B:n vanhan koodin kanssa toimimisen yhteistoimivuuslippu, koska se on linkitetty ei-yhteistoimivuuskoodiin %B:ssa"
-#: elf32-arm.c:10984
+#: elf32-arm.c:11240
msgid "%B: Unknown mandatory EABI object attribute %d"
msgstr "%B: Tuntematon pakollinen EABI-objektiattribuutti %d"
-#: elf32-arm.c:10992
+#: elf32-arm.c:11248
msgid "Warning: %B: Unknown EABI object attribute %d"
msgstr "Varoitus: %B: Tuntematon EABI-objektiattribuutti %d"
-#: elf32-arm.c:11173
+#: elf32-arm.c:11449
msgid "error: %B: Unknown CPU architecture"
msgstr "virhe: %B: Tuntematon prosessoriarkkitehtuuri"
-#: elf32-arm.c:11211
+#: elf32-arm.c:11487
msgid "error: %B: Conflicting CPU architectures %d/%d"
msgstr "virhe: %B: Ristiriitaisia prosessoriarkkitehtuureja %d/%d"
-#: elf32-arm.c:11260
+#: elf32-arm.c:11576
msgid "Error: %B has both the current and legacy Tag_MPextension_use attributes"
msgstr "Virhe: kohteessa %B on sekä nykyisiä että perinne-Tag_MPextension_use-attribuutteja"
-#: elf32-arm.c:11285
+#: elf32-arm.c:11601
msgid "error: %B uses VFP register arguments, %B does not"
msgstr "virhe: %B käyttää VFP-rekisteriargumentteja, %B ei käytä"
-#: elf32-arm.c:11430
+#: elf32-arm.c:11747
msgid "error: %B: unable to merge virtualization attributes with %B"
msgstr "virhe: %B: ei kyetä yhdistämään virtualisointiattribuutteja kohteen %B kanssa"
-#: elf32-arm.c:11456
+#: elf32-arm.c:11773
msgid "error: %B: Conflicting architecture profiles %c/%c"
msgstr "virhe: %B: Ristiriitaisia arkkitehtuuriprofiileja %c/%c"
-#: elf32-arm.c:11557
+#: elf32-arm.c:11877
msgid "Warning: %B: Conflicting platform configuration"
msgstr "Varoitus: %B: Ristiriitainen käyttöjärjestemäkonfiguraatio"
-#: elf32-arm.c:11566
+#: elf32-arm.c:11886
msgid "error: %B: Conflicting use of R9"
msgstr "virhe: %B: Ristiriitainen R9:n käyttö"
-#: elf32-arm.c:11578
+#: elf32-arm.c:11898
msgid "error: %B: SB relative addressing conflicts with use of R9"
msgstr "virhe: %B: SB-suhteellinen osoitteitus on ristiriidassa R9:n käytön kanssa"
-#: elf32-arm.c:11591
+#: elf32-arm.c:11911
msgid "warning: %B uses %u-byte wchar_t yet the output is to use %u-byte wchar_t; use of wchar_t values across objects may fail"
msgstr "varoitus: %B käyttää %u-tavuista wchar_t-merkkiä vaikka tuloste käyttää %u-tavuista wchar_t-merkkiä; wchart_t-käyttöarvot objekteissa saattavat olla virheellisiä"
-#: elf32-arm.c:11622
+#: elf32-arm.c:11942
msgid "warning: %B uses %s enums yet the output is to use %s enums; use of enum values across objects may fail"
msgstr "varoitus: %B käyttää %s enums-alkioita vaikka tuloste käyttää %s enums-alkioita; enum-arvojen käyttö objekteissa saattaa olla virheellinen"
-#: elf32-arm.c:11634
+#: elf32-arm.c:11954
msgid "error: %B uses iWMMXt register arguments, %B does not"
msgstr "virhe: %B käyttää iWMMXt-rekisteriargumentteja, %B ei käytä"
-#: elf32-arm.c:11651
+#: elf32-arm.c:11971
msgid "error: fp16 format mismatch between %B and %B"
msgstr "virhe: fp16-muototäsmäämättömyys kohteiden %B ja %B välillä"
-#: elf32-arm.c:11675
-msgid "DIV usage mismatch between %B and %B"
-msgstr "DIV-käyttötäsmäämättömyys kohteiden %B ja %B välillä"
-
-#: elf32-arm.c:11694
+#: elf32-arm.c:12007
msgid "%B has has both the current and legacy Tag_MPextension_use attributes"
msgstr "kohteella %B on sekä nykyisiä että perinne-Tag_MPextension_use-attribuutteja"
#. Ignore init flag - it may not be set, despite the flags field
#. containing valid data.
#. Ignore init flag - it may not be set, despite the flags field containing valid data.
-#: elf32-arm.c:11782 elf32-bfin.c:5079 elf32-cris.c:4169 elf32-m68hc1x.c:1282
-#: elf32-m68k.c:1236 elf32-score.c:3994 elf32-score7.c:3800 elf32-vax.c:529
-#: elfxx-mips.c:14103
+#. Ignore init flag - it may not be set, despite the flags field
+#. containing valid data.
+#: elf32-arm.c:12095 elf32-bfin.c:4949 elf32-cris.c:4139 elf32-m68hc1x.c:1427
+#: elf32-m68k.c:1195 elf32-score.c:4004 elf32-score7.c:3808 elf32-vax.c:529
+#: elf32-xgate.c:674 elfxx-mips.c:14955
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:4645
#, c-format
msgid "private flags = %lx:"
msgstr "yksityiset liput = %lx:"
-#: elf32-arm.c:11791
+#: elf32-arm.c:12104
#, c-format
msgid " [interworking enabled]"
msgstr " [yhteistoimivuus vanhan koodin kanssa on käytössä]"
-#: elf32-arm.c:11799
+#: elf32-arm.c:12112
#, c-format
msgid " [VFP float format]"
msgstr " [vektoriliukulukumuoto]"
-#: elf32-arm.c:11801
+#: elf32-arm.c:12114
#, c-format
msgid " [Maverick float format]"
msgstr " [Maverick-liukulukumuoto]"
-#: elf32-arm.c:11803
+#: elf32-arm.c:12116
#, c-format
msgid " [FPA float format]"
msgstr " [Liukulukukiihdytin-liukulukumuoto]"
-#: elf32-arm.c:11812
+#: elf32-arm.c:12125
#, c-format
msgid " [new ABI]"
msgstr " [uusi ABI]"
-#: elf32-arm.c:11815
+#: elf32-arm.c:12128
#, c-format
msgid " [old ABI]"
msgstr " [vanha ABI]"
-#: elf32-arm.c:11818
+#: elf32-arm.c:12131
#, c-format
msgid " [software FP]"
msgstr " [ohjelmistoliukuluku]"
-#: elf32-arm.c:11827
+#: elf32-arm.c:12140
#, c-format
msgid " [Version1 EABI]"
msgstr " [Versio 1 EABI]"
-#: elf32-arm.c:11830 elf32-arm.c:11841
+#: elf32-arm.c:12143 elf32-arm.c:12154
#, c-format
msgid " [sorted symbol table]"
msgstr " [lajiteltu symbolitaulu]"
-#: elf32-arm.c:11832 elf32-arm.c:11843
+#: elf32-arm.c:12145 elf32-arm.c:12156
#, c-format
msgid " [unsorted symbol table]"
msgstr " [lajittelematon symbolitaulu]"
-#: elf32-arm.c:11838
+#: elf32-arm.c:12151
#, c-format
msgid " [Version2 EABI]"
msgstr " [Versio 2 EABI]"
-#: elf32-arm.c:11846
+#: elf32-arm.c:12159
#, c-format
msgid " [dynamic symbols use segment index]"
msgstr " [dynaamiset symbolit käyttävät segmentti-indeksiä]"
-#: elf32-arm.c:11849
+#: elf32-arm.c:12162
#, c-format
msgid " [mapping symbols precede others]"
msgstr " [kuvaussymbolit ylittävät tärkeydessä muut]"
-#: elf32-arm.c:11856
+#: elf32-arm.c:12169
#, c-format
msgid " [Version3 EABI]"
msgstr " [Versio 3 EABI]"
-#: elf32-arm.c:11860
+#: elf32-arm.c:12173
#, c-format
msgid " [Version4 EABI]"
msgstr " [Versio 4 EABI]"
-#: elf32-arm.c:11864
+#: elf32-arm.c:12177
#, c-format
msgid " [Version5 EABI]"
msgstr " [Versio 5 EABI]"
-#: elf32-arm.c:11867
+#: elf32-arm.c:12180
+#, c-format
+msgid " [soft-float ABI]"
+msgstr " [ohjelmistoliukuluku-ABI]"
+
+#: elf32-arm.c:12183
+#, c-format
+msgid " [hard-float ABI]"
+msgstr " [laitteistoliukuluku-ABI]"
+
+#: elf32-arm.c:12189
#, c-format
msgid " [BE8]"
msgstr " [BE8]"
-#: elf32-arm.c:11870
+#: elf32-arm.c:12192
#, c-format
msgid " [LE8]"
msgstr " [LE8]"
-#: elf32-arm.c:11876
+#: elf32-arm.c:12198
#, c-format
msgid " <EABI version unrecognised>"
msgstr " <EABI-versio tunnistamaton>"
-#: elf32-arm.c:11883
+#: elf32-arm.c:12205
#, c-format
msgid " [relocatable executable]"
msgstr " [sijoitettava suoritettava tiedosto]"
-#: elf32-arm.c:11886
+#: elf32-arm.c:12208
#, c-format
msgid " [has entry point]"
msgstr " [on tulokohta]"
-#: elf32-arm.c:11891
+#: elf32-arm.c:12213 /src/binutils-gdb/bfd/elfnn-aarch64.c:4648
#, c-format
msgid "<Unrecognised flag bits set>"
msgstr "<Tunnistamaton lippubittijoukko>"
-#: elf32-arm.c:12189 elf32-i386.c:1461 elf32-s390.c:1000 elf32-tic6x.c:2829
-#: elf32-tilepro.c:1336 elf32-xtensa.c:1009 elf64-s390.c:960
-#: elf64-x86-64.c:1364 elfxx-sparc.c:1371 elfxx-tilegx.c:1586
+#: elf32-arm.c:12522 elf32-i386.c:1452 elf32-s390.c:1005 elf32-tic6x.c:2812
+#: elf32-tilepro.c:1511 elf32-xtensa.c:999 elf64-s390.c:927
+#: elf64-x86-64.c:1467 elfxx-sparc.c:1415 elfxx-tilegx.c:1728
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:5038
msgid "%B: bad symbol index: %d"
msgstr "%B: virheellinen symboli-indeksi: %d"
-#: elf32-arm.c:12337 elf64-x86-64.c:1561 elf64-x86-64.c:1732 elfxx-mips.c:8223
+#: elf32-arm.c:12674 elf32-metag.c:2283 elf64-x86-64.c:1593
+#: elf64-x86-64.c:1771 elfxx-mips.c:8482
msgid "%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"
-msgstr "%B: sijoitusta %s kohdetta â€%s†varten ei voida käyttää kun tehdään jaettua objektia; käännä uudelleen -fPIC-argumentilla"
+msgstr "%B: sijoitusta %s käyttäen â€%s†ei voida käyttää kun tehdään jaettua objektia; käännä uudelleen -fPIC-argumentilla"
-#: elf32-arm.c:13460
+#: elf32-arm.c:13796
#, c-format
msgid "Errors encountered processing file %s"
msgstr "Kohdattiin virheitä prosessoitaessa tiedostoa %s"
-#: elf32-arm.c:14837
+#: elf32-arm.c:14230
+#, c-format
+msgid "error: required section '%s' not found in the linker script"
+msgstr "virhe: vaadittua lohkoa ’%s’ ei löytynyt linkkeriskriptistä"
+
+#: elf32-arm.c:15252
msgid "%B: error: Cortex-A8 erratum stub is allocated in unsafe location"
msgstr "%B: virhe: Cortex-A8 virhe-stub on varattu turvattomaan paikkaan"
#. There's not much we can do apart from complain if this
#. happens.
-#: elf32-arm.c:14864
+#: elf32-arm.c:15279
msgid "%B: error: Cortex-A8 erratum stub out of range (input file too large)"
msgstr "%B: virhe: Cortex-A8 virhe-stub lukualueen ulkopuolella (syötetiedoston on liian iso)"
-#: elf32-arm.c:14958 elf32-arm.c:14980
+#: elf32-arm.c:15373 elf32-arm.c:15395
msgid "%B: error: VFP11 veneer out of range"
msgstr "%B: virhe: VFP11-julkisivu lukualueen ulkopuolella"
-#: elf32-arm.c:15518
+#: elf32-arm.c:16020
msgid "error: %B is already in final BE8 format"
msgstr "virhe: %B on jo lopullisessa BE8-muodossa"
-#: elf32-arm.c:15594
+#: elf32-arm.c:16096
msgid "error: Source object %B has EABI version %d, but target %B has EABI version %d"
msgstr "virhe: Lähdeobjektissa %B on EABI-versio %d, mutta kohteessa %B on EABI-versio %d"
-#: elf32-arm.c:15610
+#: elf32-arm.c:16112
msgid "error: %B is compiled for APCS-%d, whereas target %B uses APCS-%d"
msgstr "virhe: %B on käännetty APCS-%d:lle, kun taas kohde %B käyttää APCS-%d:ta"
# Vector floating point (coprosessor)
-#: elf32-arm.c:15635
+#: elf32-arm.c:16137
msgid "error: %B uses VFP instructions, whereas %B does not"
msgstr "virhe: %B käyttää vektoriliukulukukäskyjä, kun taas %B ei käytä"
# Floating Point Accelerator (chip)
-#: elf32-arm.c:15639
+#: elf32-arm.c:16141
msgid "error: %B uses FPA instructions, whereas %B does not"
msgstr "virhe: %B käyttää liukulukukiihdytinkäskyjä, kun taas %B ei käytä"
-#: elf32-arm.c:15649
+#: elf32-arm.c:16151
msgid "error: %B uses Maverick instructions, whereas %B does not"
msgstr "virhe: %B käyttää Maverick-käskyjä, kun taas %B ei käytä"
-#: elf32-arm.c:15653
+#: elf32-arm.c:16155
msgid "error: %B does not use Maverick instructions, whereas %B does"
msgstr "virhe: %B ei käytä Maverick-käskyjä, kun taas %B käyttää"
-#: elf32-arm.c:15672
+#: elf32-arm.c:16174
msgid "error: %B uses software FP, whereas %B uses hardware FP"
msgstr "virhe: %B käyttää ohjelmistoliukulukuja, kun taas %B käyttää laitteistoliukulukuja"
-#: elf32-arm.c:15676
+#: elf32-arm.c:16178
msgid "error: %B uses hardware FP, whereas %B uses software FP"
msgstr "virhe: %B käyttää laitteistoliukulukuja, kun taas %B käyttää ohjelmistoliukulukuja"
-#: elf32-avr.c:1229 elf32-bfin.c:3221 elf32-cris.c:2089 elf32-epiphany.c:567
-#: elf32-fr30.c:617 elf32-frv.c:4113 elf32-i860.c:1219 elf32-ip2k.c:1479
-#: elf32-iq2000.c:692 elf32-m32c.c:561 elf32-mep.c:543 elf32-moxie.c:290
-#: elf32-msp430.c:494 elf32-mt.c:399 elf32-openrisc.c:412 elf32-tilepro.c:3222
-#: elf32-v850.c:2151 elf32-xstormy16.c:943 elf64-mmix.c:1598
-#: elfxx-tilegx.c:3585
+#: elf32-avr.c:1264 elf32-bfin.c:3228 elf32-cris.c:2024 elf32-epiphany.c:568
+#: elf32-fr30.c:597 elf32-frv.c:4047 elf32-i860.c:1220 elf32-ip2k.c:1479
+#: elf32-iq2000.c:696 elf32-m32c.c:561 elf32-mep.c:543 elf32-metag.c:2000
+#: elf32-moxie.c:290 elf32-msp430.c:1325 elf32-mt.c:399 elf32-openrisc.c:412
+#: elf32-tilepro.c:3674 elf32-v850.c:2289 elf32-xstormy16.c:944
+#: elf64-mmix.c:1546 elfxx-tilegx.c:4059
msgid "internal error: dangerous relocation"
msgstr "sisäinen virhe: vaarallinen sijoitus"
-#: elf32-avr.c:2415 elf32-hppa.c:598 elf32-m68hc1x.c:166
+#: elf32-avr.c:2476 elf32-hppa.c:578 elf32-m68hc1x.c:160 elf32-metag.c:1197
+#: elf32-nios2.c:1357
msgid "%B: cannot create stub entry %s"
msgstr "%B: ei voi luoda stub-tulokohtaa %s"
@@ -1292,121 +1348,121 @@ msgstr "%B: ei voi luoda stub-tulokohtaa %s"
msgid "relocation should be even number"
msgstr "sijoituksen pitäisi olla parillinen numero"
-#: elf32-bfin.c:1593
+#: elf32-bfin.c:1601
msgid "%B(%A+0x%lx): unresolvable relocation against symbol `%s'"
msgstr "%B(%A+0x%lx): ratkaisematon sijoitus symboliin â€%sâ€"
-#: elf32-bfin.c:1626 elf32-i386.c:4307 elf32-m68k.c:4233 elf32-s390.c:3055
-#: elf64-s390.c:3030 elf64-x86-64.c:4151
+#: elf32-bfin.c:1634 elf32-i386.c:4406 elf32-m68k.c:4197 elf32-s390.c:3364
+#: elf64-s390.c:3290 elf64-x86-64.c:4506
msgid "%B(%A+0x%lx): reloc against `%s': error %d"
-msgstr "%B(%A+0x%lx): reloc-tietue kohdetta â€%s†varten: virhe %d"
+msgstr "%B(%A+0x%lx): reloc-tietue käyttäen kohdetta â€%sâ€: virhe %d"
-#: elf32-bfin.c:2725
+#: elf32-bfin.c:2732
msgid "%B: relocation at `%A+0x%x' references symbol `%s' with nonzero addend"
msgstr "%B: sijoitus kohteessa â€%A+0x%x†viittaa symboliin â€%sâ€, jossa on ei-nolla-yhteenlaskettava"
-#: elf32-bfin.c:2741
+#: elf32-bfin.c:2748
msgid "relocation references symbol not defined in the module"
msgstr "sijoitusviitteet-symboli ei ole määritelty modulissa"
-#: elf32-bfin.c:2838
+#: elf32-bfin.c:2845
msgid "R_BFIN_FUNCDESC references dynamic symbol with nonzero addend"
msgstr "R_BFIN_FUNCDESC viittaa dynaamiseen symboliin, jossa on ei-nolla-yhteenlaskettava"
-#: elf32-bfin.c:2879 elf32-bfin.c:3002
+#: elf32-bfin.c:2886 elf32-bfin.c:3009
msgid "cannot emit fixups in read-only section"
msgstr "ei voi lähettää korjauksia kirjoitussuojattuun lohkoon"
-#: elf32-bfin.c:2910 elf32-bfin.c:3040 elf32-lm32.c:1103 elf32-sh.c:5016
+#: elf32-bfin.c:2917 elf32-bfin.c:3047 elf32-lm32.c:1095 elf32-sh.c:4913
msgid "cannot emit dynamic relocations in read-only section"
-msgstr "ei voi lähettää dynaamisia sijoituksia kirjoitussuojattussa lohkossa"
+msgstr "ei voi lähettää dynaamisia sijoituksia kirjoitussuojatussa lohkossa"
-#: elf32-bfin.c:2960
+#: elf32-bfin.c:2967
msgid "R_BFIN_FUNCDESC_VALUE references dynamic symbol with nonzero addend"
msgstr "R_BFIN_FUNCDESC_VALUE viittaa dynaamiseen symboliin, jossa on ei-nolla-yhteenlaskettava"
-#: elf32-bfin.c:3125
+#: elf32-bfin.c:3132
msgid "relocations between different segments are not supported"
msgstr "sijoituksia eri segmenttien välillä ei tueta"
-#: elf32-bfin.c:3126
+#: elf32-bfin.c:3133
msgid "warning: relocation references a different segment"
msgstr "varoitus: sijoitus viittaa eri segmenttiin"
-#: elf32-bfin.c:4971
+#: elf32-bfin.c:4907
msgid "%B: unsupported relocation type %i"
msgstr "%B: ei-tuettu sijoitustyyppi %i"
# The FR-V FDPIC ABI: The FDPIC register is used as a base register for accessing the global offset table (GOT) and function descriptors.
# Yksi prosessorin rekistereistä on nimetty fdpic-rekisteriksi milloin data- ja tekstilohkot ovat sijoitettavia (eli niiden siirros ei ole vakio).
-#: elf32-bfin.c:5125 elf32-frv.c:6808
+#: elf32-bfin.c:4995 elf32-frv.c:6600
#, c-format
msgid "%s: cannot link non-fdpic object file into fdpic executable"
msgstr "%s: ei voi linkittää objektitiedostoa ilman fdpic-rekisteriä suoritettavaan tiedostoon, joka käyttää fdpic-rekisteriä"
-#: elf32-bfin.c:5129 elf32-frv.c:6812
+#: elf32-bfin.c:4999 elf32-frv.c:6604
#, c-format
msgid "%s: cannot link fdpic object file into non-fdpic executable"
msgstr "%s: ei voi linkittää fdpic-rekisteriä käyttävää objektitiedostoa suoritettavaan tiedostoon, joka ei käytä fdpic-rekisteriä"
-#: elf32-bfin.c:5283
+#: elf32-bfin.c:5153
#, c-format
msgid "*** check this relocation %s"
msgstr "*** tarkista tämä sijoitus %s"
-#: elf32-cris.c:1176
+#: elf32-cris.c:1110
msgid "%B, section %A: unresolvable relocation %s against symbol `%s'"
-msgstr "%B, lohko %A: ratkaisematon sijoitus %s symbolia â€%s†varten"
+msgstr "%B, lohko %A: ratkaisematon sijoitus %s käyttäen symbolia â€%sâ€"
# Procedure Linkage Table (PLT) and Global Offset Table (GOT)
-#: elf32-cris.c:1238
+#: elf32-cris.c:1172
msgid "%B, section %A: No PLT nor GOT for relocation %s against symbol `%s'"
-msgstr "%B, lohko %A: Ei proseduurilinkitystaulua eikä yleissiirrostaulua sijoitukselle %s symbolia â€%s†varten"
+msgstr "%B, lohko %A: Ei proseduurilinkitystaulua eikä yleissiirrostaulua sijoitukselle %s käyttäen symbolia â€%sâ€"
-#: elf32-cris.c:1240
+#: elf32-cris.c:1174
msgid "%B, section %A: No PLT for relocation %s against symbol `%s'"
-msgstr "%B, lohko %A: Ei proseduurilinkitystaulua sijoituksille %s symbolia â€%s†varten"
+msgstr "%B, lohko %A: Ei proseduurilinkitystaulua sijoituksille %s käyttäen symbolia â€%sâ€"
-#: elf32-cris.c:1246 elf32-cris.c:1379 elf32-cris.c:1639 elf32-cris.c:1722
-#: elf32-cris.c:1875 elf32-tic6x.c:2662
+#: elf32-cris.c:1180 elf32-cris.c:1313 elf32-cris.c:1573 elf32-cris.c:1656
+#: elf32-cris.c:1809 elf32-tic6x.c:2645
msgid "[whose name is lost]"
msgstr "[jonka nimi on kadonnut]"
-#: elf32-cris.c:1365 elf32-tic6x.c:2647
+#: elf32-cris.c:1299 elf32-tic6x.c:2630
msgid "%B, section %A: relocation %s with non-zero addend %d against local symbol"
-msgstr "%B, lohko %A: sijoitus %s ei-nolla-yhteenlaskettavalla %d paikallista symbolia varten"
+msgstr "%B, lohko %A: sijoitus %s ei-nolla-yhteenlaskettavalla %d käyttäen paikallista symbolia"
-#: elf32-cris.c:1373 elf32-cris.c:1716 elf32-cris.c:1869 elf32-tic6x.c:2655
+#: elf32-cris.c:1307 elf32-cris.c:1650 elf32-cris.c:1803 elf32-tic6x.c:2638
msgid "%B, section %A: relocation %s with non-zero addend %d against symbol `%s'"
-msgstr "%B, lohko %A: sijoitus %s ei-nolla-yhteenlaskettavalla %d symbolia â€%s†varten"
+msgstr "%B, lohko %A: sijoitus %s ei-nolla-yhteenlaskettavalla %d käyttäen symbolia â€%sâ€"
-#: elf32-cris.c:1399
+#: elf32-cris.c:1333
msgid "%B, section %A: relocation %s is not allowed for global symbol: `%s'"
msgstr "%B, lohko %A: sijoitusta %s ei sallita yleissymbolille: â€%sâ€"
-#: elf32-cris.c:1415
+#: elf32-cris.c:1349
msgid "%B, section %A: relocation %s with no GOT created"
msgstr "%B, lohko %A: sijoitus %s ilman yleissiirrostaulun luontia"
#. We shouldn't get here for GCC-emitted code.
-#: elf32-cris.c:1630
+#: elf32-cris.c:1564
msgid "%B, section %A: relocation %s has an undefined reference to `%s', perhaps a declaration mixup?"
msgstr "%B, lohkon %A: sijoituksella %s on määrittelemätön viite â€%sâ€, ehkä esittelysekaannus?"
-#: elf32-cris.c:2002
+#: elf32-cris.c:1937
msgid "%B, section %A: relocation %s is not allowed for symbol: `%s' which is defined outside the program, perhaps a declaration mixup?"
msgstr "%B, lohko %A: sijoitusta %s ei sallita symbolille: â€%sâ€, joka määritellään ohjelman ulkopuolella, ehkä esittelysekaannus?"
-#: elf32-cris.c:2055
+#: elf32-cris.c:1990
msgid "(too many global variables for -fpic: recompile with -fPIC)"
msgstr "(liian monta yleismuuttujaa valitsimelle -fpic: käännä uudelleen valitsimella -fPIC)"
-#: elf32-cris.c:2062
+#: elf32-cris.c:1997
msgid "(thread-local data too big for -fpic or -msmall-tls: recompile with -fPIC or -mno-small-tls)"
msgstr "(säikeen paikallinen data liian iso valitsimelle -fpic tai -msmall-tls: käännä uudelleen valitsimella -fPIC tai -mno-small-tls)"
# position-independent code (PIC)
-#: elf32-cris.c:3261
+#: elf32-cris.c:3234
msgid ""
"%B, section %A:\n"
" v10/v32 compatible object %s must not contain a PIC relocation"
@@ -1414,7 +1470,7 @@ msgstr ""
"%B, lohko %A:\n"
" v10/v32 yhteensopiva objekti %s ei saa sisältää paikkariippumatonta koodisijoitusta"
-#: elf32-cris.c:3366
+#: elf32-cris.c:3342
msgid ""
"%B, section %A:\n"
" relocation %s not valid in a shared object; typically an option mixup, recompile with -fPIC"
@@ -1422,7 +1478,7 @@ msgstr ""
"%B, lohko %A:\n"
" sijoitusta %s ei pitäisi käyttää jaetussa objektissa; tyypillisesti valitsinsekaannus, käännä uudelleen argumentilla -fPIC"
-#: elf32-cris.c:3580
+#: elf32-cris.c:3556
msgid ""
"%B, section %A:\n"
" relocation %s should not be used in a shared object; recompile with -fPIC"
@@ -1430,7 +1486,7 @@ msgstr ""
"%B, lohko %A:\n"
" sijoitusta %s ei pitäisi käyttää jaettussa objektissa; käännä uudelleen argumentilla -fPIC"
-#: elf32-cris.c:4002
+#: elf32-cris.c:3978
msgid ""
"%B, section `%A', to symbol `%s':\n"
" relocation %s should not be used in a shared object; recompile with -fPIC"
@@ -1438,39 +1494,39 @@ msgstr ""
"%B, lohko â€%Aâ€, symboliin â€%sâ€:\n"
" sijoitusta %s ei pitäisi käyttää jaettussa objektissa; käännä uudelleen argumentilla -fPIC"
-#: elf32-cris.c:4118
+#: elf32-cris.c:4091
msgid "Unexpected machine number"
msgstr "Odottamaton konenumero"
-#: elf32-cris.c:4172
+#: elf32-cris.c:4142
#, c-format
msgid " [symbols have a _ prefix]"
msgstr " [symboleissa on â€_â€-etuliite]"
-#: elf32-cris.c:4175
+#: elf32-cris.c:4145
#, c-format
msgid " [v10 and v32]"
msgstr " [v10 ja v32]"
-#: elf32-cris.c:4178
+#: elf32-cris.c:4148
#, c-format
msgid " [v32]"
msgstr " [v32]"
-#: elf32-cris.c:4223
+#: elf32-cris.c:4191
msgid "%B: uses _-prefixed symbols, but writing file with non-prefixed symbols"
msgstr "%B: käyttää â€_â€-etuliitesymboleja, mutta kirjoittaa tiedoston ilman etuliitesymboleja"
-#: elf32-cris.c:4224
+#: elf32-cris.c:4192
msgid "%B: uses non-prefixed symbols, but writing file with _-prefixed symbols"
msgstr "%B: käyttää ilman etuliitesymboleja, mutta kirjoittaa tiedoston â€_â€-etuliitesymboleilla"
# CRIS v32 info: The chip with the CRIS v32 core.
-#: elf32-cris.c:4243
+#: elf32-cris.c:4211
msgid "%B contains CRIS v32 code, incompatible with previous objects"
msgstr "%B sisältää â€CRIS v32â€-koodia, ei ole yhteensopiva aiempien objektien kanssa"
-#: elf32-cris.c:4245
+#: elf32-cris.c:4213
msgid "%B contains non-CRIS-v32 code, incompatible with previous objects"
msgstr "%B ei sisällä â€CRIS-v32â€-koodia, yhteensopimaton aiempien objektien kanssa"
@@ -1485,116 +1541,116 @@ msgid "BFD Link Error: jump (PC rel26) to section (%s) not supported"
msgstr "BFD-linkitysvirhe: hyppy (PC rel26) lohkoon (%s) ei ole tuettu"
#. Only if it's not an unresolved symbol.
-#: elf32-epiphany.c:563 elf32-ip2k.c:1475
+#: elf32-epiphany.c:564 elf32-ip2k.c:1475
msgid "unsupported relocation between data/insn address spaces"
msgstr "ei-tuettu sijoitus data/käskyosoitetilojen välillä"
-#: elf32-frv.c:1509 elf32-frv.c:1658
+#: elf32-frv.c:1460 elf32-frv.c:1609
msgid "relocation requires zero addend"
msgstr "sijoitus vaatii nolla-yhteenlaskettavan"
-#: elf32-frv.c:2888
+#: elf32-frv.c:2822
msgid "%H: relocation to `%s+%v' may have caused the error above\n"
msgstr "%H: sijoitus kohteeseen â€%s+%v†saattaa olla yläpuolella olevan virheen aiheuttama\n"
-#: elf32-frv.c:2905
+#: elf32-frv.c:2839
msgid "%H: relocation references symbol not defined in the module\n"
msgstr "%H: sijoitusviitteet-symboli ei ole määritelty modulissa\n"
-#: elf32-frv.c:2981
+#: elf32-frv.c:2915
msgid "%H: R_FRV_GETTLSOFF not applied to a call instruction\n"
msgstr "%H: R_FRV_GETTLSOFF ei sovelleta kutsukäskyyn\n"
-#: elf32-frv.c:3022
+#: elf32-frv.c:2956
msgid "%H: R_FRV_GOTTLSDESC12 not applied to an lddi instruction\n"
msgstr "%H: R_FRV_GOTTLSDESC12 ei sovelleta â€lddiâ€-käskyyn\n"
-#: elf32-frv.c:3093
+#: elf32-frv.c:3027
msgid "%H: R_FRV_GOTTLSDESCHI not applied to a sethi instruction\n"
msgstr "%H: R_FRV_GOTTLSDESCHI ei sovelleta â€sethiâ€-käskyyn\n"
-#: elf32-frv.c:3130
+#: elf32-frv.c:3064
msgid "%H: R_FRV_GOTTLSDESCLO not applied to a setlo or setlos instruction\n"
msgstr "%H: R_FRV_GOTTLSDESCLO ei sovelleta â€setloâ€- tai â€setlosâ€-käskyyn\n"
-#: elf32-frv.c:3177
+#: elf32-frv.c:3111
msgid "%H: R_FRV_TLSDESC_RELAX not applied to an ldd instruction\n"
msgstr "%H: R_FRV_TLSDESC_RELAX ei sovelleta â€lddâ€-käskyyn\n"
# msgid-virhe: calll, eli yksi ällä liikaa
-#: elf32-frv.c:3261
+#: elf32-frv.c:3195
msgid "%H: R_FRV_GETTLSOFF_RELAX not applied to a calll instruction\n"
msgstr "%H: R_FRV_GETTLSOFF_RELAX ei sovelleta kutsukäskyyn\n"
-#: elf32-frv.c:3315
+#: elf32-frv.c:3249
msgid "%H: R_FRV_GOTTLSOFF12 not applied to an ldi instruction\n"
msgstr "%H: R_FRV_GOTTLSOFF12 ei sovelleta â€ldiâ€-käskyyn\n"
-#: elf32-frv.c:3345
+#: elf32-frv.c:3279
msgid "%H: R_FRV_GOTTLSOFFHI not applied to a sethi instruction\n"
msgstr "%H: R_FRV_GOTTLSOFFHI ei sovelleta â€sethiâ€-käskyyn\n"
-#: elf32-frv.c:3374
+#: elf32-frv.c:3308
msgid "%H: R_FRV_GOTTLSOFFLO not applied to a setlo or setlos instruction\n"
msgstr "%H: R_FRV_GOTTLSOFFLO ei sovelleta â€setloâ€- tai â€setlosâ€-käskyyn\n"
-#: elf32-frv.c:3404
+#: elf32-frv.c:3338
msgid "%H: R_FRV_TLSOFF_RELAX not applied to an ld instruction\n"
msgstr "%H: R_FRV_TLSOFF_RELAX ei sovelleta â€ldâ€-käskyyn\n"
-#: elf32-frv.c:3449
+#: elf32-frv.c:3383
msgid "%H: R_FRV_TLSMOFFHI not applied to a sethi instruction\n"
msgstr "%H: R_FRV_TLSMOFFHI ei sovelleta â€sethiâ€-käskyyn\n"
-#: elf32-frv.c:3476
+#: elf32-frv.c:3410
msgid "R_FRV_TLSMOFFLO not applied to a setlo or setlos instruction\n"
msgstr "R_FRV_TLSMOFFLO ei sovelleta â€setloâ€- tai â€setlosâ€-käskyyn\n"
-#: elf32-frv.c:3597
+#: elf32-frv.c:3531
msgid "%H: R_FRV_FUNCDESC references dynamic symbol with nonzero addend\n"
msgstr "%H: R_FRV_FUNCDESC viittaa dynaamiseen symboliin ei-nolla-yhteenlaskettavalla\n"
-#: elf32-frv.c:3638 elf32-frv.c:3760
+#: elf32-frv.c:3572 elf32-frv.c:3694
msgid "%H: cannot emit fixups in read-only section\n"
msgstr "%H: ei voi lähettää korjauksia kirjoitussuojattuun lohkoon\n"
-#: elf32-frv.c:3669 elf32-frv.c:3803
+#: elf32-frv.c:3603 elf32-frv.c:3737
msgid "%H: cannot emit dynamic relocations in read-only section\n"
msgstr "%H: ei voi lähettää dynaamisia sijoituksia kirjoitussuojattussa lohkossa\n"
-#: elf32-frv.c:3718
+#: elf32-frv.c:3652
msgid "%H: R_FRV_FUNCDESC_VALUE references dynamic symbol with nonzero addend\n"
msgstr "%H: R_FRV_FUNCDESC_VALUE viittaa dynaamiseen symboliin ei-nolla-yhteenlaskettavalla\n"
-#: elf32-frv.c:3974
+#: elf32-frv.c:3908
msgid "%H: reloc against `%s' references a different segment\n"
msgstr "%H: sijoitus kohteeseen â€%s†viittaa eri segmenttiin\n"
-#: elf32-frv.c:4124
+#: elf32-frv.c:4058
msgid "%H: reloc against `%s': %s\n"
-msgstr "%H: reloc-tietue â€%sâ€: %s varten\n"
+msgstr "%H: reloc-tietue käyttäen kohdetta â€%sâ€: %s\n"
-#: elf32-frv.c:6400
+#: elf32-frv.c:6265
msgid "%B: unsupported relocation type %i\n"
msgstr "%B: ei-tuettu sijoitustyyppi %i\n"
-#: elf32-frv.c:6722
+#: elf32-frv.c:6514
#, c-format
msgid "%s: compiled with %s and linked with modules that use non-pic relocations"
msgstr "%s: käännetty %s:n kanssa ja linkitetty paikkariippuvaisia koodisijoituksia käyttävien modulien kanssa"
-#: elf32-frv.c:6775 elf32-iq2000.c:845 elf32-m32c.c:807
+#: elf32-frv.c:6567 elf32-iq2000.c:828 elf32-m32c.c:812
#, c-format
msgid "%s: compiled with %s and linked with modules compiled with %s"
msgstr "%s: käännetty %s:n kanssa ja linkitetty moduleihin, jotka on käännetty %s:n kanssa"
-#: elf32-frv.c:6787
+#: elf32-frv.c:6579
#, c-format
msgid "%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%lx)"
msgstr "%s: käyttää erilaisia tuntemattomia â€e_flags (0x%lx)â€-kenttiä kuin edelliset modulit (0x%lx)"
-#: elf32-frv.c:6837 elf32-iq2000.c:882 elf32-m32c.c:843 elf32-mt.c:576
-#: elf32-rx.c:3001
+#: elf32-frv.c:6627 elf32-iq2000.c:865 elf32-m32c.c:848 elf32-mt.c:561
+#: elf32-rl78.c:1069 elf32-rx.c:3040 elf64-ppc.c:5839
#, c-format
msgid "private flags = 0x%lx:"
msgstr "yksityiset liput = 0x%lx:"
@@ -1603,89 +1659,90 @@ msgstr "yksityiset liput = 0x%lx:"
msgid "%B: Relocations in generic ELF (EM: %d)"
msgstr "%B: Sijoituksia geneerisessä ELF (EM: %d):ssa"
-#: elf32-hppa.c:850 elf32-hppa.c:3598
+#: elf32-hppa.c:830 elf32-hppa.c:3592
msgid "%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"
msgstr "%B(%A+0x%lx): ei tavoita kohdetta %s, käännä uudelleen â€-ffunction-sectionsâ€-valitsimilla"
-#: elf32-hppa.c:1284
+#: elf32-hppa.c:1268
msgid "%B: relocation %s can not be used when making a shared object; recompile with -fPIC"
msgstr "%B: sijoitusta %s ei voi käyttää kun tehdään jaettua objektia; käännä uudelleen â€-fPICâ€-argumentilla"
-#: elf32-hppa.c:2791
+#: elf32-hppa.c:2781
msgid "%B: duplicate export stub %s"
msgstr "%B: vienti-stubin %s kaksoiskappale"
-#: elf32-hppa.c:3437
+#: elf32-hppa.c:3427
msgid "%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"
msgstr "%B(%A+0x%lx): %s korjaus käskylle 0x%x ei ole tuettu ei-jaetussa linkissä"
-#: elf32-hppa.c:4284
+#: elf32-hppa.c:4279
msgid "%B(%A+0x%lx): cannot handle %s for %s"
msgstr "%B(%A+0x%lx): ei voi käsitellä %s kohteelle %s"
-#: elf32-hppa.c:4603
+#: elf32-hppa.c:4598
msgid ".got section not immediately after .plt section"
msgstr "â€.gotâ€-alilohko ei ole välittömästi â€.pltâ€-lohkon jälkeen"
#. Unknown relocation.
-#: elf32-i386.c:373 elf32-m68k.c:384 elf32-ppc.c:1676 elf32-s390.c:379
-#: elf32-tic6x.c:2684 elf64-ppc.c:2300 elf64-s390.c:403 elf64-x86-64.c:265
+#: elf32-i386.c:380 elf32-m68k.c:353 elf32-ppc.c:2035 elf32-s390.c:345
+#: elf32-tic6x.c:2667 elf64-ppc.c:2427 elf64-s390.c:371 elf64-x86-64.c:281
msgid "%B: invalid relocation type %d"
msgstr "%B: virheellinen sijoitustyyppi %d"
-#: elf32-i386.c:1404 elf64-x86-64.c:1308
+#: elf32-i386.c:1394 elf64-x86-64.c:1410
msgid "%B: TLS transition from %s to %s against `%s' at 0x%lx in section `%A' failed"
-msgstr "%B: TLS-siirros kohteesta %s kohteeseen %s kohdetta â€%s†varten osoitteessa 0x%lx lohkossa â€%A†epäonnistui"
-
-#: elf32-i386.c:1549 elf32-i386.c:3244 elf64-x86-64.c:1487 elf64-x86-64.c:3125
-#: elfxx-sparc.c:3083
-msgid "%B: relocation %s against STT_GNU_IFUNC symbol `%s' isn't handled by %s"
-msgstr "%B: sijoitusta %s kohteen STT_GNU_IFUNC-symbolia â€%s†varten ei käsittele %s"
+msgstr "%B: TLS-siirros kohteesta %s kohteeseen %s käyttäen kohdetta â€%s†osoitteessa 0x%lx lohkossa â€%A†epäonnistui"
-#: elf32-i386.c:1711 elf32-s390.c:1182 elf32-sh.c:6362 elf32-tilepro.c:1434
-#: elf32-xtensa.c:1182 elf64-s390.c:1151 elfxx-sparc.c:1548
-#: elfxx-tilegx.c:1701
+#: elf32-i386.c:1642 elf32-s390.c:1233 elf32-sh.c:6263 elf32-tilepro.c:1627
+#: elf32-xtensa.c:1176 elf64-s390.c:1166 elfxx-sparc.c:1596
+#: elfxx-tilegx.c:1836
msgid "%B: `%s' accessed both as normal and thread local symbol"
msgstr "%B: â€%s†haettu sekä normaalina että säikeisenä paikallissymbolina"
-#: elf32-i386.c:2539 elf64-x86-64.c:2506
+#: elf32-i386.c:2500 elf64-x86-64.c:2582
msgid "%P: %B: warning: relocation against `%s' in readonly section `%A'.\n"
-msgstr "%P: %B: varoitus: sijoitus â€%s†varten kirjoitussuojatussa lohkossa â€%Aâ€.\n"
+msgstr "%P: %B: varoitus: sijoitus käyttäen kohdetta â€%s†kirjoitussuojatussa lohkossa â€%Aâ€.\n"
-#: elf32-i386.c:2629 elf64-x86-64.c:2593
+#: elf32-i386.c:2740 elf64-x86-64.c:2820
msgid "%P: %B: warning: relocation in readonly section `%A'.\n"
msgstr "%P: %B: varoitus: sijoitus kirjoitussuojatussa lohkossa â€%Aâ€.\n"
-#: elf32-i386.c:3086 elf32-tilepro.c:2557 elfxx-tilegx.c:2871
+#: elf32-i386.c:3207 elf32-tilepro.c:2873 elf64-x86-64.c:3275
+#: elfxx-tilegx.c:3172 /src/binutils-gdb/bfd/elfnn-aarch64.c:4099
msgid "%B: unrecognized relocation (0x%x) in section `%A'"
msgstr "%B: tunnistamaton sijoitus (0x%x) lohkossa â€%Aâ€"
-#: elf32-i386.c:3494 elf64-x86-64.c:3513
+#: elf32-i386.c:3368 elf64-x86-64.c:3380 elfxx-sparc.c:3150
+#: /src/binutils-gdb/bfd/elfnn-aarch64.c:3496
+msgid "%B: relocation %s against STT_GNU_IFUNC symbol `%s' isn't handled by %s"
+msgstr "%B: sijoitusta %s käyttäen kohteen STT_GNU_IFUNC-symbolia â€%s†ei käsittele %s"
+
+#: elf32-i386.c:3610 elf64-x86-64.c:3777
msgid "hidden symbol"
msgstr "piilotettu symboli"
-#: elf32-i386.c:3497 elf64-x86-64.c:3516
+#: elf32-i386.c:3613 elf64-x86-64.c:3780
msgid "internal symbol"
msgstr "sisäinen symboli"
-#: elf32-i386.c:3500 elf64-x86-64.c:3519
+#: elf32-i386.c:3616 elf64-x86-64.c:3783
msgid "protected symbol"
msgstr "suojattu symboli"
-#: elf32-i386.c:3503 elf64-x86-64.c:3522
+#: elf32-i386.c:3619 elf64-x86-64.c:3786
msgid "symbol"
msgstr "symboli"
-#: elf32-i386.c:3508
+#: elf32-i386.c:3624
msgid "%B: relocation R_386_GOTOFF against undefined %s `%s' can not be used when making a shared object"
-msgstr "%B: R_386_GOTOFF-sijoitusta määrittelemätöntä %s â€%s†varten ei voida käyttää kun tehdään jaettua objektia"
+msgstr "%B: R_386_GOTOFF-sijoitusta käyttäen määrittelemätöntä %s â€%s†ei voida käyttää kun tehdään jaettua objektia"
-#: elf32-i386.c:3518
+#: elf32-i386.c:3635
msgid "%B: relocation R_386_GOTOFF against protected function `%s' can not be used when making a shared object"
-msgstr "%B: R_386_GOTOFF-sijoitusta suojattua funktiota â€%s†varten ei voida käyttää kun tehdään jaettua objektia"
+msgstr "%B: R_386_GOTOFF-sijoitusta suojattua käyttäen funktiota â€%s†ei voida käyttää kun tehdään jaettua objektia"
-#: elf32-i386.c:4839 elf32-tilepro.c:3467 elf64-x86-64.c:4609
-#: elfxx-tilegx.c:3847
+#: elf32-i386.c:4923 elf32-tilepro.c:3923 elf64-x86-64.c:4964
+#: elfxx-tilegx.c:4326 /src/binutils-gdb/bfd/elfnn-aarch64.c:7105
#, c-format
msgid "discarded output section: `%A'"
msgstr "hylätty tulostelohko: â€%Aâ€"
@@ -1710,20 +1767,20 @@ msgstr "ip2k-linkkeri: puuttuva sivukäsky kohteessa 0x%08lx (kohde = 0x%08lx)."
msgid "ip2k linker: redundant page instruction at 0x%08lx (dest = 0x%08lx)."
msgstr "ip2k-linkkeri: redundanssisivukäsky kohteessa 0x%08lx (kohde = 0x%08lx)."
-#: elf32-iq2000.c:858 elf32-m32c.c:819
+#: elf32-iq2000.c:841 elf32-m32c.c:824
#, c-format
msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
msgstr "%s: käyttää eri â€e_flags (0x%lx)â€-kenttiä kuin edelliset modulit (0x%lx)"
-#: elf32-lm32.c:706
+#: elf32-lm32.c:698 elf32-nios2.c:2191
msgid "global pointer relative relocation when _gp not defined"
msgstr "yleisosoitinsuhteellinen sijoitus kun â€_gp†ei ole määritelty"
-#: elf32-lm32.c:761
+#: elf32-lm32.c:753 elf32-nios2.c:2623
msgid "global pointer relative address out of range"
msgstr "yleisosoittimen suhteellinen osoite lukualueen ulkopuolella"
-#: elf32-lm32.c:1057
+#: elf32-lm32.c:1049
msgid "internal error: addend should be zero for R_LM32_16_GOT"
msgstr "sisäinen virhe: yhteenlaskettavan pitäisi olla nolla kohteelle R_LM32_16_GOT"
@@ -1731,124 +1788,139 @@ msgstr "sisäinen virhe: yhteenlaskettavan pitäisi olla nolla kohteelle R_LM32_
msgid "SDA relocation when _SDA_BASE_ not defined"
msgstr "SDA-sijoitus kun â€_SDA_BASE_†ei ole määritelty"
-#: elf32-m32r.c:3043
+#: elf32-m32r.c:3003
msgid "%B: The target (%s) of an %s relocation is in the wrong section (%A)"
msgstr "%B: Kohteen (%s) sijoitus %s on väärässä lohkossa (%A)"
-#: elf32-m32r.c:3571
+#: elf32-m32r.c:3529
msgid "%B: Instruction set mismatch with previous modules"
msgstr "%B: Käskyjoukko ei täsmää edellisten modulien kanssa"
-#: elf32-m32r.c:3592
+#: elf32-m32r.c:3550 elf32-nds32.c:5636
#, c-format
msgid "private flags = %lx"
msgstr "yksityiset liput = %lx"
-#: elf32-m32r.c:3597
+#: elf32-m32r.c:3555
#, c-format
msgid ": m32r instructions"
msgstr ": m32r-käskyt"
-#: elf32-m32r.c:3598
+#: elf32-m32r.c:3556
#, c-format
msgid ": m32rx instructions"
msgstr ": m32rx-käskyt"
-#: elf32-m32r.c:3599
+#: elf32-m32r.c:3557
#, c-format
msgid ": m32r2 instructions"
msgstr ": m32r2-käskyt"
-#: elf32-m68hc1x.c:1050
+#: elf32-m68hc1x.c:1114
#, c-format
msgid "Reference to the far symbol `%s' using a wrong relocation may result in incorrect execution"
msgstr "Viite etäsymboliin â€%s†väärää sijoitusta käyttäen saattaa aiheuttaa virheellisen suorituksen"
+#: elf32-m68hc1x.c:1150
+#, c-format
+msgid "XGATE address (%lx) is not within shared RAM(0xE000-0xFFFF), therefore you must manually offset the address, and possibly manage the page, in your code."
+msgstr "XGATE-osoite (%lx) ei ole jaetun RAM(0xE000-0xFFFF)-muistin sisällä, siksi sinun on asetettava siirrososoite manuaalisesti, ja mahdollisesti hallittava sivu koodissasi."
+
# memory bank: A physical section of memory.
-#: elf32-m68hc1x.c:1073
+#: elf32-m68hc1x.c:1170
#, c-format
msgid "banked address [%lx:%04lx] (%lx) is not in the same bank as current banked address [%lx:%04lx] (%lx)"
msgstr "muistilohkottu osoite [%lx:%04lx] (%lx) ei ole samassa muistilohkossa kuin nykyinen muistilohkottu osoite [%lx:%04lx] (%lx)"
-#: elf32-m68hc1x.c:1092
+#: elf32-m68hc1x.c:1190
#, c-format
msgid "reference to a banked address [%lx:%04lx] in the normal address space at %04lx"
msgstr "viite muistilohkottuun osoitteeseen [%lx:%04lx] tavallisessa osoitetilassa osoitteessa %04lx"
-#: elf32-m68hc1x.c:1225
+#: elf32-m68hc1x.c:1237
+#, c-format
+msgid "S12 address (%lx) is not within shared RAM(0x2000-0x4000), therefore you must manually offset the address in your code"
+msgstr "S12-osoite (%lx) ei ole jaetun RAM(0x2000-0x4000)-muistin sisällä, siksi sinun on asetettava siirrososoite koodissasi manuaalisesti"
+
+#: elf32-m68hc1x.c:1370
msgid "%B: linking files compiled for 16-bit integers (-mshort) and others for 32-bit integers"
msgstr "%B: linkitystiedostot käännetty 16-bittisille kokonaisluvuille (-mshort) ja muut 32-bittisille kokonaisluvuille"
-#: elf32-m68hc1x.c:1232
+#: elf32-m68hc1x.c:1377
msgid "%B: linking files compiled for 32-bit double (-fshort-double) and others for 64-bit double"
msgstr "%B: linkitystiedostot käännetty 32-bittiselle double-liukuluvulle (-fshort-double) ja muut 64-bittiselle double-liukuluvulle"
-#: elf32-m68hc1x.c:1241
+#: elf32-m68hc1x.c:1386
msgid "%B: linking files compiled for HCS12 with others compiled for HC12"
msgstr "%B: linkitystiedostot käännetty HCS12:lle, muut käännetty HC12:lle"
-#: elf32-m68hc1x.c:1257 elf32-ppc.c:4227 elf64-sparc.c:706 elfxx-mips.c:13965
+#: elf32-m68hc1x.c:1402 elf32-ppc.c:4776 elf64-sparc.c:706 elfxx-mips.c:14817
msgid "%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
msgstr "%B: käyttää eri â€e_flags (0x%lx)â€-kenttiä kuin edelliset modulit (0x%lx)"
-#: elf32-m68hc1x.c:1285
+#: elf32-m68hc1x.c:1430 elf32-xgate.c:677
#, c-format
msgid "[abi=32-bit int, "
msgstr "[abi=32-bittinen kokonaisluku, "
-#: elf32-m68hc1x.c:1287
+#: elf32-m68hc1x.c:1432 elf32-xgate.c:679
#, c-format
msgid "[abi=16-bit int, "
msgstr "[abi=16-bittinen kokonaisluku, "
-#: elf32-m68hc1x.c:1290
+#: elf32-m68hc1x.c:1435 elf32-xgate.c:682
#, c-format
msgid "64-bit double, "
msgstr "64-bittinen double-liukuluku, "
-#: elf32-m68hc1x.c:1292
+#: elf32-m68hc1x.c:1437 elf32-xgate.c:684
#, c-format
msgid "32-bit double, "
msgstr "32-bittinen double-liukuluku, "
-#: elf32-m68hc1x.c:1295
+#: elf32-m68hc1x.c:1440
#, c-format
msgid "cpu=HC11]"
msgstr "prosessori=HC11]"
-#: elf32-m68hc1x.c:1297
+#: elf32-m68hc1x.c:1442
#, c-format
msgid "cpu=HCS12]"
msgstr "prosessori=HCS12]"
-#: elf32-m68hc1x.c:1299
+#: elf32-m68hc1x.c:1444
#, c-format
msgid "cpu=HC12]"
msgstr "prosessori=HC12]"
-#: elf32-m68hc1x.c:1302
+#: elf32-m68hc1x.c:1447
#, c-format
msgid " [memory=bank-model]"
msgstr " [muisti=muistilohkomalli]"
-#: elf32-m68hc1x.c:1304
+#: elf32-m68hc1x.c:1449
#, c-format
msgid " [memory=flat]"
msgstr " [muisti=litteä]"
-#: elf32-m68k.c:1251 elf32-m68k.c:1252 vms-alpha.c:7314 vms-alpha.c:7329
+#: elf32-m68hc1x.c:1452
+#, c-format
+msgid " [XGATE RAM offsetting]"
+msgstr " [XGATE RAM-siirrososoiteasetus]"
+
+#: elf32-m68k.c:1210 elf32-m68k.c:1211 vms-alpha.c:7207 vms-alpha.c:7222
msgid "unknown"
msgstr "tuntematon"
-#: elf32-m68k.c:1715
+#: elf32-m68k.c:1674
msgid "%B: GOT overflow: Number of relocations with 8-bit offset > %d"
msgstr "%B: Yleissiirrostaulun ylivuoto: 8-bittisellä siirrososoitteella varustettujen sijoitusten lukumäärä > %d"
-#: elf32-m68k.c:1721
+#: elf32-m68k.c:1680
msgid "%B: GOT overflow: Number of relocations with 8- or 16-bit offset > %d"
msgstr "%B: Yleissiirrostaulun ylivuoto: 8-bittisellä tai 16-bittisellä siirrososoitteella varustettujen sijoitusten lukumäärä > %d"
-#: elf32-m68k.c:3957
+#: elf32-m68k.c:3921
msgid "%B(%A+0x%lx): R_68K_TLS_LE32 relocation not permitted in shared object"
msgstr "%B(%A+0x%lx): R_68K_TLS_LE32-sijoitukset eivät ole sallittuja jaetuissa objekteissa"
@@ -1871,135 +1943,298 @@ msgstr "mep: ei reloc-tietuetta koodille %d"
msgid "MeP: howto %d has type %d"
msgstr "MeP: kuinka tehdä -kohteella %d on tyyppi %d"
-#: elf32-mep.c:648
+#: elf32-mep.c:632
msgid "%B and %B are for different cores"
msgstr "%B ja %B ovat eri käyttöjärjestelmäytimille"
-#: elf32-mep.c:665
+#: elf32-mep.c:649
msgid "%B and %B are for different configurations"
msgstr "%B ja %B ovat eri konfiguraatioille"
-#: elf32-mep.c:702
+#: elf32-mep.c:686
#, c-format
msgid "private flags = 0x%lx"
msgstr "yksityiset liput = 0x%lx"
-#: elf32-microblaze.c:742
+#: elf32-metag.c:1921
+msgid "%B(%A+0x%lx): R_METAG_TLS_LE/IENONPIC relocation not permitted in shared object"
+msgstr "%B(%A+0x%lx): R_METAG_TLS_LE/IENONPIC-sijoitukset eivät ole sallittuja jaetuissa objekteissa"
+
+#: elf32-microblaze.c:950
#, c-format
msgid "%s: unknown relocation type %d"
msgstr "%s: tuntematon sijoitustyyppi %d"
-#: elf32-microblaze.c:867 elf32-microblaze.c:912
+#: elf32-microblaze.c:1076 elf32-microblaze.c:1121
#, c-format
msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)"
msgstr "%s: Kohteen (%s) sijoitus %s on väärässä lohkossa (%s)"
-#: elf32-microblaze.c:1155 elf32-tilepro.c:2891 elfxx-sparc.c:3457
-#: elfxx-tilegx.c:3230
+#: elf32-microblaze.c:1484 elf32-tilepro.c:3320 elfxx-sparc.c:3526
+#: elfxx-tilegx.c:3729
msgid "%B: probably compiled without -fPIC?"
msgstr "%B: luultavasti käännetty ilman -fPIC-argumenttia?"
-#: elf32-microblaze.c:2074
-msgid "%B: bad relocation section name `%s'"
-msgstr "%B: virheellinen sijoituslohkonimi â€%sâ€"
-
-#: elf32-mips.c:1549 elf64-mips.c:2683 elfn32-mips.c:2487
+#: elf32-mips.c:1670 elf64-mips.c:2990 elfn32-mips.c:2793
msgid "literal relocation occurs for an external symbol"
msgstr "literaali sijoitus tapahtuu ulkoiselle symbolille"
-#: elf32-mips.c:1596 elf32-score.c:570 elf32-score7.c:469 elf64-mips.c:2726
-#: elfn32-mips.c:2528
+#: elf32-mips.c:1717 elf32-score.c:570 elf32-score7.c:469 elf64-mips.c:3033
+#: elfn32-mips.c:2834
msgid "32bits gp relative relocation occurs for an external symbol"
msgstr "32-bittinen yleisosoitinsuhteellinen sijoitus tapahtuu ulkoiselle symbolille"
-#: elf32-ppc.c:1741
+#: elf32-msp430.c:801 elf32-msp430.c:1109
+msgid "Try enabling relaxation to avoid relocation truncations"
+msgstr "Yritä ottaa käyttöön avartaminen sijoituksen typistymisien välttämiseksi"
+
+#: elf32-msp430.c:1317
+msgid "internal error: branch/jump to an odd address detected"
+msgstr "sisäinen virhe: havaittu haarautuma/hyppy parittomaan"
+
+#: elf32-msp430.c:2221
+msgid "Warning: %B: Unknown MSPABI object attribute %d"
+msgstr "Varoitus: %B: Tuntematon MSPABI-objektiattribuutti %d"
+
+# Vector floating point (coprosessor)
+#: elf32-msp430.c:2312
+msgid "error: %B uses %s instructions but %B uses %s"
+msgstr "virhe: %B käyttää %s-käskyjä, mutta %B käyttää %s"
+
+#: elf32-msp430.c:2324
+msgid "error: %B uses the %s code model whereas %B uses the %s code model"
+msgstr "virhe: %B käyttää %s-koodimallia, kun taas %B käyttää %s-koodimallia"
+
+#: elf32-msp430.c:2336
+msgid "error: %B uses the large code model but %B uses MSP430 instructions"
+msgstr "virhe: %B käyttää laajaa koodimallia, mutta %B käyttää MSP430-käskyjä"
+
+#: elf32-msp430.c:2346
+msgid "error: %B uses the %s data model whereas %B uses the %s data model"
+msgstr "virhe: %B käyttää %s-datamallia, kun taas %B käyttää %s-datamallia"
+
+#: elf32-msp430.c:2358
+msgid "error: %B uses the small code model but %B uses the %s data model"
+msgstr "virhe: %B käyttää pientä koodimallia, mutta %B käyttää %s-datamallia"
+
+#: elf32-msp430.c:2369
+msgid "error: %B uses the %s data model but %B only uses MSP430 instructions"
+msgstr "virhe: %B käyttää %s-datamallia, mutta %B käyttää vain MSP430-käskyjä"
+
+#: elf32-nds32.c:2921
+msgid "error: Can't find symbol: _SDA_BASE_."
+msgstr "virhe: Symbolia ei löytynyt: _SDA_BASE_.â€"
+
+#: elf32-nds32.c:4142
+msgid "%B: error: unknown relocation type %d."
+msgstr "%B: virhe: tuntematon sijoitustyyppi %d."
+
+#: elf32-nds32.c:4584
+#, c-format
+msgid "%s: warning: cannot deal R_NDS32_25_ABS_RELA in shared mode."
+msgstr "%s: varoitus: R_NDS32_25_ABS_RELA-käsittely jaetussa objektissa epäonnistui."
+
+#: elf32-nds32.c:4716
+msgid "%B: warning: unaligned access to GOT entry."
+msgstr "%B: varoitus: tasaamaton pääsy yleissiirrostaulukohtaan."
+
+#: elf32-nds32.c:4758
+msgid "%B: warning: relocate SDA_BASE failed."
+msgstr "%B: varoitus: SDA_BASE-sijoitus epäonnistui."
+
+#: elf32-nds32.c:4779
+msgid "%B(%A): warning: unaligned small data access of type %d."
+msgstr "%B(%A): varoitus: tasaamaton %d-tyypin small data-pääsy."
+
+#: elf32-nds32.c:5446
+msgid "%B: ISR vector size mismatch with previous modules, previous %u-byte, current %u-byte"
+msgstr "%B: ISR-vektorikokotäsmäämättömyys edelliseen moduliin, edellinen %u-tavu, nykyinen %u-tavu"
+
+#: elf32-nds32.c:5489
+msgid "%B: warning: Endian mismatch with previous modules."
+msgstr "%B: varoitus: Endian-tavujärjestystäsmäämättömyys edellisiin moduleihin."
+
+#: elf32-nds32.c:5499
+msgid "%B: warning: Older version of object file encountered, Please recompile with current tool chain."
+msgstr "%B: varoitus: Objektitiedoston vanhempi versio kohdattu, käännä uudelleen nykyisellä työkaluketjulla."
+
+#: elf32-nds32.c:5577
+msgid "%B: error: ABI mismatch with previous modules."
+msgstr "%B: virhe: ABI-täsmäämättömyys edellisten modulien kanssa."
+
+#: elf32-nds32.c:5588
+msgid "%B: error: Instruction set mismatch with previous modules."
+msgstr "%B: virhe: Käskyjoukko ei täsmää edellisten modulien kanssa."
+
+#: elf32-nds32.c:5612
+msgid "%B: warning: Incompatible elf-versions %s and %s."
+msgstr "%B: varoitus: Yhteensopimattomat elf-versiot %s ja %s."
+
+#: elf32-nds32.c:5642
+#, c-format
+msgid ": n1 instructions"
+msgstr ": n1-käskyt"
+
+#: elf32-nds32.c:5645
+#, c-format
+msgid ": n1h instructions"
+msgstr ": n1h-käskyt"
+
+#: elf32-nds32.c:8147
+msgid "%B: %s\n"
+msgstr "%B: %s\n"
+
+#: elf32-nds32.c:8449
+msgid "%B(%A): warning: relax is suppressed for sections of alignment %d-bytes > 4-byte."
+msgstr "%B(%A): varoitus: relax on vaimennettu lohkoissa, joissa tasaus %d-tavua > 4-tavu."
+
+#: elf32-nds32.c:8502
+msgid "%B: error: Cannot set _ITB_BASE_"
+msgstr "%B: virhe: _ITB_BASE_-asetus epäonnistui"
+
+#: elf32-nds32.c:11384
+msgid "%B: Nested OMIT_FP in %A."
+msgstr "%B: Sisäkkäinen OMIT_FP kohteessa %A."
+
+#: elf32-nds32.c:11401
+msgid "%B: Unmatched OMIT_FP in %A."
+msgstr "%B: Täsmäämätön OMIT_FP kohteessa %A."
+
+#: elf32-nds32.c:13357
+msgid "Linker: cannot init ex9 hash table error \n"
+msgstr "Linkkeri: ex9-tiivistetauluvirheen alustus epäonnistui\n"
+
+#: elf32-nds32.c:13790 elf32-nds32.c:13804
+msgid "Linker: error cannot fixed ex9 relocation \n"
+msgstr "Linkkeri: virhe: ex9-sijoituksen korjaus epäonnistui\n"
+
+#: elf32-nds32.c:14015
+#, c-format
+msgid "%s: warning: unaligned small data access. For entry: {%d, %d, %d}, addr = 0x%x, align = 0x%x."
+msgstr "%s: varoitus: tasaamaton small data-pääsy. Kohde: {%d, %d, %d}, osoite = 0x%x, tasaus = 0x%x."
+
+#: elf32-nds32.c:14047
+msgid "%P%F: failed creating ex9.it %s hash table: %E\n"
+msgstr "%P%F: ex9.it %s-tiivistetaulun luominen epäonnistui: %E\n"
+
+#: elf32-nios2.c:2861
+#, c-format
+msgid "global pointer relative relocation at address 0x%08x when _gp not defined\n"
+msgstr "yleisosoitinsuhteellinen sijoitus osoitteessa 0x%08x kun _gp ei ole määritelty\n"
+
+#: elf32-nios2.c:2878
+#, c-format
+msgid "Unable to reach %s (at 0x%08x) from the global pointer (at 0x%08x) because the offset (%d) is out of the allowed range, -32678 to 32767.\n"
+msgstr "Kohteen %s (osoitteessa 0x%08x) tavoittaminen yleisosoittimesta epäonnistui (osoitteessa 0x%08x) koska siirrososoite (%d) on sallitun lukualueen -32678 ... 32767 ulkopuolella.\n"
+
+#: elf32-nios2.c:3392
+msgid "%B(%A+0x%lx): R_NIOS2_TLS_LE16 relocation not permitted in shared object"
+msgstr "%B(%A+0x%lx): R_NIOS2_TLS_LE16-sijoitus ei ole sallittu jaetussa objektissa"
+
+#: elf32-nios2.c:3520
+msgid "relocation out of range"
+msgstr "sijoitus lukualueen ulkopuolella"
+
+#: elf32-nios2.c:3530 elf32-tic6x.c:2744
+msgid "dangerous relocation"
+msgstr "vaarallinen sijoitus"
+
+#: elf32-nios2.c:4529
+#, c-format
+msgid "dynamic variable `%s' is zero size"
+msgstr "dynaaminen muuttuja â€%s†on nollakokoinen"
+
+#: elf32-ppc.c:2100
#, c-format
msgid "generic linker can't handle %s"
msgstr "geneerinen linkkeri ei voi käsitellä kohdetta %s"
-#: elf32-ppc.c:2184
+#: elf32-ppc.c:2642
msgid "corrupt %s section in %B"
msgstr "rikkinäinen %s-lohko kohteessa %B"
-#: elf32-ppc.c:2203
+#: elf32-ppc.c:2661
msgid "unable to read in %s section from %B"
msgstr "ei voi lukea %s-lohkoon kohteesta %B"
-#: elf32-ppc.c:2244
+#: elf32-ppc.c:2702
msgid "warning: unable to set size of %s section in %B"
msgstr "varoitus: ei voi asettaa %s-lohkon kokoa kohteessa %B"
-#: elf32-ppc.c:2294
+#: elf32-ppc.c:2752
msgid "failed to allocate space for new APUinfo section."
msgstr "ei onnistuttu varaamaan muistitilaa uudelle APUinfo-lohkolle."
-#: elf32-ppc.c:2313
+#: elf32-ppc.c:2771
msgid "failed to compute new APUinfo section."
msgstr "ei onnistuttu laskemaan uutta APUinfo-lohkoa"
-#: elf32-ppc.c:2316
+#: elf32-ppc.c:2774
msgid "failed to install new APUinfo section."
msgstr "ei onnistuttu asentamaan uutta APUinfo-lohkoa"
-#: elf32-ppc.c:3356
+#: elf32-ppc.c:3844
msgid "%B: relocation %s cannot be used when making a shared object"
msgstr "%B: sijoitusta %s ei voi käyttää kun tehdään jaettua objektia"
#. It does not make sense to have a procedure linkage
#. table entry for a local symbol.
-#: elf32-ppc.c:3700
+#: elf32-ppc.c:4218
msgid "%P: %H: %s reloc against local symbol\n"
-msgstr "%P: %H: %s reloc-tietue paikallista symbolia varten\n"
+msgstr "%P: %H: %s reloc-tietue käyttäen paikallista symbolia\n"
+
+#: elf32-ppc.c:4299
+msgid "%P: %H: @local call to ifunc %s\n"
+msgstr "%P: %H: @local-kutsu kohteeseen ifunc %s\n"
# Otaksun tässä että hard float tarkoittaa tässä muistipaikkaa (esim. rekisteriä), joka on varattu float-tyyppisille liukuluvuille
-#: elf32-ppc.c:4039 elf32-ppc.c:4054 elfxx-mips.c:13651 elfxx-mips.c:13677
-#: elfxx-mips.c:13699 elfxx-mips.c:13725
+#: elf32-ppc.c:4588 elf32-ppc.c:4603
msgid "Warning: %B uses hard float, %B uses soft float"
msgstr "Varoitus: %B käyttää laitteistoliukulukua, %B käyttää ohjelmistoliukulukua"
# Otaksun tässä että hard float tarkoittaa tässä muistipaikkaa (esim. rekisteriä), joka on varattu float-tyyppisille liukuluvuille
-#: elf32-ppc.c:4042 elf32-ppc.c:4046
+#: elf32-ppc.c:4591 elf32-ppc.c:4595
msgid "Warning: %B uses double-precision hard float, %B uses single-precision hard float"
msgstr "Varoitus: %B käyttää kaksoistarkkuuden laitteistoliukulukua, %B käyttää yksittäistarkkuuden laitteistoliukulukua"
# Otaksun tässä että hard float tarkoittaa tässä muistipaikkaa (esim. rekisteriä), joka on varattu float-tyyppisille liukuluvuille
-#: elf32-ppc.c:4050
+#: elf32-ppc.c:4599
msgid "Warning: %B uses soft float, %B uses single-precision hard float"
msgstr "Varoitus: %B käyttää ohjelmistoliukulukua, %B käyttää yksittäistarkkuuden laitteistoliukulukua"
-#: elf32-ppc.c:4057 elf32-ppc.c:4061 elfxx-mips.c:13631 elfxx-mips.c:13635
+#: elf32-ppc.c:4606 elf32-ppc.c:4610
msgid "Warning: %B uses unknown floating point ABI %d"
msgstr "Varoitus: %B käyttää tuntematonta liukuluku-ABI:a %d"
-#: elf32-ppc.c:4103 elf32-ppc.c:4107
+#: elf32-ppc.c:4652 elf32-ppc.c:4656
msgid "Warning: %B uses unknown vector ABI %d"
msgstr "Varoitus: %B käyttää tuntematonta vektori-ABI:a %d"
-#: elf32-ppc.c:4111
+#: elf32-ppc.c:4660
msgid "Warning: %B uses vector ABI \"%s\", %B uses \"%s\""
msgstr "Varoitus: %B käyttää vektori-ABI:a â€%sâ€, %B käyttää â€%sâ€"
-#: elf32-ppc.c:4128 elf32-ppc.c:4131
+#: elf32-ppc.c:4677 elf32-ppc.c:4680
msgid "Warning: %B uses r3/r4 for small structure returns, %B uses memory"
msgstr "Varoitus: %B käyttää r3/r4 pienille rakennepaluille, %B käyttää muistia"
-#: elf32-ppc.c:4134 elf32-ppc.c:4138
+#: elf32-ppc.c:4683 elf32-ppc.c:4687
msgid "Warning: %B uses unknown small structure return convention %d"
msgstr "Varoitus: %B käyttää tuntematonta pientä rakennepaluusopimusta %d"
-#: elf32-ppc.c:4192
+#: elf32-ppc.c:4741
msgid "%B: compiled with -mrelocatable and linked with modules compiled normally"
msgstr "%B: käännetty â€-mrelocatableâ€-argumentilla ja linkitetty tavallisesti käännetyillä moduleilla"
-#: elf32-ppc.c:4200
+#: elf32-ppc.c:4749
msgid "%B: compiled normally and linked with modules compiled with -mrelocatable"
msgstr "%B: käännetty tavallisesti ja linkitetty moduleilla, jotka on käännetty â€-mrelocatableâ€-argumentilla"
-#: elf32-ppc.c:4309
+#: elf32-ppc.c:4872
msgid "%P: bss-plt forced due to %B\n"
msgstr "%P: bss-plt-argumentti pakotettu %B:n vuoksi\n"
-#: elf32-ppc.c:4312
+#: elf32-ppc.c:4875
msgid "%P: bss-plt forced by profiling\n"
msgstr "%P: profilointi pakotti bss-plt-argumentin\n"
@@ -2007,101 +2242,113 @@ msgstr "%P: profilointi pakotti bss-plt-argumentin\n"
#. could just mark this symbol to exclude it
#. from tls optimization but it's safer to skip
#. the entire optimization.
-#: elf32-ppc.c:4809 elf64-ppc.c:7858
+#: elf32-ppc.c:5369 elf64-ppc.c:8371
msgid "%H arg lost __tls_get_addr, TLS optimization disabled\n"
msgstr "%H argumentti lost __tls_get_addr, TLS otimointi poistettu käytöstä\n"
-#: elf32-ppc.c:5044 elf64-ppc.c:6528
-msgid "%P: dynamic variable `%s' is zero size\n"
-msgstr "%P: dynaaminen muuttuja â€%s†on nollakokoinen\n"
-
-#: elf32-ppc.c:7263 elf64-ppc.c:12675
+#: elf32-ppc.c:7927
msgid "%P: %B: unknown relocation type %d for symbol %s\n"
msgstr "%P: %B: tuntematon sijoitustyyppi %d symbolille %s\n"
-#: elf32-ppc.c:7524
+#: elf32-ppc.c:8191
msgid "%P: %H: non-zero addend on %s reloc against `%s'\n"
-msgstr "%P: %H: ei-nolla-yhteenlaskettava %s reloc-tietueessa symbolia â€%s†varten\n"
+msgstr "%P: %H: ei-nolla-yhteenlaskettava %s reloc-tietueessa käyttäen symbolia â€%sâ€\n"
-#: elf32-ppc.c:7720 elf64-ppc.c:13181
+#: elf32-ppc.c:8389
msgid "%P: %H: relocation %s for indirect function %s unsupported\n"
msgstr "%P: %H: sijoitusta %s epäsuoralle funktiolle %s ei tueta\n"
-#: elf32-ppc.c:7948 elf32-ppc.c:7978 elf32-ppc.c:8025
+#: elf32-ppc.c:8646 elf32-ppc.c:8676 elf32-ppc.c:8767
msgid "%P: %B: the target (%s) of a %s relocation is in the wrong output section (%s)\n"
msgstr "%P: %B: kohde (%s) sijoituksessa %s on väärässä tulostelohkossa (%s)\n"
-#: elf32-ppc.c:8097
+#: elf32-ppc.c:8854
+msgid "%B: the target (%s) of a %s relocation is in the wrong output section (%s)"
+msgstr "%B: kohde (%s) sijoituksessa %s on väärässä tulostelohkossa (%s)"
+
+#: elf32-ppc.c:8958
msgid "%P: %B: relocation %s is not yet supported for symbol %s\n"
-msgstr "%P: %B: sijoitus %s ei ole vielä tuettu symbolille %s.\n"
+msgstr "%P: %B: sijoitus %s ei ole vielä tuettu symbolille %s\n"
+
+#: elf32-ppc.c:9038
+msgid "%P: %H: error: %s against `%s' not a multiple of %u\n"
+msgstr "%P: %H: virhe: sijoitus %s käyttäen kohdetta â€%s†ei ole %u:n kerrannainen\n"
-#: elf32-ppc.c:8158 elf64-ppc.c:13467
+#: elf32-ppc.c:9067
msgid "%P: %H: unresolvable %s relocation against symbol `%s'\n"
-msgstr "%P: %H: ratkaisematon %s sijoitus symbolia â€%s†varten\n"
+msgstr "%P: %H: ratkaisematon %s sijoitus käyttäen symbolia â€%sâ€\n"
-#: elf32-ppc.c:8205 elf64-ppc.c:13512
+#: elf32-ppc.c:9114
msgid "%P: %H: %s reloc against `%s': error %d\n"
-msgstr "%P: %H: %s reloc-tietuetta â€%s†varten: virhe %d\n"
+msgstr "%P: %H: %s reloc-tietue käyttäen kohdetta â€%sâ€: virhe %d\n"
-#: elf32-ppc.c:8696
+#: elf32-ppc.c:9750
msgid "%P: %s not defined in linker created %s\n"
msgstr "%P: %s ei ole määritelty linkkerissä luodussa %s\n"
-#: elf32-rx.c:563
-msgid "%B:%A: Warning: deprecated Red Hat reloc "
-msgstr "%B:%A: Varoitus: vanhentunut Red Hat reloc -tietue "
-
-#. Check for unsafe relocs in PID mode. These are any relocs where
-#. an absolute address is being computed. There are special cases
-#. for relocs against symbols that are known to be referenced in
-#. crt0.o before the PID base address register has been initialised.
-#: elf32-rx.c:581
-msgid "%B(%A): unsafe PID relocation %s at 0x%08lx (against %s in %s)"
-msgstr "%B(%A): turvaton PID-sijoitus %s osoitteessa 0x%08lx (symbolia %s vastaan kohteessa %s)"
+#: elf32-rl78.c:784
+msgid "Warning: RL78_SYM reloc with an unknown symbol"
+msgstr "Varoitus: RL78_SYM-reloc tuntemattomalla symbolilla"
-#: elf32-rx.c:1157
-msgid "Warning: RX_SYM reloc with an unknown symbol"
-msgstr "Varoitus: RX_SYM-reloc tuntemattomalla symbolilla"
-
-#: elf32-rx.c:1324
+#: elf32-rl78.c:952 elf32-rx.c:1324
msgid "%B(%A): error: call to undefined function '%s'"
msgstr "%B(%A): virhe: kutsu määrittelemättömään funktioon ’%s’"
-#: elf32-rx.c:1338
+#: elf32-rl78.c:966 elf32-rx.c:1338
msgid "%B(%A): warning: unaligned access to symbol '%s' in the small data area"
msgstr "%B(%A): varoitus: tasaamaton pääsy symboliin ’%s’ pienellä data-alueella"
-#: elf32-rx.c:1342
+#: elf32-rl78.c:970 elf32-rx.c:1342
msgid "%B(%A): internal error: out of range error"
msgstr "%B(%A): sisäinen virhe: â€lukualueen ulkopuolellaâ€-virhe"
-#: elf32-rx.c:1346
+#: elf32-rl78.c:974 elf32-rx.c:1346
msgid "%B(%A): internal error: unsupported relocation error"
msgstr "%B(%A): sisäinen virhe: ei-tuettu sijoitusvirhe"
-#: elf32-rx.c:1350
+#: elf32-rl78.c:978 elf32-rx.c:1350
msgid "%B(%A): internal error: dangerous relocation"
msgstr "%B(%A): sisäinen virhe: vaarallinen sijoitus"
-#: elf32-rx.c:1354
+#: elf32-rl78.c:982 elf32-rx.c:1354
msgid "%B(%A): internal error: unknown error"
msgstr "%B(%A): sisäinen virhe: tuntematon virhe"
-#: elf32-rx.c:3004
+#: elf32-rl78.c:1043
+msgid "RL78/G10 ABI conflict: cannot link G10 and non-G10 objects together"
+msgstr "RL78/G10 ABI-ristiriita: G10 ja ei-G10-objektien linkittäminen yhteen epäonnistui"
+
+#: elf32-rl78.c:1046 elf32-rl78.c:1049
#, c-format
-msgid " [64-bit doubles]"
-msgstr " [64-bittiset double-liukuluvut]"
+msgid "- %s is G10, %s is not"
+msgstr "- %s on G10, %s ei ole"
-#: elf32-rx.c:3006
+#: elf32-rl78.c:1072
#, c-format
-msgid " [dsp]"
-msgstr " [paikkariippumaton koodi]"
+msgid " [G10]"
+msgstr " [G10]"
+
+#: elf32-rx.c:563
+msgid "%B:%A: Warning: deprecated Red Hat reloc "
+msgstr "%B:%A: Varoitus: vanhentunut Red Hat reloc -tietue "
-#: elf32-s390.c:2200 elf64-s390.c:2187
+#. Check for unsafe relocs in PID mode. These are any relocs where
+#. an absolute address is being computed. There are special cases
+#. for relocs against symbols that are known to be referenced in
+#. crt0.o before the PID base address register has been initialised.
+#: elf32-rx.c:581
+msgid "%B(%A): unsafe PID relocation %s at 0x%08lx (against %s in %s)"
+msgstr "%B(%A): turvaton PID-sijoitus %s osoitteessa 0x%08lx (käyttäen symbolia %s kohteessa %s)"
+
+#: elf32-rx.c:1157
+msgid "Warning: RX_SYM reloc with an unknown symbol"
+msgstr "Varoitus: RX_SYM-reloc tuntemattomalla symbolilla"
+
+#: elf32-s390.c:2292 elf64-s390.c:2244
msgid "%B(%A+0x%lx): invalid instruction for TLS relocation %s"
msgstr "%B(%A+0x%lx): virheellinen käsky TLS-sijoitukselle %s"
-#: elf32-score.c:1520 elf32-score7.c:1379 elfxx-mips.c:3435
+#: elf32-score.c:1520 elf32-score7.c:1379 elfxx-mips.c:3642
msgid "not enough GOT space for local GOT entries"
msgstr "ei tarpeeksi yleissiirrostaulutilaa paikallisille yleissiirrostaulutulokohdille"
@@ -2114,21 +2361,21 @@ msgstr "osoite ei ole word-tasattu"
msgid "%s: Malformed reloc detected for section %s"
msgstr "%s: Väärän muotoinen reloc-tietue havaittu lohkolle %s"
-#: elf32-score.c:2878 elf32-score7.c:2682
+#: elf32-score.c:2882 elf32-score7.c:2686
msgid "%B: CALL15 reloc at 0x%lx not against global symbol"
-msgstr "%B: CALL15 reloc-tietue kohteessa 0x%lx ei ole yleissymbolia varten"
+msgstr "%B: CALL15 reloc-tietueessa osoitteessa 0x%lx ei ole käytetty yleissymbolia"
-#: elf32-score.c:3997 elf32-score7.c:3803
+#: elf32-score.c:4007 elf32-score7.c:3811
#, c-format
msgid " [pic]"
msgstr " [paikkariippumaton koodi]"
-#: elf32-score.c:4001 elf32-score7.c:3807
+#: elf32-score.c:4011 elf32-score7.c:3815
#, c-format
msgid " [fix dep]"
msgstr " [korjaussyvyys]"
-#: elf32-score.c:4043 elf32-score7.c:3849
+#: elf32-score.c:4053 elf32-score7.c:3857
msgid "%B: warning: linking PIC files with non-PIC files"
msgstr "%B: varoitus: linkitetään paikkariippumattomia kooditiedostoja paikkariippuvaisten kooditiedostojen kanssa"
@@ -2140,142 +2387,142 @@ msgstr "%B: â€IMPORT ASâ€-direktiivi kohteelle %s kätkee edellisen â€IMPORT
msgid "%B: Unrecognised .directive command: %s"
msgstr "%B: Tunnistamaton â€.directiveâ€-komento: %s"
-#: elf32-sh-symbian.c:504
+#: elf32-sh-symbian.c:500
msgid "%B: Failed to add renamed symbol %s"
msgstr "%B: Ei onnistuttu lisäämään uudelleennimettyä symbolia %s"
-#: elf32-sh.c:568
+#: elf32-sh.c:569
msgid "%B: 0x%lx: warning: bad R_SH_USES offset"
msgstr "%B: 0x%lx: varoitus: virheellinen R_SH_USES-siirrososoite"
-#: elf32-sh.c:580
+#: elf32-sh.c:581
msgid "%B: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x"
msgstr "%B: 0x%lx: varoitus: R_SH_USES osoittaa tunnistamattomaan käskyyn 0x%x"
-#: elf32-sh.c:597
+#: elf32-sh.c:598
msgid "%B: 0x%lx: warning: bad R_SH_USES load offset"
msgstr "%B: 0x%lx: varoitus: virheellinen R_SH_USES lataussiirrososoite"
-#: elf32-sh.c:612
+#: elf32-sh.c:613
msgid "%B: 0x%lx: warning: could not find expected reloc"
msgstr "%B: 0x%lx: varoitus: ei voitu löytää odotettua reloc-tietuetta"
-#: elf32-sh.c:640
+#: elf32-sh.c:641
msgid "%B: 0x%lx: warning: symbol in unexpected section"
msgstr "%B: 0x%lx: varoitus: symboli odottamattomassa lohkossa"
-#: elf32-sh.c:766
+#: elf32-sh.c:767
msgid "%B: 0x%lx: warning: could not find expected COUNT reloc"
msgstr "%B: 0x%lx: varoitus: ei voitu löytää odotettua â€COUNT relocâ€-tietuetta"
-#: elf32-sh.c:775
+#: elf32-sh.c:776
msgid "%B: 0x%lx: warning: bad count"
msgstr "%B: 0x%lx: varoitus: virheellinen lukumäärä"
# Kun käskyoperandi on sen lukualueen ulkopuolella, joka sallitaan kullekin käskykentälle, assembler voi muuntaa koodin käyttämään toiminnallisesti samanlaista käskyä tai käskysekvenssiä. Tämä prosessi tunnetaan nimellä relaxation. Tätä tehdään tyypillisesti haarautumiskäskyissä, koska haarautumiskohteen etäisyyttä ei tunneta ennen linkitystä. Tavallaan tällä tavalla kumotaan lukualueen rajoitteet (constraints). Siksi olen suomentanut sen termillä avartaminen.
-#: elf32-sh.c:1179 elf32-sh.c:1549
+#: elf32-sh.c:1180 elf32-sh.c:1550
msgid "%B: 0x%lx: fatal: reloc overflow while relaxing"
msgstr "%B: 0x%lx: vakava: reloc-tietue ylivuoto avartamisen aikana"
-#: elf32-sh.c:4048 elf64-sh64.c:1514
+#: elf32-sh.c:3939 elf64-sh64.c:1514
msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled"
msgstr "Odottamatonta STO_SH5_ISA32 paikallisessa symbolissa ei käsitellä"
# Kun käskyoperandi on sen lukualueen ulkopuolella, joka sallitaan kullekin käskykentälle, assembler voi muuntaa koodin käyttämään toiminnallisesti samanlaista käskyä tai käskysekvenssiä. Tämä prosessi tunnetaan nimellä relaxation. Tätä tehdään tyypillisesti haarautumiskäskyissä, koska haarautumiskohteen etäisyyttä ei tunneta ennen linkitystä. Tavallaan tällä tavalla kumotaan lukualueen rajoitteet (constraints). Siksi olen suomentanut sen termillä avartaminen.
-#: elf32-sh.c:4299
+#: elf32-sh.c:4190
msgid "%B: 0x%lx: fatal: unaligned branch target for relax-support relocation"
msgstr "%B: 0x%lx: vakava: tasaamaton haarautumiskohde avarrustuetulle sijoitukselle"
-#: elf32-sh.c:4332 elf32-sh.c:4347
+#: elf32-sh.c:4223 elf32-sh.c:4238
msgid "%B: 0x%lx: fatal: unaligned %s relocation 0x%lx"
msgstr "%B: 0x%lx: vakava: tasaamaton %s sijoitus 0x%lx"
-#: elf32-sh.c:4361
+#: elf32-sh.c:4252
msgid "%B: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32"
msgstr "%B: 0x%lx: vakava: R_SH_PSHA-sijoitus %d ei ole lukualueella -32..32"
-#: elf32-sh.c:4375
+#: elf32-sh.c:4266
msgid "%B: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32"
msgstr "%B: 0x%lx: vakava: R_SH_PSHL-sijoitus %d ei ole lukualueella -32..32"
-#: elf32-sh.c:4519 elf32-sh.c:4989
+#: elf32-sh.c:4410 elf32-sh.c:4886
msgid "%B(%A+0x%lx): cannot emit fixup to `%s' in read-only section"
msgstr "%B(%A+0x%lx): ei voi lähettää korjauksia kohteeseen â€%s†kirjoitussuojatussa lohkossa"
-#: elf32-sh.c:5096
+#: elf32-sh.c:4993
msgid "%B(%A+0x%lx): %s relocation against external symbol \"%s\""
-msgstr "%B(%A+0x%lx): %s sijoitus ulkoista symbolia â€%s†varten"
+msgstr "%B(%A+0x%lx): %s sijoitus käyttäen ulkoista symbolia â€%sâ€"
-#: elf32-sh.c:5569
+#: elf32-sh.c:5466
#, c-format
msgid "%X%C: relocation to \"%s\" references a different segment\n"
msgstr "%X%C: sijoitus kohteeseen â€%s†viittaa eri segmenttiin\n"
-#: elf32-sh.c:5575
+#: elf32-sh.c:5472
#, c-format
msgid "%C: warning: relocation to \"%s\" references a different segment\n"
msgstr "%C: varoitus: sijoitus kohteeseen â€%s†viittaa eri segmenttiin\n"
-#: elf32-sh.c:6353 elf32-sh.c:6436
+#: elf32-sh.c:6254 elf32-sh.c:6337
msgid "%B: `%s' accessed both as normal and FDPIC symbol"
msgstr "%B: â€%s†haettu sekä normaalina että FDPIC-symbolina"
-#: elf32-sh.c:6358 elf32-sh.c:6440
+#: elf32-sh.c:6259 elf32-sh.c:6341
msgid "%B: `%s' accessed both as FDPIC and thread local symbol"
msgstr "%B: â€%s†haettu sekä FDPIC-symbolina että säikeisenä paikallissymbolina"
-#: elf32-sh.c:6388
+#: elf32-sh.c:6289
msgid "%B: Function descriptor relocation with non-zero addend"
msgstr "%B: Funktiokuvaajasijoitus nollasta poikeavalla yhteenlaskettavalla"
-#: elf32-sh.c:6624 elf64-alpha.c:4652
+#: elf32-sh.c:6525 elf64-alpha.c:4661
msgid "%B: TLS local exec code cannot be linked into shared objects"
msgstr "%B: TLS-tyyppistä paikallista suoritettavaa koodia ei voida linkittää jaettuihin objekteihin"
-#: elf32-sh64.c:223 elf64-sh64.c:2318
+#: elf32-sh64.c:224 elf64-sh64.c:2318
#, c-format
msgid "%s: compiled as 32-bit object and %s is 64-bit"
msgstr "%s: käännetty 32-bittisenä objektina ja %s on 64-bittinen"
-#: elf32-sh64.c:226 elf64-sh64.c:2321
+#: elf32-sh64.c:227 elf64-sh64.c:2321
#, c-format
msgid "%s: compiled as 64-bit object and %s is 32-bit"
msgstr "%s: käännetty 64-bittisenä objektina ja %s on 32-bittinen"
-#: elf32-sh64.c:228 elf64-sh64.c:2323
+#: elf32-sh64.c:229 elf64-sh64.c:2323
#, c-format
msgid "%s: object size does not match that of target %s"
msgstr "%s: objektikoko ei täsmää kohteen %s objektikoon kanssa"
-#: elf32-sh64.c:451 elf64-sh64.c:2837
+#: elf32-sh64.c:452 elf64-sh64.c:2839
#, c-format
msgid "%s: encountered datalabel symbol in input"
msgstr "%s: kohdattiin datalabel-symboli syötteessä"
# prepare-to-branch (PTB) instruction
-#: elf32-sh64.c:528
+#: elf32-sh64.c:529
msgid "PTB mismatch: a SHmedia address (bit 0 == 1)"
msgstr "PTB-täsmäämättömyys: SHmedia-osoite (bitti 0 == 1)"
-#: elf32-sh64.c:531
+#: elf32-sh64.c:532
msgid "PTA mismatch: a SHcompact address (bit 0 == 0)"
msgstr "PTA-täsmäämättömyys: SHcompact-osoite (bitti 0 == 0)"
-#: elf32-sh64.c:549
+#: elf32-sh64.c:550
#, c-format
msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16"
msgstr "%s: GAS-virhe: odottamaton PTB-käsky R_SH_PT_16-tyypillä"
-#: elf32-sh64.c:598
+#: elf32-sh64.c:599
msgid "%B: error: unaligned relocation type %d at %08x reloc %p\n"
msgstr "%B: virhe: tasaamaton sijoitustyyppi %d siirroksessa %08x reloc-tietue %p\n"
-#: elf32-sh64.c:674
+#: elf32-sh64.c:675
#, c-format
msgid "%s: could not write out added .cranges entries"
msgstr "%s: ei voitu kirjoittaa lisättyjä â€.crangesâ€-tulokohtia kokonaisuudessaan"
-#: elf32-sh64.c:734
+#: elf32-sh64.c:735
#, c-format
msgid "%s: could not write out sorted .cranges entries"
msgstr "%s: ei voitu kirjoittaa lajiteltuja â€.crangesâ€-tulokohtia kokonaisuudessaan"
@@ -2288,120 +2535,120 @@ msgstr "%B: käännetty 64-bittiselle järjestelmälle ja kohde on 32-bittinen"
msgid "%B: linking little endian files with big endian files"
msgstr "%B: linkitetty â€little endianâ€-tiedostoja â€big endianâ€-tiedostojen kanssa"
-#: elf32-spu.c:719
+#: elf32-spu.c:716
msgid "%X%P: overlay section %A does not start on a cache line.\n"
msgstr "%X%P: päällyslohko %A ei ala välimuistissa olevalta riviltä.\n"
-#: elf32-spu.c:727
+#: elf32-spu.c:724
msgid "%X%P: overlay section %A is larger than a cache line.\n"
msgstr "%X%P: päällyslohko %A on laajempi kuin välimuistissa oleva rivi.\n"
-#: elf32-spu.c:747
+#: elf32-spu.c:744
msgid "%X%P: overlay section %A is not in cache area.\n"
msgstr "%X%P: päällyslohko %A ei ole välimuistialueella.\n"
-#: elf32-spu.c:787
+#: elf32-spu.c:784
msgid "%X%P: overlay sections %A and %A do not start at the same address.\n"
msgstr "%X%P: päällyslohkot %A ja %A eivät ala samasta osoitteesta.\n"
-#: elf32-spu.c:1011
+#: elf32-spu.c:1008
msgid "warning: call to non-function symbol %s defined in %B"
msgstr "varoitus: kutsu ei-funktiosymboliin %s määritelty kohteessa %B"
-#: elf32-spu.c:1361
+#: elf32-spu.c:1358
msgid "%A:0x%v lrlive .brinfo (%u) differs from analysis (%u)\n"
msgstr "%A:0x%v lrlive .brinfo (%u) eroaa analyysistä (%u)\n"
-#: elf32-spu.c:1880
+#: elf32-spu.c:1877
msgid "%B is not allowed to define %s"
msgstr "%B ei saa määritellä kohdetta %s"
-#: elf32-spu.c:1888
+#: elf32-spu.c:1885
#, c-format
msgid "you are not allowed to define %s in a script"
msgstr "et saa määritellä kohdetta %s skriptissä"
-#: elf32-spu.c:1922
+#: elf32-spu.c:1919
#, c-format
msgid "%s in overlay section"
msgstr "%s päällyslohkossa"
-#: elf32-spu.c:1951
+#: elf32-spu.c:1948
msgid "overlay stub relocation overflow"
msgstr "päällys-stub-sijoitusylivuoto"
-#: elf32-spu.c:1960
+#: elf32-spu.c:1957
msgid "stubs don't match calculated size"
msgstr "stubit ei täsmää lasketun koon kanssa"
-#: elf32-spu.c:2542
+#: elf32-spu.c:2539
#, c-format
msgid "warning: %s overlaps %s\n"
msgstr "varoitus: %s menee päällekkäin %s:n kanssa\n"
-#: elf32-spu.c:2558
+#: elf32-spu.c:2555
#, c-format
msgid "warning: %s exceeds section size\n"
msgstr "varoitus: %s ylittää lohkokoon\n"
-#: elf32-spu.c:2589
+#: elf32-spu.c:2586
msgid "%A:0x%v not found in function table\n"
msgstr "%A:0x%v ei löytynyt funktiotaulusta\n"
-#: elf32-spu.c:2729
+#: elf32-spu.c:2726
msgid "%B(%A+0x%v): call to non-code section %B(%A), analysis incomplete\n"
msgstr "%B(%A+0x%v): kutsu ei-koodilohkoon %B(%A), analyysi ei ole täydellinen\n"
-#: elf32-spu.c:3297
+#: elf32-spu.c:3294
#, c-format
msgid "Stack analysis will ignore the call from %s to %s\n"
msgstr "Pinoanalyysi ei ota huomioon kutsua kohteesta %s kohteeseen %s\n"
-#: elf32-spu.c:3988
+#: elf32-spu.c:3985
msgid " %s: 0x%v\n"
msgstr " %s: 0x%v\n"
-#: elf32-spu.c:3989
+#: elf32-spu.c:3986
msgid "%s: 0x%v 0x%v\n"
msgstr "%s: 0x%v 0x%v\n"
-#: elf32-spu.c:3994
+#: elf32-spu.c:3991
msgid " calls:\n"
msgstr " kutsut:\n"
-#: elf32-spu.c:4002
+#: elf32-spu.c:3999
#, c-format
msgid " %s%s %s\n"
msgstr " %s%s %s\n"
-#: elf32-spu.c:4307
+#: elf32-spu.c:4304
#, c-format
msgid "%s duplicated in %s\n"
msgstr "%s kaksoiskappale kohteessa %s\n"
-#: elf32-spu.c:4311
+#: elf32-spu.c:4308
#, c-format
msgid "%s duplicated\n"
msgstr "%s on tehty kahteen kertaan\n"
-#: elf32-spu.c:4318
+#: elf32-spu.c:4315
msgid "sorry, no support for duplicate object files in auto-overlay script\n"
msgstr "ei tukea objektitiedostojen kaksoiskappaleille automaattisessa päällysskriptissä\n"
-#: elf32-spu.c:4359
+#: elf32-spu.c:4356
msgid "non-overlay size of 0x%v plus maximum overlay size of 0x%v exceeds local store\n"
msgstr "ei-päällyksen koko 0x%v plus päällyksen maksimikoko 0x%v ylittävät paikallisen varaston\n"
-#: elf32-spu.c:4514
+#: elf32-spu.c:4511
msgid "%B:%A%s exceeds overlay size\n"
msgstr "%B:%A%s ylittää päällyskoon\n"
-#: elf32-spu.c:4676
+#: elf32-spu.c:4673
msgid "Stack size for call graph root nodes.\n"
msgstr "Pinokoko kutsugraafijuurinodeille.\n"
# Wikipedia: A tail call is a subroutine call just before the end of a subroutine.
-#: elf32-spu.c:4677
+#: elf32-spu.c:4674
msgid ""
"\n"
"Stack size for functions. Annotations: '*' max stack, 't' tail call\n"
@@ -2409,144 +2656,164 @@ msgstr ""
"\n"
"Pinokoko funktioille. Sivuhuomautukset: â€*†maksimipino, â€t†alikutsu\n"
-#: elf32-spu.c:4687
+#: elf32-spu.c:4684
msgid "Maximum stack required is 0x%v\n"
msgstr "Vaadittu maksimipino on 0x%v\n"
-#: elf32-spu.c:4778
+#: elf32-spu.c:4775
msgid "fatal error while creating .fixup"
msgstr "vakava virhe kun luodaan .fixup"
-#: elf32-spu.c:5008
+#: elf32-spu.c:5005
msgid "%B(%s+0x%lx): unresolvable %s relocation against symbol `%s'"
-msgstr "%B(%s+0x%lx): ratkaisematon %s sijoitus symbolia â€%s†varten"
+msgstr "%B(%s+0x%lx): ratkaisematon %s sijoitus käyttäen symbolia â€%sâ€"
-#: elf32-tic6x.c:1602
+#: elf32-tic6x.c:1600
msgid "warning: generating a shared library containing non-PIC code"
msgstr "varoitus: tuotetaan jaettu kirjasto, joka sisältää ei-PIC-koodia"
-#: elf32-tic6x.c:1607
+#: elf32-tic6x.c:1605
msgid "warning: generating a shared library containing non-PID code"
msgstr "varoitus: tuotetaan jaettu kirjasto, joka sisältää ei-PID-koodia"
-#: elf32-tic6x.c:2541
+#: elf32-tic6x.c:2524
msgid "%B: SB-relative relocation but __c6xabi_DSBT_BASE not defined"
msgstr "%B: SB-suhteellinen sijoitus, mutta __c6xabi_DSBT_BASE ei ole määritelty"
-#: elf32-tic6x.c:2761
-msgid "dangerous relocation"
-msgstr "vaarallinen sijoitus"
-
-#: elf32-tic6x.c:3733
+#: elf32-tic6x.c:3648
msgid "%B: error: unknown mandatory EABI object attribute %d"
msgstr "%B: virhe: tuntematon pakollinen EABI-objektiattribuutti %d"
-#: elf32-tic6x.c:3741
+#: elf32-tic6x.c:3656
msgid "%B: warning: unknown EABI object attribute %d"
msgstr "%B: varoitus: tuntematon EABI-objektiattribuutti %d"
-#: elf32-tic6x.c:3853 elf32-tic6x.c:3861
+#: elf32-tic6x.c:3768 elf32-tic6x.c:3776
msgid "error: %B requires more stack alignment than %B preserves"
msgstr "virhe: %B vaatii enemmän pinotasausta kuin %B säilyttää"
-#: elf32-tic6x.c:3871 elf32-tic6x.c:3880
+#: elf32-tic6x.c:3786 elf32-tic6x.c:3795
msgid "error: unknown Tag_ABI_array_object_alignment value in %B"
msgstr "virhe: tuntematon Tag_ABI_array_object_alignment-arvo kohteessa %B"
-#: elf32-tic6x.c:3889 elf32-tic6x.c:3898
+#: elf32-tic6x.c:3804 elf32-tic6x.c:3813
msgid "error: unknown Tag_ABI_array_object_align_expected value in %B"
msgstr "virhe: tuntematon Tag_ABI_array_object_align_expected-arvo kohteessa %B"
-#: elf32-tic6x.c:3906 elf32-tic6x.c:3913
+#: elf32-tic6x.c:3821 elf32-tic6x.c:3828
msgid "error: %B requires more array alignment than %B preserves"
msgstr "virhe: %B vaatii enemmän taulukkotasausta kuin %B säilyttää"
-#: elf32-tic6x.c:3935
+#: elf32-tic6x.c:3850
msgid "warning: %B and %B differ in wchar_t size"
msgstr "varoitus: %B ja %B eroavat wchar_t size-koossa"
-#: elf32-tic6x.c:3953
+#: elf32-tic6x.c:3868
msgid "warning: %B and %B differ in whether code is compiled for DSBT"
msgstr "varoitus: %B ja %B eroavat siinä, että koodi on käännetty kohteelle DSBT"
# small data region on sama kuin .scommon data region
-#: elf32-v850.c:173
+#: elf32-v850.c:157
#, c-format
msgid "Variable `%s' cannot occupy in multiple small data regions"
msgstr "Muuttuja â€%s†ei voi sijaita useissa â€smallâ€-data-alueissa"
# small on .scommon, zero on .zcommon ja tiny on .tcommon
-#: elf32-v850.c:176
+#: elf32-v850.c:160
#, c-format
msgid "Variable `%s' can only be in one of the small, zero, and tiny data regions"
msgstr "Muuttuja â€%s†voi olla vain yhdessä â€smallâ€-, â€zeroâ€- ja â€tinyâ€-data-alueista"
-#: elf32-v850.c:179
+#: elf32-v850.c:163
#, c-format
msgid "Variable `%s' cannot be in both small and zero data regions simultaneously"
msgstr "Muuttuja â€%s†ei voi olla sekä â€smallâ€- että â€zeroâ€-data-alueissa samanaikaisesti"
-#: elf32-v850.c:182
+#: elf32-v850.c:166
#, c-format
msgid "Variable `%s' cannot be in both small and tiny data regions simultaneously"
msgstr "Muuttuja â€%s†ei voi olla sekä â€smallâ€- että â€tinyâ€-data-alueissa samanaikaisesti"
-#: elf32-v850.c:185
+#: elf32-v850.c:169
#, c-format
msgid "Variable `%s' cannot be in both zero and tiny data regions simultaneously"
msgstr "Muuttuja â€%s†ei voi olla sekä â€zeroâ€- että â€tinyâ€-data-alueissa samanaikaisesti"
-#: elf32-v850.c:483
+#: elf32-v850.c:467
msgid "FAILED to find previous HI16 reloc"
msgstr "EI ONNISTUTTU löytämään edellistä HI16 reloc-tietuetta"
-#: elf32-v850.c:2155
+#: elf32-v850.c:2293
msgid "could not locate special linker symbol __gp"
msgstr "ei voitu paikallistaa erityistä linkkerisymbolia â€__gpâ€"
-#: elf32-v850.c:2159
+#: elf32-v850.c:2297
msgid "could not locate special linker symbol __ep"
msgstr "ei voitu paikallistaa erityistä linkkerisymbolia â€__epâ€"
-#: elf32-v850.c:2163
+#: elf32-v850.c:2301
msgid "could not locate special linker symbol __ctbp"
msgstr "ei voitu paikallistaa erityistä linkkerisymbolia â€__ctbpâ€"
-#: elf32-v850.c:2341
+#: elf32-v850.c:2471 elf32-v850.c:2534
msgid "%B: Architecture mismatch with previous modules"
msgstr "%B: Arkkitehtuuri ei täsmännyt edellisten modulien kanssa"
+#: elf32-v850.c:2478
+msgid "%B: Alignment mismatch with previous modules"
+msgstr "%B: Tasaustäsmäämättömyys edellisiin moduleihin"
+
#. xgettext:c-format.
-#: elf32-v850.c:2360
+#: elf32-v850.c:2553
#, c-format
msgid "private flags = %lx: "
msgstr "yksityiset liput = %lx: "
-#: elf32-v850.c:2365
+#: elf32-v850.c:2558
+#, c-format
+msgid "unknown v850 architecture"
+msgstr "tuntematon v850-arkkitehtuuri"
+
+#: elf32-v850.c:2560
+#, c-format
+msgid "v850 E3 architecture"
+msgstr "v850 E3-arkkitehtuuri"
+
+#: elf32-v850.c:2562 elf32-v850.c:2572
#, c-format
msgid "v850 architecture"
msgstr "v850-arkkitehtuuri"
-#: elf32-v850.c:2366
+#: elf32-v850.c:2565
+#, c-format
+msgid ", 8-byte data alignment"
+msgstr ", 8-tavuinen datatasaus"
+
+#: elf32-v850.c:2573
#, c-format
msgid "v850e architecture"
msgstr "v850e-arkkitehtuuri"
-#: elf32-v850.c:2367
+#: elf32-v850.c:2574
#, c-format
msgid "v850e1 architecture"
msgstr "v850e1-arkkitehtuuri"
-#: elf32-v850.c:2368
+#: elf32-v850.c:2575
#, c-format
msgid "v850e2 architecture"
msgstr "v850e2-arkkitehtuuri"
-#: elf32-v850.c:2369
+#: elf32-v850.c:2576
#, c-format
msgid "v850e2v3 architecture"
msgstr "v850e2v3-arkkitehtuuri"
+#: elf32-v850.c:2577
+#, c-format
+msgid "v850e3v5 architecture"
+msgstr "v850e3v5-arkkitehtuuri"
+
#: elf32-vax.c:532
#, c-format
msgid " [nonpic]"
@@ -2562,133 +2829,232 @@ msgstr " [d-float-liukulukulippu]"
msgid " [g-float]"
msgstr " [g-float-liukulukulippu]"
-#: elf32-vax.c:655
+#: elf32-vax.c:656
#, c-format
msgid "%s: warning: GOT addend of %ld to `%s' does not match previous GOT addend of %ld"
msgstr "%s: varoitus: Yleissiirrostaulun %ld-yhteenlaskettava kohteelle â€%s†ei täsmää edellisen yleissiirrostaulun %ld-yhteenlaskettavan kanssa"
-#: elf32-vax.c:1585
+#: elf32-vax.c:1543
#, c-format
msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored"
msgstr "%s: varoitus: %d:n PLT-yhteenlaskettavaa kohteelle â€%s†lohkosta %s ei oteta huomioon"
-#: elf32-vax.c:1712
+#: elf32-vax.c:1668
#, c-format
msgid "%s: warning: %s relocation against symbol `%s' from %s section"
-msgstr "%s: varoitus: %s sijoitus symbolia â€%s†varten %s-lohkosta"
+msgstr "%s: varoitus: %s sijoitus käyttäen symbolia â€%s†%s-lohkosta"
-#: elf32-vax.c:1718
+#: elf32-vax.c:1674
#, c-format
msgid "%s: warning: %s relocation to 0x%x from %s section"
msgstr "%s: varoitus: %s sijoitus kohteeseen 0x%x â€%sâ€-lohkosta"
-#: elf32-xstormy16.c:451 elf32-ia64.c:2336 elf64-ia64.c:2336
+#: elf32-xgate.c:686
+#, c-format
+msgid "cpu=XGATE]"
+msgstr "cpu=XGATE]"
+
+#: elf32-xgate.c:688
+#, c-format
+msgid "error reading cpu type from elf private data"
+msgstr "virhe luettaessa prosessorityyppiä elf private-datasta"
+
+#: elf32-xstormy16.c:455 elf64-ia64-vms.c:2072 elf32-ia64.c:2330
+#: elf64-ia64.c:2330
msgid "non-zero addend in @fptr reloc"
msgstr "ei-nolla-yhteenlaskettava â€@fptr relocâ€-tietueessa"
-#: elf32-xtensa.c:918
+#: elf32-xtensa.c:908
msgid "%B(%A): invalid property table"
msgstr "%B(%A): virheellinen ominaisuustaulu"
-#: elf32-xtensa.c:2777
+#: elf32-xtensa.c:2774
msgid "%B(%A+0x%lx): relocation offset out of range (size=0x%x)"
msgstr "%B(%A+0x%lx): sijoitussiirrososoite lukualueen (koko=0x%x) ulkopuolella"
-#: elf32-xtensa.c:2856 elf32-xtensa.c:2977
+#: elf32-xtensa.c:2853 elf32-xtensa.c:2974
msgid "dynamic relocation in read-only section"
msgstr "dynaaminen sijoitus kirjoitussuojatussa lohkossa"
-#: elf32-xtensa.c:2953
+#: elf32-xtensa.c:2950
msgid "TLS relocation invalid without dynamic sections"
msgstr "TLS-siirros virheellinen ilman dynaamisia lohkoja"
-#: elf32-xtensa.c:3172
+#: elf32-xtensa.c:3169
msgid "internal inconsistency in size of .got.loc section"
msgstr "sisäinen epäjohdonmukaisuus â€.got.locâ€-alilohkokoossa"
-#: elf32-xtensa.c:3485
+#: elf32-xtensa.c:3482
msgid "%B: incompatible machine type. Output is 0x%x. Input is 0x%x"
msgstr "%B: yhteensopimaton konetyyppi. Tuloste on 0x%x. Syöte on 0x%x"
-#: elf32-xtensa.c:4714 elf32-xtensa.c:4722
+#: elf32-xtensa.c:4713 elf32-xtensa.c:4721
msgid "Attempt to convert L32R/CALLX to CALL failed"
msgstr "Yritys muuttaa â€L32R/CALLXâ€-kutsu â€CALLâ€-kutsuksi ei onnistunut"
-#: elf32-xtensa.c:6332 elf32-xtensa.c:6408 elf32-xtensa.c:7524
+#: elf32-xtensa.c:6330 elf32-xtensa.c:6406 elf32-xtensa.c:7522
msgid "%B(%A+0x%lx): could not decode instruction; possible configuration mismatch"
msgstr "%B(%A+0x%lx): ei voitu avata käskyä; mahdollinen konfiguraatiotäsmäämättömyys"
-#: elf32-xtensa.c:7264
+#: elf32-xtensa.c:7262
msgid "%B(%A+0x%lx): could not decode instruction for XTENSA_ASM_SIMPLIFY relocation; possible configuration mismatch"
msgstr "%B(%A+0x%lx): ei voitu avata käskyä XTENSA_ASM_SIMPLIFY-sijoitukselle; mahdollinen konfiguraatiotäsmäämättömyys"
-#: elf32-xtensa.c:9023
+#: elf32-xtensa.c:9022
msgid "invalid relocation address"
msgstr "virheellinen sijoitusosoite"
# Kun käskyoperandi on sen lukualueen ulkopuolella, joka sallitaan kullekin käskykentälle, assembler voi muuntaa koodin käyttämään toiminnallisesti samanlaista käskyä tai käskysekvenssiä. Tämä prosessi tunnetaan nimellä relaxation. Tätä tehdään tyypillisesti haarautumiskäskyissä, koska haarautumiskohteen etäisyyttä ei tunneta ennen linkitystä. Tavallaan tällä tavalla kumotaan lukualueen rajoitteet (constraints). Siksi olen suomentanut sen termillä avartaminen.
-#: elf32-xtensa.c:9072
+#: elf32-xtensa.c:9071
msgid "overflow after relaxation"
msgstr "ylivuoto avartamisen jälkeen"
-#: elf32-xtensa.c:10204
+#: elf32-xtensa.c:10203
msgid "%B(%A+0x%lx): unexpected fix for %s relocation"
msgstr "%B(%A+0x%lx): odottamaton korjaus %s-sijoitukselle"
-#: elf64-alpha.c:460
+#: elf64-alpha.c:474
msgid "GPDISP relocation did not find ldah and lda instructions"
msgstr "GPDISP-sijoitus ei löytänyt â€ldahâ€- ja â€ldaâ€-käskyjä"
-#: elf64-alpha.c:2497
+#: elf64-alpha.c:2503
msgid "%B: .got subsegment exceeds 64K (size %d)"
msgstr "%B: â€.gotâ€-alisegmentti ylittää 64 kilotavun rajan (koko %d)"
-#: elf64-alpha.c:4387 elf64-alpha.c:4399
+#: elf64-alpha.c:4396 elf64-alpha.c:4408
msgid "%B: gp-relative relocation against dynamic symbol %s"
-msgstr "%B: yleisosoitinsuhteellinen sijoitus dynaamista symbolia %s varten"
+msgstr "%B: yleisosoitinsuhteellinen sijoitus käyttäen dynaamista symbolia %s"
-#: elf64-alpha.c:4425 elf64-alpha.c:4565
+#: elf64-alpha.c:4434 elf64-alpha.c:4574
msgid "%B: pc-relative relocation against dynamic symbol %s"
-msgstr "%B: ohjelmalaskurisuhteellinen sijoitus dynaamista symbolia %s varten"
+msgstr "%B: ohjelmalaskurisuhteellinen sijoitus käyttäen dynaamista symbolia %s"
-#: elf64-alpha.c:4453
+#: elf64-alpha.c:4462
msgid "%B: change in gp: BRSGP %s"
msgstr "%B: vaihto yleisosoittimessa: BRSGP %s"
-#: elf64-alpha.c:4478
+#: elf64-alpha.c:4487
msgid "<unknown>"
msgstr "<tuntematon>"
-#: elf64-alpha.c:4483
+#: elf64-alpha.c:4492
msgid "%B: !samegp reloc against symbol without .prologue: %s"
-msgstr "%B: â€!samegp relocâ€-tietue symbolia varten ilman â€.prologueâ€-lohkoa: %s"
+msgstr "%B: â€!samegp relocâ€-tietue käyttäen symbolia ilman â€.prologueâ€-lohkoa: %s"
-#: elf64-alpha.c:4540
+#: elf64-alpha.c:4549
msgid "%B: unhandled dynamic relocation against %s"
-msgstr "%B: käsittelemätön dynaaminen sijoitus %s:ta varten"
+msgstr "%B: käsittelemätön dynaaminen sijoitus käyttäen kohdetta %s"
-#: elf64-alpha.c:4572
+#: elf64-alpha.c:4581
msgid "%B: pc-relative relocation against undefined weak symbol %s"
-msgstr "%B: ohjelmalaskurisuhteellinen sijoitus määrittelemätöntä heikkoa symbolia %s varten"
+msgstr "%B: ohjelmalaskurisuhteellinen sijoitus käyttäen määrittelemätöntä heikkoa symbolia %s"
-#: elf64-alpha.c:4636
+#: elf64-alpha.c:4645
msgid "%B: dtp-relative relocation against dynamic symbol %s"
-msgstr "%B: dtp-suhteellinen sijoitus dynaamista symbolia %s varten"
+msgstr "%B: dtp-suhteellinen sijoitus käyttäen dynaamista symbolia %s"
-#: elf64-alpha.c:4659
+#: elf64-alpha.c:4668
msgid "%B: tp-relative relocation against dynamic symbol %s"
-msgstr "%B: tp-suhteellinen sijoitus dynaamista symbolia %s varten"
+msgstr "%B: tp-suhteellinen sijoitus käyttäen dynaamista symbolia %s"
-#: elf64-hppa.c:2083
+#: elf64-hppa.c:2084
#, c-format
msgid "stub entry for %s cannot load .plt, dp offset = %ld"
msgstr "stub-tulokohta kohteelle %s ei voi ladata â€.pltâ€, dp-siirrososoite = %ld"
-#: elf64-hppa.c:3275
-msgid "%B(%A+0x"
-msgstr "%B(%A+0x"
+#: elf64-hppa.c:3280
+msgid "%B(%A+0x%"
+msgstr "%B(%A+0x%"
+
+# Kun käskyoperandi on sen lukualueen ulkopuolella, joka sallitaan kullekin käskykentälle, assembler voi muuntaa koodin käyttämään toiminnallisesti samanlaista käskyä tai käskysekvenssiä. Tämä prosessi tunnetaan nimellä relaxation. Tätä tehdään tyypillisesti haarautumiskäskyissä, koska haarautumiskohteen etäisyyttä ei tunneta ennen linkitystä. Tavallaan tällä tavalla kumotaan lukualueen rajoitteet (constraints). Siksi olen suomentanut sen termillä avartaminen.
+#: elf64-ia64-vms.c:587 elf32-ia64.c:619 elf64-ia64.c:619
+msgid "%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect branch."
+msgstr "%B: Ei voi avartaa br-käskyä kohteessa 0x%lx lohkossa â€%Aâ€. Käytä â€brlâ€-käskyä tai epäsuoraa haarautumista."
+
+#: elf64-ia64-vms.c:2027 elf32-ia64.c:2278 elf64-ia64.c:2278
+msgid "@pltoff reloc against local symbol"
+msgstr "â€@pltoff relocâ€-tietue käyttäen paikallista symbolia"
+
+#: elf64-ia64-vms.c:3279 elf32-ia64.c:3684 elf64-ia64.c:3684
+#, c-format
+msgid "%s: short data segment overflowed (0x%lx >= 0x400000)"
+msgstr "%s: â€shortâ€-datasegmentti ylivuotanut (0x%lx >= 0x400000)"
+
+#: elf64-ia64-vms.c:3290 elf32-ia64.c:3695 elf64-ia64.c:3695
+#, c-format
+msgid "%s: __gp does not cover short data segment"
+msgstr "%s: â€__gp†ei kata â€shortâ€-datasegmenttiä"
+
+#: elf64-ia64-vms.c:3555 elf32-ia64.c:3962 elf64-ia64.c:3962
+msgid "%B: non-pic code with imm relocation against dynamic symbol `%s'"
+msgstr "%B: paikkariippuvainen koodi välittömällä sijoituksella käyttäen dynaamista symbolia â€%sâ€"
+
+#: elf64-ia64-vms.c:3617 elf32-ia64.c:4029 elf64-ia64.c:4029
+msgid "%B: @gprel relocation against dynamic symbol %s"
+msgstr "%B: â€@gprelâ€-sijoitus käyttäen dynaamista symbolia %s"
+
+#: elf64-ia64-vms.c:3676 elf32-ia64.c:4092 elf64-ia64.c:4092
+msgid "%B: linking non-pic code in a position independent executable"
+msgstr "%B: linkitetään paikkariippuvainen koodi paikkariippumattomassa suoritettavassa tiedostossa"
+
+#: elf64-ia64-vms.c:3777 elf32-ia64.c:4229 elf64-ia64.c:4229
+msgid "%B: @internal branch to dynamic symbol %s"
+msgstr "%B: @sisäinen haarautuminen dynaamiseen symboliin %s"
+
+#: elf64-ia64-vms.c:3779 elf32-ia64.c:4231 elf64-ia64.c:4231
+msgid "%B: speculation fixup to dynamic symbol %s"
+msgstr "%B: spekulaatiokorjaus dynaamiseen symboliin %s"
+
+#: elf64-ia64-vms.c:3781 elf32-ia64.c:4233 elf64-ia64.c:4233
+msgid "%B: @pcrel relocation against dynamic symbol %s"
+msgstr "%B: â€@pcrelâ€-sijoitus käyttäen dynaamista symbolia %s"
+
+#: elf64-ia64-vms.c:3905 elf32-ia64.c:4430 elf64-ia64.c:4430
+msgid "unsupported reloc"
+msgstr "ei-tuettu reloc-tietue"
+
+#: elf64-ia64-vms.c:3942 elf32-ia64.c:4468 elf64-ia64.c:4468
+msgid "%B: missing TLS section for relocation %s against `%s' at 0x%lx in section `%A'."
+msgstr "%B: siirroksen %s puuttuva TLS-lohko käyttäen kohdetta â€%s†osoitteessa 0x%lx lohkossa â€%Aâ€."
+
+# Kun käskyoperandi on sen lukualueen ulkopuolella, joka sallitaan kullekin käskykentälle, assembler voi muuntaa koodin käyttämään toiminnallisesti samanlaista käskyä tai käskysekvenssiä. Tämä prosessi tunnetaan nimellä relaxation. Tätä tehdään tyypillisesti haarautumiskäskyissä, koska haarautumiskohteen etäisyyttä ei tunneta ennen linkitystä. Tavallaan tällä tavalla kumotaan lukualueen rajoitteet (constraints). Siksi olen suomentanut sen termillä avartaminen.
+#: elf64-ia64-vms.c:3957 elf32-ia64.c:4483 elf64-ia64.c:4483
+msgid "%B: Can't relax br (%s) to `%s' at 0x%lx in section `%A' with size 0x%lx (> 0x1000000)."
+msgstr "%B: Ei voi avartaa br-käskyä (%s) kohteelle â€%s†kohteessa 0x%lx lohkossa â€%A†koolla 0x%lx (> 0x1000000)."
+
+#: elf64-ia64-vms.c:4246 elf32-ia64.c:4745 elf64-ia64.c:4745
+msgid "%B: linking trap-on-NULL-dereference with non-trapping files"
+msgstr "%B: linkitetään keskeytysnollassa purkuviite â€ei-keskeytetäâ€-tiedostojen kanssa"
-#: elf64-mmix.c:1034
+#: elf64-ia64-vms.c:4255 elf32-ia64.c:4754 elf64-ia64.c:4754
+msgid "%B: linking big-endian files with little-endian files"
+msgstr "%B: linkitetään â€big-endianâ€-tiedostoja â€little-endianâ€-tiedostojen kanssa"
+
+#: elf64-ia64-vms.c:4264 elf32-ia64.c:4763 elf64-ia64.c:4763
+msgid "%B: linking 64-bit files with 32-bit files"
+msgstr "%B: linkitetään 64-bittiset tiedostot 32-bittisten tiedostojen kanssa"
+
+#: elf64-ia64-vms.c:4273 elf32-ia64.c:4772 elf64-ia64.c:4772
+msgid "%B: linking constant-gp files with non-constant-gp files"
+msgstr "%B: linkitetään vakioyleisosoitintiedostot ei-vakioiden yleisosoitintiedostojen kanssa"
+
+#: elf64-ia64-vms.c:4283 elf32-ia64.c:4782 elf64-ia64.c:4782
+msgid "%B: linking auto-pic files with non-auto-pic files"
+msgstr "%B: linkitetään automaattiset paikkariippumattomat kooditiedostot ei-automaattisten paikkariippumattomien kooditiedostojen kanssa"
+
+#: elf64-ia64-vms.c:5125 elflink.c:4299
+msgid "Warning: alignment %u of common symbol `%s' in %B is greater than the alignment (%u) of its section %A"
+msgstr "Varoitus: tasaus %u yhteissymbolissa â€%s†kohteessa %B on suurempi kuin tasaus (%u) sen lohkossa %A"
+
+#: elf64-ia64-vms.c:5131 elflink.c:4305
+msgid "Warning: alignment %u of symbol `%s' in %B is smaller than %u in %B"
+msgstr "Varoitus: tasaus %u symbolissa â€%s†kohteessa %B on pienempi kuin %u kohteessa %B"
+
+#: elf64-ia64-vms.c:5146 elflink.c:4321
+msgid "Warning: size of symbol `%s' changed from %lu in %B to %lu in %B"
+msgstr "Varoitus: symbolin â€%s†koko vaihtui koosta %lu kohteessa %B kokoon %lu kohteessa %B"
+
+#: elf64-mmix.c:986
msgid ""
"invalid input relocation when producing non-ELF, non-mmo format output.\n"
" Please use the objcopy program to convert from ELF or mmo,\n"
@@ -2698,7 +3064,7 @@ msgstr ""
" Käytä objcopy-ohjelmaa muuntamiseen ELF:stä tai mmo:sta,\n"
" tai assembloi käyttäen \"-no-expand\" (gcc-kääntäjälle, \"-Wa,-no-expand\""
-#: elf64-mmix.c:1218
+#: elf64-mmix.c:1170
msgid ""
"invalid input relocation when producing non-ELF, non-mmo format output.\n"
" Please use the objcopy program to convert from ELF or mmo,\n"
@@ -2709,7 +3075,7 @@ msgstr ""
" tai käännä käyttäen gcc-valitsinta \"-mno-base-addresses\"."
# Kun käskyoperandi on sen lukualueen ulkopuolella, joka sallitaan kullekin käskykentälle, assembler voi muuntaa koodin käyttämään toiminnallisesti samanlaista käskyä tai käskysekvenssiä. Tämä prosessi tunnetaan nimellä relaxation. Tätä tehdään tyypillisesti haarautumiskäskyissä, koska haarautumiskohteen etäisyyttä ei tunneta ennen linkitystä. Tavallaan tällä tavalla kumotaan lukualueen rajoitteet (constraints). Siksi olen suomentanut sen termillä avartaminen.
-#: elf64-mmix.c:1244
+#: elf64-mmix.c:1196
#, c-format
msgid ""
"%s: Internal inconsistency error for value for\n"
@@ -2718,46 +3084,46 @@ msgstr ""
"%s: Sisäinen yhteensopimattomuusvirhe linkkerin varaamalle\n"
" yleisrekisteriarvolle: linkitetty: 0x%lx%08lx != avarrettu: 0x%lx%08lx\n"
-#: elf64-mmix.c:1670
+#: elf64-mmix.c:1618
#, c-format
msgid "%s: base-plus-offset relocation against register symbol: (unknown) in %s"
-msgstr "%s: â€base-plus-offsetâ€-sijoitus rekisterisymbolia varten: (tuntematon) kohteessa %s"
+msgstr "%s: â€base-plus-offsetâ€-sijoitus käyttäen rekisterisymbolia: (tuntematon) kohteessa %s"
-#: elf64-mmix.c:1675
+#: elf64-mmix.c:1623
#, c-format
msgid "%s: base-plus-offset relocation against register symbol: %s in %s"
-msgstr "%s: â€base-plus-offsetâ€-sijoitus rekisterisymbolia varten: %s kohteessa %s"
+msgstr "%s: â€base-plus-offsetâ€-sijoitus käyttäen rekisterisymbolia: %s kohteessa %s"
-#: elf64-mmix.c:1719
+#: elf64-mmix.c:1667
#, c-format
msgid "%s: register relocation against non-register symbol: (unknown) in %s"
-msgstr "%s: rekisterisijoitus ei-rekisterisymbolia varten: (tuntematon) kohteessa %s"
+msgstr "%s: rekisterisijoitus käyttäen ei-rekisterisymbolia: (tuntematon) kohteessa %s"
-#: elf64-mmix.c:1724
+#: elf64-mmix.c:1672
#, c-format
msgid "%s: register relocation against non-register symbol: %s in %s"
-msgstr "%s: rekisterisijoitus ei-rekisterisymbolia varten: %s kohteessa %s"
+msgstr "%s: rekisterisijoitus käyttäen ei-rekisterisymbolia: %s kohteessa %s"
-#: elf64-mmix.c:1761
+#: elf64-mmix.c:1709
#, c-format
msgid "%s: directive LOCAL valid only with a register or absolute value"
msgstr "%s: direktiivi LOCAL on oikea vain rekisterissä tai absoluuttiarvona"
-#: elf64-mmix.c:1789
+#: elf64-mmix.c:1739
#, c-format
msgid "%s: LOCAL directive: Register $%ld is not a local register. First global register is $%ld."
msgstr "%s: LOCAL-direktiivi: Rekisteri $%ld ei ole paikallinen rekisteri. Ensimmäinen yleisrekisteri on $%ld."
-#: elf64-mmix.c:2253
+#: elf64-mmix.c:2198
#, c-format
msgid "%s: Error: multiple definition of `%s'; start of %s is set in a earlier linked file\n"
msgstr "%s: Virhe: useita â€%sâ€-määrittelyjä; %s-alku on asetettu aiemmin linkitetyssä tiedostossa\n"
-#: elf64-mmix.c:2311
+#: elf64-mmix.c:2252
msgid "Register section has contents\n"
msgstr "Rekisterilohkossa on sisältö\n"
-#: elf64-mmix.c:2503
+#: elf64-mmix.c:2441
#, c-format
msgid ""
"Internal inconsistency: remaining %u != max %u.\n"
@@ -2766,80 +3132,105 @@ msgstr ""
"Sisäinen yhteensopimattomuus: jäljelle jäävä %u != maksimi %u.\n"
" Ilmoita ohjelmistovioista (englanniksi) osoitteeseen http://sourceware.org/bugzilla/."
-#: elf64-ppc.c:4185
+#: elf64-ppc.c:4463
msgid "%P: %B: cannot create stub entry %s\n"
msgstr "%P: %B: ei voi luoda stub-tulokohtaa %s\n"
-#: elf64-ppc.c:6518
-msgid "%P: copy reloc against `%s' requires lazy plt linking; avoid setting LD_BIND_NOW=1 or upgrade gcc\n"
-msgstr "%P: kopio-reloc-tietue â€%sâ€:ta varten vaatii laiskan plt-linkityksen; vältä asettamasta LD_BIND_NOW=1 tai päivitä gcc\n"
+#: elf64-ppc.c:4810
+msgid "%P: symbol '%s' has invalid st_other for ABI version 1\n"
+msgstr "%P: symboli ’%s’ on virheellinen st_other ABI-versiolle 1\n"
-#: elf64-ppc.c:6788
+#: elf64-ppc.c:5170
+msgid "%P: .opd not allowed in ABI version %d\n"
+msgstr "%P: .opd ei ole sallittu ABI-versiossa %d\n"
+
+#: elf64-ppc.c:5809
+msgid "%B uses unknown e_flags 0x%lx"
+msgstr "%B käyttää tuntematonta e_flags 0x%lx"
+
+#: elf64-ppc.c:5816
+msgid "%B: ABI version %ld is not compatible with ABI version %ld output"
+msgstr "%B: ABI-versio %ld ei ole yhteensopiva ABI-version %ld tulosteen kanssa"
+
+#: elf64-ppc.c:5843
+#, c-format
+msgid " [abiv%ld]"
+msgstr " [abiv%ld]"
+
+#: elf64-ppc.c:7007
+msgid "%P: copy reloc against `%T' requires lazy plt linking; avoid setting LD_BIND_NOW=1 or upgrade gcc\n"
+msgstr "%P: kopio-reloc-tietue käyttäen â€%Tâ€:ta vaatii laiskan plt-linkityksen; vältä asettamasta LD_BIND_NOW=1 tai päivitä gcc\n"
+
+#: elf64-ppc.c:7270
msgid "%B: undefined symbol on R_PPC64_TOCSAVE relocation"
msgstr "%B: määrittelemätön symboli R_PPC64_TOCSAVE-sijoituksessa"
-#: elf64-ppc.c:6992
+#: elf64-ppc.c:7499
msgid "%P: dynreloc miscount for %B, section %A\n"
msgstr "%P: dynreloc-väärinlaskenta kohteelle %B, lohko %A\n"
-#: elf64-ppc.c:7076
+#: elf64-ppc.c:7583
msgid "%B: .opd is not a regular array of opd entries"
msgstr "%B: â€.opd†ei ole säännönmukainen opd-tulokohtien taulukko"
-#: elf64-ppc.c:7085
+#: elf64-ppc.c:7592
msgid "%B: unexpected reloc type %u in .opd section"
msgstr "%B: odottamaton reloc-tyyppi %u â€.opdâ€-lohkossa"
-#: elf64-ppc.c:7106
+#: elf64-ppc.c:7613
msgid "%B: undefined sym `%s' in .opd section"
msgstr "%B: määrittelemätön symboli â€%s†â€.opdâ€-lohkossa"
-#: elf64-ppc.c:7664
+#: elf64-ppc.c:8177
msgid "%H __tls_get_addr lost arg, TLS optimization disabled\n"
msgstr "%H __tls_get_addr kadotti argumentin, TLS-optimointi otettu pois käytöstä\n"
-#: elf64-ppc.c:8003 elf64-ppc.c:8564
+#: elf64-ppc.c:8516 elf64-ppc.c:9139
#, c-format
msgid "%s defined on removed toc entry"
msgstr "%s määritelty poistetussa sisällysluettelotulokohdassa"
-#: elf64-ppc.c:8521
-msgid "%P: %H: %s relocation references optimized away TOC entry\n"
-msgstr "%P: %H: %s-sijoitusviitteet optimoitu pois tulokohtasisällysluettelossa\n"
+#: elf64-ppc.c:8868
+msgid "%P: %H: toc optimization is not supported for %s instruction.\n"
+msgstr "%P: %B: tulokohtasisällysluettelo-optimointia ei tueta %s-käskylle.\n"
-#: elf64-ppc.c:9598
-msgid "%P: cannot find opd entry toc for %s\n"
-msgstr "%P: ei kyetä löytämään opd-tulokohtasisällysluetteloa kohteelle %s\n"
+#: elf64-ppc.c:9096
+msgid "%P: %H: %s references optimized away TOC entry\n"
+msgstr "%P: %H: %s-viitteet optimoitu pois tulokohtasisällysluettelossa\n"
-#: elf64-ppc.c:9680
+#: elf64-ppc.c:10394
+msgid "%P: cannot find opd entry toc for `%T'\n"
+msgstr "%P: opd-kohdan tulokohtasisällysluettelon löytäminen kohteelle â€%T†epäonnistui\n"
+
+#: elf64-ppc.c:10479
msgid "%P: long branch stub `%s' offset overflow\n"
msgstr "%P: pitkä haarautumis-stub â€%s†siirrososoitteen ylivuoto\n"
-#: elf64-ppc.c:9739
+#: elf64-ppc.c:10538
msgid "%P: can't find branch stub `%s'\n"
msgstr "%P: ei löydy haarautumis-stub-kohdetta â€%sâ€\n"
-#: elf64-ppc.c:9801 elf64-ppc.c:9943
-msgid "%P: linkage table error against `%s'\n"
-msgstr "%P: linkitystauluvirhe â€%sâ€:ta varten\n"
+#: elf64-ppc.c:10602 elf64-ppc.c:10749 elf64-ppc.c:12416
+msgid "%P: linkage table error against `%T'\n"
+msgstr "%P: linkitystauluvirhe käyttäen kohdetta â€%Tâ€\n"
-#: elf64-ppc.c:10126
+#: elf64-ppc.c:10940
msgid "%P: can't build branch stub `%s'\n"
msgstr "%P: ei voi muodostaa haaroitus-stub-kohdetta â€%sâ€\n"
-#: elf64-ppc.c:10941
+#: elf64-ppc.c:11748
msgid "%B section %A exceeds stub group size"
msgstr "%B lohko %A ylittää stub-ryhmäkoon"
-#: elf64-ppc.c:11666 elf64-ppc.c:11699
+#: elf64-ppc.c:12662 elf64-ppc.c:12697
msgid "%P: %s offset too large for .eh_frame sdata4 encoding"
msgstr "%P: %s-siirrososoite liian suuri kohteelle .eh_frame sdata4 encoding"
-#: elf64-ppc.c:11744
+#: elf64-ppc.c:12758
msgid "%P: stubs don't match calculated size\n"
msgstr "%P: stubit ei täsmää lasketun koon kanssa\n"
-#: elf64-ppc.c:11756
+#: elf64-ppc.c:12770
#, c-format
msgid ""
"linker stubs in %u group%s\n"
@@ -2847,40 +3238,54 @@ msgid ""
" toc adjust %lu\n"
" long branch %lu\n"
" long toc adj %lu\n"
-" plt call %lu"
+" plt call %lu\n"
+" plt call toc %lu"
msgstr ""
"linkkeristubit %u-ryhmä%s:ssä\n"
" haarautuminen %lu\n"
" sisältöluettelosäätö %lu\n"
" pitkä haarautuminen %lu\n"
" pitkä sisältöluettelosäätö %lu\n"
-" plt-kutsu %lu"
+" plt-kutsu %lu\n"
+" plt-kutsusisältöluettelo %lu"
# TLS: transport layer security
-#: elf64-ppc.c:12042
-msgid "%P: %H: %s used with TLS symbol %s\n"
-msgstr "%P: %H: %s käytetään TLS-symbolin %s kanssa\n"
+#: elf64-ppc.c:13096
+msgid "%P: %H: %s used with TLS symbol `%T'\n"
+msgstr "%P: %H: %s käytetään TLS-symbolin â€%T†kanssa\n"
+
+#: elf64-ppc.c:13097
+msgid "%P: %H: %s used with non-TLS symbol `%T'\n"
+msgstr "%P: %H: %s käytetään ei-TLS-symbolin â€%T†kanssa\n"
-#: elf64-ppc.c:12043
-msgid "%P: %H: %s used with non-TLS symbol %s\n"
-msgstr "%P: %H: %s käytetään ei-TLS-symbolin %s kanssa\n"
+#: elf64-ppc.c:13675
+msgid "%P: %H: call to `%T' lacks nop, can't restore toc; recompile with -fPIC\n"
+msgstr "%P: %H: â€%Tâ€-kutsusta puuttuu nop, tulokohtasisältöluetteloa ei voi palauttaa; käännä uudelleen valitsimella -fPIC\n"
-#: elf64-ppc.c:12556
-msgid "%P: %H: automatic multiple TOCs not supported using your crt files; recompile with -mminimal-toc or upgrade gcc\n"
-msgstr "%P: %H: automaattisia useita sisältöluettelotauluja ei ole tuettu crt-tiedostoissasi; käännä uudelleen â€-mminimal-tocâ€-argumentilla tai päivitä gcc\n"
+#: elf64-ppc.c:13793
+msgid "%P: %B: unknown relocation type %d for `%T'\n"
+msgstr "%P: %B: tuntematon sijoitustyyppi %d symbolille â€%Tâ€\n"
-#: elf64-ppc.c:12562
-msgid "%P: %H: sibling call optimization to `%s' does not allow automatic multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, or make `%s' extern\n"
-msgstr "%P: %H: sisarruskutsuoptimointi kohteeseen â€%s†ei salli automaattisia useita sisällysluettelotauluja; käännä uudelleen â€-mminimal-tocâ€-argumentilla tai â€-fno-optimize-sibling-callsâ€-argumentilla, tai tee kohteesta â€%s†ulkoinen\n"
+#: elf64-ppc.c:14310
+msgid "%P: %H: %s for indirect function `%T' unsupported\n"
+msgstr "%P: %H: %s epäsuoralle funktiolle â€%T†ei tueta\n"
-#: elf64-ppc.c:13286
-msgid "%P: %B: relocation %s is not supported for symbol %s\n"
-msgstr "%P: %B: sijoitus %s ei ole tuettu symbolille %s\n"
+#: elf64-ppc.c:14417
+msgid "%P: %B: %s is not supported for `%T'\n"
+msgstr "%P: %B: %s ei ole tuettu kohteelle â€%Tâ€\n"
-#: elf64-ppc.c:13446
+#: elf64-ppc.c:14565
msgid "%P: %H: error: %s not a multiple of %u\n"
msgstr "%P: %H: virhe: sijoitus %s ei ole %u:n kerrannainen\n"
+#: elf64-ppc.c:14586
+msgid "%P: %H: unresolvable %s against `%T'\n"
+msgstr "%P: %H: ratkaisematon %s käyttäen kohdetta â€%Tâ€\n"
+
+#: elf64-ppc.c:14644
+msgid "%P: %H: %s against `%T': error %d\n"
+msgstr "%P: %H: %s käyttäen kohdetta â€%Tâ€: virhe %d\n"
+
#: elf64-sh64.c:1686
#, c-format
msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n"
@@ -2906,442 +3311,468 @@ msgstr "Symbolissa â€%s†on eri tyyppejä: %s kohteessa %B, aiemmin REGISTER
msgid "%B: linking UltraSPARC specific with HAL specific code"
msgstr "%B: linkitetään UltraSPARC-kohtainen HAL-kohtaisella koodilla"
-#: elf64-x86-64.c:1427
+#: elf64-x86-64.c:1530
msgid "%B: relocation %s against symbol `%s' isn't supported in x32 mode"
-msgstr "%B: sijoitusta %s symbolia `%s' varten ei tueta x32-tilassa"
+msgstr "%B: sijoitusta %s käyttäen symbolia `%s' ei tueta x32-tilassa"
-#: elf64-x86-64.c:1656
+#: elf64-x86-64.c:1688
msgid "%B: '%s' accessed both as normal and thread local symbol"
msgstr "%B: â€%s†kutsuttu sekä normaalina että säikeisenä paikallissymbolina"
-#: elf64-x86-64.c:3150
+#: elf64-x86-64.c:3405 /src/binutils-gdb/bfd/elfnn-aarch64.c:3511
msgid "%B: relocation %s against STT_GNU_IFUNC symbol `%s' has non-zero addend: %d"
-msgstr "%B: sijoituksella %s kohteen STT_GNU_IFUNC-symbolia â€%s†varten on ei-nolla-yhteenlaskettava: %d"
+msgstr "%B: sijoituksella %s käyttäen kohteen STT_GNU_IFUNC-symbolia â€%s†on ei-nolla-yhteenlaskettava: %d"
-#: elf64-x86-64.c:3411
+#: elf64-x86-64.c:3667
msgid "%B: relocation R_X86_64_GOTOFF64 against protected function `%s' can not be used when making a shared object"
-msgstr "%B: sijoitusta R_X86_64_GOTOFF64 suojattua funktiota â€%s†varten ei voida käyttää kun tehdään jaettua objektia"
+msgstr "%B: sijoitusta R_X86_64_GOTOFF64 käyttäen suojattua funktiota â€%s†ei voida käyttää kun tehdään jaettua objektia"
-#: elf64-x86-64.c:3523
+#: elf64-x86-64.c:3787
msgid "; recompile with -fPIC"
msgstr "; käännetty uudelleen -fPIC-parametrillä"
-#: elf64-x86-64.c:3528
+#: elf64-x86-64.c:3792
msgid "%B: relocation %s against %s `%s' can not be used when making a shared object%s"
-msgstr "%B: sijoitusta %s kohteeseen %s â€%s†ei voi käyttää kun tehdään jaettua objektia %s"
+msgstr "%B: sijoitusta %s käyttäen kohdetta %s â€%s†ei voi käyttää kun tehdään jaettua objektia %s"
-#: elf64-x86-64.c:3530
+#: elf64-x86-64.c:3794
msgid "%B: relocation %s against undefined %s `%s' can not be used when making a shared object%s"
-msgstr "%B: sijoitusta %s kohteeseen %s â€%s†ei voi käyttää kun tehdään jaettua objektia %s"
+msgstr "%B: sijoitusta %s käyttäen kohdetta %s â€%s†ei voi käyttää kun tehdään jaettua objektia %s"
+
+#: elf64-x86-64.c:3900
+msgid "%B: addend -0x%x in relocation %s against symbol `%s' at 0x%lx in section `%A' is out of range"
+msgstr "%B: yhteenlaskettava -0x%x sijoituksessa %s käyttäen symbolia â€%s†osoitteessa 0x%lx lohkossa â€%A†on lukualueen ulkopuolella"
+
+#: elf64-x86-64.c:3908
+msgid "%B: addend 0x%x in relocation %s against symbol `%s' at 0x%lx in section `%A' is out of range"
+msgstr "%B: yhteenlaskettava 0x%x sijoituksessa %s käyttäen symbolia â€%s†osoitteessa 0x%lx lohkossa â€%A†on lukualueen ulkopuolella"
-#: elfcode.h:767
+#: elfcode.h:760
#, c-format
msgid "warning: %s has a corrupt string table index - ignoring"
msgstr "varoitus: %s:ssa on rikkinäinen merkkijonotauluindeksi - ei oteta huomioon"
-#: elfcode.h:1177
+#: elfcode.h:1186
#, c-format
msgid "%s: version count (%ld) does not match symbol count (%ld)"
msgstr "%s: versiolukumäärä (%ld) ei täsmää symbolilukumäärän (%ld) kanssa"
-#: elfcode.h:1431
+#: elfcode.h:1440
#, c-format
msgid "%s(%s): relocation %d has invalid symbol index %ld"
msgstr "%s(%s): sijoituksessa %d on virheellinen symboli-indeksi %ld"
-#: elfcore.h:312
+#: elfcore.h:305
msgid "Warning: %B is truncated: expected core file size >= %lu, found: %lu."
msgstr "Varoitus: %B typistettiin: odotettu käyttöjärjestelmäydintiedoston koko >= %lu, löytyi: %lu."
-#: elflink.c:1117
+#: elflink.c:1143
msgid "%s: TLS definition in %B section %A mismatches non-TLS definition in %B section %A"
msgstr "%s: TLS-määrittely kohteessa %B lohko %A ei täsmää ei-TLS-määrittelyn kanssa kohteessa %B lohko %A"
-#: elflink.c:1121
+#: elflink.c:1148
msgid "%s: TLS reference in %B mismatches non-TLS reference in %B"
msgstr "%s: TLS-viite kohteessa %B ei täsmää ei-TLS-viitteen kanssa kohteessa %B"
-#: elflink.c:1125
+#: elflink.c:1153
msgid "%s: TLS definition in %B section %A mismatches non-TLS reference in %B"
msgstr "%s: TLS-määrittely kohteessa %B lohko %A ei täsmää ei-TLS-viitteen kanssa kohteessa %B"
-#: elflink.c:1129
+#: elflink.c:1158
msgid "%s: TLS reference in %B mismatches non-TLS definition in %B section %A"
msgstr "%s: TLS-viite kohteessa %B ei täsmää ei-TLS-määrittelyn kanssa kohteessa %B lohko %A"
-#: elflink.c:1762
+#: elflink.c:1763
msgid "%B: unexpected redefinition of indirect versioned symbol `%s'"
msgstr "%B: epäsuoran versioidun symbolin â€%s†odottamaton uudelleenmäärittely"
-#: elflink.c:2063
+#: elflink.c:2066
msgid "%B: version node not found for symbol %s"
msgstr "%B: versiosolmua ei löydetty symbolille %s"
-#: elflink.c:2154
+#: elflink.c:2157
msgid "%B: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%A'"
msgstr "%B: virheellinen reloc-tietuesymboli-indeksi (0x%lx >= 0x%lx) siirrososoitteelle 0x%lx lohkossa â€%Aâ€"
-#: elflink.c:2165
+#: elflink.c:2168
msgid "%B: non-zero symbol index (0x%lx) for offset 0x%lx in section `%A' when the object file has no symbol table"
msgstr "%B: ei-nolla symboli-indeksi (0x%lx) siirrososoitetta 0x%lx varten lohkossa â€%A†kun objektitiedostolla ei ole symbolitaulua"
-#: elflink.c:2355
+#: elflink.c:2358
msgid "%B: relocation size mismatch in %B section %A"
msgstr "%B: sijoituskokotäsmäämättömyys %B:n tulolohkossa %A"
-#: elflink.c:2639
+#: elflink.c:2640
#, c-format
msgid "warning: type and size of dynamic symbol `%s' are not defined"
msgstr "varoitus: dynaamisen symbolin â€%s†tyyppi ja koko ei ole määritelty"
# USA:ssa alternate-sanaa käytetään yleisesti, kun tarkoitetaan alternative.
-#: elflink.c:3391
+#: elflink.c:3403
msgid "%P: alternate ELF machine code found (%d) in %B, expecting %d\n"
msgstr "%P: vaihtoehtoinen ELF-konekoodi löydetty (%d) kohteessa %B, otetaan %d\n"
-#: elflink.c:4037
+#: elflink.c:4032
msgid "%B: %s: invalid version %u (max %d)"
msgstr "%B: %s: virheellinen versio %u (maksimi %d)"
-#: elflink.c:4073
+#: elflink.c:4068
msgid "%B: %s: invalid needed version %d"
msgstr "%B: %s: virheellinen tarvittu versio %d"
-#: elflink.c:4269
-msgid "Warning: alignment %u of common symbol `%s' in %B is greater than the alignment (%u) of its section %A"
-msgstr "Varoitus: tasaus %u yhteissymbolissa â€%s†kohteessa %B on suurempi kuin tasaus (%u) sen lohkossa %A"
-
-#: elflink.c:4275
-msgid "Warning: alignment %u of symbol `%s' in %B is smaller than %u in %B"
-msgstr "Varoitus: tasaus %u symbolissa â€%s†kohteessa %B on pienempi kuin %u kohteessa %B"
-
-#: elflink.c:4290
-msgid "Warning: size of symbol `%s' changed from %lu in %B to %lu in %B"
-msgstr "Varoitus: symbolin â€%s†koko vaihtui koosta %lu kohteessa %B kokoon %lu kohteessa %B"
-
-#: elflink.c:4463
+#: elflink.c:4452
msgid "%B: undefined reference to symbol '%s'"
msgstr "%B: määrittelemätön viite symboliin ’%s’"
-#: elflink.c:4466
-msgid "note: '%s' is defined in DSO %B so try adding it to the linker command line"
-msgstr "huomatus: ’%s’ on määritelty kohteessa DSO %B, joten yritä lisätä se linkkittäjän komentoriville"
+#: elflink.c:5523
+msgid "%B: stack size specified and %s set"
+msgstr "%B: pinokoko määritelty ja %s asetettu"
+
+#: elflink.c:5526
+msgid "%B: %s not absolute"
+msgstr "%B: ei ole absoluuttinen"
-#: elflink.c:5781
+#: elflink.c:5824
#, c-format
msgid "%s: undefined version: %s"
msgstr "%s: määrittelemätön versio: %s"
-#: elflink.c:5849
+#: elflink.c:5892
msgid "%B: .preinit_array section is not allowed in DSO"
msgstr "%B: â€.preinit_arrayâ€-lohkoa ei sallita kohteessa DSO"
-#: elflink.c:7604
+#: elflink.c:7657
#, c-format
msgid "undefined %s reference in complex symbol: %s"
msgstr "määrittelemätön %s-viite kompleksisymbolissa: %s"
-#: elflink.c:7758
+#: elflink.c:7811
#, c-format
msgid "unknown operator '%c' in complex symbol"
msgstr "tuntematon operaattori â€%c†kompleksisymbolissa"
-#: elflink.c:8097 elflink.c:8114 elflink.c:8151 elflink.c:8168
+#: elflink.c:8165 elflink.c:8182 elflink.c:8219 elflink.c:8236
msgid "%B: Unable to sort relocs - they are in more than one size"
msgstr "%B: Ei voi lajitella relocs-tietueita - niitä on useampia kuin yhtä kokoa"
-#: elflink.c:8128 elflink.c:8182
+#: elflink.c:8196 elflink.c:8250
msgid "%B: Unable to sort relocs - they are of an unknown size"
msgstr "%B: Ei voi lajitella relocs-tietueita - niiden koko on tuntematon"
-#: elflink.c:8233
+#: elflink.c:8301
msgid "Not enough memory to sort relocations"
msgstr "Ei tarpeeksi muistia sijoitusten lajittelemiseen"
-#: elflink.c:8426
+#: elflink.c:8494
msgid "%B: Too many sections: %d (>= %d)"
msgstr "%B: Liian monia lohkoja: %d (>= %d)"
-#: elflink.c:8675
+#: elflink.c:8775
msgid "%B: internal symbol `%s' in %B is referenced by DSO"
msgstr "%B: sisäinen symboli â€%s†kohteessa %B on DSO:n viitteenä"
-#: elflink.c:8677
+#: elflink.c:8777
msgid "%B: hidden symbol `%s' in %B is referenced by DSO"
msgstr "%B: piilotettu symboli â€%s†kohteessa %B on DSO:n viitteenä"
-#: elflink.c:8679
+#: elflink.c:8779
msgid "%B: local symbol `%s' in %B is referenced by DSO"
msgstr "%B: paikallinen symboli â€%s†kohteessa %B on DSO:n viitteenä"
-#: elflink.c:8776
+#: elflink.c:8890
msgid "%B: could not find output section %A for input section %A"
msgstr "%B: ei löytynyt tulostelohkoa %A syötelohkolle %A"
-#: elflink.c:8899
+#: elflink.c:9013
msgid "%B: protected symbol `%s' isn't defined"
msgstr "%B: suojattua symbolia â€%s†ei ole määritelty"
-#: elflink.c:8901
+#: elflink.c:9015
msgid "%B: internal symbol `%s' isn't defined"
msgstr "%B: sisäistä symbolia â€%s†ei ole määritelty"
-#: elflink.c:8903
+#: elflink.c:9017
msgid "%B: hidden symbol `%s' isn't defined"
msgstr "%B: piilotettua symbolia â€%s†ei ole määritelty"
-#: elflink.c:9432
+#: elflink.c:9043
+msgid "%B: No symbol version section for versioned symbol `%s'"
+msgstr "%B: Ei symboliversiolohkoa versioidulle symbolille â€%sâ€"
+
+#: elflink.c:9598
msgid "error: %B: size of section %A is not multiple of address size"
msgstr "virhe: %B: lohkon %A koko ei ole osoitekoon kerrannainen"
-#: elflink.c:9479
+#: elflink.c:9645
msgid "error: %B contains a reloc (0x%s) for section %A that references a non-existent global symbol"
msgstr "virhe: %B sisältää reloc-tietueen (0x%s) lohkolle %A, joka viittaa puuttuvaan yleissymboliin"
-#: elflink.c:10214
+#: elflink.c:10369
msgid "%A has both ordered [`%A' in %B] and unordered [`%A' in %B] sections"
msgstr "%A:ssa on sekä järjestettyjä [â€%A†kohteessa %B] että järjestämättömiä [â€%A†kohteessa %B] lohkoja"
-#: elflink.c:10219
+#: elflink.c:10374
#, c-format
msgid "%A has both ordered and unordered sections"
msgstr "%A:ssa on sekä järjestettyjä että järjestämättömiä lohkoja"
-#: elflink.c:10784
+#: elflink.c:10982
msgid "%B: file class %s incompatible with %s"
msgstr "%B: tiedostoluokka %s on yhteensopimaton kohteen %s kanssa"
-#: elflink.c:11093 elflink.c:11137
+#: elflink.c:11303 elflink.c:11347
msgid "%B: could not find output section %s"
msgstr "%B: ei löytynyt tulostelohkoa %s"
-#: elflink.c:11098
+#: elflink.c:11308
#, c-format
msgid "warning: %s section has zero size"
msgstr "varoitus: %s-lohkossa on nollakoko"
-#: elflink.c:11143
+#: elflink.c:11353
#, c-format
msgid "warning: section '%s' is being made into a note"
msgstr "varoitus: lohkosta â€%s†on tehty note-lohko"
-#: elflink.c:11212
+#: elflink.c:11419
msgid "%P%X: read-only segment has dynamic relocations.\n"
msgstr "%P%X: kirjoitussuojatussa segmentissä on dynaamisia sijoituksia.\n"
-#: elflink.c:11215
+#: elflink.c:11422
msgid "%P: warning: creating a DT_TEXTREL in a shared object.\n"
msgstr "%P: varoitus: luodaan DT_TEXTREL-tunniste jaetussa objektissa.\n"
-#: elflink.c:11402
+#: elflink.c:11545
msgid "%P%X: can not read symbols: %E\n"
msgstr "%P%X: ei voi lukea symboleja: %E\n"
-#: elflink.c:11792
+#: elflink.c:11989
msgid "Removing unused section '%s' in file '%B'"
msgstr "Poistetaan käyttämätön lohko â€%s†tiedostossa â€%Bâ€"
-#: elflink.c:11998
+#: elflink.c:12200
msgid "Warning: gc-sections option ignored"
msgstr "Varoitus: â€gc-sectionsâ€-valitsinta ei oteta huomioon"
-#: elflink.c:12277
+#: elflink.c:12489
#, c-format
msgid "Unrecognized INPUT_SECTION_FLAG %s\n"
msgstr "Tunnistamaton INPUT_SECTION_FLAG %s\n"
-#: elfxx-mips.c:1234
+#: elfxx-mips.c:1419
msgid "static procedure (no name)"
msgstr "staattinen proseduuri (ei nimeä)"
-#: elfxx-mips.c:5259
+#: elfxx-mips.c:5476
msgid "MIPS16 and microMIPS functions cannot call each other"
msgstr "MIPS16- ja microMIPS-funktiot eivät voi kutsua toisiaan"
-#: elfxx-mips.c:5856
-msgid "%B: %A+0x%lx: Direct jumps between ISA modes are not allowed; consider recompiling with interlinking enabled."
-msgstr "%B: %A+0x%lx: Suorat hypyt ISA-tilojen välillä eivät ole sallittuja; harkitse uudelleenkääntämistä käyttäen yhteislinkitystä."
+#: elfxx-mips.c:6087
+msgid "%B: %A+0x%lx: Unsupported jump between ISA modes; consider recompiling with interlinking enabled."
+msgstr "%B: %A+0x%lx: Tukematon hyppy ISA-tilojen välillä; harkitse uudelleenkääntämistä käyttäen yhteislinkitystä."
-#: elfxx-mips.c:6519 elfxx-mips.c:6742
+#: elfxx-mips.c:6756 elfxx-mips.c:6979
msgid "%B: Warning: bad `%s' option size %u smaller than its header"
msgstr "%B: Varoitus: virheellinen â€%sâ€-valitsinkoko %u pienempi kuin sen otsake"
-#: elfxx-mips.c:7495 elfxx-mips.c:7620
+#: elfxx-mips.c:7734 elfxx-mips.c:7859
msgid "%B: Warning: cannot determine the target function for stub section `%s'"
msgstr "%B: Varoitus: ei voi määritellä stub-lohkon â€%s†kohdefunktiota"
-#: elfxx-mips.c:7749
+#: elfxx-mips.c:7990
msgid "%B: Malformed reloc detected for section %s"
msgstr "%B: Muodoltaan virheellinen reloc-tietue havaittu lohkossa %s"
-#: elfxx-mips.c:7801
+#: elfxx-mips.c:8065
msgid "%B: GOT reloc at 0x%lx not expected in executables"
msgstr "%B: Yleissiirrostaulu-reloc-tietue siirroksessa 0x%lx ei ole odotettu suoritettavissa tiedostoissa"
-#: elfxx-mips.c:7930
+#: elfxx-mips.c:8199
msgid "%B: CALL16 reloc at 0x%lx not against global symbol"
-msgstr "%B: â€CALL16 relocâ€-tietue siirroksessa 0x%lx ei ole yleissymbolia varten"
+msgstr "%B: â€CALL16 relocâ€-tietueessa siirroksessa 0x%lx ei ole käytetty yleissymbolia"
-#: elfxx-mips.c:8645
+#: elfxx-mips.c:8977
#, c-format
msgid "non-dynamic relocations refer to dynamic symbol %s"
msgstr "ei-dynaaminen sijoitus viittaa dynaamiseen symboliin %s"
-#: elfxx-mips.c:9347
+#: elfxx-mips.c:9877
msgid "%B: Can't find matching LO16 reloc against `%s' for %s at 0x%lx in section `%A'"
-msgstr "%B: Ei löydy täsmäävää â€LO16 relocâ€-tietuetta tulolohkoa â€%s†varten symbolinimelle %s kohteessa 0x%lx lohkossa â€%Aâ€"
+msgstr "%B: Ei löydy täsmäävää â€LO16 relocâ€-tietuetta käyttäen tulolohkoa â€%s†symbolinimelle %s kohteessa 0x%lx lohkossa â€%Aâ€"
-#: elfxx-mips.c:9486
+#: elfxx-mips.c:10016
msgid "small-data section exceeds 64KB; lower small-data size limit (see option -G)"
msgstr "â€smallâ€-datalohko ylittää 64 kilotavua; alenna â€smallâ€-datalohkon kokorajaa (katso valitsin -G)"
-#: elfxx-mips.c:9505
+#: elfxx-mips.c:10035
msgid "JALX to a non-word-aligned address"
msgstr "JALX word-tasaamattomaan osoitteeseen"
-#: elfxx-mips.c:13266
+#: elfxx-mips.c:10402 elfxx-mips.c:10966
+msgid "%B: `%A' offset of %ld from `%A' beyond the range of ADDIUPC"
+msgstr "%B: â€%A†%ld-siirrosoiste kohteesta â€%A†ADDIUPC-lukualueen takana"
+
+#: elfxx-mips.c:13990
#, c-format
msgid "%s: illegal section name `%s'"
msgstr "%s: virheellinen lohkonimi â€%sâ€"
-#: elfxx-mips.c:13645 elfxx-mips.c:13671
-msgid "Warning: %B uses -msingle-float, %B uses -mdouble-float"
-msgstr "Varoitus: %B käyttää â€-msingle-floatâ€-valitsinta, %B käyttää â€-mdouble-floatâ€-valitsinta"
+#: elfxx-mips.c:14375 elfxx-mips.c:14381 elfxx-mips.c:14387 elfxx-mips.c:14407
+#: elfxx-mips.c:14413 elfxx-mips.c:14419 elfxx-mips.c:14441 elfxx-mips.c:14460
+#: elfxx-mips.c:14467 elfxx-mips.c:14474
+msgid "Warning: %B uses %s (set by %B), %B uses %s"
+msgstr "Varoitus: %B käyttää %s (asettaja: %B), %B käyttää %s"
+
+#: elfxx-mips.c:14394 elfxx-mips.c:14426 elfxx-mips.c:14447 elfxx-mips.c:14480
+msgid "Warning: %B uses %s (set by %B), %B uses unknown floating point ABI %d"
+msgstr "Varoitus: %B käyttää %s (asettaja: %B), %B käyttää tuntematonta liukuluku-ABI:a %d"
+
+#: elfxx-mips.c:14493 elfxx-mips.c:14501 elfxx-mips.c:14509 elfxx-mips.c:14517
+msgid "Warning: %B uses unknown floating point ABI %d (set by %B), %B uses %s"
+msgstr "Varoitus: %B käyttää tuntematonta liukuluku-ABI:a %d (asettaja: %B), %B käyttää %s"
+
+#: elfxx-mips.c:14525
+msgid "Warning: %B uses unknown floating point ABI %d (set by %B), %B uses unknown floating point ABI %d"
+msgstr "Varoitus: %B käyttää tuntematonta liukuluku-ABI:a %d (asettaja: %B), %B käyttää tuntematonta liukuluku-ABI:a %d"
+
+#: elfxx-mips.c:14548
+msgid "Warning: %B uses %s (set by %B), %B uses unknown MSA ABI %d"
+msgstr "Varoitus: %B käyttää %s (asettaja: %B), %B käyttää tuntematonta MSA ABI:a %d"
-#: elfxx-mips.c:13657 elfxx-mips.c:13713
-msgid "Warning: %B uses -msingle-float, %B uses -mips32r2 -mfp64"
-msgstr "Varoitus: %B käyttää â€-msingle-floatâ€-valitsinta, %B käyttää â€-mips32r2 -mfp64â€-valitsimia"
+#: elfxx-mips.c:14559
+msgid "Warning: %B uses unknown MSA ABI %d (set by %B), %B uses %s"
+msgstr "Varoitus: %B käyttää tuntematonta MSA ABI:a %d (asettaja: %B), %B käyttää %s"
-#: elfxx-mips.c:13683 elfxx-mips.c:13719
-msgid "Warning: %B uses -mdouble-float, %B uses -mips32r2 -mfp64"
-msgstr "Varoitus: %B käyttää â€-mdouble-floatâ€-valitsinta, %B käyttää â€-mips32r2 -mfp64â€-valitsimia"
+#: elfxx-mips.c:14567
+msgid "Warning: %B uses unknown MSA ABI %d (set by %B), %B uses unknown MSA ABI %d"
+msgstr "Varoitus: %B käyttää tuntematonta MSA ABI:a %d (asettaja: %B), %B käyttää tuntematonta MSA ABI:a %d"
-#: elfxx-mips.c:13761
+#: elfxx-mips.c:14599
msgid "%B: endianness incompatible with that of the selected emulation"
msgstr "%B: tavujärjestys tyypiltään sopimaton valitun emuloinnin tavujärjestystyypin kanssa"
-#: elfxx-mips.c:13772
+#: elfxx-mips.c:14610
msgid "%B: ABI is incompatible with that of the selected emulation"
msgstr "%B: ABI ei ole yhteensopiva valitun emuloinnin ABIn kanssa"
-#: elfxx-mips.c:13856
+#: elfxx-mips.c:14694
msgid "%B: warning: linking abicalls files with non-abicalls files"
msgstr "%B: varoitus: linkitetään abi-kutsutiedostoja ei-abi-kutsutiedostoihin"
-#: elfxx-mips.c:13873
+#: elfxx-mips.c:14711
msgid "%B: linking 32-bit code with 64-bit code"
msgstr "%B: linkitetään 32-bittinen koodi 64-bittisen koodin kanssa"
-#: elfxx-mips.c:13901
+#: elfxx-mips.c:14739 elfxx-mips.c:14802
msgid "%B: linking %s module with previous %s modules"
msgstr "%B: linkitetään %s-moduli edellisten %s-modulien kanssa"
-#: elfxx-mips.c:13924
+#: elfxx-mips.c:14762
msgid "%B: ABI mismatch: linking %s module with previous %s modules"
msgstr "%B: ABI-täsmäämättömyys: linkitetään %s-moduli edellisten %s-modulien kanssa"
-#: elfxx-mips.c:13948
+#: elfxx-mips.c:14786
msgid "%B: ASE mismatch: linking %s module with previous %s modules"
msgstr "%B: ASE-täsmäämättömyys: linkitetään %s-moduli edellisten %s-modulien kanssa"
-#: elfxx-mips.c:14106
+#: elfxx-mips.c:14958
#, c-format
msgid " [abi=O32]"
msgstr " [abi=O32]"
-#: elfxx-mips.c:14108
+#: elfxx-mips.c:14960
#, c-format
msgid " [abi=O64]"
msgstr " [abi=O64]"
-#: elfxx-mips.c:14110
+#: elfxx-mips.c:14962
#, c-format
msgid " [abi=EABI32]"
msgstr " [abi=EABI32]"
-#: elfxx-mips.c:14112
+#: elfxx-mips.c:14964
#, c-format
msgid " [abi=EABI64]"
msgstr " [abi=EABI64]"
-#: elfxx-mips.c:14114
+#: elfxx-mips.c:14966
#, c-format
msgid " [abi unknown]"
msgstr " [abi tuntematon]"
-#: elfxx-mips.c:14116
+#: elfxx-mips.c:14968
#, c-format
msgid " [abi=N32]"
msgstr " [abi=N32]"
-#: elfxx-mips.c:14118
+#: elfxx-mips.c:14970
#, c-format
msgid " [abi=64]"
msgstr " [abi=64]"
-#: elfxx-mips.c:14120
+#: elfxx-mips.c:14972
#, c-format
msgid " [no abi set]"
msgstr " [ei abia asetettu]"
-#: elfxx-mips.c:14141
+#: elfxx-mips.c:14993
#, c-format
msgid " [unknown ISA]"
msgstr " [tuntematon ISA]"
-#: elfxx-mips.c:14155
+#: elfxx-mips.c:15013
#, c-format
msgid " [not 32bitmode]"
msgstr " [ei 32-bittitila]"
-#: elfxx-sparc.c:596
+#: elfxx-sparc.c:640
#, c-format
msgid "invalid relocation type %d"
msgstr "virheellinen sijoitustyyppi %d"
-#: elfxx-tilegx.c:3952
+#: elfxx-tilegx.c:4433
msgid "%B: Cannot link together %s and %s objects."
msgstr "%B: Ei voida linkittää yhteen %s- ja %s-objekteja."
-#: i386linux.c:451 m68klinux.c:456 sparclinux.c:450
+#: i386linux.c:418 m68klinux.c:421 sparclinux.c:414
#, c-format
msgid "Output file requires shared library `%s'\n"
msgstr "Tulostetiedosto vaatii jaetun kirjaston â€%sâ€\n"
-#: i386linux.c:459 m68klinux.c:464 sparclinux.c:458
+#: i386linux.c:426 m68klinux.c:429 sparclinux.c:422
#, c-format
msgid "Output file requires shared library `%s.so.%s'\n"
msgstr "Tulostetiedosto vaatii jaetun kirjaston â€%s.so.%sâ€\n"
-#: i386linux.c:648 i386linux.c:698 m68klinux.c:656 m68klinux.c:704
-#: sparclinux.c:648 sparclinux.c:698
+#: i386linux.c:613 i386linux.c:663 m68klinux.c:618 m68klinux.c:666
+#: sparclinux.c:609 sparclinux.c:659
#, c-format
msgid "Symbol %s not defined for fixups\n"
msgstr "Symbolia %s ei ole määritelty korjauksia varten\n"
-#: i386linux.c:722 m68klinux.c:728 sparclinux.c:722
+#: i386linux.c:687 m68klinux.c:690 sparclinux.c:683
msgid "Warning: fixup count mismatch\n"
msgstr "Varoitus: korjauslukumäärän täsmäämättömyys\n"
-#: ieee.c:159
+#: ieee.c:158
#, c-format
msgid "%s: string too long (%d chars, max 65535)"
msgstr "%s: merkkijono on liian pitkä (%d merkkiä, maksimi 65535)"
-#: ieee.c:286
+#: ieee.c:285
#, c-format
msgid "%s: unrecognized symbol `%s' flags 0x%x"
msgstr "%s: tunnistamaton symboli â€%s†liput 0x%x"
-#: ieee.c:792
+#: ieee.c:791
msgid "%B: unimplemented ATI record %u for symbol %u"
msgstr "%B: toteuttamaton ATI-tietue %u symbolille %u"
-#: ieee.c:816
+#: ieee.c:815
msgid "%B: unexpected ATN type %d in external part"
msgstr "%B: odottamaton ATN-tyyppi %d ulkoisessa osassa"
-#: ieee.c:838
+#: ieee.c:837
msgid "%B: unexpected type after ATN"
msgstr "%B: odottamaton tyyppi ATN:n jälkeen"
@@ -3408,281 +3839,223 @@ msgstr "Käytöstä poistettu %s kutsuttiin tiedostossa %s rivillä %d funktioss
msgid "Deprecated %s called\n"
msgstr "Käytöstä poistettu %s kutsuttu\n"
-#: linker.c:1872
+#: linker.c:1873
msgid "%B: indirect symbol `%s' to `%s' is a loop"
msgstr "%B: epäsuora symboli â€%s†kohteeseen â€%s†on silmukka"
-#: linker.c:2736
+#: linker.c:2750
#, c-format
msgid "Attempt to do relocatable link with %s input and %s output"
msgstr "Yritettiin tehdä sijoitettava linkki %s-syötteellä ja %s-tulosteella"
-#: linker.c:3021
+#: linker.c:3035
msgid "%B: ignoring duplicate section `%A'\n"
msgstr "%B: ei oteta huomioon lohkon â€%A†kaksoiskappaletta\n"
-#: linker.c:3030 linker.c:3039
+#: linker.c:3044 linker.c:3053
msgid "%B: duplicate section `%A' has different size\n"
msgstr "%B: lohkon â€%A†kaksoiskappaleessa on eri koko\n"
-#: linker.c:3047 linker.c:3052
+#: linker.c:3061 linker.c:3066
msgid "%B: could not read contents of section `%A'\n"
msgstr "%B: ei voitu lukea lohkon â€%A†sisältöä\n"
-#: linker.c:3056
+#: linker.c:3070
msgid "%B: duplicate section `%A' has different contents\n"
msgstr "%B: lohkon â€%A†kaksoiskappaleella on erilainen sisältö\n"
-#: mach-o.c:407
+#: mach-o.c:648
msgid "bfd_mach_o_canonicalize_symtab: unable to load symbols"
msgstr "bfd_mach_o_canonicalize_symtab: ei kyetä lataamaan symboleja"
-#: mach-o.c:1301
+#: mach-o.c:1918
+#, c-format
+msgid "mach-o: there are too many sections (%d) maximum is 255,\n"
+msgstr "mach-o: liian monta lohkoa (%d) maksimi on 255,\n"
+
+#: mach-o.c:2017
#, c-format
msgid "unable to write unknown load command 0x%lx"
msgstr "ei kyetä kirjoittamaan tuntematonta lataa-komentoa 0x%lx"
-#: mach-o.c:1789
+#: mach-o.c:2272
+msgid "sorry: modtab, toc and extrefsyms are not yet implemented for dysymtab commands."
+msgstr "valitettavasti modtab, toc ja extrefsyms ei ole vielä toteutettu dysymtab-komennoille."
+
+#: mach-o.c:2898
#, c-format
msgid "bfd_mach_o_read_symtab_symbol: unable to read %d bytes at %lu"
msgstr "bfd_mach_o_read_symtab_symbol: ei kyetä lukemaan %d tavua osoitteesta %lu"
-#: mach-o.c:1807
+#: mach-o.c:2916
#, c-format
msgid "bfd_mach_o_read_symtab_symbol: name out of range (%lu >= %lu)"
msgstr "bfd_mach_o_read_symtab_symbol: nimi lukualueen ulkopuolella (%lu >= %lu)"
-#: mach-o.c:1892
+#: mach-o.c:2997
#, c-format
msgid "bfd_mach_o_read_symtab_symbol: symbol \"%s\" specified invalid section %d (max %lu): setting to undefined"
msgstr "bfd_mach_o_read_symtab_symbol: symboli â€%s†määritellyt virheellisen lohkon %d (enintään %lu): asetus on määrittelemätön"
-#: mach-o.c:1900
-#, c-format
-msgid "bfd_mach_o_read_symtab_symbol: symbol \"%s\" is unsupported 'indirect' reference: setting to undefined"
-msgstr "bfd_mach_o_read_symtab_symbol: symboli â€%s†on tukematon ’epäsuora’ viite: asetus on määrittelemätön"
-
-#: mach-o.c:1906
+#: mach-o.c:3013
#, c-format
msgid "bfd_mach_o_read_symtab_symbol: symbol \"%s\" specified invalid type field 0x%x: setting to undefined"
msgstr "bfd_mach_o_read_symtab_symbol: symboli â€%s†määritellyt virheellisen tyyppikentän 0x%x: asetus on määrittelemätön"
-#: mach-o.c:1979
+#: mach-o.c:3085
msgid "bfd_mach_o_read_symtab_symbols: unable to allocate memory for symbols"
msgstr "bfd_mach_o_read_symtab_symbols: ei kyetä varaamaan muistia symboleille"
-#: mach-o.c:2014
-#, c-format
-msgid "bfd_mach_o_read_dysymtab_symbol: unable to read %lu bytes at %lu"
-msgstr "bfd_mach_o_read_dysymtab_symbol: ei kyetä lukemaan %lu tavua osoitteesta %lu"
-
-#: mach-o.c:2734
-#, c-format
-msgid "unable to read unknown load command 0x%lx"
-msgstr "ei kyetä lukemaan tuntematonta lataa-käskyä 0x%lx"
+#: mach-o.c:3915
+msgid "%B: unknown load command 0x%lx"
+msgstr "%B: tuntematon latauskäsky 0x%lx"
-#: mach-o.c:2915
+#: mach-o.c:4107
#, c-format
msgid "bfd_mach_o_scan: unknown architecture 0x%lx/0x%lx"
msgstr "bfd_mach_o_scan: tuntematon arkkitehtuuri 0x%lx/0x%lx"
-#: mach-o.c:3011
+#: mach-o.c:4204
#, c-format
msgid "unknown header byte-order value 0x%lx"
msgstr "tuntematon otsaketavujärjestysarvo 0x%lx"
-#: mach-o.c:3577
-msgid "Mach-O header:\n"
-msgstr "Mach-O otsake:\n"
-
-#: mach-o.c:3578
-#, c-format
-msgid " magic : %08lx\n"
-msgstr " maaginen : %08lx\n"
-
-#: mach-o.c:3579
-#, c-format
-msgid " cputype : %08lx (%s)\n"
-msgstr " prosessorityyppi : %08lx (%s)\n"
-
-#: mach-o.c:3581
-#, c-format
-msgid " cpusubtype: %08lx\n"
-msgstr " prosessorialityyppi : %08lx\n"
-
-#: mach-o.c:3582
-#, c-format
-msgid " filetype : %08lx (%s)\n"
-msgstr " tiedostotyyppi : %08lx (%s)\n"
-
-#: mach-o.c:3585
-#, c-format
-msgid " ncmds : %08lx (%lu)\n"
-msgstr "ncmds : %08lx (%lu)\n"
-
-#: mach-o.c:3586
-#, c-format
-msgid " sizeofcmds: %08lx\n"
-msgstr " komentojenkoko : %08lx\n"
-
-#: mach-o.c:3587
-#, c-format
-msgid " flags : %08lx ("
-msgstr " liput : %08lx ("
-
-#: mach-o.c:3589 vms-alpha.c:7674
-msgid ")\n"
-msgstr ")\n"
-
-#: mach-o.c:3590
-#, c-format
-msgid " reserved : %08x\n"
-msgstr " varattu : %08x\n"
-
-#: mach-o.c:3600
-msgid "Segments and Sections:\n"
-msgstr "Segmentit ja lohkot:\n"
-
-#: mach-o.c:3601
-msgid " #: Segment name Section name Address\n"
-msgstr " #: Segmenttinimi Lohkonnimi Osoite\n"
-
#: merge.c:832
#, c-format
msgid "%s: access beyond end of merged section (%ld)"
msgstr "%s: pääsy lomitetun lohkon (%ld) lopun yli"
-#: mmo.c:456
+#: mmo.c:455
#, c-format
msgid "%s: No core to allocate section name %s\n"
msgstr "%s: Ei käyttöjärjestelmäydintä lohkonimen %s varaamiseen\n"
-#: mmo.c:531
+#: mmo.c:530
#, c-format
msgid "%s: No core to allocate a symbol %d bytes long\n"
msgstr "%s: Ei käyttöjärjestelmäydintä symbolin varaamiseksi %d tavua pitkänä\n"
-#: mmo.c:1187
+#: mmo.c:1189
#, c-format
msgid "%s: invalid mmo file: initialization value for $255 is not `Main'\n"
msgstr "%s: virheellinen mmo-tiedosto: alustusarvo kohteelle $255 ei ole â€Mainâ€\n"
-#: mmo.c:1332
+#: mmo.c:1334
#, c-format
msgid "%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name starting with `%s'\n"
msgstr "%s: ei-tuettu leveämerkkisekvenssi 0x%02X 0x%02X symbolinimen jälkeen alkaen arvolla â€%sâ€\n"
-#: mmo.c:1565
+#: mmo.c:1568
#, c-format
msgid "%s: invalid mmo file: unsupported lopcode `%d'\n"
msgstr "%s: virheellinen mmo-tiedosto: ei-tuettu lopcode â€%dâ€\n"
-#: mmo.c:1575
+#: mmo.c:1578
#, c-format
msgid "%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n"
msgstr "%s: virheellinen mmo-tiedosto: odotettu YZ = 1 saatiin YZ = %d kohteelle lop_quote\n"
-#: mmo.c:1611
+#: mmo.c:1614
#, c-format
msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n"
msgstr "%s: virheellinen mmo-tiedosto: odotettiin z = 1 tai z = 2, saatiin z = %d kohteelle lop_loc\n"
-#: mmo.c:1657
+#: mmo.c:1660
#, c-format
msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n"
msgstr "%s: virheellinen mmo-tiedosto: odotettiin z = 1 tai z = 2, saatiin z = %d kohteelle lop_fixo\n"
-#: mmo.c:1696
+#: mmo.c:1699
#, c-format
msgid "%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n"
msgstr "%s: virheellinen mmo-tiedosto: odotettiin y = 0, saatiin y = %d kohteelle lop_fixrx\n"
-#: mmo.c:1705
+#: mmo.c:1708
#, c-format
msgid "%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n"
msgstr "%s: virheellinen mmo-tiedosto: odotettiin z = 16 tai z = 24, saatiin z = %d kohteelle lop_fixrx\n"
-#: mmo.c:1728
+#: mmo.c:1731
#, c-format
msgid "%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d for lop_fixrx\n"
msgstr "%s: virheellinen mmo-tiedosto: operandisanan etutavun on oltava 0 tai 1, saatiin %d kohteelle lop_fixrx\n"
-#: mmo.c:1751
+#: mmo.c:1754
#, c-format
msgid "%s: cannot allocate file name for file number %d, %d bytes\n"
msgstr "%s: ei voi varata tiedostonimeä tiedostonumerolle %d, %d tavua\n"
-#: mmo.c:1771
+#: mmo.c:1774
#, c-format
msgid "%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n"
msgstr "%s: virheellinen mmo-tiedosto: tiedostonumero %d â€%sâ€, oli jo kirjoitettu arvona â€%sâ€\n"
-#: mmo.c:1784
+#: mmo.c:1787
#, c-format
msgid "%s: invalid mmo file: file name for number %d was not specified before use\n"
msgstr "%s: virheellinen mmo-tiedosto: tiedostonimi numerolle %d ei ole määritelty ennen käyttöä\n"
-#: mmo.c:1890
+#: mmo.c:1893
#, c-format
msgid "%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n"
msgstr "%s: virheellinen mmo-tiedosto: lop_stab:n kentät y ja z ovat nollasta poikkeavia, y: %d, z: %d\n"
-#: mmo.c:1926
+#: mmo.c:1929
#, c-format
msgid "%s: invalid mmo file: lop_end not last item in file\n"
msgstr "%s: virheellinen mmo-tiedosto: lop_end ei ole viimeinen alkio tiedostossa\n"
-#: mmo.c:1939
+#: mmo.c:1942
#, c-format
msgid "%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras to the preceding lop_stab (%ld)\n"
msgstr "%s: virheellinen mmo-tiedosto: lop_end:n YZ (%ld) ei ole sama kuin tetras-numero edeltävään kohteeseen lop_stab (%ld)\n"
-#: mmo.c:2649
+#: mmo.c:2652
#, c-format
msgid "%s: invalid symbol table: duplicate symbol `%s'\n"
msgstr "%s: virheellinen symbolitaulu: symbolin â€%s†kaksoiskappale\n"
-#: mmo.c:2889
+#: mmo.c:2892
#, c-format
msgid "%s: Bad symbol definition: `Main' set to %s rather than the start address %s\n"
msgstr "%s: Virheellinen symbolimäärittely: â€Main†asetettu kohteeseen %s pikemmin kuin aloitusosoitteeseen %s\n"
-#: mmo.c:2981
+#: mmo.c:2984
#, c-format
msgid "%s: warning: symbol table too large for mmo, larger than 65535 32-bit words: %d. Only `Main' will be emitted.\n"
msgstr "%s: varoitus: symbolitaulu liian laaja kohteelle mmo, laajempi kuin 65535 32-bittistä sanaa: %d. Vain â€Main†lähetetään.\n"
-#: mmo.c:3026
+#: mmo.c:3029
#, c-format
msgid "%s: internal error, symbol table changed size from %d to %d words\n"
msgstr "%s: sisäinen virhe, symbolitaulu vaihtoi kokoa %d:sta sanasta %d sanaan\n"
-#: mmo.c:3078
+#: mmo.c:3081
#, c-format
msgid "%s: internal error, internal register section %s had contents\n"
msgstr "%s: sisäinen virhe, sisäisessä rekisterilohkossa %s oli sisältöä\n"
-#: mmo.c:3129
+#: mmo.c:3132
#, c-format
msgid "%s: no initialized registers; section length 0\n"
msgstr "%s: ei alustettuja rekistereitä; lohkopituus 0\n"
-#: mmo.c:3135
+#: mmo.c:3138
#, c-format
msgid "%s: too many initialized registers; section length %ld\n"
msgstr "%s: liian monia alustettuja rekistereitä; lohkopituus %ld\n"
-#: mmo.c:3140
+#: mmo.c:3143
#, c-format
msgid "%s: invalid start address for initialized registers of length %ld: 0x%lx%08lx\n"
msgstr "%s: virheellinen aloitusosoite alustetuille rekistereille pituudeltaan %ld: 0x%lx%08lx\n"
-#: oasys.c:882
+#: oasys.c:881
#, c-format
msgid "%s: can not represent section `%s' in oasys"
msgstr "%s: ei voi edustaa lohkoa â€%s†oasys-lohkossa"
-#: osf-core.c:140
+#: osf-core.c:128
#, c-format
msgid "Unhandled OSF/1 core file section type %d\n"
msgstr "Käsittelemätön OSF/1-käyttöjärjestelmäydintiedoston lohkotyyppi %d\n"
@@ -3707,18 +4080,18 @@ msgstr "%B: hyppy liian kauas\n"
msgid "%B: bad pair/reflo after refhi\n"
msgstr "%B: virheellinen pari/reflo refhi:n jälkeen\n"
-#: pef.c:520
+#: pef.c:522
#, c-format
msgid "bfd_pef_scan: unknown architecture 0x%lx"
msgstr "bfd_pef_scan: tuntematon arkkitehtuuri 0x%lx"
-#: pei-x86_64.c:444
+#: pei-x86_64.c:469
#, c-format
msgid "warning: .pdata section size (%ld) is not a multiple of %d\n"
msgstr "varoitus: â€.pdataâ€-lohkokoko (%ld) ei ole %d:n monikerta\n"
-#: pei-x86_64.c:448 peigen.c:1618 peigen.c:1801 pepigen.c:1618 pepigen.c:1801
-#: pex64igen.c:1618 pex64igen.c:1801
+#: pei-x86_64.c:474 peigen.c:1626 peigen.c:1809 pepigen.c:1626 pepigen.c:1809
+#: pex64igen.c:1626 pex64igen.c:1809
#, c-format
msgid ""
"\n"
@@ -3727,41 +4100,41 @@ msgstr ""
"\n"
"Funktiotaulu (tulkittu â€.pdataâ€-lohkosisältö)\n"
-#: pei-x86_64.c:450
+#: pei-x86_64.c:476
#, c-format
msgid "vma:\t\t\tBeginAddress\t EndAddress\t UnwindData\n"
msgstr "vma:\t\t\tAlkuosoite\t Loppuosoite\t Unwind-tiedot\n"
#. XXX code yet to be written.
-#: peicode.h:751
+#: peicode.h:758
msgid "%B: Unhandled import type; %x"
msgstr "%B: Käsittelemätön tuontityyppi; %x"
-#: peicode.h:756
+#: peicode.h:763
msgid "%B: Unrecognised import type; %x"
msgstr "%B: Tunnistamaton tuontityyppi; %x"
-#: peicode.h:770
+#: peicode.h:777
msgid "%B: Unrecognised import name type; %x"
msgstr "%B: Tunnistamaton tuontinimityyppi; %x"
-#: peicode.h:1166
+#: peicode.h:1173
msgid "%B: Unrecognised machine type (0x%x) in Import Library Format archive"
msgstr "%B: Tunnistamaton konetyyppi (0x%x) â€Import Library Formatâ€-arkistossa"
-#: peicode.h:1178
+#: peicode.h:1185
msgid "%B: Recognised but unhandled machine type (0x%x) in Import Library Format archive"
msgstr "%B: Tunnistettu, mutta käsittelemätön konetyyppi (0x%x) â€Import Library Formatâ€-arkistossa"
-#: peicode.h:1196
+#: peicode.h:1203
msgid "%B: size field is zero in Import Library Format header"
msgstr "%B: kokokenttä on nolla â€Import Library Formatâ€-otsakkeessa"
-#: peicode.h:1227
+#: peicode.h:1234
msgid "%B: string not null terminated in ILF object file."
msgstr "%B: merkkijonoa ei ole päätetty nollaan ILF-objektitiedostossa."
-#: ppcboot.c:414
+#: ppcboot.c:391
#, c-format
msgid ""
"\n"
@@ -3770,27 +4143,27 @@ msgstr ""
"\n"
"ppcboot-otsake:\n"
-#: ppcboot.c:415
+#: ppcboot.c:392
#, c-format
msgid "Entry offset = 0x%.8lx (%ld)\n"
msgstr "Tulokohtasiirrososoite = 0x%.8lx (%ld)\n"
-#: ppcboot.c:417
+#: ppcboot.c:394
#, c-format
msgid "Length = 0x%.8lx (%ld)\n"
msgstr "Pituus = 0x%.8lx (%ld)\n"
-#: ppcboot.c:421
+#: ppcboot.c:398
#, c-format
msgid "Flag field = 0x%.2x\n"
msgstr "Lippukenttä = 0x%.2x\n"
-#: ppcboot.c:427
+#: ppcboot.c:404
#, c-format
msgid "Partition name = \"%s\"\n"
msgstr "Osionimi = â€%sâ€\n"
-#: ppcboot.c:446
+#: ppcboot.c:423
#, c-format
msgid ""
"\n"
@@ -3799,25 +4172,29 @@ msgstr ""
"\n"
"Osio[%d] alku = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
-#: ppcboot.c:452
+#: ppcboot.c:429
#, c-format
msgid "Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
msgstr "Osio[%d] loppu = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
-#: ppcboot.c:458
+#: ppcboot.c:435
#, c-format
msgid "Partition[%d] sector = 0x%.8lx (%ld)\n"
msgstr "Osio[%d] sektori = 0x%.8lx (%ld)\n"
-#: ppcboot.c:460
+#: ppcboot.c:437
#, c-format
msgid "Partition[%d] length = 0x%.8lx (%ld)\n"
msgstr "Osio[%d] pituus = 0x%.8lx (%ld)\n"
-#: reloc.c:6160
+#: reloc.c:7371
msgid "INPUT_SECTION_FLAGS are not supported.\n"
msgstr "INPUT_SECTION_FLAGS ei ole tuettu.\n"
+#: reloc.c:7526
+msgid "%X%P: %B(%A): relocation \"%R\" goes out of range\n"
+msgstr "%X%P: %B(%A): sijoitus â€%R†menee lukualueen ulkopuolelle\n"
+
#: rs6000-core.c:448
#, c-format
msgid "%s: warning core file truncated"
@@ -3852,32 +4229,32 @@ msgstr "%B(%A+0x%lx): Stabs-tulokohdassa on virheellinen merkkijonoindeksi."
msgid "Unsupported .stab relocation"
msgstr "â€Ei-tuettu .stabâ€-sijoitus"
-#: vms-alpha.c:1299
+#: vms-alpha.c:1294
#, c-format
msgid "Unknown EGSD subtype %d"
msgstr "Tuntematon EGSD-alityyppi %d"
-#: vms-alpha.c:1330
+#: vms-alpha.c:1325
#, c-format
msgid "Stack overflow (%d) in _bfd_vms_push"
msgstr "Pinon ylivuoto (%d) kohteessa _bfd_vms_push"
-#: vms-alpha.c:1343
+#: vms-alpha.c:1338
msgid "Stack underflow in _bfd_vms_pop"
msgstr "Pinon ylivuoto kohteessa _bfd_vms_pop"
#. These names have not yet been added to this switch statement.
-#: vms-alpha.c:1580
+#: vms-alpha.c:1575
#, c-format
msgid "unknown ETIR command %d"
msgstr "tuntematon ETIR-komento %d"
-#: vms-alpha.c:1767
+#: vms-alpha.c:1762
#, c-format
msgid "bad section index in %s"
msgstr "virheellinen lohkoindeksi kohteessa %s"
-#: vms-alpha.c:1780
+#: vms-alpha.c:1775
#, c-format
msgid "unsupported STA cmd %s"
msgstr "ei-tuettu STA-komento %s"
@@ -3887,1394 +4264,1389 @@ msgstr "ei-tuettu STA-komento %s"
#. Rotate.
#. Redefine symbol to current location.
#. Define a literal.
-#: vms-alpha.c:1956 vms-alpha.c:1987 vms-alpha.c:2234
+#: vms-alpha.c:1951 vms-alpha.c:1982 vms-alpha.c:2229
#, c-format
msgid "%s: not supported"
msgstr "%s: ei tuettu"
-#: vms-alpha.c:1962
+#: vms-alpha.c:1957
#, c-format
msgid "%s: not implemented"
msgstr "%s: ei toteutettu"
-#: vms-alpha.c:2218
+#: vms-alpha.c:2213
#, c-format
msgid "invalid use of %s with contexts"
msgstr "virheellinen %s-käyttö sisällöillä"
-#: vms-alpha.c:2252
+#: vms-alpha.c:2247
#, c-format
msgid "reserved cmd %d"
msgstr "varattu komento %d"
-#: vms-alpha.c:2337
+#: vms-alpha.c:2332
msgid "Object module NOT error-free !\n"
msgstr "Objektimoduli EI ole virheetön !\n"
-#: vms-alpha.c:2766
-#, c-format
-msgid "Symbol %s replaced by %s\n"
-msgstr "Symboli %s korvattu kohteella %s\n"
-
-#: vms-alpha.c:3769
+#: vms-alpha.c:3657
#, c-format
msgid "SEC_RELOC with no relocs in section %s"
msgstr "SEC_RELOC ilman relocs-tietueita lohkossa %s"
-#: vms-alpha.c:3822 vms-alpha.c:4049
+#: vms-alpha.c:3709 vms-alpha.c:3922
#, c-format
msgid "Size error in section %s"
msgstr "Kokovirhe lohkossa %s"
-#: vms-alpha.c:3991
+#: vms-alpha.c:3868
msgid "Spurious ALPHA_R_BSR reloc"
msgstr "Väärä ALPHA_R_BSR reloc-tietue"
-#: vms-alpha.c:4036
+#: vms-alpha.c:3909
#, c-format
msgid "Unhandled relocation %s"
msgstr "Käsittelemätön sijoitus %s"
-#: vms-alpha.c:4326
+#: vms-alpha.c:4199
#, c-format
msgid "unknown source command %d"
msgstr "tuntematon lähdekomento %d"
-#: vms-alpha.c:4387
+#: vms-alpha.c:4260
msgid "DST__K_SET_LINUM_INCR not implemented"
msgstr "DST__K_SET_LINUM_INCR ei ole toteutettu"
-#: vms-alpha.c:4393
+#: vms-alpha.c:4266
msgid "DST__K_SET_LINUM_INCR_W not implemented"
msgstr "DST__K_SET_LINUM_INCR_W ei ole toteutettu"
-#: vms-alpha.c:4399
+#: vms-alpha.c:4272
msgid "DST__K_RESET_LINUM_INCR not implemented"
msgstr "DST__K_RESET_LINUM_INCR ei ole toteutettu"
-#: vms-alpha.c:4405
+#: vms-alpha.c:4278
msgid "DST__K_BEG_STMT_MODE not implemented"
msgstr "DST__K_BEG_STMT_MODE ei ole toteutettu"
-#: vms-alpha.c:4411
+#: vms-alpha.c:4284
msgid "DST__K_END_STMT_MODE not implemented"
msgstr "DST__K_END_STMT_MODE ei ole toteutettu"
-#: vms-alpha.c:4438
+#: vms-alpha.c:4311
msgid "DST__K_SET_PC not implemented"
msgstr "DST__K_SET_PC ei ole toteutettu"
-#: vms-alpha.c:4444
+#: vms-alpha.c:4317
msgid "DST__K_SET_PC_W not implemented"
msgstr "DST__K_SET_PC_W ei ole toteutettu"
-#: vms-alpha.c:4450
+#: vms-alpha.c:4323
msgid "DST__K_SET_PC_L not implemented"
msgstr "DST__K_SET_PC_L ei ole toteutettu"
-#: vms-alpha.c:4456
+#: vms-alpha.c:4329
msgid "DST__K_SET_STMTNUM not implemented"
msgstr "DST__K_SET_STMTNUM ei ole toteutettu"
-#: vms-alpha.c:4499
+#: vms-alpha.c:4372
#, c-format
msgid "unknown line command %d"
msgstr "tuntematon rivikomento %d"
-#: vms-alpha.c:4953 vms-alpha.c:4970 vms-alpha.c:4984 vms-alpha.c:4999
-#: vms-alpha.c:5011 vms-alpha.c:5022 vms-alpha.c:5034
+#: vms-alpha.c:4846 vms-alpha.c:4863 vms-alpha.c:4877 vms-alpha.c:4892
+#: vms-alpha.c:4904 vms-alpha.c:4915 vms-alpha.c:4927
#, c-format
msgid "Unknown reloc %s + %s"
msgstr "Tuntematon reloc-tietue %s + %s"
-#: vms-alpha.c:5089
+#: vms-alpha.c:4982
#, c-format
msgid "Unknown reloc %s"
msgstr "Tuntematon reloc-tietue %s"
-#: vms-alpha.c:5102
+#: vms-alpha.c:4995
msgid "Invalid section index in ETIR"
msgstr "virheellinen lohkoindeksi kohteessa ETIR"
-#: vms-alpha.c:5109
+#: vms-alpha.c:5002
msgid "Relocation for non-REL psect"
msgstr "Sijoitus kohteelle non-REL psect"
-#: vms-alpha.c:5156
+#: vms-alpha.c:5049
#, c-format
msgid "Unknown symbol in command %s"
msgstr "Tuntematon symboli komennossa %s"
-#: vms-alpha.c:5671
+#: vms-alpha.c:5564
#, c-format
msgid " EMH %u (len=%u): "
msgstr " EMH %u (pituus=%u): "
-#: vms-alpha.c:5680
+#: vms-alpha.c:5573
#, c-format
msgid "Module header\n"
msgstr "Moduliotsake\n"
-#: vms-alpha.c:5681
+#: vms-alpha.c:5574
#, c-format
msgid " structure level: %u\n"
msgstr " tietuetaso: %u\n"
-#: vms-alpha.c:5682
+#: vms-alpha.c:5575
#, c-format
msgid " max record size: %u\n"
msgstr " tietueen enimmäiskoko: %u\n"
-#: vms-alpha.c:5685
+#: vms-alpha.c:5578
#, c-format
msgid " module name : %.*s\n"
msgstr " modulinimi : %.*s\n"
-#: vms-alpha.c:5687
+#: vms-alpha.c:5580
#, c-format
msgid " module version : %.*s\n"
msgstr " moduliversio : %.*s\n"
-#: vms-alpha.c:5689
+#: vms-alpha.c:5582
#, c-format
msgid " compile date : %.17s\n"
msgstr " käännöspäivämäärä : %.17s\n"
-#: vms-alpha.c:5694
+#: vms-alpha.c:5587
#, c-format
msgid "Language Processor Name\n"
msgstr "Kielisuorittimen nimi\n"
-#: vms-alpha.c:5695
+#: vms-alpha.c:5588
#, c-format
msgid " language name: %.*s\n"
msgstr " kielinimi: %.*s\n"
-#: vms-alpha.c:5702
+#: vms-alpha.c:5595
#, c-format
msgid "Source Files Header\n"
msgstr "Lähdetiedostot-otsake\n"
-#: vms-alpha.c:5703
+#: vms-alpha.c:5596
#, c-format
msgid " file: %.*s\n"
msgstr " tiedosto: %.*s\n"
-#: vms-alpha.c:5710
+#: vms-alpha.c:5603
#, c-format
msgid "Title Text Header\n"
msgstr "Otsikkotekstiotsake\n"
-#: vms-alpha.c:5711
+#: vms-alpha.c:5604
#, c-format
msgid " title: %.*s\n"
msgstr " otsikko: %.*s\n"
-#: vms-alpha.c:5718
+#: vms-alpha.c:5611
#, c-format
msgid "Copyright Header\n"
msgstr "Copyright-otsake\n"
-#: vms-alpha.c:5719
+#: vms-alpha.c:5612
#, c-format
msgid " copyright: %.*s\n"
msgstr " copyright: %.*s\n"
-#: vms-alpha.c:5725
+#: vms-alpha.c:5618
#, c-format
msgid "unhandled emh subtype %u\n"
msgstr "käsittelemätön emh-alityyppi %u\n"
-#: vms-alpha.c:5735
+#: vms-alpha.c:5628
#, c-format
msgid " EEOM (len=%u):\n"
msgstr " EEOM (pituus=%u):\n"
-#: vms-alpha.c:5736
+#: vms-alpha.c:5629
#, c-format
msgid " number of cond linkage pairs: %u\n"
msgstr " ehdollisten linkitysparien lukumäärä: %u\n"
-#: vms-alpha.c:5738
+#: vms-alpha.c:5631
#, c-format
msgid " completion code: %u\n"
msgstr " täydentämiskoodi: %u\n"
-#: vms-alpha.c:5742
+#: vms-alpha.c:5635
#, c-format
msgid " transfer addr flags: 0x%02x\n"
msgstr " siirto-osoiteliput: 0x%02x\n"
-#: vms-alpha.c:5743
+#: vms-alpha.c:5636
#, c-format
msgid " transfer addr psect: %u\n"
msgstr " siirrososoite psect: %u\n"
-#: vms-alpha.c:5745
+#: vms-alpha.c:5638
#, c-format
msgid " transfer address : 0x%08x\n"
msgstr " siirto-osoite : 0x%08x\n"
# Käännettäväksi on merkitty monia (vianjäljitys)symboleja ja vastaavia, joita ei oikeastaan pitäisi suomentaa. Joissakin kohdissa vain selväkieliset sanat on suomennettu.
-#: vms-alpha.c:5754
+#: vms-alpha.c:5647
msgid " WEAK"
msgstr " WEAK"
-#: vms-alpha.c:5756
+#: vms-alpha.c:5649
msgid " DEF"
msgstr " DEF"
-#: vms-alpha.c:5758
+#: vms-alpha.c:5651
msgid " UNI"
msgstr " UNI"
-#: vms-alpha.c:5760 vms-alpha.c:5781
+#: vms-alpha.c:5653 vms-alpha.c:5674
msgid " REL"
msgstr " REL"
-#: vms-alpha.c:5762
+#: vms-alpha.c:5655
msgid " COMM"
msgstr " COMM"
-#: vms-alpha.c:5764
+#: vms-alpha.c:5657
msgid " VECEP"
msgstr " VECEP"
-#: vms-alpha.c:5766
+#: vms-alpha.c:5659
msgid " NORM"
msgstr " NORM"
-#: vms-alpha.c:5768
+#: vms-alpha.c:5661
msgid " QVAL"
msgstr " QVAL"
-#: vms-alpha.c:5775
+#: vms-alpha.c:5668
msgid " PIC"
msgstr " PIC"
-#: vms-alpha.c:5777
+#: vms-alpha.c:5670
msgid " LIB"
msgstr " LIB"
-#: vms-alpha.c:5779
+#: vms-alpha.c:5672
msgid " OVR"
msgstr " OVR"
-#: vms-alpha.c:5783
+#: vms-alpha.c:5676
msgid " GBL"
msgstr " GBL"
-#: vms-alpha.c:5785
+#: vms-alpha.c:5678
msgid " SHR"
msgstr " SHR"
-#: vms-alpha.c:5787
+#: vms-alpha.c:5680
msgid " EXE"
msgstr " EXE"
-#: vms-alpha.c:5789
+#: vms-alpha.c:5682
msgid " RD"
msgstr " RD"
-#: vms-alpha.c:5791
+#: vms-alpha.c:5684
msgid " WRT"
msgstr " WRT"
-#: vms-alpha.c:5793
+#: vms-alpha.c:5686
msgid " VEC"
msgstr " VEC"
-#: vms-alpha.c:5795
+#: vms-alpha.c:5688
msgid " NOMOD"
msgstr " NOMOD"
-#: vms-alpha.c:5797
+#: vms-alpha.c:5690
msgid " COM"
msgstr " COM"
-#: vms-alpha.c:5799
+#: vms-alpha.c:5692
msgid " 64B"
msgstr " 64B"
-#: vms-alpha.c:5808
+#: vms-alpha.c:5701
#, c-format
msgid " EGSD (len=%u):\n"
msgstr " EGSD (pituus=%u):\n"
-#: vms-alpha.c:5820
+#: vms-alpha.c:5713
#, c-format
msgid " EGSD entry %2u (type: %u, len: %u): "
msgstr " EGSD tulopiste %2u (tyyppi: %u, pituus: %u): "
-#: vms-alpha.c:5832
+#: vms-alpha.c:5725
#, c-format
msgid "PSC - Program section definition\n"
msgstr "PSC - Ohjelmalohkomäärittely\n"
-#: vms-alpha.c:5833 vms-alpha.c:5850
+#: vms-alpha.c:5726 vms-alpha.c:5743
#, c-format
msgid " alignment : 2**%u\n"
msgstr " tasaus : 2**%u\n"
-#: vms-alpha.c:5834 vms-alpha.c:5851
+#: vms-alpha.c:5727 vms-alpha.c:5744
#, c-format
msgid " flags : 0x%04x"
msgstr " liput : 0x%04x"
-#: vms-alpha.c:5838
+#: vms-alpha.c:5731
#, c-format
msgid " alloc (len): %u (0x%08x)\n"
msgstr " alloc (pituus): %u (0x%08x)\n"
-#: vms-alpha.c:5839 vms-alpha.c:5896 vms-alpha.c:5945
+#: vms-alpha.c:5732 vms-alpha.c:5789 vms-alpha.c:5838
#, c-format
msgid " name : %.*s\n"
msgstr " nimi : %.*s\n"
-#: vms-alpha.c:5849
+#: vms-alpha.c:5742
#, c-format
msgid "SPSC - Shared Image Program section def\n"
msgstr "SPSC - Jaettu vedosohjelmalohkomäärittely\n"
-#: vms-alpha.c:5855
+#: vms-alpha.c:5748
#, c-format
msgid " alloc (len) : %u (0x%08x)\n"
msgstr " alloc (pitus) : %u (0x%08x)\n"
-#: vms-alpha.c:5856
+#: vms-alpha.c:5749
#, c-format
msgid " image offset : 0x%08x\n"
msgstr " vedossiirros : 0x%08x\n"
-#: vms-alpha.c:5858
+#: vms-alpha.c:5751
#, c-format
msgid " symvec offset : 0x%08x\n"
msgstr " symvec-siirros : 0x%08x\n"
-#: vms-alpha.c:5860
+#: vms-alpha.c:5753
#, c-format
msgid " name : %.*s\n"
msgstr " nimi : %.*s\n"
-#: vms-alpha.c:5873
+#: vms-alpha.c:5766
#, c-format
msgid "SYM - Global symbol definition\n"
msgstr "SYM - Yleinen symbolimäärittely\n"
-#: vms-alpha.c:5874 vms-alpha.c:5934 vms-alpha.c:5955 vms-alpha.c:5974
+#: vms-alpha.c:5767 vms-alpha.c:5827 vms-alpha.c:5848 vms-alpha.c:5867
#, c-format
msgid " flags: 0x%04x"
msgstr " liput: 0x%04x"
-#: vms-alpha.c:5877
+#: vms-alpha.c:5770
#, c-format
msgid " psect offset: 0x%08x\n"
msgstr " psect-siirros: 0x%08x\n"
-#: vms-alpha.c:5881
+#: vms-alpha.c:5774
#, c-format
msgid " code address: 0x%08x\n"
msgstr " koodiosoite: 0x%08x\n"
-#: vms-alpha.c:5883
+#: vms-alpha.c:5776
#, c-format
msgid " psect index for entry point : %u\n"
msgstr " psect-indeksi tulokohdalle : %u\n"
-#: vms-alpha.c:5886 vms-alpha.c:5962 vms-alpha.c:5981
+#: vms-alpha.c:5779 vms-alpha.c:5855 vms-alpha.c:5874
#, c-format
msgid " psect index : %u\n"
msgstr " psect-indeksi : %u\n"
-#: vms-alpha.c:5888 vms-alpha.c:5964 vms-alpha.c:5983
+#: vms-alpha.c:5781 vms-alpha.c:5857 vms-alpha.c:5876
#, c-format
msgid " name : %.*s\n"
msgstr " nimi : %.*s\n"
-#: vms-alpha.c:5895
+#: vms-alpha.c:5788
#, c-format
msgid "SYM - Global symbol reference\n"
msgstr "SYM - Yleinen symboliviite\n"
-#: vms-alpha.c:5907
+#: vms-alpha.c:5800
#, c-format
msgid "IDC - Ident Consistency check\n"
msgstr "IDC - Ident-johdonmukaisuustarkistus\n"
-#: vms-alpha.c:5908
+#: vms-alpha.c:5801
#, c-format
msgid " flags : 0x%08x"
msgstr " liput : 0x%08x"
-#: vms-alpha.c:5912
+#: vms-alpha.c:5805
#, c-format
msgid " id match : %x\n"
msgstr " tunnistetäsmäys: %x\n"
-#: vms-alpha.c:5914
+#: vms-alpha.c:5807
#, c-format
msgid " error severity: %x\n"
msgstr " virhevakavuus : %x\n"
-#: vms-alpha.c:5917
+#: vms-alpha.c:5810
#, c-format
msgid " entity name : %.*s\n"
msgstr " yksilönimi : %.*s\n"
-#: vms-alpha.c:5919
+#: vms-alpha.c:5812
#, c-format
msgid " object name : %.*s\n"
msgstr " objektinimi : %.*s\n"
-#: vms-alpha.c:5922
+#: vms-alpha.c:5815
#, c-format
msgid " binary ident : 0x%08x\n"
msgstr " binaari-ident : 0x%08x\n"
-#: vms-alpha.c:5925
+#: vms-alpha.c:5818
#, c-format
msgid " ascii ident : %.*s\n"
msgstr " ascii-ident : %.*s\n"
-#: vms-alpha.c:5933
+#: vms-alpha.c:5826
#, c-format
msgid "SYMG - Universal symbol definition\n"
msgstr "SYMG - Yleinen symbolimäärittely\n"
-#: vms-alpha.c:5937
+#: vms-alpha.c:5830
#, c-format
msgid " symbol vector offset: 0x%08x\n"
msgstr " symbolivektorisiirros: 0x%08x\n"
-#: vms-alpha.c:5939
+#: vms-alpha.c:5832
#, c-format
msgid " entry point: 0x%08x\n"
msgstr " tulokohta: 0x%08x\n"
-#: vms-alpha.c:5941
+#: vms-alpha.c:5834
#, c-format
msgid " proc descr : 0x%08x\n"
msgstr " ohjelmakuvaus : 0x%08x\n"
-#: vms-alpha.c:5943
+#: vms-alpha.c:5836
#, c-format
msgid " psect index: %u\n"
msgstr " psect-indeksi : %u\n"
-#: vms-alpha.c:5954
+#: vms-alpha.c:5847
#, c-format
msgid "SYMV - Vectored symbol definition\n"
msgstr "SYMV - Vektoroitu symbolimäärittely\n"
-#: vms-alpha.c:5958
+#: vms-alpha.c:5851
#, c-format
msgid " vector : 0x%08x\n"
msgstr " vektori : 0x%08x\n"
-#: vms-alpha.c:5960 vms-alpha.c:5979
+#: vms-alpha.c:5853 vms-alpha.c:5872
#, c-format
msgid " psect offset: %u\n"
msgstr " psect-siirros: %u\n"
-#: vms-alpha.c:5973
+#: vms-alpha.c:5866
#, c-format
msgid "SYMM - Global symbol definition with version\n"
msgstr "SYMM - Yleinen symbolimäärittely versiolla\n"
-#: vms-alpha.c:5977
+#: vms-alpha.c:5870
#, c-format
msgid " version mask: 0x%08x\n"
msgstr " versiopeite : 0x%08x\n"
-#: vms-alpha.c:5988
+#: vms-alpha.c:5881
#, c-format
msgid "unhandled egsd entry type %u\n"
msgstr "käsittelemätön egsd-tulokohtatyyppi %u\n"
-#: vms-alpha.c:6022
+#: vms-alpha.c:5915
#, c-format
msgid " linkage index: %u, replacement insn: 0x%08x\n"
msgstr " linkitysindeksi: %u, korvauskäsky: 0x%08x\n"
-#: vms-alpha.c:6025
+#: vms-alpha.c:5918
#, c-format
msgid " psect idx 1: %u, offset 1: 0x%08x %08x\n"
msgstr " psect idx 1: %u, siirros 1: 0x%08x %08x\n"
-#: vms-alpha.c:6029
+#: vms-alpha.c:5922
#, c-format
msgid " psect idx 2: %u, offset 2: 0x%08x %08x\n"
msgstr " psect idx 2: %u, siirros 2: 0x%08x %08x\n"
-#: vms-alpha.c:6034
+#: vms-alpha.c:5927
#, c-format
msgid " psect idx 3: %u, offset 3: 0x%08x %08x\n"
msgstr " psect idx 3: %u, siirros 3: 0x%08x %08x\n"
-#: vms-alpha.c:6039
+#: vms-alpha.c:5932
#, c-format
msgid " global name: %.*s\n"
msgstr " yleisnimi: %.*s\n"
-#: vms-alpha.c:6049
+#: vms-alpha.c:5942
#, c-format
msgid " %s (len=%u+%u):\n"
msgstr " %s (pituus=%u+%u):\n"
-#: vms-alpha.c:6064
+#: vms-alpha.c:5957
#, c-format
msgid " (type: %3u, size: 4+%3u): "
msgstr " (tyyppi: %3u, koko: 4+%3u): "
-#: vms-alpha.c:6068
+#: vms-alpha.c:5961
#, c-format
msgid "STA_GBL (stack global) %.*s\n"
msgstr "STA_GBL (pino yleinen) %.*s\n"
-#: vms-alpha.c:6072
+#: vms-alpha.c:5965
#, c-format
msgid "STA_LW (stack longword) 0x%08x\n"
msgstr "STA_LW (pino longword) 0x%08x\n"
-#: vms-alpha.c:6076
+#: vms-alpha.c:5969
#, c-format
msgid "STA_QW (stack quadword) 0x%08x %08x\n"
msgstr "STA_QW (pino quadword) 0x%08x %08x\n"
-#: vms-alpha.c:6081
+#: vms-alpha.c:5974
#, c-format
msgid "STA_PQ (stack psect base + offset)\n"
msgstr "STA_PQ (pino psect-kanta + siirros)\n"
-#: vms-alpha.c:6082
+#: vms-alpha.c:5975
#, c-format
msgid " psect: %u, offset: 0x%08x %08x\n"
msgstr " psect: %u, siirros: 0x%08x %08x\n"
-#: vms-alpha.c:6088
+#: vms-alpha.c:5981
#, c-format
msgid "STA_LI (stack literal)\n"
msgstr "STA_LI (pinoliteraali)\n"
-#: vms-alpha.c:6091
+#: vms-alpha.c:5984
#, c-format
msgid "STA_MOD (stack module)\n"
msgstr "STA_MOD (pinomoduli)\n"
-#: vms-alpha.c:6094
+#: vms-alpha.c:5987
#, c-format
msgid "STA_CKARG (compare procedure argument)\n"
msgstr "STA_CKARG (vertaa proseduuriargumenttia)\n"
-#: vms-alpha.c:6098
+#: vms-alpha.c:5991
#, c-format
msgid "STO_B (store byte)\n"
msgstr "STO_B (tallenna byte)\n"
-#: vms-alpha.c:6101
+#: vms-alpha.c:5994
#, c-format
msgid "STO_W (store word)\n"
msgstr "STO_W (tallenna word)\n"
-#: vms-alpha.c:6104
+#: vms-alpha.c:5997
#, c-format
msgid "STO_LW (store longword)\n"
msgstr "STO_LW (tallenna longword)\n"
-#: vms-alpha.c:6107
+#: vms-alpha.c:6000
#, c-format
msgid "STO_QW (store quadword)\n"
msgstr "STO_QW (tallenna quadword)\n"
-#: vms-alpha.c:6113
+#: vms-alpha.c:6006
#, c-format
msgid "STO_IMMR (store immediate repeat) %u bytes\n"
msgstr "STO_IMMR (tallenna välitön toisto) %u tavua\n"
-#: vms-alpha.c:6120
+#: vms-alpha.c:6013
#, c-format
msgid "STO_GBL (store global) %.*s\n"
msgstr "STO_GBL (tallenna yleinen) %.*s\n"
-#: vms-alpha.c:6124
+#: vms-alpha.c:6017
#, c-format
msgid "STO_CA (store code address) %.*s\n"
msgstr "STO_CA (tallenna koodiosoite) %.*s\n"
-#: vms-alpha.c:6128
+#: vms-alpha.c:6021
#, c-format
msgid "STO_RB (store relative branch)\n"
msgstr "STO_RB (tallenna suhteellinen haarautuminen)\n"
-#: vms-alpha.c:6131
+#: vms-alpha.c:6024
#, c-format
msgid "STO_AB (store absolute branch)\n"
msgstr "STO_AB (tallenna absoluuttinen haarautuminen)\n"
-#: vms-alpha.c:6134
+#: vms-alpha.c:6027
#, c-format
msgid "STO_OFF (store offset to psect)\n"
msgstr "STO_OFF (tallenna siirros kohteeseen psect)\n"
-#: vms-alpha.c:6140
+#: vms-alpha.c:6033
#, c-format
msgid "STO_IMM (store immediate) %u bytes\n"
msgstr "STO_IMM (tallenna välitön) %u tavua\n"
-#: vms-alpha.c:6147
+#: vms-alpha.c:6040
#, c-format
msgid "STO_GBL_LW (store global longword) %.*s\n"
msgstr "STO_GBL_LW (tallenna yleinen longword) %.*s\n"
-#: vms-alpha.c:6151
+#: vms-alpha.c:6044
#, c-format
msgid "STO_OFF (store LP with procedure signature)\n"
msgstr "STO_OFF (tallenna LP-proseduurituntomerkillä)\n"
-#: vms-alpha.c:6154
+#: vms-alpha.c:6047
#, c-format
msgid "STO_BR_GBL (store branch global) *todo*\n"
msgstr "STO_BR_GBL (tallenna haarautuminen yleinen) *todo*\n"
-#: vms-alpha.c:6157
+#: vms-alpha.c:6050
#, c-format
msgid "STO_BR_PS (store branch psect + offset) *todo*\n"
msgstr "STO_BR_PS (tallenna haarautuminen psect + siirros) *todo*\n"
-#: vms-alpha.c:6161
+#: vms-alpha.c:6054
#, c-format
msgid "OPR_NOP (no-operation)\n"
msgstr "OPR_NOP (ei-toimintoa)\n"
-#: vms-alpha.c:6164
+#: vms-alpha.c:6057
#, c-format
msgid "OPR_ADD (add)\n"
msgstr "OPR_ADD (lisää)\n"
-#: vms-alpha.c:6167
+#: vms-alpha.c:6060
#, c-format
msgid "OPR_SUB (substract)\n"
msgstr "OPR_SUB (vähennä)\n"
-#: vms-alpha.c:6170
+#: vms-alpha.c:6063
#, c-format
msgid "OPR_MUL (multiply)\n"
msgstr "OPR_MUL (kerro)\n"
-#: vms-alpha.c:6173
+#: vms-alpha.c:6066
#, c-format
msgid "OPR_DIV (divide)\n"
msgstr "OPR_DIV (jaa)\n"
-#: vms-alpha.c:6176
+#: vms-alpha.c:6069
#, c-format
msgid "OPR_AND (logical and)\n"
msgstr "OPR_AND (looginen ja)\n"
-#: vms-alpha.c:6179
+#: vms-alpha.c:6072
#, c-format
msgid "OPR_IOR (logical inclusive or)\n"
msgstr "OPR_IOR (looginen kattava tai)\n"
-#: vms-alpha.c:6182
+#: vms-alpha.c:6075
#, c-format
msgid "OPR_EOR (logical exclusive or)\n"
msgstr "OPR_EOR (loogisesti poissulkeva tai)\n"
-#: vms-alpha.c:6185
+#: vms-alpha.c:6078
#, c-format
msgid "OPR_NEG (negate)\n"
msgstr "OPR_NEG (kieltävä)\n"
-#: vms-alpha.c:6188
+#: vms-alpha.c:6081
#, c-format
msgid "OPR_COM (complement)\n"
msgstr "OPR_COM (komplementti)\n"
-#: vms-alpha.c:6191
+#: vms-alpha.c:6084
#, c-format
msgid "OPR_INSV (insert field)\n"
msgstr "OPR_INSV (lisää kenttä)\n"
-#: vms-alpha.c:6194
+#: vms-alpha.c:6087
#, c-format
msgid "OPR_ASH (arithmetic shift)\n"
msgstr "OPR_ASH (aritmeettinen sivuttaissiirto)\n"
-#: vms-alpha.c:6197
+#: vms-alpha.c:6090
#, c-format
msgid "OPR_USH (unsigned shift)\n"
msgstr "OPR_USH (etumerkitön sivuttaissiirto)\n"
-#: vms-alpha.c:6200
+#: vms-alpha.c:6093
#, c-format
msgid "OPR_ROT (rotate)\n"
msgstr "OPR_ROT (pyöritä)\n"
-#: vms-alpha.c:6203
+#: vms-alpha.c:6096
#, c-format
msgid "OPR_SEL (select)\n"
msgstr "OPR_SEL (valitse)\n"
-#: vms-alpha.c:6206
+#: vms-alpha.c:6099
#, c-format
msgid "OPR_REDEF (redefine symbol to curr location)\n"
msgstr "OPR_REDEF (määritä symboli uudelleen nykyiseen paikkaan)\n"
-#: vms-alpha.c:6209
+#: vms-alpha.c:6102
#, c-format
msgid "OPR_REDEF (define a literal)\n"
msgstr "OPR_REDEF (määritä literaali)\n"
-#: vms-alpha.c:6213
+#: vms-alpha.c:6106
#, c-format
msgid "STC_LP (store cond linkage pair)\n"
msgstr "STC_LP (tallenna ehdollinen linkityspari)\n"
-#: vms-alpha.c:6217
+#: vms-alpha.c:6110
#, c-format
msgid "STC_LP_PSB (store cond linkage pair + signature)\n"
msgstr "STC_LP_PSB (tallenna ehdollinen linkityspari + tuntomerkki)\n"
-#: vms-alpha.c:6218
+#: vms-alpha.c:6111
#, c-format
msgid " linkage index: %u, procedure: %.*s\n"
msgstr " linkitysindeksi: %u, proseduuri: %.*s\n"
-#: vms-alpha.c:6221
+#: vms-alpha.c:6114
#, c-format
msgid " signature: %.*s\n"
msgstr " tuntomerkki: %.*s\n"
-#: vms-alpha.c:6224
+#: vms-alpha.c:6117
#, c-format
msgid "STC_GBL (store cond global)\n"
msgstr "STC_GBL (tallenna ehdollinen yleinen)\n"
-#: vms-alpha.c:6225
+#: vms-alpha.c:6118
#, c-format
msgid " linkage index: %u, global: %.*s\n"
msgstr " linkitysindeksi: %u, yleinen: %.*s\n"
-#: vms-alpha.c:6229
+#: vms-alpha.c:6122
#, c-format
msgid "STC_GCA (store cond code address)\n"
msgstr "STC_GCA (tallenna ehdollinen koodiosoite)\n"
-#: vms-alpha.c:6230
+#: vms-alpha.c:6123
#, c-format
msgid " linkage index: %u, procedure name: %.*s\n"
msgstr " linkitysindeksi: %u, proseduurinimi: %.*s\n"
-#: vms-alpha.c:6234
+#: vms-alpha.c:6127
#, c-format
msgid "STC_PS (store cond psect + offset)\n"
msgstr "STC_PS (tallenna ehdollinen psect + siirros)\n"
-#: vms-alpha.c:6236
+#: vms-alpha.c:6129
#, c-format
msgid " linkage index: %u, psect: %u, offset: 0x%08x %08x\n"
msgstr " linkitysindeksi: %u, psect: %u, siirros: 0x%08x %08x\n"
-#: vms-alpha.c:6243
+#: vms-alpha.c:6136
#, c-format
msgid "STC_NOP_GBL (store cond NOP at global addr)\n"
msgstr "STC_NOP_GBL (tallenna ehdollinen NOP yleisosoitteessa)\n"
-#: vms-alpha.c:6247
+#: vms-alpha.c:6140
#, c-format
msgid "STC_NOP_PS (store cond NOP at psect + offset)\n"
msgstr "STC_NOP_PS (tallenna ehdollinen NOP kohteessa psect + siirros)\n"
-#: vms-alpha.c:6251
+#: vms-alpha.c:6144
#, c-format
msgid "STC_BSR_GBL (store cond BSR at global addr)\n"
msgstr "STC_BSR_GBL (tallenna ehdollinen BSR yleisosoitteessa)\n"
-#: vms-alpha.c:6255
+#: vms-alpha.c:6148
#, c-format
msgid "STC_BSR_PS (store cond BSR at psect + offset)\n"
msgstr "STC_BSR_PS (tallenna ehdollinen BSR kohteessa psect + siirros)\n"
-#: vms-alpha.c:6259
+#: vms-alpha.c:6152
#, c-format
msgid "STC_LDA_GBL (store cond LDA at global addr)\n"
msgstr "STC_LDA_GBL (tallenna ehdollinen LDA yleisosoitteessa)\n"
-#: vms-alpha.c:6263
+#: vms-alpha.c:6156
#, c-format
msgid "STC_LDA_PS (store cond LDA at psect + offset)\n"
msgstr "STC_LDA_PS (tallenna ehdollinen LDA kohteessa psect + siirros)\n"
-#: vms-alpha.c:6267
+#: vms-alpha.c:6160
#, c-format
msgid "STC_BOH_GBL (store cond BOH at global addr)\n"
msgstr "STC_BOH_GBL (tallenna ehdollinen BOH yleisosoitteessa)\n"
-#: vms-alpha.c:6271
+#: vms-alpha.c:6164
#, c-format
msgid "STC_BOH_PS (store cond BOH at psect + offset)\n"
msgstr "STC_BOH_PS (tallenna ehdollinen BOH kohteessa psect + siirros)\n"
-#: vms-alpha.c:6276
+#: vms-alpha.c:6169
#, c-format
msgid "STC_NBH_GBL (store cond or hint at global addr)\n"
msgstr "STC_NBH_GBL (tallenna ehdollinen tai vihje yleisosoitteessa)\n"
-#: vms-alpha.c:6280
+#: vms-alpha.c:6173
#, c-format
msgid "STC_NBH_PS (store cond or hint at psect + offset)\n"
msgstr "STC_NBH_PS (tallenna ehdollinen tai vihje kohteessa psect + siirros)\n"
-#: vms-alpha.c:6284
+#: vms-alpha.c:6177
#, c-format
msgid "CTL_SETRB (set relocation base)\n"
msgstr "CTL_SETRB (aseta sijoituskanta)\n"
-#: vms-alpha.c:6290
+#: vms-alpha.c:6183
#, c-format
msgid "CTL_AUGRB (augment relocation base) %u\n"
msgstr "CTL_AUGRB (lisäyssijoituskanta) %u\n"
-#: vms-alpha.c:6294
+#: vms-alpha.c:6187
#, c-format
msgid "CTL_DFLOC (define location)\n"
msgstr "CTL_DFLOC (määritä paikka)\n"
-#: vms-alpha.c:6297
+#: vms-alpha.c:6190
#, c-format
msgid "CTL_STLOC (set location)\n"
msgstr "CTL_STLOC (aseta paikka)\n"
-#: vms-alpha.c:6300
+#: vms-alpha.c:6193
#, c-format
msgid "CTL_STKDL (stack defined location)\n"
msgstr "CTL_STKDL (pinomääritelty paikka)\n"
-#: vms-alpha.c:6303 vms-alpha.c:6717
+#: vms-alpha.c:6196 vms-alpha.c:6610
#, c-format
msgid "*unhandled*\n"
msgstr "*käsittelemätön*\n"
-#: vms-alpha.c:6333 vms-alpha.c:6372
+#: vms-alpha.c:6226 vms-alpha.c:6265
#, c-format
msgid "cannot read GST record length\n"
msgstr "ei voida lukea GST-tietuepituutta\n"
#. Ill-formed.
-#: vms-alpha.c:6354
+#: vms-alpha.c:6247
#, c-format
msgid "cannot find EMH in first GST record\n"
msgstr "ei voi löytää kohdetta EMH ensimmäisessä GST-tietueessa\n"
-#: vms-alpha.c:6380
+#: vms-alpha.c:6273
#, c-format
msgid "cannot read GST record header\n"
msgstr "ei voida lukea GST-tietueotsaketta\n"
-#: vms-alpha.c:6393
+#: vms-alpha.c:6286
#, c-format
msgid " corrupted GST\n"
msgstr " rikkoutunut kohde GST\n"
-#: vms-alpha.c:6401
+#: vms-alpha.c:6294
#, c-format
msgid "cannot read GST record\n"
msgstr "ei voida lukea GST-tietuetta\n"
-#: vms-alpha.c:6430
+#: vms-alpha.c:6323
#, c-format
msgid " unhandled EOBJ record type %u\n"
msgstr " käsittelemätön EOBJ-tietuetyyppi %u\n"
-#: vms-alpha.c:6453
+#: vms-alpha.c:6346
#, c-format
msgid " bitcount: %u, base addr: 0x%08x\n"
msgstr " bittilukumäärä: %u, perusosoite: 0x%08x\n"
-#: vms-alpha.c:6466
+#: vms-alpha.c:6359
#, c-format
msgid " bitmap: 0x%08x (count: %u):\n"
msgstr " bittikartta: 0x%08x (lukumäärä: %u):\n"
-#: vms-alpha.c:6473
+#: vms-alpha.c:6366
#, c-format
msgid " %08x"
msgstr " %08x"
-#: vms-alpha.c:6498
+#: vms-alpha.c:6391
#, c-format
msgid " image %u (%u entries)\n"
msgstr " vedos %u (%u alkiota)\n"
-#: vms-alpha.c:6503
+#: vms-alpha.c:6396
#, c-format
msgid " offset: 0x%08x, val: 0x%08x\n"
msgstr " siirros: 0x%08x, arvo: 0x%08x\n"
-#: vms-alpha.c:6524
+#: vms-alpha.c:6417
#, c-format
msgid " image %u (%u entries), offsets:\n"
msgstr " vedos %u (%u alkiota), siirrokset:\n"
-#: vms-alpha.c:6531
+#: vms-alpha.c:6424
#, c-format
msgid " 0x%08x"
msgstr " 0x%08x"
#. 64 bits.
-#: vms-alpha.c:6653
+#: vms-alpha.c:6546
#, c-format
msgid "64 bits *unhandled*\n"
msgstr "64 bittinen *käsittelemätön*\n"
-#: vms-alpha.c:6657
+#: vms-alpha.c:6550
#, c-format
msgid "class: %u, dtype: %u, length: %u, pointer: 0x%08x\n"
msgstr "luokka: %u, dtype: %u, pituus: %u, osoitin: 0x%08x\n"
-#: vms-alpha.c:6668
+#: vms-alpha.c:6561
#, c-format
msgid "non-contiguous array of %s\n"
msgstr "ei-yhtenäinen %s-taulukko\n"
-#: vms-alpha.c:6672
+#: vms-alpha.c:6565
#, c-format
msgid "dimct: %u, aflags: 0x%02x, digits: %u, scale: %u\n"
msgstr "dimct: %u, a-liput: 0x%02x, numerot: %u, skaala: %u\n"
-#: vms-alpha.c:6676
+#: vms-alpha.c:6569
#, c-format
msgid "arsize: %u, a0: 0x%08x\n"
msgstr "arsize: %u, a0: 0x%08x\n"
-#: vms-alpha.c:6680
+#: vms-alpha.c:6573
#, c-format
msgid "Strides:\n"
msgstr "Askeleet:\n"
-#: vms-alpha.c:6685
+#: vms-alpha.c:6578
#, c-format
msgid "[%u]: %u\n"
msgstr "[%u]: %u\n"
-#: vms-alpha.c:6690
+#: vms-alpha.c:6583
#, c-format
msgid "Bounds:\n"
msgstr "Rajat:\n"
-#: vms-alpha.c:6695
+#: vms-alpha.c:6588
#, c-format
msgid "[%u]: Lower: %u, upper: %u\n"
msgstr "[%u]: Alempi: %u, ylempi: %u\n"
-#: vms-alpha.c:6707
+#: vms-alpha.c:6600
#, c-format
msgid "unaligned bit-string of %s\n"
msgstr "tasaamaton %s-bittimerkkijono\n"
-#: vms-alpha.c:6711
+#: vms-alpha.c:6604
#, c-format
msgid "base: %u, pos: %u\n"
msgstr "kanta: %u, paikka: %u\n"
-#: vms-alpha.c:6731
+#: vms-alpha.c:6624
#, c-format
msgid "vflags: 0x%02x, value: 0x%08x "
msgstr "v-liput: 0x%02x, arvo: 0x%08x "
-#: vms-alpha.c:6737
+#: vms-alpha.c:6630
#, c-format
msgid "(no value)\n"
msgstr "(ei arvoa)\n"
-#: vms-alpha.c:6740
+#: vms-alpha.c:6633
#, c-format
msgid "(not active)\n"
msgstr "(ei käytössä)\n"
-#: vms-alpha.c:6743
+#: vms-alpha.c:6636
#, c-format
msgid "(not allocated)\n"
msgstr "(ei varattu)\n"
-#: vms-alpha.c:6746
+#: vms-alpha.c:6639
#, c-format
msgid "(descriptor)\n"
msgstr "(kuvaaja)\n"
-#: vms-alpha.c:6750
+#: vms-alpha.c:6643
#, c-format
msgid "(trailing value)\n"
msgstr "(jälkiarvo)\n"
-#: vms-alpha.c:6753
+#: vms-alpha.c:6646
#, c-format
msgid "(value spec follows)\n"
msgstr "(arvomäärittely seuraa)\n"
-#: vms-alpha.c:6756
+#: vms-alpha.c:6649
#, c-format
msgid "(at bit offset %u)\n"
msgstr "(bittisiirroksessa %u)\n"
-#: vms-alpha.c:6759
+#: vms-alpha.c:6652
#, c-format
msgid "(reg: %u, disp: %u, indir: %u, kind: "
msgstr "(rekisteri: %u, sijoitus: %u, suunta: %u, tyyppi: "
-#: vms-alpha.c:6766
+#: vms-alpha.c:6659
msgid "literal"
msgstr "literaali"
-#: vms-alpha.c:6769
+#: vms-alpha.c:6662
msgid "address"
msgstr "osoite"
-#: vms-alpha.c:6772
+#: vms-alpha.c:6665
msgid "desc"
msgstr "kuvaus"
-#: vms-alpha.c:6775
+#: vms-alpha.c:6668
msgid "reg"
msgstr "rekisteri"
-#: vms-alpha.c:6850
+#: vms-alpha.c:6743
#, c-format
msgid "Debug symbol table:\n"
msgstr "Vianjäljityssymbolitaulu:\n"
-#: vms-alpha.c:6861
+#: vms-alpha.c:6754
#, c-format
msgid "cannot read DST header\n"
msgstr "ei voida lukea DST-otsaketta\n"
-#: vms-alpha.c:6866
+#: vms-alpha.c:6759
#, c-format
msgid " type: %3u, len: %3u (at 0x%08x): "
msgstr " tyyppi: %3u, pituus: %3u (osoitteessa 0x%08x): "
-#: vms-alpha.c:6880
+#: vms-alpha.c:6773
#, c-format
msgid "cannot read DST symbol\n"
msgstr "ei voida lukea DST-symbolia\n"
-#: vms-alpha.c:6923
+#: vms-alpha.c:6816
#, c-format
msgid "standard data: %s\n"
msgstr "vakiotiedot: %s\n"
-#: vms-alpha.c:6926 vms-alpha.c:7010
+#: vms-alpha.c:6819 vms-alpha.c:6903
#, c-format
msgid " name: %.*s\n"
msgstr " nimi: %.*s\n"
-#: vms-alpha.c:6933
+#: vms-alpha.c:6826
#, c-format
msgid "modbeg\n"
msgstr "modbeg-alku\n"
-#: vms-alpha.c:6934
+#: vms-alpha.c:6827
#, c-format
msgid " flags: %d, language: %u, major: %u, minor: %u\n"
msgstr " liput: %d, kieli: %u, major: %u, minor: %u\n"
-#: vms-alpha.c:6940 vms-alpha.c:7206
+#: vms-alpha.c:6833 vms-alpha.c:7099
#, c-format
msgid " module name: %.*s\n"
msgstr " modulinimi: %.*s\n"
-#: vms-alpha.c:6943
+#: vms-alpha.c:6836
#, c-format
msgid " compiler : %.*s\n"
msgstr " kääntäjä : %.*s\n"
-#: vms-alpha.c:6948
+#: vms-alpha.c:6841
#, c-format
msgid "modend\n"
msgstr "modend-loppu\n"
-#: vms-alpha.c:6955
+#: vms-alpha.c:6848
msgid "rtnbeg\n"
msgstr "rtnbeg-alku\n"
-#: vms-alpha.c:6956
+#: vms-alpha.c:6849
#, c-format
msgid " flags: %u, address: 0x%08x, pd-address: 0x%08x\n"
msgstr " liput: %u, osoite: 0x%08x, pd-osoite: 0x%08x\n"
-#: vms-alpha.c:6961
+#: vms-alpha.c:6854
#, c-format
msgid " routine name: %.*s\n"
msgstr " rutiininimi: %.*s\n"
-#: vms-alpha.c:6969
+#: vms-alpha.c:6862
#, c-format
msgid "rtnend: size 0x%08x\n"
msgstr "rtnend-loppu: koko 0x%08x\n"
-#: vms-alpha.c:6977
+#: vms-alpha.c:6870
#, c-format
msgid "prolog: bkpt address 0x%08x\n"
msgstr "prolog: bkpt-osoite 0x%08x\n"
-#: vms-alpha.c:6985
+#: vms-alpha.c:6878
#, c-format
msgid "epilog: flags: %u, count: %u\n"
msgstr "epilog: liput: %u, lukumäärä: %u\n"
-#: vms-alpha.c:6994
+#: vms-alpha.c:6887
#, c-format
msgid "blkbeg: address: 0x%08x, name: %.*s\n"
msgstr "blkbeg-alku: osoite: 0x%08x, nimi: %.*s\n"
-#: vms-alpha.c:7003
+#: vms-alpha.c:6896
#, c-format
msgid "blkend: size: 0x%08x\n"
msgstr "blkend-loppu: koko: 0x%08x\n"
-#: vms-alpha.c:7009
+#: vms-alpha.c:6902
#, c-format
msgid "typspec (len: %u)\n"
msgstr "typspec (pituus: %u)\n"
-#: vms-alpha.c:7016
+#: vms-alpha.c:6909
#, c-format
msgid "septyp, name: %.*s\n"
msgstr "septyp, nimi: %.*s\n"
-#: vms-alpha.c:7025
+#: vms-alpha.c:6918
#, c-format
msgid "recbeg: name: %.*s\n"
msgstr "recbeg-alku: nimi: %.*s\n"
-#: vms-alpha.c:7032
+#: vms-alpha.c:6925
#, c-format
msgid "recend\n"
msgstr "recend-loppu\n"
-#: vms-alpha.c:7035
+#: vms-alpha.c:6928
#, c-format
msgid "enumbeg, len: %u, name: %.*s\n"
msgstr "enumbeg-alku, pituus: %u, nimi: %.*s\n"
-#: vms-alpha.c:7039
+#: vms-alpha.c:6932
#, c-format
msgid "enumelt, name: %.*s\n"
msgstr "enumelt, nimi: %.*s\n"
-#: vms-alpha.c:7043
+#: vms-alpha.c:6936
#, c-format
msgid "enumend\n"
msgstr "enumend-loppu\n"
-#: vms-alpha.c:7060
+#: vms-alpha.c:6953
#, c-format
msgid "discontiguous range (nbr: %u)\n"
msgstr "ei-yhtenäinen lukualue (numero: %u)\n"
-#: vms-alpha.c:7062
+#: vms-alpha.c:6955
#, c-format
msgid " address: 0x%08x, size: %u\n"
msgstr " osoite: 0x%08x, koko: %u\n"
-#: vms-alpha.c:7072
+#: vms-alpha.c:6965
#, c-format
msgid "line num (len: %u)\n"
msgstr "rivinumero (pituus: %u)\n"
-#: vms-alpha.c:7089
+#: vms-alpha.c:6982
#, c-format
msgid "delta_pc_w %u\n"
msgstr "delta_pc_w %u\n"
-#: vms-alpha.c:7096
+#: vms-alpha.c:6989
#, c-format
msgid "incr_linum(b): +%u\n"
msgstr "incr_linum(b): +%u\n"
-#: vms-alpha.c:7102
+#: vms-alpha.c:6995
#, c-format
msgid "incr_linum_w: +%u\n"
msgstr "incr_linum_w: +%u\n"
-#: vms-alpha.c:7108
+#: vms-alpha.c:7001
#, c-format
msgid "incr_linum_l: +%u\n"
msgstr "incr_linum_l: +%u\n"
-#: vms-alpha.c:7114
+#: vms-alpha.c:7007
#, c-format
msgid "set_line_num(w) %u\n"
msgstr "set_line_num(w) %u\n"
-#: vms-alpha.c:7119
+#: vms-alpha.c:7012
#, c-format
msgid "set_line_num_b %u\n"
msgstr "set_line_num_b %u\n"
-#: vms-alpha.c:7124
+#: vms-alpha.c:7017
#, c-format
msgid "set_line_num_l %u\n"
msgstr "set_line_num_l %u\n"
-#: vms-alpha.c:7129
+#: vms-alpha.c:7022
#, c-format
msgid "set_abs_pc: 0x%08x\n"
msgstr "set_abs_pc: 0x%08x\n"
-#: vms-alpha.c:7133
+#: vms-alpha.c:7026
#, c-format
msgid "delta_pc_l: +0x%08x\n"
msgstr "delta_pc_l: +0x%08x\n"
-#: vms-alpha.c:7138
+#: vms-alpha.c:7031
#, c-format
msgid "term(b): 0x%02x"
msgstr "term(b): 0x%02x"
-#: vms-alpha.c:7140
+#: vms-alpha.c:7033
#, c-format
msgid " pc: 0x%08x\n"
msgstr " pc: 0x%08x\n"
-#: vms-alpha.c:7145
+#: vms-alpha.c:7038
#, c-format
msgid "term_w: 0x%04x"
msgstr "term_w: 0x%04x"
-#: vms-alpha.c:7147
+#: vms-alpha.c:7040
#, c-format
msgid " pc: 0x%08x\n"
msgstr " pc: 0x%08x\n"
-#: vms-alpha.c:7153
+#: vms-alpha.c:7046
#, c-format
msgid "delta pc +%-4d"
msgstr "delta pc +%-4d"
-#: vms-alpha.c:7156
+#: vms-alpha.c:7049
#, c-format
msgid " pc: 0x%08x line: %5u\n"
msgstr " pc: 0x%08x rivi: %5u\n"
-#: vms-alpha.c:7161
+#: vms-alpha.c:7054
#, c-format
msgid " *unhandled* cmd %u\n"
msgstr " *käsittelemätön* komento %u\n"
-#: vms-alpha.c:7176
+#: vms-alpha.c:7069
#, c-format
msgid "source (len: %u)\n"
msgstr "lähde (pituus: %u)\n"
-#: vms-alpha.c:7190
+#: vms-alpha.c:7083
#, c-format
msgid " declfile: len: %u, flags: %u, fileid: %u\n"
msgstr " declfile: pituus: %u, liput: %u, tiedostotunniste: %u\n"
-#: vms-alpha.c:7194
+#: vms-alpha.c:7087
#, c-format
msgid " rms: cdt: 0x%08x %08x, ebk: 0x%08x, ffb: 0x%04x, rfo: %u\n"
msgstr " rms: cdt: 0x%08x %08x, ebk: 0x%08x, ffb: 0x%04x, rfo: %u\n"
-#: vms-alpha.c:7203
+#: vms-alpha.c:7096
#, c-format
msgid " filename : %.*s\n"
msgstr " tiedostonimi: %.*s\n"
-#: vms-alpha.c:7212
+#: vms-alpha.c:7105
#, c-format
msgid " setfile %u\n"
msgstr " setfile %u\n"
-#: vms-alpha.c:7217 vms-alpha.c:7222
+#: vms-alpha.c:7110 vms-alpha.c:7115
#, c-format
msgid " setrec %u\n"
msgstr " setrec %u\n"
-#: vms-alpha.c:7227 vms-alpha.c:7232
+#: vms-alpha.c:7120 vms-alpha.c:7125
#, c-format
msgid " setlnum %u\n"
msgstr " setlnum %u\n"
-#: vms-alpha.c:7237 vms-alpha.c:7242
+#: vms-alpha.c:7130 vms-alpha.c:7135
#, c-format
msgid " deflines %u\n"
msgstr " deflines %u\n"
-#: vms-alpha.c:7246
+#: vms-alpha.c:7139
#, c-format
msgid " formfeed\n"
msgstr " formfeed\n"
-#: vms-alpha.c:7250
+#: vms-alpha.c:7143
#, c-format
msgid " *unhandled* cmd %u\n"
msgstr " *käsittelemätön* komento %u\n"
-#: vms-alpha.c:7262
+#: vms-alpha.c:7155
#, c-format
msgid "*unhandled* dst type %u\n"
msgstr "*käsittelemätön* kohdetyyppi %u\n"
-#: vms-alpha.c:7294
+#: vms-alpha.c:7187
#, c-format
msgid "cannot read EIHD\n"
msgstr "ei voida lukea kohdetta EIHD\n"
-#: vms-alpha.c:7297
+#: vms-alpha.c:7190
#, c-format
msgid "EIHD: (size: %u, nbr blocks: %u)\n"
msgstr "EIHD: (koko: %u, nbr lohkoa: %u)\n"
-#: vms-alpha.c:7300
+#: vms-alpha.c:7193
#, c-format
msgid " majorid: %u, minorid: %u\n"
msgstr " majorid: %u, minorid: %u\n"
-#: vms-alpha.c:7308
+#: vms-alpha.c:7201
msgid "executable"
msgstr "suoritettava tiedosto"
-#: vms-alpha.c:7311
+#: vms-alpha.c:7204
msgid "linkable image"
msgstr "linkitettävä vedos"
-#: vms-alpha.c:7317
+#: vms-alpha.c:7210
#, c-format
msgid " image type: %u (%s)"
msgstr " vedostyyppi: %u (%s)"
-#: vms-alpha.c:7323
+#: vms-alpha.c:7216
msgid "native"
msgstr "kotoperäinen"
-#: vms-alpha.c:7326
+#: vms-alpha.c:7219
msgid "CLI"
msgstr "CLI"
-#: vms-alpha.c:7332
+#: vms-alpha.c:7225
#, c-format
msgid ", subtype: %u (%s)\n"
msgstr ", alityyppi: %u (%s)\n"
-#: vms-alpha.c:7338
+#: vms-alpha.c:7231
#, c-format
msgid " offsets: isd: %u, activ: %u, symdbg: %u, imgid: %u, patch: %u\n"
msgstr " siirrokset: isd: %u, activ: %u, symdbg: %u, imgid: %u, patch: %u\n"
-#: vms-alpha.c:7342
+#: vms-alpha.c:7235
#, c-format
msgid " fixup info rva: "
msgstr " korjaustiedot rva: "
-#: vms-alpha.c:7344
+#: vms-alpha.c:7237
#, c-format
msgid ", symbol vector rva: "
msgstr ", symbolivektori rva: "
-#: vms-alpha.c:7347
+#: vms-alpha.c:7240
#, c-format
msgid ""
"\n"
@@ -5283,465 +5655,469 @@ msgstr ""
"\n"
" versiotaulukkosiirros: %u\n"
-#: vms-alpha.c:7351
+#: vms-alpha.c:7244
#, c-format
msgid " img I/O count: %u, nbr channels: %u, req pri: %08x%08x\n"
msgstr " img I/O lukumäärä: %u, kanavien lukumäärä: %u, req pri: %08x%08x\n"
-#: vms-alpha.c:7357
+#: vms-alpha.c:7250
#, c-format
msgid " linker flags: %08x:"
msgstr " linkkeriliput: %08x:"
-#: vms-alpha.c:7387
+#: vms-alpha.c:7280
#, c-format
msgid " ident: 0x%08x, sysver: 0x%08x, match ctrl: %u, symvect_size: %u\n"
msgstr " ident: 0x%08x, sysver: 0x%08x, täsmää ctrl: %u, symvect_size: %u\n"
-#: vms-alpha.c:7393
+#: vms-alpha.c:7286
#, c-format
msgid " BPAGE: %u"
msgstr " BPAGE: %u"
-#: vms-alpha.c:7399
+#: vms-alpha.c:7292
#, c-format
msgid ", ext fixup offset: %u, no_opt psect off: %u"
msgstr ", ext korjaussiirros: %u, no_opt psect -siirros: %u"
-#: vms-alpha.c:7402
+#: vms-alpha.c:7295
#, c-format
msgid ", alias: %u\n"
msgstr ", alias: %u\n"
-#: vms-alpha.c:7410
+#: vms-alpha.c:7303
#, c-format
msgid "system version array information:\n"
msgstr "järjestelmäversion taulukkotiedot:\n"
-#: vms-alpha.c:7414
+#: vms-alpha.c:7307
#, c-format
msgid "cannot read EIHVN header\n"
msgstr "ei voida lukea EIHVN-otsaketta\n"
-#: vms-alpha.c:7424
+#: vms-alpha.c:7317
#, c-format
msgid "cannot read EIHVN version\n"
msgstr "ei voida lukea EIHVN-versiota\n"
-#: vms-alpha.c:7427
+#: vms-alpha.c:7320
#, c-format
msgid " %02u "
msgstr " %02u "
-#: vms-alpha.c:7431
+#: vms-alpha.c:7324
msgid "BASE_IMAGE "
msgstr "PERUS_VEDOS "
-#: vms-alpha.c:7434
+#: vms-alpha.c:7327
msgid "MEMORY_MANAGEMENT"
msgstr "MUISTI_HALLINTA "
-#: vms-alpha.c:7437
+#: vms-alpha.c:7330
msgid "IO "
msgstr "SIIRRÄNTÄ "
-#: vms-alpha.c:7440
+#: vms-alpha.c:7333
msgid "FILES_VOLUMES "
msgstr "TIEDOSTOT_TALTIOT"
-#: vms-alpha.c:7443
+#: vms-alpha.c:7336
msgid "PROCESS_SCHED "
msgstr "PROSESSI_AIKAT. "
-#: vms-alpha.c:7446
+#: vms-alpha.c:7339
msgid "SYSGEN "
msgstr "SYSGEN "
-#: vms-alpha.c:7449
+#: vms-alpha.c:7342
msgid "CLUSTERS_LOCKMGR "
msgstr "KLUSTERIEN_LUKOT "
-#: vms-alpha.c:7452
+#: vms-alpha.c:7345
msgid "LOGICAL_NAMES "
msgstr "LOOGISET_NIMET "
-#: vms-alpha.c:7455
+#: vms-alpha.c:7348
msgid "SECURITY "
msgstr "TURVALLISUUS "
-#: vms-alpha.c:7458
+#: vms-alpha.c:7351
msgid "IMAGE_ACTIVATOR "
msgstr "VEDOS_AKTIVOIJA "
-#: vms-alpha.c:7461
+#: vms-alpha.c:7354
msgid "NETWORKS "
msgstr "VERKOT "
-#: vms-alpha.c:7464
+#: vms-alpha.c:7357
msgid "COUNTERS "
msgstr "LASKURIT "
-#: vms-alpha.c:7467
+#: vms-alpha.c:7360
msgid "STABLE "
msgstr "STABIILI "
-#: vms-alpha.c:7470
+#: vms-alpha.c:7363
msgid "MISC "
msgstr "SEKALAISET "
-#: vms-alpha.c:7473
+#: vms-alpha.c:7366
msgid "CPU "
msgstr "PROSESSORI "
-#: vms-alpha.c:7476
+#: vms-alpha.c:7369
msgid "VOLATILE "
msgstr "KATOAVA "
-#: vms-alpha.c:7479
+#: vms-alpha.c:7372
msgid "SHELL "
msgstr "KUORI "
-#: vms-alpha.c:7482
+#: vms-alpha.c:7375
msgid "POSIX "
msgstr "POSIX "
-#: vms-alpha.c:7485
+#: vms-alpha.c:7378
msgid "MULTI_PROCESSING "
msgstr "MONI_PROSESSOINTI"
-#: vms-alpha.c:7488
+#: vms-alpha.c:7381
msgid "GALAXY "
msgstr "GALAKSI "
-#: vms-alpha.c:7491
+#: vms-alpha.c:7384
msgid "*unknown* "
msgstr "*tuntematon* "
-#: vms-alpha.c:7494
+#: vms-alpha.c:7387
#, c-format
msgid ": %u.%u\n"
msgstr ": %u.%u\n"
-#: vms-alpha.c:7507 vms-alpha.c:7766
+#: vms-alpha.c:7400 vms-alpha.c:7659
#, c-format
msgid "cannot read EIHA\n"
msgstr "ei voida lukea kohdetta EIHA\n"
-#: vms-alpha.c:7510
+#: vms-alpha.c:7403
#, c-format
msgid "Image activation: (size=%u)\n"
msgstr "Vedosaktivointi: (koko=%u)\n"
-#: vms-alpha.c:7512
+#: vms-alpha.c:7405
#, c-format
msgid " First address : 0x%08x 0x%08x\n"
msgstr " Ensimmäinen osoite : 0x%08x 0x%08x\n"
-#: vms-alpha.c:7515
+#: vms-alpha.c:7408
#, c-format
msgid " Second address: 0x%08x 0x%08x\n"
msgstr " Toinen osoite : 0x%08x 0x%08x\n"
-#: vms-alpha.c:7518
+#: vms-alpha.c:7411
#, c-format
msgid " Third address : 0x%08x 0x%08x\n"
msgstr " Kolmas osoite : 0x%08x 0x%08x\n"
-#: vms-alpha.c:7521
+#: vms-alpha.c:7414
#, c-format
msgid " Fourth address: 0x%08x 0x%08x\n"
msgstr " Neljäs osoite : 0x%08x 0x%08x\n"
-#: vms-alpha.c:7524
+#: vms-alpha.c:7417
#, c-format
msgid " Shared image : 0x%08x 0x%08x\n"
msgstr " Jaettu vedos : 0x%08x 0x%08x\n"
-#: vms-alpha.c:7535
+#: vms-alpha.c:7428
#, c-format
msgid "cannot read EIHI\n"
msgstr "ei voida lukea kohdetta EIHI\n"
-#: vms-alpha.c:7538
+#: vms-alpha.c:7431
#, c-format
msgid "Image identification: (major: %u, minor: %u)\n"
msgstr "Vedostunnistus: (major: %u, minor: %u)\n"
-#: vms-alpha.c:7541
+#: vms-alpha.c:7434
#, c-format
msgid " image name : %.*s\n"
msgstr " vedosnimi : %.*s\n"
-#: vms-alpha.c:7543
+#: vms-alpha.c:7436
#, c-format
msgid " link time : %s\n"
msgstr " linkitysaika : %s\n"
-#: vms-alpha.c:7545
+#: vms-alpha.c:7438
#, c-format
msgid " image ident : %.*s\n"
msgstr " vedossisennys : %.*s\n"
-#: vms-alpha.c:7547
+#: vms-alpha.c:7440
#, c-format
msgid " linker ident : %.*s\n"
msgstr " linkkeri-ident : %.*s\n"
-#: vms-alpha.c:7549
+#: vms-alpha.c:7442
#, c-format
msgid " image build ident: %.*s\n"
msgstr " vedoksen rakennusident: %.*s\n"
-#: vms-alpha.c:7559
+#: vms-alpha.c:7452
#, c-format
msgid "cannot read EIHS\n"
msgstr "ei voida lukea kohdetta EIHS\n"
-#: vms-alpha.c:7562
+#: vms-alpha.c:7455
#, c-format
msgid "Image symbol & debug table: (major: %u, minor: %u)\n"
msgstr "Vedossymboli- ja vianjäljitystaulu: (major: %u, minor: %u)\n"
-#: vms-alpha.c:7567
+#: vms-alpha.c:7460
#, c-format
msgid " debug symbol table : vbn: %u, size: %u (0x%x)\n"
msgstr " vianjäljityssymbolitaulu : vbn: %u, koko: %u (0x%x)\n"
-#: vms-alpha.c:7571
+#: vms-alpha.c:7464
#, c-format
msgid " global symbol table: vbn: %u, records: %u\n"
msgstr " yleinen symbolitaulu: vbn: %u, tietueet: %u\n"
-#: vms-alpha.c:7575
+#: vms-alpha.c:7468
#, c-format
msgid " debug module table : vbn: %u, size: %u\n"
msgstr " vianjäljitysmodulitaulu : vbn: %u, koko: %u\n"
-#: vms-alpha.c:7588
+#: vms-alpha.c:7481
#, c-format
msgid "cannot read EISD\n"
msgstr "ei voida lukea kohdetta EISD\n"
-#: vms-alpha.c:7598
+#: vms-alpha.c:7491
#, c-format
msgid "Image section descriptor: (major: %u, minor: %u, size: %u, offset: %u)\n"
msgstr "Vedoslohkokuvaaja: (major: %u, minor: %u, koko: %u, siirros: %u)\n"
-#: vms-alpha.c:7605
+#: vms-alpha.c:7498
#, c-format
msgid " section: base: 0x%08x%08x size: 0x%08x\n"
msgstr " lohko: kanta: 0x%08x%08x koko: 0x%08x\n"
-#: vms-alpha.c:7610
+#: vms-alpha.c:7503
#, c-format
msgid " flags: 0x%04x"
msgstr " liput: 0x%04x"
-#: vms-alpha.c:7647
+#: vms-alpha.c:7540
#, c-format
msgid " vbn: %u, pfc: %u, matchctl: %u type: %u ("
msgstr " vbn: %u, pfc: %u, matchctl: %u tyyppi: %u ("
-#: vms-alpha.c:7653
+#: vms-alpha.c:7546
msgid "NORMAL"
msgstr "NORMAALI"
-#: vms-alpha.c:7656
+#: vms-alpha.c:7549
msgid "SHRFXD"
msgstr "SHRFXD"
-#: vms-alpha.c:7659
+#: vms-alpha.c:7552
msgid "PRVFXD"
msgstr "PRVFXD"
-#: vms-alpha.c:7662
+#: vms-alpha.c:7555
msgid "SHRPIC"
msgstr "SHRPIC"
-#: vms-alpha.c:7665
+#: vms-alpha.c:7558
msgid "PRVPIC"
msgstr "PRVPIC"
-#: vms-alpha.c:7668
+#: vms-alpha.c:7561
msgid "USRSTACK"
msgstr "USRSTACK"
-#: vms-alpha.c:7676
+#: vms-alpha.c:7567
+msgid ")\n"
+msgstr ")\n"
+
+#: vms-alpha.c:7569
#, c-format
msgid " ident: 0x%08x, name: %.*s\n"
msgstr " ident: 0x%08x, nimi: %.*s\n"
-#: vms-alpha.c:7686
+#: vms-alpha.c:7579
#, c-format
msgid "cannot read DMT\n"
msgstr "ei voida lukea kohdetta DMT\n"
-#: vms-alpha.c:7690
+#: vms-alpha.c:7583
#, c-format
msgid "Debug module table:\n"
msgstr "Vianjäljitysmodulitaulu:\n"
-#: vms-alpha.c:7699
+#: vms-alpha.c:7592
#, c-format
msgid "cannot read DMT header\n"
msgstr "ei voida lukea DMT-otsaketta\n"
-#: vms-alpha.c:7704
+#: vms-alpha.c:7597
#, c-format
msgid " module offset: 0x%08x, size: 0x%08x, (%u psects)\n"
msgstr " modulisiirros: 0x%08x, koko: 0x%08x, (%u psects)\n"
-#: vms-alpha.c:7714
+#: vms-alpha.c:7607
#, c-format
msgid "cannot read DMT psect\n"
msgstr "ei voida lukea kohdetta DMT psect\n"
-#: vms-alpha.c:7717
+#: vms-alpha.c:7610
#, c-format
msgid " psect start: 0x%08x, length: %u\n"
msgstr " psect-alku: 0x%08x, pituus: %u\n"
-#: vms-alpha.c:7730
+#: vms-alpha.c:7623
#, c-format
msgid "cannot read DST\n"
msgstr "ei voida lukea kohdetta DST\n"
-#: vms-alpha.c:7740
+#: vms-alpha.c:7633
#, c-format
msgid "cannot read GST\n"
msgstr "ei voida lukea kohdetta GST\n"
-#: vms-alpha.c:7744
+#: vms-alpha.c:7637
#, c-format
msgid "Global symbol table:\n"
msgstr "Yleinen symbolitaulu:\n"
-#: vms-alpha.c:7772
+#: vms-alpha.c:7665
#, c-format
msgid "Image activator fixup: (major: %u, minor: %u)\n"
msgstr "Vedosaktivaattorikorjaus: (major: %u, minor: %u)\n"
-#: vms-alpha.c:7775
+#: vms-alpha.c:7668
#, c-format
msgid " iaflink : 0x%08x %08x\n"
msgstr " iaflink : 0x%08x %08x\n"
-#: vms-alpha.c:7778
+#: vms-alpha.c:7671
#, c-format
msgid " fixuplnk: 0x%08x %08x\n"
msgstr " fixuplnk: 0x%08x %08x\n"
-#: vms-alpha.c:7781
+#: vms-alpha.c:7674
#, c-format
msgid " size : %u\n"
msgstr " koko : %u\n"
-#: vms-alpha.c:7783
+#: vms-alpha.c:7676
#, c-format
msgid " flags: 0x%08x\n"
msgstr " liput: 0x%08x\n"
-#: vms-alpha.c:7787
+#: vms-alpha.c:7680
#, c-format
msgid " qrelfixoff: %5u, lrelfixoff: %5u\n"
msgstr " qrelfixoff: %5u, lrelfixoff: %5u\n"
-#: vms-alpha.c:7791
+#: vms-alpha.c:7684
#, c-format
msgid " qdotadroff: %5u, ldotadroff: %5u\n"
msgstr " qdotadroff: %5u, ldotadroff: %5u\n"
-#: vms-alpha.c:7795
+#: vms-alpha.c:7688
#, c-format
msgid " codeadroff: %5u, lpfixoff : %5u\n"
msgstr " codeadroff: %5u, lpfixoff : %5u\n"
-#: vms-alpha.c:7798
+#: vms-alpha.c:7691
#, c-format
msgid " chgprtoff : %5u\n"
msgstr " chgprtoff : %5u\n"
-#: vms-alpha.c:7801
+#: vms-alpha.c:7694
#, c-format
msgid " shlstoff : %5u, shrimgcnt : %5u\n"
msgstr " shlstoff : %5u, shrimgcnt : %5u\n"
-#: vms-alpha.c:7803
+#: vms-alpha.c:7696
#, c-format
msgid " shlextra : %5u, permctx : %5u\n"
msgstr " shlextra : %5u, permctx : %5u\n"
-#: vms-alpha.c:7806
+#: vms-alpha.c:7699
#, c-format
msgid " base_va : 0x%08x\n"
msgstr " base_va : 0x%08x\n"
-#: vms-alpha.c:7808
+#: vms-alpha.c:7701
#, c-format
msgid " lppsbfixoff: %5u\n"
msgstr " lppsbfixoff: %5u\n"
-#: vms-alpha.c:7816
+#: vms-alpha.c:7709
#, c-format
msgid " Shareable images:\n"
msgstr " Jaettavat vedokset:\n"
-#: vms-alpha.c:7820
+#: vms-alpha.c:7713
#, c-format
msgid " %u: size: %u, flags: 0x%02x, name: %.*s\n"
msgstr " %u: koko: %u, liput: 0x%02x, nimi: %.*s\n"
-#: vms-alpha.c:7827
+#: vms-alpha.c:7720
#, c-format
msgid " quad-word relocation fixups:\n"
msgstr " quad-sanaiset sijoituskorjaukset:\n"
-#: vms-alpha.c:7832
+#: vms-alpha.c:7725
#, c-format
msgid " long-word relocation fixups:\n"
msgstr " long-word-sijoituskorjaukset:\n"
-#: vms-alpha.c:7837
+#: vms-alpha.c:7730
#, c-format
msgid " quad-word .address reference fixups:\n"
msgstr " quad-word .address -viitekorjaukset:\n"
-#: vms-alpha.c:7842
+#: vms-alpha.c:7735
#, c-format
msgid " long-word .address reference fixups:\n"
msgstr " long-word .address -viitekorjaukset:\n"
-#: vms-alpha.c:7847
+#: vms-alpha.c:7740
#, c-format
msgid " Code Address Reference Fixups:\n"
msgstr " Koodiosoiteviitekorjaukset:\n"
-#: vms-alpha.c:7852
+#: vms-alpha.c:7745
#, c-format
-msgid " Linkage Pairs Referece Fixups:\n"
+msgid " Linkage Pairs Reference Fixups:\n"
msgstr " Linkitysparien viitekorjaukset:\n"
-#: vms-alpha.c:7861
+#: vms-alpha.c:7754
#, c-format
msgid " Change Protection (%u entries):\n"
msgstr " Vaihda suoja (%u alkiota):\n"
-#: vms-alpha.c:7866
+#: vms-alpha.c:7759
#, c-format
msgid " base: 0x%08x %08x, size: 0x%08x, prot: 0x%08x "
msgstr " kanta: 0x%08x %08x, koko: 0x%08x, prot: 0x%08x "
#. FIXME: we do not yet support relocatable link. It is not obvious
#. how to do it for debug infos.
-#: vms-alpha.c:8706
+#: vms-alpha.c:8599
msgid "%P: relocatable link is not supported\n"
msgstr "%P: sijoitettava linkki ei ole tuettu\n"
-#: vms-alpha.c:8776
+#: vms-alpha.c:8669
msgid "%P: multiple entry points: in modules %B and %B\n"
msgstr "%P: useita tulokohtia: moduuleissa %B ja %B\n"
-#: vms-lib.c:1423
+#: vms-lib.c:1444
#, c-format
msgid "could not open shared image '%s' from '%s'"
msgstr "ei voitu avata jaettua vedosta '%s' kohteesta '%s'"
@@ -5754,225 +6130,149 @@ msgstr "_bfd_vms_output_counted kutsuttu nollatavuilla"
msgid "_bfd_vms_output_counted called with too many bytes"
msgstr "_bfd_vms_output_counted kutsuttu liian monilla tavuilla"
-#: xcofflink.c:836
+#: xcofflink.c:824
#, c-format
msgid "%s: XCOFF shared object when not producing XCOFF output"
msgstr "%s: XCOFF jaettu objekti kun ei tuoteta XCOFF-tulostetta"
-#: xcofflink.c:857
+#: xcofflink.c:845
#, c-format
msgid "%s: dynamic object with no .loader section"
msgstr "%s: dynaaminen objekti ilman â€.loaderâ€-lohkoa"
-#: xcofflink.c:1416
+#: xcofflink.c:1404
msgid "%B: `%s' has line numbers but no enclosing section"
msgstr "%B: â€%s†on rivinumerot, mutta ei sulkevaa lohkoa"
-#: xcofflink.c:1468
+#: xcofflink.c:1456
msgid "%B: class %d symbol `%s' has no aux entries"
msgstr "%B: luokassa %d symbolissa â€%s†ei ole aputulokohtia"
-#: xcofflink.c:1490
+#: xcofflink.c:1478
msgid "%B: symbol `%s' has unrecognized csect type %d"
msgstr "%B: symbolissa â€%s†on tunnistamaton ohjauslohkotyyppi %d"
-#: xcofflink.c:1502
+#: xcofflink.c:1490
msgid "%B: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d"
msgstr "%B: virheellinen XTY_ER-symboli â€%sâ€: luokka %d ohjauslohkonumero %d ohjauslohkopituus %d"
-#: xcofflink.c:1531
+#: xcofflink.c:1519
msgid "%B: XMC_TC0 symbol `%s' is class %d scnlen %d"
msgstr "%B: XMC_TC0-symboli â€%s†on luokka %d ohjauslohkopituus %d"
-#: xcofflink.c:1677
+#: xcofflink.c:1665
msgid "%B: csect `%s' not in enclosing section"
msgstr "%B: ohjauslohkoa â€%s†ei ole sulkeutuvassa lohkossa"
-#: xcofflink.c:1784
+#: xcofflink.c:1772
msgid "%B: misplaced XTY_LD `%s'"
msgstr "%B: väärin sijoitettu XTY_LD â€%sâ€"
-#: xcofflink.c:2103
+#: xcofflink.c:2091
msgid "%B: reloc %s:%d not in csect"
msgstr "%B: reloc-tietue %s:%d ei ole ohjauslohkossa"
-#: xcofflink.c:3194
+#: xcofflink.c:3182
#, c-format
msgid "%s: no such symbol"
msgstr "%s: tuntematon symboli"
-#: xcofflink.c:3299
+#: xcofflink.c:3287
#, c-format
msgid "warning: attempt to export undefined symbol `%s'"
msgstr "varoitus: yritettiin viedä määrittelemätön symboli â€%sâ€"
-#: xcofflink.c:3678
+#: xcofflink.c:3666
msgid "error: undefined symbol __rtinit"
msgstr "virhe: määrittelemätön symboli â€__rtinitâ€"
-#: xcofflink.c:4057
+#: xcofflink.c:4045
msgid "%B: loader reloc in unrecognized section `%s'"
msgstr "%B: â€loader relocâ€-tietue tunnistamattomassa lohkossa â€%s"
-#: xcofflink.c:4068
+#: xcofflink.c:4056
msgid "%B: `%s' in loader reloc but not loader sym"
msgstr "%B: â€%s†â€loader relocâ€-tietueessa, mutta ei â€loader.symâ€-binaarissa"
-#: xcofflink.c:4084
+#: xcofflink.c:4072
msgid "%B: loader reloc in read-only section %A"
msgstr "%B: â€loader relocâ€-tietue kirjoitussuojatussa lohkossa %A"
-#: xcofflink.c:5106
+#: xcofflink.c:5094
#, c-format
msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling"
msgstr "Sisältöluettelon ylivuoto: 0x%lx > 0x10000; yritä â€-mminimal-toc†käännettäessä"
-# Kun käskyoperandi on sen lukualueen ulkopuolella, joka sallitaan kullekin käskykentälle, assembler voi muuntaa koodin käyttämään toiminnallisesti samanlaista käskyä tai käskysekvenssiä. Tämä prosessi tunnetaan nimellä relaxation. Tätä tehdään tyypillisesti haarautumiskäskyissä, koska haarautumiskohteen etäisyyttä ei tunneta ennen linkitystä. Tavallaan tällä tavalla kumotaan lukualueen rajoitteet (constraints). Siksi olen suomentanut sen termillä avartaminen.
-#: elf32-ia64.c:628 elf64-ia64.c:628
-msgid "%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect branch."
-msgstr "%B: Ei voi avartaa br-käskyä kohteessa 0x%lx lohkossa â€%Aâ€. Käytä â€brlâ€-käskyä tai epäsuoraa haarautumista."
-
-#: elf32-ia64.c:2284 elf64-ia64.c:2284
-msgid "@pltoff reloc against local symbol"
-msgstr "â€@pltoff relocâ€-tietue paikallista symbolia varten"
-
-#: elf32-ia64.c:3687 elf64-ia64.c:3687
-#, c-format
-msgid "%s: short data segment overflowed (0x%lx >= 0x400000)"
-msgstr "%s: â€shortâ€-datasegmentti ylivuotanut (0x%lx >= 0x400000)"
-
-#: elf32-ia64.c:3698 elf64-ia64.c:3698
-#, c-format
-msgid "%s: __gp does not cover short data segment"
-msgstr "%s: â€__gp†ei kata â€shortâ€-datasegmenttiä"
-
-#: elf32-ia64.c:3965 elf64-ia64.c:3965
-msgid "%B: non-pic code with imm relocation against dynamic symbol `%s'"
-msgstr "%B: paikkariippuvainen koodi välittömällä sijoituksella dynaamista symbolia â€%s†varten"
-
-#: elf32-ia64.c:4032 elf64-ia64.c:4032
-msgid "%B: @gprel relocation against dynamic symbol %s"
-msgstr "%B: â€@gprelâ€-sijoitus dynaamista symbolia %s varten"
-
-#: elf32-ia64.c:4095 elf64-ia64.c:4095
-msgid "%B: linking non-pic code in a position independent executable"
-msgstr "%B: linkitetään paikkariippuvainen koodi paikkariippumattomassa suoritettavassa tiedostossa"
-
-#: elf32-ia64.c:4232 elf64-ia64.c:4232
-msgid "%B: @internal branch to dynamic symbol %s"
-msgstr "%B: @sisäinen haarautuminen dynaamiseen symboliin %s"
-
-#: elf32-ia64.c:4234 elf64-ia64.c:4234
-msgid "%B: speculation fixup to dynamic symbol %s"
-msgstr "%B: spekulaatiokorjaus dynaamiseen symboliin %s"
-
-#: elf32-ia64.c:4236 elf64-ia64.c:4236
-msgid "%B: @pcrel relocation against dynamic symbol %s"
-msgstr "%B: â€@pcrelâ€-sijoitus dynaamista symbolia %s varten"
-
-#: elf32-ia64.c:4433 elf64-ia64.c:4433
-msgid "unsupported reloc"
-msgstr "ei-tuettu reloc-tietue"
-
-#: elf32-ia64.c:4471 elf64-ia64.c:4471
-msgid "%B: missing TLS section for relocation %s against `%s' at 0x%lx in section `%A'."
-msgstr "%B: siirroksen %s puuttuva TLS-lohko kohdetta â€%s†varten osoitteessa 0x%lx lohkossa â€%Aâ€."
-
-# Kun käskyoperandi on sen lukualueen ulkopuolella, joka sallitaan kullekin käskykentälle, assembler voi muuntaa koodin käyttämään toiminnallisesti samanlaista käskyä tai käskysekvenssiä. Tämä prosessi tunnetaan nimellä relaxation. Tätä tehdään tyypillisesti haarautumiskäskyissä, koska haarautumiskohteen etäisyyttä ei tunneta ennen linkitystä. Tavallaan tällä tavalla kumotaan lukualueen rajoitteet (constraints). Siksi olen suomentanut sen termillä avartaminen.
-#: elf32-ia64.c:4486 elf64-ia64.c:4486
-msgid "%B: Can't relax br (%s) to `%s' at 0x%lx in section `%A' with size 0x%lx (> 0x1000000)."
-msgstr "%B: Ei voi avartaa br-käskyä (%s) kohteelle â€%s†kohteessa 0x%lx lohkossa â€%A†koolla 0x%lx (> 0x1000000)."
-
-#: elf32-ia64.c:4748 elf64-ia64.c:4748
-msgid "%B: linking trap-on-NULL-dereference with non-trapping files"
-msgstr "%B: linkitetään keskeytysnollassa uudelleenviite â€ei-keskeytetäâ€-tiedostojen kanssa"
-
-#: elf32-ia64.c:4757 elf64-ia64.c:4757
-msgid "%B: linking big-endian files with little-endian files"
-msgstr "%B: linkitetään â€big-endianâ€-tiedostoja â€little-endianâ€-tiedostojen kanssa"
-
-#: elf32-ia64.c:4766 elf64-ia64.c:4766
-msgid "%B: linking 64-bit files with 32-bit files"
-msgstr "%B: linkitetään 64-bittiset tiedostot 32-bittisten tiedostojen kanssa"
-
-#: elf32-ia64.c:4775 elf64-ia64.c:4775
-msgid "%B: linking constant-gp files with non-constant-gp files"
-msgstr "%B: linkitetään vakioyleisosoitintiedostot ei-vakioiden yleisosoitintiedostojen kanssa"
-
-#: elf32-ia64.c:4785 elf64-ia64.c:4785
-msgid "%B: linking auto-pic files with non-auto-pic files"
-msgstr "%B: linkitetään automaattiset paikkariippumattomat kooditiedostot ei-automaattisten paikkariippumattomien kooditiedostojen kanssa"
-
-#: peigen.c:1002 pepigen.c:1002 pex64igen.c:1002
+#: peigen.c:1009 pepigen.c:1009 pex64igen.c:1009
#, c-format
msgid "%s: line number overflow: 0x%lx > 0xffff"
msgstr "%s: rivinumeroylivuoto: 0x%lx > 0xffff"
-#: peigen.c:1029 pepigen.c:1029 pex64igen.c:1029
+#: peigen.c:1036 pepigen.c:1036 pex64igen.c:1036
msgid "Export Directory [.edata (or where ever we found it)]"
msgstr "Vientihakemisto [.edata (tai missä sen sitten löysimmekin)]"
-#: peigen.c:1030 pepigen.c:1030 pex64igen.c:1030
+#: peigen.c:1037 pepigen.c:1037 pex64igen.c:1037
msgid "Import Directory [parts of .idata]"
msgstr "Tuontihakemisto [â€.idataâ€-osat]"
-#: peigen.c:1031 pepigen.c:1031 pex64igen.c:1031
+#: peigen.c:1038 pepigen.c:1038 pex64igen.c:1038
msgid "Resource Directory [.rsrc]"
msgstr "Resurssihakemisto [.rsrc]"
-#: peigen.c:1032 pepigen.c:1032 pex64igen.c:1032
+#: peigen.c:1039 pepigen.c:1039 pex64igen.c:1039
msgid "Exception Directory [.pdata]"
msgstr "Poikkeushakemisto [.pdata]"
-#: peigen.c:1033 pepigen.c:1033 pex64igen.c:1033
+#: peigen.c:1040 pepigen.c:1040 pex64igen.c:1040
msgid "Security Directory"
msgstr "Turvallisuushakemisto"
-#: peigen.c:1034 pepigen.c:1034 pex64igen.c:1034
+#: peigen.c:1041 pepigen.c:1041 pex64igen.c:1041
msgid "Base Relocation Directory [.reloc]"
msgstr "Perussijoitushakemisto [.reloc]"
-#: peigen.c:1035 pepigen.c:1035 pex64igen.c:1035
+#: peigen.c:1042 pepigen.c:1042 pex64igen.c:1042
msgid "Debug Directory"
msgstr "Virheenetsintähakemisto"
-#: peigen.c:1036 pepigen.c:1036 pex64igen.c:1036
+#: peigen.c:1043 pepigen.c:1043 pex64igen.c:1043
msgid "Description Directory"
msgstr "Kuvaushakemisto"
-#: peigen.c:1037 pepigen.c:1037 pex64igen.c:1037
+#: peigen.c:1044 pepigen.c:1044 pex64igen.c:1044
msgid "Special Directory"
msgstr "Erityishakemisto"
-#: peigen.c:1038 pepigen.c:1038 pex64igen.c:1038
+#: peigen.c:1045 pepigen.c:1045 pex64igen.c:1045
msgid "Thread Storage Directory [.tls]"
msgstr "Säievarastohakemisto [.tls]"
-#: peigen.c:1039 pepigen.c:1039 pex64igen.c:1039
+#: peigen.c:1046 pepigen.c:1046 pex64igen.c:1046
msgid "Load Configuration Directory"
msgstr "Lataa konfigurationhakemisto"
-#: peigen.c:1040 pepigen.c:1040 pex64igen.c:1040
+#: peigen.c:1047 pepigen.c:1047 pex64igen.c:1047
msgid "Bound Import Directory"
msgstr "Sidottu tuontihakemisto"
-#: peigen.c:1041 pepigen.c:1041 pex64igen.c:1041
+#: peigen.c:1048 pepigen.c:1048 pex64igen.c:1048
msgid "Import Address Table Directory"
msgstr "Tuontiosoitetauluhakemisto"
-#: peigen.c:1042 pepigen.c:1042 pex64igen.c:1042
+#: peigen.c:1049 pepigen.c:1049 pex64igen.c:1049
msgid "Delay Import Directory"
msgstr "Viivetuontihakemisto"
-#: peigen.c:1043 pepigen.c:1043 pex64igen.c:1043
+#: peigen.c:1050 pepigen.c:1050 pex64igen.c:1050
msgid "CLR Runtime Header"
msgstr "CLR ajoaikaotsake"
-#: peigen.c:1044 pepigen.c:1044 pex64igen.c:1044
+#: peigen.c:1051 pepigen.c:1051 pex64igen.c:1051
msgid "Reserved"
msgstr "Varattu"
-#: peigen.c:1104 pepigen.c:1104 pex64igen.c:1104
+#: peigen.c:1111 pepigen.c:1111 pex64igen.c:1111
#, c-format
msgid ""
"\n"
@@ -5981,7 +6281,7 @@ msgstr ""
"\n"
"Tuontitaulu löytyi, mutta ei lohkoa, joka sisältää sen\n"
-#: peigen.c:1109 pepigen.c:1109 pex64igen.c:1109
+#: peigen.c:1116 pepigen.c:1116 pex64igen.c:1116
#, c-format
msgid ""
"\n"
@@ -5990,7 +6290,7 @@ msgstr ""
"\n"
"Tuontitaulu lohkossa %s osoitteessa 0x%lx\n"
-#: peigen.c:1151 pepigen.c:1151 pex64igen.c:1151
+#: peigen.c:1158 pepigen.c:1158 pex64igen.c:1158
#, c-format
msgid ""
"\n"
@@ -5999,12 +6299,12 @@ msgstr ""
"\n"
"Funktiokuvaaja sijaitsi alkuosoitteessa: %04lx\n"
-#: peigen.c:1154 pepigen.c:1154 pex64igen.c:1154
+#: peigen.c:1161 pepigen.c:1161 pex64igen.c:1161
#, c-format
msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n"
msgstr "\tkoodipohja %08lx sisältöluettelo (ladattava/todellinen) %08lx/%08lx\n"
-#: peigen.c:1162 pepigen.c:1162 pex64igen.c:1162
+#: peigen.c:1169 pepigen.c:1169 pex64igen.c:1169
#, c-format
msgid ""
"\n"
@@ -6013,7 +6313,7 @@ msgstr ""
"\n"
"Ei reldata-lohkoa! Funktiokuvaaja ei ole koodattu.\n"
-#: peigen.c:1167 pepigen.c:1167 pex64igen.c:1167
+#: peigen.c:1174 pepigen.c:1174 pex64igen.c:1174
#, c-format
msgid ""
"\n"
@@ -6023,7 +6323,7 @@ msgstr ""
"Tuontitaulut (tulkittu %s lohkosisältö)\n"
# Taulukko-otsake, jossa sanat on kahdella rivillä (ilman tavuviivaa), esimerkiksi: Vihjetaulu
-#: peigen.c:1170 pepigen.c:1170 pex64igen.c:1170
+#: peigen.c:1177 pepigen.c:1177 pex64igen.c:1177
#, c-format
msgid ""
" vma: Hint Time Forward DLL First\n"
@@ -6032,7 +6332,7 @@ msgstr ""
" vma: Vihje- Aika- Jatkoläh. DLL- Ensimmäinen\n"
" taulu leima ketju nimi Thunk-funktio\n"
-#: peigen.c:1218 pepigen.c:1218 pex64igen.c:1218
+#: peigen.c:1225 pepigen.c:1225 pex64igen.c:1225
#, c-format
msgid ""
"\n"
@@ -6041,12 +6341,12 @@ msgstr ""
"\n"
"\tDLL-nimi: %s\n"
-#: peigen.c:1229 pepigen.c:1229 pex64igen.c:1229
+#: peigen.c:1236 pepigen.c:1236 pex64igen.c:1236
#, c-format
msgid "\tvma: Hint/Ord Member-Name Bound-To\n"
msgstr "\tvma: Vihje/Jär Jäsen-Nimi Sidottu\n"
-#: peigen.c:1254 pepigen.c:1254 pex64igen.c:1254
+#: peigen.c:1261 pepigen.c:1261 pex64igen.c:1261
#, c-format
msgid ""
"\n"
@@ -6055,7 +6355,7 @@ msgstr ""
"\n"
"Ensimmäinen thunk-funktio löytyi, mutta ei sen sisältävää lohkoa\n"
-#: peigen.c:1415 pepigen.c:1415 pex64igen.c:1415
+#: peigen.c:1423 pepigen.c:1423 pex64igen.c:1423
#, c-format
msgid ""
"\n"
@@ -6064,7 +6364,7 @@ msgstr ""
"\n"
"Vientitaulu löytyi, mutta ei sen sisältävää lohkoa\n"
-#: peigen.c:1424 pepigen.c:1424 pex64igen.c:1424
+#: peigen.c:1432 pepigen.c:1432 pex64igen.c:1432
#, c-format
msgid ""
"\n"
@@ -6073,7 +6373,7 @@ msgstr ""
"\n"
"Vientitaulu kohteessa %s, mutta ei sovi tuohon lohkoon\n"
-#: peigen.c:1430 pepigen.c:1430 pex64igen.c:1430
+#: peigen.c:1438 pepigen.c:1438 pex64igen.c:1438
#, c-format
msgid ""
"\n"
@@ -6082,7 +6382,7 @@ msgstr ""
"\n"
"Vientitaulu lohkossa %s osoitteessa 0x%lx\n"
-#: peigen.c:1458 pepigen.c:1458 pex64igen.c:1458
+#: peigen.c:1466 pepigen.c:1466 pex64igen.c:1466
#, c-format
msgid ""
"\n"
@@ -6093,67 +6393,67 @@ msgstr ""
"Vientitaulut (tulkittu %s lohkosisältö)\n"
"\n"
-#: peigen.c:1462 pepigen.c:1462 pex64igen.c:1462
+#: peigen.c:1470 pepigen.c:1470 pex64igen.c:1470
#, c-format
msgid "Export Flags \t\t\t%lx\n"
msgstr "Vientiliput \t\t\t%lx\n"
-#: peigen.c:1465 pepigen.c:1465 pex64igen.c:1465
+#: peigen.c:1473 pepigen.c:1473 pex64igen.c:1473
#, c-format
msgid "Time/Date stamp \t\t%lx\n"
msgstr "Aika/Päivämääräleima \t\t%lx\n"
-#: peigen.c:1468 pepigen.c:1468 pex64igen.c:1468
+#: peigen.c:1476 pepigen.c:1476 pex64igen.c:1476
#, c-format
msgid "Major/Minor \t\t\t%d/%d\n"
msgstr "Suurempi/Pienempi \t\t\t%d/%d\n"
-#: peigen.c:1471 pepigen.c:1471 pex64igen.c:1471
+#: peigen.c:1479 pepigen.c:1479 pex64igen.c:1479
#, c-format
msgid "Name \t\t\t\t"
msgstr "Nimi \t\t\t\t"
-#: peigen.c:1477 pepigen.c:1477 pex64igen.c:1477
+#: peigen.c:1485 pepigen.c:1485 pex64igen.c:1485
#, c-format
msgid "Ordinal Base \t\t\t%ld\n"
msgstr "Järjestyslukukanta \t\t\t%ld\n"
-#: peigen.c:1480 pepigen.c:1480 pex64igen.c:1480
+#: peigen.c:1488 pepigen.c:1488 pex64igen.c:1488
#, c-format
msgid "Number in:\n"
msgstr "Numero kohteessa:\n"
-#: peigen.c:1483 pepigen.c:1483 pex64igen.c:1483
+#: peigen.c:1491 pepigen.c:1491 pex64igen.c:1491
#, c-format
msgid "\tExport Address Table \t\t%08lx\n"
msgstr "\tVientiosoitetaulu \t\t%08lx\n"
-#: peigen.c:1487 pepigen.c:1487 pex64igen.c:1487
+#: peigen.c:1495 pepigen.c:1495 pex64igen.c:1495
#, c-format
msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n"
msgstr "\t[Nimiosoitin/Järjestysnumero] taulu\t%08lx\n"
-#: peigen.c:1490 pepigen.c:1490 pex64igen.c:1490
+#: peigen.c:1498 pepigen.c:1498 pex64igen.c:1498
#, c-format
msgid "Table Addresses\n"
msgstr "Tauluosoitteet\n"
-#: peigen.c:1493 pepigen.c:1493 pex64igen.c:1493
+#: peigen.c:1501 pepigen.c:1501 pex64igen.c:1501
#, c-format
msgid "\tExport Address Table \t\t"
msgstr "\tVientiosoitetaulu \t\t"
-#: peigen.c:1498 pepigen.c:1498 pex64igen.c:1498
+#: peigen.c:1506 pepigen.c:1506 pex64igen.c:1506
#, c-format
msgid "\tName Pointer Table \t\t"
msgstr "\tNimiosoitintaulu \t\t"
-#: peigen.c:1503 pepigen.c:1503 pex64igen.c:1503
+#: peigen.c:1511 pepigen.c:1511 pex64igen.c:1511
#, c-format
msgid "\tOrdinal Table \t\t\t"
msgstr "\tJärjestysnumerotaulu \t\t\t"
-#: peigen.c:1517 pepigen.c:1517 pex64igen.c:1517
+#: peigen.c:1525 pepigen.c:1525 pex64igen.c:1525
#, c-format
msgid ""
"\n"
@@ -6162,15 +6462,15 @@ msgstr ""
"\n"
"Vientiosoitetaulu -- Järjestyslukukanta %ld\n"
-#: peigen.c:1536 pepigen.c:1536 pex64igen.c:1536
+#: peigen.c:1544 pepigen.c:1544 pex64igen.c:1544
msgid "Forwarder RVA"
msgstr "Jatkolähetyksen suhteellinen muuttujaosoite"
-#: peigen.c:1547 pepigen.c:1547 pex64igen.c:1547
+#: peigen.c:1555 pepigen.c:1555 pex64igen.c:1555
msgid "Export RVA"
msgstr "Viennin suhteellinen muuttujaosoite"
-#: peigen.c:1554 pepigen.c:1554 pex64igen.c:1554
+#: peigen.c:1562 pepigen.c:1562 pex64igen.c:1562
#, c-format
msgid ""
"\n"
@@ -6179,19 +6479,19 @@ msgstr ""
"\n"
"[Järjestysnumero/Nimiosoitin] Taulu\n"
-#: peigen.c:1614 peigen.c:1797 pepigen.c:1614 pepigen.c:1797 pex64igen.c:1614
-#: pex64igen.c:1797
+#: peigen.c:1622 peigen.c:1805 pepigen.c:1622 pepigen.c:1805 pex64igen.c:1622
+#: pex64igen.c:1805
#, c-format
msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n"
msgstr "Varoitus,†.pdataâ€-lohkokoko (%ld) ei ole %d:n monikerta\n"
-#: peigen.c:1621 pepigen.c:1621 pex64igen.c:1621
+#: peigen.c:1629 pepigen.c:1629 pex64igen.c:1629
#, c-format
msgid " vma:\t\t\tBegin Address End Address Unwind Info\n"
msgstr " vma:\t\t\tAlkuosoite Loppuosoite Unwind-tiedot\n"
# Taulukko-otsake, jossa sanat jakautuvat taas alekkain kahdelle riville ilman tavuviivoja
-#: peigen.c:1623 pepigen.c:1623 pex64igen.c:1623
+#: peigen.c:1631 pepigen.c:1631 pex64igen.c:1631
#, c-format
msgid ""
" vma:\t\tBegin End EH EH PrologEnd Exception\n"
@@ -6200,22 +6500,22 @@ msgstr ""
" vma:\t\tAlku- Loppu- EH-käsit- EH- PrologEnd Poikkeus-\n"
" \t\tosoite osoite telijä data osoite peite\n"
-#: peigen.c:1697 pepigen.c:1697 pex64igen.c:1697
+#: peigen.c:1705 pepigen.c:1705 pex64igen.c:1705
#, c-format
msgid " Register save millicode"
msgstr " Rekisteri tallentaa millicode-bitin"
-#: peigen.c:1700 pepigen.c:1700 pex64igen.c:1700
+#: peigen.c:1708 pepigen.c:1708 pex64igen.c:1708
#, c-format
msgid " Register restore millicode"
msgstr " Rekisteri palauttaa millicode-bitin"
-#: peigen.c:1703 pepigen.c:1703 pex64igen.c:1703
+#: peigen.c:1711 pepigen.c:1711 pex64igen.c:1711
#, c-format
msgid " Glue code sequence"
msgstr " Vihje-koodisekvenssi"
-#: peigen.c:1803 pepigen.c:1803 pex64igen.c:1803
+#: peigen.c:1811 pepigen.c:1811 pex64igen.c:1811
#, c-format
msgid ""
" vma:\t\tBegin Prolog Function Flags Exception EH\n"
@@ -6224,7 +6524,7 @@ msgstr ""
" vma:\t\tAlku- Prologi- Funktio- Liput Poikkeus- EH-\n"
" \t\tosoite pituus pituus 32b exc käsittelijä Data\n"
-#: peigen.c:1929 pepigen.c:1929 pex64igen.c:1929
+#: peigen.c:1937 pepigen.c:1937 pex64igen.c:1937
#, c-format
msgid ""
"\n"
@@ -6236,7 +6536,7 @@ msgstr ""
"PE-tiedostokantasijoitukset (tulkittu â€.relocâ€-lohkosisältö)\n"
# Esimerkiksi välimuistissa RAM-alue koostuu usein pienistä palasista, joita kutsutaan nimellä chunk. Suomensin sen tässä sanalla alilohko
-#: peigen.c:1958 pepigen.c:1958 pex64igen.c:1958
+#: peigen.c:1966 pepigen.c:1966 pex64igen.c:1966
#, c-format
msgid ""
"\n"
@@ -6245,15 +6545,69 @@ msgstr ""
"\n"
"Virtuaaliosoite: %08lx alilohkokoko %ld (0x%lx) Korjausten lukumäärä %ld\n"
-#: peigen.c:1971 pepigen.c:1971 pex64igen.c:1971
+#: peigen.c:1979 pepigen.c:1979 pex64igen.c:1979
#, c-format
msgid "\treloc %4d offset %4x [%4lx] %s"
msgstr "\treloc-tietue %4d siirrososoite %4x [%4lx] %s"
+#: peigen.c:2023 pepigen.c:2023 pex64igen.c:2023
+#, c-format
+msgid "%*.s Entry: "
+msgstr "%*.s Entry: "
+
+#: peigen.c:2043 pepigen.c:2043 pex64igen.c:2043
+#, c-format
+msgid "name: [val: %08lx len %d]: "
+msgstr "nimi: [arvo: %08lx pituus %d]: "
+
+#: peigen.c:2054 pepigen.c:2054 pex64igen.c:2054
+#, c-format
+msgid "<corrupt string length: %#x>"
+msgstr "<rikkinäinen merkkijonopituus: %#x>"
+
+#: peigen.c:2057 pepigen.c:2057 pex64igen.c:2057
+#, c-format
+msgid "<corrupt string offset: %#lx>"
+msgstr "<rikkinäinen merkkijonosiirros: %#lx>"
+
+#: peigen.c:2060 pepigen.c:2060 pex64igen.c:2060
+#, c-format
+msgid "ID: %#08lx"
+msgstr "Tunniste: %#08lx"
+
+#: peigen.c:2063 pepigen.c:2063 pex64igen.c:2063
+#, c-format
+msgid ", Value: %#08lx\n"
+msgstr ", Arvo: %#08lx\n"
+
+#: peigen.c:2074 pepigen.c:2074 pex64igen.c:2074
+#, c-format
+msgid "%*.s Leaf: Addr: %#08lx, Size: %#08lx, Codepage: %d\n"
+msgstr "%*.s Lehti: Osoite: %#08lx, Koko: %#08lx, Koodisivu: %d\n"
+
+#: peigen.c:2116 pepigen.c:2116 pex64igen.c:2116
+#, c-format
+msgid " Table: Char: %d, Time: %08lx, Ver: %d/%d, Num Names: %d, IDs: %d\n"
+msgstr " Taulu: Merkki: %d, Aika: %08lx, Ver: %d/%d, Nimimäärä: %d, Tunnisteet: %d\n"
+
+#: peigen.c:2204 pepigen.c:2204 pex64igen.c:2204
+#, c-format
+msgid "Corrupt .rsrc section detected!\n"
+msgstr "Rikkinäinen .rsrc-lohko havaittu!\n"
+
+#: peigen.c:2220 pepigen.c:2220 pex64igen.c:2220
+#, c-format
+msgid ""
+"\n"
+"WARNING: Extra data in .rsrc section - it will be ignored by Windows:\n"
+msgstr ""
+"\n"
+"VAROITUS: Lisätietoja lohkossa .rsrc - Windows ohittaa ne:\n"
+
#. The MS dumpbin program reportedly ands with 0xff0f before
#. printing the characteristics field. Not sure why. No reason to
#. emulate it here.
-#: peigen.c:2010 pepigen.c:2010 pex64igen.c:2010
+#: peigen.c:2243 pepigen.c:2243 pex64igen.c:2243
#, c-format
msgid ""
"\n"
@@ -6262,32 +6616,150 @@ msgstr ""
"\n"
"Luonteenominaisuus 0x%x\n"
-#: peigen.c:2310 pepigen.c:2310 pex64igen.c:2310
+#: peigen.c:3194 pepigen.c:3194 pex64igen.c:3194
+#, c-format
+msgid ".rsrc merge failure: duplicate string resource: %d"
+msgstr ".rsrc-lohkon yhdistämisvirhe: merkkijonoresurssin kaksoiskappale: %d"
+
+#: peigen.c:3329 pepigen.c:3329 pex64igen.c:3329
+msgid ".rsrc merge failure: multiple non-default manifests"
+msgstr ".rsrc-lohkon yhdistämisvirhe: useita ei-oletus-manifest-tietoja"
+
+#: peigen.c:3347 pepigen.c:3347 pex64igen.c:3347
+msgid ".rsrc merge failure: a directory matches a leaf"
+msgstr ".rsrc-lohkon yhdistämisvirhe: hakemisto täsmää lehteen"
+
+#: peigen.c:3389 pepigen.c:3389 pex64igen.c:3389
+msgid ".rsrc merge failure: duplicate leaf"
+msgstr ".rsrc-lohkon yhdistämisvirhe: lehden kaksoiskappale"
+
+#: peigen.c:3391 pepigen.c:3391 pex64igen.c:3391
+#, c-format
+msgid ".rsrc merge failure: duplicate leaf: %s"
+msgstr ".rsrc-lohkon yhdistämisvirhe: lehden kaksoiskappale: %s"
+
+#: peigen.c:3457 pepigen.c:3457 pex64igen.c:3457
+msgid ".rsrc merge failure: dirs with differing characteristics\n"
+msgstr ".rsrc-lohkon yhdistämisvirhe: hakemistot eriävillä ominaisuuksilla\n"
+
+#: peigen.c:3464 pepigen.c:3464 pex64igen.c:3464
+msgid ".rsrc merge failure: differing directory versions\n"
+msgstr ".rsrc-lohkon yhdistämisvirhe: eriävät hakemistoversiot\n"
+
+#. Corrupted .rsrc section - cannot merge.
+#: peigen.c:3537 pepigen.c:3537 pex64igen.c:3537
+#, c-format
+msgid "%s: .rsrc merge failure: corrupt .rsrc section"
+msgstr "%s: .rsrc-lohkon yhdistämisvirhe: rikkinäinen .rsrc-lohko"
+
+#: peigen.c:3673 pepigen.c:3673 pex64igen.c:3673
msgid "%B: unable to fill in DataDictionary[1] because .idata$2 is missing"
msgstr "%B: DataDictionary[1]:ia ei voi täyttää, koska â€.idata$2†puuttuu"
-#: peigen.c:2330 pepigen.c:2330 pex64igen.c:2330
+#: peigen.c:3693 pepigen.c:3693 pex64igen.c:3693
msgid "%B: unable to fill in DataDictionary[1] because .idata$4 is missing"
msgstr "%B: DataDictionary[1]:ia ei voi täyttää, koska â€.idata$4†puuttuu"
-#: peigen.c:2351 pepigen.c:2351 pex64igen.c:2351
+#: peigen.c:3714 pepigen.c:3714 pex64igen.c:3714
msgid "%B: unable to fill in DataDictionary[12] because .idata$5 is missing"
msgstr "%B: DataDictionary[12]:ia ei voi täyttää, koska â€.idata$5†puuttuu"
-#: peigen.c:2371 pepigen.c:2371 pex64igen.c:2371
+#: peigen.c:3734 pepigen.c:3734 pex64igen.c:3734
msgid "%B: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE (12)] because .idata$6 is missing"
msgstr "%B: DataDictionary[PE_IMPORT_ADDRESS_TABLE (12)]:ia ei voi täyttää, koska â€.idata$6†puuttuu"
-#: peigen.c:2413 pepigen.c:2413 pex64igen.c:2413
+#: peigen.c:3776 pepigen.c:3776 pex64igen.c:3776
msgid "%B: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE(12)] because .idata$6 is missing"
msgstr "%B: DataDictionary[PE_IMPORT_ADDRESS_TABLE(12)]:ia ei voi täyttää, koska â€.idata$6†puuttuu"
-#: peigen.c:2438 pepigen.c:2438 pex64igen.c:2438
+#: peigen.c:3801 pepigen.c:3801 pex64igen.c:3801
msgid "%B: unable to fill in DataDictionary[9] because __tls_used is missing"
msgstr "%B: DataDictionary[9]:ia ei voi täyttää, koska â€__tls_used†puuttuu"
-#~ msgid "%B: error: taking the address of protected function '%s' cannot be done when making a shared library"
-#~ msgstr "%B: virhe: suojatun funktion ’%s’ osoitteen ottamista ei voida tehdä, kun tehdään jaettua kirjastoa"
+#~ msgid "%B: unable to initialize commpress status for section %s"
+#~ msgstr "%B: ei kyetä alustamaan tiivistystilaa lohkolle %s"
+
+#~ msgid "%B: unable to initialize decommpress status for section %s"
+#~ msgstr "%B: ei kyetä alustamaan tiivistyksenpurkutilaa lohkolle %s"
+
+#~ msgid ""
+#~ "%B(%s): warning: interworking not enabled.\n"
+#~ " first occurrence: %B: thumb call to arm"
+#~ msgstr ""
+#~ "%B(%s): varoitus: yhteistoimivuus vanhan koodin kanssa ei ole käytössä.\n"
+#~ " ensimmäinen esiintymä: %B: thumb-kutsu arm-koodiin"
+
+#~ msgid "DIV usage mismatch between %B and %B"
+#~ msgstr "DIV-käyttötäsmäämättömyys kohteiden %B ja %B välillä"
+
+#~ msgid "%B: bad relocation section name `%s'"
+#~ msgstr "%B: virheellinen sijoituslohkonimi â€%sâ€"
+
+#~ msgid "%P: dynamic variable `%s' is zero size\n"
+#~ msgstr "%P: dynaaminen muuttuja â€%s†on nollakokoinen\n"
+
+#~ msgid " [64-bit doubles]"
+#~ msgstr " [64-bittiset double-liukuluvut]"
+
+#~ msgid " [dsp]"
+#~ msgstr " [paikkariippumaton koodi]"
+
+#~ msgid "%P: %H: automatic multiple TOCs not supported using your crt files; recompile with -mminimal-toc or upgrade gcc\n"
+#~ msgstr "%P: %H: automaattisia useita sisältöluettelotauluja ei ole tuettu crt-tiedostoissasi; käännä uudelleen â€-mminimal-tocâ€-argumentilla tai päivitä gcc\n"
+
+#~ msgid "%P: %H: sibling call optimization to `%s' does not allow automatic multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, or make `%s' extern\n"
+#~ msgstr "%P: %H: sisarruskutsuoptimointi kohteeseen â€%s†ei salli automaattisia useita sisällysluettelotauluja; käännä uudelleen â€-mminimal-tocâ€-argumentilla tai â€-fno-optimize-sibling-callsâ€-argumentilla, tai tee kohteesta â€%s†ulkoinen\n"
+
+#~ msgid "note: '%s' is defined in DSO %B so try adding it to the linker command line"
+#~ msgstr "huomatus: ’%s’ on määritelty kohteessa DSO %B, joten yritä lisätä se linkkittäjän komentoriville"
+
+#~ msgid "Warning: %B uses -msingle-float, %B uses -mdouble-float"
+#~ msgstr "Varoitus: %B käyttää â€-msingle-floatâ€-valitsinta, %B käyttää â€-mdouble-floatâ€-valitsinta"
+
+#~ msgid "Warning: %B uses -msingle-float, %B uses -mips32r2 -mfp64"
+#~ msgstr "Varoitus: %B käyttää â€-msingle-floatâ€-valitsinta, %B käyttää â€-mips32r2 -mfp64â€-valitsimia"
+
+#~ msgid "Warning: %B uses -mdouble-float, %B uses -mips32r2 -mfp64"
+#~ msgstr "Varoitus: %B käyttää â€-mdouble-floatâ€-valitsinta, %B käyttää â€-mips32r2 -mfp64â€-valitsimia"
+
+#~ msgid "bfd_mach_o_read_symtab_symbol: symbol \"%s\" is unsupported 'indirect' reference: setting to undefined"
+#~ msgstr "bfd_mach_o_read_symtab_symbol: symboli â€%s†on tukematon ’epäsuora’ viite: asetus on määrittelemätön"
+
+#~ msgid "bfd_mach_o_read_dysymtab_symbol: unable to read %lu bytes at %lu"
+#~ msgstr "bfd_mach_o_read_dysymtab_symbol: ei kyetä lukemaan %lu tavua osoitteesta %lu"
+
+#~ msgid "Mach-O header:\n"
+#~ msgstr "Mach-O otsake:\n"
+
+#~ msgid " magic : %08lx\n"
+#~ msgstr " maaginen : %08lx\n"
+
+#~ msgid " cputype : %08lx (%s)\n"
+#~ msgstr " prosessorityyppi : %08lx (%s)\n"
+
+#~ msgid " filetype : %08lx (%s)\n"
+#~ msgstr " tiedostotyyppi : %08lx (%s)\n"
+
+#~ msgid " ncmds : %08lx (%lu)\n"
+#~ msgstr "ncmds : %08lx (%lu)\n"
+
+#~ msgid " sizeofcmds: %08lx\n"
+#~ msgstr " komentojenkoko : %08lx\n"
+
+#~ msgid " flags : %08lx ("
+#~ msgstr " liput : %08lx ("
+
+#~ msgid " reserved : %08x\n"
+#~ msgstr " varattu : %08x\n"
+
+#~ msgid "Segments and Sections:\n"
+#~ msgstr "Segmentit ja lohkot:\n"
+
+#~ msgid " #: Segment name Section name Address\n"
+#~ msgstr " #: Segmenttinimi Lohkonnimi Osoite\n"
+
+#~ msgid "Symbol %s replaced by %s\n"
+#~ msgstr "Symboli %s korvattu kohteella %s\n"
#~ msgid "%B(%A+0x%lx): cannot reach %s"
#~ msgstr "%B(%A+0x%lx): kohdetta %s ei voi tavoittaa"
@@ -6392,7 +6864,7 @@ msgstr "%B: DataDictionary[9]:ia ei voi täyttää, koska â€__tls_used†puutt
#~ msgstr "VIRHE: %B: Yhteensopimaton objektitunnus â€%sâ€:%d"
#~ msgid "%B(%A): warning: unresolvable relocation against symbol `%s'"
-#~ msgstr "%B(%A): varoitus: ratkaisematon sijoitus symbolia â€%s†varten"
+#~ msgstr "%B(%A): varoitus: ratkaisematon sijoitus käyttäen symbolia â€%sâ€"
#~ msgid "%B: Internal inconsistency; no relocation section %s"
#~ msgstr "%B: Sisäinen epäjohdonmukaisuus; ei sijoituslohkoa %s"
@@ -6431,13 +6903,16 @@ msgstr "%B: DataDictionary[9]:ia ei voi täyttää, koska â€__tls_used†puutt
#~ msgstr "VIRHE: %B: Ristiriitaisia wchar_t-määrittelyjä"
#~ msgid "%B: relocation R_X86_64_PC32 against protected function `%s' can not be used when making a shared object"
-#~ msgstr "%B: sijoitusta R_X86_64_PC32 suojattua funktiota â€%s†varten ei voida käyttää kun tehdään jaettua objektia"
-
-#~ msgid "%B: unable to initialize compress status for section %s"
-#~ msgstr "%B: ei kyetä alustamaan tiivistystilaa lohkolle %s"
-
-#~ msgid "%B: unable to initialize decompress status for section %s"
-#~ msgstr "%B: ei kyetä alustamaan tiivistyksenpurkutilaa lohkolle %s"
+#~ msgstr "%B: sijoitusta R_X86_64_PC32 käyttäen suojattua funktiota â€%s†ei voida käyttää kun tehdään jaettua objektia"
#~ msgid "R_FRV_GETTLSOFF_RELAX not applied to a call instruction"
#~ msgstr "R_FRV_GETTLSOFF_RELAX ei sovelleta kutsukäskyyn"
+
+#~ msgid "%B: %s accessed both as normal and thread local symbol"
+#~ msgstr "%B: %s haettu sekä normaalina että säikeisenä paikallissymbolina"
+
+#~ msgid "Linker: error: Cannot fix ex9 relocation\n"
+#~ msgstr "Linkkeri: virhe: ex9-sijoituksen korjaus epäonnistui\n"
+
+#~ msgid "Linker: error: Cannot init ex9 hash table\n"
+#~ msgstr "Linkkeri: virhe: ex9-tiivistetauluvirheen alustus epäonnistui\n"
diff --git a/binutils-2.25/bfd/ppcboot.c b/binutils-2.25/bfd/ppcboot.c
index b0718d8c..9ee8ab5d 100644
--- a/binutils-2.25/bfd/ppcboot.c
+++ b/binutils-2.25/bfd/ppcboot.c
@@ -1,6 +1,5 @@
/* BFD back-end for PPCbug boot records.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Written by Michael Meissner, Cygnus Support, <meissner@cygnus.com>
This file is part of BFD, the Binary File Descriptor library.
@@ -332,6 +331,7 @@ ppcboot_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED,
#define ppcboot_bfd_is_local_label_name bfd_generic_is_local_label_name
#define ppcboot_get_lineno _bfd_nosymbols_get_lineno
#define ppcboot_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define ppcboot_find_line _bfd_nosymbols_find_line
#define ppcboot_find_inliner_info _bfd_nosymbols_find_inliner_info
#define ppcboot_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define ppcboot_read_minisymbols _bfd_generic_read_minisymbols
@@ -455,7 +455,6 @@ ppcboot_bfd_print_private_bfd_data (bfd *abfd, void * farg)
_bfd_generic_section_already_linked
#define ppcboot_bfd_define_common_symbol bfd_generic_define_common_symbol
#define ppcboot_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define ppcboot_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define ppcboot_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define ppcboot_bfd_link_just_syms _bfd_generic_link_just_syms
#define ppcboot_bfd_copy_link_hash_symbol_type \
@@ -473,7 +472,7 @@ ppcboot_bfd_print_private_bfd_data (bfd *abfd, void * farg)
#define ppcboot_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
#define ppcboot_bfd_print_private_bfd_dat ppcboot_bfd_print_private_bfd_data
-const bfd_target ppcboot_vec =
+const bfd_target powerpc_boot_vec =
{
"ppcboot", /* name */
bfd_target_unknown_flavour, /* flavour */
diff --git a/binutils-2.25/bfd/ptrace-core.c b/binutils-2.25/bfd/ptrace-core.c
index 9f6ffdf9..723f4a4a 100644
--- a/binutils-2.25/bfd/ptrace-core.c
+++ b/binutils-2.25/bfd/ptrace-core.c
@@ -1,6 +1,5 @@
/* BFD backend for core files which use the ptrace_user structure
- Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
The structure of this file is based on trad-core.c written by John Gilmore
of Cygnus Support.
Modified to work with the ptrace_user structure by Kevin A. Buettner.
@@ -165,7 +164,7 @@ swap_abort (void)
#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
-const bfd_target ptrace_core_vec =
+const bfd_target core_ptrace_vec =
{
"trad-core",
bfd_target_unknown_flavour,
diff --git a/binutils-2.25/bfd/reloc.c b/binutils-2.25/bfd/reloc.c
index 25c089c5..dc471734 100644
--- a/binutils-2.25/bfd/reloc.c
+++ b/binutils-2.25/bfd/reloc.c
@@ -1,5 +1,5 @@
/* BFD support for handling relocation entries.
- Copyright 1990-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -784,10 +784,6 @@ space consuming. For each target:
}
}
}
- else
- {
- reloc_entry->addend = 0;
- }
/* FIXME: This overflow checking is incomplete, because the value
might have overflowed before we get here. For a correct check we
@@ -2293,6 +2289,17 @@ ENUMDOC
microMIPS PC-relative relocations.
ENUM
+ BFD_RELOC_MIPS_21_PCREL_S2
+ENUMX
+ BFD_RELOC_MIPS_26_PCREL_S2
+ENUMX
+ BFD_RELOC_MIPS_18_PCREL_S3
+ENUMX
+ BFD_RELOC_MIPS_19_PCREL_S2
+ENUMDOC
+ MIPS PC-relative relocations.
+
+ENUM
BFD_RELOC_MICROMIPS_GPREL16
ENUMX
BFD_RELOC_MICROMIPS_HI16
@@ -2699,6 +2706,10 @@ ENUMX
BFD_RELOC_X86_64_TLSDESC
ENUMX
BFD_RELOC_X86_64_IRELATIVE
+ENUMX
+ BFD_RELOC_X86_64_PC32_BND
+ENUMX
+ BFD_RELOC_X86_64_PLT32_BND
ENUMDOC
x86-64/elf relocations
@@ -2891,6 +2902,12 @@ ENUMX
BFD_RELOC_PPC64_PLTGOT16_DS
ENUMX
BFD_RELOC_PPC64_PLTGOT16_LO_DS
+ENUMX
+ BFD_RELOC_PPC64_ADDR16_HIGH
+ENUMX
+ BFD_RELOC_PPC64_ADDR16_HIGHA
+ENUMX
+ BFD_RELOC_PPC64_ADDR64_LOCAL
ENUMDOC
Power(rs6000) and PowerPC relocations.
@@ -2978,6 +2995,14 @@ ENUMX
BFD_RELOC_PPC64_DTPREL16_HIGHEST
ENUMX
BFD_RELOC_PPC64_DTPREL16_HIGHESTA
+ENUMX
+ BFD_RELOC_PPC64_TPREL16_HIGH
+ENUMX
+ BFD_RELOC_PPC64_TPREL16_HIGHA
+ENUMX
+ BFD_RELOC_PPC64_DTPREL16_HIGH
+ENUMX
+ BFD_RELOC_PPC64_DTPREL16_HIGHA
ENUMDOC
PowerPC and PowerPC64 thread-local storage relocations.
@@ -3823,6 +3848,322 @@ ENUMDOC
ENUM
+ BFD_RELOC_NDS32_20
+ENUMDOC
+ NDS32 relocs.
+ This is a 20 bit absolute address.
+ENUM
+ BFD_RELOC_NDS32_9_PCREL
+ENUMDOC
+ This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0.
+ENUM
+ BFD_RELOC_NDS32_WORD_9_PCREL
+ENUMDOC
+ This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0.
+ENUM
+ BFD_RELOC_NDS32_15_PCREL
+ENUMDOC
+ This is an 15-bit reloc with the right 1 bit assumed to be 0.
+ENUM
+ BFD_RELOC_NDS32_17_PCREL
+ENUMDOC
+ This is an 17-bit reloc with the right 1 bit assumed to be 0.
+ENUM
+ BFD_RELOC_NDS32_25_PCREL
+ENUMDOC
+ This is a 25-bit reloc with the right 1 bit assumed to be 0.
+ENUM
+ BFD_RELOC_NDS32_HI20
+ENUMDOC
+ This is a 20-bit reloc containing the high 20 bits of an address
+ used with the lower 12 bits
+ENUM
+ BFD_RELOC_NDS32_LO12S3
+ENUMDOC
+ This is a 12-bit reloc containing the lower 12 bits of an address
+ then shift right by 3. This is used with ldi,sdi...
+ENUM
+ BFD_RELOC_NDS32_LO12S2
+ENUMDOC
+ This is a 12-bit reloc containing the lower 12 bits of an address
+ then shift left by 2. This is used with lwi,swi...
+ENUM
+ BFD_RELOC_NDS32_LO12S1
+ENUMDOC
+ This is a 12-bit reloc containing the lower 12 bits of an address
+ then shift left by 1. This is used with lhi,shi...
+ENUM
+ BFD_RELOC_NDS32_LO12S0
+ENUMDOC
+ This is a 12-bit reloc containing the lower 12 bits of an address
+ then shift left by 0. This is used with lbisbi...
+ENUM
+ BFD_RELOC_NDS32_LO12S0_ORI
+ENUMDOC
+ This is a 12-bit reloc containing the lower 12 bits of an address
+ then shift left by 0. This is only used with branch relaxations
+ENUM
+ BFD_RELOC_NDS32_SDA15S3
+ENUMDOC
+ This is a 15-bit reloc containing the small data area 18-bit signed offset
+ and shift left by 3 for use in ldi, sdi...
+ENUM
+ BFD_RELOC_NDS32_SDA15S2
+ENUMDOC
+ This is a 15-bit reloc containing the small data area 17-bit signed offset
+ and shift left by 2 for use in lwi, swi...
+ENUM
+ BFD_RELOC_NDS32_SDA15S1
+ENUMDOC
+ This is a 15-bit reloc containing the small data area 16-bit signed offset
+ and shift left by 1 for use in lhi, shi...
+ENUM
+ BFD_RELOC_NDS32_SDA15S0
+ENUMDOC
+ This is a 15-bit reloc containing the small data area 15-bit signed offset
+ and shift left by 0 for use in lbi, sbi...
+ENUM
+ BFD_RELOC_NDS32_SDA16S3
+ENUMDOC
+ This is a 16-bit reloc containing the small data area 16-bit signed offset
+ and shift left by 3
+ENUM
+ BFD_RELOC_NDS32_SDA17S2
+ENUMDOC
+ This is a 17-bit reloc containing the small data area 17-bit signed offset
+ and shift left by 2 for use in lwi.gp, swi.gp...
+ENUM
+ BFD_RELOC_NDS32_SDA18S1
+ENUMDOC
+ This is a 18-bit reloc containing the small data area 18-bit signed offset
+ and shift left by 1 for use in lhi.gp, shi.gp...
+ENUM
+ BFD_RELOC_NDS32_SDA19S0
+ENUMDOC
+ This is a 19-bit reloc containing the small data area 19-bit signed offset
+ and shift left by 0 for use in lbi.gp, sbi.gp...
+ENUM
+ BFD_RELOC_NDS32_GOT20
+ENUMX
+ BFD_RELOC_NDS32_9_PLTREL
+ENUMX
+ BFD_RELOC_NDS32_25_PLTREL
+ENUMX
+ BFD_RELOC_NDS32_COPY
+ENUMX
+ BFD_RELOC_NDS32_GLOB_DAT
+ENUMX
+ BFD_RELOC_NDS32_JMP_SLOT
+ENUMX
+ BFD_RELOC_NDS32_RELATIVE
+ENUMX
+ BFD_RELOC_NDS32_GOTOFF
+ENUMX
+ BFD_RELOC_NDS32_GOTOFF_HI20
+ENUMX
+ BFD_RELOC_NDS32_GOTOFF_LO12
+ENUMX
+ BFD_RELOC_NDS32_GOTPC20
+ENUMX
+ BFD_RELOC_NDS32_GOT_HI20
+ENUMX
+ BFD_RELOC_NDS32_GOT_LO12
+ENUMX
+ BFD_RELOC_NDS32_GOTPC_HI20
+ENUMX
+ BFD_RELOC_NDS32_GOTPC_LO12
+ENUMDOC
+ for PIC
+ENUM
+ BFD_RELOC_NDS32_INSN16
+ENUMX
+ BFD_RELOC_NDS32_LABEL
+ENUMX
+ BFD_RELOC_NDS32_LONGCALL1
+ENUMX
+ BFD_RELOC_NDS32_LONGCALL2
+ENUMX
+ BFD_RELOC_NDS32_LONGCALL3
+ENUMX
+ BFD_RELOC_NDS32_LONGJUMP1
+ENUMX
+ BFD_RELOC_NDS32_LONGJUMP2
+ENUMX
+ BFD_RELOC_NDS32_LONGJUMP3
+ENUMX
+ BFD_RELOC_NDS32_LOADSTORE
+ENUMX
+ BFD_RELOC_NDS32_9_FIXED
+ENUMX
+ BFD_RELOC_NDS32_15_FIXED
+ENUMX
+ BFD_RELOC_NDS32_17_FIXED
+ENUMX
+ BFD_RELOC_NDS32_25_FIXED
+ENUMX
+ BFD_RELOC_NDS32_LONGCALL4
+ENUMX
+ BFD_RELOC_NDS32_LONGCALL5
+ENUMX
+ BFD_RELOC_NDS32_LONGCALL6
+ENUMX
+ BFD_RELOC_NDS32_LONGJUMP4
+ENUMX
+ BFD_RELOC_NDS32_LONGJUMP5
+ENUMX
+ BFD_RELOC_NDS32_LONGJUMP6
+ENUMX
+ BFD_RELOC_NDS32_LONGJUMP7
+ENUMDOC
+ for relax
+ENUM
+ BFD_RELOC_NDS32_PLTREL_HI20
+ENUMX
+ BFD_RELOC_NDS32_PLTREL_LO12
+ENUMX
+ BFD_RELOC_NDS32_PLT_GOTREL_HI20
+ENUMX
+ BFD_RELOC_NDS32_PLT_GOTREL_LO12
+ENUMDOC
+ for PIC
+ENUM
+ BFD_RELOC_NDS32_SDA12S2_DP
+ENUMX
+ BFD_RELOC_NDS32_SDA12S2_SP
+ENUMX
+ BFD_RELOC_NDS32_LO12S2_DP
+ENUMX
+ BFD_RELOC_NDS32_LO12S2_SP
+ENUMDOC
+ for floating point
+ENUM
+ BFD_RELOC_NDS32_DWARF2_OP1
+ENUMX
+ BFD_RELOC_NDS32_DWARF2_OP2
+ENUMX
+ BFD_RELOC_NDS32_DWARF2_LEB
+ENUMDOC
+ for dwarf2 debug_line.
+ENUM
+ BFD_RELOC_NDS32_UPDATE_TA
+ENUMDOC
+ for eliminate 16-bit instructions
+ENUM
+ BFD_RELOC_NDS32_PLT_GOTREL_LO20
+ENUMX
+ BFD_RELOC_NDS32_PLT_GOTREL_LO15
+ENUMX
+ BFD_RELOC_NDS32_PLT_GOTREL_LO19
+ENUMX
+ BFD_RELOC_NDS32_GOT_LO15
+ENUMX
+ BFD_RELOC_NDS32_GOT_LO19
+ENUMX
+ BFD_RELOC_NDS32_GOTOFF_LO15
+ENUMX
+ BFD_RELOC_NDS32_GOTOFF_LO19
+ENUMX
+ BFD_RELOC_NDS32_GOT15S2
+ENUMX
+ BFD_RELOC_NDS32_GOT17S2
+ENUMDOC
+ for PIC object relaxation
+ENUM
+ BFD_RELOC_NDS32_5
+ENUMDOC
+ NDS32 relocs.
+ This is a 5 bit absolute address.
+ENUM
+ BFD_RELOC_NDS32_10_UPCREL
+ENUMDOC
+ This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0.
+ENUM
+ BFD_RELOC_NDS32_SDA_FP7U2_RELA
+ENUMDOC
+ If fp were omitted, fp can used as another gp.
+ENUM
+ BFD_RELOC_NDS32_RELAX_ENTRY
+ENUMX
+ BFD_RELOC_NDS32_GOT_SUFF
+ENUMX
+ BFD_RELOC_NDS32_GOTOFF_SUFF
+ENUMX
+ BFD_RELOC_NDS32_PLT_GOT_SUFF
+ENUMX
+ BFD_RELOC_NDS32_MULCALL_SUFF
+ENUMX
+ BFD_RELOC_NDS32_PTR
+ENUMX
+ BFD_RELOC_NDS32_PTR_COUNT
+ENUMX
+ BFD_RELOC_NDS32_PTR_RESOLVED
+ENUMX
+ BFD_RELOC_NDS32_PLTBLOCK
+ENUMX
+ BFD_RELOC_NDS32_RELAX_REGION_BEGIN
+ENUMX
+ BFD_RELOC_NDS32_RELAX_REGION_END
+ENUMX
+ BFD_RELOC_NDS32_MINUEND
+ENUMX
+ BFD_RELOC_NDS32_SUBTRAHEND
+ENUMX
+ BFD_RELOC_NDS32_DIFF8
+ENUMX
+ BFD_RELOC_NDS32_DIFF16
+ENUMX
+ BFD_RELOC_NDS32_DIFF32
+ENUMX
+ BFD_RELOC_NDS32_DIFF_ULEB128
+ENUMX
+ BFD_RELOC_NDS32_EMPTY
+ENUMDOC
+ relaxation relative relocation types
+ENUM
+ BFD_RELOC_NDS32_25_ABS
+ENUMDOC
+ This is a 25 bit absolute address.
+ENUM
+ BFD_RELOC_NDS32_DATA
+ENUMX
+ BFD_RELOC_NDS32_TRAN
+ENUMX
+ BFD_RELOC_NDS32_17IFC_PCREL
+ENUMX
+ BFD_RELOC_NDS32_10IFCU_PCREL
+ENUMDOC
+ For ex9 and ifc using.
+ENUM
+ BFD_RELOC_NDS32_TPOFF
+ENUMX
+ BFD_RELOC_NDS32_TLS_LE_HI20
+ENUMX
+ BFD_RELOC_NDS32_TLS_LE_LO12
+ENUMX
+ BFD_RELOC_NDS32_TLS_LE_ADD
+ENUMX
+ BFD_RELOC_NDS32_TLS_LE_LS
+ENUMX
+ BFD_RELOC_NDS32_GOTTPOFF
+ENUMX
+ BFD_RELOC_NDS32_TLS_IE_HI20
+ENUMX
+ BFD_RELOC_NDS32_TLS_IE_LO12S2
+ENUMX
+ BFD_RELOC_NDS32_TLS_TPOFF
+ENUMX
+ BFD_RELOC_NDS32_TLS_LE_20
+ENUMX
+ BFD_RELOC_NDS32_TLS_LE_15S0
+ENUMX
+ BFD_RELOC_NDS32_TLS_LE_15S1
+ENUMX
+ BFD_RELOC_NDS32_TLS_LE_15S2
+ENUMDOC
+ For TLS.
+
+
+ENUM
BFD_RELOC_V850_9_PCREL
ENUMDOC
This is a 9-bit reloc
@@ -4494,7 +4835,34 @@ ENUM
ENUMDOC
This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
in .byte hlo8(symbol)
-
+ENUM
+ BFD_RELOC_AVR_DIFF8
+ENUMX
+ BFD_RELOC_AVR_DIFF16
+ENUMX
+ BFD_RELOC_AVR_DIFF32
+ENUMDOC
+ AVR relocations to mark the difference of two local symbols.
+ These are only needed to support linker relaxation and can be ignored
+ when not relaxing. The field is set to the value of the difference
+ assuming no relaxation. The relocation encodes the position of the
+ second symbol so the linker can determine whether to adjust the field
+ value.
+ENUM
+ BFD_RELOC_AVR_LDS_STS_16
+ENUMDOC
+ This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
+ lds and sts instructions supported only tiny core.
+ENUM
+ BFD_RELOC_AVR_PORT6
+ENUMDOC
+ This is a 6 bit reloc for the AVR that stores an I/O register
+ number for the IN and OUT instructions
+ENUM
+ BFD_RELOC_AVR_PORT5
+ENUMDOC
+ This is a 5 bit reloc for the AVR that stores an I/O register
+ number for the SBIC, SBIS, SBI and CBI instructions
ENUM
BFD_RELOC_RL78_NEG8
ENUMX
@@ -5583,11 +5951,55 @@ ENUMDOC
Intel i860 Relocations.
ENUM
- BFD_RELOC_OPENRISC_ABS_26
+ BFD_RELOC_OR1K_REL_26
+ENUMX
+ BFD_RELOC_OR1K_GOTPC_HI16
ENUMX
- BFD_RELOC_OPENRISC_REL_26
+ BFD_RELOC_OR1K_GOTPC_LO16
+ENUMX
+ BFD_RELOC_OR1K_GOT16
+ENUMX
+ BFD_RELOC_OR1K_PLT26
+ENUMX
+ BFD_RELOC_OR1K_GOTOFF_HI16
+ENUMX
+ BFD_RELOC_OR1K_GOTOFF_LO16
+ENUMX
+ BFD_RELOC_OR1K_COPY
+ENUMX
+ BFD_RELOC_OR1K_GLOB_DAT
+ENUMX
+ BFD_RELOC_OR1K_JMP_SLOT
+ENUMX
+ BFD_RELOC_OR1K_RELATIVE
+ENUMX
+ BFD_RELOC_OR1K_TLS_GD_HI16
+ENUMX
+ BFD_RELOC_OR1K_TLS_GD_LO16
+ENUMX
+ BFD_RELOC_OR1K_TLS_LDM_HI16
+ENUMX
+ BFD_RELOC_OR1K_TLS_LDM_LO16
+ENUMX
+ BFD_RELOC_OR1K_TLS_LDO_HI16
+ENUMX
+ BFD_RELOC_OR1K_TLS_LDO_LO16
+ENUMX
+ BFD_RELOC_OR1K_TLS_IE_HI16
+ENUMX
+ BFD_RELOC_OR1K_TLS_IE_LO16
+ENUMX
+ BFD_RELOC_OR1K_TLS_LE_HI16
+ENUMX
+ BFD_RELOC_OR1K_TLS_LE_LO16
+ENUMX
+ BFD_RELOC_OR1K_TLS_TPOFF
+ENUMX
+ BFD_RELOC_OR1K_TLS_DTPOFF
+ENUMX
+ BFD_RELOC_OR1K_TLS_DTPMOD
ENUMDOC
- OpenRISC Relocations.
+ OpenRISC 1000 Relocations.
ENUM
BFD_RELOC_H8_DIR16A8
@@ -5781,6 +6193,16 @@ ENUMX
BFD_RELOC_NIOS2_RELATIVE
ENUMX
BFD_RELOC_NIOS2_GOTOFF
+ENUMX
+ BFD_RELOC_NIOS2_CALL26_NOAT
+ENUMX
+ BFD_RELOC_NIOS2_GOT_LO
+ENUMX
+ BFD_RELOC_NIOS2_GOT_HA
+ENUMX
+ BFD_RELOC_NIOS2_CALL_LO
+ENUMX
+ BFD_RELOC_NIOS2_CALL_HA
ENUMDOC
Relocations used by the Altera Nios II core.
diff --git a/binutils-2.25/bfd/reloc16.c b/binutils-2.25/bfd/reloc16.c
index 31fc15d8..cdfc981a 100644
--- a/binutils-2.25/bfd/reloc16.c
+++ b/binutils-2.25/bfd/reloc16.c
@@ -1,7 +1,5 @@
/* 8 and 16 bit COFF relocation functions, for BFD.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001,
- 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/riscix.c b/binutils-2.25/bfd/riscix.c
index db04df18..ddf5c3a5 100644
--- a/binutils-2.25/bfd/riscix.c
+++ b/binutils-2.25/bfd/riscix.c
@@ -1,6 +1,5 @@
/* BFD back-end for RISC iX (Acorn, arm) binaries.
- Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004,
- 2005, 2007, 2010, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
This file is part of BFD, the Binary File Descriptor library.
@@ -98,7 +97,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (riscix_,OP)
+#define MY(OP) CONCAT2 (arm_aout_riscix_,OP)
#define TARGETNAME "a.out-riscix"
#define N_BADMAG(x) ((((x).a_info & ~007200) != ZMAGIC) \
&& (((x).a_info & ~006000) != OMAGIC) \
@@ -171,7 +170,7 @@ riscix_fix_pcrel_26_done (bfd *abfd ATTRIBUTE_UNUSED,
}
static bfd_reloc_status_type riscix_fix_pcrel_26 (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
-static const bfd_target *riscix_callback (bfd *);
+static const bfd_target *arm_aout_riscix_callback (bfd *);
static reloc_howto_type riscix_std_reloc_howto[] =
{
@@ -298,9 +297,9 @@ riscix_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
#define MY_bfd_final_link _bfd_generic_final_link
#define MY_bfd_reloc_type_lookup riscix_reloc_type_lookup
-#define MY_bfd_reloc_name_lookup riscix_reloc_name_lookup
-#define MY_canonicalize_reloc riscix_canonicalize_reloc
-#define MY_object_p riscix_object_p
+#define MY_bfd_reloc_name_lookup riscix_reloc_name_lookup
+#define MY_canonicalize_reloc arm_aout_riscix_canonicalize_reloc
+#define MY_object_p arm_aout_riscix_object_p
static void
riscix_swap_std_reloc_out (bfd *abfd,
diff --git a/binutils-2.25/bfd/rs6000-core.c b/binutils-2.25/bfd/rs6000-core.c
index d9c06b6c..8f2f3a0d 100644
--- a/binutils-2.25/bfd/rs6000-core.c
+++ b/binutils-2.25/bfd/rs6000-core.c
@@ -1,7 +1,5 @@
/* IBM RS/6000 "XCOFF" back-end for BFD.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
- 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Metin G. Ozisik, Mimi Phuong-Thao Vo, and John Gilmore.
Archive support from Damon A. Permezel.
Contributed by IBM Corporation and Cygnus Support.
@@ -585,7 +583,7 @@ rs6000coff_core_p (bfd *abfd)
{
ldi_core = ldinfo.l32.ldinfo_core;
ldi_datasize = ldinfo.l32.ldinfo_datasize;
- ldi_dataorg = (bfd_vma) (long) ldinfo.l32.ldinfo_dataorg;
+ ldi_dataorg = (bfd_vma) (ptr_to_uint) ldinfo.l32.ldinfo_dataorg;
ldi_next = ldinfo.l32.ldinfo_next;
}
@@ -627,7 +625,7 @@ rs6000coff_core_p (bfd *abfd)
}
else
{
- vminfo_addr = (bfd_vma) (long) vminfo.old.vminfo_addr;
+ vminfo_addr = (bfd_vma) (ptr_to_uint) vminfo.old.vminfo_addr;
vminfo_size = vminfo.old.vminfo_size;
vminfo_offset = vminfo.old.vminfo_offset;
}
diff --git a/binutils-2.25/bfd/sco5-core.c b/binutils-2.25/bfd/sco5-core.c
index 896a970c..70671766 100644
--- a/binutils-2.25/bfd/sco5-core.c
+++ b/binutils-2.25/bfd/sco5-core.c
@@ -1,7 +1,5 @@
/* BFD back end for SCO5 core files (U-area and raw sections)
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
Written by Jouke Numan <jnuman@hiscom.nl>
This file is part of BFD, the Binary File Descriptor library.
@@ -346,7 +344,7 @@ swap_abort (void)
#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
-const bfd_target sco5_core_vec =
+const bfd_target core_sco5_vec =
{
"sco5-core",
bfd_target_unknown_flavour,
diff --git a/binutils-2.25/bfd/section.c b/binutils-2.25/bfd/section.c
index fb19d8cc..b27539ae 100644
--- a/binutils-2.25/bfd/section.c
+++ b/binutils-2.25/bfd/section.c
@@ -1,8 +1,5 @@
/* Object file "section" support for the BFD library.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
- 2012, 2013
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -388,6 +385,7 @@ CODE_FRAGMENT
.#define SEC_INFO_TYPE_MERGE 2
.#define SEC_INFO_TYPE_EH_FRAME 3
.#define SEC_INFO_TYPE_JUST_SYMS 4
+.#define SEC_INFO_TYPE_TARGET 5
.
. {* Nonzero if this section uses RELA relocations, rather than REL. *}
. unsigned int use_rela_p:1;
@@ -542,6 +540,32 @@ CODE_FRAGMENT
. int size;
.};
.
+.{* Note: the following are provided as inline functions rather than macros
+. because not all callers use the return value. A macro implementation
+. would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
+. compilers will complain about comma expressions that have no effect. *}
+.static inline bfd_boolean
+.bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val)
+.{
+. ptr->userdata = val;
+. return TRUE;
+.}
+.
+.static inline bfd_boolean
+.bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
+.{
+. ptr->vma = ptr->lma = val;
+. ptr->user_set_vma = TRUE;
+. return TRUE;
+.}
+.
+.static inline bfd_boolean
+.bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val)
+.{
+. ptr->alignment_power = val;
+. return TRUE;
+.}
+.
.{* These sections are global, and are managed by BFD. The application
. and target back end are not permitted to change the values in
. these sections. *}
diff --git a/binutils-2.25/bfd/simple.c b/binutils-2.25/bfd/simple.c
index e5a5b58f..ca64101b 100644
--- a/binutils-2.25/bfd/simple.c
+++ b/binutils-2.25/bfd/simple.c
@@ -1,6 +1,5 @@
/* simple.c -- BFD simple client routines
- Copyright 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2002-2014 Free Software Foundation, Inc.
Contributed by MontaVista Software, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -101,14 +100,39 @@ struct saved_output_info
asection *section;
};
+struct saved_offsets
+{
+ int section_count;
+ struct saved_output_info *sections;
+};
+
+/* The sections in ABFD may already have output sections and offsets
+ set if we are here during linking.
+
+ DWARF-2 specifies offsets into debug sections in many cases and
+ bfd_simple_get_relocated_section_contents is called to relocate
+ debug info for a single relocatable object file. So we want
+ offsets relative to that object file's sections, not offsets in the
+ output file. For that reason, reset a debug section->output_offset
+ to zero.
+
+ If not called during linking then set section->output_section to
+ point back to the input section, because output_section must not be
+ NULL when calling the relocation routines.
+
+ Save the original output offset and section to restore later. */
+
static void
simple_save_output_info (bfd *abfd ATTRIBUTE_UNUSED,
asection *section,
void *ptr)
{
- struct saved_output_info *output_info = (struct saved_output_info *) ptr;
- output_info[section->index].offset = section->output_offset;
- output_info[section->index].section = section->output_section;
+ struct saved_offsets *saved_offsets = (struct saved_offsets *) ptr;
+ struct saved_output_info *output_info;
+
+ output_info = &saved_offsets->sections[section->index];
+ output_info->offset = section->output_offset;
+ output_info->section = section->output_section;
if ((section->flags & SEC_DEBUGGING) != 0
|| section->output_section == NULL)
{
@@ -122,9 +146,15 @@ simple_restore_output_info (bfd *abfd ATTRIBUTE_UNUSED,
asection *section,
void *ptr)
{
- struct saved_output_info *output_info = (struct saved_output_info *) ptr;
- section->output_offset = output_info[section->index].offset;
- section->output_section = output_info[section->index].section;
+ struct saved_offsets *saved_offsets = (struct saved_offsets *) ptr;
+ struct saved_output_info *output_info;
+
+ if (section->index >= saved_offsets->section_count)
+ return;
+
+ output_info = &saved_offsets->sections[section->index];
+ section->output_offset = output_info->offset;
+ section->output_section = output_info->section;
}
/*
@@ -157,7 +187,8 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
struct bfd_link_callbacks callbacks;
bfd_byte *contents, *data;
int storage_needed;
- void *saved_offsets;
+ struct saved_offsets saved_offsets;
+ bfd *link_next;
/* Don't apply relocation on executable and shared library. See
PR 4756. */
@@ -177,8 +208,10 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
memset (&link_info, 0, sizeof (link_info));
link_info.output_bfd = abfd;
link_info.input_bfds = abfd;
- link_info.input_bfds_tail = &abfd->link_next;
+ link_info.input_bfds_tail = &abfd->link.next;
+ link_next = abfd->link.next;
+ abfd->link.next = NULL;
link_info.hash = _bfd_generic_link_hash_table_create (abfd);
link_info.callbacks = &callbacks;
callbacks.warning = simple_dummy_warning;
@@ -202,28 +235,26 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
bfd_size_type amt = sec->rawsize > sec->size ? sec->rawsize : sec->size;
data = (bfd_byte *) bfd_malloc (amt);
if (data == NULL)
- return NULL;
+ {
+ _bfd_generic_link_hash_table_free (abfd);
+ abfd->link.next = link_next;
+ return NULL;
+ }
outbuf = data;
}
- /* The sections in ABFD may already have output sections and offsets set.
- Because this function is primarily for debug sections, and GCC uses the
- knowledge that debug sections will generally have VMA 0 when emitting
- relocations between DWARF-2 sections (which are supposed to be
- section-relative offsets anyway), we need to reset the output offsets
- to zero. We also need to arrange for section->output_section->vma plus
- section->output_offset to equal section->vma, which we do by setting
- section->output_section to point back to section. Save the original
- output offset and output section to restore later. */
- saved_offsets = malloc (sizeof (struct saved_output_info)
- * abfd->section_count);
- if (saved_offsets == NULL)
+ saved_offsets.section_count = abfd->section_count;
+ saved_offsets.sections = malloc (sizeof (*saved_offsets.sections)
+ * saved_offsets.section_count);
+ if (saved_offsets.sections == NULL)
{
if (data)
free (data);
+ _bfd_generic_link_hash_table_free (abfd);
+ abfd->link.next = link_next;
return NULL;
}
- bfd_map_over_sections (abfd, simple_save_output_info, saved_offsets);
+ bfd_map_over_sections (abfd, simple_save_output_info, &saved_offsets);
if (symbol_table == NULL)
{
@@ -245,9 +276,10 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
if (contents == NULL && data != NULL)
free (data);
- bfd_map_over_sections (abfd, simple_restore_output_info, saved_offsets);
- free (saved_offsets);
+ bfd_map_over_sections (abfd, simple_restore_output_info, &saved_offsets);
+ free (saved_offsets.sections);
- _bfd_generic_link_hash_table_free (link_info.hash);
+ _bfd_generic_link_hash_table_free (abfd);
+ abfd->link.next = link_next;
return contents;
}
diff --git a/binutils-2.25/bfd/som.c b/binutils-2.25/bfd/som.c
index 0ddbb6f0..513e4fa6 100644
--- a/binutils-2.25/bfd/som.c
+++ b/binutils-2.25/bfd/som.c
@@ -1,7 +1,5 @@
/* bfd back-end for HP PA-RISC SOM objects.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
- 2012, 2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah.
@@ -5351,7 +5349,7 @@ som_canonicalize_reloc (bfd *abfd,
return section->reloc_count;
}
-extern const bfd_target som_vec;
+extern const bfd_target hppa_som_vec;
/* A hook to set up object file dependent section information. */
@@ -5717,18 +5715,22 @@ som_set_arch_mach (bfd *abfd,
static bfd_boolean
som_find_nearest_line (bfd *abfd,
- asection *section,
asymbol **symbols,
+ asection *section,
bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr,
- unsigned int *line_ptr)
+ unsigned int *line_ptr,
+ unsigned int *discriminator_ptr)
{
bfd_boolean found;
asymbol *func;
bfd_vma low_func;
asymbol **p;
+ if (discriminator_ptr)
+ *discriminator_ptr = 0;
+
if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset,
& found, filename_ptr,
functionname_ptr, line_ptr,
@@ -6715,6 +6717,7 @@ som_bfd_link_split_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
return som_is_subspace (sec) && sec->size > 240000;
}
+#define som_find_line _bfd_nosymbols_find_line
#define som_close_and_cleanup som_bfd_free_cached_info
#define som_read_ar_hdr _bfd_generic_read_ar_hdr
#define som_write_ar_hdr _bfd_generic_write_ar_hdr
@@ -6734,7 +6737,6 @@ som_bfd_link_split_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
#define som_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
#define som_bfd_relax_section bfd_generic_relax_section
#define som_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define som_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define som_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define som_bfd_link_just_syms _bfd_generic_link_just_syms
#define som_bfd_copy_link_hash_symbol_type \
@@ -6752,7 +6754,7 @@ som_bfd_link_split_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
#define som_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
#define som_find_inliner_info _bfd_nosymbols_find_inliner_info
-const bfd_target som_vec =
+const bfd_target hppa_som_vec =
{
"som", /* Name. */
bfd_target_som_flavour,
diff --git a/binutils-2.25/bfd/som.h b/binutils-2.25/bfd/som.h
index 7a542493..68f60c05 100644
--- a/binutils-2.25/bfd/som.h
+++ b/binutils-2.25/bfd/som.h
@@ -1,6 +1,5 @@
/* HP PA-RISC SOM object file format: definitions internal to BFD.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001,
- 2002, 2003, 2004, 2005, 2007, 2008, 2012, 2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
diff --git a/binutils-2.25/bfd/sparclinux.c b/binutils-2.25/bfd/sparclinux.c
index 7ed255f4..dac3624f 100644
--- a/binutils-2.25/bfd/sparclinux.c
+++ b/binutils-2.25/bfd/sparclinux.c
@@ -1,7 +1,5 @@
/* BFD back-end for linux flavored sparc a.out binaries.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -39,7 +37,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (sparclinux_,OP)
+#define MY(OP) CONCAT2 (sparc_aout_linux_,OP)
#define TARGETNAME "a.out-sparc-linux"
extern const bfd_target MY(vec);
diff --git a/binutils-2.25/bfd/sparclynx.c b/binutils-2.25/bfd/sparclynx.c
index c8a6aa06..2a62c774 100644
--- a/binutils-2.25/bfd/sparclynx.c
+++ b/binutils-2.25/bfd/sparclynx.c
@@ -1,6 +1,5 @@
/* BFD support for Sparc binaries under LynxOS.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000,
- 2001, 2002, 2003, 2005, 2007, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -23,7 +22,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (sparclynx_aout_,OP)
+#define MY(OP) CONCAT2 (sparc_aout_lynx_,OP)
#define TARGETNAME "a.out-sparc-lynx"
#include "sysdep.h"
diff --git a/binutils-2.25/bfd/sparcnetbsd.c b/binutils-2.25/bfd/sparcnetbsd.c
index 0bde25ea..42d94e74 100644
--- a/binutils-2.25/bfd/sparcnetbsd.c
+++ b/binutils-2.25/bfd/sparcnetbsd.c
@@ -1,6 +1,5 @@
/* BFD back-end for NetBSD/sparc a.out-ish binaries.
- Copyright 1990, 1991, 1992, 1994, 1995, 1997, 1998, 2000, 2001, 2003,
- 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -32,7 +31,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (sparcnetbsd_,OP)
+#define MY(OP) CONCAT2 (sparc_aout_nbsd_,OP)
/* This needs to start with a.out so GDB knows it is an a.out variant. */
#define TARGETNAME "a.out-sparc-netbsd"
diff --git a/binutils-2.25/bfd/srec.c b/binutils-2.25/bfd/srec.c
index ded9e76c..5f9a5462 100644
--- a/binutils-2.25/bfd/srec.c
+++ b/binutils-2.25/bfd/srec.c
@@ -1,7 +1,5 @@
/* BFD back-end for s-record objects.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@@ -248,7 +246,7 @@ srec_bad_byte (bfd *abfd,
}
else
{
- char buf[10];
+ char buf[40];
if (! ISPRINT (c))
sprintf (buf, "\\%03o", (unsigned int) c);
@@ -454,8 +452,8 @@ srec_scan (bfd *abfd)
case 'S':
{
file_ptr pos;
- char hdr[3];
- unsigned int bytes;
+ unsigned char hdr[3];
+ unsigned int bytes, min_bytes;
bfd_vma address;
bfd_byte *data;
unsigned char check_sum;
@@ -478,6 +476,19 @@ srec_scan (bfd *abfd)
}
check_sum = bytes = HEX (hdr + 1);
+ min_bytes = 3;
+ if (hdr[0] == '2' || hdr[0] == '8')
+ min_bytes = 4;
+ else if (hdr[0] == '3' || hdr[0] == '7')
+ min_bytes = 5;
+ if (bytes < min_bytes)
+ {
+ (*_bfd_error_handler) (_("%B:%d: byte count %d too small\n"),
+ abfd, lineno, bytes);
+ bfd_set_error (bfd_error_bad_value);
+ goto error_return;
+ }
+
if (bytes * 2 > bufsize)
{
if (buf != NULL)
@@ -1244,6 +1255,7 @@ srec_print_symbol (bfd *abfd,
#define srec_bfd_is_local_label_name bfd_generic_is_local_label_name
#define srec_get_lineno _bfd_nosymbols_get_lineno
#define srec_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define srec_find_line _bfd_nosymbols_find_line
#define srec_find_inliner_info _bfd_nosymbols_find_inliner_info
#define srec_make_empty_symbol _bfd_generic_make_empty_symbol
#define srec_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
@@ -1260,7 +1272,6 @@ srec_print_symbol (bfd *abfd,
#define srec_section_already_linked _bfd_generic_section_already_linked
#define srec_bfd_define_common_symbol bfd_generic_define_common_symbol
#define srec_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define srec_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define srec_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define srec_bfd_link_just_syms _bfd_generic_link_just_syms
#define srec_bfd_copy_link_hash_symbol_type \
diff --git a/binutils-2.25/bfd/stab-syms.c b/binutils-2.25/bfd/stab-syms.c
index 8e65ddc6..74f39f36 100644
--- a/binutils-2.25/bfd/stab-syms.c
+++ b/binutils-2.25/bfd/stab-syms.c
@@ -1,6 +1,5 @@
/* Table of stab names for the BFD library.
- Copyright 1990, 1991, 1992, 1994, 1995, 1996, 2000, 2005, 2007, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/stabs.c b/binutils-2.25/bfd/stabs.c
index 8a1cd87e..e6526c51 100644
--- a/binutils-2.25/bfd/stabs.c
+++ b/binutils-2.25/bfd/stabs.c
@@ -1,6 +1,5 @@
/* Stabs in sections linking support.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -537,7 +536,7 @@ _bfd_discard_section_stabs (bfd *abfd,
link, so we should just ignore them. */
return FALSE;
- /* We should have initialized our data in _bfd_link_stab_sections.
+ /* We should have initialized our data in _bfd_link_section_stabs.
If there was some bizarre error reading the string sections, though,
we might not have. Bail rather than asserting. */
if (psecinfo == NULL)
diff --git a/binutils-2.25/bfd/sunos.c b/binutils-2.25/bfd/sunos.c
index 6d84f43f..27a658eb 100644
--- a/binutils-2.25/bfd/sunos.c
+++ b/binutils-2.25/bfd/sunos.c
@@ -1,7 +1,5 @@
/* BFD backend for SunOS binaries.
- Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -26,7 +24,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (sunos_big_,OP)
+#define MY(OP) CONCAT2 (sparc_aout_sunos_be_,OP)
#include "sysdep.h"
#include "bfd.h"
@@ -1893,7 +1891,7 @@ bfd_sunos_size_dynamic_sections (bfd *output_bfd,
to determine the number of dynamic relocs we need, and, more
importantly, there is no other way to know which symbols should
get an entry in the procedure linkage table. */
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
if ((sub->flags & DYNAMIC) == 0
&& sub->xvec == output_bfd->xvec)
diff --git a/binutils-2.25/bfd/syms.c b/binutils-2.25/bfd/syms.c
index 27b40eb8..a1d1d771 100644
--- a/binutils-2.25/bfd/syms.c
+++ b/binutils-2.25/bfd/syms.c
@@ -1,7 +1,5 @@
/* Generic symbol-table support for the BFD library.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/sysdep.h b/binutils-2.25/bfd/sysdep.h
index d560e767..7e441eb6 100644
--- a/binutils-2.25/bfd/sysdep.h
+++ b/binutils-2.25/bfd/sysdep.h
@@ -1,6 +1,5 @@
/* sysdep.h -- handle host dependencies for the BFD library
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2005, 2007, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -171,6 +170,10 @@ extern int fseeko64 (FILE *stream, off64_t offset, int whence);
#endif
#endif
+#if !HAVE_DECL_STRNLEN
+size_t strnlen (const char *, size_t);
+#endif
+
/* Define offsetof for those systems which lack it */
#ifndef offsetof
diff --git a/binutils-2.25/bfd/targets.c b/binutils-2.25/bfd/targets.c
index b117bfe6..8323e925 100644
--- a/binutils-2.25/bfd/targets.c
+++ b/binutils-2.25/bfd/targets.c
@@ -1,5 +1,5 @@
/* Generic target-file-type support for the BFD library.
- Copyright 1990-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -367,8 +367,7 @@ BFD_JUMP_TABLE macros.
. NAME##_bfd_is_target_special_symbol, \
. NAME##_get_lineno, \
. NAME##_find_nearest_line, \
-. _bfd_generic_find_nearest_line_discriminator, \
-. _bfd_generic_find_line, \
+. NAME##_find_line, \
. NAME##_find_inliner_info, \
. NAME##_bfd_make_debug_symbol, \
. NAME##_read_minisymbols, \
@@ -389,10 +388,7 @@ BFD_JUMP_TABLE macros.
. bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
. alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
. bfd_boolean (*_bfd_find_nearest_line)
-. (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
-. const char **, const char **, unsigned int *);
-. bfd_boolean (*_bfd_find_nearest_line_discriminator)
-. (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
+. (bfd *, struct bfd_symbol **, struct bfd_section *, bfd_vma,
. const char **, const char **, unsigned int *, unsigned int *);
. bfd_boolean (*_bfd_find_line)
. (bfd *, struct bfd_symbol **, struct bfd_symbol *,
@@ -446,7 +442,6 @@ BFD_JUMP_TABLE macros.
. NAME##_bfd_get_relocated_section_contents, \
. NAME##_bfd_relax_section, \
. NAME##_bfd_link_hash_table_create, \
-. NAME##_bfd_link_hash_table_free, \
. NAME##_bfd_link_add_symbols, \
. NAME##_bfd_link_just_syms, \
. NAME##_bfd_copy_link_hash_symbol_type, \
@@ -473,16 +468,14 @@ BFD_JUMP_TABLE macros.
. struct bfd_link_hash_table *
. (*_bfd_link_hash_table_create) (bfd *);
.
-. {* Release the memory associated with the linker hash table. *}
-. void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
-.
. {* Add symbols from this object file into the hash table. *}
. bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
.
. {* Indicate that we are only retrieving symbol values from this section. *}
. void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
.
-. {* Copy the symbol type of a linker hash table entry. *}
+. {* Copy the symbol type and other attributes for a linker script
+. assignment of one symbol to another. *}
.#define bfd_copy_link_hash_symbol_type(b, t, f) \
. BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
. void (*_bfd_copy_link_hash_symbol_type)
@@ -567,357 +560,360 @@ to find an alternative output format that is suitable.
Alphabetized for easy reference.
They are listed a second time below, since
we can't intermix extern's and initializers. */
-extern const bfd_target a_out_adobe_vec;
-extern const bfd_target aix5coff64_vec;
-extern const bfd_target aout0_big_vec;
-extern const bfd_target aout_arm_big_vec;
-extern const bfd_target aout_arm_little_vec;
-extern const bfd_target aout_mips_big_vec;
-extern const bfd_target aout_mips_little_vec;
-extern const bfd_target apollocoff_vec;
-extern const bfd_target arm_epoc_pe_big_vec;
-extern const bfd_target arm_epoc_pe_little_vec;
-extern const bfd_target arm_epoc_pei_big_vec;
-extern const bfd_target arm_epoc_pei_little_vec;
-extern const bfd_target arm_wince_pe_big_vec;
-extern const bfd_target arm_wince_pe_little_vec;
-extern const bfd_target arm_wince_pei_big_vec;
-extern const bfd_target arm_wince_pei_little_vec;
-extern const bfd_target armcoff_big_vec;
-extern const bfd_target armcoff_little_vec;
-extern const bfd_target armnetbsd_vec;
-extern const bfd_target armpe_big_vec;
-extern const bfd_target armpe_little_vec;
-extern const bfd_target armpei_big_vec;
-extern const bfd_target armpei_little_vec;
-extern const bfd_target b_out_vec_big_host;
-extern const bfd_target b_out_vec_little_host;
-extern const bfd_target bfd_pei_ia64_vec;
-extern const bfd_target bfd_elf32_avr_vec;
-extern const bfd_target bfd_elf32_bfin_vec;
-extern const bfd_target bfd_elf32_bfinfdpic_vec;
-extern const bfd_target bfd_elf32_big_generic_vec;
-extern const bfd_target bfd_elf32_bigarc_vec;
-extern const bfd_target bfd_elf32_bigarm_vec;
-extern const bfd_target bfd_elf32_bigarm_nacl_vec;
-extern const bfd_target bfd_elf32_bigarm_symbian_vec;
-extern const bfd_target bfd_elf32_bigarm_vxworks_vec;
-extern const bfd_target bfd_elf32_bigmips_vec;
-extern const bfd_target bfd_elf32_bigmips_vxworks_vec;
-extern const bfd_target bfd_elf32_bigmoxie_vec;
-extern const bfd_target bfd_elf32_bignios2_vec;
-extern const bfd_target bfd_elf32_cr16_vec;
-extern const bfd_target bfd_elf32_cr16c_vec;
-extern const bfd_target bfd_elf32_cris_vec;
-extern const bfd_target bfd_elf32_crx_vec;
-extern const bfd_target bfd_elf32_d10v_vec;
-extern const bfd_target bfd_elf32_d30v_vec;
-extern const bfd_target bfd_elf32_dlx_big_vec;
-extern const bfd_target bfd_elf32_epiphany_vec;
-extern const bfd_target bfd_elf32_fr30_vec;
-extern const bfd_target bfd_elf32_frv_vec;
-extern const bfd_target bfd_elf32_frvfdpic_vec;
-extern const bfd_target bfd_elf32_h8300_vec;
-extern const bfd_target bfd_elf32_hppa_linux_vec;
-extern const bfd_target bfd_elf32_hppa_nbsd_vec;
-extern const bfd_target bfd_elf32_hppa_vec;
-extern const bfd_target bfd_elf32_i370_vec;
-extern const bfd_target bfd_elf32_i386_freebsd_vec;
-extern const bfd_target bfd_elf32_i386_nacl_vec;
-extern const bfd_target bfd_elf32_i386_sol2_vec;
-extern const bfd_target bfd_elf32_i386_vxworks_vec;
-extern const bfd_target bfd_elf32_i386_vec;
-extern const bfd_target bfd_elf32_i860_little_vec;
-extern const bfd_target bfd_elf32_i860_vec;
-extern const bfd_target bfd_elf32_i960_vec;
-extern const bfd_target bfd_elf32_ia64_big_vec;
-extern const bfd_target bfd_elf32_ia64_hpux_big_vec;
-extern const bfd_target bfd_elf32_ip2k_vec;
-extern const bfd_target bfd_elf32_iq2000_vec;
-extern const bfd_target bfd_elf32_lm32_vec;
-extern const bfd_target bfd_elf32_lm32fdpic_vec;
-extern const bfd_target bfd_elf32_little_generic_vec;
-extern const bfd_target bfd_elf32_littlearc_vec;
-extern const bfd_target bfd_elf32_littlearm_vec;
-extern const bfd_target bfd_elf32_littlearm_nacl_vec;
-extern const bfd_target bfd_elf32_littlearm_symbian_vec;
-extern const bfd_target bfd_elf32_littlearm_vxworks_vec;
-extern const bfd_target bfd_elf32_littlemips_vec;
-extern const bfd_target bfd_elf32_littlemips_vxworks_vec;
-extern const bfd_target bfd_elf32_littlemoxie_vec;
-extern const bfd_target bfd_elf32_littlenios2_vec;
-extern const bfd_target bfd_elf32_m32c_vec;
-extern const bfd_target bfd_elf32_m32r_vec;
-extern const bfd_target bfd_elf32_m32rle_vec;
-extern const bfd_target bfd_elf32_m32rlin_vec;
-extern const bfd_target bfd_elf32_m32rlelin_vec;
-extern const bfd_target bfd_elf32_m68hc11_vec;
-extern const bfd_target bfd_elf32_m68hc12_vec;
-extern const bfd_target bfd_elf32_m68k_vec;
-extern const bfd_target bfd_elf32_m88k_vec;
-extern const bfd_target bfd_elf32_mcore_big_vec;
-extern const bfd_target bfd_elf32_mcore_little_vec;
-extern const bfd_target bfd_elf32_mep_vec;
-extern const bfd_target bfd_elf32_mep_little_vec;
-extern const bfd_target bfd_elf32_metag_vec;
-extern const bfd_target bfd_elf32_microblazeel_vec;
-extern const bfd_target bfd_elf32_microblaze_vec;
-extern const bfd_target bfd_elf32_mn10200_vec;
-extern const bfd_target bfd_elf32_mn10300_vec;
-extern const bfd_target bfd_elf32_mt_vec;
-extern const bfd_target bfd_elf32_msp430_vec;
-extern const bfd_target bfd_elf32_msp430_ti_vec;
-extern const bfd_target bfd_elf32_nbigmips_vec;
-extern const bfd_target bfd_elf32_nlittlemips_vec;
-extern const bfd_target bfd_elf32_ntradbigmips_vec;
-extern const bfd_target bfd_elf32_ntradlittlemips_vec;
-extern const bfd_target bfd_elf32_ntradbigmips_freebsd_vec;
-extern const bfd_target bfd_elf32_ntradlittlemips_freebsd_vec;
-extern const bfd_target bfd_elf32_openrisc_vec;
-extern const bfd_target bfd_elf32_or32_big_vec;
-extern const bfd_target bfd_elf32_pj_vec;
-extern const bfd_target bfd_elf32_pjl_vec;
-extern const bfd_target bfd_elf32_powerpc_vec;
-extern const bfd_target bfd_elf32_powerpcle_vec;
-extern const bfd_target bfd_elf32_powerpc_freebsd_vec;
-extern const bfd_target bfd_elf32_powerpc_vxworks_vec;
-extern const bfd_target bfd_elf32_rl78_vec;
-extern const bfd_target bfd_elf32_rx_le_vec;
-extern const bfd_target bfd_elf32_rx_be_vec;
-extern const bfd_target bfd_elf32_rx_be_ns_vec;
-extern const bfd_target bfd_elf32_s390_vec;
-extern const bfd_target bfd_elf32_bigscore_vec;
-extern const bfd_target bfd_elf32_littlescore_vec;
-extern const bfd_target bfd_elf32_sh64_vec;
-extern const bfd_target bfd_elf32_sh64l_vec;
-extern const bfd_target bfd_elf32_sh64lin_vec;
-extern const bfd_target bfd_elf32_sh64blin_vec;
-extern const bfd_target bfd_elf32_sh64lnbsd_vec;
-extern const bfd_target bfd_elf32_sh64nbsd_vec;
-extern const bfd_target bfd_elf32_sh_vec;
-extern const bfd_target bfd_elf32_shbfd_vec;
-extern const bfd_target bfd_elf32_shblin_vec;
-extern const bfd_target bfd_elf32_shfd_vec;
-extern const bfd_target bfd_elf32_shl_vec;
-extern const bfd_target bfd_elf32_shl_symbian_vec;
-extern const bfd_target bfd_elf32_shlin_vec;
-extern const bfd_target bfd_elf32_shlnbsd_vec;
-extern const bfd_target bfd_elf32_shlvxworks_vec;
-extern const bfd_target bfd_elf32_shnbsd_vec;
-extern const bfd_target bfd_elf32_shvxworks_vec;
-extern const bfd_target bfd_elf32_sparc_vec;
-extern const bfd_target bfd_elf32_sparc_sol2_vec;
-extern const bfd_target bfd_elf32_sparc_vxworks_vec;
-extern const bfd_target bfd_elf32_spu_vec;
-extern const bfd_target bfd_elf32_tic6x_be_vec;
-extern const bfd_target bfd_elf32_tic6x_le_vec;
-extern const bfd_target bfd_elf32_tic6x_elf_be_vec;
-extern const bfd_target bfd_elf32_tic6x_elf_le_vec;
-extern const bfd_target bfd_elf32_tic6x_linux_be_vec;
-extern const bfd_target bfd_elf32_tic6x_linux_le_vec;
-extern const bfd_target bfd_elf32_tilegx_be_vec;
-extern const bfd_target bfd_elf32_tilegx_le_vec;
-extern const bfd_target bfd_elf32_tilepro_vec;
-extern const bfd_target bfd_elf32_tradbigmips_vec;
-extern const bfd_target bfd_elf32_tradlittlemips_vec;
-extern const bfd_target bfd_elf32_tradbigmips_freebsd_vec;
-extern const bfd_target bfd_elf32_tradlittlemips_freebsd_vec;
-extern const bfd_target bfd_elf32_us_cris_vec;
-extern const bfd_target bfd_elf32_v850_vec;
-extern const bfd_target bfd_elf32_v850_rh850_vec;
-extern const bfd_target bfd_elf32_vax_vec;
-extern const bfd_target bfd_elf32_xc16x_vec;
-extern const bfd_target bfd_elf32_xgate_vec;
-extern const bfd_target bfd_elf32_xstormy16_vec;
-extern const bfd_target bfd_elf32_xtensa_be_vec;
-extern const bfd_target bfd_elf32_xtensa_le_vec;
-extern const bfd_target bfd_elf64_alpha_freebsd_vec;
-extern const bfd_target bfd_elf64_alpha_vec;
-extern const bfd_target bfd_elf64_big_generic_vec;
-extern const bfd_target bfd_elf64_bigmips_vec;
-extern const bfd_target bfd_elf64_bigaarch64_vec;
-extern const bfd_target bfd_elf32_bigaarch64_vec;
-extern const bfd_target bfd_elf64_hppa_linux_vec;
-extern const bfd_target bfd_elf64_hppa_vec;
-extern const bfd_target bfd_elf64_ia64_big_vec;
-extern const bfd_target bfd_elf64_ia64_hpux_big_vec;
-extern const bfd_target bfd_elf64_ia64_little_vec;
-extern const bfd_target bfd_elf64_ia64_vms_vec;
-extern const bfd_target bfd_elf64_little_generic_vec;
-extern const bfd_target bfd_elf64_littlemips_vec;
-extern const bfd_target bfd_elf64_littleaarch64_vec;
-extern const bfd_target bfd_elf32_littleaarch64_vec;
-extern const bfd_target bfd_elf64_mmix_vec;
-extern const bfd_target bfd_elf64_powerpc_vec;
-extern const bfd_target bfd_elf64_powerpcle_vec;
-extern const bfd_target bfd_elf64_powerpc_freebsd_vec;
-extern const bfd_target bfd_elf64_s390_vec;
-extern const bfd_target bfd_elf64_sh64_vec;
-extern const bfd_target bfd_elf64_sh64l_vec;
-extern const bfd_target bfd_elf64_sh64lin_vec;
-extern const bfd_target bfd_elf64_sh64blin_vec;
-extern const bfd_target bfd_elf64_sh64lnbsd_vec;
-extern const bfd_target bfd_elf64_sh64nbsd_vec;
-extern const bfd_target bfd_elf64_sparc_vec;
-extern const bfd_target bfd_elf64_sparc_freebsd_vec;
-extern const bfd_target bfd_elf64_sparc_sol2_vec;
-extern const bfd_target bfd_elf64_tilegx_be_vec;
-extern const bfd_target bfd_elf64_tilegx_le_vec;
-extern const bfd_target bfd_elf64_tradbigmips_vec;
-extern const bfd_target bfd_elf64_tradlittlemips_vec;
-extern const bfd_target bfd_elf64_tradbigmips_freebsd_vec;
-extern const bfd_target bfd_elf64_tradlittlemips_freebsd_vec;
-extern const bfd_target bfd_elf64_x86_64_freebsd_vec;
-extern const bfd_target bfd_elf64_x86_64_nacl_vec;
-extern const bfd_target bfd_elf64_x86_64_sol2_vec;
-extern const bfd_target bfd_elf64_x86_64_vec;
-extern const bfd_target bfd_elf32_x86_64_nacl_vec;
-extern const bfd_target bfd_elf32_x86_64_vec;
-extern const bfd_target bfd_elf64_l1om_freebsd_vec;
-extern const bfd_target bfd_elf64_l1om_vec;
-extern const bfd_target bfd_elf64_k1om_freebsd_vec;
-extern const bfd_target bfd_elf64_k1om_vec;
-extern const bfd_target bfd_mmo_vec;
-extern const bfd_target bfd_powerpc_pe_vec;
-extern const bfd_target bfd_powerpc_pei_vec;
-extern const bfd_target bfd_powerpcle_pe_vec;
-extern const bfd_target bfd_powerpcle_pei_vec;
+extern const bfd_target aarch64_elf32_be_vec;
+extern const bfd_target aarch64_elf32_le_vec;
+extern const bfd_target aarch64_elf64_be_vec;
+extern const bfd_target aarch64_elf64_le_vec;
+extern const bfd_target alpha_ecoff_le_vec;
+extern const bfd_target alpha_elf64_vec;
+extern const bfd_target alpha_elf64_fbsd_vec;
+extern const bfd_target alpha_nlm32_vec;
+extern const bfd_target alpha_vms_vec;
+extern const bfd_target alpha_vms_lib_txt_vec;
+extern const bfd_target am33_elf32_linux_vec;
+extern const bfd_target aout0_be_vec;
+extern const bfd_target aout64_vec;
+extern const bfd_target aout_vec;
+extern const bfd_target aout_adobe_vec;
+extern const bfd_target arc_elf32_be_vec;
+extern const bfd_target arc_elf32_le_vec;
+extern const bfd_target arm_aout_be_vec;
+extern const bfd_target arm_aout_le_vec;
+extern const bfd_target arm_aout_nbsd_vec;
+extern const bfd_target arm_aout_riscix_vec;
+extern const bfd_target arm_coff_be_vec;
+extern const bfd_target arm_coff_le_vec;
+extern const bfd_target arm_elf32_be_vec;
+extern const bfd_target arm_elf32_le_vec;
+extern const bfd_target arm_elf32_nacl_be_vec;
+extern const bfd_target arm_elf32_nacl_le_vec;
+extern const bfd_target arm_elf32_symbian_be_vec;
+extern const bfd_target arm_elf32_symbian_le_vec;
+extern const bfd_target arm_elf32_vxworks_be_vec;
+extern const bfd_target arm_elf32_vxworks_le_vec;
+extern const bfd_target arm_pe_be_vec;
+extern const bfd_target arm_pe_le_vec;
+extern const bfd_target arm_pe_epoc_be_vec;
+extern const bfd_target arm_pe_epoc_le_vec;
+extern const bfd_target arm_pe_wince_be_vec;
+extern const bfd_target arm_pe_wince_le_vec;
+extern const bfd_target arm_pei_be_vec;
+extern const bfd_target arm_pei_le_vec;
+extern const bfd_target arm_pei_epoc_be_vec;
+extern const bfd_target arm_pei_epoc_le_vec;
+extern const bfd_target arm_pei_wince_be_vec;
+extern const bfd_target arm_pei_wince_le_vec;
+extern const bfd_target avr_elf32_vec;
+extern const bfd_target bfin_elf32_vec;
+extern const bfd_target bfin_elf32_fdpic_vec;
+extern const bfd_target bout_be_vec;
+extern const bfd_target bout_le_vec;
+extern const bfd_target cr16_elf32_vec;
+extern const bfd_target cr16c_elf32_vec;
extern const bfd_target cris_aout_vec;
-extern const bfd_target demo_64_vec;
-extern const bfd_target ecoff_big_vec;
-extern const bfd_target ecoff_biglittle_vec;
-extern const bfd_target ecoff_little_vec;
-extern const bfd_target ecoffalpha_little_vec;
-extern const bfd_target go32coff_vec;
-extern const bfd_target go32stubbedcoff_vec;
-extern const bfd_target h8300coff_vec;
-extern const bfd_target h8500coff_vec;
-extern const bfd_target host_aout_vec;
-extern const bfd_target hp300bsd_vec;
-extern const bfd_target hp300hpux_vec;
-extern const bfd_target i386aout_vec;
-extern const bfd_target i386bsd_vec;
-extern const bfd_target i386coff_vec;
-extern const bfd_target i386dynix_vec;
-extern const bfd_target i386freebsd_vec;
-extern const bfd_target i386linux_vec;
-extern const bfd_target i386lynx_aout_vec;
-extern const bfd_target i386lynx_coff_vec;
-extern const bfd_target i386mach3_vec;
-extern const bfd_target i386msdos_vec;
-extern const bfd_target i386netbsd_vec;
-extern const bfd_target i386os9k_vec;
-extern const bfd_target i386pe_vec;
-extern const bfd_target i386pei_vec;
-extern const bfd_target i860coff_vec;
-extern const bfd_target icoff_big_vec;
-extern const bfd_target icoff_little_vec;
+extern const bfd_target cris_elf32_vec;
+extern const bfd_target cris_elf32_us_vec;
+extern const bfd_target crx_elf32_vec;
+extern const bfd_target d10v_elf32_vec;
+extern const bfd_target d30v_elf32_vec;
+extern const bfd_target dlx_elf32_be_vec;
+extern const bfd_target elf32_be_vec;
+extern const bfd_target elf32_le_vec;
+extern const bfd_target elf64_be_vec;
+extern const bfd_target elf64_le_vec;
+extern const bfd_target epiphany_elf32_vec;
+extern const bfd_target fr30_elf32_vec;
+extern const bfd_target frv_elf32_vec;
+extern const bfd_target frv_elf32_fdpic_vec;
+extern const bfd_target h8300_coff_vec;
+extern const bfd_target h8300_elf32_vec;
+extern const bfd_target h8500_coff_vec;
+extern const bfd_target hppa_elf32_vec;
+extern const bfd_target hppa_elf32_linux_vec;
+extern const bfd_target hppa_elf32_nbsd_vec;
+extern const bfd_target hppa_elf64_vec;
+extern const bfd_target hppa_elf64_linux_vec;
+extern const bfd_target hppa_som_vec;
+extern const bfd_target i370_elf32_vec;
+extern const bfd_target i386_aout_vec;
+extern const bfd_target i386_aout_bsd_vec;
+extern const bfd_target i386_aout_dynix_vec;
+extern const bfd_target i386_aout_fbsd_vec;
+extern const bfd_target i386_aout_linux_vec;
+extern const bfd_target i386_aout_lynx_vec;
+extern const bfd_target i386_aout_mach3_vec;
+extern const bfd_target i386_aout_nbsd_vec;
+extern const bfd_target i386_aout_os9k_vec;
+extern const bfd_target i386_coff_vec;
+extern const bfd_target i386_coff_go32_vec;
+extern const bfd_target i386_coff_go32stubbed_vec;
+extern const bfd_target i386_coff_lynx_vec;
+extern const bfd_target i386_elf32_vec;
+extern const bfd_target i386_elf32_fbsd_vec;
+extern const bfd_target i386_elf32_nacl_vec;
+extern const bfd_target i386_elf32_sol2_vec;
+extern const bfd_target i386_elf32_vxworks_vec;
+extern const bfd_target i386_mach_o_vec;
+extern const bfd_target i386_msdos_vec;
+extern const bfd_target i386_nlm32_vec;
+extern const bfd_target i386_pe_vec;
+extern const bfd_target i386_pei_vec;
+extern const bfd_target i860_coff_vec;
+extern const bfd_target i860_elf32_vec;
+extern const bfd_target i860_elf32_le_vec;
+extern const bfd_target i960_elf32_vec;
+extern const bfd_target ia64_elf32_be_vec;
+extern const bfd_target ia64_elf32_hpux_be_vec;
+extern const bfd_target ia64_elf64_be_vec;
+extern const bfd_target ia64_elf64_le_vec;
+extern const bfd_target ia64_elf64_hpux_be_vec;
+extern const bfd_target ia64_elf64_vms_vec;
+extern const bfd_target ia64_pei_vec;
+extern const bfd_target icoff_be_vec;
+extern const bfd_target icoff_le_vec;
extern const bfd_target ieee_vec;
-extern const bfd_target m68k4knetbsd_vec;
-extern const bfd_target m68kaux_coff_vec;
-extern const bfd_target m68kcoff_vec;
-extern const bfd_target m68kcoffun_vec;
-extern const bfd_target m68klinux_vec;
-extern const bfd_target m68knetbsd_vec;
-extern const bfd_target m68ksysvcoff_vec;
-extern const bfd_target m88kbcs_vec;
-extern const bfd_target m88kmach3_vec;
-extern const bfd_target m88kopenbsd_vec;
+extern const bfd_target ip2k_elf32_vec;
+extern const bfd_target iq2000_elf32_vec;
+extern const bfd_target k1om_elf64_vec;
+extern const bfd_target k1om_elf64_fbsd_vec;
+extern const bfd_target l1om_elf64_vec;
+extern const bfd_target l1om_elf64_fbsd_vec;
+extern const bfd_target lm32_elf32_vec;
+extern const bfd_target lm32_elf32_fdpic_vec;
+extern const bfd_target m32c_elf32_vec;
+extern const bfd_target m32r_elf32_vec;
+extern const bfd_target m32r_elf32_le_vec;
+extern const bfd_target m32r_elf32_linux_vec;
+extern const bfd_target m32r_elf32_linux_le_vec;
+extern const bfd_target m68hc11_elf32_vec;
+extern const bfd_target m68hc12_elf32_vec;
+extern const bfd_target m68k_aout_4knbsd_vec;
+extern const bfd_target m68k_aout_hp300bsd_vec;
+extern const bfd_target m68k_aout_hp300hpux_vec;
+extern const bfd_target m68k_aout_linux_vec;
+extern const bfd_target m68k_aout_nbsd_vec;
+extern const bfd_target m68k_aout_newsos3_vec;
+extern const bfd_target m68k_coff_vec;
+extern const bfd_target m68k_coff_apollo_vec;
+extern const bfd_target m68k_coff_aux_vec;
+extern const bfd_target m68k_coff_sysv_vec;
+extern const bfd_target m68k_coff_un_vec;
+extern const bfd_target m68k_elf32_vec;
+extern const bfd_target m68k_versados_vec;
+extern const bfd_target m88k_aout_mach3_vec;
+extern const bfd_target m88k_aout_obsd_vec;
+extern const bfd_target m88k_coff_bcs_vec;
+extern const bfd_target m88k_elf32_vec;
extern const bfd_target mach_o_be_vec;
extern const bfd_target mach_o_le_vec;
extern const bfd_target mach_o_fat_vec;
-extern const bfd_target mach_o_i386_vec;
-extern const bfd_target mach_o_x86_64_vec;
-extern const bfd_target mcore_pe_big_vec;
-extern const bfd_target mcore_pe_little_vec;
-extern const bfd_target mcore_pei_big_vec;
-extern const bfd_target mcore_pei_little_vec;
-extern const bfd_target mipslpe_vec;
-extern const bfd_target mipslpei_vec;
-extern const bfd_target newsos3_vec;
-extern const bfd_target nlm32_alpha_vec;
-extern const bfd_target nlm32_i386_vec;
-extern const bfd_target nlm32_powerpc_vec;
-extern const bfd_target nlm32_sparc_vec;
+extern const bfd_target mcore_elf32_be_vec;
+extern const bfd_target mcore_elf32_le_vec;
+extern const bfd_target mcore_pe_be_vec;
+extern const bfd_target mcore_pe_le_vec;
+extern const bfd_target mcore_pei_be_vec;
+extern const bfd_target mcore_pei_le_vec;
+extern const bfd_target mep_elf32_vec;
+extern const bfd_target mep_elf32_le_vec;
+extern const bfd_target metag_elf32_vec;
+extern const bfd_target microblaze_elf32_vec;
+extern const bfd_target microblaze_elf32_le_vec;
+extern const bfd_target mips_aout_be_vec;
+extern const bfd_target mips_aout_le_vec;
+extern const bfd_target mips_ecoff_be_vec;
+extern const bfd_target mips_ecoff_le_vec;
+extern const bfd_target mips_ecoff_bele_vec;
+extern const bfd_target mips_elf32_be_vec;
+extern const bfd_target mips_elf32_le_vec;
+extern const bfd_target mips_elf32_n_be_vec;
+extern const bfd_target mips_elf32_n_le_vec;
+extern const bfd_target mips_elf32_ntrad_be_vec;
+extern const bfd_target mips_elf32_ntrad_le_vec;
+extern const bfd_target mips_elf32_ntradfbsd_be_vec;
+extern const bfd_target mips_elf32_ntradfbsd_le_vec;
+extern const bfd_target mips_elf32_trad_be_vec;
+extern const bfd_target mips_elf32_trad_le_vec;
+extern const bfd_target mips_elf32_tradfbsd_be_vec;
+extern const bfd_target mips_elf32_tradfbsd_le_vec;
+extern const bfd_target mips_elf32_vxworks_be_vec;
+extern const bfd_target mips_elf32_vxworks_le_vec;
+extern const bfd_target mips_elf64_be_vec;
+extern const bfd_target mips_elf64_le_vec;
+extern const bfd_target mips_elf64_trad_be_vec;
+extern const bfd_target mips_elf64_trad_le_vec;
+extern const bfd_target mips_elf64_tradfbsd_be_vec;
+extern const bfd_target mips_elf64_tradfbsd_le_vec;
+extern const bfd_target mips_pe_le_vec;
+extern const bfd_target mips_pei_le_vec;
+extern const bfd_target mmix_elf64_vec;
+extern const bfd_target mmix_mmo_vec;
+extern const bfd_target mn10200_elf32_vec;
+extern const bfd_target mn10300_elf32_vec;
+extern const bfd_target moxie_elf32_be_vec;
+extern const bfd_target moxie_elf32_le_vec;
+extern const bfd_target msp430_elf32_vec;
+extern const bfd_target msp430_elf32_ti_vec;
+extern const bfd_target mt_elf32_vec;
+extern const bfd_target nds32_elf32_be_vec;
+extern const bfd_target nds32_elf32_le_vec;
+extern const bfd_target nds32_elf32_linux_be_vec;
+extern const bfd_target nds32_elf32_linux_le_vec;
+extern const bfd_target nios2_elf32_be_vec;
+extern const bfd_target nios2_elf32_le_vec;
+extern const bfd_target ns32k_aout_pc532mach_vec;
+extern const bfd_target ns32k_aout_pc532nbsd_vec;
extern const bfd_target oasys_vec;
-extern const bfd_target or32coff_big_vec;
-extern const bfd_target pc532machaout_vec;
-extern const bfd_target pc532netbsd_vec;
+extern const bfd_target or1k_elf32_vec;
extern const bfd_target pdp11_aout_vec;
extern const bfd_target pef_vec;
extern const bfd_target pef_xlib_vec;
+extern const bfd_target pj_elf32_vec;
+extern const bfd_target pj_elf32_le_vec;
extern const bfd_target plugin_vec;
-extern const bfd_target pmac_xcoff_vec;
-extern const bfd_target ppcboot_vec;
-extern const bfd_target riscix_vec;
-extern const bfd_target rs6000coff64_vec;
-extern const bfd_target rs6000coff_vec;
-extern const bfd_target shcoff_small_vec;
-extern const bfd_target shcoff_vec;
-extern const bfd_target shlcoff_small_vec;
-extern const bfd_target shlcoff_vec;
-extern const bfd_target shlpe_vec;
-extern const bfd_target shlpei_vec;
-extern const bfd_target som_vec;
-extern const bfd_target sparccoff_vec;
-extern const bfd_target sparcle_aout_vec;
-extern const bfd_target sparclinux_vec;
-extern const bfd_target sparclynx_aout_vec;
-extern const bfd_target sparclynx_coff_vec;
-extern const bfd_target sparcnetbsd_vec;
-extern const bfd_target sunos_big_vec;
+extern const bfd_target powerpc_boot_vec;
+extern const bfd_target powerpc_elf32_vec;
+extern const bfd_target powerpc_elf32_le_vec;
+extern const bfd_target powerpc_elf32_fbsd_vec;
+extern const bfd_target powerpc_elf32_vxworks_vec;
+extern const bfd_target powerpc_elf64_vec;
+extern const bfd_target powerpc_elf64_le_vec;
+extern const bfd_target powerpc_elf64_fbsd_vec;
+extern const bfd_target powerpc_nlm32_vec;
+extern const bfd_target powerpc_pe_vec;
+extern const bfd_target powerpc_pe_le_vec;
+extern const bfd_target powerpc_pei_vec;
+extern const bfd_target powerpc_pei_le_vec;
+extern const bfd_target powerpc_xcoff_vec;
+extern const bfd_target rl78_elf32_vec;
+extern const bfd_target rs6000_xcoff64_vec;
+extern const bfd_target rs6000_xcoff64_aix_vec;
+extern const bfd_target rs6000_xcoff_vec;
+extern const bfd_target rx_elf32_be_vec;
+extern const bfd_target rx_elf32_be_ns_vec;
+extern const bfd_target rx_elf32_le_vec;
+extern const bfd_target s390_elf32_vec;
+extern const bfd_target s390_elf64_vec;
+extern const bfd_target score_elf32_be_vec;
+extern const bfd_target score_elf32_le_vec;
+extern const bfd_target sh64_elf32_vec;
+extern const bfd_target sh64_elf32_le_vec;
+extern const bfd_target sh64_elf32_linux_vec;
+extern const bfd_target sh64_elf32_linux_be_vec;
+extern const bfd_target sh64_elf32_nbsd_vec;
+extern const bfd_target sh64_elf32_nbsd_le_vec;
+extern const bfd_target sh64_elf64_vec;
+extern const bfd_target sh64_elf64_le_vec;
+extern const bfd_target sh64_elf64_linux_vec;
+extern const bfd_target sh64_elf64_linux_be_vec;
+extern const bfd_target sh64_elf64_nbsd_vec;
+extern const bfd_target sh64_elf64_nbsd_le_vec;
+extern const bfd_target sh_coff_vec;
+extern const bfd_target sh_coff_le_vec;
+extern const bfd_target sh_coff_small_vec;
+extern const bfd_target sh_coff_small_le_vec;
+extern const bfd_target sh_elf32_vec;
+extern const bfd_target sh_elf32_le_vec;
+extern const bfd_target sh_elf32_fdpic_be_vec;
+extern const bfd_target sh_elf32_fdpic_le_vec;
+extern const bfd_target sh_elf32_linux_vec;
+extern const bfd_target sh_elf32_linux_be_vec;
+extern const bfd_target sh_elf32_nbsd_vec;
+extern const bfd_target sh_elf32_nbsd_le_vec;
+extern const bfd_target sh_elf32_symbian_le_vec;
+extern const bfd_target sh_elf32_vxworks_vec;
+extern const bfd_target sh_elf32_vxworks_le_vec;
+extern const bfd_target sh_pe_le_vec;
+extern const bfd_target sh_pei_le_vec;
+extern const bfd_target sparc_aout_le_vec;
+extern const bfd_target sparc_aout_linux_vec;
+extern const bfd_target sparc_aout_lynx_vec;
+extern const bfd_target sparc_aout_nbsd_vec;
+extern const bfd_target sparc_aout_sunos_be_vec;
+extern const bfd_target sparc_coff_vec;
+extern const bfd_target sparc_coff_lynx_vec;
+extern const bfd_target sparc_elf32_vec;
+extern const bfd_target sparc_elf32_sol2_vec;
+extern const bfd_target sparc_elf32_vxworks_vec;
+extern const bfd_target sparc_elf64_vec;
+extern const bfd_target sparc_elf64_fbsd_vec;
+extern const bfd_target sparc_elf64_sol2_vec;
+extern const bfd_target sparc_nlm32_vec;
+extern const bfd_target spu_elf32_vec;
extern const bfd_target sym_vec;
extern const bfd_target tic30_aout_vec;
extern const bfd_target tic30_coff_vec;
-extern const bfd_target tic4x_coff0_beh_vec;
extern const bfd_target tic4x_coff0_vec;
-extern const bfd_target tic4x_coff1_beh_vec;
+extern const bfd_target tic4x_coff0_beh_vec;
extern const bfd_target tic4x_coff1_vec;
-extern const bfd_target tic4x_coff2_beh_vec;
+extern const bfd_target tic4x_coff1_beh_vec;
extern const bfd_target tic4x_coff2_vec;
-extern const bfd_target tic54x_coff0_beh_vec;
+extern const bfd_target tic4x_coff2_beh_vec;
extern const bfd_target tic54x_coff0_vec;
-extern const bfd_target tic54x_coff1_beh_vec;
+extern const bfd_target tic54x_coff0_beh_vec;
extern const bfd_target tic54x_coff1_vec;
-extern const bfd_target tic54x_coff2_beh_vec;
+extern const bfd_target tic54x_coff1_beh_vec;
extern const bfd_target tic54x_coff2_vec;
-extern const bfd_target tic80coff_vec;
-extern const bfd_target vaxbsd_vec;
-extern const bfd_target vaxnetbsd_vec;
-extern const bfd_target vax1knetbsd_vec;
-extern const bfd_target versados_vec;
-extern const bfd_target vms_alpha_vec;
-extern const bfd_target vms_lib_txt_vec;
-extern const bfd_target w65_vec;
-extern const bfd_target we32kcoff_vec;
-extern const bfd_target x86_64pe_vec;
-extern const bfd_target x86_64pei_vec;
-extern const bfd_target x86_64coff_vec;
-extern const bfd_target z80coff_vec;
-extern const bfd_target z8kcoff_vec;
+extern const bfd_target tic54x_coff2_beh_vec;
+extern const bfd_target tic6x_elf32_be_vec;
+extern const bfd_target tic6x_elf32_le_vec;
+extern const bfd_target tic6x_elf32_c6000_be_vec;
+extern const bfd_target tic6x_elf32_c6000_le_vec;
+extern const bfd_target tic6x_elf32_linux_be_vec;
+extern const bfd_target tic6x_elf32_linux_le_vec;
+extern const bfd_target tic80_coff_vec;
+extern const bfd_target tilegx_elf32_be_vec;
+extern const bfd_target tilegx_elf32_le_vec;
+extern const bfd_target tilegx_elf64_be_vec;
+extern const bfd_target tilegx_elf64_le_vec;
+extern const bfd_target tilepro_elf32_vec;
+extern const bfd_target v800_elf32_vec;
+extern const bfd_target v850_elf32_vec;
+extern const bfd_target vax_aout_1knbsd_vec;
+extern const bfd_target vax_aout_bsd_vec;
+extern const bfd_target vax_aout_nbsd_vec;
+extern const bfd_target vax_elf32_vec;
+extern const bfd_target w65_coff_vec;
+extern const bfd_target we32k_coff_vec;
+extern const bfd_target x86_64_coff_vec;
+extern const bfd_target x86_64_elf32_vec;
+extern const bfd_target x86_64_elf32_nacl_vec;
+extern const bfd_target x86_64_elf64_vec;
+extern const bfd_target x86_64_elf64_fbsd_vec;
+extern const bfd_target x86_64_elf64_nacl_vec;
+extern const bfd_target x86_64_elf64_sol2_vec;
+extern const bfd_target x86_64_mach_o_vec;
+extern const bfd_target x86_64_pe_vec;
+extern const bfd_target x86_64_pe_be_vec;
+extern const bfd_target x86_64_pei_vec;
+extern const bfd_target xc16x_elf32_vec;
+extern const bfd_target xgate_elf32_vec;
+extern const bfd_target xstormy16_elf32_vec;
+extern const bfd_target xtensa_elf32_be_vec;
+extern const bfd_target xtensa_elf32_le_vec;
+extern const bfd_target z80_coff_vec;
+extern const bfd_target z8k_coff_vec;
/* These are always included. */
extern const bfd_target srec_vec;
-extern const bfd_target verilog_vec;
extern const bfd_target symbolsrec_vec;
+extern const bfd_target verilog_vec;
extern const bfd_target tekhex_vec;
extern const bfd_target binary_vec;
extern const bfd_target ihex_vec;
/* All of the xvecs for core files. */
-extern const bfd_target aix386_core_vec;
-extern const bfd_target cisco_core_big_vec;
-extern const bfd_target cisco_core_little_vec;
-extern const bfd_target hppabsd_core_vec;
-extern const bfd_target hpux_core_vec;
-extern const bfd_target irix_core_vec;
-extern const bfd_target netbsd_core_vec;
-extern const bfd_target osf_core_vec;
-extern const bfd_target ptrace_core_vec;
-extern const bfd_target sco5_core_vec;
-extern const bfd_target trad_core_vec;
-
-extern const bfd_target bfd_elf32_am33lin_vec;
+extern const bfd_target core_aix386_vec;
+extern const bfd_target core_cisco_be_vec;
+extern const bfd_target core_cisco_le_vec;
+extern const bfd_target core_hppabsd_vec;
+extern const bfd_target core_hpux_vec;
+extern const bfd_target core_irix_vec;
+extern const bfd_target core_netbsd_vec;
+extern const bfd_target core_osf_vec;
+extern const bfd_target core_ptrace_vec;
+extern const bfd_target core_sco5_vec;
+extern const bfd_target core_trad_vec;
+
static const bfd_target * const _bfd_target_vector[] =
{
#ifdef SELECT_VECS
@@ -931,339 +927,314 @@ static const bfd_target * const _bfd_target_vector[] =
#endif
/* This list is alphabetized to make it easy to compare
with other vector lists -- the decls above and
- the case statement in configure.in.
+ the case statement in configure.ac.
+ Try to keep it in order when adding new targets, and
+ use a name of the form <cpu>_<format>_<other>_<endian>_vec.
+ Note that sorting is done as if _<endian>_vec wasn't present.
Vectors that don't compile on all systems, or aren't finished,
should have an entry here with #if 0 around it, to show that
it wasn't omitted by mistake. */
- &a_out_adobe_vec,
#ifdef BFD64
- &aix5coff64_vec,
-#endif
- &aout0_big_vec,
-#if 0
- /* We have no way of distinguishing these from other a.out variants. */
- &aout_arm_big_vec,
- &aout_arm_little_vec,
- /* No one seems to use this. */
- &aout_mips_big_vec,
+ &aarch64_elf32_be_vec,
+ &aarch64_elf32_le_vec,
+ &aarch64_elf64_be_vec,
+ &aarch64_elf64_le_vec,
#endif
- &aout_mips_little_vec,
-#if 0
- &apollocoff_vec,
-#endif
- &arm_epoc_pe_big_vec,
- &arm_epoc_pe_little_vec,
- &arm_epoc_pei_big_vec,
- &arm_epoc_pei_little_vec,
- &arm_wince_pe_big_vec,
- &arm_wince_pe_little_vec,
- &arm_wince_pei_big_vec,
- &arm_wince_pei_little_vec,
- &armcoff_big_vec,
- &armcoff_little_vec,
- &armnetbsd_vec,
- &armpe_big_vec,
- &armpe_little_vec,
- &armpei_big_vec,
- &armpei_little_vec,
- &b_out_vec_big_host,
- &b_out_vec_little_host,
+
#ifdef BFD64
- &bfd_pei_ia64_vec,
+ &alpha_ecoff_le_vec,
+ &alpha_elf64_vec,
+ &alpha_elf64_fbsd_vec,
+ &alpha_nlm32_vec,
+ &alpha_vms_vec,
#endif
- &bfd_elf32_avr_vec,
- &bfd_elf32_bfin_vec,
- &bfd_elf32_bfinfdpic_vec,
+ &alpha_vms_lib_txt_vec,
- /* This, and other vectors, may not be used in any *.mt configuration.
- But that does not mean they are unnecessary. If configured with
- --enable-targets=all, objdump or gdb should be able to examine
- the file even if we don't recognize the machine type. */
- &bfd_elf32_big_generic_vec,
- &bfd_elf32_bigarc_vec,
- &bfd_elf32_bigarm_vec,
- &bfd_elf32_bigarm_symbian_vec,
- &bfd_elf32_bigarm_vxworks_vec,
+ &am33_elf32_linux_vec,
+
+ &aout0_be_vec,
#ifdef BFD64
- &bfd_elf32_bigmips_vec,
- &bfd_elf32_bigmips_vxworks_vec,
+ &aout64_vec, /* Only compiled if host has long-long support. */
#endif
- &bfd_elf32_bigmoxie_vec,
- &bfd_elf32_bignios2_vec,
- &bfd_elf32_cr16_vec,
- &bfd_elf32_cr16c_vec,
- &bfd_elf32_cris_vec,
- &bfd_elf32_crx_vec,
- &bfd_elf32_d10v_vec,
- &bfd_elf32_d30v_vec,
- &bfd_elf32_dlx_big_vec,
- &bfd_elf32_epiphany_vec,
- &bfd_elf32_fr30_vec,
- &bfd_elf32_frv_vec,
- &bfd_elf32_frvfdpic_vec,
- &bfd_elf32_h8300_vec,
- &bfd_elf32_hppa_linux_vec,
- &bfd_elf32_hppa_nbsd_vec,
- &bfd_elf32_hppa_vec,
- &bfd_elf32_i370_vec,
- &bfd_elf32_i386_freebsd_vec,
- &bfd_elf32_i386_nacl_vec,
- &bfd_elf32_i386_sol2_vec,
- &bfd_elf32_i386_vxworks_vec,
- &bfd_elf32_i386_vec,
- &bfd_elf32_i860_little_vec,
- &bfd_elf32_i860_vec,
- &bfd_elf32_i960_vec,
#if 0
- &bfd_elf32_ia64_big_vec,
-#endif
-#ifdef BFD64
- &bfd_elf32_ia64_hpux_big_vec,
-#endif
- &bfd_elf32_ip2k_vec,
- &bfd_elf32_iq2000_vec,
- &bfd_elf32_lm32_vec,
- &bfd_elf32_little_generic_vec,
- &bfd_elf32_littlearc_vec,
- &bfd_elf32_littlearm_vec,
- &bfd_elf32_littlearm_symbian_vec,
- &bfd_elf32_littlearm_vxworks_vec,
-#ifdef BFD64
- &bfd_elf32_littlemips_vec,
- &bfd_elf32_littlemips_vxworks_vec,
-#endif
- &bfd_elf32_littlemoxie_vec,
- &bfd_elf32_littlenios2_vec,
- &bfd_elf32_m32c_vec,
- &bfd_elf32_m32r_vec,
- &bfd_elf32_m32rle_vec,
- &bfd_elf32_m32rlin_vec,
- &bfd_elf32_m32rlelin_vec,
- &bfd_elf32_m68hc11_vec,
- &bfd_elf32_m68hc12_vec,
- &bfd_elf32_m68k_vec,
- &bfd_elf32_m88k_vec,
- &bfd_elf32_mcore_big_vec,
- &bfd_elf32_mcore_little_vec,
- &bfd_elf32_mep_vec,
- &bfd_elf32_metag_vec,
- &bfd_elf32_microblaze_vec,
- &bfd_elf32_mn10200_vec,
- &bfd_elf32_mn10300_vec,
- &bfd_elf32_mt_vec,
- &bfd_elf32_msp430_vec,
- &bfd_elf32_msp430_ti_vec,
-#ifdef BFD64
- &bfd_elf32_nbigmips_vec,
- &bfd_elf32_nlittlemips_vec,
- &bfd_elf32_ntradbigmips_vec,
- &bfd_elf32_ntradlittlemips_vec,
- &bfd_elf32_ntradbigmips_freebsd_vec,
- &bfd_elf32_ntradlittlemips_freebsd_vec,
-#endif
- &bfd_elf32_openrisc_vec,
- &bfd_elf32_or32_big_vec,
- &bfd_elf32_pj_vec,
- &bfd_elf32_pjl_vec,
- &bfd_elf32_powerpc_vec,
- &bfd_elf32_powerpc_vxworks_vec,
- &bfd_elf32_powerpcle_vec,
- &bfd_elf32_powerpc_freebsd_vec,
- &bfd_elf32_rl78_vec,
- &bfd_elf32_rx_be_vec,
- &bfd_elf32_rx_be_ns_vec,
- &bfd_elf32_rx_le_vec,
- &bfd_elf32_s390_vec,
-#ifdef BFD64
- &bfd_elf32_bigscore_vec,
- &bfd_elf32_littlescore_vec,
-#endif
- &bfd_elf32_sh_vec,
- &bfd_elf32_shbfd_vec,
- &bfd_elf32_shblin_vec,
- &bfd_elf32_shfd_vec,
- &bfd_elf32_shl_vec,
- &bfd_elf32_shl_symbian_vec,
- &bfd_elf32_shlin_vec,
- &bfd_elf32_shlnbsd_vec,
- &bfd_elf32_shlvxworks_vec,
- &bfd_elf32_shnbsd_vec,
- &bfd_elf32_shvxworks_vec,
-#ifdef BFD64
- &bfd_elf32_sh64_vec,
- &bfd_elf32_sh64l_vec,
- &bfd_elf32_sh64lnbsd_vec,
- &bfd_elf32_sh64nbsd_vec,
- &bfd_elf32_sh64lin_vec,
- &bfd_elf32_sh64blin_vec,
+ /* Since a.out files lack decent magic numbers, no way to recognize
+ which kind of a.out file it is. */
+ &aout_vec,
#endif
- &bfd_elf32_sparc_vec,
- &bfd_elf32_sparc_sol2_vec,
- &bfd_elf32_sparc_vxworks_vec,
- &bfd_elf32_spu_vec,
- &bfd_elf32_tic6x_be_vec,
- &bfd_elf32_tic6x_le_vec,
- &bfd_elf32_tilegx_be_vec,
- &bfd_elf32_tilegx_le_vec,
- &bfd_elf32_tilepro_vec,
-#ifdef BFD64
- &bfd_elf32_tradbigmips_vec,
- &bfd_elf32_tradlittlemips_vec,
- &bfd_elf32_tradbigmips_freebsd_vec,
- &bfd_elf32_tradlittlemips_freebsd_vec,
+ &aout_adobe_vec,
+
+ &arc_elf32_be_vec,
+ &arc_elf32_le_vec,
+
+#if 0
+ /* We have no way of distinguishing these from other a.out variants. */
+ &arm_aout_be_vec,
+ &arm_aout_le_vec,
#endif
- &bfd_elf32_us_cris_vec,
- &bfd_elf32_v850_vec,
- &bfd_elf32_v850_rh850_vec,
- &bfd_elf32_vax_vec,
- &bfd_elf32_xc16x_vec,
- &bfd_elf32_xgate_vec,
- &bfd_elf32_xstormy16_vec,
- &bfd_elf32_xtensa_be_vec,
- &bfd_elf32_xtensa_le_vec,
-#ifdef BFD64
- &bfd_elf64_alpha_freebsd_vec,
- &bfd_elf64_alpha_vec,
- &bfd_elf64_big_generic_vec,
- &bfd_elf64_bigmips_vec,
- &bfd_elf64_bigaarch64_vec,
- &bfd_elf32_bigaarch64_vec,
- &bfd_elf64_hppa_linux_vec,
- &bfd_elf64_hppa_vec,
- &bfd_elf64_ia64_big_vec,
- &bfd_elf64_ia64_hpux_big_vec,
- &bfd_elf64_ia64_little_vec,
- &bfd_elf64_ia64_vms_vec,
- &bfd_elf64_little_generic_vec,
- &bfd_elf64_littlemips_vec,
- &bfd_elf64_littleaarch64_vec,
- &bfd_elf32_littleaarch64_vec,
- &bfd_elf64_mmix_vec,
- &bfd_elf64_powerpc_vec,
- &bfd_elf64_powerpcle_vec,
- &bfd_elf64_powerpc_freebsd_vec,
- &bfd_elf64_s390_vec,
- &bfd_elf64_sh64_vec,
- &bfd_elf64_sh64l_vec,
- &bfd_elf64_sh64lnbsd_vec,
- &bfd_elf64_sh64nbsd_vec,
- &bfd_elf64_sh64lin_vec,
- &bfd_elf64_sh64blin_vec,
- &bfd_elf64_sparc_vec,
- &bfd_elf64_sparc_freebsd_vec,
- &bfd_elf64_sparc_sol2_vec,
- &bfd_elf64_tilegx_be_vec,
- &bfd_elf64_tilegx_le_vec,
- &bfd_elf64_tradbigmips_vec,
- &bfd_elf64_tradlittlemips_vec,
- &bfd_elf64_tradbigmips_freebsd_vec,
- &bfd_elf64_tradlittlemips_freebsd_vec,
- &bfd_elf64_x86_64_freebsd_vec,
- &bfd_elf64_x86_64_nacl_vec,
- &bfd_elf64_x86_64_sol2_vec,
- &bfd_elf64_x86_64_vec,
- &bfd_elf32_x86_64_nacl_vec,
- &bfd_elf32_x86_64_vec,
- &bfd_elf64_l1om_freebsd_vec,
- &bfd_elf64_l1om_vec,
- &bfd_elf64_k1om_freebsd_vec,
- &bfd_elf64_k1om_vec,
- &bfd_mmo_vec,
+ &arm_aout_nbsd_vec,
+#if 0
+ /* We have no way of distinguishing these from other a.out variants. */
+ &arm_aout_riscix_vec,
#endif
- &bfd_powerpc_pe_vec,
- &bfd_powerpc_pei_vec,
- &bfd_powerpcle_pe_vec,
- &bfd_powerpcle_pei_vec,
+ &arm_coff_be_vec,
+ &arm_coff_le_vec,
+ &arm_elf32_be_vec,
+ &arm_elf32_le_vec,
+ &arm_elf32_symbian_be_vec,
+ &arm_elf32_symbian_le_vec,
+ &arm_elf32_vxworks_be_vec,
+ &arm_elf32_vxworks_le_vec,
+ &arm_pe_be_vec,
+ &arm_pe_le_vec,
+ &arm_pe_epoc_be_vec,
+ &arm_pe_epoc_le_vec,
+ &arm_pe_wince_be_vec,
+ &arm_pe_wince_le_vec,
+ &arm_pei_be_vec,
+ &arm_pei_le_vec,
+ &arm_pei_epoc_be_vec,
+ &arm_pei_epoc_le_vec,
+ &arm_pei_wince_be_vec,
+ &arm_pei_wince_le_vec,
+
+ &avr_elf32_vec,
+
+ &bfin_elf32_vec,
+ &bfin_elf32_fdpic_vec,
+
+ &bout_be_vec,
+ &bout_le_vec,
+
+ &cr16_elf32_vec,
+ &cr16c_elf32_vec,
+
&cris_aout_vec,
+ &cris_elf32_vec,
+ &cris_elf32_us_vec,
+
+ &crx_elf32_vec,
+
+ &d10v_elf32_vec,
+ &d30v_elf32_vec,
+
+ &dlx_elf32_be_vec,
+
+ /* This, and other vectors, may not be used in any *.mt configuration.
+ But that does not mean they are unnecessary. If configured with
+ --enable-targets=all, objdump or gdb should be able to examine
+ the file even if we don't recognize the machine type. */
+ &elf32_be_vec,
+ &elf32_le_vec,
#ifdef BFD64
- &demo_64_vec, /* Only compiled if host has long-long support. */
+ &elf64_be_vec,
+ &elf64_le_vec,
#endif
- &ecoff_big_vec,
- &ecoff_biglittle_vec,
- &ecoff_little_vec,
+
+ &epiphany_elf32_vec,
+
+ &fr30_elf32_vec,
+
+ &frv_elf32_vec,
+ &frv_elf32_fdpic_vec,
+
+ &h8300_coff_vec,
+ &h8300_elf32_vec,
+ &h8500_coff_vec,
+
+ &hppa_elf32_vec,
+ &hppa_elf32_linux_vec,
+ &hppa_elf32_nbsd_vec,
#ifdef BFD64
- &ecoffalpha_little_vec,
+ &hppa_elf64_vec,
+ &hppa_elf64_linux_vec,
#endif
- &go32coff_vec,
- &go32stubbedcoff_vec,
- &h8300coff_vec,
- &h8500coff_vec,
-#if 0
- /* Since a.out files lack decent magic numbers, no way to recognize
- which kind of a.out file it is. */
- &host_aout_vec,
- /* Clashes with sunos_big_vec magic no. */
- &hp300bsd_vec,
-#endif
- &hp300hpux_vec,
- &i386aout_vec,
- &i386bsd_vec,
- &i386coff_vec,
+ &hppa_som_vec,
+
+ &i370_elf32_vec,
+
+ &i386_aout_vec,
+ &i386_aout_bsd_vec,
#if 0
- &i386dynix_vec,
+ &i386_aout_dynix_vec,
#endif
- &i386freebsd_vec,
+ &i386_aout_fbsd_vec,
#if 0
/* Since a.out files lack decent magic numbers, no way to recognize
which kind of a.out file it is. */
- &i386linux_vec,
+ &i386_aout_linux_vec,
#endif
- &i386lynx_aout_vec,
- &i386lynx_coff_vec,
+ &i386_aout_lynx_vec,
#if 0
/* No distinguishing features for Mach 3 executables. */
- &i386mach3_vec,
+ &i386_aout_mach3_vec,
#endif
- &i386msdos_vec,
- &i386netbsd_vec,
- &i386os9k_vec,
- &i386pe_vec,
- &i386pei_vec,
+ &i386_aout_nbsd_vec,
+ &i386_aout_os9k_vec,
+ &i386_coff_vec,
+ &i386_coff_go32_vec,
+ &i386_coff_go32stubbed_vec,
+ &i386_coff_lynx_vec,
+ &i386_elf32_vec,
+ &i386_elf32_fbsd_vec,
+ &i386_elf32_nacl_vec,
+ &i386_elf32_sol2_vec,
+ &i386_elf32_vxworks_vec,
+ &i386_mach_o_vec,
+ &i386_msdos_vec,
+ &i386_nlm32_vec,
+ &i386_pe_vec,
+ &i386_pei_vec,
+
+ &i860_coff_vec,
+ &i860_elf32_vec,
+ &i860_elf32_le_vec,
+
+ &i960_elf32_vec,
+
#ifdef BFD64
- &x86_64coff_vec,
- &x86_64pe_vec,
- &x86_64pei_vec,
+#if 0
+ &ia64_elf32_be_vec,
+#endif
+ &ia64_elf32_hpux_be_vec,
+ &ia64_elf64_be_vec,
+ &ia64_elf64_le_vec,
+ &ia64_elf64_hpux_be_vec,
+ &ia64_elf64_vms_vec,
+ &ia64_pei_vec,
#endif
- &i860coff_vec,
- &icoff_big_vec,
- &icoff_little_vec,
+
+ &icoff_be_vec,
+ &icoff_le_vec,
+
&ieee_vec,
+
+ &ip2k_elf32_vec,
+ &iq2000_elf32_vec,
+
+#ifdef BFD64
+ &k1om_elf64_vec,
+ &k1om_elf64_fbsd_vec,
+ &l1om_elf64_vec,
+ &l1om_elf64_fbsd_vec,
+#endif
+
+ &lm32_elf32_vec,
+
+ &m32c_elf32_vec,
+
+ &m32r_elf32_vec,
+ &m32r_elf32_le_vec,
+ &m32r_elf32_linux_vec,
+ &m32r_elf32_linux_le_vec,
+
+ &m68hc11_elf32_vec,
+ &m68hc12_elf32_vec,
+
#if 0
- &m68k4knetbsd_vec,
- &m68kaux_coff_vec,
+ &m68k_aout_4knbsd_vec,
+ /* Clashes with sparc_aout_sunos_be_vec magic no. */
+ &m68k_aout_hp300bsd_vec,
#endif
- &m68kcoff_vec,
- &m68kcoffun_vec,
+ &m68k_aout_hp300hpux_vec,
#if 0
/* Since a.out files lack decent magic numbers, no way to recognize
which kind of a.out file it is. */
- &m68klinux_vec,
+ &m68k_aout_linux_vec,
#endif
- &m68knetbsd_vec,
- &m68ksysvcoff_vec,
- &m88kbcs_vec,
- &m88kmach3_vec,
- &m88kopenbsd_vec,
+ &m68k_aout_nbsd_vec,
+ &m68k_aout_newsos3_vec,
+ &m68k_coff_vec,
+#if 0
+ &m68k_coff_apollo_vec,
+ &m68k_coff_aux_vec,
+#endif
+ &m68k_coff_sysv_vec,
+ &m68k_coff_un_vec,
+ &m68k_elf32_vec,
+ &m68k_versados_vec,
+
+ &m88k_aout_mach3_vec,
+ &m88k_aout_obsd_vec,
+ &m88k_coff_bcs_vec,
+ &m88k_elf32_vec,
+
&mach_o_be_vec,
&mach_o_le_vec,
&mach_o_fat_vec,
- &mach_o_i386_vec,
+
+ &mcore_elf32_be_vec,
+ &mcore_elf32_le_vec,
+ &mcore_pe_be_vec,
+ &mcore_pe_le_vec,
+ &mcore_pei_be_vec,
+ &mcore_pei_le_vec,
+
+ &mep_elf32_vec,
+
+ &metag_elf32_vec,
+
+ &microblaze_elf32_vec,
+
+#if 0
+ /* No one seems to use this. */
+ &mips_aout_be_vec,
+#endif
+ &mips_aout_le_vec,
+ &mips_ecoff_be_vec,
+ &mips_ecoff_le_vec,
+ &mips_ecoff_bele_vec,
#ifdef BFD64
- &mach_o_x86_64_vec,
+ &mips_elf32_be_vec,
+ &mips_elf32_le_vec,
+ &mips_elf32_n_be_vec,
+ &mips_elf32_n_le_vec,
+ &mips_elf32_ntrad_be_vec,
+ &mips_elf32_ntrad_le_vec,
+ &mips_elf32_ntradfbsd_be_vec,
+ &mips_elf32_ntradfbsd_le_vec,
+ &mips_elf32_trad_be_vec,
+ &mips_elf32_trad_le_vec,
+ &mips_elf32_tradfbsd_be_vec,
+ &mips_elf32_tradfbsd_le_vec,
+ &mips_elf32_vxworks_be_vec,
+ &mips_elf32_vxworks_le_vec,
+ &mips_elf64_be_vec,
+ &mips_elf64_le_vec,
+ &mips_elf64_trad_be_vec,
+ &mips_elf64_trad_le_vec,
+ &mips_elf64_tradfbsd_be_vec,
+ &mips_elf64_tradfbsd_le_vec,
#endif
- &mcore_pe_big_vec,
- &mcore_pe_little_vec,
- &mcore_pei_big_vec,
- &mcore_pei_little_vec,
- &mipslpe_vec,
- &mipslpei_vec,
- &newsos3_vec,
+ &mips_pe_le_vec,
+ &mips_pei_le_vec,
+
#ifdef BFD64
- &nlm32_alpha_vec,
+ &mmix_elf64_vec,
+ &mmix_mmo_vec,
#endif
- &nlm32_i386_vec,
- &nlm32_powerpc_vec,
- &nlm32_sparc_vec,
+
+ &mn10200_elf32_vec,
+ &mn10300_elf32_vec,
+
+ &moxie_elf32_be_vec,
+ &moxie_elf32_le_vec,
+
+ &msp430_elf32_vec,
+ &msp430_elf32_ti_vec,
+
+ &mt_elf32_vec,
+
+ &nds32_elf32_be_vec,
+ &nds32_elf32_le_vec,
+ &nds32_elf32_linux_be_vec,
+ &nds32_elf32_linux_le_vec,
+
+ &nios2_elf32_be_vec,
+ &nios2_elf32_le_vec,
+
+ &ns32k_aout_pc532mach_vec,
+ &ns32k_aout_pc532nbsd_vec,
+
#if 0
/* We have no oasys tools anymore, so we can't test any of this
anymore. If you want to test the stuff yourself, go ahead...
@@ -1272,45 +1243,116 @@ static const bfd_target * const _bfd_target_vector[] =
can be annoying target mis-matches. */
&oasys_vec,
#endif
- /* Entry for the OpenRISC family. */
- &or32coff_big_vec,
- &pc532machaout_vec,
- &pc532netbsd_vec,
+ &or1k_elf32_vec,
+
&pdp11_aout_vec,
+
&pef_vec,
&pef_xlib_vec,
+
+ &pj_elf32_vec,
+ &pj_elf32_le_vec,
+
#if BFD_SUPPORTS_PLUGINS
&plugin_vec,
#endif
+
+ &powerpc_boot_vec,
+ &powerpc_elf32_vec,
+ &powerpc_elf32_le_vec,
+ &powerpc_elf32_fbsd_vec,
+ &powerpc_elf32_vxworks_vec,
+#ifdef BFD64
+ &powerpc_elf64_vec,
+ &powerpc_elf64_le_vec,
+ &powerpc_elf64_fbsd_vec,
+#endif
+ &powerpc_nlm32_vec,
+ &powerpc_pe_vec,
+ &powerpc_pe_le_vec,
+ &powerpc_pei_vec,
+ &powerpc_pei_le_vec,
#if 0
/* This has the same magic number as RS/6000. */
- &pmac_xcoff_vec,
+ &powerpc_xcoff_vec,
#endif
- &ppcboot_vec,
-#if 0
- /* We have no way of distinguishing these from other a.out variants. */
- &riscix_vec,
+
+ &rl78_elf32_vec,
+
+#ifdef BFD64
+ &rs6000_xcoff64_vec,
+ &rs6000_xcoff64_aix_vec,
+#endif
+ &rs6000_xcoff_vec,
+
+ &rx_elf32_be_vec,
+ &rx_elf32_be_ns_vec,
+ &rx_elf32_le_vec,
+
+ &s390_elf32_vec,
+#ifdef BFD64
+ &s390_elf64_vec,
+#endif
+
+#ifdef BFD64
+ &score_elf32_be_vec,
+ &score_elf32_le_vec,
+#endif
+
+#ifdef BFD64
+ &sh64_elf32_vec,
+ &sh64_elf32_le_vec,
+ &sh64_elf32_linux_vec,
+ &sh64_elf32_linux_be_vec,
+ &sh64_elf32_nbsd_vec,
+ &sh64_elf32_nbsd_le_vec,
+ &sh64_elf64_vec,
+ &sh64_elf64_le_vec,
+ &sh64_elf64_linux_vec,
+ &sh64_elf64_linux_be_vec,
+ &sh64_elf64_nbsd_vec,
+ &sh64_elf64_nbsd_le_vec,
#endif
+ &sh_coff_vec,
+ &sh_coff_le_vec,
+ &sh_coff_small_vec,
+ &sh_coff_small_le_vec,
+ &sh_elf32_vec,
+ &sh_elf32_le_vec,
+ &sh_elf32_fdpic_be_vec,
+ &sh_elf32_fdpic_le_vec,
+ &sh_elf32_linux_vec,
+ &sh_elf32_linux_be_vec,
+ &sh_elf32_nbsd_vec,
+ &sh_elf32_nbsd_le_vec,
+ &sh_elf32_symbian_le_vec,
+ &sh_elf32_vxworks_vec,
+ &sh_elf32_vxworks_le_vec,
+ &sh_pe_le_vec,
+ &sh_pei_le_vec,
+
+ &sparc_aout_le_vec,
+ &sparc_aout_linux_vec,
+ &sparc_aout_lynx_vec,
+ &sparc_aout_nbsd_vec,
+ &sparc_aout_sunos_be_vec,
+ &sparc_coff_vec,
+ &sparc_coff_lynx_vec,
+ &sparc_elf32_vec,
+ &sparc_elf32_sol2_vec,
+ &sparc_elf32_vxworks_vec,
#ifdef BFD64
- &rs6000coff64_vec,
+ &sparc_elf64_vec,
+ &sparc_elf64_fbsd_vec,
+ &sparc_elf64_sol2_vec,
#endif
- &rs6000coff_vec,
- &shcoff_small_vec,
- &shcoff_vec,
- &shlcoff_small_vec,
- &shlcoff_vec,
- &shlpe_vec,
- &shlpei_vec,
- &som_vec,
- &sparccoff_vec,
- &sparcle_aout_vec,
- &sparclinux_vec,
- &sparclynx_aout_vec,
- &sparclynx_coff_vec,
- &sparcnetbsd_vec,
- &sunos_big_vec,
+ &sparc_nlm32_vec,
+
+ &spu_elf32_vec,
+
&sym_vec,
+
&tic30_aout_vec,
&tic30_coff_vec,
&tic54x_coff0_beh_vec,
@@ -1319,20 +1361,56 @@ static const bfd_target * const _bfd_target_vector[] =
&tic54x_coff1_vec,
&tic54x_coff2_beh_vec,
&tic54x_coff2_vec,
- &tic80coff_vec,
- &vaxbsd_vec,
- &vaxnetbsd_vec,
- &vax1knetbsd_vec,
- &versados_vec,
+ &tic6x_elf32_be_vec,
+ &tic6x_elf32_le_vec,
+ &tic80_coff_vec,
+
+ &tilegx_elf32_be_vec,
+ &tilegx_elf32_le_vec,
#ifdef BFD64
- &vms_alpha_vec,
+ &tilegx_elf64_be_vec,
+ &tilegx_elf64_le_vec,
#endif
- &vms_lib_txt_vec,
- &w65_vec,
- &we32kcoff_vec,
- &z80coff_vec,
- &z8kcoff_vec,
- &bfd_elf32_am33lin_vec,
+ &tilepro_elf32_vec,
+
+ &v800_elf32_vec,
+ &v850_elf32_vec,
+
+ &vax_aout_1knbsd_vec,
+ &vax_aout_bsd_vec,
+ &vax_aout_nbsd_vec,
+ &vax_elf32_vec,
+
+ &w65_coff_vec,
+
+ &we32k_coff_vec,
+
+#ifdef BFD64
+ &x86_64_coff_vec,
+ &x86_64_elf32_vec,
+ &x86_64_elf32_nacl_vec,
+ &x86_64_elf64_vec,
+ &x86_64_elf64_fbsd_vec,
+ &x86_64_elf64_nacl_vec,
+ &x86_64_elf64_sol2_vec,
+ &x86_64_mach_o_vec,
+ &x86_64_pe_vec,
+ &x86_64_pe_be_vec,
+ &x86_64_pei_vec,
+#endif
+
+ &xc16x_elf32_vec,
+
+ &xgate_elf32_vec,
+
+ &xstormy16_elf32_vec,
+
+ &xtensa_elf32_be_vec,
+ &xtensa_elf32_le_vec,
+
+ &z80_coff_vec,
+
+ &z8k_coff_vec,
#endif /* not SELECT_VECS */
/* Always support S-records, for convenience. */
@@ -1350,38 +1428,38 @@ static const bfd_target * const _bfd_target_vector[] =
/* Add any required traditional-core-file-handler. */
#ifdef AIX386_CORE
- &aix386_core_vec,
+ &core_aix386_vec,
#endif
#if 0
/* We don't include cisco_core_*_vec. Although it has a magic number,
the magic number isn't at the beginning of the file, and thus
might spuriously match other kinds of files. */
- &cisco_core_big_vec,
- &cisco_core_little_vec,
+ &core_cisco_be_vec,
+ &core_cisco_le_vec,
#endif
#ifdef HPPABSD_CORE
- &hppabsd_core_vec,
+ &core_hppabsd_vec,
#endif
#ifdef HPUX_CORE
- &hpux_core_vec,
+ &core_hpux_vec,
#endif
#ifdef IRIX_CORE
- &irix_core_vec,
+ &core_irix_vec,
#endif
#ifdef NETBSD_CORE
- &netbsd_core_vec,
+ &core_netbsd_vec,
#endif
#ifdef OSF_CORE
- &osf_core_vec,
+ &core_osf_vec,
#endif
#ifdef PTRACE_CORE
- &ptrace_core_vec,
+ &core_ptrace_vec,
#endif
#ifdef SCO5_CORE
- &sco5_core_vec,
+ &core_sco5_vec,
#endif
#ifdef TRAD_CORE
- &trad_core_vec,
+ &core_trad_vec,
#endif
NULL /* end of list marker */
@@ -1581,7 +1659,7 @@ FUNCTION
SYNOPSIS
const bfd_target *bfd_get_target_info (const char *target_name,
bfd *abfd,
- bfd_boolean *is_bigendian,
+ bfd_boolean *is_bigendian,
int *underscoring,
const char **def_target_arch);
DESCRIPTION
@@ -1650,7 +1728,7 @@ bfd_get_target_info (const char *target_name, bfd *abfd,
{
*hyp = 0;
if (_bfd_find_arch_match (new_tname, arches,
- def_target_arch))
+ def_target_arch))
break;
}
}
diff --git a/binutils-2.25/bfd/tekhex.c b/binutils-2.25/bfd/tekhex.c
index c52eb953..0328689c 100644
--- a/binutils-2.25/bfd/tekhex.c
+++ b/binutils-2.25/bfd/tekhex.c
@@ -1,6 +1,5 @@
/* BFD backend for Extended Tektronix Hex Format objects.
- Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1992-2014 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@@ -247,11 +246,12 @@ struct tekhex_data_list_struct
typedef struct tekhex_data_list_struct tekhex_data_list_type;
#define CHUNK_MASK 0x1fff
+#define CHUNK_SPAN 32
struct data_struct
{
- char chunk_data[CHUNK_MASK + 1];
- char chunk_init[CHUNK_MASK + 1];
+ unsigned char chunk_data[CHUNK_MASK + 1];
+ unsigned char chunk_init[(CHUNK_MASK + 1 + CHUNK_SPAN - 1) / CHUNK_SPAN];
bfd_vma vma;
struct data_struct *next;
};
@@ -313,7 +313,7 @@ getsym (char *dstp, char **srcp, unsigned int *lenp)
}
static struct data_struct *
-find_chunk (bfd *abfd, bfd_vma vma)
+find_chunk (bfd *abfd, bfd_vma vma, bfd_boolean create)
{
struct data_struct *d = abfd->tdata.tekhex_data->data;
@@ -321,7 +321,7 @@ find_chunk (bfd *abfd, bfd_vma vma)
while (d && (d->vma) != vma)
d = d->next;
- if (!d)
+ if (!d && create)
{
/* No chunk for this address, so make one up. */
d = (struct data_struct *)
@@ -340,11 +340,14 @@ find_chunk (bfd *abfd, bfd_vma vma)
static void
insert_byte (bfd *abfd, int value, bfd_vma addr)
{
- /* Find the chunk that this byte needs and put it in. */
- struct data_struct *d = find_chunk (abfd, addr);
+ if (value != 0)
+ {
+ /* Find the chunk that this byte needs and put it in. */
+ struct data_struct *d = find_chunk (abfd, addr, TRUE);
- d->chunk_data[addr & CHUNK_MASK] = value;
- d->chunk_init[addr & CHUNK_MASK] = 1;
+ d->chunk_data[addr & CHUNK_MASK] = value;
+ d->chunk_init[(addr & CHUNK_MASK) / CHUNK_SPAN] = 1;
+ }
}
/* The first pass is to find the names of all the sections, and see
@@ -353,7 +356,7 @@ insert_byte (bfd *abfd, int value, bfd_vma addr)
static bfd_boolean
first_phase (bfd *abfd, int type, char *src)
{
- asection *section = bfd_abs_section_ptr;
+ asection *section, *alt_section;
unsigned int len;
bfd_vma val;
char sym[17]; /* A symbol can only be 16chars long. */
@@ -393,6 +396,7 @@ first_phase (bfd *abfd, int type, char *src)
if (section == NULL)
return FALSE;
}
+ alt_section = NULL;
while (*src)
{
switch (*src)
@@ -440,6 +444,42 @@ first_phase (bfd *abfd, int type, char *src)
new_symbol->symbol.flags = (BSF_GLOBAL | BSF_EXPORT);
else
new_symbol->symbol.flags = BSF_LOCAL;
+ if (stype == '2' || stype == '6')
+ new_symbol->symbol.section = bfd_abs_section_ptr;
+ else if (stype == '3' || stype == '7')
+ {
+ if ((section->flags & SEC_DATA) == 0)
+ section->flags |= SEC_CODE;
+ else
+ {
+ if (alt_section == NULL)
+ alt_section = bfd_get_next_section_by_name (section);
+ if (alt_section == NULL)
+ alt_section = bfd_make_section_anyway_with_flags
+ (abfd, section->name,
+ (section->flags & ~SEC_DATA) | SEC_CODE);
+ if (alt_section == NULL)
+ return FALSE;
+ new_symbol->symbol.section = alt_section;
+ }
+ }
+ else if (stype == '4' || stype == '8')
+ {
+ if ((section->flags & SEC_CODE) == 0)
+ section->flags |= SEC_DATA;
+ else
+ {
+ if (alt_section == NULL)
+ alt_section = bfd_get_next_section_by_name (section);
+ if (alt_section == NULL)
+ alt_section = bfd_make_section_anyway_with_flags
+ (abfd, section->name,
+ (section->flags & ~SEC_CODE) | SEC_DATA);
+ if (alt_section == NULL)
+ return FALSE;
+ new_symbol->symbol.section = alt_section;
+ }
+ }
if (!getvalue (&src, &val))
return FALSE;
new_symbol->symbol.value = val - section->vma;
@@ -590,22 +630,26 @@ move_section_contents (bfd *abfd,
/* Get high bits of address. */
bfd_vma chunk_number = addr & ~(bfd_vma) CHUNK_MASK;
bfd_vma low_bits = addr & CHUNK_MASK;
+ bfd_boolean must_write = !get && *location != 0;
- if (chunk_number != prev_number)
- /* Different chunk, so move pointer. */
- d = find_chunk (abfd, chunk_number);
+ if (chunk_number != prev_number || (!d && must_write))
+ {
+ /* Different chunk, so move pointer. */
+ d = find_chunk (abfd, chunk_number, must_write);
+ prev_number = chunk_number;
+ }
if (get)
{
- if (d->chunk_init[low_bits])
+ if (d)
*location = d->chunk_data[low_bits];
else
*location = 0;
}
- else
+ else if (must_write)
{
d->chunk_data[low_bits] = *location;
- d->chunk_init[low_bits] = (*location != 0);
+ d->chunk_init[low_bits / CHUNK_SPAN] = 1;
}
location++;
@@ -633,7 +677,9 @@ tekhex_set_arch_mach (bfd *abfd,
enum bfd_architecture arch,
unsigned long machine)
{
- return bfd_default_set_arch_mach (abfd, arch, machine);
+ /* Ignore errors about unknown architecture. */
+ return (bfd_default_set_arch_mach (abfd, arch, machine)
+ || arch == bfd_arch_unknown);
}
/* We have to save up all the Tekhexords for a splurge before output. */
@@ -645,24 +691,6 @@ tekhex_set_section_contents (bfd *abfd,
file_ptr offset,
bfd_size_type bytes_to_do)
{
- if (! abfd->output_has_begun)
- {
- /* The first time around, allocate enough sections to hold all the chunks. */
- asection *s = abfd->sections;
- bfd_vma vma;
-
- for (s = abfd->sections; s; s = s->next)
- {
- if (s->flags & SEC_LOAD)
- {
- for (vma = s->vma & ~(bfd_vma) CHUNK_MASK;
- vma < s->vma + s->size;
- vma += CHUNK_MASK)
- find_chunk (abfd, vma);
- }
- }
- }
-
if (section->flags & (SEC_LOAD | SEC_ALLOC))
{
move_section_contents (abfd, section, locationp, offset, bytes_to_do,
@@ -773,26 +801,17 @@ tekhex_write_object_contents (bfd *abfd)
d = d->next)
{
int low;
-
- const int span = 32;
int addr;
/* Write it in blocks of 32 bytes. */
- for (addr = 0; addr < CHUNK_MASK + 1; addr += span)
+ for (addr = 0; addr < CHUNK_MASK + 1; addr += CHUNK_SPAN)
{
- int need = 0;
-
- /* Check to see if necessary. */
- for (low = 0; !need && low < span; low++)
- if (d->chunk_init[addr + low])
- need = 1;
-
- if (need)
+ if (d->chunk_init[addr / CHUNK_SPAN])
{
char *dst = buffer;
writevalue (&dst, addr + d->vma);
- for (low = 0; low < span; low++)
+ for (low = 0; low < CHUNK_SPAN; low++)
{
TOHEX (dst, d->chunk_data[addr + low]);
dst += 2;
@@ -936,6 +955,7 @@ tekhex_print_symbol (bfd *abfd,
#define tekhex_bfd_is_local_label_name bfd_generic_is_local_label_name
#define tekhex_get_lineno _bfd_nosymbols_get_lineno
#define tekhex_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define tekhex_find_line _bfd_nosymbols_find_line
#define tekhex_find_inliner_info _bfd_nosymbols_find_inliner_info
#define tekhex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define tekhex_read_minisymbols _bfd_generic_read_minisymbols
@@ -950,7 +970,6 @@ tekhex_print_symbol (bfd *abfd,
#define tekhex_section_already_linked _bfd_generic_section_already_linked
#define tekhex_bfd_define_common_symbol bfd_generic_define_common_symbol
#define tekhex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define tekhex_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define tekhex_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define tekhex_bfd_link_just_syms _bfd_generic_link_just_syms
#define tekhex_bfd_copy_link_hash_symbol_type \
diff --git a/binutils-2.25/bfd/ticoff.h b/binutils-2.25/bfd/ticoff.h
deleted file mode 100644
index 8b2eb3f7..00000000
--- a/binutils-2.25/bfd/ticoff.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Copyright 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
-
- This file is part of BFD, the Binary File Descriptor library.
-
- 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
-
-#undef F_LSYMS
-#define F_LSYMS F_LSYMS_TICOFF
-
-static bfd_boolean
-ticoff0_bad_format_hook (bfd * abfd,
- void * filehdr)
-{
- struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
-
- if (COFF0_BADMAG (*internal_f))
- return FALSE;
-
- return TRUE;
-}
-
-static bfd_boolean
-ticoff1_bad_format_hook (bfd * abfd ATTRIBUTE_UNUSED,
- void * filehdr)
-{
- struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
-
- if (COFF1_BADMAG (*internal_f))
- return FALSE;
-
- return TRUE;
-}
-
-/* Replace the stock _bfd_coff_is_local_label_name
- to recognize TI COFF local labels. */
-static bfd_boolean
-ticoff_bfd_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED,
- const char *name)
-{
- if (TICOFF_LOCAL_LABEL_P(name))
- return TRUE;
- return FALSE;
-}
-
-#define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name
-
-/* Customize coffcode.h; the default coff_ functions are set up to use COFF2;
- coff_bad_format_hook uses BADMAG, so set that for COFF2. The COFF1
- and COFF0 vectors use custom _bad_format_hook procs instead of setting
- BADMAG. */
-#define BADMAG(x) COFF2_BADMAG(x)
-#include "coffcode.h"
-
-/* COFF0 differs in file/section header size and relocation entry size. */
-static bfd_coff_backend_data ticoff0_swap_table =
-{
- coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
- coff_SWAP_aux_out, coff_SWAP_sym_out,
- coff_SWAP_lineno_out, coff_SWAP_reloc_out,
- coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out,
- coff_SWAP_scnhdr_out,
- FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN,
-#ifdef COFF_LONG_FILENAMES
- TRUE,
-#else
- FALSE,
-#endif
- COFF_DEFAULT_LONG_SECTION_NAMES,
-#endif
- COFF_DEFAULT_SECTION_ALIGNMENT_POWER,
- coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
- coff_SWAP_reloc_in, ticoff0_bad_format_hook, coff_set_arch_mach_hook,
- coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
- coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook,
- coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate,
- coff_classify_symbol, coff_compute_section_file_positions,
- coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
- coff_adjust_symndx, coff_link_add_one_symbol,
- coff_link_output_has_begun, coff_final_link_postscript
-};
-
-/* COFF1 differs in section header size. */
-static bfd_coff_backend_data ticoff1_swap_table =
-{
- coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
- coff_SWAP_aux_out, coff_SWAP_sym_out,
- coff_SWAP_lineno_out, coff_SWAP_reloc_out,
- coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out,
- coff_SWAP_scnhdr_out,
- FILHSZ, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN,
-#ifdef COFF_LONG_FILENAMES
- TRUE,
-#else
- FALSE,
-#endif
- COFF_DEFAULT_LONG_SECTION_NAMES,
- COFF_DEFAULT_SECTION_ALIGNMENT_POWER,
- coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
- coff_SWAP_reloc_in, ticoff1_bad_format_hook, coff_set_arch_mach_hook,
- coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
- coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook,
- coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate,
- coff_classify_symbol, coff_compute_section_file_positions,
- coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
- coff_adjust_symndx, coff_link_add_one_symbol,
- coff_link_output_has_begun, coff_final_link_postscript
-};
-
diff --git a/binutils-2.25/bfd/trad-core.c b/binutils-2.25/bfd/trad-core.c
index da52c310..ce1231ed 100644
--- a/binutils-2.25/bfd/trad-core.c
+++ b/binutils-2.25/bfd/trad-core.c
@@ -1,7 +1,5 @@
/* BFD back end for traditional Unix core files (U-area and raw sections)
- Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1988-2014 Free Software Foundation, Inc.
Written by John Gilmore of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -267,7 +265,7 @@ swap_abort (void)
#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
-const bfd_target trad_core_vec =
+const bfd_target core_trad_vec =
{
"trad-core",
bfd_target_unknown_flavour,
diff --git a/binutils-2.25/bfd/vax1knetbsd.c b/binutils-2.25/bfd/vax1knetbsd.c
index 22f5a135..58614ef5 100644
--- a/binutils-2.25/bfd/vax1knetbsd.c
+++ b/binutils-2.25/bfd/vax1knetbsd.c
@@ -1,5 +1,5 @@
/* BFD back-end for NetBSD/VAX (1K page size) a.out-ish binaries.
- Copyright 1998, 2000, 2001, 2002, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -30,7 +30,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (vax1knetbsd_,OP)
+#define MY(OP) CONCAT2 (vax_aout_1knbsd_,OP)
/* This needs to start with a.out so GDB knows it is an a.out variant. */
#define TARGETNAME "a.out-vax1k-netbsd"
diff --git a/binutils-2.25/bfd/vaxbsd.c b/binutils-2.25/bfd/vaxbsd.c
index bcc7cc08..54e8a32f 100644
--- a/binutils-2.25/bfd/vaxbsd.c
+++ b/binutils-2.25/bfd/vaxbsd.c
@@ -1,5 +1,5 @@
/* BFD back-end for BSD and Ultrix/VAX (1K page size) a.out-ish binaries.
- Copyright 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -28,7 +28,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate the
tokens. */
-#define MY(OP) CONCAT2 (vaxbsd_,OP)
+#define MY(OP) CONCAT2 (vax_aout_bsd_,OP)
#define TARGETNAME "a.out-vax-bsd"
diff --git a/binutils-2.25/bfd/vaxnetbsd.c b/binutils-2.25/bfd/vaxnetbsd.c
index 033cec97..faf507ee 100644
--- a/binutils-2.25/bfd/vaxnetbsd.c
+++ b/binutils-2.25/bfd/vaxnetbsd.c
@@ -1,6 +1,5 @@
/* BFD back-end for NetBSD/VAX (4K page size) a.out-ish binaries.
- Copyright 1998, 2000, 2001, 2002, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1998-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -31,7 +30,7 @@
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (vaxnetbsd_,OP)
+#define MY(OP) CONCAT2 (vax_aout_nbsd_,OP)
/* This needs to start with a.out so GDB knows it is an a.out variant. */
#define TARGETNAME "a.out-vax-netbsd"
diff --git a/binutils-2.25/bfd/verilog.c b/binutils-2.25/bfd/verilog.c
index a2d3ca78..c1c5458f 100644
--- a/binutils-2.25/bfd/verilog.c
+++ b/binutils-2.25/bfd/verilog.c
@@ -1,6 +1,5 @@
/* BFD back-end for verilog hex memory dump files.
- Copyright 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
Written by Anthony Green <green@moxielogic.com>
This file is part of BFD, the Binary File Descriptor library.
@@ -312,7 +311,6 @@ verilog_mkobject (bfd *abfd)
#define verilog_bfd_discard_group bfd_generic_discard_group
#define verilog_section_already_linked _bfd_generic_section_already_linked
#define verilog_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define verilog_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define verilog_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define verilog_bfd_link_just_syms _bfd_generic_link_just_syms
#define verilog_bfd_final_link _bfd_generic_final_link
diff --git a/binutils-2.25/bfd/versados.c b/binutils-2.25/bfd/versados.c
index ae6f6713..42bf36c9 100644
--- a/binutils-2.25/bfd/versados.c
+++ b/binutils-2.25/bfd/versados.c
@@ -1,6 +1,5 @@
/* BFD back-end for VERSAdos-E objects.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
Versados is a Motorola trademark.
@@ -795,6 +794,7 @@ versados_canonicalize_reloc (bfd *abfd,
#define versados_bfd_is_local_label_name bfd_generic_is_local_label_name
#define versados_get_lineno _bfd_nosymbols_get_lineno
#define versados_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define versados_find_line _bfd_nosymbols_find_line
#define versados_find_inliner_info _bfd_nosymbols_find_inliner_info
#define versados_make_empty_symbol _bfd_generic_make_empty_symbol
#define versados_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
@@ -813,7 +813,6 @@ versados_canonicalize_reloc (bfd *abfd,
#define versados_section_already_linked _bfd_generic_section_already_linked
#define versados_bfd_define_common_symbol bfd_generic_define_common_symbol
#define versados_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define versados_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define versados_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define versados_bfd_link_just_syms _bfd_generic_link_just_syms
#define versados_bfd_copy_link_hash_symbol_type \
@@ -821,7 +820,7 @@ versados_canonicalize_reloc (bfd *abfd,
#define versados_bfd_final_link _bfd_generic_final_link
#define versados_bfd_link_split_section _bfd_generic_link_split_section
-const bfd_target versados_vec =
+const bfd_target m68k_versados_vec =
{
"versados", /* Name. */
bfd_target_versados_flavour,
diff --git a/binutils-2.25/bfd/version.h b/binutils-2.25/bfd/version.h
index ef027b19..ec0bedc5 100644
--- a/binutils-2.25/bfd/version.h
+++ b/binutils-2.25/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20131021
+#define BFD_VERSION_DATE 20141119
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@
#define REPORT_BUGS_TO @report_bugs_to@
diff --git a/binutils-2.25/bfd/version.m4 b/binutils-2.25/bfd/version.m4
new file mode 100644
index 00000000..c92d143b
--- /dev/null
+++ b/binutils-2.25/bfd/version.m4
@@ -0,0 +1 @@
+m4_define([BFD_VERSION], [2.24.90])
diff --git a/binutils-2.25/bfd/vms-alpha.c b/binutils-2.25/bfd/vms-alpha.c
index 09438aeb..5ff5bfd4 100644
--- a/binutils-2.25/bfd/vms-alpha.c
+++ b/binutils-2.25/bfd/vms-alpha.c
@@ -1,5 +1,5 @@
/* vms.c -- BFD back-end for EVAX (openVMS/Alpha) files.
- Copyright 1996-2013 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Initial version written by Klaus Kaempf (kkaempf@rmi.de)
Major rewrite by Adacore.
@@ -2474,10 +2474,7 @@ alpha_vms_object_p (bfd *abfd)
PRIV (recrd.rec) = buf;
if (bfd_bread (buf, test_len, abfd) != test_len)
- {
- bfd_set_error (bfd_error_file_truncated);
- goto error_ret;
- }
+ goto err_wrong_format;
/* Is it an image? */
if ((bfd_getl32 (buf) == EIHD__K_MAJORID)
@@ -2502,7 +2499,6 @@ alpha_vms_object_p (bfd *abfd)
if (buf == NULL)
{
PRIV (recrd.buf) = NULL;
- bfd_set_error (bfd_error_no_memory);
goto error_ret;
}
PRIV (recrd.buf) = buf;
@@ -2517,10 +2513,7 @@ alpha_vms_object_p (bfd *abfd)
while (remaining > 0)
{
if (bfd_bread (buf + read_so_far, to_read, abfd) != to_read)
- {
- bfd_set_error (bfd_error_file_truncated);
- goto err_wrong_format;
- }
+ goto err_wrong_format;
read_so_far += to_read;
remaining -= to_read;
@@ -4582,10 +4575,14 @@ module_find_nearest_line (bfd *abfd, struct module *module, bfd_vma addr,
location. */
static bfd_boolean
-_bfd_vms_find_nearest_dst_line (bfd *abfd, asection *section,
- asymbol **symbols ATTRIBUTE_UNUSED,
- bfd_vma offset, const char **file,
- const char **func, unsigned int *line)
+_bfd_vms_find_nearest_line (bfd *abfd,
+ asymbol **symbols ATTRIBUTE_UNUSED,
+ asection *section,
+ bfd_vma offset,
+ const char **file,
+ const char **func,
+ unsigned int *line,
+ unsigned int *discriminator)
{
struct module *module;
@@ -4595,6 +4592,8 @@ _bfd_vms_find_nearest_dst_line (bfd *abfd, asection *section,
*file = NULL;
*func = NULL;
*line = 0;
+ if (discriminator)
+ *discriminator = 0;
/* We can't do anything if there is no DST (debug symbol table). */
if (PRIV (dst_section) == NULL)
@@ -4614,26 +4613,6 @@ _bfd_vms_find_nearest_dst_line (bfd *abfd, asection *section,
return FALSE;
}
-
-/* Likewise but with a discriminator. */
-
-static bfd_boolean
-_bfd_vms_find_nearest_line_discriminator (bfd *abfd,
- asection *section,
- asymbol **symbols,
- bfd_vma offset,
- const char **filename_ptr,
- const char **functionname_ptr,
- unsigned int *line_ptr,
- unsigned int *discriminator)
-{
- *discriminator = 0;
-
- return _bfd_vms_find_nearest_dst_line (abfd, section, symbols, offset,
- filename_ptr, functionname_ptr,
- line_ptr);
-}
-
/* Canonicalizations. */
/* Set name, value, section and flags of SYM from E. */
@@ -8652,7 +8631,7 @@ alpha_vms_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
{
bfd *startbfd = NULL;
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
/* Consider only VMS object files. */
if (sub->xvec != abfd->xvec)
@@ -8756,7 +8735,7 @@ alpha_vms_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
dmt = NULL;
/* Read all sections from the inputs. */
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
if (sub->flags & DYNAMIC)
{
@@ -8807,7 +8786,7 @@ alpha_vms_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
unsigned int off = 0;
/* For each object file (ie for each module). */
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
asection *sub_dst;
struct vms_dmt_header *dmth = NULL;
@@ -9214,9 +9193,8 @@ bfd_vms_get_data (bfd *abfd)
#define alpha_vms_get_lineno _bfd_nosymbols_get_lineno
#define alpha_vms_find_inliner_info _bfd_nosymbols_find_inliner_info
#define alpha_vms_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define alpha_vms_find_nearest_line _bfd_vms_find_nearest_dst_line
-#define _bfd_generic_find_nearest_line_discriminator \
- _bfd_vms_find_nearest_line_discriminator
+#define alpha_vms_find_nearest_line _bfd_vms_find_nearest_line
+#define alpha_vms_find_line _bfd_nosymbols_find_line
#define alpha_vms_bfd_is_local_label_name vms_bfd_is_local_label_name
/* Generic table. */
@@ -9239,7 +9217,6 @@ bfd_vms_get_data (bfd *abfd)
_bfd_generic_section_already_linked
#define alpha_vms_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define alpha_vms_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define alpha_vms_bfd_link_just_syms _bfd_generic_link_just_syms
#define alpha_vms_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
@@ -9255,7 +9232,7 @@ bfd_vms_get_data (bfd *abfd)
#define alpha_vms_canonicalize_dynamic_reloc \
_bfd_nodynamic_canonicalize_dynamic_reloc
-const bfd_target vms_alpha_vec =
+const bfd_target alpha_vms_vec =
{
"vms-alpha", /* Name. */
bfd_target_evax_flavour,
diff --git a/binutils-2.25/bfd/vms-lib.c b/binutils-2.25/bfd/vms-lib.c
index b553570d..dbacc33e 100644
--- a/binutils-2.25/bfd/vms-lib.c
+++ b/binutils-2.25/bfd/vms-lib.c
@@ -1,6 +1,6 @@
/* BFD back-end for VMS archive files.
- Copyright 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2010-2014 Free Software Foundation, Inc.
Written by Tristan Gingold <gingold@adacore.com>, AdaCore.
This file is part of BFD, the Binary File Descriptor library.
@@ -25,6 +25,7 @@
#include "libbfd.h"
#include "safe-ctype.h"
#include "bfdver.h"
+#include "libiberty.h"
#include "vms.h"
#include "vms/lbr.h"
#include "vms/dcx.h"
@@ -1376,7 +1377,7 @@ _bfd_vms_lib_get_module (bfd *abfd, unsigned int modidx)
default:
break;
}
- res->filename = name;
+ res->filename = xstrdup (name);
tdata->cache[modidx] = res;
@@ -2310,7 +2311,7 @@ _bfd_vms_lib_write_archive_contents (bfd *arch)
/* Add a target for text library. This costs almost nothing and is useful to
read VMS library on the host. */
-const bfd_target vms_lib_txt_vec =
+const bfd_target alpha_vms_lib_txt_vec =
{
"vms-libtxt", /* Name. */
bfd_target_unknown_flavour,
diff --git a/binutils-2.25/bfd/vms-misc.c b/binutils-2.25/bfd/vms-misc.c
index 2ea2267d..4581738d 100644
--- a/binutils-2.25/bfd/vms-misc.c
+++ b/binutils-2.25/bfd/vms-misc.c
@@ -1,7 +1,6 @@
/* vms-misc.c -- BFD back-end for VMS/VAX (openVMS/VAX) and
EVAX (openVMS/Alpha) files.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Miscellaneous functions.
diff --git a/binutils-2.25/bfd/vms.h b/binutils-2.25/bfd/vms.h
index c25987d2..58782e3a 100644
--- a/binutils-2.25/bfd/vms.h
+++ b/binutils-2.25/bfd/vms.h
@@ -1,6 +1,5 @@
/* vms.h -- Header file for VMS (Alpha and Vax) support.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Main header file.
diff --git a/binutils-2.25/bfd/warning.m4 b/binutils-2.25/bfd/warning.m4
index 244dd448..de7e9e44 100644
--- a/binutils-2.25/bfd/warning.m4
+++ b/binutils-2.25/bfd/warning.m4
@@ -1,6 +1,6 @@
-dnl Common configure.in fragment
+dnl Common configure.ac fragment
dnl
-dnl Copyright 2012 Free Software Foundation
+dnl Copyright (C) 2012-2014 Free Software Foundation, Inc.
dnl
dnl This file is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@@ -18,6 +18,9 @@ dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([AM_BINUTILS_WARNINGS],[
+# Set the 'development' global.
+. $srcdir/../bfd/development.sh
+
GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
AC_EGREP_CPP([^[0-3]$],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wshadow")
@@ -39,8 +42,8 @@ case "${host}" in
*) ;;
esac
-# Enable -Werror by default when using gcc
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+# Enable -Werror by default when using gcc. Turn it off for releases.
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" -a "$development" = true ; then
ERROR_ON_WARNING=yes
fi
diff --git a/binutils-2.25/bfd/xcofflink.c b/binutils-2.25/bfd/xcofflink.c
index d0bfd297..95229745 100644
--- a/binutils-2.25/bfd/xcofflink.c
+++ b/binutils-2.25/bfd/xcofflink.c
@@ -1,6 +1,5 @@
/* POWER/PowerPC XCOFF linker support.
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
+ Copyright (C) 1995-2014 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -572,7 +571,22 @@ xcoff_link_hash_newfunc (struct bfd_hash_entry *entry,
return (struct bfd_hash_entry *) ret;
}
-/* Create a XCOFF link hash table. */
+/* Destroy an XCOFF link hash table. */
+
+static void
+_bfd_xcoff_bfd_link_hash_table_free (bfd *obfd)
+{
+ struct xcoff_link_hash_table *ret;
+
+ ret = (struct xcoff_link_hash_table *) obfd->link.hash;
+ if (ret->archive_info)
+ htab_delete (ret->archive_info);
+ if (ret->debug_strtab)
+ _bfd_stringtab_free (ret->debug_strtab);
+ _bfd_generic_link_hash_table_free (obfd);
+}
+
+/* Create an XCOFF link hash table. */
struct bfd_link_hash_table *
_bfd_xcoff_bfd_link_hash_table_create (bfd *abfd)
@@ -593,6 +607,12 @@ _bfd_xcoff_bfd_link_hash_table_create (bfd *abfd)
ret->debug_strtab = _bfd_xcoff_stringtab_init ();
ret->archive_info = htab_create (37, xcoff_archive_info_hash,
xcoff_archive_info_eq, NULL);
+ if (!ret->debug_strtab || !ret->archive_info)
+ {
+ _bfd_xcoff_bfd_link_hash_table_free (abfd);
+ return NULL;
+ }
+ ret->root.hash_table_free = _bfd_xcoff_bfd_link_hash_table_free;
/* The linker will always generate a full a.out header. We need to
record that fact now, before the sizeof_headers routine could be
@@ -601,18 +621,6 @@ _bfd_xcoff_bfd_link_hash_table_create (bfd *abfd)
return &ret->root;
}
-
-/* Free a XCOFF link hash table. */
-
-void
-_bfd_xcoff_bfd_link_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct xcoff_link_hash_table *ret = (struct xcoff_link_hash_table *) hash;
-
- _bfd_stringtab_free (ret->debug_strtab);
- bfd_hash_table_free (&ret->root.table);
- free (ret);
-}
/* Read internal relocs for an XCOFF csect. This is a wrapper around
_bfd_coff_read_internal_relocs which tries to take advantage of any
@@ -2376,6 +2384,8 @@ xcoff_link_check_ar_symbols (bfd *abfd,
static bfd_boolean
xcoff_link_check_archive_element (bfd *abfd,
struct bfd_link_info *info,
+ struct bfd_link_hash_entry *h ATTRIBUTE_UNUSED,
+ const char *name ATTRIBUTE_UNUSED,
bfd_boolean *pneeded)
{
bfd_boolean keep_syms_p;
@@ -2455,7 +2465,7 @@ _bfd_xcoff_bfd_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
bfd_boolean needed;
if (! xcoff_link_check_archive_element (member, info,
- &needed))
+ NULL, NULL, &needed))
return FALSE;
if (needed)
member->archive_pass = -1;
@@ -2986,7 +2996,7 @@ xcoff_sweep (struct bfd_link_info *info)
{
bfd *sub;
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
asection *o;
@@ -3711,7 +3721,7 @@ bfd_xcoff_size_dynamic_sections (bfd *output_bfd,
/* We still need to call xcoff_mark, in order to set ldrel_count
correctly. */
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
asection *o;
@@ -3805,7 +3815,7 @@ bfd_xcoff_size_dynamic_sections (bfd *output_bfd,
and figure out the contents of the .debug section. */
debug_strtab = xcoff_hash_table (info)->debug_strtab;
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
asection *subdeb;
bfd_size_type symcount;
@@ -3974,7 +3984,7 @@ bfd_xcoff_link_generate_rtinit (bfd *abfd,
bim->size = 0;
bim->buffer = 0;
- abfd->link_next = 0;
+ abfd->link.next = 0;
abfd->format = bfd_object;
abfd->iostream = (void *) bim;
abfd->flags = BFD_IN_MEMORY;
@@ -4484,7 +4494,10 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo,
if (strings == NULL)
return FALSE;
}
- filename = strings + aux.x_file.x_n.x_offset;
+ if ((bfd_size_type) aux.x_file.x_n.x_offset >= obj_coff_strings_len (input_bfd))
+ filename = _("<corrupt>");
+ else
+ filename = strings + aux.x_file.x_n.x_offset;
indx = _bfd_stringtab_add (flinfo->strtab, filename,
hash, copy);
if (indx == (bfd_size_type) -1)
@@ -5042,7 +5055,7 @@ xcoff_find_tc0 (bfd *output_bfd, struct xcoff_final_link_info *flinfo)
section_index = -1;
for (input_bfd = flinfo->info->input_bfds;
input_bfd != NULL;
- input_bfd = input_bfd->link_next)
+ input_bfd = input_bfd->link.next)
for (sec = input_bfd->sections; sec != NULL; sec = sec->next)
if ((sec->flags & SEC_MARK) != 0 && xcoff_toc_section_p (sec))
{
@@ -5074,7 +5087,7 @@ xcoff_find_tc0 (bfd *output_bfd, struct xcoff_final_link_info *flinfo)
best_address = toc_end;
for (input_bfd = flinfo->info->input_bfds;
input_bfd != NULL;
- input_bfd = input_bfd->link_next)
+ input_bfd = input_bfd->link.next)
for (sec = input_bfd->sections; sec != NULL; sec = sec->next)
if ((sec->flags & SEC_MARK) != 0 && xcoff_toc_section_p (sec))
{
@@ -6104,7 +6117,7 @@ _bfd_xcoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
input BFD's. We want at least 6 symbols, since that is the
number which xcoff_write_global_symbol may need. */
max_sym_count = 6;
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
bfd_size_type sz;
diff --git a/binutils-2.25/bfd/xsym.c b/binutils-2.25/bfd/xsym.c
index 5000f831..4e2a8ab3 100644
--- a/binutils-2.25/bfd/xsym.c
+++ b/binutils-2.25/bfd/xsym.c
@@ -1,6 +1,5 @@
/* xSYM symbol-file support for BFD.
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -34,6 +33,7 @@
#define bfd_sym_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
#define bfd_sym_get_lineno _bfd_nosymbols_get_lineno
#define bfd_sym_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define bfd_sym_find_line _bfd_nosymbols_find_line
#define bfd_sym_find_inliner_info _bfd_nosymbols_find_inliner_info
#define bfd_sym_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define bfd_sym_read_minisymbols _bfd_generic_read_minisymbols
@@ -51,7 +51,6 @@
#define bfd_sym_section_already_linked _bfd_generic_section_already_linked
#define bfd_sym_bfd_define_common_symbol bfd_generic_define_common_symbol
#define bfd_sym_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define bfd_sym_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
#define bfd_sym_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define bfd_sym_bfd_link_just_syms _bfd_generic_link_just_syms
#define bfd_sym_bfd_copy_link_hash_symbol_type \
diff --git a/binutils-2.25/bfd/xsym.h b/binutils-2.25/bfd/xsym.h
index 87c4546c..1a80e25a 100644
--- a/binutils-2.25/bfd/xsym.h
+++ b/binutils-2.25/bfd/xsym.h
@@ -1,6 +1,5 @@
/* xSYM symbol-file support for BFD.
- Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/xtensa-isa.c b/binutils-2.25/bfd/xtensa-isa.c
index cf5543eb..0fa8ab4a 100644
--- a/binutils-2.25/bfd/xtensa-isa.c
+++ b/binutils-2.25/bfd/xtensa-isa.c
@@ -1,5 +1,5 @@
/* Configurable Xtensa ISA support.
- Copyright 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2003-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/binutils-2.25/bfd/xtensa-modules.c b/binutils-2.25/bfd/xtensa-modules.c
index 3a79fcd2..408e3d20 100644
--- a/binutils-2.25/bfd/xtensa-modules.c
+++ b/binutils-2.25/bfd/xtensa-modules.c
@@ -1,5 +1,5 @@
/* Xtensa configuration-specific ISA information.
- Copyright 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2003-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.