From owner-svn-src-head@freebsd.org Thu Oct 12 15:16:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08827E2C67D; Thu, 12 Oct 2017 15:16:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 D5AF880031; Thu, 12 Oct 2017 15:16:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CFGNB9045990; Thu, 12 Oct 2017 15:16:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CFGMeI045985; Thu, 12 Oct 2017 15:16:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121516.v9CFGMeI045985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 15:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324558 - in head/sys/boot: arm/uboot libsa mips/uboot powerpc/ofw powerpc/uboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: arm/uboot libsa mips/uboot powerpc/ofw powerpc/uboot X-SVN-Commit-Revision: 324558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 15:16:24 -0000 Author: imp Date: Thu Oct 12 15:16:22 2017 New Revision: 324558 URL: https://svnweb.freebsd.org/changeset/base/324558 Log: Define prototype for exit and ensure references Define a prototype for exit in stand.h. Provide a reference to exit in a few conf.c files to ensure that its definition gets pulled in early. Since exit() is a MD routine, it isn't defined in libsa. However, libsa tends to be listed last and will soon have panic() in it which calls exit(). The reference to exit early ensures that the MD exit is available to satisfy linking for static libraries. Modified: head/sys/boot/arm/uboot/conf.c head/sys/boot/libsa/stand.h head/sys/boot/mips/uboot/conf.c head/sys/boot/powerpc/ofw/conf.c head/sys/boot/powerpc/uboot/conf.c Modified: head/sys/boot/arm/uboot/conf.c ============================================================================== --- head/sys/boot/arm/uboot/conf.c Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/arm/uboot/conf.c Thu Oct 12 15:16:22 2017 (r324558) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif +/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ +void (*exitfn)(int) = exit; + struct devsw *devsw[] = { #if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) &uboot_storage, Modified: head/sys/boot/libsa/stand.h ============================================================================== --- head/sys/boot/libsa/stand.h Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/libsa/stand.h Thu Oct 12 15:16:22 2017 (r324558) @@ -376,6 +376,7 @@ extern int null_readdir(struct open_file *f, struct di * Machine dependent functions and data, must be provided or stubbed by * the consumer */ +extern void exit(int); extern int getchar(void); extern int ischar(void); extern void putchar(int); Modified: head/sys/boot/mips/uboot/conf.c ============================================================================== --- head/sys/boot/mips/uboot/conf.c Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/mips/uboot/conf.c Thu Oct 12 15:16:22 2017 (r324558) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif +/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ +void (*exitfn)(int) = exit; + struct devsw *devsw[] = { #if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) &uboot_storage, Modified: head/sys/boot/powerpc/ofw/conf.c ============================================================================== --- head/sys/boot/powerpc/ofw/conf.c Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/powerpc/ofw/conf.c Thu Oct 12 15:16:22 2017 (r324558) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif +/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ +void (*exitfn)(int) = exit; + /* * We could use linker sets for some or all of these, but * then we would have to control what ended up linked into Modified: head/sys/boot/powerpc/uboot/conf.c ============================================================================== --- head/sys/boot/powerpc/uboot/conf.c Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/powerpc/uboot/conf.c Thu Oct 12 15:16:22 2017 (r324558) @@ -35,6 +35,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif +/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ +void (*exitfn)(int) = exit; + /* * We could use linker sets for some or all of these, but * then we would have to control what ended up linked into