Re: Constify host-side offload data`

2015-10-22 Thread Ilya Verbin
On Wed, Oct 21, 2015 at 10:44:56 -0700, H.J. Lu wrote: > On Wed, Oct 21, 2015 at 10:42 AM, Ilya Verbin wrote: > > On Wed, Oct 21, 2015 at 10:38:10 -0700, H.J. Lu wrote: > >> On Wed, Oct 21, 2015 at 10:33 AM, Ilya Verbin wrote: > >> > H.J., > >> > Maybe

Re: Constify host-side offload data`

2015-10-22 Thread H.J. Lu
On Thu, Oct 22, 2015 at 7:11 AM, Ilya Verbin wrote: > On Wed, Oct 21, 2015 at 10:44:56 -0700, H.J. Lu wrote: >> On Wed, Oct 21, 2015 at 10:42 AM, Ilya Verbin wrote: >> > On Wed, Oct 21, 2015 at 10:38:10 -0700, H.J. Lu wrote: >> >> On Wed, Oct 21, 2015 at

Re: Constify host-side offload data`

2015-10-22 Thread Ilya Verbin
On Thu, Oct 22, 2015 at 07:35:55 -0700, H.J. Lu wrote: > On Thu, Oct 22, 2015 at 7:11 AM, Ilya Verbin wrote: > > On Wed, Oct 21, 2015 at 10:44:56 -0700, H.J. Lu wrote: > >> On Wed, Oct 21, 2015 at 10:42 AM, Ilya Verbin wrote: > >> > On Wed, Oct 21, 2015 at

Re: Constify host-side offload data`

2015-10-21 Thread H.J. Lu
On Wed, Oct 21, 2015 at 10:33 AM, Ilya Verbin wrote: > Hi! > > On Wed, Jul 15, 2015 at 20:56:50 -0400, Nathan Sidwell wrote: >> --- libgcc/offloadstuff.c (revision 225851) >> +++ libgcc/offloadstuff.c (working copy) >> ... >> -void *__offload_func_table[0] >> +const

Re: Constify host-side offload data`

2015-10-21 Thread H.J. Lu
On Wed, Oct 21, 2015 at 10:42 AM, Ilya Verbin wrote: > On Wed, Oct 21, 2015 at 10:38:10 -0700, H.J. Lu wrote: >> On Wed, Oct 21, 2015 at 10:33 AM, Ilya Verbin wrote: >> > H.J., >> > Maybe linker should print some warning about joining writable + nonwritable

Re: Constify host-side offload data`

2015-10-21 Thread Nathan Sidwell
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

Re: Constify host-side offload data`

2015-10-21 Thread Ilya Verbin
Hi! On Wed, Jul 15, 2015 at 20:56:50 -0400, Nathan Sidwell wrote: > --- libgcc/offloadstuff.c (revision 225851) > +++ libgcc/offloadstuff.c (working copy) > ... > -void *__offload_func_table[0] > +const void *const __offload_func_table[0] > ... > -void *__offload_var_table[0] > +const

Re: Constify host-side offload data`

2015-10-21 Thread Ilya Verbin
On Wed, Oct 21, 2015 at 10:38:10 -0700, H.J. Lu wrote: > On Wed, Oct 21, 2015 at 10:33 AM, Ilya Verbin wrote: > > H.J., > > Maybe linker should print some warning about joining writable + nonwritable > > sections? Here is a simple testcase: > > > > $ cat t1.s > > .section

Re: Constify host-side offload data`

2015-07-17 Thread Jakub Jelinek
On Thu, Jul 16, 2015 at 08:20:53AM -0400, Nathan Sidwell wrote: On 07/16/15 07:41, Ilya Verbin wrote: On Wed, Jul 15, 2015 at 20:56:50 -0400, Nathan Sidwell wrote: Index: gcc/config/nvptx/mkoffload.c === - fprintf (out, extern

Re: Constify host-side offload data`

2015-07-16 Thread Ilya Verbin
On Wed, Jul 15, 2015 at 20:56:50 -0400, Nathan Sidwell wrote: Index: gcc/config/nvptx/mkoffload.c === - fprintf (out, extern void *__OFFLOAD_TABLE__[];\n\n); + fprintf (out, extern const void *conat __OFFLOAD_TABLE__[];\n\n);

Re: Constify host-side offload data`

2015-07-16 Thread Nathan Sidwell
On 07/16/15 07:41, Ilya Verbin wrote: On Wed, Jul 15, 2015 at 20:56:50 -0400, Nathan Sidwell wrote: Index: gcc/config/nvptx/mkoffload.c === - fprintf (out, extern void *__OFFLOAD_TABLE__[];\n\n); + fprintf (out, extern const void

Constify host-side offload data`

2015-07-15 Thread Nathan Sidwell
This patch constifies the objects involved in describing the host-side offloading information. Probably won't make much difference in executable layout because of relocations, but at least allows them to be put into .rel.rodata, and makes it clear the objects aren't modified. ok for trunk?