Loading ...
Sorry, an error occurred while loading the content.

Re: data_image

Expand Messages
  • peter_lingier
    With your mail, I got the idea to put the dataimage, data section, bss section, directly on the place where the RAM is. At 2000h. I set the __data_image equal
    Message 1 of 6 , Dec 1, 2004
    • 0 Attachment
      With your mail, I got the idea to put the dataimage, data section,
      bss section, directly on the place where the RAM is. At 2000h.

      I set the __data_image equal to the __data_image_end, and I set the
      __data_section_size on zero. So, after the _premain nothing is
      copied over from ROM to RAM (loop checks on __data_section_size ).

      In my makefile I don't do an OBJCOPY of the .data and the .bss
      section anymore.

      This method is working and gives me lots of free space in the common
      bank (page 3F) now, where else the data_image was placed.

      I limited the size of the .data section from 2000h to 1A00h in the
      MEMORY declaration, to have some margin for stackcollision with the
      data.

      Thanks for the replies.

      Peter.

      --- In gnu-m68hc11@yahoogroups.com, "Jefferson Smith"
      <imajeffs@h...> wrote:
      >
      > One thing that makes it the data image is the gcc startup code,
      which
      > looks for it and copies it to RAM.
      >
      > The other is that section .data is being appended to text (ROM)
      region
      > by the linker script.
      >
      > In m68hc12elfb.x:
      > -------------
      > /* Start of the data section image in ROM. */
      > __data_image = .;
      > PROVIDE (__data_image = .);
      > /* All read-only sections that normally go in PROM must be above.
      > We construct the DATA image section in PROM at end of all
      these
      > read-only sections. The data image must be copied at init
      time.
      > Refer to GNU ld, Section 3.6.8.2 Output Section LMA. */
      > .data : AT (__data_image)
      > {
      > __data_section_start = .;
      > PROVIDE (__data_section_start = .);
      > *(.sdata)
      > *(.data)
      > *(.data.*)
      > *(.data1)
      > *(.gnu.linkonce.d.*)
      > CONSTRUCTORS
      > _edata = .;
      > PROVIDE (edata = .);
      > } > data
      > __data_section_size = SIZEOF(.data);
      > PROVIDE (__data_section_size = SIZEOF(.data));
      > __data_image_end = __data_image + __data_section_size;
      > -------------
      >
      >
      > --- In gnu-m68hc11@yahoogroups.com, "peter_lingier"
      <plingier@m...> wrote:
      > >
      > > Hello,
      > >
      > > Does anyone know how to get rid of the Dataimage?
      > >
      > > This data_image is an image of the .data (global variables) I
      > > declared and is put (due to the linkerscript I use) in page 3F.
      > > After the _premain function is executed, the data_image in Flash
      RAM
      > > is copied to RAM.
      > >
      > > All global variables are initialised in the code, and not at
      > > decleration. So, I don't really need the data_image.
      > >
      > > In the DG128 I have 8k of RAM, but due to this data_image I
      can't
      > > use all of it, because I don't have that much space left in page
      3F.
      > > I had already the case that I declared too much .data to fit in
      page
      > > 3F and that I overwrote the secure bits. It seems to me that
      the
      > > linker doesn't check on bankoverflow, if it is because of the
      > > data_image.
      > >
      > > Does anyone has experience with this?
      > >
      > > Peter
    Your message has been successfully submitted and would be delivered to recipients shortly.