From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by sourceware.org (Postfix) with ESMTP id 147F23858D37 for ; Thu, 27 Jul 2023 19:28:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 147F23858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=orcam.me.uk Received: by angie.orcam.me.uk (Postfix, from userid 500) id 6495892009C; Thu, 27 Jul 2023 21:28:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 5650592009B; Thu, 27 Jul 2023 20:28:27 +0100 (BST) Date: Thu, 27 Jul 2023 20:28:27 +0100 (BST) From: "Maciej W. Rozycki" To: Jan Beulich cc: Chenghua Xu , Binutils Subject: Re: non-conformant ELF symbol table on MIPS? In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1163.4 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_INFOUSMEBIZ,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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 Thu, 27 Jul 2023, Jan Beulich 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. Which specific MIPS target is it? There are two kinds of MIPS targets, ones that use the older IRIX symbol sorting rules and ones that use the newer "traditional" symbol sorting rules. The IRIX symbol sorting rules mandate that section symbols precede all other symbols, see e.g. bfd/elf32-mips.c:mips_elf_sym_is_global. Mind that SGI was an early adopter of the ELF standard and things weren't as settled as they are nowadays, hence e.g. the odd solution for composed relocations with the n64 psABI (later n32 uses standard ELF gABI ones) and other peculiarities here and there. Determining whether a MIPS target uses the IRIX emulation is complex, see e.g. how binutils/testsuite/binutils-all/mips/mips.exp sets `irixemul'. If you provide me with test case details (input and output), then I may be able to give you further advice, but otherwise you may want to mark the test case with `notarget' or suchlike rather than `xfail', because that's not a bug with the backend that the symbol ordering varies. Maciej