+ if (!bfd_elf64_bfd_final_link (abfd, info))
+ return false;
+
+ /* If we're producing a final executable, we need to sort the contents
+ of the .IA_64.unwind section. */
+ if (!info->relocateable)
+ {
+ asection *s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_unwind);
+ if (s)
+ {
+ bfd_size_type size = s->output_section->_raw_size;
+ char *contents = bfd_malloc (size);
+
+ if (contents == NULL)
+ return false;
+ if (! bfd_get_section_contents (abfd, s->output_section,
+ contents, (file_ptr) 0, size))
+ return false;
+
+ elf64_ia64_unwind_entry_compare_bfd = abfd;
+ qsort (contents, size / 24, 24, elf64_ia64_unwind_entry_compare);
+
+ if (! bfd_set_section_contents (abfd, s->output_section,
+ contents, (file_ptr) 0, size))
+ return false;
+ }
+ }
+
+ return true;