From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 6C66B3858D20 for ; Thu, 25 Apr 2024 19:51:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6C66B3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6C66B3858D20 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1714074667; cv=pass; b=or39tcgYuocIYMxA6JXYZ7UGC/U8eseaHJ6V6Q3i0TraRiH/HLnio3NwrTMwcnnkc/pfKyaSKys9rO3lh/V7kU03HFy6PvTa8XQCg1jTW4LNDjqxbBisBaHCdOK1h6HDsVJ8o6hk0hM3PGP6qK1zk1gxTUDmMQG7obyinm991Pc= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1714074667; c=relaxed/simple; bh=FiRYkGP72cz3LgfDVUFkx3vbgtghQQ3KJEcDeuLmb/o=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=uCjoaizNuVb3TpndTK5lgYZE/ZH09+e+YUQrE4XBgIB92SNH6NeQniJnVsbq58RVwJNEliqZI4PAp+9QHzeU6jLniSUnpxCc01cos7jXqqI3q81y5oXsZYGpDHc+rveOJXhK+zxYumWzYr26c5f817SDSmTPaOFBrQ0tLBLpZPQ= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43PHOMNL010734 for ; Thu, 25 Apr 2024 19:51:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-11-20; bh=o3akvOJbQqmZqRbkbeaCijuaazxZcOdL9iPdmgGq45k=; b=IlzpZ4R5MYiugi2y1quFMrCAu+k038YUA2egX3EbDQc8bERisRD/n3M3/g2wXKwWDh4X 7q8Ua+NDGrDsoSjNKlg8hgSvXiphxheR04H3NXtfn2Z/WQnMCQFAqT8/Ary7JlDWKgwP K2hVwC7tijiVS6UnMm6YvY22liwOuxd5pjg9b3V6jfolqWlXtgcv5xVCNzNA99scHHGL i/xH3T7rQFqDc9F7B8AGv+TVU/KWNfe3Rd8f9AVmzTyLJ/+0+2uxHKzoUW6fIdOZalJh Cn86eQzMxVNDPN6AlCbKWiBEvgAG4KH/HxS73jgFaZqN2jSol3DQy6AfTcPdzSucTuyK DA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xm68vmqu9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 25 Apr 2024 19:51:04 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 43PJfi9c019676 for ; Thu, 25 Apr 2024 19:51:02 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2041.outbound.protection.outlook.com [104.47.57.41]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3xpbf6vepg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 25 Apr 2024 19:51:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jWUbR3axkzYRWpv4w3e7XJZ/uBdkmc6tIpXCHl6C1flO2oTcAZdgFh6twzTY0qkFmhcdw7LxMh1EbHSEagbZqAQUiQvdYy/pIYPZLuJFGciHnt6ODw1gRHQ/7+mGgj5mOMYnxXyrZMcK7cXc3FhWGMH3KWCgA7fJmN2p5CpdZBdQeVBj6J/NtjJkHaeP5OalcXsKOtajzBuDpcajMk9ii0yf1UgDNDIsW7mk/uZZO4CFsyH718dtJXtN6Jx64YjY1IaRO/TVNiWNJrROx0I3mHv8Zhnck8IB3e7gCvrsT6jFcUzCCIL3y1B5PUgQCyOLcTIqzvQxjSZ8uCGCUmudiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o3akvOJbQqmZqRbkbeaCijuaazxZcOdL9iPdmgGq45k=; b=DChVJUUyXnlTEYn9t4oeFCUnOcPXh7vJlDcf65u+LcxbMAUwZioJeub7KhntzzIx8Hk5GaXSBommVZ2YtNC6y33anoxhULUBvt2cz2pV9clGBtns/jXsZqjdTI+07N3pVL3uK1cWREz6+2jKSIPJpq1KenjvtmT1bMLTLwf9haH4LrNMqQZAtj7H2VdHpAR6PzDfRjNDXyGTExqE2GneCsCTPsWKRATEPiSgaVvSzOK2PzIS7xeIIY5WBMTrGkV9WDO5+x9OK2zIrmYGXEL4p64GlxYPLWR+3Gwy3/wOqCw7Tby0a1oSS5jR8omN0HhWdEirAbV/JhbvzkCCQnlDTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o3akvOJbQqmZqRbkbeaCijuaazxZcOdL9iPdmgGq45k=; b=viKVyvIj79pGFAoW6m9TR7OisitmOhOeLQE9XDONmZMSi7j8wc7Oj+X7nTTGvyiLxfz0JcxOPn8zYlyZpyUl8hJ/q3ZOKf03CL6WAdJOHg5cZh0x4WeSs1HZtZaqvULxEE4Y4UkVXKMmY5W3w50jFY9YyBY7ZAVcQj3GAvbylsM= Received: from DS0PR10MB7953.namprd10.prod.outlook.com (2603:10b6:8:1a1::22) by SN4PR10MB5591.namprd10.prod.outlook.com (2603:10b6:806:206::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.46; Thu, 25 Apr 2024 19:51:00 +0000 Received: from DS0PR10MB7953.namprd10.prod.outlook.com ([fe80::ddec:934d:1117:499d]) by DS0PR10MB7953.namprd10.prod.outlook.com ([fe80::ddec:934d:1117:499d%3]) with mapi id 15.20.7409.042; Thu, 25 Apr 2024 19:50:59 +0000 Message-ID: Date: Thu, 25 Apr 2024 12:50:57 -0700 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] bpf: fix calculation when deciding to relax branch To: "Jose E. Marchesi" Cc: binutils@sourceware.org, cupertino.miranda@oracle.com, indu.bhagat@oracle.com References: <20240425192223.8892-1-david.faust@oracle.com> <87le515ipe.fsf@oracle.com> Content-Language: en-US From: David Faust In-Reply-To: <87le515ipe.fsf@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SJ0PR05CA0133.namprd05.prod.outlook.com (2603:10b6:a03:33d::18) To DS0PR10MB7953.namprd10.prod.outlook.com (2603:10b6:8:1a1::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7953:EE_|SN4PR10MB5591:EE_ X-MS-Office365-Filtering-Correlation-Id: 4a97e171-f2c8-4337-b127-08dc656107d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?utf-8?B?c2p6VzFpY0hDRVJramxhUnMzakFvS2Z5YjloZmFScCtnblhqM0h2cVZMaStR?= =?utf-8?B?UU9Sc1hid3k5Q1c2bWxoNEE2bnlTWUxEWGNxdUxvSnY3bGN3V09CQXJ2WWlx?= =?utf-8?B?eEFOeFEzVm0yMTZIc080NHh0bVgxQ0pVcmFVcU1WOFJtOHIxT3VhVlZ2MDFa?= =?utf-8?B?eUEwM2JPdk1lYmtGS2t4UVljR2h4bTAvT3laMmJ4aFkzemVPTTcyb1dTUWc2?= =?utf-8?B?bGpqMlgvL0Vsc3piZGR4YUxxeVZLQUpwd2Q1ZElDUHRSZjl6SHNQVS9iMm1o?= =?utf-8?B?SmMrSmZET1BSMXAzbndjNCsxK3Jsd2pYdFp6L3RNMGZDVlM3OFVZT2Vsckpt?= =?utf-8?B?VnhETDlHMFlEY2ZCWUg2WWNvcWFrb0pvNVk5bjltbGo0MXNwZDV1RnB4UWds?= =?utf-8?B?Mk5IU2JMMkYvcFYzZk5kZTVmRXJrSDE4ODJ0eTBQb0NKaVQwTG0rQUxVZHhO?= =?utf-8?B?a0UxZFd5dXI5WWY2YWRMQnF5c1RTOWpWYzhjM1lMQ0hRY2tKOHNHaWZ2dnph?= =?utf-8?B?c05wVjhNQkZtWmdVL1JKZTJESEltVEM1WURsNFFDeUdjdHFMOXRhSml3b3hp?= =?utf-8?B?TktKOC9zQzRzeVNqMk41bkx3SWhDVzZWU09CcmUvZVoreWZoRUFmTzVTSEhs?= =?utf-8?B?eVF1TVdtOHV1VnpnT1A1bm1iUSs0cjRhTm5mZmJEVDFMTCs0NE02RFpQQzVq?= =?utf-8?B?NjhBcksybU12dWdaeldBTXZCUE5ONnM1V2FydkN5ZC9GOVJ6eGRzWXN4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0R3JVQ3ZGSldvdlBM?= =?utf-8?B?b0ZDMTdZanQxWXZQU1dxbzUwbjZEVVM3TS9QdE1KSFFJZ29jL1pwc1R3PT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR10MB7953.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MUswcklMVXJQZDkzY1BySGVZMmhueG5Vdk5IemtCMndtWlBpeHg3MlEzU3Vn?= =?utf-8?B?ZUdhOWF6Q2s0SjNjYU1tYXk3NHFMYWUyM2lTVk1lQ0g2Vzdma2NLdlJLM0Nw?= =?utf-8?B?RHVZTnNwOS8rcVZxQllLVEVmajIzbUg5aDlUSUx0Y2dqVEFQUmtaOGFZcjA0?= =?utf-8?B?RDhNOUFCMmtOTzBwNVVOV1JxOXdxU2I3WThvSG0wcjBUaVdpVUZhZElKK0lq?= =?utf-8?B?dURkQlB6bmxBZnBIQk1pNXFTazJSQjY0a1oyZDV2cTRCb2xLeXIxb0IrTHJt?= =?utf-8?B?c013TjQ0b0g4ck90Zkx2SXhUVE1KeVE5elFmV1hCdEc5clcxNENkMEZ3Q3BL?= =?utf-8?B?OWY1cGR1QkZFS2ZHY3NrM3A0b1VXMklMVWcvMVZaNmdCZ1JhbUoyS1dJNmwy?= =?utf-8?B?c2dpZTJCbng0U0VRTUtxOWtVc28xNkYxUWJPNnUxVzRQbUx2VE85dUNNVHIx?= =?utf-8?B?NDg4VEQzd25ZL2U0UzNNVVJCNWRsRjR0aUpjMDdpK1daSVNIV1plSG5jcUN6?= =?utf-8?B?WTdCNFpNVWdWUm1SUVVVam9yWFVvRzJGSTQ2SzJ1cW0xZFA5TUd0SVd5QXVt?= =?utf-8?B?OXpnS1kxclpCbGg0VTdPeDJ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ocw99qNrXcodvyDIUa83nwzru97FwBh2KkUy7gECVvefuuTvann0uqnh8E6avfAyCGjaKR/KHEr2+wlEROE0llAXtZ7qNgRx+Ozd9drmSG4adpJcT9oxBhF3aJlNaUP3wCKINFAFuv0coBt/gDdKqMJ5WxAYOjXjx2LcKzWZyJ6oCdFKTdQZofuq4m/7Qo5aK6+QmDAdMTAYY2H8qCOtwIYIK72c54OzuVqc0vQ2Wt8gwyRtUIAVB8zdbbBf1fW2Qzr2KQgRNfnBCNoPd7zK7AxLyMTZKb5lIA/GT8qV6OALLl+j8Ro/hCpO1Zmds8UJQscfV2pygjbE5WAN0M7WI0D76KAq612OUiWvDFdx5/g= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a97e171-f2c8-4337-b127-08dc656107d7 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7953.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2024 19:50:59.8893 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: o6Q2VL2rw7Hm5Ovat+YW0wDc3Brd4pXZRRMH3MzDWDAb0lwYzSMuDJl9UUPYyz+i7MdAofyZpqyL9G4SGesZXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5591 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-25_19,2024-04-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 mlxscore=0 phishscore=0 spamscore=0 adultscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404250142 X-Proofpoint-GUID: r1S-tXESMK_kCCTK5gZdkVI3-2uTyPJy X-Proofpoint-ORIG-GUID: r1S-tXESMK_kCCTK5gZdkVI3-2uTyPJy X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP 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 4/25/24 12:46, Jose E. Marchesi wrote: > > Hi David. > OK. > Thanks for the patch! I just noticed a little inconsistency in the fixups for the two JAL cases below, so I'm fixing this up (and re-testing just in case) before checking it in: >> + fixp = fix_new_exp (fragp, buf - (bfd_byte *) fragp->fr_literal, >> + bfd_get_reloc_size (reloc_howto), >> + &exp, >> + reloc_howto->pc_relative, >> + BFD_RELOC_BPF_DISP32); >> + fixp = fix_new_exp (fragp, >> + buf - (bfd_byte *) fragp->fr_literal, >> + 4 /* size */, >> + &exp, >> + true /* pc-relative */, >> + BFD_RELOC_BPF_DISP32); These are equivalent, but it's better to use the howto. > >> In certain cases we were calculating the jump displacement incorrectly >> when deciding whether to relax a branch. This meant for some branches, >> such as a very long backwards conditional branch, relaxation was not >> done when it should have been. The result was to error later, because >> the actual jump displacement was too large to fit in the original >> instruction. >> >> This patch fixes up the displacement calculation so that those branches >> are correctly relaxed and no longer result in an error. In addition, it >> changes md_convert_frag to install fixups for the JAL instructions in >> the resulting relaxations rather than encoding the displacement value >> directly. >> >> Tested on x86_64-linux-gnu host for bpf-unknown-none target. >> Sanity checked building Linux kernel BPF selftests. >> >> gas/ >> * config/tc-bpf.c (relaxed_branch_length): Correct displacement >> calculation when relaxing. >> (md_convert_frag): Likewise. Install fixups for JAL >> instructions resulting from relaxation. >> * testsuite/gas/bpf/jump-relax-ja-be.d: Correct and expand test. >> * testsuite/gas/bpf/jump-relax-ja.d: Likewise. >> * testsuite/gas/bpf/jump-relax-ja.s: Likewise. >> * testsuite/gas/bpf/jump-relax-jump-be.d: Likewise. >> * testsuite/gas/bpf/jump-relax-jump.d: Likewise. >> * testsuite/gas/bpf/jump-relax-jump.s: Likewise. >> --- >> gas/config/tc-bpf.c | 38 +++++++++++++++++++--- >> gas/testsuite/gas/bpf/jump-relax-ja-be.d | 16 +++++---- >> gas/testsuite/gas/bpf/jump-relax-ja.d | 16 +++++---- >> gas/testsuite/gas/bpf/jump-relax-ja.s | 13 +++++--- >> gas/testsuite/gas/bpf/jump-relax-jump-be.d | 22 ++++++++----- >> gas/testsuite/gas/bpf/jump-relax-jump.d | 22 ++++++++----- >> gas/testsuite/gas/bpf/jump-relax-jump.s | 12 ++++--- >> 7 files changed, 96 insertions(+), 43 deletions(-) >> >> diff --git a/gas/config/tc-bpf.c b/gas/config/tc-bpf.c >> index dfa44ea194c..377ac6a7a4c 100644 >> --- a/gas/config/tc-bpf.c >> +++ b/gas/config/tc-bpf.c >> @@ -434,6 +434,7 @@ relaxed_branch_length (fragS *fragp, asection *sec, int update) >> && sec == S_GET_SEGMENT (fragp->fr_symbol)) >> { >> offsetT val = S_GET_VALUE (fragp->fr_symbol) + fragp->fr_offset; >> + val -= fragp->fr_address + fragp->fr_fix; >> >> /* Convert to 64-bit words, minus one. */ >> val = (val - 8) / 8; >> @@ -578,6 +579,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, >> && sec == S_GET_SEGMENT (fragp->fr_symbol)) >> { >> offsetT val = S_GET_VALUE (fragp->fr_symbol) + fragp->fr_offset; >> + val -= fragp->fr_address + fragp->fr_fix; >> /* Convert to 64-bit blocks minus one. */ >> disp_to_target = (val - 8) / 8; >> disp_is_known = 1; >> @@ -626,15 +628,27 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, >> { >> /* 16-bit disp is known and not in range. Turn the JA >> into a JAL with a 32-bit displacement. */ >> - char bytes[8]; >> + char bytes[8] = {0}; >> >> bytes[0] = ((BPF_CLASS_JMP32|BPF_CODE_JA|BPF_SRC_K) >> 56) & 0xff; >> bytes[1] = (word >> 48) & 0xff; >> bytes[2] = 0; /* disp16 high */ >> bytes[3] = 0; /* disp16 lo */ >> - encode_int32 ((int32_t) disp_to_target, bytes + 4); >> - >> write_insn_bytes (buf, bytes); >> + >> + /* Install fixup for the JAL. */ >> + reloc_howto_type *reloc_howto >> + = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_BPF_DISP32); >> + if (!reloc_howto) >> + abort(); >> + >> + fixp = fix_new_exp (fragp, buf - (bfd_byte *) fragp->fr_literal, >> + bfd_get_reloc_size (reloc_howto), >> + &exp, >> + reloc_howto->pc_relative, >> + BFD_RELOC_BPF_DISP32); >> + fixp->fx_file = fragp->fr_file; >> + fixp->fx_line = fragp->fr_line; >> } >> } >> else >> @@ -731,8 +745,24 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, >> bytes[1] = 0; >> bytes[2] = 0; >> bytes[3] = 0; >> - encode_int32 ((int32_t) disp_to_target, bytes + 4); >> + encode_int32 ((int32_t) 0, bytes + 4); >> write_insn_bytes (buf, bytes); >> + >> + /* Install fixup for the JAL. */ >> + reloc_howto_type *reloc_howto >> + = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_BPF_DISP32); >> + if (!reloc_howto) >> + abort(); >> + >> + fixp = fix_new_exp (fragp, >> + buf - (bfd_byte *) fragp->fr_literal, >> + 4 /* size */, >> + &exp, >> + true /* pc-relative */, >> + BFD_RELOC_BPF_DISP32); >> + fixp->fx_file = fragp->fr_file; >> + fixp->fx_line = fragp->fr_line; >> + >> buf += 8; >> } >> } >> diff --git a/gas/testsuite/gas/bpf/jump-relax-ja-be.d b/gas/testsuite/gas/bpf/jump-relax-ja-be.d >> index 5f07847e90c..e5ad30da807 100644 >> --- a/gas/testsuite/gas/bpf/jump-relax-ja-be.d >> +++ b/gas/testsuite/gas/bpf/jump-relax-ja-be.d >> @@ -8,10 +8,14 @@ >> Disassembly of section .text: >> >> 0+ <.*>: >> - 0: 05 00 80 00 00 00 00 00 ja -32768 >> - 8: 05 00 7f ff 00 00 00 00 ja 32767 >> - 10: 05 00 ff fd 00 00 00 00 ja -3 >> - 18: 05 00 00 00 00 00 00 00 ja 0 >> + 0: 05 00 80 00 00 00 00 00 ja -32768 >> + 8: 05 00 7f ff 00 00 00 00 ja 32767 >> + 10: 05 00 ff fd 00 00 00 00 ja -3 >> + 18: 05 00 00 00 00 00 00 00 ja 0 >> 18: R_BPF_GNU_64_16 undefined >> - 20: 06 00 00 00 00 00 80 01 jal 32769 >> - 28: 06 00 00 00 00 00 80 01 jal 32769 >> + 20: 06 00 00 00 00 00 80 00 jal 32768 >> + 28: 05 00 7f ff 00 00 00 00 ja 32767 >> + ... >> + >> +0+40028 : >> + 40028: 06 00 00 00 ff ff 7f fa jal -32774 >> diff --git a/gas/testsuite/gas/bpf/jump-relax-ja.d b/gas/testsuite/gas/bpf/jump-relax-ja.d >> index ed3aa6bad4e..1ac33f5d2f5 100644 >> --- a/gas/testsuite/gas/bpf/jump-relax-ja.d >> +++ b/gas/testsuite/gas/bpf/jump-relax-ja.d >> @@ -8,10 +8,14 @@ >> Disassembly of section .text: >> >> 0+ <.*>: >> - 0: 05 00 00 80 00 00 00 00 ja -32768 >> - 8: 05 00 ff 7f 00 00 00 00 ja 32767 >> - 10: 05 00 fd ff 00 00 00 00 ja -3 >> - 18: 05 00 00 00 00 00 00 00 ja 0 >> + 0: 05 00 00 80 00 00 00 00 ja -32768 >> + 8: 05 00 ff 7f 00 00 00 00 ja 32767 >> + 10: 05 00 fd ff 00 00 00 00 ja -3 >> + 18: 05 00 00 00 00 00 00 00 ja 0 >> 18: R_BPF_GNU_64_16 undefined >> - 20: 06 00 00 00 01 80 00 00 jal 32769 >> - 28: 06 00 00 00 01 80 00 00 jal 32769 >> + 20: 06 00 00 00 00 80 00 00 jal 32768 >> + 28: 05 00 ff 7f 00 00 00 00 ja 32767 >> + ... >> + >> +0+40028 : >> + 40028: 06 00 00 00 fa 7f ff ff jal -32774 >> diff --git a/gas/testsuite/gas/bpf/jump-relax-ja.s b/gas/testsuite/gas/bpf/jump-relax-ja.s >> index f164176bbd5..61f2e61cb3c 100644 >> --- a/gas/testsuite/gas/bpf/jump-relax-ja.s >> +++ b/gas/testsuite/gas/bpf/jump-relax-ja.s >> @@ -4,13 +4,18 @@ >> 1: ja -32768 >> ja 32767 >> /* The following instruction refers to a defined symbol that >> - is on reach, so it should not be relaxed. */ >> + is in reach, so it should not be relaxed. */ >> ja 1b >> /* The following instruction has an undefined symbol as a >> target. It is not to be relaxed. */ >> ja undefined + 10 >> - /* The following instructions refer to a defined symbol that >> - is not on reach. They shall be relaxed to a JAL. */ >> + /* The following instruction refers to a defined symbol that >> + is not in reach, so it shall be relaxed to JAL. */ >> ja tail >> - tail = .text + 262160 >> + /* Now the symbol is in reach, and the following instruction >> + shall not be relaxed. */ >> ja tail >> + .space 262136 >> + tail = . >> + /* The jump back is too large and shall be relaxed. */ >> + ja 1b >> diff --git a/gas/testsuite/gas/bpf/jump-relax-jump-be.d b/gas/testsuite/gas/bpf/jump-relax-jump-be.d >> index 0cacdb38fc9..5cf3bce2a2b 100644 >> --- a/gas/testsuite/gas/bpf/jump-relax-jump-be.d >> +++ b/gas/testsuite/gas/bpf/jump-relax-jump-be.d >> @@ -8,12 +8,16 @@ >> Disassembly of section .text: >> >> 0+ <.*>: >> - 0: 1d 12 80 00 00 00 00 00 jeq %r1,%r2,-32768 >> - 8: ad 12 7f ff 00 00 00 00 jlt %r1,%r2,32767 >> - 10: bd 12 ff fd 00 00 00 00 jle %r1,%r2,-3 >> - 18: 1d 12 00 01 00 00 00 00 jeq %r1,%r2,1 >> - 20: 05 00 00 01 00 00 00 00 ja 1 >> - 28: 06 00 00 00 00 00 80 01 jal 32769 >> - 30: 2d 12 00 01 00 00 00 00 jgt %r1,%r2,1 >> - 38: 05 00 00 01 00 00 00 00 ja 1 >> - 40: 06 00 00 00 00 00 80 01 jal 32769 >> + 0: 1d 12 80 00 00 00 00 00 jeq %r1,%r2,-32768 >> + 8: ad 12 7f ff 00 00 00 00 jlt %r1,%r2,32767 >> + 10: bd 12 ff fd 00 00 00 00 jle %r1,%r2,-3 >> + 18: 1d 12 00 01 00 00 00 00 jeq %r1,%r2,1 >> + 20: 05 00 00 01 00 00 00 00 ja 1 >> + 28: 06 00 00 00 00 00 80 00 jal 32768 >> + 30: 2d 12 7f ff 00 00 00 00 jgt %r1,%r2,32767 >> + ... >> + >> +0+40030 : >> + 40030: 55 10 00 01 00 00 00 00 jne %r1,0,1 >> + 40038: 05 00 00 01 00 00 00 00 ja 1 >> + 40040: 06 00 00 00 ff ff 7f f7 jal -32777 >> diff --git a/gas/testsuite/gas/bpf/jump-relax-jump.d b/gas/testsuite/gas/bpf/jump-relax-jump.d >> index dd31ba5f4e4..4300bf3f59f 100644 >> --- a/gas/testsuite/gas/bpf/jump-relax-jump.d >> +++ b/gas/testsuite/gas/bpf/jump-relax-jump.d >> @@ -8,12 +8,16 @@ >> Disassembly of section .text: >> >> 0+ <.*>: >> - 0: 1d 21 00 80 00 00 00 00 jeq %r1,%r2,-32768 >> - 8: ad 21 ff 7f 00 00 00 00 jlt %r1,%r2,32767 >> - 10: bd 21 fd ff 00 00 00 00 jle %r1,%r2,-3 >> - 18: 1d 21 01 00 00 00 00 00 jeq %r1,%r2,1 >> - 20: 05 00 01 00 00 00 00 00 ja 1 >> - 28: 06 00 00 00 01 80 00 00 jal 32769 >> - 30: 2d 21 01 00 00 00 00 00 jgt %r1,%r2,1 >> - 38: 05 00 01 00 00 00 00 00 ja 1 >> - 40: 06 00 00 00 01 80 00 00 jal 32769 >> + 0: 1d 21 00 80 00 00 00 00 jeq %r1,%r2,-32768 >> + 8: ad 21 ff 7f 00 00 00 00 jlt %r1,%r2,32767 >> + 10: bd 21 fd ff 00 00 00 00 jle %r1,%r2,-3 >> + 18: 1d 21 01 00 00 00 00 00 jeq %r1,%r2,1 >> + 20: 05 00 01 00 00 00 00 00 ja 1 >> + 28: 06 00 00 00 00 80 00 00 jal 32768 >> + 30: 2d 21 ff 7f 00 00 00 00 jgt %r1,%r2,32767 >> + ... >> + >> +0+40030 : >> + 40030: 55 01 01 00 00 00 00 00 jne %r1,0,1 >> + 40038: 05 00 01 00 00 00 00 00 ja 1 >> + 40040: 06 00 00 00 f7 7f ff ff jal -32777 >> diff --git a/gas/testsuite/gas/bpf/jump-relax-jump.s b/gas/testsuite/gas/bpf/jump-relax-jump.s >> index 5ea61109bca..6b23c56514a 100644 >> --- a/gas/testsuite/gas/bpf/jump-relax-jump.s >> +++ b/gas/testsuite/gas/bpf/jump-relax-jump.s >> @@ -2,11 +2,13 @@ >> fix in the jump 16-bit signed displacement operand. */ >> 1: jeq %r1, %r2, -32768 >> jlt %r1, %r2, 32767 >> - /* The following instruction refers to a defined symbol that >> - is on reach, so it should not be relaxed. */ >> + /* The following instructions refer to defined symbols that >> + are in reach, so they should not be relaxed. */ >> jle %r1, %r2, 1b >> - /* The following instructions refer to a defined symbol that >> - is not on reach. They shall be relaxed. */ >> jeq %r1, %r2, tail >> - tail = .text + 262160 >> jgt %r1, %r2, tail >> + /* The following instructions refers to defined symbols that >> + are not in reach, so they shall be relaxied. */ >> + .space 262136 >> + tail = . >> + jne %r1, 0, 1b