* elflink.h (elf_bfd_final_link): Don't crash on SHN_UNDEF local
authorAlan Modra <amodra@gmail.com>
Mon, 25 Feb 2002 23:31:22 +0000 (23:31 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 25 Feb 2002 23:31:22 +0000 (23:31 +0000)
dynsyms.

bfd/ChangeLog
bfd/elflink.h

index f140ff17ad1eaa343fd27795a703941ca31752b0..a381bfc63b6a3a8cc83514e460ee3caeae6b2b44 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-26  Andrew Macleod  <amacleod@cygnus.com>
+
+       * elflink.h (elf_bfd_final_link): Don't crash on SHN_UNDEF local
+       dynsyms.
+
 2002-02-25  Alan Modra  <amodra@bigpond.net.au>
 
        * elf64-hppa.h: Update copyright date.
index 47927d3830e46e6468cc415b1c5fe573b8415b8b..76dbb195b5184d6885dfbe2084b47441d684d9aa 100644 (file)
@@ -1,5 +1,5 @@
 /* ELF linker support.
-   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001
+   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -5375,8 +5375,9 @@ elf_bfd_final_link (abfd, info)
                  the original st_name with the dynstr_index.  */
               sym = e->isym;
 
-             if (e->isym.st_shndx < SHN_LORESERVE
-                 || e->isym.st_shndx > SHN_HIRESERVE)
+             if (e->isym.st_shndx != SHN_UNDEF
+                  && (e->isym.st_shndx < SHN_LORESERVE
+                      || e->isym.st_shndx > SHN_HIRESERVE))
                {
                  s = bfd_section_from_elf_index (e->input_bfd,
                                                  e->isym.st_shndx);