From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id DEA6B3858D20 for ; Tue, 29 Aug 2023 20:39:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DEA6B3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1bf078d5f33so38867405ad.3 for ; Tue, 29 Aug 2023 13:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1693341572; x=1693946372; darn=sourceware.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=uFsdmArfZYKYPPUrmHWmYBHSLtBQzaOzksHILbnnJZw=; b=hgkRzxvzYagEU3rD4NP9xAV3WPwAjrMnObniPCwx03BAbac/Wg6DiRe8EUfYWKTY1q D+eAYQ0kRdqxvCh70/EPlxDxcJtqDo2CNIqFl5d7jCrmbPac4V/i/gm/B0adVHGAt7Vq D79xbkV+dbrl6Unimwv4MYhqJdyLL1ieyurRE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693341572; x=1693946372; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uFsdmArfZYKYPPUrmHWmYBHSLtBQzaOzksHILbnnJZw=; b=iHhTmt96u8lx8l8JRaeL/pPiyZ4N5aRjVJnI71krvr8GR9lmtsU91fzfIwELnkRSi3 Ot79/+NkkRCgD48EpTx7GwhqueG1KmowPWKWWHdHWygju1lhmtlunNmkuADgDnnCT0yC rKGxLrTL4jtWNaO5ogUU08Gp6jUBVnot+cezjobI0D5o8XTxCEAZVasUaE7OlcuJSR6f rIZWTXANdW/HRVUU9SBX/RAkEV4tty/BMcl7i/uLhOvqJyV5WsSwSvpzg9PDt4oi5MV5 UcNYJ65vi73cWxJhbF/BcPMrrVML/m24flzzyFcSS5BJ6qNXCHf8scd6w5MYaTxb19KV 25/w== X-Gm-Message-State: AOJu0YySxViQTaMt0YW+YvA1kelRjZbMG03KIW19yTw2L0jDIyUpj/eN ShAG38hZYhh4u2BrvnHm17fJMg== X-Google-Smtp-Source: AGHT+IEsZq39R0LhJXVtJXT6W+yRy2iKAgh3a2gUpPcuSDrCFi/4vigPl7vO4yS0pj+tXGWttiu1Dw== X-Received: by 2002:a17:902:a414:b0:1c1:ecff:a637 with SMTP id p20-20020a170902a41400b001c1ecffa637mr220561plq.15.1693341571936; Tue, 29 Aug 2023 13:39:31 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id j10-20020a170902690a00b001bdc66478c1sm9774392plk.309.2023.08.29.13.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 13:39:31 -0700 (PDT) Date: Tue, 29 Aug 2023 13:39:30 -0700 From: Kees Cook To: binutils@sourceware.org Cc: maskray@google.com Subject: ld: provide /PASSTHRU/ section rule to avoid orphan warnings? Message-ID: <202308291330.05609E535@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi! The Linux kernel would like to have a way for the linker to emit sections without changing their section name, using wildcards. (This is needed for our efforts towards Function-Granular Kernel Address Space Layout Randomization[1].) Normally this happens automatically if a section doesn't match an existing rule, but then the --orphan-handling=warn option will report it. There is currently no way to silence these "expected sections". e.g. if we had something like: /PASSTHRU/ : { *(.text.*) } Then stuff like ".text.func1" and ".text.func2" will pass through as-is, but something unexpected, like ".other" would still get correctly reported by --orphan-handling=warn. I've opened issues in both binutils[2] and LLVM[3] for this and was hoping to get some feedback on what's needed to see this implemented. :) Thanks! -Kees [1] https://github.com/KSPP/linux/issues/132 [2] https://sourceware.org/bugzilla/show_bug.cgi?id=28772 [3] https://github.com/llvm/llvm-project/issues/65087 -- Kees Cook