This is the mail archive of the
mailing list for the GDB project.
[commit] Build failure on ppc-aix (bfd_elf_get_obj_attr_int is undefined)
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org
- Cc: froydnj at codesourcery dot com, Joel Brobecker <brobecker at adacore dot com>
- Date: Wed, 24 Nov 2010 16:28:59 -0800
- Subject: [commit] Build failure on ppc-aix (bfd_elf_get_obj_attr_int is undefined)
- References: <email@example.com>
The following change introduced an unconditional use of a bfd/ELF routine:
* rs6000-tdep.c (bfd_uses_spe_extensions): New function.
(rs6000_gdbarch_init): Call it.
However, bfd_uses_spe_extensions should only be used when BFD has been built
with ELF support. The typical way of checking that in GDB is to use
the HAVE_ELF macro.
I think that the attached patch handles things the proper way:
- If ELF is supported, then using the attribute;
- Otherwise, just skip that test, and use the other methods.
Nathan, if you could test this patch on your end of things, to make sure
I didn't break anything, that'd be great.
* rs6000-tdep.c (bfd_uses_spe_extensions): Use bfd_elf_get_obj_attr_int
only if HAVE_ELF is defined.
In the meantime, I have checked this patch in, since if fixes a build
failure. Tested on ppc-aix as well as x86_64-linux (kind of useless,
but since I did include that patch in the batch of testing...).
gdb/ChangeLog | 5 +++++
gdb/rs6000-tdep.c | 2 ++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 03bf65d..869b8d7 100644
@@ -1,3 +1,8 @@
+2010-11-24 Joel Brobecker <firstname.lastname@example.org>
+ * rs6000-tdep.c (bfd_uses_spe_extensions): Use bfd_elf_get_obj_attr_int
+ only if HAVE_ELF is defined.
2010-11-24 Jan Kratochvil <email@example.com>
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 53c3f4c..81a99b6 100644
@@ -3376,6 +3376,7 @@ bfd_uses_spe_extensions (bfd *abfd)
/* Using Tag_GNU_Power_ABI_Vector here is a bit of a hack, as the user
could be using the SPE vector abi without actually using any spe
bits whatsoever. But it's close enough for now. */
@@ -3383,6 +3384,7 @@ bfd_uses_spe_extensions (bfd *abfd)
if (vector_abi == 3)
sect = bfd_get_section_by_name (abfd, ".PPC.EMB.apuinfo");