From owner-svn-src-all@FreeBSD.ORG Fri May 30 16:47:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5DA3DFD; Fri, 30 May 2014 16:47:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ABA12955; Fri, 30 May 2014 16:47:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UGltql055493; Fri, 30 May 2014 16:47:55 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UGlt2d055490; Fri, 30 May 2014 16:47:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405301647.s4UGlt2d055490@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 30 May 2014 16:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266893 - head/sys/boot/mips/beri/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 16:47:55 -0000 Author: hselasky Date: Fri May 30 16:47:54 2014 New Revision: 266893 URL: http://svnweb.freebsd.org/changeset/base/266893 Log: Add optional support for USB to BERI loader. Fix the linker script so that the garbage collection feature can be used when linking. Sponsored by: DARPA, AFRL Modified: head/sys/boot/mips/beri/loader/Makefile head/sys/boot/mips/beri/loader/loader.ldscript head/sys/boot/mips/beri/loader/main.c Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Fri May 30 16:44:03 2014 (r266892) +++ head/sys/boot/mips/beri/loader/Makefile Fri May 30 16:47:54 2014 (r266893) @@ -136,6 +136,17 @@ FILES+= loader.rc FILES+= menu.rc .endif +.if defined(LOADER_USB_SUPPORT) +# Do garbage collection +CFLAGS+= -ffunction-sections -fdata-sections +CFLAGS+= -Wl,--gc-sections +# Link USB BOOT library +LDADD+= ${.OBJDIR}/../../../usb/libusbboot.a +CFLAGS+= -I${.CURDIR}/../../../usb +# Define USB SUPPORT +CFLAGS+= -DLOADER_USB_SUPPORT +.endif + all: loader .include Modified: head/sys/boot/mips/beri/loader/loader.ldscript ============================================================================== --- head/sys/boot/mips/beri/loader/loader.ldscript Fri May 30 16:44:03 2014 (r266892) +++ head/sys/boot/mips/beri/loader/loader.ldscript Fri May 30 16:47:54 2014 (r266893) @@ -58,11 +58,16 @@ SECTIONS . += SIZEOF_HEADERS; .text ALIGN(0x8): { - start.o(.text) - *(EXCLUDE_FILE (start.o) .text) + start.o(.text*) + *(EXCLUDE_FILE (start.o) .text*) + *(.rodata*) + + __start_set_Xcommand_set = .; + KEEP(*(set_Xcommand_set)) + __stop_set_Xcommand_set = .; } - .data ALIGN(0x8): { *(.data)} - .bss ALIGN(0x8): { *(.bss) } + .data ALIGN(0x8): { *(.data*)} + .bss ALIGN(0x8): { *(.bss*) } __heap = ALIGN(0x8); /* 64-bit aligned heap pointer */ __data_end = .; Modified: head/sys/boot/mips/beri/loader/main.c ============================================================================== --- head/sys/boot/mips/beri/loader/main.c Fri May 30 16:44:03 2014 (r266892) +++ head/sys/boot/mips/beri/loader/main.c Fri May 30 16:47:54 2014 (r266893) @@ -43,12 +43,19 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef LOADER_USB_SUPPORT +#include +#endif + static int __elfN(exec)(struct preloaded_file *); static void extract_currdev(struct bootinfo *); struct devsw *devsw[] = { &beri_cfi_disk, &beri_sdcard_disk, +#ifdef LOADER_USB_SUPPORT + &umass_disk, +#endif NULL };