aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-06-29 10:10:15 +0930
committerAlan Modra <amodra@gmail.com>2022-06-29 10:15:55 +0930
commit22a8ddfe934283113c8e88de3b49caee40343e14 (patch)
tree80ea048d66c8ceb15266382b2a059c7c78ef810e /ld/testsuite/ld-elf
parentb55819a7206c2d51ec72f42c4d77ef0e2e0f1ac6 (diff)
downloadfsf-binutils-gdb-22a8ddfe934283113c8e88de3b49caee40343e14.zip
fsf-binutils-gdb-22a8ddfe934283113c8e88de3b49caee40343e14.tar.gz
fsf-binutils-gdb-22a8ddfe934283113c8e88de3b49caee40343e14.tar.bz2
Re: ld/x86: skip p_align-1 tests with unsuitable compiler
commit d0e0f9c87a3e results "ERROR: i586-linux-cc does not exist" if cross-building an i586-linux target without a target compiler installed. * testsuite/ld-elf/linux-x86.exp (compiler_honours_aligned): New. Use it after first testing check_compiler_available.
Diffstat (limited to 'ld/testsuite/ld-elf')
-rw-r--r--ld/testsuite/ld-elf/linux-x86.exp14
1 files changed, 11 insertions, 3 deletions
diff --git a/ld/testsuite/ld-elf/linux-x86.exp b/ld/testsuite/ld-elf/linux-x86.exp
index ae0ed6a..6035ecd 100644
--- a/ld/testsuite/ld-elf/linux-x86.exp
+++ b/ld/testsuite/ld-elf/linux-x86.exp
@@ -188,9 +188,17 @@ run_ld_link_exec_tests [list \
]
# Old gcc silently ignores __attribute__ ((aligned())) with too big alignment.
-ld_compile $CC_FOR_TARGET $srcdir/$subdir/p_align-1.c tmpdir/p_align-1.o
-set output [run_host_cmd "$READELF" "-SW tmpdir/p_align-1.o"]
-if { [regexp { [.]data *PROGBITS .* 8388608[\n]} $output] } then {
+proc compiler_honours_aligned { } {
+ global CC_FOR_TARGET READELF srcdir subdir
+ ld_compile $CC_FOR_TARGET $srcdir/$subdir/p_align-1.c tmpdir/p_align-1.o
+ set output [run_host_cmd "$READELF" "-SW tmpdir/p_align-1.o"]
+ if { [regexp { [.]data *PROGBITS .* 8388608[\n]} $output] } {
+ return 1
+ }
+ return 0
+}
+
+if { [check_compiler_available] && [compiler_honours_aligned] } {
run_ld_link_exec_tests [list \
[list \
"Run p_align-1a without PIE" \