+2000-05-22 Thomas de Lellis <tdel@windriver.com>
+
+ * ld.1: Add documentation for new command line option:
+ --section-start <sectionname>=<sectionorg>
+ This is a generic version of -Ttext etc. which accepts
+ any section name as a parameter instead of just text/data/
+ bss.
+ * ld.texinfo: More docs.
+ * NEWS: More docs.
+ * lexsup.c: (parse_args): Recognize new command line option.
+ (ld_options): Add new option.
+
2000-05-18 H.J. Lu <hjl@gnu.org>
* lexsup.c (parse_args): `i' == `r', not `q'.
Changes in version 2.10:
+* Added command line switch --section-start to set the start address of any
+ specified section.
+
* Added ability to emit full relocation information in linked executables,
enabled by --emit-relocs. Some post-linkage optimization tools need
this information in order to be able to correctly identify and perform
.br
.RB "[\|" "\-defsym\ "\c
.I symbol\c
-\& = \c
+\&=\c
.I expression\c
\&\|]
.RB "[\|" \-\-demangle "\|]"
.RB "[\|" "\-T\ "\c
.I commandfile\c
\&\|]
+.RB "[\|" "\-\-section\-start\ "\c
+.I sectionname\c
+\&=\c
+.I sectionorg\c
+\&\|]
.RB "[\|" "\-Ttext\ "\c
.I textorg\c
\&\|]
.B \-format\c
\&), \c
.B \-defsym\c
-\&,
-\c
+\&, \c
+.B \-\-section\-start\c
+\&, \c
.B \-L\c
\&, \c
.B \-l\c
\& has the same effect.
.TP
-.BI "-defsym " "symbol" "\fR = \fP" expression
+.BI "-defsym " "symbol" "\fR=\fP" expression
Create a global symbol in the output file, containing the absolute
address given by \c
.I expression\c
but creates a new output section for each input file.
.TP
+.BI "--section-start " "sectionname" "\fR=\fP"org
+Locate a section in the output file at the absolute
+address given by \c
+.I org\c
+\&. \c
+\c
+.I org\c
+\& must be a hexadecimal integer.
+You may use this option as many
+times as necessary to locate multiple sections in the command
+line. If you need more elaborate expressions, consider
+using the linker command language from a script.
+
+.TP
.BI "\-Tbss " "org"\c
.TP
.BI "\-Tdata " "org"\c
trouble). The @samp{--traditional-format} switch tells @code{ld} to not
combine duplicate entries.
+@kindex --section-start @var{sectionname}=@var{org}
+@item --section-start @var{sectionname}=@var{org}
+Locate a section in the output file at the absolute
+address given by @var{org}. You may use this option as many
+times as necessary to locate multiple sections in the command
+line.
+@var{org} must be a single hexadecimal integer;
+for compatibility with other linkers, you may omit the leading
+@samp{0x} usually associated with hexadecimal values. @emph{Note:} there
+should be no white space between @var{sectionname}, the equals
+sign (``@key{=}''), and @var{org}.
+
@kindex -Tbss @var{org}
@kindex -Tdata @var{org}
@kindex -Ttext @var{org}
#define OPTION_NO_UNDEFINED (OPTION_MPC860C0 + 1)
#define OPTION_INIT (OPTION_NO_UNDEFINED + 1)
#define OPTION_FINI (OPTION_INIT + 1)
+#define OPTION_SECTION_START (OPTION_FINI + 1)
/* The long options. This structure is used for both the option
parsing and the help text. */
'\0', N_("SYMBOL"), N_("Do task level linking"), TWO_DASHES },
{ {"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT},
'\0', NULL, N_("Use same format as native linker"), TWO_DASHES },
+ { {"section-start", required_argument, NULL, OPTION_SECTION_START},
+ '\0', N_("SECTION=ADDRESS"), N_("Set address of named section"), TWO_DASHES },
{ {"Tbss", required_argument, NULL, OPTION_TBSS},
'\0', N_("ADDRESS"), N_("Set address of .bss section"), ONE_DASH },
{ {"Tdata", required_argument, NULL, OPTION_TDATA},
parser_input = input_script;
yyparse ();
break;
+ case OPTION_SECTION_START:
+ {
+ char *optarg2;
+
+ /* Check for <something>=<somthing>... */
+ optarg2 = strchr (optarg, '=');
+ if (optarg2 == NULL)
+ {
+ fprintf (stderr,
+ _("%s: Invalid argument to option \"--section-start\"\n"),
+ program_name);
+ xexit (1);
+ }
+
+ optarg2 ++;
+
+ /* So far so good. Are all the args present? */
+ if ((*optarg == '\0') || (*optarg2 == '\0'))
+ {
+ fprintf (stderr,
+ _("%s: Missing argument(s) to option \"--section-start\"\n"),
+ program_name);
+ xexit (1);
+ }
+
+ optarg2[-1] = '\0';
+
+ /* Then set it... */
+ set_section_start (optarg, optarg2);
+
+ optarg2[-1] = '=';
+ }
+ break;
case OPTION_TBSS:
set_section_start (".bss", optarg);
break;