11.3.1.3 String Literals as Arguments
In addition to being used as initializers, string literals may also be used as function arguments. For example:
myputs(“Enter the Dragon code:\n”)
;
Here allocation of the string literal depends on the surrounding code. If the statement appears in a boot or secure function, the literal will be allocated in a corresponding PSV constant section. Otherwise it will be placed in general (non-secure) memory, according to the constants memory model.
Recall that data stored in a secure segment cannot be read by any other
segment. For example, it is not possible to call the standard C library function
puts()
with a string that has been allocated in a secure segment.
Therefore literals which appear as function arguments can only be passed to functions in
the same security segment. This is also true for objects referenced by pointers and
arrays. Simple scalar types such as char
, int
, and
float
, which are passed by value, may be passed to functions in
different segments.