This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Build failure on ppc-aix (bfd_elf_get_obj_attr_int is undefined)


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
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2010-11-24  Joel Brobecker  <>
+	* 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  <>
 	Code cleanup.
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 53c3f4c..81a99b6 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -3376,6 +3376,7 @@ bfd_uses_spe_extensions (bfd *abfd)
   if (!abfd)
     return 0;
+#ifdef HAVE_ELF
   /* 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)
     return 1;
   sect = bfd_get_section_by_name (abfd, ".PPC.EMB.apuinfo");
   if (!sect)

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