This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: executable = exe + data

> * Brian Dessent <oevna@qrffrag.arg> [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;
>>   <some magic>
>>   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 ( running w2k
Ph.D. stands for "Phony Doctor"  - Isaak Asimov, Ph.D.

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]