From: Mike Stump Date: Wed, 19 May 2004 02:11:42 +0000 (+0000) Subject: tm.texi (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument to indicate if this label is... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eeab4d81a61970e9079dbd9a8033d13e0cc27980;p=gcc.git 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 From-SVN: r82016 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 74e1c531a49..331c634c100 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,21 @@ +2004-05-18 Mike Stump + Devang Patel + + * 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 * cgraph.c (hash_node, eq_node, cgraph_node, cgraph_remove_node) diff --git a/gcc/config/darwin-protos.h b/gcc/config/darwin-protos.h index 845a8283c73..1cfdd73223c 100644 --- a/gcc/config/darwin-protos.h +++ b/gcc/config/darwin-protos.h @@ -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 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_options (struct cpp_reader *); diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index a626045a9fc..89e11ded2e6 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -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. - 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. */ + 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) ? DECL_ASSEMBLER_NAME (decl) @@ -1350,12 +1352,15 @@ darwin_emit_unwind_label(FILE *file, tree decl, int empty) unsigned int base_len = IDENTIFIER_LENGTH (id); const char *suffix = ".eh"; - unsigned int suffix_len = 3; int need_quotes = name_needs_quotes (base); 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'; if (need_quotes) @@ -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. */ + void darwin_non_lazy_pcrel (FILE *file, rtx addr) { diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index de8d0c419f0..67bb29434bb 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -304,6 +304,21 @@ Boston, MA 02111-1307, USA. */ #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. */ #define DBX_USE_BINCL diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index a0f855d904e..43543a81103 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -7493,13 +7493,14 @@ If this macro is not defined, nothing special is output at the end of the jump-table. @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 should be defined on targets where FDEs need special labels, and it should write the appropriate label, for the FDE associated with the function declaration @var{decl}, to the stdio stream @var{stream}. -The third argument, @var{empty}, is a boolean: true if this is a -placeholder label for an omitted FDE. +The third argument, @var{for_eh}, is a boolean: true if this is for an +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. @end deftypefn diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index cfedd13bd28..92767ab0ed5 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -1959,7 +1959,7 @@ output_call_frame_info (int for_eh) && !fde_table[i].uses_eh_lsda && ! DECL_ONE_ONLY (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 emit any EH unwind information. Note that if exceptions aren't @@ -2123,7 +2123,7 @@ output_call_frame_info (int for_eh) && !fde->uses_eh_lsda) 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); 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); diff --git a/gcc/output.h b/gcc/output.h index 945dace71d2..8ea3d12af99 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -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_1 (tree, int); 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_file_start (void); extern void file_end_indicate_exec_stack (void); diff --git a/gcc/target.h b/gcc/target.h index 6e288104559..8e0b592291a 100644 --- a/gcc/target.h +++ b/gcc/target.h @@ -76,9 +76,10 @@ struct gcc_target /* Output code that will emit a label for unwind info, if this 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. */ - void (* unwind_label ) (FILE *, tree, int); + void (* unwind_label) (FILE *, tree, int, int); /* Output an internal label. */ void (* internal_label) (FILE *, const char *, unsigned long); diff --git a/gcc/varasm.c b/gcc/varasm.c index 96d264a2fe1..beace4ed8d4 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -5000,6 +5000,7 @@ default_globalize_label (FILE * stream, const char *name) void default_emit_unwind_label (FILE * stream ATTRIBUTE_UNUSED, tree decl ATTRIBUTE_UNUSED, + int for_eh ATTRIBUTE_UNUSED, int empty ATTRIBUTE_UNUSED) { }