Skip to content

Commit c8c25b5

Browse files
yonschnashif
authored andcommitted
bindesc: Fix placing of the descriptors end tag
Prior to this fix the descriptors end tag was placed in the binary using LONG. This was wrong because the tag is of type short, and the size of the descriptor (0), should have also been placed. It so happened that on little endian machines the incorrect linker script yielded correct results, as the extra zeros added to make the value a long ended up as the correct byte sequence (FF FF 00 00). On big endian machines however, the wrong sequence is generated (00 00 FF FF). This patch correct this issue. Signed-off-by: Yonatan Schachter <[email protected]>
1 parent da87952 commit c8c25b5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

doc/services/binary_descriptors/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ Putting it all together, here is what the example above would look like in memor
6262

6363
.. code-block::
6464
65-
46 60 a4 7e 5a 3e 86 b9 02 10 0d 00 48 65 6c 6c 6f 20 77 6f 72 6c 64 21 00 00 00 00 ff ff
66-
| magic | tag |length| H e l l o w o r l d ! | pad | end |
65+
46 60 a4 7e 5a 3e 86 b9 02 10 0d 00 48 65 6c 6c 6f 20 77 6f 72 6c 64 21 00 00 00 00 ff ff 00 00
66+
| magic | tag |length| H e l l o w o r l d ! | pad | end |
6767
6868
Usage
6969
*****

subsys/bindesc/bindesc.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
SQUAD(BINDESC_MAGIC);
1111
Z_LINK_ITERABLE(bindesc_entry);
1212
. = ALIGN(BINDESC_ALIGNMENT);
13-
LONG(BINDESC_TAG_DESCRIPTORS_END)
13+
SHORT(BINDESC_TAG_DESCRIPTORS_END);
14+
SHORT(0);

0 commit comments

Comments
 (0)