Commit eeab4d81 by Mike Stump Committed by Mike Stump

tm.texi (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument to indicate if this label is for eh.

	* doc/tm.texi (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument to indicate
	if this label is for eh.
	* config/darwin-protos.h (darwin_emit_unwind_label): Likewise.
	* config/darwin.c (darwin_emit_unwind_label): Likewise.
	* dwarf2out.c (output_call_frame_info): Likewise.
	* output.h (default_emit_unwind_label): Likewise.
	* target.h (unwind_label): Likewise.
	* varasm.c (default_emit_unwind_label): Likewise.

	* config/darwin.h (DWARF2_DEBUGGING_INFO, PREFERRED_DEBUGGING_TYPE,
	DEBUG_FRAME_SECTION, DEBUG_INFO_SECTION, DEBUG_ABBREV_SECTION,
	DEBUG_ARANGES_SECTION, DEBUG_MACINFO_SECTION, DEBUG_LINE_SECTION,
	DEBUG_LOC_SECTION, DEBUG_PUBNAMES_SECTION, DEBUG_STR_SECTION,
	DEBUG_RANGES_SECTION): Define.

Radar 3657068.

Co-Authored-By: Devang Patel <dpatel@apple.com>

From-SVN: r82016
parent bb9a388d
2004-05-18 Mike Stump <mrs@apple.com>
Devang Patel <dpatel@apple.com>
* doc/tm.texi (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument to indicate
if this label is for eh.
* config/darwin-protos.h (darwin_emit_unwind_label): Likewise.
* config/darwin.c (darwin_emit_unwind_label): Likewise.
* dwarf2out.c (output_call_frame_info): Likewise.
* output.h (default_emit_unwind_label): Likewise.
* target.h (unwind_label): Likewise.
* varasm.c (default_emit_unwind_label): Likewise.
* config/darwin.h (DWARF2_DEBUGGING_INFO, PREFERRED_DEBUGGING_TYPE,
DEBUG_FRAME_SECTION, DEBUG_INFO_SECTION, DEBUG_ABBREV_SECTION,
DEBUG_ARANGES_SECTION, DEBUG_MACINFO_SECTION, DEBUG_LINE_SECTION,
DEBUG_LOC_SECTION, DEBUG_PUBNAMES_SECTION, DEBUG_STR_SECTION,
DEBUG_RANGES_SECTION): Define.
2004-05-18 Zack Weinberg <zack@codesourcery.com> 2004-05-18 Zack Weinberg <zack@codesourcery.com>
* cgraph.c (hash_node, eq_node, cgraph_node, cgraph_remove_node) * cgraph.c (hash_node, eq_node, cgraph_node, cgraph_remove_node)
......
...@@ -76,7 +76,7 @@ extern void darwin_asm_named_section (const char *, unsigned int); ...@@ -76,7 +76,7 @@ extern void darwin_asm_named_section (const char *, unsigned int);
extern unsigned int darwin_section_type_flags (tree, const char *, int); extern unsigned int darwin_section_type_flags (tree, const char *, int);
extern void darwin_non_lazy_pcrel (FILE *, rtx); extern void darwin_non_lazy_pcrel (FILE *, rtx);
extern void darwin_emit_unwind_label(FILE *, tree, int); extern void darwin_emit_unwind_label (FILE *, tree, int, int);
extern void darwin_pragma_ignore (struct cpp_reader *); extern void darwin_pragma_ignore (struct cpp_reader *);
extern void darwin_pragma_options (struct cpp_reader *); extern void darwin_pragma_options (struct cpp_reader *);
......
...@@ -1334,10 +1334,12 @@ darwin_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED) ...@@ -1334,10 +1334,12 @@ darwin_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED)
} }
/* Emit a label for an FDE, making it global and/or weak if appropriate. /* Emit a label for an FDE, making it global and/or weak if appropriate.
The third parameter is nonzero if this is just a placeholder for an The third parameter is nonzero if this is for exception handling.
The fourth parameter is nonzero if this is just a placeholder for an
FDE that we are omitting. */ FDE that we are omitting. */
void void
darwin_emit_unwind_label(FILE *file, tree decl, int empty) darwin_emit_unwind_label (FILE *file, tree decl, int for_eh, int empty)
{ {
tree id = DECL_ASSEMBLER_NAME (decl) tree id = DECL_ASSEMBLER_NAME (decl)
? DECL_ASSEMBLER_NAME (decl) ? DECL_ASSEMBLER_NAME (decl)
...@@ -1350,12 +1352,15 @@ darwin_emit_unwind_label(FILE *file, tree decl, int empty) ...@@ -1350,12 +1352,15 @@ darwin_emit_unwind_label(FILE *file, tree decl, int empty)
unsigned int base_len = IDENTIFIER_LENGTH (id); unsigned int base_len = IDENTIFIER_LENGTH (id);
const char *suffix = ".eh"; const char *suffix = ".eh";
unsigned int suffix_len = 3;
int need_quotes = name_needs_quotes (base); int need_quotes = name_needs_quotes (base);
int quotes_len = need_quotes ? 2 : 0; int quotes_len = need_quotes ? 2 : 0;
char *lab;
if (! for_eh)
suffix = ".eh1";
char *lab = xmalloc (prefix_len + base_len + suffix_len + quotes_len + 1); lab = xmalloc (prefix_len + base_len + strlen (suffix) + quotes_len + 1);
lab[0] = '\0'; lab[0] = '\0';
if (need_quotes) if (need_quotes)
...@@ -1385,6 +1390,7 @@ darwin_emit_unwind_label(FILE *file, tree decl, int empty) ...@@ -1385,6 +1390,7 @@ darwin_emit_unwind_label(FILE *file, tree decl, int empty)
} }
/* Generate a PC-relative reference to a Mach-O non-lazy-symbol. */ /* Generate a PC-relative reference to a Mach-O non-lazy-symbol. */
void void
darwin_non_lazy_pcrel (FILE *file, rtx addr) darwin_non_lazy_pcrel (FILE *file, rtx addr)
{ {
......
...@@ -304,6 +304,21 @@ Boston, MA 02111-1307, USA. */ ...@@ -304,6 +304,21 @@ Boston, MA 02111-1307, USA. */
#define DBX_DEBUGGING_INFO 1 #define DBX_DEBUGGING_INFO 1
/* Also enable Dwarf 2 as an option. */
#define DWARF2_DEBUGGING_INFO
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
#define DEBUG_FRAME_SECTION "__DWARFA,__debug_frame,coalesced,no_toc+strip_static_syms"
#define DEBUG_INFO_SECTION "__DWARFA,__debug_info"
#define DEBUG_ABBREV_SECTION "__DWARFA,__debug_abbrev"
#define DEBUG_ARANGES_SECTION "__DWARFA,__debug_aranges"
#define DEBUG_MACINFO_SECTION "__DWARFA,__debug_macinfo"
#define DEBUG_LINE_SECTION "__DWARFA,__debug_line"
#define DEBUG_LOC_SECTION "__DWARFA,__debug_loc"
#define DEBUG_PUBNAMES_SECTION "__DWARFA,__debug_pubnames"
#define DEBUG_STR_SECTION "__DWARFA,__debug_str"
#define DEBUG_RANGES_SECTION "__DWARFA,__debug_ranges"
/* When generating stabs debugging, use N_BINCL entries. */ /* When generating stabs debugging, use N_BINCL entries. */
#define DBX_USE_BINCL #define DBX_USE_BINCL
......
...@@ -7493,13 +7493,14 @@ If this macro is not defined, nothing special is output at the end of ...@@ -7493,13 +7493,14 @@ If this macro is not defined, nothing special is output at the end of
the jump-table. the jump-table.
@end defmac @end defmac
@deftypefn {Target Hook} void TARGET_ASM_EMIT_UNWIND_LABEL (@var{stream}, @var{decl}, @var{empty}) @deftypefn {Target Hook} void TARGET_ASM_EMIT_UNWIND_LABEL (@var{stream}, @var{decl}, @var{for_eh}, @var{empty})
This target hook emits a label at the beginning of each FDE. It This target hook emits a label at the beginning of each FDE. It
should be defined on targets where FDEs need special labels, and it should be defined on targets where FDEs need special labels, and it
should write the appropriate label, for the FDE associated with the should write the appropriate label, for the FDE associated with the
function declaration @var{decl}, to the stdio stream @var{stream}. function declaration @var{decl}, to the stdio stream @var{stream}.
The third argument, @var{empty}, is a boolean: true if this is a The third argument, @var{for_eh}, is a boolean: true if this is for an
placeholder label for an omitted FDE. exception table. The fourth argument, @var{empty}, is a boolean:
true if this is a placeholder label for an omitted FDE.
The default is that FDEs are not given nonlocal labels. The default is that FDEs are not given nonlocal labels.
@end deftypefn @end deftypefn
......
...@@ -1959,7 +1959,7 @@ output_call_frame_info (int for_eh) ...@@ -1959,7 +1959,7 @@ output_call_frame_info (int for_eh)
&& !fde_table[i].uses_eh_lsda && !fde_table[i].uses_eh_lsda
&& ! DECL_ONE_ONLY (fde_table[i].decl)) && ! DECL_ONE_ONLY (fde_table[i].decl))
targetm.asm_out.unwind_label (asm_out_file, fde_table[i].decl, targetm.asm_out.unwind_label (asm_out_file, fde_table[i].decl,
/* empty */ 1); for_eh, /* empty */ 1);
/* If we don't have any functions we'll want to unwind out of, don't /* If we don't have any functions we'll want to unwind out of, don't
emit any EH unwind information. Note that if exceptions aren't emit any EH unwind information. Note that if exceptions aren't
...@@ -2123,7 +2123,7 @@ output_call_frame_info (int for_eh) ...@@ -2123,7 +2123,7 @@ output_call_frame_info (int for_eh)
&& !fde->uses_eh_lsda) && !fde->uses_eh_lsda)
continue; continue;
targetm.asm_out.unwind_label (asm_out_file, fde->decl, /* empty */ 0); targetm.asm_out.unwind_label (asm_out_file, fde->decl, for_eh, /* empty */ 0);
targetm.asm_out.internal_label (asm_out_file, FDE_LABEL, for_eh + i * 2); targetm.asm_out.internal_label (asm_out_file, FDE_LABEL, for_eh + i * 2);
ASM_GENERATE_INTERNAL_LABEL (l1, FDE_AFTER_SIZE_LABEL, for_eh + i * 2); ASM_GENERATE_INTERNAL_LABEL (l1, FDE_AFTER_SIZE_LABEL, for_eh + i * 2);
ASM_GENERATE_INTERNAL_LABEL (l2, FDE_END_LABEL, for_eh + i * 2); ASM_GENERATE_INTERNAL_LABEL (l2, FDE_END_LABEL, for_eh + i * 2);
......
...@@ -515,7 +515,7 @@ extern const char *default_strip_name_encoding (const char *); ...@@ -515,7 +515,7 @@ extern const char *default_strip_name_encoding (const char *);
extern bool default_binds_local_p (tree); extern bool default_binds_local_p (tree);
extern bool default_binds_local_p_1 (tree, int); extern bool default_binds_local_p_1 (tree, int);
extern void default_globalize_label (FILE *, const char *); extern void default_globalize_label (FILE *, const char *);
extern void default_emit_unwind_label (FILE *, tree, int); extern void default_emit_unwind_label (FILE *, tree, int, int);
extern void default_internal_label (FILE *, const char *, unsigned long); extern void default_internal_label (FILE *, const char *, unsigned long);
extern void default_file_start (void); extern void default_file_start (void);
extern void file_end_indicate_exec_stack (void); extern void file_end_indicate_exec_stack (void);
......
...@@ -76,9 +76,10 @@ struct gcc_target ...@@ -76,9 +76,10 @@ struct gcc_target
/* Output code that will emit a label for unwind info, if this /* Output code that will emit a label for unwind info, if this
target requires such labels. Second argument is the decl the target requires such labels. Second argument is the decl the
unwind info is associated with, third is is a boolean: true if unwind info is associated with, third is a boolean: true if
this is for exception handling, fourth is a boolean: true if
this is only a placeholder for an omitted FDE. */ this is only a placeholder for an omitted FDE. */
void (* unwind_label ) (FILE *, tree, int); void (* unwind_label) (FILE *, tree, int, int);
/* Output an internal label. */ /* Output an internal label. */
void (* internal_label) (FILE *, const char *, unsigned long); void (* internal_label) (FILE *, const char *, unsigned long);
......
...@@ -5000,6 +5000,7 @@ default_globalize_label (FILE * stream, const char *name) ...@@ -5000,6 +5000,7 @@ default_globalize_label (FILE * stream, const char *name)
void void
default_emit_unwind_label (FILE * stream ATTRIBUTE_UNUSED, default_emit_unwind_label (FILE * stream ATTRIBUTE_UNUSED,
tree decl ATTRIBUTE_UNUSED, tree decl ATTRIBUTE_UNUSED,
int for_eh ATTRIBUTE_UNUSED,
int empty ATTRIBUTE_UNUSED) int empty ATTRIBUTE_UNUSED)
{ {
} }
......
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