From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 20273385840C for ; Sun, 25 Sep 2022 09:22:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 20273385840C Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1664097744; bh=HVGzDBdQzhDBKmDVTSswOKwCN8Pb2dlffbo3AqlTA/Q=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=itp5DBOiOrHul0msdD4wREI+LwOUWDQiw/Q+nTKMu5o6dDG53dd5YobpdAqylDmkq DaZjCrBljP/2VtE79RaBQUA5/f+AXXAeXW/iLNyop0iWqAScAHq/mpDDbLkR9hToaK Y191p6qFvUxrYvTDhi5dMKt4SeE2XvqG9q6p2/aE= Received: from localhost.localdomain (xry111.site [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 5D47966772; Sun, 25 Sep 2022 05:22:23 -0400 (EDT) Message-ID: <68121ec1509922e881246ebbfda15e1eadb9958a.camel@xry111.site> Subject: Re: [PATCH v2] LoongArch: Set e_flags to 0x40 of ELF while using new relocations. From: Xi Ruoyao To: WANG Xuerui , liuzhensong , binutils@sourceware.org Cc: maskray@google.com, mengqinggang@loongson.cn Date: Sun, 25 Sep 2022 17:22:21 +0800 In-Reply-To: <83e9a5ac-c509-066b-07f6-cb3ec4583e48@xen0n.name> References: <20220921011756.451005-1-liuzhensong@loongson.cn> <83e9a5ac-c509-066b-07f6-cb3ec4583e48@xen0n.name> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD,LIKELY_SPAM_FROM,SPF_HELO_PASS,SPF_PASS,TXREP,T_PDS_OTHER_BAD_TLD autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sun, 2022-09-25 at 16:28 +0800, WANG Xuerui wrote: > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (elf_elfheader (ou= tput_bfd)->e_ident[EI_CLASS] =3D=3D ELFCLASS32) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 inte= rpreter =3D "/lib32/ld.so.1"; > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else if (EF_LOONGARCH= _IS_LP64 (flags)) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else if (elf_elfheade= r (output_bfd)->e_ident[EI_CLASS] =3D=3D ELFCLASS64) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 inte= rpreter =3D "/lib64/ld.so.1"; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 inte= rpreter =3D "/lib/ld.so.1"; > > + > Wait what, are we still carrying the old-world defaults for the=20 > interpreter path here? I know it's harmless because in fact it gets=20 > overridden by gcc and glibc, but I'd suggest fixing it in a separate=20 > patch later for consistency. It seems not easy to make a "correct" default... /lib64/ld-linux- loongarch-lp64d.so.1 will be incorrect for a musl-based target. Maybe we can assume Glibc is used because we are the *GNU* linker anyway... /* snip */ > I'd bikeshed a little and suggest "EF_LOONGARCH_OBJABI_foo" because > it's actually "ELF object file ABI v1" and not "ELF ABI object v1". In the doc we say "the ABI version of an ELF object", IMO it's a little misleading (can trick people to believe it could be used to distinguish old and new world). From Wikipedia: In computer software, an application binary interface (ABI) is an interface between two binary program modules. =20 I'm not sure if the (non-dynamic) relocation types belongs to the concept of ABI: the linker treats relocatable object files as an input (like how "vim" treats a text file), instead of a program module. But I can't come up with a better terminology for now... --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University