From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by sourceware.org (Postfix) with ESMTPS id 5A1CC3858429 for ; Tue, 14 Dec 2021 19:24:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5A1CC3858429 Received: by mail-pj1-x1034.google.com with SMTP id gj24so1260236pjb.0 for ; Tue, 14 Dec 2021 11:24:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=fqt+7XzmN+k8szxPwDHn4w38aAUDdkgPw/CXPBBojD0=; b=qgktlLZ7BPwrFz0gfZnh2srX8RdAQ0mBUTz39wPPPjCzEu9D369NotxpsXOCSdjRsG 7WpRwdbiyM/XeO2/laAovIG7c63nxV3l5S0Nrs1ZByv5l9LrhSvxt8nRRljtNlOFyPU3 IZSlC/H1vM4X3sKR2aXGY3BFbQ0FmaaHc6S731wfEaO+YViBRIltzeIpoGSMjcM+uGz3 SrILnjBgaq+TEGqoNTmqBvoDSQEvh5PvROdQZXMzcGSbhPvz6nCGNVDna91eRU0SDzw6 r3yVmImX5Vqy/oPMcNnsHAuIqY/BDDMhs33NA75ixApjbQ4gyQ4k7sjXV0siztZaGuKI XkvQ== X-Gm-Message-State: AOAM530g0JIUfe3NPrSRlWlbLc/1tgrIcYGwWfzD2JUFXjR2oEdVaZYN aWC3xcdQsTWMBhdqrnGLhGwTYg== X-Google-Smtp-Source: ABdhPJzIDh0Viu8FlBRREMTcKlaqLI2ljx4aA8SuKuRBjxvav4Y7lh6Jy0gVu+h5CYteyzv8z8weDw== X-Received: by 2002:a17:902:b581:b0:144:e601:de7 with SMTP id a1-20020a170902b58100b00144e6010de7mr7401891pls.71.1639509856196; Tue, 14 Dec 2021 11:24:16 -0800 (PST) Received: from google.com ([2620:15c:2ce:200:57f1:1c61:8d1d:88f5]) by smtp.gmail.com with ESMTPSA id pc1sm3883774pjb.5.2021.12.14.11.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Dec 2021 11:24:15 -0800 (PST) Date: Tue, 14 Dec 2021 11:24:11 -0800 From: Fangrui Song To: Adhemerval Zanella Cc: Florian Weimer , GNU C Library Subject: Re: [PATCH] elf: Add elf checks for main executable Message-ID: <20211214192411.qfwmv576757n4ciz@google.com> References: <873a6969-8c06-5233-2b4c-48360e120f07@linaro.org> <877dchlbb8.fsf@oldenburg.str.redhat.com> <6386c389-086d-e123-d4d6-a97777f207ed@linaro.org> <87czm8quz3.fsf@oldenburg.str.redhat.com> <871r2nmmaf.fsf@oldenburg.str.redhat.com> <20211214001742.lbleuljd2dgmfinx@google.com> <87sfuvsgll.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-19.3 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, FSL_HELO_FAKE, KAM_INFOUSMEBIZ, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=no 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: Tue, 14 Dec 2021 19:24:19 -0000 On 2021-12-14, Adhemerval Zanella wrote: > > >On 14/12/2021 06:03, Florian Weimer wrote: >> * Fāng-ruì Sòng: >> >>> If the question is: "if upstream glibc implements the diagnostic, will >>> ChromeOS port the patch to their glibc". My reply is non-authoritative, >>> but if this has not been a problem for more than 3 years now, I do know >>> see large value backporting the feature to their older glibc release. >> >> But if you don't backport, you can teach your toolchain to start >> producing binaries that fail to load on older glibc. You will have to >> keep creating binaries that lack proper markup. >> >> My concern is that we go through all this trouble to implement a version >> proper handshake, and yet Google binaries will still crash on older >> glibc. > >Is ChromeOS glibc really binary compatible with glibc from other general >Linux distributions? Different from google/grte branches, ChromeOS seems >to work by patching upstream glibc and my impression is they not really care >nor aim to be (Fāng-ruì remarks also strength this idea). Not binary compatible, like two very different Linux distributions (e.g. a musl one vs a glibc one; a pure llvm-project toolchain based one vs a traditional GNU toolchain based one). >In any case, ChromeOS's DT_RELR use does show that it is de facto a different >ABI, it is only unfortunate that its ELF ABI does not give us any standard >marking to advertise so (and we will need to resort on some hacking such as >scanning for some symbol or versioning to to do). > >I am not sure if we should really care to handle such situations, it would >be nice if we can coordinate with ChromeOS to get it align its ABI with >mainstream and sort DT_RELR but I think *now* it is not a requisite and I >think we should move DT_RELR support independently. Like every glibc Linux distribution carrying some glibc patches which may decrease binary compatibility with other glibc Linux distributions, ChromeOS carries some patches like RELR, Disable-float128, and add-clang-style-FORTIFY patches. (I've heard about complaints about the latter two patches, they are Clang oriented and will likely benefit glibc-build-with-clang gets more love: https://maskray.me/blog/2021-10-10-when-can-glibc-be-built-with-clang) If you'd like to discuss with them to minimize ABI differences, they will be happy to have a better communication with the upstream (and, the software repository and code review website are all open). Different Linux distributions have different priorities and focus. For RELR, my suggestion is: * add the DT_RELR patch without lockout to glibc 2.35 * if some distributions are really fond of "time travel compatibility", develop the lockout mechanism (in 2.36 or 2.37) * add GNU ld support * After a long time, add a know to GCC to pass the glibc oriented option to ld * I'll likely not add a lackout mechanism to ld.lld --pack-dyn-relocs. * After many years, make GCC default to the RELR linker option.