Skip to content

Commit

Permalink
Blackfin arch: add link-time asserts to make sure on-chip regions don…
Browse files Browse the repository at this point in the history
…t overflow

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
  • Loading branch information
Mike Frysinger authored and Bryan Wu committed Mar 28, 2009
1 parent 1eb19e3 commit 4636b30
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/blackfin/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ SECTIONS
. = ALIGN(4);
__etext_l1 = .;
}
ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!")

.data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
{
Expand All @@ -200,6 +201,7 @@ SECTIONS
. = ALIGN(4);
__ebss_l1 = .;
}
ASSERT (SIZEOF(.data_a_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!")

.data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
{
Expand All @@ -214,6 +216,7 @@ SECTIONS
. = ALIGN(4);
__ebss_b_l1 = .;
}
ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!")

__l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);

Expand All @@ -239,6 +242,7 @@ SECTIONS
. = ALIGN(4);
__ebss_l2 = .;
}
ASSERT (SIZEOF(.text_data_l1) <= L2_LENGTH, "L2 overflow!")

/* Force trailing alignment of our init section so that when we
* free our init memory, we don't leave behind a partial page.
Expand Down

0 comments on commit 4636b30

Please sign in to comment.