diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2009-03-29 00:47:31 +0800 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2009-03-29 00:47:31 +0800 |
commit | 4636b3019a76aacc5b01e14bd14cb468fb00940f (patch) | |
tree | 88631df7dffc436f86891acebc709d8fd0a1668c /arch/blackfin/kernel/vmlinux.lds.S | |
parent | 1eb19e30adeb05957b45204f0c04d94fc4662ffd (diff) | |
download | blackbird-op-linux-4636b3019a76aacc5b01e14bd14cb468fb00940f.tar.gz blackbird-op-linux-4636b3019a76aacc5b01e14bd14cb468fb00940f.zip |
Blackfin arch: add link-time asserts to make sure on-chip regions dont overflow
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/vmlinux.lds.S')
-rw-r--r-- | arch/blackfin/kernel/vmlinux.lds.S | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S index 4b4341da0585..27952ae047d8 100644 --- a/arch/blackfin/kernel/vmlinux.lds.S +++ b/arch/blackfin/kernel/vmlinux.lds.S @@ -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)) { @@ -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)) { @@ -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); @@ -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. |