From owner-freebsd-ppc@freebsd.org Tue Jan 7 07:18:58 2020 Return-Path: Delivered-To: freebsd-ppc@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 866C61EC519 for ; Tue, 7 Jan 2020 07:18:58 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic306-19.consmr.mail.gq1.yahoo.com (sonic306-19.consmr.mail.gq1.yahoo.com [98.137.68.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47sNz34Ygqz3Jxy for ; Tue, 7 Jan 2020 07:18:55 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 61a7M3gVM1kk.8F0dNMXfymiTOLVVgHhj4hEUoKRZT312mJ3ebFHxbnTRogd3a7 voK5wRHeISZ4vdXj498BawpSxRUZPE2rY5SyyY.nGvIGB4_ISo7kbGB3.0QPd0k.wbQxEfmQE3VY zFO9wQDprASkLI4br0qdENOvi9EvzDIhBEFC9Lp3w9H_ceWWLCs3yWPhWeqqA3yH74uVBBpYLIXv H4qTNyqYRjI9QyzYOSImG3RYA9OA2fkye84QEn3fh7a4DlYJ2Efgk7e5zTvmRoFOvpJ99axAszKV 7ZYuSftcByiIfigAd_9mZaXvFnDnl_.AOzAiwk8ACOkeRSwc8yqHbaDgUKO6h5IZ1zdiNWAqdaNY ZVvJQHJsZ79AMzUascD6R0Qjo0afgwMoDPerC2JefJJeB_GPBuTbbBNDhpsVPlzOU4Rc3GBE6Lja XPoIFlpYEIL_0cbuq3VKtAfJ2x8anRI4vUqiAmDHv58L.WMDOKWoxeEI0fbgj0g5xIvRUTGKB.7d IC5pQ9vXKeyOkqvS1gnmf8zJPX83A7.ymgiv9eYcURAKUw_xSdqde.zRnrck4sXkbz3N4KaiZTdj 5UcyzEATj4rJXHcWTENSGpfCLa0mx5S4DMkeSfhPua1Em4i.veB1354sxfUL9uv3clMFvxohbxjk _TSHToFUM_tkH_tVfFzIwUhdx5HCsTDoLWT6pHaKldSb.iz5GVhV.zH3EIJIc3K0cgh7cXxUBbp8 7ixbw_o_u7UUfeWkVcqZFWgfNE6mJI9RtBv6DVcQuiE33FsLkynbtYkGybYJOoiWbXALFVFBF7.n cVNfrVpmX7Eh8ZzyRBua0Bi0CmtsGzPzlvQTNb3xOa5JkEKau2aC9drWRYcbrukSe_QRlCJwxn9z _.tLRJCXH2QTt8ECG6ANTobrMd.sxkGiU701mlPHN_WuzWY8wwU1fA7dgECubLSpCi.GGuat9AoC r2lItwUbFgqlLTfBRtdNrNgFFG5jTSVHrGK_YKA26q6V7FSiAe4VrPeAq7OiuExAYQHS951m22y0 VRGzKSNlv46g7MaZt5RWbkROuj8hfUfFn_jViao1l7p0E_inz1JAJJetSBspTQC3zonBuoz.3Tdv d4.9B.OSyEkPBaWejVCLH9KL9sVlEuJnv2PAJ4gAw7qYqTa4eYun85N3QMRfsBMNT.ZX1i3siulm KWMlfkR.uAnXrihbPtpIGNT8jHf6AbtKVY03TZBe0OkqRUM6K7zkB1CuEi7SS9sc9ZLW_bJGpaLD p6XqM6mLsbcS12qT_cE61hp0C9YbaMZJu7RHpswXGGJeyi.4YSRArRlAhMRoqqs7ZzUPxrlxGZKG gaNfsfrc2rwTwqq1HAjaWtQd5TDpLVyywMbZkP5IeYJK233_CXkO0UEhmawJuB526cNsoDO2DNrC S7CViJtr1Ls0bKWyv Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.gq1.yahoo.com with HTTP; Tue, 7 Jan 2020 07:18:53 +0000 Received: by smtp407.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 9d6d97b2aeba020188d6dd1f45ae654d; Tue, 07 Jan 2020 07:18:49 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: Involving devel/binutils@powerpc64 in buildworld buildkernel : got/toc optimization is not supported for addis %r1,%r1,TOC_REF(trapstk)@ha (and the like) Date: Mon, 6 Jan 2020 23:18:48 -0800 References: <00DFB84D-D694-4BCA-A15F-5098F0320FA9@yahoo.com> To: FreeBSD PowerPC ML In-Reply-To: <00DFB84D-D694-4BCA-A15F-5098F0320FA9@yahoo.com> Message-Id: X-Mailer: Apple Mail (2.3608.40.2.2.4) X-Rspamd-Queue-Id: 47sNz34Ygqz3Jxy X-Spamd-Bar: / X-Spamd-Result: default: False [-0.59 / 15.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.20)[-0.200,0]; RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_SPAM_MEDIUM(0.11)[0.105,0]; RCVD_TLS_LAST(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; RCVD_IN_DNSWL_NONE(0.00)[82.68.137.98.list.dnswl.org : 127.0.5.0]; MV_CASE(0.50)[]; IP_SCORE(0.00)[ip: (6.05), ipnet: 98.137.64.0/21(0.88), asn: 36647(0.70), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 07:18:58 -0000 On 2020-Jan-6, at 22:52, Mark Millard wrote: > The following is based on what I noticed while > working on updating to head -r356426 , including > building multiple ways (discovering what fails > to build and such). >=20 > I was looking at messages and noticed that there > were messages such as: >=20 > --- kernel.full --- > locore.o: in function `dbtrap': > /usr/src/sys/powerpc/aim/trap_subr64.S:905:(.text+0xa68): got/toc = optimization is not supported for 0x3c210000 instruction >=20 > That is the addis instruction in: >=20 > dbtrap: > /* Write the trap vector to SPRG3 by computing LR & 0xff00 */ > mflr %r1 > andi. %r1,%r1,0xff00 > mtsprg3 %r1 >=20 > GET_TOCBASE(%r1) /* get new SP */ > addis %r1,%r1,TOC_REF(trapstk)@ha > ld %r1,TOC_REF(trapstk)@l(%r1) > addi %r1,%r1,(TRAPSTKSZ-48) >=20 > (based on line number). >=20 > This was for system-clang and devel/binutils@powerpc64 > being used to do the build. >=20 > But it also happened for devel/freebsd-gcc9@powerpc64 > and devel/binutils@powerpc64 bing used to do the > build: >=20 > --- kernel.full --- > locore.o: in function `dbtrap': > /usr/src/sys/powerpc/aim/trap_subr64.S:905:(.text+0xa68): got/toc = optimization is not supported for 0x3c210000 instruction >=20 > (Same instruction, same message.) >=20 >=20 > There are lots of similar messages for other instruction > encodings for zfs.ko.full --but only for the > devel/freebsd-gcc9@powerpc64 and devel/binutils@powerpc64 > combination: >=20 > --- zfs.ko.full --- > zfs.kld: in function `acl_trivial_create': > = /usr/src/sys/cddl/contrib/opensolaris/common/acl/acl_common.c:1646:(.text+= 0x568): got/toc optimization is not supported for 0x3d9e0000 instruction > zfs.kld: in function `cacl_malloc': > = /usr/src/sys/cddl/contrib/opensolaris/common/acl/acl_common.c:243:(.text+0= x5e0): got/toc optimization is not supported for 0x3d9e0000 instruction > zfs.kld: in function `ace_trivial': > = /usr/src/sys/cddl/contrib/opensolaris/common/acl/acl_common.c:1764:(.text+= 0x990): got/toc optimization is not supported for 0x3d9e0000 instruction > zfs.kld: in function `avl_nearest': > . . . >=20 > The list for zfs.ko.full is large. >=20 > Overall there are examples of each of: >=20 > got/toc optimization is not supported for 0x3c210000 instruction > got/toc optimization is not supported for 0x3c9e0000 instruction > got/toc optimization is not supported for 0x3cbe0000 instruction > got/toc optimization is not supported for 0x3cde0000 instruction > got/toc optimization is not supported for 0x3cfe0000 instruction > got/toc optimization is not supported for 0x3d1e0000 instruction > got/toc optimization is not supported for 0x3d3e0000 instruction > got/toc optimization is not supported for 0x3d5e0000 instruction > got/toc optimization is not supported for 0x3d9e0000 instruction > got/toc optimization is not supported for 0x3dde0000 instruction > got/toc optimization is not supported for 0x3dfe0000 instruction > got/toc optimization is not supported for 0x3e1e0000 instruction > got/toc optimization is not supported for 0x3e3e0000 instruction > got/toc optimization is not supported for 0x3e5e0000 instruction > got/toc optimization is not supported for 0x3e7e0000 instruction > got/toc optimization is not supported for 0x3e9e0000 instruction > got/toc optimization is not supported for 0x3ebe0000 instruction > got/toc optimization is not supported for 0x3ede0000 instruction > got/toc optimization is not supported for 0x3efe0000 instruction > got/toc optimization is not supported for 0x3f1e0000 instruction > got/toc optimization is not supported for 0x3f3e0000 instruction > got/toc optimization is not supported for 0x3f5e0000 instruction > got/toc optimization is not supported for 0x3f7e0000 instruction > got/toc optimization is not supported for 0x3f9e0000 instruction > got/toc optimization is not supported for 0x3fbe0000 instruction >=20 > I'm not sure of the implications, but I figured that the > information might be of use at some point. Looking around on the web, it looks like the relevant code in gnu's ld might be from this 2019-Aug-19 material: + enum {no_check, check_lo, check_ha} insn_check; =20 r_type =3D ELF64_R_TYPE (rel->r_info); + switch (r_type) + { + default: + insn_check =3D no_check; + break; + + case R_PPC64_PLT16_HA: + case R_PPC64_GOT_TLSLD16_HA: + case R_PPC64_GOT_TLSGD16_HA: + case R_PPC64_GOT_TPREL16_HA: + case R_PPC64_GOT_DTPREL16_HA: + case R_PPC64_GOT16_HA: + case R_PPC64_TOC16_HA: + insn_check =3D check_ha; + break; + + case R_PPC64_PLT16_LO: + case R_PPC64_PLT16_LO_DS: + case R_PPC64_GOT_TLSLD16_LO: + case R_PPC64_GOT_TLSGD16_LO: + case R_PPC64_GOT_TPREL16_LO_DS: + case R_PPC64_GOT_DTPREL16_LO_DS: + case R_PPC64_GOT16_LO: + case R_PPC64_GOT16_LO_DS: + case R_PPC64_TOC16_LO: + case R_PPC64_TOC16_LO_DS: + insn_check =3D check_lo; + break; + } + + if (insn_check !=3D no_check) + { + bfd_vma off =3D rel->r_offset & ~3; + + if (!bfd_get_section_contents (ibfd, sec, buf, off, = 4)) + goto got_error_ret; + + insn =3D bfd_get_32 (ibfd, buf); + if (insn_check =3D=3D check_lo + ? !ok_lo_toc_insn (insn, r_type) + : ((insn & ((0x3f << 26) | 0x1f << 16)) + !=3D ((15u << 26) | (2 << 16)) /* addis = rt,2,imm */)) + { + char str[12]; + + ppc64_elf_tdata (ibfd)->unexpected_toc_insn =3D 1; + sprintf (str, "%#08x", insn); + info->callbacks->einfo + /* xgettext:c-format */ + (_("%H: got/toc optimization is not supported = for" + " %s instruction\n"), + ibfd, sec, rel->r_offset & ~3, str); + continue; + } + } =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)