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: NNTP-Posting-Host: abwillms.demon.co.uk To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Mark Habersack 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 http://www.hardcafe.co.uk/Alaric/