mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 18:14:13 +08:00
When computing section link order for a relocateable link, ignore section sizes.
* ldelfgen.c (compare_link_order): Ignore section size when performing a relocateable link.
This commit is contained in:
parent
9589edb836
commit
d820a652a6
@ -1,3 +1,8 @@
|
||||
2021-05-07 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* ldelfgen.c (compare_link_order): Ignore section size when
|
||||
performing a relocateable link.
|
||||
|
||||
2021-05-07 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* ldexp.c (update_definedness): Don't return false for absolute
|
||||
|
@ -171,12 +171,15 @@ compare_link_order (const void *a, const void *b)
|
||||
else if (apos > bpos)
|
||||
return 1;
|
||||
|
||||
/* The only way we should get matching LMAs is when the first of two
|
||||
sections has zero size. */
|
||||
if (asec->size < bsec->size)
|
||||
return -1;
|
||||
else if (asec->size > bsec->size)
|
||||
return 1;
|
||||
if (! bfd_link_relocatable (&link_info))
|
||||
{
|
||||
/* The only way we should get matching LMAs is when
|
||||
the first of the two sections has zero size. */
|
||||
if (asec->size < bsec->size)
|
||||
return -1;
|
||||
else if (asec->size > bsec->size)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* If they are both zero size then they almost certainly have the same
|
||||
VMA and thus are not ordered with respect to each other. Test VMA
|
||||
|
Loading…
Reference in New Issue
Block a user