This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c/2678: gcc/g++ should stick compilation options into the .o file
- To: nobody at gcc dot gnu dot org
- Subject: Re: c/2678: gcc/g++ should stick compilation options into the .o file
- From: Phil Edwards <pedwards at disaster dot jaj dot com>
- Date: 7 May 2001 23:56:01 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: Phil Edwards <pedwards at disaster dot jaj dot com>
The following reply was made to PR c/2678; it has been noted by GNATS.
From: Phil Edwards <pedwards@disaster.jaj.com>
To: "Ronald F. Guilmette" <rfg@monkeys.com>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/2678: gcc/g++ should stick compilation options into the .o file
Date: Mon, 7 May 2001 18:33:36 -0400
On Tue, May 01, 2001 at 12:36:01AM -0000, Ronald F. Guilmette wrote:
> OK. So now _here_ is a good excuse to come up with a new GNU invention...
> a new ``GNU standardized'' ELF section name.
Given the overly-loose hammer and nail analogy that you sent me in private
email, I'll assume you're being facetious here. :-)
> Hummm... OK. Wait a minute. That would work, but I have a better idea...
>
> Just _label_ each one of these hunks of option information with the
> specific corresponding .c or .C ``primary'' source file name that was
> being compiled when those options were used. Then the final linked
> file would, in effect contain essentially a complete history, telling
> you how it got built. Hell! You could practically write a program
> to automatically reverse-engineer and re-create the original Makefiles
> (or files functionally equivalent to them) just from the final linked
> executable!
Actually, my current implementation already does this. I needed to figure
out where an extra copy of the options was coming from, and I left the code
in when I was done.
And I've never tried writing a tool using the BFD library, but if I
understand its purpose correctly, it should be easy to use it to write a
build-option-pretty-printer for an executable. It's on that part of my
TODO list titled, "probably useless but would be really fun to try."[*]
Phil
[*] Much of my life is under this category, so there's a good chance that
this tool would be written, if I haven't misunderstood BFD.
--
pedwards at disaster dot jaj dot com | pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools. Fools are protected by more capable fools.