Message ID | LO4P265MB59148A03F40658E472D79B60807D2@LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM |
---|---|
State | Not Applicable |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1412726dyb; Tue, 30 Jan 2024 10:21:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfSgdvPLQBc6vnbL0iY2ai3jEBTbVAnLfwDwGGPQQ3XT5zE6E4f1jgRZaqgM/PavL7TcAv X-Received: by 2002:a05:6214:2524:b0:681:9b63:d4b8 with SMTP id gg4-20020a056214252400b006819b63d4b8mr253704qvb.80.1706638907182; Tue, 30 Jan 2024 10:21:47 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1706638907; cv=pass; d=google.com; s=arc-20160816; b=MHQbxmM3n4OFd79rD1676E0337jiiX+qqUyitWHU7T+G15oHMYQTwY4rMtXBYb1gxX JjjD9K64quzl3phRkuNZlb3eEbuG6OmwNnvoSlW5+xn3yVDtKvTNC2puMRQC1X9np0LP Y3jEaxH1IzYu2rUH8V6dxXjCpE8g/+fJpEUofRqNDuxtBSdluKMqcl23u1EYaO1RwZzk j88w80Ce6wez+dRpbhM84PyfO5+f+z+jPyGuMHnkUcfpY3uhu1y9zZ9VvyCndY66J93D g6PNsShD8Tfy3dAMO91BSpJj6T3N1+CHqwGvYunm3HjQtayMjSFuzNEh/zaerDvhg2/k 1Ldw== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:content-language :accept-language:message-id:date:thread-index:thread-topic:subject :cc:to:from:dkim-signature:dkim-signature:arc-filter:dmarc-filter :delivered-to; bh=ziWus1KDr8+Iw1lACfYtQ3UVBbFbORL3my5fuYt0Ifc=; fh=dI+noIS9c9Mu5uul2BLOCeu0XLYvAPZU6xYKcFZrLDg=; b=br0D4lV4vB5kIAKLxz3O16SJmnp5mQOSvsc5T/0E5BUjUPRJzFeJcrY6jU0NBp7288 cxK9e1WdEf/0tCMkss1i2cxZbV5UlqRf/KuyDuz8nw+XjP9WlpDf7ySf6z/Bpko5Z0Sx ZQUUIjeOwWoRekbqS3cUpJeRYrJATFAddQ1TjIgvOGxA6wBRv5KI804T1fVyvE4AV6VX NIKV8Rx4AtPd7ERkyVuw93cbbdo7+GIVZc/timAWeNtOdQ2d+1sCi4z8E2BoNYsoUlJ0 AyA1+BtfYyPo2Rx8e8aUXqyIInj84qIpP2JOjic2Va5WMTyMf6KQqQ70XAD+hwd4cdp6 8+Ug== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@imgtec.com header.s=dk201812 header.b=yqP4vNJr; dkim=pass header.i=@IMGTecCRM.onmicrosoft.com header.s=selector2-IMGTecCRM-onmicrosoft-com header.b=cLZYX94p; arc=pass (i=2); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=imgtec.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id 8-20020a05621420e800b0068c467dc702si6573979qvk.172.2024.01.30.10.21.47 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 10:21:47 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@imgtec.com header.s=dk201812 header.b=yqP4vNJr; dkim=pass header.i=@IMGTecCRM.onmicrosoft.com header.s=selector2-IMGTecCRM-onmicrosoft-com header.b=cLZYX94p; arc=pass (i=2); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=imgtec.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DA01A3857C7D for <ouuuleilei@gmail.com>; Tue, 30 Jan 2024 18:21:46 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx08-00376f01.pphosted.com (mx08-00376f01.pphosted.com [91.207.212.86]) by sourceware.org (Postfix) with ESMTPS id 56BC83858015 for <binutils@sourceware.org>; Tue, 30 Jan 2024 18:21:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 56BC83858015 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=imgtec.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=imgtec.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 56BC83858015 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=91.207.212.86 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1706638896; cv=pass; b=pvbRGZjoW1GdCOxhcRSocThaLO8Wg71J3PERmJuALIlsrfA4zYb0lZyhVNGP9oAoB9tstCJ1XKEYv70FqJF1zKgyJXMz6t5GCcR6BcZXnk8GAR5I6W9XSC0a4GL6N9j4d+rdg+cPaUPZ9mi93Eb5VJzO876AdzIE09CwD7cX4ys= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1706638896; c=relaxed/simple; bh=yKqCmGqoGBVvp8lMVLtb9IQqjlGtElvY4txgiO8DDvU=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=q15Zr9MDRhD3IWVwoT4+f1mCT91kHGdZ2rf/BkVapZo8xD/G2o+cinPUSFYX2KpsZt8hUEDTXvtfopeKQq6s/bcj29EVLJSd6QnHk52AUQWWVVmtg5mgO4cTYev9uwxJaWa45DT4e9y1OIAWiJSNMsEbDxI2xnfGbrWKPRfsjfs= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0168888.ppops.net [127.0.0.1]) by mx08-00376f01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40UDVQTk009595; Tue, 30 Jan 2024 18:21:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imgtec.com; h= from:to:cc:subject:date:message-id:content-type:mime-version; s= dk201812; bh=ziWus1KDr8+Iw1lACfYtQ3UVBbFbORL3my5fuYt0Ifc=; b=yqP 4vNJr5dLRW00ImSRCOuvgy/9Y8zOaQlivV/7DuIsmgwBLUTjfTGslQ7zG1GcOUw/ 3y4gcxhJo6VYfwfjIXAJxSpwikVJdyAuHD9qkP5/62tsE8j9dgb+0S8bB7UXbdwW Pcdsh3s1L/bslSYzetQpoZVmuWZq5S+W1fM8iCZXYaQHMkgEJ9UJ0ewwUBnS6Fpf Bf97aEplwjiD98Y//jWa4EVDd1VT7BiUyoogZGDUy60cRSldevZ/+atQHySmUa5U pa2FrnzNz5JC137fxhxlU05oXoV2UtUaO5KJz47hzSg8SrIC2IttvQlg+2o+B89Z V796/nBLP+zCb7fCJ4g== Received: from hhmail04.hh.imgtec.org ([217.156.249.195]) by mx08-00376f01.pphosted.com (PPS) with ESMTPS id 3vvrys2qa7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 30 Jan 2024 18:21:29 +0000 (GMT) Received: from HHMAIL04.hh.imgtec.org (10.100.10.119) by HHMAIL04.hh.imgtec.org (10.100.10.119) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 30 Jan 2024 18:21:28 +0000 Received: from GBR01-LO4-obe.outbound.protection.outlook.com (104.47.85.104) by email.imgtec.com (10.100.10.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Tue, 30 Jan 2024 18:21:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OFtsiLCkfqX4L4vDwFqyqiX55ybpJWNZt8apec/THzElMQNd93qeTStaw/3WfWZA9jZoteDI9HIdzHH0lrvr8TvTT51Xk0oGRS3lfJfV8u/pjBTk+bJLm+ozmmryBonIhzgQXwdf3mintl5sYZCCx7QUVBAzkzTzi6hj2N7pngEX1rq1QQVHD4O8o8wFQO0xP6Iqzpm8lft0LJQZwGA2cIwPGZ/b9SUWTKr5mibcHFKUZJwub2hXB7cGGXGuQhoyRlNcOkxrhPHMG+O0IodEqvATN8Ls4WrPsVGaOUZ1/X3RI2DB+cKWCXCZJEuYPE1yNaY/DoLxVS2xU2U4byGcfQ== 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=ziWus1KDr8+Iw1lACfYtQ3UVBbFbORL3my5fuYt0Ifc=; b=eZene3qykZcq9zNsl7zMZj5Cxw+UXcLOJA0XYjzT54pY4J3gD9/HPGrAjdBPWHH6Agl5wTPIEzPUz9Blr/b4AWsXxhHPG/RlZ1bp0qVY3dtJax9nC6tvjpVpHEVwu5iGO6pMBn015lrvMO31ZSboyyoeUDic9AMWJZbi+14z+i8lLgNyKxvUKL7ls5shqvH188Y/le2f4q06/Jrzww7vRwmy37c0h2ipMDcuNN3jIRrGvvz9MojdusrW3ye8WPJwQ0zl8n1Chj0tYVRZ6IkKDIl2vsVJRBX3j2kP5aTmETcesmoSXTqnNHPLBJY64djGUiDe0WKxsZQyjPAfEsepLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=imgtec.com; dmarc=pass action=none header.from=imgtec.com; dkim=pass header.d=imgtec.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=IMGTecCRM.onmicrosoft.com; s=selector2-IMGTecCRM-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ziWus1KDr8+Iw1lACfYtQ3UVBbFbORL3my5fuYt0Ifc=; b=cLZYX94pyxlLMzrBLHUcreOIHY4pweaEYVjOr0MO7CjuTFlPTajLWxGCIAXcBR8YxKfRmGwKdkaGUZrR6kSJaqqnwSobfoqaQd3RHyptuOnbwX9DG/JuybXRwqoqg2tYqjPdHtvR6iCL5hsrsxaxx8C5qiKSFY73l8vxKQvRQz0= Received: from LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:29f::11) by LO4P265MB6204.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:278::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.34; Tue, 30 Jan 2024 18:21:25 +0000 Received: from LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM ([fe80::d26e:fda5:26c6:6cbf]) by LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM ([fe80::d26e:fda5:26c6:6cbf%4]) with mapi id 15.20.7228.029; Tue, 30 Jan 2024 18:21:25 +0000 From: Joseph Faulls <Joseph.Faulls@imgtec.com> To: "binutils@sourceware.org" <binutils@sourceware.org> CC: "nelson@rivosinc.com" <nelson@rivosinc.com>, "palmer@rivosinc.com" <palmer@rivosinc.com> Subject: [PATCH] bfd: check for truncation with R_RISCV_32 relocations Thread-Topic: [PATCH] bfd: check for truncation with R_RISCV_32 relocations Thread-Index: AdpTqRYPZ5AHtJbtTYS17vOpoVG5Pw== Date: Tue, 30 Jan 2024 18:21:25 +0000 Message-ID: <LO4P265MB59148A03F40658E472D79B60807D2@LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LO4P265MB5914:EE_|LO4P265MB6204:EE_ x-ms-office365-filtering-correlation-id: 7a2ee4cf-3feb-44cd-6ea1-08dc21c04512 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: D1TKnWb/6w5dX3iX6LbQiNEo/AgRAL3tYiu1vrkUmiodWSgXHO7dNtrwzEBMeGYSmXC/2nczrFhvjBGATcUYCn71rEYmI0CEkOC2wogaCUf/9ZTuguEYN6qDkeLMC0EFkREtzMFt2n5xPHtzuL5ChnPwKpSISmJBgR4a2qF7Icpvi3VJx26Kkv9TANWkGkCZlkTCOdUsZmA5CGRIg2BTi9FwqqLDPyxrn1EoExCLodvfy9JkAS2FHiLDTN7nS+htEtgBXEc/QiLumcAWdpOrH69ZyXK6z5Uy1NdqQ+cZNa7GzXPiftfvHW06X/w0TQkaIWbe0Co/frmwPUVQD+OOh6g9CXflbe63i90oA9vzR2BYrgDjx+vESWs77Ex3LlFuKKPQ0Y10H5xXzyoV5o64VjiFU5UU5uS9F2voh8wmdS0hHIcFTOfx7SPgfowJGCkKyFCJWwShX+Rmb5oP8GSj8v+8CVZ3bVgAVywZ33HCzSL3TLx4nky8FWxKa8oPdScKMIh0sYKt1bk/yghStiI9PwtvXA+0P6rx4rQIY56kXpH/NBLzTCjmVIzFGzxOhxLoTzWedI9PfZkiiLRp8hWw48oxcFP5tDrFgF/wIOixJGA= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230031)(366004)(376002)(396003)(136003)(39850400004)(346002)(230922051799003)(186009)(451199024)(64100799003)(1800799012)(8936002)(8676002)(4326008)(52536014)(33656002)(5660300002)(86362001)(2906002)(66446008)(64756008)(66946007)(66556008)(66476007)(316002)(6916009)(38070700009)(26005)(54906003)(166002)(38100700002)(76116006)(122000001)(9686003)(478600001)(71200400001)(6506007)(7696005)(83380400001)(966005)(41300700001)(55016003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: bwaOs/m4m77ghG8JC3HorJWoGNOhwyBFndC+Dd0vSL1gj3nqZ2R7bfkHk8Tav9cfzX5s/noJBKV9AYe+F/QNTgwNO3YRJ1anynY987KI5EIbBNYo6qqNAEbCsvQctlrb1ofttyuKngxGDFJ1cle81AhvVLcSG+9RU0YzR4cX0YnbtC3FFR86x3dG72cfyJHzksonCreTCBtRfvp6IzD0Wf23UTmpvyUCYkjWoIE94GDAlZHKhoGjFy29tTE1+IzZRYGd43uf1XC1jLzfTagQQgZkacgKenQA0njqEgh4abDUO8RD9rqaBI8w9riVbt/piYyvK4i6oQVPnVwyyzfbfMYIeqidrEti+LueS2ZOFt/wyOMiBqkqGxVeQjEvG4z91WtBSg3Ysh5rPEiB/HsgTy2hICkh/hXWITSXtu8t00FZUnL0801WUUSf6jpJk0alyOovcnRPBFXbkNMQLLHcIueE3vbb+46KRoFQrzGM4neBpP3R5plSisFCjZabXFKspHR9Es3ykiIaca4PGG5TIl40mXah3reSO71QozSLJ8QBZvWeI8gu1H5A3OxY8RO0vc34RTb5Wv3W3qSIIPC+vd1jVm5zfKI5mY9LxZe7BCEUNqL6ZFlvDeAKumNwKWuGHOWlNpYNlTdAgYjQ5XoV25srogGsi7iv5rM9NvrKjsctYugp4eGNuoTtDdCFsK5yietkW8fbbAZitAKc21fxhSWHLL160JloGyT4IN6mb3y9flJs2r2BrznJQImBoS0ejn7tMMKO45xbLiWO+KD4tKzEuQnmAqBXgF15dJn+Nun8Nv/mBN6FbgUbOJF72gaSPTsHwZCFubm53Oqj84xiEs4tkws6vzh3aFXzQXmT4+qp9fParf4HxKcLTQPW0egIft4EHy3hKHN+hrstze81jnrGcoEZUT7hsFxyrD7RJ44MzHnCfE7r4WsxcfxNZx/91WDHnm5udgpCvrbTs0gvveZLr9TIpJf9DjqbhcjqVPtGuy2AFx3O8kOCWIzgdIwiSHp8Ns9gCwriLnj32cmPA74uL5a3pVKnNNYKqPbCHT46O73yGwxnjbHI+YyEiwRZnFf2rpsmqTQL6wAipno6CLAarJvO7ONqfomkP4aLWP9tpaOdBogx7r5wkzA6jsb940jCAY/4femXQ2CXrMURqVPGNY3MBRwtr1IY7wStmj5O3ozQdRjpEB+VipJy+N+LG3K7MekveaHykNtgW7IkdbB0LKIUqaytb0X51TdOfQ+JtH996Zpm+fEPziFEGgCioBxt4pjxJT8dzWefTkHoNjiycBIUoVA5jclDoOK1tMsQ6b5mOfewqhOz8vmNaQxPB/zzdIkm/51ZjwtSivG1ijYESV64Ai0SKz80TxXsNGm8WVIdCqsSwY7kxbVWhO+Qd+TL8HjBG70fVwL4hYdJYeBNrO2ZXKK3txq6/G/8r6YCjxBuzhXwXdpJZX7nKgnw7tPD6O16fTCmEIwwmlCXPGA3L2CzLfzd8mpMlhrqhzJlq2EElP74bHivvqyjENdXecL2Jvl3LasV0/swzl66Ewe6XxCIef8Qn8S0rMgIIGLBmEj2w3z5DEZ4452apuyv Content-Type: multipart/alternative; boundary="_000_LO4P265MB59148A03F40658E472D79B60807D2LO4P265MB5914GBRP_" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 7a2ee4cf-3feb-44cd-6ea1-08dc21c04512 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2024 18:21:25.5488 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0d5fd8bb-e8c2-4e0a-8dd5-2c264f7140fe X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 2FkQzUaHM0SuY++AAFw6jQ3VYHKs61/nFKgPz9tuCkYh8gAL5Rownd25GvWuMAhocIgTjleVR92/KmktxsT8zIHxjygbrTmu4lU9T6q8t5o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO4P265MB6204 X-OriginatorOrg: imgtec.com X-EXCLAIMER-MD-CONFIG: 15a78312-3e47-46eb-9010-2e54d84a9631 X-Proofpoint-GUID: 1KcQL7py2OGRizRkNYGOh3jsWHs_Dth4 X-Proofpoint-ORIG-GUID: 1KcQL7py2OGRizRkNYGOh3jsWHs_Dth4 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_LOW, 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789540598538549555 X-GMAIL-MSGID: 1789540598538549555 |
Series |
bfd: check for truncation with R_RISCV_32 relocations
|
|
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | fail | Git am fail log |
Commit Message
Joseph Faulls
Jan. 30, 2024, 6:21 p.m. UTC
Relevant bug report: https://sourceware.org/bugzilla/show_bug.cgi?id=31318 With high addresses, these relocations can be truncated. In these cases, throw an error instead of silently truncating. bfd/ * elfnn-riscv.c (perform_relocation): Check for overflow. ld/ * ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated. * ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d: New test case. --- bfd/elfnn-riscv.c | 3 +++ ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d | 4 ++++ ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp | 1 + 3 files changed, 8 insertions(+) create mode 100644 ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d -- 2
Comments
It's been a long time so I forgot the details, if we add this overflow checks for ADD/SUB/SET relocations, then the regression will fail since we may generate 32-bit debug information for the rv64 toolchain in gcc, and that's why we always silent the truncated error. Not sure if that also fails for now, we need to make sure of that at first. Nelson On Wed, Jan 31, 2024 at 2:21 AM Joseph Faulls <Joseph.Faulls@imgtec.com> wrote: > Relevant bug report: https://sourceware.org/bugzilla/show_bug.cgi?id=31318 > > > > With high addresses, these relocations can be truncated. In these cases, > > throw an error instead of silently truncating. > > > > bfd/ > > * elfnn-riscv.c (perform_relocation): Check for overflow. > > > > ld/ > > * ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated. > > * ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d: > > New test case. > > --- > > bfd/elfnn-riscv.c | 3 +++ > > ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d | 4 ++++ > > ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp | 1 + > > 3 files changed, 8 insertions(+) > > create mode 100644 > ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d > > > > diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c > > index 8b27e3b8d6a..975b40e5f53 100644 > > --- a/bfd/elfnn-riscv.c > > +++ b/bfd/elfnn-riscv.c > > @@ -1865,6 +1865,9 @@ perform_relocation (const reloc_howto_type *howto, > > } > > > > case R_RISCV_32: > > + if (value & ~howto->dst_mask) > > + return bfd_reloc_overflow; > > + break; > > case R_RISCV_64: > > case R_RISCV_ADD8: > > case R_RISCV_ADD16: > > diff --git a/ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d > b/ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d > > new file mode 100644 > > index 00000000000..925d1cdb662 > > --- /dev/null > > +++ b/ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d > > @@ -0,0 +1,4 @@ > > +#source: data-reloc.s > > +#as: -march=rv64i -mabi=lp64 -defsym __abs__=1 > > +#ld: -m[riscv_choose_lp64_emul] -Ttext 0x8000 --defsym _start=0x0 > --defsym abs=0xc00000100 --defsym abs_local=0x200 > > +#error: .*relocation truncated to fit: R_RISCV_32 > > diff --git a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp > b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp > > index 7e1281d826b..5a4d8728366 100644 > > --- a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp > > +++ b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp > > @@ -175,6 +175,7 @@ if [istarget "riscv*-*-*"] { > > run_dump_test "uleb128" > > run_dump_test "pr31179" > > run_dump_test "pr31179-r" > > + run_dump_test "data-reloc-rv64-abs32-truncation" > > run_ld_link_tests [list \ > > [list "Weak reference 32" "-T weakref.ld > -m[riscv_choose_ilp32_emul]" "" \ > > "-march=rv32i -mabi=ilp32" {weakref32.s} \ > > -- > > 2 >
On Jan 30 2024, Joseph Faulls wrote: > diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c > index 8b27e3b8d6a..975b40e5f53 100644 > --- a/bfd/elfnn-riscv.c > +++ b/bfd/elfnn-riscv.c > @@ -1865,6 +1865,9 @@ perform_relocation (const reloc_howto_type *howto, > } > > case R_RISCV_32: > + if (value & ~howto->dst_mask) > + return bfd_reloc_overflow; > + break; The overflow check belongs to the howto table.
Replying to both comments
* It's been a long time so I forgot the details, if we add this overflow checks for ADD/SUB/SET relocations, then the regression will fail since we may generate 32-bit debug information for the rv64 toolchain in gcc, and that's why we always silent the truncated error. Not sure if that also fails for now, we need to make sure of that at first.
Yes, I initially did that and that’s exactly what happens. The debug information doesn’t seem to use R_RISCV_32 so it hasn’t caused any errors in the gcc test suite when the data and/or text is put at a high address. All the failures were truncation of other relocations like R_RISCV_HI20, RISCV_PCREL_HI20 and R_RISCV_GOT_HI20.
* The overflow check belongs to the howto table.
For the reason Nelson gave above, I don’t think this is a good idea. We’d see a lot of failures on truncation of debug information.
Thanks,
Joe
From: Nelson Chu <nelson@rivosinc.com>
Sent: Tuesday, January 30, 2024 11:39 PM
To: Joseph Faulls <Joseph.Faulls@imgtec.com>
Cc: binutils@sourceware.org; palmer@rivosinc.com
Subject: [EXTERNAL] Re: [PATCH] bfd: check for truncation with R_RISCV_32 relocations
*** CAUTION: This email originates from a source not known to Imagination Technologies. Think before you click a link or open an attachment ***
It's been a long time so I forgot the details, if we add this overflow checks for ADD/SUB/SET relocations, then the regression will fail since we may generate 32-bit debug information for the rv64 toolchain in gcc, and that's why we always silent the truncated error. Not sure if that also fails for now, we need to make sure of that at first.
Nelson
On Wed, Jan 31, 2024 at 2:21 AM Joseph Faulls <Joseph.Faulls@imgtec.com<mailto:Joseph.Faulls@imgtec.com>> wrote:
Relevant bug report: https://sourceware.org/bugzilla/show_bug.cgi?id=31318 [sourceware.org]<https://urldefense.com/v3/__https:/sourceware.org/bugzilla/show_bug.cgi?id=31318__;!!KCwjcDI!wulN0Qao5f5Oo-QZuqVs3Oqa3M05CJfg5GTFUC0w5F2ASD-BVSAdYyHz60Izzx94bwpD3ks9VJPpDPvnnZb7$>
With high addresses, these relocations can be truncated. In these cases,
throw an error instead of silently truncating.
bfd/
* elfnn-riscv.c (perform_relocation): Check for overflow.
ld/
* ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated.
* ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d:
New test case.
---
bfd/elfnn-riscv.c | 3 +++
ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d | 4 ++++
ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp | 1 +
3 files changed, 8 insertions(+)
create mode 100644 ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index 8b27e3b8d6a..975b40e5f53 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -1865,6 +1865,9 @@ perform_relocation (const reloc_howto_type *howto,
}
case R_RISCV_32:
+ if (value & ~howto->dst_mask)
+ return bfd_reloc_overflow;
+ break;
case R_RISCV_64:
case R_RISCV_ADD8:
case R_RISCV_ADD16:
diff --git a/ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d b/ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d
new file mode 100644
index 00000000000..925d1cdb662
--- /dev/null
+++ b/ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d
@@ -0,0 +1,4 @@
+#source: data-reloc.s
+#as: -march=rv64i -mabi=lp64 -defsym __abs__=1
+#ld: -m[riscv_choose_lp64_emul] -Ttext 0x8000 --defsym _start=0x0 --defsym abs=0xc00000100 --defsym abs_local=0x200
+#error: .*relocation truncated to fit: R_RISCV_32
diff --git a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp
index 7e1281d826b..5a4d8728366 100644
--- a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp
+++ b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp
@@ -175,6 +175,7 @@ if [istarget "riscv*-*-*"] {
run_dump_test "uleb128"
run_dump_test "pr31179"
run_dump_test "pr31179-r"
+ run_dump_test "data-reloc-rv64-abs32-truncation"
run_ld_link_tests [list \
[list "Weak reference 32" "-T weakref.ld -m[riscv_choose_ilp32_emul]" "" \
"-march=rv32i -mabi=ilp32" {weakref32.s} \
--
2
Ping – any thoughts on this? From: Joseph Faulls Sent: Wednesday, January 31, 2024 2:08 PM To: Nelson Chu <nelson@rivosinc.com>; schwab@suse.de Cc: binutils@sourceware.org; palmer@rivosinc.com Subject: Re: [PATCH] bfd: check for truncation with R_RISCV_32 relocations Replying to both comments * It's been a long time so I forgot the details, if we add this overflow checks for ADD/SUB/SET relocations, then the regression will fail since we may generate 32-bit debug information for the rv64 toolchain in gcc, and that's why we always silent the truncated error. Not sure if that also fails for now, we need to make sure of that at first. Yes, I initially did that and that’s exactly what happens. The debug information doesn’t seem to use R_RISCV_32 so it hasn’t caused any errors in the gcc test suite when the data and/or text is put at a high address. All the failures were truncation of other relocations like R_RISCV_HI20, RISCV_PCREL_HI20 and R_RISCV_GOT_HI20. * The overflow check belongs to the howto table. For the reason Nelson gave above, I don’t think this is a good idea. We’d see a lot of failures on truncation of debug information. Thanks, Joe From: Nelson Chu <nelson@rivosinc.com<mailto:nelson@rivosinc.com>> Sent: Tuesday, January 30, 2024 11:39 PM To: Joseph Faulls <Joseph.Faulls@imgtec.com<mailto:Joseph.Faulls@imgtec.com>> Cc: binutils@sourceware.org<mailto:binutils@sourceware.org>; palmer@rivosinc.com<mailto:palmer@rivosinc.com> Subject: [EXTERNAL] Re: [PATCH] bfd: check for truncation with R_RISCV_32 relocations *** CAUTION: This email originates from a source not known to Imagination Technologies. Think before you click a link or open an attachment *** It's been a long time so I forgot the details, if we add this overflow checks for ADD/SUB/SET relocations, then the regression will fail since we may generate 32-bit debug information for the rv64 toolchain in gcc, and that's why we always silent the truncated error. Not sure if that also fails for now, we need to make sure of that at first. Nelson On Wed, Jan 31, 2024 at 2:21 AM Joseph Faulls <Joseph.Faulls@imgtec.com<mailto:Joseph.Faulls@imgtec.com>> wrote: Relevant bug report: https://sourceware.org/bugzilla/show_bug.cgi?id=31318 [sourceware.org]<https://urldefense.com/v3/__https:/sourceware.org/bugzilla/show_bug.cgi?id=31318__;!!KCwjcDI!wulN0Qao5f5Oo-QZuqVs3Oqa3M05CJfg5GTFUC0w5F2ASD-BVSAdYyHz60Izzx94bwpD3ks9VJPpDPvnnZb7$> With high addresses, these relocations can be truncated. In these cases, throw an error instead of silently truncating. bfd/ * elfnn-riscv.c (perform_relocation): Check for overflow. ld/ * ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated. * ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d: New test case. --- bfd/elfnn-riscv.c | 3 +++ ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d | 4 ++++ ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp | 1 + 3 files changed, 8 insertions(+) create mode 100644 ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c index 8b27e3b8d6a..975b40e5f53 100644 --- a/bfd/elfnn-riscv.c +++ b/bfd/elfnn-riscv.c @@ -1865,6 +1865,9 @@ perform_relocation (const reloc_howto_type *howto, } case R_RISCV_32: + if (value & ~howto->dst_mask) + return bfd_reloc_overflow; + break; case R_RISCV_64: case R_RISCV_ADD8: case R_RISCV_ADD16: diff --git a/ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d b/ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d new file mode 100644 index 00000000000..925d1cdb662 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d @@ -0,0 +1,4 @@ +#source: data-reloc.s +#as: -march=rv64i -mabi=lp64 -defsym __abs__=1 +#ld: -m[riscv_choose_lp64_emul] -Ttext 0x8000 --defsym _start=0x0 --defsym abs=0xc00000100 --defsym abs_local=0x200 +#error: .*relocation truncated to fit: R_RISCV_32 diff --git a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp index 7e1281d826b..5a4d8728366 100644 --- a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp +++ b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp @@ -175,6 +175,7 @@ if [istarget "riscv*-*-*"] { run_dump_test "uleb128" run_dump_test "pr31179" run_dump_test "pr31179-r" + run_dump_test "data-reloc-rv64-abs32-truncation" run_ld_link_tests [list \ [list "Weak reference 32" "-T weakref.ld -m[riscv_choose_ilp32_emul]" "" \ "-march=rv32i -mabi=ilp32" {weakref32.s} \ -- 2
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c index 8b27e3b8d6a..975b40e5f53 100644 --- a/bfd/elfnn-riscv.c +++ b/bfd/elfnn-riscv.c @@ -1865,6 +1865,9 @@ perform_relocation (const reloc_howto_type *howto, } case R_RISCV_32: + if (value & ~howto->dst_mask) + return bfd_reloc_overflow; + break; case R_RISCV_64: case R_RISCV_ADD8: case R_RISCV_ADD16: diff --git a/ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d b/ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d new file mode 100644 index 00000000000..925d1cdb662 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/data-reloc-rv64-abs32-truncation.d @@ -0,0 +1,4 @@ +#source: data-reloc.s +#as: -march=rv64i -mabi=lp64 -defsym __abs__=1 +#ld: -m[riscv_choose_lp64_emul] -Ttext 0x8000 --defsym _start=0x0 --defsym abs=0xc00000100 --defsym abs_local=0x200 +#error: .*relocation truncated to fit: R_RISCV_32 diff --git a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp index 7e1281d826b..5a4d8728366 100644 --- a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp +++ b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp @@ -175,6 +175,7 @@ if [istarget "riscv*-*-*"] { run_dump_test "uleb128" run_dump_test "pr31179" run_dump_test "pr31179-r" + run_dump_test "data-reloc-rv64-abs32-truncation" run_ld_link_tests [list \ [list "Weak reference 32" "-T weakref.ld -m[riscv_choose_ilp32_emul]" "" \ "-march=rv32i -mabi=ilp32" {weakref32.s} \