[PATCH 09/15] fix-do-relocation

Andy Green andy at openmoko.com
Wed Aug 13 01:59:34 CEST 2008


Start meddling with linkser script, more changes came later
that actually got it working by pushing all .rodata into first
4K so the linked addresses matched reality even when ran from
the SDRAM copy.

Signed-off-by: Andy Green <andy at openmoko.com>
---

 src/kboot-stage1.lds |    9 ++-------
 src/start_kboot.c    |   14 ++++++++++++++
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/kboot-stage1.lds b/src/kboot-stage1.lds
index 8cc49f6..1998807 100644
--- a/src/kboot-stage1.lds
+++ b/src/kboot-stage1.lds
@@ -36,15 +36,10 @@ SECTIONS
 	  src/lowlevel_init.o(.text)
 	  src/start_kboot.o	(.text)
 	  *(.text)
+	  *(.rodata)
 	}
 
 	. = ALIGN(4);
-	.rodata : 
-    { 
-        *(.rodata) 
-    }
-
-	. = ALIGN(4);
 	.data : 
     { 
         *(.data) 
@@ -58,7 +53,7 @@ SECTIONS
 
 	. = ALIGN(4);
 	__bss_start = .;
-	.bss : 
+	.bss (NOLOAD) : 
     { 
         *(.bss) 
     }
diff --git a/src/start_kboot.c b/src/start_kboot.c
index 86e2483..8b46919 100644
--- a/src/start_kboot.c
+++ b/src/start_kboot.c
@@ -38,9 +38,12 @@ unsigned char buf[2*1024];
 #define ADDR  ((volatile unsigned *)&buf) 
 #define stringify(x) #x
 
+static char * hello = "hello";
+
 int start_kboot(void)
 {
 	static int n = 0;
+	void (*p)(unsigned int) = print32;
 
 	port_init();
 	serial_init(0x11, UART2);
@@ -49,7 +52,18 @@ int start_kboot(void)
 		serial_putc(2, '0');
 		serial_putc(2, 'x');
 		print32((unsigned int)&n);
+		serial_putc(2, ' ');
+		serial_putc(2, '0');
+		serial_putc(2, 'x');
+		print32((unsigned int)p);
+		serial_putc(2, ' ');
+		serial_putc(2, '0');
+		serial_putc(2, 'x');
+		print32((unsigned int)hello);
+
 		serial_putc(2, '\n');
+
+
 //		printk("Openmoko KBOOT "stringify(BUILD_HOST)" "stringify(BUILD_VERSION)" "stringify(BUILD_DATE)"\n");
 		blue_on(1);
 		n++;





More information about the openmoko-kernel mailing list