Ability to disable 32-byte alignment of bss/data symbols with size > 32 bytes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi - I have the following test program:

struct
{
    int arr[10];
} mycomm ;

int arr_bss[10] ;
int arr_data[10] = {1} ;

Compiling it with '-S' using gcc 4.3.2 under Linux (x86) shows that
each of the three symbols gets aligned on a 32 *BYTE* boundary.
    ...
    .comm    mycomm,40,32
    .comm    arr_bss,40,32
    .align 32
    .type    arr_data, @object
    .size    arr_data, 40


If I pass "-Os", the alignments drop to 4 bytes (as expected);
"__attribute__ ((aligned(4))" also works.  However, I'd very much like
a way to control this behavior globally without getting everything
else that "-Os" comes with.  A "-f" switch perhaps?  I was able to
find http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30004, which appears
to have relaxed the alignment under "-Os" specifically.

For what it's worth, GCC 4.3.2 on Solaris 10 (sparc) emits 4-byte
alignment.  Also, sun's studio 12 compiler on Linux (x86) does the
same.

Thanks in advance.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux