aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorJozef Lawrynowicz <jozef.l@mittosystems.com>2020-01-16 11:32:23 +0000
committerJozef Lawrynowicz <jozef.l@mittosystems.com>2020-01-16 13:22:31 +0000
commit0c3d9485091753e6d9c4d317a9219cf4b6dce116 (patch)
treeb9576ece5e375dd1316876db4efec1ff51464c46 /ld
parent45a4bb2010a42637bec03c06d84a998afacefb4e (diff)
downloadgdb-0c3d9485091753e6d9c4d317a9219cf4b6dce116.zip
gdb-0c3d9485091753e6d9c4d317a9219cf4b6dce116.tar.gz
gdb-0c3d9485091753e6d9c4d317a9219cf4b6dce116.tar.bz2
MSP430: Add input section rules for .upper sections to default linker script
ld/ChangeLog: 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.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/scripttempl/elf32msp430.sc8
-rw-r--r--ld/testsuite/ld-msp430-elf/msp430-elf.exp2
-rw-r--r--ld/testsuite/ld-msp430-elf/upper-input-sections.s33
4 files changed, 50 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 5208f62..7799d7d 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+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
diff --git a/ld/scripttempl/elf32msp430.sc b/ld/scripttempl/elf32msp430.sc
index 6f716c7..f9ee9ff 100644
--- a/ld/scripttempl/elf32msp430.sc
+++ b/ld/scripttempl/elf32msp430.sc
@@ -171,6 +171,8 @@ SECTIONS
*(.either.text.* .either.text)
+ *(.upper.text.* .upper.text)
+
. = ALIGN(2);
*(SORT_NONE(.fini9))
*(SORT_NONE(.fini8))
@@ -198,6 +200,9 @@ SECTIONS
${RELOCATING+*(.rodata1)
*(.either.rodata.*) *(.either.rodata)
+
+ *(.upper.rodata.* .upper.rodata)
+
*(.eh_frame_hdr)
KEEP (*(.eh_frame))
@@ -267,6 +272,8 @@ SECTIONS
*(.either.data.* .either.data)
+ *(.upper.data.* .upper.data)
+
*(.got.plt) *(.got)
. = ALIGN(2);
*(.sdata .sdata.* .gnu.linkonce.s.*)
@@ -286,6 +293,7 @@ SECTIONS
. = ALIGN(2);}
*(.bss)
${RELOCATING+*(.either.bss.* .either.bss)
+ *(.upper.bss.* .upper.bss)
*(COMMON)
PROVIDE (__bss_end = .);}
} ${RELOCATING+ > data}
diff --git a/ld/testsuite/ld-msp430-elf/msp430-elf.exp b/ld/testsuite/ld-msp430-elf/msp430-elf.exp
index 777b358..e9a0fdc 100644
--- a/ld/testsuite/ld-msp430-elf/msp430-elf.exp
+++ b/ld/testsuite/ld-msp430-elf/msp430-elf.exp
@@ -176,6 +176,8 @@ run_ld_link_tests $msp430warntests
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]]} {
diff --git a/ld/testsuite/ld-msp430-elf/upper-input-sections.s b/ld/testsuite/ld-msp430-elf/upper-input-sections.s
new file mode 100644
index 0000000..c816f30
--- /dev/null
+++ b/ld/testsuite/ld-msp430-elf/upper-input-sections.s
@@ -0,0 +1,33 @@
+.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