Skip to content

Commit

Permalink
Merge pull request #137 from sifive/ramrodata-text-itim
Browse files Browse the repository at this point in the history
Link non-init text into ITIM with the ramrodata layout
  • Loading branch information
nategraff-sifive committed Aug 13, 2019
2 parents 232e503 + 8bf39d0 commit 2f54f3d
Show file tree
Hide file tree
Showing 16 changed files with 252 additions and 39 deletions.
4 changes: 4 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ freedom_ldscript_generator_SOURCES = \
linker_script/sections/ctors_group.h \
linker_script/sections/data_group.c++ \
linker_script/sections/data_group.h \
linker_script/sections/init_text_group.c++ \
linker_script/sections/init_text_group.h \
linker_script/sections/itim_text_group.c++ \
linker_script/sections/itim_text_group.h \
linker_script/sections/itim_group.c++ \
linker_script/sections/itim_group.h \
linker_script/sections/rodata_group.c++ \
Expand Down
42 changes: 42 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ am_freedom_ldscript_generator_OBJECTS = \
linker_script/sections/freedom_ldscript_generator-constants_group.$(OBJEXT) \
linker_script/sections/freedom_ldscript_generator-ctors_group.$(OBJEXT) \
linker_script/sections/freedom_ldscript_generator-data_group.$(OBJEXT) \
linker_script/sections/freedom_ldscript_generator-init_text_group.$(OBJEXT) \
linker_script/sections/freedom_ldscript_generator-itim_text_group.$(OBJEXT) \
linker_script/sections/freedom_ldscript_generator-itim_group.$(OBJEXT) \
linker_script/sections/freedom_ldscript_generator-rodata_group.$(OBJEXT) \
linker_script/sections/freedom_ldscript_generator-text_group.$(OBJEXT) \
Expand Down Expand Up @@ -618,6 +620,10 @@ freedom_ldscript_generator_SOURCES = \
linker_script/sections/ctors_group.h \
linker_script/sections/data_group.c++ \
linker_script/sections/data_group.h \
linker_script/sections/init_text_group.c++ \
linker_script/sections/init_text_group.h \
linker_script/sections/itim_text_group.c++ \
linker_script/sections/itim_text_group.h \
linker_script/sections/itim_group.c++ \
linker_script/sections/itim_group.h \
linker_script/sections/rodata_group.c++ \
Expand Down Expand Up @@ -948,6 +954,12 @@ linker_script/sections/freedom_ldscript_generator-ctors_group.$(OBJEXT): \
linker_script/sections/freedom_ldscript_generator-data_group.$(OBJEXT): \
linker_script/sections/$(am__dirstamp) \
linker_script/sections/$(DEPDIR)/$(am__dirstamp)
linker_script/sections/freedom_ldscript_generator-init_text_group.$(OBJEXT): \
linker_script/sections/$(am__dirstamp) \
linker_script/sections/$(DEPDIR)/$(am__dirstamp)
linker_script/sections/freedom_ldscript_generator-itim_text_group.$(OBJEXT): \
linker_script/sections/$(am__dirstamp) \
linker_script/sections/$(DEPDIR)/$(am__dirstamp)
linker_script/sections/freedom_ldscript_generator-itim_group.$(OBJEXT): \
linker_script/sections/$(am__dirstamp) \
linker_script/sections/$(DEPDIR)/$(am__dirstamp)
Expand Down Expand Up @@ -1164,7 +1176,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-constants_group.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-ctors_group.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-data_group.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-init_text_group.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-itim_group.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-itim_text_group.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-rodata_group.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-text_group.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-uninit_group.Po@am__quote@
Expand Down Expand Up @@ -1392,6 +1406,34 @@ linker_script/sections/freedom_ldscript_generator-data_group.obj: linker_script/
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_ldscript_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o linker_script/sections/freedom_ldscript_generator-data_group.obj `if test -f 'linker_script/sections/data_group.c++'; then $(CYGPATH_W) 'linker_script/sections/data_group.c++'; else $(CYGPATH_W) '$(srcdir)/linker_script/sections/data_group.c++'; fi`

linker_script/sections/freedom_ldscript_generator-init_text_group.o: linker_script/sections/init_text_group.c++
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_ldscript_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT linker_script/sections/freedom_ldscript_generator-init_text_group.o -MD -MP -MF linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-init_text_group.Tpo -c -o linker_script/sections/freedom_ldscript_generator-init_text_group.o `test -f 'linker_script/sections/init_text_group.c++' || echo '$(srcdir)/'`linker_script/sections/init_text_group.c++
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-init_text_group.Tpo linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-init_text_group.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='linker_script/sections/init_text_group.c++' object='linker_script/sections/freedom_ldscript_generator-init_text_group.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_ldscript_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o linker_script/sections/freedom_ldscript_generator-init_text_group.o `test -f 'linker_script/sections/init_text_group.c++' || echo '$(srcdir)/'`linker_script/sections/init_text_group.c++

linker_script/sections/freedom_ldscript_generator-init_text_group.obj: linker_script/sections/init_text_group.c++
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_ldscript_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT linker_script/sections/freedom_ldscript_generator-init_text_group.obj -MD -MP -MF linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-init_text_group.Tpo -c -o linker_script/sections/freedom_ldscript_generator-init_text_group.obj `if test -f 'linker_script/sections/init_text_group.c++'; then $(CYGPATH_W) 'linker_script/sections/init_text_group.c++'; else $(CYGPATH_W) '$(srcdir)/linker_script/sections/init_text_group.c++'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-init_text_group.Tpo linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-init_text_group.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='linker_script/sections/init_text_group.c++' object='linker_script/sections/freedom_ldscript_generator-init_text_group.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_ldscript_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o linker_script/sections/freedom_ldscript_generator-init_text_group.obj `if test -f 'linker_script/sections/init_text_group.c++'; then $(CYGPATH_W) 'linker_script/sections/init_text_group.c++'; else $(CYGPATH_W) '$(srcdir)/linker_script/sections/init_text_group.c++'; fi`

linker_script/sections/freedom_ldscript_generator-itim_text_group.o: linker_script/sections/itim_text_group.c++
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_ldscript_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT linker_script/sections/freedom_ldscript_generator-itim_text_group.o -MD -MP -MF linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-itim_text_group.Tpo -c -o linker_script/sections/freedom_ldscript_generator-itim_text_group.o `test -f 'linker_script/sections/itim_text_group.c++' || echo '$(srcdir)/'`linker_script/sections/itim_text_group.c++
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-itim_text_group.Tpo linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-itim_text_group.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='linker_script/sections/itim_text_group.c++' object='linker_script/sections/freedom_ldscript_generator-itim_text_group.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_ldscript_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o linker_script/sections/freedom_ldscript_generator-itim_text_group.o `test -f 'linker_script/sections/itim_text_group.c++' || echo '$(srcdir)/'`linker_script/sections/itim_text_group.c++

linker_script/sections/freedom_ldscript_generator-itim_text_group.obj: linker_script/sections/itim_text_group.c++
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_ldscript_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT linker_script/sections/freedom_ldscript_generator-itim_text_group.obj -MD -MP -MF linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-itim_text_group.Tpo -c -o linker_script/sections/freedom_ldscript_generator-itim_text_group.obj `if test -f 'linker_script/sections/itim_text_group.c++'; then $(CYGPATH_W) 'linker_script/sections/itim_text_group.c++'; else $(CYGPATH_W) '$(srcdir)/linker_script/sections/itim_text_group.c++'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-itim_text_group.Tpo linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-itim_text_group.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='linker_script/sections/itim_text_group.c++' object='linker_script/sections/freedom_ldscript_generator-itim_text_group.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_ldscript_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o linker_script/sections/freedom_ldscript_generator-itim_text_group.obj `if test -f 'linker_script/sections/itim_text_group.c++'; then $(CYGPATH_W) 'linker_script/sections/itim_text_group.c++'; else $(CYGPATH_W) '$(srcdir)/linker_script/sections/itim_text_group.c++'; fi`

linker_script/sections/freedom_ldscript_generator-itim_group.o: linker_script/sections/itim_group.c++
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_ldscript_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT linker_script/sections/freedom_ldscript_generator-itim_group.o -MD -MP -MF linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-itim_group.Tpo -c -o linker_script/sections/freedom_ldscript_generator-itim_group.o `test -f 'linker_script/sections/itim_group.c++' || echo '$(srcdir)/'`linker_script/sections/itim_group.c++
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-itim_group.Tpo linker_script/sections/$(DEPDIR)/freedom_ldscript_generator-itim_group.Po
Expand Down
20 changes: 10 additions & 10 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for freedom-devicetree-tools v201905-47-g8fe9e99.
# Generated by GNU Autoconf 2.69 for freedom-devicetree-tools v201905-59-g57ad662.
#
# Report bugs to <bsou@sifive.com>.
#
Expand Down Expand Up @@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='freedom-devicetree-tools'
PACKAGE_TARNAME='freedom-devicetree-tools'
PACKAGE_VERSION='v201905-47-g8fe9e99'
PACKAGE_STRING='freedom-devicetree-tools v201905-47-g8fe9e99'
PACKAGE_VERSION='v201905-59-g57ad662'
PACKAGE_STRING='freedom-devicetree-tools v201905-59-g57ad662'
PACKAGE_BUGREPORT='bsou@sifive.com'
PACKAGE_URL=''

Expand Down Expand Up @@ -1291,7 +1291,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures freedom-devicetree-tools v201905-47-g8fe9e99 to adapt to many kinds of systems.
\`configure' configures freedom-devicetree-tools v201905-59-g57ad662 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1359,7 +1359,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of freedom-devicetree-tools v201905-47-g8fe9e99:";;
short | recursive ) echo "Configuration of freedom-devicetree-tools v201905-59-g57ad662:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1455,7 +1455,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
freedom-devicetree-tools configure v201905-47-g8fe9e99
freedom-devicetree-tools configure v201905-59-g57ad662
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1795,7 +1795,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by freedom-devicetree-tools $as_me v201905-47-g8fe9e99, which was
It was created by freedom-devicetree-tools $as_me v201905-59-g57ad662, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -2662,7 +2662,7 @@ fi
# Define the identity of the package.
PACKAGE='freedom-devicetree-tools'
VERSION='v201905-47-g8fe9e99'
VERSION='v201905-59-g57ad662'
cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -5768,7 +5768,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by freedom-devicetree-tools $as_me v201905-47-g8fe9e99, which was
This file was extended by freedom-devicetree-tools $as_me v201905-59-g57ad662, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -5825,7 +5825,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
freedom-devicetree-tools config.status v201905-47-g8fe9e99
freedom-devicetree-tools config.status v201905-59-g57ad662
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
4 changes: 4 additions & 0 deletions linker_script/layouts/default_layout.c++
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <sections/constants_group.h>
#include <sections/ctors_group.h>
#include <sections/data_group.h>
#include <sections/init_text_group.h>
#include <sections/itim_group.h>
#include <sections/rodata_group.h>
#include <sections/text_group.h>
Expand All @@ -30,6 +31,9 @@ DefaultLayout::DefaultLayout(const fdt &dtb, Memory rom_memory, Memory itim_memo

section_groups.push_back(ConstantsGroup(dtb));

section_groups.push_back(InitTextGroup(rom_memory, rom_phdr, /* Text sections are loaded from ROM */
rom_memory, rom_phdr)); /* And stay in ROM when mapped */

section_groups.push_back(TextGroup(rom_memory, rom_phdr, /* Text sections are loaded from ROM */
rom_memory, rom_phdr)); /* And stay in ROM when mapped */

Expand Down
49 changes: 38 additions & 11 deletions linker_script/layouts/ramrodata_layout.c++
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#include <sections/constants_group.h>
#include <sections/ctors_group.h>
#include <sections/data_group.h>
#include <sections/init_text_group.h>
#include <sections/itim_group.h>
#include <sections/itim_text_group.h>
#include <sections/rodata_group.h>
#include <sections/text_group.h>
#include <sections/uninit_group.h>
Expand All @@ -28,21 +30,46 @@ RamrodataLayout::RamrodataLayout(const fdt &dtb, Memory rom_memory, Memory itim_
program_headers.push_back(itim_phdr);
program_headers.push_back(itim_init_phdr);

section_groups.push_back(ConstantsGroup(dtb));
if (itim_memory.size >= MAGIC_RAMRODATA_TEXT_THRESHOLD) {
section_groups.push_back(ConstantsGroup(dtb));

section_groups.push_back(TextGroup(rom_memory, rom_phdr, /* Text sections are loaded from ROM */
rom_memory, rom_phdr)); /* And stay in ROM when mapped */
section_groups.push_back(InitTextGroup(rom_memory, rom_phdr, /* Init code is loaded from ROM */
rom_memory, rom_phdr)); /* And stays in ROM when mapped */
section_groups.back().add_trailing_command("PROVIDE (__etext = .);");
section_groups.back().add_trailing_command("PROVIDE (_etext = .);");
section_groups.back().add_trailing_command("PROVIDE (etext = .);");

section_groups.push_back(CtorsGroup(rom_memory, rom_phdr, /* Constructors are loaded from ROM */
rom_memory, rom_phdr)); /* And stay in ROM when mapped */
section_groups.push_back(CtorsGroup(rom_memory, rom_phdr, /* Constructors are loaded from ROM */
rom_memory, rom_phdr)); /* And stay in ROM when mapped */

section_groups.push_back(ItimGroup(rom_memory, rom_phdr, /* ITIM code is loaded from ROM */
itim_memory, itim_init_phdr)); /* And is copied into the ITIM at load */
section_groups.push_back(ItimTextGroup(rom_memory, rom_phdr, /* ITIM code is loaded from ROM */
itim_memory, itim_init_phdr)); /* And is copied into the ITIM at load */

section_groups.push_back(DataGroup(rom_memory, rom_phdr, /* Data is loaded from ROM */
data_memory, ram_init_phdr)); /* And copied into the data memory at load */
section_groups.push_back(DataGroup(rom_memory, rom_phdr, /* Data is loaded from ROM */
data_memory, ram_init_phdr)); /* And copied into the data memory at load */

section_groups.push_back(UninitGroup(dtb, data_memory, ram_phdr, /* BSS and unitialized data isn't loaded from ROM */
data_memory, ram_phdr)); /* And should end up in the data memory */
section_groups.push_back(UninitGroup(dtb, data_memory, ram_phdr, /* BSS and unitialized data isn't loaded from ROM */
data_memory, ram_phdr)); /* And should end up in the data memory */
} else {
section_groups.push_back(ConstantsGroup(dtb));

section_groups.push_back(InitTextGroup(rom_memory, rom_phdr, /* Init code is loaded from ROM */
rom_memory, rom_phdr)); /* And stays in ROM when mapped */

section_groups.push_back(TextGroup(rom_memory, rom_phdr, /* Text sections are loaded from ROM */
rom_memory, rom_phdr)); /* And stay in ROM when mapped */

section_groups.push_back(CtorsGroup(rom_memory, rom_phdr, /* Constructors are loaded from ROM */
rom_memory, rom_phdr)); /* And stay in ROM when mapped */

section_groups.push_back(ItimGroup(rom_memory, rom_phdr, /* ITIM code is loaded from ROM */
itim_memory, itim_init_phdr)); /* And is copied into the ITIM at load */

section_groups.push_back(DataGroup(rom_memory, rom_phdr, /* Data is loaded from ROM */
data_memory, ram_init_phdr)); /* And copied into the data memory at load */

section_groups.push_back(UninitGroup(dtb, data_memory, ram_phdr, /* BSS and unitialized data isn't loaded from ROM */
data_memory, ram_phdr)); /* And should end up in the data memory */
}
}

6 changes: 6 additions & 0 deletions linker_script/layouts/ramrodata_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
using std::list;
using std::string;

/*
* MAGIC_RAMRODATA_TEXT_THRESHOLD sets the threshold size of the ITIM at or
* over which the "ramrodata" layout places the text section into the ITIM.
*/
#define MAGIC_RAMRODATA_TEXT_THRESHOLD 0x8000

class RamrodataLayout : public LinkerScript {
public:
RamrodataLayout(const fdt &dtb, Memory rom_memory, Memory itim_memory,
Expand Down

0 comments on commit 2f54f3d

Please sign in to comment.