This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Constify host-side offload data`
- From: Nathan Sidwell <nathan at acm dot org>
- To: Ilya Verbin <iverbin at gmail dot com>, Bernd Schmidt <bschmidt at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Date: Wed, 21 Oct 2015 13:45:03 -0400
- Subject: Re: Constify host-side offload data`
- Authentication-results: sourceware.org; auth=none
- References: <55A70152 dot 8010702 at acm dot org> <20151021173350 dot GA7682 at msticlxl57 dot ims dot intel dot com>
On 10/21/15 13:33, Ilya Verbin wrote:
Hi!
This happens because .gnu.offload_{funcs,vars} sections in
crtoffload{begin,end}.o now doesn't have WRITE flag, but the same sections
produced by omp_finish_file has it. When linker joins writable + nonwritable
sections from several objects, it inserts some weird 2MB offset into the final
binary. I.e. now there are 2 such offsets: one in the host binary and one in
the MIC target image, hence 4MB. I haven't investigated how it happens, because
I thing it's bad idea to join sections with different flags.
That is a strange insertion of padding. Joining sections with different flags,
is IIUC, perfectly fine.
But we can't make .gnu.offload_{funcs,vars} in omp_finish_file also readonly,
because in case of shared libraries there are R_X86_64_RELATIVE relocations,
Um, I thought they had absolute relocs, and thus were relro, but ICBW.
which make these sections writable. So, I guess we need to remove all consts to
make these sections writable in all objects.
That seems like the prudent path.
nathan