comp.lang.ada
 help / color / mirror / Atom feed
From: "Steven Deller" <deller@smsail.com>
To: <comp.lang.ada@ada.eu.org>
Subject: RE: ADA compiler and ELF object format
Date: Mon, 26 Nov 2001 20:14:00 -0500
Date: 2001-11-26T20:14:00-05:00	[thread overview]
Message-ID: <mailman.1006823862.13162.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: <s4xM7.38318$xS6.63008@www.newsranger.com>

In ELF (and COFF and a.out formats), .bss is "uninitialized" data and .data
is "initialized data".  Period.  In BSS, there is no stored value in the
object file, just recognition of "space needed" with any symbols for the
structures pointing to that space.  With DATA, there is a value on the disk
that must be loaded into memory.

You don't get to move items back and forth between these.  Data are in their
respective locations because the data either does, or does not, have an
initial value.

As you noted, eliminating an initial value moves an item from .data to .bss.
No surprise.

FYI, BSS per http://mist.npl.washington.edu/faq/unix-FAQ-1-3.html
      bss = "Block Started by Symbol"

	Dennis Ritchie says:

	    Actually the acronym (in the sense we took it up; it may
	    have other credible etymologies) is "Block Started by
	    Symbol." It was a pseudo-op in FAP (Fortran Assembly [-er?]
	    Program), an assembler for the IBM 704-709-7090-7094
	    machines.  It defined its label and set aside space for a
	    given number of words.  There was another pseudo-op, BES,
	    "Block Ended by Symbol" that did the same except that the
	    label was defined by the last assigned word + 1.  (On these
	    machines Fortran arrays were stored backwards in storage
	    and were 1-origin.)

	    The usage is reasonably appropriate, because just as with
	    standard Unix loaders, the space assigned didn't have to be
	    punched literally into the object deck but was represented
	    by a count somewhere.

Regards,
Steve
"Then, after a second or so, nothing continued to happen."
Steven Deller        Smooth Sailing LLC
410 757 6924         deller@smsail.com


> -----Original Message-----
> From: comp.lang.ada-admin@ada.eu.org
> [mailto:comp.lang.ada-admin@ada.eu.org]On Behalf Of Ted Dennison
> Sent: Monday, November 26, 2001 2:53 PM
> To: comp.lang.ada@ada.eu.org
> Subject: Re: ADA compiler and ELF object format
>
>
> In article <877f1a1d.0111260550.182cd41d@posting.google.com>,
> Sandro Binetti
> says...
> >How coul'd I move the .data section into the .bss section of an ELF
> >object?
> >I've seen that leaving uninitialized the variables inside my ADA
> >program does move the object allocation from the .data section into
> >the .bss one. Is there another way to achieve the same result?
> >
> >Ah, I'm using a GHS Ada Multi Compiler for Sparc.
>
> You'd be pretty lucky to find someone who has messed around a
> lot with object
> file formats for that particular compiler hanging out here
> (but it could
> happen).
>
> You may have better luck asking Green Hills support.
>
> ---
> T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
>
> No trees were killed in the sending of this message.
> However a large number of electrons were terribly inconvenienced.
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>




  reply	other threads:[~2001-11-27  1:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-26 13:50 ADA compiler and ELF object format Sandro Binetti
2001-11-26 19:52 ` Ted Dennison
2001-11-27  1:14   ` Steven Deller [this message]
2001-11-27  3:57 ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox