From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D474F3858C2D; Fri, 10 Feb 2023 08:58:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D474F3858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676019492; bh=VkAuIykN0oMEUe5yQYp6f1WSivuAmHDJdPAF3XiWmxM=; h=From:To:Subject:Date:From; b=TSWuHE3aY01LxKvxnqrW/U35gNiQGSKfxRn0jWLhAyj6WFCEbd4OOxBr6O49XNsHH YEo5LMlPR1OdbOleFS6//ecur742m8BAN0Dk+2GY4PJdP0GpOxz0NCRnPnOal42H7j +H8qo19uvAZ5K/GKtXY+mZA4Qmjt/HSqZWxt4I7M= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug tdep/30109] New: [gdb/tdep] Support status of x32 abi Date: Fri, 10 Feb 2023 08:58:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tdep X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30109 Bug ID: 30109 Summary: [gdb/tdep] Support status of x32 abi Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: tdep Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- On x86_64, there's the x32 abi, see here ( abi https://en.wikipedia.org/wiki/X32_ABI ). Gdb supports the x32 abi, through the "i386:x64-32" architecture. The most recent related commits I could find are: commit 0653f01479ecbcbf3c4dfa6083187a5b2c2258c2 Author: H.J. Lu Date: Thu Feb 24 07:34:01 2022 -0800 gdb: Consolidate 32bit-pkeys.xml and 64bit-pkeys.xml and: commit a92d031d7ef6e192fb404a86d53fa834e1e3eb8c Author: Tom de Vries Date: Mon Nov 22 12:21:46 2021 +0100 [gdb/build] Fix x86_64 x32 build which are both signs of somebody building and testing it. But I suppose this is not regularly build and tested, at least not by gdb maintainers (maybe I'm wrong there). Also, AFAICT the sourceware buildbots don't test it. Looking at my own main development platform, it's x86_64-linux, with m32 biarch, so I've got the possibility to run tests for target board unix/-m32. I can't use target board unix/-mx32, because I've got no stdlibs for this flavour. So let's try a nostdlib program: .... $ cat start.c void _start (void) { } ... x86_64: ... $ gcc start.c -nostdlib=20 $ gdb -q -batch a.out -ex "b _start" -ex run Breakpoint 1 at 0x400148 Breakpoint 1, 0x0000000000400148 in _start () ... x86_64/-m32: ... $ gcc start.c -nostdlib -m32 $ gdb -q -batch a.out -ex "b _start" -ex run Breakpoint 1 at 0x80480db Breakpoint 1, 0x080480db in _start () ... x86_64/-mx32: ... $ gcc start.c -nostdlib -mx32 $ gdb -q -batch a.out -ex "b _start" -ex run Breakpoint 1 at 0x4000db /bin/bash: /home/vries/a.out: cannot execute binary file: Exec format error /bin/bash: /home/vries/a.out: Success During startup program exited with code 126. ... That's not a gdb-specific problem: ... $ ./a.out=20 bash: ./a.out: cannot execute binary file: Exec format error ... Looking at the wikipedia page, a multilib option is listed for gentoo, so I have the impression this could work. Maybe there's another reason? Ok, my linux kernel configuration doesn't support it, that's probably it: ... $ grep X86_X32 /boot/config-5.14.21-150400.24.41-default=20 # CONFIG_X86_X32 is not set ... So, it seems the best possibility to add some regular testing of this is to generate a nostdlib .s test-case (to handle cases where the compiler doesn'= t or no longer does support -mx32) which we load into gdb, check that the proper architecture is selected, set a breakpoint on start, and then, maybe even r= un it to breakpoint if the kernel supports it (but, I can't test this on my current platform). --=20 You are receiving this mail because: You are on the CC list for the bug.=