aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorJozef Lawrynowicz <jozef.l@somniumtech.com>2017-08-29 17:18:43 +0100
committerNick Clifton <nickc@redhat.com>2017-08-29 17:18:43 +0100
commit7ef3addbe195b6283d0baf59e081146dfb211c97 (patch)
treec201cf7915b7d05e32742dc90d4c0716e62babcf /gas/testsuite
parent3819af136deb7ba6bc2058d7848cf80b33dbe51c (diff)
downloadgdb-7ef3addbe195b6283d0baf59e081146dfb211c97.zip
gdb-7ef3addbe195b6283d0baf59e081146dfb211c97.tar.gz
gdb-7ef3addbe195b6283d0baf59e081146dfb211c97.tar.bz2
Improve MSP430 section placement.
ld * emultempl/msp430.em (change_output_section): New function. (move_prefixed_section): New function. (add_region_prefix): New function. (msp430_elf_after_open): New function. (gld${EMULATION_NAME}_add_options): Implement. (gld${EMULATION_NAME}_list_options): Implement. (gld${EMULATION_NAME}_handle_option): Implement. * ld.texinfo: Document new options. * testsuite/ld-msp430-elf/main-bss-lower.d: New. * testsuite/ld-msp430-elf/main-bss-upper.d: New. * testsuite/ld-msp430-elf/main-const-lower.d: New. * testsuite/ld-msp430-elf/main-const-upper.d: New. * testsuite/ld-msp430-elf/main-text-lower.d: New. * testsuite/ld-msp430-elf/main-text-upper.d: New. * testsuite/ld-msp430-elf/main-var-lower.d: New. * testsuite/ld-msp430-elf/main-var-upper.d: New. * testsuite/ld-msp430-elf/main-with-data-bss-unique-sec.s: New. * testsuite/ld-msp430-elf/main-with-data-bss.s: New. * testsuite/ld-msp430-elf/main-with-text-rodata-unique-sec.s: New. * testsuite/ld-msp430-elf/main-with-text-rodata.s: New. * testsuite/ld-msp430-elf/msp430-elf.exp: New. * testsuite/ld-msp430-elf/msp430-no-lower.ld: New. * testsuite/ld-msp430-elf/msp430.ld: New. * emultempl/msp430.em (data_statement_size): New. (eval_upper_either_sections): New. (eval_lower_either_sections): New. (intermediate_relax_sections): New. (msp430_elf_after_allocation): New. * emultempl/msp430.em (gld${EMULATION_NAME}_place_orphan): Always place sections in the lower region. gas * config/tc-msp430.c (md_parse_option): Define high data and high bss symbols if -mdata-region is passed. Define -mdata-region open. * doc/c-msp430.texi: Document -mdata-region. * testsuite/gas/msp430/high-data-bss-sym.d: New test. * testsuite/gas/msp430/high-data-bss-sym.s: New. * testsuite/gas/msp430/msp430.exp: Add -mdata-region tests.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/msp430/high-data-bss-sym.d6
-rw-r--r--gas/testsuite/gas/msp430/high-data-bss-sym.s19
-rw-r--r--gas/testsuite/gas/msp430/msp430.exp2
3 files changed, 27 insertions, 0 deletions
diff --git a/gas/testsuite/gas/msp430/high-data-bss-sym.d b/gas/testsuite/gas/msp430/high-data-bss-sym.d
new file mode 100644
index 0000000..1c8d95b
--- /dev/null
+++ b/gas/testsuite/gas/msp430/high-data-bss-sym.d
@@ -0,0 +1,6 @@
+#objdump: -t
+#name: Check symbols to initialise high data and high bss have been defined
+#...
+.*__crt0_move_highdata.*
+.*__crt0_init_highbss.*
+#pass
diff --git a/gas/testsuite/gas/msp430/high-data-bss-sym.s b/gas/testsuite/gas/msp430/high-data-bss-sym.s
new file mode 100644
index 0000000..1e6bf72
--- /dev/null
+++ b/gas/testsuite/gas/msp430/high-data-bss-sym.s
@@ -0,0 +1,19 @@
+ .file "main.c"
+.text
+ .balign 2
+ .global main
+ .type main, @function
+main:
+; start of function
+; framesize_regs: 0
+; framesize_locals: 0
+; framesize_outgoing: 0
+; framesize: 0
+; elim ap -> fp 2
+; elim fp -> sp 0
+; saved regs:(none)
+ ; start of prologue
+ ; end of prologue
+.L2:
+ BR #.L2
+ .size main, .-main
diff --git a/gas/testsuite/gas/msp430/msp430.exp b/gas/testsuite/gas/msp430/msp430.exp
index b83e1ac..0dfb271 100644
--- a/gas/testsuite/gas/msp430/msp430.exp
+++ b/gas/testsuite/gas/msp430/msp430.exp
@@ -24,4 +24,6 @@ if [expr [istarget "msp430-*-*"]] then {
run_dump_test "bad"
run_dump_test "errata_warns"
run_dump_test "errata_fixes"
+ run_dump_test "high-data-bss-sym" { { as "-mdata-region=upper" } }
+ run_dump_test "high-data-bss-sym" { { as "-mdata-region=either" } }
}