From: Jie Zhang Date: Tue, 5 Jan 2010 04:22:33 +0000 (+0000) Subject: Blackfin: fix relocation errors with large initramfs images X-Git-Tag: firefly_0821_release~9833^2~2554^2~61 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0afc272cc6044b7a4f1318eadbfb10c4be654441;p=firefly-linux-kernel-4.4.55.git Blackfin: fix relocation errors with large initramfs images Since we are now discarding .exit.text at runtime instead of link time, we need to place all .text sections ahead of the .data sections. Otherwise, a really large attached initramfs may cause link errors as it pushes the PC relative relocations behind the limits of the Blackfin ISA (~16meg). The instructions in the .exit.text are unable to call back into the .text sections leading to a link failure. Signed-off-by: Jie Zhang Signed-off-by: Mike Frysinger --- diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S index 66799e763dc9..be4b1bbb3918 100644 --- a/arch/blackfin/kernel/vmlinux.lds.S +++ b/arch/blackfin/kernel/vmlinux.lds.S @@ -104,18 +104,21 @@ SECTIONS ___init_begin = .; INIT_TEXT_SECTION(PAGE_SIZE) - . = ALIGN(16); - INIT_DATA_SECTION(16) - PERCPU(4) - /* we have to discard exit text and such at runtime, not link time, to + /* We have to discard exit text and such at runtime, not link time, to * handle embedded cross-section references (alt instructions, bug - * table, eh_frame, etc...) + * table, eh_frame, etc...). We need all of our .text up front and + * .data after it for PCREL call issues. */ .exit.text : { EXIT_TEXT } + + . = ALIGN(16); + INIT_DATA_SECTION(16) + PERCPU(4) + .exit.data : { EXIT_DATA