This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] dwarf2out.c (size_of_aranges): Skip DECL_IGNORED_P functions.


Hi,

The following change

  2012-05-03  Jason Merrill  <jason@redhat.com>

       * config/i386/i386.c (ix86_code_end): Set DECL_IGNORED_P on the
       pc thunk.
       * dwarf2out.c (output_aranges): Skip DECL_IGNORED_P functions.
       (dwarf2out_finish): Likewise.

caused the length field of a debug aranges table to sometimes be too
big. This causes DWARF readers that rely on the length field (dwz/binutils)
and not just on the terminator of the table (elfutils) to read the wrong
values on subsequent aranges tables.

This can be fixed by making the same change in size_of_aranges:

  2013-03-21  Mark Wielaard  <mjw@redhat.com>

        * dwarf2out.c (size_of_aranges): Skip DECL_IGNORED_P functions.

Cheers,

Mark
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 9be7728..b298cd9 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -7848,6 +7848,8 @@ size_of_aranges (void)
 
       FOR_EACH_VEC_ELT (*fde_vec, fde_idx, fde)
 	{
+	  if (DECL_IGNORED_P (fde->decl))
+	    continue;
 	  if (!fde->in_std_section)
 	    size += 2 * DWARF2_ADDR_SIZE;
 	  if (fde->dw_fde_second_begin && !fde->second_in_std_section)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]