Re: PCI Express support for 2.4 kernel

Tomas Szepe
2003-12-15T18:24:23Z

On Dec-16 2003, Tue, 05:16 +1100
Keith Owens <kaos@ocs.com.au> wrote:

> Does gcc 3.3.2 handle sections correctly when it optimizes zero
> assignments to use bss? With just this line in x.c
>
> static int __attribute__ ((__section__ (".init.data"))) a1 = 0;
>
> what does objdump -h report? If bss is 4 bytes then gcc 3.3.2 is
> breaking the kernel's use of init data. If bss is 0 and .init.data is
> 4 then we are OK.

$ gcc --version| grep GCC
gcc (GCC) 3.3.2
$ cat x.c
static int __attribute__ ((__section__ (".init.data"))) a1 = 0;
$ gcc -c -o x.o x.c
$ objdump -h x.o

x.o: file format elf32-i386

Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000000 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00000000 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 00000034 2**2
ALLOC
3 .init.data 00000004 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, DATA
4 .comment 00000012 00000000 00000000 00000038 2**0
CONTENTS, READONLY

Good.

--
Tomas Szepe <szepe@pinerecords.com>