diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-03-08 08:30:35 +0300 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-03-13 20:39:11 +0300 |
commit | c649bd59b6d43998d8c408e2a2fa1922ce5d8363 (patch) | |
tree | 8d8e75632df41c6ac6ff7cdff55025d4d25df77c /arch/unicore32/boot/compressed/vmlinux.lds.S | |
parent | fc2b47b55f17fd996f7a01975ce1c33c2f2513f6 (diff) | |
download | linux-c649bd59b6d43998d8c408e2a2fa1922ce5d8363.tar.xz |
unicore32: simplify linker script generation for decompressor
When I was searching for unneeded $(KCONFIG_CONFIG) usages, I noticed
this strange build dependency.
It can use $(call if_changed,...) in case ZTEXTADDR and ZBSSADDR are
changed, but even a simpler way is to use the pattern rule in
scripts/Makefile.build. This is what arch/arm/boot/compressed/Makefile
does.
I did only build test. I confirmed equivalent vmlinux.lds was generated.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch/unicore32/boot/compressed/vmlinux.lds.S')
-rw-r--r-- | arch/unicore32/boot/compressed/vmlinux.lds.S | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/arch/unicore32/boot/compressed/vmlinux.lds.S b/arch/unicore32/boot/compressed/vmlinux.lds.S new file mode 100644 index 000000000000..d5a3ce296239 --- /dev/null +++ b/arch/unicore32/boot/compressed/vmlinux.lds.S @@ -0,0 +1,61 @@ +/* + * linux/arch/unicore/boot/compressed/vmlinux.lds.in + * + * Code specific to PKUnity SoC and UniCore ISA + * + * Copyright (C) 2001-2010 GUAN Xue-tao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +OUTPUT_ARCH(unicore32) +ENTRY(_start) +SECTIONS +{ + /DISCARD/ : { + /* + * Discard any r/w data - this produces a link error if we have any, + * which is required for PIC decompression. Local data generates + * GOTOFF relocations, which prevents it being relocated independently + * of the text/got segments. + */ + *(.data) + } + + . = TEXT_START; + _text = .; + + .text : { + _start = .; + *(.start) + *(.text) + *(.text.*) + *(.fixup) + *(.gnu.warning) + *(.rodata) + *(.rodata.*) + *(.piggydata) + . = ALIGN(4); + } + + _etext = .; + + /* Assume size of decompressed image is 4x the compressed image */ + _image_size = (_etext - _text) * 4; + + _got_start = .; + .got : { *(.got) } + _got_end = .; + .got.plt : { *(.got.plt) } + _edata = .; + + . = BSS_START; + __bss_start = .; + .bss : { *(.bss) } + _end = .; + + .stack : { *(.stack) } + .comment 0 : { *(.comment) } +} + |