From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by sourceware.org (Postfix) with ESMTPS id B30743857C49 for ; Fri, 2 Oct 2020 12:30:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B30743857C49 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mittosystems.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jozef.l@mittosystems.com Received: by mail-wr1-x444.google.com with SMTP id j2so1631508wrx.7 for ; Fri, 02 Oct 2020 05:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mittosystems.com; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=GkYJCE9YnoejzBbsmp654iiOdynyhxKySNTi4Ax2rsA=; b=UUzr7sSDX5dV7vcGL89lxcg6k0z4FnHip3kiQmyoj4jgoTAE5VuuS9kP4RBTZMLzCi lpIaFKhWHym0Sni07/R/kQXYbeuXY2ZsS7V6Sj+ZPvWyVIVA7zhFTnUD236nPu7Zesth spljD/oItYASlC/I5WPJhNJCr6cLQ3be8o2NameM9DzNVt0tJi4soNrbIW5l5UVnlZvP c+21UHNJiv45HOEbu8BJnvBkDT4/BXwepRzGsWrx18ulCLtyMgGmfpvBXytgP8RACGYY /Wtd7Cc7o0VIalUzrl06ifrNHew0/bDV9grmG99HptXY6vD6kQVrW2X+Jn42X6NIRthM gT/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=GkYJCE9YnoejzBbsmp654iiOdynyhxKySNTi4Ax2rsA=; b=JQjyBHei6rVQl4MGMbmJKqojQ56l5JGQRJjgo51axiQ5/7z6ZW4oKU3sUPkTX0s45M RuXXHxflOqfoBlCXt/gKJqfK40mSYHnYLHPjcgZyveLIy8mrHyzk2lCNNmUtMsO5xxQB WsqeGtZauMHER4/vF6xqWR5+CB9eWmdmDWkjVR7WJi/j6PIluhFwyuI6Y9vdblQFB9Ux fYyzAVUUe+uRPdkRSrh/jjxlRSLZBz4IfcF+c5c/qH3hrVqgrkEVy5GwtQEJ218BCMyb MW/uzqfZi23oAYhC5pcng9cDAi8qv7llnVk0Tkfrt1dQDXkoUVMCE+oy81/lsPpCdyZ1 dAAA== X-Gm-Message-State: AOAM533bMt/qM8Ed88JJJ6f0fny/cuKCHZnKmuxYhQUtjfRoGHzT8+HF Dm2VZe6Qvczk1GV4edANDOYSgA== X-Google-Smtp-Source: ABdhPJxJ8/LGJ4VELLzrYQkqTRvRtXWX5uaWDi4nhBMQ3zh4YS4g0Zp7m4ts+VOwooZq0XOSGBt8OQ== X-Received: by 2002:adf:ef48:: with SMTP id c8mr2832108wrp.370.1601641825751; Fri, 02 Oct 2020 05:30:25 -0700 (PDT) Received: from jozef-acer-manjaro ([2a01:4b00:87fd:900:5e1d:5c99:56da:76e8]) by smtp.gmail.com with ESMTPSA id w15sm1606559wro.46.2020.10.02.05.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 05:30:24 -0700 (PDT) Date: Fri, 2 Oct 2020 13:30:23 +0100 From: Jozef Lawrynowicz To: Alan Modra Cc: "H.J. Lu" , Binutils Subject: Re: [PATCH v2] Support for SHF_GNU_RETAIN ELF Section Flag Message-ID: <20201002123023.xr7fnqmuuq6xd7xh@jozef-acer-manjaro> Mail-Followup-To: Alan Modra , "H.J. Lu" , Binutils References: <20200928132613.btkqaoomv4fdnupn@jozef-acer-manjaro> <20201001105033.4eniyhry5o6epu4x@jozef-acer-manjaro> <20201001113907.GK15011@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="x5kwsqoatppa7sfl" Content-Disposition: inline In-Reply-To: <20201001113907.GK15011@bubble.grove.modra.org> X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, 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:30:31 -0000 --x5kwsqoatppa7sfl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. I also added handling of numeric flag values in the SHF_MASKOS range for the .section directive for some OSABIs. There are new GAS tests to test this behavior for targets that either do or do not support the GNU OSABI. > > { > > if (!_bfd_elf_gc_mark (info, o, gc_mark_hook)) > > return FALSE; > > diff --git a/binutils/NEWS b/binutils/NEWS > > index c0dc73d7d8..6c7d3f3953 100644 > > --- a/binutils/NEWS > > +++ b/binutils/NEWS > > @@ -4,6 +4,10 @@ > > symbol names. In addition the --demangle=