Commit 61214be1 by Trevor Saunders

remove conditional compilation of HAVE_AS_LEB128 code

gcc/ChangeLog:

2016-08-20  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* acinclude.m4 (gcc_GAS_CHECK_FEATURE): Support doing an action
	if the feature isn't available.
	* configure: Regenerate.
	* configure.ac: define HAVE_AS_LEB128 to 0 when not available.
	* dwarf2asm.c (dw2_asm_output_data_uleb128): Always compile code
	for HAVE_AS_LEB128.
	(dw2_asm_output_data_sleb128): Likewise.
	(dw2_asm_output_delta_uleb128): Likewise.
	(dw2_asm_output_delta_sleb128): Likewise.
	* except.c (output_one_function_exception_table): Likewise.
	(dw2_size_of_call_site_table): Likewise.
	(sjlj_size_of_call_site_table): Likewise.
	* dwarf2out.c (output_loc_list): Likewise.
	(output_rnglists): Likewise.

From-SVN: r242381
parent 5129b43b
...@@ -550,6 +550,10 @@ AC_CACHE_CHECK([assembler for $1], [$2], ...@@ -550,6 +550,10 @@ AC_CACHE_CHECK([assembler for $1], [$2],
ifelse([$7],,,[dnl ifelse([$7],,,[dnl
if test $[$2] = yes; then if test $[$2] = yes; then
$7 $7
fi])
ifelse([$8],,,[dnl
if test $[$2] != yes; then
$8
fi])]) fi])])
dnl gcc_SUN_LD_VERSION dnl gcc_SUN_LD_VERSION
......
...@@ -2753,6 +2753,8 @@ L2:], ...@@ -2753,6 +2753,8 @@ L2:],
fi fi
fi]], fi]],
[AC_DEFINE(HAVE_AS_LEB128, 1, [AC_DEFINE(HAVE_AS_LEB128, 1,
[Define if your assembler supports .sleb128 and .uleb128.])],
[AC_DEFINE(HAVE_AS_LEB128, 0,
[Define if your assembler supports .sleb128 and .uleb128.])]) [Define if your assembler supports .sleb128 and .uleb128.])])
# Check if we have assembler support for unwind directives. # Check if we have assembler support for unwind directives.
......
...@@ -622,53 +622,55 @@ dw2_asm_output_data_uleb128 (unsigned HOST_WIDE_INT value, ...@@ -622,53 +622,55 @@ dw2_asm_output_data_uleb128 (unsigned HOST_WIDE_INT value,
va_start (ap, comment); va_start (ap, comment);
#ifdef HAVE_AS_LEB128 if (HAVE_AS_LEB128)
fputs ("\t.uleb128 ", asm_out_file);
fprint_whex (asm_out_file, value);
if (flag_debug_asm && comment)
{ {
fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START); fputs ("\t.uleb128 ", asm_out_file);
vfprintf (asm_out_file, comment, ap); fprint_whex (asm_out_file, value);
if (flag_debug_asm && comment)
{
fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
vfprintf (asm_out_file, comment, ap);
}
} }
#else else
{
unsigned HOST_WIDE_INT work = value;
const char *byte_op = targetm.asm_out.byte_op;
if (byte_op)
fputs (byte_op, asm_out_file);
do
{
int byte = (work & 0x7f);
work >>= 7;
if (work != 0)
/* More bytes to follow. */
byte |= 0x80;
if (byte_op)
{
fprintf (asm_out_file, "%#x", byte);
if (work != 0)
fputc (',', asm_out_file);
}
else
assemble_integer (GEN_INT (byte), 1, BITS_PER_UNIT, 1);
}
while (work != 0);
if (flag_debug_asm)
{ {
fprintf (asm_out_file, "\t%s uleb128 " HOST_WIDE_INT_PRINT_HEX, unsigned HOST_WIDE_INT work = value;
ASM_COMMENT_START, value); const char *byte_op = targetm.asm_out.byte_op;
if (comment)
if (byte_op)
fputs (byte_op, asm_out_file);
do
{ {
fputs ("; ", asm_out_file); int byte = (work & 0x7f);
vfprintf (asm_out_file, comment, ap); work >>= 7;
if (work != 0)
/* More bytes to follow. */
byte |= 0x80;
if (byte_op)
{
fprintf (asm_out_file, "%#x", byte);
if (work != 0)
fputc (',', asm_out_file);
}
else
assemble_integer (GEN_INT (byte), 1, BITS_PER_UNIT, 1);
}
while (work != 0);
if (flag_debug_asm)
{
fprintf (asm_out_file, "\t%s uleb128 " HOST_WIDE_INT_PRINT_HEX,
ASM_COMMENT_START, value);
if (comment)
{
fputs ("; ", asm_out_file);
vfprintf (asm_out_file, comment, ap);
}
} }
} }
}
#endif
putc ('\n', asm_out_file); putc ('\n', asm_out_file);
va_end (ap); va_end (ap);
...@@ -707,55 +709,57 @@ dw2_asm_output_data_sleb128 (HOST_WIDE_INT value, ...@@ -707,55 +709,57 @@ dw2_asm_output_data_sleb128 (HOST_WIDE_INT value,
va_start (ap, comment); va_start (ap, comment);
#ifdef HAVE_AS_LEB128 if (HAVE_AS_LEB128)
fprintf (asm_out_file, "\t.sleb128 " HOST_WIDE_INT_PRINT_DEC, value);
if (flag_debug_asm && comment)
{ {
fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START); fprintf (asm_out_file, "\t.sleb128 " HOST_WIDE_INT_PRINT_DEC, value);
vfprintf (asm_out_file, comment, ap);
if (flag_debug_asm && comment)
{
fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
vfprintf (asm_out_file, comment, ap);
}
} }
#else else
{
HOST_WIDE_INT work = value;
int more, byte;
const char *byte_op = targetm.asm_out.byte_op;
if (byte_op)
fputs (byte_op, asm_out_file);
do
{
byte = (work & 0x7f);
/* arithmetic shift */
work >>= 7;
more = !((work == 0 && (byte & 0x40) == 0)
|| (work == -1 && (byte & 0x40) != 0));
if (more)
byte |= 0x80;
if (byte_op)
{
fprintf (asm_out_file, "%#x", byte);
if (more)
fputc (',', asm_out_file);
}
else
assemble_integer (GEN_INT (byte), 1, BITS_PER_UNIT, 1);
}
while (more);
if (flag_debug_asm)
{ {
fprintf (asm_out_file, "\t%s sleb128 " HOST_WIDE_INT_PRINT_DEC, HOST_WIDE_INT work = value;
ASM_COMMENT_START, value); int more, byte;
if (comment) const char *byte_op = targetm.asm_out.byte_op;
if (byte_op)
fputs (byte_op, asm_out_file);
do
{ {
fputs ("; ", asm_out_file); byte = (work & 0x7f);
vfprintf (asm_out_file, comment, ap); /* arithmetic shift */
work >>= 7;
more = !((work == 0 && (byte & 0x40) == 0)
|| (work == -1 && (byte & 0x40) != 0));
if (more)
byte |= 0x80;
if (byte_op)
{
fprintf (asm_out_file, "%#x", byte);
if (more)
fputc (',', asm_out_file);
}
else
assemble_integer (GEN_INT (byte), 1, BITS_PER_UNIT, 1);
}
while (more);
if (flag_debug_asm)
{
fprintf (asm_out_file, "\t%s sleb128 " HOST_WIDE_INT_PRINT_DEC,
ASM_COMMENT_START, value);
if (comment)
{
fputs ("; ", asm_out_file);
vfprintf (asm_out_file, comment, ap);
}
} }
} }
}
#endif
fputc ('\n', asm_out_file); fputc ('\n', asm_out_file);
va_end (ap); va_end (ap);
...@@ -770,14 +774,12 @@ dw2_asm_output_delta_uleb128 (const char *lab1 ATTRIBUTE_UNUSED, ...@@ -770,14 +774,12 @@ dw2_asm_output_delta_uleb128 (const char *lab1 ATTRIBUTE_UNUSED,
va_start (ap, comment); va_start (ap, comment);
#ifdef HAVE_AS_LEB128 gcc_assert (HAVE_AS_LEB128);
fputs ("\t.uleb128 ", asm_out_file); fputs ("\t.uleb128 ", asm_out_file);
assemble_name (asm_out_file, lab1); assemble_name (asm_out_file, lab1);
putc ('-', asm_out_file); putc ('-', asm_out_file);
assemble_name (asm_out_file, lab2); assemble_name (asm_out_file, lab2);
#else
gcc_unreachable ();
#endif
if (flag_debug_asm && comment) if (flag_debug_asm && comment)
{ {
...@@ -800,14 +802,12 @@ dw2_asm_output_delta_sleb128 (const char *lab1 ATTRIBUTE_UNUSED, ...@@ -800,14 +802,12 @@ dw2_asm_output_delta_sleb128 (const char *lab1 ATTRIBUTE_UNUSED,
va_start (ap, comment); va_start (ap, comment);
#ifdef HAVE_AS_LEB128 gcc_assert (HAVE_AS_LEB128);
fputs ("\t.sleb128 ", asm_out_file); fputs ("\t.sleb128 ", asm_out_file);
assemble_name (asm_out_file, lab1); assemble_name (asm_out_file, lab1);
putc ('-', asm_out_file); putc ('-', asm_out_file);
assemble_name (asm_out_file, lab2); assemble_name (asm_out_file, lab2);
#else
gcc_unreachable ();
#endif
if (flag_debug_asm && comment) if (flag_debug_asm && comment)
{ {
......
...@@ -9550,10 +9550,8 @@ output_loc_list (dw_loc_list_ref list_head) ...@@ -9550,10 +9550,8 @@ output_loc_list (dw_loc_list_ref list_head)
ASM_OUTPUT_LABEL (asm_out_file, list_head->ll_symbol); ASM_OUTPUT_LABEL (asm_out_file, list_head->ll_symbol);
dw_loc_list_ref curr = list_head; dw_loc_list_ref curr = list_head;
#ifdef HAVE_AS_LEB128
const char *last_section = NULL; const char *last_section = NULL;
const char *base_label = NULL; const char *base_label = NULL;
#endif
/* Walk the location list, and output each range + expression. */ /* Walk the location list, and output each range + expression. */
for (curr = list_head; curr != NULL; curr = curr->dw_loc_next) for (curr = list_head; curr != NULL; curr = curr->dw_loc_next)
...@@ -9588,8 +9586,7 @@ output_loc_list (dw_loc_list_ref list_head) ...@@ -9588,8 +9586,7 @@ output_loc_list (dw_loc_list_ref list_head)
"Location list length (%s)", "Location list length (%s)",
list_head->ll_symbol); list_head->ll_symbol);
} }
#ifdef HAVE_AS_LEB128 else if (!have_multiple_function_sections && HAVE_AS_LEB128)
else if (!have_multiple_function_sections)
{ {
/* If all code is in .text section, the base address is /* If all code is in .text section, the base address is
already provided by the CU attributes. Use already provided by the CU attributes. Use
...@@ -9605,7 +9602,7 @@ output_loc_list (dw_loc_list_ref list_head) ...@@ -9605,7 +9602,7 @@ output_loc_list (dw_loc_list_ref list_head)
"Location list end address (%s)", "Location list end address (%s)",
list_head->ll_symbol); list_head->ll_symbol);
} }
else else if (HAVE_AS_LEB128)
{ {
/* Otherwise, find out how many consecutive entries could share /* Otherwise, find out how many consecutive entries could share
the same base entry. If just one, emit DW_LLE_start_length, the same base entry. If just one, emit DW_LLE_start_length,
...@@ -9668,7 +9665,6 @@ output_loc_list (dw_loc_list_ref list_head) ...@@ -9668,7 +9665,6 @@ output_loc_list (dw_loc_list_ref list_head)
"(%s)", list_head->ll_symbol); "(%s)", list_head->ll_symbol);
} }
} }
#else
/* The assembler does not support .uleb128 directive. Emit /* The assembler does not support .uleb128 directive. Emit
DW_LLE_start_end with a pair of absolute addresses. */ DW_LLE_start_end with a pair of absolute addresses. */
else else
...@@ -9683,7 +9679,6 @@ output_loc_list (dw_loc_list_ref list_head) ...@@ -9683,7 +9679,6 @@ output_loc_list (dw_loc_list_ref list_head)
"Location list end address (%s)", "Location list end address (%s)",
list_head->ll_symbol); list_head->ll_symbol);
} }
#endif
} }
else if (dwarf_split_debug_info) else if (dwarf_split_debug_info)
{ {
...@@ -11054,9 +11049,7 @@ output_rnglists (void) ...@@ -11054,9 +11049,7 @@ output_rnglists (void)
dw_ranges *r; dw_ranges *r;
char l1[MAX_ARTIFICIAL_LABEL_BYTES]; char l1[MAX_ARTIFICIAL_LABEL_BYTES];
char l2[MAX_ARTIFICIAL_LABEL_BYTES]; char l2[MAX_ARTIFICIAL_LABEL_BYTES];
#ifdef HAVE_AS_LEB128
char basebuf[MAX_ARTIFICIAL_LABEL_BYTES]; char basebuf[MAX_ARTIFICIAL_LABEL_BYTES];
#endif
switch_to_section (debug_ranges_section); switch_to_section (debug_ranges_section);
ASM_OUTPUT_LABEL (asm_out_file, ranges_section_label); ASM_OUTPUT_LABEL (asm_out_file, ranges_section_label);
...@@ -11090,10 +11083,8 @@ output_rnglists (void) ...@@ -11090,10 +11083,8 @@ output_rnglists (void)
} }
const char *lab = ""; const char *lab = "";
#ifdef HAVE_AS_LEB128
unsigned int len = vec_safe_length (ranges_table); unsigned int len = vec_safe_length (ranges_table);
const char *base = NULL; const char *base = NULL;
#endif
FOR_EACH_VEC_SAFE_ELT (ranges_table, i, r) FOR_EACH_VEC_SAFE_ELT (ranges_table, i, r)
{ {
int block_num = r->num; int block_num = r->num;
...@@ -11103,10 +11094,8 @@ output_rnglists (void) ...@@ -11103,10 +11094,8 @@ output_rnglists (void)
ASM_OUTPUT_LABEL (asm_out_file, r->label); ASM_OUTPUT_LABEL (asm_out_file, r->label);
lab = r->label; lab = r->label;
} }
#ifdef HAVE_AS_LEB128 if (HAVE_AS_LEB128 && (r->label || r->maybe_new_sec))
if (r->label || r->maybe_new_sec)
base = NULL; base = NULL;
#endif
if (block_num > 0) if (block_num > 0)
{ {
char blabel[MAX_ARTIFICIAL_LABEL_BYTES]; char blabel[MAX_ARTIFICIAL_LABEL_BYTES];
...@@ -11115,62 +11104,65 @@ output_rnglists (void) ...@@ -11115,62 +11104,65 @@ output_rnglists (void)
ASM_GENERATE_INTERNAL_LABEL (blabel, BLOCK_BEGIN_LABEL, block_num); ASM_GENERATE_INTERNAL_LABEL (blabel, BLOCK_BEGIN_LABEL, block_num);
ASM_GENERATE_INTERNAL_LABEL (elabel, BLOCK_END_LABEL, block_num); ASM_GENERATE_INTERNAL_LABEL (elabel, BLOCK_END_LABEL, block_num);
#ifdef HAVE_AS_LEB128 if (HAVE_AS_LEB128)
/* If all code is in the text section, then the compilation
unit base address defaults to DW_AT_low_pc, which is the
base of the text section. */
if (!have_multiple_function_sections)
{ {
dw2_asm_output_data (1, DW_RLE_offset_pair, /* If all code is in the text section, then the compilation
"DW_RLE_offset_pair (%s)", lab); unit base address defaults to DW_AT_low_pc, which is the
dw2_asm_output_delta_uleb128 (blabel, text_section_label, base of the text section. */
"Range begin address (%s)", lab); if (!have_multiple_function_sections)
dw2_asm_output_delta_uleb128 (elabel, text_section_label,
"Range end address (%s)", lab);
continue;
}
if (base == NULL)
{
dw_ranges *r2 = NULL;
if (i < len - 1)
r2 = &(*ranges_table)[i + 1];
if (r2
&& r2->num != 0
&& r2->label == NULL
&& !r2->maybe_new_sec)
{ {
dw2_asm_output_data (1, DW_RLE_base_address, dw2_asm_output_data (1, DW_RLE_offset_pair,
"DW_RLE_base_address (%s)", lab); "DW_RLE_offset_pair (%s)", lab);
dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel, dw2_asm_output_delta_uleb128 (blabel, text_section_label,
"Base address (%s)", lab); "Range begin address (%s)", lab);
strcpy (basebuf, blabel); dw2_asm_output_delta_uleb128 (elabel, text_section_label,
base = basebuf; "Range end address (%s)", lab);
continue;
}
if (base == NULL)
{
dw_ranges *r2 = NULL;
if (i < len - 1)
r2 = &(*ranges_table)[i + 1];
if (r2
&& r2->num != 0
&& r2->label == NULL
&& !r2->maybe_new_sec)
{
dw2_asm_output_data (1, DW_RLE_base_address,
"DW_RLE_base_address (%s)", lab);
dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel,
"Base address (%s)", lab);
strcpy (basebuf, blabel);
base = basebuf;
}
} }
if (base)
{
dw2_asm_output_data (1, DW_RLE_offset_pair,
"DW_RLE_offset_pair (%s)", lab);
dw2_asm_output_delta_uleb128 (blabel, base,
"Range begin address (%s)", lab);
dw2_asm_output_delta_uleb128 (elabel, base,
"Range end address (%s)", lab);
continue;
}
dw2_asm_output_data (1, DW_RLE_start_length,
"DW_RLE_start_length (%s)", lab);
dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel,
"Range begin address (%s)", lab);
dw2_asm_output_delta_uleb128 (elabel, blabel,
"Range length (%s)", lab);
} }
if (base) else
{ {
dw2_asm_output_data (1, DW_RLE_offset_pair, dw2_asm_output_data (1, DW_RLE_start_end,
"DW_RLE_offset_pair (%s)", lab); "DW_RLE_start_end (%s)", lab);
dw2_asm_output_delta_uleb128 (blabel, base, dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel,
"Range begin address (%s)", lab); "Range begin address (%s)", lab);
dw2_asm_output_delta_uleb128 (elabel, base, dw2_asm_output_addr (DWARF2_ADDR_SIZE, elabel,
"Range end address (%s)", lab); "Range end address (%s)", lab);
continue;
} }
dw2_asm_output_data (1, DW_RLE_start_length,
"DW_RLE_start_length (%s)", lab);
dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel,
"Range begin address (%s)", lab);
dw2_asm_output_delta_uleb128 (elabel, blabel,
"Range length (%s)", lab);
#else
dw2_asm_output_data (1, DW_RLE_start_end,
"DW_RLE_start_end (%s)", lab);
dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel,
"Range begin address (%s)", lab);
dw2_asm_output_addr (DWARF2_ADDR_SIZE, elabel,
"Range end address (%s)", lab);
#endif
} }
/* Negative block_num stands for an index into ranges_by_label. */ /* Negative block_num stands for an index into ranges_by_label. */
...@@ -11182,21 +11174,24 @@ output_rnglists (void) ...@@ -11182,21 +11174,24 @@ output_rnglists (void)
if (!have_multiple_function_sections) if (!have_multiple_function_sections)
gcc_unreachable (); gcc_unreachable ();
#ifdef HAVE_AS_LEB128 if (HAVE_AS_LEB128)
dw2_asm_output_data (1, DW_RLE_start_length, {
"DW_RLE_start_length (%s)", lab); dw2_asm_output_data (1, DW_RLE_start_length,
dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel, "DW_RLE_start_length (%s)", lab);
"Range begin address (%s)", lab); dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel,
dw2_asm_output_delta_uleb128 (elabel, blabel, "Range begin address (%s)", lab);
"Range length (%s)", lab); dw2_asm_output_delta_uleb128 (elabel, blabel,
#else "Range length (%s)", lab);
dw2_asm_output_data (1, DW_RLE_start_end, }
"DW_RLE_start_end (%s)", lab); else
dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel, {
"Range begin address (%s)", lab); dw2_asm_output_data (1, DW_RLE_start_end,
dw2_asm_output_addr (DWARF2_ADDR_SIZE, elabel, "DW_RLE_start_end (%s)", lab);
"Range end address (%s)", lab); dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel,
#endif "Range begin address (%s)", lab);
dw2_asm_output_addr (DWARF2_ADDR_SIZE, elabel,
"Range end address (%s)", lab);
}
} }
else else
dw2_asm_output_data (1, DW_RLE_end_of_list, dw2_asm_output_data (1, DW_RLE_end_of_list,
......
...@@ -216,10 +216,8 @@ static int add_call_site (rtx, int, int); ...@@ -216,10 +216,8 @@ static int add_call_site (rtx, int, int);
static void push_uleb128 (vec<uchar, va_gc> **, unsigned int); static void push_uleb128 (vec<uchar, va_gc> **, unsigned int);
static void push_sleb128 (vec<uchar, va_gc> **, int); static void push_sleb128 (vec<uchar, va_gc> **, int);
#ifndef HAVE_AS_LEB128
static int dw2_size_of_call_site_table (int); static int dw2_size_of_call_site_table (int);
static int sjlj_size_of_call_site_table (void); static int sjlj_size_of_call_site_table (void);
#endif
static void dw2_output_call_site_table (int, int); static void dw2_output_call_site_table (int, int);
static void sjlj_output_call_site_table (void); static void sjlj_output_call_site_table (void);
...@@ -2696,7 +2694,6 @@ push_sleb128 (vec<uchar, va_gc> **data_area, int value) ...@@ -2696,7 +2694,6 @@ push_sleb128 (vec<uchar, va_gc> **data_area, int value)
} }
#ifndef HAVE_AS_LEB128
static int static int
dw2_size_of_call_site_table (int section) dw2_size_of_call_site_table (int section)
{ {
...@@ -2731,7 +2728,6 @@ sjlj_size_of_call_site_table (void) ...@@ -2731,7 +2728,6 @@ sjlj_size_of_call_site_table (void)
return size; return size;
} }
#endif
static void static void
dw2_output_call_site_table (int cs_format, int section) dw2_output_call_site_table (int cs_format, int section)
...@@ -2921,13 +2917,10 @@ static void ...@@ -2921,13 +2917,10 @@ static void
output_one_function_exception_table (int section) output_one_function_exception_table (int section)
{ {
int tt_format, cs_format, lp_format, i; int tt_format, cs_format, lp_format, i;
#ifdef HAVE_AS_LEB128
char ttype_label[32]; char ttype_label[32];
char cs_after_size_label[32]; char cs_after_size_label[32];
char cs_end_label[32]; char cs_end_label[32];
#else
int call_site_len; int call_site_len;
#endif
int have_tt_data; int have_tt_data;
int tt_format_size = 0; int tt_format_size = 0;
...@@ -2942,11 +2935,11 @@ output_one_function_exception_table (int section) ...@@ -2942,11 +2935,11 @@ output_one_function_exception_table (int section)
else else
{ {
tt_format = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0, /*global=*/1); tt_format = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0, /*global=*/1);
#ifdef HAVE_AS_LEB128 if (HAVE_AS_LEB128)
ASM_GENERATE_INTERNAL_LABEL (ttype_label, ASM_GENERATE_INTERNAL_LABEL (ttype_label,
section ? "LLSDATTC" : "LLSDATT", section ? "LLSDATTC" : "LLSDATT",
current_function_funcdef_no); current_function_funcdef_no);
#endif
tt_format_size = size_of_encoded_value (tt_format); tt_format_size = size_of_encoded_value (tt_format);
assemble_align (tt_format_size * BITS_PER_UNIT); assemble_align (tt_format_size * BITS_PER_UNIT);
...@@ -2972,86 +2965,93 @@ output_one_function_exception_table (int section) ...@@ -2972,86 +2965,93 @@ output_one_function_exception_table (int section)
dw2_asm_output_data (1, tt_format, "@TType format (%s)", dw2_asm_output_data (1, tt_format, "@TType format (%s)",
eh_data_format_name (tt_format)); eh_data_format_name (tt_format));
#ifndef HAVE_AS_LEB128 if (!HAVE_AS_LEB128)
if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ) {
call_site_len = sjlj_size_of_call_site_table (); if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ)
else call_site_len = sjlj_size_of_call_site_table ();
call_site_len = dw2_size_of_call_site_table (section); else
#endif call_site_len = dw2_size_of_call_site_table (section);
}
/* A pc-relative 4-byte displacement to the @TType data. */ /* A pc-relative 4-byte displacement to the @TType data. */
if (have_tt_data) if (have_tt_data)
{ {
#ifdef HAVE_AS_LEB128 if (HAVE_AS_LEB128)
char ttype_after_disp_label[32]; {
ASM_GENERATE_INTERNAL_LABEL (ttype_after_disp_label, char ttype_after_disp_label[32];
section ? "LLSDATTDC" : "LLSDATTD", ASM_GENERATE_INTERNAL_LABEL (ttype_after_disp_label,
current_function_funcdef_no); section ? "LLSDATTDC" : "LLSDATTD",
dw2_asm_output_delta_uleb128 (ttype_label, ttype_after_disp_label, current_function_funcdef_no);
"@TType base offset"); dw2_asm_output_delta_uleb128 (ttype_label, ttype_after_disp_label,
ASM_OUTPUT_LABEL (asm_out_file, ttype_after_disp_label); "@TType base offset");
#else ASM_OUTPUT_LABEL (asm_out_file, ttype_after_disp_label);
/* Ug. Alignment queers things. */ }
unsigned int before_disp, after_disp, last_disp, disp; else
{
/* Ug. Alignment queers things. */
unsigned int before_disp, after_disp, last_disp, disp;
before_disp = 1 + 1; before_disp = 1 + 1;
after_disp = (1 + size_of_uleb128 (call_site_len) after_disp = (1 + size_of_uleb128 (call_site_len)
+ call_site_len + call_site_len
+ vec_safe_length (crtl->eh.action_record_data) + vec_safe_length (crtl->eh.action_record_data)
+ (vec_safe_length (cfun->eh->ttype_data) + (vec_safe_length (cfun->eh->ttype_data)
* tt_format_size)); * tt_format_size));
disp = after_disp; disp = after_disp;
do do
{ {
unsigned int disp_size, pad; unsigned int disp_size, pad;
last_disp = disp; last_disp = disp;
disp_size = size_of_uleb128 (disp); disp_size = size_of_uleb128 (disp);
pad = before_disp + disp_size + after_disp; pad = before_disp + disp_size + after_disp;
if (pad % tt_format_size) if (pad % tt_format_size)
pad = tt_format_size - (pad % tt_format_size); pad = tt_format_size - (pad % tt_format_size);
else else
pad = 0; pad = 0;
disp = after_disp + pad; disp = after_disp + pad;
} }
while (disp != last_disp); while (disp != last_disp);
dw2_asm_output_data_uleb128 (disp, "@TType base offset"); dw2_asm_output_data_uleb128 (disp, "@TType base offset");
#endif }
} }
/* Indicate the format of the call-site offsets. */ /* Indicate the format of the call-site offsets. */
#ifdef HAVE_AS_LEB128 if (HAVE_AS_LEB128)
cs_format = DW_EH_PE_uleb128; cs_format = DW_EH_PE_uleb128;
#else else
cs_format = DW_EH_PE_udata4; cs_format = DW_EH_PE_udata4;
#endif
dw2_asm_output_data (1, cs_format, "call-site format (%s)", dw2_asm_output_data (1, cs_format, "call-site format (%s)",
eh_data_format_name (cs_format)); eh_data_format_name (cs_format));
#ifdef HAVE_AS_LEB128 if (HAVE_AS_LEB128)
ASM_GENERATE_INTERNAL_LABEL (cs_after_size_label, {
section ? "LLSDACSBC" : "LLSDACSB", ASM_GENERATE_INTERNAL_LABEL (cs_after_size_label,
current_function_funcdef_no); section ? "LLSDACSBC" : "LLSDACSB",
ASM_GENERATE_INTERNAL_LABEL (cs_end_label, current_function_funcdef_no);
section ? "LLSDACSEC" : "LLSDACSE", ASM_GENERATE_INTERNAL_LABEL (cs_end_label,
current_function_funcdef_no); section ? "LLSDACSEC" : "LLSDACSE",
dw2_asm_output_delta_uleb128 (cs_end_label, cs_after_size_label, current_function_funcdef_no);
"Call-site table length"); dw2_asm_output_delta_uleb128 (cs_end_label, cs_after_size_label,
ASM_OUTPUT_LABEL (asm_out_file, cs_after_size_label); "Call-site table length");
if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ) ASM_OUTPUT_LABEL (asm_out_file, cs_after_size_label);
sjlj_output_call_site_table (); if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ)
else sjlj_output_call_site_table ();
dw2_output_call_site_table (cs_format, section); else
ASM_OUTPUT_LABEL (asm_out_file, cs_end_label); dw2_output_call_site_table (cs_format, section);
#else ASM_OUTPUT_LABEL (asm_out_file, cs_end_label);
dw2_asm_output_data_uleb128 (call_site_len, "Call-site table length"); }
if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ)
sjlj_output_call_site_table ();
else else
dw2_output_call_site_table (cs_format, section); {
#endif dw2_asm_output_data_uleb128 (call_site_len, "Call-site table length");
if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ)
sjlj_output_call_site_table ();
else
dw2_output_call_site_table (cs_format, section);
}
/* ??? Decode and interpret the data for flag_debug_asm. */ /* ??? Decode and interpret the data for flag_debug_asm. */
{ {
...@@ -3070,10 +3070,8 @@ output_one_function_exception_table (int section) ...@@ -3070,10 +3070,8 @@ output_one_function_exception_table (int section)
output_ttype (type, tt_format, tt_format_size); output_ttype (type, tt_format, tt_format_size);
} }
#ifdef HAVE_AS_LEB128 if (HAVE_AS_LEB128 && have_tt_data)
if (have_tt_data) ASM_OUTPUT_LABEL (asm_out_file, ttype_label);
ASM_OUTPUT_LABEL (asm_out_file, ttype_label);
#endif
/* ??? Decode and interpret the data for flag_debug_asm. */ /* ??? Decode and interpret the data for flag_debug_asm. */
if (targetm.arm_eabi_unwinder) if (targetm.arm_eabi_unwinder)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment