From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id 847403875DD1 for ; Wed, 12 Jun 2024 17:08:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 847403875DD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 847403875DD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718212087; cv=none; b=mdX6Pegpzkmcl8J3nYmnXhfYJW3lraIf87iWYG73yWrLcfpwSmLPJ8jPOn7XCzSbqFuUsjdaP7TrpXENkmLeNnnQbq4h8f4ITwmW+TYWiEkMmDASYdrsof9s5ckj0jIZfrC/DtwUfu/NgbepCmO/cuICAJFgePIZO2sj7LFKxNQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718212087; c=relaxed/simple; bh=63vDB/JagF+uah7K99oWPS5CmOXt3fpobt+4MEx3Wg0=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=InsWjtP2WRUpf3oYFyESb+X89pvB+AJoEmON8DjAoMVYORq/vDPXaaZyGBt9hAPwPy2ekLWLpfTEGeiiCVBOSnvF01r1W+WR7arAWEy3yfG4feG+DDlX9TpM98nosLEi9iVeSbVC66qIGOFiiE8GC402rN6uf0NOwlUBTc8dwAk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 372BE34689; Wed, 12 Jun 2024 17:07:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718212080; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wPB1tfeD5u90j0lkVKPpCXadEYHfrLo2NXyYexjlmyA=; b=LaLs8HQIEF+2Ufb0tyYtW9tLlNSs9ihMU4a5OdsST57Xke9Ajb7EtNCAbJHtvpxA6cTLc0 aBA205w60Z9uj9DuUMbWVeQ/Gz+Y/FVKD6e3wLGYxewxgRXXUTvYzdHf9oNlTC2ubScYnX MPBm52ITXJvklwg5vIjPHtZ2kUDDK7s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718212080; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wPB1tfeD5u90j0lkVKPpCXadEYHfrLo2NXyYexjlmyA=; b=iZ3GxkmMZQdzaWQL8iUgkBOqQLi/oPu0egI2wsp0633ca9beeNpD28bdlYNzZi36iITmMG HfSu8+YOJj3x6BDQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=hcMKhYEb; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=VcrU5Klj DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718212079; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wPB1tfeD5u90j0lkVKPpCXadEYHfrLo2NXyYexjlmyA=; b=hcMKhYEbAq70mwmqfq66l8R0AXgfoloYxHEdxhDny5OC2hPW+URdtf+ijLS+qQnqmls3Ba eeRSjkqRbMC/TRuCrtxgqrSsyfXHU4JyrOy5wMq5PB7OaTvsiW5E22y3us1FoyPKRwMkCd 3eJ2eo+3vV6xX8kPiPVCVVFfrxOAxoM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718212079; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wPB1tfeD5u90j0lkVKPpCXadEYHfrLo2NXyYexjlmyA=; b=VcrU5KljB7BhJIJCAu5Uv/RM5je1I0qXiiIVy3drcaFeLHxlcHJvkQKDDm7Jpi31FbUT5V Pw0xrvciHValjZDw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1DF7E132FF; Wed, 12 Jun 2024 17:07:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 9NnMBe/VaWYReAAAD6G6ig (envelope-from ); Wed, 12 Jun 2024 17:07:59 +0000 Message-ID: <14feedac-744e-4457-8d0d-13e609e25903@suse.de> Date: Wed, 12 Jun 2024 19:08:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/tdep] Simplify ARM_LINUX_JB_PC_EABI To: Luis Machado , gdb-patches@sourceware.org References: <20240611095739.17793-1-tdevries@suse.de> <93f0c0f4-a2a8-400a-9e96-1eb736fe8f4c@arm.com> <01cc0cf2-8d4c-4741-a8ad-c6a69e720a99@suse.de> Content-Language: en-US From: Tom de Vries In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 372BE34689 X-Spam-Score: -4.50 X-Spam-Level: X-Spamd-Result: default: False [-4.50 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; XM_UA_NO_VERSION(0.01)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWO(0.00)[2]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,sourceware.org:url,suse.de:dkim] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 6/11/24 14:33, Luis Machado wrote: > On 6/11/24 13:25, Tom de Vries wrote: >> On 6/11/24 12:29, Luis Machado wrote: >>> On 6/11/24 10:57, Tom de Vries wrote: >>>> In commit 1a7d840a216 ("[gdb/tdep] Fix ARM_LINUX_JB_PC_EABI"), in absense of >>>> osabi settings for newlib and uclibc for arm, I chose a best-effort approach >>>> using ifdefs. >>>> >>>> Post-commit review [1] pointed out that this may be causing more problems than >>>> it's worth. >>>> >>>> Fix this by removing the ifdefs and simply defining ARM_LINUX_JB_PC_EABI to 1. >>>> >>>> Rebuild on x86_64-linux with --enable-targets=all. >>>> >>>> Fixes: 1a7d840a216 ("[gdb/tdep] Fix ARM_LINUX_JB_PC_EABI") >>>> >>>> [1] https://sourceware.org/pipermail/gdb-patches/2024-June/209779.html >>>> --- >>>>   gdb/arm-linux-tdep.c | 29 ++++++++--------------------- >>>>   1 file changed, 8 insertions(+), 21 deletions(-) >>>> >>>> diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c >>>> index b0b6f3646f1..c8a9936b5c1 100644 >>>> --- a/gdb/arm-linux-tdep.c >>>> +++ b/gdb/arm-linux-tdep.c >>>> @@ -98,29 +98,16 @@ static const gdb_byte arm_linux_thumb2_le_breakpoint[] = { 0xf0, 0xf7, 0x00, 0xa >>>>        The location of saved registers in this buffer (in particular the PC >>>>      to use after longjmp is called) varies depending on the ABI (in >>>> -   particular the FP model) and also (possibly) the C Library. >>>> - >>>> -   For glibc, eglibc, and uclibc the following holds:  If the FP model is >>>> -   SoftVFP or VFP (which implies EABI) then the PC is at offset 1 or 9 in the >>>> -   buffer.  This is also true for the SoftFPA model.  However, for the FPA >>>> -   model the PC is at offset 21 in the buffer.  */ >>>> +   particular the FP model) and also (possibly) the C Library.  */ >>>>   #define ARM_LINUX_JB_ELEMENT_SIZE    ARM_INT_REGISTER_SIZE >>>> +/* For the FPA model the PC is at offset 21 in the buffer.  */ >>>>   #define ARM_LINUX_JB_PC_FPA        21 >>>> -#ifdef __UCLIBC__ >>>> -# define ARM_LINUX_JB_PC_EABI        9 >>>> -#else >>>> -# ifdef __GLIBC__ >>>> -#  if __GLIBC_PREREQ(2, 20) >>>> -/* This has been 1 since glibc 2.20, see glibc commit 80a56cc3ee ("ARM: Add >>>> -   SystemTap probes to longjmp and setjmp.").  */ >>>> -#   define ARM_LINUX_JB_PC_EABI        1 >>>> -#  else >>>> -#   define ARM_LINUX_JB_PC_EABI        9 >>>> -#  endif >>>> -# else >>>> -#  define ARM_LINUX_JB_PC_EABI        9 >>>> -# endif >>>> -#endif >>>> +/* For glibc 2.20 and later the PC is at offset 1, see glibc commit 80a56cc3ee >>>> +   ("ARM: Add SystemTap probes to longjmp and setjmp."). >>>> +   For newlib and uclibc, this is not correct, we need osabi settings to deal >>>> +   with those, see PR31854 and PR31856.  Likewise for older versions of >>>> +   glibc.  */ >>>> +#define ARM_LINUX_JB_PC_EABI        1 >>>>     /* >>>>      Dynamic Linking on ARM GNU/Linux >>>> >>>> base-commit: 60e221e9b7fae5ff40b79b93bdbff909989c2bae >>> >>> Should we document somewhere that we dropped support for >>> the old pre 2.20 glibc buffer offset though? This is a minor >>> but breaking change after all. >> >> Fine by me.  How about this, in NEWS: >> ... >> * For ARM targets, the offset of the pc in the jmp_buf has been fixed to >>   match glibc 2.20 and later.  This should only matter when not using >>   libc probes.  This may cause breakage when using an incompatible libc, >>   like uclibc or newlib, or an older glibc. >> ... >> >> Thanks, >> - Tom >> > > Excellent. Thanks Tom. I've sent a v2 with that bit included ( https://sourceware.org/pipermail/gdb-patches/2024-June/209918.html ). Thanks, - Tom