lkml.org 
[lkml]   [2000]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: linux-2.4.0-test9
Date
On Fri, 6 Oct 2000 01:19:16 +0200, 
Jamie Lokier <lk@tantalophile.demon.co.uk> wrote:
>David S. Miller wrote:
>> > These items are specifically placed into the data section, not the
>> > BSS, because these alignment games are not possible in the BSS.
>>
>> That would mean the BSS needs support alignment games.
>>
>> The problem is it doesn't work, please go try it.
>> So until it does work, I am going to revert this change.
>
>Put __attribute__ ((section (".data"))) into __tcp_clean_cacheline_pad
>and it should do what you want.
>
>Heck, section ".bss" might give you the alignment without the allocation
>but I'm not as confident about that.

Call me mad but you could actually try this instead of guessing.

# cat x.c
int __attribute__ ((section (".data"))) int1;
int __attribute__ ((section (".bss"))) int2;
int __attribute__ ((section (".data.init"))) int3;
int __attribute__ ((section (".data.init"))) int4 = 0;

# gcc -c -o x.o x.c
# nm x.o
00000000 t gcc2_compiled.
00000000 B int1
00000004 B int2
00000008 B int3
00000000 D int4
# 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 0000000c 00000000 00000000 00000034 2**2
ALLOC
3 .note 00000014 00000000 00000000 00000034 2**0
CONTENTS, READONLY
4 .data.init 00000004 00000000 00000000 00000048 2**2
CONTENTS, ALLOC, LOAD, DATA
5 .comment 0000003d 00000000 00000000 0000004c 2**0
CONTENTS, READONLY

int[123] all end up in .bss, no matter what attributes you assign. If
you want special alignment then you must initialize the variable, even
if that means a zero initializer.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:39    [W:0.070 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site