]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - bfd/elfnn-aarch64.c
Rework the resize_sections function
authorMatthew Malcomson <matthew.malcomson@arm.com>
Mon, 21 Feb 2022 13:18:27 +0000 (13:18 +0000)
committerMatthew Malcomson <matthew.malcomson@arm.com>
Mon, 21 Feb 2022 13:19:20 +0000 (13:19 +0000)
commit396742bf3607f0212d7bae1ea7238c34e7562164
tree2435e7d0547fd3d1edd1e25dd0f3bb69c542c4ca
parent4a74b265839c80c669156e19948540214fd2d117
Rework the resize_sections function

Now instead of iterating through relocations recording changes to make
and sorting those changes according to the section VMA before going on
to make the changes in section VMA order, we instead modify the sections
as we iterate through relocations.

This change can be done now that the alignment is always done, even if
the VMA of the start and end was good for precise bounds and now that
padding is added via an expression rather than setting the point to a
specific location.  Having these two things means that changing the
layout of earlier sections does not affect the precise bounds property
of later sections.

It also makes things easier that we keep the padding of a section inside
that section, so can tell whether a section has the correct size just
from the size of the section rather recording in an out-of-bounds manner
which sections have had their padding assigned.

This patch makes no functional change, but simply changes the code to be
more readable.
bfd/elfnn-aarch64.c