public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Mares <mj@atrey.karlin.mff.cuni.cz>
To: Christian Iseli <chris@lslsun.epfl.ch>
Cc: law@cygnus.com, egcs@cygnus.com
Subject: Re: Named bss sections
Date: Mon, 08 Sep 1997 10:32:00 -0000	[thread overview]
Message-ID: <19970908181639.29886@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <199709081205.OAA28412@lslsun17.epfl.ch>

Hello,

> When you work with embedded targets, it is usually necessary to specify
> where the variables reside in memory.  Most small processors have some
> special mean of accessing certain area of their memory, e.g., the first
> 256 bytes of the RAM (0000 through 00FF) are often seen as "page 0" RAM
> and the processor has special instructions to access that particular RAM area.
> Moreover, most embedded target have I/O ports mapped in RAM at specific address
> and defining those ports using sections is convenient.
> 
> Specifying where data reside in RAM is done through sectionning.  You tell
> the linker to put a particular section of data at a specified RAM address.
> 
> GCC has provision to put global and static variables in user specified sections
> using the section attribute, and though it says in the manual that it should
> only be used for initialized variables, I see no hard reason for this restriction.
> Using the -fno-common flag can partly solve the problem, except that local common
> symbols are still output through the ASM_OUTPUT_LOCAL macro and are implicitely
> forced to the .data section.
> 
> Basically, I want to be able to specify a section for any variable, not only
> initialized ones.  For example, if a variable represents some input port mapped
> in RAM, it would be wrong to have to initialize it to some value.

   In addition to this, it should be also possible to specify a default section
for read-only data (non-writeable strings etc.), probably as a per-function
attribute. This would simplify implementation of automatical discarding of
init code after it has been executed (as used for example in the Linux kernel).

				Have a nice fortnight
-- 
Martin `MJ' Mares   <mj@gts.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"Spelling checkers at maximum!  Fire!"

  parent reply	other threads:[~1997-09-08 10:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-08  6:50 Christian Iseli
1997-09-08  7:58 ` Jeffrey A Law
1997-09-08 10:32 ` Martin Mares [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-09-09  4:15 Christian Iseli
1997-09-02  7:15 Christian Iseli
1997-09-02  9:18 ` Gavin Koch
1997-09-04 22:30 ` Jeffrey A Law

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=19970908181639.29886@atrey.karlin.mff.cuni.cz \
    --to=mj@atrey.karlin.mff.cuni.cz \
    --cc=chris@lslsun.epfl.ch \
    --cc=egcs@cygnus.com \
    --cc=law@cygnus.com \
    /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).