aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-arm.c18
2 files changed, 22 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 297cec9..0fb4078 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2007-08-28 Mark Shinwell <shinwell@codesourcery.com>
+ Joseph Myers <joseph@codesourcery.com>
+
+ * elf32-arm.c (elf32_arm_compare_mapping): Compare first on vma,
+ then on type.
+
2007-08-28 Robert Sebastian Gerus <arachnist@gmail.com>
* config.bfd: Add support for i[3-7]86-*-dragonfly*.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index ef066d3..9c6130f 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -9774,8 +9774,22 @@ elf32_arm_new_section_hook (bfd *abfd, asection *sec)
static int
elf32_arm_compare_mapping (const void * a, const void * b)
{
- return ((const elf32_arm_section_map *) a)->vma
- > ((const elf32_arm_section_map *) b)->vma;
+ const elf32_arm_section_map *amap = (const elf32_arm_section_map *) a;
+ const elf32_arm_section_map *bmap = (const elf32_arm_section_map *) b;
+
+ if (amap->vma > bmap->vma)
+ return 1;
+ else if (amap->vma < bmap->vma)
+ return -1;
+ else if (amap->type > bmap->type)
+ /* Ensure results do not depend on the host qsort for objects with
+ multiple mapping symbols at the same address by sorting on type
+ after vma. */
+ return 1;
+ else if (amap->type < bmap->type)
+ return -1;
+ else
+ return 0;
}