Browse Source

chore(bl): add UNALIGNED symbols for TEXT/RODATA

Add symbols to mark end of TEXT/RODATA before page alignment.
Similar change was done by commit 8d69a03f6a ("Various
improvements/cleanups on the linker scripts") for
RO_END/COHERENT_RAM. These symbols help to know how much free
space is in the final binary because of page alignment.

Also show all *UNALIGNED__ symbols via poetry.
For example:
poetry run memory -p zynqmp -b debug

Change-Id: I322beba37dad76be9f4e88ca7e5b3eff2df7d96e
Signed-off-by: Michal Simek <michal.simek@amd.com>
pull/1999/head
Michal Simek 2 years ago
committed by Sandrine Bailleux
parent
commit
f7d445fcbb
  1. 2
      bl1/bl1.ld.S
  2. 2
      bl2/bl2.ld.S
  3. 2
      bl2/bl2_el3.ld.S
  4. 2
      bl2u/bl2u.ld.S
  5. 2
      bl31/bl31.ld.S
  6. 2
      bl32/sp_min/sp_min.ld.S
  7. 2
      bl32/tsp/tsp.ld.S
  8. 2
      docs/design/firmware-design.rst
  9. 2
      tools/memory/memory/memmap.py

2
bl1/bl1.ld.S

@ -41,6 +41,7 @@ SECTIONS {
*bl1_entrypoint.o(.text*)
*(SORT_BY_ALIGNMENT(.text*))
*(.vectors)
__TEXT_END_UNALIGNED__ = .;
. = ALIGN(PAGE_SIZE);
@ -72,6 +73,7 @@ SECTIONS {
* aligned and lld does not align the LMA to the alignment specified
* on the .data section.
*/
__RODATA_END_UNALIGNED__ = .;
__RODATA_END__ = .;
. = ALIGN(16);

2
bl2/bl2.ld.S

@ -35,6 +35,7 @@ SECTIONS {
*(SORT_BY_ALIGNMENT(.text*))
*(.vectors)
__TEXT_END_UNALIGNED__ = .;
. = ALIGN(PAGE_SIZE);
@ -57,6 +58,7 @@ SECTIONS {
RODATA_COMMON
__RODATA_END_UNALIGNED__ = .;
. = ALIGN(PAGE_SIZE);
__RODATA_END__ = .;

2
bl2/bl2_el3.ld.S

@ -65,6 +65,7 @@ SECTIONS {
*(SORT_BY_ALIGNMENT(.text*))
*(.vectors)
__TEXT_END_UNALIGNED__ = .;
. = ALIGN(PAGE_SIZE);
@ -78,6 +79,7 @@ SECTIONS {
RODATA_COMMON
__RODATA_END_UNALIGNED__ = .;
. = ALIGN(PAGE_SIZE);
__RODATA_END__ = .;

2
bl2u/bl2u.ld.S

@ -32,6 +32,7 @@ SECTIONS {
*bl2u_entrypoint.o(.text*)
*(SORT_BY_ALIGNMENT(.text*))
*(.vectors)
__TEXT_END_UNALIGNED__ = .;
. = ALIGN(PAGE_SIZE);
@ -53,6 +54,7 @@ SECTIONS {
RODATA_COMMON
__RODATA_END_UNALIGNED__ = .;
. = ALIGN(PAGE_SIZE);
__RODATA_END__ = .;
} >RAM

2
bl31/bl31.ld.S

@ -42,6 +42,7 @@ SECTIONS {
*bl31_entrypoint.o(.text*)
*(SORT_BY_ALIGNMENT(SORT(.text*)))
*(.vectors)
__TEXT_END_UNALIGNED__ = .;
. = ALIGN(PAGE_SIZE);
@ -62,6 +63,7 @@ SECTIONS {
. = ALIGN(8);
# include <lib/el3_runtime/pubsub_events.h>
__RODATA_END_UNALIGNED__ = .;
. = ALIGN(PAGE_SIZE);

2
bl32/sp_min/sp_min.ld.S

@ -34,6 +34,7 @@ SECTIONS {
*entrypoint.o(.text*)
*(SORT_BY_ALIGNMENT(.text*))
*(.vectors)
__TEXT_END_UNALIGNED__ = .;
. = ALIGN(PAGE_SIZE);
@ -58,6 +59,7 @@ SECTIONS {
. = ALIGN(8);
# include <lib/el3_runtime/pubsub_events.h>
__RODATA_END_UNALIGNED__ = .;
. = ALIGN(PAGE_SIZE);

2
bl32/tsp/tsp.ld.S

@ -30,6 +30,7 @@ SECTIONS {
*tsp_entrypoint.o(.text*)
*(.text*)
*(.vectors)
__TEXT_END_UNALIGNED__ = .;
. = ALIGN(PAGE_SIZE);
@ -43,6 +44,7 @@ SECTIONS {
RODATA_COMMON
__RODATA_END_UNALIGNED__ = .;
. = ALIGN(PAGE_SIZE);
__RODATA_END__ = .;

2
docs/design/firmware-design.rst

@ -1559,8 +1559,10 @@ The following linker symbols are defined for this purpose:
- ``__RO_START__``
- ``__RO_END__``
- ``__TEXT_START__``
- ``__TEXT_END_UNALIGNED__``
- ``__TEXT_END__``
- ``__RODATA_START__``
- ``__RODATA_END_UNALIGNED__``
- ``__RODATA_END__``
BL1's linker symbols

2
tools/memory/memory/memmap.py

@ -100,7 +100,7 @@ def main(
if symbols:
expr = (
r"(.*)(TEXT|BSS|RODATA|STACKS|_OPS|PMF|XLAT|GOT|FCONF"
r"|R.M)(.*)(START|END)__$"
r"|R.M)(.*)(START|UNALIGNED|END)__$"
)
printer.print_symbol_table(
parser.filter_symbols(parser.symbols, expr), parser.module_names

Loading…
Cancel
Save