binutils-gdb/ld/testsuite
Alan Modra 63c1f59d66 readonly_dynrelocs
In early October, HJ Lu added support for a number of targets to "Dump
dynamic relocation in read-only section with minfo".  This extends
that support to more targets, displays the symbol involved, and splits
the existing function that sets TEXTREL into a "readonly_dynrelocs"
and "maybe_set_textrel" function.  I'll need "readonly_dynrelocs" if I
ever get around to fixing "pr22374 function pointer initialization"
fails.

am33_2.0, arc, bfin, hppa64, mn10300, and nios2 fail to mark a binary
needing text relocations with DT_TEXTREL.  That's not good.  xtensa also
fails to do so but complains about "dangerous relocation: dynamic
relocation in read-only section" so I reckon that is fine and have
marked the test as an xfail.  The other targets need maintainer
attention.

Curiously, the map file dump wasn't added for x86, so the map test
currently fail on x86.  It also fails on alpha, am33_2.0, arc, bfin,
hppa64, ia64, m68k, mips, mn10300, nios2, score and vax.  cris
complains with "tmpdir/textrel.o, section .rodata: relocation
R_CRIS_32 should not be used in a shared object; recompile with -fPIC"
so I've marked it as an xfail.

bfd/
	* elf32-hppa.c (maybe_set_textrel): Print symbol for map file output.
	* elf32-ppc.c (maybe_set_textrel): Likewise.
	* elf64-ppc.c (maybe_set_textrel): Likewise.
	* elf32-arm.c (readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing..
	(elf32_arm_readonly_dynrelocs): ..this.
	* elf32-lm32.c (readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing old version of..
	(readonly_dynrelocs): ..this.
	* elf32-m32r.c (readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing old version of..
	(readonly_dynrelocs): ..this.
	* elf32-metag.c (readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing old version of..
	(readonly_dynrelocs): ..this.
	* elf32-nds32.c: Delete unnecessary forward declarations.
	(readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing old version of..
	(readonly_dynrelocs): ..this.
	* elf32-or1k.c (readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing old version of..
	(readonly_dynrelocs): ..this.
	* elf32-s390.c (readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing old version of..
	(readonly_dynrelocs): ..this.
	* elf32-sh.c (readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing old version of..
	(readonly_dynrelocs): ..this.
	* elf32-tic6x.c (readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing..
	(elf32_tic6x_readonly_dynrelocs): ..this.
	* elf32-tilepro.c (readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing old version of..
	(readonly_dynrelocs): ..this.
	* elf64-s390.c (readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing old version of..
	(readonly_dynrelocs): ..this.
	* elfnn-aarch64.c (readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing..
	(aarch64_readonly_readonly_dynrelocs): ..this.
	* elfnn-riscv.c (readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing old version of..
	(readonly_dynrelocs): ..this.
	* elfxx-sparc.c (readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing old version of..
	(readonly_dynrelocs): ..this.
	* elfxx-tilegx.c (readonly_dynrelocs): New function.
	(maybe_set_textrel): New function, replacing old version of..
	(readonly_dynrelocs): ..this.
ld/
	* testsuite/ld-elf/shared.exp: Run new textrel tests.
	* testsuite/ld-elf/textrel.map: New file.
	* testsuite/ld-elf/textrel.rd: New file.
	* testsuite/ld-elf/textrel.s: New file.
	* testsuite/ld-elf/textrel.warn: New file.
2017-12-01 17:23:56 +10:30
..
config Fix handling of GNU Property notes that are not in a GNU NOTE PROPERTY section. 2017-11-20 15:32:55 +00:00
ld-aarch64 readelf ngettext fixes 2017-11-07 17:01:16 +10:30
ld-alpha ld: Remove PF_X from PT_PHDR segment 2017-11-12 17:04:03 -08:00
ld-arc [ARC] Improve printing of pc-relative instructions. 2017-11-21 14:56:16 +01:00
ld-arm readelf ngettext fixes 2017-11-07 17:01:16 +10:30
ld-auto-import
ld-avr Add support to readelf and objdump for following links to separate debug information files. 2017-11-15 11:34:03 +00:00
ld-bootstrap
ld-cdtest
ld-checks
ld-cris readelf ngettext fixes 2017-11-07 17:01:16 +10:30
ld-crx
ld-cygwin
ld-d10v
ld-discard
ld-elf readonly_dynrelocs 2017-12-01 17:23:56 +10:30
ld-elfcomm
ld-elfvers
ld-elfvsb
ld-elfweak
ld-fastcall
ld-frv
ld-gc
ld-h8300
ld-i386 readelf ngettext fixes 2017-11-07 17:01:16 +10:30
ld-ia64 ld: Remove PF_X from PT_PHDR segment 2017-11-12 17:04:03 -08:00
ld-ifunc ld-ifunc non-PIC tests 2017-11-14 19:53:35 +10:30
ld-libs
ld-linkonce
ld-m68hc11
ld-m68k readelf ngettext fixes 2017-11-07 17:01:16 +10:30
ld-mep
ld-metag
ld-mips-elf PR22471, undefined reference to linker-defined symbols 2017-11-28 22:57:00 +10:30
ld-misc
ld-mmix
ld-mn10300
ld-msp430-elf
ld-nds32
ld-nios2
ld-pe
ld-pie
ld-plugin ld: Set non_ir_ref_regular on symbols referenced in regular objects 2017-11-28 03:48:44 -08:00
ld-powerpc ld: Remove PF_X from PT_PHDR segment 2017-11-12 17:04:03 -08:00
ld-pru
ld-riscv-elf testsuite/ld-riscv-elf/ld-riscv-elf.exp: Fix typo for istarget. 2017-10-25 00:45:05 +02:00
ld-s390 ld: Remove PF_X from PT_PHDR segment 2017-11-12 17:04:03 -08:00
ld-scripts
ld-selective
ld-sh readelf ngettext fixes 2017-11-07 17:01:16 +10:30
ld-shared
ld-size
ld-sparc ld: Remove PF_X from PT_PHDR segment 2017-11-12 17:04:03 -08:00
ld-spu
ld-srec
ld-tic6x readelf ngettext fixes 2017-11-07 17:01:16 +10:30
ld-tilegx
ld-tilepro
ld-undefined
ld-unique Stop the v850 linker from converting to other output formats whilst linking. 2017-11-21 14:15:51 +00:00
ld-v850
ld-vax-elf readelf ngettext fixes 2017-11-07 17:01:16 +10:30
ld-versados
ld-visium
ld-vxworks
ld-x86-64 x86-64: always use unsigned 32-bit reloc for 32-bit addressing w/o base reg 2017-11-23 11:02:30 +01:00
ld-xc16x
ld-xstormy16
ld-xtensa
ld-z8k
lib
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