From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by sourceware.org (Postfix) with ESMTPS id F0E673857C59 for ; Mon, 28 Sep 2020 11:35:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F0E673857C59 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wm1-f65.google.com with SMTP id d4so734334wmd.5 for ; Mon, 28 Sep 2020 04:35:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7JMzcpb/YDZM6Hh/yx7MUiwKUuHDrXYLcKAgFU1bEVY=; b=mM30ZC+K5ehDYAUAT2mOzq8Q92qawpbkqb1YJOqxVwsiLPEtUBqZs7TnyMwSiMs/lB aQ3V8g6a4y3xuufgCD+oOPjmNbCCnvK/hccBbPeNb4Ka8AehmhC6FaoS7J+Fc4SeXqZK oQFTU0nmVC9vxsjJZJE3MiBPxC0EfaSyH+vkQDnmg5FVBsTUlUF4eu2/2uyelOF8E7Sw 6hdugDk6F0TtM4C0taS/WcJ69kPjqyncJZshmJ5pvtct17axZDsLbXWibCsZOhmlKy9k a9c25JHyn/7Or2EFYxCKfePwGpm6pyM1NHpvL7r573BehnOqFtjqBC9rd+wtOMdU/DE6 8v4A== X-Gm-Message-State: AOAM533cmm81wFVpM2a0rg/4h+6jIenUFOxXskSDa8AMX2GRCF7tB/ks o6YQiVJ3kbvzG8UFLQFkBPMASjNha0zXiA== X-Google-Smtp-Source: ABdhPJzMBL7jRR6F9ClOv2Ow5hnOuYj/gkobVnfTUs253srJus+D38Loy2hOAuj1n6ToSm+91zC+Ww== X-Received: by 2002:a7b:cb97:: with SMTP id m23mr1113196wmi.173.1601292930931; Mon, 28 Sep 2020 04:35:30 -0700 (PDT) Received: from ?IPv6:2001:8a0:f905:5600:eefd:c63:53e0:3e8a? ([2001:8a0:f905:5600:eefd:c63:53e0:3e8a]) by smtp.gmail.com with ESMTPSA id u66sm889197wmg.44.2020.09.28.04.35.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Sep 2020 04:35:29 -0700 (PDT) Subject: Re: [PATCH] Support SHF_GNU_RETAIN ELF section flag To: binutils@sourceware.org References: <20200922202933.kgflmtnwzkdrmrvs@jozef-acer-manjaro> From: Pedro Alves Message-ID: Date: Mon, 28 Sep 2020 12:35:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20200922202933.kgflmtnwzkdrmrvs@jozef-acer-manjaro> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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: Mon, 28 Sep 2020 11:35:35 -0000 On 9/22/20 9:29 PM, Jozef Lawrynowicz wrote: > > The overall intention for this new flag is to enable a new "retain" > attribute to be applied to declarations of functions and data in the > source code. This attribute can be used to ensure the definition > associated with the declaration is present in the linked output file, > even if linker garbage collection would normally remove the containing > section because it is unused. On a high level, this sounds pretty much like __attribute__((used)). Couldn't the new section flag be wired to that attribute? I mean, isn't it a bug if linker garbage collection eliminates a function marked with __attribute__((used)) ? "used This attribute, attached to a function, means that code must be emitted for the function even if it appears that the function is not referenced." I was surprised to not see any mention of the "used" attribute in the proposal, neither here, nor in gABI mailing list discussion linked. But maybe I missed it. Pedro Alves