elf: Remove the property after reporting its removal
[deliverable/binutils-gdb.git] / libctf / ctf-archive.c
index ab658fd351c483269fa76441c2d5ce716c2f585b..5c1692219e892f2f32cd54ce5878f8e26bedf884 100644 (file)
@@ -21,7 +21,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <elf.h>
-#include <endian.h>
+#include "ctf-endian.h"
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
@@ -68,7 +68,8 @@ ctf_arc_write (const char *file, ctf_file_t ** ctf_files, size_t ctf_file_cnt,
   off_t nameoffs;
   struct ctf_archive_modent *modent;
 
-  ctf_dprintf ("Writing archive %s with %zi files\n", file, ctf_file_cnt);
+  ctf_dprintf ("Writing archive %s with %lu files\n", file,
+              (unsigned long) ctf_file_cnt);
 
   if ((fd = open (file, O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0666)) < 0)
     {
@@ -82,7 +83,7 @@ ctf_arc_write (const char *file, ctf_file_t ** ctf_files, size_t ctf_file_cnt,
      uint64_t's.  */
   headersz = sizeof (struct ctf_archive)
     + (ctf_file_cnt * sizeof (uint64_t) * 2);
-  ctf_dprintf ("headersz is %zi\n", headersz);
+  ctf_dprintf ("headersz is %lu\n", (unsigned long) headersz);
 
   /* From now on we work in two pieces: an mmap()ed region from zero up to the
      headersz, and a region updated via write() starting after that, containing
@@ -150,7 +151,6 @@ ctf_arc_write (const char *file, ctf_file_t ** ctf_files, size_t ctf_file_cnt,
       strcpy (&nametbl[namesz], names[i]);
 
       off = arc_write_one_ctf (ctf_files[i], fd, threshold);
-      ctf_dprintf ("Written %s, offset now %zi\n", names[i], off);
       if ((off < 0) && (off > -ECTF_BASE))
        {
          errmsg = "ctf_arc_write(): Cannot determine file "
@@ -170,10 +170,11 @@ ctf_arc_write (const char *file, ctf_file_t ** ctf_files, size_t ctf_file_cnt,
       modent++;
     }
 
-  qsort_r ((ctf_archive_modent_t *) ((char *) archdr
-                                    + sizeof (struct ctf_archive)),
-          le64toh (archdr->ctfa_nfiles),
-          sizeof (struct ctf_archive_modent), sort_modent_by_name, nametbl);
+  ctf_qsort_r ((ctf_archive_modent_t *) ((char *) archdr
+                                        + sizeof (struct ctf_archive)),
+              le64toh (archdr->ctfa_nfiles),
+              sizeof (struct ctf_archive_modent), sort_modent_by_name,
+              nametbl);
 
    /* Now the name table.  */
 
@@ -510,18 +511,15 @@ ctf_arc_open_by_offset (const struct ctf_archive *arc,
   ctf_sect_t ctfsect;
   ctf_file_t *fp;
 
-  ctf_dprintf ("ctf_arc_open_by_offset(%zi): opening\n", offset);
+  ctf_dprintf ("ctf_arc_open_by_offset(%lu): opening\n", (unsigned long) offset);
 
-  bzero (&ctfsect, sizeof (ctf_sect_t));
+  memset (&ctfsect, 0, sizeof (ctf_sect_t));
 
   offset += le64toh (arc->ctfa_ctfs);
 
   ctfsect.cts_name = _CTF_SECTION;
-  ctfsect.cts_type = SHT_PROGBITS;
-  ctfsect.cts_flags = SHF_ALLOC;
   ctfsect.cts_size = le64toh (*((uint64_t *) ((char *) arc + offset)));
   ctfsect.cts_entsize = 1;
-  ctfsect.cts_offset = 0;
   ctfsect.cts_data = (void *) ((char *) arc + offset + sizeof (uint64_t));
   fp = ctf_bufopen (&ctfsect, symsect, strsect, errp);
   if (fp)
@@ -683,7 +681,7 @@ static int arc_mmap_unmap (void *header, size_t headersz, const char **errmsg)
 }
 #else
 /* Map the header in.  Only used on new, empty files.  */
-static void *arc_mmap_header (int fd, size_t headersz)
+static void *arc_mmap_header (int fd _libctf_unused_, size_t headersz)
 {
   void *hdr;
   if ((hdr = malloc (headersz)) == NULL)
This page took 0.024627 seconds and 4 git commands to generate.