tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Building unwind tables by default



Hi all,
I would like to commit the attached patch to enable unwind tables by
default. This adds some constant tables to each program and library, but
allows reliable backtraces even when no frame pointer is used (like with
-fomit-frame-pointer). This means that libexecinfo or equivalent would
work for all binaries built with the new compiler version.

Some size constrained parts of the system, like boot loaders, are going
to need further changes to strip the sections away, but that should be
easy to identify.

Joerg
Index: external/gpl3/gcc/dist/gcc/target-def.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/gpl3/gcc/dist/gcc/target-def.h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 target-def.h
--- external/gpl3/gcc/dist/gcc/target-def.h     21 Jun 2011 01:20:12 -0000      
1.1.1.1
+++ external/gpl3/gcc/dist/gcc/target-def.h     6 Jun 2013 19:48:46 -0000
@@ -706,6 +706,7 @@
    }
 
 #ifndef TARGET_UNWIND_TABLES_DEFAULT
+#error "Missing unwind_tables_default"
 #define TARGET_UNWIND_TABLES_DEFAULT false
 #endif
 
Index: external/gpl3/gcc/dist/gcc/config/netbsd-elf.h
===================================================================
RCS file: 
/home/joerg/repo/netbsd/src/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h,v
retrieving revision 1.4
diff -u -p -r1.4 netbsd-elf.h
--- external/gpl3/gcc/dist/gcc/config/netbsd-elf.h      12 Aug 2012 00:01:50 
-0000      1.4
+++ external/gpl3/gcc/dist/gcc/config/netbsd-elf.h      6 Jun 2013 19:50:59 
-0000
@@ -108,3 +108,6 @@ along with GCC; see the file COPYING3.  
  %{static:%(link_gcc_c_sequence) -lmudflap}} \
  %{fmudflapth: -export-dynamic -lmudflapth -lpthread \
  %{static:%(link_gcc_c_sequence) -lmudflapth}} "
+
+#undef TARGET_UNWIND_TABLES_DEFAULT
+#define TARGET_UNWIND_TABLES_DEFAULT true
Index: gnu/dist/gcc4/gcc/target-def.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/gnu/dist/gcc4/gcc/target-def.h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 target-def.h
--- gnu/dist/gcc4/gcc/target-def.h      20 Apr 2006 09:05:40 -0000      1.1.1.1
+++ gnu/dist/gcc4/gcc/target-def.h      10 Jun 2013 18:29:37 -0000
@@ -473,6 +473,7 @@ Foundation, 51 Franklin Street, Fifth Fl
    }
 
 #ifndef TARGET_UNWIND_TABLES_DEFAULT
+#error "Missing unwind_tables_default"
 #define TARGET_UNWIND_TABLES_DEFAULT false
 #endif
 
Index: gnu/dist/gcc4/gcc/config/netbsd-elf.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/gnu/dist/gcc4/gcc/config/netbsd-elf.h,v
retrieving revision 1.2
diff -u -p -r1.2 netbsd-elf.h
--- gnu/dist/gcc4/gcc/config/netbsd-elf.h       12 May 2006 00:42:13 -0000      
1.2
+++ gnu/dist/gcc4/gcc/config/netbsd-elf.h       10 Jun 2013 18:30:32 -0000
@@ -93,3 +93,6 @@ Boston, MA 02110-1301, USA.  */
        %{rdynamic:-export-dynamic} \
        %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
      %{static:-static}}"
+
+#undef TARGET_UNWIND_TABLES_DEFAULT
+#define TARGET_UNWIND_TABLES_DEFAULT true


Home | Main Index | Thread Index | Old Index