public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: "Ronald F. Guilmette" <rfg@monkeys.com>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org
Subject: Re: c/2678: gcc/g++ should stick compilation options into the .o file
Date: Mon, 30 Apr 2001 17:36:00 -0000	[thread overview]
Message-ID: <20010501003601.8470.qmail@sourceware.cygnus.com> (raw)

The following reply was made to PR c/2678; it has been noted by GNATS.

From: "Ronald F. Guilmette" <rfg@monkeys.com>
To: Phil Edwards <pedwards@disaster.jaj.com>
Cc: "Joseph S. Myers" <jsm28@cam.ac.uk>, gcc-gnats@gcc.gnu.org
Subject: Re: c/2678: gcc/g++ should stick compilation options into the .o file 
Date: Mon, 30 Apr 2001 17:29:44 -0700

 In message <20010430184754.A1637@disaster.jaj.com>, you wrote:
 
 >On Mon, Apr 30, 2001 at 10:21:12AM -0700, Ronald F. Guilmette wrote:
 >> >But does "strip" (without other options) remove these sections?  It
 >> >doesn't (binutils 2.11.90.0.6) remove .comment and .note; for that reason,
 >> >Debian has modified "install -s" to pass --remove-section=.comment
 >> >--remove-section=.note to strip.
 >> 
 >> a)  It's no big deal to also supply --remove-section=.comment on the
 >>     strip command line.
 >
 >Other implementations of strip do not understand this option.  We should
 >not punish them.
 
 If somebody is using gcc, they can bloody well used GNU strip too.  If they
 don't, that's their problem.
 
 Try using gcc output with somebody else's symbolic debugger sometime.  You'll
 see what I mean.
 
 Deep interoperability with Other People's Tools hasn't been on the GNU
 agenda for a long long time.  I argued for it, long and hard, a long time
 ago, but I lost that battle.
 
 >> b)  In practice, nobody will give a damn about the presence or absense of
 >>     this extra information anyway.
 >
 >Yes, they will.  More specifically, /we/ will as we build GCC itself.
 >
 >Right now things like crtbegin.o and libgcc2 and lib<pick-a-language> are
 >all getting this information added to them.  It's not a problem with memory
 >consumption because they aren't allocated.  It is however a correctness
 >problem because the final executable gets about five copies of the options
 >strings (the assembler and linker combine the separate instances of the
 >identically-named sections).
 
 That last (parenthesized) part is true, in a general, total, and complete
 sense, if and only if you are NOT using -s with ld.  Otherwise the linker
 does not ``combine'' but rather _ignores_ certain input sections.
 
 >But the first set of options are those passed when compiling crtbegin,
 >the second set are those passed when compiling some chunk of libgcc2,
 >{etc}...
 
 Yes, you are correct that once you get past mere .o files and start get-
 ting into linking, keeping this data around (e.g. in the linker's output
 file) may perhaps be a less-than-wonderful idea.  (But see below.)
 
 OK.  So now _here_ is a good excuse to come up with a new GNU invention...
 a new ``GNU standardized'' ELF section name.
 
 For lack of a better name, let's call it `.ignore_me'.
 
 All .ignore_me sections would have special semantics (at least to the GNU
 linker) at link time.  Specifically, the special semantics would be that
 the linker just avoids coping them into the final executable (or shared
 library).
 
 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!
 
 Ok, so maybe a use for such a capability won't come up THAT often, but
 hey!  You never know.  I always keep my server logs around for at least
 a full week, just in case.  Why should this info be any different?
 
 It is always good to leave a trail of breadcrumbs, so that you can get
 back the way you came.
 


             reply	other threads:[~2001-04-30 17:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-30 17:36 Ronald F. Guilmette [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-11-05  9:16 Wolfgang Bangerth
2002-11-05  9:08 bangerth
2002-11-05  9:06 Phil Edwards
2002-11-05  7:46 Wolfgang Bangerth
2001-05-07 16:56 Phil Edwards
2001-04-30 17:16 Phil Edwards
2001-04-30 10:26 Ronald F. Guilmette
2001-04-30  9:46 Ronald F. Guilmette
2001-04-30  2:36 Phil Edwards
2001-04-30  2:16 Ronald F. Guilmette
2001-04-29 20:06 Phil Edwards
2001-04-29 11:56 Ronald F. Guilmette
2001-04-29  5:46 Phil Edwards
2001-04-29  5:16 Phil Edwards
2001-04-29  4:16 Phil Edwards
2001-04-28 13:46 rfg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010501003601.8470.qmail@sourceware.cygnus.com \
    --to=rfg@monkeys.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).