From nobody Thu Nov 14 12:44:38 2024 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xq0Gb2H3bz5ccnS for ; Thu, 14 Nov 2024 12:44:39 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xq0Gb1n5lz4JMs for ; Thu, 14 Nov 2024 12:44:39 +0000 (UTC) (envelope-from mmel@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731588279; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rmOwu4poK/CybHhpOcFE0Hd/MmIc3S2gBOeUNjjTcwc=; b=hQ61zn3aprpjxjIEiVMIrel3Jc55cV+7UVzO4bxsog4Ip/SNOzRpZ9teMGMygRcGZYyUEG q5XTuZ+7EECEhRDxz26gSGJXcZvdBPl9dxlvGcaAIq+GoJMbFPOxHARbN5f6IbunbsZU3L wbyBWi2Yd4GprlTHa8NzfOhQTWwn2k74vWo3t91ufT4QgW+mC1kOp5VuQm+Ow3jW5bidFY jxsPRDOm9evyTXd4Z5uM0BMQgn8/nuwQO+FMsfc5l6o1EjXfOfCjbRCayWBEyqH3/kP8cC OmuRyHe4zi7I/XIVbU/rP+Hp1LgLL0yohPxclZfbDOEzruS+OEHvuKGWPdOb2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731588279; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rmOwu4poK/CybHhpOcFE0Hd/MmIc3S2gBOeUNjjTcwc=; b=UuLZZ6C/9gc+7JtP2nEPHJVprEDC0DtSI/fGSPUNMX62ll1xejBcsiIiZIcqnoJzisNEgA YJbLMO7VibXKRNSrbdvLkrVgJg3rMVS7ipV/pARYcEyeeeypsUcI5ACjxTW8/x9EPo/sim e4gb6N8Jtwl6idMlMnYH8Encj9vrgdcyHk1WAj/Lc7S7FCV8S3/ARoAI9snFHvMmRZW1Mj 8jTbX82oa5hGem0qP+l2aRKZsKPdyE8r2dt2AbZRFA/Qj0HQqhxTYrJtVeY5eweus1A81q 2gqF6CRTceSPDEBDbouvnzhqBnoDxM1mxFm3Q6GIwsiMcWgdRVpSOMw2Ze8ovA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731588279; a=rsa-sha256; cv=none; b=nDP7/+G1GZ3C2aRIp0mWgUpGAKfCprR9QEy73v1CfPCzVEbV8udViHHb4FsltZFwbSVXTV +2La3cEftuxu7C6HsswW4Nkr2MNK9jM4f/O0wkFZ/mrNcKyjRikSZf6jcR3qzD6Qn5g0l8 JaDDITtizAamHciq0vL+AzHVFMrCcp1HfiMEl2nIZ6IONRms2JlXRN+WZRgctKadaFQF+t 6crA8TOCj7T0Pl/07Rn3Z9r7y/WzgaI4dEkGuBlnW/hei4pS80/98E2pKAGGQNdbUghfxE aFHQJdCEEsueAJ12Qcm3DHgzclXjMOB9Hd+cMpY1OwYgw7IKTEie+rMn1R0rqA== Received: from [192.168.168.195] (lety.radiolinkplus.cz [109.205.241.143]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mmel/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Xq0GZ6z0QzgsC for ; Thu, 14 Nov 2024 12:44:38 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Message-ID: <192a3da4-6765-401a-a669-0359f8ac9487@FreeBSD.org> Date: Thu, 14 Nov 2024 13:44:38 +0100 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: mmel@FreeBSD.org Content-Language: cs, en-US To: FreeBSD Current From: Michal Meloun Subject: llvm19 lld issue Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit While searching for the cause of armv7 kernel corruption after updating to llvm19 lld, I came across an interesting problem. - The linker script does not list all generated sections. Specifically, the data sections created by the linker set are not listed. - The linker can place these orphaned sections in any location (OK, with some restrictions). See https://maskray.me/blog/2024-06-02-understanding-orphan-sections. - Creating symbols outside a section is fragile and subject to error; the linker may place an orphaned section between the symbol definition and the following section. We ran into this problem many years ago, see https://github.com/freebsd/freebsd-src/commit/6e764e36da019837d90e3b4b712871ee4442637a. Unfortunately, we didn't fix it completely then, and we have to address the same corruption again. I think we should be strict in this area and use '--orphan-handling=error' for kernel linking. However, I'm not sure we can handle linker sets gracefully. Any comments, contrary opinion or better solution ? Does anyone know how to properly list all linker sets (mainly but not only 'set__set') in linker script and which section is appropriate for them ? .rodata? Thanks, Michal