From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56971 invoked by alias); 21 Jun 2018 15:29:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 56961 invoked by uid 89); 21 Jun 2018 15:29:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=publish, argue, checkin X-HELO: mail-io0-f193.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CucjkQcz0VcF3vo6Q7qGvlIq291XOA4PM22Hwb4mRbA=; b=amHNTjoAIRpxF9uGkVMvttnPXVW1Ftec5caXUqitSwaakp6blP8BdXDOVSgBNiAj+b 0AVComKhjIVoVHtmXFTgUerqNQCjY4VFzbhpIeFrt4t4tTF9IZdsdCdjE+Z+YzFhW8oj pk8ZDWDE0th3zE+YJkniKecj2xMt9ycT8sqqE/ZMVRRwFR9hVKIdgy3B9emD3QY7M6Fb bA8cCbHAfCZ0v82CEOMc3Cwm7AxY8BKD9vw6uKu6V7hGgQEXjNV1QlYrwC+RDqQhrMVN qc/wXNTIdKDCIG4v09FkzR+rkhi3iei48qwcrcYgyKBpOh+/jGNNW6pGd4SB4FHG0ZDI DV2A== X-Gm-Message-State: APt69E2s2uyxIMqEMJnvJ59IjDmg9AG9gqTLbQbgwEaN8CAwfmN4CFN+ tnUazhDBP2z6wTRHnlF3Sakp4A== X-Google-Smtp-Source: ADUXVKIoxfnvrZtHYtvLe0ctrlGe15KTpb+LG8uq1XXApBttI1ch6k3QIW6yduOmCFXkHI7Jps1pyA== X-Received: by 2002:a6b:1b90:: with SMTP id b138-v6mr20654732iob.48.1529594968266; Thu, 21 Jun 2018 08:29:28 -0700 (PDT) Subject: Re: [PATCH] elf.h: Add BPF relocation types. To: Mark Wielaard , libc-alpha@sourceware.org Cc: Yonghong Song , Richard Henderson References: <20180616214515.10737-1-mark@klomp.org> From: Carlos O'Donell Message-ID: Date: Thu, 21 Jun 2018 15:29:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180616214515.10737-1-mark@klomp.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-06/txt/msg00678.txt.bz2 On 06/16/2018 05:45 PM, Mark Wielaard wrote: > The BPF ELF format has new relocation types R_BPF_64_64 and R_BPF_64_32. > The existing R_BPF_MAP_FD was an extension that never got implemented. > Remove it, because its constant conflicts with the official R_BPF_64_64. > --- > ChangeLog | 5 +++++ > elf/elf.h | 3 ++- > 2 files changed, 7 insertions(+), 1 deletion(-) I trust you that R_BPF_MAP_FD was never implemented, but I consider it bad engineering to publish and then reuse a constant, even if you might argue the entire pseudo-architecture is "unstable." Having said that we should align the values here with the values being used by llvm and Facebook. They represent the most recent values being used for relocations in this pseudo-machine. Without an officially published ABI for these relocations we have no real way to review what is canonical and what is not. I don't see any objections from Florian Weimer (the other reviewer), just the same frowning face I have :/ at the lack of a proper engineering specification. OK to checkin. Reviewed-by: Carlos O'Donell > diff --git a/ChangeLog b/ChangeLog > index 9dd87eebb8..40175d254a 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,8 @@ > +2018-06-16 Mark Wielaard > + > + * elf/elf.h (R_BPF_MAP_FD): Removed. > + (R_BPF_64_64, R_BPF_64_32): New. > + > 2018-06-15 Samuel Thibault > > * include/sys/sendfile.h (__sendfile64): Declare hidden prototype. > diff --git a/elf/elf.h b/elf/elf.h > index a5b2811ce0..75043bcbf9 100644 > --- a/elf/elf.h > +++ b/elf/elf.h > @@ -3850,7 +3850,8 @@ enum > /* BPF specific declarations. */ > > #define R_BPF_NONE 0 /* No reloc */ > -#define R_BPF_MAP_FD 1 /* Map fd to pointer */ > +#define R_BPF_64_64 1 > +#define R_BPF_64_32 10 This matches what is in LLVM upstream (not the git mirror). Changed by this: commit db476dbf2ee03f8ebdacc439bdde1cf4f0ee629a Author: Alexei Starovoitov Date: Mon Nov 21 06:21:23 2016 +0000 [bpf] fix dwarf elf relocs and line numbers - teach RelocVisitor to recognize bpf relocations - fix AsmInfo->PointerSize to make sure dwarf is emitted correctly - add a test for the above Signed-off-by: Alexei Starovoitov git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287521 91177308-0d34-0410-b5e6-96231b3b80d8 > > /* Imagination Meta specific relocations. */ > >