[U-Boot-Users] [PATCH] linker script for building hello_world.c on arm

Lars Munch lars at segv.dk
Thu Sep 2 14:06:09 CEST 2004


Hello

I was unable to build the hello_world.c example for my arm target
without adding a linker script. The attached patch fixes this.

Please apply.

CHANGELOG

* Patch by Lars Munch, 02 Sep 2004:
  - Added linker script for building hello_world.c on arm

Best regards
Lars Munch

-------------- next part --------------
diff -Nru u-boot-orig/examples/arm.lds u-boot/examples/arm.lds
--- u-boot-orig/examples/arm.lds	1970-01-01 01:00:00.000000000 +0100
+++ u-boot/examples/arm.lds	2004-09-02 10:28:42.000000000 +0200
@@ -0,0 +1,48 @@
+/*
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <gj at denx.de>
+ *
+ * Modified for u-boot examples by Lars Munch, <lars at segv.dk>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+SECTIONS
+{
+        .text       :
+        {
+          *(.text)
+        }
+
+	. = ALIGN(4);
+	.rodata : { *(.rodata) }
+
+	. = ALIGN(4);
+	.data : { *(.data) }
+
+	. = ALIGN(4);
+	.got : { *(.got) }
+
+	. = ALIGN(4);
+	__bss_start = .;
+	.bss : { *(.bss) }
+	_end = .;
+}
diff -Nru u-boot-orig/examples/Makefile u-boot/examples/Makefile
--- u-boot-orig/examples/Makefile	2004-07-10 23:45:58.000000000 +0200
+++ u-boot/examples/Makefile	2004-09-02 10:22:36.000000000 +0200
@@ -30,7 +30,7 @@
 endif
 
 ifeq ($(ARCH),arm)
-LOAD_ADDR = 0xc100000
+LOAD_ADDR = 0xc100000 -T arm.lds
 endif
 
 ifeq ($(ARCH),mips)


More information about the U-Boot mailing list