binutils-gdb/bfd/pei-x86_64.c

857 lines
24 KiB
C
Raw Normal View History

2006-09-20 13:35:11 +02:00
/* BFD back-end for Intel 386 PE IMAGE COFF files.
Copyright (C) 2006-2019 Free Software Foundation, Inc.
2006-09-20 13:35:11 +02:00
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
2006-09-20 13:35:11 +02:00
(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.
Remove trailing white spaces in bfd * 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 21:03:55 +01:00
2006-09-20 13:35:11 +02:00
Written by Kai Tietz, OneVision Software GmbH&CoKg. */
#include "sysdep.h"
#include "bfd.h"
2006-09-20 13:35:11 +02:00
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * 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-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * 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-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.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-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
#define TARGET_SYM x86_64_pei_vec
#define TARGET_NAME "pei-x86-64"
2006-09-20 13:35:11 +02:00
#define COFF_IMAGE_WITH_PE
#define COFF_WITH_PE
#define COFF_WITH_pex64
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * 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-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * 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-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.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-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
#define PCRELOFFSET TRUE
#if defined (USE_MINGW64_LEADING_UNDERSCORES)
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * 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-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * 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-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.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-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
#define TARGET_UNDERSCORE '_'
#else
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * 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-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * 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-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.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-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
#define TARGET_UNDERSCORE 0
#endif
bfd/ChangeLog * coff-alpha.c (alpha_ecoff_backend_data): Initialise fields which control long section name handling with ECOFF_NO_LONG_SECTION_NAMES. * coff-mips.c (mips_ecoff_backend_data): Likewise. * coff-rs6000.c (bfd_xcoff_backend_data): Initialise fields which control long section name handling with XCOFF_NO_LONG_SECTION_NAMES. (bfd_pmac_xcoff_backend_data): Likewise. * coff64-rs6000.c (bfd_xcoff_backend_data): Likewise. (bfd_xcoff_aix5_backend_data): Likewise. (xcoff64_write_object_contents): Delete unused long_section_names local variable. * coff-sh.c (bfd_coff_small_swap_table): Initialise long section name members using COFF_DEFAULT_LONG_SECTION_NAMES and make entire struct non-const. * coffcode.h (documentation): Update to describe long section names. (COFFLONGSECTIONCATHELPER): New helper macro. (BLANKOR1TOODD): Likewise. (COFF_ENABLE_LONG_SECTION_NAMES): Likewise. (COFF_LONG_SECTION_NAMES_SETTER): Likewise. (COFF_DEFAULT_LONG_SECTION_NAMES): Likewise. (bfd_coff_set_long_section_names_allowed): New function. (bfd_coff_set_long_section_names_disallowed): Likewise. (struct bfd_coff_backend_data): Add new backend hook function pointer _bfd_coff_set_long_section_names. (bfd_coff_set_long_section_names): New backend hook. (coff_write_object_contents): Only generate long section names if bfd_coff_long_section_names() indicates they are currently enabled. (bfd_coff_std_swap_table): Make non-const, and initialise long section name fields using COFF_DEFAULT_LONG_SECTION_NAMES. (ticoff0_swap_table): Likewise to both. (ticoff1_swap_table): Again, likewise to both. * coffgen.c (make_a_section_from_file): Allow long section names as inputs even if not currently allowed for outputs. * ecoff.c (_bfd_ecoff_no_long_sections): New function. * efi-app-ia32.c (COFF_LONG_SECTION_NAMES): Define to 0, not blank. * efi-app-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-app-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-bsdrv-ia32.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-bsdrv-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-bsdrv-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-rtdrv-ia32.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-rtdrv-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-rtdrv-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-arm.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-i386.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-mcore.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-mips.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-ppc.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-sh.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. * libcoff-in.h: Update copyright year to cause updated copyright year in generated libcoff.h, and fix typo. * libcoff.h: Regenerated. * libecoff.h (ECOFF_NO_LONG_SECTION_NAMES): New macro. (_bfd_ecoff_no_long_sections): Add prototype. * libxcoff.h (XCOFF_NO_LONG_SECTION_NAMES): New macro. * pe-mips.c (COFF_LONG_SECTION_NAMES): Define empty if not already defined by an including .c file. * ticoff.h (ticoff0_swap_table): Make non-const, and initialise long section name fields using COFF_DEFAULT_LONG_SECTION_NAMES. (ticoff1_swap_table): Likewise to both. ld/ChangeLog * ld.texinfo: Update to mention long section name options. * NEWS: Mention new behaviour and command-line options. * pe-dll.c (pe_use_coff_long_section_names): New global variable. (pe_output_file_set_long_section_names): New function. (pe_dll_build_sections): Call it on output BFDs. (pe_exe_build_sections): Likewise. (pe_dll_fill_sections): Likewise. (pe_exe_fill_sections): Likewise. * pe-dll.h (pe_use_coff_long_section_names): Declare extern. (pe_output_file_set_long_section_names): Add prototype. * pep-dll.c (pe_use_coff_long_section_names): Define pep_ alias. (pe_output_file_set_long_section_names): Likewise. * pep-dll.h (pep_use_coff_long_section_names): Declare extern. (pep_output_file_set_long_section_names): Add prototype. * pe.em (OPTION_ENABLE_LONG_SECTION_NAMES): New getopt value macro. (OPTION_DISABLE_LONG_SECTION_NAMES): Likewise. (gld${EMULATION_NAME}_add_options): Add new options to xtra_long[]. (gld_${EMULATION_NAME}_list_options): Describe them. (gld${EMULATION_NAME}_handle_option): Set or clear global pe_use_coff_long_section_names flag when options recognised. (gld_${EMULATION_NAME}_after_open): En/disable long section names for main output bfd by calling pe_output_file_set_long_section_names. * pep.em (enum options): Extend enum with new getopt option values. (gld${EMULATION_NAME}_add_options): Add new options to xtra_long[]. (gld_${EMULATION_NAME}_list_options): Describe them. (gld${EMULATION_NAME}_handle_option): Set or clear global pe_use_coff_long_section_names flag when options recognised. (gld_${EMULATION_NAME}_after_open): En/disable long section names for main output bfd by calling pep_output_file_set_long_section_names. ld/testsuite/ChangeLog * ld-pe/longsecn-1.d: New test file. * ld-pe/longsecn-2.d: Likewise. * ld-pe/longsecn-3.d: Likewise. * ld-pe/longsecn-4.d: Likewise. * ld-pe/longsecn-5.d: Likewise. * ld-pe/longsecn.d: Likewise. * ld-pe/longsecn.exp: New test control script. * ld-pe/longsecn.s: New test source file.
2009-02-18 19:23:08 +01:00
/* Long section names not allowed in executable images, only object files. */
#define COFF_LONG_SECTION_NAMES 0
2006-09-20 13:35:11 +02:00
#define COFF_SUPPORT_GNU_LINKONCE
#define COFF_LONG_FILENAMES
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
#define PDATA_ROW_SIZE (3 * 4)
2006-09-20 13:35:11 +02:00
#define COFF_SECTION_ALIGNMENT_ENTRIES \
{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_PARTIAL_MATCH (".data"), \
2006-09-20 13:35:11 +02:00
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_PARTIAL_MATCH (".rdata"), \
2006-09-20 13:35:11 +02:00
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_PARTIAL_MATCH (".text"), \
2006-09-20 13:35:11 +02:00
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
{ COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \
{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
/* Note we have to make sure not to include headers twice.
Not all headers are wrapped in #ifdef guards, so we define
PEI_HEADERS to prevent double including in coff-x86_64.c */
#define PEI_HEADERS
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#include "coff/x86_64.h"
#include "coff/internal.h"
#include "coff/pe.h"
#include "libcoff.h"
#include "libpei.h"
#include "libiberty.h"
#undef AOUTSZ
#define AOUTSZ PEPAOUTSZ
#define PEAOUTHDR PEPAOUTHDR
/* Name of registers according to SEH conventions. */
static const char * const pex_regs[16] = {
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
"rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
};
/* Swap in a runtime function. */
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
static void
pex64_get_runtime_function (bfd *abfd, struct pex64_runtime_function *rf,
const void *data)
{
const struct external_pex64_runtime_function *ex_rf =
(const struct external_pex64_runtime_function *) data;
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);
}
/* Swap in unwind info header. */
static bfd_boolean
pex64_get_unwind_info (bfd *abfd, struct pex64_unwind_info *ui,
void *data, void *data_end)
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
{
struct external_pex64_unwind_info *ex_ui =
(struct external_pex64_unwind_info *) data;
bfd_byte *ex_dta = (bfd_byte *) data;
bfd_byte *ex_dta_end = (bfd_byte *) data_end;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
memset (ui, 0, sizeof (struct pex64_unwind_info));
if (ex_dta >= ex_dta_end || ex_dta + 4 >= ex_dta_end)
return FALSE;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
ui->Version = PEX64_UWI_VERSION (ex_ui->Version_Flags);
ui->Flags = PEX64_UWI_FLAGS (ex_ui->Version_Flags);
ui->SizeOfPrologue = (bfd_vma) ex_ui->SizeOfPrologue;
ui->CountOfCodes = (bfd_vma) ex_ui->CountOfCodes;
ui->FrameRegister = PEX64_UWI_FRAMEREG (ex_ui->FrameRegisterOffset);
ui->FrameOffset = PEX64_UWI_FRAMEOFF (ex_ui->FrameRegisterOffset);
ui->sizeofUnwindCodes = PEX64_UWI_SIZEOF_UWCODE_ARRAY (ui->CountOfCodes);
ui->SizeOfBlock = ui->sizeofUnwindCodes + 4;
ui->rawUnwindCodes = ex_dta + 4;
ui->rawUnwindCodesEnd = ex_dta_end;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
ex_dta += ui->SizeOfBlock;
if (ex_dta >= ex_dta_end)
return FALSE;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
switch (ui->Flags)
{
case UNW_FLAG_CHAININFO:
if (ex_dta + 12 >= ex_dta_end)
return FALSE;
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 TRUE;
case UNW_FLAG_EHANDLER:
case UNW_FLAG_UHANDLER:
case UNW_FLAG_FHANDLER:
if (ex_dta + 4 >= ex_dta_end)
return FALSE;
ui->rva_ExceptionHandler = bfd_get_32 (abfd, ex_dta);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
ui->SizeOfBlock += 4;
return TRUE;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
default:
return TRUE;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
}
}
/* Display unwind codes. */
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
static void
pex64_xdata_print_uwd_codes (FILE *file, bfd *abfd,
struct pex64_unwind_info *ui,
struct pex64_runtime_function *rf)
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
{
unsigned int i;
unsigned int tmp; /* At least 32 bits. */
int save_allowed;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
if (ui->CountOfCodes == 0 || ui->rawUnwindCodes == NULL)
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
return;
/* 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;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
i = 0;
if (ui->rawUnwindCodes + 1 >= ui->rawUnwindCodesEnd)
{
fprintf (file, _("warning: corrupt unwind data\n"));
return;
}
if (ui->Version == 2
&& PEX64_UNWCODE_CODE (ui->rawUnwindCodes[1]) == UWOP_EPILOG)
{
/* Display epilog opcode (whose docoding is not fully documented).
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * 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-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * 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-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.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-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
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;
if (ui->rawUnwindCodes + 1 + (ui->CountOfCodes * 2) >= ui->rawUnwindCodesEnd)
{
fprintf (file, _("warning: corrupt unwind data\n"));
return;
}
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++)
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
{
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);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
}
fputc ('\n', file);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
}
if (ui->rawUnwindCodes + 2 + (ui->CountOfCodes * 2) >= ui->rawUnwindCodesEnd)
{
fprintf (file, _("warning: corrupt unwind data\n"));
return;
}
for (; i < ui->CountOfCodes; i++)
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
{
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]);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
switch (PEX64_UNWCODE_CODE (dta[1]))
{
case UWOP_PUSH_NONVOL:
fprintf (file, "push %s", pex_regs[info]);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
break;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
case UWOP_ALLOC_LARGE:
if (info == 0)
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
{
if (dta + 4 > ui->rawUnwindCodesEnd)
{
fprintf (file, _("warning: corrupt unwind data\n"));
return;
}
tmp = bfd_get_16 (abfd, dta + 2) * 8;
i++;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
}
else
{
if (dta + 6 > ui->rawUnwindCodesEnd)
{
fprintf (file, _("warning: corrupt unwind data\n"));
return;
}
tmp = bfd_get_32 (abfd, dta + 2);
i += 2;
}
fprintf (file, "alloc large area: rsp = rsp - 0x%x", tmp);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
break;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
case UWOP_ALLOC_SMALL:
fprintf (file, "alloc small area: rsp = rsp - 0x%x", (info + 1) * 8);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
break;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
case UWOP_SET_FPREG:
/* 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;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
break;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
case UWOP_SAVE_NONVOL:
if (dta + 4 > ui->rawUnwindCodesEnd)
{
fprintf (file, _("warning: corrupt unwind data\n"));
return;
}
tmp = bfd_get_16 (abfd, dta + 2) * 8;
i++;
fprintf (file, "save %s at rsp + 0x%x", pex_regs[info], tmp);
unexpected = !save_allowed;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
break;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
case UWOP_SAVE_NONVOL_FAR:
if (dta + 6 > ui->rawUnwindCodesEnd)
{
fprintf (file, _("warning: corrupt unwind data\n"));
return;
}
tmp = bfd_get_32 (abfd, dta + 2);
i += 2;
fprintf (file, "save %s at rsp + 0x%x", pex_regs[info], tmp);
unexpected = !save_allowed;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
break;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
case UWOP_SAVE_XMM:
if (ui->Version == 1)
{
if (dta + 4 > ui->rawUnwindCodesEnd)
{
fprintf (file, _("warning: corrupt unwind data\n"));
return;
}
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;
}
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
break;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
case UWOP_SAVE_XMM_FAR:
if (dta + 6 > ui->rawUnwindCodesEnd)
{
fprintf (file, _("warning: corrupt unwind data\n"));
return;
}
tmp = bfd_get_32 (abfd, dta + 2) * 8;
i += 2;
fprintf (file, "save mm%u at rsp + 0x%x", info, tmp);
unexpected = !save_allowed;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
break;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
case UWOP_SAVE_XMM128:
if (dta + 4 > ui->rawUnwindCodesEnd)
{
fprintf (file, _("warning: corrupt unwind data\n"));
return;
}
tmp = bfd_get_16 (abfd, dta + 2) * 16;
i++;
fprintf (file, "save xmm%u at rsp + 0x%x", info, tmp);
unexpected = !save_allowed;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
break;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
case UWOP_SAVE_XMM128_FAR:
if (dta + 6 > ui->rawUnwindCodesEnd)
{
fprintf (file, _("warning: corrupt unwind data\n"));
return;
}
tmp = bfd_get_32 (abfd, dta + 2) * 16;
i += 2;
fprintf (file, "save xmm%u at rsp + 0x%x", info, tmp);
unexpected = !save_allowed;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
break;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
case UWOP_PUSH_MACHFRAME:
fprintf (file, "interrupt entry (SS, old RSP, EFLAGS, CS, RIP");
if (info == 0)
fprintf (file, ")");
else if (info == 1)
fprintf (file, ",ErrorCode)");
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
else
fprintf (file, ", unknown(%u))", info);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
break;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
default:
Fixes for memory access violations exposed by fuzzinf various binaries. PR binutils/17512 * dwarf.c (get_encoded_value): Check for an encoded size of 0. (display_debug_lines_raw): Check for an invalid line range value. (display_debug_frames): Check for corrupt augmentation data. * coffgen.c (coff_get_normalized_symtab): Check for an excessive number of auxillary entries. * ieee.c (next_byte): Convert to a function. Return FALSE if the next byte is beyond the end of the buffer. (parse_int): Test the return value of next_byte. (parse_expression): Convert to boolean. Return FALSE if the parsing failed. Test the return value of next_byte. (ieee_seek): Convert to a function. Return FALSE if the seek goes beyond the end of the buffer. (ieee_slurp_external_symbols): Test the return value of ieee_seek and next_byte. (ieee_slurp_sections): Convert to boolean. Return FALSE if the operation failed. Test the return value of ieee_seek and next_byte. (ieee_archive_p): Test the return value of ieee_seek and next_byte. (do_one): Likewise. (ieee_slurp_section_data): Likewise. (ieee_object_p): Likewise. Store the size of the buffer in the total_amt field in the header. * libieee.h (common_header_type): Add amt field. * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Check that the reloc's value is within range. (bfd_mach_o_read_symtab_symbols): Nullify the symbols field if the operation fails. * pei-x86_64.c (pex64_xdata_print_uwd_codes): Replace abort with an error message. (pex64_dump_xdata): Check for buffer overflows. * versados.c (process_otr): Check that the section exists before taking its size. (versados_object_p): Make sure that enough data was read for the header to be checked. * vms-alpha.c (vms_get_remaining_object_record): Change read_so_far parameter to an unsigned int. Check that the amount read is in range.
2014-11-21 22:44:04 +01:00
/* PR 17512: file: 2245-7442-0.004. */
fprintf (file, _("Unknown: %x"), PEX64_UNWCODE_CODE (dta[1]));
break;
}
if (unexpected)
fprintf (file, " [Unexpected!]");
fputc ('\n', file);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
}
}
/* Check wether section SEC_NAME contains the xdata at address ADDR. */
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
static asection *
pex64_get_section_by_rva (bfd *abfd, bfd_vma addr, const char *sec_name)
{
asection *section = bfd_get_section_by_name (abfd, sec_name);
bfd_vma vsize;
bfd_size_type datasize = 0;
if (section == NULL
|| coff_section_data (abfd, section) == NULL
|| pei_section_data (abfd, section) == NULL)
return NULL;
vsize = section->vma - pe_data (abfd)->pe_opthdr.ImageBase;
datasize = section->size;
if (!datasize || vsize > addr || (vsize + datasize) < addr)
return NULL;
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). */
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
static void
pex64_dump_xdata (FILE *file, bfd *abfd,
asection *xdata_section, bfd_byte *xdata, bfd_vma *endx,
struct pex64_runtime_function *rf)
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
{
bfd_vma vaddr;
bfd_vma end_addr;
bfd_vma addr = rf->rva_UnwindData;
Fixes for memory access violations exposed by fuzzinf various binaries. PR binutils/17512 * dwarf.c (get_encoded_value): Check for an encoded size of 0. (display_debug_lines_raw): Check for an invalid line range value. (display_debug_frames): Check for corrupt augmentation data. * coffgen.c (coff_get_normalized_symtab): Check for an excessive number of auxillary entries. * ieee.c (next_byte): Convert to a function. Return FALSE if the next byte is beyond the end of the buffer. (parse_int): Test the return value of next_byte. (parse_expression): Convert to boolean. Return FALSE if the parsing failed. Test the return value of next_byte. (ieee_seek): Convert to a function. Return FALSE if the seek goes beyond the end of the buffer. (ieee_slurp_external_symbols): Test the return value of ieee_seek and next_byte. (ieee_slurp_sections): Convert to boolean. Return FALSE if the operation failed. Test the return value of ieee_seek and next_byte. (ieee_archive_p): Test the return value of ieee_seek and next_byte. (do_one): Likewise. (ieee_slurp_section_data): Likewise. (ieee_object_p): Likewise. Store the size of the buffer in the total_amt field in the header. * libieee.h (common_header_type): Add amt field. * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Check that the reloc's value is within range. (bfd_mach_o_read_symtab_symbols): Nullify the symbols field if the operation fails. * pei-x86_64.c (pex64_xdata_print_uwd_codes): Replace abort with an error message. (pex64_dump_xdata): Check for buffer overflows. * versados.c (process_otr): Check that the section exists before taking its size. (versados_object_p): Make sure that enough data was read for the header to be checked. * vms-alpha.c (vms_get_remaining_object_record): Change read_so_far parameter to an unsigned int. Check that the amount read is in range.
2014-11-21 22:44:04 +01:00
bfd_size_type sec_size = xdata_section->rawsize > 0 ? xdata_section->rawsize : xdata_section->size;
struct pex64_unwind_info ui;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
vaddr = xdata_section->vma - pe_data (abfd)->pe_opthdr.ImageBase;
addr -= vaddr;
Fixes for memory access violations exposed by fuzzinf various binaries. PR binutils/17512 * dwarf.c (get_encoded_value): Check for an encoded size of 0. (display_debug_lines_raw): Check for an invalid line range value. (display_debug_frames): Check for corrupt augmentation data. * coffgen.c (coff_get_normalized_symtab): Check for an excessive number of auxillary entries. * ieee.c (next_byte): Convert to a function. Return FALSE if the next byte is beyond the end of the buffer. (parse_int): Test the return value of next_byte. (parse_expression): Convert to boolean. Return FALSE if the parsing failed. Test the return value of next_byte. (ieee_seek): Convert to a function. Return FALSE if the seek goes beyond the end of the buffer. (ieee_slurp_external_symbols): Test the return value of ieee_seek and next_byte. (ieee_slurp_sections): Convert to boolean. Return FALSE if the operation failed. Test the return value of ieee_seek and next_byte. (ieee_archive_p): Test the return value of ieee_seek and next_byte. (do_one): Likewise. (ieee_slurp_section_data): Likewise. (ieee_object_p): Likewise. Store the size of the buffer in the total_amt field in the header. * libieee.h (common_header_type): Add amt field. * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Check that the reloc's value is within range. (bfd_mach_o_read_symtab_symbols): Nullify the symbols field if the operation fails. * pei-x86_64.c (pex64_xdata_print_uwd_codes): Replace abort with an error message. (pex64_dump_xdata): Check for buffer overflows. * versados.c (process_otr): Check that the section exists before taking its size. (versados_object_p): Make sure that enough data was read for the header to be checked. * vms-alpha.c (vms_get_remaining_object_record): Change read_so_far parameter to an unsigned int. Check that the amount read is in range.
2014-11-21 22:44:04 +01:00
/* PR 17512: file: 2245-7442-0.004. */
if (addr >= sec_size)
{
fprintf (file, _("warning: xdata section corrupt\n"));
return;
}
if (endx)
Fixes for memory access violations exposed by fuzzinf various binaries. PR binutils/17512 * dwarf.c (get_encoded_value): Check for an encoded size of 0. (display_debug_lines_raw): Check for an invalid line range value. (display_debug_frames): Check for corrupt augmentation data. * coffgen.c (coff_get_normalized_symtab): Check for an excessive number of auxillary entries. * ieee.c (next_byte): Convert to a function. Return FALSE if the next byte is beyond the end of the buffer. (parse_int): Test the return value of next_byte. (parse_expression): Convert to boolean. Return FALSE if the parsing failed. Test the return value of next_byte. (ieee_seek): Convert to a function. Return FALSE if the seek goes beyond the end of the buffer. (ieee_slurp_external_symbols): Test the return value of ieee_seek and next_byte. (ieee_slurp_sections): Convert to boolean. Return FALSE if the operation failed. Test the return value of ieee_seek and next_byte. (ieee_archive_p): Test the return value of ieee_seek and next_byte. (do_one): Likewise. (ieee_slurp_section_data): Likewise. (ieee_object_p): Likewise. Store the size of the buffer in the total_amt field in the header. * libieee.h (common_header_type): Add amt field. * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Check that the reloc's value is within range. (bfd_mach_o_read_symtab_symbols): Nullify the symbols field if the operation fails. * pei-x86_64.c (pex64_xdata_print_uwd_codes): Replace abort with an error message. (pex64_dump_xdata): Check for buffer overflows. * versados.c (process_otr): Check that the section exists before taking its size. (versados_object_p): Make sure that enough data was read for the header to be checked. * vms-alpha.c (vms_get_remaining_object_record): Change read_so_far parameter to an unsigned int. Check that the amount read is in range.
2014-11-21 22:44:04 +01:00
{
end_addr = endx[0] - vaddr;
/* PR 17512: file: 2245-7442-0.004. */
if (end_addr > sec_size)
{
fprintf (file, _("warning: xdata section corrupt\n"));
Fixes for memory access violations exposed by fuzzinf various binaries. PR binutils/17512 * dwarf.c (get_encoded_value): Check for an encoded size of 0. (display_debug_lines_raw): Check for an invalid line range value. (display_debug_frames): Check for corrupt augmentation data. * coffgen.c (coff_get_normalized_symtab): Check for an excessive number of auxillary entries. * ieee.c (next_byte): Convert to a function. Return FALSE if the next byte is beyond the end of the buffer. (parse_int): Test the return value of next_byte. (parse_expression): Convert to boolean. Return FALSE if the parsing failed. Test the return value of next_byte. (ieee_seek): Convert to a function. Return FALSE if the seek goes beyond the end of the buffer. (ieee_slurp_external_symbols): Test the return value of ieee_seek and next_byte. (ieee_slurp_sections): Convert to boolean. Return FALSE if the operation failed. Test the return value of ieee_seek and next_byte. (ieee_archive_p): Test the return value of ieee_seek and next_byte. (do_one): Likewise. (ieee_slurp_section_data): Likewise. (ieee_object_p): Likewise. Store the size of the buffer in the total_amt field in the header. * libieee.h (common_header_type): Add amt field. * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Check that the reloc's value is within range. (bfd_mach_o_read_symtab_symbols): Nullify the symbols field if the operation fails. * pei-x86_64.c (pex64_xdata_print_uwd_codes): Replace abort with an error message. (pex64_dump_xdata): Check for buffer overflows. * versados.c (process_otr): Check that the section exists before taking its size. (versados_object_p): Make sure that enough data was read for the header to be checked. * vms-alpha.c (vms_get_remaining_object_record): Change read_so_far parameter to an unsigned int. Check that the amount read is in range.
2014-11-21 22:44:04 +01:00
end_addr = sec_size;
}
}
else
Fixes for memory access violations exposed by fuzzinf various binaries. PR binutils/17512 * dwarf.c (get_encoded_value): Check for an encoded size of 0. (display_debug_lines_raw): Check for an invalid line range value. (display_debug_frames): Check for corrupt augmentation data. * coffgen.c (coff_get_normalized_symtab): Check for an excessive number of auxillary entries. * ieee.c (next_byte): Convert to a function. Return FALSE if the next byte is beyond the end of the buffer. (parse_int): Test the return value of next_byte. (parse_expression): Convert to boolean. Return FALSE if the parsing failed. Test the return value of next_byte. (ieee_seek): Convert to a function. Return FALSE if the seek goes beyond the end of the buffer. (ieee_slurp_external_symbols): Test the return value of ieee_seek and next_byte. (ieee_slurp_sections): Convert to boolean. Return FALSE if the operation failed. Test the return value of ieee_seek and next_byte. (ieee_archive_p): Test the return value of ieee_seek and next_byte. (do_one): Likewise. (ieee_slurp_section_data): Likewise. (ieee_object_p): Likewise. Store the size of the buffer in the total_amt field in the header. * libieee.h (common_header_type): Add amt field. * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Check that the reloc's value is within range. (bfd_mach_o_read_symtab_symbols): Nullify the symbols field if the operation fails. * pei-x86_64.c (pex64_xdata_print_uwd_codes): Replace abort with an error message. (pex64_dump_xdata): Check for buffer overflows. * versados.c (process_otr): Check that the section exists before taking its size. (versados_object_p): Make sure that enough data was read for the header to be checked. * vms-alpha.c (vms_get_remaining_object_record): Change read_so_far parameter to an unsigned int. Check that the amount read is in range.
2014-11-21 22:44:04 +01:00
end_addr = sec_size;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
if (! pex64_get_unwind_info (abfd, &ui, xdata + addr, xdata + end_addr))
{
fprintf (file, _("warning: xdata section corrupt\n"));
return;
}
2015-08-12 13:32:43 +02:00
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++)
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
{
if ((i & 15) == 0)
fprintf (file, "\t %03x:", i);
fprintf (file, " %02x", xdata[addr]);
if ((i & 15) == 15)
fprintf (file, "\n");
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
}
if ((i & 15) != 0)
fprintf (file, "\n");
return;
}
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
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]);
Fixes for memory access violations exposed by fuzzinf various binaries. PR binutils/17512 * dwarf.c (get_encoded_value): Check for an encoded size of 0. (display_debug_lines_raw): Check for an invalid line range value. (display_debug_frames): Check for corrupt augmentation data. * coffgen.c (coff_get_normalized_symtab): Check for an excessive number of auxillary entries. * ieee.c (next_byte): Convert to a function. Return FALSE if the next byte is beyond the end of the buffer. (parse_int): Test the return value of next_byte. (parse_expression): Convert to boolean. Return FALSE if the parsing failed. Test the return value of next_byte. (ieee_seek): Convert to a function. Return FALSE if the seek goes beyond the end of the buffer. (ieee_slurp_external_symbols): Test the return value of ieee_seek and next_byte. (ieee_slurp_sections): Convert to boolean. Return FALSE if the operation failed. Test the return value of ieee_seek and next_byte. (ieee_archive_p): Test the return value of ieee_seek and next_byte. (do_one): Likewise. (ieee_slurp_section_data): Likewise. (ieee_object_p): Likewise. Store the size of the buffer in the total_amt field in the header. * libieee.h (common_header_type): Add amt field. * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Check that the reloc's value is within range. (bfd_mach_o_read_symtab_symbols): Nullify the symbols field if the operation fails. * pei-x86_64.c (pex64_xdata_print_uwd_codes): Replace abort with an error message. (pex64_dump_xdata): Check for buffer overflows. * versados.c (process_otr): Check that the section exists before taking its size. (versados_object_p): Make sure that enough data was read for the header to be checked. * vms-alpha.c (vms_get_remaining_object_record): Change read_so_far parameter to an unsigned int. Check that the amount read is in range.
2014-11-21 22:44:04 +01:00
/* PR 17512: file: 2245-7442-0.004. */
if (ui.CountOfCodes * 2 + ui.rawUnwindCodes > xdata + xdata_section->size)
Fixes for memory access violations exposed by fuzzinf various binaries. PR binutils/17512 * dwarf.c (get_encoded_value): Check for an encoded size of 0. (display_debug_lines_raw): Check for an invalid line range value. (display_debug_frames): Check for corrupt augmentation data. * coffgen.c (coff_get_normalized_symtab): Check for an excessive number of auxillary entries. * ieee.c (next_byte): Convert to a function. Return FALSE if the next byte is beyond the end of the buffer. (parse_int): Test the return value of next_byte. (parse_expression): Convert to boolean. Return FALSE if the parsing failed. Test the return value of next_byte. (ieee_seek): Convert to a function. Return FALSE if the seek goes beyond the end of the buffer. (ieee_slurp_external_symbols): Test the return value of ieee_seek and next_byte. (ieee_slurp_sections): Convert to boolean. Return FALSE if the operation failed. Test the return value of ieee_seek and next_byte. (ieee_archive_p): Test the return value of ieee_seek and next_byte. (do_one): Likewise. (ieee_slurp_section_data): Likewise. (ieee_object_p): Likewise. Store the size of the buffer in the total_amt field in the header. * libieee.h (common_header_type): Add amt field. * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Check that the reloc's value is within range. (bfd_mach_o_read_symtab_symbols): Nullify the symbols field if the operation fails. * pei-x86_64.c (pex64_xdata_print_uwd_codes): Replace abort with an error message. (pex64_dump_xdata): Check for buffer overflows. * versados.c (process_otr): Check that the section exists before taking its size. (versados_object_p): Make sure that enough data was read for the header to be checked. * vms-alpha.c (vms_get_remaining_object_record): Change read_so_far parameter to an unsigned int. Check that the amount read is in range.
2014-11-21 22:44:04 +01:00
fprintf (file, _("Too many unwind codes (%ld)\n"), (long) ui.CountOfCodes);
else
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));
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
fprintf (file, ".\n");
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");
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
}
}
/* 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)
{
const bfd_vma *lp = (const bfd_vma *) l;
const bfd_vma *rp = (const bfd_vma *) r;
if (*lp == *rp)
return 0;
return (*lp < *rp ? -1 : 1);
}
/* Display unwind tables for x86-64. */
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
static bfd_boolean
pex64_bfd_print_pdata_section (bfd *abfd, void *vfile, asection *pdata_section)
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
{
FILE *file = (FILE *) vfile;
bfd_byte *pdata = NULL;
bfd_byte *xdata = NULL;
asection *xdata_section = NULL;
bfd_vma xdata_base;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
bfd_size_type i;
bfd_size_type datasize;
bfd_size_type stop;
bfd_vma prev_beginaddress = (bfd_vma) -1;
bfd_vma prev_unwinddata_rva = (bfd_vma) -1;
bfd_vma imagebase;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
int onaline = PDATA_ROW_SIZE;
int seen_error = 0;
bfd_vma *xdata_arr = NULL;
int xdata_arr_cnt;
bfd_boolean virt_size_is_zero = FALSE;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
/* Sanity checks. */
if (pdata_section == NULL
|| coff_section_data (abfd, pdata_section) == NULL
|| pei_section_data (abfd, pdata_section) == NULL)
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
return TRUE;
stop = pei_section_data (abfd, pdata_section)->virt_size;
if ((stop % onaline) != 0)
fprintf (file,
Add c-format tags to translatable strings with more than one argument-using formatting token. * aout-adobe.c: Add missing c-format tags for translatable strings. * aout-cris.c: Likewise. * aoutx.h: Likewise. * bfd.c: Likewise. * binary.c: Likewise. * cache.c: Likewise. * coff-alpha.c: Likewise. * coff-arm.c: Likewise. * coff-i860.c: Likewise. * coff-mcore.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic4x.c: Likewise. * coff-tic54x.c: Likewise. * coff-tic80.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * coffswap.h: Likewise. * cpu-arm.c: Likewise. * dwarf2.c: Likewise. * ecoff.c: Likewise. * elf-attrs.c: Likewise. * elf-eh-frame.c: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-s390-common.c: Likewise. * elf.c: Likewise. * elf32-arc.c: Likewise. * elf32-arm.c: Likewise. * elf32-avr.c: Likewise. * elf32-bfin.c: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-d10v.c: Likewise. * elf32-d30v.c: Likewise. * elf32-epiphany.c: Likewise. * elf32-fr30.c: Likewise. * elf32-frv.c: Likewise. * elf32-gen.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf32-i386.c: Likewise. * elf32-i960.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc11.c: Likewise. * elf32-m68hc12.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mcore.c: Likewise. * elf32-mep.c: Likewise. * elf32-metag.c: Likewise. * elf32-microblaze.c: Likewise. * elf32-moxie.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-nds32.c: Likewise. * elf32-nios2.c: Likewise. * elf32-or1k.c: Likewise. * elf32-pj.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-rx.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-sh64.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-v850.c: Likewise. * elf32-vax.c: Likewise. * elf32-visium.c: Likewise. * elf32-xgate.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-gen.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elfcode.h: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * libbfd.c: Likewise. * linker.c: Likewise. * m68klinux.c: Likewise. * mach-o.c: Likewise. * merge.c: Likewise. * mmo.c: Likewise. * oasys.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * peXXigen.c: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * ppcboot.c: Likewise. * reloc.c: Likewise. * sparclinux.c: Likewise. * srec.c: Likewise. * stabs.c: Likewise. * vms-alpha.c: Likewise. * vms-lib.c: Likewise. * xcofflink.c: Likewise.
2016-10-19 15:04:34 +02:00
/* xgettext:c-format */
_("Warning: %s section size (%ld) is not a multiple of %d\n"),
pdata_section->name, (long) stop, onaline);
datasize = pdata_section->size;
if (datasize == 0)
{
if (stop)
fprintf (file, _("Warning: %s section size is zero\n"),
pdata_section->name);
return TRUE;
}
/* virt_size might be zero for objects. */
if (stop == 0 && strcmp (abfd->xvec->name, "pe-x86-64") == 0)
{
stop = datasize;
virt_size_is_zero = TRUE;
}
else if (datasize < stop)
{
fprintf (file,
Add c-format tags to translatable strings with more than one argument-using formatting token. * aout-adobe.c: Add missing c-format tags for translatable strings. * aout-cris.c: Likewise. * aoutx.h: Likewise. * bfd.c: Likewise. * binary.c: Likewise. * cache.c: Likewise. * coff-alpha.c: Likewise. * coff-arm.c: Likewise. * coff-i860.c: Likewise. * coff-mcore.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic4x.c: Likewise. * coff-tic54x.c: Likewise. * coff-tic80.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * coffswap.h: Likewise. * cpu-arm.c: Likewise. * dwarf2.c: Likewise. * ecoff.c: Likewise. * elf-attrs.c: Likewise. * elf-eh-frame.c: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-s390-common.c: Likewise. * elf.c: Likewise. * elf32-arc.c: Likewise. * elf32-arm.c: Likewise. * elf32-avr.c: Likewise. * elf32-bfin.c: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-d10v.c: Likewise. * elf32-d30v.c: Likewise. * elf32-epiphany.c: Likewise. * elf32-fr30.c: Likewise. * elf32-frv.c: Likewise. * elf32-gen.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf32-i386.c: Likewise. * elf32-i960.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc11.c: Likewise. * elf32-m68hc12.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mcore.c: Likewise. * elf32-mep.c: Likewise. * elf32-metag.c: Likewise. * elf32-microblaze.c: Likewise. * elf32-moxie.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-nds32.c: Likewise. * elf32-nios2.c: Likewise. * elf32-or1k.c: Likewise. * elf32-pj.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-rx.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-sh64.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-v850.c: Likewise. * elf32-vax.c: Likewise. * elf32-visium.c: Likewise. * elf32-xgate.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-gen.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elfcode.h: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * libbfd.c: Likewise. * linker.c: Likewise. * m68klinux.c: Likewise. * mach-o.c: Likewise. * merge.c: Likewise. * mmo.c: Likewise. * oasys.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * peXXigen.c: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * ppcboot.c: Likewise. * reloc.c: Likewise. * sparclinux.c: Likewise. * srec.c: Likewise. * stabs.c: Likewise. * vms-alpha.c: Likewise. * vms-lib.c: Likewise. * xcofflink.c: Likewise.
2016-10-19 15:04:34 +02:00
/* xgettext:c-format */
_("Warning: %s section size (%ld) is smaller than virtual size (%ld)\n"),
pdata_section->name, (unsigned long) datasize,
(unsigned long) stop);
/* Be sure not to read past datasize. */
stop = datasize;
}
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
/* Display functions table. */
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
fprintf (file,
_("\nThe Function Table (interpreted %s section contents)\n"),
pdata_section->name);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
fprintf (file, _("vma:\t\t\tBeginAddress\t EndAddress\t UnwindData\n"));
if (!bfd_malloc_and_get_section (abfd, pdata_section, &pdata))
goto done;
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
/* Table of xdata entries. */
xdata_arr = (bfd_vma *) xmalloc (sizeof (bfd_vma) * ((stop / onaline) + 1));
xdata_arr_cnt = 0;
if (strcmp (abfd->xvec->name, "pei-x86-64") == 0)
imagebase = pe_data (abfd)->pe_opthdr.ImageBase;
else
imagebase = 0;
for (i = 0; i < stop; i += onaline)
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
{
struct pex64_runtime_function rf;
if (i + PDATA_ROW_SIZE > stop)
break;
pex64_get_runtime_function (abfd, &rf, &pdata[i]);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
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 + pdata_section->vma);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
fprintf (file, ":\t");
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);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
fprintf (file, "\n");
if (i != 0 && rf.rva_BeginAddress <= prev_beginaddress)
{
seen_error = 1;
fprintf (file, " has %s begin address as predecessor\n",
(rf.rva_BeginAddress < prev_beginaddress ? "smaller" : "same"));
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * 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-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * 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-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.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-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
}
prev_beginaddress = rf.rva_BeginAddress;
/* Now we check for negative addresses. */
if ((prev_beginaddress & 0x80000000) != 0)
{
seen_error = 1;
fprintf (file, " has negative begin address\n");
}
if ((rf.rva_EndAddress & 0x80000000) != 0)
{
seen_error = 1;
fprintf (file, " has negative end address\n");
}
if ((rf.rva_UnwindData & 0x80000000) != 0)
{
seen_error = 1;
fprintf (file, " has negative unwind address\n");
}
else if ((rf.rva_UnwindData && !PEX64_IS_RUNTIME_FUNCTION_CHAINED (&rf))
|| virt_size_is_zero)
xdata_arr[xdata_arr_cnt++] = rf.rva_UnwindData;
}
if (seen_error)
goto done;
/* Add end of list marker. */
xdata_arr[xdata_arr_cnt++] = ~((bfd_vma) 0);
/* Sort start RVAs of xdata. */
if (xdata_arr_cnt > 1)
qsort (xdata_arr, (size_t) xdata_arr_cnt, sizeof (bfd_vma),
sort_xdata_arr);
/* Find the section containing the unwind data (.xdata). */
xdata_base = xdata_arr[0];
/* For sections with long names, first look for the same
section name, replacing .pdata by .xdata prefix. */
if (strcmp (pdata_section->name, ".pdata") != 0)
{
size_t len = strlen (pdata_section->name);
char *xdata_name = xmalloc (len + 1);
xdata_name = memcpy (xdata_name, pdata_section->name, len + 1);
/* Transform .pdata prefix into .xdata prefix. */
if (len > 1)
xdata_name [1] = 'x';
xdata_section = pex64_get_section_by_rva (abfd, xdata_base,
xdata_name);
free (xdata_name);
}
/* Second, try the .xdata section itself. */
if (!xdata_section)
xdata_section = pex64_get_section_by_rva (abfd, xdata_base, ".xdata");
/* Otherwise, if xdata_base is non zero, search also inside
other standard sections. */
if (!xdata_section && xdata_base)
xdata_section = pex64_get_section_by_rva (abfd, xdata_base, ".rdata");
if (!xdata_section && xdata_base)
xdata_section = pex64_get_section_by_rva (abfd, xdata_base, ".data");
if (!xdata_section && xdata_base)
xdata_section = pex64_get_section_by_rva (abfd, xdata_base, ".pdata");
if (!xdata_section && xdata_base)
xdata_section = pex64_get_section_by_rva (abfd, xdata_base, ".text");
/* Transfer xdata section into xdata array. */
if (!xdata_section
|| !bfd_malloc_and_get_section (abfd, xdata_section, &xdata))
goto done;
/* Avoid "also used "... ouput for single unwind info
in object file. */
prev_unwinddata_rva = (bfd_vma) -1;
/* 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;
Fixes for memory access violations exposed by fuzzinf various binaries. PR binutils/17512 * dwarf.c (get_encoded_value): Check for an encoded size of 0. (display_debug_lines_raw): Check for an invalid line range value. (display_debug_frames): Check for corrupt augmentation data. * coffgen.c (coff_get_normalized_symtab): Check for an excessive number of auxillary entries. * ieee.c (next_byte): Convert to a function. Return FALSE if the next byte is beyond the end of the buffer. (parse_int): Test the return value of next_byte. (parse_expression): Convert to boolean. Return FALSE if the parsing failed. Test the return value of next_byte. (ieee_seek): Convert to a function. Return FALSE if the seek goes beyond the end of the buffer. (ieee_slurp_external_symbols): Test the return value of ieee_seek and next_byte. (ieee_slurp_sections): Convert to boolean. Return FALSE if the operation failed. Test the return value of ieee_seek and next_byte. (ieee_archive_p): Test the return value of ieee_seek and next_byte. (do_one): Likewise. (ieee_slurp_section_data): Likewise. (ieee_object_p): Likewise. Store the size of the buffer in the total_amt field in the header. * libieee.h (common_header_type): Add amt field. * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Check that the reloc's value is within range. (bfd_mach_o_read_symtab_symbols): Nullify the symbols field if the operation fails. * pei-x86_64.c (pex64_xdata_print_uwd_codes): Replace abort with an error message. (pex64_dump_xdata): Check for buffer overflows. * versados.c (process_otr): Check that the section exists before taking its size. (versados_object_p): Make sure that enough data was read for the header to be checked. * vms-alpha.c (vms_get_remaining_object_record): Change read_so_far parameter to an unsigned int. Check that the amount read is in range.
2014-11-21 22:44:04 +01:00
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;
if (i == 0)
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * 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-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * 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-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.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-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
fprintf (file, _("\nDump of %s\n"), xdata_section->name);
fputc (' ', file);
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;
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);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
if (rf.rva_UnwindData != 0 || virt_size_is_zero)
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
{
if (PEX64_IS_RUNTIME_FUNCTION_CHAINED (&rf))
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
{
bfd_vma altent = PEX64_GET_UNWINDDATA_UNIFIED_RVA (&rf);
bfd_section_* macros This large patch removes the unnecessary bfd parameter from various bfd section macros and functions. The bfd is hardly ever used and if needed for the bfd_set_section_* or bfd_rename_section functions can be found via section->owner except for the com, und, abs, and ind std_section special sections. Those sections shouldn't be modified anyway. The patch also removes various bfd_get_section_<field> macros, replacing their use with bfd_section_<field>, and adds bfd_set_section_lma. I've also fixed a minor bug in gas where compressed section renaming was done directly rather than calling bfd_rename_section. This would have broken bfd_get_section_by_name and similar functions, but that hardly mattered at such a late stage in gas processing. bfd/ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma), (bfd_get_section_lma, bfd_get_section_alignment), (bfd_get_section_size, bfd_get_section_flags), (bfd_get_section_userdata): Delete. (bfd_section_name, bfd_section_size, bfd_section_vma), (bfd_section_lma, bfd_section_alignment): Lose bfd parameter. (bfd_section_flags, bfd_section_userdata): New. (bfd_is_com_section): Rename parameter. * section.c (bfd_set_section_userdata, bfd_set_section_vma), (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section), (bfd_set_section_size): Delete bfd parameter, rename section parameter. (bfd_set_section_lma): New. * bfd-in2.h: Regenerate. * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param, update callers. * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h, * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c, * elf-s390-common.c, * elf-vxworks.c, * elf.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-csky.c, * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c, * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c, * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c, * xcofflink.c: Update throughout for bfd section macro and function changes. binutils/ * addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c, * objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c, * od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c, * resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update throughout for bfd section macro and function changes. gas/ * as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c, * read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c, * config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c, * config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c, * config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c, * config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c, * config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c, * config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c, * config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c, * config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c, * config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c, * config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c, * config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c, * config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c, * config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c, * config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c, * config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c, * config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c, * config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c, * config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for bfd section macro and function changes. * write.c (compress_debug): Use bfd_rename_section. gdb/ * aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c, * coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c, * dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c, * exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h, * hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c, * i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c, * maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c, * mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c, * objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c, * ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c, * rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c, * s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c, * solib-spu.c, * solib-svr4.c, * solib-target.c, * spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c, * symmisc.c, * symtab.c, * target.c, * windows-nat.c, * xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c, * mi/mi-interp.c: Update throughout for bfd section macro and function changes. * gcore (gcore_create_callback): Use bfd_set_section_lma. * spu-tdep.c (spu_overlay_new_objfile): Likewise. gprof/ * corefile.c, * symtab.c: Update throughout for bfd section macro and function changes. ld/ * ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c, * emultempl/aarch64elf.em, * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/armelf.em, * emultempl/cr16elf.em, * emultempl/cskyelf.em, * emultempl/m68hc1xelf.em, * emultempl/m68kelf.em, * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, * emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update throughout for bfd section macro and function changes. libctf/ * ctf-open-bfd.c: Update throughout for bfd section macro changes. opcodes/ * arc-ext.c: Update throughout for bfd section macro changes. sim/ * common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c, * erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c, * m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c, * rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c, * rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 12:55:17 +02:00
bfd_vma pdata_vma = bfd_section_vma (pdata_section);
struct pex64_runtime_function arf;
fprintf (file, "\t shares information with ");
altent += imagebase;
if (altent >= pdata_vma
&& altent - pdata_vma + PDATA_ROW_SIZE <= stop)
{
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");
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
fprintf (file, ".\n");
}
else
{
bfd_vma *p;
/* Search for the current entry in the sorted array. */
p = (bfd_vma *)
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * 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-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * 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-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.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-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
bsearch (&rf.rva_UnwindData, xdata_arr,
(size_t) xdata_arr_cnt, sizeof (bfd_vma),
sort_xdata_arr);
/* Advance to the next pointer into the xdata section. We may
have shared xdata entries, which will result in a string of
identical pointers in the array; advance past all of them. */
while (p[0] <= rf.rva_UnwindData)
++p;
Fixes for memory access violations exposed by fuzzinf various binaries. PR binutils/17512 * dwarf.c (get_encoded_value): Check for an encoded size of 0. (display_debug_lines_raw): Check for an invalid line range value. (display_debug_frames): Check for corrupt augmentation data. * coffgen.c (coff_get_normalized_symtab): Check for an excessive number of auxillary entries. * ieee.c (next_byte): Convert to a function. Return FALSE if the next byte is beyond the end of the buffer. (parse_int): Test the return value of next_byte. (parse_expression): Convert to boolean. Return FALSE if the parsing failed. Test the return value of next_byte. (ieee_seek): Convert to a function. Return FALSE if the seek goes beyond the end of the buffer. (ieee_slurp_external_symbols): Test the return value of ieee_seek and next_byte. (ieee_slurp_sections): Convert to boolean. Return FALSE if the operation failed. Test the return value of ieee_seek and next_byte. (ieee_archive_p): Test the return value of ieee_seek and next_byte. (do_one): Likewise. (ieee_slurp_section_data): Likewise. (ieee_object_p): Likewise. Store the size of the buffer in the total_amt field in the header. * libieee.h (common_header_type): Add amt field. * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Check that the reloc's value is within range. (bfd_mach_o_read_symtab_symbols): Nullify the symbols field if the operation fails. * pei-x86_64.c (pex64_xdata_print_uwd_codes): Replace abort with an error message. (pex64_dump_xdata): Check for buffer overflows. * versados.c (process_otr): Check that the section exists before taking its size. (versados_object_p): Make sure that enough data was read for the header to be checked. * vms-alpha.c (vms_get_remaining_object_record): Change read_so_far parameter to an unsigned int. Check that the amount read is in range.
2014-11-21 22:44:04 +01:00
if (p[0] == ~((bfd_vma) 0))
p = NULL;
pex64_dump_xdata (file, abfd, xdata_section, xdata, p, &rf);
}
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
}
}
done:
free (pdata);
free (xdata_arr);
free (xdata);
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
return TRUE;
}
/* Static counter of number of found pdata sections. */
static bfd_boolean pdata_count;
/* Functionn prototype. */
bfd_boolean pex64_bfd_print_pdata (bfd *, void *);
/* Helper function for bfd_map_over_section. */
static void
pex64_print_all_pdata_sections (bfd *abfd, asection *pdata, void *obj)
{
if (CONST_STRNEQ (pdata->name, ".pdata"))
{
if (pex64_bfd_print_pdata_section (abfd, obj, pdata))
pdata_count++;
}
}
bfd_boolean
pex64_bfd_print_pdata (bfd *abfd, void *vfile)
{
asection *pdata_section = bfd_get_section_by_name (abfd, ".pdata");
if (pdata_section)
return pex64_bfd_print_pdata_section (abfd, vfile, pdata_section);
pdata_count = 0;
bfd_map_over_sections (abfd, pex64_print_all_pdata_sections, vfile);
return (pdata_count > 0);
}
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
#define bfd_pe_print_pdata pex64_bfd_print_pdata
#define bfd_coff_std_swap_table bfd_coff_pei_swap_table
bfd/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 04:13:48 +02:00
2006-09-20 13:35:11 +02:00
#include "coff-x86_64.c"