From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) by sourceware.org (Postfix) with ESMTPS id 1AF493857027 for ; Fri, 2 Oct 2020 12:33:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1AF493857027 Received: by mail-ot1-x344.google.com with SMTP id 60so1181363otw.3 for ; Fri, 02 Oct 2020 05:33:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=ouNakpH7+/PEnR+YOIMz+b3kzyxVK6Nhc/t+sMubhqY=; b=OJrsKr15ViZYi4rG7Zge5mx4It8cyWwGFVkHZ7kSe5GkMhYvpunLtttu+ParpxS9pu eUsiXiu07O6KImwI/ij9baadn6SMjsNf7RXSsac6WtfHAWJfV8J+Liishnss6Wxa4dun tkla1DEwUpeqQUfWz0aWTpJYHX/uf/lwq0VwS/UG11tHNLNhvFi+FbcRPtCipyTGPq45 RBSx54l21sEIN5sh72hCC1T1vK02cAV8FULsmrAveBUZ6GbUmcb/PqV+8fJgTmRddSJC SEdBgva9jGPxhZXFLmE75L2StEeJOjTjmbPL5N4snM9AXIN41/ixpNHDrprjL0tdhjSc jItA== X-Gm-Message-State: AOAM531RJ0BF1kpqYlqKE+KYGygOGOGwb8DG+6ntENoXqM2uBpZrAKxN msdM85B609usKwQV9bjK71ngNWSnrg0N2V72OSY987Pv X-Google-Smtp-Source: ABdhPJxW74t64yYam5P2ji4LYrecLDdKypR9XM/b1V0yiYeqc6kGizaCI8vR4QxPu/Do19UDsCHprDw2Qgng4DjjQ5Y= X-Received: by 2002:a9d:6498:: with SMTP id g24mr1557137otl.179.1601642026557; Fri, 02 Oct 2020 05:33:46 -0700 (PDT) MIME-Version: 1.0 References: <20200928132613.btkqaoomv4fdnupn@jozef-acer-manjaro> <20201001105033.4eniyhry5o6epu4x@jozef-acer-manjaro> <20201001113907.GK15011@bubble.grove.modra.org> <20201002123023.xr7fnqmuuq6xd7xh@jozef-acer-manjaro> In-Reply-To: <20201002123023.xr7fnqmuuq6xd7xh@jozef-acer-manjaro> From: "H.J. Lu" Date: Fri, 2 Oct 2020 05:33:09 -0700 Message-ID: Subject: Re: [PATCH v2] Support for SHF_GNU_RETAIN ELF Section Flag To: Alan Modra , "H.J. Lu" , Binutils Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3030.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 12:33:48 -0000 On Fri, Oct 2, 2020 at 5:30 AM Jozef Lawrynowicz wrote: > > On Thu, Oct 01, 2020 at 09:09:07PM +0930, Alan Modra via Binutils wrote: > > On Thu, Oct 01, 2020 at 11:50:33AM +0100, Jozef Lawrynowicz wrote: > > > --- a/bfd/elflink.c > > > +++ b/bfd/elflink.c > > > @@ -14102,7 +14102,8 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) > > > || (elf_section_data (o)->this_hdr.sh_type > > > == SHT_FINI_ARRAY))) > > > || (elf_section_data (o)->this_hdr.sh_type == SHT_NOTE > > > - && elf_next_in_group (o) == NULL ))) > > > + && elf_next_in_group (o) == NULL) > > > + || (elf_section_flags (o) & SHF_GNU_RETAIN))) > > > > Flag bits in SHF_MASKOS depend on OS, so this needs a test of OSABI. > > That can be done by checking elf_tdata (sub)->has_gnu_osabi for the > > appropriate bit. > > > > Fixed the two OSABI issues in the attached patch. > Please rebase since this part has been changed on master branch. -- H.J.