From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30CAAC433E0 for ; Wed, 27 Jan 2021 12:42:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E152F207B0 for ; Wed, 27 Jan 2021 12:42:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343674AbhA0Mmj (ORCPT ); Wed, 27 Jan 2021 07:42:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:50272 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343695AbhA0Mkf (ORCPT ); Wed, 27 Jan 2021 07:40:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611751149; 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=FNuG7JoCfAH9Jm56wLn/gL9lO+Td4zBW5kowrH1kfJM=; b=Su117G4Olpfd0FwiV0JJeJI+1vLz54o1ugGhKCVCyWWBdWlk8wY5VwQYkWAUXaD+cgAGmp JBYJBfpYUaq8g1X/jXWG6rZDoBTR/Ip5kcjJQk04W5I/HWABYxwWsJ0kF3ZOFtmdubVOSN dr4LruZjHTE4L/u4m1rPnpRL0kbg0EQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-482-hInXWJ-1P1GHGlv-IPrlGg-1; Wed, 27 Jan 2021 07:39:07 -0500 X-MC-Unique: hInXWJ-1P1GHGlv-IPrlGg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A1A5510054FF; Wed, 27 Jan 2021 12:39:05 +0000 (UTC) Received: from [10.10.112.133] (ovpn-112-133.rdu2.redhat.com [10.10.112.133]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4814C27C23; Wed, 27 Jan 2021 12:38:57 +0000 (UTC) Subject: Re: [PATCHv4 0/2] libbpf: Add support to use optional extended section index table To: Jiri Olsa , Arnaldo Carvalho de Melo , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: dwarves@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Yonghong Song , Hao Luo , Martin KaFai Lau , Song Liu , John Fastabend , KP Singh , Mark Wielaard References: <20210124221519.219750-1-jolsa@kernel.org> From: Joe Lawrence Message-ID: Date: Wed, 27 Jan 2021 07:38:56 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20210124221519.219750-1-jolsa@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On 1/24/21 5:15 PM, Jiri Olsa wrote: > hi, > kpatch guys hit an issue with pahole over their vmlinux, which > contains many (over 100000) sections, pahole crashes. > > With so many sections, ELF is using extended section index table, > which is used to hold values for some of the indexes and extra > code is needed to retrieve them. > > This patchset adds the support for pahole to properly read string > table index and symbol's section index, which are used in btf_encoder. > > This patchset also adds support for libbpf to properly parse .BTF > section on such object. > > This patchset is based on previously posted fix [1]. > > v4 changes: > - use size_t instead of Elf32_Word [Andrii] > - move elf_symtab__for_each_symbol_index and elf_sym__get > elf_symtab.h [Andrii] > - added ack for patch 1 [Andrii] > - changed elf_sym__get to be simpler [Andrii] > - changed elf_symtab__for_each_symbol_index to skip bad symbols > - use zalloc for struct elf_symtab allocation to get zero > initialized members > > v3 changes: > - directly bail out for !str in elf_section_by_name [Andrii] > - use symbol index in collect_function [Andrii] > - use symbol index in collect_percpu_var > - change elf_symtab__for_each_symbol_index, move elf_sym__get > to for's condition part > - libbpf patch got merged > > v2 changes: > - many variables renames [Andrii] > - use elf_getshdrstrndx() unconditionally [Andrii] > - add elf_symtab__for_each_symbol_index macro [Andrii] > - add more comments [Andrii] > - verify that extended symtab section type is SHT_SYMTAB_SHNDX [Andrii] > - fix Joe's crash in dwarves build, wrong sym.st_shndx assignment > > thanks, > jirka > > > [1] https://lore.kernel.org/bpf/20210113102509.1338601-1-jolsa@kernel.org/ > --- > Jiri Olsa (2): > elf_symtab: Add support for SHN_XINDEX index to elf_section_by_name > bpf_encoder: Translate SHN_XINDEX in symbol's st_shndx values > > btf_encoder.c | 33 +++++++++++++++++---------------- > dutil.c | 8 +++++++- > elf_symtab.c | 41 +++++++++++++++++++++++++++++++++++++++-- > elf_symtab.h | 29 +++++++++++++++++++++++++++++ > 4 files changed, 92 insertions(+), 19 deletions(-) > For v4 patchset: Tested-by: Joe Lawrence Thanks Jiri! -- Joe