From owner-freebsd-toolchain@freebsd.org Mon Dec 30 18:13:44 2019 Return-Path: Delivered-To: freebsd-toolchain@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 EA1D01E63D2 for ; Mon, 30 Dec 2019 18:13:44 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic301-22.consmr.mail.gq1.yahoo.com (sonic301-22.consmr.mail.gq1.yahoo.com [98.137.64.148]) (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 47mltJ0MX3z4KcC for ; Mon, 30 Dec 2019 18:13:43 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: CivHmuEVM1l4AFuzkAXnqThytyymhQ8pSS5H75Zrr6nHcjqY4bnfdo_HsfV6ydm SCT6k_EIjka0XzP33iH.ZtVslp2PaOj.5kZTaaWbD0hAzOi0cXMPMf08fLVIC8T4GJGxw0dSarhe YUYahFcxC4xLChIkb6jT2WFczrJjvx4Pgj7eL1m1iXBpoxY5K6IlEtd9y7adCCw_myTrwIdcJRSB S2PnSHV4rTXcmcRlyxRA1BaVjxe4wOCITs9l4n.0.AJLvR4N88S4bYgMredAKSyvcsfNYOqdHB8x vv0vj8pdRCan5yGPWOHT9sTkBmKigpSG8ZmrBCeZMfvudTr3zvdihHeUd_yetn1Bg_EPBalZZhG2 NLy6It4tki3SCeeWNzdPW3YjpdrBl3bdEumDcTn5eQ.6zWit041zP9VmX4oMyv7zeWl0nJTSSSms eUttv9lU6rKh.yGDxFVsZuM8JHk3pnyKpTW5ihlEAW_mxMiRaWILKJJPBClZ.YSX35iBDeJxuBd7 CD2X9i_AHyXPjqSifmh7SkfnFxocxUwbq6T4EdmKhTMbGI5fifhAF1yaWrp085ymlowdW2.2nDjZ 8HDE_guye5AJUXhzf.Rwigj60DqBCgpVW3hs.Pk93p7rDMZou3yRAdRrBARASQDZ8qsX7Y9lYZaL 7F0Azfsnhgm38xNkx95SEhPrDvlR_mYrw4dJG3wkgVs05dBRECODavYcZs036MW96rqR8O0rEQ_n .uj_Y6xGJpLZEkGklS8JgJmTYqK1zmRo_ps7nvsJHGkRcffIjP5q4dbkZcDFU1w5KvNTidzmUT2a rjZX6ZZrFwu7GNqvsfmJ3EXeNf14ewb1cfAgPtGhPMvxe__iWS_pz8ImSgOTLfMHv3ITUpS4.btt ng6WEetk3Bgu63fEGi.15O9WtnNBRKsNMgHIwQ1vMMMfmLkrLHlBHrxiYagmu_yoVr.jg_yFeJQi Iz5fT9Avpn408yBRFMz0SRS19x3LbZPvAerTTgIWfym1SOtA8.IIGQgv8NkF6NW1X0ao_nWzB_t6 45KQ4NB0tDL.uqWD7tmuzbOw2feMNGyKyAh9MoXfMIz8Ydj1EI45bx_xSu.1nfm9vRyC6746..9R nK5ZcKnANhnil2y4Xj3k_qGLOsQhsRmwlABDlLJMMH_UpF6ariTDDVI9pYysgxh.XAY4lAF2IY4O XXqcC1FH3VYbbqmhvZDsSoetulf2Pwyg5OOVXWrTuz3ficV955fz8t8B11XQhQfNMETh9W5OV2YU qC5G0HjT2FNztWV6Ggz3WF_eCqI7EogjVpQ0mPqt9ljVvIOPmX.9FbV_18fNnN3wX1mM7BwZsEWi 0499N.683jWtnWKPV1Fft4Hjy9Xhya98c_gisweL0uigsxOjkDthL721JeyNoFrduqnSOtrzN8M0 BYvqxivjtruS3E1pI0MHVF7Wn_QTkOdbpFDKHxA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.gq1.yahoo.com with HTTP; Mon, 30 Dec 2019 18:13:41 +0000 Received: by smtp417.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 74d28e342bb80412c9da099e00cfb633; Mon, 30 Dec 2019 18:13:40 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: devel/binutils@powerpc64 ( powerpc64-unknown-freebsd13.0-ld ) unbounded loop in bfd/elf64-ppc.c : the source code and values Message-Id: <89FF670E-3C97-44F6-9B16-FE1B68B304E9@yahoo.com> Date: Mon, 30 Dec 2019 10:13:38 -0800 To: FreeBSD Toolchain , FreeBSD ports X-Mailer: Apple Mail (2.3608.40.2.2.4) References: <89FF670E-3C97-44F6-9B16-FE1B68B304E9.ref@yahoo.com> X-Rspamd-Queue-Id: 47mltJ0MX3z4KcC X-Spamd-Bar: - X-Spamd-Result: default: False [-1.96 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.49)[-0.490,0]; 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]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-0.97)[-0.970,0]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[148.64.137.98.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; RCVD_TLS_LAST(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)[]; IP_SCORE(0.00)[ip: (3.86), ipnet: 98.137.64.0/21(0.89), asn: 36647(0.71), country: US(-0.05)]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Dec 2019 18:13:45 -0000 I ran into the following ubounded loop (via the continue) in bfd/elf64-ppc.c while trying to do a devel/freebsd-gcc9@powerpc64 based buildworld buildkernel : /* Read the relocations. */ relstart = _bfd_elf_link_read_relocs (ibfd, sec, NULL, NULL, info->keep_memory); if (relstart == NULL) return FALSE; relend = relstart + sec->reloc_count; for (rel = relstart; rel < relend; ) { enum elf_ppc64_reloc_type r_type; unsigned long r_symndx; asection *sym_sec; struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; unsigned char *tls_maskp; r_type = ELF64_R_TYPE (rel->r_info); if (r_type != R_PPC64_PLTCALL && r_type != R_PPC64_PLTCALL_NOTOC) continue; Nothing is done before the continue to make rel progress towards relend (or relend towards relstart). It just repeats the same activity over and over on the same rel value. This was in: devel/binutils/work-powerpc64/binutils-2.33.1/bfd/elf64-ppc.c The 1st line quoted above was line 7455 according to vi. Ref reference, both of the stuck links (clang.full and lld.full) have: (gdb) print r_type $1 = R_PPC64_REL16_HA (gdb) print/x *rel $3 = {r_offset = 0x2, r_info = 0x18000000fc, r_addend = 0x2} === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)