ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/08/25/16:39:28

From: Martin Str|mberg <ams AT speedy DOT ludd DOT luth DOT se>
Subject: Re: Alignment problem in GCC 2.95.2
Newsgroups: comp.os.msdos.djgpp
References: <D26a9.201$yu2 DOT 7412 AT castor DOT casema DOT net>
User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (NetBSD/1.5_BETA (alpha))
Message-ID: <1030288855.880883@queeg.ludd.luth.se>
Cache-Post-Path: queeg.ludd.luth.se!unknown AT speedy DOT ludd DOT luth DOT se
X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/)
Date: 25 Aug 2002 15:20:55 GMT
Lines: 38
NNTP-Posting-Date: 25 Aug 2002 15:20:55 GMT
NNTP-Posting-Host: queeg.ludd.luth.se
X-Trace: 1030288855 news.luth.se 441 130.240.16.109
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Kernel Panic <rzhevskiy AT mail DOT ru> wrote:
: I'm using GCC 2.95.2 (DJGPP) and having a problem with alignment.. Compiling
: the following line:

: kernel_info_page_t kernel_info_page __attribute__((aligned(PAGE_SIZE)))

: (it's beginning of a structure) I get a message like:

: global.c:31: warning: alignment of `struct kernel_info_page_t
: kernel_info_page' is greater than maximum object file alignment. Using 4.

: I haven't found any other way to set the alignment than with ugly assembler
: macros.

Can I see those macros? I'm interested myself in such aligning.

> This compiled correctly on FreeBSD (with the same GCC version!
: Though I don't understand how it's possible..)..

FreeBSD is perhaps using something other than COFF?

: Any suggestions?.. BTW, how does GCC know what file format it's actually

I wrote my own linker script that aligns the .bss section to 4096 and
make sure my structures that need this alignment comes first. On the
other hand I also have some more structures that need this alignment
and their number isn't known until the program is running. So I need
to align the end of .bss too. Thus perhaps I should just ditch my
first alignment and put everything at the end.

: going to be?..

Compiled in default, perhaps.


Right,

						MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019