+2011-04-09 Kai Tietz <ktietz@redhat.com>
+
+ * peXXigen.c (_bfd_XXi_final_link_postscripte): Sort pdata in temporary
+ buffer and use rawsize for sorting.
+ * coffcode.h (coff_compute_section_file_positions): Set rawsize
+ before doing alignment.
+
2011-04-09 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (elf_i386_relocate_section): Return relocation
if (!(current->flags & SEC_HAS_CONTENTS))
continue;
+ current->rawsize = current->size;
+
#ifdef COFF_IMAGE_WITH_PE
/* Make sure we skip empty sections in a PE image. */
if (current->size == 0)
#ifdef COFF_IMAGE_WITH_PE
/* Set the padded size. */
- current->size = (current->size + page_size -1) & -page_size;
+ current->size = (current->size + page_size - 1) & -page_size;
#endif
sofar += current->size;
bfd_byte *bfd_generic_get_relocated_section_contents
(bfd *abfd,
- struct bfd_link_info *link_info,
+ struct bfd_link_info *alink_info,
struct bfd_link_order *link_order,
bfd_byte *data,
bfd_boolean relocatable,
if (sec)
{
- bfd_size_type x = sec->rawsize ? sec->rawsize : sec->size;
+ bfd_size_type x = sec->rawsize;
+ bfd_byte *tmp_data = NULL;
- if (x && bfd_get_section_contents (abfd, sec, pfinfo->contents, 0, x))
+ if (x)
+ tmp_data = bfd_malloc (x);
+
+ if (tmp_data != NULL)
{
- qsort (pfinfo->contents,
- (size_t) ((sec->size <x ? sec->size : x) / 12),
- 12, sort_x64_pdata);
- bfd_set_section_contents (pfinfo->output_bfd, sec,
- pfinfo->contents, 0, x);
+ if (bfd_get_section_contents (abfd, sec, tmp_data, 0, x))
+ {
+ qsort (tmp_data,
+ (size_t) (x / 12),
+ 12, sort_x64_pdata);
+ bfd_set_section_contents (pfinfo->output_bfd, sec,
+ tmp_data, 0, x);
+ }
+ free (tmp_data);
}
}
}