LKML Archive on
help / color / mirror / Atom feed
From: David Miller <>
Subject: Re: Early crash
Date: Mon, 07 Feb 2011 00:50:10 -0800 (PST)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

From: Dmitry Torokhov <>
Date: Mon, 7 Feb 2011 00:19:33 -0800

> So here is the patch that explicitly specifies alignment for struct
> module_version_attribute. I tested it on i386 and x86_64 and I believe
> it will fix the issue with m68k but I do not have access to such a box.

While this may or may not fix the m68k issue, this isn't really
sufficient to make this thing work in all cases.  And the older
tracepoint commits referenced in this thread are known to cause
problems with platforms such as sparc64.

You can't reliably put structures into independent objects, put them
into a special section, and then expect array access over them (via
the section boundaries) after linking the objects together to just

Your attribute specification is only a lower-bound.

GCC can and does use variable alignment choices in different situations,
so the align directive in the various objects can all be different.  So
the array iteration will assume the iterations should use one object
size, but within the linked together section the alignments are all
different so the inter-struct gap is different.

The only portable mechanism that will work in all cases, as we've
found recently for tracepoints and similar, is to make an array of
plain pointers to the objects in the special section.


  reply	other threads:[~2011-02-07  8:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01 20:33 Early crash (was: Re: module: show version information for built-in modules in sysfs) Geert Uytterhoeven
2011-02-01 21:09 ` Dmitry Torokhov
2011-02-01 22:03   ` Geert Uytterhoeven
2011-02-01 22:26     ` Dmitry Torokhov
2011-02-02 14:48       ` Geert Uytterhoeven
2011-02-02 19:42         ` Dmitry Torokhov
2011-02-02 22:52           ` Andreas Schwab
2011-02-02 23:59             ` Dmitry Torokhov
2011-02-03  0:10               ` Andreas Schwab
2011-02-03  0:24                 ` Dmitry Torokhov
2011-02-03 17:38                   ` Andreas Schwab
2011-02-07  8:19                   ` Dmitry Torokhov
2011-02-07  8:50                     ` David Miller [this message]
2011-02-07 16:58                       ` Early crash Dmitry Torokhov
2011-02-07 19:27                         ` David Miller
2011-02-07 19:28                           ` Dmitry Torokhov
2011-02-08  3:12                           ` Rusty Russell
2011-02-08  3:31                             ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \
    --subject='Re: Early crash' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).