diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2019-10-09 18:43:36 +0000 |
---|---|---|
committer | Iain Sandoe <iains@gcc.gnu.org> | 2019-10-09 18:43:36 +0000 |
commit | a0e887be6147edcd14a5b95af17456d0a01575d4 (patch) | |
tree | 614da0f4385ce7194462750a99f97fb117b32032 /gcc/config/darwin.c | |
parent | e295e3d981355c61b72eca2ee58864958655cc31 (diff) | |
download | gcc-a0e887be6147edcd14a5b95af17456d0a01575d4.zip gcc-a0e887be6147edcd14a5b95af17456d0a01575d4.tar.gz gcc-a0e887be6147edcd14a5b95af17456d0a01575d4.tar.bz2 |
[Darwin, machopic 3/n] Set a SYMBOL flag for indirections.
We are able to treat these specially where needed in legitimate address
tests (specifically, they are guaranteed to be pointer-aligned).
gcc/ChangeLog:
2019-10-09 Iain Sandoe <iain@sandoe.co.uk>
* config/darwin.c (machopic_indirect_data_reference): Set flag to
indicate that the new symbol is an indirection.
(machopic_indirect_call_target): Likewise.
* config/darwin.h (MACHO_SYMBOL_FLAG_INDIRECTION): New.
(MACHO_SYMBOL_INDIRECTION_P): New.
(MACHO_SYMBOL_FLAG_STATIC): Adjust bit number.
From-SVN: r276767
Diffstat (limited to 'gcc/config/darwin.c')
-rw-r--r-- | gcc/config/darwin.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 679e0c2..35d0444 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -707,6 +707,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg) machopic_indirection_name (orig, /*stub_p=*/false))); SYMBOL_REF_DATA (ptr_ref) = SYMBOL_REF_DATA (orig); + SYMBOL_REF_FLAGS (ptr_ref) |= MACHO_SYMBOL_FLAG_INDIRECTION; ptr_ref = gen_const_mem (Pmode, ptr_ref); machopic_define_symbol (ptr_ref); @@ -806,6 +807,7 @@ machopic_indirect_call_target (rtx target) XEXP (target, 0) = gen_rtx_SYMBOL_REF (mode, stub_name); SYMBOL_REF_DATA (XEXP (target, 0)) = SYMBOL_REF_DATA (sym_ref); + SYMBOL_REF_FLAGS (XEXP (target, 0)) |= MACHO_SYMBOL_FLAG_INDIRECTION; MEM_READONLY_P (target) = 1; MEM_NOTRAP_P (target) = 1; } |