From: Michael Urman Date: Mon, 13 Sep 2004 00:01:03 +0000 (-0000) Subject: Add a final SO for any .text section. This is used to identify the end X-Git-Tag: v0.4.0~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ddbfba0fbe2b13e600a2a3f3c7a075f4231f2b50;p=yasm Add a final SO for any .text section. This is used to identify the end of the final function. FIXME: This creates a symbol (label .n_so) which currently has to be added to the symtab. Peter thinks it should work fine outside the table, so perhaps this is a bug in elf. Currently without being in the table instead of identifying the end of the function, it identifies offset 0. svn path=/trunk/yasm/; revision=1146 --- diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index 9979852a..4ebe08c8 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -339,8 +339,16 @@ stabs_dbgfmt_generate_sections(yasm_section *sect, /*@null@*/ void *d) N_FUN, 0, info->firstsym, info->firstbc, 0); yasm_xfree(str); } + yasm_section_bcs_traverse(sect, d, stabs_dbgfmt_generate_bcs); + if (yasm__strcasecmp(sectname, ".text")==0) { + /* Close out last function by appending a null SO stab after last bc */ + yasm_bytecode *bc = yasm_section_bcs_last(sect); + yasm_symrec *sym = yasm_symtab_define_label2(".n_so", bc, 1, bc->line); + stabs_dbgfmt_append_stab(info, info->stab, 0, N_SO, 0, sym, bc, 0); + } + return 1; }