mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 19:09:31 +08:00
Return zero only as the last step of qsort function.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2001-08-01 Adam Nemet <anemet@lnxw.com>
|
||||||
|
|
||||||
|
* elf.c (elf_sort_sections): Return zero only as the last step.
|
||||||
|
|
||||||
2001-08-01 Nick Clifton <nickc@cambridge.redhat.com>
|
2001-08-01 Nick Clifton <nickc@cambridge.redhat.com>
|
||||||
|
|
||||||
* config.bfd (arm-vxworks): Change name of define from VXWORKS to
|
* config.bfd (arm-vxworks): Change name of define from VXWORKS to
|
||||||
|
12
bfd/elf.c
12
bfd/elf.c
@ -2677,18 +2677,22 @@ elf_sort_sections (arg1, arg2)
|
|||||||
if (TOEND (sec1))
|
if (TOEND (sec1))
|
||||||
{
|
{
|
||||||
if (TOEND (sec2))
|
if (TOEND (sec2))
|
||||||
|
{
|
||||||
|
/* If the indicies are the same, do not return 0
|
||||||
|
here, but continue to try the next comparison. */
|
||||||
|
if (sec1->target_index - sec2->target_index != 0)
|
||||||
return sec1->target_index - sec2->target_index;
|
return sec1->target_index - sec2->target_index;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
else if (TOEND (sec2))
|
||||||
if (TOEND (sec2))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#undef TOEND
|
#undef TOEND
|
||||||
|
|
||||||
/* Sort by size, to put zero sized sections before others at the
|
/* Sort by size, to put zero sized sections
|
||||||
same address. */
|
before others at the same address. */
|
||||||
|
|
||||||
if (sec1->_raw_size < sec2->_raw_size)
|
if (sec1->_raw_size < sec2->_raw_size)
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user