aboutsummaryrefslogtreecommitdiff
path: root/gas/dw2gencfi.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2003-06-18 17:58:48 +0000
committerJakub Jelinek <jakub@redhat.com>2003-06-18 17:58:48 +0000
commit9393cb0db966e6c2217f08c9420a1005a39d26fc (patch)
treecb6ba5f9762d4337f6d9fa81d49e6c166c960441 /gas/dw2gencfi.c
parentdf9a398fe6867c16f436754965dc0986870ad286 (diff)
downloadgdb-9393cb0db966e6c2217f08c9420a1005a39d26fc.zip
gdb-9393cb0db966e6c2217f08c9420a1005a39d26fc.tar.gz
gdb-9393cb0db966e6c2217f08c9420a1005a39d26fc.tar.bz2
* dw2gencfi.c (EH_FRAME_ALIGNMENT): Define if not defined.
(output_cie): Don't pad. (output_fde): Add align argument. Pad to align if not 0. (cfi_finish): Set .eh_frame alignment to EH_FRAME_ALIGNMENT. Pad just last FDE to EH_FRAME_ALIGNMENT. * gas/cfi/cfi-i386.d: Regenerated. * gas/cfi/cfi-common-1.d: Regenerated. * gas/cfi/cfi-common-2.d: Regenerated. * gas/cfi/cfi-common-3.d: Regenerated. * gas/cfi/cfi-x86_64.d: Regenerated. * gas/cfi/cfi-alpha-1.d: Regenerated. * gas/cfi/cfi-alpha-2.d: Regenerated. * gas/cfi/cfi-alpha-3.d: Regenerated.
Diffstat (limited to 'gas/dw2gencfi.c')
-rw-r--r--gas/dw2gencfi.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c
index 0e118e1..c7c62a7 100644
--- a/gas/dw2gencfi.c
+++ b/gas/dw2gencfi.c
@@ -41,6 +41,14 @@
# endif
#endif
+#ifndef EH_FRAME_ALIGNMENT
+# ifdef BFD_ASSEMBLER
+# define EH_FRAME_ALIGNMENT (bfd_get_arch_size (stdoutput) == 64 ? 3 : 2)
+# else
+# define EH_FRAME_ALIGNMENT 2
+# endif
+#endif
+
#ifndef tc_cfi_frame_initial_instructions
# define tc_cfi_frame_initial_instructions() ((void)0)
#endif
@@ -836,13 +844,12 @@ output_cie (struct cie_entry *cie)
for (i = cie->first; i != cie->last; i = i->next)
output_cfi_insn (i);
- frag_align (2, 0, 0);
symbol_set_value_now (end_address);
}
static void
output_fde (struct fde_entry *fde, struct cie_entry *cie,
- struct cfi_insn_data *first)
+ struct cfi_insn_data *first, int align)
{
symbolS *after_size_address, *end_address;
expressionS exp;
@@ -874,7 +881,8 @@ output_fde (struct fde_entry *fde, struct cie_entry *cie,
for (; first; first = first->next)
output_cfi_insn (first);
- frag_align (2, 0, 0);
+ if (align)
+ frag_align (align, 0, 0);
symbol_set_value_now (end_address);
}
@@ -990,7 +998,7 @@ cfi_finish (void)
SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_READONLY);
#endif
subseg_set (cfi_seg, 0);
- record_alignment (cfi_seg, 2);
+ record_alignment (cfi_seg, EH_FRAME_ALIGNMENT);
/* Make sure check_eh_frame doesn't do anything with our output. */
save_flag_traditional_format = flag_traditional_format;
@@ -1002,7 +1010,7 @@ cfi_finish (void)
struct cie_entry *cie;
cie = select_cie_for_fde (fde, &first);
- output_fde (fde, cie, first);
+ output_fde (fde, cie, first, fde->next == NULL ? EH_FRAME_ALIGNMENT : 0);
}
flag_traditional_format = save_flag_traditional_format;