From owner-freebsd-toolchain@freebsd.org Tue Mar 2 19:37:28 2021 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 DB83154E615 for ; Tue, 2 Mar 2021 19:37:28 +0000 (UTC) (envelope-from pjfloyd@wanadoo.fr) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4DqnTN4qtbz3G2M for ; Tue, 2 Mar 2021 19:37:28 +0000 (UTC) (envelope-from pjfloyd@wanadoo.fr) Received: by mailman.nyi.freebsd.org (Postfix) id A3E1D54E3BC; Tue, 2 Mar 2021 19:37:28 +0000 (UTC) Delivered-To: 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 A3AA754E3BB for ; Tue, 2 Mar 2021 19:37:28 +0000 (UTC) (envelope-from pjfloyd@wanadoo.fr) Received: from smtp.smtpout.orange.fr (smtp11.smtpout.orange.fr [80.12.242.133]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "Bizanga Labs SMTP Client Certificate", Issuer "Bizanga Labs CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqnTM51GYz3Fv8 for ; Tue, 2 Mar 2021 19:37:26 +0000 (UTC) (envelope-from pjfloyd@wanadoo.fr) Received: from [192.168.1.17] ([2.7.65.44]) by mwinf5d89 with ME id bXdQ2400D0xHJey03XdQ8p; Tue, 02 Mar 2021 20:37:24 +0100 X-ME-Helo: [192.168.1.17] X-ME-Auth: cGpmbG95ZEB3YW5hZG9vLmZy X-ME-Date: Tue, 02 Mar 2021 20:37:24 +0100 X-ME-IP: 2.7.65.44 Subject: Re: clang options for load segments To: "toolchain@freebsd.org" References: <4D81BCDE-ECBC-49D8-BF17-38E334141FE0@FreeBSD.org> From: Paul Floyd Message-ID: <89794bb8-5e97-36a7-0b6a-fa2eaf76a72a@wanadoo.fr> Date: Tue, 2 Mar 2021 20:37:24 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <4D81BCDE-ECBC-49D8-BF17-38E334141FE0@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 4DqnTM51GYz3Fv8 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of pjfloyd@wanadoo.fr has no SPF policy when checking 80.12.242.133) smtp.mailfrom=pjfloyd@wanadoo.fr X-Spamd-Result: default: False [-0.10 / 15.00]; FREEMAIL_FROM(0.00)[wanadoo.fr]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RECEIVED_SPAMHAUS_PBL(0.00)[2.7.65.44:received]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[wanadoo.fr]; ASN(0.00)[asn:3215, ipnet:80.12.240.0/20, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[80.12.242.133:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[wanadoo.fr]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[80.12.242.133:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[80.12.242.133:from]; TO_DN_EQ_ADDR_ALL(0.00)[]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[80.12.242.133:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[toolchain] X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 19:37:28 -0000 On 3/2/21 7:31 PM, Dimitry Andric wrote: [snip - history of change] >> I will carry on looking for a proper solution. In the meantime, are there any flags to revert to the previous behaviour >> and only generate a single RW LOAD segment? > I think valgrind should be fixed to able to cope with additional > segments, but I haven't seen valgrind working on FreeBSD for years now, > so I am not going to hold my breath. :) I'll work on fixing it in Valgrind, but that is likely to be fair amount of work. No need to hold your breath. Concerning the FreeBSD port I've been working on Valgrind on FreeBSD for about a year or so and now it's not too far from working as well on FreeBSD as it does on Linux*. Either install the devel/valgrind-devel package (note: not devel/valgrind) or even better build and install from my github repo https://github.com/paulfloyd/freebsd_valgrind. I have a commit bit for upstream Valgrind and am working on integrating FreeBSD support in the 'official' Valgrind. This probably won't be in the next release, 3.17, due soon, but I hope that it gets into the next one (3.17.1 or 3.18). And I'm always on the lookout for any user feedback :-) . > > That said, you can attempt to link your executables with -z norelro (or > -Wl,-z,norelro via the compiler driver). If there is no PT_GNU_RELRO > header, lld will not split the segments. This seems to do the job as a workaround, thanks. A+ Paul * rust, OMP, clang debuginfo and some signal issues  being the exceptions that I'm aware of