Date: Fri, 6 Jan 2017 09:19:34 -0600 From: Justin Hibbits <jrh29@alumni.cwru.edu> To: Mark Millard <markmi@dsl-only.net> Cc: FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org> Subject: Re: Bug 215821 for TARGET_ARCH=powerpc64: bootstrapped ld produces a "shared object" when given a -pie option; junk kernel produced crashes Message-ID: <CAHSQbTCM_pzxdgd9-ptP2_9Ni%2B5oB7Jy=6huvRTytpNHZVaYAQ@mail.gmail.com> In-Reply-To: <496BD75E-3D29-4717-BDE8-9AAFCA27FD0C@dsl-only.net> References: <496BD75E-3D29-4717-BDE8-9AAFCA27FD0C@dsl-only.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 6, 2017 at 3:04 AM, Mark Millard <markmi@dsl-only.net> wrote: > I have submitted a FreeBSD bugzilla entry: > > Bug 215821 - head -r311147's bootstrapped ld for TARGET_ARCH=powerpc64 produces kernel.full as a "shared object" for -pie instead of as a "executable": booting the produced kernel crashes > > In essence what the .meta file for kernel.full shows as: > > CMD @ld -Bdynamic -T /usr/src/sys/conf/ldscript.powerpc64 -pie --no-warn-mismatch --warn-common --export-dynamic --dynamic-linker /red/herring -o kernel.full -X locore.o . . . > > (note the -pie) ends up producing: > > ELF 64-bit MSB shared object, 64-bit PowerPC or cisco 7500, version 1 (FreeBSD), dynamically linked, interpreter /red/herring, not stripped > > instead of what it should have produced: > > ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version 1 (FreeBSD), dynamically linked, interpreter /red/herring, not stripped > > The differences in content leads to the powerpc64 crashing at the start of the produced kernel. > > This means needing to use devel/binutils and/or devel/powerpc64-binutils instead (at least for ld). > > === > Mark Millard > markmi at dsl-only.net Hi Mark, Nathan made a change 2 years ago to build the kernel as a shared object, so that it can be relocatable. Looking at my kernel.full (base gcc build): world/zhabar/home/chmeee/freebsd/pristine/sys/ZHABAR/kernel.full: ELF 64-bit MSB shared object, 64-bit PowerPC or cisco 7500, version 1 (FreeBSD), dynamically linked, interpreter /red/herring, not stripped - Justin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHSQbTCM_pzxdgd9-ptP2_9Ni%2B5oB7Jy=6huvRTytpNHZVaYAQ>