Fix libctf build on non-ELF targets.
[deliverable/binutils-gdb.git] / libctf / ctf-open-bfd.c
index d6d442ea42580b0510d59608447eddd7ed59a8d0..5e34d123699b19e963e99fb030756c0add7205aa 100644 (file)
@@ -119,7 +119,8 @@ ctf_bfdopen (struct bfd *abfd, int *errp)
    later.  */
 
 ctf_archive_t *
-ctf_bfdopen_ctfsect (struct bfd *abfd, const ctf_sect_t *ctfsect, int *errp)
+ctf_bfdopen_ctfsect (struct bfd *abfd _libctf_unused_,
+                    const ctf_sect_t *ctfsect, int *errp)
 {
   struct ctf_archive *arc = NULL;
   ctf_archive_t *arci;
@@ -129,6 +130,7 @@ ctf_bfdopen_ctfsect (struct bfd *abfd, const ctf_sect_t *ctfsect, int *errp)
   const char *bfderrstr = NULL;
   int is_archive;
 
+#ifdef HAVE_BFD_ELF
   asection *sym_asect;
   ctf_sect_t symsect, strsect;
   /* TODO: handle SYMTAB_SHNDX.  */
@@ -178,6 +180,7 @@ ctf_bfdopen_ctfsect (struct bfd *abfd, const ctf_sect_t *ctfsect, int *errp)
          symsectp = &symsect;
        }
     }
+#endif
 
   if (ctfsect->cts_size > sizeof (uint64_t) &&
       ((*(uint64_t *) ctfsect->cts_data) == CTFA_MAGIC))
@@ -203,9 +206,11 @@ ctf_bfdopen_ctfsect (struct bfd *abfd, const ctf_sect_t *ctfsect, int *errp)
   if (arci)
     return arci;
  err_free_sym:
+#ifdef HAVE_BFD_ELF
   free ((void *) symsect.cts_data);
 err_free_str:
   free ((void *) strsect.cts_data);
+#endif
 err: _libctf_unused_;
   if (bfderrstr)
     {
This page took 0.024531 seconds and 4 git commands to generate.