From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by sourceware.org (Postfix) with ESMTPS id 5023E384B061 for ; Wed, 23 Sep 2020 01:09:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5023E384B061 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=maskray.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=emacsray@gmail.com Received: by mail-pg1-f193.google.com with SMTP id u24so2511418pgi.1 for ; Tue, 22 Sep 2020 18:09:33 -0700 (PDT) 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:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZNbe04O3W0mv4EHH6lSPbP/hWl2eL1dVs8Lyx+EXm8s=; b=Sbxyy3lrnmqgJSfb0WQW/GjY6g7gASeXGuhsDyWU2aJ5ptEzwWCbjw76Zg6yl3XVAj LUqjx12yxS+usPRPr5yxnctsdwPC5WoKTYBMEOzQnaYt5TREW08UhCBd49KbURjwmRNK gOO2OlCIXsUB3Nxiq3uxZ5XlXmrWaja5OvevSbP4Aq/d6hZ4EaovfpGAxJZ3lwdzQeQe p/qLPlySa9eBKNHKUC2VN0Yq8SnxXn+BBlwHva0eTySioAxEwHGrcR/ZHI/0D4Yn9pd1 +QoyvF9wp3Uq+7vLh8CzV0z7y5TeXehw6LfMSxwHlHnHKKo8zOAhlhtQz/HZWeSk6XQq sqMA== X-Gm-Message-State: AOAM530WlHJbMHRowe/AC3Gqt8pbHS9AvFGYKcErKKolxNtpiD4APZHc jXHy+y4FbCKDlaYp0EGyPv6Om/ARCRdFow== X-Google-Smtp-Source: ABdhPJw+d6M2ATREomJ++7kvawAwSFMxXk5DUa0gHInRtDtQDFzKz0VTO5g1TEtLY19gIH5lIHjP3Q== X-Received: by 2002:aa7:8197:0:b029:142:2501:3981 with SMTP id g23-20020aa781970000b029014225013981mr6542012pfi.70.1600823372057; Tue, 22 Sep 2020 18:09:32 -0700 (PDT) Received: from localhost ([2601:647:4b01:ae80::51fb]) by smtp.gmail.com with ESMTPSA id u23sm5130306pgg.75.2020.09.22.18.09.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 18:09:31 -0700 (PDT) Date: Tue, 22 Sep 2020 18:09:30 -0700 From: Fangrui Song To: binutils@sourceware.org Subject: Re: [PATCH] Support SHF_GNU_RETAIN ELF section flag Message-ID: <20200923010930.xtc4mgmxsoesohkn@gmail.com> References: <20200922202933.kgflmtnwzkdrmrvs@jozef-acer-manjaro> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200922202933.kgflmtnwzkdrmrvs@jozef-acer-manjaro> X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_INFOUSMEBIZ, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no 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: Wed, 23 Sep 2020 01:09:35 -0000 On 2020-09-22, Jozef Lawrynowicz wrote: >The attached patch adds support for the new SHF_GNU_RETAIN ELF section >flag, which was discussed on the GNU gABI mailing list here: >https://sourceware.org/pipermail/gnu-gabi/2020q3/000429.html > >The flag is GNU-specific so uses a bit in the SHF_MASKOS mask. >Its precise definition is as follows: We already have a way to create an artificial reference: .reloc ., R_X86_64_NONE, target_symbol If we allow a relocation number for the second operand .reloc ., 0, target_symbol this will be generic. You can insert the directives in a GC root (e.g. _start or a symbol referenced by -u or maybe an .init_array)