From 0f6e12bcdffcec5fcea2133f011b64b52cf8129e Mon Sep 17 00:00:00 2001 From: Joel Galenson Date: Fri, 24 Aug 2018 16:22:42 +0000 Subject: [PATCH] Modify tests to show PLT entry labels llvm-svn: 340616 --- lld/test/ELF/aarch64-condb-reloc.s | 6 ++++++ lld/test/ELF/aarch64-gnu-ifunc-plt.s | 4 ++++ lld/test/ELF/aarch64-thunk-pi.s | 4 ++++ lld/test/ELF/aarch64-tstbr14-reloc.s | 4 ++++ lld/test/ELF/gnu-ifunc-plt-i386.s | 8 ++++++-- lld/test/ELF/gnu-ifunc-plt.s | 8 ++++++-- lld/test/ELF/gnu-ifunc-shared.s | 6 +++++- lld/test/ELF/plt-aarch64.s | 10 ++++++++++ lld/test/ELF/plt-i686.s | 4 ++++ lld/test/ELF/plt.s | 10 ++++++++++ 10 files changed, 59 insertions(+), 5 deletions(-) diff --git a/lld/test/ELF/aarch64-condb-reloc.s b/lld/test/ELF/aarch64-condb-reloc.s index 8a75814..7aaa697 100644 --- a/lld/test/ELF/aarch64-condb-reloc.s +++ b/lld/test/ELF/aarch64-condb-reloc.s @@ -79,14 +79,20 @@ #DSO-NEXT: 10044: {{.*}} nop #DSO-NEXT: 10048: {{.*}} nop #DSO-NEXT: 1004c: {{.*}} nop +#DSO-EMPTY: +#DSO-NEXT: _foo@plt: #DSO-NEXT: 10050: {{.*}} adrp x16, #65536 #DSO-NEXT: 10054: {{.*}} ldr x17, [x16, #24] #DSO-NEXT: 10058: {{.*}} add x16, x16, #24 #DSO-NEXT: 1005c: {{.*}} br x17 +#DSO-EMPTY: +#DSO-NEXT: _bar@plt: #DSO-NEXT: 10060: {{.*}} adrp x16, #65536 #DSO-NEXT: 10064: {{.*}} ldr x17, [x16, #32] #DSO-NEXT: 10068: {{.*}} add x16, x16, #32 #DSO-NEXT: 1006c: {{.*}} br x17 +#DSO-EMPTY: +#DSO-NEXT: _dah@plt: #DSO-NEXT: 10070: {{.*}} adrp x16, #65536 #DSO-NEXT: 10074: {{.*}} ldr x17, [x16, #40] #DSO-NEXT: 10078: {{.*}} add x16, x16, #40 diff --git a/lld/test/ELF/aarch64-gnu-ifunc-plt.s b/lld/test/ELF/aarch64-gnu-ifunc-plt.s index ca30316..9cb489e 100644 --- a/lld/test/ELF/aarch64-gnu-ifunc-plt.s +++ b/lld/test/ELF/aarch64-gnu-ifunc-plt.s @@ -49,10 +49,14 @@ // DISASM-NEXT: 20034: {{.*}} nop // DISASM-NEXT: 20038: {{.*}} nop // DISASM-NEXT: 2003c: {{.*}} nop +// DISASM-EMPTY: +// DISASM-NEXT: bar2@plt: // DISASM-NEXT: 20040: {{.*}} adrp x16, #65536 // DISASM-NEXT: 20044: {{.*}} ldr x17, [x16, #24] // DISASM-NEXT: 20048: {{.*}} add x16, x16, #24 // DISASM-NEXT: 2004c: {{.*}} br x17 +// DISASM-EMPTY: +// DISASM-NEXT: zed2@plt: // DISASM-NEXT: 20050: {{.*}} adrp x16, #65536 // DISASM-NEXT: 20054: {{.*}} ldr x17, [x16, #32] // DISASM-NEXT: 20058: {{.*}} add x16, x16, #32 diff --git a/lld/test/ELF/aarch64-thunk-pi.s b/lld/test/ELF/aarch64-thunk-pi.s index d5d956c..345e6ee 100644 --- a/lld/test/ELF/aarch64-thunk-pi.s +++ b/lld/test/ELF/aarch64-thunk-pi.s @@ -81,10 +81,14 @@ high_target2: // CHECK-NEXT: 10000034: 1f 20 03 d5 nop // CHECK-NEXT: 10000038: 1f 20 03 d5 nop // CHECK-NEXT: 1000003c: 1f 20 03 d5 nop +// CHECK-EMPTY: +// CHECK-NEXT: high_target@plt: // CHECK-NEXT: 10000040: 10 00 00 90 adrp x16, #0 // CHECK-NEXT: 10000044: 11 3e 40 f9 ldr x17, [x16, #120] // CHECK-NEXT: 10000048: 10 e2 01 91 add x16, x16, #120 // CHECK-NEXT: 1000004c: 20 02 1f d6 br x17 +// CHECK-EMPTY: +// CHECK-NEXT: low_target@plt: // CHECK-NEXT: 10000050: 10 00 00 90 adrp x16, #0 // CHECK-NEXT: 10000054: 11 42 40 f9 ldr x17, [x16, #128] // CHECK-NEXT: 10000058: 10 02 02 91 add x16, x16, #128 diff --git a/lld/test/ELF/aarch64-tstbr14-reloc.s b/lld/test/ELF/aarch64-tstbr14-reloc.s index 779ca6b..e776549 100644 --- a/lld/test/ELF/aarch64-tstbr14-reloc.s +++ b/lld/test/ELF/aarch64-tstbr14-reloc.s @@ -79,10 +79,14 @@ #DSO-NEXT: 10044: {{.*}} nop #DSO-NEXT: 10048: {{.*}} nop #DSO-NEXT: 1004c: {{.*}} nop +#DSO-EMPTY: +#DSO-NEXT: _foo@plt: #DSO-NEXT: 10050: {{.*}} adrp x16, #65536 #DSO-NEXT: 10054: {{.*}} ldr x17, [x16, #24] #DSO-NEXT: 10058: {{.*}} add x16, x16, #24 #DSO-NEXT: 1005c: {{.*}} br x17 +#DSO-EMPTY: +#DSO-NEXT: _bar@plt: #DSO-NEXT: 10060: {{.*}} adrp x16, #65536 #DSO-NEXT: 10064: {{.*}} ldr x17, [x16, #32] #DSO-NEXT: 10068: {{.*}} add x16, x16, #32 diff --git a/lld/test/ELF/gnu-ifunc-plt-i386.s b/lld/test/ELF/gnu-ifunc-plt-i386.s index 14369bf..c34819a2 100644 --- a/lld/test/ELF/gnu-ifunc-plt-i386.s +++ b/lld/test/ELF/gnu-ifunc-plt-i386.s @@ -44,18 +44,22 @@ // DISASM-NEXT: 1102d: 90 nop // DISASM-NEXT: 1102e: 90 nop // DISASM-NEXT: 1102f: 90 nop +// DISASM-EMPTY: +// DISASM-NEXT: bar2@plt: // DISASM-NEXT: 11030: ff 25 0c 20 01 00 jmpl *73740 // DISASM-NEXT: 11036: 68 00 00 00 00 pushl $0 // DISASM-NEXT: 1103b: e9 e0 ff ff ff jmp -32 <.plt> +// DISASM-EMPTY: +// DISASM-NEXT: zed2@plt: // DISASM-NEXT: 11040: ff 25 10 20 01 00 jmpl *73744 // DISASM-NEXT: 11046: 68 08 00 00 00 pushl $8 // DISASM-NEXT: 1104b: e9 d0 ff ff ff jmp -48 <.plt> // DISASM-NEXT: 11050: ff 25 14 20 01 00 jmpl *73748 // DISASM-NEXT: 11056: 68 30 00 00 00 pushl $48 -// DISASM-NEXT: 1105b: e9 e0 ff ff ff jmp -32 <.plt+0x20> +// DISASM-NEXT: 1105b: e9 e0 ff ff ff jmp -32 // DISASM-NEXT: 11060: ff 25 18 20 01 00 jmpl *73752 // DISASM-NEXT: 11066: 68 38 00 00 00 pushl $56 -// DISASM-NEXT: 1106b: e9 d0 ff ff ff jmp -48 <.plt+0x20> +// DISASM-NEXT: 1106b: e9 d0 ff ff ff jmp -48 .text .type foo STT_GNU_IFUNC diff --git a/lld/test/ELF/gnu-ifunc-plt.s b/lld/test/ELF/gnu-ifunc-plt.s index b88f32c..aa1c3c7 100644 --- a/lld/test/ELF/gnu-ifunc-plt.s +++ b/lld/test/ELF/gnu-ifunc-plt.s @@ -42,18 +42,22 @@ // DISASM-NEXT: 201020: ff 35 e2 0f 00 00 pushq 4066(%rip) // DISASM-NEXT: 201026: ff 25 e4 0f 00 00 jmpq *4068(%rip) // DISASM-NEXT: 20102c: 0f 1f 40 00 nopl (%rax) +// DISASM-EMPTY: +// DISASM-NEXT: bar2@plt: // DISASM-NEXT: 201030: ff 25 e2 0f 00 00 jmpq *4066(%rip) // DISASM-NEXT: 201036: 68 00 00 00 00 pushq $0 // DISASM-NEXT: 20103b: e9 e0 ff ff ff jmp -32 <.plt> +// DISASM-EMPTY: +// DISASM-NEXT: zed2@plt: // DISASM-NEXT: 201040: ff 25 da 0f 00 00 jmpq *4058(%rip) // DISASM-NEXT: 201046: 68 01 00 00 00 pushq $1 // DISASM-NEXT: 20104b: e9 d0 ff ff ff jmp -48 <.plt> // DISASM-NEXT: 201050: ff 25 d2 0f 00 00 jmpq *4050(%rip) // DISASM-NEXT: 201056: 68 00 00 00 00 pushq $0 -// DISASM-NEXT: 20105b: e9 e0 ff ff ff jmp -32 <.plt+0x20> +// DISASM-NEXT: 20105b: e9 e0 ff ff ff jmp -32 // DISASM-NEXT: 201060: ff 25 ca 0f 00 00 jmpq *4042(%rip) // DISASM-NEXT: 201066: 68 01 00 00 00 pushq $1 -// DISASM-NEXT: 20106b: e9 d0 ff ff ff jmp -48 <.plt+0x20> +// DISASM-NEXT: 20106b: e9 d0 ff ff ff jmp -48 .text .type foo STT_GNU_IFUNC diff --git a/lld/test/ELF/gnu-ifunc-shared.s b/lld/test/ELF/gnu-ifunc-shared.s index bde6807..bc91ff9 100644 --- a/lld/test/ELF/gnu-ifunc-shared.s +++ b/lld/test/ELF/gnu-ifunc-shared.s @@ -23,15 +23,19 @@ // DISASM-NEXT: 1020: ff 35 e2 0f 00 00 pushq 4066(%rip) // DISASM-NEXT: 1026: ff 25 e4 0f 00 00 jmpq *4068(%rip) // DISASM-NEXT: 102c: 0f 1f 40 00 nopl (%rax) +// DISASM-EMPTY: +// DISASM-NEXT: fct2@plt: // DISASM-NEXT: 1030: ff 25 e2 0f 00 00 jmpq *4066(%rip) // DISASM-NEXT: 1036: 68 00 00 00 00 pushq $0 // DISASM-NEXT: 103b: e9 e0 ff ff ff jmp -32 <.plt> +// DISASM-EMPTY: +// DISASM-NEXT: f2@plt: // DISASM-NEXT: 1040: ff 25 da 0f 00 00 jmpq *4058(%rip) // DISASM-NEXT: 1046: 68 01 00 00 00 pushq $1 // DISASM-NEXT: 104b: e9 d0 ff ff ff jmp -48 <.plt> // DISASM-NEXT: 1050: ff 25 d2 0f 00 00 jmpq *4050(%rip) // DISASM-NEXT: 1056: 68 00 00 00 00 pushq $0 -// DISASM-NEXT: 105b: e9 e0 ff ff ff jmp -32 <.plt+0x20> +// DISASM-NEXT: 105b: e9 e0 ff ff ff jmp -32 // CHECK: Relocations [ // CHECK-NEXT: Section (4) .rela.plt { diff --git a/lld/test/ELF/plt-aarch64.s b/lld/test/ELF/plt-aarch64.s index 8f637bf..0ef1438 100644 --- a/lld/test/ELF/plt-aarch64.s +++ b/lld/test/ELF/plt-aarch64.s @@ -85,6 +85,8 @@ // foo@plt // Page(0x30018) - Page(0x10030) = 0x20000 - 0x10000 = 0x10000 = 65536 +// DISASMDSO-EMPTY: +// DISASMDSO-NEXT: foo@plt: // DISASMDSO-NEXT: 10030: 90 00 00 90 adrp x16, #65536 // 0x3018 & 0xFFF = 0x18 = 24 // DISASMDSO-NEXT: 10034: 11 0e 40 f9 ldr x17, [x16, #24] @@ -93,6 +95,8 @@ // bar@plt // Page(0x30020) - Page(0x10040) = 0x20000 - 0x10000 = 0x10000 = 65536 +// DISASMDSO-EMPTY: +// DISASMDSO-NEXT: bar@plt: // DISASMDSO-NEXT: 10040: 90 00 00 90 adrp x16, #65536 // 0x3020 & 0xFFF = 0x20 = 32 // DISASMDSO-NEXT: 10044: 11 12 40 f9 ldr x17, [x16, #32] @@ -101,6 +105,8 @@ // weak@plt // Page(0x30028) - Page(0x10050) = 0x20000 - 0x10000 = 0x10000 = 65536 +// DISASMDSO-EMPTY: +// DISASMDSO-NEXT: weak@plt: // DISASMDSO-NEXT: 10050: 90 00 00 90 adrp x16, #65536 // 0x3028 & 0xFFF = 0x28 = 40 // DISASMDSO-NEXT: 10054: 11 16 40 f9 ldr x17, [x16, #40] @@ -178,6 +184,8 @@ // bar@plt // Page(0x40018) - Page(0x20030) = 0x30000 - 0x20000 = 0x10000 = 65536 +// DISASMEXE-EMPTY: +// DISASMEXE-NEXT: bar@plt: // DISASMEXE-NEXT: 20030: 90 00 00 90 adrp x16, #65536 // DISASMEXE-NEXT: 20034: 11 0e 40 f9 ldr x17, [x16, #24] // DISASMEXE-NEXT: 20038: 10 62 00 91 add x16, x16, #24 @@ -185,6 +193,8 @@ // weak@plt // Page(0x40020) - Page(0x20040) = 0x30000 - 0x20000 = 0x10000 = 65536 +// DISASMEXE-EMPTY: +// DISASMEXE-NEXT: weak@plt: // DISASMEXE-NEXT: 20040: 90 00 00 90 adrp x16, #65536 // DISASMEXE-NEXT: 20044: 11 12 40 f9 ldr x17, [x16, #32] // DISASMEXE-NEXT: 20048: 10 82 00 91 add x16, x16, #32 diff --git a/lld/test/ELF/plt-i686.s b/lld/test/ELF/plt-i686.s index c24cab2..298632d 100644 --- a/lld/test/ELF/plt-i686.s +++ b/lld/test/ELF/plt-i686.s @@ -79,9 +79,13 @@ // DISASM-NEXT: 1102d: 90 nop // DISASM-NEXT: 1102e: 90 nop // DISASM-NEXT: 1102f: 90 nop +// DISASM-EMPTY: +// DISASM-NEXT: bar@plt: // DISASM-NEXT: 11030: ff 25 0c 20 01 00 jmpl *73740 // DISASM-NEXT: 11036: 68 00 00 00 00 pushl $0 // DISASM-NEXT: 1103b: e9 e0 ff ff ff jmp -32 <.plt> +// DISASM-EMPTY: +// DISASM-NEXT: zed@plt: // DISASM-NEXT: 11040: ff 25 10 20 01 00 jmpl *73744 // DISASM-NEXT: 11046: 68 08 00 00 00 pushl $8 // DISASM-NEXT: 1104b: e9 d0 ff ff ff jmp -48 <.plt> diff --git a/lld/test/ELF/plt.s b/lld/test/ELF/plt.s index cce60d7..21f0f12 100644 --- a/lld/test/ELF/plt.s +++ b/lld/test/ELF/plt.s @@ -73,12 +73,18 @@ // DISASM-NEXT: 1020: ff 35 e2 0f 00 00 pushq 4066(%rip) // DISASM-NEXT: 1026: ff 25 e4 0f 00 00 jmpq *4068(%rip) // DISASM-NEXT: 102c: 0f 1f 40 00 nopl (%rax) +// DISASM-EMPTY: +// DISASM-NEXT: bar@plt: // DISASM-NEXT: 1030: ff 25 e2 0f 00 00 jmpq *4066(%rip) // DISASM-NEXT: 1036: 68 00 00 00 00 pushq $0 // DISASM-NEXT: 103b: e9 e0 ff ff ff jmp -32 <.plt> +// DISASM-EMPTY: +// DISASM-NEXT: zed@plt: // DISASM-NEXT: 1040: ff 25 da 0f 00 00 jmpq *4058(%rip) // DISASM-NEXT: 1046: 68 01 00 00 00 pushq $1 // DISASM-NEXT: 104b: e9 d0 ff ff ff jmp -48 <.plt> +// DISASM-EMPTY: +// DISASM-NEXT: _start@plt: // DISASM-NEXT: 1050: ff 25 d2 0f 00 00 jmpq *4050(%rip) // DISASM-NEXT: 1056: 68 02 00 00 00 pushq $2 // DISASM-NEXT: 105b: e9 c0 ff ff ff jmp -64 <.plt> @@ -102,9 +108,13 @@ // DISASM2-NEXT: 201020: ff 35 e2 0f 00 00 pushq 4066(%rip) // DISASM2-NEXT: 201026: ff 25 e4 0f 00 00 jmpq *4068(%rip) // DISASM2-NEXT: 20102c: 0f 1f 40 00 nopl (%rax) +// DISASM2-EMPTY: +// DISASM2-NEXT: bar@plt: // DISASM2-NEXT: 201030: ff 25 e2 0f 00 00 jmpq *4066(%rip) // DISASM2-NEXT: 201036: 68 00 00 00 00 pushq $0 // DISASM2-NEXT: 20103b: e9 e0 ff ff ff jmp -32 <.plt> +// DISASM2-EMPTY: +// DISASM2-NEXT: zed@plt: // DISASM2-NEXT: 201040: ff 25 da 0f 00 00 jmpq *4058(%rip) // DISASM2-NEXT: 201046: 68 01 00 00 00 pushq $1 // DISASM2-NEXT: 20104b: e9 d0 ff ff ff jmp -48 <.plt> -- 2.7.4