* elf.c (bfd_section_from_shdr): Handle SHT_GNU_LIBLIST.
authorJakub Jelinek <jakub@redhat.com>
Mon, 11 Oct 2004 13:48:36 +0000 (13:48 +0000)
committerJakub Jelinek <jakub@redhat.com>
Mon, 11 Oct 2004 13:48:36 +0000 (13:48 +0000)
(special_sections): Add .gnu.liblist and .gnu.conflict.
(assign_section_numbers): Handle SHT_GNU_LIBLIST.

bfd/ChangeLog
bfd/elf.c

index a2d4bff85f4b372f73859768c640ceb094ea2795..558074e1fadda9c13fab8455ca9846259af1eef5 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-11  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf.c (bfd_section_from_shdr): Handle SHT_GNU_LIBLIST.
+       (special_sections): Add .gnu.liblist and .gnu.conflict.
+       (assign_section_numbers): Handle SHT_GNU_LIBLIST.
+
 2004-10-11  Alan Modra  <amodra@bigpond.net.au>
 
        PR 233
index e71c18c6be1b44e70cadcd1e168a30372e503203..27142a1dc41dd8dc925b0b1c3d293e8184fa4f3e 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1739,6 +1739,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
     case SHT_INIT_ARRAY:       /* .init_array section.  */
     case SHT_FINI_ARRAY:       /* .fini_array section.  */
     case SHT_PREINIT_ARRAY:    /* .preinit_array section.  */
+    case SHT_GNU_LIBLIST:      /* .gnu.liblist section.  */
       return _bfd_elf_make_section_from_shdr (abfd, hdr, name);
 
     case SHT_DYNAMIC:  /* Dynamic linking information.  */
@@ -2132,6 +2133,8 @@ static struct bfd_elf_special_section const special_sections[] =
   { ".rela",           5, -1, SHT_RELA,     0 },
   { ".rel",            4, -1, SHT_REL,      0 },
   { ".stabstr",        5,  3, SHT_STRTAB,   0 },
+  { ".gnu.liblist",   12,  0, SHT_GNU_LIBLIST, SHF_ALLOC },
+  { ".gnu.conflict",  13,  0, SHT_RELA,     SHF_ALLOC },
   { NULL,              0,  0, 0,            0 }
 };
 
@@ -2969,6 +2972,17 @@ assign_section_numbers (bfd *abfd)
            d->this_hdr.sh_link = elf_section_data (s)->this_idx;
          break;
 
+       case SHT_GNU_LIBLIST:
+         /* sh_link is the section header index of the prelink library
+            list 
+            used for the dynamic entries, or the symbol table, or the
+            version strings.  */
+         s = bfd_get_section_by_name (abfd, (sec->flags & SEC_ALLOC)
+                                            ? ".dynstr" : ".gnu.libstr");
+         if (s != NULL)
+           d->this_hdr.sh_link = elf_section_data (s)->this_idx;
+         break;
+
        case SHT_HASH:
        case SHT_GNU_versym:
          /* sh_link is the section header index of the symbol table