diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2019-10-10 19:04:33 +0000 |
---|---|---|
committer | Iain Sandoe <iains@gcc.gnu.org> | 2019-10-10 19:04:33 +0000 |
commit | eb870e5e5ed4d5b784533d23afee637543e7dacc (patch) | |
tree | 5c45bb0827a72450841153743607a532a3218d43 /gcc/objc | |
parent | d102b039463a39f0baf66a223300f9440dbb04d2 (diff) | |
download | gcc-eb870e5e5ed4d5b784533d23afee637543e7dacc.zip gcc-eb870e5e5ed4d5b784533d23afee637543e7dacc.tar.gz gcc-eb870e5e5ed4d5b784533d23afee637543e7dacc.tar.bz2 |
[Objective-C, NeXT ABI] Identify V2 IVAR refs by metadata.
For the NeXT 64b ABI, IVAR refs are supposed to be indirected for
Mach-O PIC. Identify them so that we can act as needed.
gcc/objc/ChangeLog:
2019-10-10 Iain Sandoe <iain@sandoe.co.uk>
* objc-next-metadata-tags.h (OCTI_RT_META_IVAR_REF): New.
(meta_ivar_ref): New.
* objc-next-runtime-abi-02.c
(next_runtime_abi_02_init_metadata_attributes): Create the
IVAR ref metadata identifier.
(ivar_offset_ref): Tag IVAR refs with specific metadata.
From-SVN: r276847
Diffstat (limited to 'gcc/objc')
-rw-r--r-- | gcc/objc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/objc/objc-next-metadata-tags.h | 4 | ||||
-rw-r--r-- | gcc/objc/objc-next-runtime-abi-02.c | 6 |
3 files changed, 17 insertions, 2 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 2b8f889..7919c3e 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,12 @@ +2019-10-10 Iain Sandoe <iain@sandoe.co.uk> + + * objc-next-metadata-tags.h (OCTI_RT_META_IVAR_REF): New. + (meta_ivar_ref): New. + * objc-next-runtime-abi-02.c + (next_runtime_abi_02_init_metadata_attributes): Create the + IVAR ref metadata identifier. + (ivar_offset_ref): Tag IVAR refs with specific metadata. + 2019-06-05 Martin Sebor <msebor@redhat.com> * objc-act.c (objc_build_setter_call): Adjust quoting and hyphenation. diff --git a/gcc/objc/objc-next-metadata-tags.h b/gcc/objc/objc-next-metadata-tags.h index 1822aa7..933f08c 100644 --- a/gcc/objc/objc-next-metadata-tags.h +++ b/gcc/objc/objc-next-metadata-tags.h @@ -74,6 +74,8 @@ enum objc_runtime_tree_index OCTI_RT_META_CONST_STR, + OCTI_RT_META_IVAR_REF, + OCTI_RT_META_MAX }; @@ -167,6 +169,8 @@ enum objc_runtime_tree_index #define meta_const_str objc_rt_trees[OCTI_RT_META_CONST_STR] +#define meta_ivar_ref objc_rt_trees[OCTI_RT_META_IVAR_REF] + #define OBJCMETA(DECL,VERS,KIND) \ if (VERS) \ DECL_ATTRIBUTES (DECL) = build_tree_list ((VERS), (KIND)); diff --git a/gcc/objc/objc-next-runtime-abi-02.c b/gcc/objc/objc-next-runtime-abi-02.c index aa1cbde..3e38b7d 100644 --- a/gcc/objc/objc-next-runtime-abi-02.c +++ b/gcc/objc/objc-next-runtime-abi-02.c @@ -345,6 +345,8 @@ next_runtime_abi_02_init_metadata_attributes (void) meta_ehtype = get_identifier ("V2_EHTY"); meta_const_str = get_identifier ("V2_CSTR"); + + meta_ivar_ref = get_identifier ("V2_IVRF"); } static void next_runtime_02_initialize (void) @@ -2795,8 +2797,8 @@ ivar_offset_ref (tree class_name, tree field_decl) else decl = create_hidden_decl (TREE_TYPE (size_zero_node), buf); - /* Make sure it ends up in an ObjC section. */ - OBJCMETA (decl, objc_meta, meta_base); + /* Identify so that we can indirect these where the ABI requires. */ + OBJCMETA (decl, objc_meta, meta_ivar_ref); e.decl = decl; e.offset = byte_position (field_decl); |