diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2019-10-16 14:24:41 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco@gcc.gnu.org> | 2019-10-16 14:24:41 +0000 |
commit | 7d3b27ff12610fde9d6c4b56abc70c6ee9b6b3db (patch) | |
tree | 2c2ebc761a61533c8bc20a4cc3ae61decee73ab5 /gcc/tree-ssa-strlen.c | |
parent | aab8c2fd6542a52663243eec160b80bdd61516d5 (diff) | |
download | gcc-7d3b27ff12610fde9d6c4b56abc70c6ee9b6b3db.zip gcc-7d3b27ff12610fde9d6c4b56abc70c6ee9b6b3db.tar.gz gcc-7d3b27ff12610fde9d6c4b56abc70c6ee9b6b3db.tar.bz2 |
[AArch64] Fix symbol offset limit
In aarch64_classify_symbol symbols are allowed large offsets on relocations.
This means the offset can use all of the +/-4GB offset, leaving no offset
available for the symbol itself. This results in relocation overflow and
link-time errors for simple expressions like &global_array + 0xffffff00.
To avoid this, unless the offset_within_block_p is true, limit the offset
to +/-1MB so that the symbol needs to be within a 3.9GB offset from its
references. For the tiny code model use a 64KB offset, allowing most of
the 1MB range for code/data between the symbol and its references.
gcc/
* config/aarch64/aarch64.c (aarch64_classify_symbol):
Apply reasonable limit to symbol offsets.
testsuite/
* gcc.target/aarch64/symbol-range.c: Improve testcase.
* gcc.target/aarch64/symbol-range-tiny.c: Likewise.
From-SVN: r277068
Diffstat (limited to 'gcc/tree-ssa-strlen.c')
0 files changed, 0 insertions, 0 deletions