binutils-gdb/ld/testsuite
Maciej W. Rozycki fa3b131151 PR ld/26288: Allow the use of `--just-symbols' with ET_EXEC input
Fix a regression from commit a87e1817a4 ("Have the linker fail if any
attempt to link in an executable is made.") and do not reject ET_EXEC
input supplied with the `--just-symbols' option.  Such use is legitimate
as the file requested is not actually linked and only the symbols are
extracted. Furthermore it is often the most useful application, as
already observed in our documentation for the option, where it allows
"to refer symbolically to absolute locations of memory defined in other
programs."

Provide a set of tests for the use of ET_EXEC with `--just-symbols'.
These are excluded however for SH/PE targets because they complain if a
section's VMA is 0:

ld: zero vma section reloc detected: `.text' #0 f=32795
ld: zero vma section reloc detected: `.data' #1 f=291

and for x86_64/PE targets because they seem to hardwire the VMA:

 100000000 12000000 01000000 00000000 00000000  ................

	ld/
	PR ld/26288
	* ldelf.c (ldelf_after_open): Do not reject ET_EXEC input
	supplied with `--just-symbols'.
	* testsuite/ld-misc/just-symbols.exp: New test script.
	* testsuite/ld-misc/just-symbols-1.dd: New test dump.
	* testsuite/ld-misc/just-symbols.ld: New test linker script.
	* testsuite/ld-misc/just-symbols-0.s: New test source.
	* testsuite/ld-misc/just-symbols-1.s: New test source.

(cherry picked from commit 97c79e2174fbb0dda16850fa5366592e93d31cb9)
2020-07-23 20:24:58 +01:00
..
config Emit a warning when -z relro is unsupported 2020-06-19 09:50:20 +09:30
ld-aarch64 [PATCH v3] aarch64: Emit jump slot for conditional branch to undefined symbols 2020-05-19 11:07:52 +01:00
ld-alpha ecoff testsuite fixes 2020-06-20 10:59:11 +09:30
ld-arc [ARC][committed] Update test matching pattern. 2020-01-13 11:16:47 +02:00
ld-arm Re: Change readelf's display of symbol names 2020-07-03 17:15:16 +09:30
ld-auto-import Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-avr Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-bootstrap tcl global directive outside proc body does nothing (ld) 2020-06-04 16:11:19 +09:30
ld-bpf Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-cdtest Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-checks Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-cris cris: Don't generate unnecessary dynamic tags 2020-06-24 04:00:31 -07:00
ld-crx Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-csky csky: Don't generate unnecessary dynamic tags 2020-06-24 06:14:28 -07:00
ld-cygwin Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-d10v Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-discard Unnecessary load_lib in ld testsuite 2020-06-15 15:07:13 +09:30
ld-dynamic ld-dynamic test fixes 2020-06-04 14:13:04 +09:30
ld-elf Remove x86 NaCl target support 2020-06-30 08:56:14 -07:00
ld-elfcomm tcl global directive outside proc body does nothing (ld) 2020-06-04 16:11:19 +09:30
ld-elfvers Remove x86 NaCl target support 2020-06-30 08:56:14 -07:00
ld-elfvsb Use __asm__ rather than asm in ld testsuite 2020-06-16 22:13:20 +09:30
ld-elfweak Remove perror from ld_assemble, ld_compile and ld_nm 2020-06-20 15:53:37 +09:30
ld-fastcall Remove perror from ld_assemble, ld_compile and ld_nm 2020-06-20 15:53:37 +09:30
ld-frv tcl global directive outside proc body does nothing (ld) 2020-06-04 16:11:19 +09:30
ld-gc powerpc garbage collect test 2020-07-13 23:41:57 +09:30
ld-h8300 h8300-linux ld testsuite 2020-03-25 14:51:41 +10:30
ld-i386 x86: Update PR gas/26263 linker tests 2020-07-20 05:02:51 -07:00
ld-ia64 Remove perror from ld_assemble, ld_compile and ld_nm 2020-06-20 15:53:37 +09:30
ld-ifunc pr18841 tests on powerpc64 2020-07-13 23:41:01 +09:30
ld-libs Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-linkonce PR26103 testcase 2020-06-15 12:11:27 +09:30
ld-m68hc11 Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-m68k m68k: tag floating-point ABI used 2020-06-26 14:42:19 +09:30
ld-mep Remove perror from ld_assemble, ld_compile and ld_nm 2020-06-20 15:53:37 +09:30
ld-metag Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
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 PR ld/26288: Allow the use of `--just-symbols' with ET_EXEC input 2020-07-23 20:24:58 +01:00
ld-mmix mmix bfd: fix bfd_assert for R_MMIX_PUSHJ_STUBBABLE against undef'd symbol 2020-07-15 20:16:27 +02:00
ld-mn10300 Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-msp430-elf MSP430: Add input section rules for .upper sections to default linker script 2020-01-16 13:22:31 +00:00
ld-nds32 Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-nios2 Remove perror from ld_assemble, ld_compile and ld_nm 2020-06-20 15:53:37 +09:30
ld-or1k Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-pdp11 Fixes for the magic number used in PDP11 AOUT binaries. 2020-04-14 14:41:27 +01:00
ld-pe Use __asm__ rather than asm in ld testsuite 2020-06-16 22:13:20 +09:30
ld-pie Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-plugin ld: Properly override the IR definition 2020-07-22 05:47:43 -07:00
ld-powerpc Fix a problem with a few PowerPC linker tests when the .data section is retained. 2020-07-20 14:59:39 +01:00
ld-pru Fix binary compatibility between GCC and the TI compiler for the PRU target. 2018-05-09 11:39:32 +01:00
ld-riscv-elf RISC-V: Report warning when linking the objects with different priv specs. 2020-06-22 10:01:14 +08:00
ld-s12z Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-s390 Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-scripts Remove perror from ld_assemble, ld_compile and ld_nm 2020-06-20 15:53:37 +09:30
ld-selective Remove perror from ld_assemble, ld_compile and ld_nm 2020-06-20 15:53:37 +09:30
ld-sh Re: Change readelf's display of symbol names 2020-07-03 17:15:16 +09:30
ld-shared ld: Pass -z notext to linker for tests with DT_TEXTREL 2020-05-25 04:54:50 -07:00
ld-size Use __asm__ rather than asm in ld testsuite 2020-06-16 22:13:20 +09:30
ld-sparc Re: Change readelf's display of symbol names 2020-07-03 17:15:16 +09:30
ld-spu Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-srec tcl global directive outside proc body does nothing (ld) 2020-06-04 16:11:19 +09:30
ld-tic6x tic6x: Call _bfd_elf_add_dynamic_tags 2020-06-29 05:53:01 -07:00
ld-tilegx Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-tilepro Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-undefined Add generic tests for linker support of the -shared or -pie options to tests which use them. 2020-04-30 13:49:30 +01:00
ld-unique ld testsuite fails with default-PIE compiler 2020-06-04 10:20:48 +09:30
ld-v850 Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-vax-elf Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-visium Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-vxworks Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-x86-64 x86: Update PR gas/26263 linker tests 2020-07-20 05:02:51 -07:00
ld-xc16x Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-xstormy16 Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-xtensa xtensa: fix XTENSA_NDIFF handling for PR ld/25861 2020-04-29 18:34:23 -07:00
ld-z8k Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ld-z80 Various fixes for the Z80 support. 2020-02-19 17:46:10 +00:00
lib Remove perror from ld_assemble, ld_compile and ld_nm 2020-06-20 15:53:37 +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