From: Andrew Lunn <andrew@lunn.ch>
To: Evgeniy Dushistov <dushistov@mail.ru>
Cc: Dave Milter <davemilter@gmail.com>,
ecos-discuss@ecos.sourceware.org,
ecos-devel@ecos.sourceware.org
Subject: Re: [ECOS] raw output to serial port and dataflash + legacy API questions
Date: Mon, 11 May 2009 19:04:00 -0000 [thread overview]
Message-ID: <20090511190353.GB4940@lunn.ch> (raw)
In-Reply-To: <20090511181726.GA29238@rain>
> > If something is not referenced, the linker will throw it away. It is
> > unwanted bloat.
> >
>
> The variable that is not referenced is marked as __attribute__((used)).
I _think_ this just stops the warning. The symbol itself is not
changed. This attribute is most often used for parameters passed to a
function where for backward compatibility etc, you don't reference one
of the parameters passed in.
> So compiler doesn't inform linker that there is no need to throw it
> away?
I don't think so.
> And as you see, actually I not add reference to variable in
> workaround, I add function to which add reference.
> So reference count to flash driver descriptions hasn't changed,
> but linker do not remove it.
This might suggest you are not using --function-sections and
--data-sections. Using these options the compiler puts each function
and variable into its own section and so allows the linker to do finer
grain garbage discard. Without these options it can only throw away
complete files when all symbols in a file are not used. With these
options it can throw away individual unused functions and variables.
Andrew
prev parent reply other threads:[~2009-05-11 19:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2a382c6e0905070357u76683dacqfe8bd885c9260671@mail.gmail.com>
2009-05-11 17:44 ` Evgeniy Dushistov
2009-05-11 17:57 ` Andrew Lunn
2009-05-11 18:35 ` Evgeniy Dushistov
2009-05-11 19:04 ` Andrew Lunn [this message]
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=20090511190353.GB4940@lunn.ch \
--to=andrew@lunn.ch \
--cc=davemilter@gmail.com \
--cc=dushistov@mail.ru \
--cc=ecos-devel@ecos.sourceware.org \
--cc=ecos-discuss@ecos.sourceware.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).