+2020-01-16 Jozef Lawrynowicz <jozef.l@mittosystems.com>
+
+ * scripttempl/elf32msp430.sc: Add input section rules for
+ .upper.{text,data,rodata,bss}.
+ * testsuite/ld-msp430-elf/msp430-elf.exp: Run new test.
+ * testsuite/ld-msp430-elf/upper-input-sections.s: New test.
+
2020-01-15 Lars Brinkhoff <lars@nocrew.org>
PR 20694
*(.either.text.* .either.text)
+ *(.upper.text.* .upper.text)
+
. = ALIGN(2);
*(SORT_NONE(.fini9))
*(SORT_NONE(.fini8))
${RELOCATING+*(.rodata1)
*(.either.rodata.*) *(.either.rodata)
+
+ *(.upper.rodata.* .upper.rodata)
+
*(.eh_frame_hdr)
KEEP (*(.eh_frame))
*(.either.data.* .either.data)
+ *(.upper.data.* .upper.data)
+
*(.got.plt) *(.got)
. = ALIGN(2);
*(.sdata .sdata.* .gnu.linkonce.s.*)
. = ALIGN(2);}
*(.bss)
${RELOCATING+*(.either.bss.* .either.bss)
+ *(.upper.bss.* .upper.bss)
*(COMMON)
PROVIDE (__bss_end = .);}
} ${RELOCATING+ > data}
run_dump_test valid-map
run_ld_link_tests {{ "Check no reloc overflow with #lo and data in the upper region"
"-m msp430X" "" "" {reloc-lo-430x.s} {} "reloc-lo-430x"}}
+run_ld_link_tests {{ "Check .upper prefixed input sections can be placed"
+ "-m msp430X" "" "" {upper-input-sections.s} {} "upper-input-sections"}}
# Don't run data region tests if a data region is specified
if {[string match "*-mdata-region*" [board_info [target_info name] multilib_flags]]} {
--- /dev/null
+.text
+ .balign 2
+ .section .upper.text,"ax",@progbits
+ .global foo
+ .type foo, @function
+foo:
+ MOV.W #42, R8
+ RETA
+ .size foo, .-foo
+
+ .balign 2
+ .global main
+ .type main, @function
+main:
+ CALLA #foo
+.L4:
+ BRA #.L4
+ .size main, .-main
+ .section .upper.bss,"aw",@nobits
+ .balign 2
+ .global P
+P:
+ .zero 4
+ .section .upper.data,"aw",@progbits
+ .balign 2
+ .global Q
+Q:
+ .long 4
+ .section .upper.rodata,"aw",@progbits
+ .balign 2
+ .global R
+R:
+ .word 8