1 /* seh pdata/xdata coff object file format
2 Copyright (C) 2009-2022 Free Software Foundation, Inc.
4 This file is part of GAS.
6 GAS is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 GAS is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GAS; see the file COPYING. If not, write to the Free
18 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
21 #include "obj-coff-seh.h"
24 /* Private segment collection list. */
32 static seh_context
*seh_ctx_cur
= NULL
;
34 static htab_t seh_hash
;
36 static struct seh_seg_list
*x_segcur
= NULL
;
37 static struct seh_seg_list
*p_segcur
= NULL
;
39 static void write_function_xdata (seh_context
*);
40 static void write_function_pdata (seh_context
*);
43 /* Build based on segment the derived .pdata/.xdata
44 segment name containing origin segment's postfix name part. */
46 get_pxdata_name (segT seg
, const char *base_name
)
48 const char *name
,*dollar
, *dot
;
51 name
= bfd_section_name (seg
);
53 dollar
= strchr (name
, '$');
54 dot
= strchr (name
+ 1, '.');
62 else if (dot
< dollar
)
67 sname
= concat (base_name
, name
, NULL
);
72 /* Allocate a seh_seg_list structure. */
73 static struct seh_seg_list
*
74 alloc_pxdata_item (segT seg
, int subseg
, char *name
)
76 struct seh_seg_list
*r
;
78 r
= (struct seh_seg_list
*)
79 xmalloc (sizeof (struct seh_seg_list
) + strlen (name
));
86 /* Generate pdata/xdata segment with same linkonce properties
89 make_pxdata_seg (segT cseg
, char *name
)
91 segT save_seg
= now_seg
;
92 int save_subseg
= now_subseg
;
96 r
= subseg_new (name
, 0);
97 /* Check if code segment is marked as linked once. */
98 flags
= (bfd_section_flags (cseg
)
99 & (SEC_LINK_ONCE
| SEC_LINK_DUPLICATES_DISCARD
100 | SEC_LINK_DUPLICATES_ONE_ONLY
| SEC_LINK_DUPLICATES_SAME_SIZE
101 | SEC_LINK_DUPLICATES_SAME_CONTENTS
));
103 /* Add standard section flags. */
104 flags
|= SEC_ALLOC
| SEC_LOAD
| SEC_READONLY
| SEC_DATA
;
106 /* Apply possibly linked once flags to new generated segment, too. */
107 if (!bfd_set_section_flags (r
, flags
))
108 as_bad (_("bfd_set_section_flags: %s"),
109 bfd_errmsg (bfd_get_error ()));
111 /* Restore to previous segment. */
112 subseg_set (save_seg
, save_subseg
);
117 seh_hash_insert (const char *name
, struct seh_seg_list
*item
)
119 str_hash_insert (seh_hash
, name
, item
, 1);
122 static struct seh_seg_list
*
123 seh_hash_find (char *name
)
125 return (struct seh_seg_list
*) str_hash_find (seh_hash
, name
);
128 static struct seh_seg_list
*
129 seh_hash_find_or_make (segT cseg
, const char *base_name
)
131 struct seh_seg_list
*item
;
134 /* Initialize seh_hash once. */
136 seh_hash
= str_htab_create ();
138 name
= get_pxdata_name (cseg
, base_name
);
140 item
= seh_hash_find (name
);
143 item
= alloc_pxdata_item (make_pxdata_seg (cseg
, name
), 0, name
);
145 seh_hash_insert (item
->seg_name
, item
);
153 /* Check if current segment has same name. */
155 seh_validate_seg (const char *directive
)
157 const char *cseg_name
, *nseg_name
;
158 if (seh_ctx_cur
->code_seg
== now_seg
)
160 cseg_name
= bfd_section_name (seh_ctx_cur
->code_seg
);
161 nseg_name
= bfd_section_name (now_seg
);
162 as_bad (_("%s used in segment '%s' instead of expected '%s'"),
163 directive
, nseg_name
, cseg_name
);
164 ignore_rest_of_line ();
168 /* Switch back to the code section, whatever that may be. */
170 obj_coff_seh_code (int ignored ATTRIBUTE_UNUSED
)
172 subseg_set (seh_ctx_cur
->code_seg
, 0);
176 switch_xdata (int subseg
, segT code_seg
)
178 x_segcur
= seh_hash_find_or_make (code_seg
, ".xdata");
180 subseg_set (x_segcur
->seg
, subseg
);
184 switch_pdata (segT code_seg
)
186 p_segcur
= seh_hash_find_or_make (code_seg
, ".pdata");
188 subseg_set (p_segcur
->seg
, p_segcur
->subseg
);
191 /* Parsing routines. */
193 /* Return the style of SEH unwind info to generate. */
196 seh_get_target_kind (void)
199 return seh_kind_unknown
;
200 switch (bfd_get_arch (stdoutput
))
203 case bfd_arch_powerpc
:
207 switch (bfd_get_mach (stdoutput
))
209 case bfd_mach_x86_64
:
210 case bfd_mach_x86_64_intel_syntax
:
217 return seh_kind_mips
;
219 /* Should return seh_kind_x64. But not implemented yet. */
220 return seh_kind_unknown
;
224 return seh_kind_unknown
;
227 /* Verify that we're in the context of a seh_proc. */
230 verify_context (const char *directive
)
232 if (seh_ctx_cur
== NULL
)
234 as_bad (_("%s used outside of .seh_proc block"), directive
);
235 ignore_rest_of_line ();
241 /* Similar, except we also verify the appropriate target. */
244 verify_context_and_target (const char *directive
, seh_kind target
)
246 if (seh_get_target_kind () != target
)
248 as_warn (_("%s ignored for this target"), directive
);
249 ignore_rest_of_line ();
252 return verify_context (directive
);
255 /* Skip whitespace and a comma. Error if the comma is not seen. */
258 skip_whitespace_and_comma (int required
)
261 if (*input_line_pointer
== ',')
263 input_line_pointer
++;
269 as_bad (_("missing separator"));
270 ignore_rest_of_line ();
273 demand_empty_rest_of_line ();
277 /* Mark current context to use 32-bit instruction (arm). */
280 obj_coff_seh_32 (int what
)
282 if (!verify_context_and_target ((what
? ".seh_32" : ".seh_no32"),
286 seh_ctx_cur
->use_instruction_32
= (what
? 1 : 0);
287 demand_empty_rest_of_line ();
290 /* Set for current context the handler and optional data (arm). */
293 obj_coff_seh_eh (int what ATTRIBUTE_UNUSED
)
295 if (!verify_context_and_target (".seh_eh", seh_kind_arm
))
298 /* Write block to .text if exception handler is set. */
299 seh_ctx_cur
->handler_written
= 1;
300 emit_expr (&seh_ctx_cur
->handler
, 4);
301 emit_expr (&seh_ctx_cur
->handler_data
, 4);
303 demand_empty_rest_of_line ();
306 /* Set for current context the default handler (x64). */
309 obj_coff_seh_handler (int what ATTRIBUTE_UNUSED
)
314 if (!verify_context (".seh_handler"))
317 if (*input_line_pointer
== 0 || *input_line_pointer
== '\n')
319 as_bad (_(".seh_handler requires a handler"));
320 demand_empty_rest_of_line ();
326 if (*input_line_pointer
== '@')
328 name_end
= get_symbol_name (&symbol_name
);
330 seh_ctx_cur
->handler
.X_op
= O_constant
;
331 seh_ctx_cur
->handler
.X_add_number
= 0;
333 if (strcasecmp (symbol_name
, "@0") == 0
334 || strcasecmp (symbol_name
, "@null") == 0)
336 else if (strcasecmp (symbol_name
, "@1") == 0)
337 seh_ctx_cur
->handler
.X_add_number
= 1;
339 as_bad (_("unknown constant value '%s' for handler"), symbol_name
);
341 (void) restore_line_pointer (name_end
);
344 expression (&seh_ctx_cur
->handler
);
346 seh_ctx_cur
->handler_data
.X_op
= O_constant
;
347 seh_ctx_cur
->handler_data
.X_add_number
= 0;
348 seh_ctx_cur
->handler_flags
= 0;
350 if (!skip_whitespace_and_comma (0))
353 if (seh_get_target_kind () == seh_kind_x64
)
357 name_end
= get_symbol_name (&symbol_name
);
359 if (strcasecmp (symbol_name
, "@unwind") == 0)
360 seh_ctx_cur
->handler_flags
|= UNW_FLAG_UHANDLER
;
361 else if (strcasecmp (symbol_name
, "@except") == 0)
362 seh_ctx_cur
->handler_flags
|= UNW_FLAG_EHANDLER
;
364 as_bad (_(".seh_handler constant '%s' unknown"), symbol_name
);
366 (void) restore_line_pointer (name_end
);
368 while (skip_whitespace_and_comma (0));
372 expression (&seh_ctx_cur
->handler_data
);
373 demand_empty_rest_of_line ();
375 if (seh_ctx_cur
->handler_written
)
376 as_warn (_(".seh_handler after .seh_eh is ignored"));
380 /* Switch to subsection for handler data for exception region (x64). */
383 obj_coff_seh_handlerdata (int what ATTRIBUTE_UNUSED
)
385 if (!verify_context_and_target (".seh_handlerdata", seh_kind_x64
))
387 demand_empty_rest_of_line ();
389 switch_xdata (seh_ctx_cur
->subsection
+ 1, seh_ctx_cur
->code_seg
);
392 /* Mark end of current context. */
395 do_seh_endproc (void)
397 seh_ctx_cur
->end_addr
= symbol_temp_new_now ();
399 write_function_xdata (seh_ctx_cur
);
400 write_function_pdata (seh_ctx_cur
);
405 obj_coff_seh_endproc (int what ATTRIBUTE_UNUSED
)
407 demand_empty_rest_of_line ();
408 if (seh_ctx_cur
== NULL
)
410 as_bad (_(".seh_endproc used without .seh_proc"));
413 seh_validate_seg (".seh_endproc");
417 /* Mark begin of new context. */
420 obj_coff_seh_proc (int what ATTRIBUTE_UNUSED
)
425 if (seh_ctx_cur
!= NULL
)
427 as_bad (_("previous SEH entry not closed (missing .seh_endproc)"));
431 if (*input_line_pointer
== 0 || *input_line_pointer
== '\n')
433 as_bad (_(".seh_proc requires function label name"));
434 demand_empty_rest_of_line ();
438 seh_ctx_cur
= XCNEW (seh_context
);
440 seh_ctx_cur
->code_seg
= now_seg
;
442 if (seh_get_target_kind () == seh_kind_x64
)
444 x_segcur
= seh_hash_find_or_make (seh_ctx_cur
->code_seg
, ".xdata");
445 seh_ctx_cur
->subsection
= x_segcur
->subseg
;
446 x_segcur
->subseg
+= 2;
451 name_end
= get_symbol_name (&symbol_name
);
452 seh_ctx_cur
->func_name
= xstrdup (symbol_name
);
453 (void) restore_line_pointer (name_end
);
455 demand_empty_rest_of_line ();
457 seh_ctx_cur
->start_addr
= symbol_temp_new_now ();
460 /* Mark end of prologue for current context. */
463 obj_coff_seh_endprologue (int what ATTRIBUTE_UNUSED
)
465 if (!verify_context (".seh_endprologue")
466 || !seh_validate_seg (".seh_endprologue"))
468 demand_empty_rest_of_line ();
470 if (seh_ctx_cur
->endprologue_addr
!= NULL
)
471 as_warn (_("duplicate .seh_endprologue in .seh_proc block"));
473 seh_ctx_cur
->endprologue_addr
= symbol_temp_new_now ();
476 /* End-of-file hook. */
479 obj_coff_seh_do_final (void)
481 if (seh_ctx_cur
!= NULL
)
482 as_bad (_("open SEH entry at end of file (missing .seh_endproc)"));
485 /* Enter a prologue element into current context (x64). */
488 seh_x64_make_prologue_element (int code
, int info
, offsetT off
)
490 seh_prologue_element
*n
;
492 if (seh_ctx_cur
== NULL
)
494 if (seh_ctx_cur
->elems_count
== seh_ctx_cur
->elems_max
)
496 seh_ctx_cur
->elems_max
+= 8;
497 seh_ctx_cur
->elems
= XRESIZEVEC (seh_prologue_element
,
499 seh_ctx_cur
->elems_max
);
502 n
= &seh_ctx_cur
->elems
[seh_ctx_cur
->elems_count
++];
506 n
->pc_addr
= symbol_temp_new_now ();
509 /* Helper to read a register name from input stream (x64). */
512 seh_x64_read_reg (const char *directive
, int kind
)
514 static const char * const int_regs
[16] =
515 { "rax", "rcx", "rdx", "rbx", "rsp", "rbp","rsi","rdi",
516 "r8","r9","r10","r11","r12","r13","r14","r15" };
517 static const char * const xmm_regs
[16] =
518 { "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
519 "xmm8", "xmm9", "xmm10","xmm11","xmm12","xmm13","xmm14","xmm15" };
521 const char * const *regs
= NULL
;
523 char *symbol_name
= NULL
;
540 if (*input_line_pointer
== '%')
541 ++input_line_pointer
;
542 name_end
= get_symbol_name (& symbol_name
);
544 for (i
= 0; i
< 16; i
++)
545 if (! strcasecmp (regs
[i
], symbol_name
))
548 (void) restore_line_pointer (name_end
);
550 /* Error if register not found, or EAX used as a frame pointer. */
551 if (i
== 16 || (kind
== 0 && i
== 0))
553 as_bad (_("invalid register for %s"), directive
);
560 /* Add a register push-unwind token to the current context. */
563 obj_coff_seh_pushreg (int what ATTRIBUTE_UNUSED
)
567 if (!verify_context_and_target (".seh_pushreg", seh_kind_x64
)
568 || !seh_validate_seg (".seh_pushreg"))
571 reg
= seh_x64_read_reg (".seh_pushreg", 1);
572 demand_empty_rest_of_line ();
577 seh_x64_make_prologue_element (UWOP_PUSH_NONVOL
, reg
, 0);
580 /* Add a register frame-unwind token to the current context. */
583 obj_coff_seh_pushframe (int what ATTRIBUTE_UNUSED
)
587 if (!verify_context_and_target (".seh_pushframe", seh_kind_x64
)
588 || !seh_validate_seg (".seh_pushframe"))
593 if (is_name_beginner (*input_line_pointer
))
597 get_symbol_name (&identifier
);
598 if (strcmp (identifier
, "code") != 0)
600 as_bad(_("invalid argument \"%s\" for .seh_pushframe. Expected \"code\" or nothing"),
607 demand_empty_rest_of_line ();
609 seh_x64_make_prologue_element (UWOP_PUSH_MACHFRAME
, code
, 0);
612 /* Add a register save-unwind token to current context. */
615 obj_coff_seh_save (int what
)
617 const char *directive
= (what
== 1 ? ".seh_savereg" : ".seh_savexmm");
618 int code
, reg
, scale
;
621 if (!verify_context_and_target (directive
, seh_kind_x64
)
622 || !seh_validate_seg (directive
))
625 reg
= seh_x64_read_reg (directive
, what
);
627 if (!skip_whitespace_and_comma (1))
630 off
= get_absolute_expression ();
631 demand_empty_rest_of_line ();
637 as_bad (_("%s offset is negative"), directive
);
641 scale
= (what
== 1 ? 8 : 16);
643 if ((off
& (scale
- 1)) == 0 && off
<= (offsetT
) (0xffff * scale
))
645 code
= (what
== 1 ? UWOP_SAVE_NONVOL
: UWOP_SAVE_XMM128
);
648 else if (off
< (offsetT
) 0xffffffff)
649 code
= (what
== 1 ? UWOP_SAVE_NONVOL_FAR
: UWOP_SAVE_XMM128_FAR
);
652 as_bad (_("%s offset out of range"), directive
);
656 seh_x64_make_prologue_element (code
, reg
, off
);
659 /* Add a stack-allocation token to current context. */
662 obj_coff_seh_stackalloc (int what ATTRIBUTE_UNUSED
)
667 if (!verify_context_and_target (".seh_stackalloc", seh_kind_x64
)
668 || !seh_validate_seg (".seh_stackalloc"))
671 off
= get_absolute_expression ();
672 demand_empty_rest_of_line ();
678 as_bad (_(".seh_stackalloc offset is negative"));
682 if ((off
& 7) == 0 && off
<= 128)
683 code
= UWOP_ALLOC_SMALL
, info
= (off
- 8) >> 3, off
= 0;
684 else if ((off
& 7) == 0 && off
<= (offsetT
) (0xffff * 8))
685 code
= UWOP_ALLOC_LARGE
, info
= 0, off
>>= 3;
686 else if (off
<= (offsetT
) 0xffffffff)
687 code
= UWOP_ALLOC_LARGE
, info
= 1;
690 as_bad (_(".seh_stackalloc offset out of range"));
694 seh_x64_make_prologue_element (code
, info
, off
);
697 /* Add a frame-pointer token to current context. */
700 obj_coff_seh_setframe (int what ATTRIBUTE_UNUSED
)
705 if (!verify_context_and_target (".seh_setframe", seh_kind_x64
)
706 || !seh_validate_seg (".seh_setframe"))
709 reg
= seh_x64_read_reg (".seh_setframe", 0);
711 if (!skip_whitespace_and_comma (1))
714 off
= get_absolute_expression ();
715 demand_empty_rest_of_line ();
720 as_bad (_(".seh_setframe offset is negative"));
722 as_bad (_(".seh_setframe offset out of range"));
724 as_bad (_(".seh_setframe offset not a multiple of 16"));
725 else if (seh_ctx_cur
->framereg
!= 0)
726 as_bad (_("duplicate .seh_setframe in current .seh_proc"));
729 seh_ctx_cur
->framereg
= reg
;
730 seh_ctx_cur
->frameoff
= off
;
731 seh_x64_make_prologue_element (UWOP_SET_FPREG
, 0, 0);
735 /* Data writing routines. */
737 /* Output raw integers in 1, 2, or 4 bytes. */
742 FRAG_APPEND_1_CHAR (byte
);
748 md_number_to_chars (frag_more (2), data
, 2);
754 md_number_to_chars (frag_more (4), data
, 4);
757 /* Write out prologue data for x64. */
760 seh_x64_write_prologue_data (const seh_context
*c
)
764 /* We have to store in reverse order. */
765 for (i
= c
->elems_count
- 1; i
>= 0; --i
)
767 const seh_prologue_element
*e
= c
->elems
+ i
;
770 /* First comes byte offset in code. */
771 exp
.X_op
= O_subtract
;
772 exp
.X_add_symbol
= e
->pc_addr
;
773 exp
.X_op_symbol
= c
->start_addr
;
774 exp
.X_add_number
= 0;
777 /* Second comes code+info packed into a byte. */
778 out_one ((e
->info
<< 4) | e
->code
);
782 case UWOP_PUSH_NONVOL
:
783 case UWOP_ALLOC_SMALL
:
785 case UWOP_PUSH_MACHFRAME
:
786 /* These have no extra data. */
789 case UWOP_ALLOC_LARGE
:
792 case UWOP_SAVE_NONVOL_FAR
:
793 case UWOP_SAVE_XMM128_FAR
:
794 /* An unscaled 4 byte offset. */
800 case UWOP_SAVE_NONVOL
:
801 case UWOP_SAVE_XMM128
:
802 /* A scaled 2 byte offset. */
813 seh_x64_size_prologue_data (const seh_context
*c
)
817 for (i
= c
->elems_count
- 1; i
>= 0; --i
)
818 switch (c
->elems
[i
].code
)
820 case UWOP_PUSH_NONVOL
:
821 case UWOP_ALLOC_SMALL
:
823 case UWOP_PUSH_MACHFRAME
:
827 case UWOP_SAVE_NONVOL
:
828 case UWOP_SAVE_XMM128
:
832 case UWOP_SAVE_NONVOL_FAR
:
833 case UWOP_SAVE_XMM128_FAR
:
837 case UWOP_ALLOC_LARGE
:
838 ret
+= (c
->elems
[i
].info
? 3 : 2);
848 /* Write out the xdata information for one function (x64). */
851 seh_x64_write_function_xdata (seh_context
*c
)
853 int flags
, count_unwind_codes
;
856 /* Set 4-byte alignment. */
857 frag_align (2, 0, 0);
859 c
->xdata_addr
= symbol_temp_new_now ();
860 flags
= c
->handler_flags
;
861 count_unwind_codes
= seh_x64_size_prologue_data (c
);
863 /* ubyte:3 version, ubyte:5 flags. */
864 out_one ((flags
<< 3) | 1);
866 /* Size of prologue. */
867 if (c
->endprologue_addr
)
869 exp
.X_op
= O_subtract
;
870 exp
.X_add_symbol
= c
->endprologue_addr
;
871 exp
.X_op_symbol
= c
->start_addr
;
872 exp
.X_add_number
= 0;
878 /* Number of slots (i.e. shorts) in the unwind codes array. */
879 if (count_unwind_codes
> 255)
880 as_fatal (_("too much unwind data in this .seh_proc"));
881 out_one (count_unwind_codes
);
883 /* ubyte:4 frame-reg, ubyte:4 frame-reg-offset. */
884 /* Note that frameoff is already a multiple of 16, and therefore
885 the offset is already both scaled and shifted into place. */
886 out_one (c
->frameoff
| c
->framereg
);
888 seh_x64_write_prologue_data (c
);
890 /* We need to align prologue data. */
891 if (count_unwind_codes
& 1)
894 if (flags
& (UNW_FLAG_EHANDLER
| UNW_FLAG_UHANDLER
))
896 /* Force the use of segment-relative relocations instead of absolute
897 valued expressions. Don't adjust for constants (e.g. NULL). */
898 if (c
->handler
.X_op
== O_symbol
)
899 c
->handler
.X_op
= O_symbol_rva
;
900 emit_expr (&c
->handler
, 4);
903 /* Handler data will be tacked in here by subsections. */
906 /* Write out xdata for one function. */
909 write_function_xdata (seh_context
*c
)
911 segT save_seg
= now_seg
;
912 int save_subseg
= now_subseg
;
914 /* MIPS, SH, ARM don't have xdata. */
915 if (seh_get_target_kind () != seh_kind_x64
)
918 switch_xdata (c
->subsection
, c
->code_seg
);
920 seh_x64_write_function_xdata (c
);
922 subseg_set (save_seg
, save_subseg
);
925 /* Write pdata section data for one function (arm). */
928 seh_arm_write_function_pdata (seh_context
*c
)
931 unsigned int prol_len
= 0, func_len
= 0;
934 /* Start address of the function. */
936 exp
.X_add_symbol
= c
->start_addr
;
937 exp
.X_add_number
= 0;
940 exp
.X_op
= O_subtract
;
941 exp
.X_add_symbol
= c
->end_addr
;
942 exp
.X_op_symbol
= c
->start_addr
;
943 exp
.X_add_number
= 0;
944 if (resolve_expression (&exp
) && exp
.X_op
== O_constant
)
945 func_len
= exp
.X_add_number
;
947 as_bad (_(".seh_endproc in a different section from .seh_proc"));
949 if (c
->endprologue_addr
)
951 exp
.X_op
= O_subtract
;
952 exp
.X_add_symbol
= c
->endprologue_addr
;
953 exp
.X_op_symbol
= c
->start_addr
;
954 exp
.X_add_number
= 0;
956 if (resolve_expression (&exp
) && exp
.X_op
== O_constant
)
957 prol_len
= exp
.X_add_number
;
959 as_bad (_(".seh_endprologue in a different section from .seh_proc"));
962 /* Both function and prologue are in units of instructions. */
963 func_len
>>= (c
->use_instruction_32
? 2 : 1);
964 prol_len
>>= (c
->use_instruction_32
? 2 : 1);
966 /* Assemble the second word of the pdata. */
967 val
= prol_len
& 0xff;
968 val
|= (func_len
& 0x3fffff) << 8;
969 if (c
->use_instruction_32
)
971 if (c
->handler_written
)
976 /* Write out pdata for one function. */
979 write_function_pdata (seh_context
*c
)
982 segT save_seg
= now_seg
;
983 int save_subseg
= now_subseg
;
984 memset (&exp
, 0, sizeof (expressionS
));
985 switch_pdata (c
->code_seg
);
987 switch (seh_get_target_kind ())
990 exp
.X_op
= O_symbol_rva
;
991 exp
.X_add_number
= 0;
993 exp
.X_add_symbol
= c
->start_addr
;
995 exp
.X_op
= O_symbol_rva
;
996 exp
.X_add_number
= 0;
997 exp
.X_add_symbol
= c
->end_addr
;
999 exp
.X_op
= O_symbol_rva
;
1000 exp
.X_add_number
= 0;
1001 exp
.X_add_symbol
= c
->xdata_addr
;
1002 emit_expr (&exp
, 4);
1006 exp
.X_op
= O_symbol
;
1007 exp
.X_add_number
= 0;
1009 exp
.X_add_symbol
= c
->start_addr
;
1010 emit_expr (&exp
, 4);
1011 exp
.X_add_symbol
= c
->end_addr
;
1012 emit_expr (&exp
, 4);
1014 emit_expr (&c
->handler
, 4);
1015 emit_expr (&c
->handler_data
, 4);
1017 exp
.X_add_symbol
= (c
->endprologue_addr
1018 ? c
->endprologue_addr
1020 emit_expr (&exp
, 4);
1024 seh_arm_write_function_pdata (c
);
1031 subseg_set (save_seg
, save_subseg
);