www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/07/08:48:49

Xref: news2.mv.net comp.os.msdos.djgpp:6719
From: alaric AT abwillms DOT demon DOT co DOT uk (Alaric B. Williams)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: __attribute__((section))
Date: Thu, 01 Aug 1996 20:13:19 GMT
Lines: 35
Message-ID: <838930289.23607.0@abwillms.demon.co.uk>
References: <Pine DOT NEB DOT 3 DOT 93 DOT 960801161121 DOT 10145A-100000 AT ananke DOT amu DOT edu DOT pl>
NNTP-Posting-Host: abwillms.demon.co.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Mark Habersack <grendel AT ananke DOT amu DOT edu DOT pl> wrote:

>You're right, but what about automatic locking of the section at
>startup? [continued below]

Well, I'd just call a function in main() to do it. Making it automatic
I would leave to the people who write the startup code... like,
Charles, I guess, if he think's it's cool. Otherwise, I couldn't be
bothered to make it automatic!

>>group it). No need for different .ld scripts unless you want to
>>control the placement of this section in the load image.

>So you have to create a separate .ld script anyway to initialize variables
>properly - just like it's done with .dtor .ctor sections. Note that the LIBC
>source contains only extern declarations of the __djgpp_first_ctor/dtor and
>__djgpp_last_ctor/dtor - they are actually created in .ld script. 

True, point taken. I'd stick .ltext on the end of .text, and .ldata on
the end of .data, as someone else suggested.

Wow... I think I've done something cool! :-)

>Mark

Regards,


ABW
--
I have become... Comfortably numb...

Alaric B. Williams Internet : alaric AT abwillms DOT demon DOT co DOT uk
<A HREF="http://www.hardcafe.co.uk/Alaric/">http://www.hardcafe.co.uk/Alaric/</A>

- Raw text -


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