From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64929 invoked by alias); 21 Jun 2018 18:58:57 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 64914 invoked by uid 89); 21 Jun 2018 18:58:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.4 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=packaged, BTW, H*Ad:U*ast, perfect X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Jun 2018 18:58:55 +0000 Received: from librem.wildebeest.org (deer0x15.wildebeest.org [172.31.17.151]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 319D63000D19; Thu, 21 Jun 2018 20:58:53 +0200 (CEST) Received: by librem.wildebeest.org (Postfix, from userid 1000) id F0337141E5D; Thu, 21 Jun 2018 20:58:52 +0200 (CEST) Date: Thu, 21 Jun 2018 18:58:00 -0000 From: Mark Wielaard To: Yonghong Song Cc: elfutils-devel@sourceware.org, ast@fb.com, kafai@fb.com Subject: Re: [PATCH v2] backends,bpf: add proper relocation support Message-ID: <20180621185852.GB30961@wildebeest.org> References: <20180616200243.1389518-1-yhs@fb.com> <1529494894.12946.134.camel@klomp.org> <6ea2640a-fd92-82b9-0041-0d74bfff17c3@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6ea2640a-fd92-82b9-0041-0d74bfff17c3@fb.com> User-Agent: Mutt/1.9.5 (2018-04-13) X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2018-q2/txt/msg00252.txt.bz2 On Wed, Jun 20, 2018 at 07:18:22AM -0700, Yonghong Song wrote: > On 6/20/18 4:41 AM, Mark Wielaard wrote: > > The patch looks perfect. And the new testcase is good. I used the > > testfile to quickly test eu-readelf --debug-dump also got the > > relocations right, and it did of course. > > > > Just waiting for the glibc elf.h update/sync and then I'll push this to > > master. > > This looks perfect. Thanks! Pushed both. Thanks for the patch and testcase. BTW. The following now also just works in case you have tools that cannot handle the BPF relocations, but can handle separate .debug files: eu-strip --reloc-debug-sections -f testfile-bpf-reloc.o.debug \ testfile-bpf-reloc.o That puts the debuginfo with all (simple) relocations resolved into the .debug file. --reloc-debug-sections Resolve all trivial relocations between debug sections if the removed sections are placed in a debug file (only relevant for ET_REL files, operation is not reversable, needs -f) This is used by some distros for the kernel .ko modules (which are also ET_REL files) to safe space. But also might be applicable to these BPF elf files in case they are packaged. Cheers, Mark