[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.
This commit is contained in:
Fangrui Song
2024-06-03 13:18:58 -07:00
parent c93312a63d
commit 6ef632ad36
2 changed files with 4 additions and 15 deletions

View File

@@ -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;
}

View File

@@ -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