aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@gcc.gnu.org>2001-06-05 18:57:49 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-06-05 18:57:49 -0700
commit099c8b17ace8e7a35a53993bf8cf211b955d29a8 (patch)
tree7d58db2a4f6ec00eb20b149b79bc6fbe2e8c5a80 /gcc/dwarf2out.c
parentc51f6c6bd5a4177ee5dcb0afbfe9b27e4fda6478 (diff)
downloadgcc-099c8b17ace8e7a35a53993bf8cf211b955d29a8.zip
gcc-099c8b17ace8e7a35a53993bf8cf211b955d29a8.tar.gz
gcc-099c8b17ace8e7a35a53993bf8cf211b955d29a8.tar.bz2
dwarf2.h (DW_EH_PE_aligned): New.
* dwarf2.h (DW_EH_PE_aligned): New. * dwarf2asm.c (eh_data_format_name): Name it. (dw2_asm_output_encoded_addr_rtx): Align for it. * dwarf2out.c (output_call_frame_info): Handle it for personality routine and LSDA pointers. * unwind-pe.h (DW_EH_PE_aligned): New. (base_of_encoded_value): Handle it. (read_encoded_value_with_base): Likewise. * unwind-dw2-fde.c (base_from_object): Likewise. (get_cie_encoding): Likewise. * config/alpha/elf.h: Remove ecoff commentary. * config/alpha/osf.h (ASM_PREFERRED_EH_DATA_FORMAT): New. From-SVN: r42926
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c48
1 files changed, 44 insertions, 4 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index d72ecc2..5d56184 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -1820,6 +1820,28 @@ output_call_frame_info (for_eh)
augmentation[0] = 'z';
*p = '\0';
}
+
+ /* Ug. Some platforms can't do unaligned dynamic relocations at all. */
+ if (eh_personality_libfunc && per_encoding == DW_EH_PE_aligned)
+ {
+ int offset = ( 4 /* Length */
+ + 4 /* CIE Id */
+ + 1 /* CIE version */
+ + strlen (augmentation) + 1 /* Augmentation */
+ + size_of_uleb128 (1) /* Code alignment */
+ + size_of_sleb128 (DWARF_CIE_DATA_ALIGNMENT)
+ + 1 /* RA column */
+ + 1 /* Augmentation size */
+ + 1 /* Personality encoding */ );
+ int pad = -offset & (PTR_SIZE - 1);
+
+ augmentation_size += pad;
+
+ /* Augmentations should be small, so there's scarce need to
+ iterate for a solution. Die if we exceed one uleb128 byte. */
+ if (size_of_uleb128 (augmentation_size) != 1)
+ abort ();
+ }
}
dw2_asm_output_nstring (augmentation, -1, "CIE Augmentation");
@@ -1909,8 +1931,22 @@ output_call_frame_info (for_eh)
{
if (any_lsda_needed)
{
- dw2_asm_output_data_uleb128 (
- size_of_encoded_value (lsda_encoding), "Augmentation size");
+ int size = size_of_encoded_value (lsda_encoding);
+
+ if (lsda_encoding == DW_EH_PE_aligned)
+ {
+ int offset = ( 4 /* Length */
+ + 4 /* CIE offset */
+ + 2 * size_of_encoded_value (fde_encoding)
+ + 1 /* Augmentation size */ );
+ int pad = -offset & (PTR_SIZE - 1);
+
+ size += pad;
+ if (size_of_uleb128 (size) != 1)
+ abort ();
+ }
+
+ dw2_asm_output_data_uleb128 (size, "Augmentation size");
if (fde->uses_eh_lsda)
{
@@ -1921,8 +1957,12 @@ output_call_frame_info (for_eh)
"Language Specific Data Area");
}
else
- dw2_asm_output_data (size_of_encoded_value (lsda_encoding),
- 0, "Language Specific Data Area (none)");
+ {
+ if (lsda_encoding == DW_EH_PE_aligned)
+ ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
+ dw2_asm_output_data (size_of_encoded_value (lsda_encoding),
+ 0, "Language Specific Data Area (none)");
+ }
}
else
dw2_asm_output_data_uleb128 (0, "Augmentation size");