Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 2019 14:53:05 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Justin Hibbits <jrh29@alumni.cwru.edu>
Cc:        FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   Re: FreeBSD/powerpc and FreeBSD/powerpcspe toolchain update
Message-ID:  <4B8DE338-8152-42CD-914C-35596FFDA76B@yahoo.com>
In-Reply-To: <20190627145312.5abd82e7@titan.knownspace>
References:  <CAHSQbTBjZFb1dPk2FN=438i0FVtAKHYy-y22L%2BHFEDrTmd-9Aw@mail.gmail.com> <CE47F595-68EF-43A2-877B-61C1981AF9E7@yahoo.com> <20190627145312.5abd82e7@titan.knownspace>

index | next in thread | previous in thread | raw e-mail



On 2019-Jun-27, at 12:53, Justin Hibbits <jrh29 at alumni.cwru.edu> wrote:

> On Thu, 27 Jun 2019 12:03:05 -0700
> Mark Millard <marklmi@yahoo.com> wrote:
> 
>> On 2019-Jun-24, at 19:40, Justin Hibbits <jrh29@alumni.cwru.edu>
>> wrote:
>> 
>>> As of r349351 32-bit powerpc toolchains need to be rebuilt as part
>>> of buildworld, in order to take advantage of the new Secure
>>> Procedure Linkage Table (Secure-PLT) format.  This can be done by
>>> passing "WITHOUT_SYSTEM_TOOLCHAIN=" on the 'make buildworld'
>>> command line.
>>> 
>>> Cross-building should work fine with no changes, as that already
>>> builds a new toolchain.  If building with an external toolchain,
>>> such as gcc8, add 'CFLAGS+= -msecure-plt' to /etc/src.conf to
>>> ensure the new PLT is used, otherwise it will default to BSS-PLT,
>>> which is fully compatible, but not as secure.  There is breakage
>>> intended at all, so please let me know if there are any problems.  
>> 
>> My attempt to amd64->powerpc (32-bit) cross build from/to head
>> -r349444 via system clang and lld got the following. This may not be
>> a recent change. It has been a long time since I tried lld, instead
>> using devel/powerpc64-binutils. ( devel/powerpc64-binutils now fails
>> where it used to work, but I sent a separate note out about that. )
>> 
>> --- agp.ko.full ---
>> ld: agp.kld(.text+0x37a4): R_PPC_PLTREL24 reloc against local symbol
>> agp.kld: could not read symbols: Bad value
>> *** [agp.ko.full] Error code 1
>> 
> 
> Hi Mark,
> 
> Can you determine what symbol has that relocation?  I don't see that
> error when building natively, or cross-building with base toolchain, so
> there's very likely a change in binutils between 2.17 and now that's
> leading to this failure.

Sure. readelf shows for agp.kld at 0x37a4 :

000037a4 00004512 R_PPC_PLTREL24      00000000 agp_find_caps + 0

and also shows for agp_find_caps:

    69: 0000000000000000   172 FUNC    LOCAL  DEFAULT    1 agp_find_caps

(Note that I build with debug symbols., even for non-debug builds.)

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B8DE338-8152-42CD-914C-35596FFDA76B>