public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* section placement q
@ 2000-05-11 18:15 Andrew Morton
  2000-05-11 19:01 ` Linus Torvalds
  0 siblings, 1 reply; 16+ messages in thread
From: Andrew Morton @ 2000-05-11 18:15 UTC (permalink / raw)
  To: gcc

The linux kernel likes to put lots of things into special sections so
those sections can be unloaded when not neeed.  However this is less
effective than it might be because strings are still placed in .rodata. 
Example:

struct foo
{
        int i;
        char *s;
};

struct foo foo_array[] __attribute__ ((__section__(".foosect"))) =
{
        { 12, "foo1" }
};

Here, the integer and the char * are placed in .foosect, but the actual
string "foo1\0" is placed in .rodata.

I believe this behaviour is correct and logical.  One probably unpopular
workaround is to change 'char *s' into 'char s[20]'.

Can anyone suggest a construct which will allow the string to be placed
in a different section while retaining the current 'char *' semantics?


Thanks.

-- 
-akpm-

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2000-05-26  6:54 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-11 18:15 section placement q Andrew Morton
2000-05-11 19:01 ` Linus Torvalds
2000-05-13 21:47   ` Andrew Morton
2000-05-14 19:40     ` Graham Stoney
2000-05-15 10:56       ` Linus Torvalds
2000-05-24 18:40     ` Artur Skawina
2000-05-24 19:18       ` Andrew Morton
2000-05-25  6:58         ` Artur Skawina
2000-05-25  7:15           ` Andrew Morton
2000-05-25 17:43             ` Artur Skawina
2000-05-25 10:09           ` Jamie Lokier
2000-05-25 10:20             ` Richard Henderson
2000-05-25 17:43             ` Artur Skawina
2000-05-26  3:52               ` Jamie Lokier
2000-05-26  5:17                 ` Andrew Morton
2000-05-26  6:54                   ` Jamie Lokier

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 read-only IMAP folder(s) and NNTP newsgroup(s).