binutils-gdb/gas/config/obj-coff-seh.c

1018 lines
23 KiB
C
Raw Normal View History

/* seh pdata/xdata coff object file format
Copyright (C) 2009-2019 Free Software Foundation, Inc.
This file is part of GAS.
GAS 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, or (at your option)
any later version.
GAS 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 GAS; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
2009-08-17 13:46:29 +02:00
#include "obj-coff-seh.h"
/* Private segment collection list. */
struct seh_seg_list {
segT seg;
int subseg;
char *seg_name;
};
2009-08-17 13:46:29 +02:00
/* Local data. */
static seh_context *seh_ctx_cur = NULL;
static struct hash_control *seh_hash;
static struct seh_seg_list *x_segcur = NULL;
static struct seh_seg_list *p_segcur = NULL;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
static void write_function_xdata (seh_context *);
static void write_function_pdata (seh_context *);
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Build based on segment the derived .pdata/.xdata
segment name containing origin segment's postfix name part. */
static char *
get_pxdata_name (segT seg, const char *base_name)
2009-08-17 13:46:29 +02:00
{
const char *name,*dollar, *dot;
char *sname;
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
name = bfd_section_name (seg);
dollar = strchr (name, '$');
dot = strchr (name + 1, '.');
if (!dollar && !dot)
name = "";
else if (!dollar)
name = dot;
else if (!dot)
name = dollar;
else if (dot < dollar)
name = dot;
else
name = dollar;
sname = concat (base_name, name, NULL);
return sname;
}
/* Allocate a seh_seg_list structure. */
static struct seh_seg_list *
alloc_pxdata_item (segT seg, int subseg, char *name)
{
struct seh_seg_list *r;
r = (struct seh_seg_list *)
xmalloc (sizeof (struct seh_seg_list) + strlen (name));
r->seg = seg;
r->subseg = subseg;
r->seg_name = name;
return r;
}
/* Generate pdata/xdata segment with same linkonce properties
of based segment. */
static segT
make_pxdata_seg (segT cseg, char *name)
{
segT save_seg = now_seg;
int save_subseg = now_subseg;
segT r;
flagword flags;
r = subseg_new (name, 0);
/* Check if code segment is marked as linked once. */
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
flags = (bfd_section_flags (cseg)
& (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD
| SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE
| SEC_LINK_DUPLICATES_SAME_CONTENTS));
/* Add standard section flags. */
flags |= SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA;
/* Apply possibly linked once flags to new generated segment, too. */
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
if (!bfd_set_section_flags (r, flags))
as_bad (_("bfd_set_section_flags: %s"),
bfd_errmsg (bfd_get_error ()));
/* Restore to previous segment. */
subseg_set (save_seg, save_subseg);
return r;
2009-08-17 13:46:29 +02:00
}
static void
seh_hash_insert (const char *name, struct seh_seg_list *item)
{
const char *error_string;
if ((error_string = hash_jam (seh_hash, name, (char *) item)))
as_fatal (_("Inserting \"%s\" into structure table failed: %s"),
name, error_string);
}
static struct seh_seg_list *
seh_hash_find (char *name)
2009-08-17 13:46:29 +02:00
{
return (struct seh_seg_list *) hash_find (seh_hash, name);
}
static struct seh_seg_list *
seh_hash_find_or_make (segT cseg, const char *base_name)
{
struct seh_seg_list *item;
char *name;
/* Initialize seh_hash once. */
if (!seh_hash)
seh_hash = hash_new ();
name = get_pxdata_name (cseg, base_name);
item = seh_hash_find (name);
if (!item)
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
{
item = alloc_pxdata_item (make_pxdata_seg (cseg, name), 0, name);
seh_hash_insert (item->seg_name, item);
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
}
else
free (name);
return item;
}
/* Check if current segment has same name. */
static int
seh_validate_seg (const char *directive)
{
const char *cseg_name, *nseg_name;
if (seh_ctx_cur->code_seg == now_seg)
return 1;
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
cseg_name = bfd_section_name (seh_ctx_cur->code_seg);
nseg_name = bfd_section_name (now_seg);
as_bad (_("%s used in segment '%s' instead of expected '%s'"),
directive, nseg_name, cseg_name);
ignore_rest_of_line ();
return 0;
}
/* Switch back to the code section, whatever that may be. */
static void
obj_coff_seh_code (int ignored ATTRIBUTE_UNUSED)
{
subseg_set (seh_ctx_cur->code_seg, 0);
}
static void
switch_xdata (int subseg, segT code_seg)
{
x_segcur = seh_hash_find_or_make (code_seg, ".xdata");
subseg_set (x_segcur->seg, subseg);
}
static void
switch_pdata (segT code_seg)
{
p_segcur = seh_hash_find_or_make (code_seg, ".pdata");
subseg_set (p_segcur->seg, p_segcur->subseg);
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
}
/* Parsing routines. */
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Return the style of SEH unwind info to generate. */
static seh_kind
seh_get_target_kind (void)
{
if (!stdoutput)
return seh_kind_unknown;
switch (bfd_get_arch (stdoutput))
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
case bfd_arch_arm:
case bfd_arch_powerpc:
case bfd_arch_sh:
return seh_kind_arm;
case bfd_arch_i386:
switch (bfd_get_mach (stdoutput))
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
case bfd_mach_x86_64:
case bfd_mach_x86_64_intel_syntax:
return seh_kind_x64;
default:
break;
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* FALL THROUGH. */
case bfd_arch_mips:
return seh_kind_mips;
case bfd_arch_ia64:
/* Should return seh_kind_x64. But not implemented yet. */
return seh_kind_unknown;
2009-08-17 13:46:29 +02:00
default:
break;
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
return seh_kind_unknown;
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Verify that we're in the context of a seh_proc. */
static int
verify_context (const char *directive)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
if (seh_ctx_cur == NULL)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
as_bad (_("%s used outside of .seh_proc block"), directive);
ignore_rest_of_line ();
return 0;
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
return 1;
}
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Similar, except we also verify the appropriate target. */
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
static int
verify_context_and_target (const char *directive, seh_kind target)
{
if (seh_get_target_kind () != target)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
as_warn (_("%s ignored for this target"), directive);
ignore_rest_of_line ();
return 0;
}
return verify_context (directive);
}
/* Skip whitespace and a comma. Error if the comma is not seen. */
static int
skip_whitespace_and_comma (int required)
{
SKIP_WHITESPACE ();
if (*input_line_pointer == ',')
{
input_line_pointer++;
SKIP_WHITESPACE ();
return 1;
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
else if (required)
{
as_bad (_("missing separator"));
ignore_rest_of_line ();
}
else
demand_empty_rest_of_line ();
return 0;
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Mark current context to use 32-bit instruction (arm). */
2009-08-17 13:46:29 +02:00
static void
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
obj_coff_seh_32 (int what)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
if (!verify_context_and_target ((what ? ".seh_32" : ".seh_no32"),
seh_kind_arm))
return;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
seh_ctx_cur->use_instruction_32 = (what ? 1 : 0);
demand_empty_rest_of_line ();
}
/* Set for current context the handler and optional data (arm). */
static void
obj_coff_seh_eh (int what ATTRIBUTE_UNUSED)
{
if (!verify_context_and_target (".seh_eh", seh_kind_arm))
2009-08-17 13:46:29 +02:00
return;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Write block to .text if exception handler is set. */
seh_ctx_cur->handler_written = 1;
emit_expr (&seh_ctx_cur->handler, 4);
emit_expr (&seh_ctx_cur->handler_data, 4);
demand_empty_rest_of_line ();
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Set for current context the default handler (x64). */
2009-08-17 13:46:29 +02:00
static void
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
obj_coff_seh_handler (int what ATTRIBUTE_UNUSED)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
char *symbol_name;
char name_end;
if (!verify_context (".seh_handler"))
2009-08-17 13:46:29 +02:00
return;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
if (*input_line_pointer == 0 || *input_line_pointer == '\n')
{
as_bad (_(".seh_handler requires a handler"));
demand_empty_rest_of_line ();
return;
}
SKIP_WHITESPACE ();
if (*input_line_pointer == '@')
2009-08-17 13:46:29 +02:00
{
Allow symbol and label names to be enclosed in double quotes. gas PR gas/18581 * expr.c (get_symbol_end): Rename to get_symbol_name. Add a return parameter pointing to the start of the symbol. Allow symbol names enclosed in double quotes. (restore_line_pointer): New function. Replace the NUL character inserted into the input stream with the given character. If the character was a double quote, advance the input pointer. * expr.h (get_symbol_end): Delete. (get_symbol_name): Add prototype. (restore_line_pointer): Prototype. * read.h (SKIP_WHITESPACE_AFTER_NAME): New macro. * doc/as.texinfo (Symbol Intro): Document that symbol names can now be enclosed in double quotes. * cond.c (s_ifdef): Replace get_symbol_end with get_symbol_name. Use restore_line_pointer to replace the NUL in the input stream. Use SKIP_WHITESPACE_AFTER_NAME to skip past the end of a symbol. Check for the use of double quoted symbol names. * expr.c: Likewise. * config/obj-aout.c: Likewise. * config/obj-coff-seh.c: Likewise. * config/obj-coff.c: Likewise. * config/obj-elf.c: Likewise. * config/obj-evax.c: Likewise. * config/obj-macho.c: Likewise. * config/obj-som.c: Likewise. * config/tc-alpha.c: Likewise. * config/tc-arc.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-dlx.c: Likewise. * config/tc-h8300.c: Likewise. * config/tc-hppa.c: Likewise. * config/tc-i370.c: Likewise. * config/tc-i386-intel.c: Likewise. * config/tc-i386.c: Likewise. * config/tc-i960.c: Likewise. * config/tc-ia64.c: Likewise. * config/tc-iq2000.c: Likewise. * config/tc-m32r.c: Likewise. * config/tc-m68hc11.c: Likewise. * config/tc-m68k.c: Likewise. * config/tc-microblaze.c: Likewise. * config/tc-mips.c: Likewise. * config/tc-mmix.c: Likewise. * config/tc-mn10200.c: Likewise. * config/tc-mn10300.c: Likewise. * config/tc-nios2.c: Likewise. * config/tc-ppc.c: Likewise. * config/tc-s390.c: Likewise. * config/tc-score.c: Likewise. * config/tc-score7.c: Likewise. * config/tc-sparc.c: Likewise. * config/tc-tic4x.c: Likewise. * config/tc-tic54x.c: Likewise. * config/tc-tic6x.c: Likewise. * config/tc-tilegx.c: Likewise. * config/tc-tilepro.c: Likewise. * config/tc-v850.c: Likewise. * config/tc-xtensa.c: Likewise. * config/tc-z80.c: Likewise. * dw2gencfi.c: Likewise. * dwarf2dbgc.: Likewise. * ecoff.c: Likewise. * read.c: Likewise. * stabs.c: Likewise. tests PR gas/18581 * gas/all/byte.d: Disable this test. Quoted expressions are now allowed in .byte directives. * gas/all/quoted-sym-names.s: New test. * gas/all/quoted-sym-names.d: Expected output. * gas/all/gas.exp: Run the new test.
2015-08-21 17:42:14 +02:00
name_end = get_symbol_name (&symbol_name);
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
seh_ctx_cur->handler.X_op = O_constant;
seh_ctx_cur->handler.X_add_number = 0;
if (strcasecmp (symbol_name, "@0") == 0
|| strcasecmp (symbol_name, "@null") == 0)
;
else if (strcasecmp (symbol_name, "@1") == 0)
seh_ctx_cur->handler.X_add_number = 1;
else
as_bad (_("unknown constant value '%s' for handler"), symbol_name);
Allow symbol and label names to be enclosed in double quotes. gas PR gas/18581 * expr.c (get_symbol_end): Rename to get_symbol_name. Add a return parameter pointing to the start of the symbol. Allow symbol names enclosed in double quotes. (restore_line_pointer): New function. Replace the NUL character inserted into the input stream with the given character. If the character was a double quote, advance the input pointer. * expr.h (get_symbol_end): Delete. (get_symbol_name): Add prototype. (restore_line_pointer): Prototype. * read.h (SKIP_WHITESPACE_AFTER_NAME): New macro. * doc/as.texinfo (Symbol Intro): Document that symbol names can now be enclosed in double quotes. * cond.c (s_ifdef): Replace get_symbol_end with get_symbol_name. Use restore_line_pointer to replace the NUL in the input stream. Use SKIP_WHITESPACE_AFTER_NAME to skip past the end of a symbol. Check for the use of double quoted symbol names. * expr.c: Likewise. * config/obj-aout.c: Likewise. * config/obj-coff-seh.c: Likewise. * config/obj-coff.c: Likewise. * config/obj-elf.c: Likewise. * config/obj-evax.c: Likewise. * config/obj-macho.c: Likewise. * config/obj-som.c: Likewise. * config/tc-alpha.c: Likewise. * config/tc-arc.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-dlx.c: Likewise. * config/tc-h8300.c: Likewise. * config/tc-hppa.c: Likewise. * config/tc-i370.c: Likewise. * config/tc-i386-intel.c: Likewise. * config/tc-i386.c: Likewise. * config/tc-i960.c: Likewise. * config/tc-ia64.c: Likewise. * config/tc-iq2000.c: Likewise. * config/tc-m32r.c: Likewise. * config/tc-m68hc11.c: Likewise. * config/tc-m68k.c: Likewise. * config/tc-microblaze.c: Likewise. * config/tc-mips.c: Likewise. * config/tc-mmix.c: Likewise. * config/tc-mn10200.c: Likewise. * config/tc-mn10300.c: Likewise. * config/tc-nios2.c: Likewise. * config/tc-ppc.c: Likewise. * config/tc-s390.c: Likewise. * config/tc-score.c: Likewise. * config/tc-score7.c: Likewise. * config/tc-sparc.c: Likewise. * config/tc-tic4x.c: Likewise. * config/tc-tic54x.c: Likewise. * config/tc-tic6x.c: Likewise. * config/tc-tilegx.c: Likewise. * config/tc-tilepro.c: Likewise. * config/tc-v850.c: Likewise. * config/tc-xtensa.c: Likewise. * config/tc-z80.c: Likewise. * dw2gencfi.c: Likewise. * dwarf2dbgc.: Likewise. * ecoff.c: Likewise. * read.c: Likewise. * stabs.c: Likewise. tests PR gas/18581 * gas/all/byte.d: Disable this test. Quoted expressions are now allowed in .byte directives. * gas/all/quoted-sym-names.s: New test. * gas/all/quoted-sym-names.d: Expected output. * gas/all/gas.exp: Run the new test.
2015-08-21 17:42:14 +02:00
(void) restore_line_pointer (name_end);
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
else
expression (&seh_ctx_cur->handler);
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
seh_ctx_cur->handler_data.X_op = O_constant;
seh_ctx_cur->handler_data.X_add_number = 0;
seh_ctx_cur->handler_flags = 0;
if (!skip_whitespace_and_comma (0))
2009-08-17 13:46:29 +02:00
return;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
if (seh_get_target_kind () == seh_kind_x64)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
do
2009-08-17 13:46:29 +02:00
{
Allow symbol and label names to be enclosed in double quotes. gas PR gas/18581 * expr.c (get_symbol_end): Rename to get_symbol_name. Add a return parameter pointing to the start of the symbol. Allow symbol names enclosed in double quotes. (restore_line_pointer): New function. Replace the NUL character inserted into the input stream with the given character. If the character was a double quote, advance the input pointer. * expr.h (get_symbol_end): Delete. (get_symbol_name): Add prototype. (restore_line_pointer): Prototype. * read.h (SKIP_WHITESPACE_AFTER_NAME): New macro. * doc/as.texinfo (Symbol Intro): Document that symbol names can now be enclosed in double quotes. * cond.c (s_ifdef): Replace get_symbol_end with get_symbol_name. Use restore_line_pointer to replace the NUL in the input stream. Use SKIP_WHITESPACE_AFTER_NAME to skip past the end of a symbol. Check for the use of double quoted symbol names. * expr.c: Likewise. * config/obj-aout.c: Likewise. * config/obj-coff-seh.c: Likewise. * config/obj-coff.c: Likewise. * config/obj-elf.c: Likewise. * config/obj-evax.c: Likewise. * config/obj-macho.c: Likewise. * config/obj-som.c: Likewise. * config/tc-alpha.c: Likewise. * config/tc-arc.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-dlx.c: Likewise. * config/tc-h8300.c: Likewise. * config/tc-hppa.c: Likewise. * config/tc-i370.c: Likewise. * config/tc-i386-intel.c: Likewise. * config/tc-i386.c: Likewise. * config/tc-i960.c: Likewise. * config/tc-ia64.c: Likewise. * config/tc-iq2000.c: Likewise. * config/tc-m32r.c: Likewise. * config/tc-m68hc11.c: Likewise. * config/tc-m68k.c: Likewise. * config/tc-microblaze.c: Likewise. * config/tc-mips.c: Likewise. * config/tc-mmix.c: Likewise. * config/tc-mn10200.c: Likewise. * config/tc-mn10300.c: Likewise. * config/tc-nios2.c: Likewise. * config/tc-ppc.c: Likewise. * config/tc-s390.c: Likewise. * config/tc-score.c: Likewise. * config/tc-score7.c: Likewise. * config/tc-sparc.c: Likewise. * config/tc-tic4x.c: Likewise. * config/tc-tic54x.c: Likewise. * config/tc-tic6x.c: Likewise. * config/tc-tilegx.c: Likewise. * config/tc-tilepro.c: Likewise. * config/tc-v850.c: Likewise. * config/tc-xtensa.c: Likewise. * config/tc-z80.c: Likewise. * dw2gencfi.c: Likewise. * dwarf2dbgc.: Likewise. * ecoff.c: Likewise. * read.c: Likewise. * stabs.c: Likewise. tests PR gas/18581 * gas/all/byte.d: Disable this test. Quoted expressions are now allowed in .byte directives. * gas/all/quoted-sym-names.s: New test. * gas/all/quoted-sym-names.d: Expected output. * gas/all/gas.exp: Run the new test.
2015-08-21 17:42:14 +02:00
name_end = get_symbol_name (&symbol_name);
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
if (strcasecmp (symbol_name, "@unwind") == 0)
seh_ctx_cur->handler_flags |= UNW_FLAG_UHANDLER;
else if (strcasecmp (symbol_name, "@except") == 0)
seh_ctx_cur->handler_flags |= UNW_FLAG_EHANDLER;
else
as_bad (_(".seh_handler constant '%s' unknown"), symbol_name);
Allow symbol and label names to be enclosed in double quotes. gas PR gas/18581 * expr.c (get_symbol_end): Rename to get_symbol_name. Add a return parameter pointing to the start of the symbol. Allow symbol names enclosed in double quotes. (restore_line_pointer): New function. Replace the NUL character inserted into the input stream with the given character. If the character was a double quote, advance the input pointer. * expr.h (get_symbol_end): Delete. (get_symbol_name): Add prototype. (restore_line_pointer): Prototype. * read.h (SKIP_WHITESPACE_AFTER_NAME): New macro. * doc/as.texinfo (Symbol Intro): Document that symbol names can now be enclosed in double quotes. * cond.c (s_ifdef): Replace get_symbol_end with get_symbol_name. Use restore_line_pointer to replace the NUL in the input stream. Use SKIP_WHITESPACE_AFTER_NAME to skip past the end of a symbol. Check for the use of double quoted symbol names. * expr.c: Likewise. * config/obj-aout.c: Likewise. * config/obj-coff-seh.c: Likewise. * config/obj-coff.c: Likewise. * config/obj-elf.c: Likewise. * config/obj-evax.c: Likewise. * config/obj-macho.c: Likewise. * config/obj-som.c: Likewise. * config/tc-alpha.c: Likewise. * config/tc-arc.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-dlx.c: Likewise. * config/tc-h8300.c: Likewise. * config/tc-hppa.c: Likewise. * config/tc-i370.c: Likewise. * config/tc-i386-intel.c: Likewise. * config/tc-i386.c: Likewise. * config/tc-i960.c: Likewise. * config/tc-ia64.c: Likewise. * config/tc-iq2000.c: Likewise. * config/tc-m32r.c: Likewise. * config/tc-m68hc11.c: Likewise. * config/tc-m68k.c: Likewise. * config/tc-microblaze.c: Likewise. * config/tc-mips.c: Likewise. * config/tc-mmix.c: Likewise. * config/tc-mn10200.c: Likewise. * config/tc-mn10300.c: Likewise. * config/tc-nios2.c: Likewise. * config/tc-ppc.c: Likewise. * config/tc-s390.c: Likewise. * config/tc-score.c: Likewise. * config/tc-score7.c: Likewise. * config/tc-sparc.c: Likewise. * config/tc-tic4x.c: Likewise. * config/tc-tic54x.c: Likewise. * config/tc-tic6x.c: Likewise. * config/tc-tilegx.c: Likewise. * config/tc-tilepro.c: Likewise. * config/tc-v850.c: Likewise. * config/tc-xtensa.c: Likewise. * config/tc-z80.c: Likewise. * dw2gencfi.c: Likewise. * dwarf2dbgc.: Likewise. * ecoff.c: Likewise. * read.c: Likewise. * stabs.c: Likewise. tests PR gas/18581 * gas/all/byte.d: Disable this test. Quoted expressions are now allowed in .byte directives. * gas/all/quoted-sym-names.s: New test. * gas/all/quoted-sym-names.d: Expected output. * gas/all/gas.exp: Run the new test.
2015-08-21 17:42:14 +02:00
(void) restore_line_pointer (name_end);
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
while (skip_whitespace_and_comma (0));
}
else
{
expression (&seh_ctx_cur->handler_data);
demand_empty_rest_of_line ();
if (seh_ctx_cur->handler_written)
as_warn (_(".seh_handler after .seh_eh is ignored"));
}
}
/* Switch to subsection for handler data for exception region (x64). */
static void
obj_coff_seh_handlerdata (int what ATTRIBUTE_UNUSED)
{
if (!verify_context_and_target (".seh_handlerdata", seh_kind_x64))
return;
demand_empty_rest_of_line ();
switch_xdata (seh_ctx_cur->subsection + 1, seh_ctx_cur->code_seg);
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
}
/* Mark end of current context. */
static void
do_seh_endproc (void)
{
seh_ctx_cur->end_addr = symbol_temp_new_now ();
write_function_xdata (seh_ctx_cur);
write_function_pdata (seh_ctx_cur);
seh_ctx_cur = NULL;
}
static void
obj_coff_seh_endproc (int what ATTRIBUTE_UNUSED)
{
demand_empty_rest_of_line ();
if (seh_ctx_cur == NULL)
{
as_bad (_(".seh_endproc used without .seh_proc"));
return;
}
seh_validate_seg (".seh_endproc");
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
do_seh_endproc ();
}
/* Mark begin of new context. */
static void
obj_coff_seh_proc (int what ATTRIBUTE_UNUSED)
{
char *symbol_name;
char name_end;
if (seh_ctx_cur != NULL)
{
as_bad (_("previous SEH entry not closed (missing .seh_endproc)"));
do_seh_endproc ();
}
if (*input_line_pointer == 0 || *input_line_pointer == '\n')
{
as_bad (_(".seh_proc requires function label name"));
demand_empty_rest_of_line ();
return;
}
seh_ctx_cur = XCNEW (seh_context);
seh_ctx_cur->code_seg = now_seg;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
if (seh_get_target_kind () == seh_kind_x64)
{
x_segcur = seh_hash_find_or_make (seh_ctx_cur->code_seg, ".xdata");
seh_ctx_cur->subsection = x_segcur->subseg;
x_segcur->subseg += 2;
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
SKIP_WHITESPACE ();
Allow symbol and label names to be enclosed in double quotes. gas PR gas/18581 * expr.c (get_symbol_end): Rename to get_symbol_name. Add a return parameter pointing to the start of the symbol. Allow symbol names enclosed in double quotes. (restore_line_pointer): New function. Replace the NUL character inserted into the input stream with the given character. If the character was a double quote, advance the input pointer. * expr.h (get_symbol_end): Delete. (get_symbol_name): Add prototype. (restore_line_pointer): Prototype. * read.h (SKIP_WHITESPACE_AFTER_NAME): New macro. * doc/as.texinfo (Symbol Intro): Document that symbol names can now be enclosed in double quotes. * cond.c (s_ifdef): Replace get_symbol_end with get_symbol_name. Use restore_line_pointer to replace the NUL in the input stream. Use SKIP_WHITESPACE_AFTER_NAME to skip past the end of a symbol. Check for the use of double quoted symbol names. * expr.c: Likewise. * config/obj-aout.c: Likewise. * config/obj-coff-seh.c: Likewise. * config/obj-coff.c: Likewise. * config/obj-elf.c: Likewise. * config/obj-evax.c: Likewise. * config/obj-macho.c: Likewise. * config/obj-som.c: Likewise. * config/tc-alpha.c: Likewise. * config/tc-arc.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-dlx.c: Likewise. * config/tc-h8300.c: Likewise. * config/tc-hppa.c: Likewise. * config/tc-i370.c: Likewise. * config/tc-i386-intel.c: Likewise. * config/tc-i386.c: Likewise. * config/tc-i960.c: Likewise. * config/tc-ia64.c: Likewise. * config/tc-iq2000.c: Likewise. * config/tc-m32r.c: Likewise. * config/tc-m68hc11.c: Likewise. * config/tc-m68k.c: Likewise. * config/tc-microblaze.c: Likewise. * config/tc-mips.c: Likewise. * config/tc-mmix.c: Likewise. * config/tc-mn10200.c: Likewise. * config/tc-mn10300.c: Likewise. * config/tc-nios2.c: Likewise. * config/tc-ppc.c: Likewise. * config/tc-s390.c: Likewise. * config/tc-score.c: Likewise. * config/tc-score7.c: Likewise. * config/tc-sparc.c: Likewise. * config/tc-tic4x.c: Likewise. * config/tc-tic54x.c: Likewise. * config/tc-tic6x.c: Likewise. * config/tc-tilegx.c: Likewise. * config/tc-tilepro.c: Likewise. * config/tc-v850.c: Likewise. * config/tc-xtensa.c: Likewise. * config/tc-z80.c: Likewise. * dw2gencfi.c: Likewise. * dwarf2dbgc.: Likewise. * ecoff.c: Likewise. * read.c: Likewise. * stabs.c: Likewise. tests PR gas/18581 * gas/all/byte.d: Disable this test. Quoted expressions are now allowed in .byte directives. * gas/all/quoted-sym-names.s: New test. * gas/all/quoted-sym-names.d: Expected output. * gas/all/gas.exp: Run the new test.
2015-08-21 17:42:14 +02:00
name_end = get_symbol_name (&symbol_name);
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
seh_ctx_cur->func_name = xstrdup (symbol_name);
Allow symbol and label names to be enclosed in double quotes. gas PR gas/18581 * expr.c (get_symbol_end): Rename to get_symbol_name. Add a return parameter pointing to the start of the symbol. Allow symbol names enclosed in double quotes. (restore_line_pointer): New function. Replace the NUL character inserted into the input stream with the given character. If the character was a double quote, advance the input pointer. * expr.h (get_symbol_end): Delete. (get_symbol_name): Add prototype. (restore_line_pointer): Prototype. * read.h (SKIP_WHITESPACE_AFTER_NAME): New macro. * doc/as.texinfo (Symbol Intro): Document that symbol names can now be enclosed in double quotes. * cond.c (s_ifdef): Replace get_symbol_end with get_symbol_name. Use restore_line_pointer to replace the NUL in the input stream. Use SKIP_WHITESPACE_AFTER_NAME to skip past the end of a symbol. Check for the use of double quoted symbol names. * expr.c: Likewise. * config/obj-aout.c: Likewise. * config/obj-coff-seh.c: Likewise. * config/obj-coff.c: Likewise. * config/obj-elf.c: Likewise. * config/obj-evax.c: Likewise. * config/obj-macho.c: Likewise. * config/obj-som.c: Likewise. * config/tc-alpha.c: Likewise. * config/tc-arc.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-dlx.c: Likewise. * config/tc-h8300.c: Likewise. * config/tc-hppa.c: Likewise. * config/tc-i370.c: Likewise. * config/tc-i386-intel.c: Likewise. * config/tc-i386.c: Likewise. * config/tc-i960.c: Likewise. * config/tc-ia64.c: Likewise. * config/tc-iq2000.c: Likewise. * config/tc-m32r.c: Likewise. * config/tc-m68hc11.c: Likewise. * config/tc-m68k.c: Likewise. * config/tc-microblaze.c: Likewise. * config/tc-mips.c: Likewise. * config/tc-mmix.c: Likewise. * config/tc-mn10200.c: Likewise. * config/tc-mn10300.c: Likewise. * config/tc-nios2.c: Likewise. * config/tc-ppc.c: Likewise. * config/tc-s390.c: Likewise. * config/tc-score.c: Likewise. * config/tc-score7.c: Likewise. * config/tc-sparc.c: Likewise. * config/tc-tic4x.c: Likewise. * config/tc-tic54x.c: Likewise. * config/tc-tic6x.c: Likewise. * config/tc-tilegx.c: Likewise. * config/tc-tilepro.c: Likewise. * config/tc-v850.c: Likewise. * config/tc-xtensa.c: Likewise. * config/tc-z80.c: Likewise. * dw2gencfi.c: Likewise. * dwarf2dbgc.: Likewise. * ecoff.c: Likewise. * read.c: Likewise. * stabs.c: Likewise. tests PR gas/18581 * gas/all/byte.d: Disable this test. Quoted expressions are now allowed in .byte directives. * gas/all/quoted-sym-names.s: New test. * gas/all/quoted-sym-names.d: Expected output. * gas/all/gas.exp: Run the new test.
2015-08-21 17:42:14 +02:00
(void) restore_line_pointer (name_end);
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
demand_empty_rest_of_line ();
seh_ctx_cur->start_addr = symbol_temp_new_now ();
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Mark end of prologue for current context. */
static void
obj_coff_seh_endprologue (int what ATTRIBUTE_UNUSED)
{
if (!verify_context (".seh_endprologue")
|| !seh_validate_seg (".seh_endprologue"))
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
return;
demand_empty_rest_of_line ();
if (seh_ctx_cur->endprologue_addr != NULL)
as_warn (_("duplicate .seh_endprologue in .seh_proc block"));
else
seh_ctx_cur->endprologue_addr = symbol_temp_new_now ();
}
/* End-of-file hook. */
2009-08-17 13:46:29 +02:00
void
obj_coff_seh_do_final (void)
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
if (seh_ctx_cur != NULL)
as_bad (_("open SEH entry at end of file (missing .seh_endproc)"));
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Enter a prologue element into current context (x64). */
2009-08-17 13:46:29 +02:00
static void
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
seh_x64_make_prologue_element (int code, int info, offsetT off)
2009-08-17 13:46:29 +02:00
{
seh_prologue_element *n;
2009-08-17 13:46:29 +02:00
if (seh_ctx_cur == NULL)
return;
if (seh_ctx_cur->elems_count == seh_ctx_cur->elems_max)
{
seh_ctx_cur->elems_max += 8;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
seh_ctx_cur->elems = XRESIZEVEC (seh_prologue_element,
seh_ctx_cur->elems,
seh_ctx_cur->elems_max);
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
n = &seh_ctx_cur->elems[seh_ctx_cur->elems_count++];
n->code = code;
n->info = info;
n->off = off;
n->pc_addr = symbol_temp_new_now ();
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Helper to read a register name from input stream (x64). */
2009-08-17 13:46:29 +02:00
static int
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
seh_x64_read_reg (const char *directive, int kind)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
static const char * const int_regs[16] =
{ "rax", "rcx", "rdx", "rbx", "rsp", "rbp","rsi","rdi",
"r8","r9","r10","r11","r12","r13","r14","r15" };
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
static const char * const xmm_regs[16] =
{ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
"xmm8", "xmm9", "xmm10","xmm11","xmm12","xmm13","xmm14","xmm15" };
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
const char * const *regs = NULL;
2009-08-17 13:46:29 +02:00
char name_end;
char *symbol_name = NULL;
int i;
switch (kind)
{
case 0:
case 1:
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
regs = int_regs;
break;
case 2:
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
regs = xmm_regs;
break;
default:
abort ();
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
SKIP_WHITESPACE ();
2009-08-17 13:46:29 +02:00
if (*input_line_pointer == '%')
++input_line_pointer;
Allow symbol and label names to be enclosed in double quotes. gas PR gas/18581 * expr.c (get_symbol_end): Rename to get_symbol_name. Add a return parameter pointing to the start of the symbol. Allow symbol names enclosed in double quotes. (restore_line_pointer): New function. Replace the NUL character inserted into the input stream with the given character. If the character was a double quote, advance the input pointer. * expr.h (get_symbol_end): Delete. (get_symbol_name): Add prototype. (restore_line_pointer): Prototype. * read.h (SKIP_WHITESPACE_AFTER_NAME): New macro. * doc/as.texinfo (Symbol Intro): Document that symbol names can now be enclosed in double quotes. * cond.c (s_ifdef): Replace get_symbol_end with get_symbol_name. Use restore_line_pointer to replace the NUL in the input stream. Use SKIP_WHITESPACE_AFTER_NAME to skip past the end of a symbol. Check for the use of double quoted symbol names. * expr.c: Likewise. * config/obj-aout.c: Likewise. * config/obj-coff-seh.c: Likewise. * config/obj-coff.c: Likewise. * config/obj-elf.c: Likewise. * config/obj-evax.c: Likewise. * config/obj-macho.c: Likewise. * config/obj-som.c: Likewise. * config/tc-alpha.c: Likewise. * config/tc-arc.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-dlx.c: Likewise. * config/tc-h8300.c: Likewise. * config/tc-hppa.c: Likewise. * config/tc-i370.c: Likewise. * config/tc-i386-intel.c: Likewise. * config/tc-i386.c: Likewise. * config/tc-i960.c: Likewise. * config/tc-ia64.c: Likewise. * config/tc-iq2000.c: Likewise. * config/tc-m32r.c: Likewise. * config/tc-m68hc11.c: Likewise. * config/tc-m68k.c: Likewise. * config/tc-microblaze.c: Likewise. * config/tc-mips.c: Likewise. * config/tc-mmix.c: Likewise. * config/tc-mn10200.c: Likewise. * config/tc-mn10300.c: Likewise. * config/tc-nios2.c: Likewise. * config/tc-ppc.c: Likewise. * config/tc-s390.c: Likewise. * config/tc-score.c: Likewise. * config/tc-score7.c: Likewise. * config/tc-sparc.c: Likewise. * config/tc-tic4x.c: Likewise. * config/tc-tic54x.c: Likewise. * config/tc-tic6x.c: Likewise. * config/tc-tilegx.c: Likewise. * config/tc-tilepro.c: Likewise. * config/tc-v850.c: Likewise. * config/tc-xtensa.c: Likewise. * config/tc-z80.c: Likewise. * dw2gencfi.c: Likewise. * dwarf2dbgc.: Likewise. * ecoff.c: Likewise. * read.c: Likewise. * stabs.c: Likewise. tests PR gas/18581 * gas/all/byte.d: Disable this test. Quoted expressions are now allowed in .byte directives. * gas/all/quoted-sym-names.s: New test. * gas/all/quoted-sym-names.d: Expected output. * gas/all/gas.exp: Run the new test.
2015-08-21 17:42:14 +02:00
name_end = get_symbol_name (& symbol_name);
2009-08-17 13:46:29 +02:00
for (i = 0; i < 16; i++)
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
if (! strcasecmp (regs[i], symbol_name))
2009-08-17 13:46:29 +02:00
break;
Allow symbol and label names to be enclosed in double quotes. gas PR gas/18581 * expr.c (get_symbol_end): Rename to get_symbol_name. Add a return parameter pointing to the start of the symbol. Allow symbol names enclosed in double quotes. (restore_line_pointer): New function. Replace the NUL character inserted into the input stream with the given character. If the character was a double quote, advance the input pointer. * expr.h (get_symbol_end): Delete. (get_symbol_name): Add prototype. (restore_line_pointer): Prototype. * read.h (SKIP_WHITESPACE_AFTER_NAME): New macro. * doc/as.texinfo (Symbol Intro): Document that symbol names can now be enclosed in double quotes. * cond.c (s_ifdef): Replace get_symbol_end with get_symbol_name. Use restore_line_pointer to replace the NUL in the input stream. Use SKIP_WHITESPACE_AFTER_NAME to skip past the end of a symbol. Check for the use of double quoted symbol names. * expr.c: Likewise. * config/obj-aout.c: Likewise. * config/obj-coff-seh.c: Likewise. * config/obj-coff.c: Likewise. * config/obj-elf.c: Likewise. * config/obj-evax.c: Likewise. * config/obj-macho.c: Likewise. * config/obj-som.c: Likewise. * config/tc-alpha.c: Likewise. * config/tc-arc.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-dlx.c: Likewise. * config/tc-h8300.c: Likewise. * config/tc-hppa.c: Likewise. * config/tc-i370.c: Likewise. * config/tc-i386-intel.c: Likewise. * config/tc-i386.c: Likewise. * config/tc-i960.c: Likewise. * config/tc-ia64.c: Likewise. * config/tc-iq2000.c: Likewise. * config/tc-m32r.c: Likewise. * config/tc-m68hc11.c: Likewise. * config/tc-m68k.c: Likewise. * config/tc-microblaze.c: Likewise. * config/tc-mips.c: Likewise. * config/tc-mmix.c: Likewise. * config/tc-mn10200.c: Likewise. * config/tc-mn10300.c: Likewise. * config/tc-nios2.c: Likewise. * config/tc-ppc.c: Likewise. * config/tc-s390.c: Likewise. * config/tc-score.c: Likewise. * config/tc-score7.c: Likewise. * config/tc-sparc.c: Likewise. * config/tc-tic4x.c: Likewise. * config/tc-tic54x.c: Likewise. * config/tc-tic6x.c: Likewise. * config/tc-tilegx.c: Likewise. * config/tc-tilepro.c: Likewise. * config/tc-v850.c: Likewise. * config/tc-xtensa.c: Likewise. * config/tc-z80.c: Likewise. * dw2gencfi.c: Likewise. * dwarf2dbgc.: Likewise. * ecoff.c: Likewise. * read.c: Likewise. * stabs.c: Likewise. tests PR gas/18581 * gas/all/byte.d: Disable this test. Quoted expressions are now allowed in .byte directives. * gas/all/quoted-sym-names.s: New test. * gas/all/quoted-sym-names.d: Expected output. * gas/all/gas.exp: Run the new test.
2015-08-21 17:42:14 +02:00
(void) restore_line_pointer (name_end);
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Error if register not found, or EAX used as a frame pointer. */
if (i == 16 || (kind == 0 && i == 0))
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
as_bad (_("invalid register for %s"), directive);
return -1;
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
return i;
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Add a register push-unwind token to the current context. */
2009-08-17 13:46:29 +02:00
static void
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
obj_coff_seh_pushreg (int what ATTRIBUTE_UNUSED)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
int reg;
if (!verify_context_and_target (".seh_pushreg", seh_kind_x64)
|| !seh_validate_seg (".seh_pushreg"))
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
return;
reg = seh_x64_read_reg (".seh_pushreg", 1);
2009-08-17 13:46:29 +02:00
demand_empty_rest_of_line ();
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
if (reg < 0)
return;
seh_x64_make_prologue_element (UWOP_PUSH_NONVOL, reg, 0);
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Add a register frame-unwind token to the current context. */
2009-08-17 13:46:29 +02:00
static void
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
obj_coff_seh_pushframe (int what ATTRIBUTE_UNUSED)
2009-08-17 13:46:29 +02:00
{
if (!verify_context_and_target (".seh_pushframe", seh_kind_x64)
|| !seh_validate_seg (".seh_pushframe"))
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
return;
2009-08-17 13:46:29 +02:00
demand_empty_rest_of_line ();
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
seh_x64_make_prologue_element (UWOP_PUSH_MACHFRAME, 0, 0);
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Add a register save-unwind token to current context. */
2009-08-17 13:46:29 +02:00
static void
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
obj_coff_seh_save (int what)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
const char *directive = (what == 1 ? ".seh_savereg" : ".seh_savexmm");
int code, reg, scale;
offsetT off;
2009-08-17 13:46:29 +02:00
if (!verify_context_and_target (directive, seh_kind_x64)
|| !seh_validate_seg (directive))
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
return;
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
reg = seh_x64_read_reg (directive, what);
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
if (!skip_whitespace_and_comma (1))
return;
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
off = get_absolute_expression ();
2009-08-17 13:46:29 +02:00
demand_empty_rest_of_line ();
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
if (reg < 0)
return;
if (off < 0)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
as_bad (_("%s offset is negative"), directive);
2009-08-17 13:46:29 +02:00
return;
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
scale = (what == 1 ? 8 : 16);
2009-08-17 13:46:29 +02:00
if ((off & (scale - 1)) == 0 && off <= (offsetT) (0xffff * scale))
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
code = (what == 1 ? UWOP_SAVE_NONVOL : UWOP_SAVE_XMM128);
off /= scale;
2009-08-17 13:46:29 +02:00
}
else if (off < (offsetT) 0xffffffff)
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
code = (what == 1 ? UWOP_SAVE_NONVOL_FAR : UWOP_SAVE_XMM128_FAR);
else
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
as_bad (_("%s offset out of range"), directive);
return;
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
seh_x64_make_prologue_element (code, reg, off);
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Add a stack-allocation token to current context. */
2009-08-17 13:46:29 +02:00
static void
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
obj_coff_seh_stackalloc (int what ATTRIBUTE_UNUSED)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
offsetT off;
int code, info;
if (!verify_context_and_target (".seh_stackalloc", seh_kind_x64)
|| !seh_validate_seg (".seh_stackalloc"))
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
return;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
off = get_absolute_expression ();
2009-08-17 13:46:29 +02:00
demand_empty_rest_of_line ();
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
if (off == 0)
return;
if (off < 0)
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
as_bad (_(".seh_stackalloc offset is negative"));
return;
}
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
if ((off & 7) == 0 && off <= 128)
code = UWOP_ALLOC_SMALL, info = (off - 8) >> 3, off = 0;
else if ((off & 7) == 0 && off <= (offsetT) (0xffff * 8))
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
code = UWOP_ALLOC_LARGE, info = 0, off >>= 3;
else if (off <= (offsetT) 0xffffffff)
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
code = UWOP_ALLOC_LARGE, info = 1;
2009-08-17 13:46:29 +02:00
else
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
as_bad (_(".seh_stackalloc offset out of range"));
return;
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
seh_x64_make_prologue_element (code, info, off);
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Add a frame-pointer token to current context. */
2009-08-17 13:46:29 +02:00
static void
obj_coff_seh_setframe (int what ATTRIBUTE_UNUSED)
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
offsetT off;
2009-08-17 13:46:29 +02:00
int reg;
if (!verify_context_and_target (".seh_setframe", seh_kind_x64)
|| !seh_validate_seg (".seh_setframe"))
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
return;
reg = seh_x64_read_reg (".seh_setframe", 0);
if (!skip_whitespace_and_comma (1))
return;
off = get_absolute_expression ();
demand_empty_rest_of_line ();
if (reg < 0)
return;
if (off < 0)
as_bad (_(".seh_setframe offset is negative"));
else if (off > 240)
as_bad (_(".seh_setframe offset out of range"));
else if (off & 15)
as_bad (_(".seh_setframe offset not a multiple of 16"));
else if (seh_ctx_cur->framereg != 0)
as_bad (_("duplicate .seh_setframe in current .seh_proc"));
else
{
seh_ctx_cur->framereg = reg;
seh_ctx_cur->frameoff = off;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
seh_x64_make_prologue_element (UWOP_SET_FPREG, 0, 0);
}
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Data writing routines. */
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Output raw integers in 1, 2, or 4 bytes. */
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
static inline void
out_one (int byte)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
FRAG_APPEND_1_CHAR (byte);
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
static inline void
out_two (int data)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
md_number_to_chars (frag_more (2), data, 2);
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
static inline void
out_four (int data)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
md_number_to_chars (frag_more (4), data, 4);
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Write out prologue data for x64. */
static void
seh_x64_write_prologue_data (const seh_context *c)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
int i;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* We have to store in reverse order. */
for (i = c->elems_count - 1; i >= 0; --i)
{
const seh_prologue_element *e = c->elems + i;
expressionS exp;
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* First comes byte offset in code. */
exp.X_op = O_subtract;
exp.X_add_symbol = e->pc_addr;
exp.X_op_symbol = c->start_addr;
exp.X_add_number = 0;
emit_expr (&exp, 1);
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Second comes code+info packed into a byte. */
out_one ((e->info << 4) | e->code);
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
switch (e->code)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
case UWOP_PUSH_NONVOL:
case UWOP_ALLOC_SMALL:
case UWOP_SET_FPREG:
case UWOP_PUSH_MACHFRAME:
/* These have no extra data. */
2009-08-17 13:46:29 +02:00
break;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
case UWOP_ALLOC_LARGE:
if (e->info)
{
case UWOP_SAVE_NONVOL_FAR:
case UWOP_SAVE_XMM128_FAR:
/* An unscaled 4 byte offset. */
out_four (e->off);
break;
}
/* FALLTHRU */
case UWOP_SAVE_NONVOL:
case UWOP_SAVE_XMM128:
/* A scaled 2 byte offset. */
out_two (e->off);
break;
default:
abort ();
2009-08-17 13:46:29 +02:00
}
}
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
static int
seh_x64_size_prologue_data (const seh_context *c)
{
int i, ret = 0;
for (i = c->elems_count - 1; i >= 0; --i)
switch (c->elems[i].code)
{
case UWOP_PUSH_NONVOL:
case UWOP_ALLOC_SMALL:
case UWOP_SET_FPREG:
case UWOP_PUSH_MACHFRAME:
ret += 1;
break;
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
case UWOP_SAVE_NONVOL:
case UWOP_SAVE_XMM128:
ret += 2;
break;
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
case UWOP_SAVE_NONVOL_FAR:
case UWOP_SAVE_XMM128_FAR:
ret += 3;
break;
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
case UWOP_ALLOC_LARGE:
ret += (c->elems[i].info ? 3 : 2);
break;
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
default:
abort ();
}
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
return ret;
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Write out the xdata information for one function (x64). */
static void
seh_x64_write_function_xdata (seh_context *c)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
int flags, count_unwind_codes;
expressionS exp;
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Set 4-byte alignment. */
frag_align (2, 0, 0);
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
c->xdata_addr = symbol_temp_new_now ();
flags = c->handler_flags;
count_unwind_codes = seh_x64_size_prologue_data (c);
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* ubyte:3 version, ubyte:5 flags. */
out_one ((flags << 3) | 1);
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Size of prologue. */
if (c->endprologue_addr)
{
exp.X_op = O_subtract;
exp.X_add_symbol = c->endprologue_addr;
exp.X_op_symbol = c->start_addr;
exp.X_add_number = 0;
emit_expr (&exp, 1);
}
else
out_one (0);
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Number of slots (i.e. shorts) in the unwind codes array. */
if (count_unwind_codes > 255)
as_fatal (_("too much unwind data in this .seh_proc"));
out_one (count_unwind_codes);
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* ubyte:4 frame-reg, ubyte:4 frame-reg-offset. */
/* Note that frameoff is already a multiple of 16, and therefore
the offset is already both scaled and shifted into place. */
out_one (c->frameoff | c->framereg);
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
seh_x64_write_prologue_data (c);
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* We need to align prologue data. */
if (count_unwind_codes & 1)
out_two (0);
if (flags & (UNW_FLAG_EHANDLER | UNW_FLAG_UHANDLER))
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Force the use of segment-relative relocations instead of absolute
valued expressions. Don't adjust for constants (e.g. NULL). */
if (c->handler.X_op == O_symbol)
c->handler.X_op = O_symbol_rva;
emit_expr (&c->handler, 4);
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Handler data will be tacked in here by subsections. */
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Write out xdata for one function. */
2009-08-17 13:46:29 +02:00
static void
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
write_function_xdata (seh_context *c)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
segT save_seg = now_seg;
int save_subseg = now_subseg;
/* MIPS, SH, ARM don't have xdata. */
if (seh_get_target_kind () != seh_kind_x64)
2009-08-17 13:46:29 +02:00
return;
switch_xdata (c->subsection, c->code_seg);
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
seh_x64_write_function_xdata (c);
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
subseg_set (save_seg, save_subseg);
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Write pdata section data for one function (arm). */
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
static void
seh_arm_write_function_pdata (seh_context *c)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
expressionS exp;
unsigned int prol_len = 0, func_len = 0;
unsigned int val;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Start address of the function. */
exp.X_op = O_symbol;
exp.X_add_symbol = c->start_addr;
exp.X_add_number = 0;
emit_expr (&exp, 4);
exp.X_op = O_subtract;
exp.X_add_symbol = c->end_addr;
exp.X_op_symbol = c->start_addr;
exp.X_add_number = 0;
if (resolve_expression (&exp) && exp.X_op == O_constant)
func_len = exp.X_add_number;
2009-08-17 13:46:29 +02:00
else
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
as_bad (_(".seh_endproc in a different section from .seh_proc"));
if (c->endprologue_addr)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
exp.X_op = O_subtract;
exp.X_add_symbol = c->endprologue_addr;
exp.X_op_symbol = c->start_addr;
exp.X_add_number = 0;
if (resolve_expression (&exp) && exp.X_op == O_constant)
prol_len = exp.X_add_number;
else
as_bad (_(".seh_endprologue in a different section from .seh_proc"));
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Both function and prologue are in units of instructions. */
func_len >>= (c->use_instruction_32 ? 2 : 1);
prol_len >>= (c->use_instruction_32 ? 2 : 1);
/* Assemble the second word of the pdata. */
val = prol_len & 0xff;
val |= (func_len & 0x3fffff) << 8;
if (c->use_instruction_32)
val |= 0x40000000U;
if (c->handler_written)
val |= 0x80000000U;
out_four (val);
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
/* Write out pdata for one function. */
2009-08-17 13:46:29 +02:00
static void
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
write_function_pdata (seh_context *c)
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
expressionS exp;
segT save_seg = now_seg;
int save_subseg = now_subseg;
memset (&exp, 0, sizeof (expressionS));
switch_pdata (c->code_seg);
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
switch (seh_get_target_kind ())
2009-08-17 13:46:29 +02:00
{
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
case seh_kind_x64:
exp.X_op = O_symbol_rva;
exp.X_add_number = 0;
exp.X_add_symbol = c->start_addr;
emit_expr (&exp, 4);
exp.X_op = O_symbol_rva;
exp.X_add_number = 0;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
exp.X_add_symbol = c->end_addr;
emit_expr (&exp, 4);
exp.X_op = O_symbol_rva;
exp.X_add_number = 0;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
exp.X_add_symbol = c->xdata_addr;
emit_expr (&exp, 4);
break;
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
case seh_kind_mips:
exp.X_op = O_symbol;
exp.X_add_number = 0;
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
exp.X_add_symbol = c->start_addr;
emit_expr (&exp, 4);
exp.X_add_symbol = c->end_addr;
emit_expr (&exp, 4);
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
emit_expr (&c->handler, 4);
emit_expr (&c->handler_data, 4);
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
exp.X_add_symbol = (c->endprologue_addr
? c->endprologue_addr
: c->start_addr);
emit_expr (&exp, 4);
break;
2009-08-17 13:46:29 +02:00
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
case seh_kind_arm:
seh_arm_write_function_pdata (c);
break;
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
default:
abort ();
2009-08-17 13:46:29 +02:00
}
* config/obj-coff-seh.c: Rewrite the entire file. (symtab, symptr, reltab, relcount, relsize): Remove. (seh_ctx_root, seh_ctx): Remove. (xdata_seg, xdata_subseg, pdata_seg): New. (switch_xdata, switch_pdata): New. (verify_context, verify_context_and_target, skip_whitespace_and_comma): New parsing functions. Rewrite all parsing functions to use them. (obj_coff_seh_32): Fix != arm thinko. (obj_coff_seh_handler): For x64, don't accept handler pointer here, only flags. (obj_coff_seh_handlerdata): New. (do_seh_endproc): Split out of ... (obj_coff_seh_endproc): ... here. (obj_coff_seh_proc): Use it, if needed. (seh_x64_make_prologue_element): Use XRESIZEVEC, symbol_temp_new_now. (seh_x64_read_reg): Remove mm_regs alternative. Tidy integer reg alternatives. Don't slurp commas. (seh_read_offset): Remove. (obj_coff_seh_pushframe): Split out from obj_coff_seh_push. (obj_coff_seh_scope): Remove. (obj_coff_seh_save): Decide UWOP_SAVE_* vs _FAR immediately. (obj_coff_seh_stackalloc): Decide _SMALL vs _LARGE immediately. (out_one, out_two, out_four): New. (seh_x64_write_prologue_data, seh_x64_size_prologue_data, seh_x64_write_function_xdata, write_function_xdata): Rewrite from seh_x64_write_xdata, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, and seh_create_unwind_data. (seh_arm_write_function_pdata): Rewrite from seh_arm_create_pdata. (write_function_pdata): Rewrite from make_function_entry_pdata. (seh_write_text_eh_data, make_function_entry_pdata, seh_arm_create_pdata, seh_arm_write_pdata, seh_reloc, save_relocs, seh_symbol_init, seh_symbol, quick_section, seh_emit_rva, seh_emit_long, seh_make_globl, seh_make_section2, seh_make_section, seh_make_xlbl_name, make_seh_text_label, seh_fill_pcsyms, seh_needed_unwind_info, seh_store_elm_data, seh_getelm_data_size, seh_getsize_of_unwind_entry, seh_make_unwind_entry, seh_getsize_unwind_data, seh_create_unwind_data, seh_make_function_entry_xdata, seh_x64_makescope_elem): Remove. * config/obj-coff-seh.h (SEH_CMDS): Remove seh_savemm, seh_scope. Add seh_handlerdata. Adjust function/what arguments for seh_savereg, seh_pushframe, seh_stackalloc. (struct seh_prologue_element): Adjust members to closer match the elements of the UNWIND_CODE structure. (struct seh_scope_elem): Remove. (struct seh_context): Replace char* members with symbolS or expressionS as appropriate. Sort members by ARM/x64 applicability. Remove obsolete stuff wrt direct symbol and reloc manipulation.
2010-08-30 23:51:28 +02:00
subseg_set (save_seg, save_subseg);
2009-08-17 13:46:29 +02:00
}