]> git.ipfire.org Git - thirdparty/gcc.git/commit
S/390: New option -mpic-data-is-text-relative
authorkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 28 Jun 2017 07:03:35 +0000 (07:03 +0000)
committerkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 28 Jun 2017 07:03:35 +0000 (07:03 +0000)
commit9852c8ae78561152e9335c0416058b42ac26f41c
tree23d3790403d00862b7e13222615a0f27eeb982cc
parent87c7c57ebc43f0818909014b9c9ff5c6f704b67c
S/390: New option -mpic-data-is-text-relative

For hotpatching it might be required to introduce new .text parts
while keep using the existing .data/.bss sections.  To make this work
the backend needs to be prevented from using relative addressing
between code and data.
This only works when already building PIC
since the addressing will then be handling via GOT.

gcc/testsuite/ChangeLog:

2017-06-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* gcc.target/s390/nodatarel-1.c: New test.

gcc/ChangeLog:

2017-06-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* config/s390/predicates.md: Use s390_rel_address_ok_p.
* config/s390/s390-protos.h: Add prototype of
s390_rel_address_ok_p.
* config/s390/s390.c (s390_got_symbol): New function.
(s390_rel_address_ok_p): New function.
(legitimize_pic_address): Use s390_rel_address_ok_p.
(s390_load_got): Use s390_got_symbol.
(s390_option_override): Issue error if
-mno-pic-data-is-text-relative is used without -fpic/-fPIC.
* config/s390/s390.h (TARGET_DEFAULT_PIC_DATA_IS_TEXT_RELATIVE):
New macro.
* config/s390/s390.opt: New option mpic-data-is-text-relative.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249720 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/s390/predicates.md
gcc/config/s390/s390-protos.h
gcc/config/s390/s390.c
gcc/config/s390/s390.h
gcc/config/s390/s390.opt
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/s390/nodatarel-1.c [new file with mode: 0644]