From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70660 invoked by alias); 24 Feb 2020 06:38:57 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 70652 invoked by uid 89); 24 Feb 2020 06:38:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_INFOUSMEBIZ,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=transit, H*Ad:U*amodra, HTo:U*nickc, koji X-HELO: mail-pj1-f67.google.com Received: from mail-pj1-f67.google.com (HELO mail-pj1-f67.google.com) (209.85.216.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Feb 2020 06:38:55 +0000 Received: by mail-pj1-f67.google.com with SMTP id f2so3710450pjq.1 for ; Sun, 23 Feb 2020 22:38:55 -0800 (PST) Return-Path: Received: from localhost ([2601:647:4b01:ae80::51fb]) by smtp.gmail.com with ESMTPSA id b15sm11276788pft.58.2020.02.23.22.38.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Feb 2020 22:38:53 -0800 (PST) Date: Mon, 24 Feb 2020 06:38:00 -0000 From: Fangrui Song To: Nick Clifton Cc: Alan Modra , binutils@sourceware.org Subject: Re: RFC: Supporting multiple relocs per section Message-ID: <20200224063852.2seelvdhlvzhxw53@google.com> References: <877e0pmpew.fsf@redhat.com> <20200218002019.GD5570@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-SW-Source: 2020-02/txt/msg00525.txt.bz2 Hi Nick, On 2020-02-19, Nick Clifton wrote: >Hi Alan, > >>> As part of this process I also discovered that the BFD library would >>> unconditionally convert OS-specific and PROC-specific section indices >>> into SHN_ABS indices when writing out symbol tables, > >> That sounds like a bug that should be fixed for all ELF targets and >> not via a target hook. > >A good point - I will do that. > > > >>> [1] This is to support kernel live patch modules used by Fedora and RHEL >>> and possibly other distributions too. >> >> Can the need for multiple reloc sections be avoided? Or at least >> any processing on extra reloc sections? (I wanted to ask the same question...) >Not now. The scheme has been in place for a couple of years now, so >I think that it is too late to change it. >> The current support as such >> for multiple reloc sections in bfd is by treating any extra reloc >> sections as normal sections, ie. just a blob of data in the section. >> Or@least that is what is supposed to happen. > >I thought so too, but it turns out not to be so. The extra reloc >sections are dropped, rather than being preserved in transit from >input to output. > >> Hmm, I see your patch updates reloc symbols in the extra reloc >> sections. Am I correct in guessing that the underlying problem is >> that objcopy/strip renumber symbols? > >Yup. :-) > >> And I suppose there isn't any >> way to convince people not to objcopy/strip files with extra reloc >> sections? > >No. The actual issue came about because the kernel team are trying to >update their practices and rather than create and distribute these >live update modules by hand they are now trying to use the brew/koji >build systems. Which use objcopy and strip from the binutils. Which >corrupts the modules... > >> What about requiring those extra reloc sections only have >> relocs using a zero symbol index? > >No, they need specific symbol indicies in order for the relocations >to be applied by the kernel's live patcher... > >Cheers > Nick Where can we find more information about the kernel side implementation, if it is open?