From mboxrd@z Thu Jan 1 00:00:00 1970 From: rfg@monkeys.com To: gcc-gnats@gcc.gnu.org Subject: c/2678: gcc/g++ should stick compilation options into the .o file Date: Sat, 28 Apr 2001 13:46:00 -0000 Message-id: <20010428203649.2180.qmail@sourceware.cygnus.com> X-SW-Source: 2001-04/msg00690.html List-Id: >Number: 2678 >Category: c >Synopsis: gcc/g++ should stick compilation options into the .o file >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: change-request >Submitter-Id: net >Arrival-Date: Sat Apr 28 13:46:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Ronald F. Guilmette >Release: gcc-2.95.2 >Organization: >Environment: >Description: It would be Really Nice if the gcc and g++ compilers, when compiling for some ELF target (at least) would stick a copy of ALL of the compilation options used during the compile into an ELF .comment or .note section within the resulting .o file. I wish I had a nickle for every time I had a .o file, left over from some build I did a long long time ago (in a galaxy not far away) and I was stuck saying to myself ``I wish I knew what options this thing had been compiled with. I wonder if it was optimized.'' The ELF object file format provides a couple of obvious means (.command and .note sections) for recording this exact infor- mation into each .o file. And I don't think that it would be very hard to get the front-end gcc/g++ driver to pass ALL compilation options down to cc1 and/or cc1plus. They in turn could easily still the options into a suitable ELF section. Note that this would also allow for some potentially inter- esting types of retrospective automated analysis of .o files. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: