https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84052

Arsen Arsenović <arsen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arsen at gcc dot gnu.org

--- Comment #7 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
I think this can be fixed in the plugin if a new event was added to GCC just
before laying out the struct:

modified   gcc/c/c-decl.cc
@@ -9678,6 +9678,9 @@ finish_struct (location_t loc, tree t, tree fieldlist,
tree attributes,

   TYPE_FIELDS (t) = fieldlist;

+  invoke_plugin_callbacks (PLUGIN_BEFORE_STRUCT_LAYOUT, t);
+  fieldlist = TYPE_FIELDS (t);
+
   maybe_apply_pragma_scalar_storage_order (t);

   layout_type (t);

I've modified the current Linux randomizer plugin to make use of this and it
/seems/ to work but I didn't fully test it yet so I'm not sure.  WDYT of the
above?

Reply via email to