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]

[PATCH] Remove some unused code from unwind-de2-fde.o


The attached patch avoids the inclusion of some unused static
functions in unwind-dw2-fde.o.  This makes it possible to include that
module (and only that module) in glibc.  While it isn't certain that
we will make use of this code in glibc, this patch does something
useful for other systems too, since it eleminates some unused code,
and saves a few relocations in the shared libgcc.

Bootstrapped and tested on sparc-sun-solaris2.6.  No regressions.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* unwind-pe.h (base_of_encoded_value, read_encoded_value): Define
	only if NO_BASE_OF_ENCODED_VALUE isn't defined.
	* unwind-dw2-fde.c (NO_BASE_OF_ENCODED_VALUE): Define before
	including "unwind-pe.h".

Index: unwind-pe.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/unwind-pe.h,v
retrieving revision 1.2.2.4
diff -u -p -r1.2.2.4 unwind-pe.h
--- unwind-pe.h 2001/06/09 17:58:28 1.2.2.4
+++ unwind-pe.h 2001/07/30 18:00:18
@@ -76,6 +76,8 @@ size_of_encoded_value (unsigned char enc
   __gxx_abort ();
 }
 
+#ifndef NO_BASE_OF_ENCODED_VALUE
+
 /* Given an encoding and an _Unwind_Context, return the base to which
    the encoding is relative.  This base may then be passed to
    read_encoded_value_with_base for use when the _Unwind_Context is
@@ -104,6 +106,8 @@ base_of_encoded_value (unsigned char enc
   __gxx_abort ();
 }
 
+#endif
+
 /* Load an encoded value from memory at P.  The value is returned in VAL;
    The function returns P incremented past the value.  BASE is as given
    by base_of_encoded_value for this encoding in the appropriate context.  */
@@ -220,6 +224,8 @@ read_encoded_value_with_base (unsigned c
   return p;
 }
 
+#ifndef NO_BASE_OF_ENCODED_VALUE
+
 /* Like read_encoded_value_with_base, but get the base from the context
    rather than providing it directly.  */
 
@@ -231,6 +237,8 @@ read_encoded_value (struct _Unwind_Conte
 		base_of_encoded_value (encoding, context),
 		p, val);
 }
+
+#endif
 
 /* Read an unsigned leb128 value from P, store the value in VAL, return
    P incremented past the value.  */
Index: unwind-dw2-fde.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/unwind-dw2-fde.c,v
retrieving revision 1.2.2.6
diff -u -p -r1.2.2.6 unwind-dw2-fde.c
--- unwind-dw2-fde.c 2001/06/11 20:15:07 1.2.2.6
+++ unwind-dw2-fde.c 2001/07/30 18:00:18
@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA.  */
 #include "tsystem.h"
 #include "dwarf2.h"
 #include "unwind.h"
+#define NO_BASE_OF_ENCODED_VALUE
 #include "unwind-pe.h"
 #include "unwind-dw2-fde.h"
 #include "gthr.h"



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