31.12.2013 Views

Linkage Kit Manual V6-00 - Fujitsu

Linkage Kit Manual V6-00 - Fujitsu

Linkage Kit Manual V6-00 - Fujitsu

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.6 Automatically Locating Sections<br />

5.6.2 Automatically Locating Sections when -AL 2 is Specified<br />

If -AL 2 is specified, a linker automatically locates sections without location<br />

specification into an available space of area.<br />

Linker determines into which the location place of a section shall be made between<br />

ROM area or RAM area based on the type of a section in that case.<br />

Section 5.6.2 describes the location destinations for each section type and the order of<br />

determining location addresses.<br />

Figure 5.6-4 shows an example of location when -AL 2 is specified.<br />

■ Section Types and Location Destinations<br />

If -AL 2 is specified, a linker automatically locates sections without location specifications. At this time,<br />

the linker determines their location destinations (areas) according to their section types as shown in Table<br />

5.6-4.<br />

Table 5.6-4 Section Types and Location Destinations<br />

Location destination<br />

ROM area<br />

(specified in -ro)<br />

RAM area<br />

(specified in -ra)<br />

Section type<br />

CODE<br />

CONST<br />

IO<br />

DATA<br />

STACK<br />

■ Determining Location Addresses<br />

If -AL 2 is specified, a linker determines the section location addresses in the order shown in Table 5.6-5.<br />

As shown in Table 5.6-5, the order specified by the user is prioritized to the automatic location.<br />

A linker always searches a place to locate a section, starting from low-order addresses.<br />

Table 5.6-5 Section Location Destinations<br />

Order Section to be processed Location destination and method<br />

1 Section with the ABS attribute Located at the address provided with the section<br />

2<br />

3<br />

Section with a specified location<br />

address in the -sc option, e.g., as<br />

"-sc Section=0x01<strong>00</strong>"<br />

Section with a specified location<br />

area in the -sc option as "-sc<br />

Section=ROM"<br />

Located at the specified address<br />

In the specified area, the linker searches a place where it<br />

can locate the section without overlapping with another<br />

section, then locates it.<br />

4 Section without a specified location<br />

The linker determines the location area according to<br />

Table 5.6-4. Then, in the determined area, the linker<br />

searches a place where it can locate the section without<br />

overlapping with another section. The linker then<br />

locates it.<br />

PART II LINKER 69

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!