delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/07/14:21:56

Date: Tue, 7 Sep 1999 13:42:13 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Keith McCormick <kdm98 AT spiritone DOT com>
cc: djgpp AT delorie DOT com, "Mark E." <snowball3 AT bigfoot DOT com>
Subject: Re: Need help building Allegro!?!
In-Reply-To: <936657184.703540@ridge.spiritone.com>
Message-ID: <Pine.SUN.3.91.990907134032.27853B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 6 Sep 1999, Keith McCormick wrote:

> Another thing I changed myself (as intimated in mail archive) is the
> COFF_DEFAULT_SECTION_ALIGNMENT_POWER.  I changed it to 4 instead of 2.

That might just be your problem.  AFAIK, naive changes like that break
the static constructors and destructors, which are called from
`__main', and that is exactly where your program crashes.

Mark, am I right in assuming that section alignment can cause these
crashes?

So either try the same setup with Binutils 2.8.1 from SimTel, or
rebuild Binutils 2.9.1 after reverting to the original alignment, and
see if the problem goes away.

> Also, does this actually do anything because the linker scripts have an
> ALIGN statement.

Of course, this changes something.  The ALIGN directives in the linker
script are for the beginning of the section, whereas
COFF_DEFAULT_SECTION_ALIGNMENT_POWER is for *subsections*.
Subsections are the parts of code generated for each object file.  If
the object code for each .o file is 4-byte aligned, then you cannot
get a better alignment for your code even if the section beginning is
aligned better.

- Raw text -


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