diff options
author | Fangrui Song <maskray@google.com> | 2022-02-16 17:41:23 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2022-02-16 17:41:23 +0000 |
commit | c212f39d9a82c6c09f4a1447d9d2ff09843827c5 (patch) | |
tree | 4dcd736239b6373674032ce36fa62ecd9ea67883 /bfd/bfd-in2.h | |
parent | 1f841a9348f189a8ee4423eb416d6e5495b5b49d (diff) | |
download | gdb-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 'bfd/bfd-in2.h')
-rw-r--r-- | bfd/bfd-in2.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 3b2a4f4..78a0a1d 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1170,6 +1170,9 @@ typedef struct bfd_section This is used when support for non-contiguous memory regions is enabled. */ struct bfd_section *already_assigned; + /* Explicitly specified section type, if non-zero. */ + unsigned int type; + } asection; /* Relax table contains information about instructions which can @@ -1352,8 +1355,8 @@ discarded_section (const asection *sec) /* symbol, symbol_ptr_ptr, */ \ (struct bfd_symbol *) SYM, &SEC.symbol, \ \ - /* map_head, map_tail, already_assigned */ \ - { NULL }, { NULL }, NULL \ + /* map_head, map_tail, already_assigned, type */ \ + { NULL }, { NULL }, NULL, 0 \ \ } |