Skip to content

Commit

Permalink
posix: linker: Wrap rodata and rwdata in sections.
Browse files Browse the repository at this point in the history
* zephyr_linker_sources states that RODATA and RWDATA
  included will be wrapped in an outer section, so
  add these sections for the posix arch too.

Signed-off-by: Pete Johanson <[email protected]>
  • Loading branch information
petejohanson authored and aescolar committed Aug 13, 2020
1 parent af0b109 commit b51eeb0
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions include/arch/posix/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,37 @@
SECTIONS
{

SECTION_PROLOGUE(romstart_snippet,,)
{
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-rom-start.ld>
}

#include <linker/common-rom.ld>

SECTION_PROLOGUE(rodata_snippet,,)
{

/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-rodata.ld>
}
} INSERT AFTER .rodata;

SECTIONS
{

SECTION_DATA_PROLOGUE(data_snippet,,)
{

/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-rwdata.ld>
}

#include <linker/common-ram.ld>

Expand All @@ -48,12 +63,13 @@ SECTIONS

#include <arch/posix/native_tasks.ld>

__data_ram_end = .;

SECTION_DATA_PROLOGUE(noinit_snippet,,)
{
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-noinit.ld>
}

/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
Expand Down

0 comments on commit b51eeb0

Please sign in to comment.