diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2019-11-25 08:55:37 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2020-03-13 14:44:45 +0000 |
commit | abf874aafe3d717573e4a48bf0e3c6334e666a55 (patch) | |
tree | 48877a5c76632d003c4a64bea1b3a9eea74d4f96 /ld/ld.texi | |
parent | 74e10d1742f1b8312359c59a2af06c9e661252b3 (diff) | |
download | gdb-abf874aafe3d717573e4a48bf0e3c6334e666a55.zip gdb-abf874aafe3d717573e4a48bf0e3c6334e666a55.tar.gz gdb-abf874aafe3d717573e4a48bf0e3c6334e666a55.tar.bz2 |
Add support for non-contiguous memory regions
2020-01-06 Christophe Lyon <christophe.lyon@linaro.org>
bfd/
* bfd-in2.h: Regenerate.
* section.c (asection): Add already_assigned field.
(BFD_FAKE_SECTION): Add default initializer for it.
* ecoff.c (bfd_debug_section): Initialize already_assigned field.
* elf32-arm.c (arm_build_one_stub): Add support for
non_contiguous_regions.
* elf32-csky.c (csky_build_one_stub): Likewise.
* elf32-hppa.c (hppa_build_one_stub): Likewise.
* elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
* elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
* elf32-metag.c (metag_build_one_stub): Likewise.
* elf32-nios2.c (nios2_build_one_stub): Likewise.
* elf64-ppc.c (ppc_build_one_stub): Likewise.
(ppc_size_one_stub): Likewise.
* elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
* elflink.c (elf_link_input_bfd): Likewise.
include/
* bfdlink.h (bfd_link_info): Add non_contiguous_regions and
non_contiguous_regions_warnings fields.
ld/
* ldlang.c (lang_add_section): Add support for
non_contiguous_regions.
(size_input_section): Likewise.
(lang_size_sections_1): Likewise.
(process_insert_statements): Likewise.
* ldlex.h (option_values): Add OPTION_NON_CONTIGUOUS_REGIONS and
OPTION_NON_CONTIGUOUS_REGIONS_WARNINGS.
* lexsup.c (ld_options): Add entries for
--enable-non-contiguous-regions and
--enable-non-contiguous-regions-warnings.
(parse_args): Handle it.
* NEWS: Add --enable-non-contiguous-regions and
--enable-non-contiguous-regions-warnings.
* ld.texi: Add --enable-non-contiguous-regions and
--enable-non-contiguous-regions-warnings documentation.
* emultempl/armelf.em (elf32_arm_add_stub_section): Add
SEC_LINKER_CREATED flag.
* emultempl/xtensaelf.em (ld_build_required_section_dependence):
Emit an error when --enable-non-contiguous-regions is used.
* testsuite/ld-elf/non-contiguous.d: New.
* testsuite/ld-elf/non-contiguous.ld: New.
* testsuite/ld-elf/non-contiguous.s: New.
* testsuite/ld-arm/arm-elf.exp: Run the new tests.
* testsuite/ld-arm/arm-elf/non-contiguous-arm.s: New.
* testsuite/ld-arm/arm-elf/non-contiguous-arm.d: New.
* testsuite/ld-arm/arm-elf/non-contiguous-arm.ld: New.
* testsuite/ld-arm/arm-elf/non-contiguous-arm2.d: New.
* testsuite/ld-arm/arm-elf/non-contiguous-arm3.ld: New.
* testsuite/ld-arm/arm-elf/non-contiguous-arm3.d: New.
* testsuite/ld-arm/arm-elf/non-contiguous-arm3.ld: New.
* testsuite/ld-arm/arm-elf/non-contiguous-arm4.d: New.
* testsuite/ld-arm/arm-elf/non-contiguous-arm4.ld: New.
* testsuite/ld-arm/arm-elf/non-contiguous-arm5.d: New.
* testsuite/ld-arm/arm-elf/non-contiguous-arm5.ld: New.
* testsuite/ld-arm/arm-elf/non-contiguous-arm6.d: New.
* testsuite/ld-arm/arm-elf/non-contiguous-arm6.ld: New.
* testsuite/ld-powerpc/powerpc.exp: Run new tests.
* testsuite/ld-powerpc/non-contiguous-powerpc.d: New.
* testsuite/ld-powerpc/non-contiguous-powerpc.ld: New.
* testsuite/ld-powerpc/non-contiguous-powerpc.sd: New.
* testsuite/ld-powerpc/non-contiguous-powerpc64.d: New.
Diffstat (limited to 'ld/ld.texi')
-rw-r--r-- | ld/ld.texi | 42 |
1 files changed, 42 insertions, 0 deletions
@@ -459,6 +459,48 @@ 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. +@kindex --enable-non-contiguous-regions +@item --enable-non-contiguous-regions +This option avoids generating an error if an input section does not +fit a matching output section. The linker tries to allocate the input +section to subseque nt matching output sections, and generates an +error only if no output section is large enough. This is useful when +several non-contiguous memory regions are available and the input +section does not require a particular one. The order in which input +sections are evaluated does not change, for instance: + +@smallexample + MEMORY @{ + MEM1 (rwx) : ORIGIN : 0x1000, LENGTH = 0x14 + MEM2 (rwx) : ORIGIN : 0x1000, LENGTH = 0x40 + MEM3 (rwx) : ORIGIN : 0x2000, LENGTH = 0x40 + @} + SECTIONS @{ + mem1 : @{ *(.data.*); @} > MEM1 + mem2 : @{ *(.data.*); @} > MEM2 + mem3 : @{ *(.data.*); @} > MEM2 + @} + + with input sections: + .data.1: size 8 + .data.2: size 0x10 + .data.3: size 4 + + results in .data.1 affected to mem1, and .data.2 and .data.3 + affected to mem2, even though .data.3 would fit in mem3. +@end smallexample + +This option is incompatible with INSERT statements because it changes +the way input sections are mapped to output sections. + +@kindex --enable-non-contiguous-regions-warnings +@item --enable-non-contiguous-regions-warnings +This option enables warnings when +@code{--enable-non-contiguous-regions} allows possibly unexpected +matches in sections mapping, potentially leading to silently +discarding a section instead of failing because it does not fit any +output region. + @cindex entry point, from command line @kindex -e @var{entry} @kindex --entry=@var{entry} |