From owner-svn-src-head@freebsd.org Wed Mar 29 15:28:52 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 E6D65D23C12; Wed, 29 Mar 2017 15:28:52 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id AA9F465BDD; Wed, 29 Mar 2017 15:28:52 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from dhcp-10-248-121-82.eduroam.wireless.private.cam.ac.uk (global-5-144.nat-2.net.cam.ac.uk [131.111.5.144]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 3C9384E6EC; Wed, 29 Mar 2017 15:28:15 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r316119 - in head/sys/boot: arm/uboot efi/boot1 efi/loader From: Andrew Turner In-Reply-To: <201703282356.v2SNu2Hv057034@repo.freebsd.org> Date: Wed, 29 Mar 2017 16:28:14 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <08FA2B39-CF4A-4BDD-8A3A-44FA69F708F4@fubar.geek.nz> References: <201703282356.v2SNu2Hv057034@repo.freebsd.org> To: Ngie Cooper X-Mailer: Apple Mail (2.3259) 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: Wed, 29 Mar 2017 15:28:53 -0000 > On 29 Mar 2017, at 00:56, Ngie Cooper wrote: >=20 > Author: ngie > Date: Tue Mar 28 23:56:02 2017 > New Revision: 316119 > URL: https://svnweb.freebsd.org/changeset/base/316119 >=20 > Log: > self_reloc.c: Pass -Wno-error=3Dmaybe-uninitialized to gcc versions = greater than 4.2.1 >=20 > self_reloc.c doesn't initialize `rel` in all cases in the C code, = however, the value > might be initialized properly on the stack in the assembly code. The code does initialise rel as the loader will have either a DT_REL or = DT_RELA entry, however the compiler doesn=E2=80=99t know this. The asm = code shouldn=E2=80=99t be setting any stack variables as it calls = self_reloc so would need to know the stack layout. This may change = depending on the compiler used, and any flags passed to it. >=20 > For right now (because this doesn't seem to be breaking anything and = my initializing > the stack value could break something since it's called from assembly = code) disable > the warning for self_reloc.c. More investigation should be done to = determine the > appropriate response to this warning (either intialize the value or = find a smarter > way to deal with the warning). The proper solution is to initialise it. If the values incorrect it will = access invalid memory, however as it=E2=80=99s parsing its own = relocation tables it will be safe, if they are wrong there are bigger = problems & the rest of the loader is unlikely to succeed. Andrew