[gdb/testsuite] Fix gdb.base/infoline-reloc-main-from-zero.exp with clang
authorTom de Vries <tdevries@suse.de>
Fri, 14 Oct 2022 11:09:51 +0000 (13:09 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 14 Oct 2022 11:09:51 +0000 (13:09 +0200)
commit21f507efad6bf16edf2432b65b763e7686349b8a
tree801977f7b9b5d5f2ea197c7e51d975699d2dd5d4
parent68f7bda9b1c32920ce4a2fe65129525bc0b05bf7
[gdb/testsuite] Fix gdb.base/infoline-reloc-main-from-zero.exp with clang

With test-case gdb.base/infoline-reloc-main-from-zero.exp and clang I run into:
...
gdb compile failed, clang-13.0: warning: -e main: 'linker' input unused \
  [-Wunused-command-line-argument]
clang-13.0: warning: -Wl,-Ttext=0x00: 'linker' input unused \
  [-Wunused-command-line-argument]
clang-13.0: warning: -Wl,-N: 'linker' input unused \
  [-Wunused-command-line-argument]
UNTESTED: gdb.base/infoline-reloc-main-from-zero.exp: \
  infoline-reloc-main-from-zero.exp
UNTESTED: gdb.base/infoline-reloc-main-from-zero.exp: failed to compile
...

Fix this by using ldflags instead of additional_flags.

Likewise, fix all occurrences of:
...
$ find gdb/testsuite -name *.exp | xargs grep additional_flags.*Wl
...

Tested on x86_64-linux.
16 files changed:
gdb/testsuite/gdb.ada/inline-section-gc.exp
gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp
gdb/testsuite/gdb.base/code_elim.exp
gdb/testsuite/gdb.base/dump.exp
gdb/testsuite/gdb.base/gcore-relro.exp
gdb/testsuite/gdb.base/gnu-ifunc.exp
gdb/testsuite/gdb.base/gold-gdb-index.exp
gdb/testsuite/gdb.base/index-cache.exp
gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp
gdb/testsuite/gdb.base/nested-subp2.exp
gdb/testsuite/gdb.base/nested-subp3.exp
gdb/testsuite/gdb.base/skip-solib.exp
gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp
gdb/testsuite/gdb.reverse/solib-precsave.exp
gdb/testsuite/gdb.threads/gcore-thread.exp
gdb/testsuite/lib/gdb.exp