This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[patch] PPC build faiure (was: Re VXWorks support for PPC)
- From: Paul Brook <paul at codesourcery dot com>
- To: binutils at sources dot redhat dot com
- Cc: Nick Clifton <nickc at redhat dot com>
- Date: Tue, 5 Jul 2005 17:08:24 +0100
- Subject: [patch] PPC build faiure (was: Re VXWorks support for PPC)
- References: <m3d5pxs1z8.fsf@redhat.com>
On Tuesday 05 July 2005 16:32, Nick Clifton wrote:
> Hi Paul,
>
> Your recent check-in to add support for ppc-vxworks appears to have
> broken other ELF based PPC toolchains. eg for powerpc-eabisim I now
> get:
>
> .../bfd/elf32-ppc.c:7414: error: 'ppc_special_sections_s' undeclared here
> (not in a function) .../bfd/elf32-ppc.c:7415: error:
> 'ppc_special_sections_t' undeclared here (not in a function)
> .../bfd/elf32-ppc.c:7422: error: 'ppc_special_sections_other' undeclared
> here (not in a function)
My patch was still using the old method of handling special sections.
Attached patch fixes this.
Tested on powerpc-linux --enable-targets=all.
Ok?
2005-07-06 Paul Brook <paul@codesourcery.com>
* elf32-ppc.c (ppc_elf_vxworks_special_sections): Remove.
(ppc_elf_vxworks_get_sec_type_attr): New function.
(elf_backend_special_sections): Remove vxwords definition.
(elf_backend_get_sec_type_attr): Define for vxworks.
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /var/cvsroot/src-cvs/src/bfd/elf32-ppc.c,v
retrieving revision 1.169
diff -u -p -r1.169 elf32-ppc.c
--- bfd/elf32-ppc.c 5 Jul 2005 13:25:47 -0000 1.169
+++ bfd/elf32-ppc.c 5 Jul 2005 15:51:45 -0000
@@ -7388,39 +7388,18 @@ ppc_elf_finish_dynamic_sections (bfd *ou
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-powerpc-vxworks"
-/* This is the same as ppc_elf_special_sections except it does not include
- the entry for .plt. */
-static struct bfd_elf_special_section const *
- ppc_elf_vxworks_special_sections[27]=
+/* VxWorks uses the elf default section flags for .plt. */
+static const struct bfd_elf_special_section *
+ppc_elf_vxworks_get_sec_type_attr (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
{
- NULL, /* 'a' */
- NULL, /* 'b' */
- NULL, /* 'c' */
- NULL, /* 'd' */
- NULL, /* 'e' */
- NULL, /* 'f' */
- NULL, /* 'g' */
- NULL, /* 'h' */
- NULL, /* 'i' */
- NULL, /* 'j' */
- NULL, /* 'k' */
- NULL, /* 'l' */
- NULL, /* 'm' */
- NULL, /* 'n' */
- NULL, /* 'o' */
- NULL, /* 'p' */
- NULL, /* 'q' */
- NULL, /* 'r' */
- ppc_special_sections_s, /* 's' */
- ppc_special_sections_t, /* 's' */
- NULL, /* 'u' */
- NULL, /* 'v' */
- NULL, /* 'w' */
- NULL, /* 'x' */
- NULL, /* 'y' */
- NULL, /* 'z' */
- ppc_special_sections_other, /* other */
-};
+ if (sec->name == NULL)
+ return NULL;
+
+ if (strcmp (sec->name, ".plt") == 0)
+ return _bfd_elf_get_sec_type_attr (abfd, sec);
+
+ return ppc_elf_get_sec_type_attr (abfd, sec);
+}
/* Like ppc_elf_link_hash_table_create, but overrides
appropriately for VxWorks. */
@@ -7501,9 +7480,6 @@ ppc_elf_vxworks_final_write_processing (
#undef bfd_elf32_bfd_link_hash_table_create
#define bfd_elf32_bfd_link_hash_table_create \
ppc_elf_vxworks_link_hash_table_create
-#undef elf_backend_special_sections
-#define elf_backend_special_sections \
- ppc_elf_vxworks_special_sections
#undef elf_backend_add_symbol_hook
#define elf_backend_add_symbol_hook \
ppc_elf_vxworks_add_symbol_hook
@@ -7513,6 +7489,9 @@ ppc_elf_vxworks_final_write_processing (
#undef elf_backend_final_write_processing
#define elf_backend_final_write_processing \
ppc_elf_vxworks_final_write_processing
+#undef elf_backend_get_sec_type_attr
+#define elf_backend_get_sec_type_attr \
+ ppc_elf_vxworks_get_sec_type_attr
#undef elf_backend_emit_relocs
#define elf_backend_emit_relocs \
elf_vxworks_emit_relocs