From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 84B073857340; Wed, 20 Dec 2023 16:00:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84B073857340 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Szabolcs Nagy To: bfd-cvs@sourceware.org Subject: [binutils-gdb/binutils-2_41-branch] aarch64-elf: FAIL: indirect call stub to BTI stub relaxation X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/binutils-2_41-branch X-Git-Oldrev: 3d37af699dd1e0a27b6b3e4f2fef7e673574564a X-Git-Newrev: 5f41ff2d2cddd6d477351b36353ba1cf89bdafe7 Message-Id: <20231220160025.84B073857340@sourceware.org> Date: Wed, 20 Dec 2023 16:00:25 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2023 16:00:25 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D5f41ff2d2cdd= d6d477351b36353ba1cf89bdafe7 commit 5f41ff2d2cddd6d477351b36353ba1cf89bdafe7 Author: Alan Modra Date: Mon Dec 4 08:48:34 2023 +1030 aarch64-elf: FAIL: indirect call stub to BTI stub relaxation =20 aarch64-elf fails the ld-aarch64/bfd-far-3.d test, due to the stubs being emitted in a different order to that of aarch64-linux. They are emitted in a different order due to stub names for local symbols having the section id in the stub name. aarch64-linux-ld generates one more section than aarch64-elf-ld. That section is .gnu.hash. So the stub names differ and are hashed to different slots in stub_hash_table. =20 Fix this by running the test with --hash-style=3Dsysv, and adjust expected output. I've also changed the branch over stubs emitted at the start of a group of stubs to not care about the symbol, for all groups not just the one that needed changing. =20 * ld-aarch64/bti-far-3.d: Add --hash-style=3Dsysv. Adjust expected output. =20 (cherry picked from commit 21a2a3d567a2af583768b5f614403e65611c58a5) Diff: --- ld/testsuite/ld-aarch64/bti-far-3.d | 51 ++++++++++++++++++---------------= ---- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/ld/testsuite/ld-aarch64/bti-far-3.d b/ld/testsuite/ld-aarch64/= bti-far-3.d index b27d8b56548..f04ce94f0ac 100644 --- a/ld/testsuite/ld-aarch64/bti-far-3.d +++ b/ld/testsuite/ld-aarch64/bti-far-3.d @@ -2,7 +2,7 @@ #source: bti-far-3a.s #source: bti-far-3b.s #source: bti-far-3c.s -#ld: -shared -T bti-far-3.ld +#ld: -shared --hash-style=3Dsysv -T bti-far-3.ld #objdump: -dr =20 [^:]*: *file format elf64-.*aarch64 @@ -25,7 +25,7 @@ Disassembly of section \.plt: 20024: f9401211 ldr x17, \[x16, #32\] 20028: 91008210 add x16, x16, #0x20 2002c: d61f0220 br x17 - 20030: 14000004 b 20040 <__extern_func_bti_veneer\+0x8> + 20030: 14000004 b 20040 .* 20034: d503201f nop =20 0000000000020038 <__extern_func_bti_veneer>: @@ -38,12 +38,12 @@ Disassembly of section \.text: 30000: 15c00004 b 7030010 <__b_func_veneer> 30004: 17ffc007 b 20020 \.\.\. - 7030008: 1400000a b 7030030 <__a_func_bti_veneer\+0x8> + 7030008: 1400000a b 7030030 .* 703000c: d503201f nop =20 0000000007030010 <__b_func_veneer>: 7030010: 90040010 adrp x16, f030000 - 7030014: 9101e210 add x16, x16, #0x78 + 7030014: 91018210 add x16, x16, #0x60 7030018: d61f0200 br x16 \.\.\. =20 @@ -53,34 +53,33 @@ Disassembly of section \.text: \.\.\. =20 0000000008030030 : - 8030030: 15c00004 b f030040 <__c_func_veneer> - 8030034: 15c00005 b f030048 <__a_func_veneer> + 8030030: 15c0000a b f030058 <__c_func_veneer> + 8030034: 15c00003 b f030040 <__a_func_veneer> \.\.\. - f030038: 14000012 b f030080 <__b_func_bti_veneer\+0x8> + f030038: 14000012 b f030080 .* f03003c: d503201f nop =20 -000000000f030040 <__c_func_veneer>: - f030040: d503245f bti c - f030044: 1440000f b 10030080 - -000000000f030048 <__a_func_veneer>: - f030048: 90fc0010 adrp x16, 7030000 - f03004c: 9100a210 add x16, x16, #0x28 - f030050: d61f0200 br x16 +000000000f030040 <__a_func_veneer>: + f030040: 90fc0010 adrp x16, 7030000 + f030044: 9100a210 add x16, x16, #0x28 + f030048: d61f0200 br x16 \.\.\. =20 -000000000f030060 <__extern_func_veneer>: - f030060: 90f87f90 adrp x16, 20000 <\.plt> - f030064: 9100e210 add x16, x16, #0x38 - f030068: d61f0200 br x16 - \.\.\. +000000000f030058 <__c_func_veneer>: + f030058: d503245f bti c + f03005c: 14400009 b 10030080 + +000000000f030060 <__b_func_bti_veneer>: + f030060: d503245f bti c + f030064: 163ffff3 b 8030030 =20 -000000000f030078 <__b_func_bti_veneer>: - f030078: d503245f bti c - f03007c: 163fffed b 8030030 +000000000f030068 <__extern_func_veneer>: + f030068: 90f87f90 adrp x16, 20000 <\.plt> + f03006c: 9100e210 add x16, x16, #0x38 + f030070: d61f0200 br x16 \.\.\. =20 0000000010030080 : - 10030080: 17bffff2 b f030048 <__a_func_veneer> - 10030084: 17bffffd b f030078 <__b_func_bti_veneer> - 10030088: 17bffff6 b f030060 <__extern_func_veneer> + 10030080: 17bffff0 b f030040 <__a_func_veneer> + 10030084: 17bffff7 b f030060 <__b_func_bti_veneer> + 10030088: 17bffff8 b f030068 <__extern_func_veneer>