elf: Support DT_RELR in linker tests
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 5 Jan 2022 15:12:03 +0000 (07:12 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 12 Jan 2022 14:04:51 +0000 (06:04 -0800)
commitf2e37a5c7f8c8f761d2d86f2a69efe07503dc640
treedb77266086c3d28118e38e76830809fc4d668560
parent23cc1de50b006fa10e295bdb4455540f001515e9
elf: Support DT_RELR in linker tests

Allow eabling and disabling DT_RELR in linker tests.  Disable DT_RELR in
linker tests which don't expect DT_RELR in linker outputs.

binutils/

* testsuite/lib/binutils-common.exp (run_dump_test): Make
DT_RELR_LDFLAGS and NO_DT_RELR_LDFLAGS global.

ld/

* testsuite/config/default.exp (DT_RELR_LDFLAGS): New.
(DT_RELR_CC_LDFLAGS): Likewise.
(NO_DT_RELR_LDFLAGS): Likewise.
(NO_DT_RELR_CC_LDFLAGS): Likewise.
* testsuite/ld-elf/shared.exp: Pass $NO_DT_RELR_LDFLAGS to
linker for some tests.
* testsuite/ld-i386/export-class.exp: Likewise.
* testsuite/ld-i386/i386.exp: Likewise.
* testsuite/ld-i386/ibt-plt-2a.d: Pass $NO_DT_RELR_LDFLAGS to
linker.
* testsuite/ld-i386/ibt-plt-3a.d: Likewise.
* testsuite/ld-i386/ibt-plt-3c.d: Likewise.
* testsuite/ld-i386/pr26869.d: Likewise.
* testsuite/ld-i386/report-reloc-1.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-x86-64-now.d: Likewise.
* testsuite/ld-ifunc/pr17154-x86-64.d: Likewise.
* testsuite/ld-x86-64/bnd-branch-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise.
* testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-plt-1.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2a.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3a.d: Likewise.
* testsuite/ld-x86-64/ilp32-4.d: Likewise.
* testsuite/ld-x86-64/load1c.d: Likewise.
* testsuite/ld-x86-64/load1d.d: Likewise.
* testsuite/ld-x86-64/pr13082-2b.d: Likewise.
* testsuite/ld-x86-64/pr14207.d: Likewise.
* testsuite/ld-x86-64/pr18176.d: Likewise.
* testsuite/ld-x86-64/pr19162.d: Likewise.
* testsuite/ld-x86-64/pr19636-2d.d: Likewise.
* testsuite/ld-x86-64/pr19636-2l.d: Likewise.
* testsuite/ld-x86-64/pr20253-1d.d: Likewise.
* testsuite/ld-x86-64/pr20253-1f.d: Likewise.
* testsuite/ld-x86-64/pr20253-1j.d: Likewise.
* testsuite/ld-x86-64/pr20253-1l.d: Likewise.
* testsuite/ld-x86-64/report-reloc-1-x32.d: Likewise.
* testsuite/ld-x86-64/report-reloc-1.d: Likewise.
* testsuite/ld-x86-64/export-class.exp (x86_64_export_class_test):
Pass $NO_DT_RELR_LDFLAGS to linker.
* testsuite/ld-x86-64/x86-64.exp: Pass $NO_DT_RELR_LDFLAGS to
linker for some tests.
43 files changed:
binutils/testsuite/lib/binutils-common.exp
ld/testsuite/config/default.exp
ld/testsuite/ld-elf/shared.exp
ld/testsuite/ld-i386/export-class.exp
ld/testsuite/ld-i386/i386.exp
ld/testsuite/ld-i386/ibt-plt-2a.d
ld/testsuite/ld-i386/ibt-plt-3a.d
ld/testsuite/ld-i386/ibt-plt-3c.d
ld/testsuite/ld-i386/pr26869.d
ld/testsuite/ld-i386/report-reloc-1.d
ld/testsuite/ld-ifunc/ifunc-2-i386-now.d
ld/testsuite/ld-ifunc/ifunc-2-local-i386-now.d
ld/testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d
ld/testsuite/ld-ifunc/ifunc-2-x86-64-now.d
ld/testsuite/ld-ifunc/pr17154-x86-64-now.d
ld/testsuite/ld-ifunc/pr17154-x86-64.d
ld/testsuite/ld-x86-64/bnd-branch-1-now.d
ld/testsuite/ld-x86-64/bnd-ifunc-1-now.d
ld/testsuite/ld-x86-64/bnd-ifunc-2-now.d
ld/testsuite/ld-x86-64/bnd-ifunc-2.d
ld/testsuite/ld-x86-64/bnd-plt-1-now.d
ld/testsuite/ld-x86-64/bnd-plt-1.d
ld/testsuite/ld-x86-64/export-class.exp
ld/testsuite/ld-x86-64/ibt-plt-2a-x32.d
ld/testsuite/ld-x86-64/ibt-plt-2a.d
ld/testsuite/ld-x86-64/ibt-plt-3a-x32.d
ld/testsuite/ld-x86-64/ibt-plt-3a.d
ld/testsuite/ld-x86-64/ilp32-4.d
ld/testsuite/ld-x86-64/load1c.d
ld/testsuite/ld-x86-64/load1d.d
ld/testsuite/ld-x86-64/pr13082-2b.d
ld/testsuite/ld-x86-64/pr14207.d
ld/testsuite/ld-x86-64/pr18176.d
ld/testsuite/ld-x86-64/pr19162.d
ld/testsuite/ld-x86-64/pr19636-2d.d
ld/testsuite/ld-x86-64/pr19636-2l.d
ld/testsuite/ld-x86-64/pr20253-1d.d
ld/testsuite/ld-x86-64/pr20253-1f.d
ld/testsuite/ld-x86-64/pr20253-1j.d
ld/testsuite/ld-x86-64/pr20253-1l.d
ld/testsuite/ld-x86-64/report-reloc-1-x32.d
ld/testsuite/ld-x86-64/report-reloc-1.d
ld/testsuite/ld-x86-64/x86-64.exp