This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] .fill does not accept forward labels


On 10/09/2017 08:40 PM, Maciej W. Rozycki wrote:
...
>  Please verify it suitably; offhand I smell endianness related problems 
> with this pattern, but there can be other peculiarities with some targets.  

It is endianess-safe. That's why I've chosen patterns with duplicate bytes. It was already tested on
s390 32/64 (big endian) and x86_64. I've now also tested it on mips64, aarch64 and ppc64.

...

>  If verifying actual output, then I suggest using `dc.w' instead.  With 
> MIPS targets for example `.word' will produce 32-bit quantities.

Ok. I couldn't find .dc described in the gas manual. The only hit comes from the S/390 gas doc with
the very helpful statement: "A small subset of the usual DC directive is supported." :)

What about .2byte ? Would that be preferrable in any way?

Whatever ...

diff --git a/gas/testsuite/gas/all/fill-1.d b/gas/testsuite/gas/all/fill-1.d
new file mode 100644
index 0000000..0402245
--- /dev/null
+++ b/gas/testsuite/gas/all/fill-1.d
@@ -0,0 +1,8 @@
+#objdump: -s -j .data
+#name: fill test with forward labels
+
+.*: +file format .*
+
+Contents of section .data:
+ [^ ]* 0a0a0d0d 0b0b0d0d .*
+
diff --git a/gas/testsuite/gas/all/fill-1.s b/gas/testsuite/gas/all/fill-1.s
index e72cbf1..4981c39 100644
--- a/gas/testsuite/gas/all/fill-1.s
+++ b/gas/testsuite/gas/all/fill-1.s
@@ -1,5 +1,7 @@
-       .text
-       .fill (2f-1f), 1, 0x90
+       .data
+       .dc.w 0x0a0a
+       .fill (2f-1f), 1, 0x0d
 1:
-        .word 42


+       .dc.w 0x0b0b


 2:


+       .dc.w 0x0d0d


diff --git a/gas/testsuite/gas/all/gas.exp b/gas/testsuite/gas/all/gas.exp


index 93e31da..1810ef4 100644


--- a/gas/testsuite/gas/all/gas.exp


+++ b/gas/testsuite/gas/all/gas.exp


@@ -487,4 +487,4 @@ run_dump_test "org-4"


 run_dump_test "org-5"


 run_dump_test "org-6"





-gas_test "fill-1.s" "" "" "test .fill forward label references"


+run_dump_test "fill-1"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]