userspace: get rid of app section placeholders

We used to leave byte-long placeholder symbols to ensure
that empty application memory sections did not cause
build errors that were very difficult to understand.

Now we use some relatively portable inline assembly to
generate a symbol, but don't take up any extra space.

The malloc and libc partitions are now only instantiated
if there is some data to put in them.

Fixes: #13923

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2019-02-27 20:12:40 -08:00 committed by Andrew Boie
commit 7707060959
5 changed files with 53 additions and 8 deletions

View file

@ -301,11 +301,15 @@ void main(void)
{
#ifdef CONFIG_USERSPACE
struct k_mem_partition *parts[] = {
&ztest_mem_partition,
#ifdef Z_LIBC_PARTITION_EXISTS
/* C library globals, stack canary storage, etc */
&z_libc_partition,
#endif
#ifdef Z_MALLOC_PARTITION_EXISTS
/* Required for access to malloc arena */
&z_malloc_partition
&z_malloc_partition,
#endif
&ztest_mem_partition
};
/* Ztests just have one memory domain with one partition.