public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Robert Cragie" <rcc@jennic.com>
To: <ecos-discuss@sources.redhat.com>
Subject: [ECOS] Declaring new section
Date: Fri, 10 Aug 2001 03:40:00 -0000	[thread overview]
Message-ID: <NDBBLOIOMLKELOJBAPAGGEBDCIAA.rcc@jennic.com> (raw)

I needed to declare a new section for a specific SRAM device on my board. I
did this by the adding the following lines in the .ldi file:

// eCos memory layout - Tue Feb 29 14:25:49 2000

// This is a generated file - do not edit

#include <cyg/infra/cyg_type.inc>

MEMORY
{
    ram : ORIGIN = 0, LENGTH = 0x4000000
    rom : ORIGIN = 0x24000000, LENGTH = 0x80000
Added this line --->        sram : ORIGIN = 0x28001000, LENGTH = 0x0003F000
}

SECTIONS
{
    SECTIONS_BEGIN
    SECTION_rom_vectors (rom, 0x24000000, LMA_EQ_VMA)
    SECTION_text (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_fini (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_rodata (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_rodata1 (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_fixup (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_gcc_except_table (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_fixed_vectors (ram, 0x20, LMA_EQ_VMA)
    SECTION_data (ram, 0x800, FOLLOWING (.gcc_except_table))
    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
    CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
Added this line --->    SECTION_sram (sram, 0x28001000, LMA_EQ_VMA)
    SECTIONS_END
}

This worked fine, but when I came to generate an S-record file (using
"arm-elf-objcopy -S -O srec myfile myfile.srec") for downloading, it added
in loads of S-records at 0x28000000, all 0. This screws up the ARM Boot
Monitor flash downloader, as it somehow assumes these should go where the
flash is at 0x24000000. I noticed that the .sram section (according to
"arm-elf-objdump -h myfile") is of type CONTENTS, ALLOC, LOAD, DATA.

There is obviously a bit of magick going on between the .ldi file and
target.ld - is there any way I can make the .sram section like the .bss
section, i.e. so it is cleared to zero and doesn't appear as downloadable?

Also, whilst we're on the subject, is there anyway to link in .a files
without having to physically include them in target.ld?

TIA

Robert Cragie
Design Engineer
Jennic Ltd.
Furnival Street
Sheffield
S1 4QT
United Kingdom
Tel: +44 (0) 114 281 4512
Fax: +44 (0) 114 281 2951
Mob: +44 (0) 7940 558520
mailto:rcc@jennic.com
http://www.jennic.com

             reply	other threads:[~2001-08-10  3:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-10  3:40 Robert Cragie [this message]
2001-08-10  3:45 ` Andrew Lunn
2001-08-10 10:03 ` Jonathan Larmour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=NDBBLOIOMLKELOJBAPAGGEBDCIAA.rcc@jennic.com \
    --to=rcc@jennic.com \
    --cc=ecos-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).