From patchwork Sun Sep 20 05:01:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Ambardar X-Patchwork-Id: 1367779 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=RtxpiOKS; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BvFmf4R3nz9sRR for ; Sun, 20 Sep 2020 15:02:10 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726944AbgITFCJ (ORCPT ); Sun, 20 Sep 2020 01:02:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726760AbgITFCI (ORCPT ); Sun, 20 Sep 2020 01:02:08 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64946C061755; Sat, 19 Sep 2020 22:02:08 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id b17so5219723pji.1; Sat, 19 Sep 2020 22:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VVuA7I40ahfUSFUhF/rh76ojr9Knrl+A3vaZY0vD+mA=; b=RtxpiOKSLr1NSy3ffy2+RruORNC2xkcNG3fz5n9HxaLj0Mb5ih7x7TRziM1EYyPuPZ yp1pNewgL99sSf5PDa4dNpIjnheAYLpa8F9xRnYmYyCU2efLXSTZpCqX74mxjkOeCXnZ HQCdSWp/Am3SK5EoIA1LlEoVK7ofClZp4NgofTRYy52JlLTE6534vX+hi5WH45Lc4QBs Hqfezf9TzgX0GIskuG72ouM08jtsw2UsydZz3mXrcQwT3kN/IB6CKWIm+k6LDuz2XMUQ O1GYJa9vZTK/gEp4QHl/PUIj7UCpWY2vNlR+x9t8wqOlxo6utGKyqRMu++KGsq2iiymn or/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VVuA7I40ahfUSFUhF/rh76ojr9Knrl+A3vaZY0vD+mA=; b=FNyx5UmJlG1yIStSjF+ddgilmlOibtveNbtETn70ZhK42o5DPE3qqsINYT39HPTM4b rD2xrYaLVolkA42D/yKqRj6/NmR2eFCLg9WHV2RiTfyzIYy8dXFiAOa3tWUnPWInwXZi cTUxHsByxH7d2uZ43VQKR/a8Tc3OlfIHnBGVHtnPqoT1QAIEPISCn+N0jSjzctwseMky +VcXe2AqqdSKUFz5zKzusru+2aZ53qnhjhwR9VqZTGzXiV5KXNV2r+w7nbufqI20Qv25 rmQzCKlvF3OY6uRvd6H96G5WPQ86hQyLLjpPAXqnEVneB7yvGmFaEGt1tR65VdGIF49j jyqg== X-Gm-Message-State: AOAM532/MXJqX7JiEvWNIz3WMn+MyBk15TGL7DyJEbrByd2193BkQuBU l9IEBZUhgTEJ99AXbXlNhBA= X-Google-Smtp-Source: ABdhPJw5qgPMIAPvD2E0wCa/1tGvhtBbZnlZsoCPVIAeOynYj3mgr10coUuwlKAJsvf7M3syWO2i3w== X-Received: by 2002:a17:90a:ab8f:: with SMTP id n15mr19257434pjq.139.1600578128006; Sat, 19 Sep 2020 22:02:08 -0700 (PDT) Received: from localhost.localdomain ([2001:470:e92d:10:d88d:3b4f:9cac:cf18]) by smtp.gmail.com with ESMTPSA id w19sm8432556pfq.60.2020.09.19.22.02.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 22:02:07 -0700 (PDT) From: Tony Ambardar X-Google-Original-From: Tony Ambardar To: Alexei Starovoitov , Daniel Borkmann Cc: Tony Ambardar , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-arch@vger.kernel.org, Arnd Bergmann Subject: [PATCH bpf v1 2/3] bpf: prevent .BTF section elimination Date: Sat, 19 Sep 2020 22:01:34 -0700 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Systems with memory or disk constraints often reduce the kernel footprint by configuring LD_DEAD_CODE_DATA_ELIMINATION. However, this can result in removal of any BTF information. Use the KEEP() macro to preserve the BTF data as done with other important sections, while still allowing for smaller kernels. Fixes: 90ceddcb4950 ("bpf: Support llvm-objcopy for vmlinux BTF") Signed-off-by: Tony Ambardar Acked-by: John Fastabend --- include/asm-generic/vmlinux.lds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 5430febd34be..7636bc71c71f 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -661,7 +661,7 @@ #define BTF \ .BTF : AT(ADDR(.BTF) - LOAD_OFFSET) { \ __start_BTF = .; \ - *(.BTF) \ + KEEP(*(.BTF)) \ __stop_BTF = .; \ } \ . = ALIGN(4); \