public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Printable information in executables
@ 2003-11-03  5:04 Alex Vinokur
  2003-11-03 20:15 ` Shankar Unni
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alex Vinokur @ 2003-11-03  5:04 UTC (permalink / raw)
  To: cygwin

Executable files contain various printable information.
For instance, list of  used DLLs.

However those files contain neither compiler name nor compiler version.
It seems to be worth including something like "gcc version 3.3.1 (cygming special)" in executables.

Next question. Is it possible to add 'user related printable information' to executables (through compilation option or something
else)?

--
 =====================================
   Alex Vinokur
     mailto:alexvn@connect.to
     http://mathforum.org/library/view/10978.html
     news://news.gmane.org/gmane.comp.lang.c++.perfometer
   =====================================






--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Printable information in executables
  2003-11-03  5:04 Printable information in executables Alex Vinokur
@ 2003-11-03 20:15 ` Shankar Unni
  2003-11-03 21:56 ` Hannu E K Nevalainen
  2003-11-04 15:58 ` Gerrit P. Haase
  2 siblings, 0 replies; 4+ messages in thread
From: Shankar Unni @ 2003-11-03 20:15 UTC (permalink / raw)
  To: cygwin

Alex Vinokur wrote:

> However those files contain neither compiler name nor compiler version.
> It seems to be worth including something like "gcc version 3.3.1 (cygming special)" in executables.

There's no standard place in the PE header (in the object files) for
this sort of information.

Besides, the compiler information would have to be per-".o", not
per-".exe", since you can generally mix and match .o's from different
compilers (provided they generate code with the same calling conventions
and structure layouts) when linking a .exe.

Even if there were a convention for inserting this kind of information
(say, a special .info or .compiler section in the .o file), the
executable would end up with hundreds of these strings for any
moderately-sized program, and the information would be, at best,
confusing and only mildly interesting..



--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Printable information in executables
  2003-11-03  5:04 Printable information in executables Alex Vinokur
  2003-11-03 20:15 ` Shankar Unni
@ 2003-11-03 21:56 ` Hannu E K Nevalainen
  2003-11-04 15:58 ` Gerrit P. Haase
  2 siblings, 0 replies; 4+ messages in thread
From: Hannu E K Nevalainen @ 2003-11-03 21:56 UTC (permalink / raw)
  To: cygwin

> From: Alex Vinokur
> Sent: Monday, November 03, 2003 6:05 AM

> Executable files contain various printable information.
> For instance, list of  used DLLs.
>
> However those files contain neither compiler name nor compiler version.
> It seems to be worth including something like "gcc version 3.3.1
> (cygming special)" in executables.
>
> Next question. Is it possible to add 'user related printable
> information' to executables (through compilation option or something
> else)?

 The answer depends on how you plan to use that information.

The simplest form is just to declare a static string (char array), making
sure that the compiler doesn't remove it at optimization. (Hmm...? Is it
enough to do some dummy reference to it?)

This gives a simplified image of the true heuristics but anyway;
on the old AmigaOS they use(d) something like:

$ cat chk.c
int main() {
  char versionstring[]="$VER: name major.minor (date) extended_info";
  return 0;
}

$ for (( n=0; n<4; n++ )) do
  gcc -O$n chk.c;
  echo -n $n:;
  strings a.exe | grep '$VER: ';
done
0:$VER: name major.minor (date) extended_info
1:$VER: name major.minor (date) extended_info
2:$VER: name major.minor (date) extended_info
3:$VER: name major.minor (date) extended_info

Hmm... :-} it doesn't get removed by plain optimization... :-)

/Hannu E K Nevalainen, B.Sc. EE - 59?16.37'N, 17?12.60'E
-- printf("LocalTime: UTC+%02d\n",(DST)? 2:1); --
--END OF MESSAGE--


--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Printable information in executables
  2003-11-03  5:04 Printable information in executables Alex Vinokur
  2003-11-03 20:15 ` Shankar Unni
  2003-11-03 21:56 ` Hannu E K Nevalainen
@ 2003-11-04 15:58 ` Gerrit P. Haase
  2 siblings, 0 replies; 4+ messages in thread
From: Gerrit P. Haase @ 2003-11-04 15:58 UTC (permalink / raw)
  To: Alex Vinokur; +Cc: cygwin

Hello Alex,

Monday, November 3, 2003, 6:04:41 AM, you wrote:

> Executable files contain various printable information.
> For instance, list of  used DLLs.

> However those files contain neither compiler name nor compiler version.
> It seems to be worth including something like "gcc version 3.3.1 (cygming
> special)" in executables. 

> Next question. Is it possible to add 'user related printable
> information' to executables (through compilation option or something
> else)?

You could use resource files.

-- 
Best regards,
 Gerrit 


--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-11-04 15:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-03  5:04 Printable information in executables Alex Vinokur
2003-11-03 20:15 ` Shankar Unni
2003-11-03 21:56 ` Hannu E K Nevalainen
2003-11-04 15:58 ` Gerrit P. Haase

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).