From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x931.google.com (mail-ua1-x931.google.com [IPv6:2607:f8b0:4864:20::931]) by sourceware.org (Postfix) with ESMTPS id 139BD3858426 for ; Mon, 6 Dec 2021 21:07:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 139BD3858426 Received: by mail-ua1-x931.google.com with SMTP id n6so22450191uak.1 for ; Mon, 06 Dec 2021 13:07:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=2yTe2ifLljg5u+04jbAc9mge5AApAd6vaJQSQhoMdo8=; b=SwPu+uo1Ol155r8a1ZX6Z/BdGdRmXH89o+9G5XPs+5gl2dJODR9/mGE6f924x4zZR5 EKhe/sSvpz5UncFQreZsOSiUDeAGQUf9lWtKe7fkwIXCKe5ISIQLJf/anFNqOFPkclzT w28fmYND7HouPfJZFfEZL9JRQrngXyqCHWx3YatupjcH1J84PtrxUfMKnFFYyrlK/RPU NMmOC6RyR6nSR6PVu/ivlNAtuVGLx9YUZasX+KpBP/A4pxM971KAzrp35gHiDE/bFson 7wJiGuQhP64G3b5cKxojCrbuMGYyJxMIVOceea47TCkfDR21XN9z/59kW3uK0f8tYXYT nsWw== X-Gm-Message-State: AOAM532gBu7EQdP25CeM9jwbNnKVHqVJ4dIC/Jt7Bhlz2rexJaYctdz3 fh4oJsCr4kpJTpGnWnsiOlo9UzZCOWjitA== X-Google-Smtp-Source: ABdhPJy8zQPtU0/jgJSQsgFHEdQI/bMB3Yah1WIPT7587iKUsCPH0WbgW+6BQIkysiniyNfNSWFN1A== X-Received: by 2002:ab0:698c:: with SMTP id t12mr43061610uaq.142.1638824828565; Mon, 06 Dec 2021 13:07:08 -0800 (PST) Received: from ?IPV6:2804:431:c7cb:30f8:a284:bef4:40ef:e94d? ([2804:431:c7cb:30f8:a284:bef4:40ef:e94d]) by smtp.gmail.com with ESMTPSA id y7sm5040343uad.2.2021.12.06.13.07.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Dec 2021 13:07:08 -0800 (PST) Message-ID: <6386c389-086d-e123-d4d6-a97777f207ed@linaro.org> Date: Mon, 6 Dec 2021 18:07:06 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH] elf: Add elf checks for main executable Content-Language: en-US To: Florian Weimer Cc: "H.J. Lu" , GNU C Library References: <20211119150329.2200675-1-adhemerval.zanella@linaro.org> <87bl1tmtxz.fsf@oldenburg.str.redhat.com> <873a6969-8c06-5233-2b4c-48360e120f07@linaro.org> <877dchlbb8.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella In-Reply-To: <877dchlbb8.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2021 21:07:11 -0000 On 06/12/2021 17:37, Florian Weimer wrote: > * Adhemerval Zanella: > >> On 06/12/2021 16:22, H.J. Lu wrote: >>> On Mon, Dec 6, 2021 at 11:09 AM Florian Weimer wrote: >>>> >>>> * Adhemerval Zanella: >>>> >>>>> +static void >>>>> +modify_abiversion (ElfW(Ehdr) *ehdr) >>>>> +{ >>>>> + ehdr->e_ident[EI_ABIVERSION] = LIBC_ABI_MAX; >>>>> +} >>>> >>>> So this is eventually controlled by the libc-abis file, right? >>>> >>>> I *thought* that the consensus was that binutils should bump version if >>>> absolute symbols are used. But I don't see that in the absolute symbol >>>> tests. >>>> >>>> Is this really doing anything? >>>> >>> >>> EI_ABIVERSION check works on executables created by the new linker >>> which bumps EI_ABIVERSION. This complements the existing >>> EI_ABIVERSION check on DSOs. This is orthogonal to the ABI version >>> check for existing ld.so binaries which needs an ABIVERSION version. >>> >> >> Currently only mips does actually set and checks different EI_ABIVERSION >> through VALID_ELF_ABIVERSION. For instance, -Wl,--hash-style=gnu with >> mips64 will set EI_ABIVERSION to 5. > > What surprised me is that binutils does not seem to *generate* the bump > for ABSOLUTE. Not so much the lack of checking in glibc. It does, but only for specific configurations. bintutils does have a testcase for it, pr21375*, but not all configurations does bump because they do not require ABS relocations (for instance, for n64 -mmicromips --defsym hidn=1 does set the ABI version to 4).