Skip to content

Commit

Permalink
Blackfin: fix relocation errors with large initramfs images
Browse files Browse the repository at this point in the history
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 <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
Jie Zhang authored and Mike Frysinger committed Mar 9, 2010
1 parent cb19171 commit 0afc272
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions arch/blackfin/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0afc272

Please sign in to comment.