From 87fa7d568ddd804fb73bb78e33ae1c22d9fe343c Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 9 Mar 2021 08:52:32 +0100 Subject: bfd: don't silently wrap or truncate PE image section RVAs In PE images section addresses get expressed as addresses relative to the image base. Therefore the VA of a section must be no less than the image base, and after subtraction of the image base the resulting value should fit in 32 bits. (The issue is particularly obvious to notice when sections, perhaps because of ELF assumptions, get placed at VA 0 by default. Debugging info sections as well as .comment, when input files are ELF, are a good example. All such sections need proper mentioning in the linker script to avoid this warning.) There are a number of test cases which previously produced bogus images, yet still declared the test a success. Like done for other tests already, force a zero image base for these. This then also allows (and requires) dropping again xfail-s which 39a7b38fac0e ("Fix linker tests to work with 16-bit targets") had added to ld-scripts/default-script*.d (originally as skip-s). This also depends on similar adjustments to testsuite/ld-scripts/map-address.* made by an earlier patch. For ld-scripts/print-memory-usage.* I suppose xcoff could be dropped from the exclusion list by suppressing garbage collection, just like already done in e.g. (as seen in the diff here) ld-scripts/data.*, but I didn't want to make unrelated adjustments. --- ld/testsuite/ld-scripts/default-script2.d | 2 -- 1 file changed, 2 deletions(-) (limited to 'ld/testsuite/ld-scripts/default-script2.d') diff --git a/ld/testsuite/ld-scripts/default-script2.d b/ld/testsuite/ld-scripts/default-script2.d index b10ac96..39c24e0 100644 --- a/ld/testsuite/ld-scripts/default-script2.d +++ b/ld/testsuite/ld-scripts/default-script2.d @@ -1,8 +1,6 @@ #source: default-script.s #ld: -T default-script.t -defsym _START=0x800 #nm: -n -#xfail: {[is_pecoff_format x86_64-*]} -# Skipped on Mingw64 and Cygwin because the image base defaults to 0x100000000 #... 0*800 . _START -- cgit v1.1