From 2bb8c72b39f4dcce0be292b2c701edbe4dd4ca7c Mon Sep 17 00:00:00 2001 From: Vignesh Balasubramanian Date: Wed, 30 Mar 2022 16:29:43 +0530 Subject: gdb/testsuite: add text_segment option to gdb_compile LLVM's lld linker doesn't have the "-Ttext-segment" option, but "--image-base" can be used instead. To centralize the logic of checking which option is supported, add the text_segment option to gdb_compile. Change tests that are currently using -Ttext-segment to use that new option instead. This patch fixes only compilation error, for example: Before: $ make check TESTS="gdb.base/jit-elf.exp" RUNTESTFLAGS="CC_FOR_TARGET=clang LDFLAGS_FOR_TARGET=-fuse-ld=ld" Running /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/jit-elf.exp ... gdb compile failed, clang-13: warning: -Xlinker -Ttext-segment=0x7000000: 'linker' input unused [-Wunused-command-line-argument] After: $ make check TESTS="gdb.base/jit-elf.exp" RUNTESTFLAGS="CC_FOR_TARGET=clang LDFLAGS_FOR_TARGET=-fuse-ld=ld" Running /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/jit-elf.exp ... FAIL: gdb.base/jit-elf.exp: one_jit_test-1: continue to breakpoint: break here 1 FAIL: gdb.base/jit-elf.exp: one_jit_test-1: continue to breakpoint: break here 2 FAIL: gdb.base/jit-elf.exp: one_jit_test-2: continue to breakpoint: break here 1 FAIL: gdb.base/jit-elf.exp: one_jit_test-2: info function ^jit_function FAIL: gdb.base/jit-elf.exp: one_jit_test-2: continue to breakpoint: break here 2 FAIL: gdb.base/jit-elf.exp: attach: one_jit_test-2: continue to breakpoint: break here 1 FAIL: gdb.base/jit-elf.exp: attach: one_jit_test-2: break here 1: attach FAIL: gdb.base/jit-elf.exp: PIE: one_jit_test-1: continue to breakpoint: break here 1 FAIL: gdb.base/jit-elf.exp: PIE: one_jit_test-1: continue to breakpoint: break here 2 === gdb Summary === # of expected passes 26 # of unexpected failures 9 Change-Id: I3678c5c9bbfc2f80671698e28a038e6b3d14e635 --- gdb/testsuite/gdb.threads/step-over-exec.exp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/testsuite/gdb.threads') diff --git a/gdb/testsuite/gdb.threads/step-over-exec.exp b/gdb/testsuite/gdb.threads/step-over-exec.exp index 9e252e6..783f865 100644 --- a/gdb/testsuite/gdb.threads/step-over-exec.exp +++ b/gdb/testsuite/gdb.threads/step-over-exec.exp @@ -47,8 +47,8 @@ proc do_test { execr_thread different_text_segments displaced_stepping } { set execd_opts [list debug] if { $different_text_segments } { - lappend execr_opts "ldflags=-Wl,-Ttext-segment=0x600000" - lappend execd_opts "ldflags=-Wl,-Ttext-segment=0x800000" + lappend execr_opts "text_segment=0x600000" + lappend execd_opts "text_segment=0x800000" } if { $execr_thread == "leader" } { -- cgit v1.1