* elflink.c (elf_sort_symbol): Compare section id, not pointers.
authorAlexandre Oliva <aoliva@redhat.com>
Wed, 9 Jun 2004 13:49:04 +0000 (13:49 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Wed, 9 Jun 2004 13:49:04 +0000 (13:49 +0000)
(elf_link_add_object_symbols): Likewise.

bfd/ChangeLog
bfd/elflink.c

index 4d2a84a9fd82ff1bc680207b2435b6df6dfbd559..99de171724e7e6c626b0de5ab3ec909a76196f76 100644 (file)
@@ -1,5 +1,8 @@
 2004-06-09  Alexandre Oliva  <aoliva@redhat.com>
 
+       * elflink.c (elf_sort_symbol): Compare section id, not pointers.
+       (elf_link_add_object_symbols): Likewise.
+
        * elf-m10300.c (_bfd_mn10300_elf_reloc_type_class): New.
        (elf_backend_reloc_type_class): New.
 
index 436ff840e6d2364fd3800a1b11df6bcabca7dda0..37b113b6716cd586f6c3b0a62722652dfc9f68a5 100644 (file)
@@ -2728,7 +2728,7 @@ elf_sort_symbol (const void *arg1, const void *arg2)
     return vdiff > 0 ? 1 : -1;
   else
     {
-      long sdiff = h1->root.u.def.section - h2->root.u.def.section;
+      long sdiff = h1->root.u.def.section->id - h2->root.u.def.section->id;
       if (sdiff != 0)
        return sdiff > 0 ? 1 : -1;
     }
@@ -3982,7 +3982,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
                i = idx + 1;
              else
                {
-                 long sdiff = slook - h->root.u.def.section;
+                 long sdiff = slook->id - h->root.u.def.section->id;
                  if (sdiff < 0)
                    j = idx;
                  else if (sdiff > 0)