From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by sourceware.org (Postfix) with ESMTPS id F25B93858C2F for ; Thu, 27 Jul 2023 19:04:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F25B93858C2F Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-51ff0e3d8c1so1693202a12.0 for ; Thu, 27 Jul 2023 12:04:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690484665; x=1691089465; 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=KdYHExWCRWzFcUv4bKPX4IN+FbYPd5t5IbNZi0QT7Ho=; b=MODhbTNmy/cY6/DA4XCcNx0v3qMxwZ2OzJIjyRz0cTyonNk5v1/TZfoGYt7V3g55BE smAcDxoIJkNAo6GbsjI0j6zDiFScHE6QkehXBF8FTbAKCchBDJTY1tUDwFGVmgC5Keuq p04I0aAxWtW1Sq1HDinZXCrfqq/5gmtaiCl7KHRdeVaDsSKVAJwTS3ew4FipmXhZO0rB ep+iAIKHDnlQbNfLuNgREohFRWnZZu32pG83shFNwFxC/Ntz8vdgJ87BJnvTqVN+mslY QWmk5EeWredPLiCnZBEVx10NTggMwlYIXn0Fof423GOcc9UDtbs8WWjsaLwrKcKleOlW k71Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690484665; x=1691089465; 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=KdYHExWCRWzFcUv4bKPX4IN+FbYPd5t5IbNZi0QT7Ho=; b=I1V8qrFGdnh3ZI+v+EbxiH384U9w7yMYxYmolew+Ij63bsKcoU7yhS24yX6f9gm2gY k/urkkrYsuZRh02Tu3I623thm+SQEo5wbxlADfW2nRU+XZqlqr8J46nRojCtZVHNNlAX m9utHDw9vDo4b697ba08yVqE9OdcPVtiWKvHRoxiAWq3i5TJYTn29Gfv/1QESMGvwI9i a4QmKIVB6PAfT5iC7ABRC8f14fuiV2i2miw0CM9AwACVlu2f1RWO9dB241VAqy6fxTRO bDD2v2CwZK9niGk73JCMWZNo4V4WA4QmdjIZIH36ASq6q2zHRgUBEXVqAu4x+fd4fcuT IPNA== X-Gm-Message-State: ABy/qLYOTWIxxeTOB3YBeSRqNRD4YnxpesuMpb3IHAuWGoxNY5tatuK8 S2ONtYTt76Tb5zPL9QSqw+0jhPVmUKOSNhaLnJR3RQ== X-Google-Smtp-Source: APBJJlFFIjLOH3Ffj51y71fnwKEui84J+1kFRCgKcUSNmBOAwL8V1wroxoMHoMbTxEmp3OVtMKeltO1bs0ya3nmtefE= X-Received: by 2002:a50:ee05:0:b0:522:2d1b:5a38 with SMTP id g5-20020a50ee05000000b005222d1b5a38mr2442445eds.10.1690484664669; Thu, 27 Jul 2023 12:04:24 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ian Lance Taylor Date: Thu, 27 Jul 2023 12:04:12 -0700 Message-ID: Subject: Re: non-conformant ELF symbol table on MIPS? To: Jan Beulich Cc: "Maciej W. Rozycki" , Chenghua Xu , Binutils Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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, Jul 27, 2023 at 7:28=E2=80=AFAM Jan Beulich via Binutils wrote: > > extending the gas elf/common3.s testcase (in the context of trying to fix > PR gas/30688) to > > .comm foobar,30,4 > .comm buf1, 5-1, 8 > .comm buf2, 4, 9-1 > .lcomm lbuf, 9-1 > > I notice a violation of the ELF spec on most (all?) MIPS targets I would > routinely test for common code changes: "lbuf" is emitted last in the > symbol table. The spec is quite clear: "In each symbol table, all > symbols with STB_LOCAL binding precede the weak and global symbols." I > guess I want/need to xfail that test for mips*-*-* for the time being, > but it would be nice if you could shed some light on this behavior. This is historical behavior that dates back to the SGI Irix operating system. Search for elf_bad_symtab in the BFD sources. Here is the commend from elf-bfd.h: /* Irix 5 often screws up the symbol table, sorting local symbols after global symbols. This flag is set if the symbol table in this BFD appears to be screwed up. If it is, we ignore the sh_info field in the symbol table header, and always read all the symbols. */ unsigned int bad_symtab : 1; I believe we currently set elf_bad_symtab true by default for most MIPS tar= gets. Ian