From 6ef632ad36c522b03cf03c7dd76184a35d3b7f41 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 3 Jun 2024 13:18:58 -0700 Subject: [BOLT,test] Fix lsda.ldscript when MAXPAGESIZE>=0x10000 The intention is to check a section name different from .gcc_except_table . Rather than using a linker script, use llvm-objcopy --rename-section instead. --- bolt/test/Inputs/lsda.ldscript | 10 ---------- bolt/test/lsda-section-name.cpp | 9 ++++----- 2 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 bolt/test/Inputs/lsda.ldscript (limited to 'bolt/test') diff --git a/bolt/test/Inputs/lsda.ldscript b/bolt/test/Inputs/lsda.ldscript deleted file mode 100644 index 011e0c6..0000000 --- a/bolt/test/Inputs/lsda.ldscript +++ /dev/null @@ -1,10 +0,0 @@ -SECTIONS { - .interp : { *(.interp) } - . = ALIGN(CONSTANT(MAXPAGESIZE)); - .text : { *(.text*) } - . = ALIGN(CONSTANT(MAXPAGESIZE)); - .gcc_except_table.main : { *(.gcc_except_table*) } - . = 0x20000; - .eh_frame : { *(.eh_frame) } - . = 0x80000; -} diff --git a/bolt/test/lsda-section-name.cpp b/bolt/test/lsda-section-name.cpp index 41fb176..34a736f 100644 --- a/bolt/test/lsda-section-name.cpp +++ b/bolt/test/lsda-section-name.cpp @@ -1,11 +1,10 @@ // This test check that LSDA section named by .gcc_except_table.main is // disassembled by BOLT. -// RUN: %clang++ %cxxflags -O3 -no-pie -c %s -o %t.o -// RUN: %clang++ %cxxflags -no-pie -fuse-ld=lld %t.o -o %t.exe \ -// RUN: -Wl,-q -Wl,--script=%S/Inputs/lsda.ldscript -// RUN: llvm-readelf -SW %t.exe | FileCheck %s -// RUN: llvm-bolt %t.exe -o %t.bolt +// RUN: %clang++ %cxxflags -O3 -no-pie -fuse-ld=lld %t.o -o %t +// RUN: llvm-objcopy --rename-section .gcc_except_table=.gcc_except_table.main %t +// RUN: llvm-readelf -SW %t | FileCheck %s +// RUN: llvm-bolt %t -o %t.bolt // CHECK: .gcc_except_table.main -- cgit v1.1