specified in the library. If specified multiple times @code{DT_AUDIT}
will contain a colon separated list of audit interfaces to use. If the linker
finds an object with an audit entry while searching for shared libraries,
-it will add a corresponding @code{DT_DEPAUDIT} entry in the output file.
+it will add a corresponding @code{DT_DEPAUDIT} entry in the output file.
This option is only meaningful on ELF platforms supporting the rtld-audit
-interface.
+interface.
@ifset I960
@cindex architectures
specified in the library. If specified multiple times @code{DT_DEPAUDIT}
will contain a colon separated list of audit interfaces to use. This
option is only meaningful on ELF platforms supporting the rtld-audit interface.
-The -P option is provided for Solaris compatibility.
+The -P option is provided for Solaris compatibility.
@cindex entry point, from command line
@kindex -e @var{entry}
@kindex --no-copy-dt-needed-entries
@item --copy-dt-needed-entries
@itemx --no-copy-dt-needed-entries
-This option affects the treatment of dynamic libraries referred to
+This option affects the treatment of dynamic libraries referred to
by DT_NEEDED tags @emph{inside} ELF dynamic libraries mentioned on the
command line. Normally the linker won't add a DT_NEEDED tag to the
output binary for each library mentioned in a DT_NEEDED tag in an
relocations. See @samp{--entry} and @samp{--undefined}.
This option can be set when doing a partial link (enabled with option
-@samp{-r}). In this case the root of symbols kept must be explicitly
+@samp{-r}). In this case the root of symbols kept must be explicitly
specified either by an @samp{--entry} or @samp{--undefined} option or by
a @code{ENTRY} command in the linker script.
When creating an ELF executable or shared object, it will set the address
of the first byte of the text segment.
+@kindex -Trodata-segment=@var{org}
+@item -Trodata-segment=@var{org}
+@cindex rodata segment origin, cmd line
+When creating an ELF executable or shared object for a target where
+the read-only data is in its own segment separate from the executable
+text, it will set the address of the first byte of the read-only data segment.
+
@kindex --unresolved-symbols
@item --unresolved-symbols=@var{method}
Determine how to handle unresolved symbols. There are four possible
disallow it in object files, by using these two options. Executable images
generated with these long section names are slightly non-standard, carrying
as they do a string table, and may generate confusing output when examined
-with non-GNU PE-aware tools, such as file viewers and dumpers. However,
-GDB relies on the use of PE long section names to find Dwarf-2 debug
+with non-GNU PE-aware tools, such as file viewers and dumpers. However,
+GDB relies on the use of PE long section names to find Dwarf-2 debug
information sections in an executable image at runtime, and so if neither
option is specified on the command-line, @command{ld} will enable long
section names, overriding the default and technically correct behaviour,
@kindex --wdmdriver
@item --wdmdriver
The driver uses the MS Windows Driver Model.
-
+
@kindex --tsaware
@item --tsaware
The image is Terminal Server aware.
@code{C}:
@multitable @columnfractions .25 .25 .25 .25
@item Section @tab Variant A @tab Variant B @tab Variant C
-@item .text @tab RAM @tab ROM @tab ROM
+@item .text @tab RAM @tab ROM @tab ROM
@item .rodata @tab RAM @tab ROM @tab ROM2
@item .data @tab RAM @tab RAM/ROM @tab RAM/ROM2
@item .bss @tab RAM @tab RAM @tab RAM
with symbol names, file names, or section names. Each memory region
must have a distinct name within the @code{MEMORY} command. However you can
add later alias names to existing memory regions with the @ref{REGION_ALIAS}
-command.
+command.
@cindex memory region attributes
The @var{attr} string is an optional list of attributes that specify
So for example:
@smallexample
- .text ALIGN (CONSTANT (MAXPAGESIZE)) : @{ *(.text) @}
+ .text ALIGN (CONSTANT (MAXPAGESIZE)) : @{ *(.text) @}
@end smallexample
will create a text section aligned to the largest page boundary
@cindex ARM1176 erratum workaround
@kindex --fix-arm1176
@kindex --no-fix-arm1176
-The @samp{--fix-arm1176} switch enables a link-time workaround for an erratum
-in certain ARM1176 processors. The workaround is enabled by default if you
-are targeting ARM v6 (excluding ARM v6T2) or earlier. It can be disabled
+The @samp{--fix-arm1176} switch enables a link-time workaround for an erratum
+in certain ARM1176 processors. The workaround is enabled by default if you
+are targeting ARM v6 (excluding ARM v6T2) or earlier. It can be disabled
unconditionally by specifying @samp{--no-fix-arm1176}.
-Further information is available in the ``ARM1176JZ-S and ARM1176JZF-S
+Further information is available in the ``ARM1176JZ-S and ARM1176JZF-S
Programmer Advice Notice'' available on the ARM documentation website at:
http://infocenter.arm.com/.
symbols known to belong to the system's runtime and libraries. As it will
often not be desirable to export all of a DLL's symbols, which may include
private functions that are not part of any public interface, the command-line
-options listed above may be used to filter symbols out from the list for
+options listed above may be used to filter symbols out from the list for
exporting. The @samp{--output-def} option can be used in order to see the
final list of exported symbols with all exclusions taken into effect.
{ {"pic-executable", no_argument, NULL, OPTION_PIE},
'\0', NULL, NULL, TWO_DASHES },
{ {"sort-common", optional_argument, NULL, OPTION_SORT_COMMON},
- '\0', N_("[=ascending|descending]"),
- N_("Sort common symbols by alignment [in specified order]"),
+ '\0', N_("[=ascending|descending]"),
+ N_("Sort common symbols by alignment [in specified order]"),
TWO_DASHES },
{ {"sort_common", no_argument, NULL, OPTION_SORT_COMMON},
'\0', NULL, NULL, NO_HELP },
{ {"sort-section", required_argument, NULL, OPTION_SORT_SECTION},
- '\0', N_("name|alignment"),
+ '\0', N_("name|alignment"),
N_("Sort sections by name or maximum alignment"), TWO_DASHES },
{ {"spare-dynamic-tags", required_argument, NULL, OPTION_SPARE_DYNAMIC_TAGS},
'\0', N_("COUNT"), N_("How many tags to reserve in .dynamic section"),
'\0', N_("ADDRESS"), N_("Set address of .text section"), ONE_DASH },
{ {"Ttext-segment", required_argument, NULL, OPTION_TTEXT_SEGMENT},
'\0', N_("ADDRESS"), N_("Set address of text segment"), ONE_DASH },
+ { {"Trodata-segment", required_argument, NULL, OPTION_TRODATA_SEGMENT},
+ '\0', N_("ADDRESS"), N_("Set address of rodata segment"), ONE_DASH },
{ {"unresolved-symbols=<method>", required_argument, NULL,
OPTION_UNRESOLVED_SYMBOLS},
'\0', NULL, N_("How to handle unresolved symbols. <method> is:\n"
case OPTION_TTEXT_SEGMENT:
set_segment_start (".text-segment", optarg);
break;
+ case OPTION_TRODATA_SEGMENT:
+ set_segment_start (".rodata-segment", optarg);
+ break;
case OPTION_TRADITIONAL_FORMAT:
link_info.traditional_format = TRUE;
break;
EOF
if test -n "${SEPARATE_CODE}"; then
+ if test -n "${RODATA_ADDR}"; then
+ RODATA_ADDR="\
+SEGMENT_START(\"rodata-segment\", ${RODATA_ADDR}) + SIZEOF_HEADERS"
+ else
+ RODATA_ADDR="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))}"
+ RODATA_ADDR="SEGMENT_START(\"rodata-segment\", ${RODATA_ADDR})"
+ fi
+ if test -n "${SHLIB_RODATA_ADDR}"; then
+ SHLIB_RODATA_ADDR="\
+SEGMENT_START(\"rodata-segment\", ${SHLIB_RODATA_ADDR}) + SIZEOF_HEADERS"
+ else
+ SHLIB_RODATA_ADDR="SEGMENT_START(\"rodata-segment\", ${SHLIB_RODATA_ADDR})"
+ SHLIB_RODATA_ADDR="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))"
+ fi
cat <<EOF
/* Adjust the address for the rodata segment. We want to adjust up to
the same address within the page on the next page up. */
- ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${RODATA_ADDR-ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))};}}}
- ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_RODATA_ADDR-ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))};}}
- ${CREATE_PIE+${RELOCATING+. = ${SHLIB_RODATA_ADDR-ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))};}}
+ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${RODATA_ADDR};}}}
+ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_RODATA_ADDR};}}
+ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_RODATA_ADDR};}}
EOF
emit_early_ro
emit_dyn
.debug_ranges 0 : { *(.debug_ranges) }
/* DWARF Extension. */
- .debug_macro 0 : { *(.debug_macro) }
-
+ .debug_macro 0 : { *(.debug_macro) }
+
${TINY_DATA_SECTION}
${TINY_BSS_SECTION}