mirror of
https://github.com/dgibson/dtc.git
synced 2026-04-12 00:47:46 -04:00
asm: Use .asciz and .ascii instead of .string
We use the .string pseudo-op both in some of our test assembly files and in our -Oasm output. We expect this to emit a \0 terminated string into the .o file. However for certain targets (e.g. HP PA-RISC) it doesn't include the \0. Use .asciz instead, which explicitly does what we want. There's also one place we can use .ascii (which explicitly emits a string *without* \0 termination) instead of multiple .byte directives. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
5eb5927d81
commit
ff3a30c115
6 changed files with 75 additions and 77 deletions
|
|
@ -32,7 +32,7 @@ _dt_reserve_map:
|
|||
dt_struct_start:
|
||||
_dt_struct_start:
|
||||
.long OF_DT_BEGIN_NODE
|
||||
.string ""
|
||||
.asciz ""
|
||||
.balign 4
|
||||
.long OF_DT_PROP
|
||||
.long 0xa
|
||||
|
|
@ -58,7 +58,7 @@ _dt_struct_start:
|
|||
.long 0x2
|
||||
.balign 4
|
||||
.long OF_DT_BEGIN_NODE
|
||||
.string "memory@0"
|
||||
.asciz "memory@0"
|
||||
.balign 4
|
||||
.long OF_DT_PROP
|
||||
.long 0x7
|
||||
|
|
@ -77,7 +77,7 @@ _dt_struct_start:
|
|||
.balign 4
|
||||
.long OF_DT_END_NODE
|
||||
.long OF_DT_BEGIN_NODE
|
||||
.string "cpus"
|
||||
.asciz "cpus"
|
||||
.balign 4
|
||||
.long OF_DT_PROP
|
||||
.long 0x4
|
||||
|
|
@ -151,22 +151,22 @@ _dt_struct_end:
|
|||
.globl dt_strings_start
|
||||
dt_strings_start:
|
||||
_dt_strings_start:
|
||||
.string "model"
|
||||
.string "compatible"
|
||||
.string "#address-cells"
|
||||
.string "#size-cells"
|
||||
.string "device_type"
|
||||
.string "reg"
|
||||
.string "d10"
|
||||
.string "d23"
|
||||
.string "b101"
|
||||
.string "o17"
|
||||
.string "hd00d"
|
||||
.string "stuff"
|
||||
.string "bad-d-1"
|
||||
.string "bad-d-2"
|
||||
.string "bad-o-1"
|
||||
.string "bad-o-2"
|
||||
.asciz "model"
|
||||
.asciz "compatible"
|
||||
.asciz "#address-cells"
|
||||
.asciz "#size-cells"
|
||||
.asciz "device_type"
|
||||
.asciz "reg"
|
||||
.asciz "d10"
|
||||
.asciz "d23"
|
||||
.asciz "b101"
|
||||
.asciz "o17"
|
||||
.asciz "hd00d"
|
||||
.asciz "stuff"
|
||||
.asciz "bad-d-1"
|
||||
.asciz "bad-d-2"
|
||||
.asciz "bad-o-1"
|
||||
.asciz "bad-o-2"
|
||||
.globl dt_strings_end
|
||||
dt_strings_end:
|
||||
_dt_strings_end:
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ _dt_reserve_map:
|
|||
dt_struct_start:
|
||||
_dt_struct_start:
|
||||
.long OF_DT_BEGIN_NODE
|
||||
.string ""
|
||||
.asciz ""
|
||||
.balign 4
|
||||
.long OF_DT_PROP
|
||||
.long 0xc
|
||||
|
|
@ -76,7 +76,7 @@ _dt_struct_start:
|
|||
.long 0x2
|
||||
.balign 4
|
||||
.long OF_DT_BEGIN_NODE
|
||||
.string "cpus"
|
||||
.asciz "cpus"
|
||||
.balign 4
|
||||
.long OF_DT_PROP
|
||||
.long 0x4
|
||||
|
|
@ -94,7 +94,7 @@ _dt_struct_start:
|
|||
.long 0x0
|
||||
.balign 4
|
||||
.long OF_DT_BEGIN_NODE
|
||||
.string "PowerPC,970@0"
|
||||
.asciz "PowerPC,970@0"
|
||||
.balign 4
|
||||
.long OF_DT_PROP
|
||||
.long 0xc
|
||||
|
|
@ -139,7 +139,7 @@ _dt_struct_start:
|
|||
.balign 4
|
||||
.long OF_DT_END_NODE
|
||||
.long OF_DT_BEGIN_NODE
|
||||
.string "PowerPC,970@1"
|
||||
.asciz "PowerPC,970@1"
|
||||
.balign 4
|
||||
.long OF_DT_PROP
|
||||
.long 0xc
|
||||
|
|
@ -181,7 +181,7 @@ _dt_struct_start:
|
|||
.long OF_DT_END_NODE
|
||||
.long OF_DT_END_NODE
|
||||
.long OF_DT_BEGIN_NODE
|
||||
.string "randomnode"
|
||||
.asciz "randomnode"
|
||||
.balign 4
|
||||
.long OF_DT_PROP
|
||||
.long 0x13
|
||||
|
|
@ -216,7 +216,7 @@ _dt_struct_start:
|
|||
.balign 4
|
||||
.long OF_DT_END_NODE
|
||||
.long OF_DT_BEGIN_NODE
|
||||
.string "memory@0"
|
||||
.asciz "memory@0"
|
||||
.balign 4
|
||||
.long OF_DT_PROP
|
||||
.long 0x7
|
||||
|
|
@ -242,7 +242,7 @@ memreg:
|
|||
.balign 4
|
||||
.long OF_DT_END_NODE
|
||||
.long OF_DT_BEGIN_NODE
|
||||
.string "chosen"
|
||||
.asciz "chosen"
|
||||
.balign 4
|
||||
.long OF_DT_PROP
|
||||
.long 0xf
|
||||
|
|
@ -267,25 +267,25 @@ _dt_struct_end:
|
|||
.globl dt_strings_start
|
||||
dt_strings_start:
|
||||
_dt_strings_start:
|
||||
.string "model"
|
||||
.string "compatible"
|
||||
.string "#address-cells"
|
||||
.string "#size-cells"
|
||||
.string "linux,phandle"
|
||||
.string "name"
|
||||
.string "device_type"
|
||||
.string "reg"
|
||||
.string "clock-frequency"
|
||||
.string "timebase-frequency"
|
||||
.string "linux,boot-cpu"
|
||||
.string "i-cache-size"
|
||||
.string "d-cache-size"
|
||||
.string "string"
|
||||
.string "blob"
|
||||
.string "ref"
|
||||
.string "mixed"
|
||||
.string "bootargs"
|
||||
.string "linux,platform"
|
||||
.asciz "model"
|
||||
.asciz "compatible"
|
||||
.asciz "#address-cells"
|
||||
.asciz "#size-cells"
|
||||
.asciz "linux,phandle"
|
||||
.asciz "name"
|
||||
.asciz "device_type"
|
||||
.asciz "reg"
|
||||
.asciz "clock-frequency"
|
||||
.asciz "timebase-frequency"
|
||||
.asciz "linux,boot-cpu"
|
||||
.asciz "i-cache-size"
|
||||
.asciz "d-cache-size"
|
||||
.asciz "string"
|
||||
.asciz "blob"
|
||||
.asciz "ref"
|
||||
.asciz "mixed"
|
||||
.asciz "bootargs"
|
||||
.asciz "linux,platform"
|
||||
.globl dt_strings_end
|
||||
dt_strings_end:
|
||||
_dt_strings_end:
|
||||
|
|
|
|||
|
|
@ -54,13 +54,13 @@ tree##_rsvmap_end: ;
|
|||
#define PROP_STR(tree, name, str) \
|
||||
PROPHDR(tree, name, 55f - 54f) \
|
||||
54: \
|
||||
.string str ; \
|
||||
.asciz str ; \
|
||||
55: \
|
||||
.balign 4 ;
|
||||
|
||||
#define BEGIN_NODE(name) \
|
||||
FDTLONG(FDT_BEGIN_NODE) ; \
|
||||
.string name ; \
|
||||
.asciz name ; \
|
||||
.balign 4 ;
|
||||
|
||||
#define END_NODE \
|
||||
|
|
@ -68,7 +68,7 @@ tree##_rsvmap_end: ;
|
|||
|
||||
#define STRING(tree, name, str) \
|
||||
tree##_##name: ; \
|
||||
.string str ;
|
||||
.asciz str ;
|
||||
|
||||
.data
|
||||
|
||||
|
|
@ -253,9 +253,7 @@ truncated_string_struct_end:
|
|||
truncated_string_strings:
|
||||
STRING(truncated_string, good_string, "good")
|
||||
truncated_string_bad_string:
|
||||
.byte 'b'
|
||||
.byte 'a'
|
||||
.byte 'd'
|
||||
.ascii "bad"
|
||||
/* NOTE: terminating \0 deliberately missing */
|
||||
truncated_string_strings_end:
|
||||
truncated_string_end:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue