comparison docs/manual/manual.html @ 236:ce1fdc8d6568

Added ability to add padding after a section when linking. Added the ability for lwlink to automatically append padding bytes to the end of a section (once the section instances are merged). This behaviour is controlled by the link script. See the updated documentation for more information.
author William Astle <lost@l-w.ca>
date Sat, 11 Aug 2012 23:29:57 -0600
parents d389adbcc4ab
children 0bc1c88fe776
comparison
equal deleted inserted replaced
235:e3741cf53e00 236:ce1fdc8d6568
196 HREF="#AEN795" 196 HREF="#AEN795"
197 >Linking Scripts</A 197 >Linking Scripts</A
198 ></DT 198 ></DT
199 ><DT 199 ><DT
200 >4.4. <A 200 >4.4. <A
201 HREF="#AEN843" 201 HREF="#AEN852"
202 >Format Specific Linking Notes</A 202 >Format Specific Linking Notes</A
203 ></DT 203 ></DT
204 ><DD 204 ><DD
205 ><DL 205 ><DL
206 ><DT 206 ><DT
207 >4.4.1. <A 207 >4.4.1. <A
208 HREF="#AEN846" 208 HREF="#AEN855"
209 >OS9 Modules</A 209 >OS9 Modules</A
210 ></DT 210 ></DT
211 ></DL 211 ></DL
212 ></DD 212 ></DD
213 ></DL 213 ></DL
214 ></DD 214 ></DD
215 ><DT 215 ><DT
216 >5. <A 216 >5. <A
217 HREF="#AEN858" 217 HREF="#AEN867"
218 >Libraries and LWAR</A 218 >Libraries and LWAR</A
219 ></DT 219 ></DT
220 ><DD 220 ><DD
221 ><DL 221 ><DL
222 ><DT 222 ><DT
223 >5.1. <A 223 >5.1. <A
224 HREF="#AEN862" 224 HREF="#AEN871"
225 >Command Line Options</A 225 >Command Line Options</A
226 ></DT 226 ></DT
227 ></DL 227 ></DL
228 ></DD 228 ></DD
229 ><DT 229 ><DT
241 ><B 241 ><B
242 >List of Tables</B 242 >List of Tables</B
243 ></DT 243 ></DT
244 ><DT 244 ><DT
245 >6-1. <A 245 >6-1. <A
246 HREF="#AEN945" 246 HREF="#AEN954"
247 >Object File Term Types</A 247 >Object File Term Types</A
248 ></DT 248 ></DT
249 ><DT 249 ><DT
250 >6-2. <A 250 >6-2. <A
251 HREF="#AEN975" 251 HREF="#AEN984"
252 >Object File Operator Numbers</A 252 >Object File Operator Numbers</A
253 ></DT 253 ></DT
254 ></DL 254 ></DL
255 ></DIV 255 ></DIV
256 ><DIV 256 ><DIV
2518 ></P 2518 ></P
2519 ><DIV 2519 ><DIV
2520 CLASS="VARIABLELIST" 2520 CLASS="VARIABLELIST"
2521 ><DL 2521 ><DL
2522 ><DT 2522 ><DT
2523 >sectopt <CODE
2524 CLASS="PARAMETER"
2525 >section</CODE
2526 > padafter <CODE
2527 CLASS="PARAMETER"
2528 >byte,...</CODE
2529 ></DT
2530 ><DD
2531 ><P
2532 >&#13;This will cause the linker to append the specified list of byte values
2533 (specified in hexadecimal separated by commas) to the end of the named
2534 section. This is done once all instances of the specified section are
2535 collected together. This has no effect if the specified section does not
2536 appear anywhere in any of the objects specified for linking. &#13;</P
2537 ><P
2538 >&#13;If code depends on the presence of this padding somewhere, it is sufficient
2539 to include an empty section of the specified name in the object that depends
2540 on it.&#13;</P
2541 ></DD
2542 ><DT
2523 >define basesympat <CODE 2543 >define basesympat <CODE
2524 CLASS="PARAMETER" 2544 CLASS="PARAMETER"
2525 >string</CODE 2545 >string</CODE
2526 ></DT 2546 ></DT
2527 ><DD 2547 ><DD
2533 >. 2553 >.
2534 In the string, %s can appear exactly once and will be replaced with the 2554 In the string, %s can appear exactly once and will be replaced with the
2535 section name. The base address is calculated after all instances of each 2555 section name. The base address is calculated after all instances of each
2536 section have been collapsed together.&#13;</P 2556 section have been collapsed together.&#13;</P
2537 ><P 2557 ><P
2558 >&#13;It should be noted that if none of the objects to be linked contains a
2559 particular section name, there will be no base symbol defined for it, even
2560 if it is listed explicitly in the link script. If code depends on the
2561 presence of these symbols, it is sufficient to include an empty section of
2562 the specified name in the object that depends on it.&#13;</P
2563 ><P
2538 > If the pattern resolves to the same string for multiple 2564 > If the pattern resolves to the same string for multiple
2539 sections, the results are undefined.&#13;</P 2565 sections, the results are undefined.&#13;</P
2540 ></DD 2566 ></DD
2541 ><DT 2567 ><DT
2542 >define lensympat <CODE 2568 >define lensympat <CODE
2551 >string</CODE 2577 >string</CODE
2552 >. In 2578 >. In
2553 the string, %s can appear exactly once and will be replaced with the section 2579 the string, %s can appear exactly once and will be replaced with the section
2554 name. The length is calculated after all instances of a section have been 2580 name. The length is calculated after all instances of a section have been
2555 collapsed together.&#13;</P 2581 collapsed together.&#13;</P
2582 ><P
2583 >&#13;It should be noted that if none of the objects to be linked contains a
2584 particular section name, there will be no length symbol defined for it, even
2585 if it is listed explicitly in the link script. If code depends on the
2586 presence of these symbols, it is sufficient to include an empty section of
2587 the specified name in the object that depends on it.&#13;</P
2556 ><P 2588 ><P
2557 >If the pattern resolves to the same string for multiple 2589 >If the pattern resolves to the same string for multiple
2558 sections, the results are undefined.&#13;</P 2590 sections, the results are undefined.&#13;</P
2559 ></DD 2591 ></DD
2560 ><DT 2592 ><DT
2633 ><DIV 2665 ><DIV
2634 CLASS="SECTION" 2666 CLASS="SECTION"
2635 ><HR><H2 2667 ><HR><H2
2636 CLASS="SECTION" 2668 CLASS="SECTION"
2637 ><A 2669 ><A
2638 NAME="AEN843" 2670 NAME="AEN852"
2639 >4.4. Format Specific Linking Notes</A 2671 >4.4. Format Specific Linking Notes</A
2640 ></H2 2672 ></H2
2641 ><P 2673 ><P
2642 >Some formats require special information to be able to generate actual 2674 >Some formats require special information to be able to generate actual
2643 binaries. If the specific format you are interested in is not listed in 2675 binaries. If the specific format you are interested in is not listed in
2646 ><DIV 2678 ><DIV
2647 CLASS="SECTION" 2679 CLASS="SECTION"
2648 ><HR><H3 2680 ><HR><H3
2649 CLASS="SECTION" 2681 CLASS="SECTION"
2650 ><A 2682 ><A
2651 NAME="AEN846" 2683 NAME="AEN855"
2652 >4.4.1. OS9 Modules</A 2684 >4.4.1. OS9 Modules</A
2653 ></H3 2685 ></H3
2654 ><P 2686 ><P
2655 >OS9 modules need to embed several items into the module header. These 2687 >OS9 modules need to embed several items into the module header. These
2656 items are the type of module, the langauge of the module, the module 2688 items are the type of module, the langauge of the module, the module
2722 ></DIV 2754 ></DIV
2723 ><DIV 2755 ><DIV
2724 CLASS="CHAPTER" 2756 CLASS="CHAPTER"
2725 ><HR><H1 2757 ><HR><H1
2726 ><A 2758 ><A
2727 NAME="AEN858" 2759 NAME="AEN867"
2728 ></A 2760 ></A
2729 >Chapter 5. Libraries and LWAR</H1 2761 >Chapter 5. Libraries and LWAR</H1
2730 ><P 2762 ><P
2731 >LWTOOLS also includes a tool for managing libraries. These are analogous to 2763 >LWTOOLS also includes a tool for managing libraries. These are analogous to
2732 the static libraries created with the "ar" tool on POSIX systems. Each library 2764 the static libraries created with the "ar" tool on POSIX systems. Each library
2741 ><DIV 2773 ><DIV
2742 CLASS="SECTION" 2774 CLASS="SECTION"
2743 ><HR><H2 2775 ><HR><H2
2744 CLASS="SECTION" 2776 CLASS="SECTION"
2745 ><A 2777 ><A
2746 NAME="AEN862" 2778 NAME="AEN871"
2747 >5.1. Command Line Options</A 2779 >5.1. Command Line Options</A
2748 ></H2 2780 ></H2
2749 ><P 2781 ><P
2750 >The binary for LWAR is called "lwar". Note that the binary is in lower 2782 >The binary for LWAR is called "lwar". Note that the binary is in lower
2751 case. The options lwar understands are listed below. For archive manipulation 2783 case. The options lwar understands are listed below. For archive manipulation
2942 followed by any data required by the term. Then end of the list is flagged 2974 followed by any data required by the term. Then end of the list is flagged
2943 by a NULL expression (only an end of expression term).</P 2975 by a NULL expression (only an end of expression term).</P
2944 ><DIV 2976 ><DIV
2945 CLASS="TABLE" 2977 CLASS="TABLE"
2946 ><A 2978 ><A
2947 NAME="AEN945" 2979 NAME="AEN954"
2948 ></A 2980 ></A
2949 ><P 2981 ><P
2950 ><B 2982 ><B
2951 >Table 6-1. Object File Term Types</B 2983 >Table 6-1. Object File Term Types</B
2952 ></P 2984 ></P
3014 allows local symbols that are not exported to have the same names as 3046 allows local symbols that are not exported to have the same names as
3015 exported symbols or external references.</P 3047 exported symbols or external references.</P
3016 ><DIV 3048 ><DIV
3017 CLASS="TABLE" 3049 CLASS="TABLE"
3018 ><A 3050 ><A
3019 NAME="AEN975" 3051 NAME="AEN984"
3020 ></A 3052 ></A
3021 ><P 3053 ><P
3022 ><B 3054 ><B
3023 >Table 6-2. Object File Operator Numbers</B 3055 >Table 6-2. Object File Operator Numbers</B
3024 ></P 3056 ></P