binutils-gdb/ld/testsuite
Hans-Peter Nilsson a8a48c756c mmix bfd: fix bfd_assert for R_MMIX_PUSHJ_STUBBABLE against undef'd symbol
Spotted when inspecting gcc testsuite logs, but this already is
covered by the ld-mmix testsuite, it's just that the assert is ignored
since the regexp match is for a substring and not anchored.

With the anchors added but not the bugfix, the ld.log shows that the
asserts cause a non-match as intended:

Executing on host: sh -c {./ld-new   -LX/src/ld/testsuite/ld-mmix  -m elf64mmix -o tmpdir/dump tmpdir/undef-2.o tmpdir/start.o  2>&1}  /dev/null dump.tmp (timeout = 300)
./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845
./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845
./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845
./ld-new: tmpdir/undef-2.o:(.text+0x0): undefined reference to `undefd'
failed with: <./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845
./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845
./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845
./ld-new: tmpdir/undef-2.o:(.text+0x0): undefined reference to `undefd'>, expected: <\A[^\n\r]*undefined reference to `undefd'\Z>
FAIL: ld-mmix/undef-2

Gone with the fix of course, leaving just the intended "undefined
reference" like.

I'm not going to add anchors manually for all the "error:" strings in
the test-suite, not even in the mmix parts.  Sorry, but I'll just do
it for *these* specific undefined-reference tests.

Just a thought: maybe the run_dump_test "error:" string should
*automatically* get anchor marks prepended and appended for a single
line match as in the patch, "\A[^\n\r]*" prepended and \Z appended
unless either anchor mark or \r or \n is present in the regexp?

Committed.

bfd:
	* elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
	R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.

ld/testsuite:
	* testsuite/ld-mmix/undef-1.d, testsuite/ld-mmix/undef-1m.d,
	testsuite/ld-mmix/undef-2.d, testsuite/ld-mmix/undef-2m.d: Add
	start- and end-anchors to error-string to match just a
	single-line error-message.
2020-07-15 06:22:28 +02:00
..
config
ld-aarch64
ld-alpha
ld-arc
ld-arm Re: Change readelf's display of symbol names 2020-07-03 17:15:16 +09:30
ld-auto-import
ld-avr
ld-bootstrap
ld-bpf
ld-cdtest
ld-checks Use is_xcoff_format in ld testsuite 2020-07-07 18:26:34 +09:30
ld-cris cris: Don't generate unnecessary dynamic tags 2020-06-24 04:00:31 -07:00
ld-crx
ld-csky csky: Don't generate unnecessary dynamic tags 2020-06-24 06:14:28 -07:00
ld-cygwin
ld-d10v
ld-discard
ld-dynamic
ld-elf Remove x86 NaCl target support 2020-06-30 08:56:14 -07:00
ld-elfcomm
ld-elfvers Use is_xcoff_format in ld testsuite 2020-07-07 18:26:34 +09:30
ld-elfvsb Use is_xcoff_format in ld testsuite 2020-07-07 18:26:34 +09:30
ld-elfweak Use is_xcoff_format in ld testsuite 2020-07-07 18:26:34 +09:30
ld-fastcall
ld-frv
ld-gc powerpc garbage collect test 2020-07-09 22:58:16 +09:30
ld-h8300
ld-i386 Re: Change readelf's display of symbol names 2020-07-03 17:15:16 +09:30
ld-ia64
ld-ifunc pr18841 tests on powerpc64 2020-07-09 22:58:16 +09:30
ld-libs
ld-linkonce
ld-m68hc11
ld-m68k m68k: tag floating-point ABI used 2020-06-26 14:42:19 +09:30
ld-mep
ld-metag
ld-mips-elf Change readelf's display of symbol names (when not in --wide mode) so that if they are going to be truncated then "[...]" is displayed at the end. Add a comment line option to disable this enhancement and restore the old behaviour. 2020-07-02 11:30:52 +01:00
ld-misc
ld-mmix mmix bfd: fix bfd_assert for R_MMIX_PUSHJ_STUBBABLE against undef'd symbol 2020-07-15 06:22:28 +02:00
ld-mn10300
ld-msp430-elf
ld-nds32
ld-nios2
ld-or1k
ld-pdp11
ld-pe
ld-pie
ld-plugin Remove x86 NaCl target support 2020-06-30 08:56:14 -07:00
ld-powerpc PowerPC64 ld --no-power10-stubs 2020-07-10 11:14:38 +09:30
ld-pru
ld-riscv-elf
ld-s12z
ld-s390
ld-scripts x86_64-cygwin tests 2020-07-13 22:03:59 +09:30
ld-selective
ld-sh sh vxworks tests 2020-07-07 18:26:33 +09:30
ld-shared
ld-size
ld-sparc Re: Change readelf's display of symbol names 2020-07-03 17:15:16 +09:30
ld-spu
ld-srec Use is_xcoff_format in ld testsuite 2020-07-07 18:26:34 +09:30
ld-tic6x tic6x: Call _bfd_elf_add_dynamic_tags 2020-06-29 05:53:01 -07:00
ld-tilegx
ld-tilepro
ld-undefined Use is_xcoff_format in ld testsuite 2020-07-07 18:26:34 +09:30
ld-unique
ld-v850
ld-vax-elf
ld-visium
ld-vxworks
ld-x86-64 Remove x86 NaCl target support 2020-06-30 08:56:14 -07:00
ld-xc16x
ld-xstormy16
ld-xtensa
ld-z8k
ld-z80
lib powerpc-aix5.2 tests 2020-07-08 15:56:28 +09:30
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-9303