X-Spam-Check-By: sourceware.org X-IronPort-AV: i="3.99,318,1131339600"; d="scan'208"; a="148322656:sNHT22929396" To: cygwin AT cygwin DOT com Subject: Re: executable = exe + data Mail-Copies-To: never Reply-To: sds AT gnu DOT org X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. From: Sam Steingold In-Reply-To: <43B7186A.8CE0CB91@dessent.net> (Brian Dessent's message of "Sat, 31 Dec 2005 15:46:50 -0800") References: <43B7186A DOT 8CE0CB91 AT dessent DOT net> Mail-Followup-To: cygwin AT cygwin DOT com Date: Sun, 01 Jan 2006 12:50:52 -0500 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com > * Brian Dessent [2005-12-31 15:46:50 -0800]: > > Sam Steingold wrote: > >> Is it possible? >> >> simply put, it it possible to write something like this: >> >> int main () { >> size_t my_length; >> >> printf("exe size=%lld\n",my_length); >> return 0; >> } > > All the methods mentioned so far are essentially hacks working against > the linker, doing stuff behind its back. Why not go with the flow? > Put your data in its own section, and write a linker script to handle > that section in the desired way. You can access the address by > referencing the linker script variables in your source code. See > section 3 of the ld manual, particularly 3.5.3. This should work on > any platform that uses ld. the problems with this is that the "data" that is being appended is not known at link time and appending it may not require C tools (ld/gcc &c). -- Sam Steingold (http://www.podval.org/~sds) running w2k http://www.jihadwatch.org/ http://www.mideasttruth.com/ http://pmw.org.il/ http://ffii.org/ http://www.palestinefacts.org/ http://www.dhimmi.com/ Ph.D. stands for "Phony Doctor" - Isaak Asimov, Ph.D. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/