From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128112 invoked by alias); 13 Sep 2018 15:32:27 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 127790 invoked by uid 89); 13 Sep 2018 15:32:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=2003, cleaning X-HELO: relay1.mentorg.com Date: Thu, 13 Sep 2018 15:32:00 -0000 From: Joseph Myers To: Arnd Bergmann CC: Mao Han , , GNU C Library , Subject: Re: [gnu-csky] [PATCH v4 06/13] C-SKY: Linux ABI In-Reply-To: Message-ID: References: <53924daa4b51c0d552d17d3c5fd9aea09f9fc4b2.1536720821.git.han_mao@c-sky.com> <20180913081721.GB4004@vmh-VirtualBox> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2018-09/txt/msg00191.txt.bz2 On Thu, 13 Sep 2018, Arnd Bergmann wrote: > From what I can tell, mips64, riscv64, nios2, and microblaze are all wrong, and > the generic default would be wrong as well if picked up by anything else (but > nothing seems to use it). A question for cleaning this up and possibly unifying versions of this header: for multi-ABI architectures, in userspace, what are these structures meant to refer to? The structures that would be produced by a core dump for the current process, as opposed to those that might be produced by a core dump for another ABI? I can confirm that the struct elf_prpsinfo defined in sys/procfs.h for MIPS n64 has size 0x90 whereas an n64 core dump has data size 0x88 for NT_PRPSINFO, indicating the pr_uid / pr_gid types are indeed wrong. But I'm concerned here about n32 and about other fields in the structure. The code (dating back to the original addition of support for 64-bit MIPS ABIs to glibc in 2003) uses type unsigned long long int for pr_flag for n32. But if I core dump an n32 process, I get 0x80 for the size of NT_PRPSINFO (while the userspace structure has size 0x88). And similarly there are n32 conditionals in struct elf_prstatus - the core dump has size 0x1b8 for NT_PRSTATUS but the userspace structure has size 0x1c0. If the structure is meant to correspond to the current ABI, that suggests those n32 conditionals are wrong (the conditional on the definition of elf_greg_t, however, is correct, as n32 does use 64-bit registers). -- Joseph S. Myers joseph@codesourcery.com