Linker Tasks

Using Linker commands

8.Get the addresses of routines and data that are referenced in the module.

Step 1: Determine how much space is required to load the module. There must be enough contiguous memory to hold the module's text, data, and bss segments. You can make a liberal guess as to how much memory is needed, and hope that you've guessed correctly. Or you can be more precise by pre-linking the module and getting size information from its header.

Step 2: Allocate the required memory and obtain its starting address. Typically, you use malloc(3C) to allocate the required memory. You must modify the starting address returned by malloc to ensure that it starts on a memory page boundary (address MOD 4096 == 0).

Step 3: Link the module from the running application. Use the following options when invoking the linker from the program:

-omod_name

Name of the output module that will be loaded by the

 

running program.

-Abase_prog

Tells the linker to prepare the output file for

 

incremental loading. Also causes the linker to include

 

symbol table information from base_prog in the output

 

file.

-Rhex_addr

Specifies the hexadecimal address at which the module

 

will be loaded. This is the address calculated in Step 2.

-N

Causes the data segment to be placed immediately

 

after the text segment.

-eentry_pt

If specified (it is optional), causes the symbol named

 

entry_pt to be the entry point into the module. The

 

location of the entry point is stored in the module's

 

header.

Step 4: Get information about the module's text, data, and bss segments from the module's header. There are two header structures stored at the start of the file: struct header (defined in <filehdr.h>) and struct som_exec_auxhdr (defined in <aouthdr.h>). The required information is stored in the second header, so to get it, a program must seek past the first header before reading the second one.

66

Chapter 3

Page 66
Image 66
Kenwood HP 9000 manual Using Linker commands

HP 9000 specifications

The Kenwood HP 9000 is a cutting-edge home appliance designed for culinary enthusiasts seeking to elevate their cooking experience. This powerful kitchen machine stands out for its multi-functionality, combining the roles of a food processor, blender, and mixer into one sleek unit.

One of the flagship features of the Kenwood HP 9000 is its robust motor, which delivers exceptional performance across various tasks. With a powerful motor that operates at multiple speeds, users can tackle everything from kneading dough to finely chopping vegetables with ease. The variable speed control allows for precision, ensuring that every ingredient is processed to perfection according to individual preferences.

The HP 9000 comes equipped with a variety of attachments that enhance its versatility. Among these are a stainless-steel mixing bowl, a dough hook, a whisk, and multiple cutting blades. This extensive array of accessories means that users can whip up delightful pastries, create homemade pasta, or prepare smoothies with minimal hassle. Each attachment is designed for easy attachment and removal, making the transition between tasks seamless and efficient.

Another key characteristic of the Kenwood HP 9000 is its advanced safety features. The design incorporates mechanisms that prevent the machine from operating unless all components are securely in place. This not only gives users peace of mind while cooking but also ensures longevity for the appliance, reducing the risk of wear and tear over time.

In terms of design, the HP 9000 is both modern and aesthetically pleasing. Its ergonomic shape and compact size make it easy to store and use in various kitchen settings, while the high-quality materials used in its construction guarantee durability and longevity. The user interface is intuitive, with clearly labeled buttons that facilitate operation, ensuring that even novice cooks can navigate the machine effortlessly.

Additionally, the Kenwood HP 9000 features innovative technologies, such as an integrated digital timer and a pulse function for added control during food preparation. These features enhance cooking precision, allowing users to achieve consistent results every time.

In summary, the Kenwood HP 9000 is an exceptional kitchen appliance that combines power, versatility, and safety. With its advanced features and user-friendly design, it is an ideal choice for anyone looking to simplify their cooking process while achieving professional-level results. Whether you're whipping up a quick meal or tackling an elaborate recipe, the HP 9000 is a reliable companion that will inspire culinary creativity.