aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf
diff options
context:
space:
mode:
authorJim Wilson <jimw@sifive.com>2017-12-06 10:34:36 -0800
committerJim Wilson <jimw@sifive.com>2017-12-06 10:34:36 -0800
commit1c9c7ce078427891a94dc7604ce9e62175ebfda5 (patch)
tree43462daac8331919898ef39d5eba799b1f27217f /ld/testsuite/ld-elf
parent7cc244debb587d0f6179d80b5ca9b0ee86e9ab72 (diff)
downloadgdb-1c9c7ce078427891a94dc7604ce9e62175ebfda5.zip
gdb-1c9c7ce078427891a94dc7604ce9e62175ebfda5.tar.gz
gdb-1c9c7ce078427891a94dc7604ce9e62175ebfda5.tar.bz2
Objcopy interleave fails if section address not multiple of interleave.
PR 22465 binutils/ * objcopy.c (copy_section): New local extra. If isection->lma not exactly divisible by interleave, then bias from. Also adjust osection->lma if necessary. ld/ * testsuite/ld-elf/interleave-0.d, testsuite/ld-elf/interleave-4.d, * testsuite/ld-elf/interleave.ld, testsuite/ld-elf/interleave.s: New.
Diffstat (limited to 'ld/testsuite/ld-elf')
-rw-r--r--ld/testsuite/ld-elf/interleave-0.d9
-rw-r--r--ld/testsuite/ld-elf/interleave-4.d9
-rw-r--r--ld/testsuite/ld-elf/interleave.ld10
-rw-r--r--ld/testsuite/ld-elf/interleave.s18
4 files changed, 46 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/interleave-0.d b/ld/testsuite/ld-elf/interleave-0.d
new file mode 100644
index 0000000..837223c
--- /dev/null
+++ b/ld/testsuite/ld-elf/interleave-0.d
@@ -0,0 +1,9 @@
+#name: --interleave test byte 0
+#source: interleave.s
+#ld: -Tinterleave.ld
+#objcopy: --interleave=8 --interleave-width=1 --byte=0 -O verilog
+
+@0+0
+00
+@0+2
+14
diff --git a/ld/testsuite/ld-elf/interleave-4.d b/ld/testsuite/ld-elf/interleave-4.d
new file mode 100644
index 0000000..a4bb808
--- /dev/null
+++ b/ld/testsuite/ld-elf/interleave-4.d
@@ -0,0 +1,9 @@
+#name: --interleave test byte 4
+#source: interleave.s
+#ld: -Tinterleave.ld
+#objcopy: --interleave=8 --interleave-width=1 --byte=4 -O verilog
+
+@0+0
+04
+@0+1
+10
diff --git a/ld/testsuite/ld-elf/interleave.ld b/ld/testsuite/ld-elf/interleave.ld
new file mode 100644
index 0000000..6406166
--- /dev/null
+++ b/ld/testsuite/ld-elf/interleave.ld
@@ -0,0 +1,10 @@
+MEMORY
+{
+ x0(xrw): ORIGIN = 0x0, LENGTH = 8
+ x1(xrw): ORIGIN = 0xC, LENGTH = 8
+}
+SECTIONS
+{
+ .a0 : { *(.text.a0) } > x0
+ .a1 : { *(.text.a1) } > x1
+}
diff --git a/ld/testsuite/ld-elf/interleave.s b/ld/testsuite/ld-elf/interleave.s
new file mode 100644
index 0000000..490aa59
--- /dev/null
+++ b/ld/testsuite/ld-elf/interleave.s
@@ -0,0 +1,18 @@
+ .section ".text.a0"
+ .byte 0x00
+ .byte 0x01
+ .byte 0x02
+ .byte 0x03
+ .byte 0x04
+ .byte 0x05
+ .byte 0x06
+ .byte 0x07
+ .section ".text.a1"
+ .byte 0x10
+ .byte 0x11
+ .byte 0x12
+ .byte 0x13
+ .byte 0x14
+ .byte 0x15
+ .byte 0x16
+ .byte 0x17