+static int
+process_gnu_liblist (file)
+ FILE * file;
+{
+ Elf_Internal_Shdr * section, * string_sec;
+ Elf32_External_Lib * elib;
+ char * strtab;
+ size_t cnt;
+ unsigned i;
+
+ if (! do_arch)
+ return 0;
+
+ for (i = 0, section = section_headers;
+ i < elf_header.e_shnum;
+ i++, section ++)
+ {
+ switch (section->sh_type)
+ {
+ case SHT_GNU_LIBLIST:
+ elib = ((Elf32_External_Lib *)
+ get_data (NULL, file, section->sh_offset, section->sh_size,
+ _("liblist")));
+
+ if (elib == NULL)
+ break;
+ string_sec = SECTION_HEADER (section->sh_link);
+
+ strtab = (char *) get_data (NULL, file, string_sec->sh_offset,
+ string_sec->sh_size,
+ _("liblist string table"));
+
+ if (strtab == NULL
+ || section->sh_entsize != sizeof (Elf32_External_Lib))
+ {
+ free (elib);
+ break;
+ }
+
+ printf (_("\nLibrary list section '%s' contains %lu entries:\n"),
+ SECTION_NAME (section),
+ (long) (section->sh_size / sizeof (Elf32_External_Lib)));
+
+ puts (" Library Time Stamp Checksum Version Flags");
+
+ for (cnt = 0; cnt < section->sh_size / sizeof (Elf32_External_Lib);
+ ++cnt)
+ {
+ Elf32_Lib liblist;
+ time_t time;
+ char timebuf[20];
+ struct tm * tmp;
+
+ liblist.l_name = BYTE_GET (elib[cnt].l_name);
+ time = BYTE_GET (elib[cnt].l_time_stamp);
+ liblist.l_checksum = BYTE_GET (elib[cnt].l_checksum);
+ liblist.l_version = BYTE_GET (elib[cnt].l_version);
+ liblist.l_flags = BYTE_GET (elib[cnt].l_flags);
+
+ tmp = gmtime (&time);
+ sprintf (timebuf, "%04u-%02u-%02uT%02u:%02u:%02u",
+ tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
+ tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+ printf ("%3lu: ", (unsigned long) cnt);
+ if (do_wide)
+ printf ("%-20s", strtab + liblist.l_name);
+ else
+ printf ("%-20.20s", strtab + liblist.l_name);
+ printf (" %s %#010lx %-7ld %-7ld\n", timebuf, liblist.l_checksum,
+ liblist.l_version, liblist.l_flags);
+ }
+
+ free (elib);
+ }
+ }
+
+ return 1;
+}
+