From owner-freebsd-mips@freebsd.org Thu Nov 8 18:02:19 2018 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 268B31132A27 for ; Thu, 8 Nov 2018 18:02:19 +0000 (UTC) (envelope-from thiago.gjc@hotmail.com) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-oln040092253059.outbound.protection.outlook.com [40.92.253.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CC5F8AA2A for ; Thu, 8 Nov 2018 18:02:17 +0000 (UTC) (envelope-from thiago.gjc@hotmail.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q5MY8FgCWgUjuImtqcP8og41TOGFumPCDgWrDDayAoE=; b=vHAXiDxrv4WJDXOOvlUjGEoX1rftuY7s6v4R5G5f6Skz4VzI34PC7GYm7vtVBMNFJbnwW6+xMp+PWjK5wTc0Lrd+4h/6iBGWwMPwq7JPz1iJbGMC8HpFAWyKgQeLu+RIafCkZWP/rAUOva+d3kY68ir3o6HEreQAyUDZ4VbeP4zVkxEt7T8AuYsZUbeZKEfJPIPIF+OkDAshkxwJU+3TZhXNl20I9F0n5MrL7oOSve5SFlfpI3Tb5S+TGf2+JQjrWLQVIL+SKsRkWIR+65OttiV13cnwSaGXKwualepgDvFTl9K+PRR1JAJmn4FdHzoxLr0IC5EUFz2tIn19IRXzbg== Received: from HK2APC01FT062.eop-APC01.prod.protection.outlook.com (10.152.248.59) by HK2APC01HT151.eop-APC01.prod.protection.outlook.com (10.152.249.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10; Thu, 8 Nov 2018 18:02:13 +0000 Received: from HK2PR03MB0834.apcprd03.prod.outlook.com (10.152.248.59) by HK2APC01FT062.mail.protection.outlook.com (10.152.249.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Thu, 8 Nov 2018 18:02:13 +0000 Received: from HK2PR03MB0834.apcprd03.prod.outlook.com ([fe80::c0da:b203:87ac:3d62]) by HK2PR03MB0834.apcprd03.prod.outlook.com ([fe80::c0da:b203:87ac:3d62%5]) with mapi id 15.20.1339.009; Thu, 8 Nov 2018 18:02:13 +0000 From: brito augusto To: "freebsd-mips@freebsd.org" Subject: =?utf-8?B?0JHQuNCx0LvQuNC4INC00LAgISDQmtC+0L3RgdGC0LjRgtGD0YbQuNC4INC9?= =?utf-8?B?0LXRgiAhICBCaWJsZSB5ZXMhIENvbnN0aXR1dGlvbiBubyEgMDMtMDItMTE=?= Thread-Topic: =?utf-8?B?0JHQuNCx0LvQuNC4INC00LAgISDQmtC+0L3RgdGC0LjRgtGD0YbQuNC4INC9?= =?utf-8?B?0LXRgiAhICBCaWJsZSB5ZXMhIENvbnN0aXR1dGlvbiBubyEgMDMtMDItMTE=?= Thread-Index: AQHUd40t8/KxnAn04UqTdrnjzNfx0g== Date: Thu, 8 Nov 2018 18:02:13 +0000 Message-ID: Reply-To: "Bible Yes, Constitution No." Accept-Language: pt-BR, en-US Content-Language: en-US X-MS-Has-Attach: X-Auto-Response-Suppress: All X-MS-TNEF-Correlator: x-clientproxiedby: OSAPR01CA0167.jpnprd01.prod.outlook.com (2603:1096:604:d::35) To HK2PR03MB0834.apcprd03.prod.outlook.com (2a01:111:e400:a425::15) x-incomingtopheadermarker: OriginalChecksum:02EA634C0111186E1C73269BAB694ED4E35F4D848058F4B0C7D682EC015613B8; UpperCasedChecksum:96C707939535500BCF1E8B1AF241FB85562C3C31ED9F72BE3934037761C302DF; SizeAsReceived:7848; Count:51 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [x2rS346PJKW0GqFrctKR6MmHdRaG7LgLyQtXw4J5AEpLCsLBn92CyU4J/CQeknjg] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HK2APC01HT151; 6:JjxFHgz84TCrzP/RcblllFlPt7diC3Yo6sriHZ2JJju5p2SL2lk67JyepMRLiXjom48qvfii3iNya9bR94hOBvRT3rTjUxjbwVJH+9venMGPmPjcCl6McM0arNq0plejAU+NPs34Z0K4KI95YispyZ7YWdqTUSYqQGwn+AGcEpnObkd6AY8bGkN1+bG2xQR1SCGEI1Whm8bzA/ooX1kQFf3eV/zXn+ZEnB5eR8k5PtDtF/CwCUWvxYUUqwYi5XZjPxdt1DpQXCw5PXHSS7p4Ud9eKR0+WcvLPlfiPagygKs2JrIDUVL9vDpfseO6hfVbXugZpJLlR1D8aws/0jI/JkSWAzQK1yGamXCv+pBpHWt5Lv1hisrjjWZBZnDrxQJ3xBO0ldAkx0Qg5Lj9t8nQJPn7lQEEQZEQpI6am69P7u9f6p1QgRx2zlOU6GMcl3aJNrahu6TxlV/4/EQwfpiTbg==; 5:BqyOdmFD/VA/W8S+HME9Ldrez4w8fTJRtzABac4OVk3cagekhwthIx4KBeDjRUTgvwdHI30zae2nvuaAKNVfAgR2JISvezueJa97fHDEcWSkWKWmFyYt04n0hNgrIi6Vcf3+BGr0KcjN5uSe6/Bwx8c+yA4B7lqHs3zv42rCMqw=; 7:QFDJLB+OB4SEqpUe3w8GNl6mqaYSti5HhgW5+qfimZS+0uM/A8e0rZsoJ3avwsDjirh4wW8BvXEnVZKkvdanpEkqk6IijeDHgqeQNcC4Y+po6ipGtPf+VkXGeq5N/7L+n1w/bEx5pS0amU0u4Nhoew== x-incomingheadercount: 51 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1601125500)(1603101475)(1701031045); SRVR:HK2APC01HT151; x-ms-traffictypediagnostic: HK2APC01HT151: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(4566010)(82015058); SRVR:HK2APC01HT151; BCL:0; PCL:0; RULEID:; SRVR:HK2APC01HT151; x-microsoft-antispam-message-info: k3wPPA9cDZKhGZsbeGiicM92xdmdhaEH6txth2I8qxwrIdQfcy0xUqu3mO8jDtrR MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 074d7d4d-72e2-4a0a-9d89-73b16535e4cd X-MS-Exchange-CrossTenant-Network-Message-Id: af864f64-dbf4-4c2e-ad1a-08d645a44fcb X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 074d7d4d-72e2-4a0a-9d89-73b16535e4cd X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Nov 2018 18:02:13.8747 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2APC01HT151 X-Rspamd-Queue-Id: 7CC5F8AA2A X-Spamd-Result: default: False [-3.81 / 200.00]; HAS_REPLYTO(0.00)[turboscreamer@gmx.com]; R_SPF_ALLOW(-0.20)[+ip4:40.92.0.0/14]; FREEMAIL_FROM(0.00)[hotmail.com]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[hotmail.com:+]; MIME_BASE64_TEXT(0.10)[]; DMARC_POLICY_ALLOW(-0.50)[hotmail.com,none]; SUBJECT_HAS_EXCLAIM(0.00)[]; MX_GOOD(-0.01)[hotmail-com.olc.protection.outlook.com,hotmail-com.olc.protection.outlook.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[hotmail.com]; ASN(0.00)[asn:8075, ipnet:40.64.0.0/10, country:US]; IP_SCORE(-0.56)[ipnet: 40.64.0.0/10(-0.48), asn: 8075(-2.23), country: US(-0.09)]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[hotmail.com]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FREEMAIL_REPLYTO(0.00)[gmx.com]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_SHORT(-0.33)[-0.333,0]; RCVD_IN_DNSWL_NONE(0.00)[59.253.92.40.list.dnswl.org : 127.0.3.0]; TO_DN_EQ_ADDR_ALL(0.00)[] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2018 18:02:19 -0000 0J/QntCa0J7Qm9CV0J3QmNCVINCY0JjQodCj0KHQkCDQpdCg0JjQodCi0JANCg0KDQoNCg0K0J/Q ntCa0J7Qm9CV0J3QmNCVINCc0KPQp9CV0J3QmNCm0JANCg0K0YPRh9C40YLRjCDRg9C80LjRgNCw 0YLRjA0KDQrQt9CwINCY0LjRgdGD0YHQsCDQpdGA0LjRgdGC0LANCg0KDQoNCg0K0K3QotCeINCc 0JjQndCY0KHQotCV0KDQodCi0JLQniDQk9Ce0JvQntCh0JAg0JLQntCh0KHQotCQ0J3QntCS0JvQ ldCd0JjQrywg0KLQntCb0KzQmtCeINCU0JLQldCg0Kwg0JTQm9CvINCg0JDQn9Ci0KPQoNCrINCm 0JXQoNCa0JLQmDoNCg0KDQpodHRwczovL3RoZWxhc3RlbGlqYWgud2Vicy5jb20vDQoNCg0KDQoN ClBSLiDQotCj0J/QmNCg0JDQndCYLCDQn9Ce0KHQm9CV0JTQndCY0Jkg0K3Qm9CY0K8uDQoNCtCR 0JjQkdCb0JjQryDQlNCQISDQmtCe0J3QodCi0JjQotCj0KbQmNCvINCd0JUhDQoNCjIwNzA6INCY 0JjQodCj0KEg0JLQntCX0JLQoNCQ0KnQkNCV0KLQodCvLg0KDQrQnNCrINCd0JUg0JzQkNCh0J7Q ndCe0JIhDQoNCg0KDQoNCg0KDQrigJzQktC+0YIsINCvINC/0L7RiNC70Y4g0Log0LLQsNC8INCY 0LvQuNGOINC/0YDQvtGA0L7QutCwINC/0YDQtdC0INC90LDRgdGC0YPQv9C70LXQvdC40LXQvCDQ tNC90Y8g0JPQvtGB0L/QvtC00L3Rjywg0LLQtdC70LjQutC+0LPQviDQuCDRgdGC0YDQsNGI0L3Q vtCz0L4uIiAo0JzQsNC70LDRhdC40Y8gNDo1KQ0KDQoNCg0K4oCc0JjQuNGB0YPRgSDRgdC60LDQ t9Cw0Lsg0LjQvCDQsiDQvtGC0LLQtdGCOiDQv9GA0LDQstC00LAsINCY0LvQuNGPINC00L7Qu9C2 0LXQvSDQv9GA0LjQtNGC0Lgg0L/RgNC10LbQtNC1INC4INGD0YHRgtGA0L7QuNGC0Ywg0LLRgdGR OyIgKNCc0LDRgtGE0LXRjyAxNzoxMSkNCg0KDQoNCg0KOTU2ODUxNjMNCg0KDQoNCg0KR0VORVJB VElPTiBKRVNVUyBDSFJJU1QNCg0KDQoNCkdFTkVSQVRJT04gT0YgTUFSVFlSUw0KDQoNClRFQUNI SU5HIFRPIERJRQ0KDQpGT1IgSkVTVVMgQ0hSSVNULg0KDQoNCg0KDQpUSElTIElTIFRIRSBNSU5J U1RSWSBPRiBUSEUgVk9JQ0UgT0YgUkVTVE9SQVRJT04sIFRIRSBPTkxZIERPT1IgRk9SIFRIRSBS QVBUVVJFIE9GIFRIRSBDSFVSQ0g6DQoNCg0KaHR0cHM6Ly90aGVsYXN0ZWxpamFoLndlYnMuY29t Lw0KDQoNCg0KDQpQUi4gVFVQSVJBTkksIFRIRSBMQVNUIEVMSUpBSC4NCg0KQklCTEUgWUVTISBD T05TVElUVVRJT04gTk8hDQoNCjIwNzA6IEpFU1VTIFdJTEwgUkVUVVJOLg0KDQpXRSBBUkVOJ1Qg RlJFRU1BU09OUyENCg0KDQoNCg0KDQoNCuKAnEJlaG9sZCwgSSB3aWxsIHNlbmQgeW91IEVsaWph aCB0aGUgcHJvcGhldCBiZWZvcmUgdGhlIGNvbWluZyBvZiB0aGUgZ3JlYXQgYW5kIGRyZWFkZnVs IGRheSBvZiB0aGUgTG9yZC4iIChNYWxhY2hpIDQ6NSkNCg0KDQrigJxFbGlqYWggdHJ1bHkgc2hh bGwgZmlyc3QgY29tZSBhbmQgcmVzdG9yZSBhbGwgdGhpbmdzLiIgKE1hdHRoZXcgMTc6MTEpDQoN Cg0KDQoNCg0KMDMtMDItMTENCg== From owner-freebsd-mips@freebsd.org Fri Nov 9 21:45:50 2018 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BE071109193 for ; Fri, 9 Nov 2018 21:45:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 9A52C8F8ED for ; Fri, 9 Nov 2018 21:45:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 5A71D1109192; Fri, 9 Nov 2018 21:45:49 +0000 (UTC) Delivered-To: mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3882E1109191 for ; Fri, 9 Nov 2018 21:45:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B57E98F8E1 for ; Fri, 9 Nov 2018 21:45:48 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id E4D4C15B56 for ; Fri, 9 Nov 2018 21:45:47 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id wA9LjlSs038183 for ; Fri, 9 Nov 2018 21:45:47 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id wA9LjllC038182 for mips@FreeBSD.org; Fri, 9 Nov 2018 21:45:47 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: mips@FreeBSD.org Subject: [Bug 231790] objcopy: corrupts relocation entries in big-endian mips64 output when adjusting symbol indexes Date: Fri, 09 Nov 2018 21:45:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: regression X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@freebsd.org X-Bugzilla-Status: Closed X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: emaste@freebsd.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-Rspamd-Queue-Id: 9A52C8F8ED X-Spamd-Result: default: False [-106.85 / 200.00]; ARC_NA(0.00)[]; FORGED_RECIPIENTS_FORWARDING(0.00)[]; ALLOW_DOMAIN_WHITELIST(-100.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORWARDED(0.00)[mips@mailman.ysv.freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_ONE(0.00)[1]; SPF_FAIL_FORWARDING(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCVD_IN_DNSWL_MED(-0.20)[5.0.0.0.0.5.0.0.0.0.0.0.0.0.0.0.a.6.0.2.4.5.2.2.0.0.9.1.1.0.0.2.list.dnswl.org : 127.0.9.2]; MX_GOOD(-0.01)[cached: mx66.freebsd.org]; FROM_NO_DN(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-3.64)[ip: (-9.80), ipnet: 2001:1900:2254::/48(-4.69), asn: 10310(-3.62), country: US(-0.09)]; ASN(0.00)[asn:10310, ipnet:2001:1900:2254::/48, country:US]; FORGED_RECIPIENTS(0.00)[mips@FreeBSD.org,freebsd-mips@freebsd.org]; RCVD_COUNT_SEVEN(0.00)[7]; TO_DOM_EQ_FROM_DOM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2018 21:45:50 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231790 --- Comment #12 from commit-hook@freebsd.org --- A commit references this bug: Author: emaste Date: Fri Nov 9 21:45:44 UTC 2018 New revision: 340309 URL: https://svnweb.freebsd.org/changeset/base/340309 Log: Fix objcopy for little-endian MIPS64 objects. MFC r338478 (jhb): Fix objcopy for little-endian MIPS64 objects. MIPS64 does not store the 'r_info' field of a relocation table entry as a 64-bit value consisting of a 32-bit symbol index in the high 32 bits and a 32-bit type in the low 32 bits as on other architectures. Instead, the 64-bit 'r_info' field is really a 32-bit symbol index followed by four individual byte type fields. For big-endian MIPS64, treating this as a 64-bit integer happens to be compatible with the layout expected by other architectures (symbol index in upper 32-bits of resulting "native" 64-bit integer). However, for little-endian MIPS64 the parsed 64-bit integer contains the symbol index in the low 32 bits and the 4 individual byte type fields in the upper 32-bits (but as if the upper 32-bits were byte-swapped). To cope, add two helper routines in gelf_getrel.c to translate between the correct native 'r_info' value and the value obtained after the normal byte-swap translation. Use these routines in gelf_getrel(), gelf_getrela= (), gelf_update_rel(), and gelf_update_rela(). This fixes 'readelf -r' on little-endian MIPS64 objects which was previously decoding incorrect relocations as well as 'objcopy: invalid symbox index' warnings from objcopy when extracting debug symbols from kernel modules. Even with this fixed, objcopy was still crashing when trying to extract debug symbols from little-endian MIPS64 modules. The workaround in gelf_*rel*() depends on the current ELF object having a valid ELF header so that the 'e_machine' field can be compared against EM_MIPS. objcopy was parsing the relocation entries to possibly rewrite the 'r_info' fields in the update_relocs() function before writing the initial ELF header to the destination object file. Move the initial write of the ELF header earlier before copy_contents() so that update_relocs() uses the correct symbol index values. Note that this change should really go upstream. The binutils readelf source has a similar hack for MIPS64EL though I implemented this version from scratch using the MIPS64 ABI PDF as a reference. MFC r339083 (emaste): libelf: correct mips64el test to use ELF header libelf maintains two views of endianness: e_byteorder, and e_ident[EI_DATA] in the ELF header itself. e_byteorder is not always kept in sync, so use the ELF header endianness to test for mips64el. MFC r339473 (emaste): libelf: also test for 64-bit ELF in _libelf_is_mips= 64el Although _libelf_is_mips64el is only called in contexts where we've already checked that e_class is ELFCLASS64 but this may change in the future. Add a safety belt so that we don't access an invalid e_ehdr64 union member if it does. PR: 231790 Changes: _U stable/11/ stable/11/contrib/elftoolchain/elfcopy/main.c stable/11/contrib/elftoolchain/libelf/Makefile stable/11/contrib/elftoolchain/libelf/_libelf.h stable/11/contrib/elftoolchain/libelf/gelf_mips64el.c stable/11/contrib/elftoolchain/libelf/gelf_rel.c stable/11/contrib/elftoolchain/libelf/gelf_rela.c stable/11/sys/sys/param.h --=20 You are receiving this mail because: You are on the CC list for the bug.=