Skip to content
Snippets Groups Projects
Commit 0990d93d authored by Ilya Leoshkevich's avatar Ilya Leoshkevich
Browse files

IBM Z: Use @PLT symbols for local functions in 64-bit mode

This helps with generating code for kernel hotpatches, which contain
individual functions and are loaded more than 2G away from vmlinux.
This should not create performance regressions for the normal use
cases, because for local functions ld replaces @PLT calls with direct
calls.

gcc/ChangeLog:

	* config/s390/predicates.md (bras_sym_operand): Accept all
	functions in 64-bit mode, use UNSPEC_PLT31.
	(larl_operand): Use UNSPEC_PLT31.
	* config/s390/s390.c (s390_loadrelative_operand_p): Likewise.
	(legitimize_pic_address): Likewise.
	(s390_emit_tls_call_insn): Mark __tls_get_offset as function,
	use UNSPEC_PLT31.
	(s390_delegitimize_address): Use UNSPEC_PLT31.
	(s390_output_addr_const_extra): Likewise.
	(print_operand): Add @PLT to TLS calls, handle %K.
	(s390_function_profiler): Mark __fentry__/_mcount as function,
	use %K, use UNSPEC_PLT31.
	(s390_output_mi_thunk): Use only UNSPEC_GOT, use %K.
	(s390_emit_call): Use UNSPEC_PLT31.
	(s390_emit_tpf_eh_return): Mark __tpf_eh_return as function.
	* config/s390/s390.md (UNSPEC_PLT31): Rename from UNSPEC_PLT.
	(*movdi_64): Use %K.
	(reload_base_64): Likewise.
	(*sibcall_brc): Likewise.
	(*sibcall_brcl): Likewise.
	(*sibcall_value_brc): Likewise.
	(*sibcall_value_brcl): Likewise.
	(*bras): Likewise.
	(*brasl): Likewise.
	(*bras_r): Likewise.
	(*brasl_r): Likewise.
	(*bras_tls): Likewise.
	(*brasl_tls): Likewise.
	(main_base_64): Likewise.
	(reload_base_64): Likewise.
	(@split_stack_call<mode>): Likewise.

gcc/testsuite/ChangeLog:

	* g++.dg/ext/visibility/noPLT.C: Skip on s390x.
	* g++.target/s390/mi-thunk.C: New test.
	* gcc.target/s390/nodatarel-1.c: Move foostatic to the new
	tests.
	* gcc.target/s390/pr80080-4.c: Allow @PLT suffix.
	* gcc.target/s390/risbg-ll-3.c: Likewise.
	* gcc.target/s390/call.h: Common code for the new tests.
	* gcc.target/s390/call-z10-pic-nodatarel.c: New test.
	* gcc.target/s390/call-z10-pic.c: New test.
	* gcc.target/s390/call-z10.c: New test.
	* gcc.target/s390/call-z9-pic-nodatarel.c: New test.
	* gcc.target/s390/call-z9-pic.c: New test.
	* gcc.target/s390/call-z9.c: New test.
	* gcc.target/s390/mfentry-m64-pic.c: New test.
	* gcc.target/s390/tls.h: Common code for the new TLS tests.
	* gcc.target/s390/tls-pic.c: New test.
	* gcc.target/s390/tls.c: New test.
parent df0d7486
No related branches found
No related tags found
No related merge requests found
Showing
with 320 additions and 73 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment