aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.cc
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel@linux.ibm.com>2023-08-01 21:01:19 +0200
committerAndreas Krebbel <krebbel@linux.ibm.com>2023-08-01 21:01:33 +0200
commit6cb2f2c7f36c999590a949f663d6057cbc67271f (patch)
treeeb712fd24e11ab01c1333f48a00d57cb9f52d0d0 /gcc/tree-cfg.cc
parent7c09e7e24b0d04857d5880197959e75bda0c489e (diff)
downloadgcc-6cb2f2c7f36c999590a949f663d6057cbc67271f.zip
gcc-6cb2f2c7f36c999590a949f663d6057cbc67271f.tar.gz
gcc-6cb2f2c7f36c999590a949f663d6057cbc67271f.tar.bz2
IBM Z: Handle unaligned symbols
The IBM Z ELF ABI mandates every symbol to reside on a 2 byte boundary in order to be able to use the larl instruction. However, in some situations it is difficult to enforce this, e.g. for common linker scripts as used in the Linux kernel. This patch introduces the -munaligned-symbols option. When that option is used, external symbols without an explicit alignment are considered unaligned and its address will be pushed into GOT or the literal pool. If the symbol in the final linker step turns out end up on a 2 byte boundary the linker is able to take this back and replace the indirect reference with larl again. This should minimize the effect to symbols which are actually unaligned in the end. gcc/ChangeLog: * config/s390/s390.cc (s390_encode_section_info): Assume external symbols without explicit alignment to be unaligned if -munaligned-symbols has been specified. * config/s390/s390.opt (-munaligned-symbols): New option. gcc/testsuite/ChangeLog: * gcc.target/s390/aligned-1.c: New test. * gcc.target/s390/unaligned-1.c: New test.
Diffstat (limited to 'gcc/tree-cfg.cc')
0 files changed, 0 insertions, 0 deletions