This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ARM/FDPIC v5 04/21] [ARM] FDPIC: Add support for FDPIC for arm architecture
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: Christophe Lyon <christophe dot lyon at linaro dot org>
- Cc: Christophe Lyon <christophe dot lyon at st dot com>, gcc Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 05 Sep 2019 09:03:14 +0100
- Subject: Re: [ARM/FDPIC v5 04/21] [ARM] FDPIC: Add support for FDPIC for arm architecture
- References: <20190515124006.25840-1-christophe.lyon@st.com> <20190515124006.25840-5-christophe.lyon@st.com> <mptblxu8a41.fsf@arm.com> <b6cf8cf9-def4-2438-6144-d4efd7fcd579@st.com> <mptblw2he2t.fsf@arm.com> <CAKdteOYLF-wDBxr4sCkyrbWaE=7VGjYujYxWNf9o4NcsTh2PGw@mail.gmail.com> <mptpnkhg4de.fsf@arm.com> <CAKdteOYfZX3guENyaMwXbmOvhegSUTZCJtEuvr4Njhciqnke1g@mail.gmail.com>
Christophe Lyon <christophe.lyon@linaro.org> writes:
> + if (SYMBOL_REF_P (orig))
> + {
> + if (CONSTANT_POOL_ADDRESS_P (orig))
> + {
> + *is_readonly = true;
> + return true;
> + }
> + if (SYMBOL_REF_LOCAL_P (orig)
> + && !SYMBOL_REF_EXTERNAL_P (orig)
> + && SYMBOL_REF_DECL (orig)
> + && (!DECL_P (SYMBOL_REF_DECL (orig))
> + || !DECL_COMMON (SYMBOL_REF_DECL (orig))))
> + {
> + tree decl = SYMBOL_REF_DECL (orig);
> + tree init = (TREE_CODE (decl) == VAR_DECL)
> + ? DECL_INITIAL (decl) : (TREE_CODE (decl) == CONSTRUCTOR)
> + ? decl : 0;
> + int reloc = 0;
> + bool named_section, readonly;
> +
> + if (init && init != error_mark_node)
> + reloc = compute_reloc_for_constant (init);
> +
> + named_section = TREE_CODE (decl) == VAR_DECL
> + && lookup_attribute ("section", DECL_ATTRIBUTES (decl));
> + readonly = decl_readonly_section (decl, reloc);
> +
> + /* We don't know where the link script will put a named
> + section, so return false in such a case. */
> + if (named_section)
> + return false;
> +
> + *is_readonly = readonly;
> + return true;
> + }
> + else
> + /* We don't know. */
> + return false;
Nit: no need for the "else".
OK with that changes, thanks.
Richard