old-cross-binutils/ld/testsuite/ld-elf/symbolic-func.r
Alan Modra a496fbc880 Fix broken -Bsymbolic-functions
For selected targets.  The testcase reveals a number of targets that
still need fixing.

bfd/
	* elf32-arm.c (elf32_arm_final_link_relocate): Use SYMBOLIC_BIND to
	check if a symbol should be bound symbolically.
	* elf32-hppa.c (elf32_hppa_check_relocs,
	elf32_hppa_adjust_dynamic_symbol, elf32_hppa_relocate_section,
	elf32_hppa_finish_dynamic_symbol): Likewise.
	* elf32-m68k.c (elf_m68k_check_relocs,
	elf_m68k_relocate_section): Likewise.
	* elf32-nios2.c (nios2_elf32_relocate_section,
	nios2_elf32_check_relocs, allocate_dynrelocs): Likewise.
	* elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol,
	elf32_tic6x_relocate_section): Likewise.
ld/testsuite/
	* ld-elf/symbolic-func.s,
	* ld-elf/symbolic-func.r: New test.
	* ld-elf/elf.exp: Run it.
2015-07-25 20:41:04 +09:30

18 lines
840 B
R

# Most targets will emit an R_*_RELATIVE reloc here, but RELATIVE
# relocs are superfluous. A target can do without them by simply
# defining an ADDR32 or ADDR64 style reloc without a symbol to behave
# like a RELATIVE reloc. GLOB_DAT relocs are similarly superfluous.
# In fact, a RELATIVE reloc can be wrong even if a target does have
# them, if the 32-bit or 64-bit field being relocated is unaligned.
# In that case the target ought to emit a UADDR32/64 or similar rather
# than a RELATIVE reloc.
#
# We also allow a dynamic reloc with a reference to .text as that
# should also resolve correctly. No reloc, or one referencing "fun"
# is incorrect. Also fail the test on finding a reloc at offset 0,
# typically a NONE reloc.
Relocation section.*
*Offset.*
0*[1-9a-f][0-9a-f]* +[^ ]+ +[^ ]+ +([0-9a-f]+( +\.text( \+ 0)?)?)?
#pass