]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
arm: Generate proper load section addresses
authorMichal Simek <michal.simek@xilinx.com>
Fri, 17 May 2013 09:26:59 +0000 (11:26 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 23 May 2013 06:54:11 +0000 (08:54 +0200)
Moving to multiplatform caused that LOAD session
were wrongly generated for our images.
simpleImage is currently used by Qemu.

Wrong - before this patch:
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x008000 0xc0008000 0xc0008000 0x4fffe8 0x507fe8 RWE 0x8000
  LOAD           0x507fe8 0xc050ffe8 0xc050ffe8 0x8b130 0xb5a88 RWE 0x8000
  NOTE           0x52c2ac 0xc05342ac 0xc05342ac 0x00024 0x00024 R E 0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4

Correct - after this patch:
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x008000 0xc0008000 0x00008000 0x4fffe8 0x507fe8 RWE 0x8000
  LOAD           0x507fe8 0xc050ffe8 0x0050ffe8 0x8b130 0xb5a88 RWE 0x8000
  NOTE           0x52c2ac 0xc05342ac 0x005342ac 0x00024 0x00024 R E 0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/include/asm/page.h
arch/arm/kernel/vmlinux.lds.S

index e95d3c3e8eca03e01404dd2b87b35b3fedc19010..812a4944e78343469a2216327a746f37ce01b98c 100644 (file)
 #define PAGE_SIZE              (_AC(1,UL) << PAGE_SHIFT)
 #define PAGE_MASK              (~(PAGE_SIZE-1))
 
-#ifdef CONFIG_PHYS_OFFSET
-#define LOAD_OFFSET    (CONFIG_PAGE_OFFSET - CONFIG_PHYS_OFFSET)
-#endif
-
 #ifndef __ASSEMBLY__
 
 #ifndef CONFIG_MMU
index f84c3f003bbdf673f0354a2336aca090b25084bd..b024f8295dc9db6db1d1ada3435eda3eb27c9e88 100644 (file)
@@ -3,11 +3,15 @@
  * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
  */
 
-#include <asm/page.h>
+#ifdef CONFIG_ARCH_ZYNQ
+# define LOAD_OFFSET   CONFIG_PAGE_OFFSET
+#endif
+
 #include <asm-generic/vmlinux.lds.h>
 #include <asm/cache.h>
 #include <asm/thread_info.h>
 #include <asm/memory.h>
+#include <asm/page.h>
 
 #define PROC_INFO                                                      \
        . = ALIGN(4);                                                   \
@@ -90,11 +94,7 @@ SECTIONS
        arm_start = . ;
 #else
        . = PAGE_OFFSET + TEXT_OFFSET;
-#ifdef CONFIG_PHYS_OFFSET
-       arm_start = CONFIG_PHYS_OFFSET + TEXT_OFFSET;
-#else
        arm_start = TEXT_OFFSET;
-#endif
 #endif
        .head.text : AT(ADDR(.head.text) - LOAD_OFFSET) {
                _text = .;