Commit 6f985294 authored by Bernd Schmidt's avatar Bernd Schmidt Committed by Bryan Wu

Blackfin arch: fix bugs in linker script when using upstream binutils

Fix a few problems I discovered when building a kernel with upstream CVS
binutils.

We have to add the NOTES macro to our linker script, since a kernel
built with --build-id is otherwise unable to boot.  Last time NOTES was
added, it broke things, but the definition of the macro has changed not
to rely on parts of the linker script that aren't present on Blackfin.

I also noticed that _l2_lma_start does not point into the kernel image,
but rather somewhere in L1/L2 space, which seems unintended.  Also, when
the L2 section was added to the linker script, the part following it which
computes then length of the init section was not updated.
Signed-off-by: default avatarBernd Schmidt <bernds_cb1@t-online.de>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
parent 5e6d9f51
...@@ -68,6 +68,8 @@ SECTIONS ...@@ -68,6 +68,8 @@ SECTIONS
__etext = .; __etext = .;
} }
NOTES
/* Just in case the first read only is a 32-bit access */ /* Just in case the first read only is a 32-bit access */
RO_DATA(4) RO_DATA(4)
...@@ -167,6 +169,7 @@ SECTIONS ...@@ -167,6 +169,7 @@ SECTIONS
. = ALIGN(4); . = ALIGN(4);
___initramfs_start = .; ___initramfs_start = .;
*(.init.ramfs) *(.init.ramfs)
. = ALIGN(4);
___initramfs_end = .; ___initramfs_end = .;
} }
...@@ -212,7 +215,7 @@ SECTIONS ...@@ -212,7 +215,7 @@ SECTIONS
__ebss_b_l1 = .; __ebss_b_l1 = .;
} }
__l2_lma_start = .; __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
.text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1)) .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
{ {
...@@ -236,10 +239,11 @@ SECTIONS ...@@ -236,10 +239,11 @@ SECTIONS
. = ALIGN(4); . = ALIGN(4);
__ebss_l2 = .; __ebss_l2 = .;
} }
/* Force trailing alignment of our init section so that when we /* Force trailing alignment of our init section so that when we
* free our init memory, we don't leave behind a partial page. * free our init memory, we don't leave behind a partial page.
*/ */
. = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1); . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2);
. = ALIGN(PAGE_SIZE); . = ALIGN(PAGE_SIZE);
___init_end = .; ___init_end = .;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment