Chapter 5. Sections and Relocation
33
undefined section
This "section" is a catch all for address references to objects not in the preceding sections.
An idealized example of three relocatable sections follows. The example uses the traditional section
names
.text
and
.data
. Memory addresses are on the horizontal axis.
+ + + +
partial program # 1:
|ttttt|dddd|00|
+ + + +
text
data bss
seg.
seg. seg.
+ + + +
partial program # 2:
|TTT|DDD|000|
+ + + +
+ + + + + + + +~~
linked program:
|
|TTT|ttttt|
|dddd|DDD|00000|
+ + + + + + + +~~
addresses:
0 ...
5.3. Assembler Internal Sections
These sections are meant only for the internal use of
as
. They have no meaning at run time. You do not
really need to know about these sections for most purposes; but they can be mentioned in
as
warning
messages, so it might be helpful to have an idea of their meanings to
as
. These sections are used
to permit the value of every expression in your assembly language program to be a section relative
address.
ASSEMBLER INTERNAL LOGIC ERROR!
An internal assembler logic error has been found. This means there is a bug in the assembler.
expr section
The assembler stores complex expression internally as combinations of symbols. When it needs
to represent an expression as a symbol, it puts it in the expr section.
5.4. Sub Sections
Assembled bytes conventionally fall into two sections: text and data. You may have separate groups of
data in named sections that you want to end up near to each other in the object file, even though they
are not contiguous in the assembler source.
as
allows you to use subsections for this purpose. Within
each section, there can be numbered subsections with values from 0 to 8192. Objects assembled into
the same subsection go into the object file together with other objects in the same subsection. For
example, a compiler might want to store constants in the text section, but might not want to have
them interspersed with the program being assembled. In this case, the compiler could issue a
.text
0
before each section of code being output, and a
.text 1
before each group of constants being
output.
Subsections are optional. If you do not use subsections, everything goes in subsection number zero.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved