This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix -fPIC on ppc-*-linux*
- From: Richard Henderson <rth at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Alan Modra <amodra at bigpond dot net dot au>, Geoff Keating <geoffk at geoffk dot org>, Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 7 Feb 2003 14:46:33 -0800
- Subject: Re: [PATCH] Fix -fPIC on ppc-*-linux*
- References: <20030129142108.P17910@sunsite.ms.mff.cuni.cz>
On Wed, Jan 29, 2003 at 02:21:08PM +0100, Jakub Jelinek wrote:
> +/* We don't need to generate entries in .fixup. */
> +#undef RELOCATABLE_NEEDS_FIXUP
After the message from Franz, I think this part is ok.
I'd really rather we didn't treat -fPIC == -mrelocatable,
but that's probably a reasonalble amount of overhaul.
> = default_section_type_flags_1 (decl, name, reloc,
> flag_pic || DEFAULT_ABI == ABI_AIX);
>
> +#ifdef RELOCATABLE_NEEDS_FIXUP
> if (TARGET_RELOCATABLE)
> flags |= SECTION_WRITE;
> +#endif
Here I think it's better we do
bool rw_relocs = flag_pic || DEFAULT_ABI == ABI_AIX;
#ifdef RELOCATABLE_NEEDS_FIXUP
if (TARGET_RELOCATABLE)
rw_relocs = 1;
#endif
... = default_section_type_flags_1 (decl, name, reloc, rw_relocs);
I expect you'd have to modify several of the other section
manipulation hooks as well.
r~