aboutsummaryrefslogtreecommitdiff
path: root/ld/ld.texi
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2022-02-16 17:41:23 +0000
committerNick Clifton <nickc@redhat.com>2022-02-16 17:41:23 +0000
commitc212f39d9a82c6c09f4a1447d9d2ff09843827c5 (patch)
tree4dcd736239b6373674032ce36fa62ecd9ea67883 /ld/ld.texi
parent1f841a9348f189a8ee4423eb416d6e5495b5b49d (diff)
downloadgdb-c212f39d9a82c6c09f4a1447d9d2ff09843827c5.zip
gdb-c212f39d9a82c6c09f4a1447d9d2ff09843827c5.tar.gz
gdb-c212f39d9a82c6c09f4a1447d9d2ff09843827c5.tar.bz2
ld: Support customized output section type
bfd/ PR ld/28841 * bfd-in2.h (struct bfd_section): Add type. (discarded_section): Add field. * elf.c (elf_fake_sections): Handle bfd_section::type. * section.c (BFD_FAKE_SECTION): Add field. * mri.c (mri_draw_tree): Update function call. ld/ PR ld/28841 * ld.texi: Document new output section type. * ldlex.l: Add new token TYPE. * ldgram.y: Handle TYPE=exp. * ldlang.h: Add type_section to list of section types. * ldlang.c (lang_add_section): Handle type_section. (map_input_to_output_sections): Handle type_section. * testsuite/ld-scripts/output-section-types.t: Add tests. * testsuite/ld-scripts/output-section-types.d: Update.
Diffstat (limited to 'ld/ld.texi')
-rw-r--r--ld/ld.texi16
1 files changed, 13 insertions, 3 deletions
diff --git a/ld/ld.texi b/ld/ld.texi
index fc75e9b..d57e922 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -5483,13 +5483,23 @@ loaded into memory when the program is run.
@item READONLY
The section should be marked as read-only.
@item DSECT
-@itemx COPY
-@itemx INFO
-@itemx OVERLAY
+@item COPY
+@item INFO
+@item OVERLAY
These type names are supported for backward compatibility, and are
rarely used. They all have the same effect: the section should be
marked as not allocatable, so that no memory is allocated for the
section when the program is run.
+@item TYPE = @var{type}
+Set the section type to the integer @var{type}. When generating an ELF
+output file, type names @code{SHT_PROGBITS}, @code{SHT_STRTAB},
+@code{SHT_NOTE}, @code {SHT_NOBITS}, @code{SHT_INIT_ARRAY},
+@code{SHT_FINI_ARRAY}, and @code{SHT_PREINIT_ARRAY} are also allowed
+for @var{type}. It is the user's responsibility to ensure that any
+special requirements of the section type are met.
+@item READONLY ( TYPE = @var{type} )
+This form of the syntax combines the @var{READONLY} type with the
+type specified by @var{type}.
@end table
@kindex NOLOAD