sort sections by LMA then VMA.
authorNick Clifton <nickc@redhat.com>
Sat, 6 Jun 1998 00:28:46 +0000 (00:28 +0000)
committerNick Clifton <nickc@redhat.com>
Sat, 6 Jun 1998 00:28:46 +0000 (00:28 +0000)
bfd/ChangeLog
bfd/elf.c

index 3cc05fecb34ba750ffe23e383f18def8919a1ca3..01e502f323dcd71116845c659a5bd6d5a8ce5ea9 100644 (file)
@@ -1,5 +1,8 @@
 Fri Jun  5 17:21:51 1998  Nick Clifton  <nickc@cygnus.com>
 
+       * elf.c (elf_sort_sections): Sort by LMA first then VMA, since the
+       LMA is used to order sections in a segment.
+
        * elf32-v850.c: Add prototypes for static functions.
        Change type of addend parameter to bfd_vma in various functions.
 
index 46701cfb3d00cc11f2fdbec4c9ddc7c1d79828e6..1cb603223366b7f5a2fb02a6b85117ab517c70bb 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2344,16 +2344,18 @@ elf_sort_sections (arg1, arg2)
   const asection *sec1 = *(const asection **) arg1;
   const asection *sec2 = *(const asection **) arg2;
 
-  if (sec1->vma < sec2->vma)
+  /* Sort by LMA first, since this is the address used to
+     place the section into a segment.  */
+  if (sec1->lma < sec2->lma)
     return -1;
-  else if (sec1->vma > sec2->vma)
+  else if (sec1->lma > sec2->lma)
     return 1;
 
-  /* Sort by LMA.  Normally the LMA and the VMA will be the same, and
+  /* Sort by VMA.  Normally the LMA and the VMA will be the same, and
      this will do nothing.  */
-  if (sec1->lma < sec2->lma)
+  if (sec1->vma < sec2->vma)
     return -1;
-  else if (sec1->lma > sec2->lma)
+  else if (sec1->vma > sec2->vma)
     return 1;
 
   /* Put !SEC_LOAD sections after SEC_LOAD ones.  */
This page took 0.048883 seconds and 4 git commands to generate.