Message ID | 8ff73c3e-932a-bb76-cef5-de72d0b54b4a@suse.cz |
---|---|
State | New |
Headers | show |
Series | Fill up padding in lto_section struct. | expand |
On Wed, Feb 03, 2021 at 12:58:12PM +0100, Martin Liška wrote: > The patch is about filling a padding byte that is later > streamed with memcpy. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Martin > > gcc/ChangeLog: > > PR lto/98912 > * lto-streamer-out.c (produce_lto_section): Fill up missing > padding. > * lto-streamer.h (struct lto_section): Add _padding field. LGTM, thanks. > --- a/gcc/lto-streamer-out.c > +++ b/gcc/lto-streamer-out.c > @@ -2670,7 +2670,7 @@ produce_lto_section () > bool slim_object = flag_generate_lto && !flag_fat_lto_objects; > lto_section s > - = { LTO_major_version, LTO_minor_version, slim_object, 0 }; > + = { LTO_major_version, LTO_minor_version, slim_object, 0, 0 }; > s.set_compression (compression); > lto_write_data (&s, sizeof s); > lto_end_section (); > diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h > index 7736ae77b8b..5c7cd84d46f 100644 > --- a/gcc/lto-streamer.h > +++ b/gcc/lto-streamer.h > @@ -369,6 +369,7 @@ struct lto_section > int16_t major_version; > int16_t minor_version; > unsigned char slim_object; > + unsigned char _padding; > /* Flags is a private field that is not defined publicly. */ > uint16_t flags; > -- > 2.30.0 Jakub
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 405f3bfc56c..a26d4885800 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -2670,7 +2670,7 @@ produce_lto_section () bool slim_object = flag_generate_lto && !flag_fat_lto_objects; lto_section s - = { LTO_major_version, LTO_minor_version, slim_object, 0 }; + = { LTO_major_version, LTO_minor_version, slim_object, 0, 0 }; s.set_compression (compression); lto_write_data (&s, sizeof s); lto_end_section (); diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h index 7736ae77b8b..5c7cd84d46f 100644 --- a/gcc/lto-streamer.h +++ b/gcc/lto-streamer.h @@ -369,6 +369,7 @@ struct lto_section int16_t major_version; int16_t minor_version; unsigned char slim_object; + unsigned char _padding; /* Flags is a private field that is not defined publicly. */ uint16_t flags;