Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1695434ybv; Thu, 6 Feb 2020 08:15:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyE7TgkJvw70dPqk/ZqvdAeFbeG3slJhHeWA+ZI4gRq646/2iaVFePXNUKrkO8Yy2zZgTXM X-Received: by 2002:a9d:67c9:: with SMTP id c9mr31558802otn.67.1581005701170; Thu, 06 Feb 2020 08:15:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581005701; cv=none; d=google.com; s=arc-20160816; b=lUwP+vMhxosdUgN9lDnUNabaaJBZYlkqnuv/xL9Temp8ZJK91OhoGmZv9Bn1+g7L3u suEao63swO5uNfGDBLdyZQd/eVWaVHbdBCMn0uzBNGOsvGm8E0Lq/uLI09uPUReONtPs gAImqOli9EoTI6FCEIigiRhnBNr5cFbzwr86QoblkmzDkZZ2ZaT4LT2F04BivTsh/Nsq A2VjZdLY3COHNiRB0kOp9C7J29AJqHHmyKeh6IBcdT65y4uIb/m8s4SmzcdL5PvNyxBb pzQHaCOeXFOnE+bB0YoFDTkTKckok1EO/tcA2BvK0ThmuOSI3cpNA40e8kwvyVN2tlTn RNNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=FapTU+sIoIgXhVwEKNeSLtLXJp8fZNlrQHlOeGtKClQ=; b=Msfcfogv57R/sdCp9rvIRDeRAzi2JyIPtcupiMkzOMLcD4K0bPmlXjhYB+E2e+RixL Az3EUaQRuY13vJmz2mww/RupdJDqN6noA12uKR/Y4gb5g+SWbQiEyexY6ZXWWJorGpaA 4idMfjXV7BmjFFmVYJfPRwfYG9CCm4x+zij62xhozjj5Wn8AnfJPFPSGsf652fN84jwW LzEFckanY1d3TO3n1h6FXberYSxPzN2SxZIXg14omx3zHfl7K9QKgrzE9yDpsZY1PTbh ry2+RtAyYt/cNIDDT6Halzw1NMiJyJaKc/0zU8cDgFk9OBmqB/+I8R1TGda80ebZZlNo wZzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=mhDIUKV3; dkim=temperror (no key for signature) header.i=@fluxnic.net header.s=2016-12.pbsmtp header.b=R6BmjNIZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i16si1854otp.58.2020.02.06.08.14.48; Thu, 06 Feb 2020 08:15:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=mhDIUKV3; dkim=temperror (no key for signature) header.i=@fluxnic.net header.s=2016-12.pbsmtp header.b=R6BmjNIZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727695AbgBFQMQ (ORCPT + 99 others); Thu, 6 Feb 2020 11:12:16 -0500 Received: from pb-smtp2.pobox.com ([64.147.108.71]:63438 "EHLO pb-smtp2.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727358AbgBFQMP (ORCPT ); Thu, 6 Feb 2020 11:12:15 -0500 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 7914E4267F; Thu, 6 Feb 2020 11:12:14 -0500 (EST) (envelope-from nico@fluxnic.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sasl; bh=s77iPB9oFfq1CkqBPIOEo+Qt9nE=; b=mhDIUK V3+nFIBbZ4oaaKXKLwQ0WuAtfmTWW8hFHiJxq59f2BLifyQJx5YzvDJWcKNliDZ6 M4NLDIb/8wSgCazOxVDsloRrU/86KEr0LG+7PB1ZuxVpyNRx4Aid9S4d01P53K/8 9rEQD6i7//+ezo68eR5X/3hJstakKh7eiwI+U= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 6F96D4267E; Thu, 6 Feb 2020 11:12:14 -0500 (EST) (envelope-from nico@fluxnic.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=fluxnic.net; h=date:from:to:cc:subject:in-reply-to:message-id:references:mime-version:content-type; s=2016-12.pbsmtp; bh=USAs6fd+3dK9Jv6668+jev/vMsJexfPZ6kNB/99uw7A=; b=R6BmjNIZ5BDDOmlSnNrBqmLNfxnLGYGd8rMdTe8MNtC246FoDErsshWuEf7NTNOGHW2vShefSbGg4hwVnm7xbzwR+UCbkT8EtDjfRwLlhcHEImL7rT0oLbWme8V8YMTsXSLCXXyBE8YQ0Irf/Ff3cB6LJPXnEurDdWYjtISpd4I= Received: from yoda.home (unknown [24.203.50.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id E52B94267D; Thu, 6 Feb 2020 11:12:13 -0500 (EST) (envelope-from nico@fluxnic.net) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTPSA id BB4C22DA03F4; Thu, 6 Feb 2020 11:12:12 -0500 (EST) Date: Thu, 6 Feb 2020 11:12:12 -0500 (EST) From: Nicolas Pitre To: Jessica Yu cc: Quentin Perret , masahiroy@kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, maennich@google.com, kernel-team@android.com Subject: Re: [PATCH v2] kbuild: allow symbol whitelisting with TRIM_UNUSED_KSYMS In-Reply-To: <20200206155651.GC16783@linux-8ccs> Message-ID: References: <20200129181541.105335-1-qperret@google.com> <20200206155651.GC16783@linux-8ccs> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Pobox-Relay-ID: 6FE61F14-48FB-11EA-9CA5-D1361DBA3BAF-78420484!pb-smtp2.pobox.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 6 Feb 2020, Jessica Yu wrote: > Hm, I thought TRIM_UNUSED_KSYMS just *unexports* unused symbols, no? > "Trimmed from the build" sounds like the symbols are not compiled in > or dropped completely. Please correct me if I misunderstood. If they are unexposed, then it doesn't make much sense to keep them around wasting space. So yes, the compiler is free to optimize away the unused code at that point. Please see the first part of the following article where effective kernel size reduction is is achieved with this feature: https://lwn.net/Articles/746780/ Nicolas