From nobody Thu Nov 14 21:01:29 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 4XqCHw01gzz5d8lP for ; Thu, 14 Nov 2024 21:01:32 +0000 (UTC) (envelope-from dim@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 4XqCHv6h95z4B7w; Thu, 14 Nov 2024 21:01:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731618091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7zm7kqwaAysCQehSGwi/60Lr26XGWt2c/pwPT9HtTzQ=; b=cUJ5qDSMqfhzsGIPEMOd8t9J5C/tRmGsFihdOufvrOeoS3BDGjTAXAdn2lnWkfnZugtYUN z+sWTeVplRr9sWQCRD3ShXjuJqq4VqQ7jhcVqIjF31D3nGwS3VqDmQLpK8HxjHhHUnzWLe p8P2hPD4nxUfPY5RNDtQUG44N6l5jrrsUXuVHI3DMdd7oEWAahNyQhsm7N8XcOHxYf7xDk McCneErIDtOw0B9HA0J6xUfyyt0CpOt030nRm09bzPLXBwm/b0Sc0dD3qjoslA2SLcxPRI Dz7E4iSTqF4cjhzVrlO4htBTqabbk+5FMgm7bpBhddWO3De+5fz8+EDS63hA0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731618091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7zm7kqwaAysCQehSGwi/60Lr26XGWt2c/pwPT9HtTzQ=; b=SwwPPazaUq6NJpdFJfeb9IYDF9Tria1xbEnupSeAundLGB3s/lukhGnvcjtnH6etCLJPyl JqrU7ZqTPGJwHM9VQrkAc3jYYwBTp8YxYnkDWwiWAr1XJmQSxf7OZmxl9Z9dV9fjcjUaXr 3I8D/u3QXQ4EGnHv0eUjQyRjE/xIk4vDcm/+36DMtLpMcYJP9Ozbe9nY8jnzaquorudNPn XXrmVV4WkZ2z5WB3XbgaH+4Rx3qVZ0sOSc7dd/43Lh6GR88Mx6IZr6d3hgcZNodQvYjQ1s HbjZeqGCRn959kdyVECPpvgWMQJs7eCqZTiYMmEtC16jMdB3aFfjk+v9QR2XQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731618091; a=rsa-sha256; cv=none; b=yx8b4EQfFa3AyfNinEg4nHKTUJ9F/FhQNK3DGGyrctSm3dNs8S8tY8D1en/TqUiE4n93PB ceTMemuZP/H/RhJevUWjx8mkBRHI42xFRoFWo3F7jqqCxN6GX1s3IwU7xxr8vh3acSdf5e NXfvGqsUs6K50ZlpcTHUALXyNIT4KbZ0CguoL9uBwc+oeSqpD6yQTRvvVafLkZBF1Eoc6c tL/6MAJCEADlBA1LB6YhFZazd63WpRTZhzj6h4e3L6t7M7ldhOgRlx+lxPH5kA6/H+W9ce l8RZWkdMncPE1uXPTBE1eETaHv4Iyoko+yLvTzQGP6vDIjsylw9gwFe64sQWsQ== Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (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 (2048 bits) client-digest SHA256) (Client CN "tensor.andric.com", Issuer "R10" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XqCHv5jw4z16tK; Thu, 14 Nov 2024 21:01:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (longrow.home.andric.com [192.168.0.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 4A281747C0; Thu, 14 Nov 2024 22:01:30 +0100 (CET) Content-Type: text/plain; charset=us-ascii 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 (Mac OS X Mail 16.0 \(3731.700.6.1.9\)) Subject: Re: llvm19 lld issue From: Dimitry Andric In-Reply-To: <192a3da4-6765-401a-a669-0359f8ac9487@FreeBSD.org> Date: Thu, 14 Nov 2024 22:01:29 +0100 Cc: FreeBSD Current Content-Transfer-Encoding: quoted-printable Message-Id: <8C24BC41-9782-45C9-AB8B-075943452519@FreeBSD.org> References: <192a3da4-6765-401a-a669-0359f8ac9487@FreeBSD.org> To: "mmel@freebsd.org" X-Mailer: Apple Mail (2.3731.700.6.1.9) On 14 Nov 2024, at 13:44, Michal Meloun wrote: >=20 > While searching for the cause of armv7 kernel corruption after = updating to llvm19 lld, I came across an interesting problem. >=20 > - The linker script does not list all generated sections. = Specifically, the data sections created by the linker set are not = listed. >=20 > - 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. >=20 > - 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. >=20 > We ran into this problem many years ago, see = https://github.com/freebsd/freebsd-src/commit/6e764e36da019837d90e3b4b7128= 71ee4442637a. Unfortunately, we didn't fix it completely then, and we = have to address the same corruption again. >=20 > I think we should be strict in this area and use = '--orphan-handling=3Derror' for kernel linking. However, I'm not sure we = can handle linker sets gracefully. >=20 > 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? I tried adding --orphan-handler=3Derror, and on buildkernel (even for = amd64) I get pretty soon: --- all_subdir_accf_data --- ld: error: accf_data.o:(.data) is being placed in '.data' ld: error: accf_data.o:(set_modmetadata_set) is being placed in = 'set_modmetadata_set' ld: error: accf_data.o:(set_sysinit_set) is being placed in = 'set_sysinit_set' ld: error: accf_data.o:(.debug_loc) is being placed in '.debug_loc' ld: error: accf_data.o:(.debug_abbrev) is being placed in = '.debug_abbrev' ld: error: accf_data.o:(.debug_info) is being placed in '.debug_info' ld: error: accf_data.o:(.debug_ranges) is being placed in = '.debug_ranges' ld: error: accf_data.o:(.debug_str) is being placed in '.debug_str' ld: error: accf_data.o:(.comment) is being placed in '.comment' ld: error: accf_data.o:(.debug_frame) is being placed in '.debug_frame' ld: error: accf_data.o:(.debug_line) is being placed in '.debug_line' ld: error: accf_data.o:(.llvm_addrsig) is being placed in = '.llvm_addrsig' ld: error: accf_data.o:(.SUNW_ctf) is being placed in '.SUNW_ctf' ld: error: :(.note.gnu.build-id) is being placed in = '.note.gnu.build-id' ld: error: :(.note.GNU-stack) is being placed in = '.note.GNU-stack' ld: error: :(.symtab) is being placed in '.symtab' ld: error: :(.shstrtab) is being placed in '.shstrtab' ld: error: :(.strtab) is being placed in '.strtab' --- all_subdir_aic7xxx --- --- all_subdir_aic7xxx/ahc --- --- machine --- machine -> /home/dim/src/freebsd/src/sys/amd64/include --- all_subdir_accf_data --- *** [accf_data.ko.full] Error code 1 Not sure if those are all really orphaned, though? -Dimitry