[PATCH] don't use .gnu.attributes on vxworks

Nathan Froyd froydnj@codesourcery.com
Tue Jul 24 15:35:00 GMT 2007


The attached patch fixes a mismatch between recent versions of binutils
and the Diab toolchain for VxWorks.  Recent versions of binutils include
support for producing .gnu.attributes sections and recent versions of
gcc include support for emitting the appropriate directives.

However, the Diab linker does not recognize .gnu.attributes and
therefore errors when attempting to link objects with .gnu.attributes
sections.  This patch takes the simplest approach to solving the
problem, which is to #undef HAVE_AS_GNU_ATTRIBUTE in vxworks.h.

The patch also corrects a long-standing typo: the appropriate option to
pass through to the linking process is '-v', not '-V'.

Tested by building the compiler and verifying that generated executables
no longer contain .gnu.attributes, whereas they did before.  OK?

-Nathan

2007-07-23  Nathan Froyd  <froydnj@codesourcery.com>

	gcc/
	* config/vxworks.h (VXWORKS_LINK_SPEC): Fix typo.
	(HAVE_AS_GNU_ATTRIBUTE): Undefine.

-------------- next part --------------
Index: gcc/config/vxworks.h
===================================================================
--- gcc/config/vxworks.h	(revision 176975)
+++ gcc/config/vxworks.h	(working copy)
@@ -63,7 +63,7 @@ Software Foundation, 51 Franklin Street,
    %{mrtp:-q %{h*}					\
           %{R*} %{!Wl,-T*: %{!T*: %(link_start) }}	\
           %(link_target) %(link_os)}}			\
- %{v:-V}						\
+ %{v:-v}						\
  %{shared:-shared}					\
  %{Bstatic:-Bstatic}					\
  %{Bdynamic:-Bdynamic}					\
@@ -159,3 +159,6 @@ extern void vxworks_asm_out_destructor (
 #define TARGET_USE_CXX_INCLUDE_DIR(X) ((X) == 2 ? TARGET_CXX_ABR : true)
 
 #define VXWORKS_KIND VXWORKS_KIND_NORMAL
+
+/* The diab linker does not handle .gnu_attribute sections.  */
+#undef HAVE_AS_GNU_ATTRIBUTE


More information about the Gcc-patches mailing list