Add a test case for skip with inlined functions
[deliverable/binutils-gdb.git] / bfd / elf-strtab.c
index ec9002fae7b26cec18eb92ab364a36bd9f22bca6..55e138a6319cb105a8a2482aa56bc72678201bf5 100644 (file)
@@ -270,6 +270,12 @@ _bfd_elf_strtab_size (struct elf_strtab_hash *tab)
   return tab->sec_size ? tab->sec_size : tab->size;
 }
 
+bfd_size_type
+_bfd_elf_strtab_len (struct elf_strtab_hash *tab)
+{
+  return tab->size;
+}
+
 bfd_size_type
 _bfd_elf_strtab_offset (struct elf_strtab_hash *tab, size_t idx)
 {
@@ -285,6 +291,19 @@ _bfd_elf_strtab_offset (struct elf_strtab_hash *tab, size_t idx)
   return tab->array[idx]->u.index;
 }
 
+const char *
+_bfd_elf_strtab_str (struct elf_strtab_hash *tab, size_t idx,
+                    bfd_size_type *offset)
+{
+  if (idx == 0)
+    return 0;
+  BFD_ASSERT (idx < tab->size);
+  BFD_ASSERT (tab->sec_size);
+  if (offset)
+    *offset = tab->array[idx]->u.index;
+  return tab->array[idx]->root.string;
+}
+
 bfd_boolean
 _bfd_elf_strtab_emit (register bfd *abfd, struct elf_strtab_hash *tab)
 {
@@ -315,7 +334,9 @@ _bfd_elf_strtab_emit (register bfd *abfd, struct elf_strtab_hash *tab)
   return TRUE;
 }
 
-/* Compare two elf_strtab_hash_entry structures.  Called via qsort.  */
+/* Compare two elf_strtab_hash_entry structures.  Called via qsort.
+   Won't ever return zero as all entries differ, so there is no issue
+   with qsort stability here.  */
 
 static int
 strrevcmp (const void *a, const void *b)
This page took 0.024494 seconds and 4 git commands to generate.