public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Mandeep Sandhu <mandeepsandhu.chd@gmail.com>
To: Bart Veer <bartv@ecoscentric.com>
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] strange size issue (i386 vs ARM)
Date: Thu, 01 Oct 2009 15:00:00 -0000	[thread overview]
Message-ID: <b18c5f790910010800q1d33bb0ic4917bbf670adfb0@mail.gmail.com> (raw)
In-Reply-To: <pnzl8btckp.fsf@delenn.bartv.net>

On Thu, Oct 1, 2009 at 7:56 PM, Bart Veer <bartv@ecoscentric.com> wrote:
>>>>>> "Mandeep" == Mandeep Sandhu <mandeepsandhu.chd@gmail.com> writes:
>
>    Mandeep> Look at the size output for the _same_ app compiled with
>    Mandeep> the Linux Synthetic target:
>
>    Mandeep> $ i386-elf-size myapp
>    Mandeep>    text       data     bss     dec     hex filename
>    Mandeep>  103690       7328 8381268 8492286  8194fe myapp
>
>    Mandeep> The text size of the ARM binary (~127KB) is
>    Mandeep> understandably larger than the i386 one (~102 KB).
>
>    Mandeep> But how come the data+bss value is so different!?!? The
>    Mandeep> i386 one is more than 8MB!
>
>    Mandeep> Is this expected? I'm still googling to find the answer.
>
> On real embedded targets the memory is physical. Not so on the
> synthetic target. Somehow or other the executable's ELF header info
> must tell the Linux OS to allocate 8MB of memory for the emulated
> target's RAM. Without that things like malloc() would not work, at
> least not without playing nasty games with mmap() at run-time. The
> easiest way to make things work is to make it seem like data+bss
> occupy all of 8MB, irrespective of the application's actual static
> data requirements. The surplus over 8MB reported by size is likely to
> be const data and the like which the linker script places in the
> read-only code region.
>
> This could probably be fixed if it was really necessary, but it would
> be non-trivial and I don't recall anybody reporting the issue in the
> past. Generally memory usage on the synthetic target will not give an
> accurate indication of memory usage on real targets because of the
> need for much larger stack sizes etc. - I won't go into all the
> unpleasant details.

Thanks Bart. This explains it. It's not an issue for me, was just
curious to know.

Regards,
-mandeep

>
> Bart
>
> --
> Bart Veer                                   eCos Configuration Architect
> eCosCentric Limited    The eCos experts      http://www.ecoscentric.com/
> Barnwell House, Barnwell Drive, Cambridge, UK.      Tel: +44 1223 245571
> Registered in England and Wales: Reg No 4422071.
>       >>>> Visit us at ESC-UK  http://www.embedded.co.uk <<<<
>       >>>> Oct 7-8 on Stand 433 at FIVE ISC, Farnborough <<<<
>

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

      reply	other threads:[~2009-10-01 15:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-01 13:10 Mandeep Sandhu
2009-10-01 13:32 ` Simon Kallweit
2009-10-01 14:26 ` Bart Veer
2009-10-01 15:00   ` Mandeep Sandhu [this message]

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=b18c5f790910010800q1d33bb0ic4917bbf670adfb0@mail.gmail.com \
    --to=mandeepsandhu.chd@gmail.com \
    --cc=bartv@ecoscentric.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    /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).