From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) by sourceware.org (Postfix) with ESMTPS id B903C3858C2A for ; Thu, 21 Dec 2023 15:12:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B903C3858C2A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B903C3858C2A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1133 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703171524; cv=none; b=Y1ZwLgArRsEuYGsQIvGJQdSaLnL3DaLZbrW3YDEZ9CRH+dvgEyoCrgMkcmBk0Daxv9V+fQnT4JlJRHNa872ewWWV0sYnc4LEuuaasdiiRQznnyJrNDFwr/GSBI3kvpfqSg/LwEA7mZoFKBsq1OhaUVpVkNuSsYXlxugd5y8MFIs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703171524; c=relaxed/simple; bh=aytIeU0l5wuZWq3aqpuiWfdbhNYsDE8+GckKPM/pGwg=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=ZT57RwxYXCX2tw2h4EX0jlp9lQwwB3foyLqWkrbA1YcV0gnM9GFKsObT7qOKwAiL66d7XLA0Li5YV/UUItmhHhabqNRF3BZHtQ6qlfd1eP9XA5CmT34IV0JLEYcTVpZH0k0CgU3AAhMDrI/b3Fi4/D7vIZH1XRfE5YGPkZ7Mzx4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-5e3338663b2so8938377b3.2 for ; Thu, 21 Dec 2023 07:12:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703171522; x=1703776322; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wzs9OAuwxUvEPTigRia90BlfWzIi/thOhwBBfOpqN9I=; b=i2uUrH6B0XNPF8JoerIua6u+z+0zf8GTmcJLuL1Jrod0M5pAiCmicqdwXqFvBTX9XY lGEfd6HLtElt4ujkUry5Zn1YePREFNBkyfViEKlbvxvqs0/VbWSRdpk2ff1jqiu7zViZ L/YSp29CXsH9fQVyQRxvQExWqOHsJ0xksoHHAPj6PGpxjo92XaLvNxcT+c9gQT4NcHQk jKx1J4lRI2RFvxSf8cvuP+XOHNB+SKa7KjZTK58u9+AuLymaq00JWhWBisKOkSqqW25c ina4UhKZJZNTxXcN45gdUgq8oQkAs13ldHA1xB7xT/S/xal2f3TZfhbCO6PCzK7HY3q9 LjLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703171522; x=1703776322; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wzs9OAuwxUvEPTigRia90BlfWzIi/thOhwBBfOpqN9I=; b=D1WzWwTQ1xUoyNEK7yPSnzidgQmxKyaMKUrTrpVCsTUWMxzbYje86r6Yb6HNUZ91V4 v2tHkqz6n/pVCVCleBqV/AoltceQ6hbzu5qgqr/Eqk1l64YOYqINomLJDHOWfpmy++jQ sYrkRDCcQlLGWnpFyq3hAKJ6IPTlgA5lWjFIJi50vsiwgnVjjlvLv0B2pBYSBi+xZHq4 tqRIxWOWa+E+2qZLCD3sudxNN6lBpMutxsN5mDgTPfgchufbygroLOZ2PYHMRtMY8nqc i+S4I8t54BXRjn/rTeqr/XfOO8BGUMcX8klfWYw9YJ3Z1HDzfvPiRmf02EdbPIw58T7A o1yA== X-Gm-Message-State: AOJu0YzBrm+c3n97QNf7NKR24IWhvRbe017DPqcqFly4vM9/4/EbOgHX dsilPtzGDs3+bzj1oW5yS2FYK4d/LgbfgqF/f2w= X-Google-Smtp-Source: AGHT+IE3sfKjLpt/DgY1FZm9p3/gOXIvqy4/vgHO7VIC2vCto2IjSPHZs/1NHy7VRo99KGAiBLPPuH7/Vx77ZF8C2cU= X-Received: by 2002:a81:8ac6:0:b0:5d7:1941:aa4 with SMTP id a189-20020a818ac6000000b005d719410aa4mr1541324ywg.63.1703171522044; Thu, 21 Dec 2023 07:12:02 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "H.J. Lu" Date: Thu, 21 Dec 2023 07:11:25 -0800 Message-ID: Subject: Re: how to know host endianness in binutils To: Jan Beulich Cc: Binutils , Nick Clifton , Alan Modra Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3015.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Thu, Dec 21, 2023 at 6:31=E2=80=AFAM Jan Beulich wro= te: > > Hello, > > looking around, I can't seem to be able to find any standardized way of > knowing host endianness in binutils (in gas/ in particular). As was > pointed out to me, the new cpu_flags_from_attr() in config/tc-i386.c > won't work as is on big-endian hosts, yet I would really, really like > to avoid needing to enumerate all of the dozens of bitfields in that > function (converting one kind of bitfield to another). That's not the > least because this set constantly grows. > > I can see config/tc-bpf.c checking WORDS_BIGENDIAN, but I couldn't > convince myself (from looking at the generated config.h) that one can > really rely on that. > > Jan WORDS_BIGENDIAN is generated by AC_C_BIGENDIAN. It should be correct. --=20 H.J.