From d982a683ded075122866117b88d6324734cb3720 Mon Sep 17 00:00:00 2001 From: YongKang Zhu Date: Fri, 31 Jan 2025 09:56:02 -0800 Subject: [PATCH 1/3] [bolt][nfc] Fix test X86/dynamic-relocs-on-entry.s --- bolt/test/X86/dynamic-relocs-on-entry.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bolt/test/X86/dynamic-relocs-on-entry.s b/bolt/test/X86/dynamic-relocs-on-entry.s index 2a29a43c4939a..a5bf89c882443 100644 --- a/bolt/test/X86/dynamic-relocs-on-entry.s +++ b/bolt/test/X86/dynamic-relocs-on-entry.s @@ -9,7 +9,7 @@ # RUN: FileCheck %s --input-file=%t.out.txt ## Check if the new address in `chain` is correctly updated by BOLT -# CHECK: Relocation section '.rela.dyn' at offset 0x{{.*}} contains 1 entry: +# CHECK: Relocation section '.rela.dyn' at offset 0x{{.*}} contains 1 entries: # CHECK: {{.*}} R_X86_64_RELATIVE [[#%x,ADDR:]] # CHECK: [[#ADDR]]: c3 retq .text @@ -29,4 +29,4 @@ _start: .data .Lfoo: - .quad Label \ No newline at end of file + .quad Label From 4c6296fd278838adaf74431ba8b095c9b7e60439 Mon Sep 17 00:00:00 2001 From: YongKang Zhu Date: Fri, 31 Jan 2025 11:47:36 -0800 Subject: [PATCH 2/3] entry vs. entries: different readelf's output slightly different things --- bolt/test/X86/dynamic-relocs-on-entry.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bolt/test/X86/dynamic-relocs-on-entry.s b/bolt/test/X86/dynamic-relocs-on-entry.s index a5bf89c882443..523f94536d48a 100644 --- a/bolt/test/X86/dynamic-relocs-on-entry.s +++ b/bolt/test/X86/dynamic-relocs-on-entry.s @@ -9,7 +9,7 @@ # RUN: FileCheck %s --input-file=%t.out.txt ## Check if the new address in `chain` is correctly updated by BOLT -# CHECK: Relocation section '.rela.dyn' at offset 0x{{.*}} contains 1 entries: +# CHECK: Relocation section '.rela.dyn' at offset 0x{{.*}} contains 1 entr{{.*}}: # CHECK: {{.*}} R_X86_64_RELATIVE [[#%x,ADDR:]] # CHECK: [[#ADDR]]: c3 retq .text From 0ed367a425d6cf33be844245808c0fc7febdad83 Mon Sep 17 00:00:00 2001 From: YongKang Zhu Date: Fri, 31 Jan 2025 11:57:39 -0800 Subject: [PATCH 3/3] Use llvm-readelf instead of /usr/bin/readelf --- bolt/test/X86/dynamic-relocs-on-entry.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bolt/test/X86/dynamic-relocs-on-entry.s b/bolt/test/X86/dynamic-relocs-on-entry.s index 523f94536d48a..4ec8ba4ad4460 100644 --- a/bolt/test/X86/dynamic-relocs-on-entry.s +++ b/bolt/test/X86/dynamic-relocs-on-entry.s @@ -4,12 +4,12 @@ # RUN: %clang %cflags -fPIC -pie %s -o %t.exe -nostdlib -Wl,-q # RUN: llvm-bolt %t.exe -o %t.bolt > %t.out.txt -# RUN: readelf -r %t.bolt >> %t.out.txt +# RUN: llvm-readelf -r %t.bolt >> %t.out.txt # RUN: llvm-objdump --disassemble-symbols=chain %t.bolt >> %t.out.txt # RUN: FileCheck %s --input-file=%t.out.txt ## Check if the new address in `chain` is correctly updated by BOLT -# CHECK: Relocation section '.rela.dyn' at offset 0x{{.*}} contains 1 entr{{.*}}: +# CHECK: Relocation section '.rela.dyn' at offset 0x{{.*}} contains 1 entries: # CHECK: {{.*}} R_X86_64_RELATIVE [[#%x,ADDR:]] # CHECK: [[#ADDR]]: c3 retq .text