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/testsuite/ld-powerpc | |
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/testsuite/ld-powerpc')
-rw-r--r-- | ld/testsuite/ld-powerpc/non-contiguous-powerpc.d | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/non-contiguous-powerpc.ld | 22 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/non-contiguous-powerpc.s | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/non-contiguous-powerpc64.d | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/powerpc.exp | 3 |
5 files changed, 43 insertions, 0 deletions
diff --git a/ld/testsuite/ld-powerpc/non-contiguous-powerpc.d b/ld/testsuite/ld-powerpc/non-contiguous-powerpc.d new file mode 100644 index 0000000..858e353 --- /dev/null +++ b/ld/testsuite/ld-powerpc/non-contiguous-powerpc.d @@ -0,0 +1,5 @@ +#name: non-contiguous-powerpc +#source: non-contiguous-powerpc.s +#ld: --enable-non-contiguous-regions -T non-contiguous-powerpc.ld +#error: \ARelaxation not supported with --enable-non-contiguous-regions.* +#skip: powerpc64*-* diff --git a/ld/testsuite/ld-powerpc/non-contiguous-powerpc.ld b/ld/testsuite/ld-powerpc/non-contiguous-powerpc.ld new file mode 100644 index 0000000..744d246 --- /dev/null +++ b/ld/testsuite/ld-powerpc/non-contiguous-powerpc.ld @@ -0,0 +1,22 @@ +/* Distance between 'one' and 'two' means that relaxation implies that + .text.one's size increases. Even though the result would fit in + 'oneandhalf', this is not supported by + --enable-non-contiguous-regions. */ + +MEMORY { + one (RXAI) : ORIGIN = 0x00000000, LENGTH = 0x00000010 + oneandhalf (RXAI) : ORIGIN = 0x00001000, LENGTH = 0x00001010 + two (RXAI) : ORIGIN = 0x20000000, LENGTH = 0x10000000 +} + +SECTIONS { + one : { + *(.text.one) + } > one + oneandhalf : { + *(.text.one) + } > oneandhalf + two : { + *(.text.two) + } > two +} diff --git a/ld/testsuite/ld-powerpc/non-contiguous-powerpc.s b/ld/testsuite/ld-powerpc/non-contiguous-powerpc.s new file mode 100644 index 0000000..e02b322 --- /dev/null +++ b/ld/testsuite/ld-powerpc/non-contiguous-powerpc.s @@ -0,0 +1,8 @@ + .machine "ppc" + + .section .text.one + b 2f + + .section .text.two +2: + nop diff --git a/ld/testsuite/ld-powerpc/non-contiguous-powerpc64.d b/ld/testsuite/ld-powerpc/non-contiguous-powerpc64.d new file mode 100644 index 0000000..ff0e3fc --- /dev/null +++ b/ld/testsuite/ld-powerpc/non-contiguous-powerpc64.d @@ -0,0 +1,5 @@ +#name: non-contiguous-powerpc64 +#source: non-contiguous-powerpc.s +#as: -a64 +#ld: -melf64ppc --enable-non-contiguous-regions -T non-contiguous-powerpc.ld +#error: .*Could not assign group.* diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp index 94b2fac..84d7c9c 100644 --- a/ld/testsuite/ld-powerpc/powerpc.exp +++ b/ld/testsuite/ld-powerpc/powerpc.exp @@ -405,6 +405,7 @@ if [ supports_ppc64 ] then { run_dump_test "tlsgd" run_dump_test "tlsld" run_dump_test "tlsie" + run_dump_test "non-contiguous-powerpc64" } run_dump_test "localgot" @@ -443,3 +444,5 @@ run_dump_test "vle-multiseg-6" run_dump_test "ppc476-shared" run_dump_test "ppc476-shared2" + +run_dump_test "non-contiguous-powerpc" |