kumquat-buildroot/arch
Alexey Brodkin d024d369b8 arch/arc: Accommodate 16 KiB MMU pages
ARC processors are known for its configurability and one of those
configurable things is MMU page size which might be set to any
power of two from 4 KiB to 16 MiB, though in the Linux kernel we
only support 4, 8 and 16 KiB due to practical considerations.

And the most used setting is 8 KiB thus GNU LD assumes maximum
page size is 8 KiB by default and while this works for smaller
pages (it's OK to align segments by larger value it will be still
peoperly aligned) this breaks execution of user-space apps on HW
with larger pages because Elf sections might very well span across
allocated pages and thus make executable broken.

Simplest example:
------------------------------------>8-----------------------------------
$ arc-linux-gcc test.c
$ arc-linux-readelf --segments a.out

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
...
  LOAD           0x000000 0x00010000 0x00010000 0x003e8 0x003e8 R E 0x2000 <-- See
  LOAD           0x001f24 0x00013f24 0x00013f24 0x000f0 0x0010c RW  0x2000
------------------------------------>8-----------------------------------

Fortunately we may override default page size settings with "max-page-size"
linker option this way:
------------------------------------>8-----------------------------------
$ arc-linux-gcc test.c -Wl,-z,max-page-size=16384
$ arc-linux-readelf --segments a.out
Elf file type is EXEC (Executable file)
Entry point 0x102c4
There are 8 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
...
  LOAD           0x000000 0x00010000 0x00010000 0x003e8 0x003e8 R E 0x4000 <-- See
  LOAD           0x001f24 0x00015f24 0x00015f24 0x000f0 0x0010c RW  0x4000
------------------------------------>8-----------------------------------

Which we implement with that change.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
[yann.morin.1998@free.fr: fix comment: s/8196/8192/]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2019-12-22 21:56:21 +01:00
..
arch.mk arch: drop BR2_GCC_TARGET_CPU_REVISION option 2018-10-01 14:52:32 +02:00
arch.mk.arc arch/arc: Accommodate 16 KiB MMU pages 2019-12-22 21:56:21 +01:00
arch.mk.csky arch/csky: add support for the ck860 core 2019-05-31 22:59:57 +02:00
arch.mk.riscv arch: add support for RISC-V 32-bit (riscv32) architecture 2019-01-06 14:09:31 +01:00
arch.mk.xtensa arc/xtensa: store the Xtensa overlay in the per-package DL_DIR 2018-04-02 15:59:30 +02:00
Config.in arch/csky: restrict ck610 to the C-SKY gcc port 2019-08-01 10:15:17 +02:00
Config.in.arc arch/Config.in.arc: introduce the ARC optimized hs38 variant 2019-11-12 21:51:13 +01:00
Config.in.arm arch/arm: add two new non-cortex-based armv8.2a cores 2019-07-13 23:06:23 +02:00
Config.in.csky arch/csky: restrict ck610 to the C-SKY gcc port 2019-08-01 10:15:17 +02:00
Config.in.m68k arch: force syntax colouring to kconfig in Config.in.* 2019-05-20 22:34:16 +02:00
Config.in.microblaze arch: force syntax colouring to kconfig in Config.in.* 2019-05-20 22:34:16 +02:00
Config.in.mips arch: force syntax colouring to kconfig in Config.in.* 2019-05-20 22:34:16 +02:00
Config.in.nds32 arch/Config.in.nds32: force syntax colouring to kconfig 2019-06-20 21:27:20 +02:00
Config.in.nios2 arch: force syntax colouring to kconfig in Config.in.* 2019-05-20 22:34:16 +02:00
Config.in.or1k arch: force syntax colouring to kconfig in Config.in.* 2019-05-20 22:34:16 +02:00
Config.in.powerpc Merge branch 'next' 2019-06-02 22:11:20 +02:00
Config.in.riscv arch/riscv: set the default float ABI based on ISA extensions 2019-09-19 21:43:53 +02:00
Config.in.sh arch: force syntax colouring to kconfig in Config.in.* 2019-05-20 22:34:16 +02:00
Config.in.sparc arch: force syntax colouring to kconfig in Config.in.* 2019-05-20 22:34:16 +02:00
Config.in.x86 arch: Add support for Westmere targets 2019-06-13 21:09:51 +02:00
Config.in.xtensa arch: force syntax colouring to kconfig in Config.in.* 2019-05-20 22:34:16 +02:00