summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authortbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2016-11-14 10:58:48 +0000
committertbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2016-11-14 10:58:48 +0000
commitb4866769ceb58060d220dbed72432735d80f3b2f (patch)
treec22752892fde2e66aeecd39618b75adcc48d4e5c /gcc/dwarf2out.c
parent7cacafcffcb95b64ee499b4daf69e3b26eea06f2 (diff)
downloadgcc-b4866769ceb58060d220dbed72432735d80f3b2f.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242381 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c153
1 files changed, 74 insertions, 79 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index f9ec0903b78..58a5e1ad2ff 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -9550,10 +9550,8 @@ output_loc_list (dw_loc_list_ref list_head)
ASM_OUTPUT_LABEL (asm_out_file, list_head->ll_symbol);
dw_loc_list_ref curr = list_head;
-#ifdef HAVE_AS_LEB128
const char *last_section = NULL;
const char *base_label = NULL;
-#endif
/* Walk the location list, and output each range + expression. */
for (curr = list_head; curr != NULL; curr = curr->dw_loc_next)
@@ -9588,8 +9586,7 @@ output_loc_list (dw_loc_list_ref list_head)
"Location list length (%s)",
list_head->ll_symbol);
}
-#ifdef HAVE_AS_LEB128
- else if (!have_multiple_function_sections)
+ else if (!have_multiple_function_sections && HAVE_AS_LEB128)
{
/* If all code is in .text section, the base address is
already provided by the CU attributes. Use
@@ -9605,7 +9602,7 @@ output_loc_list (dw_loc_list_ref list_head)
"Location list end address (%s)",
list_head->ll_symbol);
}
- else
+ else if (HAVE_AS_LEB128)
{
/* Otherwise, find out how many consecutive entries could share
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)
"(%s)", list_head->ll_symbol);
}
}
-#else
/* The assembler does not support .uleb128 directive. Emit
DW_LLE_start_end with a pair of absolute addresses. */
else
@@ -9683,7 +9679,6 @@ output_loc_list (dw_loc_list_ref list_head)
"Location list end address (%s)",
list_head->ll_symbol);
}
-#endif
}
else if (dwarf_split_debug_info)
{
@@ -11054,9 +11049,7 @@ output_rnglists (void)
dw_ranges *r;
char l1[MAX_ARTIFICIAL_LABEL_BYTES];
char l2[MAX_ARTIFICIAL_LABEL_BYTES];
-#ifdef HAVE_AS_LEB128
char basebuf[MAX_ARTIFICIAL_LABEL_BYTES];
-#endif
switch_to_section (debug_ranges_section);
ASM_OUTPUT_LABEL (asm_out_file, ranges_section_label);
@@ -11090,10 +11083,8 @@ output_rnglists (void)
}
const char *lab = "";
-#ifdef HAVE_AS_LEB128
unsigned int len = vec_safe_length (ranges_table);
const char *base = NULL;
-#endif
FOR_EACH_VEC_SAFE_ELT (ranges_table, i, r)
{
int block_num = r->num;
@@ -11103,10 +11094,8 @@ output_rnglists (void)
ASM_OUTPUT_LABEL (asm_out_file, r->label);
lab = r->label;
}
-#ifdef HAVE_AS_LEB128
- if (r->label || r->maybe_new_sec)
+ if (HAVE_AS_LEB128 && (r->label || r->maybe_new_sec))
base = NULL;
-#endif
if (block_num > 0)
{
char blabel[MAX_ARTIFICIAL_LABEL_BYTES];
@@ -11115,62 +11104,65 @@ output_rnglists (void)
ASM_GENERATE_INTERNAL_LABEL (blabel, BLOCK_BEGIN_LABEL, block_num);
ASM_GENERATE_INTERNAL_LABEL (elabel, BLOCK_END_LABEL, block_num);
-#ifdef 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)
+ if (HAVE_AS_LEB128)
{
- dw2_asm_output_data (1, DW_RLE_offset_pair,
- "DW_RLE_offset_pair (%s)", lab);
- dw2_asm_output_delta_uleb128 (blabel, text_section_label,
- "Range begin address (%s)", lab);
- 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)
+ /* 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_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;
+ dw2_asm_output_data (1, DW_RLE_offset_pair,
+ "DW_RLE_offset_pair (%s)", lab);
+ dw2_asm_output_delta_uleb128 (blabel, text_section_label,
+ "Range begin address (%s)", lab);
+ 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,
+ "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,
- "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_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);
}
- 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. */
@@ -11182,21 +11174,24 @@ output_rnglists (void)
if (!have_multiple_function_sections)
gcc_unreachable ();
-#ifdef HAVE_AS_LEB128
- 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
+ if (HAVE_AS_LEB128)
+ {
+ 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);
+ }
}
else
dw2_asm_output_data (1, DW_RLE_end_of_list,