From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 1793C3858CDA for ; Fri, 28 Jul 2023 17:12:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1793C3858CDA 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-x52a.google.com with SMTP id 4fb4d7f45d1cf-5221f3affe4so3027051a12.0 for ; Fri, 28 Jul 2023 10:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690564322; x=1691169122; 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=8y2TRpu/DyIV9HNkZ0wlCLd7taPPqQM3A/cxi6HcAJU=; b=v30gdXPXgxsZ7RPSJvnsU/iiUzQ4xP28u80zpKAS/e3D9OBd0KmYIkMIB/83Ostr3w CZq+qed6Ys7CQW8BZgEBHP/xix7+5ujKhl4hHsR77vy7IFCAGrj2rgaGAPi6H2S2tIg4 Amlbwgf5KoThb+9zgXwEoBCDGn2XXK5rzjpEbtGSi8mi5o3GLpnYXoay4Rb79th1h0pk xZBHiZMDuwRCvD6DcLOA+qKL8W7HDdqId0zAD69q9OaeqbvwIhHmW2LJZSCnHa5W+9bT ZJcLjqXfm7Obubq64wqze+luxlAaFJ11/ZWr99UqAMB4i0yIVFvt5XPXb14DE7IlBzEA xVkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690564322; x=1691169122; 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=8y2TRpu/DyIV9HNkZ0wlCLd7taPPqQM3A/cxi6HcAJU=; b=j4Ykf24UBva/BRmuxbOWbKMyQ4m2w2hpBfclYLkBwCF/iTgktf8xe17PlYBb5k3LKA m6y1upQ/+zxT7DuE/5jDPaTeRS5s6N/ZYKLxZrPqw28FajX8Gj51Q+f4ybxryMPi5uSg GpmwQX0ZJsk0oglkyWOSxoZUIfDensqAEIvFmsXoSspPlZu69LEFLHngVnHRR1Q71asF RQvcvz4VIUptR5bkmkG3wfbMRe23UXcKF435larOlAIIEA/sd1DIxx4AFsVVkVSxitKo yjwvUpICujgx3g/lnMPd6zo/OXTdivvJA+Q2TpndDUkAkDBipEn0Pmoe/7kgtUt1uMzd zfDw== X-Gm-Message-State: ABy/qLaTwrIZc5om8Dd6XI24esolODd1FC+aUMNaHOHL0+m3Cuc3c9+0 1+P5Q1jxrDE7nolGz+ksKtBnbVoF4rcVAk9c0DLEDcbian1bnfhElb8= X-Google-Smtp-Source: APBJJlGvyIQl13OWpWKORADl/E6uC/hXwFrOSxzpXMVqZ+HNptA5wdpWClr+cuPT/gsvaKWYhFCZ0Keav/pUdYmtWEA= X-Received: by 2002:a50:ec82:0:b0:522:2aba:bb32 with SMTP id e2-20020a50ec82000000b005222ababb32mr2433718edr.13.1690564321634; Fri, 28 Jul 2023 10:12:01 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ian Lance Taylor Date: Fri, 28 Jul 2023 10:11:50 -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.0 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 11:16=E2=80=AFPM Jan Beulich wr= ote: > > On 27.07.2023 21:04, Ian Lance Taylor wrote: > > 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 wou= ld > >> 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= targets. > > That explains consuming behavior. But gas is a producer, and from what > you say and quote I can't see why gas also needs to produce non- > conforming symbol tables. It was required for the linker, because otherwise the SGI IRIX dynamic linker would not work correctly. I don't recall whether it was required for gas. That may have been an accidental carry-over. Or it may have been required for the IRIX static linker to work, I don't remember. Doing it for the plan mips-elf target is probably not the best choice today= . Ian